repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
partition
stringclasses
1 value
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-xml/src/main/java/org/xwiki/xml/ExtractHandler.java
ExtractHandler.openTag
private void openTag(String qName, Attributes atts) { this.result.append('<').append(qName); for (int i = 0; i < atts.getLength(); i++) { this.result.append(' ').append(atts.getQName(i)).append("=\"").append(atts.getValue(i)).append('\"'); } this.result.append('>'); }
java
private void openTag(String qName, Attributes atts) { this.result.append('<').append(qName); for (int i = 0; i < atts.getLength(); i++) { this.result.append(' ').append(atts.getQName(i)).append("=\"").append(atts.getValue(i)).append('\"'); } this.result.append('>'); }
[ "private", "void", "openTag", "(", "String", "qName", ",", "Attributes", "atts", ")", "{", "this", ".", "result", ".", "append", "(", "'", "'", ")", ".", "append", "(", "qName", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "atts", ...
Append an open tag with the given specification to the result buffer. @param qName Tag's qualified name. @param atts Tag's attributes.
[ "Append", "an", "open", "tag", "with", "the", "given", "specification", "to", "the", "result", "buffer", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-xml/src/main/java/org/xwiki/xml/ExtractHandler.java#L169-L176
train
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-context/src/main/java/org/xwiki/context/internal/ExecutionContextProperty.java
ExecutionContextProperty.checkValue
private void checkValue(Object value) { if (this.nonNull && value == null) { throw new IllegalArgumentException(String.format("The property [%s] may not be null!", getKey())); } if (getType() != null && value != null && !getType().isAssignableFrom(value.getClass())) { ...
java
private void checkValue(Object value) { if (this.nonNull && value == null) { throw new IllegalArgumentException(String.format("The property [%s] may not be null!", getKey())); } if (getType() != null && value != null && !getType().isAssignableFrom(value.getClass())) { ...
[ "private", "void", "checkValue", "(", "Object", "value", ")", "{", "if", "(", "this", ".", "nonNull", "&&", "value", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "String", ".", "format", "(", "\"The property [%s] may not be null!\"", ...
Check that the value is compatible with the configure constraints. @param value The value. @throws IllegalArgumentException if the value is null and this property has the nonNull attribute set, or if the type is set for this value, but the value is not assignable to the set type.
[ "Check", "that", "the", "value", "is", "compatible", "with", "the", "configure", "constraints", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-context/src/main/java/org/xwiki/context/internal/ExecutionContextProperty.java#L96-L106
train
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-cipher/src/main/java/org/xwiki/crypto/cipher/internal/asymmetric/factory/AbstractBcAsymmetricCipherFactory.java
AbstractBcAsymmetricCipherFactory.newKeySizeArray
protected static int[] newKeySizeArray(int minSize, int maxSize, int step) { int[] result = new int[((maxSize - minSize) / step) + 1]; for (int i = minSize, j = 0; i <= maxSize; i += step, j++) { result[j] = i; } return result; }
java
protected static int[] newKeySizeArray(int minSize, int maxSize, int step) { int[] result = new int[((maxSize - minSize) / step) + 1]; for (int i = minSize, j = 0; i <= maxSize; i += step, j++) { result[j] = i; } return result; }
[ "protected", "static", "int", "[", "]", "newKeySizeArray", "(", "int", "minSize", ",", "int", "maxSize", ",", "int", "step", ")", "{", "int", "[", "]", "result", "=", "new", "int", "[", "(", "(", "maxSize", "-", "minSize", ")", "/", "step", ")", "+...
Helper function to create supported key size arrays. @param minSize minimum size supported. @param maxSize maximum size supported. @param step intermediate step supported. @return an array of sizes.
[ "Helper", "function", "to", "create", "supported", "key", "size", "arrays", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-cipher/src/main/java/org/xwiki/crypto/cipher/internal/asymmetric/factory/AbstractBcAsymmetricCipherFactory.java#L70-L77
train
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-pkix/src/main/java/org/xwiki/crypto/pkix/internal/BcX509v3TBSCertificateBuilder.java
BcX509v3TBSCertificateBuilder.setExtensions
public BcX509v3TBSCertificateBuilder setExtensions(CertifiedPublicKey issuer, PublicKeyParameters subject, X509Extensions extensions1, X509Extensions extensions2) throws IOException { DefaultX509ExtensionBuilder extBuilder = new DefaultX509ExtensionBuilder(); extBuilder.addAuthorityKeyIdent...
java
public BcX509v3TBSCertificateBuilder setExtensions(CertifiedPublicKey issuer, PublicKeyParameters subject, X509Extensions extensions1, X509Extensions extensions2) throws IOException { DefaultX509ExtensionBuilder extBuilder = new DefaultX509ExtensionBuilder(); extBuilder.addAuthorityKeyIdent...
[ "public", "BcX509v3TBSCertificateBuilder", "setExtensions", "(", "CertifiedPublicKey", "issuer", ",", "PublicKeyParameters", "subject", ",", "X509Extensions", "extensions1", ",", "X509Extensions", "extensions2", ")", "throws", "IOException", "{", "DefaultX509ExtensionBuilder", ...
Set the extensions of a v3 certificate. @param issuer the issuer certified public key to compute the Authority Key Identifier, or null for none. @param subject the subject certified public key parameters to compute the Subject Key Identifier, or null for none. @param extensions1 the common extensions set. @param exten...
[ "Set", "the", "extensions", "of", "a", "v3", "certificate", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-pkix/src/main/java/org/xwiki/crypto/pkix/internal/BcX509v3TBSCertificateBuilder.java#L143-L158
train
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-velocity/src/main/java/org/xwiki/velocity/tools/CollectionsTool.java
CollectionsTool.unmodifiable
public <E> List<E> unmodifiable(List<E> input) { if (input == null) { return null; } return Collections.unmodifiableList(input); }
java
public <E> List<E> unmodifiable(List<E> input) { if (input == null) { return null; } return Collections.unmodifiableList(input); }
[ "public", "<", "E", ">", "List", "<", "E", ">", "unmodifiable", "(", "List", "<", "E", ">", "input", ")", "{", "if", "(", "input", "==", "null", ")", "{", "return", "null", ";", "}", "return", "Collections", ".", "unmodifiableList", "(", "input", "...
Returns an unmodifiable view of the specified list. @param <E> the type of the elements in the list @param input the list to wrap in an unmodifiable bridge @return an unmodifiable view of the list
[ "Returns", "an", "unmodifiable", "view", "of", "the", "specified", "list", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-velocity/src/main/java/org/xwiki/velocity/tools/CollectionsTool.java#L196-L202
train
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-velocity/src/main/java/org/xwiki/velocity/tools/CollectionsTool.java
CollectionsTool.unmodifiable
public <K, V> Map<K, V> unmodifiable(Map<K, V> input) { if (input == null) { return null; } return Collections.unmodifiableMap(input); }
java
public <K, V> Map<K, V> unmodifiable(Map<K, V> input) { if (input == null) { return null; } return Collections.unmodifiableMap(input); }
[ "public", "<", "K", ",", "V", ">", "Map", "<", "K", ",", "V", ">", "unmodifiable", "(", "Map", "<", "K", ",", "V", ">", "input", ")", "{", "if", "(", "input", "==", "null", ")", "{", "return", "null", ";", "}", "return", "Collections", ".", "...
Returns an unmodifiable view of the specified map. @param <K> the type of keys maintained by this map @param <V> the type of mapped values @param input the map to wrap in an unmodifiable bridge @return an unmodifiable view of the map
[ "Returns", "an", "unmodifiable", "view", "of", "the", "specified", "map", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-velocity/src/main/java/org/xwiki/velocity/tools/CollectionsTool.java#L212-L218
train
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-velocity/src/main/java/org/xwiki/velocity/tools/CollectionsTool.java
CollectionsTool.unmodifiable
public <E> Set<E> unmodifiable(Set<E> input) { if (input == null) { return null; } return Collections.unmodifiableSet(input); }
java
public <E> Set<E> unmodifiable(Set<E> input) { if (input == null) { return null; } return Collections.unmodifiableSet(input); }
[ "public", "<", "E", ">", "Set", "<", "E", ">", "unmodifiable", "(", "Set", "<", "E", ">", "input", ")", "{", "if", "(", "input", "==", "null", ")", "{", "return", "null", ";", "}", "return", "Collections", ".", "unmodifiableSet", "(", "input", ")",...
Returns an unmodifiable view of the specified set. @param <E> the type of the elements in the set @param input the set to wrap in an unmodifiable bridge @return an unmodifiable view of the set
[ "Returns", "an", "unmodifiable", "view", "of", "the", "specified", "set", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-velocity/src/main/java/org/xwiki/velocity/tools/CollectionsTool.java#L227-L233
train
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-velocity/src/main/java/org/xwiki/velocity/tools/CollectionsTool.java
CollectionsTool.unmodifiable
public <E> Collection<E> unmodifiable(Collection<E> input) { if (input == null) { return null; } return Collections.unmodifiableCollection(input); }
java
public <E> Collection<E> unmodifiable(Collection<E> input) { if (input == null) { return null; } return Collections.unmodifiableCollection(input); }
[ "public", "<", "E", ">", "Collection", "<", "E", ">", "unmodifiable", "(", "Collection", "<", "E", ">", "input", ")", "{", "if", "(", "input", "==", "null", ")", "{", "return", "null", ";", "}", "return", "Collections", ".", "unmodifiableCollection", "...
Returns an unmodifiable view of the specified collection. @param <E> the type of the elements in the collection @param input the collection to wrap in an unmodifiable bridge @return an unmodifiable view of the collection
[ "Returns", "an", "unmodifiable", "view", "of", "the", "specified", "collection", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-velocity/src/main/java/org/xwiki/velocity/tools/CollectionsTool.java#L242-L248
train
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-velocity/src/main/java/org/xwiki/velocity/tools/CollectionsTool.java
CollectionsTool.reverse
public <E> boolean reverse(List<E> input) { if (input == null) { return false; } try { Collections.reverse(input); return true; } catch (UnsupportedOperationException ex) { return false; } }
java
public <E> boolean reverse(List<E> input) { if (input == null) { return false; } try { Collections.reverse(input); return true; } catch (UnsupportedOperationException ex) { return false; } }
[ "public", "<", "E", ">", "boolean", "reverse", "(", "List", "<", "E", ">", "input", ")", "{", "if", "(", "input", "==", "null", ")", "{", "return", "false", ";", "}", "try", "{", "Collections", ".", "reverse", "(", "input", ")", ";", "return", "t...
Reverse the order of the elements within a list, so that the last element is moved to the beginning of the list, the next-to-last element to the second position, and so on. The input list is modified in place, so this operation will succeed only if the list is modifiable. @param <E> the type of the elements in the lis...
[ "Reverse", "the", "order", "of", "the", "elements", "within", "a", "list", "so", "that", "the", "last", "element", "is", "moved", "to", "the", "beginning", "of", "the", "list", "the", "next", "-", "to", "-", "last", "element", "to", "the", "second", "p...
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-velocity/src/main/java/org/xwiki/velocity/tools/CollectionsTool.java#L314-L325
train
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-velocity/src/main/java/org/xwiki/velocity/tools/CollectionsTool.java
CollectionsTool.sort
public <E extends Comparable<E>> boolean sort(List<E> input) { if (input == null) { return false; } try { Collections.sort(input); return true; } catch (UnsupportedOperationException ex) { return false; } }
java
public <E extends Comparable<E>> boolean sort(List<E> input) { if (input == null) { return false; } try { Collections.sort(input); return true; } catch (UnsupportedOperationException ex) { return false; } }
[ "public", "<", "E", "extends", "Comparable", "<", "E", ">", ">", "boolean", "sort", "(", "List", "<", "E", ">", "input", ")", "{", "if", "(", "input", "==", "null", ")", "{", "return", "false", ";", "}", "try", "{", "Collections", ".", "sort", "(...
Sort the elements within a list according to their natural order. The input list is modified in place, so this operation will succeed only if the list is modifiable. @param <E> the type of the elements in the list @param input the list to sort @return {@code true} if the list was successfully sorted, {@code false} oth...
[ "Sort", "the", "elements", "within", "a", "list", "according", "to", "their", "natural", "order", ".", "The", "input", "list", "is", "modified", "in", "place", "so", "this", "operation", "will", "succeed", "only", "if", "the", "list", "is", "modifiable", "...
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-velocity/src/main/java/org/xwiki/velocity/tools/CollectionsTool.java#L335-L346
train
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-diff/xwiki-commons-diff-api/src/main/java/org/xwiki/diff/internal/DefaultDiffManager.java
DefaultDiffManager.isFullyModified
private <E> boolean isFullyModified(List commonAncestor, Patch<E> patchCurrent) { return patchCurrent.size() == 1 && commonAncestor.size() == patchCurrent.get(0).getPrevious().size(); }
java
private <E> boolean isFullyModified(List commonAncestor, Patch<E> patchCurrent) { return patchCurrent.size() == 1 && commonAncestor.size() == patchCurrent.get(0).getPrevious().size(); }
[ "private", "<", "E", ">", "boolean", "isFullyModified", "(", "List", "commonAncestor", ",", "Patch", "<", "E", ">", "patchCurrent", ")", "{", "return", "patchCurrent", ".", "size", "(", ")", "==", "1", "&&", "commonAncestor", ".", "size", "(", ")", "==",...
Check if the content is completely different between the ancestor and the current version @param <E> the type of compared elements @param commonAncestor previous version @param patchCurrent patch to the current version @return either or not the user has changed everything
[ "Check", "if", "the", "content", "is", "completely", "different", "between", "the", "ancestor", "and", "the", "current", "version" ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-diff/xwiki-commons-diff-api/src/main/java/org/xwiki/diff/internal/DefaultDiffManager.java#L399-L401
train
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-velocity/src/main/java/org/xwiki/velocity/introspection/SecureUberspector.java
SecureUberspector.getIterator
@Override public Iterator getIterator(Object obj, Info i) throws Exception { if (obj != null) { SecureIntrospectorControl sic = (SecureIntrospectorControl) this.introspector; if (sic.checkObjectExecutePermission(obj.getClass(), null)) { return super.getIterator(ob...
java
@Override public Iterator getIterator(Object obj, Info i) throws Exception { if (obj != null) { SecureIntrospectorControl sic = (SecureIntrospectorControl) this.introspector; if (sic.checkObjectExecutePermission(obj.getClass(), null)) { return super.getIterator(ob...
[ "@", "Override", "public", "Iterator", "getIterator", "(", "Object", "obj", ",", "Info", "i", ")", "throws", "Exception", "{", "if", "(", "obj", "!=", "null", ")", "{", "SecureIntrospectorControl", "sic", "=", "(", "SecureIntrospectorControl", ")", "this", "...
Get an iterator from the given object. Since the superclass method this secure version checks for execute permission. @param obj object to iterate over @param i line, column, template info @return Iterator for object @throws Exception when failing to get iterator
[ "Get", "an", "iterator", "from", "the", "given", "object", ".", "Since", "the", "superclass", "method", "this", "secure", "version", "checks", "for", "execute", "permission", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-velocity/src/main/java/org/xwiki/velocity/introspection/SecureUberspector.java#L63-L75
train
xwiki/xwiki-commons
xwiki-commons-tools/xwiki-commons-tool-xar/xwiki-commons-tool-xar-plugin/src/main/java/org/xwiki/tool/xar/AbstractXARMojo.java
AbstractXARMojo.unpackXARToOutputDirectory
protected void unpackXARToOutputDirectory(Artifact artifact, String[] includes, String[] excludes) throws MojoExecutionException { if (!this.outputBuildDirectory.exists()) { this.outputBuildDirectory.mkdirs(); } File file = artifact.getFile(); unpack(file, this.o...
java
protected void unpackXARToOutputDirectory(Artifact artifact, String[] includes, String[] excludes) throws MojoExecutionException { if (!this.outputBuildDirectory.exists()) { this.outputBuildDirectory.mkdirs(); } File file = artifact.getFile(); unpack(file, this.o...
[ "protected", "void", "unpackXARToOutputDirectory", "(", "Artifact", "artifact", ",", "String", "[", "]", "includes", ",", "String", "[", "]", "excludes", ")", "throws", "MojoExecutionException", "{", "if", "(", "!", "this", ".", "outputBuildDirectory", ".", "exi...
Unpacks A XAR artifacts into the build output directory, along with the project's XAR files. @param artifact the XAR artifact to unpack. @throws MojoExecutionException in case of unpack error
[ "Unpacks", "A", "XAR", "artifacts", "into", "the", "build", "output", "directory", "along", "with", "the", "project", "s", "XAR", "files", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-tools/xwiki-commons-tool-xar/xwiki-commons-tool-xar-plugin/src/main/java/org/xwiki/tool/xar/AbstractXARMojo.java#L256-L265
train
xwiki/xwiki-commons
xwiki-commons-tools/xwiki-commons-tool-xar/xwiki-commons-tool-xar-plugin/src/main/java/org/xwiki/tool/xar/AbstractXARMojo.java
AbstractXARMojo.resolveArtifactDependencies
protected Set<Artifact> resolveArtifactDependencies(Artifact artifact) throws ArtifactResolutionException, ArtifactNotFoundException, ProjectBuildingException { Artifact pomArtifact = this.factory.createArtifact(artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion(), "", ...
java
protected Set<Artifact> resolveArtifactDependencies(Artifact artifact) throws ArtifactResolutionException, ArtifactNotFoundException, ProjectBuildingException { Artifact pomArtifact = this.factory.createArtifact(artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion(), "", ...
[ "protected", "Set", "<", "Artifact", ">", "resolveArtifactDependencies", "(", "Artifact", "artifact", ")", "throws", "ArtifactResolutionException", ",", "ArtifactNotFoundException", ",", "ProjectBuildingException", "{", "Artifact", "pomArtifact", "=", "this", ".", "factor...
This method resolves all transitive dependencies of an artifact. @param artifact the artifact used to retrieve dependencies @return resolved set of dependencies @throws ArtifactResolutionException error @throws ArtifactNotFoundException error @throws ProjectBuildingException error @throws InvalidDependencyVersionExcep...
[ "This", "method", "resolves", "all", "transitive", "dependencies", "of", "an", "artifact", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-tools/xwiki-commons-tool-xar/xwiki-commons-tool-xar-plugin/src/main/java/org/xwiki/tool/xar/AbstractXARMojo.java#L286-L297
train
xwiki/xwiki-commons
xwiki-commons-tools/xwiki-commons-tool-xar/xwiki-commons-tool-xar-plugin/src/main/java/org/xwiki/tool/xar/AbstractXARMojo.java
AbstractXARMojo.getDocFromXML
protected XWikiDocument getDocFromXML(File file) throws MojoExecutionException { XWikiDocument doc; try { doc = new XWikiDocument(); doc.fromXML(file); } catch (Exception e) { throw new MojoExecutionException(String.format("Failed to parse [%s].", file.ge...
java
protected XWikiDocument getDocFromXML(File file) throws MojoExecutionException { XWikiDocument doc; try { doc = new XWikiDocument(); doc.fromXML(file); } catch (Exception e) { throw new MojoExecutionException(String.format("Failed to parse [%s].", file.ge...
[ "protected", "XWikiDocument", "getDocFromXML", "(", "File", "file", ")", "throws", "MojoExecutionException", "{", "XWikiDocument", "doc", ";", "try", "{", "doc", "=", "new", "XWikiDocument", "(", ")", ";", "doc", ".", "fromXML", "(", "file", ")", ";", "}", ...
Load a XWiki document from its XML representation. @param file the file to parse. @return the loaded document object or null if the document cannot be parsed
[ "Load", "a", "XWiki", "document", "from", "its", "XML", "representation", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-tools/xwiki-commons-tool-xar/xwiki-commons-tool-xar-plugin/src/main/java/org/xwiki/tool/xar/AbstractXARMojo.java#L330-L342
train
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-job/src/main/java/org/xwiki/job/internal/DefaultJobStatusStore.java
DefaultJobStatusStore.repair
private void repair() throws IOException { File folder = this.configuration.getStorage(); if (folder.exists()) { if (!folder.isDirectory()) { throw new IOException("Not a directory: " + folder); } repairFolder(folder); } }
java
private void repair() throws IOException { File folder = this.configuration.getStorage(); if (folder.exists()) { if (!folder.isDirectory()) { throw new IOException("Not a directory: " + folder); } repairFolder(folder); } }
[ "private", "void", "repair", "(", ")", "throws", "IOException", "{", "File", "folder", "=", "this", ".", "configuration", ".", "getStorage", "(", ")", ";", "if", "(", "folder", ".", "exists", "(", ")", ")", "{", "if", "(", "!", "folder", ".", "isDire...
Load jobs from directory. @throws IOException when failing to load statuses
[ "Load", "jobs", "from", "directory", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-job/src/main/java/org/xwiki/job/internal/DefaultJobStatusStore.java#L211-L222
train
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-job/src/main/java/org/xwiki/job/internal/DefaultJobManager.java
DefaultJobManager.runJob
public void runJob() { try { this.currentJob = this.jobQueue.take(); // Create a clean Execution Context ExecutionContext context = new ExecutionContext(); try { this.executionContextManager.initialize(context); } catch (Execution...
java
public void runJob() { try { this.currentJob = this.jobQueue.take(); // Create a clean Execution Context ExecutionContext context = new ExecutionContext(); try { this.executionContextManager.initialize(context); } catch (Execution...
[ "public", "void", "runJob", "(", ")", "{", "try", "{", "this", ".", "currentJob", "=", "this", ".", "jobQueue", ".", "take", "(", ")", ";", "// Create a clean Execution Context", "ExecutionContext", "context", "=", "new", "ExecutionContext", "(", ")", ";", "...
Execute one job.
[ "Execute", "one", "job", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-job/src/main/java/org/xwiki/job/internal/DefaultJobManager.java#L128-L148
train
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-repositories/xwiki-commons-extension-repository-xwiki/src/main/java/org/xwiki/extension/repository/xwiki/internal/XWikiExtensionRepository.java
XWikiExtensionRepository.initRepositoryFeatures
private void initRepositoryFeatures() { if (this.repositoryVersion == null) { // Default features this.repositoryVersion = new DefaultVersion(Resources.VERSION10); this.filterable = false; this.sortable = false; // Get remote features ...
java
private void initRepositoryFeatures() { if (this.repositoryVersion == null) { // Default features this.repositoryVersion = new DefaultVersion(Resources.VERSION10); this.filterable = false; this.sortable = false; // Get remote features ...
[ "private", "void", "initRepositoryFeatures", "(", ")", "{", "if", "(", "this", ".", "repositoryVersion", "==", "null", ")", "{", "// Default features", "this", ".", "repositoryVersion", "=", "new", "DefaultVersion", "(", "Resources", ".", "VERSION10", ")", ";", ...
Check what is supported by the remote repository.
[ "Check", "what", "is", "supported", "by", "the", "remote", "repository", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-repositories/xwiki-commons-extension-repository-xwiki/src/main/java/org/xwiki/extension/repository/xwiki/internal/XWikiExtensionRepository.java#L163-L192
train
xwiki/xwiki-commons
xwiki-commons-tools/xwiki-commons-tool-xar/xwiki-commons-tool-xar-plugin/src/main/java/org/xwiki/tool/xar/internal/XWikiDocument.java
XWikiDocument.fromXML
public void fromXML(Document domdoc) throws DocumentException { this.encoding = domdoc.getXMLEncoding(); Element rootElement = domdoc.getRootElement(); this.reference = readDocumentReference(domdoc); this.locale = rootElement.attributeValue("locale"); if (this.locale == nu...
java
public void fromXML(Document domdoc) throws DocumentException { this.encoding = domdoc.getXMLEncoding(); Element rootElement = domdoc.getRootElement(); this.reference = readDocumentReference(domdoc); this.locale = rootElement.attributeValue("locale"); if (this.locale == nu...
[ "public", "void", "fromXML", "(", "Document", "domdoc", ")", "throws", "DocumentException", "{", "this", ".", "encoding", "=", "domdoc", ".", "getXMLEncoding", "(", ")", ";", "Element", "rootElement", "=", "domdoc", ".", "getRootElement", "(", ")", ";", "thi...
Parse XML document to extract document information. @param domdoc the xml document @throws DocumentException error when parsing XML file
[ "Parse", "XML", "document", "to", "extract", "document", "information", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-tools/xwiki-commons-tool-xar/xwiki-commons-tool-xar-plugin/src/main/java/org/xwiki/tool/xar/internal/XWikiDocument.java#L192-L234
train
xwiki/xwiki-commons
xwiki-commons-tools/xwiki-commons-tool-xar/xwiki-commons-tool-xar-plugin/src/main/java/org/xwiki/tool/xar/internal/XWikiDocument.java
XWikiDocument.readElement
public static String readElement(Element rootElement, String elementName) throws DocumentException { String result = null; Element element = rootElement.element(elementName); if (element != null) { // Make sure the element does not have any child element if (!element....
java
public static String readElement(Element rootElement, String elementName) throws DocumentException { String result = null; Element element = rootElement.element(elementName); if (element != null) { // Make sure the element does not have any child element if (!element....
[ "public", "static", "String", "readElement", "(", "Element", "rootElement", ",", "String", "elementName", ")", "throws", "DocumentException", "{", "String", "result", "=", "null", ";", "Element", "element", "=", "rootElement", ".", "element", "(", "elementName", ...
Read an element from the XML. @param rootElement the root XML element under which to find the element @param elementName the name of the element to read @return null or the element value as a String @throws DocumentException if it is not a valid XML wiki page @since 10.8RC1
[ "Read", "an", "element", "from", "the", "XML", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-tools/xwiki-commons-tool-xar/xwiki-commons-tool-xar-plugin/src/main/java/org/xwiki/tool/xar/internal/XWikiDocument.java#L285-L298
train
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-pkix/src/main/java/org/xwiki/crypto/pkix/internal/BcUtils.java
BcUtils.getX509CertificateHolder
public static X509CertificateHolder getX509CertificateHolder(CertifiedPublicKey cert) { if (cert instanceof BcX509CertifiedPublicKey) { return ((BcX509CertifiedPublicKey) cert).getX509CertificateHolder(); } else { try { return new X509CertificateHolder(cert.ge...
java
public static X509CertificateHolder getX509CertificateHolder(CertifiedPublicKey cert) { if (cert instanceof BcX509CertifiedPublicKey) { return ((BcX509CertifiedPublicKey) cert).getX509CertificateHolder(); } else { try { return new X509CertificateHolder(cert.ge...
[ "public", "static", "X509CertificateHolder", "getX509CertificateHolder", "(", "CertifiedPublicKey", "cert", ")", "{", "if", "(", "cert", "instanceof", "BcX509CertifiedPublicKey", ")", "{", "return", "(", "(", "BcX509CertifiedPublicKey", ")", "cert", ")", ".", "getX509...
Convert certified public key to certificate holder. @param cert the certified public key. @return a certificate holder.
[ "Convert", "certified", "public", "key", "to", "certificate", "holder", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-pkix/src/main/java/org/xwiki/crypto/pkix/internal/BcUtils.java#L68-L81
train
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-pkix/src/main/java/org/xwiki/crypto/pkix/internal/BcUtils.java
BcUtils.getAsymmetricKeyParameter
public static AsymmetricKeyParameter getAsymmetricKeyParameter(PublicKeyParameters publicKey) { if (publicKey instanceof BcAsymmetricKeyParameters) { return ((BcAsymmetricKeyParameters) publicKey).getParameters(); } else { try { return PublicKeyFactory.createK...
java
public static AsymmetricKeyParameter getAsymmetricKeyParameter(PublicKeyParameters publicKey) { if (publicKey instanceof BcAsymmetricKeyParameters) { return ((BcAsymmetricKeyParameters) publicKey).getParameters(); } else { try { return PublicKeyFactory.createK...
[ "public", "static", "AsymmetricKeyParameter", "getAsymmetricKeyParameter", "(", "PublicKeyParameters", "publicKey", ")", "{", "if", "(", "publicKey", "instanceof", "BcAsymmetricKeyParameters", ")", "{", "return", "(", "(", "BcAsymmetricKeyParameters", ")", "publicKey", ")...
Convert public key parameters to asymmetric key parameter. @param publicKey the public key parameter to convert. @return an asymmetric key parameter.
[ "Convert", "public", "key", "parameters", "to", "asymmetric", "key", "parameter", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-pkix/src/main/java/org/xwiki/crypto/pkix/internal/BcUtils.java#L89-L102
train
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-pkix/src/main/java/org/xwiki/crypto/pkix/internal/BcUtils.java
BcUtils.getSubjectPublicKeyInfo
public static SubjectPublicKeyInfo getSubjectPublicKeyInfo(PublicKeyParameters publicKey) { try { if (publicKey instanceof BcPublicKeyParameters) { return ((BcPublicKeyParameters) publicKey).getSubjectPublicKeyInfo(); } else { return SubjectPublicKeyIn...
java
public static SubjectPublicKeyInfo getSubjectPublicKeyInfo(PublicKeyParameters publicKey) { try { if (publicKey instanceof BcPublicKeyParameters) { return ((BcPublicKeyParameters) publicKey).getSubjectPublicKeyInfo(); } else { return SubjectPublicKeyIn...
[ "public", "static", "SubjectPublicKeyInfo", "getSubjectPublicKeyInfo", "(", "PublicKeyParameters", "publicKey", ")", "{", "try", "{", "if", "(", "publicKey", "instanceof", "BcPublicKeyParameters", ")", "{", "return", "(", "(", "BcPublicKeyParameters", ")", "publicKey", ...
Convert public key parameter to subject public key info. @param publicKey the public key to convert. @return a subject public key info.
[ "Convert", "public", "key", "parameter", "to", "subject", "public", "key", "info", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-pkix/src/main/java/org/xwiki/crypto/pkix/internal/BcUtils.java#L110-L122
train
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-pkix/src/main/java/org/xwiki/crypto/pkix/internal/BcUtils.java
BcUtils.getX509CertificateHolder
public static X509CertificateHolder getX509CertificateHolder(TBSCertificate tbsCert, byte[] signature) { ASN1EncodableVector v = new ASN1EncodableVector(); v.add(tbsCert); v.add(tbsCert.getSignature()); v.add(new DERBitString(signature)); return new X509CertificateHolder(Ce...
java
public static X509CertificateHolder getX509CertificateHolder(TBSCertificate tbsCert, byte[] signature) { ASN1EncodableVector v = new ASN1EncodableVector(); v.add(tbsCert); v.add(tbsCert.getSignature()); v.add(new DERBitString(signature)); return new X509CertificateHolder(Ce...
[ "public", "static", "X509CertificateHolder", "getX509CertificateHolder", "(", "TBSCertificate", "tbsCert", ",", "byte", "[", "]", "signature", ")", "{", "ASN1EncodableVector", "v", "=", "new", "ASN1EncodableVector", "(", ")", ";", "v", ".", "add", "(", "tbsCert", ...
Build the structure of an X.509 certificate. @param tbsCert the to be signed structure @param signature the signature @return a X.509 certificate holder.
[ "Build", "the", "structure", "of", "an", "X", ".", "509", "certificate", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-pkix/src/main/java/org/xwiki/crypto/pkix/internal/BcUtils.java#L131-L140
train
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-pkix/src/main/java/org/xwiki/crypto/pkix/internal/BcUtils.java
BcUtils.isAlgorithlIdentifierEqual
public static boolean isAlgorithlIdentifierEqual(AlgorithmIdentifier id1, AlgorithmIdentifier id2) { if (!id1.getAlgorithm().equals(id2.getAlgorithm())) { return false; } if (id1.getParameters() == null) { return !(id2.getParameters() != null && !id2....
java
public static boolean isAlgorithlIdentifierEqual(AlgorithmIdentifier id1, AlgorithmIdentifier id2) { if (!id1.getAlgorithm().equals(id2.getAlgorithm())) { return false; } if (id1.getParameters() == null) { return !(id2.getParameters() != null && !id2....
[ "public", "static", "boolean", "isAlgorithlIdentifierEqual", "(", "AlgorithmIdentifier", "id1", ",", "AlgorithmIdentifier", "id2", ")", "{", "if", "(", "!", "id1", ".", "getAlgorithm", "(", ")", ".", "equals", "(", "id2", ".", "getAlgorithm", "(", ")", ")", ...
Compare two algorithm identifier. @param id1 an algorithm identifier. @param id2 another algorithm identifier. @return true if both algorithm identifier are equals, false otherwise.
[ "Compare", "two", "algorithm", "identifier", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-pkix/src/main/java/org/xwiki/crypto/pkix/internal/BcUtils.java#L149-L167
train
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-pkix/src/main/java/org/xwiki/crypto/pkix/internal/BcUtils.java
BcUtils.updateDEREncodedObject
public static Signer updateDEREncodedObject(Signer signer, ASN1Encodable tbsObj) throws IOException { OutputStream sOut = signer.getOutputStream(); DEROutputStream dOut = new DEROutputStream(sOut); dOut.writeObject(tbsObj); sOut.close(); return signer; }
java
public static Signer updateDEREncodedObject(Signer signer, ASN1Encodable tbsObj) throws IOException { OutputStream sOut = signer.getOutputStream(); DEROutputStream dOut = new DEROutputStream(sOut); dOut.writeObject(tbsObj); sOut.close(); return signer; }
[ "public", "static", "Signer", "updateDEREncodedObject", "(", "Signer", "signer", ",", "ASN1Encodable", "tbsObj", ")", "throws", "IOException", "{", "OutputStream", "sOut", "=", "signer", ".", "getOutputStream", "(", ")", ";", "DEROutputStream", "dOut", "=", "new",...
DER encode an ASN.1 object into the given signer and return the signer. @param signer a signer. @param tbsObj the object to sign. @return a the signer for chaining. @throws java.io.IOException on encoding error.
[ "DER", "encode", "an", "ASN", ".", "1", "object", "into", "the", "given", "signer", "and", "return", "the", "signer", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-pkix/src/main/java/org/xwiki/crypto/pkix/internal/BcUtils.java#L177-L188
train
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-pkix/src/main/java/org/xwiki/crypto/pkix/internal/BcUtils.java
BcUtils.getX500Name
public static X500Name getX500Name(PrincipalIndentifier principal) { if (principal instanceof BcPrincipalIdentifier) { return ((BcPrincipalIdentifier) principal).getX500Name(); } else { return new X500Name(principal.getName()); } }
java
public static X500Name getX500Name(PrincipalIndentifier principal) { if (principal instanceof BcPrincipalIdentifier) { return ((BcPrincipalIdentifier) principal).getX500Name(); } else { return new X500Name(principal.getName()); } }
[ "public", "static", "X500Name", "getX500Name", "(", "PrincipalIndentifier", "principal", ")", "{", "if", "(", "principal", "instanceof", "BcPrincipalIdentifier", ")", "{", "return", "(", "(", "BcPrincipalIdentifier", ")", "principal", ")", ".", "getX500Name", "(", ...
Convert principal identifier to X.500 name. @param principal principal identifier to convert. @return an X.500 name.
[ "Convert", "principal", "identifier", "to", "X", ".", "500", "name", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-pkix/src/main/java/org/xwiki/crypto/pkix/internal/BcUtils.java#L196-L203
train
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-pkix/src/main/java/org/xwiki/crypto/pkix/internal/BcUtils.java
BcUtils.getSignerAlgoritmIdentifier
public static AlgorithmIdentifier getSignerAlgoritmIdentifier(Signer signer) { if (signer instanceof ContentSigner) { return ((ContentSigner) signer).getAlgorithmIdentifier(); } else { return AlgorithmIdentifier.getInstance(signer.getEncoded()); } }
java
public static AlgorithmIdentifier getSignerAlgoritmIdentifier(Signer signer) { if (signer instanceof ContentSigner) { return ((ContentSigner) signer).getAlgorithmIdentifier(); } else { return AlgorithmIdentifier.getInstance(signer.getEncoded()); } }
[ "public", "static", "AlgorithmIdentifier", "getSignerAlgoritmIdentifier", "(", "Signer", "signer", ")", "{", "if", "(", "signer", "instanceof", "ContentSigner", ")", "{", "return", "(", "(", "ContentSigner", ")", "signer", ")", ".", "getAlgorithmIdentifier", "(", ...
Get the algorithm identifier of a signer. @param signer the signer. @return an algorithm identifier.
[ "Get", "the", "algorithm", "identifier", "of", "a", "signer", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-pkix/src/main/java/org/xwiki/crypto/pkix/internal/BcUtils.java#L211-L218
train
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-pkix/src/main/java/org/xwiki/crypto/pkix/internal/BcUtils.java
BcUtils.convertCertificate
public static CertifiedPublicKey convertCertificate(CertificateFactory certFactory, X509CertificateHolder cert) { if (cert == null) { return null; } if (certFactory instanceof BcX509CertificateFactory) { return ((BcX509CertificateFactory) certFactory).convert(cert); ...
java
public static CertifiedPublicKey convertCertificate(CertificateFactory certFactory, X509CertificateHolder cert) { if (cert == null) { return null; } if (certFactory instanceof BcX509CertificateFactory) { return ((BcX509CertificateFactory) certFactory).convert(cert); ...
[ "public", "static", "CertifiedPublicKey", "convertCertificate", "(", "CertificateFactory", "certFactory", ",", "X509CertificateHolder", "cert", ")", "{", "if", "(", "cert", "==", "null", ")", "{", "return", "null", ";", "}", "if", "(", "certFactory", "instanceof",...
Convert a Bouncy Castle certificate holder into a certified public key. @param certFactory the certificate factory to be used for conversion. @param cert the certificate to convert. @return a certified public key wrapping equivalent to the provided holder. @since 6.0M1
[ "Convert", "a", "Bouncy", "Castle", "certificate", "holder", "into", "a", "certified", "public", "key", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-pkix/src/main/java/org/xwiki/crypto/pkix/internal/BcUtils.java#L228-L244
train
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/repository/internal/AbstractCachedExtensionRepository.java
AbstractCachedExtensionRepository.addCachedExtension
protected void addCachedExtension(E extension) { if (!this.extensions.containsKey(extension.getId())) { // extensions this.extensions.put(extension.getId(), extension); // versions addCachedExtensionVersion(extension.getId().getId(), extension); i...
java
protected void addCachedExtension(E extension) { if (!this.extensions.containsKey(extension.getId())) { // extensions this.extensions.put(extension.getId(), extension); // versions addCachedExtensionVersion(extension.getId().getId(), extension); i...
[ "protected", "void", "addCachedExtension", "(", "E", "extension", ")", "{", "if", "(", "!", "this", ".", "extensions", ".", "containsKey", "(", "extension", ".", "getId", "(", ")", ")", ")", "{", "// extensions", "this", ".", "extensions", ".", "put", "(...
Register a new extension. @param extension the new extension
[ "Register", "a", "new", "extension", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/repository/internal/AbstractCachedExtensionRepository.java#L99-L113
train
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/repository/internal/AbstractCachedExtensionRepository.java
AbstractCachedExtensionRepository.addCachedExtensionVersion
protected void addCachedExtensionVersion(String feature, E extension) { // versions List<E> versions = this.extensionsVersions.get(feature); if (versions == null) { versions = new ArrayList<E>(); this.extensionsVersions.put(feature, versions); versions.a...
java
protected void addCachedExtensionVersion(String feature, E extension) { // versions List<E> versions = this.extensionsVersions.get(feature); if (versions == null) { versions = new ArrayList<E>(); this.extensionsVersions.put(feature, versions); versions.a...
[ "protected", "void", "addCachedExtensionVersion", "(", "String", "feature", ",", "E", "extension", ")", "{", "// versions", "List", "<", "E", ">", "versions", "=", "this", ".", "extensionsVersions", ".", "get", "(", "feature", ")", ";", "if", "(", "versions"...
Register extension in all caches. @param feature the feature @param extension the extension
[ "Register", "extension", "in", "all", "caches", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/repository/internal/AbstractCachedExtensionRepository.java#L121-L140
train
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/repository/internal/AbstractCachedExtensionRepository.java
AbstractCachedExtensionRepository.removeCachedExtension
protected void removeCachedExtension(E extension) { // Remove the extension from the memory. this.extensions.remove(extension.getId()); // versions removeCachedExtensionVersion(extension.getId().getId(), extension); if (!this.strictId) { for (String feature : ext...
java
protected void removeCachedExtension(E extension) { // Remove the extension from the memory. this.extensions.remove(extension.getId()); // versions removeCachedExtensionVersion(extension.getId().getId(), extension); if (!this.strictId) { for (String feature : ext...
[ "protected", "void", "removeCachedExtension", "(", "E", "extension", ")", "{", "// Remove the extension from the memory.", "this", ".", "extensions", ".", "remove", "(", "extension", ".", "getId", "(", ")", ")", ";", "// versions", "removeCachedExtensionVersion", "(",...
Remove extension from all caches. @param extension the extension
[ "Remove", "extension", "from", "all", "caches", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/repository/internal/AbstractCachedExtensionRepository.java#L147-L159
train
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/repository/internal/AbstractCachedExtensionRepository.java
AbstractCachedExtensionRepository.removeCachedExtensionVersion
protected void removeCachedExtensionVersion(String feature, E extension) { // versions List<E> extensionVersions = this.extensionsVersions.get(feature); extensionVersions.remove(extension); if (extensionVersions.isEmpty()) { this.extensionsVersions.remove(feature); ...
java
protected void removeCachedExtensionVersion(String feature, E extension) { // versions List<E> extensionVersions = this.extensionsVersions.get(feature); extensionVersions.remove(extension); if (extensionVersions.isEmpty()) { this.extensionsVersions.remove(feature); ...
[ "protected", "void", "removeCachedExtensionVersion", "(", "String", "feature", ",", "E", "extension", ")", "{", "// versions", "List", "<", "E", ">", "extensionVersions", "=", "this", ".", "extensionsVersions", ".", "get", "(", "feature", ")", ";", "extensionVer...
Remove passed extension associated to passed feature from the cache. @param feature the feature associated to the extension @param extension the extension
[ "Remove", "passed", "extension", "associated", "to", "passed", "feature", "from", "the", "cache", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/repository/internal/AbstractCachedExtensionRepository.java#L167-L175
train
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-password/src/main/java/org/xwiki/crypto/password/PasswordToByteConverter.java
PasswordToByteConverter.convert
public static byte[] convert(char[] password, ToBytesMode mode) { byte[] passwd; switch (mode) { case PKCS12: passwd = PBEParametersGenerator.PKCS12PasswordToBytes(password); break; case PKCS5: passwd = PBEParametersGenerator.P...
java
public static byte[] convert(char[] password, ToBytesMode mode) { byte[] passwd; switch (mode) { case PKCS12: passwd = PBEParametersGenerator.PKCS12PasswordToBytes(password); break; case PKCS5: passwd = PBEParametersGenerator.P...
[ "public", "static", "byte", "[", "]", "convert", "(", "char", "[", "]", "password", ",", "ToBytesMode", "mode", ")", "{", "byte", "[", "]", "passwd", ";", "switch", "(", "mode", ")", "{", "case", "PKCS12", ":", "passwd", "=", "PBEParametersGenerator", ...
Convert password to bytes. @param password password to convert. @param mode mode of conversion. @return a bytes array representing the password.
[ "Convert", "password", "to", "bytes", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-password/src/main/java/org/xwiki/crypto/password/PasswordToByteConverter.java#L91-L108
train
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-component/xwiki-commons-component-api/src/main/java/org/xwiki/component/namespace/NamespaceUtils.java
NamespaceUtils.getPrefix
public static String getPrefix(String namespaceString) { Namespace namespace = toNamespace(namespaceString); return namespace != null ? namespace.getType() : null; }
java
public static String getPrefix(String namespaceString) { Namespace namespace = toNamespace(namespaceString); return namespace != null ? namespace.getType() : null; }
[ "public", "static", "String", "getPrefix", "(", "String", "namespaceString", ")", "{", "Namespace", "namespace", "=", "toNamespace", "(", "namespaceString", ")", ";", "return", "namespace", "!=", "null", "?", "namespace", ".", "getType", "(", ")", ":", "null",...
Extract prefix of the id used to find custom factory. @param namespaceString the namespace as a {@link String} @return the type of the namespace or null if none is provided
[ "Extract", "prefix", "of", "the", "id", "used", "to", "find", "custom", "factory", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-component/xwiki-commons-component-api/src/main/java/org/xwiki/component/namespace/NamespaceUtils.java#L55-L60
train
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-xml/src/main/java/org/xwiki/xml/internal/html/filter/ListFilter.java
ListFilter.filter
private void filter(Element list) { // Iterate all the child nodes of the given list to see who's allowed and who's not allowed inside it. Node child = list.getFirstChild(); Node previousListItem = null; while (child != null) { Node nextSibling = child.getNextSibling(); ...
java
private void filter(Element list) { // Iterate all the child nodes of the given list to see who's allowed and who's not allowed inside it. Node child = list.getFirstChild(); Node previousListItem = null; while (child != null) { Node nextSibling = child.getNextSibling(); ...
[ "private", "void", "filter", "(", "Element", "list", ")", "{", "// Iterate all the child nodes of the given list to see who's allowed and who's not allowed inside it.", "Node", "child", "=", "list", ".", "getFirstChild", "(", ")", ";", "Node", "previousListItem", "=", "null...
Transforms the given list in a valid XHTML list by moving the nodes that are not allowed inside &lt;ul&gt; and &lt;ol&gt; in &lt;li&gt; elements. @param list the list to be filtered
[ "Transforms", "the", "given", "list", "in", "a", "valid", "XHTML", "list", "by", "moving", "the", "nodes", "that", "are", "not", "allowed", "inside", "&lt", ";", "ul&gt", ";", "and", "&lt", ";", "ol&gt", ";", "in", "&lt", ";", "li&gt", ";", "elements",...
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-xml/src/main/java/org/xwiki/xml/internal/html/filter/ListFilter.java#L83-L109
train
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-xml/src/main/java/org/xwiki/xml/internal/html/filter/ListFilter.java
ListFilter.isAllowedInsideList
private boolean isAllowedInsideList(Node node) { return (node.getNodeType() != Node.ELEMENT_NODE || node.getNodeName().equalsIgnoreCase(TAG_LI)) && (node.getNodeType() != Node.TEXT_NODE || node.getNodeValue().trim().length() == 0); }
java
private boolean isAllowedInsideList(Node node) { return (node.getNodeType() != Node.ELEMENT_NODE || node.getNodeName().equalsIgnoreCase(TAG_LI)) && (node.getNodeType() != Node.TEXT_NODE || node.getNodeValue().trim().length() == 0); }
[ "private", "boolean", "isAllowedInsideList", "(", "Node", "node", ")", "{", "return", "(", "node", ".", "getNodeType", "(", ")", "!=", "Node", ".", "ELEMENT_NODE", "||", "node", ".", "getNodeName", "(", ")", ".", "equalsIgnoreCase", "(", "TAG_LI", ")", ")"...
Checks if a given node is allowed or not as a child of a &lt;ul&gt; or &lt;ol&gt; element. @param node the node to be checked @return {@code true} if the given node is allowed inside an ordered or unordered list, {@code false} otherwise
[ "Checks", "if", "a", "given", "node", "is", "allowed", "or", "not", "as", "a", "child", "of", "a", "&lt", ";", "ul&gt", ";", "or", "&lt", ";", "ol&gt", ";", "element", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-xml/src/main/java/org/xwiki/xml/internal/html/filter/ListFilter.java#L117-L121
train
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-component/xwiki-commons-component-default/src/main/java/org/xwiki/component/annotation/ComponentDescriptorFactory.java
ComponentDescriptorFactory.createComponentDescriptor
private ComponentDescriptor createComponentDescriptor(Class<?> componentClass, String hint, Type componentRoleType) { DefaultComponentDescriptor descriptor = new DefaultComponentDescriptor(); descriptor.setRoleType(componentRoleType); descriptor.setImplementation(componentClass); ...
java
private ComponentDescriptor createComponentDescriptor(Class<?> componentClass, String hint, Type componentRoleType) { DefaultComponentDescriptor descriptor = new DefaultComponentDescriptor(); descriptor.setRoleType(componentRoleType); descriptor.setImplementation(componentClass); ...
[ "private", "ComponentDescriptor", "createComponentDescriptor", "(", "Class", "<", "?", ">", "componentClass", ",", "String", "hint", ",", "Type", "componentRoleType", ")", "{", "DefaultComponentDescriptor", "descriptor", "=", "new", "DefaultComponentDescriptor", "(", ")...
Create a component descriptor for the passed component implementation class, hint and component role class. @param componentClass the component implementation class @param hint the hint @param componentRoleType the component role type @return the component descriptor with resolved component dependencies
[ "Create", "a", "component", "descriptor", "for", "the", "passed", "component", "implementation", "class", "hint", "and", "component", "role", "class", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-component/xwiki-commons-component-default/src/main/java/org/xwiki/component/annotation/ComponentDescriptorFactory.java#L119-L140
train
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-component/xwiki-commons-component-default/src/main/java/org/xwiki/component/internal/StackingComponentEventManager.java
StackingComponentEventManager.flushEvents
public synchronized void flushEvents() { while (!this.events.isEmpty()) { ComponentEventEntry entry = this.events.pop(); sendEvent(entry.event, entry.descriptor, entry.componentManager); } }
java
public synchronized void flushEvents() { while (!this.events.isEmpty()) { ComponentEventEntry entry = this.events.pop(); sendEvent(entry.event, entry.descriptor, entry.componentManager); } }
[ "public", "synchronized", "void", "flushEvents", "(", ")", "{", "while", "(", "!", "this", ".", "events", ".", "isEmpty", "(", ")", ")", "{", "ComponentEventEntry", "entry", "=", "this", ".", "events", ".", "pop", "(", ")", ";", "sendEvent", "(", "entr...
Force to send all stored events.
[ "Force", "to", "send", "all", "stored", "events", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-component/xwiki-commons-component-default/src/main/java/org/xwiki/component/internal/StackingComponentEventManager.java#L88-L94
train
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-component/xwiki-commons-component-default/src/main/java/org/xwiki/component/internal/StackingComponentEventManager.java
StackingComponentEventManager.notifyComponentEvent
private void notifyComponentEvent(Event event, ComponentDescriptor<?> descriptor, ComponentManager componentManager) { if (this.shouldStack) { synchronized (this) { this.events.push(new ComponentEventEntry(event, descriptor, componentManager)); } } els...
java
private void notifyComponentEvent(Event event, ComponentDescriptor<?> descriptor, ComponentManager componentManager) { if (this.shouldStack) { synchronized (this) { this.events.push(new ComponentEventEntry(event, descriptor, componentManager)); } } els...
[ "private", "void", "notifyComponentEvent", "(", "Event", "event", ",", "ComponentDescriptor", "<", "?", ">", "descriptor", ",", "ComponentManager", "componentManager", ")", "{", "if", "(", "this", ".", "shouldStack", ")", "{", "synchronized", "(", "this", ")", ...
Send or stack the provided event dependening on the configuration. @param event the event send by the component manager @param descriptor the event related component descriptor. @param componentManager the event related component manager instance. @see #shouldStack(boolean)
[ "Send", "or", "stack", "the", "provided", "event", "dependening", "on", "the", "configuration", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-component/xwiki-commons-component-default/src/main/java/org/xwiki/component/internal/StackingComponentEventManager.java#L120-L130
train
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-component/xwiki-commons-component-default/src/main/java/org/xwiki/component/internal/StackingComponentEventManager.java
StackingComponentEventManager.sendEvent
private void sendEvent(Event event, ComponentDescriptor<?> descriptor, ComponentManager componentManager) { if (this.observationManager != null) { this.observationManager.notify(event, componentManager, descriptor); } }
java
private void sendEvent(Event event, ComponentDescriptor<?> descriptor, ComponentManager componentManager) { if (this.observationManager != null) { this.observationManager.notify(event, componentManager, descriptor); } }
[ "private", "void", "sendEvent", "(", "Event", "event", ",", "ComponentDescriptor", "<", "?", ">", "descriptor", ",", "ComponentManager", "componentManager", ")", "{", "if", "(", "this", ".", "observationManager", "!=", "null", ")", "{", "this", ".", "observati...
Send the event. @param event the event to send @param descriptor the event related component descriptor. @param componentManager the event related component manager instance.
[ "Send", "the", "event", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-component/xwiki-commons-component-default/src/main/java/org/xwiki/component/internal/StackingComponentEventManager.java#L139-L144
train
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-pkix/src/main/java/org/xwiki/crypto/pkix/CertifyingSigner.java
CertifyingSigner.getInstance
public static CertifyingSigner getInstance(boolean forSigning, CertifiedKeyPair certifier, SignerFactory factory) { return new CertifyingSigner(certifier.getCertificate(), factory.getInstance(forSigning, certifier.getPrivateKey())); }
java
public static CertifyingSigner getInstance(boolean forSigning, CertifiedKeyPair certifier, SignerFactory factory) { return new CertifyingSigner(certifier.getCertificate(), factory.getInstance(forSigning, certifier.getPrivateKey())); }
[ "public", "static", "CertifyingSigner", "getInstance", "(", "boolean", "forSigning", ",", "CertifiedKeyPair", "certifier", ",", "SignerFactory", "factory", ")", "{", "return", "new", "CertifyingSigner", "(", "certifier", ".", "getCertificate", "(", ")", ",", "factor...
Get a certifying signer instance from the given signer factory for a given certifier. @param forSigning true for signing, and false for verifying. @param certifier the certified key pair of the certifier. @param factory a signer factory to create the signer. @return a certifying signer.
[ "Get", "a", "certifying", "signer", "instance", "from", "the", "given", "signer", "factory", "for", "a", "given", "certifier", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-pkix/src/main/java/org/xwiki/crypto/pkix/CertifyingSigner.java#L67-L71
train
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-job/src/main/java/org/xwiki/job/AbstractJob.java
AbstractJob.jobStarting
protected void jobStarting() { this.jobContext.pushCurrentJob(this); this.observationManager.notify(new JobStartedEvent(getRequest().getId(), getType(), this.request), this); if (this.status instanceof AbstractJobStatus) { ((AbstractJobStatus<R>) this.status).setStartDate(new D...
java
protected void jobStarting() { this.jobContext.pushCurrentJob(this); this.observationManager.notify(new JobStartedEvent(getRequest().getId(), getType(), this.request), this); if (this.status instanceof AbstractJobStatus) { ((AbstractJobStatus<R>) this.status).setStartDate(new D...
[ "protected", "void", "jobStarting", "(", ")", "{", "this", ".", "jobContext", ".", "pushCurrentJob", "(", "this", ")", ";", "this", ".", "observationManager", ".", "notify", "(", "new", "JobStartedEvent", "(", "getRequest", "(", ")", ".", "getId", "(", ")"...
Called when the job is starting.
[ "Called", "when", "the", "job", "is", "starting", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-job/src/main/java/org/xwiki/job/AbstractJob.java#L248-L269
train
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-job/src/main/java/org/xwiki/job/AbstractJob.java
AbstractJob.jobFinished
protected void jobFinished(Throwable error) { this.lock.lock(); try { if (this.status instanceof AbstractJobStatus) { // Store error ((AbstractJobStatus) this.status).setError(error); } // Give a chance to any listener to do custo...
java
protected void jobFinished(Throwable error) { this.lock.lock(); try { if (this.status instanceof AbstractJobStatus) { // Store error ((AbstractJobStatus) this.status).setError(error); } // Give a chance to any listener to do custo...
[ "protected", "void", "jobFinished", "(", "Throwable", "error", ")", "{", "this", ".", "lock", ".", "lock", "(", ")", ";", "try", "{", "if", "(", "this", ".", "status", "instanceof", "AbstractJobStatus", ")", "{", "// Store error", "(", "(", "AbstractJobSta...
Called when the job is done. @param error the exception throw during execution of the job
[ "Called", "when", "the", "job", "is", "done", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-job/src/main/java/org/xwiki/job/AbstractJob.java#L276-L331
train
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-legacy/xwiki-commons-legacy-velocity/src/main/java/org/xwiki/velocity/introspection/LinkingUberspector.java
LinkingUberspector.initializeUberspector
protected void initializeUberspector(String classname) { // Avoids direct recursive calls if (!StringUtils.isEmpty(classname) && !classname.equals(this.getClass().getCanonicalName())) { Uberspect u = instantiateUberspector(classname); if (u == null) { return; ...
java
protected void initializeUberspector(String classname) { // Avoids direct recursive calls if (!StringUtils.isEmpty(classname) && !classname.equals(this.getClass().getCanonicalName())) { Uberspect u = instantiateUberspector(classname); if (u == null) { return; ...
[ "protected", "void", "initializeUberspector", "(", "String", "classname", ")", "{", "// Avoids direct recursive calls", "if", "(", "!", "StringUtils", ".", "isEmpty", "(", "classname", ")", "&&", "!", "classname", ".", "equals", "(", "this", ".", "getClass", "("...
Instantiates and initializes an uberspector class and adds it to the array. Also set the log and runtime services, if the class implements the proper interfaces. @param classname The name of the uberspector class to add to the chain.
[ "Instantiates", "and", "initializes", "an", "uberspector", "class", "and", "adds", "it", "to", "the", "array", ".", "Also", "set", "the", "log", "and", "runtime", "services", "if", "the", "class", "implements", "the", "proper", "interfaces", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-legacy/xwiki-commons-legacy-velocity/src/main/java/org/xwiki/velocity/introspection/LinkingUberspector.java#L117-L144
train
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-legacy/xwiki-commons-legacy-velocity/src/main/java/org/xwiki/velocity/introspection/LinkingUberspector.java
LinkingUberspector.instantiateUberspector
protected Uberspect instantiateUberspector(String classname) { Object o = null; try { o = ClassUtils.getNewInstance(classname); } catch (ClassNotFoundException e) { this.log.warn(String.format("The specified uberspector [%s]" + " does not exist or is n...
java
protected Uberspect instantiateUberspector(String classname) { Object o = null; try { o = ClassUtils.getNewInstance(classname); } catch (ClassNotFoundException e) { this.log.warn(String.format("The specified uberspector [%s]" + " does not exist or is n...
[ "protected", "Uberspect", "instantiateUberspector", "(", "String", "classname", ")", "{", "Object", "o", "=", "null", ";", "try", "{", "o", "=", "ClassUtils", ".", "getNewInstance", "(", "classname", ")", ";", "}", "catch", "(", "ClassNotFoundException", "e", ...
Tries to create an uberspector instance using reflection. @param classname The name of the uberspector class to instantiate. @return An instance of the specified Uberspector. If the class cannot be instantiated using the default constructor, or does not implement {@link Uberspect}, <code>null</code> is returned.
[ "Tries", "to", "create", "an", "uberspector", "instance", "using", "reflection", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-legacy/xwiki-commons-legacy-velocity/src/main/java/org/xwiki/velocity/introspection/LinkingUberspector.java#L153-L179
train
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/repository/internal/installed/DefaultInstalledExtensionRepository.java
DefaultInstalledExtensionRepository.validateExtension
private void validateExtension(LocalExtension localExtension, boolean dependencies) { Collection<String> namespaces = DefaultInstalledExtension.getNamespaces(localExtension); if (namespaces == null) { if (dependencies || !DefaultInstalledExtension.isDependency(localExtension, null)) { ...
java
private void validateExtension(LocalExtension localExtension, boolean dependencies) { Collection<String> namespaces = DefaultInstalledExtension.getNamespaces(localExtension); if (namespaces == null) { if (dependencies || !DefaultInstalledExtension.isDependency(localExtension, null)) { ...
[ "private", "void", "validateExtension", "(", "LocalExtension", "localExtension", ",", "boolean", "dependencies", ")", "{", "Collection", "<", "String", ">", "namespaces", "=", "DefaultInstalledExtension", ".", "getNamespaces", "(", "localExtension", ")", ";", "if", ...
Check extension validity and set it as not installed if not. @param localExtension the extension to validate @param dependencies true if dependencies should be validated @throws InvalidExtensionException when the passed extension is fond invalid
[ "Check", "extension", "validity", "and", "set", "it", "as", "not", "installed", "if", "not", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/repository/internal/installed/DefaultInstalledExtensionRepository.java#L228-L266
train
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/repository/internal/installed/DefaultInstalledExtensionRepository.java
DefaultInstalledExtensionRepository.validateExtension
private DefaultInstalledExtension validateExtension(LocalExtension localExtension, String namespace, Map<String, ExtensionDependency> managedDependencies) throws InvalidExtensionException { DefaultInstalledExtension installedExtension = this.extensions.get(localExtension.getId()); if (instal...
java
private DefaultInstalledExtension validateExtension(LocalExtension localExtension, String namespace, Map<String, ExtensionDependency> managedDependencies) throws InvalidExtensionException { DefaultInstalledExtension installedExtension = this.extensions.get(localExtension.getId()); if (instal...
[ "private", "DefaultInstalledExtension", "validateExtension", "(", "LocalExtension", "localExtension", ",", "String", "namespace", ",", "Map", "<", "String", ",", "ExtensionDependency", ">", "managedDependencies", ")", "throws", "InvalidExtensionException", "{", "DefaultInst...
Check extension validity against a specific namespace. @param localExtension the extension to validate @param namespace the namespace @param managedDependencies the managed dependencies @return the corresponding {@link DefaultInstalledExtension} @throws InvalidExtensionException when the passed extension is fond inval...
[ "Check", "extension", "validity", "against", "a", "specific", "namespace", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/repository/internal/installed/DefaultInstalledExtensionRepository.java#L340-L392
train
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-component/xwiki-commons-component-api/src/main/java/org/xwiki/component/util/ReflectionUtils.java
ReflectionUtils.setFieldValue
public static void setFieldValue(Object instanceContainingField, String fieldName, Object fieldValue) { // Find the class containing the field to set Class<?> targetClass = instanceContainingField.getClass(); while (targetClass != null) { for (Field field : targetClass.getDeclare...
java
public static void setFieldValue(Object instanceContainingField, String fieldName, Object fieldValue) { // Find the class containing the field to set Class<?> targetClass = instanceContainingField.getClass(); while (targetClass != null) { for (Field field : targetClass.getDeclare...
[ "public", "static", "void", "setFieldValue", "(", "Object", "instanceContainingField", ",", "String", "fieldName", ",", "Object", "fieldValue", ")", "{", "// Find the class containing the field to set", "Class", "<", "?", ">", "targetClass", "=", "instanceContainingField"...
Sets a value to a field using reflection even if the field is private. @param instanceContainingField the object containing the field @param fieldName the name of the field in the object @param fieldValue the value to set for the provided field
[ "Sets", "a", "value", "to", "a", "field", "using", "reflection", "even", "if", "the", "field", "is", "private", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-component/xwiki-commons-component-api/src/main/java/org/xwiki/component/util/ReflectionUtils.java#L155-L184
train
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-component/xwiki-commons-component-api/src/main/java/org/xwiki/component/util/ReflectionUtils.java
ReflectionUtils.resolveType
public static Type resolveType(Type targetType, Type rootType) { Type resolvedType; if (targetType instanceof ParameterizedType && rootType instanceof ParameterizedType) { ParameterizedType parameterizedType = (ParameterizedType) targetType; resolvedType = r...
java
public static Type resolveType(Type targetType, Type rootType) { Type resolvedType; if (targetType instanceof ParameterizedType && rootType instanceof ParameterizedType) { ParameterizedType parameterizedType = (ParameterizedType) targetType; resolvedType = r...
[ "public", "static", "Type", "resolveType", "(", "Type", "targetType", ",", "Type", "rootType", ")", "{", "Type", "resolvedType", ";", "if", "(", "targetType", "instanceof", "ParameterizedType", "&&", "rootType", "instanceof", "ParameterizedType", ")", "{", "Parame...
Find and replace the generic parameters with the real types. @param targetType the type for which to resolve the parameters @param rootType an extending class as Type @return the Type with resolved parameters
[ "Find", "and", "replace", "the", "generic", "parameters", "with", "the", "real", "types", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-component/xwiki-commons-component-api/src/main/java/org/xwiki/component/util/ReflectionUtils.java#L399-L414
train
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-component/xwiki-commons-component-api/src/main/java/org/xwiki/component/util/ReflectionUtils.java
ReflectionUtils.serializeType
@Unstable public static String serializeType(Type type) { if (type == null) { return null; } StringBuilder sb = new StringBuilder(); if (type instanceof ParameterizedType) { ParameterizedType parameterizedType = (ParameterizedType) type; Stri...
java
@Unstable public static String serializeType(Type type) { if (type == null) { return null; } StringBuilder sb = new StringBuilder(); if (type instanceof ParameterizedType) { ParameterizedType parameterizedType = (ParameterizedType) type; Stri...
[ "@", "Unstable", "public", "static", "String", "serializeType", "(", "Type", "type", ")", "{", "if", "(", "type", "==", "null", ")", "{", "return", "null", ";", "}", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", ")", ";", "if", "(", "type", ...
Serialize a type in a String using a standard definition. @param type the type to serialize. @return a string representing this type. @since 11.2RC1
[ "Serialize", "a", "type", "in", "a", "String", "using", "a", "standard", "definition", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-component/xwiki-commons-component-api/src/main/java/org/xwiki/component/util/ReflectionUtils.java#L610-L666
train
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-collection/src/main/java/org/xwiki/collection/SoftCache.java
SoftCache.get
public V get(K key, V defaultValue) { // Check if we only know an equal entry V sharedValue = get(key); if (sharedValue == null) { // If no entry can be found, store and return the passed one sharedValue = defaultValue; // Make sure to remember the entry...
java
public V get(K key, V defaultValue) { // Check if we only know an equal entry V sharedValue = get(key); if (sharedValue == null) { // If no entry can be found, store and return the passed one sharedValue = defaultValue; // Make sure to remember the entry...
[ "public", "V", "get", "(", "K", "key", ",", "V", "defaultValue", ")", "{", "// Check if we only know an equal entry", "V", "sharedValue", "=", "get", "(", "key", ")", ";", "if", "(", "sharedValue", "==", "null", ")", "{", "// If no entry can be found, store and ...
Get the value associated to the passed key. If no value can be found stored and return the passed default value. @param key the entry key @param defaultValue the default value @return the value associated to the passed key
[ "Get", "the", "value", "associated", "to", "the", "passed", "key", ".", "If", "no", "value", "can", "be", "found", "stored", "and", "return", "the", "passed", "default", "value", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-collection/src/main/java/org/xwiki/collection/SoftCache.java#L68-L83
train
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-collection/src/main/java/org/xwiki/collection/SoftCache.java
SoftCache.put
public void put(K key, V value) { this.lock.writeLock().lock(); try { this.map.put(key, new SoftReference<>(value)); } finally { this.lock.writeLock().unlock(); } }
java
public void put(K key, V value) { this.lock.writeLock().lock(); try { this.map.put(key, new SoftReference<>(value)); } finally { this.lock.writeLock().unlock(); } }
[ "public", "void", "put", "(", "K", "key", ",", "V", "value", ")", "{", "this", ".", "lock", ".", "writeLock", "(", ")", ".", "lock", "(", ")", ";", "try", "{", "this", ".", "map", ".", "put", "(", "key", ",", "new", "SoftReference", "<>", "(", ...
Associate passed key to passed value. @param key the entry key @param value the entry value
[ "Associate", "passed", "key", "to", "passed", "value", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-collection/src/main/java/org/xwiki/collection/SoftCache.java#L91-L100
train
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-cache/xwiki-commons-cache-infinispan/src/main/java/org/xwiki/cache/infinispan/internal/InfinispanCache.java
InfinispanCache.cacheEntryInserted
private void cacheEntryInserted(String key, T value) { InfinispanCacheEntryEvent<T> event = new InfinispanCacheEntryEvent<>(new InfinispanCacheEntry<T>(this, key, value)); T previousValue = this.preEventData.get(key); if (previousValue != null) { if (previousValue !...
java
private void cacheEntryInserted(String key, T value) { InfinispanCacheEntryEvent<T> event = new InfinispanCacheEntryEvent<>(new InfinispanCacheEntry<T>(this, key, value)); T previousValue = this.preEventData.get(key); if (previousValue != null) { if (previousValue !...
[ "private", "void", "cacheEntryInserted", "(", "String", "key", ",", "T", "value", ")", "{", "InfinispanCacheEntryEvent", "<", "T", ">", "event", "=", "new", "InfinispanCacheEntryEvent", "<>", "(", "new", "InfinispanCacheEntry", "<", "T", ">", "(", "this", ",",...
Dispatch data insertion event. @param key the entry key. @param value the entry value.
[ "Dispatch", "data", "insertion", "event", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-cache/xwiki-commons-cache-infinispan/src/main/java/org/xwiki/cache/infinispan/internal/InfinispanCache.java#L200-L216
train
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-cache/xwiki-commons-cache-infinispan/src/main/java/org/xwiki/cache/infinispan/internal/InfinispanCache.java
InfinispanCache.cacheEntryRemoved
private void cacheEntryRemoved(String key, T value) { InfinispanCacheEntryEvent<T> event = new InfinispanCacheEntryEvent<>(new InfinispanCacheEntry<T>(this, key, value)); sendEntryRemovedEvent(event); }
java
private void cacheEntryRemoved(String key, T value) { InfinispanCacheEntryEvent<T> event = new InfinispanCacheEntryEvent<>(new InfinispanCacheEntry<T>(this, key, value)); sendEntryRemovedEvent(event); }
[ "private", "void", "cacheEntryRemoved", "(", "String", "key", ",", "T", "value", ")", "{", "InfinispanCacheEntryEvent", "<", "T", ">", "event", "=", "new", "InfinispanCacheEntryEvent", "<>", "(", "new", "InfinispanCacheEntry", "<", "T", ">", "(", "this", ",", ...
Dispatch data remove event. @param key the entry key. @param value the entry value.
[ "Dispatch", "data", "remove", "event", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-cache/xwiki-commons-cache-infinispan/src/main/java/org/xwiki/cache/infinispan/internal/InfinispanCache.java#L224-L230
train
xwiki/xwiki-commons
xwiki-commons-tools/xwiki-commons-tool-enforcers/xwiki-commons-tool-enforcer-dependencies/src/main/java/org/xwiki/tool/enforcer/ExternalExtensionCheck.java
ExternalExtensionCheck.checkNonCoreGroupId
private void checkNonCoreGroupId(Model model) throws EnforcerRuleException { String groupId = model.getGroupId(); if (groupId.equals(CORE_GROUP_ID) || (groupId.startsWith(CORE_GROUP_ID_PREFIX) && !groupId.equals(CONTRIB_GROUP_ID) && !groupId.startsWith(CONTRIB_GROUP_ID_PREFIX))) { ...
java
private void checkNonCoreGroupId(Model model) throws EnforcerRuleException { String groupId = model.getGroupId(); if (groupId.equals(CORE_GROUP_ID) || (groupId.startsWith(CORE_GROUP_ID_PREFIX) && !groupId.equals(CONTRIB_GROUP_ID) && !groupId.startsWith(CONTRIB_GROUP_ID_PREFIX))) { ...
[ "private", "void", "checkNonCoreGroupId", "(", "Model", "model", ")", "throws", "EnforcerRuleException", "{", "String", "groupId", "=", "model", ".", "getGroupId", "(", ")", ";", "if", "(", "groupId", ".", "equals", "(", "CORE_GROUP_ID", ")", "||", "(", "gro...
Make sure the group id does not start with "org.xwiki" or starts with "org.xwiki.contrib".
[ "Make", "sure", "the", "group", "id", "does", "not", "start", "with", "org", ".", "xwiki", "or", "starts", "with", "org", ".", "xwiki", ".", "contrib", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-tools/xwiki-commons-tool-enforcers/xwiki-commons-tool-enforcer-dependencies/src/main/java/org/xwiki/tool/enforcer/ExternalExtensionCheck.java#L110-L118
train
xwiki/xwiki-commons
xwiki-commons-tools/xwiki-commons-tool-enforcers/xwiki-commons-tool-enforcer-dependencies/src/main/java/org/xwiki/tool/enforcer/ExternalExtensionCheck.java
ExternalExtensionCheck.checkNonCoreArtifactId
private void checkNonCoreArtifactId(Model model) throws EnforcerRuleException { String artifactId = model.getArtifactId(); for (String prefix : CORE_ARTIFACT_ID_PREFIXES) { if (artifactId.startsWith(prefix)) { throw new EnforcerRuleException("The [%s] artifact id prefix i...
java
private void checkNonCoreArtifactId(Model model) throws EnforcerRuleException { String artifactId = model.getArtifactId(); for (String prefix : CORE_ARTIFACT_ID_PREFIXES) { if (artifactId.startsWith(prefix)) { throw new EnforcerRuleException("The [%s] artifact id prefix i...
[ "private", "void", "checkNonCoreArtifactId", "(", "Model", "model", ")", "throws", "EnforcerRuleException", "{", "String", "artifactId", "=", "model", ".", "getArtifactId", "(", ")", ";", "for", "(", "String", "prefix", ":", "CORE_ARTIFACT_ID_PREFIXES", ")", "{", ...
Make sure that non core artifacts don't use reserved artifact prefixes.
[ "Make", "sure", "that", "non", "core", "artifacts", "don", "t", "use", "reserved", "artifact", "prefixes", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-tools/xwiki-commons-tool-enforcers/xwiki-commons-tool-enforcer-dependencies/src/main/java/org/xwiki/tool/enforcer/ExternalExtensionCheck.java#L123-L131
train
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-filter/xwiki-commons-filter-xml/src/main/java/org/xwiki/filter/xml/internal/output/FilterStreamXMLStreamWriter.java
FilterStreamXMLStreamWriter.writeStartDocument
public void writeStartDocument(String encoding, String version) throws FilterException { try { this.writer.writeStartDocument(encoding, version); } catch (XMLStreamException e) { throw new FilterException("Failed to write start document", e); } }
java
public void writeStartDocument(String encoding, String version) throws FilterException { try { this.writer.writeStartDocument(encoding, version); } catch (XMLStreamException e) { throw new FilterException("Failed to write start document", e); } }
[ "public", "void", "writeStartDocument", "(", "String", "encoding", ",", "String", "version", ")", "throws", "FilterException", "{", "try", "{", "this", ".", "writer", ".", "writeStartDocument", "(", "encoding", ",", "version", ")", ";", "}", "catch", "(", "X...
Write the XML Declaration. @param encoding the XML version @param version the XML encoding @throws FilterException
[ "Write", "the", "XML", "Declaration", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-filter/xwiki-commons-filter-xml/src/main/java/org/xwiki/filter/xml/internal/output/FilterStreamXMLStreamWriter.java#L108-L115
train
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-properties/src/main/java/org/xwiki/properties/internal/DefaultConverterManager.java
DefaultConverterManager.getTypeName
private String getTypeName(Type type) { String name; if (type instanceof Class) { name = ((Class<?>) type).getName(); } else if (type instanceof ParameterizedType) { name = ((Class<?>) ((ParameterizedType) type).getRawType()).getName(); } else { na...
java
private String getTypeName(Type type) { String name; if (type instanceof Class) { name = ((Class<?>) type).getName(); } else if (type instanceof ParameterizedType) { name = ((Class<?>) ((ParameterizedType) type).getRawType()).getName(); } else { na...
[ "private", "String", "getTypeName", "(", "Type", "type", ")", "{", "String", "name", ";", "if", "(", "type", "instanceof", "Class", ")", "{", "name", "=", "(", "(", "Class", "<", "?", ">", ")", "type", ")", ".", "getName", "(", ")", ";", "}", "el...
Get class name without generics. @param type the type @return type name without generics
[ "Get", "class", "name", "without", "generics", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-properties/src/main/java/org/xwiki/properties/internal/DefaultConverterManager.java#L184-L196
train
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-properties/src/main/java/org/xwiki/properties/internal/DefaultConverterManager.java
DefaultConverterManager.getTypeGenericName
private String getTypeGenericName(Type type) { StringBuilder sb = new StringBuilder(getTypeName(type)); if (type instanceof ParameterizedType) { ParameterizedType parameterizedType = (ParameterizedType) type; Type[] generics = parameterizedType.getActualTypeArguments(); ...
java
private String getTypeGenericName(Type type) { StringBuilder sb = new StringBuilder(getTypeName(type)); if (type instanceof ParameterizedType) { ParameterizedType parameterizedType = (ParameterizedType) type; Type[] generics = parameterizedType.getActualTypeArguments(); ...
[ "private", "String", "getTypeGenericName", "(", "Type", "type", ")", "{", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", "getTypeName", "(", "type", ")", ")", ";", "if", "(", "type", "instanceof", "ParameterizedType", ")", "{", "ParameterizedType", "...
Get type name. @param type the type @return type name
[ "Get", "type", "name", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-properties/src/main/java/org/xwiki/properties/internal/DefaultConverterManager.java#L204-L225
train
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/repository/internal/core/DefaultCoreExtensionRepository.java
DefaultCoreExtensionRepository.updateExtensions
public void updateExtensions() { // Start a background thread to get more details about the found extensions Thread thread = new Thread(new Runnable() { @Override public void run() { DefaultCoreExtensionRepository.this.scanner ...
java
public void updateExtensions() { // Start a background thread to get more details about the found extensions Thread thread = new Thread(new Runnable() { @Override public void run() { DefaultCoreExtensionRepository.this.scanner ...
[ "public", "void", "updateExtensions", "(", ")", "{", "// Start a background thread to get more details about the found extensions", "Thread", "thread", "=", "new", "Thread", "(", "new", "Runnable", "(", ")", "{", "@", "Override", "public", "void", "run", "(", ")", "...
Update core extensions only if there is any remote repository and it's not disabled.
[ "Update", "core", "extensions", "only", "if", "there", "is", "any", "remote", "repository", "and", "it", "s", "not", "disabled", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/repository/internal/core/DefaultCoreExtensionRepository.java#L129-L146
train
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-job/src/main/java/org/xwiki/job/AbstractJobStatus.java
AbstractJobStatus.startListening
public void startListening() { // Register progress listener this.observationManager.addListener(new WrappedThreadEventListener(this.progress)); // Isolate log for the job status this.logListener = new LoggerListener(LoggerListener.class.getName() + '_' + hashCode(), this.logs); ...
java
public void startListening() { // Register progress listener this.observationManager.addListener(new WrappedThreadEventListener(this.progress)); // Isolate log for the job status this.logListener = new LoggerListener(LoggerListener.class.getName() + '_' + hashCode(), this.logs); ...
[ "public", "void", "startListening", "(", ")", "{", "// Register progress listener", "this", ".", "observationManager", ".", "addListener", "(", "new", "WrappedThreadEventListener", "(", "this", ".", "progress", ")", ")", ";", "// Isolate log for the job status", "this",...
Start listening to events.
[ "Start", "listening", "to", "events", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-job/src/main/java/org/xwiki/job/AbstractJobStatus.java#L190-L202
train
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-job/src/main/java/org/xwiki/job/AbstractJobStatus.java
AbstractJobStatus.stopListening
public void stopListening() { if (isIsolated()) { this.loggerManager.popLogListener(); } else { this.observationManager.removeListener(this.logListener.getName()); } this.observationManager.removeListener(this.progress.getName()); // Make sure the pro...
java
public void stopListening() { if (isIsolated()) { this.loggerManager.popLogListener(); } else { this.observationManager.removeListener(this.logListener.getName()); } this.observationManager.removeListener(this.progress.getName()); // Make sure the pro...
[ "public", "void", "stopListening", "(", ")", "{", "if", "(", "isIsolated", "(", ")", ")", "{", "this", ".", "loggerManager", ".", "popLogListener", "(", ")", ";", "}", "else", "{", "this", ".", "observationManager", ".", "removeListener", "(", "this", "....
Stop listening to events.
[ "Stop", "listening", "to", "events", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-job/src/main/java/org/xwiki/job/AbstractJobStatus.java#L207-L218
train
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-diff/xwiki-commons-diff-script/src/main/java/org/xwiki/diff/script/DiffDisplayerScriptService.java
DiffDisplayerScriptService.inline
public <E> List<InlineDiffChunk<E>> inline(List<E> previous, List<E> next) { setError(null); try { return this.inlineDiffDisplayer.display(this.diffManager.diff(previous, next, null)); } catch (DiffException e) { setError(e); return null; } }
java
public <E> List<InlineDiffChunk<E>> inline(List<E> previous, List<E> next) { setError(null); try { return this.inlineDiffDisplayer.display(this.diffManager.diff(previous, next, null)); } catch (DiffException e) { setError(e); return null; } }
[ "public", "<", "E", ">", "List", "<", "InlineDiffChunk", "<", "E", ">", ">", "inline", "(", "List", "<", "E", ">", "previous", ",", "List", "<", "E", ">", "next", ")", "{", "setError", "(", "null", ")", ";", "try", "{", "return", "this", ".", "...
Builds an in-line diff between two versions of a list of elements. @param previous the previous version @param next the next version @param <E> the type of elements that are compared to produce the diff @return the list of in-line diff chunks
[ "Builds", "an", "in", "-", "line", "diff", "between", "two", "versions", "of", "a", "list", "of", "elements", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-diff/xwiki-commons-diff-script/src/main/java/org/xwiki/diff/script/DiffDisplayerScriptService.java#L97-L107
train
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-diff/xwiki-commons-diff-script/src/main/java/org/xwiki/diff/script/DiffDisplayerScriptService.java
DiffDisplayerScriptService.inline
public List<InlineDiffChunk<Character>> inline(String previous, String next) { setError(null); try { return this.inlineDiffDisplayer .display(this.diffManager.diff(this.charSplitter.split(previous), this.charSplitter.split(next), null)); } catch (DiffException e)...
java
public List<InlineDiffChunk<Character>> inline(String previous, String next) { setError(null); try { return this.inlineDiffDisplayer .display(this.diffManager.diff(this.charSplitter.split(previous), this.charSplitter.split(next), null)); } catch (DiffException e)...
[ "public", "List", "<", "InlineDiffChunk", "<", "Character", ">", ">", "inline", "(", "String", "previous", ",", "String", "next", ")", "{", "setError", "(", "null", ")", ";", "try", "{", "return", "this", ".", "inlineDiffDisplayer", ".", "display", "(", ...
Builds an in-line diff between two versions of a text. @param previous the previous version @param next the next version @return the list of in-line diff chunks
[ "Builds", "an", "in", "-", "line", "diff", "between", "two", "versions", "of", "a", "text", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-diff/xwiki-commons-diff-script/src/main/java/org/xwiki/diff/script/DiffDisplayerScriptService.java#L116-L127
train
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-pkix/src/main/java/org/xwiki/crypto/pkix/internal/BcStoreX509CertificateProvider.java
BcStoreX509CertificateProvider.getCertificate
public X509CertificateHolder getCertificate(Selector selector) { try { return (X509CertificateHolder) this.store.getMatches(selector).iterator().next(); } catch (Throwable t) { return null; } }
java
public X509CertificateHolder getCertificate(Selector selector) { try { return (X509CertificateHolder) this.store.getMatches(selector).iterator().next(); } catch (Throwable t) { return null; } }
[ "public", "X509CertificateHolder", "getCertificate", "(", "Selector", "selector", ")", "{", "try", "{", "return", "(", "X509CertificateHolder", ")", "this", ".", "store", ".", "getMatches", "(", "selector", ")", ".", "iterator", "(", ")", ".", "next", "(", "...
Get the first certificate matching the provided selector. @param selector the selector. @return a certificate holder.
[ "Get", "the", "first", "certificate", "matching", "the", "provided", "selector", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-pkix/src/main/java/org/xwiki/crypto/pkix/internal/BcStoreX509CertificateProvider.java#L76-L83
train
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-component/xwiki-commons-component-default/src/main/java/org/xwiki/component/annotation/ComponentAnnotationLoader.java
ComponentAnnotationLoader.initialize
public void initialize(ComponentManager manager, ClassLoader classLoader) { try { // Find all declared components by retrieving the list defined in COMPONENT_LIST. List<ComponentDeclaration> componentDeclarations = getDeclaredComponents(classLoader, COMPONENT_LIST); // F...
java
public void initialize(ComponentManager manager, ClassLoader classLoader) { try { // Find all declared components by retrieving the list defined in COMPONENT_LIST. List<ComponentDeclaration> componentDeclarations = getDeclaredComponents(classLoader, COMPONENT_LIST); // F...
[ "public", "void", "initialize", "(", "ComponentManager", "manager", ",", "ClassLoader", "classLoader", ")", "{", "try", "{", "// Find all declared components by retrieving the list defined in COMPONENT_LIST.", "List", "<", "ComponentDeclaration", ">", "componentDeclarations", "...
Loads all components defined using annotations. @param manager the component manager to use to dynamically register components @param classLoader the classloader to use to look for the Component list declaration file ( {@code META-INF/components.txt})
[ "Loads", "all", "components", "defined", "using", "annotations", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-component/xwiki-commons-component-default/src/main/java/org/xwiki/component/annotation/ComponentAnnotationLoader.java#L99-L126
train
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-component/xwiki-commons-component-default/src/main/java/org/xwiki/component/annotation/ComponentAnnotationLoader.java
ComponentAnnotationLoader.getComponentsDescriptors
private Collection<ComponentDescriptor<?>> getComponentsDescriptors(ClassLoader classLoader, List<ComponentDeclaration> componentDeclarations) { // For each component class name found, load its class and use introspection to find the necessary // annotations required to create a Component De...
java
private Collection<ComponentDescriptor<?>> getComponentsDescriptors(ClassLoader classLoader, List<ComponentDeclaration> componentDeclarations) { // For each component class name found, load its class and use introspection to find the necessary // annotations required to create a Component De...
[ "private", "Collection", "<", "ComponentDescriptor", "<", "?", ">", ">", "getComponentsDescriptors", "(", "ClassLoader", "classLoader", ",", "List", "<", "ComponentDeclaration", ">", "componentDeclarations", ")", "{", "// For each component class name found, load its class an...
Find all component descriptors out of component declarations. @param classLoader the classloader used to load the component declaration implementation class. @param componentDeclarations the list of component declarations for which you want to build the component descriptor. @return a collection of component descripto...
[ "Find", "all", "component", "descriptors", "out", "of", "component", "declarations", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-component/xwiki-commons-component-default/src/main/java/org/xwiki/component/annotation/ComponentAnnotationLoader.java#L150-L184
train
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-component/xwiki-commons-component-default/src/main/java/org/xwiki/component/annotation/ComponentAnnotationLoader.java
ComponentAnnotationLoader.getDeclaredComponents
private List<ComponentDeclaration> getDeclaredComponents(ClassLoader classLoader, String location) throws IOException { List<ComponentDeclaration> annotatedClassNames = new ArrayList<>(); Enumeration<URL> urls = classLoader.getResources(location); while (urls.hasMoreElements()) { ...
java
private List<ComponentDeclaration> getDeclaredComponents(ClassLoader classLoader, String location) throws IOException { List<ComponentDeclaration> annotatedClassNames = new ArrayList<>(); Enumeration<URL> urls = classLoader.getResources(location); while (urls.hasMoreElements()) { ...
[ "private", "List", "<", "ComponentDeclaration", ">", "getDeclaredComponents", "(", "ClassLoader", "classLoader", ",", "String", "location", ")", "throws", "IOException", "{", "List", "<", "ComponentDeclaration", ">", "annotatedClassNames", "=", "new", "ArrayList", "<>...
Get all components listed in the passed resource file. @param classLoader the classloader to use to find the resources @param location the name of the resources to look for @return the list of component implementation class names @throws IOException in case of an error loading the component list resource @since 3.3M1
[ "Get", "all", "components", "listed", "in", "the", "passed", "resource", "file", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-component/xwiki-commons-component-default/src/main/java/org/xwiki/component/annotation/ComponentAnnotationLoader.java#L466-L486
train
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-component/xwiki-commons-component-default/src/main/java/org/xwiki/component/annotation/ComponentAnnotationLoader.java
ComponentAnnotationLoader.getDeclaredComponentsFromJAR
public List<ComponentDeclaration> getDeclaredComponentsFromJAR(InputStream jarFile) throws IOException { ZipInputStream zis = new ZipInputStream(jarFile); List<ComponentDeclaration> componentDeclarations = null; List<ComponentDeclaration> componentOverrideDeclarations = null; for (...
java
public List<ComponentDeclaration> getDeclaredComponentsFromJAR(InputStream jarFile) throws IOException { ZipInputStream zis = new ZipInputStream(jarFile); List<ComponentDeclaration> componentDeclarations = null; List<ComponentDeclaration> componentOverrideDeclarations = null; for (...
[ "public", "List", "<", "ComponentDeclaration", ">", "getDeclaredComponentsFromJAR", "(", "InputStream", "jarFile", ")", "throws", "IOException", "{", "ZipInputStream", "zis", "=", "new", "ZipInputStream", "(", "jarFile", ")", ";", "List", "<", "ComponentDeclaration", ...
Get all components listed in a JAR file. @param jarFile the JAR file to parse @return the list of component declaration (implementation class names and priorities) @throws IOException in case of an error loading the component list resource
[ "Get", "all", "components", "listed", "in", "a", "JAR", "file", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-component/xwiki-commons-component-default/src/main/java/org/xwiki/component/annotation/ComponentAnnotationLoader.java#L536-L565
train
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-pkix/src/main/java/org/xwiki/crypto/pkix/internal/BcX509CertificateFactory.java
BcX509CertificateFactory.convert
public CertifiedPublicKey convert(X509CertificateHolder cert) { if (cert == null) { return null; } return new BcX509CertifiedPublicKey(cert, this.factory); }
java
public CertifiedPublicKey convert(X509CertificateHolder cert) { if (cert == null) { return null; } return new BcX509CertifiedPublicKey(cert, this.factory); }
[ "public", "CertifiedPublicKey", "convert", "(", "X509CertificateHolder", "cert", ")", "{", "if", "(", "cert", "==", "null", ")", "{", "return", "null", ";", "}", "return", "new", "BcX509CertifiedPublicKey", "(", "cert", ",", "this", ".", "factory", ")", ";",...
Convert Bouncy Castle certificate holder. @param cert a certificate holder. @return a certified public key. @since 6.0M1
[ "Convert", "Bouncy", "Castle", "certificate", "holder", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-pkix/src/main/java/org/xwiki/crypto/pkix/internal/BcX509CertificateFactory.java#L61-L67
train
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-xml/src/main/java/org/xwiki/xml/internal/html/filter/BodyFilter.java
BodyFilter.surroundWithParagraph
private void surroundWithParagraph(Document document, Node body, Node beginNode, Node endNode) { // surround all the nodes starting with the marker node with a paragraph. Element paragraph = document.createElement(TAG_P); body.insertBefore(paragraph, beginNode); Node child = beginNod...
java
private void surroundWithParagraph(Document document, Node body, Node beginNode, Node endNode) { // surround all the nodes starting with the marker node with a paragraph. Element paragraph = document.createElement(TAG_P); body.insertBefore(paragraph, beginNode); Node child = beginNod...
[ "private", "void", "surroundWithParagraph", "(", "Document", "document", ",", "Node", "body", ",", "Node", "beginNode", ",", "Node", "endNode", ")", "{", "// surround all the nodes starting with the marker node with a paragraph.", "Element", "paragraph", "=", "document", ...
Surround passed nodes with a paragraph element. @param document the document to use to create the new paragraph element @param body the body under which to wrap non valid elements with paragraphs @param beginNode the first node where to start the wrapping @param endNode the last node where to stop the wrapping. If nul...
[ "Surround", "passed", "nodes", "with", "a", "paragraph", "element", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-xml/src/main/java/org/xwiki/xml/internal/html/filter/BodyFilter.java#L140-L151
train
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-properties/src/main/java/org/xwiki/properties/internal/DefaultBeanManager.java
DefaultBeanManager.validateBean
private void validateBean(Object bean) throws PropertyException { if (getValidatorFactory() != null) { Validator validator = getValidatorFactory().getValidator(); Set<ConstraintViolation<Object>> constraintViolations = validator.validate(bean); if (!constraintViolations.i...
java
private void validateBean(Object bean) throws PropertyException { if (getValidatorFactory() != null) { Validator validator = getValidatorFactory().getValidator(); Set<ConstraintViolation<Object>> constraintViolations = validator.validate(bean); if (!constraintViolations.i...
[ "private", "void", "validateBean", "(", "Object", "bean", ")", "throws", "PropertyException", "{", "if", "(", "getValidatorFactory", "(", ")", "!=", "null", ")", "{", "Validator", "validator", "=", "getValidatorFactory", "(", ")", ".", "getValidator", "(", ")"...
Validate populated values based on JSR 303. @param bean the bean to validate @throws PropertyException validation error
[ "Validate", "populated", "values", "based", "on", "JSR", "303", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-properties/src/main/java/org/xwiki/properties/internal/DefaultBeanManager.java#L205-L215
train
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-diff/xwiki-commons-diff-script/src/main/java/org/xwiki/diff/script/DiffScriptService.java
DiffScriptService.diff
public <E> DiffResult<E> diff(List<E> previous, List<E> next, DiffConfiguration<E> configuration) { DiffResult<E> result; try { result = this.diffManager.diff(previous, next, configuration); } catch (DiffException e) { result = new DefaultDiffResult<E>(previous, next)...
java
public <E> DiffResult<E> diff(List<E> previous, List<E> next, DiffConfiguration<E> configuration) { DiffResult<E> result; try { result = this.diffManager.diff(previous, next, configuration); } catch (DiffException e) { result = new DefaultDiffResult<E>(previous, next)...
[ "public", "<", "E", ">", "DiffResult", "<", "E", ">", "diff", "(", "List", "<", "E", ">", "previous", ",", "List", "<", "E", ">", "next", ",", "DiffConfiguration", "<", "E", ">", "configuration", ")", "{", "DiffResult", "<", "E", ">", "result", ";"...
Produce a diff between the two provided versions. @param <E> the type of compared elements @param previous the previous version of the content to compare @param next the next version of the content to compare @param configuration the configuration of the diff behavior @return the result of the diff
[ "Produce", "a", "diff", "between", "the", "two", "provided", "versions", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-diff/xwiki-commons-diff-script/src/main/java/org/xwiki/diff/script/DiffScriptService.java#L93-L104
train
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-diff/xwiki-commons-diff-script/src/main/java/org/xwiki/diff/script/DiffScriptService.java
DiffScriptService.merge
public <E> MergeResult<E> merge(List<E> commonAncestor, List<E> next, List<E> current, MergeConfiguration<E> configuration) { MergeResult<E> result; try { result = this.diffManager.merge(commonAncestor, next, current, configuration); } catch (MergeException e) { ...
java
public <E> MergeResult<E> merge(List<E> commonAncestor, List<E> next, List<E> current, MergeConfiguration<E> configuration) { MergeResult<E> result; try { result = this.diffManager.merge(commonAncestor, next, current, configuration); } catch (MergeException e) { ...
[ "public", "<", "E", ">", "MergeResult", "<", "E", ">", "merge", "(", "List", "<", "E", ">", "commonAncestor", ",", "List", "<", "E", ">", "next", ",", "List", "<", "E", ">", "current", ",", "MergeConfiguration", "<", "E", ">", "configuration", ")", ...
Execute a 3-way merge on provided versions. @param <E> the type of compared elements @param commonAncestor the common ancestor of the two versions of the content to compare @param next the next version of the content to compare @param current the current version of the content to compare @param configuration the confi...
[ "Execute", "a", "3", "-", "way", "merge", "on", "provided", "versions", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-diff/xwiki-commons-diff-script/src/main/java/org/xwiki/diff/script/DiffScriptService.java#L116-L128
train
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-blame/xwiki-commons-blame-api/src/main/java/org/xwiki/blame/internal/DefaultAnnotatedContent.java
DefaultAnnotatedContent.analyseRevision
void analyseRevision(R revision, List<E> previous) { if (currentRevision == null) { return; } if (previous == null || previous.isEmpty()) { resolveRemainingToCurrent(); } else { resolveToCurrent(DiffUtils.diff(currentRevisionContent, previous).get...
java
void analyseRevision(R revision, List<E> previous) { if (currentRevision == null) { return; } if (previous == null || previous.isEmpty()) { resolveRemainingToCurrent(); } else { resolveToCurrent(DiffUtils.diff(currentRevisionContent, previous).get...
[ "void", "analyseRevision", "(", "R", "revision", ",", "List", "<", "E", ">", "previous", ")", "{", "if", "(", "currentRevision", "==", "null", ")", "{", "return", ";", "}", "if", "(", "previous", "==", "null", "||", "previous", ".", "isEmpty", "(", "...
Resolve revision of line to current revision based on given previous content, and prepare for next analysis. @param revision the revision of the content provided. @param previous the content in a previous revision.
[ "Resolve", "revision", "of", "line", "to", "current", "revision", "based", "on", "given", "previous", "content", "and", "prepare", "for", "next", "analysis", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-blame/xwiki-commons-blame-api/src/main/java/org/xwiki/blame/internal/DefaultAnnotatedContent.java#L118-L132
train
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-blame/xwiki-commons-blame-api/src/main/java/org/xwiki/blame/internal/DefaultAnnotatedContent.java
DefaultAnnotatedContent.resolveToCurrent
private void resolveToCurrent(List<Delta<E>> deltas) { int lineOffset = 0; for (Delta<E> d : deltas) { Chunk<E> original = d.getOriginal(); Chunk<E> revised = d.getRevised(); int pos = original.getPosition() + lineOffset; // delete lines ...
java
private void resolveToCurrent(List<Delta<E>> deltas) { int lineOffset = 0; for (Delta<E> d : deltas) { Chunk<E> original = d.getOriginal(); Chunk<E> revised = d.getRevised(); int pos = original.getPosition() + lineOffset; // delete lines ...
[ "private", "void", "resolveToCurrent", "(", "List", "<", "Delta", "<", "E", ">", ">", "deltas", ")", "{", "int", "lineOffset", "=", "0", ";", "for", "(", "Delta", "<", "E", ">", "d", ":", "deltas", ")", "{", "Chunk", "<", "E", ">", "original", "=...
Resolve revision of line to current revision based on given previous content. Thanks to Michael Schierl <schierlm%40gmx.de> for sharing this code on StackOverflow. @param deltas the delta to apply to current content to move to previous revision.
[ "Resolve", "revision", "of", "line", "to", "current", "revision", "based", "on", "given", "previous", "content", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-blame/xwiki-commons-blame-api/src/main/java/org/xwiki/blame/internal/DefaultAnnotatedContent.java#L141-L166
train
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-blame/xwiki-commons-blame-api/src/main/java/org/xwiki/blame/internal/DefaultAnnotatedContent.java
DefaultAnnotatedContent.resolveRemainingToCurrent
private void resolveRemainingToCurrent() { for (int i = 0; i < this.size; i++) { if (sourceRevisions.get(i) == null) { sourceRevisions.set(i, currentRevision); } } }
java
private void resolveRemainingToCurrent() { for (int i = 0; i < this.size; i++) { if (sourceRevisions.get(i) == null) { sourceRevisions.set(i, currentRevision); } } }
[ "private", "void", "resolveRemainingToCurrent", "(", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "this", ".", "size", ";", "i", "++", ")", "{", "if", "(", "sourceRevisions", ".", "get", "(", "i", ")", "==", "null", ")", "{", "sourc...
Resolve all line remaining without revision to current.
[ "Resolve", "all", "line", "remaining", "without", "revision", "to", "current", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-blame/xwiki-commons-blame-api/src/main/java/org/xwiki/blame/internal/DefaultAnnotatedContent.java#L171-L178
train
xwiki/xwiki-commons
xwiki-commons-tools/xwiki-commons-tool-xar/xwiki-commons-tool-xar-plugin/src/main/java/org/xwiki/tool/xar/XARMojo.java
XARMojo.performArchive
private void performArchive() throws Exception { // The source dir points to the target/classes directory where the Maven resources plugin // has copied the XAR files during the process-resources phase. // For package.xml, however, we look in the resources directory (i.e. src/main/resources)...
java
private void performArchive() throws Exception { // The source dir points to the target/classes directory where the Maven resources plugin // has copied the XAR files during the process-resources phase. // For package.xml, however, we look in the resources directory (i.e. src/main/resources)...
[ "private", "void", "performArchive", "(", ")", "throws", "Exception", "{", "// The source dir points to the target/classes directory where the Maven resources plugin", "// has copied the XAR files during the process-resources phase.", "// For package.xml, however, we look in the resources direct...
Create the XAR by zipping the resource files. @throws Exception if the zipping failed for some reason
[ "Create", "the", "XAR", "by", "zipping", "the", "resource", "files", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-tools/xwiki-commons-tool-xar/xwiki-commons-tool-xar-plugin/src/main/java/org/xwiki/tool/xar/XARMojo.java#L95-L140
train
xwiki/xwiki-commons
xwiki-commons-tools/xwiki-commons-tool-xar/xwiki-commons-tool-xar-plugin/src/main/java/org/xwiki/tool/xar/XARMojo.java
XARMojo.unpackDependentXARs
private void unpackDependentXARs() throws MojoExecutionException { Set<Artifact> artifacts = this.project.getArtifacts(); if (artifacts != null) { for (Artifact artifact : artifacts) { if (!artifact.isOptional() && "xar".equals(artifact.getType())) { u...
java
private void unpackDependentXARs() throws MojoExecutionException { Set<Artifact> artifacts = this.project.getArtifacts(); if (artifacts != null) { for (Artifact artifact : artifacts) { if (!artifact.isOptional() && "xar".equals(artifact.getType())) { u...
[ "private", "void", "unpackDependentXARs", "(", ")", "throws", "MojoExecutionException", "{", "Set", "<", "Artifact", ">", "artifacts", "=", "this", ".", "project", ".", "getArtifacts", "(", ")", ";", "if", "(", "artifacts", "!=", "null", ")", "{", "for", "...
Unpack XAR dependencies before pack then into it. @throws MojoExecutionException error when unpack dependencies.
[ "Unpack", "XAR", "dependencies", "before", "pack", "then", "into", "it", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-tools/xwiki-commons-tool-xar/xwiki-commons-tool-xar-plugin/src/main/java/org/xwiki/tool/xar/XARMojo.java#L262-L272
train
xwiki/xwiki-commons
xwiki-commons-tools/xwiki-commons-tool-xar/xwiki-commons-tool-xar-plugin/src/main/java/org/xwiki/tool/xar/XARMojo.java
XARMojo.generatePackageXml
private void generatePackageXml(File packageFile, Collection<ArchiveEntry> files) throws Exception { getLog().info(String.format("Generating package.xml descriptor at [%s]", packageFile.getPath())); OutputFormat outputFormat = new OutputFormat("", true); outputFormat.setEncoding(this.encodi...
java
private void generatePackageXml(File packageFile, Collection<ArchiveEntry> files) throws Exception { getLog().info(String.format("Generating package.xml descriptor at [%s]", packageFile.getPath())); OutputFormat outputFormat = new OutputFormat("", true); outputFormat.setEncoding(this.encodi...
[ "private", "void", "generatePackageXml", "(", "File", "packageFile", ",", "Collection", "<", "ArchiveEntry", ">", "files", ")", "throws", "Exception", "{", "getLog", "(", ")", ".", "info", "(", "String", ".", "format", "(", "\"Generating package.xml descriptor at ...
Create and add package configuration file to the package. @param packageFile the package when to add configuration file. @param files the files in the package. @throws Exception error when writing the configuration file.
[ "Create", "and", "add", "package", "configuration", "file", "to", "the", "package", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-tools/xwiki-commons-tool-xar/xwiki-commons-tool-xar-plugin/src/main/java/org/xwiki/tool/xar/XARMojo.java#L281-L292
train
xwiki/xwiki-commons
xwiki-commons-tools/xwiki-commons-tool-xar/xwiki-commons-tool-xar-plugin/src/main/java/org/xwiki/tool/xar/XARMojo.java
XARMojo.toXML
private Document toXML(Collection<ArchiveEntry> files) throws Exception { Document doc = new DOMDocument(); Element packageElement = new DOMElement("package"); doc.setRootElement(packageElement); Element infoElement = new DOMElement("infos"); packageElement.add(infoElement)...
java
private Document toXML(Collection<ArchiveEntry> files) throws Exception { Document doc = new DOMDocument(); Element packageElement = new DOMElement("package"); doc.setRootElement(packageElement); Element infoElement = new DOMElement("infos"); packageElement.add(infoElement)...
[ "private", "Document", "toXML", "(", "Collection", "<", "ArchiveEntry", ">", "files", ")", "throws", "Exception", "{", "Document", "doc", "=", "new", "DOMDocument", "(", ")", ";", "Element", "packageElement", "=", "new", "DOMElement", "(", "\"package\"", ")", ...
Generate a DOM4J Document containing the generated XML. @param files the list of files that we want to include in the generated package XML file. @return the DOM4J Document containing the generated XML
[ "Generate", "a", "DOM4J", "Document", "containing", "the", "generated", "XML", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-tools/xwiki-commons-tool-xar/xwiki-commons-tool-xar-plugin/src/main/java/org/xwiki/tool/xar/XARMojo.java#L300-L316
train
xwiki/xwiki-commons
xwiki-commons-tools/xwiki-commons-tool-xar/xwiki-commons-tool-xar-plugin/src/main/java/org/xwiki/tool/xar/XARMojo.java
XARMojo.addFilesToArchive
private void addFilesToArchive(ZipArchiver archiver, File sourceDir) throws Exception { File generatedPackageFile = new File(sourceDir, PACKAGE_XML); if (generatedPackageFile.exists()) { generatedPackageFile.delete(); } archiver.addDirectory(sourceDir, getIncludes(), get...
java
private void addFilesToArchive(ZipArchiver archiver, File sourceDir) throws Exception { File generatedPackageFile = new File(sourceDir, PACKAGE_XML); if (generatedPackageFile.exists()) { generatedPackageFile.delete(); } archiver.addDirectory(sourceDir, getIncludes(), get...
[ "private", "void", "addFilesToArchive", "(", "ZipArchiver", "archiver", ",", "File", "sourceDir", ")", "throws", "Exception", "{", "File", "generatedPackageFile", "=", "new", "File", "(", "sourceDir", ",", "PACKAGE_XML", ")", ";", "if", "(", "generatedPackageFile"...
Adds the files from a specific directory to an archive. It also builds a package.xml file based on that content which is also added to the archive. @param archiver the archive in which the files will be added @param sourceDir the directory whose contents will be added to the archive @throws Exception if the files cann...
[ "Adds", "the", "files", "from", "a", "specific", "directory", "to", "an", "archive", ".", "It", "also", "builds", "a", "package", ".", "xml", "file", "based", "on", "that", "content", "which", "is", "also", "added", "to", "the", "archive", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-tools/xwiki-commons-tool-xar/xwiki-commons-tool-xar-plugin/src/main/java/org/xwiki/tool/xar/XARMojo.java#L466-L476
train
xwiki/xwiki-commons
xwiki-commons-tools/xwiki-commons-tool-xar/xwiki-commons-tool-xar-plugin/src/main/java/org/xwiki/tool/xar/XARMojo.java
XARMojo.addFilesToArchive
private void addFilesToArchive(ZipArchiver archiver, File sourceDir, File packageXml) throws Exception { Collection<String> documentNames; getLog().info(String.format("Using the existing package.xml descriptor at [%s]", packageXml.getPath())); try { documentNames = getDocumentNam...
java
private void addFilesToArchive(ZipArchiver archiver, File sourceDir, File packageXml) throws Exception { Collection<String> documentNames; getLog().info(String.format("Using the existing package.xml descriptor at [%s]", packageXml.getPath())); try { documentNames = getDocumentNam...
[ "private", "void", "addFilesToArchive", "(", "ZipArchiver", "archiver", ",", "File", "sourceDir", ",", "File", "packageXml", ")", "throws", "Exception", "{", "Collection", "<", "String", ">", "documentNames", ";", "getLog", "(", ")", ".", "info", "(", "String"...
Adds files from a specific directory to an archive. It uses an existing package.xml to filter the files to be added. @param archiver the archive in which the files will be added @param sourceDir the directory whose contents will be added to the archive @param packageXml the corresponding package.xml file @throws Excep...
[ "Adds", "files", "from", "a", "specific", "directory", "to", "an", "archive", ".", "It", "uses", "an", "existing", "package", ".", "xml", "to", "filter", "the", "files", "to", "be", "added", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-tools/xwiki-commons-tool-xar/xwiki-commons-tool-xar-plugin/src/main/java/org/xwiki/tool/xar/XARMojo.java#L487-L535
train
xwiki/xwiki-commons
xwiki-commons-tools/xwiki-commons-tool-xar/xwiki-commons-tool-xar-plugin/src/main/java/org/xwiki/tool/xar/XARMojo.java
XARMojo.addContentsToQueue
private static void addContentsToQueue(Queue<File> fileQueue, File sourceDir) throws MojoExecutionException { File[] files = sourceDir.listFiles(); if (files != null) { for (File currentFile : files) { fileQueue.add(currentFile); } } else { ...
java
private static void addContentsToQueue(Queue<File> fileQueue, File sourceDir) throws MojoExecutionException { File[] files = sourceDir.listFiles(); if (files != null) { for (File currentFile : files) { fileQueue.add(currentFile); } } else { ...
[ "private", "static", "void", "addContentsToQueue", "(", "Queue", "<", "File", ">", "fileQueue", ",", "File", "sourceDir", ")", "throws", "MojoExecutionException", "{", "File", "[", "]", "files", "=", "sourceDir", ".", "listFiles", "(", ")", ";", "if", "(", ...
Adds the contents of a specific directory to a queue of files. @param fileQueue the queue of files @param sourceDir the directory to be scanned
[ "Adds", "the", "contents", "of", "a", "specific", "directory", "to", "a", "queue", "of", "files", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-tools/xwiki-commons-tool-xar/xwiki-commons-tool-xar-plugin/src/main/java/org/xwiki/tool/xar/XARMojo.java#L543-L553
train
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-xml/src/main/java/org/xwiki/xml/html/HTMLUtils.java
HTMLUtils.stripHTMLEnvelope
public static void stripHTMLEnvelope(Document document) { org.w3c.dom.Element root = document.getDocumentElement(); if (root.getNodeName().equalsIgnoreCase(HTMLConstants.TAG_HTML)) { // Look for a head element below the root element and for a body element Node bodyNode = null...
java
public static void stripHTMLEnvelope(Document document) { org.w3c.dom.Element root = document.getDocumentElement(); if (root.getNodeName().equalsIgnoreCase(HTMLConstants.TAG_HTML)) { // Look for a head element below the root element and for a body element Node bodyNode = null...
[ "public", "static", "void", "stripHTMLEnvelope", "(", "Document", "document", ")", "{", "org", ".", "w3c", ".", "dom", ".", "Element", "root", "=", "document", ".", "getDocumentElement", "(", ")", ";", "if", "(", "root", ".", "getNodeName", "(", ")", "."...
Strip the HTML envelope if it exists. Precisely this means removing the head tag and move all tags in the body tag directly under the html element. This is useful for example if you wish to insert an HTML fragment into an existing HTML page. @param document the w3c Document to strip
[ "Strip", "the", "HTML", "envelope", "if", "it", "exists", ".", "Precisely", "this", "means", "removing", "the", "head", "tag", "and", "move", "all", "tags", "in", "the", "body", "tag", "directly", "under", "the", "html", "element", ".", "This", "is", "us...
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-xml/src/main/java/org/xwiki/xml/html/HTMLUtils.java#L269-L299
train
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-xml/src/main/java/org/xwiki/xml/html/HTMLUtils.java
HTMLUtils.stripFirstElementInside
public static void stripFirstElementInside(Document document, String parentTagName, String elementTagName) { NodeList parentNodes = document.getElementsByTagName(parentTagName); if (parentNodes.getLength() > 0) { Node parentNode = parentNodes.item(0); // Look for a p element ...
java
public static void stripFirstElementInside(Document document, String parentTagName, String elementTagName) { NodeList parentNodes = document.getElementsByTagName(parentTagName); if (parentNodes.getLength() > 0) { Node parentNode = parentNodes.item(0); // Look for a p element ...
[ "public", "static", "void", "stripFirstElementInside", "(", "Document", "document", ",", "String", "parentTagName", ",", "String", "elementTagName", ")", "{", "NodeList", "parentNodes", "=", "document", ".", "getElementsByTagName", "(", "parentTagName", ")", ";", "i...
Remove the first element inside a parent element and copy the element's children in the parent. @param document the w3c document from which to remove the top level paragraph @param parentTagName the name of the parent tag to look under @param elementTagName the name of the first element to remove
[ "Remove", "the", "first", "element", "inside", "a", "parent", "element", "and", "copy", "the", "element", "s", "children", "in", "the", "parent", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-xml/src/main/java/org/xwiki/xml/html/HTMLUtils.java#L308-L324
train
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-store/xwiki-commons-crypto-store-filesystem/src/main/java/org/xwiki/crypto/store/filesystem/internal/AbstractX509FileSystemStore.java
AbstractX509FileSystemStore.store
protected void store(BufferedWriter out, String type, byte[] data) throws IOException { write(out, type, data); out.close(); }
java
protected void store(BufferedWriter out, String type, byte[] data) throws IOException { write(out, type, data); out.close(); }
[ "protected", "void", "store", "(", "BufferedWriter", "out", ",", "String", "type", ",", "byte", "[", "]", "data", ")", "throws", "IOException", "{", "write", "(", "out", ",", "type", ",", "data", ")", ";", "out", ".", "close", "(", ")", ";", "}" ]
Write data encoded based64 between PEM line headers and close the writer. @param out the output buffered writer to write to. @param type the type to be put in the header. @param data the bytes data to store encoded. @throws IOException on error.
[ "Write", "data", "encoded", "based64", "between", "PEM", "line", "headers", "and", "close", "the", "writer", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-store/xwiki-commons-crypto-store-filesystem/src/main/java/org/xwiki/crypto/store/filesystem/internal/AbstractX509FileSystemStore.java#L88-L92
train
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-store/xwiki-commons-crypto-store-filesystem/src/main/java/org/xwiki/crypto/store/filesystem/internal/AbstractX509FileSystemStore.java
AbstractX509FileSystemStore.write
protected void write(BufferedWriter out, String type, byte[] data) throws IOException { writeHeader(out, type); out.write(this.base64.encode(data, 64)); out.newLine(); writeFooter(out, type); }
java
protected void write(BufferedWriter out, String type, byte[] data) throws IOException { writeHeader(out, type); out.write(this.base64.encode(data, 64)); out.newLine(); writeFooter(out, type); }
[ "protected", "void", "write", "(", "BufferedWriter", "out", ",", "String", "type", ",", "byte", "[", "]", "data", ")", "throws", "IOException", "{", "writeHeader", "(", "out", ",", "type", ")", ";", "out", ".", "write", "(", "this", ".", "base64", ".",...
Write data encoded based64 between PEM line headers. @param out the output buffered writer to write to. @param type the type to be written in the header. @param data the bytes data to store encoded. @throws IOException on error.
[ "Write", "data", "encoded", "based64", "between", "PEM", "line", "headers", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-store/xwiki-commons-crypto-store-filesystem/src/main/java/org/xwiki/crypto/store/filesystem/internal/AbstractX509FileSystemStore.java#L102-L108
train
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-store/xwiki-commons-crypto-store-filesystem/src/main/java/org/xwiki/crypto/store/filesystem/internal/AbstractX509FileSystemStore.java
AbstractX509FileSystemStore.writeHeader
private static void writeHeader(BufferedWriter out, String type) throws IOException { out.write(PEM_BEGIN + type + DASHES); out.newLine(); }
java
private static void writeHeader(BufferedWriter out, String type) throws IOException { out.write(PEM_BEGIN + type + DASHES); out.newLine(); }
[ "private", "static", "void", "writeHeader", "(", "BufferedWriter", "out", ",", "String", "type", ")", "throws", "IOException", "{", "out", ".", "write", "(", "PEM_BEGIN", "+", "type", "+", "DASHES", ")", ";", "out", ".", "newLine", "(", ")", ";", "}" ]
Write a PEM like header. @param out the output buffered writer to write to. @param type the type to be written in the header. @throws IOException on error.
[ "Write", "a", "PEM", "like", "header", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-store/xwiki-commons-crypto-store-filesystem/src/main/java/org/xwiki/crypto/store/filesystem/internal/AbstractX509FileSystemStore.java#L117-L121
train
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-store/xwiki-commons-crypto-store-filesystem/src/main/java/org/xwiki/crypto/store/filesystem/internal/AbstractX509FileSystemStore.java
AbstractX509FileSystemStore.writeFooter
private static void writeFooter(BufferedWriter out, String type) throws IOException { out.write(PEM_END + type + DASHES); out.newLine(); }
java
private static void writeFooter(BufferedWriter out, String type) throws IOException { out.write(PEM_END + type + DASHES); out.newLine(); }
[ "private", "static", "void", "writeFooter", "(", "BufferedWriter", "out", ",", "String", "type", ")", "throws", "IOException", "{", "out", ".", "write", "(", "PEM_END", "+", "type", "+", "DASHES", ")", ";", "out", ".", "newLine", "(", ")", ";", "}" ]
Write a PEM like footer. @param out the output buffered writer to write to. @param type the type to be written in the footer. @throws IOException on error.
[ "Write", "a", "PEM", "like", "footer", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-store/xwiki-commons-crypto-store-filesystem/src/main/java/org/xwiki/crypto/store/filesystem/internal/AbstractX509FileSystemStore.java#L130-L134
train
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-store/xwiki-commons-crypto-store-filesystem/src/main/java/org/xwiki/crypto/store/filesystem/internal/AbstractX509FileSystemStore.java
AbstractX509FileSystemStore.getStoreFile
protected File getStoreFile(StoreReference store) { if (store instanceof FileStoreReference) { return ((FileStoreReference) store).getFile(); } throw new IllegalArgumentException(String.format("Unsupported store reference [%s] for this implementation.", store.getClass...
java
protected File getStoreFile(StoreReference store) { if (store instanceof FileStoreReference) { return ((FileStoreReference) store).getFile(); } throw new IllegalArgumentException(String.format("Unsupported store reference [%s] for this implementation.", store.getClass...
[ "protected", "File", "getStoreFile", "(", "StoreReference", "store", ")", "{", "if", "(", "store", "instanceof", "FileStoreReference", ")", "{", "return", "(", "(", "FileStoreReference", ")", "store", ")", ".", "getFile", "(", ")", ";", "}", "throw", "new", ...
Return the file corresponding to the given store reference. @param store the store reference. @return a file or folder for storage. @throws java.lang.IllegalArgumentException if the reference is not appropriate for a filesystem storage.
[ "Return", "the", "file", "corresponding", "to", "the", "given", "store", "reference", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-store/xwiki-commons-crypto-store-filesystem/src/main/java/org/xwiki/crypto/store/filesystem/internal/AbstractX509FileSystemStore.java#L143-L150
train
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-store/xwiki-commons-crypto-store-filesystem/src/main/java/org/xwiki/crypto/store/filesystem/internal/AbstractX509FileSystemStore.java
AbstractX509FileSystemStore.getPublicKey
protected X509CertifiedPublicKey getPublicKey(CertifiedPublicKey publicKey) { if (publicKey instanceof X509CertifiedPublicKey) { return (X509CertifiedPublicKey) publicKey; } throw new IllegalArgumentException(String.format("Unsupported certificate [%s], expecting X509 certificat...
java
protected X509CertifiedPublicKey getPublicKey(CertifiedPublicKey publicKey) { if (publicKey instanceof X509CertifiedPublicKey) { return (X509CertifiedPublicKey) publicKey; } throw new IllegalArgumentException(String.format("Unsupported certificate [%s], expecting X509 certificat...
[ "protected", "X509CertifiedPublicKey", "getPublicKey", "(", "CertifiedPublicKey", "publicKey", ")", "{", "if", "(", "publicKey", "instanceof", "X509CertifiedPublicKey", ")", "{", "return", "(", "X509CertifiedPublicKey", ")", "publicKey", ";", "}", "throw", "new", "Ill...
Return the X.509 certificate. @param publicKey the certified public key. @return the cast to an X.509 certificate. @throws java.lang.IllegalArgumentException if the certified key is not an X.509 one.
[ "Return", "the", "X", ".", "509", "certificate", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-store/xwiki-commons-crypto-store-filesystem/src/main/java/org/xwiki/crypto/store/filesystem/internal/AbstractX509FileSystemStore.java#L170-L178
train
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-store/xwiki-commons-crypto-store-filesystem/src/main/java/org/xwiki/crypto/store/filesystem/internal/AbstractX509FileSystemStore.java
AbstractX509FileSystemStore.getCertIdentifier
protected String getCertIdentifier(X509CertifiedPublicKey publicKey) throws IOException { byte[] keyId = publicKey.getSubjectKeyIdentifier(); if (keyId != null) { return this.hex.encode(keyId); } return publicKey.getSerialNumber().toString() + ", " + publicKey.getIssuer()...
java
protected String getCertIdentifier(X509CertifiedPublicKey publicKey) throws IOException { byte[] keyId = publicKey.getSubjectKeyIdentifier(); if (keyId != null) { return this.hex.encode(keyId); } return publicKey.getSerialNumber().toString() + ", " + publicKey.getIssuer()...
[ "protected", "String", "getCertIdentifier", "(", "X509CertifiedPublicKey", "publicKey", ")", "throws", "IOException", "{", "byte", "[", "]", "keyId", "=", "publicKey", ".", "getSubjectKeyIdentifier", "(", ")", ";", "if", "(", "keyId", "!=", "null", ")", "{", "...
Return a unique identifier appropriate for a file name. If the certificate as a subject key identifier, the result is this encoded identifier. Else, use the concatenation of the certificate serial number and the issuer name. @param publicKey the certificate. @return a unique identifier. @throws java.io.IOException on ...
[ "Return", "a", "unique", "identifier", "appropriate", "for", "a", "file", "name", ".", "If", "the", "certificate", "as", "a", "subject", "key", "identifier", "the", "result", "is", "this", "encoded", "identifier", ".", "Else", "use", "the", "concatenation", ...
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-store/xwiki-commons-crypto-store-filesystem/src/main/java/org/xwiki/crypto/store/filesystem/internal/AbstractX509FileSystemStore.java#L189-L196
train
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-store/xwiki-commons-crypto-store-filesystem/src/main/java/org/xwiki/crypto/store/filesystem/internal/AbstractX509FileSystemStore.java
AbstractX509FileSystemStore.readObject
protected Object readObject(BufferedReader in, byte[] password) throws IOException, GeneralSecurityException { String line; Object obj = null; while ((line = in.readLine()) != null) { obj = processObject(in, line, password); if (obj != null) { break; ...
java
protected Object readObject(BufferedReader in, byte[] password) throws IOException, GeneralSecurityException { String line; Object obj = null; while ((line = in.readLine()) != null) { obj = processObject(in, line, password); if (obj != null) { break; ...
[ "protected", "Object", "readObject", "(", "BufferedReader", "in", ",", "byte", "[", "]", "password", ")", "throws", "IOException", ",", "GeneralSecurityException", "{", "String", "line", ";", "Object", "obj", "=", "null", ";", "while", "(", "(", "line", "=",...
Read an object from a PEM like file. @param in the input reader to read from. @param password a password to decrypt encrypted objects. May be null if the object is not encrypted. @return the object read. @throws IOException on I/O error. @throws GeneralSecurityException on decryption error.
[ "Read", "an", "object", "from", "a", "PEM", "like", "file", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-store/xwiki-commons-crypto-store-filesystem/src/main/java/org/xwiki/crypto/store/filesystem/internal/AbstractX509FileSystemStore.java#L207-L220
train
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-store/xwiki-commons-crypto-store-filesystem/src/main/java/org/xwiki/crypto/store/filesystem/internal/AbstractX509FileSystemStore.java
AbstractX509FileSystemStore.processObject
protected Object processObject(BufferedReader in, String line, byte[] password) throws IOException, GeneralSecurityException { if (line.contains(PEM_BEGIN + CERTIFICATE + DASHES)) { return this.certificateFactory.decode(readBytes(in, PEM_END + CERTIFICATE + DASHES)); } re...
java
protected Object processObject(BufferedReader in, String line, byte[] password) throws IOException, GeneralSecurityException { if (line.contains(PEM_BEGIN + CERTIFICATE + DASHES)) { return this.certificateFactory.decode(readBytes(in, PEM_END + CERTIFICATE + DASHES)); } re...
[ "protected", "Object", "processObject", "(", "BufferedReader", "in", ",", "String", "line", ",", "byte", "[", "]", "password", ")", "throws", "IOException", ",", "GeneralSecurityException", "{", "if", "(", "line", ".", "contains", "(", "PEM_BEGIN", "+", "CERTI...
Process an object from a PEM like file. @param in the input reader to read from. @param line the last read line. @param password a password to decrypt encrypted objects. May be null if the object is not encrypted. @return the object read, or null if the line was not a recognized PEM header. @throws IOException on I/O ...
[ "Process", "an", "object", "from", "a", "PEM", "like", "file", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-store/xwiki-commons-crypto-store-filesystem/src/main/java/org/xwiki/crypto/store/filesystem/internal/AbstractX509FileSystemStore.java#L232-L239
train
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-store/xwiki-commons-crypto-store-filesystem/src/main/java/org/xwiki/crypto/store/filesystem/internal/AbstractX509FileSystemStore.java
AbstractX509FileSystemStore.readBytes
protected byte[] readBytes(BufferedReader in, String endMarker) throws IOException { String line; StringBuilder buf = new StringBuilder(); while ((line = in.readLine()) != null) { if (line.contains(endMarker)) { break; } buf.append(line.tr...
java
protected byte[] readBytes(BufferedReader in, String endMarker) throws IOException { String line; StringBuilder buf = new StringBuilder(); while ((line = in.readLine()) != null) { if (line.contains(endMarker)) { break; } buf.append(line.tr...
[ "protected", "byte", "[", "]", "readBytes", "(", "BufferedReader", "in", ",", "String", "endMarker", ")", "throws", "IOException", "{", "String", "line", ";", "StringBuilder", "buf", "=", "new", "StringBuilder", "(", ")", ";", "while", "(", "(", "line", "=...
Read base64 data up to an end marker and decode them. @param in the input reader to read from. @param endMarker the end marker. @return the data read. @throws IOException on error.
[ "Read", "base64", "data", "up", "to", "an", "end", "marker", "and", "decode", "them", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-store/xwiki-commons-crypto-store-filesystem/src/main/java/org/xwiki/crypto/store/filesystem/internal/AbstractX509FileSystemStore.java#L249-L262
train
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-job/src/main/java/org/xwiki/job/internal/DefaultJobProgress.java
DefaultJobProgress.onPushLevelProgress
private void onPushLevelProgress(int steps, Object source, boolean singlesteplevel) { if (this.currentStep.isLevelFinished()) { // If current step is done move to next one this.currentStep = this.currentStep.getParent().nextStep(null, source); } // Add level ...
java
private void onPushLevelProgress(int steps, Object source, boolean singlesteplevel) { if (this.currentStep.isLevelFinished()) { // If current step is done move to next one this.currentStep = this.currentStep.getParent().nextStep(null, source); } // Add level ...
[ "private", "void", "onPushLevelProgress", "(", "int", "steps", ",", "Object", "source", ",", "boolean", "singlesteplevel", ")", "{", "if", "(", "this", ".", "currentStep", ".", "isLevelFinished", "(", ")", ")", "{", "// If current step is done move to next one", "...
Adds a new level to the progress stack.
[ "Adds", "a", "new", "level", "to", "the", "progress", "stack", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-job/src/main/java/org/xwiki/job/internal/DefaultJobProgress.java#L114-L123
train
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-job/src/main/java/org/xwiki/job/internal/DefaultJobProgress.java
DefaultJobProgress.onEndStepProgress
private void onEndStepProgress(Object source) { // Try to find the right step based on the source DefaultJobProgressStep step = findStep(this.currentStep, source); if (step == null) { LOGGER.warn("Could not find any matching step for source [{}]. Ignoring EndStepProgress.", ...
java
private void onEndStepProgress(Object source) { // Try to find the right step based on the source DefaultJobProgressStep step = findStep(this.currentStep, source); if (step == null) { LOGGER.warn("Could not find any matching step for source [{}]. Ignoring EndStepProgress.", ...
[ "private", "void", "onEndStepProgress", "(", "Object", "source", ")", "{", "// Try to find the right step based on the source", "DefaultJobProgressStep", "step", "=", "findStep", "(", "this", ".", "currentStep", ",", "source", ")", ";", "if", "(", "step", "==", "nul...
Close current step.
[ "Close", "current", "step", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-job/src/main/java/org/xwiki/job/internal/DefaultJobProgress.java#L128-L142
train
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-job/src/main/java/org/xwiki/job/internal/DefaultJobProgress.java
DefaultJobProgress.onStepProgress
@Deprecated private void onStepProgress(Object source) { onStartStepProgress(null, source); // if there is only one step close it and move to the next one if (this.currentStep.getParent().getChildren().size() == 1) { this.currentStep = this.currentStep.getParent().nextStep(n...
java
@Deprecated private void onStepProgress(Object source) { onStartStepProgress(null, source); // if there is only one step close it and move to the next one if (this.currentStep.getParent().getChildren().size() == 1) { this.currentStep = this.currentStep.getParent().nextStep(n...
[ "@", "Deprecated", "private", "void", "onStepProgress", "(", "Object", "source", ")", "{", "onStartStepProgress", "(", "null", ",", "source", ")", ";", "// if there is only one step close it and move to the next one", "if", "(", "this", ".", "currentStep", ".", "getPa...
Move progress to next step. @deprecated since 7.1M2, use {@link #onStartStepProgress(Message)} instead
[ "Move", "progress", "to", "next", "step", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-job/src/main/java/org/xwiki/job/internal/DefaultJobProgress.java#L167-L176
train