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
Azure/azure-sdk-for-java
recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/JobOperationResultsInner.java
JobOperationResultsInner.get
public void get(String vaultName, String resourceGroupName, String jobName, String operationId) { getWithServiceResponseAsync(vaultName, resourceGroupName, jobName, operationId).toBlocking().single().body(); }
java
public void get(String vaultName, String resourceGroupName, String jobName, String operationId) { getWithServiceResponseAsync(vaultName, resourceGroupName, jobName, operationId).toBlocking().single().body(); }
[ "public", "void", "get", "(", "String", "vaultName", ",", "String", "resourceGroupName", ",", "String", "jobName", ",", "String", "operationId", ")", "{", "getWithServiceResponseAsync", "(", "vaultName", ",", "resourceGroupName", ",", "jobName", ",", "operationId", ...
Gets the result of the operation. @param vaultName The name of the Recovery Services vault. @param resourceGroupName The name of the resource group associated with the Recovery Services vault. @param jobName Job name associated with this GET operation. @param operationId OperationID associated with this GET operation....
[ "Gets", "the", "result", "of", "the", "operation", "." ]
aab183ddc6686c82ec10386d5a683d2691039626
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/JobOperationResultsInner.java#L71-L73
train
Gets a CDN image image.
Create a Java method that does the following: "Gets a CDN image image.".
Of course, here is the Java code you requested: ```java public void get(String vaultName, String resourceGroupName, String jobName, String operationId) { getWithServiceResponseAsync(vaultName, resourceGroupName, jobName, operationId).toBlocking().single().body(); } ``` Hope this helps!
jlinn/quartz-redis-jobstore
src/main/java/net/joelinn/quartz/jobstore/AbstractRedisStorage.java
AbstractRedisStorage.checkExists
public boolean checkExists(JobKey jobKey, T jedis){ return jedis.exists(redisSchema.jobHashKey(jobKey)); }
java
public boolean checkExists(JobKey jobKey, T jedis){ return jedis.exists(redisSchema.jobHashKey(jobKey)); }
[ "public", "boolean", "checkExists", "(", "JobKey", "jobKey", ",", "T", "jedis", ")", "{", "return", "jedis", ".", "exists", "(", "redisSchema", ".", "jobHashKey", "(", "jobKey", ")", ")", ";", "}" ]
Check if the job identified by the given key exists in storage @param jobKey the key of the desired job @param jedis a thread-safe Redis connection @return true if the job exists; false otherwise
[ "Check", "if", "the", "job", "identified", "by", "the", "given", "key", "exists", "in", "storage" ]
be9a52ee776d8a09866fe99fd9718bc13a0cb992
https://github.com/jlinn/quartz-redis-jobstore/blob/be9a52ee776d8a09866fe99fd9718bc13a0cb992/src/main/java/net/joelinn/quartz/jobstore/AbstractRedisStorage.java#L353-L355
train
Check if the job exists in Redis
Create a Java method that does the following: "Check if the job exists in Redis".
Of course, here is the Java code you requested: ```java public boolean checkExists(JobKey jobKey, T jedis){ return jedis.exists(redisSchema.jobHashKey(jobKey)); } ``` Hope this helps!
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-properties/src/main/java/org/xwiki/properties/internal/DefaultBeanDescriptor.java
DefaultBeanDescriptor.extractBeanDescriptor
protected void extractBeanDescriptor() { Object defaultInstance = null; try { defaultInstance = getBeanClass().newInstance(); } catch (Exception e) { LOGGER.debug("Failed to create a new default instance for class " + this.beanClass + ". The BeanD...
java
protected void extractBeanDescriptor() { Object defaultInstance = null; try { defaultInstance = getBeanClass().newInstance(); } catch (Exception e) { LOGGER.debug("Failed to create a new default instance for class " + this.beanClass + ". The BeanD...
[ "protected", "void", "extractBeanDescriptor", "(", ")", "{", "Object", "defaultInstance", "=", "null", ";", "try", "{", "defaultInstance", "=", "getBeanClass", "(", ")", ".", "newInstance", "(", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "LOG...
Extract informations form the bean.
[ "Extract", "informations", "form", "the", "bean", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-properties/src/main/java/org/xwiki/properties/internal/DefaultBeanDescriptor.java#L96-L132
train
Extract the BeanDescriptor from the BeanClass.
Create a Java method that does the following: "Extract the BeanDescriptor from the BeanClass.".
Of course, here is the Java code you requested: ```java protected void extractBeanDescriptor() { Object defaultInstance = null; try { defaultInstance = getBeanClass().newInstance(); } catch (Exception e) { LOGGER.debug("Failed to create a new default instance for cl...
marklogic/marklogic-contentpump
mapreduce/src/main/java/com/marklogic/dom/NodeImpl.java
NodeImpl.replaceChild
public Node replaceChild(Node newChild, Node oldChild) throws DOMException { throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, null); }
java
public Node replaceChild(Node newChild, Node oldChild) throws DOMException { throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, null); }
[ "public", "Node", "replaceChild", "(", "Node", "newChild", ",", "Node", "oldChild", ")", "throws", "DOMException", "{", "throw", "new", "DOMException", "(", "DOMException", ".", "NO_MODIFICATION_ALLOWED_ERR", ",", "null", ")", ";", "}" ]
Unsupported.
[ "Unsupported", "." ]
4c41e4a953301f81a4c655efb2a847603dee8afc
https://github.com/marklogic/marklogic-contentpump/blob/4c41e4a953301f81a4c655efb2a847603dee8afc/mapreduce/src/main/java/com/marklogic/dom/NodeImpl.java#L436-L438
train
Replace the child of this node with a new node.
Create a Java method that does the following: "Replace the child of this node with a new node.".
Of course, here is the Java code you requested: ```java public Node replaceChild(Node newChild, Node oldChild) throws DOMException { throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, null); } ``` Hope this helps!
alkacon/opencms-core
src/org/opencms/i18n/tools/CmsContainerPageCopier.java
CmsContainerPageCopier.getRootCms
private CmsObject getRootCms() throws CmsException { if (null == m_rootCms) { m_rootCms = OpenCms.initCmsObject(m_cms); m_rootCms.getRequestContext().setSiteRoot(""); } return m_rootCms; }
java
private CmsObject getRootCms() throws CmsException { if (null == m_rootCms) { m_rootCms = OpenCms.initCmsObject(m_cms); m_rootCms.getRequestContext().setSiteRoot(""); } return m_rootCms; }
[ "private", "CmsObject", "getRootCms", "(", ")", "throws", "CmsException", "{", "if", "(", "null", "==", "m_rootCms", ")", "{", "m_rootCms", "=", "OpenCms", ".", "initCmsObject", "(", "m_cms", ")", ";", "m_rootCms", ".", "getRequestContext", "(", ")", ".", ...
Return the cms object with the site root set to "/". @return the cms object with the site root set to "/". @throws CmsException thrown if initializing the root cms object fails.
[ "Return", "the", "cms", "object", "with", "the", "site", "root", "set", "to", "/", "." ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/i18n/tools/CmsContainerPageCopier.java#L684-L691
train
Returns the root cms.
Create a Java method that does the following: "Returns the root cms.".
Of course, here is the Java code you requested: ```java private CmsObject getRootCms() throws CmsException { if (null == m_rootCms) { m_rootCms = OpenCms.initCmsObject(m_cms); m_rootCms.getRequestContext().setSiteRoot(""); } return m_rootCms; } ``` Hope this helps!
apache/flink
flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/WindowedStream.java
WindowedStream.aggregate
@PublicEvolving public <ACC, R> SingleOutputStreamOperator<R> aggregate( AggregateFunction<T, ACC, R> function, TypeInformation<ACC> accumulatorType, TypeInformation<R> resultType) { checkNotNull(function, "function"); checkNotNull(accumulatorType, "accumulatorType"); checkNotNull(resultType, "resultTy...
java
@PublicEvolving public <ACC, R> SingleOutputStreamOperator<R> aggregate( AggregateFunction<T, ACC, R> function, TypeInformation<ACC> accumulatorType, TypeInformation<R> resultType) { checkNotNull(function, "function"); checkNotNull(accumulatorType, "accumulatorType"); checkNotNull(resultType, "resultTy...
[ "@", "PublicEvolving", "public", "<", "ACC", ",", "R", ">", "SingleOutputStreamOperator", "<", "R", ">", "aggregate", "(", "AggregateFunction", "<", "T", ",", "ACC", ",", "R", ">", "function", ",", "TypeInformation", "<", "ACC", ">", "accumulatorType", ",", ...
Applies the given aggregation function to each window. The aggregation function is called for each element, aggregating values incrementally and keeping the state to one accumulator per key and window. @param function The aggregation function. @return The data stream that is the result of applying the aggregation func...
[ "Applies", "the", "given", "aggregation", "function", "to", "each", "window", ".", "The", "aggregation", "function", "is", "called", "for", "each", "element", "aggregating", "values", "incrementally", "and", "keeping", "the", "state", "to", "one", "accumulator", ...
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/WindowedStream.java#L716-L732
train
Returns a new stream aggregation function that performs a pass through window aggregation.
Create a Java method that does the following: "Returns a new stream aggregation function that performs a pass through window aggregation.".
Of course, here is the Java code you requested: ```java @PublicEvolving public <ACC, R> SingleOutputStreamOperator<R> aggregate( AggregateFunction<T, ACC, R> function, TypeInformation<ACC> accumulatorType, TypeInformation<R> resultType) { checkNotNull(function, "function"); checkNotNull(accumulatorType,...
CenturyLinkCloud/mdw
mdw-workflow/src/com/centurylink/mdw/workflow/adapter/db/JdbcSqlAdapter.java
JdbcSqlAdapter.getRequestData
@Override protected Object getRequestData() throws ActivityException { try { return executePreScript(getSqlQuery()); } catch (Exception ex) { throw new ActivityException(ex.getMessage(), ex); } }
java
@Override protected Object getRequestData() throws ActivityException { try { return executePreScript(getSqlQuery()); } catch (Exception ex) { throw new ActivityException(ex.getMessage(), ex); } }
[ "@", "Override", "protected", "Object", "getRequestData", "(", ")", "throws", "ActivityException", "{", "try", "{", "return", "executePreScript", "(", "getSqlQuery", "(", ")", ")", ";", "}", "catch", "(", "Exception", "ex", ")", "{", "throw", "new", "Activit...
Returns the parameterized SQL query to execute.
[ "Returns", "the", "parameterized", "SQL", "query", "to", "execute", "." ]
91167fe65a25a5d7022cdcf8b0fae8506f5b87ce
https://github.com/CenturyLinkCloud/mdw/blob/91167fe65a25a5d7022cdcf8b0fae8506f5b87ce/mdw-workflow/src/com/centurylink/mdw/workflow/adapter/db/JdbcSqlAdapter.java#L177-L185
train
Override this method to get the request data from the database.
Create a Java method that does the following: "Override this method to get the request data from the database.".
Of course, here is the Java code you requested: ```java @Override protected Object getRequestData() throws ActivityException { try { return executePreScript(getSqlQuery()); } catch (Exception ex) { throw new ActivityException(ex.getMessage(), ex); } } ```...
structr/structr
structr-rest/src/main/java/org/structr/rest/serialization/StreamingWriter.java
StreamingWriter.doParallel
private void doParallel(final List list, final RestWriter parentWriter, final Set<Integer> visitedObjects, final Operation op) { final SecurityContext securityContext = parentWriter.getSecurityContext(); final int numberOfPartitions = (int)Math.rint(Math.log(list.size())) + 1; final List<List> partition...
java
private void doParallel(final List list, final RestWriter parentWriter, final Set<Integer> visitedObjects, final Operation op) { final SecurityContext securityContext = parentWriter.getSecurityContext(); final int numberOfPartitions = (int)Math.rint(Math.log(list.size())) + 1; final List<List> partition...
[ "private", "void", "doParallel", "(", "final", "List", "list", ",", "final", "RestWriter", "parentWriter", ",", "final", "Set", "<", "Integer", ">", "visitedObjects", ",", "final", "Operation", "op", ")", "{", "final", "SecurityContext", "securityContext", "=", ...
----- private methods -----
[ "-----", "private", "methods", "-----" ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-rest/src/main/java/org/structr/rest/serialization/StreamingWriter.java#L519-L580
train
This method is used to perform a parallel operation on the given list of objects.
Create a Java method that does the following: "This method is used to perform a parallel operation on the given list of objects.".
Of course, here is the Java code you requested: ```java private void doParallel(final List list, final RestWriter parentWriter, final Set<Integer> visitedObjects, final Operation op) { final SecurityContext securityContext = parentWriter.getSecurityContext(); final int numberOfPartitions = (int)Math.rint...
windup/windup
rules-java/api/src/main/java/org/jboss/windup/rules/apps/java/scan/operation/packagemapping/PackageNameMapping.java
PackageNameMapping.isExclusivelyKnownArchive
public static boolean isExclusivelyKnownArchive(GraphRewrite event, String filePath) { String extension = StringUtils.substringAfterLast(filePath, "."); if (!StringUtils.equalsIgnoreCase(extension, "jar")) return false; ZipFile archive; try { archive...
java
public static boolean isExclusivelyKnownArchive(GraphRewrite event, String filePath) { String extension = StringUtils.substringAfterLast(filePath, "."); if (!StringUtils.equalsIgnoreCase(extension, "jar")) return false; ZipFile archive; try { archive...
[ "public", "static", "boolean", "isExclusivelyKnownArchive", "(", "GraphRewrite", "event", ",", "String", "filePath", ")", "{", "String", "extension", "=", "StringUtils", ".", "substringAfterLast", "(", "filePath", ",", "\".\"", ")", ";", "if", "(", "!", "StringU...
Indicates that all of the packages within an archive are "known" by the package mapper. Generally this indicates that the archive does not contain customer code.
[ "Indicates", "that", "all", "of", "the", "packages", "within", "an", "archive", "are", "known", "by", "the", "package", "mapper", ".", "Generally", "this", "indicates", "that", "the", "archive", "does", "not", "contain", "customer", "code", "." ]
6668f09e7f012d24a0b4212ada8809417225b2ad
https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/rules-java/api/src/main/java/org/jboss/windup/rules/apps/java/scan/operation/packagemapping/PackageNameMapping.java#L89-L157
train
Checks if the given file is exclusively known.
Create a Java method that does the following: "Checks if the given file is exclusively known.".
Of course, here is the Java code you requested: ```java public static boolean isExclusivelyKnownArchive(GraphRewrite event, String filePath) { String extension = StringUtils.substringAfterLast(filePath, "."); if (!StringUtils.equalsIgnoreCase(extension, "jar")) return false; Z...
yan74/afplib
org.afplib/src/main/java/org/afplib/afplib/impl/PresentationSpaceResetMixingImpl.java
PresentationSpaceResetMixingImpl.eIsSet
@Override public boolean eIsSet(int featureID) { switch (featureID) { case AfplibPackage.PRESENTATION_SPACE_RESET_MIXING__BG_MX_FLAG: return BG_MX_FLAG_EDEFAULT == null ? bgMxFlag != null : !BG_MX_FLAG_EDEFAULT.equals(bgMxFlag); } return super.eIsSet(featureID); }
java
@Override public boolean eIsSet(int featureID) { switch (featureID) { case AfplibPackage.PRESENTATION_SPACE_RESET_MIXING__BG_MX_FLAG: return BG_MX_FLAG_EDEFAULT == null ? bgMxFlag != null : !BG_MX_FLAG_EDEFAULT.equals(bgMxFlag); } return super.eIsSet(featureID); }
[ "@", "Override", "public", "boolean", "eIsSet", "(", "int", "featureID", ")", "{", "switch", "(", "featureID", ")", "{", "case", "AfplibPackage", ".", "PRESENTATION_SPACE_RESET_MIXING__BG_MX_FLAG", ":", "return", "BG_MX_FLAG_EDEFAULT", "==", "null", "?", "bgMxFlag",...
<!-- 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/PresentationSpaceResetMixingImpl.java#L139-L146
train
Replies if the feature is set to a value.
Create a Java method that does the following: "Replies if the feature is set to a value.".
Of course, here is the Java code you requested: ```java @Override public boolean eIsSet(int featureID) { switch (featureID) { case AfplibPackage.PRESENTATION_SPACE_RESET_MIXING__BG_MX_FLAG: return BG_MX_FLAG_EDEFAULT == null ? bgMxFlag != null : !BG_MX_FLAG_EDEFAULT.equals(bgMxFlag); } return super.eIsSe...
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/matchspace/selector/impl/TopicPattern.java
TopicPattern.checkPrefix
boolean checkPrefix(char[] chars, int[] cursor) { if (chars.length > cursor[0] && chars[cursor[0]] == MatchSpace.NONWILD_MARKER) return false; if (prefix == null) return true; if (cursor[1] - cursor[0] < prefix.minlen) // a conservative test, but if we can't pass it, we'll certainly fail l...
java
boolean checkPrefix(char[] chars, int[] cursor) { if (chars.length > cursor[0] && chars[cursor[0]] == MatchSpace.NONWILD_MARKER) return false; if (prefix == null) return true; if (cursor[1] - cursor[0] < prefix.minlen) // a conservative test, but if we can't pass it, we'll certainly fail l...
[ "boolean", "checkPrefix", "(", "char", "[", "]", "chars", ",", "int", "[", "]", "cursor", ")", "{", "if", "(", "chars", ".", "length", ">", "cursor", "[", "0", "]", "&&", "chars", "[", "cursor", "[", "0", "]", "]", "==", "MatchSpace", ".", "NONWI...
Override checkPrefix to implement topic semantics
[ "Override", "checkPrefix", "to", "implement", "topic", "semantics" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/matchspace/selector/impl/TopicPattern.java#L32-L55
train
Check if the prefix matches the characters in the string.
Create a Java method that does the following: "Check if the prefix matches the characters in the string.".
Of course, here is the Java code you requested: ```java boolean checkPrefix(char[] chars, int[] cursor) { if (chars.length > cursor[0] && chars[cursor[0]] == MatchSpace.NONWILD_MARKER) return false; if (prefix == null) return true; if (cursor[1] - cursor[0] < prefix.minlen) // a conservat...
ggrandes/standalone-preferences
src/main/java/org/javastack/preferences/CustomMapper.java
CustomMapper.map
@Override public String map(final String propName) { if (propName == null) return null; String keyName = propName, defValue = null; final int offsetDefault = propName.indexOf(':'); if (offsetDefault != -1) { keyName = propName.substring(0, offsetDefault); defValue = propName.substring(offsetDefault + ...
java
@Override public String map(final String propName) { if (propName == null) return null; String keyName = propName, defValue = null; final int offsetDefault = propName.indexOf(':'); if (offsetDefault != -1) { keyName = propName.substring(0, offsetDefault); defValue = propName.substring(offsetDefault + ...
[ "@", "Override", "public", "String", "map", "(", "final", "String", "propName", ")", "{", "if", "(", "propName", "==", "null", ")", "return", "null", ";", "String", "keyName", "=", "propName", ",", "defValue", "=", "null", ";", "final", "int", "offsetDef...
Map PropertyName in format "keyName:default-value" to {@link ClassLoaderMap#get(ClassLoader, String, String)} or {@link System#getProperty(String)} or {@code default-value} @param propName string in format keyName[:default-value] @return maped value
[ "Map", "PropertyName", "in", "format", "keyName", ":", "default", "-", "value", "to", "{", "@link", "ClassLoaderMap#get", "(", "ClassLoader", "String", "String", ")", "}", "or", "{", "@link", "System#getProperty", "(", "String", ")", "}", "or", "{", "@code",...
0c006a9226dbfbd32bc0bb6ae0954b9c615360f1
https://github.com/ggrandes/standalone-preferences/blob/0c006a9226dbfbd32bc0bb6ae0954b9c615360f1/src/main/java/org/javastack/preferences/CustomMapper.java#L20-L36
valid
Override this method to return the value of the specified property.
Create a Java method that does the following: "Override this method to return the value of the specified property.".
Of course, here is the Java code you requested: ```java @Override public String map(final String propName) { if (propName == null) return null; String keyName = propName, defValue = null; final int offsetDefault = propName.indexOf(':'); if (offsetDefault != -1) { keyName = propName.substring(0, offsetDe...
canoo/dolphin-platform
platform/dolphin-platform-core/src/main/java/com/canoo/dp/impl/platform/core/commons/lang/TypeUtils.java
TypeUtils.normalizeUpperBounds
private static Type[] normalizeUpperBounds(final Type[] bounds) { Assert.requireNonNull(bounds, "bounds"); // don't bother if there's only one (or none) type if (bounds.length < 2) { return bounds; } final Set<Type> types = new HashSet<>(bounds.length); for ...
java
private static Type[] normalizeUpperBounds(final Type[] bounds) { Assert.requireNonNull(bounds, "bounds"); // don't bother if there's only one (or none) type if (bounds.length < 2) { return bounds; } final Set<Type> types = new HashSet<>(bounds.length); for ...
[ "private", "static", "Type", "[", "]", "normalizeUpperBounds", "(", "final", "Type", "[", "]", "bounds", ")", "{", "Assert", ".", "requireNonNull", "(", "bounds", ",", "\"bounds\"", ")", ";", "// don't bother if there's only one (or none) type", "if", "(", "bounds...
<p>This method strips out the redundant upper bound types in type variable types and wildcard types (or it would with wildcard types if multiple upper bounds were allowed).</p> <p>Example, with the variable type declaration: <p> <pre>&lt;K extends java.util.Collection&lt;String&gt; &amp; java.util.List&lt;String&gt;&gt...
[ "<p", ">", "This", "method", "strips", "out", "the", "redundant", "upper", "bound", "types", "in", "type", "variable", "types", "and", "wildcard", "types", "(", "or", "it", "would", "with", "wildcard", "types", "if", "multiple", "upper", "bounds", "were", ...
fb99c1fab24df80d2fa094d8688b546140146874
https://github.com/canoo/dolphin-platform/blob/fb99c1fab24df80d2fa094d8688b546140146874/platform/dolphin-platform-core/src/main/java/com/canoo/dp/impl/platform/core/commons/lang/TypeUtils.java#L896-L921
train
Normalize the upper bounds of a class.
Create a Java method that does the following: "Normalize the upper bounds of a class.".
Of course, here is the Java code you requested: ```java private static Type[] normalizeUpperBounds(final Type[] bounds) { Assert.requireNonNull(bounds, "bounds"); // don't bother if there's only one (or none) type if (bounds.length < 2) { return bounds; } final Set<...
opensourceBIM/BIMserver
PluginBase/generated/org/bimserver/models/ifc4/impl/Ifc4PackageImpl.java
Ifc4PackageImpl.getIfcAreaMeasure
@Override public EClass getIfcAreaMeasure() { if (ifcAreaMeasureEClass == null) { ifcAreaMeasureEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI) .getEClassifiers().get(783); } return ifcAreaMeasureEClass; }
java
@Override public EClass getIfcAreaMeasure() { if (ifcAreaMeasureEClass == null) { ifcAreaMeasureEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI) .getEClassifiers().get(783); } return ifcAreaMeasureEClass; }
[ "@", "Override", "public", "EClass", "getIfcAreaMeasure", "(", ")", "{", "if", "(", "ifcAreaMeasureEClass", "==", "null", ")", "{", "ifcAreaMeasureEClass", "=", "(", "EClass", ")", "EPackage", ".", "Registry", ".", "INSTANCE", ".", "getEPackage", "(", "Ifc4Pac...
<!-- begin-user-doc --> <!-- end-user-doc --> @generated
[ "<!", "--", "begin", "-", "user", "-", "doc", "--", ">", "<!", "--", "end", "-", "user", "-", "doc", "--", ">" ]
116803c3047d1b32217366757cee1bb3880fda63
https://github.com/opensourceBIM/BIMserver/blob/116803c3047d1b32217366757cee1bb3880fda63/PluginBase/generated/org/bimserver/models/ifc4/impl/Ifc4PackageImpl.java#L39522-L39529
train
Get the IfcAreaMeasure for the IIfc4Package.
Create a Java method that does the following: "Get the IfcAreaMeasure for the IIfc4Package.".
Of course, here is the Java code you requested: ```java @Override public EClass getIfcAreaMeasure() { if (ifcAreaMeasureEClass == null) { ifcAreaMeasureEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI) .getEClassifiers().get(783); } return ifcAreaMeasureEClass; } ``` ...
unbescape/unbescape
src/main/java/org/unbescape/xml/XmlEscapeUtil.java
XmlEscapeUtil.unescape
static void unescape(final Reader reader, final Writer writer, final XmlEscapeSymbols symbols) throws IOException { if (reader == null) { return; } char[] escapes = new char[10]; int escapei = 0; int c1, c2, ce; // c1: current char, c2: next char, ce: current escap...
java
static void unescape(final Reader reader, final Writer writer, final XmlEscapeSymbols symbols) throws IOException { if (reader == null) { return; } char[] escapes = new char[10]; int escapei = 0; int c1, c2, ce; // c1: current char, c2: next char, ce: current escap...
[ "static", "void", "unescape", "(", "final", "Reader", "reader", ",", "final", "Writer", "writer", ",", "final", "XmlEscapeSymbols", "symbols", ")", "throws", "IOException", "{", "if", "(", "reader", "==", "null", ")", "{", "return", ";", "}", "char", "[", ...
/* Perform an unescape operation based on a Reader, writing the results to a Writer. Note this reader is going to be read char-by-char, so some kind of buffering might be appropriate if this is an inconvenience for the specific Reader implementation.
[ "/", "*", "Perform", "an", "unescape", "operation", "based", "on", "a", "Reader", "writing", "the", "results", "to", "a", "Writer", "." ]
ec5435fb3508c2eed25d8165dc27ded2602cae13
https://github.com/unbescape/unbescape/blob/ec5435fb3508c2eed25d8165dc27ded2602cae13/src/main/java/org/unbescape/xml/XmlEscapeUtil.java#L788-L1021
train
Unescape the XML.
Create a Java method that does the following: "Unescape the XML.".
Of course, here is the Java code you requested: ```java static void unescape(final Reader reader, final Writer writer, final XmlEscapeSymbols symbols) throws IOException { if (reader == null) { return; } char[] escapes = new char[10]; int escapei = 0; int c1, c2, ...
deeplearning4j/nd4j
nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/jita/allocator/concurrency/AtomicState.java
AtomicState.requestTick
public void requestTick(long time, TimeUnit timeUnit) { long timeframeMs = TimeUnit.MILLISECONDS.convert(time, timeUnit); long currentTime = System.currentTimeMillis(); boolean isWaiting = false; // if we have Toe request queued - we' have to wait till it finishes. try { ...
java
public void requestTick(long time, TimeUnit timeUnit) { long timeframeMs = TimeUnit.MILLISECONDS.convert(time, timeUnit); long currentTime = System.currentTimeMillis(); boolean isWaiting = false; // if we have Toe request queued - we' have to wait till it finishes. try { ...
[ "public", "void", "requestTick", "(", "long", "time", ",", "TimeUnit", "timeUnit", ")", "{", "long", "timeframeMs", "=", "TimeUnit", ".", "MILLISECONDS", ".", "convert", "(", "time", ",", "timeUnit", ")", ";", "long", "currentTime", "=", "System", ".", "cu...
This method requests to change state to Tick. PLEASE NOTE: this method is blocking, if memory is in Toe state. PLEASE NOTE: if Tick can't be acquired within specified timeframe, exception will be thrown @param time @param timeUnit
[ "This", "method", "requests", "to", "change", "state", "to", "Tick", "." ]
8f005bcecb240d1fbb83b9d390ad801d1d3b6933
https://github.com/deeplearning4j/nd4j/blob/8f005bcecb240d1fbb83b9d390ad801d1d3b6933/nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/jita/allocator/concurrency/AtomicState.java#L59-L80
test
Request a tick.
Create a Java method that does the following: "Request a tick.".
Of course, here is the Java code you requested: ```java public void requestTick(long time, TimeUnit timeUnit) { long timeframeMs = TimeUnit.MILLISECONDS.convert(time, timeUnit); long currentTime = System.currentTimeMillis(); boolean isWaiting = false; // if we have Toe request queued -...
devnied/EMV-NFC-Paycard-Enrollment
library/src/main/java/com/github/devnied/emvnfccard/parser/EmvTemplate.java
EmvTemplate.readWithPSE
protected boolean readWithPSE() throws CommunicationException { boolean ret = false; if (LOGGER.isDebugEnabled()) { LOGGER.debug("Try to read card with Payment System Environment"); } // Select the payment environment PPSE or PSE directory byte[] data = selectPaymentEnvironment(); if (ResponseUtils.isSuc...
java
protected boolean readWithPSE() throws CommunicationException { boolean ret = false; if (LOGGER.isDebugEnabled()) { LOGGER.debug("Try to read card with Payment System Environment"); } // Select the payment environment PPSE or PSE directory byte[] data = selectPaymentEnvironment(); if (ResponseUtils.isSuc...
[ "protected", "boolean", "readWithPSE", "(", ")", "throws", "CommunicationException", "{", "boolean", "ret", "=", "false", ";", "if", "(", "LOGGER", ".", "isDebugEnabled", "(", ")", ")", "{", "LOGGER", ".", "debug", "(", "\"Try to read card with Payment System Envi...
Read EMV card with Payment System Environment or Proximity Payment System Environment @return true is succeed false otherwise @throws CommunicationException communication error
[ "Read", "EMV", "card", "with", "Payment", "System", "Environment", "or", "Proximity", "Payment", "System", "Environment" ]
bfbd3960708689154a7a75c8a9a934197d738a5b
https://github.com/devnied/EMV-NFC-Paycard-Enrollment/blob/bfbd3960708689154a7a75c8a9a934197d738a5b/library/src/main/java/com/github/devnied/emvnfccard/parser/EmvTemplate.java#L389-L425
train
Read with PSE
Create a Java method that does the following: "Read with PSE".
Of course, here is the Java code you requested: ```java protected boolean readWithPSE() throws CommunicationException { boolean ret = false; if (LOGGER.isDebugEnabled()) { LOGGER.debug("Try to read card with Payment System Environment"); } // Select the payment environment PPSE or PSE directory byte[] dat...
Unidata/thredds
visad/src/main/java/ucar/nc2/iosp/gempak/GempakFileReader.java
GempakFileReader.findFileHeader
public DMFileHeaderInfo findFileHeader(String name) { if ((fileHeaderInfo == null) || fileHeaderInfo.isEmpty()) { return null; } for (DMFileHeaderInfo fhi : fileHeaderInfo) { if (name.equals(fhi.kfhnam)) { return fhi; } } return null; }
java
public DMFileHeaderInfo findFileHeader(String name) { if ((fileHeaderInfo == null) || fileHeaderInfo.isEmpty()) { return null; } for (DMFileHeaderInfo fhi : fileHeaderInfo) { if (name.equals(fhi.kfhnam)) { return fhi; } } return null; }
[ "public", "DMFileHeaderInfo", "findFileHeader", "(", "String", "name", ")", "{", "if", "(", "(", "fileHeaderInfo", "==", "null", ")", "||", "fileHeaderInfo", ".", "isEmpty", "(", ")", ")", "{", "return", "null", ";", "}", "for", "(", "DMFileHeaderInfo", "f...
Find the file header with this name @param name name of header @return headerinfo or null if not found
[ "Find", "the", "file", "header", "with", "this", "name" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/visad/src/main/java/ucar/nc2/iosp/gempak/GempakFileReader.java#L1155-L1165
test
Find the file header with the given name.
Create a Java method that does the following: "Find the file header with the given name.".
Of course, here is the Java code you requested: ```java public DMFileHeaderInfo findFileHeader(String name) { if ((fileHeaderInfo == null) || fileHeaderInfo.isEmpty()) { return null; } for (DMFileHeaderInfo fhi : fileHeaderInfo) { if (name.equals(fhi.kfhnam)) { return fhi; } }...
pravega/pravega
controller/src/main/java/io/pravega/controller/server/eventProcessor/requesthandlers/CommitRequestHandler.java
CommitRequestHandler.getEpochRecords
private CompletableFuture<List<EpochRecord>> getEpochRecords(String scope, String stream, int epoch, OperationContext context) { List<CompletableFuture<EpochRecord>> list = new ArrayList<>(); list.add(streamMetadataStore.getEpoch(scope, stream, epoch, context, executor)); list.add(streamMetadata...
java
private CompletableFuture<List<EpochRecord>> getEpochRecords(String scope, String stream, int epoch, OperationContext context) { List<CompletableFuture<EpochRecord>> list = new ArrayList<>(); list.add(streamMetadataStore.getEpoch(scope, stream, epoch, context, executor)); list.add(streamMetadata...
[ "private", "CompletableFuture", "<", "List", "<", "EpochRecord", ">", ">", "getEpochRecords", "(", "String", "scope", ",", "String", "stream", ",", "int", "epoch", ",", "OperationContext", "context", ")", "{", "List", "<", "CompletableFuture", "<", "EpochRecord"...
Fetches epoch history records for active epoch and the supplied `epoch` from the store.
[ "Fetches", "epoch", "history", "records", "for", "active", "epoch", "and", "the", "supplied", "epoch", "from", "the", "store", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/server/eventProcessor/requesthandlers/CommitRequestHandler.java#L299-L304
train
Get the epoch records.
Create a Java method that does the following: "Get the epoch records.".
Of course, here is the Java code you requested: ```java private CompletableFuture<List<EpochRecord>> getEpochRecords(String scope, String stream, int epoch, OperationContext context) { List<CompletableFuture<EpochRecord>> list = new ArrayList<>(); list.add(streamMetadataStore.getEpoch(scope, stream, ep...
petergeneric/stdlib
stdlib/src/main/java/com/peterphi/std/system/exec/AbstractProcessTracker.java
AbstractProcessTracker.waitForExit
public int waitForExit(final Deadline deadline) { final int intervalMax = 4500; // the maximum time between polls is 4.5 seconds int interval = 5; // initial sleep will be 3* this, so 15ms while (!isFinished() && deadline.isValid()) { try { // Check very frequently initially, tripling the wait each ...
java
public int waitForExit(final Deadline deadline) { final int intervalMax = 4500; // the maximum time between polls is 4.5 seconds int interval = 5; // initial sleep will be 3* this, so 15ms while (!isFinished() && deadline.isValid()) { try { // Check very frequently initially, tripling the wait each ...
[ "public", "int", "waitForExit", "(", "final", "Deadline", "deadline", ")", "{", "final", "int", "intervalMax", "=", "4500", ";", "// the maximum time between polls is 4.5 seconds", "int", "interval", "=", "5", ";", "// initial sleep will be 3* this, so 15ms", "while", "...
Waits for the process to exit; this method blocks until the process has completed (at which point it returns the process exit code) or until <code>deadline</code> has elapsed, at which point it returns Integer.MIN_VALUE @param deadline @return the exit code of the process
[ "Waits", "for", "the", "process", "to", "exit", ";", "this", "method", "blocks", "until", "the", "process", "has", "completed", "(", "at", "which", "point", "it", "returns", "the", "process", "exit", "code", ")", "or", "until", "<code", ">", "deadline<", ...
d4025d2f881bc0542b1e004c5f65a1ccaf895836
https://github.com/petergeneric/stdlib/blob/d4025d2f881bc0542b1e004c5f65a1ccaf895836/stdlib/src/main/java/com/peterphi/std/system/exec/AbstractProcessTracker.java#L162-L198
train
Wait for the process to exit.
Create a Java method that does the following: "Wait for the process to exit.".
Of course, here is the Java code you requested: ```java public int waitForExit(final Deadline deadline) { final int intervalMax = 4500; // the maximum time between polls is 4.5 seconds int interval = 5; // initial sleep will be 3* this, so 15ms while (!isFinished() && deadline.isValid()) { try { //...
eclipse/hawkbit
hawkbit-rest/hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/exception/ResponseExceptionHandler.java
ResponseExceptionHandler.handleHttpMessageNotReadableException
@ExceptionHandler(HttpMessageNotReadableException.class) public ResponseEntity<ExceptionInfo> handleHttpMessageNotReadableException(final HttpServletRequest request, final Exception ex) { logRequest(request, ex); final ExceptionInfo response = createExceptionInfo(new MessageNotReadableEx...
java
@ExceptionHandler(HttpMessageNotReadableException.class) public ResponseEntity<ExceptionInfo> handleHttpMessageNotReadableException(final HttpServletRequest request, final Exception ex) { logRequest(request, ex); final ExceptionInfo response = createExceptionInfo(new MessageNotReadableEx...
[ "@", "ExceptionHandler", "(", "HttpMessageNotReadableException", ".", "class", ")", "public", "ResponseEntity", "<", "ExceptionInfo", ">", "handleHttpMessageNotReadableException", "(", "final", "HttpServletRequest", "request", ",", "final", "Exception", "ex", ")", "{", ...
Method for handling exception of type HttpMessageNotReadableException which is thrown in case the request body is not well formed and cannot be deserialized. Called by the Spring-Framework for exception handling. @param request the Http request @param ex the exception which occurred @return the entity to be responded ...
[ "Method", "for", "handling", "exception", "of", "type", "HttpMessageNotReadableException", "which", "is", "thrown", "in", "case", "the", "request", "body", "is", "not", "well", "formed", "and", "cannot", "be", "deserialized", ".", "Called", "by", "the", "Spring"...
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-rest/hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/exception/ResponseExceptionHandler.java#L125-L131
train
Handle http message not readable exception.
Create a Java method that does the following: "Handle http message not readable exception.".
Of course, here is the Java code you requested: ```java @ExceptionHandler(HttpMessageNotReadableException.class) public ResponseEntity<ExceptionInfo> handleHttpMessageNotReadableException(final HttpServletRequest request, final Exception ex) { logRequest(request, ex); final ExceptionInf...
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/templates/ElemLiteralResult.java
ElemLiteralResult.throwDOMException
public void throwDOMException(short code, String msg) { String themsg = XSLMessages.createMessage(msg, null); throw new DOMException(code, themsg); }
java
public void throwDOMException(short code, String msg) { String themsg = XSLMessages.createMessage(msg, null); throw new DOMException(code, themsg); }
[ "public", "void", "throwDOMException", "(", "short", "code", ",", "String", "msg", ")", "{", "String", "themsg", "=", "XSLMessages", ".", "createMessage", "(", "msg", ",", "null", ")", ";", "throw", "new", "DOMException", "(", "code", ",", "themsg", ")", ...
Throw a DOMException @param msg key of the error that occured.
[ "Throw", "a", "DOMException" ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/templates/ElemLiteralResult.java#L1470-L1476
train
Throw a DOMException with a message.
Create a Java method that does the following: "Throw a DOMException with a message.".
Of course, here is the Java code you requested: ```java public void throwDOMException(short code, String msg) { String themsg = XSLMessages.createMessage(msg, null); throw new DOMException(code, themsg); } ``` Hope this helps!
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/ExecutionVertex.java
ExecutionVertex.checkInputDependencyConstraints
boolean checkInputDependencyConstraints() { if (getInputDependencyConstraint() == InputDependencyConstraint.ANY) { // InputDependencyConstraint == ANY return IntStream.range(0, inputEdges.length).anyMatch(this::isInputConsumable); } else { // InputDependencyConstraint == ALL return IntStream.range(0, in...
java
boolean checkInputDependencyConstraints() { if (getInputDependencyConstraint() == InputDependencyConstraint.ANY) { // InputDependencyConstraint == ANY return IntStream.range(0, inputEdges.length).anyMatch(this::isInputConsumable); } else { // InputDependencyConstraint == ALL return IntStream.range(0, in...
[ "boolean", "checkInputDependencyConstraints", "(", ")", "{", "if", "(", "getInputDependencyConstraint", "(", ")", "==", "InputDependencyConstraint", ".", "ANY", ")", "{", "// InputDependencyConstraint == ANY", "return", "IntStream", ".", "range", "(", "0", ",", "input...
Check whether the InputDependencyConstraint is satisfied for this vertex. @return whether the input constraint is satisfied
[ "Check", "whether", "the", "InputDependencyConstraint", "is", "satisfied", "for", "this", "vertex", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/ExecutionVertex.java#L767-L775
train
Check if the input dependency constraint is satisfied.
Create a Java method that does the following: "Check if the input dependency constraint is satisfied.".
Of course, here is the Java code you requested: ```java boolean checkInputDependencyConstraints() { if (getInputDependencyConstraint() == InputDependencyConstraint.ANY) { // InputDependencyConstraint == ANY return IntStream.range(0, inputEdges.length).anyMatch(this::isInputConsumable); } else { // InputDe...
OpenLiberty/open-liberty
dev/com.ibm.ws.injection.core/src/com/ibm/ws/injectionengine/AbstractInjectionEngine.java
AbstractInjectionEngine.getOverrideReferenceFactories
@Override @SuppressWarnings("unchecked") public synchronized <A extends Annotation> OverrideReferenceFactory<A>[] getOverrideReferenceFactories(Class<A> klass) // F743-32443 { ivOverrideReferenceFactoryMapCopyOnWrite = true; // PM79779 return (OverrideReferenceFactory<A>[]) ivOverrideReferen...
java
@Override @SuppressWarnings("unchecked") public synchronized <A extends Annotation> OverrideReferenceFactory<A>[] getOverrideReferenceFactories(Class<A> klass) // F743-32443 { ivOverrideReferenceFactoryMapCopyOnWrite = true; // PM79779 return (OverrideReferenceFactory<A>[]) ivOverrideReferen...
[ "@", "Override", "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "synchronized", "<", "A", "extends", "Annotation", ">", "OverrideReferenceFactory", "<", "A", ">", "[", "]", "getOverrideReferenceFactories", "(", "Class", "<", "A", ">", "klass", ")"...
Gets the list of override factories for the specified class. @param klass the class @return the list of override factories
[ "Gets", "the", "list", "of", "override", "factories", "for", "the", "specified", "class", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.injection.core/src/com/ibm/ws/injectionengine/AbstractInjectionEngine.java#L1170-L1176
train
Get the override reference factories for a class.
Create a Java method that does the following: "Get the override reference factories for a class.".
Of course, here is the Java code you requested: ```java @Override @SuppressWarnings("unchecked") public synchronized <A extends Annotation> OverrideReferenceFactory<A>[] getOverrideReferenceFactories(Class<A> klass) // F743-32443 { ivOverrideReferenceFactoryMapCopyOnWrite = true; // PM79779 ...
apiman/apiman
manager/api/export-import/src/main/java/io/apiman/manager/api/exportimport/manager/StorageExporter.java
StorageExporter.export
public void export() { logger.info("----------------------------"); //$NON-NLS-1$ logger.info(Messages.i18n.format("StorageExporter.StartingExport")); //$NON-NLS-1$ try { storage.beginTx(); try { exportMetadata(); exportUsers(); ...
java
public void export() { logger.info("----------------------------"); //$NON-NLS-1$ logger.info(Messages.i18n.format("StorageExporter.StartingExport")); //$NON-NLS-1$ try { storage.beginTx(); try { exportMetadata(); exportUsers(); ...
[ "public", "void", "export", "(", ")", "{", "logger", ".", "info", "(", "\"----------------------------\"", ")", ";", "//$NON-NLS-1$", "logger", ".", "info", "(", "Messages", ".", "i18n", ".", "format", "(", "\"StorageExporter.StartingExport\"", ")", ")", ";", ...
Called begin the export process.
[ "Called", "begin", "the", "export", "process", "." ]
8c049c2a2f2e4a69bbb6125686a15edd26f29c21
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/export-import/src/main/java/io/apiman/manager/api/exportimport/manager/StorageExporter.java#L78-L101
train
Export the content of the file to a file.
Create a Java method that does the following: "Export the content of the file to a file.".
Of course, here is the Java code you requested: ```java public void export() { logger.info("----------------------------"); //$NON-NLS-1$ logger.info(Messages.i18n.format("StorageExporter.StartingExport")); //$NON-NLS-1$ try { storage.beginTx(); try { exp...
dmfs/jdav
src/org/dmfs/dav/PropertyRequest.java
PropertyRequest.addProperty
public PropertyRequest addProperty(ElementDescriptor<?> property) { if (mProp == null) { mProp = new HashMap<ElementDescriptor<?>, Object>(16); } mProp.put(property, null); return this; }
java
public PropertyRequest addProperty(ElementDescriptor<?> property) { if (mProp == null) { mProp = new HashMap<ElementDescriptor<?>, Object>(16); } mProp.put(property, null); return this; }
[ "public", "PropertyRequest", "addProperty", "(", "ElementDescriptor", "<", "?", ">", "property", ")", "{", "if", "(", "mProp", "==", "null", ")", "{", "mProp", "=", "new", "HashMap", "<", "ElementDescriptor", "<", "?", ">", ",", "Object", ">", "(", "16",...
Add another property to the list of requested properties. @param property The property to request from the server. @return This instance.
[ "Add", "another", "property", "to", "the", "list", "of", "requested", "properties", "." ]
a619d85423210a283b3eb1fba9abda4fdc894969
https://github.com/dmfs/jdav/blob/a619d85423210a283b3eb1fba9abda4fdc894969/src/org/dmfs/dav/PropertyRequest.java#L49-L57
train
Add a property to the request.
Create a Java method that does the following: "Add a property to the request.".
Of course, here is the Java code you requested: ```java public PropertyRequest addProperty(ElementDescriptor<?> property) { if (mProp == null) { mProp = new HashMap<ElementDescriptor<?>, Object>(16); } mProp.put(property, null); return this; } ``` Hope this helps!
nmorel/gwt-jackson
gwt-jackson/src/main/java/com/github/nmorel/gwtjackson/client/deser/collection/ArrayListJsonDeserializer.java
ArrayListJsonDeserializer.newInstance
public static <T> ArrayListJsonDeserializer<T> newInstance( JsonDeserializer<T> deserializer ) { return new ArrayListJsonDeserializer<T>( deserializer ); }
java
public static <T> ArrayListJsonDeserializer<T> newInstance( JsonDeserializer<T> deserializer ) { return new ArrayListJsonDeserializer<T>( deserializer ); }
[ "public", "static", "<", "T", ">", "ArrayListJsonDeserializer", "<", "T", ">", "newInstance", "(", "JsonDeserializer", "<", "T", ">", "deserializer", ")", "{", "return", "new", "ArrayListJsonDeserializer", "<", "T", ">", "(", "deserializer", ")", ";", "}" ]
<p>newInstance</p> @param deserializer {@link JsonDeserializer} used to deserialize the objects inside the {@link ArrayList}. @param <T> Type of the elements inside the {@link ArrayList} @return a new instance of {@link ArrayListJsonDeserializer}
[ "<p", ">", "newInstance<", "/", "p", ">" ]
3fdc4350a27a9b64fc437d5fe516bf9191b74824
https://github.com/nmorel/gwt-jackson/blob/3fdc4350a27a9b64fc437d5fe516bf9191b74824/gwt-jackson/src/main/java/com/github/nmorel/gwtjackson/client/deser/collection/ArrayListJsonDeserializer.java#L39-L41
train
Create an ArrayListJsonDeserializer instance.
Create a Java method that does the following: "Create an ArrayListJsonDeserializer instance.".
Of course, here is the Java code you requested: ```java public static <T> ArrayListJsonDeserializer<T> newInstance( JsonDeserializer<T> deserializer ) { return new ArrayListJsonDeserializer<T>( deserializer ); } ``` Hope this helps!
google/error-prone-javac
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageUseWriter.java
PackageUseWriter.addPackageList
protected void addPackageList(Content contentTree) { Content caption = getTableCaption(configuration.getContent( "doclet.ClassUse_Packages.that.use.0", getPackageLink(packageElement, utils.getPackageName(packageElement)))); Content table = (configuration.isOutputHtml5()) ...
java
protected void addPackageList(Content contentTree) { Content caption = getTableCaption(configuration.getContent( "doclet.ClassUse_Packages.that.use.0", getPackageLink(packageElement, utils.getPackageName(packageElement)))); Content table = (configuration.isOutputHtml5()) ...
[ "protected", "void", "addPackageList", "(", "Content", "contentTree", ")", "{", "Content", "caption", "=", "getTableCaption", "(", "configuration", ".", "getContent", "(", "\"doclet.ClassUse_Packages.that.use.0\"", ",", "getPackageLink", "(", "packageElement", ",", "uti...
Add the list of packages that use the given package. @param contentTree the content tree to which the package list will be added
[ "Add", "the", "list", "of", "packages", "that", "use", "the", "given", "package", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageUseWriter.java#L160-L181
train
Add the package list.
Create a Java method that does the following: "Add the package list.".
Of course, here is the Java code you requested: ```java protected void addPackageList(Content contentTree) { Content caption = getTableCaption(configuration.getContent( "doclet.ClassUse_Packages.that.use.0", getPackageLink(packageElement, utils.getPackageName(packageElement))));...
FXMisc/RichTextFX
richtextfx/src/main/java/org/fxmisc/richtext/util/UndoUtils.java
UndoUtils.applyMultiPlainTextChange
public static <PS, SEG, S> Consumer<List<PlainTextChange>> applyMultiPlainTextChange( GenericStyledArea<PS, SEG, S> area) { return changeList -> { MultiChangeBuilder<PS, SEG, S> builder = area.createMultiChange(changeList.size()); for (PlainTextChange c : changeList) { ...
java
public static <PS, SEG, S> Consumer<List<PlainTextChange>> applyMultiPlainTextChange( GenericStyledArea<PS, SEG, S> area) { return changeList -> { MultiChangeBuilder<PS, SEG, S> builder = area.createMultiChange(changeList.size()); for (PlainTextChange c : changeList) { ...
[ "public", "static", "<", "PS", ",", "SEG", ",", "S", ">", "Consumer", "<", "List", "<", "PlainTextChange", ">", ">", "applyMultiPlainTextChange", "(", "GenericStyledArea", "<", "PS", ",", "SEG", ",", "S", ">", "area", ")", "{", "return", "changeList", "-...
Applies a list of {@link PlainTextChange}s to the given area when the {@link UndoManager}'s change stream emits an event by {@code area.replaceAbsolutely(change.getPosition(), change.getRemovalEnd(), change.getInserted()}.
[ "Applies", "a", "list", "of", "{" ]
bc7cab6a637855e0f37d9b9c12a9172c31545f0b
https://github.com/FXMisc/RichTextFX/blob/bc7cab6a637855e0f37d9b9c12a9172c31545f0b/richtextfx/src/main/java/org/fxmisc/richtext/util/UndoUtils.java#L165-L174
train
Apply multi plain text change to a generic styled area.
Create a Java method that does the following: "Apply multi plain text change to a generic styled area.".
Of course, here is the Java code you requested: ```java public static <PS, SEG, S> Consumer<List<PlainTextChange>> applyMultiPlainTextChange( GenericStyledArea<PS, SEG, S> area) { return changeList -> { MultiChangeBuilder<PS, SEG, S> builder = area.createMultiChange(changeList.size()); ...
forge/javaee-descriptors
impl/src/main/java/org/jboss/shrinkwrap/descriptor/impl/facesconfig20/WebFacesConfigDescriptorImpl.java
WebFacesConfigDescriptorImpl.getAllFactory
public List<FacesConfigFactoryType<WebFacesConfigDescriptor>> getAllFactory() { List<FacesConfigFactoryType<WebFacesConfigDescriptor>> list = new ArrayList<FacesConfigFactoryType<WebFacesConfigDescriptor>>(); List<Node> nodeList = model.get("factory"); for(Node node: nodeList) { Face...
java
public List<FacesConfigFactoryType<WebFacesConfigDescriptor>> getAllFactory() { List<FacesConfigFactoryType<WebFacesConfigDescriptor>> list = new ArrayList<FacesConfigFactoryType<WebFacesConfigDescriptor>>(); List<Node> nodeList = model.get("factory"); for(Node node: nodeList) { Face...
[ "public", "List", "<", "FacesConfigFactoryType", "<", "WebFacesConfigDescriptor", ">", ">", "getAllFactory", "(", ")", "{", "List", "<", "FacesConfigFactoryType", "<", "WebFacesConfigDescriptor", ">>", "list", "=", "new", "ArrayList", "<", "FacesConfigFactoryType", "<...
Returns all <code>factory</code> elements @return list of <code>factory</code>
[ "Returns", "all", "<code", ">", "factory<", "/", "code", ">", "elements" ]
cb914330a1a0b04bfc1d0f199bd9cde3bbf0b3ed
https://github.com/forge/javaee-descriptors/blob/cb914330a1a0b04bfc1d0f199bd9cde3bbf0b3ed/impl/src/main/java/org/jboss/shrinkwrap/descriptor/impl/facesconfig20/WebFacesConfigDescriptorImpl.java#L345-L355
train
Get all Factory
Create a Java method that does the following: "Get all Factory".
Of course, here is the Java code you requested: ```java public List<FacesConfigFactoryType<WebFacesConfigDescriptor>> getAllFactory() { List<FacesConfigFactoryType<WebFacesConfigDescriptor>> list = new ArrayList<FacesConfigFactoryType<WebFacesConfigDescriptor>>(); List<Node> nodeList = model.get("factor...
mijecu25/dsa
src/main/java/com/mijecu25/dsa/algorithms/swap/TrivialSwap.java
TrivialSwap.swap
public static void swap(char[] charArray1, char[] charArray2, int index) { TrivialSwap.swap(charArray1, index, charArray2, index); }
java
public static void swap(char[] charArray1, char[] charArray2, int index) { TrivialSwap.swap(charArray1, index, charArray2, index); }
[ "public", "static", "void", "swap", "(", "char", "[", "]", "charArray1", ",", "char", "[", "]", "charArray2", ",", "int", "index", ")", "{", "TrivialSwap", ".", "swap", "(", "charArray1", ",", "index", ",", "charArray2", ",", "index", ")", ";", "}" ]
Swap the elements of two char arrays at the same position @param charArray1 one of the arrays that will have one of its values swapped. @param charArray2 the other array that will have one of its values swapped. @param index the index of the arrays that will have their values swapped.
[ "Swap", "the", "elements", "of", "two", "char", "arrays", "at", "the", "same", "position" ]
a22971b746833e78a3939ae4de65e8f6bf2e3fd4
https://github.com/mijecu25/dsa/blob/a22971b746833e78a3939ae4de65e8f6bf2e3fd4/src/main/java/com/mijecu25/dsa/algorithms/swap/TrivialSwap.java#L245-L247
train
Swap the elements of two char arrays at the same position.
Create a Java method that does the following: "Swap the elements of two char arrays at the same position.".
Of course, here is the Java code you requested: ```java public static void swap(char[] charArray1, char[] charArray2, int index) { TrivialSwap.swap(charArray1, index, charArray2, index); } ``` Hope this helps!
Evol-Instruct
N/A
N/A
java
[]
[]
train
Implement an algorithm to reverse a string in Java without using any built-in string manipulation methods or additional data structures. The algorithm should have a time complexity of O(n) and a space complexity of O(1). Additionally, the algorithm should be able to handle strings containing Unicode characters and mai...
To reverse a string without using any built-in string manipulation methods or additional data structures in Java, we can use the following algorithm: 1. Convert the string to a character array. This is necessary because strings in Java are immutable, so we cannot directly modify the characters in place. 2. Use two po...
haraldk/TwelveMonkeys
imageio/imageio-core/src/main/java/com/twelvemonkeys/imageio/color/KCMSSanitizerStrategy.java
KCMSSanitizerStrategy.intFromBigEndian
private static int intFromBigEndian(final byte[] array, final int index) { return ((array[index ] & 0xff) << 24) | ((array[index + 1] & 0xff) << 16) | ((array[index + 2] & 0xff) << 8) | ((array[index + 3] & 0xff) ); }
java
private static int intFromBigEndian(final byte[] array, final int index) { return ((array[index ] & 0xff) << 24) | ((array[index + 1] & 0xff) << 16) | ((array[index + 2] & 0xff) << 8) | ((array[index + 3] & 0xff) ); }
[ "private", "static", "int", "intFromBigEndian", "(", "final", "byte", "[", "]", "array", ",", "final", "int", "index", ")", "{", "return", "(", "(", "array", "[", "index", "]", "&", "0xff", ")", "<<", "24", ")", "|", "(", "(", "array", "[", "index"...
TODO: Move to some common util
[ "TODO", ":", "Move", "to", "some", "common", "util" ]
7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d
https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/imageio/imageio-core/src/main/java/com/twelvemonkeys/imageio/color/KCMSSanitizerStrategy.java#L96-L101
train
Convert an integer from the Big Endian byte array to a CRTC int.
Create a Java method that does the following: "Convert an integer from the Big Endian byte array to a CRTC int.".
Of course, here is the Java code you requested: ```java private static int intFromBigEndian(final byte[] array, final int index) { return ((array[index ] & 0xff) << 24) | ((array[index + 1] & 0xff) << 16) | ((array[index + 2] & 0xff) << 8) | ((array[index + ...
exoplatform/jcr
exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/importing/BaseXmlImporter.java
BaseXmlImporter.createVersionHistory
protected void createVersionHistory(ImportNodeData nodeData) throws RepositoryException { // Generate new VersionHistoryIdentifier and BaseVersionIdentifier // if uuid changed after UC boolean newVersionHistory = nodeData.isNewIdentifer() || !nodeData.isContainsVersionhistory(); if (newVersio...
java
protected void createVersionHistory(ImportNodeData nodeData) throws RepositoryException { // Generate new VersionHistoryIdentifier and BaseVersionIdentifier // if uuid changed after UC boolean newVersionHistory = nodeData.isNewIdentifer() || !nodeData.isContainsVersionhistory(); if (newVersio...
[ "protected", "void", "createVersionHistory", "(", "ImportNodeData", "nodeData", ")", "throws", "RepositoryException", "{", "// Generate new VersionHistoryIdentifier and BaseVersionIdentifier", "// if uuid changed after UC", "boolean", "newVersionHistory", "=", "nodeData", ".", "isN...
Create new version history. @param nodeData @throws RepositoryException
[ "Create", "new", "version", "history", "." ]
3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2
https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/importing/BaseXmlImporter.java#L353-L383
train
Create version history.
Create a Java method that does the following: "Create version history.".
Of course, here is the Java code you requested: ```java protected void createVersionHistory(ImportNodeData nodeData) throws RepositoryException { // Generate new VersionHistoryIdentifier and BaseVersionIdentifier // if uuid changed after UC boolean newVersionHistory = nodeData.isNewIdentifer() || ...
jenkinsci/jenkins
core/src/main/java/hudson/util/jna/DotNet.java
DotNet.isInstalled
public static boolean isInstalled(int major, int minor) { try { // see http://support.microsoft.com/?scid=kb;en-us;315291 for the basic algorithm // observation in my registry shows that the actual key name can be things like "v2.0 SP1" // or "v2.0.50727", so the regexp is wr...
java
public static boolean isInstalled(int major, int minor) { try { // see http://support.microsoft.com/?scid=kb;en-us;315291 for the basic algorithm // observation in my registry shows that the actual key name can be things like "v2.0 SP1" // or "v2.0.50727", so the regexp is wr...
[ "public", "static", "boolean", "isInstalled", "(", "int", "major", ",", "int", "minor", ")", "{", "try", "{", "// see http://support.microsoft.com/?scid=kb;en-us;315291 for the basic algorithm", "// observation in my registry shows that the actual key name can be things like \"v2.0 SP1...
Returns true if the .NET framework of the given version (or greater) is installed.
[ "Returns", "true", "if", "the", ".", "NET", "framework", "of", "the", "given", "version", "(", "or", "greater", ")", "is", "installed", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/util/jna/DotNet.java#L45-L65
train
Checks if the Registry is installed.
Create a Java method that does the following: "Checks if the Registry is installed.".
Of course, here is the Java code you requested: ```java public static boolean isInstalled(int major, int minor) { try { // see http://support.microsoft.com/?scid=kb;en-us;315291 for the basic algorithm // observation in my registry shows that the actual key name can be things like "v2.0...
Azure/azure-sdk-for-java
datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/implementation/AccountsInner.java
AccountsInner.listByResourceGroupNextAsync
public Observable<Page<DataLakeStoreAccountInner>> listByResourceGroupNextAsync(final String nextPageLink) { return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) .map(new Func1<ServiceResponse<Page<DataLakeStoreAccountInner>>, Page<DataLakeStoreAccountInner>>() { @Ove...
java
public Observable<Page<DataLakeStoreAccountInner>> listByResourceGroupNextAsync(final String nextPageLink) { return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) .map(new Func1<ServiceResponse<Page<DataLakeStoreAccountInner>>, Page<DataLakeStoreAccountInner>>() { @Ove...
[ "public", "Observable", "<", "Page", "<", "DataLakeStoreAccountInner", ">", ">", "listByResourceGroupNextAsync", "(", "final", "String", "nextPageLink", ")", "{", "return", "listByResourceGroupNextWithServiceResponseAsync", "(", "nextPageLink", ")", ".", "map", "(", "ne...
Lists the Data Lake Store accounts within a specific resource group. The response includes a link to the next page of results, if any. @param nextPageLink The NextLink from the previous successful call to List operation. @throws IllegalArgumentException thrown if parameters fail the validation @return the observable t...
[ "Lists", "the", "Data", "Lake", "Store", "accounts", "within", "a", "specific", "resource", "group", ".", "The", "response", "includes", "a", "link", "to", "the", "next", "page", "of", "results", "if", "any", "." ]
aab183ddc6686c82ec10386d5a683d2691039626
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/implementation/AccountsInner.java#L1916-L1924
train
Gets a list of a Data Lake Store account.
Create a Java method that does the following: "Gets a list of a Data Lake Store account.".
Of course, here is the Java code you requested: ```java public Observable<Page<DataLakeStoreAccountInner>> listByResourceGroupNextAsync(final String nextPageLink) { return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) .map(new Func1<ServiceResponse<Page<DataLakeStoreAccountInner>>, ...
soarcn/COCOQuery
query/src/main/java/com/cocosw/query/AbstractViewQuery.java
AbstractViewQuery.image
public T image(Drawable drawable) { if (view instanceof ImageView) { ImageView iv = (ImageView) view; iv.setImageDrawable(drawable); } return self(); }
java
public T image(Drawable drawable) { if (view instanceof ImageView) { ImageView iv = (ImageView) view; iv.setImageDrawable(drawable); } return self(); }
[ "public", "T", "image", "(", "Drawable", "drawable", ")", "{", "if", "(", "view", "instanceof", "ImageView", ")", "{", "ImageView", "iv", "=", "(", "ImageView", ")", "view", ";", "iv", ".", "setImageDrawable", "(", "drawable", ")", ";", "}", "return", ...
Set the image of an ImageView. @param drawable the drawable @return self @see drawable
[ "Set", "the", "image", "of", "an", "ImageView", "." ]
712eac37ab65ef3dbdf55dbfae28750edfc36608
https://github.com/soarcn/COCOQuery/blob/712eac37ab65ef3dbdf55dbfae28750edfc36608/query/src/main/java/com/cocosw/query/AbstractViewQuery.java#L318-L326
train
Set the drawable of the ImageView.
Create a Java method that does the following: "Set the drawable of the ImageView.".
Of course, here is the Java code you requested: ```java public T image(Drawable drawable) { if (view instanceof ImageView) { ImageView iv = (ImageView) view; iv.setImageDrawable(drawable); } return self(); } ``` Hope this helps!
SynBioDex/sbol-data
sbol-data-examples/src/main/java/org/sbolstandard/examples/DataTreeCreator.java
DataTreeCreator.makeDocument
public static DocumentRoot<QName> makeDocument() { return DocumentRoot( NamespaceBindings(SbolTerms.sbol2), TopLevelDocuments( TopLevelDocument( SbolTerms.dnaComponent, partsRegistry.namespacedUri("Part:BBa_I0462")...
java
public static DocumentRoot<QName> makeDocument() { return DocumentRoot( NamespaceBindings(SbolTerms.sbol2), TopLevelDocuments( TopLevelDocument( SbolTerms.dnaComponent, partsRegistry.namespacedUri("Part:BBa_I0462")...
[ "public", "static", "DocumentRoot", "<", "QName", ">", "makeDocument", "(", ")", "{", "return", "DocumentRoot", "(", "NamespaceBindings", "(", "SbolTerms", ".", "sbol2", ")", ",", "TopLevelDocuments", "(", "TopLevelDocument", "(", "SbolTerms", ".", "dnaComponent",...
Creates an example {@link DocumentRoot} object with data from the SBOL1.1 data model. Included SBOL objects are DnaComponent, SequenceAnnotation and DnaSequence. @return {@link DocumentRoot}
[ "Creates", "an", "example", "{" ]
5b7ebfb6a4dcd9838f451547c25fc0a0c72ae41d
https://github.com/SynBioDex/sbol-data/blob/5b7ebfb6a4dcd9838f451547c25fc0a0c72ae41d/sbol-data-examples/src/main/java/org/sbolstandard/examples/DataTreeCreator.java#L309-L378
valid
Create a DocumentRoot of the type DocumentRoot.
Create a Java method that does the following: "Create a DocumentRoot of the type DocumentRoot.".
Of course, here is the Java code you requested: ```java public static DocumentRoot<QName> makeDocument() { return DocumentRoot( NamespaceBindings(SbolTerms.sbol2), TopLevelDocuments( TopLevelDocument( SbolTerms.dnaComponent, ...
radkovo/Pdf2Dom
src/main/java/org/fit/cssbox/pdf/CSSBoxTree.java
CSSBoxTree.startNewPage
@Override protected void startNewPage() { super.startNewPage(); pagebox = createBlock(body, curpage, false); pagebox.setStyle(createPageStyle()); body.addSubBox(pagebox); }
java
@Override protected void startNewPage() { super.startNewPage(); pagebox = createBlock(body, curpage, false); pagebox.setStyle(createPageStyle()); body.addSubBox(pagebox); }
[ "@", "Override", "protected", "void", "startNewPage", "(", ")", "{", "super", ".", "startNewPage", "(", ")", ";", "pagebox", "=", "createBlock", "(", "body", ",", "curpage", ",", "false", ")", ";", "pagebox", ".", "setStyle", "(", "createPageStyle", "(", ...
===========================================================================================
[ "===========================================================================================" ]
12e52b80eca7f57fc41e6ed895bf1db72c38da53
https://github.com/radkovo/Pdf2Dom/blob/12e52b80eca7f57fc41e6ed895bf1db72c38da53/src/main/java/org/fit/cssbox/pdf/CSSBoxTree.java#L186-L193
train
Create a new page box.
Create a Java method that does the following: "Create a new page box.".
Of course, here is the Java code you requested: ```java @Override protected void startNewPage() { super.startNewPage(); pagebox = createBlock(body, curpage, false); pagebox.setStyle(createPageStyle()); body.addSubBox(pagebox); } ``` Hope this helps!
RKumsher/utils
src/main/java/com/github/rkumsher/collection/RandomCollectionUtils.java
RandomCollectionUtils.randomListFrom
public static <T> List<T> randomListFrom(Iterable<T> elements, Range<Integer> size) { checkArgument(!isEmpty(elements), "Elements to populate from must not be empty"); return randomListFrom(() -> IterableUtils.randomFrom(elements), size); }
java
public static <T> List<T> randomListFrom(Iterable<T> elements, Range<Integer> size) { checkArgument(!isEmpty(elements), "Elements to populate from must not be empty"); return randomListFrom(() -> IterableUtils.randomFrom(elements), size); }
[ "public", "static", "<", "T", ">", "List", "<", "T", ">", "randomListFrom", "(", "Iterable", "<", "T", ">", "elements", ",", "Range", "<", "Integer", ">", "size", ")", "{", "checkArgument", "(", "!", "isEmpty", "(", "elements", ")", ",", "\"Elements to...
Returns a list filled randomly from the given elements. @param elements elements to randomly fill list from @param size range that the size of the list will be randomly chosen from @param <T> the type of elements in the given iterable @return list filled randomly from the given elements @throws IllegalArgumentExceptio...
[ "Returns", "a", "list", "filled", "randomly", "from", "the", "given", "elements", "." ]
fcdb190569cd0288249bf4b46fd418f8c01d1caf
https://github.com/RKumsher/utils/blob/fcdb190569cd0288249bf4b46fd418f8c01d1caf/src/main/java/com/github/rkumsher/collection/RandomCollectionUtils.java#L97-L100
train
Creates a random list from the given elements.
Create a Java method that does the following: "Creates a random list from the given elements.".
Of course, here is the Java code you requested: ```java public static <T> List<T> randomListFrom(Iterable<T> elements, Range<Integer> size) { checkArgument(!isEmpty(elements), "Elements to populate from must not be empty"); return randomListFrom(() -> IterableUtils.randomFrom(elements), size); } ``` Hope th...
Esri/geometry-api-java
src/main/java/com/esri/core/geometry/RelationalOperationsMatrix.java
RelationalOperationsMatrix.getPredefinedRelation_
private static int getPredefinedRelation_(String scl, int dim_a, int dim_b) { if (equals_(scl)) return RelationalOperations.Relation.equals; if (disjoint_(scl)) return RelationalOperations.Relation.disjoint; if (touches_(scl, dim_a, dim_b)) return RelationalOperations.Relation.touches; if (crosses_(...
java
private static int getPredefinedRelation_(String scl, int dim_a, int dim_b) { if (equals_(scl)) return RelationalOperations.Relation.equals; if (disjoint_(scl)) return RelationalOperations.Relation.disjoint; if (touches_(scl, dim_a, dim_b)) return RelationalOperations.Relation.touches; if (crosses_(...
[ "private", "static", "int", "getPredefinedRelation_", "(", "String", "scl", ",", "int", "dim_a", ",", "int", "dim_b", ")", "{", "if", "(", "equals_", "(", "scl", ")", ")", "return", "RelationalOperations", ".", "Relation", ".", "equals", ";", "if", "(", ...
Checks whether scl string is a predefined relation.
[ "Checks", "whether", "scl", "string", "is", "a", "predefined", "relation", "." ]
494da8ec953d76e7c6072afbc081abfe48ff07cf
https://github.com/Esri/geometry-api-java/blob/494da8ec953d76e7c6072afbc081abfe48ff07cf/src/main/java/com/esri/core/geometry/RelationalOperationsMatrix.java#L1122-L1142
train
Gets the preferred relation of the given string.
Create a Java method that does the following: "Gets the preferred relation of the given string.".
Of course, here is the Java code you requested: ```java private static int getPredefinedRelation_(String scl, int dim_a, int dim_b) { if (equals_(scl)) return RelationalOperations.Relation.equals; if (disjoint_(scl)) return RelationalOperations.Relation.disjoint; if (touches_(scl, dim_a, dim_b)) retur...
RestComm/jain-slee
container/resource/src/main/java/org/mobicents/slee/resource/SleeEndpointFireEventNotTransactedExecutor.java
SleeEndpointFireEventNotTransactedExecutor.execute
void execute(final ActivityHandle realHandle, final ActivityHandle refHandle, final FireableEventType eventType, final Object event, final Address address, final ReceivableService receivableService, final int eventFlags) throws ActivityIsEndingException, FireEventException, SLEEException, UnrecognizedAct...
java
void execute(final ActivityHandle realHandle, final ActivityHandle refHandle, final FireableEventType eventType, final Object event, final Address address, final ReceivableService receivableService, final int eventFlags) throws ActivityIsEndingException, FireEventException, SLEEException, UnrecognizedAct...
[ "void", "execute", "(", "final", "ActivityHandle", "realHandle", ",", "final", "ActivityHandle", "refHandle", ",", "final", "FireableEventType", "eventType", ",", "final", "Object", "event", ",", "final", "Address", "address", ",", "final", "ReceivableService", "rec...
Executes a non transacted fire event operation. @param realHandle @param refHandle @param eventType @param event @param address @param receivableService @param eventFlags @throws ActivityIsEndingException @throws FireEventException @throws SLEEException @throws UnrecognizedActivityHandleException
[ "Executes", "a", "non", "transacted", "fire", "event", "operation", "." ]
0eaa16ff2d4b6faf43f0d99260e88878fd54dee0
https://github.com/RestComm/jain-slee/blob/0eaa16ff2d4b6faf43f0d99260e88878fd54dee0/container/resource/src/main/java/org/mobicents/slee/resource/SleeEndpointFireEventNotTransactedExecutor.java#L70-L86
test
Execute the activity.
Create a Java method that does the following: "Execute the activity.".
Of course, here is the Java code you requested: ```java void execute(final ActivityHandle realHandle, final ActivityHandle refHandle, final FireableEventType eventType, final Object event, final Address address, final ReceivableService receivableService, final int eventFlags) throws ActivityIsEndingException,...
agmip/agmip-common-functions
src/main/java/org/agmip/common/Event.java
Event.updateEvent
public void updateEvent(String key, String value) { updateEvent(key, value, true, true); }
java
public void updateEvent(String key, String value) { updateEvent(key, value, true, true); }
[ "public", "void", "updateEvent", "(", "String", "key", ",", "String", "value", ")", "{", "updateEvent", "(", "key", ",", "value", ",", "true", ",", "true", ")", ";", "}" ]
Update the current event with given key and value, if current event not available, add a new one into array @param key The variable's key for a event @param value The input value for the key
[ "Update", "the", "current", "event", "with", "given", "key", "and", "value", "if", "current", "event", "not", "available", "add", "a", "new", "one", "into", "array" ]
4efa3042178841b026ca6fba9c96da02fbfb9a8e
https://github.com/agmip/agmip-common-functions/blob/4efa3042178841b026ca6fba9c96da02fbfb9a8e/src/main/java/org/agmip/common/Event.java#L73-L75
train
Update an event in the source.
Create a Java method that does the following: "Update an event in the source.".
Of course, here is the Java code you requested: ```java public void updateEvent(String key, String value) { updateEvent(key, value, true, true); } ``` Hope this helps!
kiegroup/jbpm
jbpm-bpmn2-emfextmodel/src/main/java/bpsim/util/BpsimResourceFactoryImpl.java
BpsimResourceFactoryImpl.createResource
@Override public Resource createResource(URI uri) { XMLResource result = new BpsimResourceImpl(uri); result.getDefaultSaveOptions().put(XMLResource.OPTION_EXTENDED_META_DATA, Boolean.TRUE); result.getDefaultLoadOptions().put(XMLResource.OPTION_EXTENDED_META_DATA, Boolean.TRUE); result.getDefaultSaveOptions()....
java
@Override public Resource createResource(URI uri) { XMLResource result = new BpsimResourceImpl(uri); result.getDefaultSaveOptions().put(XMLResource.OPTION_EXTENDED_META_DATA, Boolean.TRUE); result.getDefaultLoadOptions().put(XMLResource.OPTION_EXTENDED_META_DATA, Boolean.TRUE); result.getDefaultSaveOptions()....
[ "@", "Override", "public", "Resource", "createResource", "(", "URI", "uri", ")", "{", "XMLResource", "result", "=", "new", "BpsimResourceImpl", "(", "uri", ")", ";", "result", ".", "getDefaultSaveOptions", "(", ")", ".", "put", "(", "XMLResource", ".", "OPTI...
Creates an instance of the resource. <!-- begin-user-doc --> <!-- end-user-doc --> @generated
[ "Creates", "an", "instance", "of", "the", "resource", ".", "<!", "--", "begin", "-", "user", "-", "doc", "--", ">", "<!", "--", "end", "-", "user", "-", "doc", "--", ">" ]
c3473c728aa382ebbea01e380c5e754a96647b82
https://github.com/kiegroup/jbpm/blob/c3473c728aa382ebbea01e380c5e754a96647b82/jbpm-bpmn2-emfextmodel/src/main/java/bpsim/util/BpsimResourceFactoryImpl.java#L53-L66
train
Override this method to create a new XML resource.
Create a Java method that does the following: "Override this method to create a new XML resource.".
Of course, here is the Java code you requested: ```java @Override public Resource createResource(URI uri) { XMLResource result = new BpsimResourceImpl(uri); result.getDefaultSaveOptions().put(XMLResource.OPTION_EXTENDED_META_DATA, Boolean.TRUE); result.getDefaultLoadOptions().put(XMLResource.OPTION_EXTENDED_MET...
SonarOpenCommunity/sonar-cxx
cxx-squid/src/main/java/org/sonar/cxx/CxxLanguage.java
CxxLanguage.getMetric
public <G extends Serializable> Metric<G> getMetric(CxxMetricsFactory.Key metricKey) { Metric<G> metric = (Metric<G>) this.langSpecificMetrics.get(metricKey); if (metric == null) { throw new IllegalStateException("Requested metric " + metricKey + " couldn't be found"); } return metric; }
java
public <G extends Serializable> Metric<G> getMetric(CxxMetricsFactory.Key metricKey) { Metric<G> metric = (Metric<G>) this.langSpecificMetrics.get(metricKey); if (metric == null) { throw new IllegalStateException("Requested metric " + metricKey + " couldn't be found"); } return metric; }
[ "public", "<", "G", "extends", "Serializable", ">", "Metric", "<", "G", ">", "getMetric", "(", "CxxMetricsFactory", ".", "Key", "metricKey", ")", "{", "Metric", "<", "G", ">", "metric", "=", "(", "Metric", "<", "G", ">", ")", "this", ".", "langSpecific...
Get language specific metric @throws IllegalStateException if metric was not registered
[ "Get", "language", "specific", "metric" ]
7e7a3a44d6d86382a0434652a798f8235503c9b8
https://github.com/SonarOpenCommunity/sonar-cxx/blob/7e7a3a44d6d86382a0434652a798f8235503c9b8/cxx-squid/src/main/java/org/sonar/cxx/CxxLanguage.java#L117-L123
train
Gets the metric with the specified key.
Create a Java method that does the following: "Gets the metric with the specified key.".
Of course, here is the Java code you requested: ```java public <G extends Serializable> Metric<G> getMetric(CxxMetricsFactory.Key metricKey) { Metric<G> metric = (Metric<G>) this.langSpecificMetrics.get(metricKey); if (metric == null) { throw new IllegalStateException("Requested metric " + metricKey +...
kiegroup/jbpm
jbpm-audit/src/main/java/org/jbpm/process/audit/JPAWorkingMemoryDbLogger.java
JPAWorkingMemoryDbLogger.joinTransaction
private Object joinTransaction(EntityManager em) { boolean newTx = false; UserTransaction ut = null; if (isJTA) { try { em.joinTransaction(); } catch (TransactionRequiredException e) { ut = findUserTransaction(); try { if( ut != null && ut.getStatus() ==...
java
private Object joinTransaction(EntityManager em) { boolean newTx = false; UserTransaction ut = null; if (isJTA) { try { em.joinTransaction(); } catch (TransactionRequiredException e) { ut = findUserTransaction(); try { if( ut != null && ut.getStatus() ==...
[ "private", "Object", "joinTransaction", "(", "EntityManager", "em", ")", "{", "boolean", "newTx", "=", "false", ";", "UserTransaction", "ut", "=", "null", ";", "if", "(", "isJTA", ")", "{", "try", "{", "em", ".", "joinTransaction", "(", ")", ";", "}", ...
This method opens a new transaction, if none is currently running, and joins the entity manager/persistence context to that transaction. @param em The entity manager we're using. @return {@link UserTransaction} If we've started a new transaction, then we return it so that it can be closed. @throws NotSupportedException...
[ "This", "method", "opens", "a", "new", "transaction", "if", "none", "is", "currently", "running", "and", "joins", "the", "entity", "manager", "/", "persistence", "context", "to", "that", "transaction", "." ]
c3473c728aa382ebbea01e380c5e754a96647b82
https://github.com/kiegroup/jbpm/blob/c3473c728aa382ebbea01e380c5e754a96647b82/jbpm-audit/src/main/java/org/jbpm/process/audit/JPAWorkingMemoryDbLogger.java#L312-L350
train
Join the user transaction.
Create a Java method that does the following: "Join the user transaction.".
Of course, here is the Java code you requested: ```java private Object joinTransaction(EntityManager em) { boolean newTx = false; UserTransaction ut = null; if (isJTA) { try { em.joinTransaction(); } catch (TransactionRequiredException e) { ut = findUserTransact...
EdwardRaff/JSAT
JSAT/src/jsat/classifiers/boosting/Bagging.java
Bagging.getWeightSampledDataSet
public static RegressionDataSet getWeightSampledDataSet(RegressionDataSet dataSet, int[] sampledCounts) { RegressionDataSet destination = new RegressionDataSet(dataSet.getNumNumericalVars(), dataSet.getCategories()); for (int i = 0; i < sampledCounts.length; i++) { if(sampledCou...
java
public static RegressionDataSet getWeightSampledDataSet(RegressionDataSet dataSet, int[] sampledCounts) { RegressionDataSet destination = new RegressionDataSet(dataSet.getNumNumericalVars(), dataSet.getCategories()); for (int i = 0; i < sampledCounts.length; i++) { if(sampledCou...
[ "public", "static", "RegressionDataSet", "getWeightSampledDataSet", "(", "RegressionDataSet", "dataSet", ",", "int", "[", "]", "sampledCounts", ")", "{", "RegressionDataSet", "destination", "=", "new", "RegressionDataSet", "(", "dataSet", ".", "getNumNumericalVars", "("...
Creates a new data set from the given sample counts. Points sampled multiple times will be added once to the data set with their weight multiplied by the number of times it was sampled. @param dataSet the data set that was sampled from @param sampledCounts the sampling values obtained from {@link #sampleWithReplacement...
[ "Creates", "a", "new", "data", "set", "from", "the", "given", "sample", "counts", ".", "Points", "sampled", "multiple", "times", "will", "be", "added", "once", "to", "the", "data", "set", "with", "their", "weight", "multiplied", "by", "the", "number", "of"...
0ff53b7b39684b2379cc1da522f5b3a954b15cfb
https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/classifiers/boosting/Bagging.java#L345-L358
train
Get the weight sampled data set.
Create a Java method that does the following: "Get the weight sampled data set.".
Of course, here is the Java code you requested: ```java public static RegressionDataSet getWeightSampledDataSet(RegressionDataSet dataSet, int[] sampledCounts) { RegressionDataSet destination = new RegressionDataSet(dataSet.getNumNumericalVars(), dataSet.getCategories()); for (int i = 0; i < sampl...
grpc/grpc-java
api/src/main/java/io/grpc/Attributes.java
Attributes.get
@SuppressWarnings("unchecked") @Nullable public <T> T get(Key<T> key) { return (T) data.get(key); }
java
@SuppressWarnings("unchecked") @Nullable public <T> T get(Key<T> key) { return (T) data.get(key); }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "@", "Nullable", "public", "<", "T", ">", "T", "get", "(", "Key", "<", "T", ">", "key", ")", "{", "return", "(", "T", ")", "data", ".", "get", "(", "key", ")", ";", "}" ]
Gets the value for the key, or {@code null} if it's not present.
[ "Gets", "the", "value", "for", "the", "key", "or", "{" ]
973885457f9609de232d2553b82c67f6c3ff57bf
https://github.com/grpc/grpc-java/blob/973885457f9609de232d2553b82c67f6c3ff57bf/api/src/main/java/io/grpc/Attributes.java#L62-L66
train
Get the value of the key in the data.
Create a Java method that does the following: "Get the value of the key in the data.".
Of course, here is the Java code you requested: ```java @SuppressWarnings("unchecked") @Nullable public <T> T get(Key<T> key) { return (T) data.get(key); } ``` Hope this helps!
mgormley/prim
src/main/java_generated/edu/jhu/prim/map/IntDoubleHashMap.java
IntDoubleHashMap.contains
private boolean contains(final int key, final int index) { return (key != 0 || states[index] == FULL) && keys[index] == key; }
java
private boolean contains(final int key, final int index) { return (key != 0 || states[index] == FULL) && keys[index] == key; }
[ "private", "boolean", "contains", "(", "final", "int", "key", ",", "final", "int", "index", ")", "{", "return", "(", "key", "!=", "0", "||", "states", "[", "index", "]", "==", "FULL", ")", "&&", "keys", "[", "index", "]", "==", "key", ";", "}" ]
Check if the tables contain an element associated with specified key at specified index. @param key key to check @param index index to check @return true if an element is associated with key at index
[ "Check", "if", "the", "tables", "contain", "an", "element", "associated", "with", "specified", "key", "at", "specified", "index", "." ]
5dce5e1ae94a9ae558a6262fc246e1a24f56686c
https://github.com/mgormley/prim/blob/5dce5e1ae94a9ae558a6262fc246e1a24f56686c/src/main/java_generated/edu/jhu/prim/map/IntDoubleHashMap.java#L423-L425
train
Checks if the key is in the cache.
Create a Java method that does the following: "Checks if the key is in the cache.".
Of course, here is the Java code you requested: ```java private boolean contains(final int key, final int index) { return (key != 0 || states[index] == FULL) && keys[index] == key; } ``` Hope this helps!
apache/flink
flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/functions/aggfunctions/DeclarativeAggregateFunction.java
DeclarativeAggregateFunction.mergeOperands
public final UnresolvedReferenceExpression[] mergeOperands() { UnresolvedReferenceExpression[] aggBuffers = aggBufferAttributes(); UnresolvedReferenceExpression[] ret = new UnresolvedReferenceExpression[aggBuffers.length]; for (int i = 0; i < aggBuffers.length; i++) { String name = String.valueOf(i); valida...
java
public final UnresolvedReferenceExpression[] mergeOperands() { UnresolvedReferenceExpression[] aggBuffers = aggBufferAttributes(); UnresolvedReferenceExpression[] ret = new UnresolvedReferenceExpression[aggBuffers.length]; for (int i = 0; i < aggBuffers.length; i++) { String name = String.valueOf(i); valida...
[ "public", "final", "UnresolvedReferenceExpression", "[", "]", "mergeOperands", "(", ")", "{", "UnresolvedReferenceExpression", "[", "]", "aggBuffers", "=", "aggBufferAttributes", "(", ")", ";", "UnresolvedReferenceExpression", "[", "]", "ret", "=", "new", "UnresolvedR...
Merge inputs of {@link #mergeExpressions()}, these inputs are agg buffer generated by user definition.
[ "Merge", "inputs", "of", "{" ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/functions/aggfunctions/DeclarativeAggregateFunction.java#L155-L164
train
Merge the operands of this expression into one.
Create a Java method that does the following: "Merge the operands of this expression into one.".
Of course, here is the Java code you requested: ```java public final UnresolvedReferenceExpression[] mergeOperands() { UnresolvedReferenceExpression[] aggBuffers = aggBufferAttributes(); UnresolvedReferenceExpression[] ret = new UnresolvedReferenceExpression[aggBuffers.length]; for (int i = 0; i < aggBuffers.len...
deeplearning4j/deeplearning4j
nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/imports/converters/DifferentialFunctionClassHolder.java
DifferentialFunctionClassHolder.getOpDefByTensorflowName
public OpDef getOpDefByTensorflowName(String name) { if(!tensorflowOpDescriptors.containsKey(name)) { throw new ND4JIllegalStateException("No op found with name " + name); } return tensorflowOpDescriptors.get(name); }
java
public OpDef getOpDefByTensorflowName(String name) { if(!tensorflowOpDescriptors.containsKey(name)) { throw new ND4JIllegalStateException("No op found with name " + name); } return tensorflowOpDescriptors.get(name); }
[ "public", "OpDef", "getOpDefByTensorflowName", "(", "String", "name", ")", "{", "if", "(", "!", "tensorflowOpDescriptors", ".", "containsKey", "(", "name", ")", ")", "{", "throw", "new", "ND4JIllegalStateException", "(", "\"No op found with name \"", "+", "name", ...
Get the op definition of a given tensorflow op. Note that if the name does not exist, an {@link ND4JIllegalStateException} will be thrown @param name the name of the op @return the op definition for a given op
[ "Get", "the", "op", "definition", "of", "a", "given", "tensorflow", "op", "." ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/imports/converters/DifferentialFunctionClassHolder.java#L115-L121
train
Get the op definition by tensorflow name.
Create a Java method that does the following: "Get the op definition by tensorflow name.".
Of course, here is the Java code you requested: ```java public OpDef getOpDefByTensorflowName(String name) { if(!tensorflowOpDescriptors.containsKey(name)) { throw new ND4JIllegalStateException("No op found with name " + name); } return tensorflowOpDescriptors.get(name); } ``` ...
denisneuling/apitrary.jar
apitrary-api-client/src/main/java/com/apitrary/api/client/util/ClassUtil.java
ClassUtil.getDeclaredFieldSilent
public static Field getDeclaredFieldSilent(Class<?> target, String fieldName) { try { return target.getDeclaredField(fieldName); } catch (Exception e) { return null; } }
java
public static Field getDeclaredFieldSilent(Class<?> target, String fieldName) { try { return target.getDeclaredField(fieldName); } catch (Exception e) { return null; } }
[ "public", "static", "Field", "getDeclaredFieldSilent", "(", "Class", "<", "?", ">", "target", ",", "String", "fieldName", ")", "{", "try", "{", "return", "target", ".", "getDeclaredField", "(", "fieldName", ")", ";", "}", "catch", "(", "Exception", "e", ")...
<p> getDeclaredFieldSilent. </p> @param target a {@link java.lang.Class} object. @param fieldName a {@link java.lang.String} object. @return a {@link java.lang.reflect.Field} object.
[ "<p", ">", "getDeclaredFieldSilent", ".", "<", "/", "p", ">" ]
b7f639a1e735c60ba2b1b62851926757f5de8628
https://github.com/denisneuling/apitrary.jar/blob/b7f639a1e735c60ba2b1b62851926757f5de8628/apitrary-api-client/src/main/java/com/apitrary/api/client/util/ClassUtil.java#L369-L375
train
Get the field with the given name throwing an exception if it fails.
Create a Java method that does the following: "Get the field with the given name throwing an exception if it fails.".
Of course, here is the Java code you requested: ```java public static Field getDeclaredFieldSilent(Class<?> target, String fieldName) { try { return target.getDeclaredField(fieldName); } catch (Exception e) { return null; } } ``` Hope this helps!
twitter/hraven
hraven-core/src/main/java/com/twitter/hraven/datasource/JobHistoryService.java
JobHistoryService.getFlowByJobID
public Flow getFlowByJobID(String cluster, String jobId, boolean populateTasks) throws IOException { Flow flow = null; JobKey key = idService.getJobKeyById(new QualifiedJobId(cluster, jobId)); if (key != null) { byte[] startRow = ByteUtil.join(Constants.SEP_BYTES, Bytes.toBytes(key.get...
java
public Flow getFlowByJobID(String cluster, String jobId, boolean populateTasks) throws IOException { Flow flow = null; JobKey key = idService.getJobKeyById(new QualifiedJobId(cluster, jobId)); if (key != null) { byte[] startRow = ByteUtil.join(Constants.SEP_BYTES, Bytes.toBytes(key.get...
[ "public", "Flow", "getFlowByJobID", "(", "String", "cluster", ",", "String", "jobId", ",", "boolean", "populateTasks", ")", "throws", "IOException", "{", "Flow", "flow", "=", "null", ";", "JobKey", "key", "=", "idService", ".", "getJobKeyById", "(", "new", "...
Returns the {@link Flow} instance containing the given job ID. @param cluster the cluster identifier @param jobId the job identifier @return
[ "Returns", "the", "{", "@link", "Flow", "}", "instance", "containing", "the", "given", "job", "ID", "." ]
e35996b6e2f016bcd18db0bad320be7c93d95208
https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-core/src/main/java/com/twitter/hraven/datasource/JobHistoryService.java#L192-L216
train
Get a Flow object from the job_history table.
Create a Java method that does the following: "Get a Flow object from the job_history table.".
Of course, here is the Java code you requested: ```java public Flow getFlowByJobID(String cluster, String jobId, boolean populateTasks) throws IOException { Flow flow = null; JobKey key = idService.getJobKeyById(new QualifiedJobId(cluster, jobId)); if (key != null) { byte[] startRow = ...
landawn/AbacusUtil
src/com/landawn/abacus/util/stream/EntryStream.java
EntryStream.of
public static <E> EntryStream<E, Integer> of(final Multiset<E> multiset) { return multiset == null ? EntryStream.<E, Integer> empty() : multiset.entryStream(); }
java
public static <E> EntryStream<E, Integer> of(final Multiset<E> multiset) { return multiset == null ? EntryStream.<E, Integer> empty() : multiset.entryStream(); }
[ "public", "static", "<", "E", ">", "EntryStream", "<", "E", ",", "Integer", ">", "of", "(", "final", "Multiset", "<", "E", ">", "multiset", ")", "{", "return", "multiset", "==", "null", "?", "EntryStream", ".", "<", "E", ",", "Integer", ">", "empty",...
}
[ "}" ]
544b7720175d15e9329f83dd22a8cc5fa4515e12
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/stream/EntryStream.java#L1740-L1742
train
Creates an EntryStream from a Multiset.
Create a Java method that does the following: "Creates an EntryStream from a Multiset.".
Of course, here is the Java code you requested: ```java public static <E> EntryStream<E, Integer> of(final Multiset<E> multiset) { return multiset == null ? EntryStream.<E, Integer> empty() : multiset.entryStream(); } ``` Hope this helps!
vojtechhabarta/typescript-generator
typescript-generator-core/src/main/java/cz/habarta/typescript/generator/ext/BeanPropertyPathExtension.java
BeanPropertyPathExtension.extractOriginalTsType
private static TsType extractOriginalTsType(TsType type) { if (type instanceof TsType.OptionalType) { return extractOriginalTsType(((TsType.OptionalType)type).type); } if (type instanceof TsType.UnionType) { TsType.UnionType union = (TsType.UnionType)type; Lis...
java
private static TsType extractOriginalTsType(TsType type) { if (type instanceof TsType.OptionalType) { return extractOriginalTsType(((TsType.OptionalType)type).type); } if (type instanceof TsType.UnionType) { TsType.UnionType union = (TsType.UnionType)type; Lis...
[ "private", "static", "TsType", "extractOriginalTsType", "(", "TsType", "type", ")", "{", "if", "(", "type", "instanceof", "TsType", ".", "OptionalType", ")", "{", "return", "extractOriginalTsType", "(", "(", "(", "TsType", ".", "OptionalType", ")", "type", ")"...
If the type is optional of number|null|undefined, or list of of integer, we want to be able to recognize it as number to link the member to another class. => extract the original type while ignoring the |null|undefined and optional informations.
[ "If", "the", "type", "is", "optional", "of", "number|null|undefined", "or", "list", "of", "of", "integer", "we", "want", "to", "be", "able", "to", "recognize", "it", "as", "number", "to", "link", "the", "member", "to", "another", "class", ".", "=", ">", ...
23a43848f075360eefb15c5e233cfd71205b3e9f
https://github.com/vojtechhabarta/typescript-generator/blob/23a43848f075360eefb15c5e233cfd71205b3e9f/typescript-generator-core/src/main/java/cz/habarta/typescript/generator/ext/BeanPropertyPathExtension.java#L120-L140
train
Extract original type from a type.
Create a Java method that does the following: "Extract original type from a type.".
Of course, here is the Java code you requested: ```java private static TsType extractOriginalTsType(TsType type) { if (type instanceof TsType.OptionalType) { return extractOriginalTsType(((TsType.OptionalType)type).type); } if (type instanceof TsType.UnionType) { TsType....
lukas-krecan/JsonUnit
json-unit-assertj/src/main/java/net/javacrumbs/jsonunit/assertj/JsonAssert.java
JsonAssert.isArray
public ListAssert<Object> isArray() { Node node = assertType(ARRAY); return new JsonListAssert((List<?>)node.getValue(), path.asPrefix(), configuration) .as("Different value found in node \"%s\"", path); }
java
public ListAssert<Object> isArray() { Node node = assertType(ARRAY); return new JsonListAssert((List<?>)node.getValue(), path.asPrefix(), configuration) .as("Different value found in node \"%s\"", path); }
[ "public", "ListAssert", "<", "Object", ">", "isArray", "(", ")", "{", "Node", "node", "=", "assertType", "(", "ARRAY", ")", ";", "return", "new", "JsonListAssert", "(", "(", "List", "<", "?", ">", ")", "node", ".", "getValue", "(", ")", ",", "path", ...
Asserts that given node is present and is of type array. @return
[ "Asserts", "that", "given", "node", "is", "present", "and", "is", "of", "type", "array", "." ]
2b12ed792e8dd787bddd6f3b8eb2325737435791
https://github.com/lukas-krecan/JsonUnit/blob/2b12ed792e8dd787bddd6f3b8eb2325737435791/json-unit-assertj/src/main/java/net/javacrumbs/jsonunit/assertj/JsonAssert.java#L175-L179
train
Assert that result is an array
Create a Java method that does the following: "Assert that result is an array".
Of course, here is the Java code you requested: ```java public ListAssert<Object> isArray() { Node node = assertType(ARRAY); return new JsonListAssert((List<?>)node.getValue(), path.asPrefix(), configuration) .as("Different value found in node \"%s\"", path); } ``` Hope this helps!
michael-rapp/AndroidMaterialPreferences
library/src/main/java/de/mrapp/android/preference/AbstractTwoStatePreference.java
AbstractTwoStatePreference.obtainStyledAttributes
private void obtainStyledAttributes(@Nullable final AttributeSet attributeSet, @AttrRes final int defaultStyle, @StyleRes final int defaultStyleResource) { TypedArray typedArray = getContext() .obtainStyledAttributes...
java
private void obtainStyledAttributes(@Nullable final AttributeSet attributeSet, @AttrRes final int defaultStyle, @StyleRes final int defaultStyleResource) { TypedArray typedArray = getContext() .obtainStyledAttributes...
[ "private", "void", "obtainStyledAttributes", "(", "@", "Nullable", "final", "AttributeSet", "attributeSet", ",", "@", "AttrRes", "final", "int", "defaultStyle", ",", "@", "StyleRes", "final", "int", "defaultStyleResource", ")", "{", "TypedArray", "typedArray", "=", ...
Obtains all attributes from a specific attribute set. @param attributeSet The attribute set, the attributes should be obtained from, as an instance of the type {@link AttributeSet} or null, if no attributes should be obtained @param defaultStyle The default style to apply to this preference. If 0, no style will be app...
[ "Obtains", "all", "attributes", "from", "a", "specific", "attribute", "set", "." ]
73a7e449458313bd041fc8d6038e290506b68eb1
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/AbstractTwoStatePreference.java#L146-L160
train
Obtains the styled attributes from the attribute set.
Create a Java method that does the following: "Obtains the styled attributes from the attribute set.".
Of course, here is the Java code you requested: ```java private void obtainStyledAttributes(@Nullable final AttributeSet attributeSet, @AttrRes final int defaultStyle, @StyleRes final int defaultStyleResource) { TypedArray typedArr...
eclipse/xtext-core
org.eclipse.xtext/emf-gen/org/eclipse/xtext/impl/CompoundElementImpl.java
CompoundElementImpl.eGet
@Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case XtextPackage.COMPOUND_ELEMENT__ELEMENTS: return getElements(); } return super.eGet(featureID, resolve, coreType); }
java
@Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case XtextPackage.COMPOUND_ELEMENT__ELEMENTS: return getElements(); } return super.eGet(featureID, resolve, coreType); }
[ "@", "Override", "public", "Object", "eGet", "(", "int", "featureID", ",", "boolean", "resolve", ",", "boolean", "coreType", ")", "{", "switch", "(", "featureID", ")", "{", "case", "XtextPackage", ".", "COMPOUND_ELEMENT__ELEMENTS", ":", "return", "getElements", ...
<!-- begin-user-doc --> <!-- end-user-doc --> @generated
[ "<!", "--", "begin", "-", "user", "-", "doc", "--", ">", "<!", "--", "end", "-", "user", "-", "doc", "--", ">" ]
bac941cb75cb24706519845ec174cfef874d7557
https://github.com/eclipse/xtext-core/blob/bac941cb75cb24706519845ec174cfef874d7557/org.eclipse.xtext/emf-gen/org/eclipse/xtext/impl/CompoundElementImpl.java#L95-L102
train
Override eGet to return the value of the featureID.
Create a Java method that does the following: "Override eGet to return the value of the featureID.".
Of course, here is the Java code you requested: ```java @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case XtextPackage.COMPOUND_ELEMENT__ELEMENTS: return getElements(); } return super.eGet(featureID, resolve, coreType); } ``` Hope this helps!
Alluxio/alluxio
core/transport/src/main/java/alluxio/grpc/SyncPointInfo.java
SyncPointInfo.getSyncPointUri
public java.lang.String getSyncPointUri() { java.lang.Object ref = syncPointUri_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); ...
java
public java.lang.String getSyncPointUri() { java.lang.Object ref = syncPointUri_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); ...
[ "public", "java", ".", "lang", ".", "String", "getSyncPointUri", "(", ")", "{", "java", ".", "lang", ".", "Object", "ref", "=", "syncPointUri_", ";", "if", "(", "ref", "instanceof", "java", ".", "lang", ".", "String", ")", "{", "return", "(", "java", ...
<code>optional string syncPointUri = 1;</code>
[ "<code", ">", "optional", "string", "syncPointUri", "=", "1", ";", "<", "/", "code", ">" ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/transport/src/main/java/alluxio/grpc/SyncPointInfo.java#L107-L120
train
Gets the value of the syncPointUri property.
Create a Java method that does the following: "Gets the value of the syncPointUri property.".
Of course, here is the Java code you requested: ```java public java.lang.String getSyncPointUri() { java.lang.Object ref = syncPointUri_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString...
j-a-w-r/jawr
jawr-core/src/main/java/net/jawr/web/resource/bundle/variant/resolver/BrowserResolver.java
BrowserResolver.resolveVariant
@Override public String resolveVariant(HttpServletRequest request) { String browser = null; String userAgent = request.getHeader("User-Agent"); if (userAgent != null) { Matcher matcher = IE_PATTERN.matcher(userAgent); if (matcher.find()) { browser = "ie" + matcher.group(1); } else if (userAgent.con...
java
@Override public String resolveVariant(HttpServletRequest request) { String browser = null; String userAgent = request.getHeader("User-Agent"); if (userAgent != null) { Matcher matcher = IE_PATTERN.matcher(userAgent); if (matcher.find()) { browser = "ie" + matcher.group(1); } else if (userAgent.con...
[ "@", "Override", "public", "String", "resolveVariant", "(", "HttpServletRequest", "request", ")", "{", "String", "browser", "=", "null", ";", "String", "userAgent", "=", "request", ".", "getHeader", "(", "\"User-Agent\"", ")", ";", "if", "(", "userAgent", "!="...
/* (non-Javadoc) @see net.jawr.web.resource.bundle.variant.VariantResolver#resolveVariant(javax .servlet.http.HttpServletRequest)
[ "/", "*", "(", "non", "-", "Javadoc", ")" ]
1fa7cd46ebcd36908bd90b298ca316fa5b0c1b0d
https://github.com/j-a-w-r/jawr/blob/1fa7cd46ebcd36908bd90b298ca316fa5b0c1b0d/jawr-core/src/main/java/net/jawr/web/resource/bundle/variant/resolver/BrowserResolver.java#L72-L91
train
Resolves the variant of the browser based on the user agent.
Create a Java method that does the following: "Resolves the variant of the browser based on the user agent.".
Of course, here is the Java code you requested: ```java @Override public String resolveVariant(HttpServletRequest request) { String browser = null; String userAgent = request.getHeader("User-Agent"); if (userAgent != null) { Matcher matcher = IE_PATTERN.matcher(userAgent); if (matcher.find()) { brows...
aws/aws-sdk-java
aws-java-sdk-ecs/src/main/java/com/amazonaws/services/ecs/model/ContainerDefinition.java
ContainerDefinition.getDnsServers
public java.util.List<String> getDnsServers() { if (dnsServers == null) { dnsServers = new com.amazonaws.internal.SdkInternalList<String>(); } return dnsServers; }
java
public java.util.List<String> getDnsServers() { if (dnsServers == null) { dnsServers = new com.amazonaws.internal.SdkInternalList<String>(); } return dnsServers; }
[ "public", "java", ".", "util", ".", "List", "<", "String", ">", "getDnsServers", "(", ")", "{", "if", "(", "dnsServers", "==", "null", ")", "{", "dnsServers", "=", "new", "com", ".", "amazonaws", ".", "internal", ".", "SdkInternalList", "<", "String", ...
<p> A list of DNS servers that are presented to the container. This parameter maps to <code>Dns</code> in the <a href="https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate">Create a container</a> section of the <a href="https://docs.docker.com/engine/api/v1.35/">Docker Remote API</a> and the <code>--dns<...
[ "<p", ">", "A", "list", "of", "DNS", "servers", "that", "are", "presented", "to", "the", "container", ".", "This", "parameter", "maps", "to", "<code", ">", "Dns<", "/", "code", ">", "in", "the", "<a", "href", "=", "https", ":", "//", "docs", ".", "...
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-ecs/src/main/java/com/amazonaws/services/ecs/model/ContainerDefinition.java#L4690-L4695
train
Gets the value of the dnsServers property.
Create a Java method that does the following: "Gets the value of the dnsServers property.".
Of course, here is the Java code you requested: ```java public java.util.List<String> getDnsServers() { if (dnsServers == null) { dnsServers = new com.amazonaws.internal.SdkInternalList<String>(); } return dnsServers; } ``` Hope this helps!
openbaton/openbaton-client
sdk/src/main/java/org/openbaton/sdk/api/rest/NetworkServiceDescriptorAgent.java
NetworkServiceDescriptorAgent.getVNFDependencies
@Help( help = "Get all the VirtualNetworkFunctionDescriptor Dependency of a NetworkServiceDescriptor with specific id" ) public List<VNFDependency> getVNFDependencies(final String idNSD) throws SDKException { String url = idNSD + "/vnfdependencies"; return Arrays.asList((VNFDependency[]) request...
java
@Help( help = "Get all the VirtualNetworkFunctionDescriptor Dependency of a NetworkServiceDescriptor with specific id" ) public List<VNFDependency> getVNFDependencies(final String idNSD) throws SDKException { String url = idNSD + "/vnfdependencies"; return Arrays.asList((VNFDependency[]) request...
[ "@", "Help", "(", "help", "=", "\"Get all the VirtualNetworkFunctionDescriptor Dependency of a NetworkServiceDescriptor with specific id\"", ")", "public", "List", "<", "VNFDependency", ">", "getVNFDependencies", "(", "final", "String", "idNSD", ")", "throws", "SDKException", ...
Return a List with all the VNFDependencies that are contained in a specific NetworkServiceDescriptor. @param idNSD the ID of the NetworkServiceDescriptor @return the List of VNFDependencies @throws SDKException if the request fails
[ "Return", "a", "List", "with", "all", "the", "VNFDependencies", "that", "are", "contained", "in", "a", "specific", "NetworkServiceDescriptor", "." ]
6ca6dd6b62a23940d312213d6fa489d5b636061a
https://github.com/openbaton/openbaton-client/blob/6ca6dd6b62a23940d312213d6fa489d5b636061a/sdk/src/main/java/org/openbaton/sdk/api/rest/NetworkServiceDescriptorAgent.java#L210-L217
train
Get all the VNFDependencies of a specific NetworkServiceDescriptor.
Create a Java method that does the following: "Get all the VNFDependencies of a specific NetworkServiceDescriptor.".
Of course, here is the Java code you requested: ```java @Help( help = "Get all the VirtualNetworkFunctionDescriptor Dependency of a NetworkServiceDescriptor with specific id" ) public List<VNFDependency> getVNFDependencies(final String idNSD) throws SDKException { String url = idNSD + "/vnfdependen...
infinispan/infinispan
commons/src/main/java/org/infinispan/commons/util/OsgiClassLoader.java
OsgiClassLoader.findResource
@Override protected URL findResource(String name) { if (resourceCache.containsKey(name)) { return resourceCache.get(name); } for (WeakReference<Bundle> ref : bundles) { final Bundle bundle = ref.get(); if (bundle != null && bundle.getState() == Bundle.ACTIVE) { ...
java
@Override protected URL findResource(String name) { if (resourceCache.containsKey(name)) { return resourceCache.get(name); } for (WeakReference<Bundle> ref : bundles) { final Bundle bundle = ref.get(); if (bundle != null && bundle.getState() == Bundle.ACTIVE) { ...
[ "@", "Override", "protected", "URL", "findResource", "(", "String", "name", ")", "{", "if", "(", "resourceCache", ".", "containsKey", "(", "name", ")", ")", "{", "return", "resourceCache", ".", "get", "(", "name", ")", ";", "}", "for", "(", "WeakReferenc...
Load the resource and break on first found match. TODO: Should this throw a different exception or warn if multiple resources were found? Naming collisions can and do happen in OSGi...
[ "Load", "the", "resource", "and", "break", "on", "first", "found", "match", "." ]
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/commons/src/main/java/org/infinispan/commons/util/OsgiClassLoader.java#L99-L121
train
Find a resource.
Create a Java method that does the following: "Find a resource.".
Of course, here is the Java code you requested: ```java @Override protected URL findResource(String name) { if (resourceCache.containsKey(name)) { return resourceCache.get(name); } for (WeakReference<Bundle> ref : bundles) { final Bundle bundle = ref.get(); if (bundle !...
fommil/matrix-toolkits-java
src/main/java/no/uib/cipr/matrix/DenseCholesky.java
DenseCholesky.solve
public DenseMatrix solve(DenseMatrix B) throws MatrixNotSPDException { if (notspd) throw new MatrixNotSPDException(); if (n != B.numRows()) throw new IllegalArgumentException("n != B.numRows()"); intW info = new intW(0); if (upper) LAPACK.getInstance(...
java
public DenseMatrix solve(DenseMatrix B) throws MatrixNotSPDException { if (notspd) throw new MatrixNotSPDException(); if (n != B.numRows()) throw new IllegalArgumentException("n != B.numRows()"); intW info = new intW(0); if (upper) LAPACK.getInstance(...
[ "public", "DenseMatrix", "solve", "(", "DenseMatrix", "B", ")", "throws", "MatrixNotSPDException", "{", "if", "(", "notspd", ")", "throw", "new", "MatrixNotSPDException", "(", ")", ";", "if", "(", "n", "!=", "B", ".", "numRows", "(", ")", ")", "throw", "...
Solves for <code>B</code>, overwriting it on return
[ "Solves", "for", "<code", ">", "B<", "/", "code", ">", "overwriting", "it", "on", "return" ]
6157618bc86bcda3749af2a60bf869d8f3292960
https://github.com/fommil/matrix-toolkits-java/blob/6157618bc86bcda3749af2a60bf869d8f3292960/src/main/java/no/uib/cipr/matrix/DenseCholesky.java#L179-L199
train
Solve for A matrix B.
Create a Java method that does the following: "Solve for A matrix B.".
Of course, here is the Java code you requested: ```java public DenseMatrix solve(DenseMatrix B) throws MatrixNotSPDException { if (notspd) throw new MatrixNotSPDException(); if (n != B.numRows()) throw new IllegalArgumentException("n != B.numRows()"); intW info = new in...
androiddevelop/CommonBase
src/main/java/me/codeboy/common/base/net/core/CBConnection.java
CBConnection.connect
public CBConnection connect(String url, String charset) { this.url = url; this.charset = charset; return this; }
java
public CBConnection connect(String url, String charset) { this.url = url; this.charset = charset; return this; }
[ "public", "CBConnection", "connect", "(", "String", "url", ",", "String", "charset", ")", "{", "this", ".", "url", "=", "url", ";", "this", ".", "charset", "=", "charset", ";", "return", "this", ";", "}" ]
连接地址 @param url url @param charset 编码 @return 连接
[ "连接地址" ]
9528eb3a040177596a3f131fa958a94c63614fc4
https://github.com/androiddevelop/CommonBase/blob/9528eb3a040177596a3f131fa958a94c63614fc4/src/main/java/me/codeboy/common/base/net/core/CBConnection.java#L53-L57
valid
Connect to a CBSession.
Create a Java method that does the following: "Connect to a CBSession.".
Of course, here is the Java code you requested: ```java public CBConnection connect(String url, String charset) { this.url = url; this.charset = charset; return this; } ``` Hope this helps!
riversun/d6
src/main/java/org/riversun/d6/core/D6Crud.java
D6Crud.execInsert
public boolean execInsert(D6Model[] modelObjects) { final D6Inex includeExcludeColumnNames = null; return execInsert(modelObjects, includeExcludeColumnNames, false); }
java
public boolean execInsert(D6Model[] modelObjects) { final D6Inex includeExcludeColumnNames = null; return execInsert(modelObjects, includeExcludeColumnNames, false); }
[ "public", "boolean", "execInsert", "(", "D6Model", "[", "]", "modelObjects", ")", "{", "final", "D6Inex", "includeExcludeColumnNames", "=", "null", ";", "return", "execInsert", "(", "modelObjects", ",", "includeExcludeColumnNames", ",", "false", ")", ";", "}" ]
Insert the specified model object into the DB @param modelObjects @return true:DB operation success false:failure
[ "Insert", "the", "specified", "model", "object", "into", "the", "DB" ]
2798bd876b9380dbfea8182d11ad306cb1b0e114
https://github.com/riversun/d6/blob/2798bd876b9380dbfea8182d11ad306cb1b0e114/src/main/java/org/riversun/d6/core/D6Crud.java#L478-L481
train
Insert a sequence of objects into the database.
Create a Java method that does the following: "Insert a sequence of objects into the database.".
Of course, here is the Java code you requested: ```java public boolean execInsert(D6Model[] modelObjects) { final D6Inex includeExcludeColumnNames = null; return execInsert(modelObjects, includeExcludeColumnNames, false); } ``` Hope this helps!
OpenLiberty/open-liberty
dev/com.ibm.ws.channelfw/src/com/ibm/ws/channelfw/internal/ChannelFrameworkImpl.java
ChannelFrameworkImpl.getEndPoint
@Override public CFEndPoint getEndPoint(String chainName) throws ChannelFrameworkException { CFEndPoint rc = null; if (null != chainName) { synchronized (this) { ChainDataImpl chain = this.chainDataMap.get(chainName); if (null != chain) { ...
java
@Override public CFEndPoint getEndPoint(String chainName) throws ChannelFrameworkException { CFEndPoint rc = null; if (null != chainName) { synchronized (this) { ChainDataImpl chain = this.chainDataMap.get(chainName); if (null != chain) { ...
[ "@", "Override", "public", "CFEndPoint", "getEndPoint", "(", "String", "chainName", ")", "throws", "ChannelFrameworkException", "{", "CFEndPoint", "rc", "=", "null", ";", "if", "(", "null", "!=", "chainName", ")", "{", "synchronized", "(", "this", ")", "{", ...
/* @see com.ibm.wsspi.channelfw.ChannelFramework#getEndPoint(java.lang.String)
[ "/", "*" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.channelfw/src/com/ibm/ws/channelfw/internal/ChannelFrameworkImpl.java#L4632-L4644
train
Get the CFEndPoint for the specified chain name.
Create a Java method that does the following: "Get the CFEndPoint for the specified chain name.".
Of course, here is the Java code you requested: ```java @Override public CFEndPoint getEndPoint(String chainName) throws ChannelFrameworkException { CFEndPoint rc = null; if (null != chainName) { synchronized (this) { ChainDataImpl chain = this.chainDataMap.get(chainName...
liferay/com-liferay-commerce
commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPFriendlyURLEntryPersistenceImpl.java
CPFriendlyURLEntryPersistenceImpl.findByG_C_L_U
@Override public CPFriendlyURLEntry findByG_C_L_U(long groupId, long classNameId, String languageId, String urlTitle) throws NoSuchCPFriendlyURLEntryException { CPFriendlyURLEntry cpFriendlyURLEntry = fetchByG_C_L_U(groupId, classNameId, languageId, urlTitle); if (cpFriendlyURLEntry == null) { StringBu...
java
@Override public CPFriendlyURLEntry findByG_C_L_U(long groupId, long classNameId, String languageId, String urlTitle) throws NoSuchCPFriendlyURLEntryException { CPFriendlyURLEntry cpFriendlyURLEntry = fetchByG_C_L_U(groupId, classNameId, languageId, urlTitle); if (cpFriendlyURLEntry == null) { StringBu...
[ "@", "Override", "public", "CPFriendlyURLEntry", "findByG_C_L_U", "(", "long", "groupId", ",", "long", "classNameId", ",", "String", "languageId", ",", "String", "urlTitle", ")", "throws", "NoSuchCPFriendlyURLEntryException", "{", "CPFriendlyURLEntry", "cpFriendlyURLEntry...
Returns the cp friendly url entry where groupId = &#63; and classNameId = &#63; and languageId = &#63; and urlTitle = &#63; or throws a {@link NoSuchCPFriendlyURLEntryException} if it could not be found. @param groupId the group ID @param classNameId the class name ID @param languageId the language ID @param urlTitle ...
[ "Returns", "the", "cp", "friendly", "url", "entry", "where", "groupId", "=", "&#63", ";", "and", "classNameId", "=", "&#63", ";", "and", "languageId", "=", "&#63", ";", "and", "urlTitle", "=", "&#63", ";", "or", "throws", "a", "{", "@link", "NoSuchCPFrie...
9e54362d7f59531fc684016ba49ee7cdc3a2f22b
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPFriendlyURLEntryPersistenceImpl.java#L3925-L3959
train
Returns the cp friendly url entry in the language optionally using the default language if no localization exists for the requested language.
Create a Java method that does the following: "Returns the cp friendly url entry in the language optionally using the default language if no localization exists for the requested language.".
Of course, here is the Java code you requested: ```java @Override public CPFriendlyURLEntry findByG_C_L_U(long groupId, long classNameId, String languageId, String urlTitle) throws NoSuchCPFriendlyURLEntryException { CPFriendlyURLEntry cpFriendlyURLEntry = fetchByG_C_L_U(groupId, classNameId, languageId, ur...
pressgang-ccms/PressGangCCMSContentSpec
src/main/java/org/jboss/pressgang/ccms/contentspec/ContentSpec.java
ContentSpec.setLegalNotice
public void setLegalNotice(final SpecTopic legalNotice) { if (legalNotice == null && this.legalNotice == null) { return; } else if (legalNotice == null) { removeChild(this.legalNotice); this.legalNotice = null; } else if (this.legalNotice == null) { ...
java
public void setLegalNotice(final SpecTopic legalNotice) { if (legalNotice == null && this.legalNotice == null) { return; } else if (legalNotice == null) { removeChild(this.legalNotice); this.legalNotice = null; } else if (this.legalNotice == null) { ...
[ "public", "void", "setLegalNotice", "(", "final", "SpecTopic", "legalNotice", ")", "{", "if", "(", "legalNotice", "==", "null", "&&", "this", ".", "legalNotice", "==", "null", ")", "{", "return", ";", "}", "else", "if", "(", "legalNotice", "==", "null", ...
Sets the SpecTopic of the Legal Notice for the Content Specification. @param legalNotice The SpecTopic for the Legal Notice.
[ "Sets", "the", "SpecTopic", "of", "the", "Legal", "Notice", "for", "the", "Content", "Specification", "." ]
2bc02e2971e4522b47a130fb7ae5a0f5ad377df1
https://github.com/pressgang-ccms/PressGangCCMSContentSpec/blob/2bc02e2971e4522b47a130fb7ae5a0f5ad377df1/src/main/java/org/jboss/pressgang/ccms/contentspec/ContentSpec.java#L1938-L1952
train
Sets the SpecTopic of the Legal Notice.
Create a Java method that does the following: "Sets the SpecTopic of the Legal Notice.".
Of course, here is the Java code you requested: ```java public void setLegalNotice(final SpecTopic legalNotice) { if (legalNotice == null && this.legalNotice == null) { return; } else if (legalNotice == null) { removeChild(this.legalNotice); this.legalNotice = null; ...
codeprimate-software/cp-elements
src/main/java/org/cp/elements/process/util/ProcessUtils.java
ProcessUtils.getProcessId
public static int getProcessId() { RuntimeMXBean runtimeMxBean = ManagementFactory.getRuntimeMXBean(); String runtimeMxBeanName = runtimeMxBean.getName(); Throwable cause = null; if (hasText(runtimeMxBeanName)) { int atSignIndex = runtimeMxBeanName.indexOf('@'); if (atSignIndex > 0) { ...
java
public static int getProcessId() { RuntimeMXBean runtimeMxBean = ManagementFactory.getRuntimeMXBean(); String runtimeMxBeanName = runtimeMxBean.getName(); Throwable cause = null; if (hasText(runtimeMxBeanName)) { int atSignIndex = runtimeMxBeanName.indexOf('@'); if (atSignIndex > 0) { ...
[ "public", "static", "int", "getProcessId", "(", ")", "{", "RuntimeMXBean", "runtimeMxBean", "=", "ManagementFactory", ".", "getRuntimeMXBean", "(", ")", ";", "String", "runtimeMxBeanName", "=", "runtimeMxBean", ".", "getName", "(", ")", ";", "Throwable", "cause", ...
Determines the Process ID (PID) of this Java {@link Process}. @return an {@link Integer} value indicating the Process ID (PID) of this Java {@link Process}. @throws PidUnknownException if the Process ID (PID) of this Java {@link Process} cannot be determined.
[ "Determines", "the", "Process", "ID", "(", "PID", ")", "of", "this", "Java", "{", "@link", "Process", "}", "." ]
f2163c149fbbef05015e688132064ebcac7c49ab
https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/process/util/ProcessUtils.java#L79-L99
train
Get the process ID from the name of the JVM.
Create a Java method that does the following: "Get the process ID from the name of the JVM.".
Of course, here is the Java code you requested: ```java public static int getProcessId() { RuntimeMXBean runtimeMxBean = ManagementFactory.getRuntimeMXBean(); String runtimeMxBeanName = runtimeMxBean.getName(); Throwable cause = null; if (hasText(runtimeMxBeanName)) { int atSignIndex = runtimeM...
khuxtable/seaglass
src/main/java/com/seaglasslookandfeel/painter/AbstractRegionPainter.java
AbstractRegionPainter.getComponentColor
protected final Color getComponentColor(JComponent c, String property, Color defaultColor, float saturationOffset, float brightnessOffset, int alphaOffset) { Color color = null; if (c != null) { // handle some special cases for performance if ("background".equals(pr...
java
protected final Color getComponentColor(JComponent c, String property, Color defaultColor, float saturationOffset, float brightnessOffset, int alphaOffset) { Color color = null; if (c != null) { // handle some special cases for performance if ("background".equals(pr...
[ "protected", "final", "Color", "getComponentColor", "(", "JComponent", "c", ",", "String", "property", ",", "Color", "defaultColor", ",", "float", "saturationOffset", ",", "float", "brightnessOffset", ",", "int", "alphaOffset", ")", "{", "Color", "color", "=", "...
Get a color property from the given JComponent. First checks for a <code> getXXX()</code> method and if that fails checks for a client property with key <code>property</code>. If that still fails to return a Color then <code>defaultColor</code> is returned. @param c The component to get the color prope...
[ "Get", "a", "color", "property", "from", "the", "given", "JComponent", ".", "First", "checks", "for", "a", "<code", ">", "getXXX", "()", "<", "/", "code", ">", "method", "and", "if", "that", "fails", "checks", "for", "a", "client", "property", "with", ...
f25ecba622923d7b29b64cb7d6068dd8005989b3
https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/painter/AbstractRegionPainter.java#L459-L521
train
Get the color for a component.
Create a Java method that does the following: "Get the color for a component.".
Of course, here is the Java code you requested: ```java protected final Color getComponentColor(JComponent c, String property, Color defaultColor, float saturationOffset, float brightnessOffset, int alphaOffset) { Color color = null; if (c != null) { // handle some special cas...
aws/aws-sdk-java
aws-java-sdk-cloudformation/src/main/java/com/amazonaws/services/cloudformation/model/ListStackResourcesResult.java
ListStackResourcesResult.withStackResourceSummaries
public ListStackResourcesResult withStackResourceSummaries(StackResourceSummary... stackResourceSummaries) { if (this.stackResourceSummaries == null) { setStackResourceSummaries(new com.amazonaws.internal.SdkInternalList<StackResourceSummary>(stackResourceSummaries.length)); } for (S...
java
public ListStackResourcesResult withStackResourceSummaries(StackResourceSummary... stackResourceSummaries) { if (this.stackResourceSummaries == null) { setStackResourceSummaries(new com.amazonaws.internal.SdkInternalList<StackResourceSummary>(stackResourceSummaries.length)); } for (S...
[ "public", "ListStackResourcesResult", "withStackResourceSummaries", "(", "StackResourceSummary", "...", "stackResourceSummaries", ")", "{", "if", "(", "this", ".", "stackResourceSummaries", "==", "null", ")", "{", "setStackResourceSummaries", "(", "new", "com", ".", "am...
<p> A list of <code>StackResourceSummary</code> structures. </p> <p> <b>NOTE:</b> This method appends the values to the existing list (if any). Use {@link #setStackResourceSummaries(java.util.Collection)} or {@link #withStackResourceSummaries(java.util.Collection)} if you want to override the existing values. </p> @pa...
[ "<p", ">", "A", "list", "of", "<code", ">", "StackResourceSummary<", "/", "code", ">", "structures", ".", "<", "/", "p", ">", "<p", ">", "<b", ">", "NOTE", ":", "<", "/", "b", ">", "This", "method", "appends", "the", "values", "to", "the", "existin...
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-cloudformation/src/main/java/com/amazonaws/services/cloudformation/model/ListStackResourcesResult.java#L91-L99
train
Adds the stackResourceSummaries value to the list.
Create a Java method that does the following: "Adds the stackResourceSummaries value to the list.".
Of course, here is the Java code you requested: ```java public ListStackResourcesResult withStackResourceSummaries(StackResourceSummary... stackResourceSummaries) { if (this.stackResourceSummaries == null) { setStackResourceSummaries(new com.amazonaws.internal.SdkInternalList<StackResourceSummary>(...
liquibase/liquibase
liquibase-core/src/main/java/liquibase/snapshot/DatabaseSnapshot.java
DatabaseSnapshot.include
protected <T extends DatabaseObject> T include(T example) throws DatabaseException, InvalidExampleException { if (example == null) { return null; } if (database.isSystemObject(example)) { return null; } if ((example instanceof Schema) && (example.getName...
java
protected <T extends DatabaseObject> T include(T example) throws DatabaseException, InvalidExampleException { if (example == null) { return null; } if (database.isSystemObject(example)) { return null; } if ((example instanceof Schema) && (example.getName...
[ "protected", "<", "T", "extends", "DatabaseObject", ">", "T", "include", "(", "T", "example", ")", "throws", "DatabaseException", ",", "InvalidExampleException", "{", "if", "(", "example", "==", "null", ")", "{", "return", "null", ";", "}", "if", "(", "dat...
Include the object described by the passed example object in this snapshot. Returns the object snapshot or null if the object does not exist in the database. If the same object was returned by an earlier include() call, the same object instance will be returned.
[ "Include", "the", "object", "described", "by", "the", "passed", "example", "object", "in", "this", "snapshot", ".", "Returns", "the", "object", "snapshot", "or", "null", "if", "the", "object", "does", "not", "exist", "in", "the", "database", ".", "If", "th...
86a3b30fa6821ac981056f252f918557f5ebcc60
https://github.com/liquibase/liquibase/blob/86a3b30fa6821ac981056f252f918557f5ebcc60/liquibase-core/src/main/java/liquibase/snapshot/DatabaseSnapshot.java#L251-L320
valid
This method is called to include a single instance of the database object.
Create a Java method that does the following: "This method is called to include a single instance of the database object.".
Of course, here is the Java code you requested: ```java protected <T extends DatabaseObject> T include(T example) throws DatabaseException, InvalidExampleException { if (example == null) { return null; } if (database.isSystemObject(example)) { return null; } ...
ben-manes/caffeine
simulator/src/main/java/com/github/benmanes/caffeine/cache/simulator/policy/linked/FrequentlyUsedPolicy.java
FrequentlyUsedPolicy.onHit
private void onHit(Node node) { policyStats.recordHit(); int newCount = node.freq.count + 1; FrequencyNode freqN = (node.freq.next.count == newCount) ? node.freq.next : new FrequencyNode(newCount, node.freq); node.remove(); if (node.freq.isEmpty()) { node.freq.remove(); } ...
java
private void onHit(Node node) { policyStats.recordHit(); int newCount = node.freq.count + 1; FrequencyNode freqN = (node.freq.next.count == newCount) ? node.freq.next : new FrequencyNode(newCount, node.freq); node.remove(); if (node.freq.isEmpty()) { node.freq.remove(); } ...
[ "private", "void", "onHit", "(", "Node", "node", ")", "{", "policyStats", ".", "recordHit", "(", ")", ";", "int", "newCount", "=", "node", ".", "freq", ".", "count", "+", "1", ";", "FrequencyNode", "freqN", "=", "(", "node", ".", "freq", ".", "next",...
Moves the entry to the next higher frequency list, creating it if necessary.
[ "Moves", "the", "entry", "to", "the", "next", "higher", "frequency", "list", "creating", "it", "if", "necessary", "." ]
4cf6d6e6a18ea2e8088f166261e5949343b0f2eb
https://github.com/ben-manes/caffeine/blob/4cf6d6e6a18ea2e8088f166261e5949343b0f2eb/simulator/src/main/java/com/github/benmanes/caffeine/cache/simulator/policy/linked/FrequentlyUsedPolicy.java#L87-L100
train
On hit.
Create a Java method that does the following: "On hit.".
Of course, here is the Java code you requested: ```java private void onHit(Node node) { policyStats.recordHit(); int newCount = node.freq.count + 1; FrequencyNode freqN = (node.freq.next.count == newCount) ? node.freq.next : new FrequencyNode(newCount, node.freq); node.remove(); if...
VoltDB/voltdb
src/hsqldb19b3/org/hsqldb_voltpatches/Session.java
Session.defineLocalTable
public Table defineLocalTable(HsqlName tableName, HsqlName[] colNames, Type[] colTypes) { // I'm not sure the table type, here TableBase.CACHED_TABLE, matters // all that much. assert(localTables != null); Table newTable = TableUtil.newTable(database, TableBase.CACHED_TABLE, tableName); ...
java
public Table defineLocalTable(HsqlName tableName, HsqlName[] colNames, Type[] colTypes) { // I'm not sure the table type, here TableBase.CACHED_TABLE, matters // all that much. assert(localTables != null); Table newTable = TableUtil.newTable(database, TableBase.CACHED_TABLE, tableName); ...
[ "public", "Table", "defineLocalTable", "(", "HsqlName", "tableName", ",", "HsqlName", "[", "]", "colNames", ",", "Type", "[", "]", "colTypes", ")", "{", "// I'm not sure the table type, here TableBase.CACHED_TABLE, matters", "// all that much.", "assert", "(", "localTable...
Define a local table with the given name, column names and column types. @param tableName @param colNames @param colTypes @return
[ "Define", "a", "local", "table", "with", "the", "given", "name", "column", "names", "and", "column", "types", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/Session.java#L1860-L1869
train
Create a new local table.
Create a Java method that does the following: "Create a new local table.".
Of course, here is the Java code you requested: ```java public Table defineLocalTable(HsqlName tableName, HsqlName[] colNames, Type[] colTypes) { // I'm not sure the table type, here TableBase.CACHED_TABLE, matters // all that much. assert(localTables != null); Table newTable = TableUtil.n...
OpenLiberty/open-liberty
dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/ejbcontainer/runtime/AbstractEJBRuntime.java
AbstractEJBRuntime.finishBMDInit
private void finishBMDInit(BeanMetaData bmd) throws ContainerException, EJBConfigurationException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) Tr.entry(tc, "finishBMDInit: " + bmd.j2eeName); // d640935.1 // First, create the reference context for the bean if we haven't...
java
private void finishBMDInit(BeanMetaData bmd) throws ContainerException, EJBConfigurationException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) Tr.entry(tc, "finishBMDInit: " + bmd.j2eeName); // d640935.1 // First, create the reference context for the bean if we haven't...
[ "private", "void", "finishBMDInit", "(", "BeanMetaData", "bmd", ")", "throws", "ContainerException", ",", "EJBConfigurationException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "Tr", ...
Fully initialize the BeanMetaData. When this method completes successfully, bmd.fullyInitialized will be true; this method must not be called if this field is already true. The context class loader must be the runtime class loader when calling this method.
[ "Fully", "initialize", "the", "BeanMetaData", ".", "When", "this", "method", "completes", "successfully", "bmd", ".", "fullyInitialized", "will", "be", "true", ";", "this", "method", "must", "not", "be", "called", "if", "this", "field", "is", "already", "true"...
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/ejbcontainer/runtime/AbstractEJBRuntime.java#L1501-L1516
train
Finish the initialization of a BeanMetaData object.
Create a Java method that does the following: "Finish the initialization of a BeanMetaData object.".
Of course, here is the Java code you requested: ```java private void finishBMDInit(BeanMetaData bmd) throws ContainerException, EJBConfigurationException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) Tr.entry(tc, "finishBMDInit: " + bmd.j2eeName); // d640935.1 // First...
mbenson/therian
core/src/main/java/therian/operator/convert/IterableToList.java
IterableToList.perform
@Override public boolean perform(TherianContext context, Convert<? extends Iterable<?>, ? super List> convert) { final Type sourceElementType = context.eval(GetElementType.of(convert.getSourcePosition())); return context.evalSuccess(Convert.to(convert.getTargetPosition(), Positions.readO...
java
@Override public boolean perform(TherianContext context, Convert<? extends Iterable<?>, ? super List> convert) { final Type sourceElementType = context.eval(GetElementType.of(convert.getSourcePosition())); return context.evalSuccess(Convert.to(convert.getTargetPosition(), Positions.readO...
[ "@", "Override", "public", "boolean", "perform", "(", "TherianContext", "context", ",", "Convert", "<", "?", "extends", "Iterable", "<", "?", ">", ",", "?", "super", "List", ">", "convert", ")", "{", "final", "Type", "sourceElementType", "=", "context", "....
{@inheritDoc}
[ "{" ]
0653505f73e2a6f5b0abc394ea6d83af03408254
https://github.com/mbenson/therian/blob/0653505f73e2a6f5b0abc394ea6d83af03408254/core/src/main/java/therian/operator/convert/IterableToList.java#L50-L56
train
Override the method to perform the conversion.
Create a Java method that does the following: "Override the method to perform the conversion.".
Of course, here is the Java code you requested: ```java @Override public boolean perform(TherianContext context, Convert<? extends Iterable<?>, ? super List> convert) { final Type sourceElementType = context.eval(GetElementType.of(convert.getSourcePosition())); return context.evalSuccess(Convert.to...
alkacon/opencms-core
src/org/opencms/jsp/CmsJspTagContainer.java
CmsJspTagContainer.getContainerWidth
private int getContainerWidth() { int containerWidth = -1; try { containerWidth = Integer.parseInt(m_width); } catch (NumberFormatException e) { // do nothing, set width to -1 LOG.debug("Error parsing container width.", e); } return containerW...
java
private int getContainerWidth() { int containerWidth = -1; try { containerWidth = Integer.parseInt(m_width); } catch (NumberFormatException e) { // do nothing, set width to -1 LOG.debug("Error parsing container width.", e); } return containerW...
[ "private", "int", "getContainerWidth", "(", ")", "{", "int", "containerWidth", "=", "-", "1", ";", "try", "{", "containerWidth", "=", "Integer", ".", "parseInt", "(", "m_width", ")", ";", "}", "catch", "(", "NumberFormatException", "e", ")", "{", "// do no...
Gets the container width as a number.<p> If the container width is not set, or not a number, -1 will be returned.<p> @return the container width or -1
[ "Gets", "the", "container", "width", "as", "a", "number", ".", "<p", ">" ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/CmsJspTagContainer.java#L1158-L1168
train
Get the container width.
Create a Java method that does the following: "Get the container width.".
Of course, here is the Java code you requested: ```java private int getContainerWidth() { int containerWidth = -1; try { containerWidth = Integer.parseInt(m_width); } catch (NumberFormatException e) { // do nothing, set width to -1 LOG.debug("Error parsing c...
jetty-project/jetty-npn
npn-boot/src/main/java/sun/security/ssl/ServerHandshaker.java
ServerHandshaker.processMessage
void processMessage(byte type, int message_len) throws IOException { // // In SSLv3 and TLS, messages follow strictly increasing // numerical order _except_ for one annoying special case. // if ((state >= type) && (state != HandshakeMessage.ht_client_k...
java
void processMessage(byte type, int message_len) throws IOException { // // In SSLv3 and TLS, messages follow strictly increasing // numerical order _except_ for one annoying special case. // if ((state >= type) && (state != HandshakeMessage.ht_client_k...
[ "void", "processMessage", "(", "byte", "type", ",", "int", "message_len", ")", "throws", "IOException", "{", "//", "// In SSLv3 and TLS, messages follow strictly increasing", "// numerical order _except_ for one annoying special case.", "//", "if", "(", "(", "state", ">=", ...
/* This routine handles all the server side handshake messages, one at a time. Given the message type (and in some cases the pending cipher spec) it parses the type-specific message. Then it calls a function that handles that specific message. It updates the state machine as each message is processed, and writes res...
[ "/", "*", "This", "routine", "handles", "all", "the", "server", "side", "handshake", "messages", "one", "at", "a", "time", ".", "Given", "the", "message", "type", "(", "and", "in", "some", "cases", "the", "pending", "cipher", "spec", ")", "it", "parses",...
a26a7a5eabeeb57a63c6ee08fcf9b8cec1fa6c0d
https://github.com/jetty-project/jetty-npn/blob/a26a7a5eabeeb57a63c6ee08fcf9b8cec1fa6c0d/npn-boot/src/main/java/sun/security/ssl/ServerHandshaker.java#L151-L284
train
Process a message from the server.
Create a Java method that does the following: "Process a message from the server.".
Of course, here is the Java code you requested: ```java void processMessage(byte type, int message_len) throws IOException { // // In SSLv3 and TLS, messages follow strictly increasing // numerical order _except_ for one annoying special case. // if ((state >= type) ...
google/flogger
api/src/main/java/com/google/common/flogger/parser/PrintfMessageParser.java
PrintfMessageParser.unescapePrintf
static void unescapePrintf(StringBuilder out, String message, int start, int end) { int pos = start; while (pos < end) { if (message.charAt(pos++) != '%') { continue; } if (pos == end) { // Ignore unexpected trailing '%'. break; } char chr = message.charAt(p...
java
static void unescapePrintf(StringBuilder out, String message, int start, int end) { int pos = start; while (pos < end) { if (message.charAt(pos++) != '%') { continue; } if (pos == end) { // Ignore unexpected trailing '%'. break; } char chr = message.charAt(p...
[ "static", "void", "unescapePrintf", "(", "StringBuilder", "out", ",", "String", "message", ",", "int", "start", ",", "int", "end", ")", "{", "int", "pos", "=", "start", ";", "while", "(", "pos", "<", "end", ")", "{", "if", "(", "message", ".", "charA...
VisibleForTesting
[ "VisibleForTesting" ]
a164967a93a9f4ce92f34319fc0cc7c91a57321c
https://github.com/google/flogger/blob/a164967a93a9f4ce92f34319fc0cc7c91a57321c/api/src/main/java/com/google/common/flogger/parser/PrintfMessageParser.java#L232-L261
train
Unescapes a single - escaped printf from the given message.
Create a Java method that does the following: "Unescapes a single - escaped printf from the given message.".
Of course, here is the Java code you requested: ```java static void unescapePrintf(StringBuilder out, String message, int start, int end) { int pos = start; while (pos < end) { if (message.charAt(pos++) != '%') { continue; } if (pos == end) { // Ignore unexpected trailing '%'....
cdk/cdk
legacy/src/main/java/org/openscience/cdk/smsd/algorithm/rgraph/CDKMCS.java
CDKMCS.queryAdjacency
private static boolean queryAdjacency(IBond bondA1, IBond bondB1, IBond bondA2, IBond bondB2) { IAtom atom1 = null; IAtom atom2 = null; if (bondA1.contains(bondB1.getBegin())) { atom1 = bondB1.getBegin(); } else if (bondA1.contains(bondB1.getEnd())) { atom1 = bo...
java
private static boolean queryAdjacency(IBond bondA1, IBond bondB1, IBond bondA2, IBond bondB2) { IAtom atom1 = null; IAtom atom2 = null; if (bondA1.contains(bondB1.getBegin())) { atom1 = bondB1.getBegin(); } else if (bondA1.contains(bondB1.getEnd())) { atom1 = bo...
[ "private", "static", "boolean", "queryAdjacency", "(", "IBond", "bondA1", ",", "IBond", "bondB1", ",", "IBond", "bondA2", ",", "IBond", "bondB2", ")", "{", "IAtom", "atom1", "=", "null", ";", "IAtom", "atom2", "=", "null", ";", "if", "(", "bondA1", ".", ...
Determines if 2 bondA1 have 1 atom in common if second is atom query AtomContainer @param atom1 first bondA1 @param bondB1 second bondA1 @return the symbol of the common atom or "" if the 2 bonds have no common atom
[ "Determines", "if", "2", "bondA1", "have", "1", "atom", "in", "common", "if", "second", "is", "atom", "query", "AtomContainer" ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/legacy/src/main/java/org/openscience/cdk/smsd/algorithm/rgraph/CDKMCS.java#L940-L964
train
Query the alignment of two bonds.
Create a Java method that does the following: "Query the alignment of two bonds.".
Of course, here is the Java code you requested: ```java private static boolean queryAdjacency(IBond bondA1, IBond bondB1, IBond bondA2, IBond bondB2) { IAtom atom1 = null; IAtom atom2 = null; if (bondA1.contains(bondB1.getBegin())) { atom1 = bondB1.getBegin(); } else if (b...
phax/ph-schedule
ph-schedule/src/main/java/com/helger/schedule/quartz/trigger/JDK8TriggerBuilder.java
JDK8TriggerBuilder.forJob
@Nonnull public JDK8TriggerBuilder <T> forJob (final String jobName, final String jobGroup) { m_aJobKey = new JobKey (jobName, jobGroup); return this; }
java
@Nonnull public JDK8TriggerBuilder <T> forJob (final String jobName, final String jobGroup) { m_aJobKey = new JobKey (jobName, jobGroup); return this; }
[ "@", "Nonnull", "public", "JDK8TriggerBuilder", "<", "T", ">", "forJob", "(", "final", "String", "jobName", ",", "final", "String", "jobGroup", ")", "{", "m_aJobKey", "=", "new", "JobKey", "(", "jobName", ",", "jobGroup", ")", ";", "return", "this", ";", ...
Set the identity of the Job which should be fired by the produced Trigger - a <code>JobKey</code> will be produced with the given name and group. @param jobName the name of the job to fire. @param jobGroup the group of the job to fire. @return the updated JDK8TriggerBuilder @see ITrigger#getJobKey()
[ "Set", "the", "identity", "of", "the", "Job", "which", "should", "be", "fired", "by", "the", "produced", "Trigger", "-", "a", "<code", ">", "JobKey<", "/", "code", ">", "will", "be", "produced", "with", "the", "given", "name", "and", "group", "." ]
b000790b46a9f8d23ad44cc20591f753d07c0229
https://github.com/phax/ph-schedule/blob/b000790b46a9f8d23ad44cc20591f753d07c0229/ph-schedule/src/main/java/com/helger/schedule/quartz/trigger/JDK8TriggerBuilder.java#L352-L357
train
Set the job key.
Create a Java method that does the following: "Set the job key.".
Of course, here is the Java code you requested: ```java @Nonnull public JDK8TriggerBuilder <T> forJob (final String jobName, final String jobGroup) { m_aJobKey = new JobKey (jobName, jobGroup); return this; } ``` Hope this helps!
overturetool/overture
core/pog/src/main/java/org/overture/pog/visitors/PogParamStmVisitor.java
PogParamStmVisitor.caseAReturnStm
@Override public IProofObligationList caseAReturnStm(AReturnStm node, IPOContextStack question) throws AnalysisException { try { IProofObligationList obligations = new ProofObligationList(); if (node.getExpression() != null) { obligations.addAll(node.getExpression().apply(rootVisitor, question));...
java
@Override public IProofObligationList caseAReturnStm(AReturnStm node, IPOContextStack question) throws AnalysisException { try { IProofObligationList obligations = new ProofObligationList(); if (node.getExpression() != null) { obligations.addAll(node.getExpression().apply(rootVisitor, question));...
[ "@", "Override", "public", "IProofObligationList", "caseAReturnStm", "(", "AReturnStm", "node", ",", "IPOContextStack", "question", ")", "throws", "AnalysisException", "{", "try", "{", "IProofObligationList", "obligations", "=", "new", "ProofObligationList", "(", ")", ...
}
[ "}" ]
83175dc6c24fa171cde4fcf61ecb648eba3bdbc1
https://github.com/overturetool/overture/blob/83175dc6c24fa171cde4fcf61ecb648eba3bdbc1/core/pog/src/main/java/org/overture/pog/visitors/PogParamStmVisitor.java#L474-L492
train
A return statement.
Create a Java method that does the following: "A return statement.".
Of course, here is the Java code you requested: ```java @Override public IProofObligationList caseAReturnStm(AReturnStm node, IPOContextStack question) throws AnalysisException { try { IProofObligationList obligations = new ProofObligationList(); if (node.getExpression() != null) { obligations.a...
Alluxio/alluxio
core/transport/src/main/java/alluxio/grpc/FileInfo.java
FileInfo.getUfsFingerprintBytes
public com.google.protobuf.ByteString getUfsFingerprintBytes() { java.lang.Object ref = ufsFingerprint_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); ufsFingerprint_ = b;...
java
public com.google.protobuf.ByteString getUfsFingerprintBytes() { java.lang.Object ref = ufsFingerprint_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); ufsFingerprint_ = b;...
[ "public", "com", ".", "google", ".", "protobuf", ".", "ByteString", "getUfsFingerprintBytes", "(", ")", "{", "java", ".", "lang", ".", "Object", "ref", "=", "ufsFingerprint_", ";", "if", "(", "ref", "instanceof", "java", ".", "lang", ".", "String", ")", ...
<code>optional string ufsFingerprint = 26;</code>
[ "<code", ">", "optional", "string", "ufsFingerprint", "=", "26", ";", "<", "/", "code", ">" ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/transport/src/main/java/alluxio/grpc/FileInfo.java#L903-L915
train
Gets the ufsFingerprintBytes value.
Create a Java method that does the following: "Gets the ufsFingerprintBytes value.".
Of course, here is the Java code you requested: ```java public com.google.protobuf.ByteString getUfsFingerprintBytes() { java.lang.Object ref = ufsFingerprint_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( ...
Evol-Instruct
N/A
N/A
java
[]
[]
train
Write a Java switch statement that prints different messages based on the following conditions: 1. If the boolean variable "isWeekend" is true, print "Enjoy your weekend!" 2. If the boolean variable "isWeekend" is false and the boolean variable "isWorking" is true, print "Keep up the good work!" 3. If both "isWeekend"...
Here's the correct Java switch statement: ```java boolean isWeekend = true; boolean isWorking = false; switch (isWeekend) { case true: System.out.println("Enjoy your weekend!"); break; case false: switch (isWorking) { case true: System.out.println("Keep up t...
treelogic-swe/aws-mock
src/main/java/com/tlswe/awsmock/ec2/control/MockSecurityGroupController.java
MockSecurityGroupController.createSecurityGroup
public MockSecurityGroup createSecurityGroup( final String groupName, final String groupDescription, final String vpcId) { MockSecurityGroup ret = new MockSecurityGroup(); ret.setGroupName(groupName); ret.setGroupDescription(groupDescription); ret.setGroupId( ...
java
public MockSecurityGroup createSecurityGroup( final String groupName, final String groupDescription, final String vpcId) { MockSecurityGroup ret = new MockSecurityGroup(); ret.setGroupName(groupName); ret.setGroupDescription(groupDescription); ret.setGroupId( ...
[ "public", "MockSecurityGroup", "createSecurityGroup", "(", "final", "String", "groupName", ",", "final", "String", "groupDescription", ",", "final", "String", "vpcId", ")", "{", "MockSecurityGroup", "ret", "=", "new", "MockSecurityGroup", "(", ")", ";", "ret", "."...
Create the mock SecurityGroup. @param groupName group Name. @param groupDescription group Description. @param vpcId vpc Id for Security Group. @return mock Security Group.
[ "Create", "the", "mock", "SecurityGroup", "." ]
1d1058c0ebbd0615efa28695481e36ae3ffc58a0
https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/ec2/control/MockSecurityGroupController.java#L86-L107
train
Create a mock SecurityGroup.
Create a Java method that does the following: "Create a mock SecurityGroup.".
Of course, here is the Java code you requested: ```java public MockSecurityGroup createSecurityGroup( final String groupName, final String groupDescription, final String vpcId) { MockSecurityGroup ret = new MockSecurityGroup(); ret.setGroupName(groupName); ret.setGroupDescription(g...
OpenLiberty/open-liberty
dev/com.ibm.ws.kernel.boot.core/src/com/ibm/ws/kernel/boot/logging/TaggedFileOutputStreamFactory.java
TaggedFileOutputStreamFactory.createOutputStream
@Override public FileOutputStream createOutputStream(File file, boolean append) throws IOException { return new TaggedFileOutputStream(file, append); }
java
@Override public FileOutputStream createOutputStream(File file, boolean append) throws IOException { return new TaggedFileOutputStream(file, append); }
[ "@", "Override", "public", "FileOutputStream", "createOutputStream", "(", "File", "file", ",", "boolean", "append", ")", "throws", "IOException", "{", "return", "new", "TaggedFileOutputStream", "(", "file", ",", "append", ")", ";", "}" ]
{@inheritDoc}
[ "{" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.boot.core/src/com/ibm/ws/kernel/boot/logging/TaggedFileOutputStreamFactory.java#L32-L35
train
Create a new FileOutputStream.
Create a Java method that does the following: "Create a new FileOutputStream.".
Of course, here is the Java code you requested: ```java @Override public FileOutputStream createOutputStream(File file, boolean append) throws IOException { return new TaggedFileOutputStream(file, append); } ``` Hope this helps!
looly/hutool
hutool-core/src/main/java/cn/hutool/core/collection/CollUtil.java
CollUtil.extract
public static List<Object> extract(Iterable<?> collection, Editor<Object> editor, boolean ignoreNull) { final List<Object> fieldValueList = new ArrayList<>(); Object value; for (Object bean : collection) { value = editor.edit(bean); if (null == value && ignoreNull) { continue; } fieldValue...
java
public static List<Object> extract(Iterable<?> collection, Editor<Object> editor, boolean ignoreNull) { final List<Object> fieldValueList = new ArrayList<>(); Object value; for (Object bean : collection) { value = editor.edit(bean); if (null == value && ignoreNull) { continue; } fieldValue...
[ "public", "static", "List", "<", "Object", ">", "extract", "(", "Iterable", "<", "?", ">", "collection", ",", "Editor", "<", "Object", ">", "editor", ",", "boolean", "ignoreNull", ")", "{", "final", "List", "<", "Object", ">", "fieldValueList", "=", "new...
通过Editor抽取集合元素中的某些值返回为新列表<br> 例如提供的是一个Bean列表,通过Editor接口实现获取某个字段值,返回这个字段值组成的新列表 @param collection 原集合 @param editor 编辑器 @param ignoreNull 是否忽略空值 @return 抽取后的新列表 @since 4.5.7
[ "通过Editor抽取集合元素中的某些值返回为新列表<br", ">", "例如提供的是一个Bean列表,通过Editor接口实现获取某个字段值,返回这个字段值组成的新列表" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/collection/CollUtil.java#L1137-L1148
train
Extract a list of objects from a collection using the specified editor.
Create a Java method that does the following: "Extract a list of objects from a collection using the specified editor.".
Of course, here is the Java code you requested: ```java public static List<Object> extract(Iterable<?> collection, Editor<Object> editor, boolean ignoreNull) { final List<Object> fieldValueList = new ArrayList<>(); Object value; for (Object bean : collection) { value = editor.edit(bean); if (null == v...
google/guice
extensions/assistedinject/src/com/google/inject/assistedinject/AssistedConstructor.java
AssistedConstructor.newInstance
public T newInstance(Object[] args) throws Throwable { constructor.setAccessible(true); try { return constructor.newInstance(args); } catch (InvocationTargetException e) { throw e.getCause(); } }
java
public T newInstance(Object[] args) throws Throwable { constructor.setAccessible(true); try { return constructor.newInstance(args); } catch (InvocationTargetException e) { throw e.getCause(); } }
[ "public", "T", "newInstance", "(", "Object", "[", "]", "args", ")", "throws", "Throwable", "{", "constructor", ".", "setAccessible", "(", "true", ")", ";", "try", "{", "return", "constructor", ".", "newInstance", "(", "args", ")", ";", "}", "catch", "(",...
Returns an instance of T, constructed using this constructor, with the supplied arguments.
[ "Returns", "an", "instance", "of", "T", "constructed", "using", "this", "constructor", "with", "the", "supplied", "arguments", "." ]
a0552a16d813ead98fe73737fb001db336650251
https://github.com/google/guice/blob/a0552a16d813ead98fe73737fb001db336650251/extensions/assistedinject/src/com/google/inject/assistedinject/AssistedConstructor.java#L89-L96
test
Create a new instance of the class.
Create a Java method that does the following: "Create a new instance of the class.".
Of course, here is the Java code you requested: ```java public T newInstance(Object[] args) throws Throwable { constructor.setAccessible(true); try { return constructor.newInstance(args); } catch (InvocationTargetException e) { throw e.getCause(); } } ``` Hope this helps!
before/quality-check
modules/quality-check/src/main/java/net/sf/qualitycheck/Check.java
Check.isNumber
@ArgumentsChecked @Throws({ IllegalNullArgumentException.class, IllegalNumberArgumentException.class }) public static <T extends Number> T isNumber(@Nonnull final String value, @Nullable final String name, @Nonnull final Class<T> type) { Check.notNull(value, "value"); Check.notNull(type, "type"); final Number ...
java
@ArgumentsChecked @Throws({ IllegalNullArgumentException.class, IllegalNumberArgumentException.class }) public static <T extends Number> T isNumber(@Nonnull final String value, @Nullable final String name, @Nonnull final Class<T> type) { Check.notNull(value, "value"); Check.notNull(type, "type"); final Number ...
[ "@", "ArgumentsChecked", "@", "Throws", "(", "{", "IllegalNullArgumentException", ".", "class", ",", "IllegalNumberArgumentException", ".", "class", "}", ")", "public", "static", "<", "T", "extends", "Number", ">", "T", "isNumber", "(", "@", "Nonnull", "final", ...
Ensures that a String argument is a number. This overload supports all subclasses of {@code Number}. The number is first converted to a {@code BigDecimal} or {@code BigInteger}. Floating point types are only supported if the {@code type} is one of {@code Float, Double, BigDecimal}. <p> This method does also check agai...
[ "Ensures", "that", "a", "String", "argument", "is", "a", "number", ".", "This", "overload", "supports", "all", "subclasses", "of", "{", "@code", "Number", "}", ".", "The", "number", "is", "first", "converted", "to", "a", "{", "@code", "BigDecimal", "}", ...
a75c32c39434ddb1f89bece57acae0536724c15a
https://github.com/before/quality-check/blob/a75c32c39434ddb1f89bece57acae0536724c15a/modules/quality-check/src/main/java/net/sf/qualitycheck/Check.java#L1294-L1312
train
Checks if a string is a number.
Create a Java method that does the following: "Checks if a string is a number.".
Of course, here is the Java code you requested: ```java @ArgumentsChecked @Throws({ IllegalNullArgumentException.class, IllegalNumberArgumentException.class }) public static <T extends Number> T isNumber(@Nonnull final String value, @Nullable final String name, @Nonnull final Class<T> type) { Check.notNull(value, ...
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/ForkJoinPool.java
ForkJoinPool.tryCreateExternalQueue
private void tryCreateExternalQueue(int index) { AuxState aux; if ((aux = auxState) != null && index >= 0) { WorkQueue q = new WorkQueue(this, null); q.config = index; q.scanState = ~UNSIGNALLED; q.qlock = 1; // lock queue boo...
java
private void tryCreateExternalQueue(int index) { AuxState aux; if ((aux = auxState) != null && index >= 0) { WorkQueue q = new WorkQueue(this, null); q.config = index; q.scanState = ~UNSIGNALLED; q.qlock = 1; // lock queue boo...
[ "private", "void", "tryCreateExternalQueue", "(", "int", "index", ")", "{", "AuxState", "aux", ";", "if", "(", "(", "aux", "=", "auxState", ")", "!=", "null", "&&", "index", ">=", "0", ")", "{", "WorkQueue", "q", "=", "new", "WorkQueue", "(", "this", ...
Constructs and tries to install a new external queue, failing if the workQueues array already has a queue at the given index. @param index the index of the new queue
[ "Constructs", "and", "tries", "to", "install", "a", "new", "external", "queue", "failing", "if", "the", "workQueues", "array", "already", "has", "a", "queue", "at", "the", "given", "index", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/ForkJoinPool.java#L2487-L2514
train
Try to create an external queue.
Create a Java method that does the following: "Try to create an external queue.".
Of course, here is the Java code you requested: ```java private void tryCreateExternalQueue(int index) { AuxState aux; if ((aux = auxState) != null && index >= 0) { WorkQueue q = new WorkQueue(this, null); q.config = index; q.scanState = ~UNSIGNALLED; q.q...
JavaMoney/jsr354-ri-bp
src/main/java/org/javamoney/moneta/RoundedMoney.java
RoundedMoney.multiply
@Override public RoundedMoney multiply(Number multiplicand) { BigDecimal bd = MoneyUtils.getBigDecimal(multiplicand); if (isOne(bd)) { return this; } MathContext mc = monetaryContext.get(MathContext.class); if(mc==null){ mc = MathContext.DECIMAL64; ...
java
@Override public RoundedMoney multiply(Number multiplicand) { BigDecimal bd = MoneyUtils.getBigDecimal(multiplicand); if (isOne(bd)) { return this; } MathContext mc = monetaryContext.get(MathContext.class); if(mc==null){ mc = MathContext.DECIMAL64; ...
[ "@", "Override", "public", "RoundedMoney", "multiply", "(", "Number", "multiplicand", ")", "{", "BigDecimal", "bd", "=", "MoneyUtils", ".", "getBigDecimal", "(", "multiplicand", ")", ";", "if", "(", "isOne", "(", "bd", ")", ")", "{", "return", "this", ";",...
/* (non-Javadoc) @see MonetaryAmount#multiply(Number)
[ "/", "*", "(", "non", "-", "Javadoc", ")" ]
9c147ef5623d8032a6dc4c0e5eefdfb41641a9a2
https://github.com/JavaMoney/jsr354-ri-bp/blob/9c147ef5623d8032a6dc4c0e5eefdfb41641a9a2/src/main/java/org/javamoney/moneta/RoundedMoney.java#L415-L427
train
Multiply this money by another.
Create a Java method that does the following: "Multiply this money by another.".
Of course, here is the Java code you requested: ```java @Override public RoundedMoney multiply(Number multiplicand) { BigDecimal bd = MoneyUtils.getBigDecimal(multiplicand); if (isOne(bd)) { return this; } MathContext mc = monetaryContext.get(MathContext.class); ...
yanzhenjie/AndPermission
support/src/main/java/com/yanzhenjie/permission/bridge/BridgeActivity.java
BridgeActivity.requestInstall
static void requestInstall(Source source) { Intent intent = new Intent(source.getContext(), BridgeActivity.class); intent.putExtra(KEY_TYPE, BridgeRequest.TYPE_INSTALL); source.startActivity(intent); }
java
static void requestInstall(Source source) { Intent intent = new Intent(source.getContext(), BridgeActivity.class); intent.putExtra(KEY_TYPE, BridgeRequest.TYPE_INSTALL); source.startActivity(intent); }
[ "static", "void", "requestInstall", "(", "Source", "source", ")", "{", "Intent", "intent", "=", "new", "Intent", "(", "source", ".", "getContext", "(", ")", ",", "BridgeActivity", ".", "class", ")", ";", "intent", ".", "putExtra", "(", "KEY_TYPE", ",", "...
Request for package install.
[ "Request", "for", "package", "install", "." ]
bbfaaecdb8ecf0f2aa270d80c0b88d022dddda7c
https://github.com/yanzhenjie/AndPermission/blob/bbfaaecdb8ecf0f2aa270d80c0b88d022dddda7c/support/src/main/java/com/yanzhenjie/permission/bridge/BridgeActivity.java#L64-L68
train
Request install of the Bridge.
Create a Java method that does the following: "Request install of the Bridge.".
Of course, here is the Java code you requested: ```java static void requestInstall(Source source) { Intent intent = new Intent(source.getContext(), BridgeActivity.class); intent.putExtra(KEY_TYPE, BridgeRequest.TYPE_INSTALL); source.startActivity(intent); } ``` Hope this helps!
eurekaclinical/protempa
protempa-framework/src/main/java/org/protempa/proposition/interval/DirectionalPathConsistency.java
DirectionalPathConsistency.getConsistent
static boolean getConsistent(DirectedGraph g) { Object[] vertexOrdering = new Object[g.size()]; int voa = 0; for (Iterator<?> itr = g.iterator(); itr.hasNext(); voa++) { vertexOrdering[voa] = itr.next(); } int vol = vertexOrdering.length; Weight[][] updatedEdg...
java
static boolean getConsistent(DirectedGraph g) { Object[] vertexOrdering = new Object[g.size()]; int voa = 0; for (Iterator<?> itr = g.iterator(); itr.hasNext(); voa++) { vertexOrdering[voa] = itr.next(); } int vol = vertexOrdering.length; Weight[][] updatedEdg...
[ "static", "boolean", "getConsistent", "(", "DirectedGraph", "g", ")", "{", "Object", "[", "]", "vertexOrdering", "=", "new", "Object", "[", "g", ".", "size", "(", ")", "]", ";", "int", "voa", "=", "0", ";", "for", "(", "Iterator", "<", "?", ">", "i...
Returns whether a directed graph is consistent. @param g a <code>DirectedGraph</code>. @return <code>true</code> if the given graph is consistent, <code>false</code> otherwise.
[ "Returns", "whether", "a", "directed", "graph", "is", "consistent", "." ]
5a620d1a407c7a5426d1cf17d47b97717cf71634
https://github.com/eurekaclinical/protempa/blob/5a620d1a407c7a5426d1cf17d47b97717cf71634/protempa-framework/src/main/java/org/protempa/proposition/interval/DirectionalPathConsistency.java#L88-L144
train
Returns true if the directed graph g is consistent.
Create a Java method that does the following: "Returns true if the directed graph g is consistent.".
Of course, here is the Java code you requested: ```java static boolean getConsistent(DirectedGraph g) { Object[] vertexOrdering = new Object[g.size()]; int voa = 0; for (Iterator<?> itr = g.iterator(); itr.hasNext(); voa++) { vertexOrdering[voa] = itr.next(); } int v...
rackerlabs/blueflood
blueflood-elasticsearch/src/main/java/com/rackspacecloud/blueflood/io/AbstractElasticIO.java
AbstractElasticIO.regexToGrabCurrentAndNextLevel
protected String regexToGrabCurrentAndNextLevel(final String query) { if (StringUtils.isEmpty(query)) { throw new IllegalArgumentException("Query(glob) string cannot be null/empty"); } String queryRegex = getRegex(query); int totalQueryTokens = getTotalTokens(query); ...
java
protected String regexToGrabCurrentAndNextLevel(final String query) { if (StringUtils.isEmpty(query)) { throw new IllegalArgumentException("Query(glob) string cannot be null/empty"); } String queryRegex = getRegex(query); int totalQueryTokens = getTotalTokens(query); ...
[ "protected", "String", "regexToGrabCurrentAndNextLevel", "(", "final", "String", "query", ")", "{", "if", "(", "StringUtils", ".", "isEmpty", "(", "query", ")", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Query(glob) string cannot be null/empty\"", "...
Returns regex which could grab metric names from current level to the next level for a given query. (Some exceptions when query has only one level due to the nature of underlying data) for metrics : foo.bar.baz, foo.bar.baz.qux, for query=foo.bar.*, the regex which this method returns will capture the following metr...
[ "Returns", "regex", "which", "could", "grab", "metric", "names", "from", "current", "level", "to", "the", "next", "level", "for", "a", "given", "query", "." ]
4722a3449b1a7f8e88889ea8c340c6f24396b5b0
https://github.com/rackerlabs/blueflood/blob/4722a3449b1a7f8e88889ea8c340c6f24396b5b0/blueflood-elasticsearch/src/main/java/com/rackspacecloud/blueflood/io/AbstractElasticIO.java#L286-L322
test
Returns the regex to grab the current OIDC level.
Create a Java method that does the following: "Returns the regex to grab the current OIDC level.".
Of course, here is the Java code you requested: ```java protected String regexToGrabCurrentAndNextLevel(final String query) { if (StringUtils.isEmpty(query)) { throw new IllegalArgumentException("Query(glob) string cannot be null/empty"); } String queryRegex = getRegex(query); ...
apache/incubator-druid
indexing-service/src/main/java/org/apache/druid/indexing/common/actions/SegmentTransactionalInsertAction.java
SegmentTransactionalInsertAction.perform
@Override public SegmentPublishResult perform(Task task, TaskActionToolbox toolbox) { TaskActionPreconditions.checkLockCoversSegments(task, toolbox.getTaskLockbox(), segments); final SegmentPublishResult retVal; try { retVal = toolbox.getTaskLockbox().doInCriticalSection( task, ...
java
@Override public SegmentPublishResult perform(Task task, TaskActionToolbox toolbox) { TaskActionPreconditions.checkLockCoversSegments(task, toolbox.getTaskLockbox(), segments); final SegmentPublishResult retVal; try { retVal = toolbox.getTaskLockbox().doInCriticalSection( task, ...
[ "@", "Override", "public", "SegmentPublishResult", "perform", "(", "Task", "task", ",", "TaskActionToolbox", "toolbox", ")", "{", "TaskActionPreconditions", ".", "checkLockCoversSegments", "(", "task", ",", "toolbox", ".", "getTaskLockbox", "(", ")", ",", "segments"...
Behaves similarly to {@link org.apache.druid.indexing.overlord.IndexerMetadataStorageCoordinator#announceHistoricalSegments(Set, DataSourceMetadata, DataSourceMetadata)}.
[ "Behaves", "similarly", "to", "{" ]
f776b9408962b9006cfcfe4d6c1794751972cc8e
https://github.com/apache/incubator-druid/blob/f776b9408962b9006cfcfe4d6c1794751972cc8e/indexing-service/src/main/java/org/apache/druid/indexing/common/actions/SegmentTransactionalInsertAction.java#L102-L150
train
Override this method to perform the action.
Create a Java method that does the following: "Override this method to perform the action.".
Of course, here is the Java code you requested: ```java @Override public SegmentPublishResult perform(Task task, TaskActionToolbox toolbox) { TaskActionPreconditions.checkLockCoversSegments(task, toolbox.getTaskLockbox(), segments); final SegmentPublishResult retVal; try { retVal = toolbox.getTa...
UrielCh/ovh-java-sdk
ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java
ApiOvhTelephony.billingAccount_number_serviceName_PUT
public void billingAccount_number_serviceName_PUT(String billingAccount, String serviceName, OvhNumber body) throws IOException { String qPath = "/telephony/{billingAccount}/number/{serviceName}"; StringBuilder sb = path(qPath, billingAccount, serviceName); exec(qPath, "PUT", sb.toString(), body); }
java
public void billingAccount_number_serviceName_PUT(String billingAccount, String serviceName, OvhNumber body) throws IOException { String qPath = "/telephony/{billingAccount}/number/{serviceName}"; StringBuilder sb = path(qPath, billingAccount, serviceName); exec(qPath, "PUT", sb.toString(), body); }
[ "public", "void", "billingAccount_number_serviceName_PUT", "(", "String", "billingAccount", ",", "String", "serviceName", ",", "OvhNumber", "body", ")", "throws", "IOException", "{", "String", "qPath", "=", "\"/telephony/{billingAccount}/number/{serviceName}\"", ";", "Strin...
Alter this object properties REST: PUT /telephony/{billingAccount}/number/{serviceName} @param body [required] New object properties @param billingAccount [required] The name of your billingAccount @param serviceName [required] Name of the service
[ "Alter", "this", "object", "properties" ]
6d531a40e56e09701943e334c25f90f640c55701
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L5666-L5670
train
Update number in billing account
Create a Java method that does the following: "Update number in billing account".
Of course, here is the Java code you requested: ```java public void billingAccount_number_serviceName_PUT(String billingAccount, String serviceName, OvhNumber body) throws IOException { String qPath = "/telephony/{billingAccount}/number/{serviceName}"; StringBuilder sb = path(qPath, billingAccount, serviceName); ...
pravega/pravega
client/src/main/java/io/pravega/client/netty/impl/FlowHandler.java
FlowHandler.createFlow
public ClientConnection createFlow(final Flow flow, final ReplyProcessor rp) { Exceptions.checkNotClosed(closed.get(), this); Preconditions.checkState(!disableFlow.get(), "Ensure flows are enabled."); log.info("Creating Flow {} for endpoint {}. The current Channel is {}.", flow.getFlowId(), conn...
java
public ClientConnection createFlow(final Flow flow, final ReplyProcessor rp) { Exceptions.checkNotClosed(closed.get(), this); Preconditions.checkState(!disableFlow.get(), "Ensure flows are enabled."); log.info("Creating Flow {} for endpoint {}. The current Channel is {}.", flow.getFlowId(), conn...
[ "public", "ClientConnection", "createFlow", "(", "final", "Flow", "flow", ",", "final", "ReplyProcessor", "rp", ")", "{", "Exceptions", ".", "checkNotClosed", "(", "closed", ".", "get", "(", ")", ",", "this", ")", ";", "Preconditions", ".", "checkState", "("...
Create a flow on existing connection. @param flow Flow. @param rp ReplyProcessor for the specified flow. @return Client Connection object.
[ "Create", "a", "flow", "on", "existing", "connection", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/client/src/main/java/io/pravega/client/netty/impl/FlowHandler.java#L64-L72
train
Create a new flow.
Create a Java method that does the following: "Create a new flow.".
Of course, here is the Java code you requested: ```java public ClientConnection createFlow(final Flow flow, final ReplyProcessor rp) { Exceptions.checkNotClosed(closed.get(), this); Preconditions.checkState(!disableFlow.get(), "Ensure flows are enabled."); log.info("Creating Flow {} for endpoin...
DDTH/ddth-dao
ddth-dao-core/src/main/java/com/github/ddth/dao/BaseJsonBo.java
BaseJsonBo.triggerPopulate
@Override protected void triggerPopulate() { super.triggerPopulate(); Lock lock = lockForRead(); try { cacheJsonObjs.clear(); Map<String, Object> attributeMap = attributeMap(); if (attributeMap != null) { attributeMap.forEach((k, v) -> { ...
java
@Override protected void triggerPopulate() { super.triggerPopulate(); Lock lock = lockForRead(); try { cacheJsonObjs.clear(); Map<String, Object> attributeMap = attributeMap(); if (attributeMap != null) { attributeMap.forEach((k, v) -> { ...
[ "@", "Override", "protected", "void", "triggerPopulate", "(", ")", "{", "super", ".", "triggerPopulate", "(", ")", ";", "Lock", "lock", "=", "lockForRead", "(", ")", ";", "try", "{", "cacheJsonObjs", ".", "clear", "(", ")", ";", "Map", "<", "String", "...
{@inheritDoc}
[ "{" ]
8d059ddf641a1629aa53851f9d1b41abf175a180
https://github.com/DDTH/ddth-dao/blob/8d059ddf641a1629aa53851f9d1b41abf175a180/ddth-dao-core/src/main/java/com/github/ddth/dao/BaseJsonBo.java#L269-L288
train
Trigger populate method.
Create a Java method that does the following: "Trigger populate method.".
Of course, here is the Java code you requested: ```java @Override protected void triggerPopulate() { super.triggerPopulate(); Lock lock = lockForRead(); try { cacheJsonObjs.clear(); Map<String, Object> attributeMap = attributeMap(); if (attributeMap != nu...
googleapis/google-cloud-java
google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SecurityPolicyClient.java
SecurityPolicyClient.getRuleSecurityPolicy
@BetaApi public final SecurityPolicyRule getRuleSecurityPolicy(Integer priority, String securityPolicy) { GetRuleSecurityPolicyHttpRequest request = GetRuleSecurityPolicyHttpRequest.newBuilder() .setPriority(priority) .setSecurityPolicy(securityPolicy) .build(); re...
java
@BetaApi public final SecurityPolicyRule getRuleSecurityPolicy(Integer priority, String securityPolicy) { GetRuleSecurityPolicyHttpRequest request = GetRuleSecurityPolicyHttpRequest.newBuilder() .setPriority(priority) .setSecurityPolicy(securityPolicy) .build(); re...
[ "@", "BetaApi", "public", "final", "SecurityPolicyRule", "getRuleSecurityPolicy", "(", "Integer", "priority", ",", "String", "securityPolicy", ")", "{", "GetRuleSecurityPolicyHttpRequest", "request", "=", "GetRuleSecurityPolicyHttpRequest", ".", "newBuilder", "(", ")", "....
Gets a rule at the specified priority. <p>Sample code: <pre><code> try (SecurityPolicyClient securityPolicyClient = SecurityPolicyClient.create()) { Integer priority = 0; ProjectGlobalSecurityPolicyName securityPolicy = ProjectGlobalSecurityPolicyName.of("[PROJECT]", "[SECURITY_POLICY]"); SecurityPolicyRule response ...
[ "Gets", "a", "rule", "at", "the", "specified", "priority", "." ]
d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a
https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SecurityPolicyClient.java#L516-L525
train
Gets the SecurityPolicyRule for the specified resource.
Create a Java method that does the following: "Gets the SecurityPolicyRule for the specified resource.".
Of course, here is the Java code you requested: ```java @BetaApi public final SecurityPolicyRule getRuleSecurityPolicy(Integer priority, String securityPolicy) { GetRuleSecurityPolicyHttpRequest request = GetRuleSecurityPolicyHttpRequest.newBuilder() .setPriority(priority) .setSe...