repo
stringlengths
7
59
path
stringlengths
17
234
func_name
stringlengths
3
117
original_string
stringlengths
63
281k
language
stringclasses
1 value
code
stringlengths
63
281k
code_tokens
listlengths
20
16.3k
docstring
stringlengths
1
34k
docstring_tokens
listlengths
1
3.44k
sha
stringlengths
40
40
url
stringlengths
106
339
partition
stringclasses
3 values
summary
stringlengths
3
248
output
stringlengths
142
281k
oblac/jodd
jodd-proxetta/src/main/java/jodd/asm7/AnnotationVisitor.java
AnnotationVisitor.visitEnum
public void visitEnum(final String name, final String descriptor, final String value) { if (av != null) { av.visitEnum(name, descriptor, value); } }
java
public void visitEnum(final String name, final String descriptor, final String value) { if (av != null) { av.visitEnum(name, descriptor, value); } }
[ "public", "void", "visitEnum", "(", "final", "String", "name", ",", "final", "String", "descriptor", ",", "final", "String", "value", ")", "{", "if", "(", "av", "!=", "null", ")", "{", "av", ".", "visitEnum", "(", "name", ",", "descriptor", ",", "value...
Visits an enumeration value of the annotation. @param name the value name. @param descriptor the class descriptor of the enumeration class. @param value the actual enumeration value.
[ "Visits", "an", "enumeration", "value", "of", "the", "annotation", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-proxetta/src/main/java/jodd/asm7/AnnotationVisitor.java#L99-L103
test
Visit an enumeration.
Of course, here is the Java code you requested: ```java public void visitEnum(final String name, final String descriptor, final String value) { if (av != null) { av.visitEnum(name, descriptor, value); } } ``` Hope this helps!
kaazing/gateway
mina.core/core/src/main/java/org/apache/mina/util/AvailablePortFinder.java
AvailablePortFinder.getAvailablePorts
public static Set<Integer> getAvailablePorts(int fromPort, int toPort) { if (fromPort < MIN_PORT_NUMBER || toPort > MAX_PORT_NUMBER || fromPort > toPort) { throw new IllegalArgumentException("Invalid port range: " + fromPort + " ~ " + toPort); } S...
java
public static Set<Integer> getAvailablePorts(int fromPort, int toPort) { if (fromPort < MIN_PORT_NUMBER || toPort > MAX_PORT_NUMBER || fromPort > toPort) { throw new IllegalArgumentException("Invalid port range: " + fromPort + " ~ " + toPort); } S...
[ "public", "static", "Set", "<", "Integer", ">", "getAvailablePorts", "(", "int", "fromPort", ",", "int", "toPort", ")", "{", "if", "(", "fromPort", "<", "MIN_PORT_NUMBER", "||", "toPort", ">", "MAX_PORT_NUMBER", "||", "fromPort", ">", "toPort", ")", "{", "...
Returns the {@link Set} of currently avaliable port numbers ({@link Integer}) between the specified port range. @throws IllegalArgumentException if port range is not between {@link #MIN_PORT_NUMBER} and {@link #MAX_PORT_NUMBER} or <code>fromPort</code> if greater than <code>toPort</code>.
[ "Returns", "the", "{", "@link", "Set", "}", "of", "currently", "avaliable", "port", "numbers", "(", "{", "@link", "Integer", "}", ")", "between", "the", "specified", "port", "range", "." ]
06017b19273109b3b992e528e702586446168d57
https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/util/AvailablePortFinder.java#L136-L165
train
Get a set of available ports.
Of course, here is the Java code you requested: ```java public static Set<Integer> getAvailablePorts(int fromPort, int toPort) { if (fromPort < MIN_PORT_NUMBER || toPort > MAX_PORT_NUMBER || fromPort > toPort) { throw new IllegalArgumentException("Invalid port range: " ...
looly/hutool
hutool-extra/src/main/java/cn/hutool/extra/template/engine/velocity/VelocityTemplate.java
VelocityTemplate.toContext
private VelocityContext toContext(Map<?, ?> bindingMap) { final Map<String, Object> map = Convert.convert(new TypeReference<Map<String, Object>>() {}, bindingMap); return new VelocityContext(map); }
java
private VelocityContext toContext(Map<?, ?> bindingMap) { final Map<String, Object> map = Convert.convert(new TypeReference<Map<String, Object>>() {}, bindingMap); return new VelocityContext(map); }
[ "private", "VelocityContext", "toContext", "(", "Map", "<", "?", ",", "?", ">", "bindingMap", ")", "{", "final", "Map", "<", "String", ",", "Object", ">", "map", "=", "Convert", ".", "convert", "(", "new", "TypeReference", "<", "Map", "<", "String", ",...
将Map转为VelocityContext @param bindingMap 参数绑定的Map @return {@link VelocityContext}
[ "将Map转为VelocityContext" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-extra/src/main/java/cn/hutool/extra/template/engine/velocity/VelocityTemplate.java#L69-L72
train
Converts a map of strings to VelocityContext.
Of course, here is the Java code you requested: ```java private VelocityContext toContext(Map<?, ?> bindingMap) { final Map<String, Object> map = Convert.convert(new TypeReference<Map<String, Object>>() {}, bindingMap); return new VelocityContext(map); } ``` Hope this helps!
fozziethebeat/S-Space
src/main/java/edu/ucla/sspace/matrix/MatlabSparseMatrixBuilder.java
MatlabSparseMatrixBuilder.addColumn
public synchronized int addColumn(double[] column) { if (isFinished) throw new IllegalStateException( "Cannot add rows to a MatrixBuilder that is finished"); for (int r = 0; r < column.length; ++r) { if (column[r] != 0d) { // NB: Matlab sparse form...
java
public synchronized int addColumn(double[] column) { if (isFinished) throw new IllegalStateException( "Cannot add rows to a MatrixBuilder that is finished"); for (int r = 0; r < column.length; ++r) { if (column[r] != 0d) { // NB: Matlab sparse form...
[ "public", "synchronized", "int", "addColumn", "(", "double", "[", "]", "column", ")", "{", "if", "(", "isFinished", ")", "throw", "new", "IllegalStateException", "(", "\"Cannot add rows to a MatrixBuilder that is finished\"", ")", ";", "for", "(", "int", "r", "=",...
{@inheritDoc}
[ "{" ]
a608102737dfd3d59038a9ead33fe60356bc6029
https://github.com/fozziethebeat/S-Space/blob/a608102737dfd3d59038a9ead33fe60356bc6029/src/main/java/edu/ucla/sspace/matrix/MatlabSparseMatrixBuilder.java#L156-L170
train
Add a column to the matrix.
Of course, here is the Java code you requested: ```java public synchronized int addColumn(double[] column) { if (isFinished) throw new IllegalStateException( "Cannot add rows to a MatrixBuilder that is finished"); for (int r = 0; r < column.length; ++r) { if (col...
alipay/sofa-rpc
extension-impl/remoting-http/src/main/java/com/alipay/sofa/rpc/transport/http/AbstractHttp2ClientTransport.java
AbstractHttp2ClientTransport.doInvokeAsync
protected ResponseFuture doInvokeAsync(SofaRequest request, RpcInternalContext rpcContext, int timeoutMillis) { SofaResponseCallback listener = request.getSofaResponseCallback(); if (listener != null) { AbstractHttpClientHandler callback = new CallbackInvokeClientHandler(transportConfig.getC...
java
protected ResponseFuture doInvokeAsync(SofaRequest request, RpcInternalContext rpcContext, int timeoutMillis) { SofaResponseCallback listener = request.getSofaResponseCallback(); if (listener != null) { AbstractHttpClientHandler callback = new CallbackInvokeClientHandler(transportConfig.getC...
[ "protected", "ResponseFuture", "doInvokeAsync", "(", "SofaRequest", "request", ",", "RpcInternalContext", "rpcContext", ",", "int", "timeoutMillis", ")", "{", "SofaResponseCallback", "listener", "=", "request", ".", "getSofaResponseCallback", "(", ")", ";", "if", "(",...
异步调用 @param request 请求对象 @param rpcContext RPC内置上下文 @param timeoutMillis 超时时间(毫秒)
[ "异步调用" ]
a31406410291e56696185a29c3ba4bd1f54488fd
https://github.com/alipay/sofa-rpc/blob/a31406410291e56696185a29c3ba4bd1f54488fd/extension-impl/remoting-http/src/main/java/com/alipay/sofa/rpc/transport/http/AbstractHttp2ClientTransport.java#L227-L244
train
This method is used to invoke a request asynchronously.
Of course, here is the Java code you requested: ```java protected ResponseFuture doInvokeAsync(SofaRequest request, RpcInternalContext rpcContext, int timeoutMillis) { SofaResponseCallback listener = request.getSofaResponseCallback(); if (listener != null) { AbstractHttpClientHandler callba...
OpenLiberty/open-liberty
dev/com.ibm.ws.recoverylog/src/com/ibm/ws/recoverylog/utils/RecoverableUnitIdTable.java
RecoverableUnitIdTable.reserveId
public final synchronized boolean reserveId(long id, Object obj) { if (tc.isEntryEnabled()) Tr.entry(tc, "reserveId", new Object[] {new Long(id), obj}); boolean reserved = false; // The id can only be reserved if it // isn't already in the map if (_idMap.get(id) == null) { _idMap.put(id, obj); rese...
java
public final synchronized boolean reserveId(long id, Object obj) { if (tc.isEntryEnabled()) Tr.entry(tc, "reserveId", new Object[] {new Long(id), obj}); boolean reserved = false; // The id can only be reserved if it // isn't already in the map if (_idMap.get(id) == null) { _idMap.put(id, obj); rese...
[ "public", "final", "synchronized", "boolean", "reserveId", "(", "long", "id", ",", "Object", "obj", ")", "{", "if", "(", "tc", ".", "isEntryEnabled", "(", ")", ")", "Tr", ".", "entry", "(", "tc", ",", "\"reserveId\"", ",", "new", "Object", "[", "]", ...
Reserve the given id and associate it with the given object. This method should be used during recovery when there is a requirement to create a new object with a specific id rather than the one that is next available. @return true if the id was successfully reserved. @param id The value of the id to be reserved @param...
[ "Reserve", "the", "given", "id", "and", "associate", "it", "with", "the", "given", "object", ".", "This", "method", "should", "be", "used", "during", "recovery", "when", "there", "is", "a", "requirement", "to", "create", "a", "new", "object", "with", "a", ...
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.recoverylog/src/com/ibm/ws/recoverylog/utils/RecoverableUnitIdTable.java#L83-L100
train
This method is used to reserve an object from the cache.
Of course, here is the Java code you requested: ```java public final synchronized boolean reserveId(long id, Object obj) { if (tc.isEntryEnabled()) Tr.entry(tc, "reserveId", new Object[] {new Long(id), obj}); boolean reserved = false; // The id can only be reserved if it // isn't already in the map if (_i...
windup/windup
config/api/src/main/java/org/jboss/windup/config/Variables.java
Variables.findVariableOfType
@SuppressWarnings("unchecked") public <T extends WindupVertexFrame> Iterable<T> findVariableOfType(Class<T> type) { for (Map<String, Iterable<? extends WindupVertexFrame>> topOfStack : deque) { for (Iterable<? extends WindupVertexFrame> frames : topOfStack.values()) { ...
java
@SuppressWarnings("unchecked") public <T extends WindupVertexFrame> Iterable<T> findVariableOfType(Class<T> type) { for (Map<String, Iterable<? extends WindupVertexFrame>> topOfStack : deque) { for (Iterable<? extends WindupVertexFrame> frames : topOfStack.values()) { ...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "<", "T", "extends", "WindupVertexFrame", ">", "Iterable", "<", "T", ">", "findVariableOfType", "(", "Class", "<", "T", ">", "type", ")", "{", "for", "(", "Map", "<", "String", ",", "Iterable", ...
Searches the variables layers, top to bottom, for the iterable having all of it's items of the given type. Return null if not found.
[ "Searches", "the", "variables", "layers", "top", "to", "bottom", "for", "the", "iterable", "having", "all", "of", "it", "s", "items", "of", "the", "given", "type", ".", "Return", "null", "if", "not", "found", "." ]
6668f09e7f012d24a0b4212ada8809417225b2ad
https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/config/api/src/main/java/org/jboss/windup/config/Variables.java#L202-L227
train
Find all the variables of the given type in the deque.
Of course, here is the Java code you requested: ```java @SuppressWarnings("unchecked") public <T extends WindupVertexFrame> Iterable<T> findVariableOfType(Class<T> type) { for (Map<String, Iterable<? extends WindupVertexFrame>> topOfStack : deque) { for (Iterable<? extends WindupVer...
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/html/Composite.java
Composite.flush
void flush(OutputStream out, String encoding) throws IOException { flush(new OutputStreamWriter(out,encoding)); }
java
void flush(OutputStream out, String encoding) throws IOException { flush(new OutputStreamWriter(out,encoding)); }
[ "void", "flush", "(", "OutputStream", "out", ",", "String", "encoding", ")", "throws", "IOException", "{", "flush", "(", "new", "OutputStreamWriter", "(", "out", ",", "encoding", ")", ")", ";", "}" ]
/* Flush is a package method used by Page.flush() to locate the most nested composite, write out and empty its contents.
[ "/", "*", "Flush", "is", "a", "package", "method", "used", "by", "Page", ".", "flush", "()", "to", "locate", "the", "most", "nested", "composite", "write", "out", "and", "empty", "its", "contents", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/html/Composite.java#L230-L234
train
Flushes the underlying stream.
Of course, here is the Java code you requested: ```java void flush(OutputStream out, String encoding) throws IOException { flush(new OutputStreamWriter(out,encoding)); } ``` Hope this helps!
VoltDB/voltdb
src/hsqldb19b3/org/hsqldb_voltpatches/Constraint.java
Constraint.isUniqueWithColumns
boolean isUniqueWithColumns(int[] cols) { if (constType != UNIQUE || core.mainCols.length != cols.length) { return false; } return ArrayUtil.haveEqualSets(core.mainCols, cols, cols.length); }
java
boolean isUniqueWithColumns(int[] cols) { if (constType != UNIQUE || core.mainCols.length != cols.length) { return false; } return ArrayUtil.haveEqualSets(core.mainCols, cols, cols.length); }
[ "boolean", "isUniqueWithColumns", "(", "int", "[", "]", "cols", ")", "{", "if", "(", "constType", "!=", "UNIQUE", "||", "core", ".", "mainCols", ".", "length", "!=", "cols", ".", "length", ")", "{", "return", "false", ";", "}", "return", "ArrayUtil", "...
Compares this with another constraint column set. This is used only for UNIQUE constraints.
[ "Compares", "this", "with", "another", "constraint", "column", "set", ".", "This", "is", "used", "only", "for", "UNIQUE", "constraints", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/Constraint.java#L705-L712
train
Checks if the class is UNIQUE with the given columns.
Of course, here is the Java code you requested: ```java boolean isUniqueWithColumns(int[] cols) { if (constType != UNIQUE || core.mainCols.length != cols.length) { return false; } return ArrayUtil.haveEqualSets(core.mainCols, cols, cols.length); } ``` Hope this helps!
yan74/afplib
org.afplib/src/main/java/org/afplib/afplib/impl/ResourceSectionNumberImpl.java
ResourceSectionNumberImpl.eGet
@Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case AfplibPackage.RESOURCE_SECTION_NUMBER__RES_SNUM: return getResSNum(); } return super.eGet(featureID, resolve, coreType); }
java
@Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case AfplibPackage.RESOURCE_SECTION_NUMBER__RES_SNUM: return getResSNum(); } return super.eGet(featureID, resolve, coreType); }
[ "@", "Override", "public", "Object", "eGet", "(", "int", "featureID", ",", "boolean", "resolve", ",", "boolean", "coreType", ")", "{", "switch", "(", "featureID", ")", "{", "case", "AfplibPackage", ".", "RESOURCE_SECTION_NUMBER__RES_SNUM", ":", "return", "getRes...
<!-- begin-user-doc --> <!-- end-user-doc --> @generated
[ "<!", "--", "begin", "-", "user", "-", "doc", "--", ">", "<!", "--", "end", "-", "user", "-", "doc", "--", ">" ]
9ff0513f9448bdf8c0b0e31dc4910c094c48fb2f
https://github.com/yan74/afplib/blob/9ff0513f9448bdf8c0b0e31dc4910c094c48fb2f/org.afplib/src/main/java/org/afplib/afplib/impl/ResourceSectionNumberImpl.java#L95-L102
train
Override eGet to return the object that corresponds to the featureID.
Of course, here is the Java code you requested: ```java @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case AfplibPackage.RESOURCE_SECTION_NUMBER__RES_SNUM: return getResSNum(); } return super.eGet(featureID, resolve, coreType); } ``` Hope this hel...
citygml4j/citygml4j
src-gen/main/java/net/opengis/gml/ObjectFactory.java
ObjectFactory.createTemporalCS
@XmlElementDecl(namespace = "http://www.opengis.net/gml", name = "TemporalCS", substitutionHeadNamespace = "http://www.opengis.net/gml", substitutionHeadName = "_CoordinateSystem") public JAXBElement<TemporalCSType> createTemporalCS(TemporalCSType value) { return new JAXBElement<TemporalCSType>(_TemporalCS_...
java
@XmlElementDecl(namespace = "http://www.opengis.net/gml", name = "TemporalCS", substitutionHeadNamespace = "http://www.opengis.net/gml", substitutionHeadName = "_CoordinateSystem") public JAXBElement<TemporalCSType> createTemporalCS(TemporalCSType value) { return new JAXBElement<TemporalCSType>(_TemporalCS_...
[ "@", "XmlElementDecl", "(", "namespace", "=", "\"http://www.opengis.net/gml\"", ",", "name", "=", "\"TemporalCS\"", ",", "substitutionHeadNamespace", "=", "\"http://www.opengis.net/gml\"", ",", "substitutionHeadName", "=", "\"_CoordinateSystem\"", ")", "public", "JAXBElement"...
Create an instance of {@link JAXBElement }{@code <}{@link TemporalCSType }{@code >} @param value Java instance representing xml element's value. @return the new instance of {@link JAXBElement }{@code <}{@link TemporalCSType }{@code >}
[ "Create", "an", "instance", "of", "{", "@link", "JAXBElement", "}", "{", "@code", "<", "}", "{", "@link", "TemporalCSType", "}", "{", "@code", ">", "}" ]
9155997d5ecf7e8f19411a02ba047f13375b97b9
https://github.com/citygml4j/citygml4j/blob/9155997d5ecf7e8f19411a02ba047f13375b97b9/src-gen/main/java/net/opengis/gml/ObjectFactory.java#L6980-L6983
train
Create an instance of the temporalCS class.
Of course, here is the Java code you requested: ```java @XmlElementDecl(namespace = "http://www.opengis.net/gml", name = "TemporalCS", substitutionHeadNamespace = "http://www.opengis.net/gml", substitutionHeadName = "_CoordinateSystem") public JAXBElement<TemporalCSType> createTemporalCS(TemporalCSType value) { ...
apache/groovy
src/main/java/org/codehaus/groovy/runtime/ArrayTypeUtils.java
ArrayTypeUtils.dimension
public static int dimension(Class clazz) { checkArrayType(clazz); int result = 0; while (clazz.isArray()) { result++; clazz = clazz.getComponentType(); } return result; }
java
public static int dimension(Class clazz) { checkArrayType(clazz); int result = 0; while (clazz.isArray()) { result++; clazz = clazz.getComponentType(); } return result; }
[ "public", "static", "int", "dimension", "(", "Class", "clazz", ")", "{", "checkArrayType", "(", "clazz", ")", ";", "int", "result", "=", "0", ";", "while", "(", "clazz", ".", "isArray", "(", ")", ")", "{", "result", "++", ";", "clazz", "=", "clazz", ...
Calculate the dimension of array @param clazz the type of array @return the dimension of array
[ "Calculate", "the", "dimension", "of", "array" ]
71cf20addb611bb8d097a59e395fd20bc7f31772
https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/ArrayTypeUtils.java#L33-L43
train
Get the dimension of the class.
Of course, here is the Java code you requested: ```java public static int dimension(Class clazz) { checkArrayType(clazz); int result = 0; while (clazz.isArray()) { result++; clazz = clazz.getComponentType(); } return result; } ``` Hope this helps!
eFaps/eFaps-Kernel
src/main/java/org/efaps/admin/datamodel/attributetype/DecimalType.java
DecimalType.eval
protected BigDecimal eval(final Object... _values) throws SQLException { final BigDecimal ret; if (_values == null || _values.length == 0 || _values[0] == null) { ret = null; } else if (_values[0] instanceof String && ((String) _values[0]).length() > 0) { tr...
java
protected BigDecimal eval(final Object... _values) throws SQLException { final BigDecimal ret; if (_values == null || _values.length == 0 || _values[0] == null) { ret = null; } else if (_values[0] instanceof String && ((String) _values[0]).length() > 0) { tr...
[ "protected", "BigDecimal", "eval", "(", "final", "Object", "...", "_values", ")", "throws", "SQLException", "{", "final", "BigDecimal", "ret", ";", "if", "(", "_values", "==", "null", "||", "_values", ".", "length", "==", "0", "||", "_values", "[", "0", ...
Evaluate the value. @param _values value to be evaluated @return BigDecimal value @throws SQLException on error
[ "Evaluate", "the", "value", "." ]
04b96548f518c2386a93f5ec2b9349f9b9063859
https://github.com/eFaps/eFaps-Kernel/blob/04b96548f518c2386a93f5ec2b9349f9b9063859/src/main/java/org/efaps/admin/datamodel/attributetype/DecimalType.java#L68-L90
train
Method to evaluate the value of a CIS ACS A
Of course, here is the Java code you requested: ```java protected BigDecimal eval(final Object... _values) throws SQLException { final BigDecimal ret; if (_values == null || _values.length == 0 || _values[0] == null) { ret = null; } else if (_values[0] instanceof Strin...
b3log/latke
latke-core/src/main/java/org/b3log/latke/event/SynchronizedEventQueue.java
SynchronizedEventQueue.fireEvent
synchronized void fireEvent(final Event<?> event) { final String eventType = event.getType(); List<Event<?>> events = synchronizedEvents.get(eventType); if (null == events) { events = new ArrayList<>(); synchronizedEvents.put(eventType, events); } events....
java
synchronized void fireEvent(final Event<?> event) { final String eventType = event.getType(); List<Event<?>> events = synchronizedEvents.get(eventType); if (null == events) { events = new ArrayList<>(); synchronizedEvents.put(eventType, events); } events....
[ "synchronized", "void", "fireEvent", "(", "final", "Event", "<", "?", ">", "event", ")", "{", "final", "String", "eventType", "=", "event", ".", "getType", "(", ")", ";", "List", "<", "Event", "<", "?", ">", ">", "events", "=", "synchronizedEvents", "....
Fires the specified event. @param event the specified event
[ "Fires", "the", "specified", "event", "." ]
f7e08a47eeecea5f7c94006382c24f353585de33
https://github.com/b3log/latke/blob/f7e08a47eeecea5f7c94006382c24f353585de33/latke-core/src/main/java/org/b3log/latke/event/SynchronizedEventQueue.java#L56-L67
train
Fires an event.
Of course, here is the Java code you requested: ```java synchronized void fireEvent(final Event<?> event) { final String eventType = event.getType(); List<Event<?>> events = synchronizedEvents.get(eventType); if (null == events) { events = new ArrayList<>(); synchronized...
primefaces/primefaces
src/main/java/org/primefaces/csp/CspResponseWriter.java
CspResponseWriter.listenOnEndAttribute
private void listenOnEndAttribute() throws IOException { if (lastElement == null) { return; } // no nonce written -> do it if ("script".equalsIgnoreCase(lastElement) && LangUtils.isValueBlank(lastNonce)) { getWrapped().writeAttribute("nonce", cspState.ge...
java
private void listenOnEndAttribute() throws IOException { if (lastElement == null) { return; } // no nonce written -> do it if ("script".equalsIgnoreCase(lastElement) && LangUtils.isValueBlank(lastNonce)) { getWrapped().writeAttribute("nonce", cspState.ge...
[ "private", "void", "listenOnEndAttribute", "(", ")", "throws", "IOException", "{", "if", "(", "lastElement", "==", "null", ")", "{", "return", ";", "}", "// no nonce written -> do it\r", "if", "(", "\"script\"", ".", "equalsIgnoreCase", "(", "lastElement", ")", ...
Write needed attributes before the starting element will be closed by adding a trailing '>' character when calling e.g. {@link ResponseWriter#writeText}. See {@link ResponseWriter#startElement(String, UIComponent)}
[ "Write", "needed", "attributes", "before", "the", "starting", "element", "will", "be", "closed", "by", "adding", "a", "trailing", ">", "character", "when", "calling", "e", ".", "g", ".", "{" ]
b8cdd5ed395d09826e40e3302d6b14901d3ef4e7
https://github.com/primefaces/primefaces/blob/b8cdd5ed395d09826e40e3302d6b14901d3ef4e7/src/main/java/org/primefaces/csp/CspResponseWriter.java#L174-L200
train
listen on end attribute.
Of course, here is the Java code you requested: ```java private void listenOnEndAttribute() throws IOException { if (lastElement == null) { return; } // no nonce written -> do it if ("script".equalsIgnoreCase(lastElement) && LangUtils.isValueBlank(lastNonce)) { ...
googleads/googleads-java-lib
examples/admanager_axis/src/main/java/admanager/axis/v201902/customtargetingservice/DeleteCustomTargetingValues.java
DeleteCustomTargetingValues.runExample
public static void runExample( AdManagerServices adManagerServices, AdManagerSession session, long customTargetingValueId) throws RemoteException { // Get the CustomTargetingService. CustomTargetingServiceInterface customTargetingService = adManagerServices.get(session, CustomTargetingServic...
java
public static void runExample( AdManagerServices adManagerServices, AdManagerSession session, long customTargetingValueId) throws RemoteException { // Get the CustomTargetingService. CustomTargetingServiceInterface customTargetingService = adManagerServices.get(session, CustomTargetingServic...
[ "public", "static", "void", "runExample", "(", "AdManagerServices", "adManagerServices", ",", "AdManagerSession", "session", ",", "long", "customTargetingValueId", ")", "throws", "RemoteException", "{", "// Get the CustomTargetingService.", "CustomTargetingServiceInterface", "c...
Runs the example. @param adManagerServices the services factory. @param session the session. @param customTargetingValueId the ID of the custom targeting value to delete. @throws ApiException if the API request failed with one or more service errors. @throws RemoteException if the API request failed due to other error...
[ "Runs", "the", "example", "." ]
967957cc4f6076514e3a7926fe653e4f1f7cc9c9
https://github.com/googleads/googleads-java-lib/blob/967957cc4f6076514e3a7926fe653e4f1f7cc9c9/examples/admanager_axis/src/main/java/admanager/axis/v201902/customtargetingservice/DeleteCustomTargetingValues.java#L65-L124
train
Example of deleting a custom targeting value.
Of course, here is the Java code you requested: ```java public static void runExample( AdManagerServices adManagerServices, AdManagerSession session, long customTargetingValueId) throws RemoteException { // Get the CustomTargetingService. CustomTargetingServiceInterface customTargetingService = ...
oblac/jodd
jodd-db/src/main/java/jodd/db/DbQuery.java
DbQuery.setDouble
public Q setDouble(final int index, final Number value) { if (value == null) { setNull(index, Types.DOUBLE); } else { setDouble(index, value.doubleValue()); } return _this(); }
java
public Q setDouble(final int index, final Number value) { if (value == null) { setNull(index, Types.DOUBLE); } else { setDouble(index, value.doubleValue()); } return _this(); }
[ "public", "Q", "setDouble", "(", "final", "int", "index", ",", "final", "Number", "value", ")", "{", "if", "(", "value", "==", "null", ")", "{", "setNull", "(", "index", ",", "Types", ".", "DOUBLE", ")", ";", "}", "else", "{", "setDouble", "(", "in...
---------------------------------------------------------------- Double
[ "----------------------------------------------------------------", "Double" ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-db/src/main/java/jodd/db/DbQuery.java#L468-L476
test
Sets the value of the designated column to the specified double value.
Of course, here is the Java code you requested: ```java public Q setDouble(final int index, final Number value) { if (value == null) { setNull(index, Types.DOUBLE); } else { setDouble(index, value.doubleValue()); } return _this(); } ``` Hope this helps!
rzwitserloot/lombok
src/core/lombok/eclipse/handlers/HandleWither.java
HandleWither.generateWitherForField
public void generateWitherForField(EclipseNode fieldNode, EclipseNode sourceNode, AccessLevel level) { for (EclipseNode child : fieldNode.down()) { if (child.getKind() == Kind.ANNOTATION) { if (annotationTypeMatches(Wither.class, child)) { //The annotation will make it happen, so we can skip it. retu...
java
public void generateWitherForField(EclipseNode fieldNode, EclipseNode sourceNode, AccessLevel level) { for (EclipseNode child : fieldNode.down()) { if (child.getKind() == Kind.ANNOTATION) { if (annotationTypeMatches(Wither.class, child)) { //The annotation will make it happen, so we can skip it. retu...
[ "public", "void", "generateWitherForField", "(", "EclipseNode", "fieldNode", ",", "EclipseNode", "sourceNode", ",", "AccessLevel", "level", ")", "{", "for", "(", "EclipseNode", "child", ":", "fieldNode", ".", "down", "(", ")", ")", "{", "if", "(", "child", "...
Generates a wither on the stated field. Used by {@link HandleValue}. The difference between this call and the handle method is as follows: If there is a {@code lombok.experimental.Wither} annotation on the field, it is used and the same rules apply (e.g. warning if the method already exists, stated access level appl...
[ "Generates", "a", "wither", "on", "the", "stated", "field", "." ]
75601240760bd81ff95fcde7a1b8185769ce64e8
https://github.com/rzwitserloot/lombok/blob/75601240760bd81ff95fcde7a1b8185769ce64e8/src/core/lombok/eclipse/handlers/HandleWither.java#L108-L120
train
Generate wither for field.
Of course, here is the Java code you requested: ```java public void generateWitherForField(EclipseNode fieldNode, EclipseNode sourceNode, AccessLevel level) { for (EclipseNode child : fieldNode.down()) { if (child.getKind() == Kind.ANNOTATION) { if (annotationTypeMatches(Wither.class, child)) { //The ann...
bmwcarit/joynr
java/backend-services/capabilities-directory/src/main/java/io/joynr/capabilities/DiscoveryEntryStorePersisted.java
DiscoveryEntryStorePersisted.add
@Override public synchronized void add(DiscoveryEntry discoveryEntry) { logger.debug("adding discovery entry: {}", discoveryEntry); if (!(discoveryEntry instanceof GlobalDiscoveryEntryPersisted)) { return; } GlobalDiscoveryEntryPersisted globalDiscoveryEntry = (GlobalDisc...
java
@Override public synchronized void add(DiscoveryEntry discoveryEntry) { logger.debug("adding discovery entry: {}", discoveryEntry); if (!(discoveryEntry instanceof GlobalDiscoveryEntryPersisted)) { return; } GlobalDiscoveryEntryPersisted globalDiscoveryEntry = (GlobalDisc...
[ "@", "Override", "public", "synchronized", "void", "add", "(", "DiscoveryEntry", "discoveryEntry", ")", "{", "logger", ".", "debug", "(", "\"adding discovery entry: {}\"", ",", "discoveryEntry", ")", ";", "if", "(", "!", "(", "discoveryEntry", "instanceof", "Globa...
/* (non-Javadoc) @see io.joynr.capabilities.CapabilitiesStore#add(io.joynr. capabilities .DiscoveryEntry)
[ "/", "*", "(", "non", "-", "Javadoc", ")" ]
b7a92bad1cf2f093de080facd2c803560f4c6c26
https://github.com/bmwcarit/joynr/blob/b7a92bad1cf2f093de080facd2c803560f4c6c26/java/backend-services/capabilities-directory/src/main/java/io/joynr/capabilities/DiscoveryEntryStorePersisted.java#L75-L107
train
Add a discovery entry to the database.
Of course, here is the Java code you requested: ```java @Override public synchronized void add(DiscoveryEntry discoveryEntry) { logger.debug("adding discovery entry: {}", discoveryEntry); if (!(discoveryEntry instanceof GlobalDiscoveryEntryPersisted)) { return; } GlobalD...
alibaba/simpleimage
simpleimage.core/src/main/java/com/alibaba/simpleimage/codec/jpeg/ext/AdobeHeaderReader.java
AdobeHeaderReader.readProperties
public void readProperties(ImageInputStream in, int len, ExtendImageHeader imageHeader) throws IOException { int transform = 0, numToRead = 0; if (len >= 14) { numToRead = 14; } else if (len > 0) { numToRead = len; } else { numToRead = 0; } ...
java
public void readProperties(ImageInputStream in, int len, ExtendImageHeader imageHeader) throws IOException { int transform = 0, numToRead = 0; if (len >= 14) { numToRead = 14; } else if (len > 0) { numToRead = len; } else { numToRead = 0; } ...
[ "public", "void", "readProperties", "(", "ImageInputStream", "in", ",", "int", "len", ",", "ExtendImageHeader", "imageHeader", ")", "throws", "IOException", "{", "int", "transform", "=", "0", ",", "numToRead", "=", "0", ";", "if", "(", "len", ">=", "14", "...
/* (non-Javadoc) @see com.alibaba.simpleimage.jpeg.ExtendImageHeaderReader#readProperties(com.alibaba.simpleimage.jpeg.ImageInputStream , com.alibaba.simpleimage.jpeg.ExtendImageHeader)
[ "/", "*", "(", "non", "-", "Javadoc", ")" ]
aabe559c267402b754c2ad606b796c4c6570788c
https://github.com/alibaba/simpleimage/blob/aabe559c267402b754c2ad606b796c4c6570788c/simpleimage.core/src/main/java/com/alibaba/simpleimage/codec/jpeg/ext/AdobeHeaderReader.java#L36-L65
train
Read the properties of the image from the image input stream.
Of course, here is the Java code you requested: ```java public void readProperties(ImageInputStream in, int len, ExtendImageHeader imageHeader) throws IOException { int transform = 0, numToRead = 0; if (len >= 14) { numToRead = 14; } else if (len > 0) { numToRead = len;...
duraspace/fcrepo-cloudsync
fcrepo-cloudsync-service/src/main/java/org/duraspace/fcrepo/cloudsync/service/CloudSyncServiceImpl.java
CloudSyncServiceImpl.listProviderAccounts
@Override public List<ProviderAccount> listProviderAccounts(String url, String username, String password) { return duraCloudDao.listProviderAccounts(url, username, password); }
java
@Override public List<ProviderAccount> listProviderAccounts(String url, String username, String password) { return duraCloudDao.listProviderAccounts(url, username, password); }
[ "@", "Override", "public", "List", "<", "ProviderAccount", ">", "listProviderAccounts", "(", "String", "url", ",", "String", "username", ",", "String", "password", ")", "{", "return", "duraCloudDao", ".", "listProviderAccounts", "(", "url", ",", "username", ",",...
-----------------------------------------------------------------------
[ "-----------------------------------------------------------------------" ]
2d90e2c9c84a827f2605607ff40e116c67eff9b9
https://github.com/duraspace/fcrepo-cloudsync/blob/2d90e2c9c84a827f2605607ff40e116c67eff9b9/fcrepo-cloudsync-service/src/main/java/org/duraspace/fcrepo/cloudsync/service/CloudSyncServiceImpl.java#L363-L368
train
List all provider accounts
Of course, here is the Java code you requested: ```java @Override public List<ProviderAccount> listProviderAccounts(String url, String username, String password) { return duraCloudDao.listProviderAccounts(url, use...
TNG/ArchUnit
archunit/src/main/java/com/tngtech/archunit/core/importer/ClassFileImporter.java
ClassFileImporter.importUrls
@PublicAPI(usage = ACCESS) public JavaClasses importUrls(Collection<URL> urls) { return importLocations(Locations.of(urls)); }
java
@PublicAPI(usage = ACCESS) public JavaClasses importUrls(Collection<URL> urls) { return importLocations(Locations.of(urls)); }
[ "@", "PublicAPI", "(", "usage", "=", "ACCESS", ")", "public", "JavaClasses", "importUrls", "(", "Collection", "<", "URL", ">", "urls", ")", "{", "return", "importLocations", "(", "Locations", ".", "of", "(", "urls", ")", ")", ";", "}" ]
Converts the supplied {@link URL URLs} to {@link Location locations} and delegates to {@link #importLocations(Collection)}
[ "Converts", "the", "supplied", "{" ]
024c5d2502e91de6cb586b86c7084dbd12f3ef37
https://github.com/TNG/ArchUnit/blob/024c5d2502e91de6cb586b86c7084dbd12f3ef37/archunit/src/main/java/com/tngtech/archunit/core/importer/ClassFileImporter.java#L312-L315
train
Imports a collection of URIs into a CRAs covering the generated code.
Of course, here is the Java code you requested: ```java @PublicAPI(usage = ACCESS) public JavaClasses importUrls(Collection<URL> urls) { return importLocations(Locations.of(urls)); } ``` Hope this helps!
eclipse/hawkbit
hawkbit-dmf/hawkbit-dmf-amqp/src/main/java/org/eclipse/hawkbit/amqp/AmqpConfiguration.java
AmqpConfiguration.authenticationReceiverQueue
@Bean public Queue authenticationReceiverQueue() { return QueueBuilder.nonDurable(amqpProperties.getAuthenticationReceiverQueue()).autoDelete() .withArguments(getTTLMaxArgsAuthenticationQueue()).build(); }
java
@Bean public Queue authenticationReceiverQueue() { return QueueBuilder.nonDurable(amqpProperties.getAuthenticationReceiverQueue()).autoDelete() .withArguments(getTTLMaxArgsAuthenticationQueue()).build(); }
[ "@", "Bean", "public", "Queue", "authenticationReceiverQueue", "(", ")", "{", "return", "QueueBuilder", ".", "nonDurable", "(", "amqpProperties", ".", "getAuthenticationReceiverQueue", "(", ")", ")", ".", "autoDelete", "(", ")", ".", "withArguments", "(", "getTTLM...
Create the DMF API receiver queue for authentication requests called by 3rd party artifact storages for download authorization by devices. @return the receiver queue
[ "Create", "the", "DMF", "API", "receiver", "queue", "for", "authentication", "requests", "called", "by", "3rd", "party", "artifact", "storages", "for", "download", "authorization", "by", "devices", "." ]
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-dmf/hawkbit-dmf-amqp/src/main/java/org/eclipse/hawkbit/amqp/AmqpConfiguration.java#L147-L151
train
A non - durable queue that will be used to receive messages from the server.
Of course, here is the Java code you requested: ```java @Bean public Queue authenticationReceiverQueue() { return QueueBuilder.nonDurable(amqpProperties.getAuthenticationReceiverQueue()).autoDelete() .withArguments(getTTLMaxArgsAuthenticationQueue()).build(); } ``` Hope this helps!
kuujo/vertigo
core/src/main/java/net/kuujo/vertigo/io/connection/impl/DefaultOutputConnection.java
DefaultOutputConnection.createMessage
private JsonObject createMessage(Object value) { // Tag the message with a monotonically increasing ID. The ID // will be used by the other side of the connection to guarantee // ordering. JsonObject message = serializer.serialize(value); long id = currentMessage++; message.putNumber("id", id); ...
java
private JsonObject createMessage(Object value) { // Tag the message with a monotonically increasing ID. The ID // will be used by the other side of the connection to guarantee // ordering. JsonObject message = serializer.serialize(value); long id = currentMessage++; message.putNumber("id", id); ...
[ "private", "JsonObject", "createMessage", "(", "Object", "value", ")", "{", "// Tag the message with a monotonically increasing ID. The ID", "// will be used by the other side of the connection to guarantee", "// ordering.", "JsonObject", "message", "=", "serializer", ".", "serialize...
Creates a value message.
[ "Creates", "a", "value", "message", "." ]
c5869dbc5fff89eb5262e83f7a81719b01a5ba6f
https://github.com/kuujo/vertigo/blob/c5869dbc5fff89eb5262e83f7a81719b01a5ba6f/core/src/main/java/net/kuujo/vertigo/io/connection/impl/DefaultOutputConnection.java#L564-L573
train
Creates a new message with a monotonically increasing ID.
Of course, here is the Java code you requested: ```java private JsonObject createMessage(Object value) { // Tag the message with a monotonically increasing ID. The ID // will be used by the other side of the connection to guarantee // ordering. JsonObject message = serializer.serialize(value); long...
forge/javaee-descriptors
impl/src/main/java/org/jboss/shrinkwrap/descriptor/impl/connector16/ConnectorDescriptorImpl.java
ConnectorDescriptorImpl.removeAllNamespaces
public ConnectorDescriptor removeAllNamespaces() { List<String> nameSpaceKeys = new ArrayList<String>(); java.util.Map<String, String> attributes = model.getAttributes(); for (Entry<String, String> e : attributes.entrySet()) { final String name = e.getKey(); final String val...
java
public ConnectorDescriptor removeAllNamespaces() { List<String> nameSpaceKeys = new ArrayList<String>(); java.util.Map<String, String> attributes = model.getAttributes(); for (Entry<String, String> e : attributes.entrySet()) { final String name = e.getKey(); final String val...
[ "public", "ConnectorDescriptor", "removeAllNamespaces", "(", ")", "{", "List", "<", "String", ">", "nameSpaceKeys", "=", "new", "ArrayList", "<", "String", ">", "(", ")", ";", "java", ".", "util", ".", "Map", "<", "String", ",", "String", ">", "attributes"...
Removes all existing namespaces. @return the current instance of <code>ConnectorDescriptor</code>
[ "Removes", "all", "existing", "namespaces", "." ]
cb914330a1a0b04bfc1d0f199bd9cde3bbf0b3ed
https://github.com/forge/javaee-descriptors/blob/cb914330a1a0b04bfc1d0f199bd9cde3bbf0b3ed/impl/src/main/java/org/jboss/shrinkwrap/descriptor/impl/connector16/ConnectorDescriptorImpl.java#L117-L135
train
Removes all namespaces from the connector.
Of course, here is the Java code you requested: ```java public ConnectorDescriptor removeAllNamespaces() { List<String> nameSpaceKeys = new ArrayList<String>(); java.util.Map<String, String> attributes = model.getAttributes(); for (Entry<String, String> e : attributes.entrySet()) { ...
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/vpn/vpnclientlessaccessprofile.java
vpnclientlessaccessprofile.add
public static base_responses add(nitro_service client, vpnclientlessaccessprofile resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { vpnclientlessaccessprofile addresources[] = new vpnclientlessaccessprofile[resources.length]; for (int i=0;i<resource...
java
public static base_responses add(nitro_service client, vpnclientlessaccessprofile resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { vpnclientlessaccessprofile addresources[] = new vpnclientlessaccessprofile[resources.length]; for (int i=0;i<resource...
[ "public", "static", "base_responses", "add", "(", "nitro_service", "client", ",", "vpnclientlessaccessprofile", "resources", "[", "]", ")", "throws", "Exception", "{", "base_responses", "result", "=", "null", ";", "if", "(", "resources", "!=", "null", "&&", "res...
Use this API to add vpnclientlessaccessprofile resources.
[ "Use", "this", "API", "to", "add", "vpnclientlessaccessprofile", "resources", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/vpn/vpnclientlessaccessprofile.java#L370-L381
train
Use this API to add vpnclientlessaccessprofile resources.
Of course, here is the Java code you requested: ```java public static base_responses add(nitro_service client, vpnclientlessaccessprofile resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { vpnclientlessaccessprofile addresources[] = new vpnclientlessac...
dbflute-session/mailflute
src/main/java/org/dbflute/mail/send/supplement/logging/SMailTypicalLoggingStrategy.java
SMailTypicalLoggingStrategy.logRetrySuccess
@Override public void logRetrySuccess(CardView view, SMailPostingDiscloser discloser, int challengeCount, Exception firstCause) { if (normalLogger.isInfoEnabled()) { normalLogger.info(buildRetrySuccessDisp(view, discloser, challengeCount, firstCause)); } }
java
@Override public void logRetrySuccess(CardView view, SMailPostingDiscloser discloser, int challengeCount, Exception firstCause) { if (normalLogger.isInfoEnabled()) { normalLogger.info(buildRetrySuccessDisp(view, discloser, challengeCount, firstCause)); } }
[ "@", "Override", "public", "void", "logRetrySuccess", "(", "CardView", "view", ",", "SMailPostingDiscloser", "discloser", ",", "int", "challengeCount", ",", "Exception", "firstCause", ")", "{", "if", "(", "normalLogger", ".", "isInfoEnabled", "(", ")", ")", "{",...
=============
[ "=============" ]
e41da4984131b09d55060e247fa4831682bc40a9
https://github.com/dbflute-session/mailflute/blob/e41da4984131b09d55060e247fa4831682bc40a9/src/main/java/org/dbflute/mail/send/supplement/logging/SMailTypicalLoggingStrategy.java#L112-L117
train
Log a successful retry of a SMailPostingDiscloser.
Of course, here is the Java code you requested: ```java @Override public void logRetrySuccess(CardView view, SMailPostingDiscloser discloser, int challengeCount, Exception firstCause) { if (normalLogger.isInfoEnabled()) { normalLogger.info(buildRetrySuccessDisp(view, discloser, challengeCount, ...
apache/flink
flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/KeyedStream.java
KeyedStream.timeWindow
public WindowedStream<T, KEY, TimeWindow> timeWindow(Time size) { if (environment.getStreamTimeCharacteristic() == TimeCharacteristic.ProcessingTime) { return window(TumblingProcessingTimeWindows.of(size)); } else { return window(TumblingEventTimeWindows.of(size)); } }
java
public WindowedStream<T, KEY, TimeWindow> timeWindow(Time size) { if (environment.getStreamTimeCharacteristic() == TimeCharacteristic.ProcessingTime) { return window(TumblingProcessingTimeWindows.of(size)); } else { return window(TumblingEventTimeWindows.of(size)); } }
[ "public", "WindowedStream", "<", "T", ",", "KEY", ",", "TimeWindow", ">", "timeWindow", "(", "Time", "size", ")", "{", "if", "(", "environment", ".", "getStreamTimeCharacteristic", "(", ")", "==", "TimeCharacteristic", ".", "ProcessingTime", ")", "{", "return"...
Windows this {@code KeyedStream} into tumbling time windows. <p>This is a shortcut for either {@code .window(TumblingEventTimeWindows.of(size))} or {@code .window(TumblingProcessingTimeWindows.of(size))} depending on the time characteristic set using {@link org.apache.flink.streaming.api.environment.StreamExecutionEnv...
[ "Windows", "this", "{", "@code", "KeyedStream", "}", "into", "tumbling", "time", "windows", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/KeyedStream.java#L611-L617
train
Create a time window stream.
Of course, here is the Java code you requested: ```java public WindowedStream<T, KEY, TimeWindow> timeWindow(Time size) { if (environment.getStreamTimeCharacteristic() == TimeCharacteristic.ProcessingTime) { return window(TumblingProcessingTimeWindows.of(size)); } else { return window(TumblingEventTimeWindow...
alkacon/opencms-core
src-gwt/org/opencms/gwt/client/util/CmsJsUtil.java
CmsJsUtil.wrapCallback
public static AsyncCallback<String> wrapCallback(final JavaScriptObject func) { return new AsyncCallback<String>() { public void onFailure(Throwable caught) { // TODO Auto-generated method stub } public void onSuccess(String result) { ...
java
public static AsyncCallback<String> wrapCallback(final JavaScriptObject func) { return new AsyncCallback<String>() { public void onFailure(Throwable caught) { // TODO Auto-generated method stub } public void onSuccess(String result) { ...
[ "public", "static", "AsyncCallback", "<", "String", ">", "wrapCallback", "(", "final", "JavaScriptObject", "func", ")", "{", "return", "new", "AsyncCallback", "<", "String", ">", "(", ")", "{", "public", "void", "onFailure", "(", "Throwable", "caught", ")", ...
Wraps a native JavaScript callback taking a string argument into an AsyncCallback so that it can easily be called from GWT Java code.<p> @param func the function to wrap @return the AsyncCallback wrapper
[ "Wraps", "a", "native", "JavaScript", "callback", "taking", "a", "string", "argument", "into", "an", "AsyncCallback", "so", "that", "it", "can", "easily", "be", "called", "from", "GWT", "Java", "code", ".", "<p", ">" ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/util/CmsJsUtil.java#L135-L151
train
Wrap a callback to be used in a javascript object.
Of course, here is the Java code you requested: ```java public static AsyncCallback<String> wrapCallback(final JavaScriptObject func) { return new AsyncCallback<String>() { public void onFailure(Throwable caught) { // TODO Auto-generated method stub } ...
artclarke/humble-video
humble-video-noarch/src/main/java/io/humble/video/Codec.java
Codec.findEncodingCodecByIntID
public static Codec findEncodingCodecByIntID(int id) { long cPtr = VideoJNI.Codec_findEncodingCodecByIntID(id); return (cPtr == 0) ? null : new Codec(cPtr, false); }
java
public static Codec findEncodingCodecByIntID(int id) { long cPtr = VideoJNI.Codec_findEncodingCodecByIntID(id); return (cPtr == 0) ? null : new Codec(cPtr, false); }
[ "public", "static", "Codec", "findEncodingCodecByIntID", "(", "int", "id", ")", "{", "long", "cPtr", "=", "VideoJNI", ".", "Codec_findEncodingCodecByIntID", "(", "id", ")", ";", "return", "(", "cPtr", "==", "0", ")", "?", "null", ":", "new", "Codec", "(", ...
Find a codec that can be used for encoding.<br> @param id The id of the codec, as an integer.<br> @return the codec, or null if we can't find it.
[ "Find", "a", "codec", "that", "can", "be", "used", "for", "encoding", ".", "<br", ">" ]
aa349ae2d7ef74160b7074feac8d298cf90394d1
https://github.com/artclarke/humble-video/blob/aa349ae2d7ef74160b7074feac8d298cf90394d1/humble-video-noarch/src/main/java/io/humble/video/Codec.java#L378-L381
test
Find encoding codec by int id.
Of course, here is the Java code you requested: ```java public static Codec findEncodingCodecByIntID(int id) { long cPtr = VideoJNI.Codec_findEncodingCodecByIntID(id); return (cPtr == 0) ? null : new Codec(cPtr, false); } ``` Hope this helps!
virgo47/javasimon
core/src/main/java/org/javasimon/EnabledManager.java
EnabledManager.replaceUnknownSimon
private AbstractSimon replaceUnknownSimon(AbstractSimon simon, Class<? extends AbstractSimon> simonClass) { AbstractSimon newSimon = instantiateSimon(simon.getName(), simonClass); newSimon.enabled = simon.enabled; // fixes parent link and parent's children list ((AbstractSimon) simon.getParent()).replaceChild(...
java
private AbstractSimon replaceUnknownSimon(AbstractSimon simon, Class<? extends AbstractSimon> simonClass) { AbstractSimon newSimon = instantiateSimon(simon.getName(), simonClass); newSimon.enabled = simon.enabled; // fixes parent link and parent's children list ((AbstractSimon) simon.getParent()).replaceChild(...
[ "private", "AbstractSimon", "replaceUnknownSimon", "(", "AbstractSimon", "simon", ",", "Class", "<", "?", "extends", "AbstractSimon", ">", "simonClass", ")", "{", "AbstractSimon", "newSimon", "=", "instantiateSimon", "(", "simon", ".", "getName", "(", ")", ",", ...
called from synchronized method
[ "called", "from", "synchronized", "method" ]
17dfaa93cded9ce8ef64a134b28ccbf4d0284d2f
https://github.com/virgo47/javasimon/blob/17dfaa93cded9ce8ef64a134b28ccbf4d0284d2f/core/src/main/java/org/javasimon/EnabledManager.java#L147-L162
train
Replaces an unknown simon with a new one.
Of course, here is the Java code you requested: ```java private AbstractSimon replaceUnknownSimon(AbstractSimon simon, Class<? extends AbstractSimon> simonClass) { AbstractSimon newSimon = instantiateSimon(simon.getName(), simonClass); newSimon.enabled = simon.enabled; // fixes parent link and parent's children...
lionsoul2014/jcseg
jcseg-server/src/main/java/org/lionsoul/jcseg/json/XML.java
XML.stringToValue
public static Object stringToValue(String string) { if ("true".equalsIgnoreCase(string)) { return Boolean.TRUE; } if ("false".equalsIgnoreCase(string)) { return Boolean.FALSE; } if ("null".equalsIgnoreCase(string)) { return JSONObject.NULL; ...
java
public static Object stringToValue(String string) { if ("true".equalsIgnoreCase(string)) { return Boolean.TRUE; } if ("false".equalsIgnoreCase(string)) { return Boolean.FALSE; } if ("null".equalsIgnoreCase(string)) { return JSONObject.NULL; ...
[ "public", "static", "Object", "stringToValue", "(", "String", "string", ")", "{", "if", "(", "\"true\"", ".", "equalsIgnoreCase", "(", "string", ")", ")", "{", "return", "Boolean", ".", "TRUE", ";", "}", "if", "(", "\"false\"", ".", "equalsIgnoreCase", "("...
Try to convert a string into a number, boolean, or null. If the string can't be converted, return the string. This is much less ambitious than JSONObject.stringToValue, especially because it does not attempt to convert plus forms, octal forms, hex forms, or E forms lacking decimal points. @param string A String. @retur...
[ "Try", "to", "convert", "a", "string", "into", "a", "number", "boolean", "or", "null", ".", "If", "the", "string", "can", "t", "be", "converted", "return", "the", "string", ".", "This", "is", "much", "less", "ambitious", "than", "JSONObject", ".", "strin...
7c8a912e3bbcaf4f8de701180b9c24e2e444a94b
https://github.com/lionsoul2014/jcseg/blob/7c8a912e3bbcaf4f8de701180b9c24e2e444a94b/jcseg-server/src/main/java/org/lionsoul/jcseg/json/XML.java#L302-L334
train
Convert a string to a value.
Of course, here is the Java code you requested: ```java public static Object stringToValue(String string) { if ("true".equalsIgnoreCase(string)) { return Boolean.TRUE; } if ("false".equalsIgnoreCase(string)) { return Boolean.FALSE; } if ("null".equalsIgno...
alibaba/transmittable-thread-local
src/main/java/com/alibaba/ttl/TtlRunnable.java
TtlRunnable.gets
@Nonnull public static List<TtlRunnable> gets(@Nullable Collection<? extends Runnable> tasks, boolean releaseTtlValueReferenceAfterRun) { return gets(tasks, releaseTtlValueReferenceAfterRun, false); }
java
@Nonnull public static List<TtlRunnable> gets(@Nullable Collection<? extends Runnable> tasks, boolean releaseTtlValueReferenceAfterRun) { return gets(tasks, releaseTtlValueReferenceAfterRun, false); }
[ "@", "Nonnull", "public", "static", "List", "<", "TtlRunnable", ">", "gets", "(", "@", "Nullable", "Collection", "<", "?", "extends", "Runnable", ">", "tasks", ",", "boolean", "releaseTtlValueReferenceAfterRun", ")", "{", "return", "gets", "(", "tasks", ",", ...
wrap input {@link Runnable} Collection to {@link TtlRunnable} Collection. @param tasks task to be wrapped. if input is {@code null}, return {@code null}. @param releaseTtlValueReferenceAfterRun release TTL value reference after run, avoid memory leak even if {@link TtlRunnable} is referred. ...
[ "wrap", "input", "{", "@link", "Runnable", "}", "Collection", "to", "{", "@link", "TtlRunnable", "}", "Collection", "." ]
30b4d99cdb7064b4c1797d2e40bfa07adce8e7f9
https://github.com/alibaba/transmittable-thread-local/blob/30b4d99cdb7064b4c1797d2e40bfa07adce8e7f9/src/main/java/com/alibaba/ttl/TtlRunnable.java#L153-L156
train
Gets a list of TTL runnables from a collection of tasks.
Of course, here is the Java code you requested: ```java @Nonnull public static List<TtlRunnable> gets(@Nullable Collection<? extends Runnable> tasks, boolean releaseTtlValueReferenceAfterRun) { return gets(tasks, releaseTtlValueReferenceAfterRun, false); } ``` Hope this helps!
eiichiro/jaguar
jaguar-core/src/main/java/org/eiichiro/jaguar/aspect/Interceptor.java
Interceptor.intercept
public Object intercept(final Object object, Method method, final Object[] args, final MethodProxy proxy) throws Throwable { if (!descriptor.joinpoints().contains(method)) { return proxy.invokeSuper(object, args); } Map<Descriptor<?>, Object> aspects = new HashMap<Descriptor<?>, Object>(); List<Descri...
java
public Object intercept(final Object object, Method method, final Object[] args, final MethodProxy proxy) throws Throwable { if (!descriptor.joinpoints().contains(method)) { return proxy.invokeSuper(object, args); } Map<Descriptor<?>, Object> aspects = new HashMap<Descriptor<?>, Object>(); List<Descri...
[ "public", "Object", "intercept", "(", "final", "Object", "object", ",", "Method", "method", ",", "final", "Object", "[", "]", "args", ",", "final", "MethodProxy", "proxy", ")", "throws", "Throwable", "{", "if", "(", "!", "descriptor", ".", "joinpoints", "(...
Intercepts the component method invocation and invokes the bound aspect components. @param object The component (Dynamically-generated subclass) instance invoked. @param method The component method invoked. @param args The component method invocation arguments. @param proxy {@code MethodProxy} provided by cglib and us...
[ "Intercepts", "the", "component", "method", "invocation", "and", "invokes", "the", "bound", "aspect", "components", "." ]
9da0b8677fa306f10f848402490c75d05c213547
https://github.com/eiichiro/jaguar/blob/9da0b8677fa306f10f848402490c75d05c213547/jaguar-core/src/main/java/org/eiichiro/jaguar/aspect/Interceptor.java#L84-L168
train
Intercepts a method.
Of course, here is the Java code you requested: ```java public Object intercept(final Object object, Method method, final Object[] args, final MethodProxy proxy) throws Throwable { if (!descriptor.joinpoints().contains(method)) { return proxy.invokeSuper(object, args); } Map<Descriptor<?>, Object> aspe...
aws/aws-sdk-java
aws-java-sdk-lightsail/src/main/java/com/amazonaws/services/lightsail/model/GetActiveNamesResult.java
GetActiveNamesResult.withActiveNames
public GetActiveNamesResult withActiveNames(String... activeNames) { if (this.activeNames == null) { setActiveNames(new java.util.ArrayList<String>(activeNames.length)); } for (String ele : activeNames) { this.activeNames.add(ele); } return this; }
java
public GetActiveNamesResult withActiveNames(String... activeNames) { if (this.activeNames == null) { setActiveNames(new java.util.ArrayList<String>(activeNames.length)); } for (String ele : activeNames) { this.activeNames.add(ele); } return this; }
[ "public", "GetActiveNamesResult", "withActiveNames", "(", "String", "...", "activeNames", ")", "{", "if", "(", "this", ".", "activeNames", "==", "null", ")", "{", "setActiveNames", "(", "new", "java", ".", "util", ".", "ArrayList", "<", "String", ">", "(", ...
<p> The list of active names returned by the get active names request. </p> <p> <b>NOTE:</b> This method appends the values to the existing list (if any). Use {@link #setActiveNames(java.util.Collection)} or {@link #withActiveNames(java.util.Collection)} if you want to override the existing values. </p> @param activeN...
[ "<p", ">", "The", "list", "of", "active", "names", "returned", "by", "the", "get", "active", "names", "request", ".", "<", "/", "p", ">", "<p", ">", "<b", ">", "NOTE", ":", "<", "/", "b", ">", "This", "method", "appends", "the", "values", "to", "...
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-lightsail/src/main/java/com/amazonaws/services/lightsail/model/GetActiveNamesResult.java#L84-L92
train
A list of the names of the active attributes.
Of course, here is the Java code you requested: ```java public GetActiveNamesResult withActiveNames(String... activeNames) { if (this.activeNames == null) { setActiveNames(new java.util.ArrayList<String>(activeNames.length)); } for (String ele : activeNames) { this.activ...
aws/aws-sdk-java
aws-java-sdk-iot/src/main/java/com/amazonaws/services/iot/AWSIotClient.java
AWSIotClient.updateThingGroupsForThing
@Override public UpdateThingGroupsForThingResult updateThingGroupsForThing(UpdateThingGroupsForThingRequest request) { request = beforeClientExecution(request); return executeUpdateThingGroupsForThing(request); }
java
@Override public UpdateThingGroupsForThingResult updateThingGroupsForThing(UpdateThingGroupsForThingRequest request) { request = beforeClientExecution(request); return executeUpdateThingGroupsForThing(request); }
[ "@", "Override", "public", "UpdateThingGroupsForThingResult", "updateThingGroupsForThing", "(", "UpdateThingGroupsForThingRequest", "request", ")", "{", "request", "=", "beforeClientExecution", "(", "request", ")", ";", "return", "executeUpdateThingGroupsForThing", "(", "requ...
<p> Updates the groups to which the thing belongs. </p> @param updateThingGroupsForThingRequest @return Result of the UpdateThingGroupsForThing operation returned by the service. @throws InvalidRequestException The request is not valid. @throws ThrottlingException The rate exceeds the limit. @throws InternalFailureExc...
[ "<p", ">", "Updates", "the", "groups", "to", "which", "the", "thing", "belongs", ".", "<", "/", "p", ">" ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-iot/src/main/java/com/amazonaws/services/iot/AWSIotClient.java#L10778-L10782
train
Updates the groups for a thing.
Of course, here is the Java code you requested: ```java @Override public UpdateThingGroupsForThingResult updateThingGroupsForThing(UpdateThingGroupsForThingRequest request) { request = beforeClientExecution(request); return executeUpdateThingGroupsForThing(request); } ``` Hope this helps!
prestodb/presto
presto-orc/src/main/java/com/facebook/presto/orc/stream/LongDecode.java
LongDecode.getClosestFixedBits
public static int getClosestFixedBits(int width) { if (width == 0) { return 1; } if (width >= 1 && width <= 24) { return width; } else if (width > 24 && width <= 26) { return 26; } else if (width > 26 && width <= 28) { ...
java
public static int getClosestFixedBits(int width) { if (width == 0) { return 1; } if (width >= 1 && width <= 24) { return width; } else if (width > 24 && width <= 26) { return 26; } else if (width > 26 && width <= 28) { ...
[ "public", "static", "int", "getClosestFixedBits", "(", "int", "width", ")", "{", "if", "(", "width", "==", "0", ")", "{", "return", "1", ";", "}", "if", "(", "width", ">=", "1", "&&", "width", "<=", "24", ")", "{", "return", "width", ";", "}", "e...
Gets the closest supported fixed bit width for the specified bit width.
[ "Gets", "the", "closest", "supported", "fixed", "bit", "width", "for", "the", "specified", "bit", "width", "." ]
89de5e379d8f85e139d292b0add8c537a2a01a88
https://github.com/prestodb/presto/blob/89de5e379d8f85e139d292b0add8c537a2a01a88/presto-orc/src/main/java/com/facebook/presto/orc/stream/LongDecode.java#L87-L120
train
Get the closest fixed bits of a segment of a segment of a given width.
Of course, here is the Java code you requested: ```java public static int getClosestFixedBits(int width) { if (width == 0) { return 1; } if (width >= 1 && width <= 24) { return width; } else if (width > 24 && width <= 26) { return 26; ...
TheHortonMachine/hortonmachine
gears/src/main/java/org/hortonmachine/gears/io/dbf/OmsDbfTableReader.java
OmsDbfTableReader.readDbf
public static Map<String, List<Object>> readDbf( String path ) throws IOException { OmsDbfTableReader reader = new OmsDbfTableReader(); reader.file = path; reader.readTable(); return reader.outTabledata; }
java
public static Map<String, List<Object>> readDbf( String path ) throws IOException { OmsDbfTableReader reader = new OmsDbfTableReader(); reader.file = path; reader.readTable(); return reader.outTabledata; }
[ "public", "static", "Map", "<", "String", ",", "List", "<", "Object", ">", ">", "readDbf", "(", "String", "path", ")", "throws", "IOException", "{", "OmsDbfTableReader", "reader", "=", "new", "OmsDbfTableReader", "(", ")", ";", "reader", ".", "file", "=", ...
Fast read access mode. @param path the dbf path. @return the read table. @throws IOException
[ "Fast", "read", "access", "mode", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/dbf/OmsDbfTableReader.java#L120-L127
train
Read the DBF file.
Of course, here is the Java code you requested: ```java public static Map<String, List<Object>> readDbf( String path ) throws IOException { OmsDbfTableReader reader = new OmsDbfTableReader(); reader.file = path; reader.readTable(); return reader.outTabledata; } ``` Hope this help...
spring-projects/spring-security
config/src/main/java/org/springframework/security/config/annotation/web/messaging/MessageSecurityMetadataSourceRegistry.java
MessageSecurityMetadataSourceRegistry.simpDestPathMatcher
public MessageSecurityMetadataSourceRegistry simpDestPathMatcher( PathMatcher pathMatcher) { Assert.notNull(pathMatcher, "pathMatcher cannot be null"); this.pathMatcher.setPathMatcher(pathMatcher); this.defaultPathMatcher = false; return this; }
java
public MessageSecurityMetadataSourceRegistry simpDestPathMatcher( PathMatcher pathMatcher) { Assert.notNull(pathMatcher, "pathMatcher cannot be null"); this.pathMatcher.setPathMatcher(pathMatcher); this.defaultPathMatcher = false; return this; }
[ "public", "MessageSecurityMetadataSourceRegistry", "simpDestPathMatcher", "(", "PathMatcher", "pathMatcher", ")", "{", "Assert", ".", "notNull", "(", "pathMatcher", ",", "\"pathMatcher cannot be null\"", ")", ";", "this", ".", "pathMatcher", ".", "setPathMatcher", "(", ...
The {@link PathMatcher} to be used with the {@link MessageSecurityMetadataSourceRegistry#simpDestMatchers(String...)}. The default is to use the default constructor of {@link AntPathMatcher}. @param pathMatcher the {@link PathMatcher} to use. Cannot be null. @return the {@link MessageSecurityMetadataSourceRegistry} fo...
[ "The", "{", "@link", "PathMatcher", "}", "to", "be", "used", "with", "the", "{", "@link", "MessageSecurityMetadataSourceRegistry#simpDestMatchers", "(", "String", "...", ")", "}", ".", "The", "default", "is", "to", "use", "the", "default", "constructor", "of", ...
98a8467e4c2ae05b3e09c67ece856944fa48ed23
https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/config/src/main/java/org/springframework/security/config/annotation/web/messaging/MessageSecurityMetadataSourceRegistry.java#L179-L185
test
Sets the path matcher to use for destination path matchers.
Of course, here is the Java code you requested: ```java public MessageSecurityMetadataSourceRegistry simpDestPathMatcher( PathMatcher pathMatcher) { Assert.notNull(pathMatcher, "pathMatcher cannot be null"); this.pathMatcher.setPathMatcher(pathMatcher); this.defaultPathMatcher = false; return this; } ``` ...
unbescape/unbescape
src/main/java/org/unbescape/properties/PropertiesEscape.java
PropertiesEscape.unescapeProperties
public static void unescapeProperties(final String text, final Writer writer) throws IOException { if (writer == null) { throw new IllegalArgumentException("Argument 'writer' cannot be null"); } if (text == null) { return; } if (text.indexOf('...
java
public static void unescapeProperties(final String text, final Writer writer) throws IOException { if (writer == null) { throw new IllegalArgumentException("Argument 'writer' cannot be null"); } if (text == null) { return; } if (text.indexOf('...
[ "public", "static", "void", "unescapeProperties", "(", "final", "String", "text", ",", "final", "Writer", "writer", ")", "throws", "IOException", "{", "if", "(", "writer", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Argument 'writ...
<p> Perform a Java Properties (key or value) <strong>unescape</strong> operation on a <tt>String</tt> input, writing results to a <tt>Writer</tt>. </p> <p> No additional configuration arguments are required. Unescape operations will always perform <em>complete</em> Java Properties unescape of SECs and u-based escapes. ...
[ "<p", ">", "Perform", "a", "Java", "Properties", "(", "key", "or", "value", ")", "<strong", ">", "unescape<", "/", "strong", ">", "operation", "on", "a", "<tt", ">", "String<", "/", "tt", ">", "input", "writing", "results", "to", "a", "<tt", ">", "Wr...
ec5435fb3508c2eed25d8165dc27ded2602cae13
https://github.com/unbescape/unbescape/blob/ec5435fb3508c2eed25d8165dc27ded2602cae13/src/main/java/org/unbescape/properties/PropertiesEscape.java#L1405-L1422
train
Unescapes properties from a string.
Of course, here is the Java code you requested: ```java public static void unescapeProperties(final String text, final Writer writer) throws IOException { if (writer == null) { throw new IllegalArgumentException("Argument 'writer' cannot be null"); } if (text == null) {...
mnlipp/jgrapes
org.jgrapes.http/src/org/jgrapes/http/LanguageSelector.java
LanguageSelector.associatedLocale
public static Locale associatedLocale(Associator assoc) { return assoc.associated(Selection.class) .map(sel -> sel.get()[0]).orElse(Locale.getDefault()); }
java
public static Locale associatedLocale(Associator assoc) { return assoc.associated(Selection.class) .map(sel -> sel.get()[0]).orElse(Locale.getDefault()); }
[ "public", "static", "Locale", "associatedLocale", "(", "Associator", "assoc", ")", "{", "return", "assoc", ".", "associated", "(", "Selection", ".", "class", ")", ".", "map", "(", "sel", "->", "sel", ".", "get", "(", ")", "[", "0", "]", ")", ".", "or...
Convenience method to retrieve a locale from an associator. @param assoc the associator @return the locale
[ "Convenience", "method", "to", "retrieve", "a", "locale", "from", "an", "associator", "." ]
8b5d874935d84c34a52d3e3d3745e869b5203fa0
https://github.com/mnlipp/jgrapes/blob/8b5d874935d84c34a52d3e3d3745e869b5203fa0/org.jgrapes.http/src/org/jgrapes/http/LanguageSelector.java#L228-L231
train
Returns the locale associated with the given association.
Of course, here is the Java code you requested: ```java public static Locale associatedLocale(Associator assoc) { return assoc.associated(Selection.class) .map(sel -> sel.get()[0]).orElse(Locale.getDefault()); } ``` Hope this helps!
revelytix/spark
spark-http-client/src/main/java/spark/protocol/parser/XMLResultsParser.java
XMLResultsParser.cleanup
static final void cleanup(XMLStreamReader reader) throws XMLStreamException { if (reader.nextTag() != END_ELEMENT || !reader.getLocalName().equalsIgnoreCase(SPARQL.name())) { logger.warn("Extra data at end of results"); } else if (reader.next() != END_DOCUMENT) { logger.warn("Unexpected data after X...
java
static final void cleanup(XMLStreamReader reader) throws XMLStreamException { if (reader.nextTag() != END_ELEMENT || !reader.getLocalName().equalsIgnoreCase(SPARQL.name())) { logger.warn("Extra data at end of results"); } else if (reader.next() != END_DOCUMENT) { logger.warn("Unexpected data after X...
[ "static", "final", "void", "cleanup", "(", "XMLStreamReader", "reader", ")", "throws", "XMLStreamException", "{", "if", "(", "reader", ".", "nextTag", "(", ")", "!=", "END_ELEMENT", "||", "!", "reader", ".", "getLocalName", "(", ")", ".", "equalsIgnoreCase", ...
Cleans up the stream reader. This method is expected to be called just before the final </sparql> end element, which should be the last event in the document. Also closes the stream since there's nothing more to read rather than wait for the client to do so. @param reader The reader @throws XMLStreamException if there ...
[ "Cleans", "up", "the", "stream", "reader", ".", "This", "method", "is", "expected", "to", "be", "called", "just", "before", "the", "final", "<", "/", "sparql", ">", "end", "element", "which", "should", "be", "the", "last", "event", "in", "the", "document...
d777d40c962bc66fdc04b7c3a66d20b777ff6fb4
https://github.com/revelytix/spark/blob/d777d40c962bc66fdc04b7c3a66d20b777ff6fb4/spark-http-client/src/main/java/spark/protocol/parser/XMLResultsParser.java#L306-L314
train
Cleanup the XML input stream.
Of course, here is the Java code you requested: ```java static final void cleanup(XMLStreamReader reader) throws XMLStreamException { if (reader.nextTag() != END_ELEMENT || !reader.getLocalName().equalsIgnoreCase(SPARQL.name())) { logger.warn("Extra data at end of results"); } else if (reader.next() != E...
PeterisP/LVTagger
src/main/java/edu/stanford/nlp/trees/TreeGraphNode.java
TreeGraphNode.headWordNode
public TreeGraphNode headWordNode() { TreeGraphNode hwn = safeCast(label.get(TreeCoreAnnotations.HeadWordAnnotation.class)); if (hwn == null || (hwn.treeGraph() != null && !(hwn.treeGraph().equals(this.treeGraph())))) { return null; } return hwn; }
java
public TreeGraphNode headWordNode() { TreeGraphNode hwn = safeCast(label.get(TreeCoreAnnotations.HeadWordAnnotation.class)); if (hwn == null || (hwn.treeGraph() != null && !(hwn.treeGraph().equals(this.treeGraph())))) { return null; } return hwn; }
[ "public", "TreeGraphNode", "headWordNode", "(", ")", "{", "TreeGraphNode", "hwn", "=", "safeCast", "(", "label", ".", "get", "(", "TreeCoreAnnotations", ".", "HeadWordAnnotation", ".", "class", ")", ")", ";", "if", "(", "hwn", "==", "null", "||", "(", "hwn...
Return the node containing the head word for this node (or <code>null</code> if none), as recorded in this node's {@link CyclicCoreLabel <code>CyclicCoreLabel</code>}. (In contrast to {@link edu.stanford.nlp.ling.CategoryWordTag <code>CategoryWordTag</code>}, we store head words and head tags as references to nodes, n...
[ "Return", "the", "node", "containing", "the", "head", "word", "for", "this", "node", "(", "or", "<code", ">", "null<", "/", "code", ">", "if", "none", ")", "as", "recorded", "in", "this", "node", "s", "{", "@link", "CyclicCoreLabel", "<code", ">", "Cyc...
b3d44bab9ec07ace0d13612c448a6b7298c1f681
https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/trees/TreeGraphNode.java#L568-L574
train
Returns the head word node.
Of course, here is the Java code you requested: ```java public TreeGraphNode headWordNode() { TreeGraphNode hwn = safeCast(label.get(TreeCoreAnnotations.HeadWordAnnotation.class)); if (hwn == null || (hwn.treeGraph() != null && !(hwn.treeGraph().equals(this.treeGraph())))) { return null; } r...
foundation-runtime/configuration
configuration-lib/src/main/java/com/cisco/oss/foundation/configuration/FoundationCompositeConfiguration.java
FoundationCompositeConfiguration.getKeys
@Override @SuppressWarnings("unchecked") /** * override to support ordering of returned keys. */ public Iterator<String> getKeys() { final Iterator tempKeysIter = super.getKeys(); final List<String> keys = sortKeys(tempKeysIter); return keys.iterator(); }
java
@Override @SuppressWarnings("unchecked") /** * override to support ordering of returned keys. */ public Iterator<String> getKeys() { final Iterator tempKeysIter = super.getKeys(); final List<String> keys = sortKeys(tempKeysIter); return keys.iterator(); }
[ "@", "Override", "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "/**\n * override to support ordering of returned keys.\n */", "public", "Iterator", "<", "String", ">", "getKeys", "(", ")", "{", "final", "Iterator", "tempKeysIter", "=", "super", ".", "getKe...
each call to this method method will first sort the keys and then return the iterator.
[ "each", "call", "to", "this", "method", "method", "will", "first", "sort", "the", "keys", "and", "then", "return", "the", "iterator", "." ]
c5bd171a2cca0dc1c8d568f987843ca47c6d1eed
https://github.com/foundation-runtime/configuration/blob/c5bd171a2cca0dc1c8d568f987843ca47c6d1eed/configuration-lib/src/main/java/com/cisco/oss/foundation/configuration/FoundationCompositeConfiguration.java#L47-L58
train
Override to support ordering of returned keys.
Of course, here is the Java code you requested: ```java @Override @SuppressWarnings("unchecked") /** * override to support ordering of returned keys. */ public Iterator<String> getKeys() { final Iterator tempKeysIter = super.getKeys(); final List<String> keys = sortKeys(tempKeysI...
Omertron/api-themoviedb
src/main/java/com/omertron/themoviedbapi/Compare.java
Compare.movies
public static boolean movies(final MovieInfo moviedb, final String title, final String year, int maxDistance, boolean caseSensitive) { if ((moviedb == null) || (StringUtils.isBlank(title))) { return false; } String primaryTitle, firstCompareTitle, secondCompareTitle; if (cas...
java
public static boolean movies(final MovieInfo moviedb, final String title, final String year, int maxDistance, boolean caseSensitive) { if ((moviedb == null) || (StringUtils.isBlank(title))) { return false; } String primaryTitle, firstCompareTitle, secondCompareTitle; if (cas...
[ "public", "static", "boolean", "movies", "(", "final", "MovieInfo", "moviedb", ",", "final", "String", "title", ",", "final", "String", "year", ",", "int", "maxDistance", ",", "boolean", "caseSensitive", ")", "{", "if", "(", "(", "moviedb", "==", "null", "...
Compare the MovieDB object with a title and year @param moviedb The moviedb object to compare too @param title The title of the movie to compare @param year The year of the movie to compare @param maxDistance The Levenshtein Distance between the two titles. 0 = exact match @param caseSensitive true if the comparison i...
[ "Compare", "the", "MovieDB", "object", "with", "a", "title", "and", "year" ]
bf132d7c7271734e13b58ba3bc92bba46f220118
https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/Compare.java#L64-L88
train
Check if a movie is in a movie table.
Of course, here is the Java code you requested: ```java public static boolean movies(final MovieInfo moviedb, final String title, final String year, int maxDistance, boolean caseSensitive) { if ((moviedb == null) || (StringUtils.isBlank(title))) { return false; } String primaryTitl...
ocpsoft/rewrite
config-servlet/src/main/java/org/ocpsoft/rewrite/servlet/config/UserAgentUtil.java
UserAgentUtil.detectTierIphone
public boolean detectTierIphone() { if ((this.initCompleted == true) || (this.isTierIphone == true)) return this.isTierIphone; if (detectIphoneOrIpod() || detectAndroidPhone() || detectWindowsPhone() || detectBlackBerry10Phone() ...
java
public boolean detectTierIphone() { if ((this.initCompleted == true) || (this.isTierIphone == true)) return this.isTierIphone; if (detectIphoneOrIpod() || detectAndroidPhone() || detectWindowsPhone() || detectBlackBerry10Phone() ...
[ "public", "boolean", "detectTierIphone", "(", ")", "{", "if", "(", "(", "this", ".", "initCompleted", "==", "true", ")", "||", "(", "this", ".", "isTierIphone", "==", "true", ")", ")", "return", "this", ".", "isTierIphone", ";", "if", "(", "detectIphoneO...
The quick way to detect for a tier of devices. This method detects for devices which can display iPhone-optimized web content. Includes iPhone, iPod Touch, Android, Windows Phone 7 and 8, BB10, WebOS, Playstation Vita, etc. @return detection of any device in the iPhone/Android/Windows Phone/BlackBerry/WebOS Tier
[ "The", "quick", "way", "to", "detect", "for", "a", "tier", "of", "devices", ".", "This", "method", "detects", "for", "devices", "which", "can", "display", "iPhone", "-", "optimized", "web", "content", ".", "Includes", "iPhone", "iPod", "Touch", "Android", ...
eded0bad0101d119a3a1e67ed3f97a3bc9a8222e
https://github.com/ocpsoft/rewrite/blob/eded0bad0101d119a3a1e67ed3f97a3bc9a8222e/config-servlet/src/main/java/org/ocpsoft/rewrite/servlet/config/UserAgentUtil.java#L1193-L1212
valid
Detects if the device is a tier iphone device.
Of course, here is the Java code you requested: ```java public boolean detectTierIphone() { if ((this.initCompleted == true) || (this.isTierIphone == true)) return this.isTierIphone; if (detectIphoneOrIpod() || detectAndroidPhone() || detectWindowsP...
aws/aws-sdk-java
aws-java-sdk-appstream/src/main/java/com/amazonaws/services/appstream/model/BatchDisassociateUserStackRequest.java
BatchDisassociateUserStackRequest.setUserStackAssociations
public void setUserStackAssociations(java.util.Collection<UserStackAssociation> userStackAssociations) { if (userStackAssociations == null) { this.userStackAssociations = null; return; } this.userStackAssociations = new java.util.ArrayList<UserStackAssociation>(userStack...
java
public void setUserStackAssociations(java.util.Collection<UserStackAssociation> userStackAssociations) { if (userStackAssociations == null) { this.userStackAssociations = null; return; } this.userStackAssociations = new java.util.ArrayList<UserStackAssociation>(userStack...
[ "public", "void", "setUserStackAssociations", "(", "java", ".", "util", ".", "Collection", "<", "UserStackAssociation", ">", "userStackAssociations", ")", "{", "if", "(", "userStackAssociations", "==", "null", ")", "{", "this", ".", "userStackAssociations", "=", "...
<p> The list of UserStackAssociation objects. </p> @param userStackAssociations The list of UserStackAssociation objects.
[ "<p", ">", "The", "list", "of", "UserStackAssociation", "objects", ".", "<", "/", "p", ">" ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-appstream/src/main/java/com/amazonaws/services/appstream/model/BatchDisassociateUserStackRequest.java#L56-L63
train
Sets the value of the userStackAssociations property.
Of course, here is the Java code you requested: ```java public void setUserStackAssociations(java.util.Collection<UserStackAssociation> userStackAssociations) { if (userStackAssociations == null) { this.userStackAssociations = null; return; } this.userStackAssociations ...
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/type/ExceptionSet.java
ExceptionSet.clear
public void clear() { exceptionSet.clear(); explicitSet.clear(); universalHandler = false; commonSupertype = null; size = 0; }
java
public void clear() { exceptionSet.clear(); explicitSet.clear(); universalHandler = false; commonSupertype = null; size = 0; }
[ "public", "void", "clear", "(", ")", "{", "exceptionSet", ".", "clear", "(", ")", ";", "explicitSet", ".", "clear", "(", ")", ";", "universalHandler", "=", "false", ";", "commonSupertype", "=", "null", ";", "size", "=", "0", ";", "}" ]
Remove all exceptions from the set.
[ "Remove", "all", "exceptions", "from", "the", "set", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/type/ExceptionSet.java#L292-L298
train
Clear all the caches.
Of course, here is the Java code you requested: ```java public void clear() { exceptionSet.clear(); explicitSet.clear(); universalHandler = false; commonSupertype = null; size = 0; } ``` Hope this helps!
tiefaces/TieFaces
src/org/tiefaces/components/websheet/utility/ColorUtility.java
ColorUtility.getXColorWithSchema
private static XColor getXColorWithSchema(final String colorSchema, final double preTint, final CTSchemeColor ctsColor, final ThemesTable themeTable) { int colorIndex = getThemeIndexFromName(colorSchema); if (colorIndex < 0) { return null; } XSSFColor bcolor = themeTable.getThemeColor(colorIndex...
java
private static XColor getXColorWithSchema(final String colorSchema, final double preTint, final CTSchemeColor ctsColor, final ThemesTable themeTable) { int colorIndex = getThemeIndexFromName(colorSchema); if (colorIndex < 0) { return null; } XSSFColor bcolor = themeTable.getThemeColor(colorIndex...
[ "private", "static", "XColor", "getXColorWithSchema", "(", "final", "String", "colorSchema", ",", "final", "double", "preTint", ",", "final", "CTSchemeColor", "ctsColor", ",", "final", "ThemesTable", "themeTable", ")", "{", "int", "colorIndex", "=", "getThemeIndexFr...
Get xcolor with color schema name. Normally the names are accent1 to 7. Sometimes also have lumOff/lumMod/alphaInt setting. @param colorSchema color schema @param preTint tint @param ctsColor ctsColor instance. @param themeTable themeTable. @return xcolor.
[ "Get", "xcolor", "with", "color", "schema", "name", ".", "Normally", "the", "names", "are", "accent1", "to", "7", ".", "Sometimes", "also", "have", "lumOff", "/", "lumMod", "/", "alphaInt", "setting", "." ]
3b57b9701ed0f080b5fa4fa78269cc0c422b34ba
https://github.com/tiefaces/TieFaces/blob/3b57b9701ed0f080b5fa4fa78269cc0c422b34ba/src/org/tiefaces/components/websheet/utility/ColorUtility.java#L229-L261
test
Gets the XColor with the specified schema.
Of course, here is the Java code you requested: ```java private static XColor getXColorWithSchema(final String colorSchema, final double preTint, final CTSchemeColor ctsColor, final ThemesTable themeTable) { int colorIndex = getThemeIndexFromName(colorSchema); if (colorIndex < 0) { return null; } ...
jmapper-framework/jmapper-core
JMapper Framework/src/main/java/com/googlecode/jmapper/cache/JMapperCache.java
JMapperCache.getMapper
@SuppressWarnings("unchecked") public static synchronized <D,S> IJMapper<D, S> getMapper(final Class<D> destination,final Class<S> source,final ChooseConfig config,final String xml) { String mapperName = mapperClassName(destination, source, xml); if(mapperCache.containsKey(mapperName)) return (IJMapper<D...
java
@SuppressWarnings("unchecked") public static synchronized <D,S> IJMapper<D, S> getMapper(final Class<D> destination,final Class<S> source,final ChooseConfig config,final String xml) { String mapperName = mapperClassName(destination, source, xml); if(mapperCache.containsKey(mapperName)) return (IJMapper<D...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "static", "synchronized", "<", "D", ",", "S", ">", "IJMapper", "<", "D", ",", "S", ">", "getMapper", "(", "final", "Class", "<", "D", ">", "destination", ",", "final", "Class", "<", "S", ">"...
Returns an instance of JMapper from cache if exists, in alternative a new instance. <br>The configuration evaluated is the one received in input present in the xml configuration. @param destination the Destination Class @param source the Source Class @param config the configuration to load @param xml xml configuration...
[ "Returns", "an", "instance", "of", "JMapper", "from", "cache", "if", "exists", "in", "alternative", "a", "new", "instance", ".", "<br", ">", "The", "configuration", "evaluated", "is", "the", "one", "received", "in", "input", "present", "in", "the", "xml", ...
b48fd3527f35055b8b4a30f53a51136f183acc90
https://github.com/jmapper-framework/jmapper-core/blob/b48fd3527f35055b8b4a30f53a51136f183acc90/JMapper Framework/src/main/java/com/googlecode/jmapper/cache/JMapperCache.java#L134-L145
train
Gets the mapper.
Of course, here is the Java code you requested: ```java @SuppressWarnings("unchecked") public static synchronized <D,S> IJMapper<D, S> getMapper(final Class<D> destination,final Class<S> source,final ChooseConfig config,final String xml) { String mapperName = mapperClassName(destination, source, xml); if(ma...
couchbase/couchbase-jvm-core
src/main/java/com/couchbase/client/core/endpoint/SSLEngineFactory.java
SSLEngineFactory.get
public SSLEngine get() { try { String pass = env.sslKeystorePassword(); char[] password = pass == null || pass.isEmpty() ? null : pass.toCharArray(); KeyStore ks = env.sslKeystore(); if (ks == null) { String ksFile = env.sslKeystoreFile(); ...
java
public SSLEngine get() { try { String pass = env.sslKeystorePassword(); char[] password = pass == null || pass.isEmpty() ? null : pass.toCharArray(); KeyStore ks = env.sslKeystore(); if (ks == null) { String ksFile = env.sslKeystoreFile(); ...
[ "public", "SSLEngine", "get", "(", ")", "{", "try", "{", "String", "pass", "=", "env", ".", "sslKeystorePassword", "(", ")", ";", "char", "[", "]", "password", "=", "pass", "==", "null", "||", "pass", ".", "isEmpty", "(", ")", "?", "null", ":", "pa...
Returns a new {@link SSLEngine} constructed from the config settings. @return a {@link SSLEngine} ready to be used.
[ "Returns", "a", "new", "{", "@link", "SSLEngine", "}", "constructed", "from", "the", "config", "settings", "." ]
97f0427112c2168fee1d6499904f5fa0e24c6797
https://github.com/couchbase/couchbase-jvm-core/blob/97f0427112c2168fee1d6499904f5fa0e24c6797/src/main/java/com/couchbase/client/core/endpoint/SSLEngineFactory.java#L88-L147
train
Get the SSLEngine.
Of course, here is the Java code you requested: ```java public SSLEngine get() { try { String pass = env.sslKeystorePassword(); char[] password = pass == null || pass.isEmpty() ? null : pass.toCharArray(); KeyStore ks = env.sslKeystore(); if (ks == null) { ...
datastax/java-driver
core/src/main/java/com/datastax/oss/driver/internal/core/metrics/HdrReservoir.java
HdrReservoir.getSnapshot
@Override public Snapshot getSnapshot() { long now = System.nanoTime(); cacheLock.readLock().lock(); try { if (now - cachedHistogramTimestampNanos < refreshIntervalNanos) { return cachedSnapshot; } } finally { cacheLock.readLock().unlock(); } cacheLock.writeLock().l...
java
@Override public Snapshot getSnapshot() { long now = System.nanoTime(); cacheLock.readLock().lock(); try { if (now - cachedHistogramTimestampNanos < refreshIntervalNanos) { return cachedSnapshot; } } finally { cacheLock.readLock().unlock(); } cacheLock.writeLock().l...
[ "@", "Override", "public", "Snapshot", "getSnapshot", "(", ")", "{", "long", "now", "=", "System", ".", "nanoTime", "(", ")", ";", "cacheLock", ".", "readLock", "(", ")", ".", "lock", "(", ")", ";", "try", "{", "if", "(", "now", "-", "cachedHistogram...
{@inheritDoc} <p>Note that the snapshots returned from this method do not implement {@link Snapshot#getValues()} nor {@link Snapshot#dump(OutputStream)}. In addition, due to the way that internal data structures are recycled, you should not hold onto a snapshot for more than the refresh interval; one way to ensure thi...
[ "{", "@inheritDoc", "}" ]
612a63f2525618e2020e86c9ad75ab37adba6132
https://github.com/datastax/java-driver/blob/612a63f2525618e2020e86c9ad75ab37adba6132/core/src/main/java/com/datastax/oss/driver/internal/core/metrics/HdrReservoir.java#L114-L140
train
Get the snapshot of the current record set.
Of course, here is the Java code you requested: ```java @Override public Snapshot getSnapshot() { long now = System.nanoTime(); cacheLock.readLock().lock(); try { if (now - cachedHistogramTimestampNanos < refreshIntervalNanos) { return cachedSnapshot; } } finally { cacheLoc...
oblac/jodd
jodd-props/src/main/java/jodd/props/Props.java
Props.load
public Props load(final Map<?, ?> p) { for (final Map.Entry<?, ?> entry : p.entrySet()) { final String name = entry.getKey().toString(); final Object value = entry.getValue(); if (value == null) { continue; } data.putBaseProperty(name, value.toString(), false); } return this; }
java
public Props load(final Map<?, ?> p) { for (final Map.Entry<?, ?> entry : p.entrySet()) { final String name = entry.getKey().toString(); final Object value = entry.getValue(); if (value == null) { continue; } data.putBaseProperty(name, value.toString(), false); } return this; }
[ "public", "Props", "load", "(", "final", "Map", "<", "?", ",", "?", ">", "p", ")", "{", "for", "(", "final", "Map", ".", "Entry", "<", "?", ",", "?", ">", "entry", ":", "p", ".", "entrySet", "(", ")", ")", "{", "final", "String", "name", "=",...
Loads base properties from the provided java properties. Null values are ignored.
[ "Loads", "base", "properties", "from", "the", "provided", "java", "properties", ".", "Null", "values", "are", "ignored", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-props/src/main/java/jodd/props/Props.java#L290-L300
test
Load properties from a map.
Of course, here is the Java code you requested: ```java public Props load(final Map<?, ?> p) { for (final Map.Entry<?, ?> entry : p.entrySet()) { final String name = entry.getKey().toString(); final Object value = entry.getValue(); if (value == null) { continue; } data.putBaseProperty(name, value....
versionone/VersionOne.SDK.Java.ObjectModel
src/main/java/com/versionone/om/V1InstanceGetter.java
V1InstanceGetter.buildProjects
public Collection<BuildProject> buildProjects(BuildProjectFilter filter) { return get(BuildProject.class, (filter != null) ? filter : new BuildProjectFilter()); }
java
public Collection<BuildProject> buildProjects(BuildProjectFilter filter) { return get(BuildProject.class, (filter != null) ? filter : new BuildProjectFilter()); }
[ "public", "Collection", "<", "BuildProject", ">", "buildProjects", "(", "BuildProjectFilter", "filter", ")", "{", "return", "get", "(", "BuildProject", ".", "class", ",", "(", "filter", "!=", "null", ")", "?", "filter", ":", "new", "BuildProjectFilter", "(", ...
Get Build Projects filtered by the criteria specified in the passed in filter. @param filter Limit the items returned. If null, then all items returned. @return Collection of items as specified in the filter.
[ "Get", "Build", "Projects", "filtered", "by", "the", "criteria", "specified", "in", "the", "passed", "in", "filter", "." ]
59d35b67c849299631bca45ee94143237eb2ae1a
https://github.com/versionone/VersionOne.SDK.Java.ObjectModel/blob/59d35b67c849299631bca45ee94143237eb2ae1a/src/main/java/com/versionone/om/V1InstanceGetter.java#L305-L307
train
Get Build Projects filtered by the criteria specified in the passed in filter.
Of course, here is the Java code you requested: ```java public Collection<BuildProject> buildProjects(BuildProjectFilter filter) { return get(BuildProject.class, (filter != null) ? filter : new BuildProjectFilter()); } ``` Hope this helps!
httl/httl
httl/src/main/java/httl/spi/loggers/SimpleLogger.java
SimpleLogger.setLoggerLevel
public void setLoggerLevel(String level) { if ("TRACE".equalsIgnoreCase(level)) { this.level = TRACE; } else if ("DEBUG".equalsIgnoreCase(level)) { this.level = DEBUG; } else if ("INFO".equalsIgnoreCase(level)) { this.level = INFO; } else if ("WARN".eq...
java
public void setLoggerLevel(String level) { if ("TRACE".equalsIgnoreCase(level)) { this.level = TRACE; } else if ("DEBUG".equalsIgnoreCase(level)) { this.level = DEBUG; } else if ("INFO".equalsIgnoreCase(level)) { this.level = INFO; } else if ("WARN".eq...
[ "public", "void", "setLoggerLevel", "(", "String", "level", ")", "{", "if", "(", "\"TRACE\"", ".", "equalsIgnoreCase", "(", "level", ")", ")", "{", "this", ".", "level", "=", "TRACE", ";", "}", "else", "if", "(", "\"DEBUG\"", ".", "equalsIgnoreCase", "("...
httl.properties: logger.level=DEBUG
[ "httl", ".", "properties", ":", "logger", ".", "level", "=", "DEBUG" ]
e13e00f4ab41252a8f53d6dafd4a6610be9dcaad
https://github.com/httl/httl/blob/e13e00f4ab41252a8f53d6dafd4a6610be9dcaad/httl/src/main/java/httl/spi/loggers/SimpleLogger.java#L45-L57
train
Set the logger level.
Of course, here is the Java code you requested: ```java public void setLoggerLevel(String level) { if ("TRACE".equalsIgnoreCase(level)) { this.level = TRACE; } else if ("DEBUG".equalsIgnoreCase(level)) { this.level = DEBUG; } else if ("INFO".equalsIgnoreCase(level)) { ...
Azure/azure-sdk-for-java
datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/VirtualNetworkRulesInner.java
VirtualNetworkRulesInner.createOrUpdateAsync
public Observable<VirtualNetworkRuleInner> createOrUpdateAsync(String resourceGroupName, String accountName, String virtualNetworkRuleName, CreateOrUpdateVirtualNetworkRuleParameters parameters) { return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, virtualNetworkRuleName, parameters).m...
java
public Observable<VirtualNetworkRuleInner> createOrUpdateAsync(String resourceGroupName, String accountName, String virtualNetworkRuleName, CreateOrUpdateVirtualNetworkRuleParameters parameters) { return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, virtualNetworkRuleName, parameters).m...
[ "public", "Observable", "<", "VirtualNetworkRuleInner", ">", "createOrUpdateAsync", "(", "String", "resourceGroupName", ",", "String", "accountName", ",", "String", "virtualNetworkRuleName", ",", "CreateOrUpdateVirtualNetworkRuleParameters", "parameters", ")", "{", "return", ...
Creates or updates the specified virtual network rule. During update, the virtual network rule with the specified name will be replaced with this new virtual network rule. @param resourceGroupName The name of the Azure resource group. @param accountName The name of the Data Lake Store account. @param virtualNetworkRul...
[ "Creates", "or", "updates", "the", "specified", "virtual", "network", "rule", ".", "During", "update", "the", "virtual", "network", "rule", "with", "the", "specified", "name", "will", "be", "replaced", "with", "this", "new", "virtual", "network", "rule", "." ]
aab183ddc6686c82ec10386d5a683d2691039626
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/VirtualNetworkRulesInner.java#L257-L264
train
Creates or updates a virtual network rule.
Of course, here is the Java code you requested: ```java public Observable<VirtualNetworkRuleInner> createOrUpdateAsync(String resourceGroupName, String accountName, String virtualNetworkRuleName, CreateOrUpdateVirtualNetworkRuleParameters parameters) { return createOrUpdateWithServiceResponseAsync(resourceGrou...
rest-assured/rest-assured
rest-assured/src/main/java/io/restassured/matcher/RestAssuredMatchers.java
RestAssuredMatchers.endsWithPath
public static ResponseAwareMatcher<Response> endsWithPath(final String path) { return response -> endsWith(response.<String>path(path)); }
java
public static ResponseAwareMatcher<Response> endsWithPath(final String path) { return response -> endsWith(response.<String>path(path)); }
[ "public", "static", "ResponseAwareMatcher", "<", "Response", ">", "endsWithPath", "(", "final", "String", "path", ")", "{", "return", "response", "->", "endsWith", "(", "response", ".", "<", "String", ">", "path", "(", "path", ")", ")", ";", "}" ]
Creates a {@link ResponseAwareMatcher} that extracts the given path from the response and wraps it in a {@link org.hamcrest.Matchers#equalTo(Object)} matcher. This is useful if you have a resource that e.g. returns the given JSON: <pre> { "userId" : "my-id", "href" : "http://localhost:8080/my-id" } </pre> you can then ...
[ "Creates", "a", "{", "@link", "ResponseAwareMatcher", "}", "that", "extracts", "the", "given", "path", "from", "the", "response", "and", "wraps", "it", "in", "a", "{", "@link", "org", ".", "hamcrest", ".", "Matchers#equalTo", "(", "Object", ")", "}", "matc...
165a85b65070f5a07fe0045175613fb2c2811642
https://github.com/rest-assured/rest-assured/blob/165a85b65070f5a07fe0045175613fb2c2811642/rest-assured/src/main/java/io/restassured/matcher/RestAssuredMatchers.java#L174-L176
test
Create a matcher that matches responses that end with the given path.
Of course, here is the Java code you requested: ```java public static ResponseAwareMatcher<Response> endsWithPath(final String path) { return response -> endsWith(response.<String>path(path)); } ``` Hope this helps!
brianwhu/xillium
base/src/main/java/org/xillium/base/TraceWrapper.java
TraceWrapper.warn
public final Trace warn(Class<?> c, String message) { return _trace.warn(c, message); }
java
public final Trace warn(Class<?> c, String message) { return _trace.warn(c, message); }
[ "public", "final", "Trace", "warn", "(", "Class", "<", "?", ">", "c", ",", "String", "message", ")", "{", "return", "_trace", ".", "warn", "(", "c", ",", "message", ")", ";", "}" ]
Reports an alarming condition.
[ "Reports", "an", "alarming", "condition", "." ]
e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799
https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/base/src/main/java/org/xillium/base/TraceWrapper.java#L60-L62
train
Logs a warning message for a class.
Of course, here is the Java code you requested: ```java public final Trace warn(Class<?> c, String message) { return _trace.warn(c, message); } ``` Hope this helps!
highsource/hyperjaxb3
ejb/plugin/src/main/java/org/jvnet/hyperjaxb3/ejb/jpa2/strategy/annotate/CreateXAnnotations.java
CreateXAnnotations.createOneToOne
public XAnnotation<javax.persistence.OneToOne> createOneToOne( OneToOne cOneToOne) { return cOneToOne == null ? null : // new XAnnotation<javax.persistence.OneToOne>( javax.persistence.OneToOne.class, // cOneToOne.getTargetEntity() == null ? null : new XSingleAnnotationField<Class<Ob...
java
public XAnnotation<javax.persistence.OneToOne> createOneToOne( OneToOne cOneToOne) { return cOneToOne == null ? null : // new XAnnotation<javax.persistence.OneToOne>( javax.persistence.OneToOne.class, // cOneToOne.getTargetEntity() == null ? null : new XSingleAnnotationField<Class<Ob...
[ "public", "XAnnotation", "<", "javax", ".", "persistence", ".", "OneToOne", ">", "createOneToOne", "(", "OneToOne", "cOneToOne", ")", "{", "return", "cOneToOne", "==", "null", "?", "null", ":", "//", "new", "XAnnotation", "<", "javax", ".", "persistence", "....
9.1.23
[ "9", ".", "1", ".", "23" ]
c645d1628b8c26a844858d221fc9affe9c18543e
https://github.com/highsource/hyperjaxb3/blob/c645d1628b8c26a844858d221fc9affe9c18543e/ejb/plugin/src/main/java/org/jvnet/hyperjaxb3/ejb/jpa2/strategy/annotate/CreateXAnnotations.java#L220-L250
train
Create a One - To - One annotation.
Of course, here is the Java code you requested: ```java public XAnnotation<javax.persistence.OneToOne> createOneToOne( OneToOne cOneToOne) { return cOneToOne == null ? null : // new XAnnotation<javax.persistence.OneToOne>( javax.persistence.OneToOne.class, // cOneToOne.getTargetEntity() ==...
OpenLiberty/open-liberty
dev/com.ibm.ws.channel.ssl/src/com/ibm/ws/channel/ssl/internal/SSLHandshakeErrorTracker.java
SSLHandshakeErrorTracker.noteHandshakeError
void noteHandshakeError(Exception failure) { numberOfLogEntries++; if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "noteHandshakeError (" + numberOfLogEntries + "): " + failure.getMessage(), failure); } if (shouldLogError) { if (num...
java
void noteHandshakeError(Exception failure) { numberOfLogEntries++; if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "noteHandshakeError (" + numberOfLogEntries + "): " + failure.getMessage(), failure); } if (shouldLogError) { if (num...
[ "void", "noteHandshakeError", "(", "Exception", "failure", ")", "{", "numberOfLogEntries", "++", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "{", "Tr", ".", "debug", "(", "tc", "...
This method should be called when an SSL handshake error occurs. It will determine if an error messages should be logged, and log it if necessary. <p> Note that a debug message containing the failure will be issued if debug is enabled, regardless of the error message being printed. @param failure Exception which resul...
[ "This", "method", "should", "be", "called", "when", "an", "SSL", "handshake", "error", "occurs", ".", "It", "will", "determine", "if", "an", "error", "messages", "should", "be", "logged", "and", "log", "it", "if", "necessary", ".", "<p", ">", "Note", "th...
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.channel.ssl/src/com/ibm/ws/channel/ssl/internal/SSLHandshakeErrorTracker.java#L73-L86
train
This method is called by the SSLSession after an error occurs.
Of course, here is the Java code you requested: ```java void noteHandshakeError(Exception failure) { numberOfLogEntries++; if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "noteHandshakeError (" + numberOfLogEntries + "): " + failure.getMessage(), failure); ...
OpenLiberty/open-liberty
dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/values/CookieData.java
CookieData.match
public static CookieData match(String name, int offset, int length) { if (null == name) return null; return (CookieData) myMatcher.match(name, offset, length); }
java
public static CookieData match(String name, int offset, int length) { if (null == name) return null; return (CookieData) myMatcher.match(name, offset, length); }
[ "public", "static", "CookieData", "match", "(", "String", "name", ",", "int", "offset", ",", "int", "length", ")", "{", "if", "(", "null", "==", "name", ")", "return", "null", ";", "return", "(", "CookieData", ")", "myMatcher", ".", "match", "(", "name...
Find the enumerated object that matchs the input name using the given offset and length into that name. If none exist, then a null value is returned. @param name @param offset - starting point in that name @param length - length to use from that starting point @return CookieData
[ "Find", "the", "enumerated", "object", "that", "matchs", "the", "input", "name", "using", "the", "given", "offset", "and", "length", "into", "that", "name", ".", "If", "none", "exist", "then", "a", "null", "value", "is", "returned", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/values/CookieData.java#L98-L102
train
Match a cookie name.
Of course, here is the Java code you requested: ```java public static CookieData match(String name, int offset, int length) { if (null == name) return null; return (CookieData) myMatcher.match(name, offset, length); } ``` Hope this helps!
JodaOrg/joda-time
src/example/org/joda/example/time/DateTimeBrowser.java
DateTimeBrowser.getADate
private DateTime getADate(String s) { DateTime retDT = null; try { retDT = new DateTime( s ); } // the try catch(IllegalArgumentException pe) { // ignore it here, caller sees null } // the catch return retDT; }
java
private DateTime getADate(String s) { DateTime retDT = null; try { retDT = new DateTime( s ); } // the try catch(IllegalArgumentException pe) { // ignore it here, caller sees null } // the catch return retDT; }
[ "private", "DateTime", "getADate", "(", "String", "s", ")", "{", "DateTime", "retDT", "=", "null", ";", "try", "{", "retDT", "=", "new", "DateTime", "(", "s", ")", ";", "}", "// the try", "catch", "(", "IllegalArgumentException", "pe", ")", "{", "// igno...
/* getADate Returns a new DateTime object reference if possible, otherwise null. @return retDT A DateTime object reference.
[ "/", "*", "getADate", "Returns", "a", "new", "DateTime", "object", "reference", "if", "possible", "otherwise", "null", "." ]
bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42
https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/example/org/joda/example/time/DateTimeBrowser.java#L361-L372
train
Get a date from a string.
Of course, here is the Java code you requested: ```java private DateTime getADate(String s) { DateTime retDT = null; try { retDT = new DateTime( s ); } // the try catch(IllegalArgumentException pe) { // ignore it here, caller sees null } /...
yan74/afplib
org.afplib/src/main/java/org/afplib/afplib/impl/AfplibFactoryImpl.java
AfplibFactoryImpl.createIOBObjTypeFromString
public IOBObjType createIOBObjTypeFromString(EDataType eDataType, String initialValue) { IOBObjType result = IOBObjType.get(initialValue); if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); return result; }
java
public IOBObjType createIOBObjTypeFromString(EDataType eDataType, String initialValue) { IOBObjType result = IOBObjType.get(initialValue); if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); return result; }
[ "public", "IOBObjType", "createIOBObjTypeFromString", "(", "EDataType", "eDataType", ",", "String", "initialValue", ")", "{", "IOBObjType", "result", "=", "IOBObjType", ".", "get", "(", "initialValue", ")", ";", "if", "(", "result", "==", "null", ")", "throw", ...
<!-- begin-user-doc --> <!-- end-user-doc --> @generated
[ "<!", "--", "begin", "-", "user", "-", "doc", "--", ">", "<!", "--", "end", "-", "user", "-", "doc", "--", ">" ]
9ff0513f9448bdf8c0b0e31dc4910c094c48fb2f
https://github.com/yan74/afplib/blob/9ff0513f9448bdf8c0b0e31dc4910c094c48fb2f/org.afplib/src/main/java/org/afplib/afplib/impl/AfplibFactoryImpl.java#L5348-L5352
train
Create an IOBObjType from a String value.
Of course, here is the Java code you requested: ```java public IOBObjType createIOBObjTypeFromString(EDataType eDataType, String initialValue) { IOBObjType result = IOBObjType.get(initialValue); if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '"...
twitter/elephant-bird
core/src/main/java/com/twitter/elephantbird/util/Strings.java
Strings.underscore
public static String underscore(String word) { String firstPattern = "([A-Z]+)([A-Z][a-z])"; String secondPattern = "([a-z\\d])([A-Z])"; String replacementPattern = "$1_$2"; // Replace package separator with slash. word = word.replaceAll("\\.", "/"); // Replace $ with two underscores for inner c...
java
public static String underscore(String word) { String firstPattern = "([A-Z]+)([A-Z][a-z])"; String secondPattern = "([a-z\\d])([A-Z])"; String replacementPattern = "$1_$2"; // Replace package separator with slash. word = word.replaceAll("\\.", "/"); // Replace $ with two underscores for inner c...
[ "public", "static", "String", "underscore", "(", "String", "word", ")", "{", "String", "firstPattern", "=", "\"([A-Z]+)([A-Z][a-z])\"", ";", "String", "secondPattern", "=", "\"([a-z\\\\d])([A-Z])\"", ";", "String", "replacementPattern", "=", "\"$1_$2\"", ";", "// Repl...
Underscore the given word. @param word The word @return The underscored version of the word
[ "Underscore", "the", "given", "word", "." ]
62642c935198aa0ff968f48669c7e654b42dfbf0
https://github.com/twitter/elephant-bird/blob/62642c935198aa0ff968f48669c7e654b42dfbf0/core/src/main/java/com/twitter/elephantbird/util/Strings.java#L37-L51
valid
Convert a word to an underscore.
Of course, here is the Java code you requested: ```java public static String underscore(String word) { String firstPattern = "([A-Z]+)([A-Z][a-z])"; String secondPattern = "([a-z\\d])([A-Z])"; String replacementPattern = "$1_$2"; // Replace package separator with slash. word = word.replaceAll("\\."...
groupon/monsoon
history/src/main/java/com/groupon/lex/metrics/history/xdr/TSDataOptimizerTask.java
TSDataOptimizerTask.run
public CompletableFuture<NewFile> run() { LOG.log(Level.FINE, "starting optimized file creation for {0} files", files.size()); CompletableFuture<NewFile> fileCreation = new CompletableFuture<>(); final List<TSData> fjpFiles = this.files; // We clear out files below, which makes createTmpFile se...
java
public CompletableFuture<NewFile> run() { LOG.log(Level.FINE, "starting optimized file creation for {0} files", files.size()); CompletableFuture<NewFile> fileCreation = new CompletableFuture<>(); final List<TSData> fjpFiles = this.files; // We clear out files below, which makes createTmpFile se...
[ "public", "CompletableFuture", "<", "NewFile", ">", "run", "(", ")", "{", "LOG", ".", "log", "(", "Level", ".", "FINE", ",", "\"starting optimized file creation for {0} files\"", ",", "files", ".", "size", "(", ")", ")", ";", "CompletableFuture", "<", "NewFile...
Start creating the optimized file. This operation resets the state of the optimizer task, so it can be re-used for subsequent invocations. @return A completeable future that yields the newly created file.
[ "Start", "creating", "the", "optimized", "file", ".", "This", "operation", "resets", "the", "state", "of", "the", "optimizer", "task", "so", "it", "can", "be", "re", "-", "used", "for", "subsequent", "invocations", "." ]
eb68d72ba4c01fe018dc981097dbee033908f5c7
https://github.com/groupon/monsoon/blob/eb68d72ba4c01fe018dc981097dbee033908f5c7/history/src/main/java/com/groupon/lex/metrics/history/xdr/TSDataOptimizerTask.java#L186-L196
train
This method is called by the thread that creates a new temporary file.
Of course, here is the Java code you requested: ```java public CompletableFuture<NewFile> run() { LOG.log(Level.FINE, "starting optimized file creation for {0} files", files.size()); CompletableFuture<NewFile> fileCreation = new CompletableFuture<>(); final List<TSData> fjpFiles = this.files; ...
apereo/cas
support/cas-server-support-oauth-core-api/src/main/java/org/apereo/cas/support/oauth/profile/DefaultOAuth20UserProfileDataCreator.java
DefaultOAuth20UserProfileDataCreator.finalizeProfileResponse
protected void finalizeProfileResponse(final AccessToken accessTokenTicket, final Map<String, Object> map, final Principal principal) { val service = accessTokenTicket.getService(); val registeredService = servicesManager.findServiceBy(service); if (registeredService instanceof OAuthRegisteredSe...
java
protected void finalizeProfileResponse(final AccessToken accessTokenTicket, final Map<String, Object> map, final Principal principal) { val service = accessTokenTicket.getService(); val registeredService = servicesManager.findServiceBy(service); if (registeredService instanceof OAuthRegisteredSe...
[ "protected", "void", "finalizeProfileResponse", "(", "final", "AccessToken", "accessTokenTicket", ",", "final", "Map", "<", "String", ",", "Object", ">", "map", ",", "final", "Principal", "principal", ")", "{", "val", "service", "=", "accessTokenTicket", ".", "g...
Finalize profile response. @param accessTokenTicket the access token ticket @param map the map @param principal the authentication principal
[ "Finalize", "profile", "response", "." ]
b4b306433a8782cef803a39bea5b1f96740e0e9b
https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-oauth-core-api/src/main/java/org/apereo/cas/support/oauth/profile/DefaultOAuth20UserProfileDataCreator.java#L85-L93
train
Finalize profile response.
Of course, here is the Java code you requested: ```java protected void finalizeProfileResponse(final AccessToken accessTokenTicket, final Map<String, Object> map, final Principal principal) { val service = accessTokenTicket.getService(); val registeredService = servicesManager.findServiceBy(service); ...
mediathekview/MServer
src/main/java/mServer/crawler/sender/base/UrlUtils.java
UrlUtils.getBaseUrl
public static String getBaseUrl(final String aUrl) { if (aUrl != null) { int index = aUrl.indexOf("//"); if (index > 0) { index = aUrl.indexOf('/', index + 2); } else { index = aUrl.indexOf('/'); } if (index > 0) { return aUrl.substring(0, index); ...
java
public static String getBaseUrl(final String aUrl) { if (aUrl != null) { int index = aUrl.indexOf("//"); if (index > 0) { index = aUrl.indexOf('/', index + 2); } else { index = aUrl.indexOf('/'); } if (index > 0) { return aUrl.substring(0, index); ...
[ "public", "static", "String", "getBaseUrl", "(", "final", "String", "aUrl", ")", "{", "if", "(", "aUrl", "!=", "null", ")", "{", "int", "index", "=", "aUrl", ".", "indexOf", "(", "\"//\"", ")", ";", "if", "(", "index", ">", "0", ")", "{", "index", ...
returns the base of the url example: https://www.myurl.de:778/some/resource => https://www.myurl.de:778 @param aUrl the url @return the base of the url
[ "returns", "the", "base", "of", "the", "url", "example", ":", "https", ":", "//", "www", ".", "myurl", ".", "de", ":", "778", "/", "some", "/", "resource", "=", ">", "https", ":", "//", "www", ".", "myurl", ".", "de", ":", "778" ]
ba8d03e6a1a303db3807a1327f553f1decd30388
https://github.com/mediathekview/MServer/blob/ba8d03e6a1a303db3807a1327f553f1decd30388/src/main/java/mServer/crawler/sender/base/UrlUtils.java#L116-L131
train
Gets the base URL from the URL.
Of course, here is the Java code you requested: ```java public static String getBaseUrl(final String aUrl) { if (aUrl != null) { int index = aUrl.indexOf("//"); if (index > 0) { index = aUrl.indexOf('/', index + 2); } else { index = aUrl.indexOf('/'); } if (i...
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/xtal/CrystalTransform.java
CrystalTransform.isEquivalent
public boolean isEquivalent(CrystalTransform other) { Matrix4d mul = new Matrix4d(); mul.mul(this.matTransform,other.matTransform); if (mul.epsilonEquals(IDENTITY, 0.0001)) { return true; } return false; }
java
public boolean isEquivalent(CrystalTransform other) { Matrix4d mul = new Matrix4d(); mul.mul(this.matTransform,other.matTransform); if (mul.epsilonEquals(IDENTITY, 0.0001)) { return true; } return false; }
[ "public", "boolean", "isEquivalent", "(", "CrystalTransform", "other", ")", "{", "Matrix4d", "mul", "=", "new", "Matrix4d", "(", ")", ";", "mul", ".", "mul", "(", "this", ".", "matTransform", ",", "other", ".", "matTransform", ")", ";", "if", "(", "mul",...
Returns true if the given CrystalTransform is equivalent to this one. Two crystal transforms are equivalent if one is the inverse of the other, i.e. their transformation matrices multiplication is equal to the identity. @param other @return
[ "Returns", "true", "if", "the", "given", "CrystalTransform", "is", "equivalent", "to", "this", "one", ".", "Two", "crystal", "transforms", "are", "equivalent", "if", "one", "is", "the", "inverse", "of", "the", "other", "i", ".", "e", ".", "their", "transfo...
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/xtal/CrystalTransform.java#L146-L154
train
Checks if the two crystal transforms are equivalent.
Of course, here is the Java code you requested: ```java public boolean isEquivalent(CrystalTransform other) { Matrix4d mul = new Matrix4d(); mul.mul(this.matTransform,other.matTransform); if (mul.epsilonEquals(IDENTITY, 0.0001)) { return true; } return false; } ``` Hope this helps!
dickschoeller/gedbrowser
gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/finder/ParentFinder.java
ParentFinder.find
@Override public <T extends GedObject> Collection<T> find(final FinderObject owner, final Class<T> clazz) { return owner.findInParent(clazz); }
java
@Override public <T extends GedObject> Collection<T> find(final FinderObject owner, final Class<T> clazz) { return owner.findInParent(clazz); }
[ "@", "Override", "public", "<", "T", "extends", "GedObject", ">", "Collection", "<", "T", ">", "find", "(", "final", "FinderObject", "owner", ",", "final", "Class", "<", "T", ">", "clazz", ")", "{", "return", "owner", ".", "findInParent", "(", "clazz", ...
{@inheritDoc}
[ "{" ]
e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1
https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/finder/ParentFinder.java#L91-L95
train
Find in parent.
Of course, here is the Java code you requested: ```java @Override public <T extends GedObject> Collection<T> find(final FinderObject owner, final Class<T> clazz) { return owner.findInParent(clazz); } ``` Hope this helps!
kaazing/gateway
management/src/main/java/org/kaazing/gateway/management/Utils.java
Utils.assertIOThread
public static void assertIOThread(Thread t, boolean flag) { if (flag) { assert t.equals(Thread.currentThread()) : "Management NOT on IO thread when expected"; // XXX testing } else { assert !(t.equals(Thread.currentThread())) : "Management on IO thread when not expected"; // XX...
java
public static void assertIOThread(Thread t, boolean flag) { if (flag) { assert t.equals(Thread.currentThread()) : "Management NOT on IO thread when expected"; // XXX testing } else { assert !(t.equals(Thread.currentThread())) : "Management on IO thread when not expected"; // XX...
[ "public", "static", "void", "assertIOThread", "(", "Thread", "t", ",", "boolean", "flag", ")", "{", "if", "(", "flag", ")", "{", "assert", "t", ".", "equals", "(", "Thread", ".", "currentThread", "(", ")", ")", ":", "\"Management NOT on IO thread when expect...
means we expect that we are NOT.
[ "means", "we", "expect", "that", "we", "are", "NOT", "." ]
06017b19273109b3b992e528e702586446168d57
https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/management/src/main/java/org/kaazing/gateway/management/Utils.java#L101-L107
train
Assert IO thread.
Of course, here is the Java code you requested: ```java public static void assertIOThread(Thread t, boolean flag) { if (flag) { assert t.equals(Thread.currentThread()) : "Management NOT on IO thread when expected"; // XXX testing } else { assert !(t.equals(Thread.currentThread(...
apache/groovy
src/main/java/org/codehaus/groovy/syntax/Numbers.java
Numbers.parseInteger
public static Number parseInteger(AST reportNode, String text) { // remove place holder underscore before starting text = text.replace("_", ""); char c = ' '; int length = text.length(); // // Strip off the sign, if present boolean negative = false; if...
java
public static Number parseInteger(AST reportNode, String text) { // remove place holder underscore before starting text = text.replace("_", ""); char c = ' '; int length = text.length(); // // Strip off the sign, if present boolean negative = false; if...
[ "public", "static", "Number", "parseInteger", "(", "AST", "reportNode", ",", "String", "text", ")", "{", "// remove place holder underscore before starting", "text", "=", "text", ".", "replace", "(", "\"_\"", ",", "\"\"", ")", ";", "char", "c", "=", "'", "'", ...
Builds a Number from the given integer descriptor. Creates the narrowest type possible, or a specific type, if specified. @param reportNode at node for error reporting in the parser @param text literal text to parse @return instantiated Number object @throws NumberFormatException if the number does not fit with...
[ "Builds", "a", "Number", "from", "the", "given", "integer", "descriptor", ".", "Creates", "the", "narrowest", "type", "possible", "or", "a", "specific", "type", "if", "specified", "." ]
71cf20addb611bb8d097a59e395fd20bc7f31772
https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/syntax/Numbers.java#L134-L225
train
Parses an integer from a string.
Of course, here is the Java code you requested: ```java public static Number parseInteger(AST reportNode, String text) { // remove place holder underscore before starting text = text.replace("_", ""); char c = ' '; int length = text.length(); // // Strip off the sign,...
BlueBrain/bluima
modules/bluima_typesystem/src/main/java/de/julielab/jules/types/mmax/MMAXAnnotation.java
MMAXAnnotation.getSegmentList
public AnnotationSegment getSegmentList(int i) { if (MMAXAnnotation_Type.featOkTst && ((MMAXAnnotation_Type)jcasType).casFeat_segmentList == null) jcasType.jcas.throwFeatMissing("segmentList", "de.julielab.jules.types.mmax.MMAXAnnotation"); jcasType.jcas.checkArrayBounds(jcasType.ll_cas.ll_getRefValue(add...
java
public AnnotationSegment getSegmentList(int i) { if (MMAXAnnotation_Type.featOkTst && ((MMAXAnnotation_Type)jcasType).casFeat_segmentList == null) jcasType.jcas.throwFeatMissing("segmentList", "de.julielab.jules.types.mmax.MMAXAnnotation"); jcasType.jcas.checkArrayBounds(jcasType.ll_cas.ll_getRefValue(add...
[ "public", "AnnotationSegment", "getSegmentList", "(", "int", "i", ")", "{", "if", "(", "MMAXAnnotation_Type", ".", "featOkTst", "&&", "(", "(", "MMAXAnnotation_Type", ")", "jcasType", ")", ".", "casFeat_segmentList", "==", "null", ")", "jcasType", ".", "jcas", ...
indexed getter for segmentList - gets an indexed value - List of MMAX annotation segements that make up the MMAX annotation. @generated @param i index in the array to get @return value of the element at index i
[ "indexed", "getter", "for", "segmentList", "-", "gets", "an", "indexed", "value", "-", "List", "of", "MMAX", "annotation", "segements", "that", "make", "up", "the", "MMAX", "annotation", "." ]
793ea3f46761dce72094e057a56cddfa677156ae
https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_typesystem/src/main/java/de/julielab/jules/types/mmax/MMAXAnnotation.java#L152-L156
train
indexed getter for segmentList - gets an indexed value -
Of course, here is the Java code you requested: ```java public AnnotationSegment getSegmentList(int i) { if (MMAXAnnotation_Type.featOkTst && ((MMAXAnnotation_Type)jcasType).casFeat_segmentList == null) jcasType.jcas.throwFeatMissing("segmentList", "de.julielab.jules.types.mmax.MMAXAnnotation"); jcasType...
aws/aws-sdk-java
aws-java-sdk-ec2/src/main/java/com/amazonaws/services/ec2/model/DescribeLaunchTemplateVersionsResult.java
DescribeLaunchTemplateVersionsResult.withLaunchTemplateVersions
public DescribeLaunchTemplateVersionsResult withLaunchTemplateVersions(LaunchTemplateVersion... launchTemplateVersions) { if (this.launchTemplateVersions == null) { setLaunchTemplateVersions(new com.amazonaws.internal.SdkInternalList<LaunchTemplateVersion>(launchTemplateVersions.length)); } ...
java
public DescribeLaunchTemplateVersionsResult withLaunchTemplateVersions(LaunchTemplateVersion... launchTemplateVersions) { if (this.launchTemplateVersions == null) { setLaunchTemplateVersions(new com.amazonaws.internal.SdkInternalList<LaunchTemplateVersion>(launchTemplateVersions.length)); } ...
[ "public", "DescribeLaunchTemplateVersionsResult", "withLaunchTemplateVersions", "(", "LaunchTemplateVersion", "...", "launchTemplateVersions", ")", "{", "if", "(", "this", ".", "launchTemplateVersions", "==", "null", ")", "{", "setLaunchTemplateVersions", "(", "new", "com",...
<p> Information about the launch template versions. </p> <p> <b>NOTE:</b> This method appends the values to the existing list (if any). Use {@link #setLaunchTemplateVersions(java.util.Collection)} or {@link #withLaunchTemplateVersions(java.util.Collection)} if you want to override the existing values. </p> @param laun...
[ "<p", ">", "Information", "about", "the", "launch", "template", "versions", ".", "<", "/", "p", ">", "<p", ">", "<b", ">", "NOTE", ":", "<", "/", "b", ">", "This", "method", "appends", "the", "values", "to", "the", "existing", "list", "(", "if", "a...
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-ec2/src/main/java/com/amazonaws/services/ec2/model/DescribeLaunchTemplateVersionsResult.java#L89-L97
train
Adds the value of the launchTemplateVersions property.
Of course, here is the Java code you requested: ```java public DescribeLaunchTemplateVersionsResult withLaunchTemplateVersions(LaunchTemplateVersion... launchTemplateVersions) { if (this.launchTemplateVersions == null) { setLaunchTemplateVersions(new com.amazonaws.internal.SdkInternalList<LaunchTem...
airbnb/RxGroups
rxgroups-android/src/main/java/com/airbnb/rxgroups/GroupLifecycleManager.java
GroupLifecycleManager.onSaveInstanceState
public void onSaveInstanceState(Bundle outState) { hasSavedState = true; outState.putParcelable(KEY_STATE, new State(observableManager.id(), group.id())); }
java
public void onSaveInstanceState(Bundle outState) { hasSavedState = true; outState.putParcelable(KEY_STATE, new State(observableManager.id(), group.id())); }
[ "public", "void", "onSaveInstanceState", "(", "Bundle", "outState", ")", "{", "hasSavedState", "=", "true", ";", "outState", ".", "putParcelable", "(", "KEY_STATE", ",", "new", "State", "(", "observableManager", ".", "id", "(", ")", ",", "group", ".", "id", ...
Call this method from your Activity or Fragment's onSaveInstanceState method
[ "Call", "this", "method", "from", "your", "Activity", "or", "Fragment", "s", "onSaveInstanceState", "method" ]
9478b5ea52e7926173d742b61d0cb24b05082ff9
https://github.com/airbnb/RxGroups/blob/9478b5ea52e7926173d742b61d0cb24b05082ff9/rxgroups-android/src/main/java/com/airbnb/rxgroups/GroupLifecycleManager.java#L214-L217
valid
Saves the state of the group to a Bundle.
Of course, here is the Java code you requested: ```java public void onSaveInstanceState(Bundle outState) { hasSavedState = true; outState.putParcelable(KEY_STATE, new State(observableManager.id(), group.id())); } ``` Hope this helps!
MorphiaOrg/morphia
morphia/src/main/java/dev/morphia/mapping/Mapper.java
Mapper.getSubTypes
public List<MappedClass> getSubTypes(final MappedClass mc) { List<MappedClass> subtypes = new ArrayList<MappedClass>(); for (MappedClass mappedClass : getMappedClasses()) { if (mappedClass.isSubType(mc)) { subtypes.add(mappedClass); } } return sub...
java
public List<MappedClass> getSubTypes(final MappedClass mc) { List<MappedClass> subtypes = new ArrayList<MappedClass>(); for (MappedClass mappedClass : getMappedClasses()) { if (mappedClass.isSubType(mc)) { subtypes.add(mappedClass); } } return sub...
[ "public", "List", "<", "MappedClass", ">", "getSubTypes", "(", "final", "MappedClass", "mc", ")", "{", "List", "<", "MappedClass", ">", "subtypes", "=", "new", "ArrayList", "<", "MappedClass", ">", "(", ")", ";", "for", "(", "MappedClass", "mappedClass", "...
Finds any subtypes for the given MappedClass. @param mc the parent type @return the list of subtypes @since 1.3
[ "Finds", "any", "subtypes", "for", "the", "given", "MappedClass", "." ]
667c30bdc7c6f1d9f2e2eb8774835d6137b52d12
https://github.com/MorphiaOrg/morphia/blob/667c30bdc7c6f1d9f2e2eb8774835d6137b52d12/morphia/src/main/java/dev/morphia/mapping/Mapper.java#L216-L225
train
Gets the subtypes of the MappedClass.
Of course, here is the Java code you requested: ```java public List<MappedClass> getSubTypes(final MappedClass mc) { List<MappedClass> subtypes = new ArrayList<MappedClass>(); for (MappedClass mappedClass : getMappedClasses()) { if (mappedClass.isSubType(mc)) { subtypes.add(...
craterdog/java-primitive-types
src/main/java/craterdog/primitives/Angle.java
Angle.cosine
static public double cosine(Angle angle) { double result = lock(Math.cos(angle.value)); return result; }
java
static public double cosine(Angle angle) { double result = lock(Math.cos(angle.value)); return result; }
[ "static", "public", "double", "cosine", "(", "Angle", "angle", ")", "{", "double", "result", "=", "lock", "(", "Math", ".", "cos", "(", "angle", ".", "value", ")", ")", ";", "return", "result", ";", "}" ]
This function returns the cosine of the specified angle. @param angle The angle. @return The cosine of the angle.
[ "This", "function", "returns", "the", "cosine", "of", "the", "specified", "angle", "." ]
730f9bceacfac69f99b094464a7da5747c07a59e
https://github.com/craterdog/java-primitive-types/blob/730f9bceacfac69f99b094464a7da5747c07a59e/src/main/java/craterdog/primitives/Angle.java#L202-L205
train
Get the cosine of the given angle.
Of course, here is the Java code you requested: ```java static public double cosine(Angle angle) { double result = lock(Math.cos(angle.value)); return result; } ``` Hope this helps!
JavaMoney/jsr354-ri-bp
src/main/java/org/javamoney/moneta/spi/base/BaseMonetaryCurrenciesSingletonSpi.java
BaseMonetaryCurrenciesSingletonSpi.getCurrency
public CurrencyUnit getCurrency(String currencyCode, String... providers) { Objects.requireNonNull(currencyCode, "Currency Code may not be null"); Collection<CurrencyUnit> found = getCurrencies(CurrencyQueryBuilder.of().setCurrencyCodes(currencyCode).setProviderNames(providers).build());...
java
public CurrencyUnit getCurrency(String currencyCode, String... providers) { Objects.requireNonNull(currencyCode, "Currency Code may not be null"); Collection<CurrencyUnit> found = getCurrencies(CurrencyQueryBuilder.of().setCurrencyCodes(currencyCode).setProviderNames(providers).build());...
[ "public", "CurrencyUnit", "getCurrency", "(", "String", "currencyCode", ",", "String", "...", "providers", ")", "{", "Objects", ".", "requireNonNull", "(", "currencyCode", ",", "\"Currency Code may not be null\"", ")", ";", "Collection", "<", "CurrencyUnit", ">", "f...
Access a new instance based on the currency code. Currencies are available as provided by {@link javax.money.spi.CurrencyProviderSpi} instances registered with the {@link javax.money.spi.Bootstrap}. @param currencyCode the ISO currency code, not {@code null}. @param providers the (optional) specification of provide...
[ "Access", "a", "new", "instance", "based", "on", "the", "currency", "code", ".", "Currencies", "are", "available", "as", "provided", "by", "{", "@link", "javax", ".", "money", ".", "spi", ".", "CurrencyProviderSpi", "}", "instances", "registered", "with", "t...
9c147ef5623d8032a6dc4c0e5eefdfb41641a9a2
https://github.com/JavaMoney/jsr354-ri-bp/blob/9c147ef5623d8032a6dc4c0e5eefdfb41641a9a2/src/main/java/org/javamoney/moneta/spi/base/BaseMonetaryCurrenciesSingletonSpi.java#L48-L59
train
Gets the currency with the given code and provider names.
Of course, here is the Java code you requested: ```java public CurrencyUnit getCurrency(String currencyCode, String... providers) { Objects.requireNonNull(currencyCode, "Currency Code may not be null"); Collection<CurrencyUnit> found = getCurrencies(CurrencyQueryBuilder.of().setCurrency...
mabe02/lanterna
src/main/java/com/googlecode/lanterna/gui2/TextBox.java
TextBox.setValidationPattern
public synchronized TextBox setValidationPattern(Pattern validationPattern) { if(validationPattern != null) { for(String line: lines) { if(!validated(line)) { throw new IllegalStateException("TextBox validation pattern " + validationPattern + " does not match exis...
java
public synchronized TextBox setValidationPattern(Pattern validationPattern) { if(validationPattern != null) { for(String line: lines) { if(!validated(line)) { throw new IllegalStateException("TextBox validation pattern " + validationPattern + " does not match exis...
[ "public", "synchronized", "TextBox", "setValidationPattern", "(", "Pattern", "validationPattern", ")", "{", "if", "(", "validationPattern", "!=", "null", ")", "{", "for", "(", "String", "line", ":", "lines", ")", "{", "if", "(", "!", "validated", "(", "line"...
Sets a pattern on which the content of the text box is to be validated. For multi-line TextBox:s, the pattern is checked against each line individually, not the content as a whole. Partial matchings will not be allowed, the whole pattern must match, however, empty lines will always be allowed. When the user tried to mo...
[ "Sets", "a", "pattern", "on", "which", "the", "content", "of", "the", "text", "box", "is", "to", "be", "validated", ".", "For", "multi", "-", "line", "TextBox", ":", "s", "the", "pattern", "is", "checked", "against", "each", "line", "individually", "not"...
8dfd62206ff46ab10223b2ef2dbb0a2c51850954
https://github.com/mabe02/lanterna/blob/8dfd62206ff46ab10223b2ef2dbb0a2c51850954/src/main/java/com/googlecode/lanterna/gui2/TextBox.java#L161-L171
train
Sets the validation pattern.
Of course, here is the Java code you requested: ```java public synchronized TextBox setValidationPattern(Pattern validationPattern) { if(validationPattern != null) { for(String line: lines) { if(!validated(line)) { throw new IllegalStateException("TextBox validat...
aerogear/aerogear-android-store
library/src/main/java/org/jboss/aerogear/android/store/sql/EncryptedSQLStore.java
EncryptedSQLStore.read
@Override public T read(Serializable id) throws InvalidKeyException { ensureOpen(); String sql = "SELECT " + COLUMN_DATA + " FROM " + TABLE_NAME + " WHERE " + COLUMN_ID + " = ?"; Cursor cursor = getReadableDatabase().rawQuery(sql, new String[]{id.toString()}); cursor.moveToFirst(); ...
java
@Override public T read(Serializable id) throws InvalidKeyException { ensureOpen(); String sql = "SELECT " + COLUMN_DATA + " FROM " + TABLE_NAME + " WHERE " + COLUMN_ID + " = ?"; Cursor cursor = getReadableDatabase().rawQuery(sql, new String[]{id.toString()}); cursor.moveToFirst(); ...
[ "@", "Override", "public", "T", "read", "(", "Serializable", "id", ")", "throws", "InvalidKeyException", "{", "ensureOpen", "(", ")", ";", "String", "sql", "=", "\"SELECT \"", "+", "COLUMN_DATA", "+", "\" FROM \"", "+", "TABLE_NAME", "+", "\" WHERE \"", "+", ...
{@inheritDoc} @throws InvalidKeyException Will occur if you use the wrong password to retrieve the data
[ "{", "@inheritDoc", "}" ]
525ca981cd94846fcb0729cf3314de84c9359923
https://github.com/aerogear/aerogear-android-store/blob/525ca981cd94846fcb0729cf3314de84c9359923/library/src/main/java/org/jboss/aerogear/android/store/sql/EncryptedSQLStore.java#L185-L203
train
Read a single entity from the database.
Of course, here is the Java code you requested: ```java @Override public T read(Serializable id) throws InvalidKeyException { ensureOpen(); String sql = "SELECT " + COLUMN_DATA + " FROM " + TABLE_NAME + " WHERE " + COLUMN_ID + " = ?"; Cursor cursor = getReadableDatabase().rawQuery(sql, new...
fcrepo3/fcrepo
fcrepo-server/src/main/java/org/fcrepo/server/validation/RelsValidator.java
RelsValidator.isValid
private static boolean isValid(String stValue) { int scan; boolean bValid = true; for (scan = 0; scan < stValue.length(); scan++) { if (scan == 0) bValid = XMLChar.isNCNameStart(stValue.charAt(scan)); else bValid = XMLChar.isNCName(stValue...
java
private static boolean isValid(String stValue) { int scan; boolean bValid = true; for (scan = 0; scan < stValue.length(); scan++) { if (scan == 0) bValid = XMLChar.isNCNameStart(stValue.charAt(scan)); else bValid = XMLChar.isNCName(stValue...
[ "private", "static", "boolean", "isValid", "(", "String", "stValue", ")", "{", "int", "scan", ";", "boolean", "bValid", "=", "true", ";", "for", "(", "scan", "=", "0", ";", "scan", "<", "stValue", ".", "length", "(", ")", ";", "scan", "++", ")", "{...
validate the value against the xsd definition <p/> NCName ::= (Letter | '_') (NCNameChar)* NCNameChar ::= Letter | Digit | '.' | '-' | '_' | CombiningChar | Extender
[ "validate", "the", "value", "against", "the", "xsd", "definition", "<p", "/", ">", "NCName", "::", "=", "(", "Letter", "|", "_", ")", "(", "NCNameChar", ")", "*", "NCNameChar", "::", "=", "Letter", "|", "Digit", "|", ".", "|", "-", "|", "_", "|", ...
37df51b9b857fd12c6ab8269820d406c3c4ad774
https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-server/src/main/java/org/fcrepo/server/validation/RelsValidator.java#L408-L421
train
Check if the string is a valid XML string.
Of course, here is the Java code you requested: ```java private static boolean isValid(String stValue) { int scan; boolean bValid = true; for (scan = 0; scan < stValue.length(); scan++) { if (scan == 0) bValid = XMLChar.isNCNameStart(stValue.charAt(scan)); ...
jayantk/jklol
src/com/jayantkrish/jklol/util/Assignment.java
Assignment.intersection
@Deprecated public final Assignment intersection(Collection<Integer> varNums) { return intersection(Ints.toArray(varNums)); }
java
@Deprecated public final Assignment intersection(Collection<Integer> varNums) { return intersection(Ints.toArray(varNums)); }
[ "@", "Deprecated", "public", "final", "Assignment", "intersection", "(", "Collection", "<", "Integer", ">", "varNums", ")", "{", "return", "intersection", "(", "Ints", ".", "toArray", "(", "varNums", ")", ")", ";", "}" ]
If varNums is a subset of the variables in this assignment, this method returns the value assigned to each variable in varNums. varNums may contain indices which are not represented in this assignment. These indices are ignored; in this case, the returned assignment will contain fewer variable/value mappings than {@cod...
[ "If", "varNums", "is", "a", "subset", "of", "the", "variables", "in", "this", "assignment", "this", "method", "returns", "the", "value", "assigned", "to", "each", "variable", "in", "varNums", ".", "varNums", "may", "contain", "indices", "which", "are", "not"...
d27532ca83e212d51066cf28f52621acc3fd44cc
https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/util/Assignment.java#L218-L221
train
Returns the intersection of this set with the given set of var numbers.
Of course, here is the Java code you requested: ```java @Deprecated public final Assignment intersection(Collection<Integer> varNums) { return intersection(Ints.toArray(varNums)); } ``` Hope this helps!
aws/aws-sdk-java
aws-java-sdk-pi/src/main/java/com/amazonaws/services/pi/model/DimensionKeyDescription.java
DimensionKeyDescription.withDimensions
public DimensionKeyDescription withDimensions(java.util.Map<String, String> dimensions) { setDimensions(dimensions); return this; }
java
public DimensionKeyDescription withDimensions(java.util.Map<String, String> dimensions) { setDimensions(dimensions); return this; }
[ "public", "DimensionKeyDescription", "withDimensions", "(", "java", ".", "util", ".", "Map", "<", "String", ",", "String", ">", "dimensions", ")", "{", "setDimensions", "(", "dimensions", ")", ";", "return", "this", ";", "}" ]
<p> A map of name-value pairs for the dimensions in the group. </p> @param dimensions A map of name-value pairs for the dimensions in the group. @return Returns a reference to this object so that method calls can be chained together.
[ "<p", ">", "A", "map", "of", "name", "-", "value", "pairs", "for", "the", "dimensions", "in", "the", "group", ".", "<", "/", "p", ">" ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-pi/src/main/java/com/amazonaws/services/pi/model/DimensionKeyDescription.java#L85-L88
train
Sets the dimensions for the resource.
Of course, here is the Java code you requested: ```java public DimensionKeyDescription withDimensions(java.util.Map<String, String> dimensions) { setDimensions(dimensions); return this; } ``` Hope this helps!
googleapis/google-cloud-java
google-cloud-clients/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/ConfigClient.java
ConfigClient.createExclusion
public final LogExclusion createExclusion(ParentName parent, LogExclusion exclusion) { CreateExclusionRequest request = CreateExclusionRequest.newBuilder() .setParent(parent == null ? null : parent.toString()) .setExclusion(exclusion) .build(); return createExclusion...
java
public final LogExclusion createExclusion(ParentName parent, LogExclusion exclusion) { CreateExclusionRequest request = CreateExclusionRequest.newBuilder() .setParent(parent == null ? null : parent.toString()) .setExclusion(exclusion) .build(); return createExclusion...
[ "public", "final", "LogExclusion", "createExclusion", "(", "ParentName", "parent", ",", "LogExclusion", "exclusion", ")", "{", "CreateExclusionRequest", "request", "=", "CreateExclusionRequest", ".", "newBuilder", "(", ")", ".", "setParent", "(", "parent", "==", "nu...
Creates a new exclusion in a specified parent resource. Only log entries belonging to that resource can be excluded. You can have up to 10 exclusions in a resource. <p>Sample code: <pre><code> try (ConfigClient configClient = ConfigClient.create()) { ParentName parent = ProjectName.of("[PROJECT]"); LogExclusion exclu...
[ "Creates", "a", "new", "exclusion", "in", "a", "specified", "parent", "resource", ".", "Only", "log", "entries", "belonging", "to", "that", "resource", "can", "be", "excluded", ".", "You", "can", "have", "up", "to", "10", "exclusions", "in", "a", "resource...
d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a
https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/ConfigClient.java#L1114-L1122
train
Create an exclusion in the CRA.
Of course, here is the Java code you requested: ```java public final LogExclusion createExclusion(ParentName parent, LogExclusion exclusion) { CreateExclusionRequest request = CreateExclusionRequest.newBuilder() .setParent(parent == null ? null : parent.toString()) .setExclusion(ex...
liferay/com-liferay-commerce
commerce-price-list-service/src/main/java/com/liferay/commerce/price/list/service/base/CommercePriceListUserSegmentEntryRelLocalServiceBaseImpl.java
CommercePriceListUserSegmentEntryRelLocalServiceBaseImpl.getCommercePriceListUserSegmentEntryRelsByUuidAndCompanyId
@Override public List<CommercePriceListUserSegmentEntryRel> getCommercePriceListUserSegmentEntryRelsByUuidAndCompanyId( String uuid, long companyId, int start, int end, OrderByComparator<CommercePriceListUserSegmentEntryRel> orderByComparator) { return commercePriceListUserSegmentEntryRelPersistence.findByUuid_C...
java
@Override public List<CommercePriceListUserSegmentEntryRel> getCommercePriceListUserSegmentEntryRelsByUuidAndCompanyId( String uuid, long companyId, int start, int end, OrderByComparator<CommercePriceListUserSegmentEntryRel> orderByComparator) { return commercePriceListUserSegmentEntryRelPersistence.findByUuid_C...
[ "@", "Override", "public", "List", "<", "CommercePriceListUserSegmentEntryRel", ">", "getCommercePriceListUserSegmentEntryRelsByUuidAndCompanyId", "(", "String", "uuid", ",", "long", "companyId", ",", "int", "start", ",", "int", "end", ",", "OrderByComparator", "<", "Co...
Returns a range of commerce price list user segment entry rels matching the UUID and company. @param uuid the UUID of the commerce price list user segment entry rels @param companyId the primary key of the company @param start the lower bound of the range of commerce price list user segment entry rels @param end the u...
[ "Returns", "a", "range", "of", "commerce", "price", "list", "user", "segment", "entry", "rels", "matching", "the", "UUID", "and", "company", "." ]
9e54362d7f59531fc684016ba49ee7cdc3a2f22b
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-price-list-service/src/main/java/com/liferay/commerce/price/list/service/base/CommercePriceListUserSegmentEntryRelLocalServiceBaseImpl.java#L397-L403
train
Returns a range of commerce price list user segment entry rels matching the UUID and company.
Of course, here is the Java code you requested: ```java @Override public List<CommercePriceListUserSegmentEntryRel> getCommercePriceListUserSegmentEntryRelsByUuidAndCompanyId( String uuid, long companyId, int start, int end, OrderByComparator<CommercePriceListUserSegmentEntryRel> orderByComparator) { return com...
wildfly/wildfly
iiop-openjdk/src/main/java/org/wildfly/iiop/openjdk/rmi/Util.java
Util.getClassHashCode
static long getClassHashCode(Class cls) { // The simple cases if (cls.isInterface()) return 0; if (!Serializable.class.isAssignableFrom(cls)) return 0; if (Externalizable.class.isAssignableFrom(cls)) return 1; // Try cache Long l = (Lo...
java
static long getClassHashCode(Class cls) { // The simple cases if (cls.isInterface()) return 0; if (!Serializable.class.isAssignableFrom(cls)) return 0; if (Externalizable.class.isAssignableFrom(cls)) return 1; // Try cache Long l = (Lo...
[ "static", "long", "getClassHashCode", "(", "Class", "cls", ")", "{", "// The simple cases", "if", "(", "cls", ".", "isInterface", "(", ")", ")", "return", "0", ";", "if", "(", "!", "Serializable", ".", "class", ".", "isAssignableFrom", "(", "cls", ")", "...
Return the class hash code, as specified in "The Common Object Request Broker: Architecture and Specification" (01-02-33), section 10.6.2.
[ "Return", "the", "class", "hash", "code", "as", "specified", "in", "The", "Common", "Object", "Request", "Broker", ":", "Architecture", "and", "Specification", "(", "01", "-", "02", "-", "33", ")", "section", "10", ".", "6", ".", "2", "." ]
64896f1500fe465ad83d96ede9fa19d0c3747f18
https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/iiop-openjdk/src/main/java/org/wildfly/iiop/openjdk/rmi/Util.java#L430-L530
test
Gets the class hashcode.
Of course, here is the Java code you requested: ```java static long getClassHashCode(Class cls) { // The simple cases if (cls.isInterface()) return 0; if (!Serializable.class.isAssignableFrom(cls)) return 0; if (Externalizable.class.isAssignableFrom(cls)) ...
xiancloud/xian
xian-zookeeper/xian-curator/xian-curator-recipes/src/main/java/org/apache/curator/framework/recipes/atomic/CachedAtomicInteger.java
CachedAtomicInteger.next
public AtomicValue<Integer> next() throws Exception { MutableAtomicValue<Integer> result = new MutableAtomicValue<Integer>(0, 0); if ( currentValue == null ) { currentValue = number.add(cacheFactor); if ( !currentValue.succeeded() ) { ...
java
public AtomicValue<Integer> next() throws Exception { MutableAtomicValue<Integer> result = new MutableAtomicValue<Integer>(0, 0); if ( currentValue == null ) { currentValue = number.add(cacheFactor); if ( !currentValue.succeeded() ) { ...
[ "public", "AtomicValue", "<", "Integer", ">", "next", "(", ")", "throws", "Exception", "{", "MutableAtomicValue", "<", "Integer", ">", "result", "=", "new", "MutableAtomicValue", "<", "Integer", ">", "(", "0", ",", "0", ")", ";", "if", "(", "currentValue",...
Returns the next value (incrementing by 1). If a new chunk of numbers is needed, it is requested from the number @return next increment @throws Exception errors
[ "Returns", "the", "next", "value", "(", "incrementing", "by", "1", ")", ".", "If", "a", "new", "chunk", "of", "numbers", "is", "needed", "it", "is", "requested", "from", "the", "number" ]
1948e088545553d2745b2c86d8b5a64988bb850e
https://github.com/xiancloud/xian/blob/1948e088545553d2745b2c86d8b5a64988bb850e/xian-zookeeper/xian-curator/xian-curator-recipes/src/main/java/org/apache/curator/framework/recipes/atomic/CachedAtomicInteger.java#L49-L75
train
Gets the next entry in the array.
Of course, here is the Java code you requested: ```java public AtomicValue<Integer> next() throws Exception { MutableAtomicValue<Integer> result = new MutableAtomicValue<Integer>(0, 0); if ( currentValue == null ) { currentValue = number.add(cacheFactor); if (...
jcodec/jcodec
src/main/java/org/jcodec/codecs/h264/H264Utils.java
H264Utils.decodeMOVPacket
public static ByteBuffer decodeMOVPacket(ByteBuffer result, AvcCBox avcC) { if (avcC.getNalLengthSize() == 4) { decodeMOVPacketInplace(result, avcC); return result; } return joinNALUnits(splitMOVPacket(result, avcC)); }
java
public static ByteBuffer decodeMOVPacket(ByteBuffer result, AvcCBox avcC) { if (avcC.getNalLengthSize() == 4) { decodeMOVPacketInplace(result, avcC); return result; } return joinNALUnits(splitMOVPacket(result, avcC)); }
[ "public", "static", "ByteBuffer", "decodeMOVPacket", "(", "ByteBuffer", "result", ",", "AvcCBox", "avcC", ")", "{", "if", "(", "avcC", ".", "getNalLengthSize", "(", ")", "==", "4", ")", "{", "decodeMOVPacketInplace", "(", "result", ",", "avcC", ")", ";", "...
Decodes AVC packet in ISO BMF format into Annex B format. Replaces NAL unit size integers with 00 00 00 01 start codes. If the space allows the transformation is done inplace. @param result
[ "Decodes", "AVC", "packet", "in", "ISO", "BMF", "format", "into", "Annex", "B", "format", "." ]
cd6efa51ef05f409a8ba8cfb7521f4b4f10ccc75
https://github.com/jcodec/jcodec/blob/cd6efa51ef05f409a8ba8cfb7521f4b4f10ccc75/src/main/java/org/jcodec/codecs/h264/H264Utils.java#L312-L318
test
Decodes a MovPacket from a byte buffer.
Of course, here is the Java code you requested: ```java public static ByteBuffer decodeMOVPacket(ByteBuffer result, AvcCBox avcC) { if (avcC.getNalLengthSize() == 4) { decodeMOVPacketInplace(result, avcC); return result; } return joinNALUnits(splitMOVPacket(result, avcC)...
luhuiguo/chinese-utils
src/main/java/com/luhuiguo/chinese/ChineseUtils.java
ChineseUtils.toPinyin
public static String toPinyin(String str, PinyinFormat format) { return Pinyin.INSTANCE.convert(str, format); }
java
public static String toPinyin(String str, PinyinFormat format) { return Pinyin.INSTANCE.convert(str, format); }
[ "public", "static", "String", "toPinyin", "(", "String", "str", ",", "PinyinFormat", "format", ")", "{", "return", "Pinyin", ".", "INSTANCE", ".", "convert", "(", "str", ",", "format", ")", ";", "}" ]
转换成中文拼音字符串。 @param str 输入的字符串。 @param format 输出拼音的格式。 @return 转换后的中文拼音字符串。
[ "转换成中文拼音字符串。" ]
70466411b537f3848dd80bfa44c0fa6d5e390c68
https://github.com/luhuiguo/chinese-utils/blob/70466411b537f3848dd80bfa44c0fa6d5e390c68/src/main/java/com/luhuiguo/chinese/ChineseUtils.java#L53-L55
train
Converts a string to a Pinyin string.
Of course, here is the Java code you requested: ```java public static String toPinyin(String str, PinyinFormat format) { return Pinyin.INSTANCE.convert(str, format); } ``` Hope this helps!
aws/aws-sdk-java
aws-java-sdk-rds/src/main/java/com/amazonaws/services/rds/AmazonRDSClient.java
AmazonRDSClient.describeDBSnapshotAttributes
@Override public DBSnapshotAttributesResult describeDBSnapshotAttributes(DescribeDBSnapshotAttributesRequest request) { request = beforeClientExecution(request); return executeDescribeDBSnapshotAttributes(request); }
java
@Override public DBSnapshotAttributesResult describeDBSnapshotAttributes(DescribeDBSnapshotAttributesRequest request) { request = beforeClientExecution(request); return executeDescribeDBSnapshotAttributes(request); }
[ "@", "Override", "public", "DBSnapshotAttributesResult", "describeDBSnapshotAttributes", "(", "DescribeDBSnapshotAttributesRequest", "request", ")", "{", "request", "=", "beforeClientExecution", "(", "request", ")", ";", "return", "executeDescribeDBSnapshotAttributes", "(", "...
<p> Returns a list of DB snapshot attribute names and values for a manual DB snapshot. </p> <p> When sharing snapshots with other AWS accounts, <code>DescribeDBSnapshotAttributes</code> returns the <code>restore</code> attribute and a list of IDs for the AWS accounts that are authorized to copy or restore the manual DB...
[ "<p", ">", "Returns", "a", "list", "of", "DB", "snapshot", "attribute", "names", "and", "values", "for", "a", "manual", "DB", "snapshot", ".", "<", "/", "p", ">", "<p", ">", "When", "sharing", "snapshots", "with", "other", "AWS", "accounts", "<code", "...
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-rds/src/main/java/com/amazonaws/services/rds/AmazonRDSClient.java#L4156-L4160
train
Retrieves the attributes of an existing DB snapshot.
Of course, here is the Java code you requested: ```java @Override public DBSnapshotAttributesResult describeDBSnapshotAttributes(DescribeDBSnapshotAttributesRequest request) { request = beforeClientExecution(request); return executeDescribeDBSnapshotAttributes(request); } ``` Hope this helps!
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/detect/FormatStringChecker.java
FormatStringChecker.sawOpcode
@Override public void sawOpcode(int seen) { // System.out.println(getPC() + " " + Const.getOpcodeName(seen) + " " + state); if (stack.getStackDepth() < stackDepth) { state = FormatState.NONE; stackDepth = 0; arguments = null; } if (seen == Const.A...
java
@Override public void sawOpcode(int seen) { // System.out.println(getPC() + " " + Const.getOpcodeName(seen) + " " + state); if (stack.getStackDepth() < stackDepth) { state = FormatState.NONE; stackDepth = 0; arguments = null; } if (seen == Const.A...
[ "@", "Override", "public", "void", "sawOpcode", "(", "int", "seen", ")", "{", "// System.out.println(getPC() + \" \" + Const.getOpcodeName(seen) + \" \" + state);", "if", "(", "stack", ".", "getStackDepth", "(", ")", "<", "stackDepth", ")", "{", "state", "=", "FormatS...
/* (non-Javadoc) @see edu.umd.cs.findbugs.bcel.OpcodeStackDetector#sawOpcode(int)
[ "/", "*", "(", "non", "-", "Javadoc", ")" ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/detect/FormatStringChecker.java#L65-L123
train
overrides the visitor to look for a localization message
Of course, here is the Java code you requested: ```java @Override public void sawOpcode(int seen) { // System.out.println(getPC() + " " + Const.getOpcodeName(seen) + " " + state); if (stack.getStackDepth() < stackDepth) { state = FormatState.NONE; stackDepth = 0; ...
VoltDB/voltdb
src/frontend/org/voltdb/messaging/FastSerializer.java
FastSerializer.writeInvocation
public void writeInvocation(StoredProcedureInvocation invocation) throws IOException { int len = invocation.getSerializedSize(); growIfNeeded(len); invocation.flattenToBuffer(buffer.b()); }
java
public void writeInvocation(StoredProcedureInvocation invocation) throws IOException { int len = invocation.getSerializedSize(); growIfNeeded(len); invocation.flattenToBuffer(buffer.b()); }
[ "public", "void", "writeInvocation", "(", "StoredProcedureInvocation", "invocation", ")", "throws", "IOException", "{", "int", "len", "=", "invocation", ".", "getSerializedSize", "(", ")", ";", "growIfNeeded", "(", "len", ")", ";", "invocation", ".", "flattenToBuf...
Write an SPI using it's ByteBuffer serialization code.
[ "Write", "an", "SPI", "using", "it", "s", "ByteBuffer", "serialization", "code", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/messaging/FastSerializer.java#L297-L301
train
Write a stored procedure invocation to the underlying stream.
Of course, here is the Java code you requested: ```java public void writeInvocation(StoredProcedureInvocation invocation) throws IOException { int len = invocation.getSerializedSize(); growIfNeeded(len); invocation.flattenToBuffer(buffer.b()); } ``` Hope this helps!
OpenLiberty/open-liberty
dev/com.ibm.websphere.javaee.jsf.2.2/src/javax/faces/component/UIViewRoot.java
UIViewRoot._broadcastAll
private boolean _broadcastAll(FacesContext context, List<? extends FacesEvent> events, Collection<FacesEvent> eventsAborted) { assert events != null; for (int i = 0; i < events.size(); i++) { FacesEvent event = events...
java
private boolean _broadcastAll(FacesContext context, List<? extends FacesEvent> events, Collection<FacesEvent> eventsAborted) { assert events != null; for (int i = 0; i < events.size(); i++) { FacesEvent event = events...
[ "private", "boolean", "_broadcastAll", "(", "FacesContext", "context", ",", "List", "<", "?", "extends", "FacesEvent", ">", "events", ",", "Collection", "<", "FacesEvent", ">", "eventsAborted", ")", "{", "assert", "events", "!=", "null", ";", "for", "(", "in...
Broadcast all events in the specified collection, stopping the at any time an AbortProcessingException is thrown. @param context the current JSF context @param events the events to broadcast @return @return <code>true</code> if the broadcast was completed without unexpected abortion/exception, <code>false</code> othe...
[ "Broadcast", "all", "events", "in", "the", "specified", "collection", "stopping", "the", "at", "any", "time", "an", "AbortProcessingException", "is", "thrown", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.websphere.javaee.jsf.2.2/src/javax/faces/component/UIViewRoot.java#L1146-L1235
train
Broadcast all FacesEvents to all components.
Of course, here is the Java code you requested: ```java private boolean _broadcastAll(FacesContext context, List<? extends FacesEvent> events, Collection<FacesEvent> eventsAborted) { assert events != null; for (int i = 0; i < events.siz...
CloudSlang/cs-actions
cs-vmware/src/main/java/io/cloudslang/content/vmware/services/VmService.java
VmService.cloneVM
public Map<String, String> cloneVM(HttpInputs httpInputs, VmInputs vmInputs) throws Exception { ConnectionResources connectionResources = new ConnectionResources(httpInputs, vmInputs); try { ManagedObjectReference vmMor = new MorObjectHandler().getMor(connectionResources, ...
java
public Map<String, String> cloneVM(HttpInputs httpInputs, VmInputs vmInputs) throws Exception { ConnectionResources connectionResources = new ConnectionResources(httpInputs, vmInputs); try { ManagedObjectReference vmMor = new MorObjectHandler().getMor(connectionResources, ...
[ "public", "Map", "<", "String", ",", "String", ">", "cloneVM", "(", "HttpInputs", "httpInputs", ",", "VmInputs", "vmInputs", ")", "throws", "Exception", "{", "ConnectionResources", "connectionResources", "=", "new", "ConnectionResources", "(", "httpInputs", ",", "...
Method used to connect to data center and clone a virtual machine identified by the inputs provided. @param httpInputs Object that has all the inputs necessary to made a connection to data center @param vmInputs Object that has all the specific inputs necessary to identify the virtual machine that will be cloned @re...
[ "Method", "used", "to", "connect", "to", "data", "center", "and", "clone", "a", "virtual", "machine", "identified", "by", "the", "inputs", "provided", "." ]
9a1be1e99ad88286a6c153d5f2275df6ae1a57a1
https://github.com/CloudSlang/cs-actions/blob/9a1be1e99ad88286a6c153d5f2275df6ae1a57a1/cs-vmware/src/main/java/io/cloudslang/content/vmware/services/VmService.java#L337-L372
train
Method used to connect to a VM identified by the inputs provided.
Of course, here is the Java code you requested: ```java public Map<String, String> cloneVM(HttpInputs httpInputs, VmInputs vmInputs) throws Exception { ConnectionResources connectionResources = new ConnectionResources(httpInputs, vmInputs); try { ManagedObjectReference vmMor = new MorObject...
iipc/openwayback
wayback-core/src/main/java/org/archive/wayback/core/UIResults.java
UIResults.getFormatter
public StringFormatter getFormatter() { if (formatter == null) { ResourceBundle b = ResourceBundle.getBundle(UI_RESOURCE_BUNDLE_NAME, new UTF8Control()); formatter = new StringFormatter(b, getLocale()); } return formatter; }
java
public StringFormatter getFormatter() { if (formatter == null) { ResourceBundle b = ResourceBundle.getBundle(UI_RESOURCE_BUNDLE_NAME, new UTF8Control()); formatter = new StringFormatter(b, getLocale()); } return formatter; }
[ "public", "StringFormatter", "getFormatter", "(", ")", "{", "if", "(", "formatter", "==", "null", ")", "{", "ResourceBundle", "b", "=", "ResourceBundle", ".", "getBundle", "(", "UI_RESOURCE_BUNDLE_NAME", ",", "new", "UTF8Control", "(", ")", ")", ";", "formatte...
return StringFormatter set-up for locale of request being processed. <p>deprecation recalled 2014-05-06.</p> @return StringFormatter localized to user request
[ "return", "StringFormatter", "set", "-", "up", "for", "locale", "of", "request", "being", "processed", ".", "<p", ">", "deprecation", "recalled", "2014", "-", "05", "-", "06", ".", "<", "/", "p", ">" ]
da74c3a59a5b5a5c365bd4702dcb45d263535794
https://github.com/iipc/openwayback/blob/da74c3a59a5b5a5c365bd4702dcb45d263535794/wayback-core/src/main/java/org/archive/wayback/core/UIResults.java#L692-L698
train
Gets the formatter.
Of course, here is the Java code you requested: ```java public StringFormatter getFormatter() { if (formatter == null) { ResourceBundle b = ResourceBundle.getBundle(UI_RESOURCE_BUNDLE_NAME, new UTF8Control()); formatter = new StringFormatter(b, getLocale()); } return formatter; } ``` Hop...
matthewhorridge/owlapi-gwt
owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLLiteralImplDouble_CustomFieldSerializer.java
OWLLiteralImplDouble_CustomFieldSerializer.deserializeInstance
@Override public void deserializeInstance(SerializationStreamReader streamReader, OWLLiteralImplDouble instance) throws SerializationException { deserialize(streamReader, instance); }
java
@Override public void deserializeInstance(SerializationStreamReader streamReader, OWLLiteralImplDouble instance) throws SerializationException { deserialize(streamReader, instance); }
[ "@", "Override", "public", "void", "deserializeInstance", "(", "SerializationStreamReader", "streamReader", ",", "OWLLiteralImplDouble", "instance", ")", "throws", "SerializationException", "{", "deserialize", "(", "streamReader", ",", "instance", ")", ";", "}" ]
Deserializes the content of the object from the {@link com.google.gwt.user.client.rpc.SerializationStreamReader}. @param streamReader the {@link com.google.gwt.user.client.rpc.SerializationStreamReader} to read the object's content from @param instance the object instance to deserialize @throws com.google.gwt.user.clie...
[ "Deserializes", "the", "content", "of", "the", "object", "from", "the", "{" ]
7ab975fb6cef3c8947099983551672a3b5d4e2fd
https://github.com/matthewhorridge/owlapi-gwt/blob/7ab975fb6cef3c8947099983551672a3b5d4e2fd/owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLLiteralImplDouble_CustomFieldSerializer.java#L87-L90
train
Deserialize an instance of the CRN class.
Of course, here is the Java code you requested: ```java @Override public void deserializeInstance(SerializationStreamReader streamReader, OWLLiteralImplDouble instance) throws SerializationException { deserialize(streamReader, instance); } ``` Hope this helps!
Azure/azure-sdk-for-java
keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java
KeyVaultClientBaseImpl.wrapKeyAsync
public ServiceFuture<KeyOperationResult> wrapKeyAsync(String vaultBaseUrl, String keyName, String keyVersion, JsonWebKeyEncryptionAlgorithm algorithm, byte[] value, final ServiceCallback<KeyOperationResult> serviceCallback) { return ServiceFuture.fromResponse(wrapKeyWithServiceResponseAsync(vaultBaseUrl, keyNam...
java
public ServiceFuture<KeyOperationResult> wrapKeyAsync(String vaultBaseUrl, String keyName, String keyVersion, JsonWebKeyEncryptionAlgorithm algorithm, byte[] value, final ServiceCallback<KeyOperationResult> serviceCallback) { return ServiceFuture.fromResponse(wrapKeyWithServiceResponseAsync(vaultBaseUrl, keyNam...
[ "public", "ServiceFuture", "<", "KeyOperationResult", ">", "wrapKeyAsync", "(", "String", "vaultBaseUrl", ",", "String", "keyName", ",", "String", "keyVersion", ",", "JsonWebKeyEncryptionAlgorithm", "algorithm", ",", "byte", "[", "]", "value", ",", "final", "Service...
Wraps a symmetric key using a specified key. The WRAP operation supports encryption of a symmetric key using a key encryption key that has previously been stored in an Azure Key Vault. The WRAP operation is only strictly necessary for symmetric keys stored in Azure Key Vault since protection with an asymmetric key can ...
[ "Wraps", "a", "symmetric", "key", "using", "a", "specified", "key", ".", "The", "WRAP", "operation", "supports", "encryption", "of", "a", "symmetric", "key", "using", "a", "key", "encryption", "key", "that", "has", "previously", "been", "stored", "in", "an",...
aab183ddc6686c82ec10386d5a683d2691039626
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java#L2619-L2621
train
Wrap a key in a key vault.
Of course, here is the Java code you requested: ```java public ServiceFuture<KeyOperationResult> wrapKeyAsync(String vaultBaseUrl, String keyName, String keyVersion, JsonWebKeyEncryptionAlgorithm algorithm, byte[] value, final ServiceCallback<KeyOperationResult> serviceCallback) { return ServiceFuture.fromResp...
greatman/craftconomy3
src/main/java/com/greatmancode/craftconomy3/Common.java
Common.initializeWorldGroup
public void initializeWorldGroup() { if (worldGroupManager == null) { worldGroupManager = new WorldGroupsManager(); sendConsoleMessage(Level.INFO, getLanguageManager().getString("world_group_manager_loaded")); } }
java
public void initializeWorldGroup() { if (worldGroupManager == null) { worldGroupManager = new WorldGroupsManager(); sendConsoleMessage(Level.INFO, getLanguageManager().getString("world_group_manager_loaded")); } }
[ "public", "void", "initializeWorldGroup", "(", ")", "{", "if", "(", "worldGroupManager", "==", "null", ")", "{", "worldGroupManager", "=", "new", "WorldGroupsManager", "(", ")", ";", "sendConsoleMessage", "(", "Level", ".", "INFO", ",", "getLanguageManager", "("...
Initialize the {@link WorldGroupsManager}
[ "Initialize", "the", "{" ]
51b1b3de7d039e20c7418d1e70b8c4b02b8cf840
https://github.com/greatman/craftconomy3/blob/51b1b3de7d039e20c7418d1e70b8c4b02b8cf840/src/main/java/com/greatmancode/craftconomy3/Common.java#L434-L439
train
Initialize the world group manager.
Of course, here is the Java code you requested: ```java public void initializeWorldGroup() { if (worldGroupManager == null) { worldGroupManager = new WorldGroupsManager(); sendConsoleMessage(Level.INFO, getLanguageManager().getString("world_group_manager_loaded")); } } ``` ...
zaproxy/zaproxy
src/org/zaproxy/zap/spider/URLResolver.java
URLResolver.removeLeadingSlashPoints
private static String removeLeadingSlashPoints(String path) { while (path.startsWith("/..")) { path = path.substring(3); } return path; }
java
private static String removeLeadingSlashPoints(String path) { while (path.startsWith("/..")) { path = path.substring(3); } return path; }
[ "private", "static", "String", "removeLeadingSlashPoints", "(", "String", "path", ")", "{", "while", "(", "path", ".", "startsWith", "(", "\"/..\"", ")", ")", "{", "path", "=", "path", ".", "substring", "(", "3", ")", ";", "}", "return", "path", ";", "...
"/.." at the beginning should be removed as browsers do (not in RFC). @param path the path @return the cleaned string defining the path.
[ "/", "..", "at", "the", "beginning", "should", "be", "removed", "as", "browsers", "do", "(", "not", "in", "RFC", ")", "." ]
0cbe5121f2ae1ecca222513d182759210c569bec
https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/spider/URLResolver.java#L395-L401
train
Remove leading slash points from a path.
Of course, here is the Java code you requested: ```java private static String removeLeadingSlashPoints(String path) { while (path.startsWith("/..")) { path = path.substring(3); } return path; } ``` Hope this helps!
spring-projects/spring-loaded
springloaded/src/main/java/org/springsource/loaded/ri/ReflectiveInterceptor.java
ReflectiveInterceptor.toParamString
static String toParamString(Class<?>[] params) { if (params == null || params.length == 0) { return "()"; } StringBuilder s = new StringBuilder(); s.append('('); for (int i = 0, max = params.length; i < max; i++) { if (i > 0) { s.append(", "); } if (params[i] == null) { s.append("null"); ...
java
static String toParamString(Class<?>[] params) { if (params == null || params.length == 0) { return "()"; } StringBuilder s = new StringBuilder(); s.append('('); for (int i = 0, max = params.length; i < max; i++) { if (i > 0) { s.append(", "); } if (params[i] == null) { s.append("null"); ...
[ "static", "String", "toParamString", "(", "Class", "<", "?", ">", "[", "]", "params", ")", "{", "if", "(", "params", "==", "null", "||", "params", ".", "length", "==", "0", ")", "{", "return", "\"()\"", ";", "}", "StringBuilder", "s", "=", "new", "...
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
[ "//////////////////////////////////////////////////////////////////////////////////////////////////////////////" ]
59b32f957a05c6d9f149148158053605e2a6205a
https://github.com/spring-projects/spring-loaded/blob/59b32f957a05c6d9f149148158053605e2a6205a/springloaded/src/main/java/org/springsource/loaded/ri/ReflectiveInterceptor.java#L187-L206
train
Returns a string representation of the given parameter types.
Of course, here is the Java code you requested: ```java static String toParamString(Class<?>[] params) { if (params == null || params.length == 0) { return "()"; } StringBuilder s = new StringBuilder(); s.append('('); for (int i = 0, max = params.length; i < max; i++) { if (i > 0) { s.append(", ");...
eurekaclinical/protempa
protempa-framework/src/main/java/org/protempa/proposition/value/ValueList.java
ValueList.compare
@Override public ValueComparator compare(Value val) { if (val == null || val.getType() != ValueType.VALUELIST) { return ValueComparator.NOT_EQUAL_TO; } ValueList<?> vl = (ValueList<?>) val; return vl.contains(this) ? ValueComparator.IN : ValueComparator.NOT_IN; }
java
@Override public ValueComparator compare(Value val) { if (val == null || val.getType() != ValueType.VALUELIST) { return ValueComparator.NOT_EQUAL_TO; } ValueList<?> vl = (ValueList<?>) val; return vl.contains(this) ? ValueComparator.IN : ValueComparator.NOT_IN; }
[ "@", "Override", "public", "ValueComparator", "compare", "(", "Value", "val", ")", "{", "if", "(", "val", "==", "null", "||", "val", ".", "getType", "(", ")", "!=", "ValueType", ".", "VALUELIST", ")", "{", "return", "ValueComparator", ".", "NOT_EQUAL_TO", ...
Compares a value list for membership in another value list. This method does <b>NOT</b> compare two lists for equality. To do this, use {@link #equals(java.lang.Object) }. @param o a {@link Value}. @return if the provided value is a value list, returns {@link ValueComparator#IN} if the list is in the provided value li...
[ "Compares", "a", "value", "list", "for", "membership", "in", "another", "value", "list", ".", "This", "method", "does", "<b", ">", "NOT<", "/", "b", ">", "compare", "two", "lists", "for", "equality", ".", "To", "do", "this", "use", "{", "@link", "#equa...
5a620d1a407c7a5426d1cf17d47b97717cf71634
https://github.com/eurekaclinical/protempa/blob/5a620d1a407c7a5426d1cf17d47b97717cf71634/protempa-framework/src/main/java/org/protempa/proposition/value/ValueList.java#L91-L98
train
Compare this value with another value.
Of course, here is the Java code you requested: ```java @Override public ValueComparator compare(Value val) { if (val == null || val.getType() != ValueType.VALUELIST) { return ValueComparator.NOT_EQUAL_TO; } ValueList<?> vl = (ValueList<?>) val; return vl.contains(this) ...