| 1 |
|
|
| 2 |
|
|
| 3 |
|
|
| 4 |
|
|
| 5 |
|
|
| 6 |
|
|
| 7 |
|
|
| 8 |
|
|
| 9 |
|
|
| 10 |
|
|
| 11 |
|
|
| 12 |
|
|
| 13 |
|
|
| 14 |
|
|
| 15 |
|
|
| 16 |
|
|
| 17 |
|
|
| 18 |
|
|
| 19 |
|
|
| 20 |
|
package org.xwiki.extension.script.internal.safe; |
| 21 |
|
|
| 22 |
|
import org.xwiki.context.Execution; |
| 23 |
|
import org.xwiki.extension.Extension; |
| 24 |
|
import org.xwiki.extension.ExtensionDependency; |
| 25 |
|
import org.xwiki.extension.ExtensionId; |
| 26 |
|
import org.xwiki.extension.repository.ExtensionRepository; |
| 27 |
|
import org.xwiki.extension.repository.ExtensionRepositoryDescriptor; |
| 28 |
|
import org.xwiki.extension.repository.ExtensionRepositoryId; |
| 29 |
|
import org.xwiki.extension.repository.result.IterableResult; |
| 30 |
|
import org.xwiki.extension.version.Version; |
| 31 |
|
import org.xwiki.script.internal.safe.ScriptSafeProvider; |
| 32 |
|
|
| 33 |
|
|
| 34 |
|
|
| 35 |
|
|
| 36 |
|
@param |
| 37 |
|
@version |
| 38 |
|
@since |
| 39 |
|
|
| |
|
| 69.2% |
Uncovered Elements: 8 (26) |
Complexity: 10 |
Complexity Density: 0.53 |
|
| 40 |
|
public class SafeExtensionRepository<T extends ExtensionRepository> extends AbstractNoExceptionSafeObject<T> implements |
| 41 |
|
ExtensionRepository |
| 42 |
|
{ |
| 43 |
|
|
| 44 |
|
@param |
| 45 |
|
@param |
| 46 |
|
@param |
| 47 |
|
@param |
| 48 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 49 |
1620 |
public SafeExtensionRepository(T repository, ScriptSafeProvider< ? > safeProvider, Execution execution,... |
| 50 |
|
boolean hasProgrammingRight) |
| 51 |
|
{ |
| 52 |
1620 |
super(repository, safeProvider, execution, hasProgrammingRight); |
| 53 |
|
} |
| 54 |
|
|
| 55 |
|
|
| 56 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (5) |
Complexity: 2 |
Complexity Density: 0.4 |
|
| 57 |
322 |
@Override... |
| 58 |
|
public Extension resolve(ExtensionId extensionId) |
| 59 |
|
{ |
| 60 |
322 |
setError(null); |
| 61 |
|
|
| 62 |
322 |
try { |
| 63 |
322 |
return safe(getWrapped().resolve(extensionId)); |
| 64 |
|
} catch (Exception e) { |
| 65 |
169 |
setError(e); |
| 66 |
|
} |
| 67 |
|
|
| 68 |
169 |
return null; |
| 69 |
|
} |
| 70 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (5) |
Complexity: 2 |
Complexity Density: 0.4 |
|
| 71 |
105 |
@Override... |
| 72 |
|
public Extension resolve(ExtensionDependency extensionDependency) |
| 73 |
|
{ |
| 74 |
105 |
setError(null); |
| 75 |
|
|
| 76 |
105 |
try { |
| 77 |
105 |
return safe(getWrapped().resolve(extensionDependency)); |
| 78 |
|
} catch (Exception e) { |
| 79 |
37 |
setError(e); |
| 80 |
|
} |
| 81 |
|
|
| 82 |
37 |
return null; |
| 83 |
|
} |
| 84 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 85 |
3 |
@Override... |
| 86 |
|
public ExtensionRepositoryId getId() |
| 87 |
|
{ |
| 88 |
3 |
return getWrapped().getId(); |
| 89 |
|
} |
| 90 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 91 |
469 |
@Override... |
| 92 |
|
public ExtensionRepositoryDescriptor getDescriptor() |
| 93 |
|
{ |
| 94 |
469 |
return getWrapped().getDescriptor(); |
| 95 |
|
} |
| 96 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 97 |
0 |
@Override... |
| 98 |
|
public boolean exists(ExtensionId extensionId) |
| 99 |
|
{ |
| 100 |
0 |
return getWrapped().exists(extensionId); |
| 101 |
|
} |
| 102 |
|
|
| |
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 2 |
Complexity Density: 0.4 |
|
| 103 |
0 |
@Override... |
| 104 |
|
public IterableResult<Version> resolveVersions(String id, int offset, int nb) |
| 105 |
|
{ |
| 106 |
0 |
setError(null); |
| 107 |
|
|
| 108 |
0 |
try { |
| 109 |
0 |
return getWrapped().resolveVersions(id, offset, nb); |
| 110 |
|
} catch (Exception e) { |
| 111 |
0 |
setError(e); |
| 112 |
|
} |
| 113 |
|
|
| 114 |
0 |
return null; |
| 115 |
|
} |
| 116 |
|
} |