repo
stringlengths
7
59
path
stringlengths
3
222
func_name
stringlengths
3
127
original_string
stringlengths
0
466k
language
stringclasses
1 value
code
stringlengths
0
466k
code_tokens
listlengths
0
68.3k
docstring
stringlengths
0
21.3k
docstring_tokens
listlengths
0
1.93k
sha
stringlengths
0
40
url
stringlengths
0
339
partition
stringclasses
3 values
summary
stringlengths
0
250
instruction
stringlengths
38
3.13k
input
stringclasses
1 value
output
stringlengths
146
466k
JavaMoney/jsr354-ri-bp
src/main/java/org/javamoney/moneta/RoundedMoney.java
RoundedMoney.negate
@Override public RoundedMoney negate() { MathContext mc = monetaryContext.get(MathContext.class); if(mc==null){ mc = MathContext.DECIMAL64; } return new RoundedMoney(number.negate(mc), currency, rounding); }
java
@Override public RoundedMoney negate() { MathContext mc = monetaryContext.get(MathContext.class); if(mc==null){ mc = MathContext.DECIMAL64; } return new RoundedMoney(number.negate(mc), currency, rounding); }
[ "@", "Override", "public", "RoundedMoney", "negate", "(", ")", "{", "MathContext", "mc", "=", "monetaryContext", ".", "get", "(", "MathContext", ".", "class", ")", ";", "if", "(", "mc", "==", "null", ")", "{", "mc", "=", "MathContext", ".", "DECIMAL64", ...
/* (non-Javadoc) @see MonetaryAmount#negate()
[ "/", "*", "(", "non", "-", "Javadoc", ")" ]
9c147ef5623d8032a6dc4c0e5eefdfb41641a9a2
https://github.com/JavaMoney/jsr354-ri-bp/blob/9c147ef5623d8032a6dc4c0e5eefdfb41641a9a2/src/main/java/org/javamoney/moneta/RoundedMoney.java#L433-L441
train
Negate this money.
Create a Java method that does the following: "Negate this money.".
Of course, here is the Java code you requested: ```java @Override public RoundedMoney negate() { MathContext mc = monetaryContext.get(MathContext.class); if(mc==null){ mc = MathContext.DECIMAL64; } return new RoundedMoney(number.negate(mc), currency, roun...
OpenLiberty/open-liberty
dev/com.ibm.ws.org.apache.cxf.cxf.rt.frontend.jaxrs.3.2/src/com/ibm/ws/jaxrs20/metadata/JaxRsModuleInfo.java
JaxRsModuleInfo.getEndpointInfos
public Collection<EndpointInfo> getEndpointInfos() { ArrayList<EndpointInfo> values = new ArrayList<EndpointInfo>(); Iterator<String> it = getEndpointNames().iterator(); // for each endpoint name, iterate over it's list of endpoints and add to values while (it.hasNext()) { ...
java
public Collection<EndpointInfo> getEndpointInfos() { ArrayList<EndpointInfo> values = new ArrayList<EndpointInfo>(); Iterator<String> it = getEndpointNames().iterator(); // for each endpoint name, iterate over it's list of endpoints and add to values while (it.hasNext()) { ...
[ "public", "Collection", "<", "EndpointInfo", ">", "getEndpointInfos", "(", ")", "{", "ArrayList", "<", "EndpointInfo", ">", "values", "=", "new", "ArrayList", "<", "EndpointInfo", ">", "(", ")", ";", "Iterator", "<", "String", ">", "it", "=", "getEndpointNam...
/* return all endpoints
[ "/", "*", "return", "all", "endpoints" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.org.apache.cxf.cxf.rt.frontend.jaxrs.3.2/src/com/ibm/ws/jaxrs20/metadata/JaxRsModuleInfo.java#L89-L103
train
Get the list of all the endpoints in the context.
Create a Java method that does the following: "Get the list of all the endpoints in the context.".
Of course, here is the Java code you requested: ```java public Collection<EndpointInfo> getEndpointInfos() { ArrayList<EndpointInfo> values = new ArrayList<EndpointInfo>(); Iterator<String> it = getEndpointNames().iterator(); // for each endpoint name, iterate over it's list of endpoints and ...
looly/hutool
hutool-core/src/main/java/cn/hutool/core/collection/CollUtil.java
CollUtil.toMap
public static <K, V> HashMap<K, V> toMap(Iterable<Entry<K, V>> entryIter) { return IterUtil.toMap(entryIter); }
java
public static <K, V> HashMap<K, V> toMap(Iterable<Entry<K, V>> entryIter) { return IterUtil.toMap(entryIter); }
[ "public", "static", "<", "K", ",", "V", ">", "HashMap", "<", "K", ",", "V", ">", "toMap", "(", "Iterable", "<", "Entry", "<", "K", ",", "V", ">", ">", "entryIter", ")", "{", "return", "IterUtil", ".", "toMap", "(", "entryIter", ")", ";", "}" ]
将Entry集合转换为HashMap @param <K> 键类型 @param <V> 值类型 @param entryIter entry集合 @return Map @see IterUtil#toMap(Iterable)
[ "将Entry集合转换为HashMap" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/collection/CollUtil.java#L1512-L1514
train
Converts an iterable of entries to a HashMap.
Create a Java method that does the following: "Converts an iterable of entries to a HashMap.".
Of course, here is the Java code you requested: ```java public static <K, V> HashMap<K, V> toMap(Iterable<Entry<K, V>> entryIter) { return IterUtil.toMap(entryIter); } ``` Hope this helps!
Doctoror/ParticlesDrawable
opengl/src/main/java/com/doctoror/particlesdrawable/opengl/GlParticlesView.java
GlParticlesView.setSpeedFactor
@Override public void setSpeedFactor(@FloatRange(from = 0) final float speedFactor) { queueEvent(new Runnable() { @Override public void run() { scene.setSpeedFactor(speedFactor); } }); }
java
@Override public void setSpeedFactor(@FloatRange(from = 0) final float speedFactor) { queueEvent(new Runnable() { @Override public void run() { scene.setSpeedFactor(speedFactor); } }); }
[ "@", "Override", "public", "void", "setSpeedFactor", "(", "@", "FloatRange", "(", "from", "=", "0", ")", "final", "float", "speedFactor", ")", "{", "queueEvent", "(", "new", "Runnable", "(", ")", "{", "@", "Override", "public", "void", "run", "(", ")", ...
{@inheritDoc}
[ "{" ]
97ab510936692b5cf47822df78dd455f5e4b7ddf
https://github.com/Doctoror/ParticlesDrawable/blob/97ab510936692b5cf47822df78dd455f5e4b7ddf/opengl/src/main/java/com/doctoror/particlesdrawable/opengl/GlParticlesView.java#L294-L302
train
Sets the speed factor of the Araka language.
Create a Java method that does the following: "Sets the speed factor of the Araka language.".
Of course, here is the Java code you requested: ```java @Override public void setSpeedFactor(@FloatRange(from = 0) final float speedFactor) { queueEvent(new Runnable() { @Override public void run() { scene.setSpeedFactor(speedFactor); } }); } ...
looly/hutool
hutool-core/src/main/java/cn/hutool/core/io/file/FileWriter.java
FileWriter.writeLines
public <T> File writeLines(Collection<T> list, LineSeparator lineSeparator, boolean isAppend) throws IORuntimeException { try (PrintWriter writer = getPrintWriter(isAppend)){ for (T t : list) { if (null != t) { writer.print(t.toString()); printNewLine(writer, lineSeparator); writer.flush()...
java
public <T> File writeLines(Collection<T> list, LineSeparator lineSeparator, boolean isAppend) throws IORuntimeException { try (PrintWriter writer = getPrintWriter(isAppend)){ for (T t : list) { if (null != t) { writer.print(t.toString()); printNewLine(writer, lineSeparator); writer.flush()...
[ "public", "<", "T", ">", "File", "writeLines", "(", "Collection", "<", "T", ">", "list", ",", "LineSeparator", "lineSeparator", ",", "boolean", "isAppend", ")", "throws", "IORuntimeException", "{", "try", "(", "PrintWriter", "writer", "=", "getPrintWriter", "(...
将列表写入文件 @param <T> 集合元素类型 @param list 列表 @param lineSeparator 换行符枚举(Windows、Mac或Linux换行符) @param isAppend 是否追加 @return 目标文件 @throws IORuntimeException IO异常 @since 3.1.0
[ "将列表写入文件" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/file/FileWriter.java#L197-L208
train
Write lines to a file.
Create a Java method that does the following: "Write lines to a file.".
Of course, here is the Java code you requested: ```java public <T> File writeLines(Collection<T> list, LineSeparator lineSeparator, boolean isAppend) throws IORuntimeException { try (PrintWriter writer = getPrintWriter(isAppend)){ for (T t : list) { if (null != t) { writer.print(t.toString()); ...
lucee/Lucee
core/src/main/java/lucee/runtime/type/scope/ScopeContext.java
ScopeContext.clearUnused
public void clearUnused() { Log log = getLog(); try { // create cleaner engine for session/client scope if (session == null) session = new StorageScopeEngine(factory, log, new StorageScopeCleaner[] { new FileStorageScopeCleaner(Scope.SCOPE_SESSION, null)// new // SessionEndListener()) , new Data...
java
public void clearUnused() { Log log = getLog(); try { // create cleaner engine for session/client scope if (session == null) session = new StorageScopeEngine(factory, log, new StorageScopeCleaner[] { new FileStorageScopeCleaner(Scope.SCOPE_SESSION, null)// new // SessionEndListener()) , new Data...
[ "public", "void", "clearUnused", "(", ")", "{", "Log", "log", "=", "getLog", "(", ")", ";", "try", "{", "// create cleaner engine for session/client scope", "if", "(", "session", "==", "null", ")", "session", "=", "new", "StorageScopeEngine", "(", "factory", "...
remove all unused scope objects
[ "remove", "all", "unused", "scope", "objects" ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/type/scope/ScopeContext.java#L812-L845
train
Clear unused storage scopes.
Create a Java method that does the following: "Clear unused storage scopes.".
Of course, here is the Java code you requested: ```java public void clearUnused() { Log log = getLog(); try { // create cleaner engine for session/client scope if (session == null) session = new StorageScopeEngine(factory, log, new StorageScopeCleaner[] { new FileStorageScopeCleaner(Scope.SCOPE_SESSION, nu...
tango-controls/JTango
dao/src/main/java/fr/esrf/TangoApi/DeviceProxyDAODefaultImpl.java
DeviceProxyDAODefaultImpl.read_attribute_asynch
public int read_attribute_asynch(final DeviceProxy deviceProxy, final String attname) throws DevFailed { final String[] attnames = new String[1]; attnames[0] = attname; return read_attribute_asynch(deviceProxy, attnames); }
java
public int read_attribute_asynch(final DeviceProxy deviceProxy, final String attname) throws DevFailed { final String[] attnames = new String[1]; attnames[0] = attname; return read_attribute_asynch(deviceProxy, attnames); }
[ "public", "int", "read_attribute_asynch", "(", "final", "DeviceProxy", "deviceProxy", ",", "final", "String", "attname", ")", "throws", "DevFailed", "{", "final", "String", "[", "]", "attnames", "=", "new", "String", "[", "1", "]", ";", "attnames", "[", "0",...
==========================================================================
[ "==========================================================================" ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/dao/src/main/java/fr/esrf/TangoApi/DeviceProxyDAODefaultImpl.java#L2336-L2341
train
Read an attribute in a DeviceProxy object asynch.
Create a Java method that does the following: "Read an attribute in a DeviceProxy object asynch.".
Of course, here is the Java code you requested: ```java public int read_attribute_asynch(final DeviceProxy deviceProxy, final String attname) throws DevFailed { final String[] attnames = new String[1]; attnames[0] = attname; return read_attribute_asynch(deviceProxy, attnames); }...
aws/aws-sdk-java
aws-java-sdk-iotanalytics/src/main/java/com/amazonaws/services/iotanalytics/AWSIoTAnalyticsClient.java
AWSIoTAnalyticsClient.describePipeline
@Override public DescribePipelineResult describePipeline(DescribePipelineRequest request) { request = beforeClientExecution(request); return executeDescribePipeline(request); }
java
@Override public DescribePipelineResult describePipeline(DescribePipelineRequest request) { request = beforeClientExecution(request); return executeDescribePipeline(request); }
[ "@", "Override", "public", "DescribePipelineResult", "describePipeline", "(", "DescribePipelineRequest", "request", ")", "{", "request", "=", "beforeClientExecution", "(", "request", ")", ";", "return", "executeDescribePipeline", "(", "request", ")", ";", "}" ]
<p> Retrieves information about a pipeline. </p> @param describePipelineRequest @return Result of the DescribePipeline operation returned by the service. @throws InvalidRequestException The request was not valid. @throws ResourceNotFoundException A resource with the specified name could not be found. @throws InternalF...
[ "<p", ">", "Retrieves", "information", "about", "a", "pipeline", ".", "<", "/", "p", ">" ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-iotanalytics/src/main/java/com/amazonaws/services/iotanalytics/AWSIoTAnalyticsClient.java#L1200-L1204
train
Returns a description of a pipeline.
Create a Java method that does the following: "Returns a description of a pipeline.".
Of course, here is the Java code you requested: ```java @Override public DescribePipelineResult describePipeline(DescribePipelineRequest request) { request = beforeClientExecution(request); return executeDescribePipeline(request); } ``` Hope this helps!
oblac/jodd
jodd-core/src/main/java/jodd/buffer/FastBooleanBuffer.java
FastBooleanBuffer.append
public FastBooleanBuffer append(final FastBooleanBuffer buff) { if (buff.offset == 0) { return this; } append(buff.buffer, 0, buff.offset); return this; }
java
public FastBooleanBuffer append(final FastBooleanBuffer buff) { if (buff.offset == 0) { return this; } append(buff.buffer, 0, buff.offset); return this; }
[ "public", "FastBooleanBuffer", "append", "(", "final", "FastBooleanBuffer", "buff", ")", "{", "if", "(", "buff", ".", "offset", "==", "0", ")", "{", "return", "this", ";", "}", "append", "(", "buff", ".", "buffer", ",", "0", ",", "buff", ".", "offset",...
Appends another fast buffer to this one.
[ "Appends", "another", "fast", "buffer", "to", "this", "one", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-core/src/main/java/jodd/buffer/FastBooleanBuffer.java#L104-L110
test
Append the contents of the specified FastBooleanBuffer to this FastBooleanBuffer.
Create a Java method that does the following: "Append the contents of the specified FastBooleanBuffer to this FastBooleanBuffer.".
Of course, here is the Java code you requested: ```java public FastBooleanBuffer append(final FastBooleanBuffer buff) { if (buff.offset == 0) { return this; } append(buff.buffer, 0, buff.offset); return this; } ``` Hope this helps!
adamfisk/littleshoot-commons-id
src/main/java/org/apache/commons/id/uuid/VersionOneGenerator.java
VersionOneGenerator.nextUUID
public synchronized UUID nextUUID() { byte[] rawUUID = new byte[UUID_BYTE_LENGTH]; long time = 0; short clockSq = 0; Node node = manager.currentNode(); while (time < 1) { try { manager.lockNode(node); time = node.getUUIDTime(); ...
java
public synchronized UUID nextUUID() { byte[] rawUUID = new byte[UUID_BYTE_LENGTH]; long time = 0; short clockSq = 0; Node node = manager.currentNode(); while (time < 1) { try { manager.lockNode(node); time = node.getUUIDTime(); ...
[ "public", "synchronized", "UUID", "nextUUID", "(", ")", "{", "byte", "[", "]", "rawUUID", "=", "new", "byte", "[", "UUID_BYTE_LENGTH", "]", ";", "long", "time", "=", "0", ";", "short", "clockSq", "=", "0", ";", "Node", "node", "=", "manager", ".", "c...
<p>Returns a new version 1 UUID. The method acts upons static variables and so should be sychronized.</p> @return Returns a new version 1 UUID.
[ "<p", ">", "Returns", "a", "new", "version", "1", "UUID", ".", "The", "method", "acts", "upons", "static", "variables", "and", "so", "should", "be", "sychronized", ".", "<", "/", "p", ">" ]
49a8f5f2b10831c509876ca463bf1a87e1e49ae9
https://github.com/adamfisk/littleshoot-commons-id/blob/49a8f5f2b10831c509876ca463bf1a87e1e49ae9/src/main/java/org/apache/commons/id/uuid/VersionOneGenerator.java#L95-L128
train
Returns the next UUID in the cache.
Create a Java method that does the following: "Returns the next UUID in the cache.".
Of course, here is the Java code you requested: ```java public synchronized UUID nextUUID() { byte[] rawUUID = new byte[UUID_BYTE_LENGTH]; long time = 0; short clockSq = 0; Node node = manager.currentNode(); while (time < 1) { try { manager.lockNode(n...
aws/aws-sdk-java
aws-java-sdk-kinesis/src/main/java/com/amazonaws/services/kinesis/model/transform/PutRecordRequestMarshaller.java
PutRecordRequestMarshaller.marshall
public void marshall(PutRecordRequest putRecordRequest, ProtocolMarshaller protocolMarshaller) { if (putRecordRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(putRecordRequest.getStreamName(...
java
public void marshall(PutRecordRequest putRecordRequest, ProtocolMarshaller protocolMarshaller) { if (putRecordRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(putRecordRequest.getStreamName(...
[ "public", "void", "marshall", "(", "PutRecordRequest", "putRecordRequest", ",", "ProtocolMarshaller", "protocolMarshaller", ")", "{", "if", "(", "putRecordRequest", "==", "null", ")", "{", "throw", "new", "SdkClientException", "(", "\"Invalid argument passed to marshall(....
Marshall the given parameter object.
[ "Marshall", "the", "given", "parameter", "object", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-kinesis/src/main/java/com/amazonaws/services/kinesis/model/transform/PutRecordRequestMarshaller.java#L50-L65
train
marshalls the given PutRecordRequest to the given protocolMarshaller.
Create a Java method that does the following: "marshalls the given PutRecordRequest to the given protocolMarshaller.".
Of course, here is the Java code you requested: ```java public void marshall(PutRecordRequest putRecordRequest, ProtocolMarshaller protocolMarshaller) { if (putRecordRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { pr...
Azure/azure-sdk-for-java
common/azure-common/src/main/java/com/azure/common/implementation/SwaggerMethodParser.java
SwaggerMethodParser.getUnexpectedException
@Override public UnexpectedExceptionInformation getUnexpectedException(int code) { if (exceptionMapping == null) { exceptionMapping = processUnexpectedResponseExceptionTypes(); } return exceptionMapping.getOrDefault(code, defaultException); }
java
@Override public UnexpectedExceptionInformation getUnexpectedException(int code) { if (exceptionMapping == null) { exceptionMapping = processUnexpectedResponseExceptionTypes(); } return exceptionMapping.getOrDefault(code, defaultException); }
[ "@", "Override", "public", "UnexpectedExceptionInformation", "getUnexpectedException", "(", "int", "code", ")", "{", "if", "(", "exceptionMapping", "==", "null", ")", "{", "exceptionMapping", "=", "processUnexpectedResponseExceptionTypes", "(", ")", ";", "}", "return"...
Get the {@link UnexpectedExceptionInformation} that will be used to generate a RestException if the HTTP response status code is not one of the expected status codes. If an UnexpectedExceptionInformation is not found for the status code the default UnexpectedExceptionInformation will be returned. @param code Exceptio...
[ "Get", "the", "{", "@link", "UnexpectedExceptionInformation", "}", "that", "will", "be", "used", "to", "generate", "a", "RestException", "if", "the", "HTTP", "response", "status", "code", "is", "not", "one", "of", "the", "expected", "status", "codes", "." ]
aab183ddc6686c82ec10386d5a683d2691039626
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/common/azure-common/src/main/java/com/azure/common/implementation/SwaggerMethodParser.java#L407-L414
train
Get an UnexpectedExceptionInformation object for the specified HTTP status code.
Create a Java method that does the following: "Get an UnexpectedExceptionInformation object for the specified HTTP status code.".
Of course, here is the Java code you requested: ```java @Override public UnexpectedExceptionInformation getUnexpectedException(int code) { if (exceptionMapping == null) { exceptionMapping = processUnexpectedResponseExceptionTypes(); } return exceptionMapping.getOrDefault(code, ...
jeffreyning/nh-micro
nh-micro-db/src/main/java/com/nh/micro/db/MicroMetaDao.java
MicroMetaDao.queryObjJoinCountByCondition
public int queryObjJoinCountByCondition(String sql,Object[] paramArray){ /* JdbcTemplate jdbcTemplate = (JdbcTemplate) MicroDbHolder .getDbSource(dbName);*/ JdbcTemplate jdbcTemplate = getMicroJdbcTemplate(); logger.debug(sql); logger.debug(Arrays.toString(paramArray)); Integer total=jdbcTemplate.que...
java
public int queryObjJoinCountByCondition(String sql,Object[] paramArray){ /* JdbcTemplate jdbcTemplate = (JdbcTemplate) MicroDbHolder .getDbSource(dbName);*/ JdbcTemplate jdbcTemplate = getMicroJdbcTemplate(); logger.debug(sql); logger.debug(Arrays.toString(paramArray)); Integer total=jdbcTemplate.que...
[ "public", "int", "queryObjJoinCountByCondition", "(", "String", "sql", ",", "Object", "[", "]", "paramArray", ")", "{", "/*\t\tJdbcTemplate jdbcTemplate = (JdbcTemplate) MicroDbHolder\r\n\t\t.getDbSource(dbName);*/", "JdbcTemplate", "jdbcTemplate", "=", "getMicroJdbcTemplate", "(...
/* 锟斤拷锟絪ql锟斤拷询锟斤拷录锟斤拷
[ "/", "*", "锟斤拷锟絪ql锟斤拷询锟斤拷录锟斤拷" ]
f1cb420a092f8ba94317519ede739974decb5617
https://github.com/jeffreyning/nh-micro/blob/f1cb420a092f8ba94317519ede739974decb5617/nh-micro-db/src/main/java/com/nh/micro/db/MicroMetaDao.java#L939-L947
train
Query for number of objects in the table that match the condition specified in the parameter array.
Create a Java method that does the following: "Query for number of objects in the table that match the condition specified in the parameter array.".
Of course, here is the Java code you requested: ```java public int queryObjJoinCountByCondition(String sql,Object[] paramArray){ /* JdbcTemplate jdbcTemplate = (JdbcTemplate) MicroDbHolder .getDbSource(dbName);*/ JdbcTemplate jdbcTemplate = getMicroJdbcTemplate(); logger.debug(sql); logger.debug(Arrays...
crowmagnumb/s6-util
src/main/java/net/crowmagnumb/util/io/ResourceReaderImpl.java
ResourceReaderImpl.getDoubleValue
@Override public double getDoubleValue( final String key, final double defaultValue ) { return formatDoubleValue( key, getFormattedPropValue( key ), defaultValue ); }
java
@Override public double getDoubleValue( final String key, final double defaultValue ) { return formatDoubleValue( key, getFormattedPropValue( key ), defaultValue ); }
[ "@", "Override", "public", "double", "getDoubleValue", "(", "final", "String", "key", ",", "final", "double", "defaultValue", ")", "{", "return", "formatDoubleValue", "(", "key", ",", "getFormattedPropValue", "(", "key", ")", ",", "defaultValue", ")", ";", "}"...
/* (non-Javadoc) @see net.crowmagnumb.util.ResourceReader#getDoubleValue(java.lang.String, double)
[ "/", "*", "(", "non", "-", "Javadoc", ")" ]
0f9969bc0809e8a617501fa57c135e9b3984fae0
https://github.com/crowmagnumb/s6-util/blob/0f9969bc0809e8a617501fa57c135e9b3984fae0/src/main/java/net/crowmagnumb/util/io/ResourceReaderImpl.java#L1008-L1013
train
Get a double value from a security component.
Create a Java method that does the following: "Get a double value from a security component.".
Of course, here is the Java code you requested: ```java @Override public double getDoubleValue( final String key, final double defaultValue ) { return formatDoubleValue( key, getFormattedPropValue( key ), defaultValue ); } ``` Hope this helps!
Azure/azure-sdk-for-java
common/azure-common/src/main/java/com/azure/common/implementation/http/UrlBuilder.java
UrlBuilder.withPort
public UrlBuilder withPort(String port) { if (port == null || port.isEmpty()) { this.port = null; } else { with(port, UrlTokenizerState.PORT); } return this; }
java
public UrlBuilder withPort(String port) { if (port == null || port.isEmpty()) { this.port = null; } else { with(port, UrlTokenizerState.PORT); } return this; }
[ "public", "UrlBuilder", "withPort", "(", "String", "port", ")", "{", "if", "(", "port", "==", "null", "||", "port", ".", "isEmpty", "(", ")", ")", "{", "this", ".", "port", "=", "null", ";", "}", "else", "{", "with", "(", "port", ",", "UrlTokenizer...
Set the port that will be used to build the final URL. @param port The port that will be used to build the final URL. @return This UrlBuilder so that multiple setters can be chained together.
[ "Set", "the", "port", "that", "will", "be", "used", "to", "build", "the", "final", "URL", "." ]
aab183ddc6686c82ec10386d5a683d2691039626
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/common/azure-common/src/main/java/com/azure/common/implementation/http/UrlBuilder.java#L72-L79
train
Sets the port.
Create a Java method that does the following: "Sets the port.".
Of course, here is the Java code you requested: ```java public UrlBuilder withPort(String port) { if (port == null || port.isEmpty()) { this.port = null; } else { with(port, UrlTokenizerState.PORT); } return this; } ``` Hope this helps!
OpenLiberty/open-liberty
dev/com.ibm.ws.artifact.zip/src/com/ibm/ws/artifact/zip/internal/ZipFileContainer.java
ZipFileContainer.releaseExtractionGuard
private void releaseExtractionGuard(ExtractionGuard extractionLatch) { synchronized( extractionsLock ) { extractionLocks.remove( extractionLatch.path ); } extractionLatch.completionLatch.countDown(); }
java
private void releaseExtractionGuard(ExtractionGuard extractionLatch) { synchronized( extractionsLock ) { extractionLocks.remove( extractionLatch.path ); } extractionLatch.completionLatch.countDown(); }
[ "private", "void", "releaseExtractionGuard", "(", "ExtractionGuard", "extractionLatch", ")", "{", "synchronized", "(", "extractionsLock", ")", "{", "extractionLocks", ".", "remove", "(", "extractionLatch", ".", "path", ")", ";", "}", "extractionLatch", ".", "complet...
unblocking secondary extractions.
[ "unblocking", "secondary", "extractions", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.artifact.zip/src/com/ibm/ws/artifact/zip/internal/ZipFileContainer.java#L1425-L1430
train
Release an extraction guard.
Create a Java method that does the following: "Release an extraction guard.".
Of course, here is the Java code you requested: ```java private void releaseExtractionGuard(ExtractionGuard extractionLatch) { synchronized( extractionsLock ) { extractionLocks.remove( extractionLatch.path ); } extractionLatch.completionLatch.countDown(); } ``` Hope this helps!
super-csv/super-csv
super-csv/src/main/java/org/supercsv/io/CsvResultSetWriter.java
CsvResultSetWriter.write
public void write(final ResultSet resultSet) throws SQLException, IOException { if( resultSet == null ) { throw new NullPointerException("ResultSet cannot be null"); } writeHeaders(resultSet); // increments row and line number writeContents(resultSet); // increments row and line number before writing of e...
java
public void write(final ResultSet resultSet) throws SQLException, IOException { if( resultSet == null ) { throw new NullPointerException("ResultSet cannot be null"); } writeHeaders(resultSet); // increments row and line number writeContents(resultSet); // increments row and line number before writing of e...
[ "public", "void", "write", "(", "final", "ResultSet", "resultSet", ")", "throws", "SQLException", ",", "IOException", "{", "if", "(", "resultSet", "==", "null", ")", "{", "throw", "new", "NullPointerException", "(", "\"ResultSet cannot be null\"", ")", ";", "}",...
{@inheritDoc}
[ "{" ]
f18db724674dc1c4116e25142c1b5403ebf43e96
https://github.com/super-csv/super-csv/blob/f18db724674dc1c4116e25142c1b5403ebf43e96/super-csv/src/main/java/org/supercsv/io/CsvResultSetWriter.java#L58-L65
train
Write the contents of a ResultSet to the output stream.
Create a Java method that does the following: "Write the contents of a ResultSet to the output stream.".
Of course, here is the Java code you requested: ```java public void write(final ResultSet resultSet) throws SQLException, IOException { if( resultSet == null ) { throw new NullPointerException("ResultSet cannot be null"); } writeHeaders(resultSet); // increments row and line number writeContents(resultSe...
Harium/keel
src/main/java/com/harium/keel/catalano/math/transform/FourierTransform.java
FourierTransform.FFT
public static void FFT(ComplexNumber[] data, Direction direction) { double[] real = ComplexNumber.getReal(data); double[] img = ComplexNumber.getImaginary(data); if (direction == Direction.Forward) FFT(real, img); else FFT(img, real); if (direction ...
java
public static void FFT(ComplexNumber[] data, Direction direction) { double[] real = ComplexNumber.getReal(data); double[] img = ComplexNumber.getImaginary(data); if (direction == Direction.Forward) FFT(real, img); else FFT(img, real); if (direction ...
[ "public", "static", "void", "FFT", "(", "ComplexNumber", "[", "]", "data", ",", "Direction", "direction", ")", "{", "double", "[", "]", "real", "=", "ComplexNumber", ".", "getReal", "(", "data", ")", ";", "double", "[", "]", "img", "=", "ComplexNumber", ...
1-D Fast Fourier Transform. @param data Data to transform. @param direction Transformation direction.
[ "1", "-", "D", "Fast", "Fourier", "Transform", "." ]
0369ae674f9e664bccc5f9e161ae7e7a3b949a1e
https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/transform/FourierTransform.java#L168-L185
train
FFT data using the NFT FFT.
Create a Java method that does the following: "FFT data using the NFT FFT.".
Of course, here is the Java code you requested: ```java public static void FFT(ComplexNumber[] data, Direction direction) { double[] real = ComplexNumber.getReal(data); double[] img = ComplexNumber.getImaginary(data); if (direction == Direction.Forward) FFT(real, img); ...
xiancloud/xian
xian-core/src/main/java/info/xiancloud/core/util/file/FileUtil.java
FileUtil.copyFile
public static void copyFile(InputStream _inputStream, String newFile) throws IOException { try (InputStream inputStream = _inputStream; FileOutputStream outputStream = new FileOutputStream(newFile)) { int length = 2097152; byte[] buffer = new byte[length]; while ...
java
public static void copyFile(InputStream _inputStream, String newFile) throws IOException { try (InputStream inputStream = _inputStream; FileOutputStream outputStream = new FileOutputStream(newFile)) { int length = 2097152; byte[] buffer = new byte[length]; while ...
[ "public", "static", "void", "copyFile", "(", "InputStream", "_inputStream", ",", "String", "newFile", ")", "throws", "IOException", "{", "try", "(", "InputStream", "inputStream", "=", "_inputStream", ";", "FileOutputStream", "outputStream", "=", "new", "FileOutputSt...
拷贝文件,本方法会将输入输出流关闭。
[ "拷贝文件,本方法会将输入输出流关闭。" ]
1948e088545553d2745b2c86d8b5a64988bb850e
https://github.com/xiancloud/xian/blob/1948e088545553d2745b2c86d8b5a64988bb850e/xian-core/src/main/java/info/xiancloud/core/util/file/FileUtil.java#L36-L51
train
Copy a file from an input stream to a file.
Create a Java method that does the following: "Copy a file from an input stream to a file.".
Of course, here is the Java code you requested: ```java public static void copyFile(InputStream _inputStream, String newFile) throws IOException { try (InputStream inputStream = _inputStream; FileOutputStream outputStream = new FileOutputStream(newFile)) { int length = 2097152; ...
Evol-Instruct
N/A
N/A
java
[]
[]
train
Create a class in Java called 'Student' which has the following attributes: firstname, lastname, age, gender, and subjects. Implement the class in such a way that the firstname and lastname are both non-empty strings consisting only of alphabets, the age is a positive integer between 16 and 40 (inclusive), the gender i...
Here is an example implementation of the 'Student' class in Java: ```java import java.util.ArrayList; import java.util.List; public class Student { private String firstname; private String lastname; private int age; private String gender; private List<String> subjects; public Student(String f...
deeplearning4j/deeplearning4j
nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/util/NDArrayMath.java
NDArrayMath.vectorsPerSlice
public static long vectorsPerSlice(INDArray arr) { if (arr.rank() > 2) { return ArrayUtil.prodLong(new long[] {arr.size(-1), arr.size(-2)}); } return arr.slices(); }
java
public static long vectorsPerSlice(INDArray arr) { if (arr.rank() > 2) { return ArrayUtil.prodLong(new long[] {arr.size(-1), arr.size(-2)}); } return arr.slices(); }
[ "public", "static", "long", "vectorsPerSlice", "(", "INDArray", "arr", ")", "{", "if", "(", "arr", ".", "rank", "(", ")", ">", "2", ")", "{", "return", "ArrayUtil", ".", "prodLong", "(", "new", "long", "[", "]", "{", "arr", ".", "size", "(", "-", ...
The number of vectors in each slice of an ndarray. @param arr the array to get the number of vectors per slice for @return the number of vectors per slice
[ "The", "number", "of", "vectors", "in", "each", "slice", "of", "an", "ndarray", "." ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/util/NDArrayMath.java#L94-L100
train
Returns the number of vectors per slice of the given array.
Create a Java method that does the following: "Returns the number of vectors per slice of the given array.".
Of course, here is the Java code you requested: ```java public static long vectorsPerSlice(INDArray arr) { if (arr.rank() > 2) { return ArrayUtil.prodLong(new long[] {arr.size(-1), arr.size(-2)}); } return arr.slices(); } ``` Hope this helps!
haifengl/smile
core/src/main/java/smile/clustering/BBDTree.java
BBDTree.filter
private double filter(Node node, double[][] centroids, int[] candidates, int k, double[][] sums, int[] counts, int[] membership) { int d = centroids[0].length; // Determine which mean the node mean is closest to double minDist = Math.squaredDistance(node.center, centroids[candidates[0]]); ...
java
private double filter(Node node, double[][] centroids, int[] candidates, int k, double[][] sums, int[] counts, int[] membership) { int d = centroids[0].length; // Determine which mean the node mean is closest to double minDist = Math.squaredDistance(node.center, centroids[candidates[0]]); ...
[ "private", "double", "filter", "(", "Node", "node", ",", "double", "[", "]", "[", "]", "centroids", ",", "int", "[", "]", "candidates", ",", "int", "k", ",", "double", "[", "]", "[", "]", "sums", ",", "int", "[", "]", "counts", ",", "int", "[", ...
This determines which clusters all data that are rooted node will be assigned to, and updates sums, counts and membership (if not null) accordingly. Candidates maintains the set of cluster indices which could possibly be the closest clusters for data in this subtree.
[ "This", "determines", "which", "clusters", "all", "data", "that", "are", "rooted", "node", "will", "be", "assigned", "to", "and", "updates", "sums", "counts", "and", "membership", "(", "if", "not", "null", ")", "accordingly", ".", "Candidates", "maintains", ...
e27e43e90fbaacce3f99d30120cf9dd6a764c33d
https://github.com/haifengl/smile/blob/e27e43e90fbaacce3f99d30120cf9dd6a764c33d/core/src/main/java/smile/clustering/BBDTree.java#L278-L327
train
This method is the main entry point for the filter method.
Create a Java method that does the following: "This method is the main entry point for the filter method.".
Of course, here is the Java code you requested: ```java private double filter(Node node, double[][] centroids, int[] candidates, int k, double[][] sums, int[] counts, int[] membership) { int d = centroids[0].length; // Determine which mean the node mean is closest to double minDist = Math.squa...
couchbase/couchbase-lite-java
src/main/java/com/couchbase/lite/QueryBuilder.java
QueryBuilder.select
@NonNull public static Select select(@NonNull SelectResult... results) { if (results == null) { throw new IllegalArgumentException("results cannot be null."); } return new Select(false, results); }
java
@NonNull public static Select select(@NonNull SelectResult... results) { if (results == null) { throw new IllegalArgumentException("results cannot be null."); } return new Select(false, results); }
[ "@", "NonNull", "public", "static", "Select", "select", "(", "@", "NonNull", "SelectResult", "...", "results", ")", "{", "if", "(", "results", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"results cannot be null.\"", ")", ";", "}"...
Create a SELECT statement instance that you can use further (e.g. calling the from() function) to construct the complete query statement. @param results The array of the SelectResult object for specifying the returned values. @return A Select object.
[ "Create", "a", "SELECT", "statement", "instance", "that", "you", "can", "use", "further", "(", "e", ".", "g", ".", "calling", "the", "from", "()", "function", ")", "to", "construct", "the", "complete", "query", "statement", "." ]
cb72c44186456e6191a9ad0a7feb310011d0b081
https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/QueryBuilder.java#L31-L35
train
Creates a new instance of a CRS class with the specified results.
Create a Java method that does the following: "Creates a new instance of a CRS class with the specified results.".
Of course, here is the Java code you requested: ```java @NonNull public static Select select(@NonNull SelectResult... results) { if (results == null) { throw new IllegalArgumentException("results cannot be null."); } return new Select(false, results); } ``` Hope this helps!
OpenLiberty/open-liberty
dev/com.ibm.ws.injection.core/src/com/ibm/wsspi/injectionengine/ComponentNameSpaceConfiguration.java
ComponentNameSpaceConfiguration.setClientContainer
public void setClientContainer(boolean clientContainer) // F48603.7 { setOwningFlow(clientContainer ? ReferenceFlowKind.CLIENT : null); if (isClientContainer() && ivInjectionClasses != null && !ivInjectionClasses.isEmpty()) { ivClientMainClass = ivInjectionClasses.get(0); } }
java
public void setClientContainer(boolean clientContainer) // F48603.7 { setOwningFlow(clientContainer ? ReferenceFlowKind.CLIENT : null); if (isClientContainer() && ivInjectionClasses != null && !ivInjectionClasses.isEmpty()) { ivClientMainClass = ivInjectionClasses.get(0); } }
[ "public", "void", "setClientContainer", "(", "boolean", "clientContainer", ")", "// F48603.7", "{", "setOwningFlow", "(", "clientContainer", "?", "ReferenceFlowKind", ".", "CLIENT", ":", "null", ")", ";", "if", "(", "isClientContainer", "(", ")", "&&", "ivInjectio...
Indicates injection processing is occurring in the client container. <p> When processing is performed for the client container, the first class in the list of injection classes must be the client application main class.
[ "Indicates", "injection", "processing", "is", "occurring", "in", "the", "client", "container", ".", "<p", ">" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.injection.core/src/com/ibm/wsspi/injectionengine/ComponentNameSpaceConfiguration.java#L1204-L1210
train
Sets the owning flow of this class to client container.
Create a Java method that does the following: "Sets the owning flow of this class to client container.".
Of course, here is the Java code you requested: ```java public void setClientContainer(boolean clientContainer) // F48603.7 { setOwningFlow(clientContainer ? ReferenceFlowKind.CLIENT : null); if (isClientContainer() && ivInjectionClasses != null && !ivInjectionClasses.isEmpty()) { ivCli...
FudanNLP/fnlp
fnlp-core/src/main/java/org/fnlp/ml/types/InstanceSet.java
InstanceSet.loadThruPipes
public void loadThruPipes(Reader reader) throws Exception { // 通过迭代加入样本 while (reader.hasNext()) { Instance inst = reader.next(); if (pipes != null) pipes.addThruPipe(inst); this.add(inst); } }
java
public void loadThruPipes(Reader reader) throws Exception { // 通过迭代加入样本 while (reader.hasNext()) { Instance inst = reader.next(); if (pipes != null) pipes.addThruPipe(inst); this.add(inst); } }
[ "public", "void", "loadThruPipes", "(", "Reader", "reader", ")", "throws", "Exception", "{", "// 通过迭代加入样本\r", "while", "(", "reader", ".", "hasNext", "(", ")", ")", "{", "Instance", "inst", "=", "reader", ".", "next", "(", ")", ";", "if", "(", "pipes", ...
用本样本集合默认的“数据类型转换管道”通过“数据读取器”批量建立样本集合 @param reader 数据读取器 @throws Exception
[ "用本样本集合默认的“数据类型转换管道”通过“数据读取器”批量建立样本集合" ]
ce258f3e4a5add2ba0b5e4cbac7cab2190af6659
https://github.com/FudanNLP/fnlp/blob/ce258f3e4a5add2ba0b5e4cbac7cab2190af6659/fnlp-core/src/main/java/org/fnlp/ml/types/InstanceSet.java#L193-L202
train
Load the ThruPipes.
Create a Java method that does the following: "Load the ThruPipes.".
Of course, here is the Java code you requested: ```java public void loadThruPipes(Reader reader) throws Exception { // 通过迭代加入样本 while (reader.hasNext()) { Instance inst = reader.next(); if (pipes != null) pipes.addThruPipe(inst); this.add(inst...
aws/aws-sdk-java
aws-java-sdk-waf/src/main/java/com/amazonaws/services/waf/model/waf/transform/WebACLSummaryMarshaller.java
WebACLSummaryMarshaller.marshall
public void marshall(WebACLSummary webACLSummary, ProtocolMarshaller protocolMarshaller) { if (webACLSummary == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(webACLSummary.getWebACLId(), WEBACLID_BI...
java
public void marshall(WebACLSummary webACLSummary, ProtocolMarshaller protocolMarshaller) { if (webACLSummary == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(webACLSummary.getWebACLId(), WEBACLID_BI...
[ "public", "void", "marshall", "(", "WebACLSummary", "webACLSummary", ",", "ProtocolMarshaller", "protocolMarshaller", ")", "{", "if", "(", "webACLSummary", "==", "null", ")", "{", "throw", "new", "SdkClientException", "(", "\"Invalid argument passed to marshall(...)\"", ...
Marshall the given parameter object.
[ "Marshall", "the", "given", "parameter", "object", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-waf/src/main/java/com/amazonaws/services/waf/model/waf/transform/WebACLSummaryMarshaller.java#L44-L56
train
marshalls the given WebACLSummary object to the JSON object.
Create a Java method that does the following: "marshalls the given WebACLSummary object to the JSON object.".
Of course, here is the Java code you requested: ```java public void marshall(WebACLSummary webACLSummary, ProtocolMarshaller protocolMarshaller) { if (webACLSummary == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMar...
rupertlssmith/lojix
base/common/src/main/com/thesett/common/properties/ParsedProperties.java
ParsedProperties.setPropertyIfNull
public long setPropertyIfNull(String propname, long value) { return Long.parseLong(setPropertyIfNull(propname, Long.toString(value))); }
java
public long setPropertyIfNull(String propname, long value) { return Long.parseLong(setPropertyIfNull(propname, Long.toString(value))); }
[ "public", "long", "setPropertyIfNull", "(", "String", "propname", ",", "long", "value", ")", "{", "return", "Long", ".", "parseLong", "(", "setPropertyIfNull", "(", "propname", ",", "Long", ".", "toString", "(", "value", ")", ")", ")", ";", "}" ]
Helper method for setting properties to defaults when they are not already set. @param propname The name of the system property to set. @param value The value to set it to. @return The value of the property after this method call.
[ "Helper", "method", "for", "setting", "properties", "to", "defaults", "when", "they", "are", "not", "already", "set", "." ]
ad494dc8bce2345567de7689d42291d4b30fbd51
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/base/common/src/main/com/thesett/common/properties/ParsedProperties.java#L201-L204
test
Set a property of the class record.
Create a Java method that does the following: "Set a property of the class record.".
Of course, here is the Java code you requested: ```java public long setPropertyIfNull(String propname, long value) { return Long.parseLong(setPropertyIfNull(propname, Long.toString(value))); } ``` Hope this helps!
apache/flink
flink-formats/flink-parquet/src/main/java/org/apache/flink/formats/parquet/utils/ParquetRecordReader.java
ParquetRecordReader.readNextRecord
private boolean readNextRecord() throws IOException { boolean recordFound = false; while (!recordFound) { // no more records left if (numReadRecords >= numTotalRecords) { return false; } try { if (numReadRecords == numRecordsUpToCurrentBlock) { // advance to next block PageReadStore p...
java
private boolean readNextRecord() throws IOException { boolean recordFound = false; while (!recordFound) { // no more records left if (numReadRecords >= numTotalRecords) { return false; } try { if (numReadRecords == numRecordsUpToCurrentBlock) { // advance to next block PageReadStore p...
[ "private", "boolean", "readNextRecord", "(", ")", "throws", "IOException", "{", "boolean", "recordFound", "=", "false", ";", "while", "(", "!", "recordFound", ")", "{", "// no more records left", "if", "(", "numReadRecords", ">=", "numTotalRecords", ")", "{", "r...
Reads the next record. @return True if a record could be read, false otherwise.
[ "Reads", "the", "next", "record", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-formats/flink-parquet/src/main/java/org/apache/flink/formats/parquet/utils/ParquetRecordReader.java#L215-L271
train
Reads the next record from the underlying reader.
Create a Java method that does the following: "Reads the next record from the underlying reader.".
Of course, here is the Java code you requested: ```java private boolean readNextRecord() throws IOException { boolean recordFound = false; while (!recordFound) { // no more records left if (numReadRecords >= numTotalRecords) { return false; } try { if (numReadRecords == numRecordsUpToCurrentBl...
Azure/azure-sdk-for-java
edgegateway/resource-manager/v2019_03_01/src/main/java/com/microsoft/azure/management/edgegateway/v2019_03_01/implementation/BandwidthSchedulesInner.java
BandwidthSchedulesInner.beginCreateOrUpdateAsync
public Observable<BandwidthScheduleInner> beginCreateOrUpdateAsync(String deviceName, String name, String resourceGroupName, BandwidthScheduleInner parameters) { return beginCreateOrUpdateWithServiceResponseAsync(deviceName, name, resourceGroupName, parameters).map(new Func1<ServiceResponse<BandwidthScheduleInn...
java
public Observable<BandwidthScheduleInner> beginCreateOrUpdateAsync(String deviceName, String name, String resourceGroupName, BandwidthScheduleInner parameters) { return beginCreateOrUpdateWithServiceResponseAsync(deviceName, name, resourceGroupName, parameters).map(new Func1<ServiceResponse<BandwidthScheduleInn...
[ "public", "Observable", "<", "BandwidthScheduleInner", ">", "beginCreateOrUpdateAsync", "(", "String", "deviceName", ",", "String", "name", ",", "String", "resourceGroupName", ",", "BandwidthScheduleInner", "parameters", ")", "{", "return", "beginCreateOrUpdateWithServiceRe...
Creates or updates a bandwidth schedule. @param deviceName The device name. @param name The bandwidth schedule name which needs to be added/updated. @param resourceGroupName The resource group name. @param parameters The bandwidth schedule to be added or updated. @throws IllegalArgumentException thrown if parameters f...
[ "Creates", "or", "updates", "a", "bandwidth", "schedule", "." ]
aab183ddc6686c82ec10386d5a683d2691039626
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/edgegateway/resource-manager/v2019_03_01/src/main/java/com/microsoft/azure/management/edgegateway/v2019_03_01/implementation/BandwidthSchedulesInner.java#L435-L442
train
Creates or updates a device s BASIC CA file.
Create a Java method that does the following: "Creates or updates a device s BASIC CA file.".
Of course, here is the Java code you requested: ```java public Observable<BandwidthScheduleInner> beginCreateOrUpdateAsync(String deviceName, String name, String resourceGroupName, BandwidthScheduleInner parameters) { return beginCreateOrUpdateWithServiceResponseAsync(deviceName, name, resourceGroupName, param...
cdk/cdk
storage/inchi/src/main/java/org/openscience/cdk/graph/invariant/InChINumbersTools.java
InChINumbersTools.auxInfo
static String auxInfo(IAtomContainer container, INCHI_OPTION... options) throws CDKException { InChIGeneratorFactory factory = InChIGeneratorFactory.getInstance(); boolean org = factory.getIgnoreAromaticBonds(); factory.setIgnoreAromaticBonds(true); InChIGenerator gen = factory.getInChIG...
java
static String auxInfo(IAtomContainer container, INCHI_OPTION... options) throws CDKException { InChIGeneratorFactory factory = InChIGeneratorFactory.getInstance(); boolean org = factory.getIgnoreAromaticBonds(); factory.setIgnoreAromaticBonds(true); InChIGenerator gen = factory.getInChIG...
[ "static", "String", "auxInfo", "(", "IAtomContainer", "container", ",", "INCHI_OPTION", "...", "options", ")", "throws", "CDKException", "{", "InChIGeneratorFactory", "factory", "=", "InChIGeneratorFactory", ".", "getInstance", "(", ")", ";", "boolean", "org", "=", ...
Obtain the InChI auxiliary info for the provided structure using using the specified InChI options. @param container the structure to obtain the numbers of @return auxiliary info @throws CDKException the inchi could not be generated
[ "Obtain", "the", "InChI", "auxiliary", "info", "for", "the", "provided", "structure", "using", "using", "the", "specified", "InChI", "options", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/storage/inchi/src/main/java/org/openscience/cdk/graph/invariant/InChINumbersTools.java#L232-L241
train
Returns the auxiliary information for the given molecule.
Create a Java method that does the following: "Returns the auxiliary information for the given molecule.".
Of course, here is the Java code you requested: ```java static String auxInfo(IAtomContainer container, INCHI_OPTION... options) throws CDKException { InChIGeneratorFactory factory = InChIGeneratorFactory.getInstance(); boolean org = factory.getIgnoreAromaticBonds(); factory.setIgnoreAromaticBo...
fuinorg/srcgen4j-commons
src/main/java/org/fuin/srcgen4j/commons/Artifact.java
Artifact.findTargetFor
@Nullable public final Target findTargetFor(@Nullable final String targetPath) { if (targets == null) { return null; } if (targetPath == null) { return null; } for (final Target target : targets) { if (target.matches(targetPath)) {...
java
@Nullable public final Target findTargetFor(@Nullable final String targetPath) { if (targets == null) { return null; } if (targetPath == null) { return null; } for (final Target target : targets) { if (target.matches(targetPath)) {...
[ "@", "Nullable", "public", "final", "Target", "findTargetFor", "(", "@", "Nullable", "final", "String", "targetPath", ")", "{", "if", "(", "targets", "==", "null", ")", "{", "return", "null", ";", "}", "if", "(", "targetPath", "==", "null", ")", "{", "...
Returns the first target that matched the given path based on the defined patterns. Returns null if the argument is <code>null</code>. @param targetPath Path to find. @return Target.
[ "Returns", "the", "first", "target", "that", "matched", "the", "given", "path", "based", "on", "the", "defined", "patterns", ".", "Returns", "null", "if", "the", "argument", "is", "<code", ">", "null<", "/", "code", ">", "." ]
bce26fd3167ea91fb2f3ad3fc9a1836d3d9fb14b
https://github.com/fuinorg/srcgen4j-commons/blob/bce26fd3167ea91fb2f3ad3fc9a1836d3d9fb14b/src/main/java/org/fuin/srcgen4j/commons/Artifact.java#L169-L183
train
Find the target for the given target path.
Create a Java method that does the following: "Find the target for the given target path.".
Of course, here is the Java code you requested: ```java @Nullable public final Target findTargetFor(@Nullable final String targetPath) { if (targets == null) { return null; } if (targetPath == null) { return null; } for (final Target target : ...
jbundle/jbundle
thin/base/db/base/src/main/java/org/jbundle/thin/base/db/mem/base/PTable.java
PTable.remove
public synchronized void remove(FieldTable table) throws DBException { BaseBuffer bufferOld = (BaseBuffer)table.getDataSource(); // same as .getHandle(Constants.DATA_SOURCE_HANDLE); for (int iKeyArea = Constants.MAIN_KEY_AREA; iKeyArea < table.getRecord().getKeyAreaCount() + Constants.MAIN_KEY_AREA;...
java
public synchronized void remove(FieldTable table) throws DBException { BaseBuffer bufferOld = (BaseBuffer)table.getDataSource(); // same as .getHandle(Constants.DATA_SOURCE_HANDLE); for (int iKeyArea = Constants.MAIN_KEY_AREA; iKeyArea < table.getRecord().getKeyAreaCount() + Constants.MAIN_KEY_AREA;...
[ "public", "synchronized", "void", "remove", "(", "FieldTable", "table", ")", "throws", "DBException", "{", "BaseBuffer", "bufferOld", "=", "(", "BaseBuffer", ")", "table", ".", "getDataSource", "(", ")", ";", "// same as .getHandle(Constants.DATA_SOURCE_HANDLE);", "fo...
Delete this record. @param table The table. @exception DBException File exception.
[ "Delete", "this", "record", "." ]
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/db/base/src/main/java/org/jbundle/thin/base/db/mem/base/PTable.java#L362-L373
train
Remove this record from this table.
Create a Java method that does the following: "Remove this record from this table.".
Of course, here is the Java code you requested: ```java public synchronized void remove(FieldTable table) throws DBException { BaseBuffer bufferOld = (BaseBuffer)table.getDataSource(); // same as .getHandle(Constants.DATA_SOURCE_HANDLE); for (int iKeyArea = Constants.MAIN_KEY_AREA; iKeyArea < table...
FXMisc/RichTextFX
richtextfx/src/main/java/org/fxmisc/richtext/model/ReadOnlyStyledDocument.java
ReadOnlyStyledDocument.from
public static <PS, SEG, S> ReadOnlyStyledDocument<PS, SEG, S> from(StyledDocument<PS, SEG, S> doc) { if(doc instanceof ReadOnlyStyledDocument) { return (ReadOnlyStyledDocument<PS, SEG, S>) doc; } else { return new ReadOnlyStyledDocument<>(doc.getParagraphs()); } }
java
public static <PS, SEG, S> ReadOnlyStyledDocument<PS, SEG, S> from(StyledDocument<PS, SEG, S> doc) { if(doc instanceof ReadOnlyStyledDocument) { return (ReadOnlyStyledDocument<PS, SEG, S>) doc; } else { return new ReadOnlyStyledDocument<>(doc.getParagraphs()); } }
[ "public", "static", "<", "PS", ",", "SEG", ",", "S", ">", "ReadOnlyStyledDocument", "<", "PS", ",", "SEG", ",", "S", ">", "from", "(", "StyledDocument", "<", "PS", ",", "SEG", ",", "S", ">", "doc", ")", "{", "if", "(", "doc", "instanceof", "ReadOnl...
Creates a {@link ReadOnlyStyledDocument} from the given {@link StyledDocument}. @param <PS> The type of the paragraph style. @param <SEG> The type of the segments in the paragraph (e.g. {@link String}). @param <S> The type of the style of individual segments.
[ "Creates", "a", "{", "@link", "ReadOnlyStyledDocument", "}", "from", "the", "given", "{", "@link", "StyledDocument", "}", "." ]
bc7cab6a637855e0f37d9b9c12a9172c31545f0b
https://github.com/FXMisc/RichTextFX/blob/bc7cab6a637855e0f37d9b9c12a9172c31545f0b/richtextfx/src/main/java/org/fxmisc/richtext/model/ReadOnlyStyledDocument.java#L142-L148
train
Gets a ReadOnlyStyledDocument from a given document.
Create a Java method that does the following: "Gets a ReadOnlyStyledDocument from a given document.".
Of course, here is the Java code you requested: ```java public static <PS, SEG, S> ReadOnlyStyledDocument<PS, SEG, S> from(StyledDocument<PS, SEG, S> doc) { if(doc instanceof ReadOnlyStyledDocument) { return (ReadOnlyStyledDocument<PS, SEG, S>) doc; } else { return new ReadOnlyS...
cojen/Cojen
src/main/java/org/cojen/util/ClassInjector.java
ClassInjector.create
public static ClassInjector create(String prefix, ClassLoader parent) { return create(prefix, parent, false); }
java
public static ClassInjector create(String prefix, ClassLoader parent) { return create(prefix, parent, false); }
[ "public", "static", "ClassInjector", "create", "(", "String", "prefix", ",", "ClassLoader", "parent", ")", "{", "return", "create", "(", "prefix", ",", "parent", ",", "false", ")", ";", "}" ]
Create a ClassInjector for defining one class. The prefix is optional, which is used as the start of the auto-generated class name. If the parent ClassLoader is not specified, it will default to the ClassLoader of the ClassInjector class. <p> If the parent loader was used for loading injected classes, the new class wil...
[ "Create", "a", "ClassInjector", "for", "defining", "one", "class", ".", "The", "prefix", "is", "optional", "which", "is", "used", "as", "the", "start", "of", "the", "auto", "-", "generated", "class", "name", ".", "If", "the", "parent", "ClassLoader", "is",...
ddee9a0fde83870b97e0ed04c58270aa665f3a62
https://github.com/cojen/Cojen/blob/ddee9a0fde83870b97e0ed04c58270aa665f3a62/src/main/java/org/cojen/util/ClassInjector.java#L89-L91
train
Create a class injector with the specified prefix and parent class loader.
Create a Java method that does the following: "Create a class injector with the specified prefix and parent class loader.".
Of course, here is the Java code you requested: ```java public static ClassInjector create(String prefix, ClassLoader parent) { return create(prefix, parent, false); } ``` Hope this helps!
OpenLiberty/open-liberty
dev/com.ibm.ws.security.credentials.wscred/src/com/ibm/ws/security/credentials/wscred/internal/WSCredentialProvider.java
WSCredentialProvider.getUniqueGroupAccessIds
private List<String> getUniqueGroupAccessIds(UserRegistry userRegistry, String realm, String uniqueName) throws EntryNotFoundException, RegistryException { List<String> uniqueGroupAccessIds = new ArrayList<String>(); List<String> uniqueGroupIds = userRegi...
java
private List<String> getUniqueGroupAccessIds(UserRegistry userRegistry, String realm, String uniqueName) throws EntryNotFoundException, RegistryException { List<String> uniqueGroupAccessIds = new ArrayList<String>(); List<String> uniqueGroupIds = userRegi...
[ "private", "List", "<", "String", ">", "getUniqueGroupAccessIds", "(", "UserRegistry", "userRegistry", ",", "String", "realm", ",", "String", "uniqueName", ")", "throws", "EntryNotFoundException", ",", "RegistryException", "{", "List", "<", "String", ">", "uniqueGro...
Get a list of all of the groups the user belongs to, formated as group access IDs. @param userRegistry @param realm @param uniqueName @return A list of all of the uniqueGroupAccessIds the user belongs to @throws EntryNotFoundException @throws RegistryException
[ "Get", "a", "list", "of", "all", "of", "the", "groups", "the", "user", "belongs", "to", "formated", "as", "group", "access", "IDs", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.credentials.wscred/src/com/ibm/ws/security/credentials/wscred/internal/WSCredentialProvider.java#L253-L263
train
Get the list of unique group access ids for a user.
Create a Java method that does the following: "Get the list of unique group access ids for a user.".
Of course, here is the Java code you requested: ```java private List<String> getUniqueGroupAccessIds(UserRegistry userRegistry, String realm, String uniqueName) throws EntryNotFoundException, RegistryException { List<String> uniqueGroupAccessIds = new ArrayList<...
pip-services3-java/pip-services3-commons-java
src/org/pipservices3/commons/random/RandomDateTime.java
RandomDateTime.nextDate
public static ZonedDateTime nextDate(int minYear, int maxYear) { int currentYear = ZonedDateTime.now().getYear(); minYear = minYear == 0 ? currentYear - RandomInteger.nextInteger(10) : minYear; maxYear = maxYear == 0 ? currentYear : maxYear; int year = RandomInteger.nextInteger(minYear, maxYear); int month =...
java
public static ZonedDateTime nextDate(int minYear, int maxYear) { int currentYear = ZonedDateTime.now().getYear(); minYear = minYear == 0 ? currentYear - RandomInteger.nextInteger(10) : minYear; maxYear = maxYear == 0 ? currentYear : maxYear; int year = RandomInteger.nextInteger(minYear, maxYear); int month =...
[ "public", "static", "ZonedDateTime", "nextDate", "(", "int", "minYear", ",", "int", "maxYear", ")", "{", "int", "currentYear", "=", "ZonedDateTime", ".", "now", "(", ")", ".", "getYear", "(", ")", ";", "minYear", "=", "minYear", "==", "0", "?", "currentY...
Generates a random ZonedDateTime in the range ['minYear', 'maxYear']. This method generate dates without time (or time set to 00:00:00) @param minYear (optional) minimum range value @param maxYear max range value @return a random ZonedDateTime value.
[ "Generates", "a", "random", "ZonedDateTime", "in", "the", "range", "[", "minYear", "maxYear", "]", ".", "This", "method", "generate", "dates", "without", "time", "(", "or", "time", "set", "to", "00", ":", "00", ":", "00", ")" ]
a8a0c3e5ec58f0663c295aa855c6b3afad2af86a
https://github.com/pip-services3-java/pip-services3-commons-java/blob/a8a0c3e5ec58f0663c295aa855c6b3afad2af86a/src/org/pipservices3/commons/random/RandomDateTime.java#L25-L39
train
Returns a random date in the given range.
Create a Java method that does the following: "Returns a random date in the given range.".
Of course, here is the Java code you requested: ```java public static ZonedDateTime nextDate(int minYear, int maxYear) { int currentYear = ZonedDateTime.now().getYear(); minYear = minYear == 0 ? currentYear - RandomInteger.nextInteger(10) : minYear; maxYear = maxYear == 0 ? currentYear : maxYear; int year = R...
performancecopilot/parfait
parfait-agent/src/main/java/io/pcp/parfait/ParfaitAgent.java
ParfaitAgent.parseAllSpecifications
public static List<Specification> parseAllSpecifications() { List<Specification> allMonitorables = new ArrayList<>(); try { File[] files = new File(PATHNAME).listFiles(); if (files != null) { for (File file : files) { allMonitorables.addAll(par...
java
public static List<Specification> parseAllSpecifications() { List<Specification> allMonitorables = new ArrayList<>(); try { File[] files = new File(PATHNAME).listFiles(); if (files != null) { for (File file : files) { allMonitorables.addAll(par...
[ "public", "static", "List", "<", "Specification", ">", "parseAllSpecifications", "(", ")", "{", "List", "<", "Specification", ">", "allMonitorables", "=", "new", "ArrayList", "<>", "(", ")", ";", "try", "{", "File", "[", "]", "files", "=", "new", "File", ...
parse all configuration files from the parfait directory
[ "parse", "all", "configuration", "files", "from", "the", "parfait", "directory" ]
33ed3aaa96ee3e0ab4c45791a7bd3e5cd443e94b
https://github.com/performancecopilot/parfait/blob/33ed3aaa96ee3e0ab4c45791a7bd3e5cd443e94b/parfait-agent/src/main/java/io/pcp/parfait/ParfaitAgent.java#L67-L84
train
Parses all the specification files in the pathname.
Create a Java method that does the following: "Parses all the specification files in the pathname.".
Of course, here is the Java code you requested: ```java public static List<Specification> parseAllSpecifications() { List<Specification> allMonitorables = new ArrayList<>(); try { File[] files = new File(PATHNAME).listFiles(); if (files != null) { for (File file ...
OpenLiberty/open-liberty
dev/com.ibm.ws.logging.core/src/com/ibm/ws/logging/internal/WsLogger.java
WsLogger.entering
@Override public void entering(String sourceClass, String sourceMethod, Object param1) { if (isLoggable(Level.FINER)) { Object params[] = { param1 }; logp(Level.FINER, sourceClass, sourceMethod, "ENTRY {0}", params); } }
java
@Override public void entering(String sourceClass, String sourceMethod, Object param1) { if (isLoggable(Level.FINER)) { Object params[] = { param1 }; logp(Level.FINER, sourceClass, sourceMethod, "ENTRY {0}", params); } }
[ "@", "Override", "public", "void", "entering", "(", "String", "sourceClass", ",", "String", "sourceMethod", ",", "Object", "param1", ")", "{", "if", "(", "isLoggable", "(", "Level", ".", "FINER", ")", ")", "{", "Object", "params", "[", "]", "=", "{", "...
/* @see java.util.logging.Logger#entering(java.lang.String, java.lang.String, java.lang.Object)
[ "/", "*" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging.core/src/com/ibm/ws/logging/internal/WsLogger.java#L422-L428
train
This method is invoked by the application to log a CRA - 203 entry.
Create a Java method that does the following: "This method is invoked by the application to log a CRA - 203 entry.".
Of course, here is the Java code you requested: ```java @Override public void entering(String sourceClass, String sourceMethod, Object param1) { if (isLoggable(Level.FINER)) { Object params[] = { param1 }; logp(Level.FINER, sourceClass, sourceMethod, "ENTRY {0}", params); } ...
aeshell/aesh-readline
readline/src/main/java/org/aesh/readline/util/Parser.java
Parser.formatDisplayListTerminalString
public static String formatDisplayListTerminalString(List<TerminalString> displayList, int termHeight, int termWidth) { if (displayList == null || displayList.size() < 1) return ""; // make sure that termWidth is > 0 if (termWidth < 1) termWidth = 80; // setting it to def...
java
public static String formatDisplayListTerminalString(List<TerminalString> displayList, int termHeight, int termWidth) { if (displayList == null || displayList.size() < 1) return ""; // make sure that termWidth is > 0 if (termWidth < 1) termWidth = 80; // setting it to def...
[ "public", "static", "String", "formatDisplayListTerminalString", "(", "List", "<", "TerminalString", ">", "displayList", ",", "int", "termHeight", ",", "int", "termWidth", ")", "{", "if", "(", "displayList", "==", "null", "||", "displayList", ".", "size", "(", ...
Format completions so that they look similar to GNU Readline @param displayList to format @param termHeight max height @param termWidth max width @return formatted string to be outputted
[ "Format", "completions", "so", "that", "they", "look", "similar", "to", "GNU", "Readline" ]
3d7258f6490a422658ec85c8457514390c03232d
https://github.com/aeshell/aesh-readline/blob/3d7258f6490a422658ec85c8457514390c03232d/readline/src/main/java/org/aesh/readline/util/Parser.java#L134-L187
train
Format display list terminal string.
Create a Java method that does the following: "Format display list terminal string.".
Of course, here is the Java code you requested: ```java public static String formatDisplayListTerminalString(List<TerminalString> displayList, int termHeight, int termWidth) { if (displayList == null || displayList.size() < 1) return ""; // make sure that termWidth is > 0 if (termWi...
tango-controls/JTango
common/src/main/java/fr/esrf/TangoApi/IORdump.java
IORdump.getIor
public static String getIor(String filename) throws FileNotFoundException, SecurityException, IOException { // for static call we use an utility class return IORDumpUtil.getIor(filename); }
java
public static String getIor(String filename) throws FileNotFoundException, SecurityException, IOException { // for static call we use an utility class return IORDumpUtil.getIor(filename); }
[ "public", "static", "String", "getIor", "(", "String", "filename", ")", "throws", "FileNotFoundException", ",", "SecurityException", ",", "IOException", "{", "// for static call we use an utility class", "return", "IORDumpUtil", ".", "getIor", "(", "filename", ")", ";",...
===============================================================
[ "===============================================================" ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/common/src/main/java/fr/esrf/TangoApi/IORdump.java#L159-L162
train
Get the IOR for a file
Create a Java method that does the following: "Get the IOR for a file".
Of course, here is the Java code you requested: ```java public static String getIor(String filename) throws FileNotFoundException, SecurityException, IOException { // for static call we use an utility class return IORDumpUtil.getIor(filename); } ``` Hope this helps!
aws/aws-sdk-java
aws-java-sdk-ses/src/main/java/com/amazonaws/services/simpleemail/model/BulkEmailDestination.java
BulkEmailDestination.withReplacementTags
public BulkEmailDestination withReplacementTags(MessageTag... replacementTags) { if (this.replacementTags == null) { setReplacementTags(new com.amazonaws.internal.SdkInternalList<MessageTag>(replacementTags.length)); } for (MessageTag ele : replacementTags) { this.replace...
java
public BulkEmailDestination withReplacementTags(MessageTag... replacementTags) { if (this.replacementTags == null) { setReplacementTags(new com.amazonaws.internal.SdkInternalList<MessageTag>(replacementTags.length)); } for (MessageTag ele : replacementTags) { this.replace...
[ "public", "BulkEmailDestination", "withReplacementTags", "(", "MessageTag", "...", "replacementTags", ")", "{", "if", "(", "this", ".", "replacementTags", "==", "null", ")", "{", "setReplacementTags", "(", "new", "com", ".", "amazonaws", ".", "internal", ".", "S...
<p> A list of tags, in the form of name/value pairs, to apply to an email that you send using <code>SendBulkTemplatedEmail</code>. Tags correspond to characteristics of the email that you define, so that you can publish email sending events. </p> <p> <b>NOTE:</b> This method appends the values to the existing list (if ...
[ "<p", ">", "A", "list", "of", "tags", "in", "the", "form", "of", "name", "/", "value", "pairs", "to", "apply", "to", "an", "email", "that", "you", "send", "using", "<code", ">", "SendBulkTemplatedEmail<", "/", "code", ">", ".", "Tags", "correspond", "t...
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-ses/src/main/java/com/amazonaws/services/simpleemail/model/BulkEmailDestination.java#L133-L141
train
Sets the replacementTags value for this BulkEmailDestination.
Create a Java method that does the following: "Sets the replacementTags value for this BulkEmailDestination.".
Of course, here is the Java code you requested: ```java public BulkEmailDestination withReplacementTags(MessageTag... replacementTags) { if (this.replacementTags == null) { setReplacementTags(new com.amazonaws.internal.SdkInternalList<MessageTag>(replacementTags.length)); } for (Mes...
groupon/monsoon
history/src/main/java/com/groupon/lex/metrics/history/xdr/support/TmpFileBasedColumnMajorTSData.java
Builder.fixBacklog
private void fixBacklog() throws IOException { try { writers.values().parallelStream() .forEach(groupWriter -> { try { groupWriter.fixBacklog(timestamps.size()); } catch (IOExcepti...
java
private void fixBacklog() throws IOException { try { writers.values().parallelStream() .forEach(groupWriter -> { try { groupWriter.fixBacklog(timestamps.size()); } catch (IOExcepti...
[ "private", "void", "fixBacklog", "(", ")", "throws", "IOException", "{", "try", "{", "writers", ".", "values", "(", ")", ".", "parallelStream", "(", ")", ".", "forEach", "(", "groupWriter", "->", "{", "try", "{", "groupWriter", ".", "fixBacklog", "(", "t...
Pad all groups with empty maps, to ensure it's the same size as timestamps list. We want to keep all the Group instances to have the same number of maps as the timestamps list, so we can zip the two together.
[ "Pad", "all", "groups", "with", "empty", "maps", "to", "ensure", "it", "s", "the", "same", "size", "as", "timestamps", "list", "." ]
eb68d72ba4c01fe018dc981097dbee033908f5c7
https://github.com/groupon/monsoon/blob/eb68d72ba4c01fe018dc981097dbee033908f5c7/history/src/main/java/com/groupon/lex/metrics/history/xdr/support/TmpFileBasedColumnMajorTSData.java#L114-L127
train
Fixes the backlog.
Create a Java method that does the following: "Fixes the backlog.".
Of course, here is the Java code you requested: ```java private void fixBacklog() throws IOException { try { writers.values().parallelStream() .forEach(groupWriter -> { try { groupWriter.fixBacklog(timestamp...
OpenLiberty/open-liberty
dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/values/CookieSecureData.java
CookieSecureData.set
@Override @SuppressWarnings("unused") public boolean set(HttpCookie cookie, byte[] attribValue) { // The mere presence of the SECURE attribute means that // this attrib is set cookie.setSecure(true); if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { ...
java
@Override @SuppressWarnings("unused") public boolean set(HttpCookie cookie, byte[] attribValue) { // The mere presence of the SECURE attribute means that // this attrib is set cookie.setSecure(true); if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { ...
[ "@", "Override", "@", "SuppressWarnings", "(", "\"unused\"", ")", "public", "boolean", "set", "(", "HttpCookie", "cookie", ",", "byte", "[", "]", "attribValue", ")", "{", "// The mere presence of the SECURE attribute means that", "// this attrib is set", "cookie", ".", ...
/* @see com.ibm.ws.http.channel.internal.values.CookieData#set(com.ibm.websphere .http.HttpCookie, byte[])
[ "/", "*" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/values/CookieSecureData.java#L41-L52
train
Set the Cookie Secure attribute.
Create a Java method that does the following: "Set the Cookie Secure attribute.".
Of course, here is the Java code you requested: ```java @Override @SuppressWarnings("unused") public boolean set(HttpCookie cookie, byte[] attribValue) { // The mere presence of the SECURE attribute means that // this attrib is set cookie.setSecure(true); if (TraceComponent.isA...
h2oai/h2o-3
h2o-core/src/main/java/water/nbhm/NonBlockingIdentityHashMap.java
NonBlockingIdentityHashMap.print
private final void print( Object[] kvs ) { for( int i=0; i<len(kvs); i++ ) { Object K = key(kvs,i); if( K != null ) { String KS = (K == TOMBSTONE) ? "XXX" : K.toString(); Object V = val(kvs,i); Object U = Prime.unbox(V); String p = (V==U) ? "" : "prime_"; String U...
java
private final void print( Object[] kvs ) { for( int i=0; i<len(kvs); i++ ) { Object K = key(kvs,i); if( K != null ) { String KS = (K == TOMBSTONE) ? "XXX" : K.toString(); Object V = val(kvs,i); Object U = Prime.unbox(V); String p = (V==U) ? "" : "prime_"; String U...
[ "private", "final", "void", "print", "(", "Object", "[", "]", "kvs", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "len", "(", "kvs", ")", ";", "i", "++", ")", "{", "Object", "K", "=", "key", "(", "kvs", ",", "i", ")", ";", "...
print the entire state of the table
[ "print", "the", "entire", "state", "of", "the", "table" ]
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/nbhm/NonBlockingIdentityHashMap.java#L203-L220
train
Print the array of key - value pairs.
Create a Java method that does the following: "Print the array of key - value pairs.".
Of course, here is the Java code you requested: ```java private final void print( Object[] kvs ) { for( int i=0; i<len(kvs); i++ ) { Object K = key(kvs,i); if( K != null ) { String KS = (K == TOMBSTONE) ? "XXX" : K.toString(); Object V = val(kvs,i); Object U = Prime.unbox(V); ...
boncey/Flickr4Java
src/main/java/com/flickr4java/flickr/people/PeopleInterface.java
PeopleInterface.getLimits
public User getLimits() throws FlickrException { Map<String, Object> parameters = new HashMap<String, Object>(); parameters.put("method", METHOD_GET_LIMITS); Response response = transportAPI.get(transportAPI.getPath(), parameters, apiKey, sharedSecret); if (response.isError()) { ...
java
public User getLimits() throws FlickrException { Map<String, Object> parameters = new HashMap<String, Object>(); parameters.put("method", METHOD_GET_LIMITS); Response response = transportAPI.get(transportAPI.getPath(), parameters, apiKey, sharedSecret); if (response.isError()) { ...
[ "public", "User", "getLimits", "(", ")", "throws", "FlickrException", "{", "Map", "<", "String", ",", "Object", ">", "parameters", "=", "new", "HashMap", "<", "String", ",", "Object", ">", "(", ")", ";", "parameters", ".", "put", "(", "\"method\"", ",", ...
Get's the user's current upload limits, User object only contains user_id @return Media Limits
[ "Get", "s", "the", "user", "s", "current", "upload", "limits", "User", "object", "only", "contains", "user_id" ]
f66987ba0e360e5fb7730efbbb8c51f3d978fc25
https://github.com/boncey/Flickr4Java/blob/f66987ba0e360e5fb7730efbbb8c51f3d978fc25/src/main/java/com/flickr4java/flickr/people/PeopleInterface.java#L552-L580
train
Get the limits for a user.
Create a Java method that does the following: "Get the limits for a user.".
Of course, here is the Java code you requested: ```java public User getLimits() throws FlickrException { Map<String, Object> parameters = new HashMap<String, Object>(); parameters.put("method", METHOD_GET_LIMITS); Response response = transportAPI.get(transportAPI.getPath(), parameters, api...
deeplearning4j/deeplearning4j
deeplearning4j/deeplearning4j-nearestneighbors-parent/nearestneighbor-core/src/main/java/org/deeplearning4j/clustering/kmeans/KMeansClustering.java
KMeansClustering.setup
public static KMeansClustering setup(int clusterCount, int maxIterationCount, Distance distanceFunction) { return setup(clusterCount, maxIterationCount, distanceFunction, false); }
java
public static KMeansClustering setup(int clusterCount, int maxIterationCount, Distance distanceFunction) { return setup(clusterCount, maxIterationCount, distanceFunction, false); }
[ "public", "static", "KMeansClustering", "setup", "(", "int", "clusterCount", ",", "int", "maxIterationCount", ",", "Distance", "distanceFunction", ")", "{", "return", "setup", "(", "clusterCount", ",", "maxIterationCount", ",", "distanceFunction", ",", "false", ")",...
Setup a kmeans instance @param clusterCount the number of clusters @param maxIterationCount the max number of iterations to run kmeans @param distanceFunction the distance function to use for grouping @return
[ "Setup", "a", "kmeans", "instance" ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nearestneighbors-parent/nearestneighbor-core/src/main/java/org/deeplearning4j/clustering/kmeans/KMeansClustering.java#L84-L86
train
Creates a new KMeansClustering instance with the specified parameters.
Create a Java method that does the following: "Creates a new KMeansClustering instance with the specified parameters.".
Of course, here is the Java code you requested: ```java public static KMeansClustering setup(int clusterCount, int maxIterationCount, Distance distanceFunction) { return setup(clusterCount, maxIterationCount, distanceFunction, false); } ``` Hope this helps!
aws/aws-sdk-java
aws-java-sdk-rds/src/main/java/com/amazonaws/services/rds/model/DescribeDBInstancesResult.java
DescribeDBInstancesResult.withDBInstances
public DescribeDBInstancesResult withDBInstances(DBInstance... dBInstances) { if (this.dBInstances == null) { setDBInstances(new com.amazonaws.internal.SdkInternalList<DBInstance>(dBInstances.length)); } for (DBInstance ele : dBInstances) { this.dBInstances.add(ele); ...
java
public DescribeDBInstancesResult withDBInstances(DBInstance... dBInstances) { if (this.dBInstances == null) { setDBInstances(new com.amazonaws.internal.SdkInternalList<DBInstance>(dBInstances.length)); } for (DBInstance ele : dBInstances) { this.dBInstances.add(ele); ...
[ "public", "DescribeDBInstancesResult", "withDBInstances", "(", "DBInstance", "...", "dBInstances", ")", "{", "if", "(", "this", ".", "dBInstances", "==", "null", ")", "{", "setDBInstances", "(", "new", "com", ".", "amazonaws", ".", "internal", ".", "SdkInternalL...
<p> A list of <a>DBInstance</a> instances. </p> <p> <b>NOTE:</b> This method appends the values to the existing list (if any). Use {@link #setDBInstances(java.util.Collection)} or {@link #withDBInstances(java.util.Collection)} if you want to override the existing values. </p> @param dBInstances A list of <a>DBInstance...
[ "<p", ">", "A", "list", "of", "<a", ">", "DBInstance<", "/", "a", ">", "instances", ".", "<", "/", "p", ">", "<p", ">", "<b", ">", "NOTE", ":", "<", "/", "b", ">", "This", "method", "appends", "the", "values", "to", "the", "existing", "list", "...
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-rds/src/main/java/com/amazonaws/services/rds/model/DescribeDBInstancesResult.java#L137-L145
train
Adds the DB Instances to the list of DB Instances.
Create a Java method that does the following: "Adds the DB Instances to the list of DB Instances.".
Of course, here is the Java code you requested: ```java public DescribeDBInstancesResult withDBInstances(DBInstance... dBInstances) { if (this.dBInstances == null) { setDBInstances(new com.amazonaws.internal.SdkInternalList<DBInstance>(dBInstances.length)); } for (DBInstance ele : d...
landawn/AbacusUtil
src/com/landawn/abacus/pool/AbstractPool.java
AbstractPool.evict
protected void evict() { lock.lock(); Map<K, E> removingObjects = null; try { for (Map.Entry<K, E> entry : pool.entrySet()) { if (entry.getValue().activityPrint().isExpired()) { if (removingObjects == null) { removi...
java
protected void evict() { lock.lock(); Map<K, E> removingObjects = null; try { for (Map.Entry<K, E> entry : pool.entrySet()) { if (entry.getValue().activityPrint().isExpired()) { if (removingObjects == null) { removi...
[ "protected", "void", "evict", "(", ")", "{", "lock", ".", "lock", "(", ")", ";", "Map", "<", "K", ",", "E", ">", "removingObjects", "=", "null", ";", "try", "{", "for", "(", "Map", ".", "Entry", "<", "K", ",", "E", ">", "entry", ":", "pool", ...
scan the object pool to find the idle object which inactive time greater than permitted the inactive time for it or it's time out.
[ "scan", "the", "object", "pool", "to", "find", "the", "idle", "object", "which", "inactive", "time", "greater", "than", "permitted", "the", "inactive", "time", "for", "it", "or", "it", "s", "time", "out", "." ]
544b7720175d15e9329f83dd22a8cc5fa4515e12
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/pool/AbstractPool.java#L410-L444
train
Evicts all expired objects from the cache.
Create a Java method that does the following: "Evicts all expired objects from the cache.".
Of course, here is the Java code you requested: ```java protected void evict() { lock.lock(); Map<K, E> removingObjects = null; try { for (Map.Entry<K, E> entry : pool.entrySet()) { if (entry.getValue().activityPrint().isExpired()) { if (r...
xcesco/kripton
kripton-processor/src/main/java/com/abubusoft/kripton/processor/BindDataSourceSubProcessor.java
BindDataSourceSubProcessor.process
@Override public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) { for (TypeElement dataSource : dataSets) { SQLiteDatabaseSchema currentSchema = createDataSource(dataSource); // Analyze beans BEFORE daos, because beans are needed for DAO // definition for (String daoN...
java
@Override public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) { for (TypeElement dataSource : dataSets) { SQLiteDatabaseSchema currentSchema = createDataSource(dataSource); // Analyze beans BEFORE daos, because beans are needed for DAO // definition for (String daoN...
[ "@", "Override", "public", "boolean", "process", "(", "Set", "<", "?", "extends", "TypeElement", ">", "annotations", ",", "RoundEnvironment", "roundEnv", ")", "{", "for", "(", "TypeElement", "dataSource", ":", "dataSets", ")", "{", "SQLiteDatabaseSchema", "curre...
/* (non-Javadoc) @see javax.annotation.processing.AbstractProcessor#process(java.util.Set, javax.annotation.processing.RoundEnvironment)
[ "/", "*", "(", "non", "-", "Javadoc", ")" ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/BindDataSourceSubProcessor.java#L211-L272
train
Process the annotations of the DAO.
Create a Java method that does the following: "Process the annotations of the DAO.".
Of course, here is the Java code you requested: ```java @Override public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) { for (TypeElement dataSource : dataSets) { SQLiteDatabaseSchema currentSchema = createDataSource(dataSource); // Analyze beans BEFORE daos, because bean...
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/widget/editor/DefaultDataEditorWidget.java
DefaultDataEditorWidget.setFilterForm
protected void setFilterForm(FilterForm filterForm) { if (this.filterForm != null) { validationResultsModel.remove(this.filterForm.getFormModel() .getValidationResults()); } this.filterForm = filterForm; if (this.filterForm != null) { validationResultsModel.add(filterForm.getFormModel() .getVa...
java
protected void setFilterForm(FilterForm filterForm) { if (this.filterForm != null) { validationResultsModel.remove(this.filterForm.getFormModel() .getValidationResults()); } this.filterForm = filterForm; if (this.filterForm != null) { validationResultsModel.add(filterForm.getFormModel() .getVa...
[ "protected", "void", "setFilterForm", "(", "FilterForm", "filterForm", ")", "{", "if", "(", "this", ".", "filterForm", "!=", "null", ")", "{", "validationResultsModel", ".", "remove", "(", "this", ".", "filterForm", ".", "getFormModel", "(", ")", ".", "getVa...
Set the form to use as filter. @see DataProvider#supportsFiltering()
[ "Set", "the", "form", "to", "use", "as", "filter", "." ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/widget/editor/DefaultDataEditorWidget.java#L347-L359
train
Sets the filterForm.
Create a Java method that does the following: "Sets the filterForm.".
Of course, here is the Java code you requested: ```java protected void setFilterForm(FilterForm filterForm) { if (this.filterForm != null) { validationResultsModel.remove(this.filterForm.getFormModel() .getValidationResults()); } this.filterForm = filterForm; if (this.filterForm != null) { validat...
stephanenicolas/toothpick
toothpick-runtime/src/main/java/toothpick/ScopeNode.java
ScopeNode.addChild
ScopeNode addChild(ScopeNode child) { if (child == null) { throw new IllegalArgumentException("Child must be non null."); } //this variable is important. It takes a snapshot of the node final ScopeNode parentScope = child.getParentScope(); if (parentScope == this) { return child; } ...
java
ScopeNode addChild(ScopeNode child) { if (child == null) { throw new IllegalArgumentException("Child must be non null."); } //this variable is important. It takes a snapshot of the node final ScopeNode parentScope = child.getParentScope(); if (parentScope == this) { return child; } ...
[ "ScopeNode", "addChild", "(", "ScopeNode", "child", ")", "{", "if", "(", "child", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Child must be non null.\"", ")", ";", "}", "//this variable is important. It takes a snapshot of the node", "fin...
Adds a child {@link ScopeNode} to a {@link ScopeNode}. Children scopes have access to all bindings of their parents, as well as their scoped instances, and can override them. In a lock free way, this method returns the child scope : either {@code child} or a child scope that was already added. @param child the new chi...
[ "Adds", "a", "child", "{", "@link", "ScopeNode", "}", "to", "a", "{", "@link", "ScopeNode", "}", ".", "Children", "scopes", "have", "access", "to", "all", "bindings", "of", "their", "parents", "as", "well", "as", "their", "scoped", "instances", "and", "c...
54476ca9a5fa48809c15a46e43e38db9ed7e1a75
https://github.com/stephanenicolas/toothpick/blob/54476ca9a5fa48809c15a46e43e38db9ed7e1a75/toothpick-runtime/src/main/java/toothpick/ScopeNode.java#L223-L250
train
Add a child node to this scope.
Create a Java method that does the following: "Add a child node to this scope.".
Of course, here is the Java code you requested: ```java ScopeNode addChild(ScopeNode child) { if (child == null) { throw new IllegalArgumentException("Child must be non null."); } //this variable is important. It takes a snapshot of the node final ScopeNode parentScope = child.getParentScope(); ...
dwdyer/watchmaker
examples/src/java/main/org/uncommons/watchmaker/examples/geneticprogramming/Simplification.java
Simplification.apply
public List<Node> apply(List<Node> selectedCandidates, Random rng) { List<Node> evolved = new ArrayList<Node>(selectedCandidates.size()); for (Node node : selectedCandidates) { evolved.add(probability.nextEvent(rng) ? node.simplify() : node); } return evolved; ...
java
public List<Node> apply(List<Node> selectedCandidates, Random rng) { List<Node> evolved = new ArrayList<Node>(selectedCandidates.size()); for (Node node : selectedCandidates) { evolved.add(probability.nextEvent(rng) ? node.simplify() : node); } return evolved; ...
[ "public", "List", "<", "Node", ">", "apply", "(", "List", "<", "Node", ">", "selectedCandidates", ",", "Random", "rng", ")", "{", "List", "<", "Node", ">", "evolved", "=", "new", "ArrayList", "<", "Node", ">", "(", "selectedCandidates", ".", "size", "(...
Simplify the expressions represented by the candidates. Each expression is simplified according to the configured probability. @param selectedCandidates The individuals to evolve. @param rng A source of randomness. @return The (possibly) simplified candidates.
[ "Simplify", "the", "expressions", "represented", "by", "the", "candidates", ".", "Each", "expression", "is", "simplified", "according", "to", "the", "configured", "probability", "." ]
33d942350e6bf7d9a17b9262a4f898158530247e
https://github.com/dwdyer/watchmaker/blob/33d942350e6bf7d9a17b9262a4f898158530247e/examples/src/java/main/org/uncommons/watchmaker/examples/geneticprogramming/Simplification.java#L62-L70
train
Applies the algorithm to a list of candidates.
Create a Java method that does the following: "Applies the algorithm to a list of candidates.".
Of course, here is the Java code you requested: ```java public List<Node> apply(List<Node> selectedCandidates, Random rng) { List<Node> evolved = new ArrayList<Node>(selectedCandidates.size()); for (Node node : selectedCandidates) { evolved.add(probability.nextEvent(rng) ? node....
phax/ph-web
ph-http/src/main/java/com/helger/http/digestauth/DigestAuthServerBuilder.java
DigestAuthServerBuilder.addDomain
@Nonnull public DigestAuthServerBuilder addDomain (@Nonnull final ISimpleURL aURL) { ValueEnforcer.notNull (aURL, "Url"); final String sURL = aURL.getAsStringWithEncodedParameters (); // Check for spaces, as all URLs are concatenated with spaces! if (sURL.indexOf (' ') >= 0) throw new Illegal...
java
@Nonnull public DigestAuthServerBuilder addDomain (@Nonnull final ISimpleURL aURL) { ValueEnforcer.notNull (aURL, "Url"); final String sURL = aURL.getAsStringWithEncodedParameters (); // Check for spaces, as all URLs are concatenated with spaces! if (sURL.indexOf (' ') >= 0) throw new Illegal...
[ "@", "Nonnull", "public", "DigestAuthServerBuilder", "addDomain", "(", "@", "Nonnull", "final", "ISimpleURL", "aURL", ")", "{", "ValueEnforcer", ".", "notNull", "(", "aURL", ",", "\"Url\"", ")", ";", "final", "String", "sURL", "=", "aURL", ".", "getAsStringWit...
Add an URIs, as specified in RFC XURI, that define the protection space. If a URI is an abs_path, it is relative to the canonical root URL of the server being accessed. An absoluteURI in this list may refer to a different server than the one being accessed. The client can use this list to determine the set of URIs for ...
[ "Add", "an", "URIs", "as", "specified", "in", "RFC", "XURI", "that", "define", "the", "protection", "space", ".", "If", "a", "URI", "is", "an", "abs_path", "it", "is", "relative", "to", "the", "canonical", "root", "URL", "of", "the", "server", "being", ...
d445fd25184605b62682c93c9782409acf0ae813
https://github.com/phax/ph-web/blob/d445fd25184605b62682c93c9782409acf0ae813/ph-http/src/main/java/com/helger/http/digestauth/DigestAuthServerBuilder.java#L95-L106
train
Add a domain to the server.
Create a Java method that does the following: "Add a domain to the server.".
Of course, here is the Java code you requested: ```java @Nonnull public DigestAuthServerBuilder addDomain (@Nonnull final ISimpleURL aURL) { ValueEnforcer.notNull (aURL, "Url"); final String sURL = aURL.getAsStringWithEncodedParameters (); // Check for spaces, as all URLs are concatenated with spaces!...
weld/core
impl/src/main/java/org/jboss/weld/bootstrap/events/ContainerLifecycleEventPreloader.java
ContainerLifecycleEventPreloader.preloadContainerLifecycleEvent
@SuppressFBWarnings(value = "RV_RETURN_VALUE_IGNORED_BAD_PRACTICE", justification = "We never need to synchronize with the preloader.") void preloadContainerLifecycleEvent(Class<?> eventRawType, Type... typeParameters) { executor.submit(new PreloadingTask(new ParameterizedTypeImpl(eventRawType, typeParamete...
java
@SuppressFBWarnings(value = "RV_RETURN_VALUE_IGNORED_BAD_PRACTICE", justification = "We never need to synchronize with the preloader.") void preloadContainerLifecycleEvent(Class<?> eventRawType, Type... typeParameters) { executor.submit(new PreloadingTask(new ParameterizedTypeImpl(eventRawType, typeParamete...
[ "@", "SuppressFBWarnings", "(", "value", "=", "\"RV_RETURN_VALUE_IGNORED_BAD_PRACTICE\"", ",", "justification", "=", "\"We never need to synchronize with the preloader.\"", ")", "void", "preloadContainerLifecycleEvent", "(", "Class", "<", "?", ">", "eventRawType", ",", "Type"...
In multi-threaded environment we often cannot leverage multiple core fully in bootstrap because the deployer threads are often blocked by the reflection API or waiting to get a classloader lock. While waiting for classes to be loaded or reflection metadata to be obtained, we can make use of the idle CPU cores and start...
[ "In", "multi", "-", "threaded", "environment", "we", "often", "cannot", "leverage", "multiple", "core", "fully", "in", "bootstrap", "because", "the", "deployer", "threads", "are", "often", "blocked", "by", "the", "reflection", "API", "or", "waiting", "to", "ge...
567a2eaf95b168597d23a56be89bf05a7834b2aa
https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/bootstrap/events/ContainerLifecycleEventPreloader.java#L70-L73
train
Preload container lifecycle event.
Create a Java method that does the following: "Preload container lifecycle event.".
Of course, here is the Java code you requested: ```java @SuppressFBWarnings(value = "RV_RETURN_VALUE_IGNORED_BAD_PRACTICE", justification = "We never need to synchronize with the preloader.") void preloadContainerLifecycleEvent(Class<?> eventRawType, Type... typeParameters) { executor.submit(new Preloading...
netty/netty
codec/src/main/java/io/netty/handler/codec/serialization/ClassResolvers.java
ClassResolvers.softCachingResolver
public static ClassResolver softCachingResolver(ClassLoader classLoader) { return new CachingClassResolver( new ClassLoaderClassResolver(defaultClassLoader(classLoader)), new SoftReferenceMap<String, Class<?>>(new HashMap<String, Reference<Class<?>>>())); }
java
public static ClassResolver softCachingResolver(ClassLoader classLoader) { return new CachingClassResolver( new ClassLoaderClassResolver(defaultClassLoader(classLoader)), new SoftReferenceMap<String, Class<?>>(new HashMap<String, Reference<Class<?>>>())); }
[ "public", "static", "ClassResolver", "softCachingResolver", "(", "ClassLoader", "classLoader", ")", "{", "return", "new", "CachingClassResolver", "(", "new", "ClassLoaderClassResolver", "(", "defaultClassLoader", "(", "classLoader", ")", ")", ",", "new", "SoftReferenceM...
aggressive non-concurrent cache good for non-shared cache, when we're not worried about class unloading @param classLoader - specific classLoader to use, or null if you want to revert to default @return new instance of class resolver
[ "aggressive", "non", "-", "concurrent", "cache", "good", "for", "non", "-", "shared", "cache", "when", "we", "re", "not", "worried", "about", "class", "unloading" ]
ba06eafa1c1824bd154f1a380019e7ea2edf3c4c
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec/src/main/java/io/netty/handler/codec/serialization/ClassResolvers.java#L54-L58
train
Creates a class resolver that uses the default classloader.
Create a Java method that does the following: "Creates a class resolver that uses the default classloader.".
Of course, here is the Java code you requested: ```java public static ClassResolver softCachingResolver(ClassLoader classLoader) { return new CachingClassResolver( new ClassLoaderClassResolver(defaultClassLoader(classLoader)), new SoftReferenceMap<String, Class<?>>(new HashMap<S...
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/alg/distort/mls/ImageDeformPointMLS_F32.java
ImageDeformPointMLS_F32.fixateUndistorted
public void fixateUndistorted() { if( controls.size() < 2 ) throw new RuntimeException("Not enough control points specified. Found "+controls.size()); for (int row = 0; row < gridRows; row++) { for (int col = 0; col < gridCols; col++) { Cache cache = getGrid(row,col); cache.weights.resize(controls.si...
java
public void fixateUndistorted() { if( controls.size() < 2 ) throw new RuntimeException("Not enough control points specified. Found "+controls.size()); for (int row = 0; row < gridRows; row++) { for (int col = 0; col < gridCols; col++) { Cache cache = getGrid(row,col); cache.weights.resize(controls.si...
[ "public", "void", "fixateUndistorted", "(", ")", "{", "if", "(", "controls", ".", "size", "(", ")", "<", "2", ")", "throw", "new", "RuntimeException", "(", "\"Not enough control points specified. Found \"", "+", "controls", ".", "size", "(", ")", ")", ";", ...
Precompute the portion of the equation which only concerns the undistorted location of each point on the grid even the current undistorted location of each control point.
[ "Precompute", "the", "portion", "of", "the", "equation", "which", "only", "concerns", "the", "undistorted", "location", "of", "each", "point", "on", "the", "grid", "even", "the", "current", "undistorted", "location", "of", "each", "control", "point", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/distort/mls/ImageDeformPointMLS_F32.java#L185-L203
train
Fixes the undistorted control points.
Create a Java method that does the following: "Fixes the undistorted control points.".
Of course, here is the Java code you requested: ```java public void fixateUndistorted() { if( controls.size() < 2 ) throw new RuntimeException("Not enough control points specified. Found "+controls.size()); for (int row = 0; row < gridRows; row++) { for (int col = 0; col < gridCols; col++) { Cache cache...
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/GVRVertexBuffer.java
GVRVertexBuffer.setIntArray
public void setIntArray(String attributeName, int[] data, int stride, int offset) { if (!NativeVertexBuffer.setIntArray(getNative(), attributeName, data, stride, offset)) { throw new IllegalArgumentException("Attribute name " + attributeName + " cannot be updated"); } }
java
public void setIntArray(String attributeName, int[] data, int stride, int offset) { if (!NativeVertexBuffer.setIntArray(getNative(), attributeName, data, stride, offset)) { throw new IllegalArgumentException("Attribute name " + attributeName + " cannot be updated"); } }
[ "public", "void", "setIntArray", "(", "String", "attributeName", ",", "int", "[", "]", "data", ",", "int", "stride", ",", "int", "offset", ")", "{", "if", "(", "!", "NativeVertexBuffer", ".", "setIntArray", "(", "getNative", "(", ")", ",", "attributeName",...
Updates a vertex attribute from an integer array. All of the entries of the input integer array are copied into the storage for the named vertex attribute. Other vertex attributes are not affected. The attribute name must be one of the attributes named in the descriptor passed to the constructor. <p> All vertex attribu...
[ "Updates", "a", "vertex", "attribute", "from", "an", "integer", "array", ".", "All", "of", "the", "entries", "of", "the", "input", "integer", "array", "are", "copied", "into", "the", "storage", "for", "the", "named", "vertex", "attribute", ".", "Other", "v...
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRVertexBuffer.java#L285-L291
train
Sets an int array attribute.
Create a Java method that does the following: "Sets an int array attribute.".
Of course, here is the Java code you requested: ```java public void setIntArray(String attributeName, int[] data, int stride, int offset) { if (!NativeVertexBuffer.setIntArray(getNative(), attributeName, data, stride, offset)) { throw new IllegalArgumentException("Attribute name " + att...
liferay/com-liferay-commerce
commerce-discount-api/src/main/java/com/liferay/commerce/discount/service/persistence/CommerceDiscountUtil.java
CommerceDiscountUtil.fetchByGroupId_Last
public static CommerceDiscount fetchByGroupId_Last(long groupId, OrderByComparator<CommerceDiscount> orderByComparator) { return getPersistence().fetchByGroupId_Last(groupId, orderByComparator); }
java
public static CommerceDiscount fetchByGroupId_Last(long groupId, OrderByComparator<CommerceDiscount> orderByComparator) { return getPersistence().fetchByGroupId_Last(groupId, orderByComparator); }
[ "public", "static", "CommerceDiscount", "fetchByGroupId_Last", "(", "long", "groupId", ",", "OrderByComparator", "<", "CommerceDiscount", ">", "orderByComparator", ")", "{", "return", "getPersistence", "(", ")", ".", "fetchByGroupId_Last", "(", "groupId", ",", "orderB...
Returns the last commerce discount in the ordered set where groupId = &#63;. @param groupId the group ID @param orderByComparator the comparator to order the set by (optionally <code>null</code>) @return the last matching commerce discount, or <code>null</code> if a matching commerce discount could not be found
[ "Returns", "the", "last", "commerce", "discount", "in", "the", "ordered", "set", "where", "groupId", "=", "&#63", ";", "." ]
9e54362d7f59531fc684016ba49ee7cdc3a2f22b
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-discount-api/src/main/java/com/liferay/commerce/discount/service/persistence/CommerceDiscountUtil.java#L622-L625
train
Returns the last commerce discount in the ordered set where groupId = &#63 ;.
Create a Java method that does the following: "Returns the last commerce discount in the ordered set where groupId = &#63 ;.".
Of course, here is the Java code you requested: ```java public static CommerceDiscount fetchByGroupId_Last(long groupId, OrderByComparator<CommerceDiscount> orderByComparator) { return getPersistence().fetchByGroupId_Last(groupId, orderByComparator); } ``` Hope this helps!
nextreports/nextreports-engine
src/ro/nextreports/engine/util/ReportUtil.java
ReportUtil.getForReportLayout
private static ReportLayout getForReportLayout(Connection con, ReportLayout layout, ParametersBean pBean) throws Exception { ReportLayout convertedLayout = ObjectCloner.silenceDeepCopy(layout); List<Band> bands = convertedLayout.getDocumentBands(); for (Band band : bands) { for (int i = 0, rows = band.getRowC...
java
private static ReportLayout getForReportLayout(Connection con, ReportLayout layout, ParametersBean pBean) throws Exception { ReportLayout convertedLayout = ObjectCloner.silenceDeepCopy(layout); List<Band> bands = convertedLayout.getDocumentBands(); for (Band band : bands) { for (int i = 0, rows = band.getRowC...
[ "private", "static", "ReportLayout", "getForReportLayout", "(", "Connection", "con", ",", "ReportLayout", "layout", ",", "ParametersBean", "pBean", ")", "throws", "Exception", "{", "ReportLayout", "convertedLayout", "=", "ObjectCloner", ".", "silenceDeepCopy", "(", "l...
If a report layout contains a ForReportBandElement we must replace this element with more ReportBandElements This means inserting n-1 new columns, where n is the number of values return by sql inside ForReportBandElement A ForReportBandElement is interpreted only at first appearance Column name from sql inside ForRepo...
[ "If", "a", "report", "layout", "contains", "a", "ForReportBandElement", "we", "must", "replace", "this", "element", "with", "more", "ReportBandElements", "This", "means", "inserting", "n", "-", "1", "new", "columns", "where", "n", "is", "the", "number", "of", ...
a847575a9298b5fce63b88961190c5b83ddccc44
https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/util/ReportUtil.java#L885-L939
train
This method is used to convert a ReportLayout to a ForReportBand.
Create a Java method that does the following: "This method is used to convert a ReportLayout to a ForReportBand.".
Of course, here is the Java code you requested: ```java private static ReportLayout getForReportLayout(Connection con, ReportLayout layout, ParametersBean pBean) throws Exception { ReportLayout convertedLayout = ObjectCloner.silenceDeepCopy(layout); List<Band> bands = convertedLayout.getDocumentBands(); for (Ba...
LGoodDatePicker/LGoodDatePicker
Project/src/main/java/com/github/lgooddatepicker/zinternaltools/CalculateMinimumTimeFieldSize.java
CalculateMinimumTimeFieldSize.getFormattedTimeWidthInPixels
static public int getFormattedTimeWidthInPixels(DateTimeFormatter formatForDisplayTime, Font fontValidTime, int numberOfExtraCharacters) { // Create the font metrics that will be used in the calculation. JTextField textField = new JTextField(); FontMetrics fontMetrics = textField.get...
java
static public int getFormattedTimeWidthInPixels(DateTimeFormatter formatForDisplayTime, Font fontValidTime, int numberOfExtraCharacters) { // Create the font metrics that will be used in the calculation. JTextField textField = new JTextField(); FontMetrics fontMetrics = textField.get...
[ "static", "public", "int", "getFormattedTimeWidthInPixels", "(", "DateTimeFormatter", "formatForDisplayTime", ",", "Font", "fontValidTime", ",", "int", "numberOfExtraCharacters", ")", "{", "// Create the font metrics that will be used in the calculation.", "JTextField", "textField"...
getFormattedDateWidthInPixels, This returns the width (in pixels) of the longest formatted time, using the supplied DateTimeFormatter instance and font. Note that the locale information is built into the display format. You may optionally add extra characters to the longestTimeString that is used in the calculation, b...
[ "getFormattedDateWidthInPixels", "This", "returns", "the", "width", "(", "in", "pixels", ")", "of", "the", "longest", "formatted", "time", "using", "the", "supplied", "DateTimeFormatter", "instance", "and", "font", ".", "Note", "that", "the", "locale", "informatio...
c7df05a5fe382e1e08a6237e9391d8dc5fd48692
https://github.com/LGoodDatePicker/LGoodDatePicker/blob/c7df05a5fe382e1e08a6237e9391d8dc5fd48692/Project/src/main/java/com/github/lgooddatepicker/zinternaltools/CalculateMinimumTimeFieldSize.java#L30-L50
train
Get the width of the longest formatted time in pixels using the supplied formatter and font.
Create a Java method that does the following: "Get the width of the longest formatted time in pixels using the supplied formatter and font.".
Of course, here is the Java code you requested: ```java static public int getFormattedTimeWidthInPixels(DateTimeFormatter formatForDisplayTime, Font fontValidTime, int numberOfExtraCharacters) { // Create the font metrics that will be used in the calculation. JTextField textField = new JTex...
yan74/afplib
org.afplib/src/main/java/org/afplib/afplib/impl/GBIMGImpl.java
GBIMGImpl.setRES
public void setRES(Integer newRES) { Integer oldRES = res; res = newRES; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, AfplibPackage.GBIMG__RES, oldRES, res)); }
java
public void setRES(Integer newRES) { Integer oldRES = res; res = newRES; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, AfplibPackage.GBIMG__RES, oldRES, res)); }
[ "public", "void", "setRES", "(", "Integer", "newRES", ")", "{", "Integer", "oldRES", "=", "res", ";", "res", "=", "newRES", ";", "if", "(", "eNotificationRequired", "(", ")", ")", "eNotify", "(", "new", "ENotificationImpl", "(", "this", ",", "Notification"...
<!-- 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/GBIMGImpl.java#L251-L256
train
Sets the resource value.
Create a Java method that does the following: "Sets the resource value.".
Of course, here is the Java code you requested: ```java public void setRES(Integer newRES) { Integer oldRES = res; res = newRES; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, AfplibPackage.GBIMG__RES, oldRES, res)); } ``` Hope this helps!
Syncleus/aparapi
src/main/java/com/aparapi/device/OpenCLDevice.java
OpenCLDevice.configure
public void configure() { if (configurator != null && !underConfiguration.get() && underConfiguration.compareAndSet(false, true)) { try { configurator.configure(this); } finally { underConfiguration.set(false); } } }
java
public void configure() { if (configurator != null && !underConfiguration.get() && underConfiguration.compareAndSet(false, true)) { try { configurator.configure(this); } finally { underConfiguration.set(false); } } }
[ "public", "void", "configure", "(", ")", "{", "if", "(", "configurator", "!=", "null", "&&", "!", "underConfiguration", ".", "get", "(", ")", "&&", "underConfiguration", ".", "compareAndSet", "(", "false", ",", "true", ")", ")", "{", "try", "{", "configu...
Called by the underlying Aparapi OpenCL platform, upon device detection.
[ "Called", "by", "the", "underlying", "Aparapi", "OpenCL", "platform", "upon", "device", "detection", "." ]
6d5892c8e69854b3968c541023de37cf4762bd24
https://github.com/Syncleus/aparapi/blob/6d5892c8e69854b3968c541023de37cf4762bd24/src/main/java/com/aparapi/device/OpenCLDevice.java#L148-L157
train
Configure the object.
Create a Java method that does the following: "Configure the object.".
Of course, here is the Java code you requested: ```java public void configure() { if (configurator != null && !underConfiguration.get() && underConfiguration.compareAndSet(false, true)) { try { configurator.configure(this); } finally { underConfiguration.set(false); } } } ``` Hope this ...
derari/cthul
strings/src/main/java/org/cthul/strings/FormatMatcher.java
FormatMatcher.find
public boolean find(int start, MatchResults result) { if (!matcher.find(start)) return false; applyMatch(result); return true; }
java
public boolean find(int start, MatchResults result) { if (!matcher.find(start)) return false; applyMatch(result); return true; }
[ "public", "boolean", "find", "(", "int", "start", ",", "MatchResults", "result", ")", "{", "if", "(", "!", "matcher", ".", "find", "(", "start", ")", ")", "return", "false", ";", "applyMatch", "(", "result", ")", ";", "return", "true", ";", "}" ]
Finds the next match and fills the result @param start @param result @return true iff match was found
[ "Finds", "the", "next", "match", "and", "fills", "the", "result" ]
74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc
https://github.com/derari/cthul/blob/74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc/strings/src/main/java/org/cthul/strings/FormatMatcher.java#L69-L73
train
Find a hierarchical record in the source.
Create a Java method that does the following: "Find a hierarchical record in the source.".
Of course, here is the Java code you requested: ```java public boolean find(int start, MatchResults result) { if (!matcher.find(start)) return false; applyMatch(result); return true; } ``` Hope this helps!
strator-dev/greenpepper
greenpepper/core/src/main/java/com/greenpepper/interpreter/ImportInterpreter.java
ImportInterpreter.interpret
public void interpret( Specification specification ) { Example table = specification.nextExample(); for (Example row = table.at( 0, 1 ); row != null; row = row.nextSibling()) { if (!row.hasChild()) continue; String packageName = row.firstChild().getContent(); ...
java
public void interpret( Specification specification ) { Example table = specification.nextExample(); for (Example row = table.at( 0, 1 ); row != null; row = row.nextSibling()) { if (!row.hasChild()) continue; String packageName = row.firstChild().getContent(); ...
[ "public", "void", "interpret", "(", "Specification", "specification", ")", "{", "Example", "table", "=", "specification", ".", "nextExample", "(", ")", ";", "for", "(", "Example", "row", "=", "table", ".", "at", "(", "0", ",", "1", ")", ";", "row", "!=...
{@inheritDoc}
[ "{" ]
2a61e6c179b74085babcc559d677490b0cad2d30
https://github.com/strator-dev/greenpepper/blob/2a61e6c179b74085babcc559d677490b0cad2d30/greenpepper/core/src/main/java/com/greenpepper/interpreter/ImportInterpreter.java#L49-L60
train
Interprets the specification for a CRS file.
Create a Java method that does the following: "Interprets the specification for a CRS file.".
Of course, here is the Java code you requested: ```java public void interpret( Specification specification ) { Example table = specification.nextExample(); for (Example row = table.at( 0, 1 ); row != null; row = row.nextSibling()) { if (!row.hasChild()) continue; Str...
Wikidata/Wikidata-Toolkit
wdtk-dumpfiles/src/main/java/org/wikidata/wdtk/dumpfiles/wmf/WmfDumpFile.java
WmfDumpFile.getDumpFileCompressionType
public static CompressionType getDumpFileCompressionType(String fileName) { if (fileName.endsWith(".gz")) { return CompressionType.GZIP; } else if (fileName.endsWith(".bz2")) { return CompressionType.BZ2; } else { return CompressionType.NONE; } }
java
public static CompressionType getDumpFileCompressionType(String fileName) { if (fileName.endsWith(".gz")) { return CompressionType.GZIP; } else if (fileName.endsWith(".bz2")) { return CompressionType.BZ2; } else { return CompressionType.NONE; } }
[ "public", "static", "CompressionType", "getDumpFileCompressionType", "(", "String", "fileName", ")", "{", "if", "(", "fileName", ".", "endsWith", "(", "\".gz\"", ")", ")", "{", "return", "CompressionType", ".", "GZIP", ";", "}", "else", "if", "(", "fileName", ...
Returns the compression type of this kind of dump file using file suffixes @param fileName the name of the file @return compression type @throws IllegalArgumentException if the given dump file type is not known
[ "Returns", "the", "compression", "type", "of", "this", "kind", "of", "dump", "file", "using", "file", "suffixes" ]
7732851dda47e1febff406fba27bfec023f4786e
https://github.com/Wikidata/Wikidata-Toolkit/blob/7732851dda47e1febff406fba27bfec023f4786e/wdtk-dumpfiles/src/main/java/org/wikidata/wdtk/dumpfiles/wmf/WmfDumpFile.java#L200-L208
train
Get the compression type of a dump file.
Create a Java method that does the following: "Get the compression type of a dump file.".
Of course, here is the Java code you requested: ```java public static CompressionType getDumpFileCompressionType(String fileName) { if (fileName.endsWith(".gz")) { return CompressionType.GZIP; } else if (fileName.endsWith(".bz2")) { return CompressionType.BZ2; } else { return CompressionType.NONE; } ...
languagetool-org/languagetool
languagetool-core/src/main/java/org/languagetool/JLanguageTool.java
JLanguageTool.activateDefaultPatternRules
private void activateDefaultPatternRules() throws IOException { List<AbstractPatternRule> patternRules = language.getPatternRules(); List<String> enabledRules = language.getDefaultEnabledRulesForVariant(); List<String> disabledRules = language.getDefaultDisabledRulesForVariant(); if (!enabledRules.isEmp...
java
private void activateDefaultPatternRules() throws IOException { List<AbstractPatternRule> patternRules = language.getPatternRules(); List<String> enabledRules = language.getDefaultEnabledRulesForVariant(); List<String> disabledRules = language.getDefaultDisabledRulesForVariant(); if (!enabledRules.isEmp...
[ "private", "void", "activateDefaultPatternRules", "(", ")", "throws", "IOException", "{", "List", "<", "AbstractPatternRule", ">", "patternRules", "=", "language", ".", "getPatternRules", "(", ")", ";", "List", "<", "String", ">", "enabledRules", "=", "language", ...
Loads and activates the pattern rules from {@code org/languagetool/rules/<languageCode>/grammar.xml}.
[ "Loads", "and", "activates", "the", "pattern", "rules", "from", "{" ]
b7a3d63883d242fb2525877c6382681c57a0a142
https://github.com/languagetool-org/languagetool/blob/b7a3d63883d242fb2525877c6382681c57a0a142/languagetool-core/src/main/java/org/languagetool/JLanguageTool.java#L511-L526
train
Activate the default pattern rules for the language.
Create a Java method that does the following: "Activate the default pattern rules for the language.".
Of course, here is the Java code you requested: ```java private void activateDefaultPatternRules() throws IOException { List<AbstractPatternRule> patternRules = language.getPatternRules(); List<String> enabledRules = language.getDefaultEnabledRulesForVariant(); List<String> disabledRules = language.getDefa...
facebook/fresco
animated-base/src/main/java/com/facebook/imagepipeline/animated/util/AnimatedDrawableUtil.java
AnimatedDrawableUtil.getFrameForTimestampMs
public int getFrameForTimestampMs(int frameTimestampsMs[], int timestampMs) { int index = Arrays.binarySearch(frameTimestampsMs, timestampMs); if (index < 0) { return -index - 1 - 1; } else { return index; } }
java
public int getFrameForTimestampMs(int frameTimestampsMs[], int timestampMs) { int index = Arrays.binarySearch(frameTimestampsMs, timestampMs); if (index < 0) { return -index - 1 - 1; } else { return index; } }
[ "public", "int", "getFrameForTimestampMs", "(", "int", "frameTimestampsMs", "[", "]", ",", "int", "timestampMs", ")", "{", "int", "index", "=", "Arrays", ".", "binarySearch", "(", "frameTimestampsMs", ",", "timestampMs", ")", ";", "if", "(", "index", "<", "0...
Gets the frame index for specified timestamp. @param frameTimestampsMs an array of timestamps generated by {@link #getFrameForTimestampMs)} @param timestampMs the timestamp @return the frame index for the timestamp or the last frame number if the timestamp is outside the duration of the entire animation
[ "Gets", "the", "frame", "index", "for", "specified", "timestamp", "." ]
0b85879d51c5036d5e46e627a6651afefc0b971a
https://github.com/facebook/fresco/blob/0b85879d51c5036d5e46e627a6651afefc0b971a/animated-base/src/main/java/com/facebook/imagepipeline/animated/util/AnimatedDrawableUtil.java#L81-L88
train
Get the frame for the given timestampMs.
Create a Java method that does the following: "Get the frame for the given timestampMs.".
Of course, here is the Java code you requested: ```java public int getFrameForTimestampMs(int frameTimestampsMs[], int timestampMs) { int index = Arrays.binarySearch(frameTimestampsMs, timestampMs); if (index < 0) { return -index - 1 - 1; } else { return index; } } ``` Hope this helps!
sarl/sarl
main/coreplugins/io.sarl.m2e/src/io/sarl/m2e/wizards/importproject/EnableSarlMavenNatureAction.java
EnableSarlMavenNatureAction.enableNature
protected void enableNature(IProject project) { final IFile pom = project.getFile(IMavenConstants.POM_FILE_NAME); final Job job; if (pom.exists()) { job = createJobForMavenProject(project); } else { job = createJobForJavaProject(project); } if (job != null) { job.schedule(); } }
java
protected void enableNature(IProject project) { final IFile pom = project.getFile(IMavenConstants.POM_FILE_NAME); final Job job; if (pom.exists()) { job = createJobForMavenProject(project); } else { job = createJobForJavaProject(project); } if (job != null) { job.schedule(); } }
[ "protected", "void", "enableNature", "(", "IProject", "project", ")", "{", "final", "IFile", "pom", "=", "project", ".", "getFile", "(", "IMavenConstants", ".", "POM_FILE_NAME", ")", ";", "final", "Job", "job", ";", "if", "(", "pom", ".", "exists", "(", ...
Enable the SARL Maven nature. @param project the project.
[ "Enable", "the", "SARL", "Maven", "nature", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.m2e/src/io/sarl/m2e/wizards/importproject/EnableSarlMavenNatureAction.java#L122-L133
train
Enable the nature of the project.
Create a Java method that does the following: "Enable the nature of the project.".
Of course, here is the Java code you requested: ```java protected void enableNature(IProject project) { final IFile pom = project.getFile(IMavenConstants.POM_FILE_NAME); final Job job; if (pom.exists()) { job = createJobForMavenProject(project); } else { job = createJobForJavaProject(project); } if (...
OpenEstate/OpenEstate-IO
OpenImmo/src/main/jaxb/org/openestate/io/openimmo/xml/ObjectFactory.java
ObjectFactory.createGastterrasse
@XmlElementDecl(namespace = "", name = "gastterrasse") public JAXBElement<Boolean> createGastterrasse(Boolean value) { return new JAXBElement<Boolean>(_Gastterrasse_QNAME, Boolean.class, null, value); }
java
@XmlElementDecl(namespace = "", name = "gastterrasse") public JAXBElement<Boolean> createGastterrasse(Boolean value) { return new JAXBElement<Boolean>(_Gastterrasse_QNAME, Boolean.class, null, value); }
[ "@", "XmlElementDecl", "(", "namespace", "=", "\"\"", ",", "name", "=", "\"gastterrasse\"", ")", "public", "JAXBElement", "<", "Boolean", ">", "createGastterrasse", "(", "Boolean", "value", ")", "{", "return", "new", "JAXBElement", "<", "Boolean", ">", "(", ...
Create an instance of {@link JAXBElement }{@code <}{@link Boolean }{@code >}}
[ "Create", "an", "instance", "of", "{", "@link", "JAXBElement", "}", "{", "@code", "<", "}", "{", "@link", "Boolean", "}", "{", "@code", ">", "}}" ]
f961dae78f40823f05a8c0d4e59d639e718aa18a
https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/OpenImmo/src/main/jaxb/org/openestate/io/openimmo/xml/ObjectFactory.java#L2805-L2808
test
Create an instance of a Gastterrasse type.
Create a Java method that does the following: "Create an instance of a Gastterrasse type.".
Of course, here is the Java code you requested: ```java @XmlElementDecl(namespace = "", name = "gastterrasse") public JAXBElement<Boolean> createGastterrasse(Boolean value) { return new JAXBElement<Boolean>(_Gastterrasse_QNAME, Boolean.class, null, value); } ``` Hope this helps!
liferay/com-liferay-commerce
commerce-currency-service/src/main/java/com/liferay/commerce/currency/service/base/CommerceCurrencyLocalServiceBaseImpl.java
CommerceCurrencyLocalServiceBaseImpl.dynamicQuery
@Override public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery) { return commerceCurrencyPersistence.findWithDynamicQuery(dynamicQuery); }
java
@Override public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery) { return commerceCurrencyPersistence.findWithDynamicQuery(dynamicQuery); }
[ "@", "Override", "public", "<", "T", ">", "List", "<", "T", ">", "dynamicQuery", "(", "DynamicQuery", "dynamicQuery", ")", "{", "return", "commerceCurrencyPersistence", ".", "findWithDynamicQuery", "(", "dynamicQuery", ")", ";", "}" ]
Performs a dynamic query on the database and returns the matching rows. @param dynamicQuery the dynamic query @return the matching rows
[ "Performs", "a", "dynamic", "query", "on", "the", "database", "and", "returns", "the", "matching", "rows", "." ]
9e54362d7f59531fc684016ba49ee7cdc3a2f22b
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-currency-service/src/main/java/com/liferay/commerce/currency/service/base/CommerceCurrencyLocalServiceBaseImpl.java#L153-L156
train
Executes a dynamic query on the database.
Create a Java method that does the following: "Executes a dynamic query on the database.".
Of course, here is the Java code you requested: ```java @Override public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery) { return commerceCurrencyPersistence.findWithDynamicQuery(dynamicQuery); } ``` Hope this helps!
googleapis/google-cloud-java
google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupClient.java
InstanceGroupClient.removeInstancesInstanceGroup
@BetaApi public final Operation removeInstancesInstanceGroup( ProjectZoneInstanceGroupName instanceGroup, InstanceGroupsRemoveInstancesRequest instanceGroupsRemoveInstancesRequestResource) { RemoveInstancesInstanceGroupHttpRequest request = RemoveInstancesInstanceGroupHttpRequest.newBuilder()...
java
@BetaApi public final Operation removeInstancesInstanceGroup( ProjectZoneInstanceGroupName instanceGroup, InstanceGroupsRemoveInstancesRequest instanceGroupsRemoveInstancesRequestResource) { RemoveInstancesInstanceGroupHttpRequest request = RemoveInstancesInstanceGroupHttpRequest.newBuilder()...
[ "@", "BetaApi", "public", "final", "Operation", "removeInstancesInstanceGroup", "(", "ProjectZoneInstanceGroupName", "instanceGroup", ",", "InstanceGroupsRemoveInstancesRequest", "instanceGroupsRemoveInstancesRequestResource", ")", "{", "RemoveInstancesInstanceGroupHttpRequest", "reque...
Removes one or more instances from the specified instance group, but does not delete those instances. <p>If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration before the VM instance is removed or deleted. <p>Sample code: <p...
[ "Removes", "one", "or", "more", "instances", "from", "the", "specified", "instance", "group", "but", "does", "not", "delete", "those", "instances", "." ]
d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a
https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupClient.java#L1066-L1078
train
Removes an instance group from the specified project.
Create a Java method that does the following: "Removes an instance group from the specified project.".
Of course, here is the Java code you requested: ```java @BetaApi public final Operation removeInstancesInstanceGroup( ProjectZoneInstanceGroupName instanceGroup, InstanceGroupsRemoveInstancesRequest instanceGroupsRemoveInstancesRequestResource) { RemoveInstancesInstanceGroupHttpRequest request = ...
msgpack/msgpack-java
msgpack-core/src/main/java/org/msgpack/core/MessageUnpacker.java
MessageUnpacker.getNextBuffer
private MessageBuffer getNextBuffer() throws IOException { MessageBuffer next = in.next(); if (next == null) { throw new MessageInsufficientBufferException(); } assert (buffer != null); totalReadBytes += buffer.size(); return next; }
java
private MessageBuffer getNextBuffer() throws IOException { MessageBuffer next = in.next(); if (next == null) { throw new MessageInsufficientBufferException(); } assert (buffer != null); totalReadBytes += buffer.size(); return next; }
[ "private", "MessageBuffer", "getNextBuffer", "(", ")", "throws", "IOException", "{", "MessageBuffer", "next", "=", "in", ".", "next", "(", ")", ";", "if", "(", "next", "==", "null", ")", "{", "throw", "new", "MessageInsufficientBufferException", "(", ")", ";...
Get the next buffer without changing the position @return @throws IOException
[ "Get", "the", "next", "buffer", "without", "changing", "the", "position" ]
16e370e348215a72a14c210b42d448d513aee015
https://github.com/msgpack/msgpack-java/blob/16e370e348215a72a14c210b42d448d513aee015/msgpack-core/src/main/java/org/msgpack/core/MessageUnpacker.java#L272-L282
train
Get the next MessageBuffer from the underlying stream.
Create a Java method that does the following: "Get the next MessageBuffer from the underlying stream.".
Of course, here is the Java code you requested: ```java private MessageBuffer getNextBuffer() throws IOException { MessageBuffer next = in.next(); if (next == null) { throw new MessageInsufficientBufferException(); } assert (buffer != null); totalRead...
mgormley/pacaya
src/main/java/edu/jhu/pacaya/gm/util/DirectedGraph.java
DirectedGraph.preOrderTraversal
public void preOrderTraversal(N root, Visitor<N> v) { setMarkedAllNodes(false); preOrderTraveralRecursive(root, v); }
java
public void preOrderTraversal(N root, Visitor<N> v) { setMarkedAllNodes(false); preOrderTraveralRecursive(root, v); }
[ "public", "void", "preOrderTraversal", "(", "N", "root", ",", "Visitor", "<", "N", ">", "v", ")", "{", "setMarkedAllNodes", "(", "false", ")", ";", "preOrderTraveralRecursive", "(", "root", ",", "v", ")", ";", "}" ]
Visits the nodes in a pre-order traversal.
[ "Visits", "the", "nodes", "in", "a", "pre", "-", "order", "traversal", "." ]
786294cbac7cc65dbc32210c10acc32ed0c69233
https://github.com/mgormley/pacaya/blob/786294cbac7cc65dbc32210c10acc32ed0c69233/src/main/java/edu/jhu/pacaya/gm/util/DirectedGraph.java#L247-L250
train
Traverses the tree using pre - order traversal.
Create a Java method that does the following: "Traverses the tree using pre - order traversal.".
Of course, here is the Java code you requested: ```java public void preOrderTraversal(N root, Visitor<N> v) { setMarkedAllNodes(false); preOrderTraveralRecursive(root, v); } ``` Hope this helps!
aspectran/aspectran
core/src/main/java/com/aspectran/core/util/apon/AponReader.java
AponReader.parse
public static <T extends Parameters> T parse(File file, String encoding, T parameters) throws AponParseException { if (file == null) { throw new IllegalArgumentException("file must not be null"); } if (parameters == null) { throw new IllegalArgumentException("...
java
public static <T extends Parameters> T parse(File file, String encoding, T parameters) throws AponParseException { if (file == null) { throw new IllegalArgumentException("file must not be null"); } if (parameters == null) { throw new IllegalArgumentException("...
[ "public", "static", "<", "T", "extends", "Parameters", ">", "T", "parse", "(", "File", "file", ",", "String", "encoding", ",", "T", "parameters", ")", "throws", "AponParseException", "{", "if", "(", "file", "==", "null", ")", "{", "throw", "new", "Illega...
Converts into a given Parameters object from a file. @param <T> the generic type @param file the file to parse @param encoding the character encoding @param parameters the Parameters object @return the Parameters object @throws AponParseException if reading APON format document fails
[ "Converts", "into", "a", "given", "Parameters", "object", "from", "a", "file", "." ]
2d758a2a28b71ee85b42823c12dc44674d7f2c70
https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/core/src/main/java/com/aspectran/core/util/apon/AponReader.java#L500-L527
train
Parses the given file with the specified parameters.
Create a Java method that does the following: "Parses the given file with the specified parameters.".
Of course, here is the Java code you requested: ```java public static <T extends Parameters> T parse(File file, String encoding, T parameters) throws AponParseException { if (file == null) { throw new IllegalArgumentException("file must not be null"); } if (parameters ==...
VoltDB/voltdb
src/frontend/org/voltdb/sysprocs/saverestore/IndexSnapshotRequestConfig.java
IndexSnapshotRequestConfig.toJSONString
@Override public void toJSONString(JSONStringer stringer) throws JSONException { super.toJSONString(stringer); stringer.key("partitionRanges").object(); for (PartitionRanges partitionRange : partitionRanges) { stringer.key(Integer.toString(partitionRange.partitionId)).objec...
java
@Override public void toJSONString(JSONStringer stringer) throws JSONException { super.toJSONString(stringer); stringer.key("partitionRanges").object(); for (PartitionRanges partitionRange : partitionRanges) { stringer.key(Integer.toString(partitionRange.partitionId)).objec...
[ "@", "Override", "public", "void", "toJSONString", "(", "JSONStringer", "stringer", ")", "throws", "JSONException", "{", "super", ".", "toJSONString", "(", "stringer", ")", ";", "stringer", ".", "key", "(", "\"partitionRanges\"", ")", ".", "object", "(", ")", ...
serialize request
[ "serialize", "request" ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/sysprocs/saverestore/IndexSnapshotRequestConfig.java#L108-L126
train
Override toJSONString to add the result to the given stringer.
Create a Java method that does the following: "Override toJSONString to add the result to the given stringer.".
Of course, here is the Java code you requested: ```java @Override public void toJSONString(JSONStringer stringer) throws JSONException { super.toJSONString(stringer); stringer.key("partitionRanges").object(); for (PartitionRanges partitionRange : partitionRanges) { stringe...
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/AnalysisCacheToRepositoryAdapter.java
AnalysisCacheToRepositoryAdapter.findClass
@Override public JavaClass findClass(String className) { @SlashedClassName String slashedClassName = ClassName.toSlashedClassName(className); ClassDescriptor classDescriptor = DescriptorFactory.instance().getClassDescriptor(slashedClassName); return Global.getAnalysisCache().probeCla...
java
@Override public JavaClass findClass(String className) { @SlashedClassName String slashedClassName = ClassName.toSlashedClassName(className); ClassDescriptor classDescriptor = DescriptorFactory.instance().getClassDescriptor(slashedClassName); return Global.getAnalysisCache().probeCla...
[ "@", "Override", "public", "JavaClass", "findClass", "(", "String", "className", ")", "{", "@", "SlashedClassName", "String", "slashedClassName", "=", "ClassName", ".", "toSlashedClassName", "(", "className", ")", ";", "ClassDescriptor", "classDescriptor", "=", "Des...
/* (non-Javadoc) @see org.apache.bcel.util.Repository#findClass(java.lang.String)
[ "/", "*", "(", "non", "-", "Javadoc", ")" ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/AnalysisCacheToRepositoryAdapter.java#L61-L67
train
Find a class by name.
Create a Java method that does the following: "Find a class by name.".
Of course, here is the Java code you requested: ```java @Override public JavaClass findClass(String className) { @SlashedClassName String slashedClassName = ClassName.toSlashedClassName(className); ClassDescriptor classDescriptor = DescriptorFactory.instance().getClassDescriptor(slashedClas...
albfernandez/itext2
src/main/java/com/lowagie/text/rtf/style/RtfFontList.java
RtfFontList.getFontNumber
public int getFontNumber(RtfFont font) { if(font instanceof RtfParagraphStyle) { font = new RtfFont(this.document, font); } int fontIndex = -1; for(int i = 0; i < fontList.size(); i++) { if(fontList.get(i).equals(font)) { fontIndex = i; ...
java
public int getFontNumber(RtfFont font) { if(font instanceof RtfParagraphStyle) { font = new RtfFont(this.document, font); } int fontIndex = -1; for(int i = 0; i < fontList.size(); i++) { if(fontList.get(i).equals(font)) { fontIndex = i; ...
[ "public", "int", "getFontNumber", "(", "RtfFont", "font", ")", "{", "if", "(", "font", "instanceof", "RtfParagraphStyle", ")", "{", "font", "=", "new", "RtfFont", "(", "this", ".", "document", ",", "font", ")", ";", "}", "int", "fontIndex", "=", "-", "...
Gets the index of the font in the list of fonts. If the font does not exist in the list, it is added. @param font The font to get the id for @return The index of the font
[ "Gets", "the", "index", "of", "the", "font", "in", "the", "list", "of", "fonts", ".", "If", "the", "font", "does", "not", "exist", "in", "the", "list", "it", "is", "added", "." ]
438fc1899367fd13dfdfa8dfdca9a3c1a7783b84
https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/rtf/style/RtfFontList.java#L113-L128
train
Gets the font number.
Create a Java method that does the following: "Gets the font number.".
Of course, here is the Java code you requested: ```java public int getFontNumber(RtfFont font) { if(font instanceof RtfParagraphStyle) { font = new RtfFont(this.document, font); } int fontIndex = -1; for(int i = 0; i < fontList.size(); i++) { if(fontList.get(i).e...
evant/JobSchedulerCompat
jobscheduler/src/main/java/me/tatarka/support/internal/job/JobStore.java
JobStore.containsJobId
public boolean containsJobId(int jobId) { for (int i = mJobSet.size() - 1; i >= 0; i--) { JobStatus ts = mJobSet.valueAt(i); if (ts.matches(jobId)) { return true; } } return false; }
java
public boolean containsJobId(int jobId) { for (int i = mJobSet.size() - 1; i >= 0; i--) { JobStatus ts = mJobSet.valueAt(i); if (ts.matches(jobId)) { return true; } } return false; }
[ "public", "boolean", "containsJobId", "(", "int", "jobId", ")", "{", "for", "(", "int", "i", "=", "mJobSet", ".", "size", "(", ")", "-", "1", ";", "i", ">=", "0", ";", "i", "--", ")", "{", "JobStatus", "ts", "=", "mJobSet", ".", "valueAt", "(", ...
Whether this jobStatus object already exists in the JobStore.
[ "Whether", "this", "jobStatus", "object", "already", "exists", "in", "the", "JobStore", "." ]
afa59227b33824700f11bc575ca535b0e78babec
https://github.com/evant/JobSchedulerCompat/blob/afa59227b33824700f11bc575ca535b0e78babec/jobscheduler/src/main/java/me/tatarka/support/internal/job/JobStore.java#L131-L139
valid
Check if the job set contains the jobId.
Create a Java method that does the following: "Check if the job set contains the jobId.".
Of course, here is the Java code you requested: ```java public boolean containsJobId(int jobId) { for (int i = mJobSet.size() - 1; i >= 0; i--) { JobStatus ts = mJobSet.valueAt(i); if (ts.matches(jobId)) { return true; } } return false; } ...
realtime-framework/RealtimeMessaging-Java
library/src/main/java/ibt/ortc/extensibility/OrtcClient.java
OrtcClient.send
public void send(String channel, String message) { // CAUSE: Assignment to method parameter Pair<Boolean, String> sendValidation = isSendValid(channel, message, null, null); //String lMessage = message.replace("\n", "\\n"); if (sendValidation != null && sendValidation.first) { try { String messageId = ...
java
public void send(String channel, String message) { // CAUSE: Assignment to method parameter Pair<Boolean, String> sendValidation = isSendValid(channel, message, null, null); //String lMessage = message.replace("\n", "\\n"); if (sendValidation != null && sendValidation.first) { try { String messageId = ...
[ "public", "void", "send", "(", "String", "channel", ",", "String", "message", ")", "{", "// CAUSE: Assignment to method parameter", "Pair", "<", "Boolean", ",", "String", ">", "sendValidation", "=", "isSendValid", "(", "channel", ",", "message", ",", "null", ","...
Sends a message to the specified channel. @param channel Channel to wich the message should be sent @param message The content of the message to be sent
[ "Sends", "a", "message", "to", "the", "specified", "channel", "." ]
cae0dfd01567a2d9e55a0849c0c9b09ad4b2cc08
https://github.com/realtime-framework/RealtimeMessaging-Java/blob/cae0dfd01567a2d9e55a0849c0c9b09ad4b2cc08/library/src/main/java/ibt/ortc/extensibility/OrtcClient.java#L634-L653
train
Sends a message to a channel.
Create a Java method that does the following: "Sends a message to a channel.".
Of course, here is the Java code you requested: ```java public void send(String channel, String message) { // CAUSE: Assignment to method parameter Pair<Boolean, String> sendValidation = isSendValid(channel, message, null, null); //String lMessage = message.replace("\n", "\\n"); if (sendValidation != null &&...
EMCECS/nfs-client-java
src/main/java/com/emc/ecs/nfsclient/nfs/nfs3/Nfs3.java
Nfs3.wrapped_getLookup
public Nfs3LookupResponse wrapped_getLookup(NfsLookupRequest request) throws IOException { RpcResponseHandler<Nfs3LookupResponse> responseHandler = new NfsResponseHandler<Nfs3LookupResponse>() { /* (non-Javadoc) * @see com.emc.ecs.nfsclient.rpc.RpcResponseHandler#makeNewResponse() ...
java
public Nfs3LookupResponse wrapped_getLookup(NfsLookupRequest request) throws IOException { RpcResponseHandler<Nfs3LookupResponse> responseHandler = new NfsResponseHandler<Nfs3LookupResponse>() { /* (non-Javadoc) * @see com.emc.ecs.nfsclient.rpc.RpcResponseHandler#makeNewResponse() ...
[ "public", "Nfs3LookupResponse", "wrapped_getLookup", "(", "NfsLookupRequest", "request", ")", "throws", "IOException", "{", "RpcResponseHandler", "<", "Nfs3LookupResponse", ">", "responseHandler", "=", "new", "NfsResponseHandler", "<", "Nfs3LookupResponse", ">", "(", ")",...
/* (non-Javadoc) @see com.emc.ecs.nfsclient.nfs.Nfs#wrapped_getLookup(com.emc.ecs.nfsclient.nfs.NfsLookupRequest)
[ "/", "*", "(", "non", "-", "Javadoc", ")" ]
7ba25bad5052b95cd286052745327729288b2843
https://github.com/EMCECS/nfs-client-java/blob/7ba25bad5052b95cd286052745327729288b2843/src/main/java/com/emc/ecs/nfsclient/nfs/nfs3/Nfs3.java#L594-L619
train
This method is called by the VFS to get a lookup response.
Create a Java method that does the following: "This method is called by the VFS to get a lookup response.".
Of course, here is the Java code you requested: ```java public Nfs3LookupResponse wrapped_getLookup(NfsLookupRequest request) throws IOException { RpcResponseHandler<Nfs3LookupResponse> responseHandler = new NfsResponseHandler<Nfs3LookupResponse>() { /* (non-Javadoc) * @see com.emc.ec...
eclipse/xtext-extras
org.eclipse.xtext.generator/src-gen/org/eclipse/xtext/generator/parser/antlr/debug/simpleAntlr/impl/ReferenceOrLiteralImpl.java
ReferenceOrLiteralImpl.eIsSet
@Override public boolean eIsSet(int featureID) { switch (featureID) { case SimpleAntlrPackage.REFERENCE_OR_LITERAL__NAME: return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); } return super.eIsSet(featureID); }
java
@Override public boolean eIsSet(int featureID) { switch (featureID) { case SimpleAntlrPackage.REFERENCE_OR_LITERAL__NAME: return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); } return super.eIsSet(featureID); }
[ "@", "Override", "public", "boolean", "eIsSet", "(", "int", "featureID", ")", "{", "switch", "(", "featureID", ")", "{", "case", "SimpleAntlrPackage", ".", "REFERENCE_OR_LITERAL__NAME", ":", "return", "NAME_EDEFAULT", "==", "null", "?", "name", "!=", "null", "...
<!-- begin-user-doc --> <!-- end-user-doc --> @generated
[ "<!", "--", "begin", "-", "user", "-", "doc", "--", ">", "<!", "--", "end", "-", "user", "-", "doc", "--", ">" ]
451359541295323a29f5855e633f770cec02069a
https://github.com/eclipse/xtext-extras/blob/451359541295323a29f5855e633f770cec02069a/org.eclipse.xtext.generator/src-gen/org/eclipse/xtext/generator/parser/antlr/debug/simpleAntlr/impl/ReferenceOrLiteralImpl.java#L148-L157
train
Override the eIsSet method to check if the featureID is a CBE CBE
Create a Java method that does the following: "Override the eIsSet method to check if the featureID is a CBE CBE".
Of course, here is the Java code you requested: ```java @Override public boolean eIsSet(int featureID) { switch (featureID) { case SimpleAntlrPackage.REFERENCE_OR_LITERAL__NAME: return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); } return super.eIsSet(featureID)...
aws/aws-sdk-java
aws-java-sdk-route53/src/main/java/com/amazonaws/services/route53domains/AmazonRoute53DomainsClient.java
AmazonRoute53DomainsClient.enableDomainAutoRenew
@Override public EnableDomainAutoRenewResult enableDomainAutoRenew(EnableDomainAutoRenewRequest request) { request = beforeClientExecution(request); return executeEnableDomainAutoRenew(request); }
java
@Override public EnableDomainAutoRenewResult enableDomainAutoRenew(EnableDomainAutoRenewRequest request) { request = beforeClientExecution(request); return executeEnableDomainAutoRenew(request); }
[ "@", "Override", "public", "EnableDomainAutoRenewResult", "enableDomainAutoRenew", "(", "EnableDomainAutoRenewRequest", "request", ")", "{", "request", "=", "beforeClientExecution", "(", "request", ")", ";", "return", "executeEnableDomainAutoRenew", "(", "request", ")", "...
<p> This operation configures Amazon Route 53 to automatically renew the specified domain before the domain registration expires. The cost of renewing your domain registration is billed to your AWS account. </p> <p> The period during which you can renew a domain name varies by TLD. For a list of TLDs and their renewal ...
[ "<p", ">", "This", "operation", "configures", "Amazon", "Route", "53", "to", "automatically", "renew", "the", "specified", "domain", "before", "the", "domain", "registration", "expires", ".", "The", "cost", "of", "renewing", "your", "domain", "registration", "is...
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-route53/src/main/java/com/amazonaws/services/route53domains/AmazonRoute53DomainsClient.java#L644-L648
train
Enables or disables a domain s auto renewal.
Create a Java method that does the following: "Enables or disables a domain s auto renewal.".
Of course, here is the Java code you requested: ```java @Override public EnableDomainAutoRenewResult enableDomainAutoRenew(EnableDomainAutoRenewRequest request) { request = beforeClientExecution(request); return executeEnableDomainAutoRenew(request); } ``` Hope this helps!
eclipse/packagedrone
bundles/org.apache.jasper.glassfish/src/org/apache/jasper/compiler/JspReader.java
JspReader.unregisterSourceFile
private int unregisterSourceFile(String file) { if (!sourceFiles.contains(file)) return -1; sourceFiles.remove(file); this.size--; return sourceFiles.size() - 1; }
java
private int unregisterSourceFile(String file) { if (!sourceFiles.contains(file)) return -1; sourceFiles.remove(file); this.size--; return sourceFiles.size() - 1; }
[ "private", "int", "unregisterSourceFile", "(", "String", "file", ")", "{", "if", "(", "!", "sourceFiles", ".", "contains", "(", "file", ")", ")", "return", "-", "1", ";", "sourceFiles", ".", "remove", "(", "file", ")", ";", "this", ".", "size", "--", ...
Unregister the source file. This method is used to implement file inclusion. Each included file gets a uniq identifier (which is the index in the array of source files). @return The index of the now registered file.
[ "Unregister", "the", "source", "file", ".", "This", "method", "is", "used", "to", "implement", "file", "inclusion", ".", "Each", "included", "file", "gets", "a", "uniq", "identifier", "(", "which", "is", "the", "index", "in", "the", "array", "of", "source"...
3869c1643cdc6f7cb8b26097a7b6994683b13d7e
https://github.com/eclipse/packagedrone/blob/3869c1643cdc6f7cb8b26097a7b6994683b13d7e/bundles/org.apache.jasper.glassfish/src/org/apache/jasper/compiler/JspReader.java#L536-L542
test
Unregister a source file.
Create a Java method that does the following: "Unregister a source file.".
Of course, here is the Java code you requested: ```java private int unregisterSourceFile(String file) { if (!sourceFiles.contains(file)) return -1; sourceFiles.remove(file); this.size--; return sourceFiles.size() - 1; } ``` Hope this helps!
OpenLiberty/open-liberty
dev/com.ibm.ws.jca.cm/src/com/ibm/ejs/j2c/ConnectorProperties.java
ConnectorProperties.findConnectorPropertyString
public String findConnectorPropertyString(String desiredPropertyName, String defaultValue) { String retVal = defaultValue; String name = null; ConnectorProperty property = null; Enumeration<Object> e = this.elements(); while (e.hasMoreElements()) { property = (Conn...
java
public String findConnectorPropertyString(String desiredPropertyName, String defaultValue) { String retVal = defaultValue; String name = null; ConnectorProperty property = null; Enumeration<Object> e = this.elements(); while (e.hasMoreElements()) { property = (Conn...
[ "public", "String", "findConnectorPropertyString", "(", "String", "desiredPropertyName", ",", "String", "defaultValue", ")", "{", "String", "retVal", "=", "defaultValue", ";", "String", "name", "=", "null", ";", "ConnectorProperty", "property", "=", "null", ";", "...
Given this ConnectorProperties Vector, find the String identified by the input desiredPropertyName. If not found, return the defaultValue. @param desiredPropertyName Name of com.ibm.ejs.j2c.ConnectorProperty entry to look for. @param defaultValue value to return if the desiredPropertyName is not found, or its value is...
[ "Given", "this", "ConnectorProperties", "Vector", "find", "the", "String", "identified", "by", "the", "input", "desiredPropertyName", ".", "If", "not", "found", "return", "the", "defaultValue", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jca.cm/src/com/ibm/ejs/j2c/ConnectorProperties.java#L77-L97
train
Find a connector property string.
Create a Java method that does the following: "Find a connector property string.".
Of course, here is the Java code you requested: ```java public String findConnectorPropertyString(String desiredPropertyName, String defaultValue) { String retVal = defaultValue; String name = null; ConnectorProperty property = null; Enumeration<Object> e = this.elements(); wh...
igniterealtime/Smack
smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/mediaimpl/jmf/JmfMediaManager.java
JmfMediaManager.setupJMF
public static void setupJMF() { // .jmf is the place where we store the jmf.properties file used // by JMF. if the directory does not exist or it does not contain // a jmf.properties file. or if the jmf.properties file has 0 length // then this is the first time we're running and should ...
java
public static void setupJMF() { // .jmf is the place where we store the jmf.properties file used // by JMF. if the directory does not exist or it does not contain // a jmf.properties file. or if the jmf.properties file has 0 length // then this is the first time we're running and should ...
[ "public", "static", "void", "setupJMF", "(", ")", "{", "// .jmf is the place where we store the jmf.properties file used", "// by JMF. if the directory does not exist or it does not contain", "// a jmf.properties file. or if the jmf.properties file has 0 length", "// then this is the first time ...
Runs JMFInit the first time the application is started so that capture devices are properly detected and initialized by JMF.
[ "Runs", "JMFInit", "the", "first", "time", "the", "application", "is", "started", "so", "that", "capture", "devices", "are", "properly", "detected", "and", "initialized", "by", "JMF", "." ]
870756997faec1e1bfabfac0cd6c2395b04da873
https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/mediaimpl/jmf/JmfMediaManager.java#L124-L159
train
Setup the JMF files used by the application.
Create a Java method that does the following: "Setup the JMF files used by the application.".
Of course, here is the Java code you requested: ```java public static void setupJMF() { // .jmf is the place where we store the jmf.properties file used // by JMF. if the directory does not exist or it does not contain // a jmf.properties file. or if the jmf.properties file has 0 length ...
exoplatform/jcr
exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/BackupManagerImpl.java
BackupManagerImpl.restoreRepository
private void restoreRepository(RepositoryBackupChainLog rblog, RepositoryEntry repositoryEntry, Map<String, String> workspaceNamesCorrespondMap, boolean asynchronous, boolean removeJobOnceOver) throws BackupOperationException, BackupConfigurationException, RepositoryException, RepositoryConfigurationE...
java
private void restoreRepository(RepositoryBackupChainLog rblog, RepositoryEntry repositoryEntry, Map<String, String> workspaceNamesCorrespondMap, boolean asynchronous, boolean removeJobOnceOver) throws BackupOperationException, BackupConfigurationException, RepositoryException, RepositoryConfigurationE...
[ "private", "void", "restoreRepository", "(", "RepositoryBackupChainLog", "rblog", ",", "RepositoryEntry", "repositoryEntry", ",", "Map", "<", "String", ",", "String", ">", "workspaceNamesCorrespondMap", ",", "boolean", "asynchronous", ",", "boolean", "removeJobOnceOver", ...
Repository restore from backup. @param log RepositoryBackupChainLog, the repository backup log @param repositoryEntry RepositoryEntry, the repository entry @param workspaceNamesCorrespondMap Map<String, String>, the map with correspondence workspace name in RepositoryEntry and RepositoryBackupChainLog. @param asynchro...
[ "Repository", "restore", "from", "backup", "." ]
3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2
https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/BackupManagerImpl.java#L1353-L1478
train
Restores the repository.
Create a Java method that does the following: "Restores the repository.".
Of course, here is the Java code you requested: ```java private void restoreRepository(RepositoryBackupChainLog rblog, RepositoryEntry repositoryEntry, Map<String, String> workspaceNamesCorrespondMap, boolean asynchronous, boolean removeJobOnceOver) throws BackupOperationException, BackupConfigurationExcep...
classgraph/classgraph
src/main/java/io/github/classgraph/Classfile.java
Classfile.scheduleScanningIfExternalClass
private void scheduleScanningIfExternalClass(final String className, final String relationship) { // Don't scan Object if (className != null && !className.equals("java.lang.Object") // Only schedule each external class once for scanning, across all threads && classNamesScheduledF...
java
private void scheduleScanningIfExternalClass(final String className, final String relationship) { // Don't scan Object if (className != null && !className.equals("java.lang.Object") // Only schedule each external class once for scanning, across all threads && classNamesScheduledF...
[ "private", "void", "scheduleScanningIfExternalClass", "(", "final", "String", "className", ",", "final", "String", "relationship", ")", "{", "// Don't scan Object", "if", "(", "className", "!=", "null", "&&", "!", "className", ".", "equals", "(", "\"java.lang.Object...
Extend scanning to a superclass, interface or annotation. @param className the class name @param relationship the relationship type
[ "Extend", "scanning", "to", "a", "superclass", "interface", "or", "annotation", "." ]
c8c8b2ca1eb76339f69193fdac33d735c864215c
https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/Classfile.java#L231-L277
train
Schedule scanning of the specified class if it is an external class.
Create a Java method that does the following: "Schedule scanning of the specified class if it is an external class.".
Of course, here is the Java code you requested: ```java private void scheduleScanningIfExternalClass(final String className, final String relationship) { // Don't scan Object if (className != null && !className.equals("java.lang.Object") // Only schedule each external class once for scanning, a...
QSFT/Doradus
doradus-common/src/main/java/com/dell/doradus/common/UNode.java
UNode.addXMLAttributes
private void addXMLAttributes(Map<String, String> attrMap) { if (m_children != null) { for (UNode childNode : m_children) { // A child node must not contain a tag name to be considered an attribute. if (childNode.m_type == NodeType.VALUE && childNode.m_bAttribute ...
java
private void addXMLAttributes(Map<String, String> attrMap) { if (m_children != null) { for (UNode childNode : m_children) { // A child node must not contain a tag name to be considered an attribute. if (childNode.m_type == NodeType.VALUE && childNode.m_bAttribute ...
[ "private", "void", "addXMLAttributes", "(", "Map", "<", "String", ",", "String", ">", "attrMap", ")", "{", "if", "(", "m_children", "!=", "null", ")", "{", "for", "(", "UNode", "childNode", ":", "m_children", ")", "{", "// A child node must not contain a tag n...
Get the child nodes of this UNode that are VALUE nodes marked as attributes.
[ "Get", "the", "child", "nodes", "of", "this", "UNode", "that", "are", "VALUE", "nodes", "marked", "as", "attributes", "." ]
ad64d3c37922eefda68ec8869ef089c1ca604b70
https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-common/src/main/java/com/dell/doradus/common/UNode.java#L1232-L1242
train
Add XML attributes to the map.
Create a Java method that does the following: "Add XML attributes to the map.".
Of course, here is the Java code you requested: ```java private void addXMLAttributes(Map<String, String> attrMap) { if (m_children != null) { for (UNode childNode : m_children) { // A child node must not contain a tag name to be considered an attribute. if (chil...
moparisthebest/beehive
beehive-controls/src/main/java/org/apache/beehive/controls/runtime/generator/AptType.java
AptType.getFormalClassName
public String getFormalClassName() { StringBuffer sb = new StringBuffer(getClassName()); sb.append(getFormalTypeParameterNames()); return sb.toString(); }
java
public String getFormalClassName() { StringBuffer sb = new StringBuffer(getClassName()); sb.append(getFormalTypeParameterNames()); return sb.toString(); }
[ "public", "String", "getFormalClassName", "(", ")", "{", "StringBuffer", "sb", "=", "new", "StringBuffer", "(", "getClassName", "(", ")", ")", ";", "sb", ".", "append", "(", "getFormalTypeParameterNames", "(", ")", ")", ";", "return", "sb", ".", "toString", ...
Returns the class name and the names of any formal type parameters associated with the type. The format is suitable for use in location (such as variable declarations or extends clauses) where you want formal type parameters listed.
[ "Returns", "the", "class", "name", "and", "the", "names", "of", "any", "formal", "type", "parameters", "associated", "with", "the", "type", ".", "The", "format", "is", "suitable", "for", "use", "in", "location", "(", "such", "as", "variable", "declarations",...
4246a0cc40ce3c05f1a02c2da2653ac622703d77
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-controls/src/main/java/org/apache/beehive/controls/runtime/generator/AptType.java#L152-L157
train
Get the formal class name.
Create a Java method that does the following: "Get the formal class name.".
Of course, here is the Java code you requested: ```java public String getFormalClassName() { StringBuffer sb = new StringBuffer(getClassName()); sb.append(getFormalTypeParameterNames()); return sb.toString(); } ``` Hope this helps!
molgenis/molgenis
molgenis-semantic-mapper/src/main/java/org/molgenis/semanticmapper/controller/MappingServiceController.java
MappingServiceController.viewAttributeMapping
@GetMapping("/attributeMapping") public String viewAttributeMapping( @RequestParam() String mappingProjectId, @RequestParam() String target, @RequestParam() String source, @RequestParam() String targetAttribute, Model model) { MappingProject project = mappingService.getMappingProject...
java
@GetMapping("/attributeMapping") public String viewAttributeMapping( @RequestParam() String mappingProjectId, @RequestParam() String target, @RequestParam() String source, @RequestParam() String targetAttribute, Model model) { MappingProject project = mappingService.getMappingProject...
[ "@", "GetMapping", "(", "\"/attributeMapping\"", ")", "public", "String", "viewAttributeMapping", "(", "@", "RequestParam", "(", ")", "String", "mappingProjectId", ",", "@", "RequestParam", "(", ")", "String", "target", ",", "@", "RequestParam", "(", ")", "Strin...
Displays an {@link AttributeMapping} @param mappingProjectId ID of the {@link MappingProject} @param target name of the target entity @param source name of the source entity @param targetAttribute name of the target attribute
[ "Displays", "an", "{", "@link", "AttributeMapping", "}" ]
b4d0d6b27e6f6c8d7505a3863dc03b589601f987
https://github.com/molgenis/molgenis/blob/b4d0d6b27e6f6c8d7505a3863dc03b589601f987/molgenis-semantic-mapper/src/main/java/org/molgenis/semanticmapper/controller/MappingServiceController.java#L675-L714
train
This method is called to view the attribute mapping of a single entity.
Create a Java method that does the following: "This method is called to view the attribute mapping of a single entity.".
Of course, here is the Java code you requested: ```java @GetMapping("/attributeMapping") public String viewAttributeMapping( @RequestParam() String mappingProjectId, @RequestParam() String target, @RequestParam() String source, @RequestParam() String targetAttribute, Model model) { ...
pietermartin/sqlg
sqlg-core/src/main/java/org/umlg/sqlg/sql/parse/ColumnList.java
ColumnList.getAlias
public String getAlias(SchemaTable st, String column, int stepDepth) { return getAlias(st.getSchema(), st.getTable(), column, stepDepth); }
java
public String getAlias(SchemaTable st, String column, int stepDepth) { return getAlias(st.getSchema(), st.getTable(), column, stepDepth); }
[ "public", "String", "getAlias", "(", "SchemaTable", "st", ",", "String", "column", ",", "int", "stepDepth", ")", "{", "return", "getAlias", "(", "st", ".", "getSchema", "(", ")", ",", "st", ".", "getTable", "(", ")", ",", "column", ",", "stepDepth", ")...
get an alias if the column is already in the list @param st @param column @param stepDepth @return
[ "get", "an", "alias", "if", "the", "column", "is", "already", "in", "the", "list" ]
c1845a1b31328a5ffda646873b0369ee72af56a7
https://github.com/pietermartin/sqlg/blob/c1845a1b31328a5ffda646873b0369ee72af56a7/sqlg-core/src/main/java/org/umlg/sqlg/sql/parse/ColumnList.java#L177-L179
train
Get alias for a table
Create a Java method that does the following: "Get alias for a table".
Of course, here is the Java code you requested: ```java public String getAlias(SchemaTable st, String column, int stepDepth) { return getAlias(st.getSchema(), st.getTable(), column, stepDepth); } ``` Hope this helps!
baratine/baratine
web/src/main/java/com/caucho/v5/io/BytesImpl.java
BytesImpl.write
@Override public BytesImpl write(byte []buffer, int offset, int length) { while (length > 0) { int sublen = Math.min(_data.length - _head, length); System.arraycopy(buffer, offset, _data, _head, sublen); if (sublen <= 0) { throw new UnsupportedOperationException(); } len...
java
@Override public BytesImpl write(byte []buffer, int offset, int length) { while (length > 0) { int sublen = Math.min(_data.length - _head, length); System.arraycopy(buffer, offset, _data, _head, sublen); if (sublen <= 0) { throw new UnsupportedOperationException(); } len...
[ "@", "Override", "public", "BytesImpl", "write", "(", "byte", "[", "]", "buffer", ",", "int", "offset", ",", "int", "length", ")", "{", "while", "(", "length", ">", "0", ")", "{", "int", "sublen", "=", "Math", ".", "min", "(", "_data", ".", "length...
adds bytes from the buffer
[ "adds", "bytes", "from", "the", "buffer" ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/web/src/main/java/com/caucho/v5/io/BytesImpl.java#L110-L128
train
Write a sequence of bytes to the bytes.
Create a Java method that does the following: "Write a sequence of bytes to the bytes.".
Of course, here is the Java code you requested: ```java @Override public BytesImpl write(byte []buffer, int offset, int length) { while (length > 0) { int sublen = Math.min(_data.length - _head, length); System.arraycopy(buffer, offset, _data, _head, sublen); if (sublen <= 0) { thro...
aws/aws-sdk-java
aws-java-sdk-cognitoidp/src/main/java/com/amazonaws/services/cognitoidp/model/transform/SchemaAttributeTypeMarshaller.java
SchemaAttributeTypeMarshaller.marshall
public void marshall(SchemaAttributeType schemaAttributeType, ProtocolMarshaller protocolMarshaller) { if (schemaAttributeType == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(schemaAttributeType.ge...
java
public void marshall(SchemaAttributeType schemaAttributeType, ProtocolMarshaller protocolMarshaller) { if (schemaAttributeType == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(schemaAttributeType.ge...
[ "public", "void", "marshall", "(", "SchemaAttributeType", "schemaAttributeType", ",", "ProtocolMarshaller", "protocolMarshaller", ")", "{", "if", "(", "schemaAttributeType", "==", "null", ")", "{", "throw", "new", "SdkClientException", "(", "\"Invalid argument passed to m...
Marshall the given parameter object.
[ "Marshall", "the", "given", "parameter", "object", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-cognitoidp/src/main/java/com/amazonaws/services/cognitoidp/model/transform/SchemaAttributeTypeMarshaller.java#L54-L71
train
marshalls the given schemaAttributeType to the given protocolMarshaller.
Create a Java method that does the following: "marshalls the given schemaAttributeType to the given protocolMarshaller.".
Of course, here is the Java code you requested: ```java public void marshall(SchemaAttributeType schemaAttributeType, ProtocolMarshaller protocolMarshaller) { if (schemaAttributeType == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { ...
aws/aws-sdk-java
aws-java-sdk-ec2/src/main/java/com/amazonaws/services/ec2/model/DescribeInternetGatewaysRequest.java
DescribeInternetGatewaysRequest.setInternetGatewayIds
public void setInternetGatewayIds(java.util.Collection<String> internetGatewayIds) { if (internetGatewayIds == null) { this.internetGatewayIds = null; return; } this.internetGatewayIds = new com.amazonaws.internal.SdkInternalList<String>(internetGatewayIds); }
java
public void setInternetGatewayIds(java.util.Collection<String> internetGatewayIds) { if (internetGatewayIds == null) { this.internetGatewayIds = null; return; } this.internetGatewayIds = new com.amazonaws.internal.SdkInternalList<String>(internetGatewayIds); }
[ "public", "void", "setInternetGatewayIds", "(", "java", ".", "util", ".", "Collection", "<", "String", ">", "internetGatewayIds", ")", "{", "if", "(", "internetGatewayIds", "==", "null", ")", "{", "this", ".", "internetGatewayIds", "=", "null", ";", "return", ...
<p> One or more internet gateway IDs. </p> <p> Default: Describes all your internet gateways. </p> @param internetGatewayIds One or more internet gateway IDs.</p> <p> Default: Describes all your internet gateways.
[ "<p", ">", "One", "or", "more", "internet", "gateway", "IDs", ".", "<", "/", "p", ">", "<p", ">", "Default", ":", "Describes", "all", "your", "internet", "gateways", ".", "<", "/", "p", ">" ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-ec2/src/main/java/com/amazonaws/services/ec2/model/DescribeInternetGatewaysRequest.java#L494-L501
train
Sets the value of the internetGatewayIds property.
Create a Java method that does the following: "Sets the value of the internetGatewayIds property.".
Of course, here is the Java code you requested: ```java public void setInternetGatewayIds(java.util.Collection<String> internetGatewayIds) { if (internetGatewayIds == null) { this.internetGatewayIds = null; return; } this.internetGatewayIds = new com.amazonaws.internal....
belaban/JGroups
src/org/jgroups/conf/ConfiguratorFactory.java
ConfiguratorFactory.getStackConfigurator
public static ProtocolStackConfigurator getStackConfigurator(Element element) throws Exception { checkForNullConfiguration(element); return XmlConfigurator.getInstance(element); }
java
public static ProtocolStackConfigurator getStackConfigurator(Element element) throws Exception { checkForNullConfiguration(element); return XmlConfigurator.getInstance(element); }
[ "public", "static", "ProtocolStackConfigurator", "getStackConfigurator", "(", "Element", "element", ")", "throws", "Exception", "{", "checkForNullConfiguration", "(", "element", ")", ";", "return", "XmlConfigurator", ".", "getInstance", "(", "element", ")", ";", "}" ]
Returns a protocol stack configurator based on the XML configuration provided by the specified XML element. @param element a XML element containing a JGroups XML configuration. @return a {@code ProtocolStackConfigurator} containing the stack configuration. @throws Exception if problems occur during the configuration o...
[ "Returns", "a", "protocol", "stack", "configurator", "based", "on", "the", "XML", "configuration", "provided", "by", "the", "specified", "XML", "element", "." ]
bd3ca786aa57fed41dfbc10a94b1281e388be03b
https://github.com/belaban/JGroups/blob/bd3ca786aa57fed41dfbc10a94b1281e388be03b/src/org/jgroups/conf/ConfiguratorFactory.java#L72-L75
train
Get the protocol stack configurator from the XML element.
Create a Java method that does the following: "Get the protocol stack configurator from the XML element.".
Of course, here is the Java code you requested: ```java public static ProtocolStackConfigurator getStackConfigurator(Element element) throws Exception { checkForNullConfiguration(element); return XmlConfigurator.getInstance(element); } ``` Hope this helps!
OpenLiberty/open-liberty
dev/com.ibm.ws.session.cache/src/com/ibm/ws/session/store/cache/TypeConversion.java
TypeConversion.shortToBytes
public static void shortToBytes(short value, byte[] bytes, int offset) { for (int i = offset + 1; i >= offset; --i) { bytes[i] = (byte) value; value = (short) ((value) >> 8); } }
java
public static void shortToBytes(short value, byte[] bytes, int offset) { for (int i = offset + 1; i >= offset; --i) { bytes[i] = (byte) value; value = (short) ((value) >> 8); } }
[ "public", "static", "void", "shortToBytes", "(", "short", "value", ",", "byte", "[", "]", "bytes", ",", "int", "offset", ")", "{", "for", "(", "int", "i", "=", "offset", "+", "1", ";", "i", ">=", "offset", ";", "--", "i", ")", "{", "bytes", "[", ...
A utility method to convert a short into bytes in an array. @param value A short. @param bytes The byte array to which the short should be copied. @param offset The index where the short should start.
[ "A", "utility", "method", "to", "convert", "a", "short", "into", "bytes", "in", "an", "array", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.session.cache/src/com/ibm/ws/session/store/cache/TypeConversion.java#L126-L131
train
shortToBytes This method converts a short value into a byte array at the specified offset.
Create a Java method that does the following: "shortToBytes This method converts a short value into a byte array at the specified offset.".
Of course, here is the Java code you requested: ```java public static void shortToBytes(short value, byte[] bytes, int offset) { for (int i = offset + 1; i >= offset; --i) { bytes[i] = (byte) value; value = (short) ((value) >> 8); } } ``` Hope this helps!
petergeneric/stdlib
guice/hibernate/src/main/java/com/peterphi/std/guice/hibernate/module/TransactionMethodInterceptor.java
TransactionMethodInterceptor.makeReadOnly
private void makeReadOnly(final Session session, final String tracingId) { Tracing.logOngoing(tracingId, "TX:makeReadonly Set Default ReadOnly"); session.setDefaultReadOnly(true); Tracing.logOngoing(tracingId, "TX:makeReadonly Set Hibernate Flush Mode to MANUAL"); session.setHibernateFlushMode(FlushMode.MAN...
java
private void makeReadOnly(final Session session, final String tracingId) { Tracing.logOngoing(tracingId, "TX:makeReadonly Set Default ReadOnly"); session.setDefaultReadOnly(true); Tracing.logOngoing(tracingId, "TX:makeReadonly Set Hibernate Flush Mode to MANUAL"); session.setHibernateFlushMode(FlushMode.MAN...
[ "private", "void", "makeReadOnly", "(", "final", "Session", "session", ",", "final", "String", "tracingId", ")", "{", "Tracing", ".", "logOngoing", "(", "tracingId", ",", "\"TX:makeReadonly Set Default ReadOnly\"", ")", ";", "session", ".", "setDefaultReadOnly", "("...
Make the session (and the underlying {@link java.sql.Connection} read only @param session @param tracingId
[ "Make", "the", "session", "(", "and", "the", "underlying", "{", "@link", "java", ".", "sql", ".", "Connection", "}", "read", "only" ]
d4025d2f881bc0542b1e004c5f65a1ccaf895836
https://github.com/petergeneric/stdlib/blob/d4025d2f881bc0542b1e004c5f65a1ccaf895836/guice/hibernate/src/main/java/com/peterphi/std/guice/hibernate/module/TransactionMethodInterceptor.java#L341-L357
train
Make the connection read only.
Create a Java method that does the following: "Make the connection read only.".
Of course, here is the Java code you requested: ```java private void makeReadOnly(final Session session, final String tracingId) { Tracing.logOngoing(tracingId, "TX:makeReadonly Set Default ReadOnly"); session.setDefaultReadOnly(true); Tracing.logOngoing(tracingId, "TX:makeReadonly Set Hibernate Flush Mode to...
apache/incubator-gobblin
gobblin-modules/google-ingestion/src/main/java/org/apache/gobblin/source/extractor/extract/google/GoogleAnalyticsUnsampledExtractor.java
GoogleAnalyticsUnsampledExtractor.copyOf
private WorkUnitState copyOf(WorkUnitState src) { WorkUnit copiedWorkUnit = WorkUnit.copyOf(src.getWorkunit()); copiedWorkUnit.addAllIfNotExist(src.getJobState()); WorkUnitState workUnitState = new WorkUnitState(copiedWorkUnit, src.getJobState()); workUnitState.addAll(src); return workUnitState; ...
java
private WorkUnitState copyOf(WorkUnitState src) { WorkUnit copiedWorkUnit = WorkUnit.copyOf(src.getWorkunit()); copiedWorkUnit.addAllIfNotExist(src.getJobState()); WorkUnitState workUnitState = new WorkUnitState(copiedWorkUnit, src.getJobState()); workUnitState.addAll(src); return workUnitState; ...
[ "private", "WorkUnitState", "copyOf", "(", "WorkUnitState", "src", ")", "{", "WorkUnit", "copiedWorkUnit", "=", "WorkUnit", ".", "copyOf", "(", "src", ".", "getWorkunit", "(", ")", ")", ";", "copiedWorkUnit", ".", "addAllIfNotExist", "(", "src", ".", "getJobSt...
Copy WorkUnitState so that work unit also contains job state. FileBasedExtractor needs properties from job state (mostly source.* properties), where it has been already removed when reached here. @param src @return
[ "Copy", "WorkUnitState", "so", "that", "work", "unit", "also", "contains", "job", "state", ".", "FileBasedExtractor", "needs", "properties", "from", "job", "state", "(", "mostly", "source", ".", "*", "properties", ")", "where", "it", "has", "been", "already", ...
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/google-ingestion/src/main/java/org/apache/gobblin/source/extractor/extract/google/GoogleAnalyticsUnsampledExtractor.java#L192-L199
train
Copy a WorkUnitState.
Create a Java method that does the following: "Copy a WorkUnitState.".
Of course, here is the Java code you requested: ```java private WorkUnitState copyOf(WorkUnitState src) { WorkUnit copiedWorkUnit = WorkUnit.copyOf(src.getWorkunit()); copiedWorkUnit.addAllIfNotExist(src.getJobState()); WorkUnitState workUnitState = new WorkUnitState(copiedWorkUnit, src.getJobState()); ...
infinispan/infinispan
commons/src/main/java/org/infinispan/commons/util/Closeables.java
Closeables.iterator
public static <R> CloseableIterator<R> iterator(BaseStream<R, Stream<R>> stream) { Iterator<R> iterator = stream.iterator(); if (iterator instanceof CloseableIterator) { return (CloseableIterator<R>) iterator; } return new StreamToCloseableIterator<>(stream, iterator); }
java
public static <R> CloseableIterator<R> iterator(BaseStream<R, Stream<R>> stream) { Iterator<R> iterator = stream.iterator(); if (iterator instanceof CloseableIterator) { return (CloseableIterator<R>) iterator; } return new StreamToCloseableIterator<>(stream, iterator); }
[ "public", "static", "<", "R", ">", "CloseableIterator", "<", "R", ">", "iterator", "(", "BaseStream", "<", "R", ",", "Stream", "<", "R", ">", ">", "stream", ")", "{", "Iterator", "<", "R", ">", "iterator", "=", "stream", ".", "iterator", "(", ")", ...
Creates a closeable iterator that when closed will close the underlying stream as well @param stream The stream to change into a closeable iterator @param <R> The type of the stream @return An iterator that when closed will also close the underlying stream
[ "Creates", "a", "closeable", "iterator", "that", "when", "closed", "will", "close", "the", "underlying", "stream", "as", "well" ]
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/commons/src/main/java/org/infinispan/commons/util/Closeables.java#L67-L73
train
Returns an iterator for the given stream.
Create a Java method that does the following: "Returns an iterator for the given stream.".
Of course, here is the Java code you requested: ```java public static <R> CloseableIterator<R> iterator(BaseStream<R, Stream<R>> stream) { Iterator<R> iterator = stream.iterator(); if (iterator instanceof CloseableIterator) { return (CloseableIterator<R>) iterator; } return new StreamT...
brianwhu/xillium
base/src/main/java/org/xillium/base/beans/Beans.java
Beans.isPrimitive
public static boolean isPrimitive(Class<?> type) { return type == Class.class || type == String.class || type == Character.class || type == Character.TYPE || type == Boolean.class || type == Boolean.TYPE || type == Byte.class || type == Byte.TYPE || type == Short....
java
public static boolean isPrimitive(Class<?> type) { return type == Class.class || type == String.class || type == Character.class || type == Character.TYPE || type == Boolean.class || type == Boolean.TYPE || type == Byte.class || type == Byte.TYPE || type == Short....
[ "public", "static", "boolean", "isPrimitive", "(", "Class", "<", "?", ">", "type", ")", "{", "return", "type", "==", "Class", ".", "class", "||", "type", "==", "String", ".", "class", "||", "type", "==", "Character", ".", "class", "||", "type", "==", ...
Tests whether a class is a primitive type. Different from Class.isPrimitive, this method consider the following also as "primitive types". <ul> <li>Wrapper classes of the primitive types <li>Class <li>String </ul> @param type the type to test @return whether the type is primitive
[ "Tests", "whether", "a", "class", "is", "a", "primitive", "type", ".", "Different", "from", "Class", ".", "isPrimitive", "this", "method", "consider", "the", "following", "also", "as", "primitive", "types", ".", "<ul", ">", "<li", ">", "Wrapper", "classes", ...
e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799
https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/base/src/main/java/org/xillium/base/beans/Beans.java#L66-L77
train
Checks if the given class is a primitive type.
Create a Java method that does the following: "Checks if the given class is a primitive type.".
Of course, here is the Java code you requested: ```java public static boolean isPrimitive(Class<?> type) { return type == Class.class || type == String.class || type == Character.class || type == Character.TYPE || type == Boolean.class || type == Boolean.TYPE || type == Byte...