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
citrusframework/citrus
modules/citrus-jms/src/main/java/com/consol/citrus/jms/endpoint/JmsConsumer.java
JmsConsumer.receive
private javax.jms.Message receive(String destinationName, String selector) { javax.jms.Message receivedJmsMessage; if (log.isDebugEnabled()) { log.debug("Receiving JMS message on destination: '" + destinationName + (StringUtils.hasText(selector) ? "(" + selector + ")" : "") + "'"); ...
java
private javax.jms.Message receive(String destinationName, String selector) { javax.jms.Message receivedJmsMessage; if (log.isDebugEnabled()) { log.debug("Receiving JMS message on destination: '" + destinationName + (StringUtils.hasText(selector) ? "(" + selector + ")" : "") + "'"); ...
[ "private", "javax", ".", "jms", ".", "Message", "receive", "(", "String", "destinationName", ",", "String", "selector", ")", "{", "javax", ".", "jms", ".", "Message", "receivedJmsMessage", ";", "if", "(", "log", ".", "isDebugEnabled", "(", ")", ")", "{", ...
Receive message from destination name. @param destinationName @param selector @return
[ "Receive", "message", "from", "destination", "name", "." ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-jms/src/main/java/com/consol/citrus/jms/endpoint/JmsConsumer.java#L81-L101
train
Receives a JMS message from the destination.
Create a Java method that does the following: "Receives a JMS message from the destination.".
Of course, here is the Java code you requested: ```java private javax.jms.Message receive(String destinationName, String selector) { javax.jms.Message receivedJmsMessage; if (log.isDebugEnabled()) { log.debug("Receiving JMS message on destination: '" + destinationName + (StringUtils.hasTex...
alkacon/opencms-core
src-gwt/org/opencms/ade/containerpage/client/CmsContainerpageController.java
CmsContainerpageController.isRootContainer
protected boolean isRootContainer(CmsContainer container) { boolean isRoot = false; if (!container.isSubContainer()) { isRoot = true; } else if (container.isDetailOnly()) { CmsContainer parent = getContainer(container.getParentContainerName()); isRoot = (pare...
java
protected boolean isRootContainer(CmsContainer container) { boolean isRoot = false; if (!container.isSubContainer()) { isRoot = true; } else if (container.isDetailOnly()) { CmsContainer parent = getContainer(container.getParentContainerName()); isRoot = (pare...
[ "protected", "boolean", "isRootContainer", "(", "CmsContainer", "container", ")", "{", "boolean", "isRoot", "=", "false", ";", "if", "(", "!", "container", ".", "isSubContainer", "(", ")", ")", "{", "isRoot", "=", "true", ";", "}", "else", "if", "(", "co...
Returns whether the given container is considered a root container.<p> @param container the container to check @return <code>true</code> if the given container is a root container
[ "Returns", "whether", "the", "given", "container", "is", "considered", "a", "root", "container", ".", "<p", ">" ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/containerpage/client/CmsContainerpageController.java#L3570-L3580
train
Checks if the container is the root container.
Create a Java method that does the following: "Checks if the container is the root container.".
Of course, here is the Java code you requested: ```java protected boolean isRootContainer(CmsContainer container) { boolean isRoot = false; if (!container.isSubContainer()) { isRoot = true; } else if (container.isDetailOnly()) { CmsContainer parent = getContainer(contai...
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/templates/ElemCopy.java
ElemCopy.execute
public void execute( TransformerImpl transformer) throws TransformerException { XPathContext xctxt = transformer.getXPathContext(); try { int sourceNode = xctxt.getCurrentNode(); xctxt.pushCurrentNode(sourceNode); DTM dtm = xctxt.getDTM(sourceNode...
java
public void execute( TransformerImpl transformer) throws TransformerException { XPathContext xctxt = transformer.getXPathContext(); try { int sourceNode = xctxt.getCurrentNode(); xctxt.pushCurrentNode(sourceNode); DTM dtm = xctxt.getDTM(sourceNode...
[ "public", "void", "execute", "(", "TransformerImpl", "transformer", ")", "throws", "TransformerException", "{", "XPathContext", "xctxt", "=", "transformer", ".", "getXPathContext", "(", ")", ";", "try", "{", "int", "sourceNode", "=", "xctxt", ".", "getCurrentNode"...
The xsl:copy element provides an easy way of copying the current node. Executing this function creates a copy of the current node into the result tree. <p>The namespace nodes of the current node are automatically copied as well, but the attributes and children of the node are not automatically copied. The content of th...
[ "The", "xsl", ":", "copy", "element", "provides", "an", "easy", "way", "of", "copying", "the", "current", "node", ".", "Executing", "this", "function", "creates", "a", "copy", "of", "the", "current", "node", "into", "the", "result", "tree", ".", "<p", ">...
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/templates/ElemCopy.java#L88-L135
train
Execute the XML - CML processing.
Create a Java method that does the following: "Execute the XML - CML processing.".
Of course, here is the Java code you requested: ```java public void execute( TransformerImpl transformer) throws TransformerException { XPathContext xctxt = transformer.getXPathContext(); try { int sourceNode = xctxt.getCurrentNode(); xctxt.pushCurrent...
OpenLiberty/open-liberty
dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/filter/FilterConfig.java
FilterConfig.setDispatchMode
public void setDispatchMode(int[] dispatchModeInts) { //convert to DispatcherType dispatchMode = new DispatcherType [dispatchModeInts.length]; for (int i=0;i<dispatchModeInts.length;i++){ int dispatchModeCur=dispatchModeInts[i]; switch (dispatchModeCur) { case 0: dispatchMode[i]=DispatcherType.RE...
java
public void setDispatchMode(int[] dispatchModeInts) { //convert to DispatcherType dispatchMode = new DispatcherType [dispatchModeInts.length]; for (int i=0;i<dispatchModeInts.length;i++){ int dispatchModeCur=dispatchModeInts[i]; switch (dispatchModeCur) { case 0: dispatchMode[i]=DispatcherType.RE...
[ "public", "void", "setDispatchMode", "(", "int", "[", "]", "dispatchModeInts", ")", "{", "//convert to DispatcherType", "dispatchMode", "=", "new", "DispatcherType", "[", "dispatchModeInts", ".", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", ...
public static final int FILTER_ERROR = 3;
[ "public", "static", "final", "int", "FILTER_ERROR", "=", "3", ";" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/filter/FilterConfig.java#L97-L112
train
Sets the dispatch mode.
Create a Java method that does the following: "Sets the dispatch mode.".
Of course, here is the Java code you requested: ```java public void setDispatchMode(int[] dispatchModeInts) { //convert to DispatcherType dispatchMode = new DispatcherType [dispatchModeInts.length]; for (int i=0;i<dispatchModeInts.length;i++){ int dispatchModeCur=dispatchModeInts[i]; switch (dispatchM...
google/error-prone-javac
src/jdk.compiler/share/classes/com/sun/source/util/SimpleDocTreeVisitor.java
SimpleDocTreeVisitor.visitSee
@Override public R visitSee(SeeTree node, P p) { return defaultAction(node, p); }
java
@Override public R visitSee(SeeTree node, P p) { return defaultAction(node, p); }
[ "@", "Override", "public", "R", "visitSee", "(", "SeeTree", "node", ",", "P", "p", ")", "{", "return", "defaultAction", "(", "node", ",", "p", ")", ";", "}" ]
{@inheritDoc} This implementation calls {@code defaultAction}. @param node {@inheritDoc} @param p {@inheritDoc} @return the result of {@code defaultAction}
[ "{", "@inheritDoc", "}", "This", "implementation", "calls", "{", "@code", "defaultAction", "}", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/source/util/SimpleDocTreeVisitor.java#L333-L336
train
Visit a SeeTree.
Create a Java method that does the following: "Visit a SeeTree.".
Of course, here is the Java code you requested: ```java @Override public R visitSee(SeeTree node, P p) { return defaultAction(node, p); } ``` Hope this helps!
lestard/advanced-bindings
src/main/java/eu/lestard/advanced_bindings/api/NumberBindings.java
NumberBindings.divideSafe
public static IntegerBinding divideSafe(ObservableIntegerValue dividend, ObservableIntegerValue divisor, int defaultValue) { return divideSafe(dividend, divisor, new SimpleIntegerProperty(defaultValue)); }
java
public static IntegerBinding divideSafe(ObservableIntegerValue dividend, ObservableIntegerValue divisor, int defaultValue) { return divideSafe(dividend, divisor, new SimpleIntegerProperty(defaultValue)); }
[ "public", "static", "IntegerBinding", "divideSafe", "(", "ObservableIntegerValue", "dividend", ",", "ObservableIntegerValue", "divisor", ",", "int", "defaultValue", ")", "{", "return", "divideSafe", "(", "dividend", ",", "divisor", ",", "new", "SimpleIntegerProperty", ...
An integer binding of a division that won't throw an {@link java.lang.ArithmeticException} when a division by zero happens. See {@link #divideSafe(javafx.beans.value.ObservableIntegerValue, javafx.beans.value.ObservableIntegerValue)} for more information. @param dividend the observable value used as dividend @para...
[ "An", "integer", "binding", "of", "a", "division", "that", "won", "t", "throw", "an", "{", "@link", "java", ".", "lang", ".", "ArithmeticException", "}", "when", "a", "division", "by", "zero", "happens", ".", "See", "{", "@link", "#divideSafe", "(", "jav...
054a5dde261c29f862b971765fa3da3704a13ab4
https://github.com/lestard/advanced-bindings/blob/054a5dde261c29f862b971765fa3da3704a13ab4/src/main/java/eu/lestard/advanced_bindings/api/NumberBindings.java#L245-L247
train
Create a division binding that is safe to use.
Create a Java method that does the following: "Create a division binding that is safe to use.".
Of course, here is the Java code you requested: ```java public static IntegerBinding divideSafe(ObservableIntegerValue dividend, ObservableIntegerValue divisor, int defaultValue) { return divideSafe(dividend, divisor, new SimpleIntegerProperty(defaultValue)); } ``` Hope this helps!
OpenLiberty/open-liberty
dev/com.ibm.ws.security.jwt/src/com/ibm/websphere/security/jwt/JwtBuilder.java
JwtBuilder.claim
public JwtBuilder claim(String name, Object value) throws InvalidClaimException { // if (isValidClaim(name, value)) { // if (name.equals(Claims.AUDIENCE)) { // if (value instanceof ArrayList) { // this.audience((ArrayList) v...
java
public JwtBuilder claim(String name, Object value) throws InvalidClaimException { // if (isValidClaim(name, value)) { // if (name.equals(Claims.AUDIENCE)) { // if (value instanceof ArrayList) { // this.audience((ArrayList) v...
[ "public", "JwtBuilder", "claim", "(", "String", "name", ",", "Object", "value", ")", "throws", "InvalidClaimException", "{", "// if (isValidClaim(name, value)) {", "// if (name.equals(Claims.AUDIENCE)) {", "// if (value instanceof ArrayList) {", "// ...
Sets the specified claim. @param name This is a String and represents the name of the claim @param value This is an Object and represents the value of the claim @return {@code JwtBuilder} object @throws InvalidClaimException Thrown if the claim is {@code null}, or the value is {@code null} or the value is not the corr...
[ "Sets", "the", "specified", "claim", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.jwt/src/com/ibm/websphere/security/jwt/JwtBuilder.java#L364-L437
train
This method is called to add a single claim to the JWT.
Create a Java method that does the following: "This method is called to add a single claim to the JWT.".
Of course, here is the Java code you requested: ```java public JwtBuilder claim(String name, Object value) throws InvalidClaimException { // if (isValidClaim(name, value)) { // if (name.equals(Claims.AUDIENCE)) { // if (value instanceof ArrayList) { ...
liferay/com-liferay-commerce
commerce-product-type-virtual-order-service/src/main/java/com/liferay/commerce/product/type/virtual/order/service/base/CommerceVirtualOrderItemLocalServiceBaseImpl.java
CommerceVirtualOrderItemLocalServiceBaseImpl.dynamicQueryCount
@Override public long dynamicQueryCount(DynamicQuery dynamicQuery, Projection projection) { return commerceVirtualOrderItemPersistence.countWithDynamicQuery(dynamicQuery, projection); }
java
@Override public long dynamicQueryCount(DynamicQuery dynamicQuery, Projection projection) { return commerceVirtualOrderItemPersistence.countWithDynamicQuery(dynamicQuery, projection); }
[ "@", "Override", "public", "long", "dynamicQueryCount", "(", "DynamicQuery", "dynamicQuery", ",", "Projection", "projection", ")", "{", "return", "commerceVirtualOrderItemPersistence", ".", "countWithDynamicQuery", "(", "dynamicQuery", ",", "projection", ")", ";", "}" ]
Returns the number of rows matching the dynamic query. @param dynamicQuery the dynamic query @param projection the projection to apply to the query @return the number of rows matching the dynamic query
[ "Returns", "the", "number", "of", "rows", "matching", "the", "dynamic", "query", "." ]
9e54362d7f59531fc684016ba49ee7cdc3a2f22b
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-type-virtual-order-service/src/main/java/com/liferay/commerce/product/type/virtual/order/service/base/CommerceVirtualOrderItemLocalServiceBaseImpl.java#L216-L221
train
Executes the dynamic query on the database and returns the number of rows matching the query.
Create a Java method that does the following: "Executes the dynamic query on the database and returns the number of rows matching the query.".
Of course, here is the Java code you requested: ```java @Override public long dynamicQueryCount(DynamicQuery dynamicQuery, Projection projection) { return commerceVirtualOrderItemPersistence.countWithDynamicQuery(dynamicQuery, projection); } ``` Hope this helps!
BrunoEberhard/minimal-j
src/main/java/org/minimalj/frontend/impl/swing/toolkit/SwingFrontend.java
SwingFrontend.runWithContext
public static void runWithContext(Runnable r) { try { browserStack.push(SwingFrame.getActiveWindow().getVisibleTab()); Subject.setCurrent(SwingFrame.getActiveWindow().getSubject()); r.run(); } finally { Subject.setCurrent(null); browserStack.pop(); } }
java
public static void runWithContext(Runnable r) { try { browserStack.push(SwingFrame.getActiveWindow().getVisibleTab()); Subject.setCurrent(SwingFrame.getActiveWindow().getSubject()); r.run(); } finally { Subject.setCurrent(null); browserStack.pop(); } }
[ "public", "static", "void", "runWithContext", "(", "Runnable", "r", ")", "{", "try", "{", "browserStack", ".", "push", "(", "SwingFrame", ".", "getActiveWindow", "(", ")", ".", "getVisibleTab", "(", ")", ")", ";", "Subject", ".", "setCurrent", "(", "SwingF...
As the current subject can be different for each Swing Window this method ensure that no wrong subject stays as current subject @param r a runnable (normally a lambda is used)
[ "As", "the", "current", "subject", "can", "be", "different", "for", "each", "Swing", "Window", "this", "method", "ensure", "that", "no", "wrong", "subject", "stays", "as", "current", "subject" ]
f7c5461b2b47a10b383aee1e2f1f150f6773703b
https://github.com/BrunoEberhard/minimal-j/blob/f7c5461b2b47a10b383aee1e2f1f150f6773703b/src/main/java/org/minimalj/frontend/impl/swing/toolkit/SwingFrontend.java#L380-L389
train
Run a Runnable in the context of the current window.
Create a Java method that does the following: "Run a Runnable in the context of the current window.".
Of course, here is the Java code you requested: ```java public static void runWithContext(Runnable r) { try { browserStack.push(SwingFrame.getActiveWindow().getVisibleTab()); Subject.setCurrent(SwingFrame.getActiveWindow().getSubject()); r.run(); } finally { Subject.setCurrent(null); browserStack.po...
aws/aws-sdk-java
aws-java-sdk-simpleworkflow/src/main/java/com/amazonaws/services/simpleworkflow/model/transform/StartChildWorkflowExecutionDecisionAttributesMarshaller.java
StartChildWorkflowExecutionDecisionAttributesMarshaller.marshall
public void marshall(StartChildWorkflowExecutionDecisionAttributes startChildWorkflowExecutionDecisionAttributes, ProtocolMarshaller protocolMarshaller) { if (startChildWorkflowExecutionDecisionAttributes == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); }...
java
public void marshall(StartChildWorkflowExecutionDecisionAttributes startChildWorkflowExecutionDecisionAttributes, ProtocolMarshaller protocolMarshaller) { if (startChildWorkflowExecutionDecisionAttributes == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); }...
[ "public", "void", "marshall", "(", "StartChildWorkflowExecutionDecisionAttributes", "startChildWorkflowExecutionDecisionAttributes", ",", "ProtocolMarshaller", "protocolMarshaller", ")", "{", "if", "(", "startChildWorkflowExecutionDecisionAttributes", "==", "null", ")", "{", "thr...
Marshall the given parameter object.
[ "Marshall", "the", "given", "parameter", "object", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-simpleworkflow/src/main/java/com/amazonaws/services/simpleworkflow/model/transform/StartChildWorkflowExecutionDecisionAttributesMarshaller.java#L63-L84
train
marshalls the given StartChildWorkflowExecutionDecisionAttributes object to the JSON file.
Create a Java method that does the following: "marshalls the given StartChildWorkflowExecutionDecisionAttributes object to the JSON file.".
Of course, here is the Java code you requested: ```java public void marshall(StartChildWorkflowExecutionDecisionAttributes startChildWorkflowExecutionDecisionAttributes, ProtocolMarshaller protocolMarshaller) { if (startChildWorkflowExecutionDecisionAttributes == null) { throw new SdkClientExcepti...
diirt/util
src/main/java/org/epics/util/time/TimeDuration.java
TimeDuration.minus
public TimeDuration minus(TimeDuration duration) { return createWithCarry(sec - duration.getSec(), nanoSec - duration.getNanoSec()); }
java
public TimeDuration minus(TimeDuration duration) { return createWithCarry(sec - duration.getSec(), nanoSec - duration.getNanoSec()); }
[ "public", "TimeDuration", "minus", "(", "TimeDuration", "duration", ")", "{", "return", "createWithCarry", "(", "sec", "-", "duration", ".", "getSec", "(", ")", ",", "nanoSec", "-", "duration", ".", "getNanoSec", "(", ")", ")", ";", "}" ]
Returns the difference between this duration and the given. @param duration another duration @return a new duration
[ "Returns", "the", "difference", "between", "this", "duration", "and", "the", "given", "." ]
24aca0a173a635aaf0b78d213a3fee8d4f91c077
https://github.com/diirt/util/blob/24aca0a173a635aaf0b78d213a3fee8d4f91c077/src/main/java/org/epics/util/time/TimeDuration.java#L215-L217
train
Subtracts the given duration from this duration.
Create a Java method that does the following: "Subtracts the given duration from this duration.".
Of course, here is the Java code you requested: ```java public TimeDuration minus(TimeDuration duration) { return createWithCarry(sec - duration.getSec(), nanoSec - duration.getNanoSec()); } ``` Hope this helps!
aws/aws-sdk-java
aws-java-sdk-workdocs/src/main/java/com/amazonaws/services/workdocs/AmazonWorkDocsClient.java
AmazonWorkDocsClient.describeFolderContents
@Override public DescribeFolderContentsResult describeFolderContents(DescribeFolderContentsRequest request) { request = beforeClientExecution(request); return executeDescribeFolderContents(request); }
java
@Override public DescribeFolderContentsResult describeFolderContents(DescribeFolderContentsRequest request) { request = beforeClientExecution(request); return executeDescribeFolderContents(request); }
[ "@", "Override", "public", "DescribeFolderContentsResult", "describeFolderContents", "(", "DescribeFolderContentsRequest", "request", ")", "{", "request", "=", "beforeClientExecution", "(", "request", ")", ";", "return", "executeDescribeFolderContents", "(", "request", ")",...
<p> Describes the contents of the specified folder, including its documents and subfolders. </p> <p> By default, Amazon WorkDocs returns the first 100 active document and folder metadata items. If there are more results, the response includes a marker that you can use to request the next set of results. You can also re...
[ "<p", ">", "Describes", "the", "contents", "of", "the", "specified", "folder", "including", "its", "documents", "and", "subfolders", ".", "<", "/", "p", ">", "<p", ">", "By", "default", "Amazon", "WorkDocs", "returns", "the", "first", "100", "active", "doc...
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-workdocs/src/main/java/com/amazonaws/services/workdocs/AmazonWorkDocsClient.java#L1652-L1656
train
Retrieves the contents of a folder.
Create a Java method that does the following: "Retrieves the contents of a folder.".
Of course, here is the Java code you requested: ```java @Override public DescribeFolderContentsResult describeFolderContents(DescribeFolderContentsRequest request) { request = beforeClientExecution(request); return executeDescribeFolderContents(request); } ``` Hope this helps!
aoindustries/aocode-public
src/main/java/com/aoindustries/util/persistent/FixedPersistentBlockBuffer.java
FixedPersistentBlockBuffer.ensureCapacity
@Override // @NotThreadSafe protected void ensureCapacity(long capacity) throws IOException { long curCapacity = pbuffer.capacity(); if(curCapacity<capacity) expandCapacity(curCapacity, capacity); }
java
@Override // @NotThreadSafe protected void ensureCapacity(long capacity) throws IOException { long curCapacity = pbuffer.capacity(); if(curCapacity<capacity) expandCapacity(curCapacity, capacity); }
[ "@", "Override", "// @NotThreadSafe", "protected", "void", "ensureCapacity", "(", "long", "capacity", ")", "throws", "IOException", "{", "long", "curCapacity", "=", "pbuffer", ".", "capacity", "(", ")", ";", "if", "(", "curCapacity", "<", "capacity", ")", "exp...
This class takes a lazy approach on allocating buffer space. It will allocate additional space as needed here, rounding up to the next 4096-byte boundary.
[ "This", "class", "takes", "a", "lazy", "approach", "on", "allocating", "buffer", "space", ".", "It", "will", "allocate", "additional", "space", "as", "needed", "here", "rounding", "up", "to", "the", "next", "4096", "-", "byte", "boundary", "." ]
c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3
https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/util/persistent/FixedPersistentBlockBuffer.java#L318-L323
train
Ensure that the buffer has the given capacity.
Create a Java method that does the following: "Ensure that the buffer has the given capacity.".
Of course, here is the Java code you requested: ```java @Override // @NotThreadSafe protected void ensureCapacity(long capacity) throws IOException { long curCapacity = pbuffer.capacity(); if(curCapacity<capacity) expandCapacity(curCapacity, capacity); } ``` Hope this helps!
aws/aws-sdk-java
aws-java-sdk-docdb/src/main/java/com/amazonaws/services/docdb/model/DBClusterSnapshotAttributesResult.java
DBClusterSnapshotAttributesResult.setDBClusterSnapshotAttributes
public void setDBClusterSnapshotAttributes(java.util.Collection<DBClusterSnapshotAttribute> dBClusterSnapshotAttributes) { if (dBClusterSnapshotAttributes == null) { this.dBClusterSnapshotAttributes = null; return; } this.dBClusterSnapshotAttributes = new java.util.Array...
java
public void setDBClusterSnapshotAttributes(java.util.Collection<DBClusterSnapshotAttribute> dBClusterSnapshotAttributes) { if (dBClusterSnapshotAttributes == null) { this.dBClusterSnapshotAttributes = null; return; } this.dBClusterSnapshotAttributes = new java.util.Array...
[ "public", "void", "setDBClusterSnapshotAttributes", "(", "java", ".", "util", ".", "Collection", "<", "DBClusterSnapshotAttribute", ">", "dBClusterSnapshotAttributes", ")", "{", "if", "(", "dBClusterSnapshotAttributes", "==", "null", ")", "{", "this", ".", "dBClusterS...
<p> The list of attributes and values for the DB cluster snapshot. </p> @param dBClusterSnapshotAttributes The list of attributes and values for the DB cluster snapshot.
[ "<p", ">", "The", "list", "of", "attributes", "and", "values", "for", "the", "DB", "cluster", "snapshot", ".", "<", "/", "p", ">" ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-docdb/src/main/java/com/amazonaws/services/docdb/model/DBClusterSnapshotAttributesResult.java#L103-L110
train
Sets the value of the dBClusterSnapshotAttributes property.
Create a Java method that does the following: "Sets the value of the dBClusterSnapshotAttributes property.".
Of course, here is the Java code you requested: ```java public void setDBClusterSnapshotAttributes(java.util.Collection<DBClusterSnapshotAttribute> dBClusterSnapshotAttributes) { if (dBClusterSnapshotAttributes == null) { this.dBClusterSnapshotAttributes = null; return; } ...
aws/aws-sdk-java
aws-java-sdk-cognitoidentity/src/main/java/com/amazonaws/services/cognitoidentity/AmazonCognitoIdentityClient.java
AmazonCognitoIdentityClient.getOpenIdToken
@Override public GetOpenIdTokenResult getOpenIdToken(GetOpenIdTokenRequest request) { request = beforeClientExecution(request); return executeGetOpenIdToken(request); }
java
@Override public GetOpenIdTokenResult getOpenIdToken(GetOpenIdTokenRequest request) { request = beforeClientExecution(request); return executeGetOpenIdToken(request); }
[ "@", "Override", "public", "GetOpenIdTokenResult", "getOpenIdToken", "(", "GetOpenIdTokenRequest", "request", ")", "{", "request", "=", "beforeClientExecution", "(", "request", ")", ";", "return", "executeGetOpenIdToken", "(", "request", ")", ";", "}" ]
<p> Gets an OpenID token, using a known Cognito ID. This known Cognito ID is returned by <a>GetId</a>. You can optionally add additional logins for the identity. Supplying multiple logins creates an implicit link. </p> <p> The OpenId token is valid for 10 minutes. </p> <p> This is a public API. You do not need any cred...
[ "<p", ">", "Gets", "an", "OpenID", "token", "using", "a", "known", "Cognito", "ID", ".", "This", "known", "Cognito", "ID", "is", "returned", "by", "<a", ">", "GetId<", "/", "a", ">", ".", "You", "can", "optionally", "add", "additional", "logins", "for"...
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-cognitoidentity/src/main/java/com/amazonaws/services/cognitoidentity/AmazonCognitoIdentityClient.java#L941-L945
train
Returns the OpenIdToken for an app.
Create a Java method that does the following: "Returns the OpenIdToken for an app.".
Of course, here is the Java code you requested: ```java @Override public GetOpenIdTokenResult getOpenIdToken(GetOpenIdTokenRequest request) { request = beforeClientExecution(request); return executeGetOpenIdToken(request); } ``` Hope this helps!
ninjaframework/ninja
ninja-core/src/main/java/ninja/RouteParameter.java
RouteParameter.parse
static public Map<String, RouteParameter> parse(String path) { Map<String,RouteParameter> params = new LinkedHashMap<>(); // extract any named parameters Matcher matcher = Route.PATTERN_FOR_VARIABLE_PARTS_OF_ROUTE.matcher(path); while (matcher.find()) { RouteParamete...
java
static public Map<String, RouteParameter> parse(String path) { Map<String,RouteParameter> params = new LinkedHashMap<>(); // extract any named parameters Matcher matcher = Route.PATTERN_FOR_VARIABLE_PARTS_OF_ROUTE.matcher(path); while (matcher.find()) { RouteParamete...
[ "static", "public", "Map", "<", "String", ",", "RouteParameter", ">", "parse", "(", "String", "path", ")", "{", "Map", "<", "String", ",", "RouteParameter", ">", "params", "=", "new", "LinkedHashMap", "<>", "(", ")", ";", "// extract any named parameters", "...
Parse a path such as "/user/{id: [0-9]+}/email/{addr}" for the named parameters. @param path The path to parse @return A map containing the named parameters in the order they were parsed or null if no parameters were parsed.
[ "Parse", "a", "path", "such", "as", "/", "user", "/", "{", "id", ":", "[", "0", "-", "9", "]", "+", "}", "/", "email", "/", "{", "addr", "}", "for", "the", "named", "parameters", "." ]
a097dca61b5efa8e1a327de3a40c3e3e0eb3c11e
https://github.com/ninjaframework/ninja/blob/a097dca61b5efa8e1a327de3a40c3e3e0eb3c11e/ninja-core/src/main/java/ninja/RouteParameter.java#L83-L95
valid
Parse the path to get the parameters.
Create a Java method that does the following: "Parse the path to get the parameters.".
Of course, here is the Java code you requested: ```java static public Map<String, RouteParameter> parse(String path) { Map<String,RouteParameter> params = new LinkedHashMap<>(); // extract any named parameters Matcher matcher = Route.PATTERN_FOR_VARIABLE_PARTS_OF_ROUTE.matcher(path); ...
alkacon/opencms-core
src/org/opencms/staticexport/CmsStaticExportRfsRule.java
CmsStaticExportRfsRule.match
public boolean match(String vfsName) { for (int j = 0; j < m_relatedSystemResources.size(); j++) { Pattern pattern = m_relatedSystemResources.get(j); if (pattern.matcher(vfsName).matches()) { return true; } } return false; }
java
public boolean match(String vfsName) { for (int j = 0; j < m_relatedSystemResources.size(); j++) { Pattern pattern = m_relatedSystemResources.get(j); if (pattern.matcher(vfsName).matches()) { return true; } } return false; }
[ "public", "boolean", "match", "(", "String", "vfsName", ")", "{", "for", "(", "int", "j", "=", "0", ";", "j", "<", "m_relatedSystemResources", ".", "size", "(", ")", ";", "j", "++", ")", "{", "Pattern", "pattern", "=", "m_relatedSystemResources", ".", ...
Checks if a vfsName matches the given related system resource patterns.<p> @param vfsName the vfs name of a resource to check @return true if the name matches one of the given related system resource patterns
[ "Checks", "if", "a", "vfsName", "matches", "the", "given", "related", "system", "resource", "patterns", ".", "<p", ">" ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/staticexport/CmsStaticExportRfsRule.java#L317-L326
train
Check if the vfsName matches this resource.
Create a Java method that does the following: "Check if the vfsName matches this resource.".
Of course, here is the Java code you requested: ```java public boolean match(String vfsName) { for (int j = 0; j < m_relatedSystemResources.size(); j++) { Pattern pattern = m_relatedSystemResources.get(j); if (pattern.matcher(vfsName).matches()) { return true; ...
amplexus/java-flac-encoder
src/main/java/net/sourceforge/javaflacencoder/EncodedElement.java
EncodedElement.packIntByBits
public EncodedElement packIntByBits(int[] inputA, int[] inputBits, int inputOffset, int countA) { //go to end if we're not there. if(next != null) { EncodedElement end = EncodedElement.getEnd_S(next); return end.packIntByBits(inputA, inputBits, inputOffset, countA); } //calculate how m...
java
public EncodedElement packIntByBits(int[] inputA, int[] inputBits, int inputOffset, int countA) { //go to end if we're not there. if(next != null) { EncodedElement end = EncodedElement.getEnd_S(next); return end.packIntByBits(inputA, inputBits, inputOffset, countA); } //calculate how m...
[ "public", "EncodedElement", "packIntByBits", "(", "int", "[", "]", "inputA", ",", "int", "[", "]", "inputBits", ",", "int", "inputOffset", ",", "int", "countA", ")", "{", "//go to end if we're not there.", "if", "(", "next", "!=", "null", ")", "{", "EncodedE...
Pack a number of bits from each int of an array(within given limits)to the end of this list. @param inputA Array containing input values. @param inputBits Array containing number of bits to use for each index packed. This array should be equal in size to the inputA array. @param inputOffset Index of first usable index...
[ "Pack", "a", "number", "of", "bits", "from", "each", "int", "of", "an", "array", "(", "within", "given", "limits", ")", "to", "the", "end", "of", "this", "list", "." ]
3d536b877dee2a3fd4ab2e0d9569e292cae93bc9
https://github.com/amplexus/java-flac-encoder/blob/3d536b877dee2a3fd4ab2e0d9569e292cae93bc9/src/main/java/net/sourceforge/javaflacencoder/EncodedElement.java#L419-L472
train
This method packs the given input bits into a single int array.
Create a Java method that does the following: "This method packs the given input bits into a single int array.".
Of course, here is the Java code you requested: ```java public EncodedElement packIntByBits(int[] inputA, int[] inputBits, int inputOffset, int countA) { //go to end if we're not there. if(next != null) { EncodedElement end = EncodedElement.getEnd_S(next); return end.packIntByBits(inputA, inp...
liferay/com-liferay-commerce
commerce-wish-list-service/src/main/java/com/liferay/commerce/wish/list/service/persistence/impl/CommerceWishListItemPersistenceImpl.java
CommerceWishListItemPersistenceImpl.cacheResult
@Override public void cacheResult(List<CommerceWishListItem> commerceWishListItems) { for (CommerceWishListItem commerceWishListItem : commerceWishListItems) { if (entityCache.getResult( CommerceWishListItemModelImpl.ENTITY_CACHE_ENABLED, CommerceWishListItemImpl.class, commerceWishListItem.getP...
java
@Override public void cacheResult(List<CommerceWishListItem> commerceWishListItems) { for (CommerceWishListItem commerceWishListItem : commerceWishListItems) { if (entityCache.getResult( CommerceWishListItemModelImpl.ENTITY_CACHE_ENABLED, CommerceWishListItemImpl.class, commerceWishListItem.getP...
[ "@", "Override", "public", "void", "cacheResult", "(", "List", "<", "CommerceWishListItem", ">", "commerceWishListItems", ")", "{", "for", "(", "CommerceWishListItem", "commerceWishListItem", ":", "commerceWishListItems", ")", "{", "if", "(", "entityCache", ".", "ge...
Caches the commerce wish list items in the entity cache if it is enabled. @param commerceWishListItems the commerce wish list items
[ "Caches", "the", "commerce", "wish", "list", "items", "in", "the", "entity", "cache", "if", "it", "is", "enabled", "." ]
9e54362d7f59531fc684016ba49ee7cdc3a2f22b
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-wish-list-service/src/main/java/com/liferay/commerce/wish/list/service/persistence/impl/CommerceWishListItemPersistenceImpl.java#L3192-L3205
train
Caches the commerce wish list items in the entity cache if it is enabled.
Create a Java method that does the following: "Caches the commerce wish list items in the entity cache if it is enabled.".
Of course, here is the Java code you requested: ```java @Override public void cacheResult(List<CommerceWishListItem> commerceWishListItems) { for (CommerceWishListItem commerceWishListItem : commerceWishListItems) { if (entityCache.getResult( CommerceWishListItemModelImpl.ENTITY_CACHE_ENABLED, Commer...
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/FastStringBuffer.java
FastStringBuffer.append
public final void append(StringBuffer value) { if (value == null) return; int strlen = value.length(); if (0 == strlen) return; int copyfrom = 0; char[] chunk = m_array[m_lastChunk]; int available = m_chunkSize - m_firstFree; // Repeat while data remains to be copied w...
java
public final void append(StringBuffer value) { if (value == null) return; int strlen = value.length(); if (0 == strlen) return; int copyfrom = 0; char[] chunk = m_array[m_lastChunk]; int available = m_chunkSize - m_firstFree; // Repeat while data remains to be copied w...
[ "public", "final", "void", "append", "(", "StringBuffer", "value", ")", "{", "if", "(", "value", "==", "null", ")", "return", ";", "int", "strlen", "=", "value", ".", "length", "(", ")", ";", "if", "(", "0", "==", "strlen", ")", "return", ";", "int...
Append the contents of a StringBuffer onto the FastStringBuffer, growing the storage if necessary. <p> NOTE THAT after calling append(), previously obtained references to m_array[] may no longer be valid. @param value StringBuffer whose contents are to be appended.
[ "Append", "the", "contents", "of", "a", "StringBuffer", "onto", "the", "FastStringBuffer", "growing", "the", "storage", "if", "necessary", ".", "<p", ">", "NOTE", "THAT", "after", "calling", "append", "()", "previously", "obtained", "references", "to", "m_array"...
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/FastStringBuffer.java#L559-L630
train
Append the contents of the specified StringBuffer to this FastStringBuffer.
Create a Java method that does the following: "Append the contents of the specified StringBuffer to this FastStringBuffer.".
Of course, here is the Java code you requested: ```java public final void append(StringBuffer value) { if (value == null) return; int strlen = value.length(); if (0 == strlen) return; int copyfrom = 0; char[] chunk = m_array[m_lastChunk]; int available = m_chunkSize - m_firstF...
aws/aws-sdk-java
aws-java-sdk-clouddirectory/src/main/java/com/amazonaws/services/clouddirectory/model/transform/AttributeKeyAndValueMarshaller.java
AttributeKeyAndValueMarshaller.marshall
public void marshall(AttributeKeyAndValue attributeKeyAndValue, ProtocolMarshaller protocolMarshaller) { if (attributeKeyAndValue == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(attributeKeyAndValu...
java
public void marshall(AttributeKeyAndValue attributeKeyAndValue, ProtocolMarshaller protocolMarshaller) { if (attributeKeyAndValue == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(attributeKeyAndValu...
[ "public", "void", "marshall", "(", "AttributeKeyAndValue", "attributeKeyAndValue", ",", "ProtocolMarshaller", "protocolMarshaller", ")", "{", "if", "(", "attributeKeyAndValue", "==", "null", ")", "{", "throw", "new", "SdkClientException", "(", "\"Invalid argument passed t...
Marshall the given parameter object.
[ "Marshall", "the", "given", "parameter", "object", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-clouddirectory/src/main/java/com/amazonaws/services/clouddirectory/model/transform/AttributeKeyAndValueMarshaller.java#L44-L56
train
marshalls the given AttributeKeyAndValue to the given protocolMarshaller.
Create a Java method that does the following: "marshalls the given AttributeKeyAndValue to the given protocolMarshaller.".
Of course, here is the Java code you requested: ```java public void marshall(AttributeKeyAndValue attributeKeyAndValue, ProtocolMarshaller protocolMarshaller) { if (attributeKeyAndValue == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { ...
opensourceBIM/BIMserver
PluginBase/generated/org/bimserver/models/ifc4/impl/Ifc4PackageImpl.java
Ifc4PackageImpl.getIfcIsothermalMoistureCapacityMeasure
@Override public EClass getIfcIsothermalMoistureCapacityMeasure() { if (ifcIsothermalMoistureCapacityMeasureEClass == null) { ifcIsothermalMoistureCapacityMeasureEClass = (EClass) EPackage.Registry.INSTANCE .getEPackage(Ifc4Package.eNS_URI).getEClassifiers().get(820); } return ifcIsothermalMoisture...
java
@Override public EClass getIfcIsothermalMoistureCapacityMeasure() { if (ifcIsothermalMoistureCapacityMeasureEClass == null) { ifcIsothermalMoistureCapacityMeasureEClass = (EClass) EPackage.Registry.INSTANCE .getEPackage(Ifc4Package.eNS_URI).getEClassifiers().get(820); } return ifcIsothermalMoisture...
[ "@", "Override", "public", "EClass", "getIfcIsothermalMoistureCapacityMeasure", "(", ")", "{", "if", "(", "ifcIsothermalMoistureCapacityMeasureEClass", "==", "null", ")", "{", "ifcIsothermalMoistureCapacityMeasureEClass", "=", "(", "EClass", ")", "EPackage", ".", "Registr...
<!-- 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#L40610-L40617
train
Create a subclass of the IfcIsothermalMoistureCapacityMeasure class.
Create a Java method that does the following: "Create a subclass of the IfcIsothermalMoistureCapacityMeasure class.".
Of course, here is the Java code you requested: ```java @Override public EClass getIfcIsothermalMoistureCapacityMeasure() { if (ifcIsothermalMoistureCapacityMeasureEClass == null) { ifcIsothermalMoistureCapacityMeasureEClass = (EClass) EPackage.Registry.INSTANCE .getEPackage(Ifc4Package.eNS_URI).getECla...
aleksandr-m/gitflow-maven-plugin
src/main/java/com/amashchenko/maven/plugin/gitflow/AbstractGitFlowMojo.java
AbstractGitFlowMojo.validateConfiguration
protected void validateConfiguration(String... params) throws MojoFailureException { if (StringUtils.isNotBlank(argLine) && MAVEN_DISALLOWED_PATTERN.matcher(argLine).find()) { throw new MojoFailureException( "The argLine doesn't match allowed pattern."...
java
protected void validateConfiguration(String... params) throws MojoFailureException { if (StringUtils.isNotBlank(argLine) && MAVEN_DISALLOWED_PATTERN.matcher(argLine).find()) { throw new MojoFailureException( "The argLine doesn't match allowed pattern."...
[ "protected", "void", "validateConfiguration", "(", "String", "...", "params", ")", "throws", "MojoFailureException", "{", "if", "(", "StringUtils", ".", "isNotBlank", "(", "argLine", ")", "&&", "MAVEN_DISALLOWED_PATTERN", ".", "matcher", "(", "argLine", ")", ".", ...
Validates plugin configuration. Throws exception if configuration is not valid. @param params Configuration parameters to validate. @throws MojoFailureException If configuration is not valid.
[ "Validates", "plugin", "configuration", ".", "Throws", "exception", "if", "configuration", "is", "not", "valid", "." ]
d7be13c653d885c1cb1d8cd0337fa9db985c381e
https://github.com/aleksandr-m/gitflow-maven-plugin/blob/d7be13c653d885c1cb1d8cd0337fa9db985c381e/src/main/java/com/amashchenko/maven/plugin/gitflow/AbstractGitFlowMojo.java#L204-L220
train
Validate the configuration.
Create a Java method that does the following: "Validate the configuration.".
Of course, here is the Java code you requested: ```java protected void validateConfiguration(String... params) throws MojoFailureException { if (StringUtils.isNotBlank(argLine) && MAVEN_DISALLOWED_PATTERN.matcher(argLine).find()) { throw new MojoFailureException( ...
Azure/azure-sdk-for-java
authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/implementation/RoleAssignmentsInner.java
RoleAssignmentsInner.listForScopeWithServiceResponseAsync
public Observable<ServiceResponse<Page<RoleAssignmentInner>>> listForScopeWithServiceResponseAsync(final String scope, final String filter) { return listForScopeSinglePageAsync(scope, filter) .concatMap(new Func1<ServiceResponse<Page<RoleAssignmentInner>>, Observable<ServiceResponse<Page<RoleAssignm...
java
public Observable<ServiceResponse<Page<RoleAssignmentInner>>> listForScopeWithServiceResponseAsync(final String scope, final String filter) { return listForScopeSinglePageAsync(scope, filter) .concatMap(new Func1<ServiceResponse<Page<RoleAssignmentInner>>, Observable<ServiceResponse<Page<RoleAssignm...
[ "public", "Observable", "<", "ServiceResponse", "<", "Page", "<", "RoleAssignmentInner", ">", ">", ">", "listForScopeWithServiceResponseAsync", "(", "final", "String", "scope", ",", "final", "String", "filter", ")", "{", "return", "listForScopeSinglePageAsync", "(", ...
Gets role assignments for a scope. @param scope The scope of the role assignments. @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope for the specifie...
[ "Gets", "role", "assignments", "for", "a", "scope", "." ]
aab183ddc6686c82ec10386d5a683d2691039626
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/implementation/RoleAssignmentsInner.java#L1531-L1543
train
List all the role assignments in a scope.
Create a Java method that does the following: "List all the role assignments in a scope.".
Of course, here is the Java code you requested: ```java public Observable<ServiceResponse<Page<RoleAssignmentInner>>> listForScopeWithServiceResponseAsync(final String scope, final String filter) { return listForScopeSinglePageAsync(scope, filter) .concatMap(new Func1<ServiceResponse<Page<RoleAssig...
googleapis/google-cloud-java
google-cloud-examples/src/main/java/com/google/cloud/examples/storage/snippets/StorageSnippets.java
StorageSnippets.authListBuckets
public Page<Bucket> authListBuckets() { // [START auth_cloud_implicit] // If you don't specify credentials when constructing the client, the // client library will look for credentials in the environment. Storage storage = StorageOptions.getDefaultInstance().getService(); Page<Bucket> buckets = st...
java
public Page<Bucket> authListBuckets() { // [START auth_cloud_implicit] // If you don't specify credentials when constructing the client, the // client library will look for credentials in the environment. Storage storage = StorageOptions.getDefaultInstance().getService(); Page<Bucket> buckets = st...
[ "public", "Page", "<", "Bucket", ">", "authListBuckets", "(", ")", "{", "// [START auth_cloud_implicit]", "// If you don't specify credentials when constructing the client, the", "// client library will look for credentials in the environment.", "Storage", "storage", "=", "StorageOptio...
Example of default auth
[ "Example", "of", "default", "auth" ]
d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a
https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-examples/src/main/java/com/google/cloud/examples/storage/snippets/StorageSnippets.java#L986-L999
train
Example of listing buckets in Cloud Identity Insights.
Create a Java method that does the following: "Example of listing buckets in Cloud Identity Insights.".
Of course, here is the Java code you requested: ```java public Page<Bucket> authListBuckets() { // [START auth_cloud_implicit] // If you don't specify credentials when constructing the client, the // client library will look for credentials in the environment. Storage storage = StorageOptions.getDefau...
socialize/socialize-sdk-android
sdk/src/com/socialize/SubscriptionUtils.java
SubscriptionUtils.subscribe
public static void subscribe (Activity context, Entity e, SubscriptionType type, SubscriptionResultListener listener) { subscriptionUtils.subscribe(context, e, type, listener); }
java
public static void subscribe (Activity context, Entity e, SubscriptionType type, SubscriptionResultListener listener) { subscriptionUtils.subscribe(context, e, type, listener); }
[ "public", "static", "void", "subscribe", "(", "Activity", "context", ",", "Entity", "e", ",", "SubscriptionType", "type", ",", "SubscriptionResultListener", "listener", ")", "{", "subscriptionUtils", ".", "subscribe", "(", "context", ",", "e", ",", "type", ",", ...
Subscribes the current user to notifications for new comments on this entity. @param context The current context. @param e The entity. @param type The subscription type. @param listener A listener to handle the result.
[ "Subscribes", "the", "current", "user", "to", "notifications", "for", "new", "comments", "on", "this", "entity", "." ]
23044d66c83718fe5c3f6f4b7b4033ac5b06fbee
https://github.com/socialize/socialize-sdk-android/blob/23044d66c83718fe5c3f6f4b7b4033ac5b06fbee/sdk/src/com/socialize/SubscriptionUtils.java#L55-L57
valid
Subscribe to an entity.
Create a Java method that does the following: "Subscribe to an entity.".
Of course, here is the Java code you requested: ```java public static void subscribe (Activity context, Entity e, SubscriptionType type, SubscriptionResultListener listener) { subscriptionUtils.subscribe(context, e, type, listener); } ``` Hope this helps!
Azure/azure-sdk-for-java
recoveryservices.backup/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2017_07_01/implementation/ExportJobsOperationResultsInner.java
ExportJobsOperationResultsInner.getAsync
public Observable<OperationResultInfoBaseResourceInner> getAsync(String vaultName, String resourceGroupName, String operationId) { return getWithServiceResponseAsync(vaultName, resourceGroupName, operationId).map(new Func1<ServiceResponse<OperationResultInfoBaseResourceInner>, OperationResultInfoBaseResourceInn...
java
public Observable<OperationResultInfoBaseResourceInner> getAsync(String vaultName, String resourceGroupName, String operationId) { return getWithServiceResponseAsync(vaultName, resourceGroupName, operationId).map(new Func1<ServiceResponse<OperationResultInfoBaseResourceInner>, OperationResultInfoBaseResourceInn...
[ "public", "Observable", "<", "OperationResultInfoBaseResourceInner", ">", "getAsync", "(", "String", "vaultName", ",", "String", "resourceGroupName", ",", "String", "operationId", ")", "{", "return", "getWithServiceResponseAsync", "(", "vaultName", ",", "resourceGroupName...
Gets the operation result of operation triggered by Export Jobs API. If the operation is successful, then it also contains URL of a Blob and a SAS key to access the same. The blob contains exported jobs in JSON serialized format. @param vaultName The name of the recovery services vault. @param resourceGroupName The na...
[ "Gets", "the", "operation", "result", "of", "operation", "triggered", "by", "Export", "Jobs", "API", ".", "If", "the", "operation", "is", "successful", "then", "it", "also", "contains", "URL", "of", "a", "Blob", "and", "a", "SAS", "key", "to", "access", ...
aab183ddc6686c82ec10386d5a683d2691039626
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/recoveryservices.backup/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2017_07_01/implementation/ExportJobsOperationResultsInner.java#L98-L105
train
Gets a single resource.
Create a Java method that does the following: "Gets a single resource.".
Of course, here is the Java code you requested: ```java public Observable<OperationResultInfoBaseResourceInner> getAsync(String vaultName, String resourceGroupName, String operationId) { return getWithServiceResponseAsync(vaultName, resourceGroupName, operationId).map(new Func1<ServiceResponse<OperationResultI...
BlueBrain/bluima
modules/bluima_xml/src/main/java/ch/epfl/bbp/uima/xml/archivearticle3/ObjectFactory.java
ObjectFactory.createEquivalent
@XmlElementDecl(namespace = "http://www.w3.org/1998/Math/MathML", name = "equivalent") public JAXBElement<RelationsType> createEquivalent(RelationsType value) { return new JAXBElement<RelationsType>(_Equivalent_QNAME, RelationsType.class, null, value); }
java
@XmlElementDecl(namespace = "http://www.w3.org/1998/Math/MathML", name = "equivalent") public JAXBElement<RelationsType> createEquivalent(RelationsType value) { return new JAXBElement<RelationsType>(_Equivalent_QNAME, RelationsType.class, null, value); }
[ "@", "XmlElementDecl", "(", "namespace", "=", "\"http://www.w3.org/1998/Math/MathML\"", ",", "name", "=", "\"equivalent\"", ")", "public", "JAXBElement", "<", "RelationsType", ">", "createEquivalent", "(", "RelationsType", "value", ")", "{", "return", "new", "JAXBElem...
Create an instance of {@link JAXBElement }{@code <}{@link RelationsType }{@code >}}
[ "Create", "an", "instance", "of", "{", "@link", "JAXBElement", "}", "{", "@code", "<", "}", "{", "@link", "RelationsType", "}", "{", "@code", ">", "}}" ]
793ea3f46761dce72094e057a56cddfa677156ae
https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_xml/src/main/java/ch/epfl/bbp/uima/xml/archivearticle3/ObjectFactory.java#L3114-L3117
train
Create an equivalent relation between two sets of relations.
Create a Java method that does the following: "Create an equivalent relation between two sets of relations.".
Of course, here is the Java code you requested: ```java @XmlElementDecl(namespace = "http://www.w3.org/1998/Math/MathML", name = "equivalent") public JAXBElement<RelationsType> createEquivalent(RelationsType value) { return new JAXBElement<RelationsType>(_Equivalent_QNAME, RelationsType.class, null, value)...
Evol-Instruct
N/A
N/A
java
[]
[]
train
Generate a code snippet in Java to display a message "Hello World!" but ensure that the message is displayed using a for loop and each character of the message is printed one by one with a 1-second delay in between.
Here is a code snippet in Java that displays the message "Hello World!" using a for loop and prints each character one by one with a 1-second delay: ```java public class HelloWorld { public static void main(String[] args) throws InterruptedException { String message = "Hello World!"; for (...
spring-projects/spring-retry
src/main/java/org/springframework/retry/support/RetryTemplate.java
RetryTemplate.doExecute
protected <T, E extends Throwable> T doExecute(RetryCallback<T, E> retryCallback, RecoveryCallback<T> recoveryCallback, RetryState state) throws E, ExhaustedRetryException { RetryPolicy retryPolicy = this.retryPolicy; BackOffPolicy backOffPolicy = this.backOffPolicy; // Allow the retry policy to initialis...
java
protected <T, E extends Throwable> T doExecute(RetryCallback<T, E> retryCallback, RecoveryCallback<T> recoveryCallback, RetryState state) throws E, ExhaustedRetryException { RetryPolicy retryPolicy = this.retryPolicy; BackOffPolicy backOffPolicy = this.backOffPolicy; // Allow the retry policy to initialis...
[ "protected", "<", "T", ",", "E", "extends", "Throwable", ">", "T", "doExecute", "(", "RetryCallback", "<", "T", ",", "E", ">", "retryCallback", ",", "RecoveryCallback", "<", "T", ">", "recoveryCallback", ",", "RetryState", "state", ")", "throws", "E", ",",...
Execute the callback once if the policy dictates that we can, otherwise execute the recovery callback. @param recoveryCallback the {@link RecoveryCallback} @param retryCallback the {@link RetryCallback} @param state the {@link RetryState} @param <T> the type of the return value @param <E> the exception type to throw @s...
[ "Execute", "the", "callback", "once", "if", "the", "policy", "dictates", "that", "we", "can", "otherwise", "execute", "the", "recovery", "callback", "." ]
e2b0555f96594c2321990d0deeac45fc44d4f123
https://github.com/spring-projects/spring-retry/blob/e2b0555f96594c2321990d0deeac45fc44d4f123/src/main/java/org/springframework/retry/support/RetryTemplate.java#L250-L386
train
Execute the retry operation.
Create a Java method that does the following: "Execute the retry operation.".
Of course, here is the Java code you requested: ```java protected <T, E extends Throwable> T doExecute(RetryCallback<T, E> retryCallback, RecoveryCallback<T> recoveryCallback, RetryState state) throws E, ExhaustedRetryException { RetryPolicy retryPolicy = this.retryPolicy; BackOffPolicy backOffPolicy = this...
looly/hutool
hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java
FileUtil.copyFile
public static Path copyFile(Path src, Path dest, StandardCopyOption... options) throws IORuntimeException { Assert.notNull(src, "Source File is null !"); Assert.notNull(dest, "Destination File or directiory is null !"); Path destPath = dest.toFile().isDirectory() ? dest.resolve(src.getFileName()) : dest; ...
java
public static Path copyFile(Path src, Path dest, StandardCopyOption... options) throws IORuntimeException { Assert.notNull(src, "Source File is null !"); Assert.notNull(dest, "Destination File or directiory is null !"); Path destPath = dest.toFile().isDirectory() ? dest.resolve(src.getFileName()) : dest; ...
[ "public", "static", "Path", "copyFile", "(", "Path", "src", ",", "Path", "dest", ",", "StandardCopyOption", "...", "options", ")", "throws", "IORuntimeException", "{", "Assert", ".", "notNull", "(", "src", ",", "\"Source File is null !\"", ")", ";", "Assert", ...
通过JDK7+的 {@link Files#copy(Path, Path, CopyOption...)} 方法拷贝文件 @param src 源文件路径 @param dest 目标文件或目录,如果为目录使用与源文件相同的文件名 @param options {@link StandardCopyOption} @return Path @throws IORuntimeException IO异常
[ "通过JDK7", "+", "的", "{", "@link", "Files#copy", "(", "Path", "Path", "CopyOption", "...", ")", "}", "方法拷贝文件" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java#L961-L971
train
Copies a source file to a destination file.
Create a Java method that does the following: "Copies a source file to a destination file.".
Of course, here is the Java code you requested: ```java public static Path copyFile(Path src, Path dest, StandardCopyOption... options) throws IORuntimeException { Assert.notNull(src, "Source File is null !"); Assert.notNull(dest, "Destination File or directiory is null !"); Path destPath = dest.toFile().is...
deeplearning4j/deeplearning4j
nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/dataset/api/preprocessor/MultiNormalizerHybrid.java
MultiNormalizerHybrid.revertFeatures
public void revertFeatures(@NonNull INDArray[] features, INDArray[] maskArrays, int input) { NormalizerStrategy strategy = getStrategy(globalInputStrategy, perInputStrategies, input); if (strategy != null) { INDArray mask = (maskArrays == null ? null : maskArrays[input]); //noins...
java
public void revertFeatures(@NonNull INDArray[] features, INDArray[] maskArrays, int input) { NormalizerStrategy strategy = getStrategy(globalInputStrategy, perInputStrategies, input); if (strategy != null) { INDArray mask = (maskArrays == null ? null : maskArrays[input]); //noins...
[ "public", "void", "revertFeatures", "(", "@", "NonNull", "INDArray", "[", "]", "features", ",", "INDArray", "[", "]", "maskArrays", ",", "int", "input", ")", "{", "NormalizerStrategy", "strategy", "=", "getStrategy", "(", "globalInputStrategy", ",", "perInputStr...
Undo (revert) the normalization applied by this DataNormalization instance to the features of a particular input @param features The normalized array of inputs @param maskArrays Optional mask arrays belonging to the inputs @param input the index of the input to revert normalization on
[ "Undo", "(", "revert", ")", "the", "normalization", "applied", "by", "this", "DataNormalization", "instance", "to", "the", "features", "of", "a", "particular", "input" ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/dataset/api/preprocessor/MultiNormalizerHybrid.java#L380-L387
train
Revert the features from the global input to the mask array
Create a Java method that does the following: "Revert the features from the global input to the mask array".
Of course, here is the Java code you requested: ```java public void revertFeatures(@NonNull INDArray[] features, INDArray[] maskArrays, int input) { NormalizerStrategy strategy = getStrategy(globalInputStrategy, perInputStrategies, input); if (strategy != null) { INDArray mask = (maskArrays...
eclipse/xtext-lib
org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/ComparableExtensions.java
ComparableExtensions.operator_lessThan
@Pure /* not guaranteed, since compareTo() is invoked */ @Inline("($1.compareTo($2) < 0)") public static <C> boolean operator_lessThan(Comparable<? super C> left, C right) { return left.compareTo(right) < 0; }
java
@Pure /* not guaranteed, since compareTo() is invoked */ @Inline("($1.compareTo($2) < 0)") public static <C> boolean operator_lessThan(Comparable<? super C> left, C right) { return left.compareTo(right) < 0; }
[ "@", "Pure", "/* not guaranteed, since compareTo() is invoked */", "@", "Inline", "(", "\"($1.compareTo($2) < 0)\"", ")", "public", "static", "<", "C", ">", "boolean", "operator_lessThan", "(", "Comparable", "<", "?", "super", "C", ">", "left", ",", "C", "right", ...
The comparison operator <code>less than</code>. @param left a comparable @param right the value to compare with @return <code>left.compareTo(right) < 0</code>
[ "The", "comparison", "operator", "<code", ">", "less", "than<", "/", "code", ">", "." ]
7063572e1f1bd713a3aa53bdf3a8dc60e25c169a
https://github.com/eclipse/xtext-lib/blob/7063572e1f1bd713a3aa53bdf3a8dc60e25c169a/org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/ComparableExtensions.java#L29-L33
train
Replies if the left value is less than the right value.
Create a Java method that does the following: "Replies if the left value is less than the right value.".
Of course, here is the Java code you requested: ```java @Pure /* not guaranteed, since compareTo() is invoked */ @Inline("($1.compareTo($2) < 0)") public static <C> boolean operator_lessThan(Comparable<? super C> left, C right) { return left.compareTo(right) < 0; } ``` Hope this helps!
wro4j/wro4j
wro4j-core/src/main/java/ro/isdc/wro/model/resource/processor/decorator/ExceptionHandlingProcessorDecorator.java
ExceptionHandlingProcessorDecorator.process
@Override public void process(final Resource resource, final Reader reader, final Writer writer) throws IOException { final String resourceContent = IOUtils.toString(reader); final Reader innerReader = new StringReader(resourceContent); final StringWriter innerWriter = new StringWriter(); try { ...
java
@Override public void process(final Resource resource, final Reader reader, final Writer writer) throws IOException { final String resourceContent = IOUtils.toString(reader); final Reader innerReader = new StringReader(resourceContent); final StringWriter innerWriter = new StringWriter(); try { ...
[ "@", "Override", "public", "void", "process", "(", "final", "Resource", "resource", ",", "final", "Reader", "reader", ",", "final", "Writer", "writer", ")", "throws", "IOException", "{", "final", "String", "resourceContent", "=", "IOUtils", ".", "toString", "(...
{@inheritDoc}
[ "{" ]
d2a3de71ab8bf0af7061fb6327501e08198338df
https://github.com/wro4j/wro4j/blob/d2a3de71ab8bf0af7061fb6327501e08198338df/wro4j-core/src/main/java/ro/isdc/wro/model/resource/processor/decorator/ExceptionHandlingProcessorDecorator.java#L49-L74
test
Override the process method to write the content of the resource using the base class.
Create a Java method that does the following: "Override the process method to write the content of the resource using the base class.".
Of course, here is the Java code you requested: ```java @Override public void process(final Resource resource, final Reader reader, final Writer writer) throws IOException { final String resourceContent = IOUtils.toString(reader); final Reader innerReader = new StringReader(resourceContent); final ...
project-ncl/pnc
indy-repository-manager/src/main/java/org/jboss/pnc/indyrepositorymanager/IndyRunningPromotion.java
IndyRunningPromotion.monitor
@Override public void monitor(Consumer<CompletedRepositoryPromotion> onComplete, Consumer<Exception> onError) { try { StoreKey fromKey = new StoreKey(pakageType, fromType, fromId); if (!indy.stores().exists(fromKey)) { throw new RepositoryManagerException("No such %s ...
java
@Override public void monitor(Consumer<CompletedRepositoryPromotion> onComplete, Consumer<Exception> onError) { try { StoreKey fromKey = new StoreKey(pakageType, fromType, fromId); if (!indy.stores().exists(fromKey)) { throw new RepositoryManagerException("No such %s ...
[ "@", "Override", "public", "void", "monitor", "(", "Consumer", "<", "CompletedRepositoryPromotion", ">", "onComplete", ",", "Consumer", "<", "Exception", ">", "onError", ")", "{", "try", "{", "StoreKey", "fromKey", "=", "new", "StoreKey", "(", "pakageType", ",...
Trigger the repository promotion configured for this instance, and send the result to the appropriate consumer. @param onComplete The consumer which will handle non-error results @param onError Handles errors
[ "Trigger", "the", "repository", "promotion", "configured", "for", "this", "instance", "and", "send", "the", "result", "to", "the", "appropriate", "consumer", "." ]
85743ca59d14cdf750d6daa8bd0a0a8be390a796
https://github.com/project-ncl/pnc/blob/85743ca59d14cdf750d6daa8bd0a0a8be390a796/indy-repository-manager/src/main/java/org/jboss/pnc/indyrepositorymanager/IndyRunningPromotion.java#L53-L77
valid
Monitor the generation of the records in the repository.
Create a Java method that does the following: "Monitor the generation of the records in the repository.".
Of course, here is the Java code you requested: ```java @Override public void monitor(Consumer<CompletedRepositoryPromotion> onComplete, Consumer<Exception> onError) { try { StoreKey fromKey = new StoreKey(pakageType, fromType, fromId); if (!indy.stores().exists(fromKey)) { ...
monitorjbl/excel-streaming-reader
src/main/java/com/monitorjbl/xlsx/impl/StreamingCell.java
StreamingCell.getStringCellValue
@Override public String getStringCellValue() { Object c = contentsSupplier.getContent(); return c == null ? "" : c.toString(); }
java
@Override public String getStringCellValue() { Object c = contentsSupplier.getContent(); return c == null ? "" : c.toString(); }
[ "@", "Override", "public", "String", "getStringCellValue", "(", ")", "{", "Object", "c", "=", "contentsSupplier", ".", "getContent", "(", ")", ";", "return", "c", "==", "null", "?", "\"\"", ":", "c", ".", "toString", "(", ")", ";", "}" ]
Get the value of the cell as a string. For blank cells we return an empty string. @return the value of the cell as a string
[ "Get", "the", "value", "of", "the", "cell", "as", "a", "string", ".", "For", "blank", "cells", "we", "return", "an", "empty", "string", "." ]
4e95c9aaaecf33685a09f8c267af3a578ba5e070
https://github.com/monitorjbl/excel-streaming-reader/blob/4e95c9aaaecf33685a09f8c267af3a578ba5e070/src/main/java/com/monitorjbl/xlsx/impl/StreamingCell.java#L183-L188
train
Get the value of the .
Create a Java method that does the following: "Get the value of the .".
Of course, here is the Java code you requested: ```java @Override public String getStringCellValue() { Object c = contentsSupplier.getContent(); return c == null ? "" : c.toString(); } ``` Hope this helps!
paypal/SeLion
server/src/main/java/com/paypal/selion/grid/servlets/transfer/DownloadResponder.java
DownloadResponder.respond
public void respond() { LOGGER.entering(); managedArtifact = downloadRequestProcessor.getArtifact(this.pathInfo); contents = managedArtifact.getArtifactContents(); setResponseMetadata(); try { IOUtils.copy(new ByteArrayInputStream(contents), httpServletResponse.getOut...
java
public void respond() { LOGGER.entering(); managedArtifact = downloadRequestProcessor.getArtifact(this.pathInfo); contents = managedArtifact.getArtifactContents(); setResponseMetadata(); try { IOUtils.copy(new ByteArrayInputStream(contents), httpServletResponse.getOut...
[ "public", "void", "respond", "(", ")", "{", "LOGGER", ".", "entering", "(", ")", ";", "managedArtifact", "=", "downloadRequestProcessor", ".", "getArtifact", "(", "this", ".", "pathInfo", ")", ";", "contents", "=", "managedArtifact", ".", "getArtifactContents", ...
Sends a response over the HTTP servlet for the current {@link TransferContext}.
[ "Sends", "a", "response", "over", "the", "HTTP", "servlet", "for", "the", "current", "{" ]
694d12d0df76db48d0360b16192770c6a4fbdfd2
https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/server/src/main/java/com/paypal/selion/grid/servlets/transfer/DownloadResponder.java#L64-L75
train
This method is called to respond to the servlet.
Create a Java method that does the following: "This method is called to respond to the servlet.".
Of course, here is the Java code you requested: ```java public void respond() { LOGGER.entering(); managedArtifact = downloadRequestProcessor.getArtifact(this.pathInfo); contents = managedArtifact.getArtifactContents(); setResponseMetadata(); try { IOUtils.copy(new B...
OpenLiberty/open-liberty
dev/com.ibm.ws.microprofile.config.1.1/src/com/ibm/ws/microprofile/config/converters/UserConverter.java
UserConverter.getType
@Trivial private static Type getType(Converter<?> converter) { Type type = null; Type[] itypes = converter.getClass().getGenericInterfaces(); for (Type itype : itypes) { ParameterizedType ptype = (ParameterizedType) itype; if (ptype.getRawType() == Converter.class) {...
java
@Trivial private static Type getType(Converter<?> converter) { Type type = null; Type[] itypes = converter.getClass().getGenericInterfaces(); for (Type itype : itypes) { ParameterizedType ptype = (ParameterizedType) itype; if (ptype.getRawType() == Converter.class) {...
[ "@", "Trivial", "private", "static", "Type", "getType", "(", "Converter", "<", "?", ">", "converter", ")", "{", "Type", "type", "=", "null", ";", "Type", "[", "]", "itypes", "=", "converter", ".", "getClass", "(", ")", ".", "getGenericInterfaces", "(", ...
Reflectively work out the Type of a Converter @param converter @return
[ "Reflectively", "work", "out", "the", "Type", "of", "a", "Converter" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.microprofile.config.1.1/src/com/ibm/ws/microprofile/config/converters/UserConverter.java#L103-L125
train
Get the type of the conversion.
Create a Java method that does the following: "Get the type of the conversion.".
Of course, here is the Java code you requested: ```java @Trivial private static Type getType(Converter<?> converter) { Type type = null; Type[] itypes = converter.getClass().getGenericInterfaces(); for (Type itype : itypes) { ParameterizedType ptype = (ParameterizedType) itype;...
belaban/JGroups
src/org/jgroups/util/Table.java
Table.add
public boolean add(long seqno, T element) { lock.lock(); try { return _add(seqno, element, true, null); } finally { lock.unlock(); } }
java
public boolean add(long seqno, T element) { lock.lock(); try { return _add(seqno, element, true, null); } finally { lock.unlock(); } }
[ "public", "boolean", "add", "(", "long", "seqno", ",", "T", "element", ")", "{", "lock", ".", "lock", "(", ")", ";", "try", "{", "return", "_add", "(", "seqno", ",", "element", ",", "true", ",", "null", ")", ";", "}", "finally", "{", "lock", ".",...
Adds an element if the element at the given index is null. Returns true if no element existed at the given index, else returns false and doesn't set the element. @param seqno @param element @return True if the element at the computed index was null, else false
[ "Adds", "an", "element", "if", "the", "element", "at", "the", "given", "index", "is", "null", ".", "Returns", "true", "if", "no", "element", "existed", "at", "the", "given", "index", "else", "returns", "false", "and", "doesn", "t", "set", "the", "element...
bd3ca786aa57fed41dfbc10a94b1281e388be03b
https://github.com/belaban/JGroups/blob/bd3ca786aa57fed41dfbc10a94b1281e388be03b/src/org/jgroups/util/Table.java#L201-L209
train
Add a single element to the set.
Create a Java method that does the following: "Add a single element to the set.".
Of course, here is the Java code you requested: ```java public boolean add(long seqno, T element) { lock.lock(); try { return _add(seqno, element, true, null); } finally { lock.unlock(); } } ``` Hope this helps!
google/j2objc
jre_emul/android/platform/libcore/luni/src/main/java/java/net/AddressCache.java
AddressCache.put
public void put(String hostname, int netId, InetAddress[] addresses) { cache.put(new AddressCacheKey(hostname, netId), new AddressCacheEntry(addresses)); }
java
public void put(String hostname, int netId, InetAddress[] addresses) { cache.put(new AddressCacheKey(hostname, netId), new AddressCacheEntry(addresses)); }
[ "public", "void", "put", "(", "String", "hostname", ",", "int", "netId", ",", "InetAddress", "[", "]", "addresses", ")", "{", "cache", ".", "put", "(", "new", "AddressCacheKey", "(", "hostname", ",", "netId", ")", ",", "new", "AddressCacheEntry", "(", "a...
Associates the given 'addresses' with 'hostname'. The association will expire after a certain length of time.
[ "Associates", "the", "given", "addresses", "with", "hostname", ".", "The", "association", "will", "expire", "after", "a", "certain", "length", "of", "time", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/luni/src/main/java/java/net/AddressCache.java#L117-L119
train
Put an array of addresses into the cache.
Create a Java method that does the following: "Put an array of addresses into the cache.".
Of course, here is the Java code you requested: ```java public void put(String hostname, int netId, InetAddress[] addresses) { cache.put(new AddressCacheKey(hostname, netId), new AddressCacheEntry(addresses)); } ``` Hope this helps!
VoltDB/voltdb
src/frontend/org/voltdb/utils/PolygonFactory.java
PolygonFactory.CreateStar
@Deprecated public static GeographyValue CreateStar( GeographyPointValue center, GeographyPointValue firstVertex, int numPointsInStar, double ratioOfPointLength, // pass in 1.0 for a polygon with twice the number of vertices, or .1 for a very jagged star d...
java
@Deprecated public static GeographyValue CreateStar( GeographyPointValue center, GeographyPointValue firstVertex, int numPointsInStar, double ratioOfPointLength, // pass in 1.0 for a polygon with twice the number of vertices, or .1 for a very jagged star d...
[ "@", "Deprecated", "public", "static", "GeographyValue", "CreateStar", "(", "GeographyPointValue", "center", ",", "GeographyPointValue", "firstVertex", ",", "int", "numPointsInStar", ",", "double", "ratioOfPointLength", ",", "// pass in 1.0 for a polygon with twice the number o...
Create a star-shaped polygon with an optional hole. This polygon will have numPointsInStar outer points, and numPointsInStar inner points. For each outer point, OP, distance(center, OP) = distance(center, firstVertex). For each inner point, IP, distance(center, IP) = ratioOfPointLength*distance(center, firstVertex)....
[ "Create", "a", "star", "-", "shaped", "polygon", "with", "an", "optional", "hole", ".", "This", "polygon", "will", "have", "numPointsInStar", "outer", "points", "and", "numPointsInStar", "inner", "points", ".", "For", "each", "outer", "point", "OP", "distance"...
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/utils/PolygonFactory.java#L107-L184
train
Create a star polygon.
Create a Java method that does the following: "Create a star polygon.".
Of course, here is the Java code you requested: ```java @Deprecated public static GeographyValue CreateStar( GeographyPointValue center, GeographyPointValue firstVertex, int numPointsInStar, double ratioOfPointLength, // pass in 1.0 for a polygon with twice the numbe...
line/centraldogma
server/src/main/java/com/linecorp/centraldogma/server/internal/metadata/MetadataService.java
MetadataService.restoreProject
public CompletableFuture<Revision> restoreProject(Author author, String projectName) { requireNonNull(author, "author"); requireNonNull(projectName, "projectName"); final Change<JsonNode> change = Change.ofJsonPatch(METADATA_JSON, new RemoveOperation(PROJECT_REMOVAL).toJsonNode(...
java
public CompletableFuture<Revision> restoreProject(Author author, String projectName) { requireNonNull(author, "author"); requireNonNull(projectName, "projectName"); final Change<JsonNode> change = Change.ofJsonPatch(METADATA_JSON, new RemoveOperation(PROJECT_REMOVAL).toJsonNode(...
[ "public", "CompletableFuture", "<", "Revision", ">", "restoreProject", "(", "Author", "author", ",", "String", "projectName", ")", "{", "requireNonNull", "(", "author", ",", "\"author\"", ")", ";", "requireNonNull", "(", "projectName", ",", "\"projectName\"", ")",...
Restores a {@link ProjectMetadata} whose name equals to the specified {@code projectName}.
[ "Restores", "a", "{" ]
b9e46c67fbc26628c2186ce2f46e7fb303c831e9
https://github.com/line/centraldogma/blob/b9e46c67fbc26628c2186ce2f46e7fb303c831e9/server/src/main/java/com/linecorp/centraldogma/server/internal/metadata/MetadataService.java#L119-L127
train
Restores the project.
Create a Java method that does the following: "Restores the project.".
Of course, here is the Java code you requested: ```java public CompletableFuture<Revision> restoreProject(Author author, String projectName) { requireNonNull(author, "author"); requireNonNull(projectName, "projectName"); final Change<JsonNode> change = Change.ofJsonPatch(METADA...
MenoData/Time4J
base/src/main/java/net/time4j/range/CalendarMonth.java
CalendarMonth.from
public static CalendarMonth from(GregorianDate date) { PlainDate iso = PlainDate.from(date); // includes validation return CalendarMonth.of(iso.getYear(), iso.getMonth()); }
java
public static CalendarMonth from(GregorianDate date) { PlainDate iso = PlainDate.from(date); // includes validation return CalendarMonth.of(iso.getYear(), iso.getMonth()); }
[ "public", "static", "CalendarMonth", "from", "(", "GregorianDate", "date", ")", "{", "PlainDate", "iso", "=", "PlainDate", ".", "from", "(", "date", ")", ";", "// includes validation", "return", "CalendarMonth", ".", "of", "(", "iso", ".", "getYear", "(", ")...
/*[deutsch] <p>Konvertiert das angegebene gregorianische Datum zu einem Kalendermonat. </p> @param date gregorian calendar date (for example {@code PlainDate} @return CalendarMonth @throws IllegalArgumentException if given date is invalid @since 3.28/4.24
[ "/", "*", "[", "deutsch", "]", "<p", ">", "Konvertiert", "das", "angegebene", "gregorianische", "Datum", "zu", "einem", "Kalendermonat", ".", "<", "/", "p", ">" ]
08b2eda6b2dbb140b92011cf7071bb087edd46a5
https://github.com/MenoData/Time4J/blob/08b2eda6b2dbb140b92011cf7071bb087edd46a5/base/src/main/java/net/time4j/range/CalendarMonth.java#L466-L471
train
Create a CalendarMonth from a GregorianDate.
Create a Java method that does the following: "Create a CalendarMonth from a GregorianDate.".
Of course, here is the Java code you requested: ```java public static CalendarMonth from(GregorianDate date) { PlainDate iso = PlainDate.from(date); // includes validation return CalendarMonth.of(iso.getYear(), iso.getMonth()); } ``` Hope this helps!
facebookarchive/hadoop-20
src/core/org/apache/hadoop/fs/HarFileSystem.java
HarFileSystem.initialize
public void initialize(URI name, Configuration conf) throws IOException { //decode the name underLyingURI = decodeHarURI(name, conf); // we got the right har Path- now check if this is //truly a har filesystem Path harPath = archivePath( new Path(name.getScheme(), name.getAuthority(), name.ge...
java
public void initialize(URI name, Configuration conf) throws IOException { //decode the name underLyingURI = decodeHarURI(name, conf); // we got the right har Path- now check if this is //truly a har filesystem Path harPath = archivePath( new Path(name.getScheme(), name.getAuthority(), name.ge...
[ "public", "void", "initialize", "(", "URI", "name", ",", "Configuration", "conf", ")", "throws", "IOException", "{", "//decode the name", "underLyingURI", "=", "decodeHarURI", "(", "name", ",", "conf", ")", ";", "// we got the right har Path- now check if this is", "...
Initialize a Har filesystem per har archive. The archive home directory is the top level directory in the filesystem that contains the HAR archive. Be careful with this method, you do not want to go on creating new Filesystem instances per call to path.getFileSystem(). the uri of Har is har://underlyingfsscheme-host:po...
[ "Initialize", "a", "Har", "filesystem", "per", "har", "archive", ".", "The", "archive", "home", "directory", "is", "the", "top", "level", "directory", "in", "the", "filesystem", "that", "contains", "the", "HAR", "archive", ".", "Be", "careful", "with", "this...
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/fs/HarFileSystem.java#L155-L191
train
Initialize the HarFile object
Create a Java method that does the following: "Initialize the HarFile object".
Of course, here is the Java code you requested: ```java public void initialize(URI name, Configuration conf) throws IOException { //decode the name underLyingURI = decodeHarURI(name, conf); // we got the right har Path- now check if this is //truly a har filesystem Path harPath = archivePath( ...
hypfvieh/java-utils
src/main/java/com/github/hypfvieh/util/NetUtil.java
NetUtil.getHostName
public static String getHostName(String _ipAddress) { try { InetAddress addr = InetAddress.getByName(_ipAddress); return addr.getHostName(); } catch (Exception _ex) { return _ipAddress; } }
java
public static String getHostName(String _ipAddress) { try { InetAddress addr = InetAddress.getByName(_ipAddress); return addr.getHostName(); } catch (Exception _ex) { return _ipAddress; } }
[ "public", "static", "String", "getHostName", "(", "String", "_ipAddress", ")", "{", "try", "{", "InetAddress", "addr", "=", "InetAddress", ".", "getByName", "(", "_ipAddress", ")", ";", "return", "addr", ".", "getHostName", "(", ")", ";", "}", "catch", "("...
Get the host name of a local address, if available. @param _ipAddress the IP address @return the host name, or the original IP if name not available
[ "Get", "the", "host", "name", "of", "a", "local", "address", "if", "available", "." ]
407c32d6b485596d4d2b644f5f7fc7a02d0169c6
https://github.com/hypfvieh/java-utils/blob/407c32d6b485596d4d2b644f5f7fc7a02d0169c6/src/main/java/com/github/hypfvieh/util/NetUtil.java#L21-L28
train
Get the hostname of an IP address.
Create a Java method that does the following: "Get the hostname of an IP address.".
Of course, here is the Java code you requested: ```java public static String getHostName(String _ipAddress) { try { InetAddress addr = InetAddress.getByName(_ipAddress); return addr.getHostName(); } catch (Exception _ex) { return _ipAddress; } } ``` Hope...
dbracewell/hermes
hermes-core/src/main/java/com/davidbracewell/hermes/DocumentFactory.java
DocumentFactory.getInstance
public static DocumentFactory getInstance() { if (CONFIGURED_INSTANCE == null) { synchronized (DocumentFactory.class) { if (CONFIGURED_INSTANCE == null) { CONFIGURED_INSTANCE = new DocumentFactory(); } } } return CONFIGURED_INSTANCE; }
java
public static DocumentFactory getInstance() { if (CONFIGURED_INSTANCE == null) { synchronized (DocumentFactory.class) { if (CONFIGURED_INSTANCE == null) { CONFIGURED_INSTANCE = new DocumentFactory(); } } } return CONFIGURED_INSTANCE; }
[ "public", "static", "DocumentFactory", "getInstance", "(", ")", "{", "if", "(", "CONFIGURED_INSTANCE", "==", "null", ")", "{", "synchronized", "(", "DocumentFactory", ".", "class", ")", "{", "if", "(", "CONFIGURED_INSTANCE", "==", "null", ")", "{", "CONFIGURED...
Gets instance of the document factory configured using configuration settings. @return A document factory whose preprocessors are set via configuration options
[ "Gets", "instance", "of", "the", "document", "factory", "configured", "using", "configuration", "settings", "." ]
9ebefe7ad5dea1b731ae6931a30771eb75325ea3
https://github.com/dbracewell/hermes/blob/9ebefe7ad5dea1b731ae6931a30771eb75325ea3/hermes-core/src/main/java/com/davidbracewell/hermes/DocumentFactory.java#L74-L83
train
Get the instance of the DocumentFactory.
Create a Java method that does the following: "Get the instance of the DocumentFactory.".
Of course, here is the Java code you requested: ```java public static DocumentFactory getInstance() { if (CONFIGURED_INSTANCE == null) { synchronized (DocumentFactory.class) { if (CONFIGURED_INSTANCE == null) { CONFIGURED_INSTANCE = new DocumentFactory(); } ...
arxanchain/java-common
src/main/java/com/arxanfintech/common/crypto/core/ECKey.java
ECKey.verify
public static boolean verify(byte[] data, byte[] signature, byte[] pub) { return verify(data, ECDSASignature.decodeFromDER(signature), pub); }
java
public static boolean verify(byte[] data, byte[] signature, byte[] pub) { return verify(data, ECDSASignature.decodeFromDER(signature), pub); }
[ "public", "static", "boolean", "verify", "(", "byte", "[", "]", "data", ",", "byte", "[", "]", "signature", ",", "byte", "[", "]", "pub", ")", "{", "return", "verify", "(", "data", ",", "ECDSASignature", ".", "decodeFromDER", "(", "signature", ")", ","...
Verifies the given ASN.1 encoded ECDSA signature against a hash using the public key. @param data Hash of the data to verify. @param signature signature. @param pub The public key bytes to use. @return -
[ "Verifies", "the", "given", "ASN", ".", "1", "encoded", "ECDSA", "signature", "against", "a", "hash", "using", "the", "public", "key", "." ]
3ddfedfd948f5bab3fee0b74b85cdce4702ed84e
https://github.com/arxanchain/java-common/blob/3ddfedfd948f5bab3fee0b74b85cdce4702ed84e/src/main/java/com/arxanfintech/common/crypto/core/ECKey.java#L1037-L1039
train
Verify the data with the ECDSA signature.
Create a Java method that does the following: "Verify the data with the ECDSA signature.".
Of course, here is the Java code you requested: ```java public static boolean verify(byte[] data, byte[] signature, byte[] pub) { return verify(data, ECDSASignature.decodeFromDER(signature), pub); } ``` Hope this helps!
FitLayout/segmentation
src/main/java/org/fit/segm/grouping/op/GroupByDOMOperator.java
GroupByDOMOperator.groupByDOM
private void groupByDOM(AreaImpl root) { if (root.getChildCount() > 1) findSuperAreas(root, 1); for (int i = 0; i < root.getChildCount(); i++) groupByDOM((AreaImpl) root.getChildAt(i)); }
java
private void groupByDOM(AreaImpl root) { if (root.getChildCount() > 1) findSuperAreas(root, 1); for (int i = 0; i < root.getChildCount(); i++) groupByDOM((AreaImpl) root.getChildAt(i)); }
[ "private", "void", "groupByDOM", "(", "AreaImpl", "root", ")", "{", "if", "(", "root", ".", "getChildCount", "(", ")", ">", "1", ")", "findSuperAreas", "(", "root", ",", "1", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "root", ".",...
Takes the leaf areas and tries to join the homogeneous paragraphs.
[ "Takes", "the", "leaf", "areas", "and", "tries", "to", "join", "the", "homogeneous", "paragraphs", "." ]
12998087d576640c2f2a6360cf6088af95eea5f4
https://github.com/FitLayout/segmentation/blob/12998087d576640c2f2a6360cf6088af95eea5f4/src/main/java/org/fit/segm/grouping/op/GroupByDOMOperator.java#L68-L74
train
Group by DOM.
Create a Java method that does the following: "Group by DOM.".
Of course, here is the Java code you requested: ```java private void groupByDOM(AreaImpl root) { if (root.getChildCount() > 1) findSuperAreas(root, 1); for (int i = 0; i < root.getChildCount(); i++) groupByDOM((AreaImpl) root.getChildAt(i)); } ``` Hope this helps!
michael-rapp/AndroidMaterialViews
library/src/main/java/de/mrapp/android/view/drawable/CircularProgressDrawable.java
CircularProgressDrawable.initializeAngleAnimator
private void initializeAngleAnimator() { angleAnimator = ObjectAnimator.ofFloat(this, createAngleProperty(), MAX_DEGREES); angleAnimator.setInterpolator(new LinearInterpolator()); angleAnimator.setDuration(ANGLE_ANIMATION_DURATION); angleAnimator.setRepeatMode(ValueAnimator.RESTART); ...
java
private void initializeAngleAnimator() { angleAnimator = ObjectAnimator.ofFloat(this, createAngleProperty(), MAX_DEGREES); angleAnimator.setInterpolator(new LinearInterpolator()); angleAnimator.setDuration(ANGLE_ANIMATION_DURATION); angleAnimator.setRepeatMode(ValueAnimator.RESTART); ...
[ "private", "void", "initializeAngleAnimator", "(", ")", "{", "angleAnimator", "=", "ObjectAnimator", ".", "ofFloat", "(", "this", ",", "createAngleProperty", "(", ")", ",", "MAX_DEGREES", ")", ";", "angleAnimator", ".", "setInterpolator", "(", "new", "LinearInterp...
Initializes the angle animator.
[ "Initializes", "the", "angle", "animator", "." ]
398421be462fe5793c7e3a9212949e06236a7c2f
https://github.com/michael-rapp/AndroidMaterialViews/blob/398421be462fe5793c7e3a9212949e06236a7c2f/library/src/main/java/de/mrapp/android/view/drawable/CircularProgressDrawable.java#L138-L144
valid
Initialize the angle animator.
Create a Java method that does the following: "Initialize the angle animator.".
Of course, here is the Java code you requested: ```java private void initializeAngleAnimator() { angleAnimator = ObjectAnimator.ofFloat(this, createAngleProperty(), MAX_DEGREES); angleAnimator.setInterpolator(new LinearInterpolator()); angleAnimator.setDuration(ANGLE_ANIMATION_DURATION); ...
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/jar/JarVerifier.java
JarVerifier.beginEntry
public void beginEntry(JarEntry je, ManifestEntryVerifier mev) throws IOException { if (je == null) return; if (debug != null) { debug.println("beginEntry "+je.getName()); } String name = je.getName(); /* * Assumptions: * 1...
java
public void beginEntry(JarEntry je, ManifestEntryVerifier mev) throws IOException { if (je == null) return; if (debug != null) { debug.println("beginEntry "+je.getName()); } String name = je.getName(); /* * Assumptions: * 1...
[ "public", "void", "beginEntry", "(", "JarEntry", "je", ",", "ManifestEntryVerifier", "mev", ")", "throws", "IOException", "{", "if", "(", "je", "==", "null", ")", "return", ";", "if", "(", "debug", "!=", "null", ")", "{", "debug", ".", "println", "(", ...
This method scans to see which entry we're parsing and keeps various state information depending on what type of file is being parsed.
[ "This", "method", "scans", "to", "see", "which", "entry", "we", "re", "parsing", "and", "keeps", "various", "state", "information", "depending", "on", "what", "type", "of", "file", "is", "being", "parsed", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/jar/JarVerifier.java#L111-L182
train
Begin the entry processing for a jar entry.
Create a Java method that does the following: "Begin the entry processing for a jar entry.".
Of course, here is the Java code you requested: ```java public void beginEntry(JarEntry je, ManifestEntryVerifier mev) throws IOException { if (je == null) return; if (debug != null) { debug.println("beginEntry "+je.getName()); } String name = je.ge...
eserating/siren4j
src/main/java/com/google/code/siren4j/util/ReflectionUtils.java
ReflectionUtils.isGetter
public static boolean isGetter(Method method) { String name = method.getName(); String[] splitname = StringUtils.splitByCharacterTypeCamelCase(name); return !method.getReturnType().equals(void.class) && Modifier.isPublic(method.getModifiers()) && (splitname[0].equals(GETTER_P...
java
public static boolean isGetter(Method method) { String name = method.getName(); String[] splitname = StringUtils.splitByCharacterTypeCamelCase(name); return !method.getReturnType().equals(void.class) && Modifier.isPublic(method.getModifiers()) && (splitname[0].equals(GETTER_P...
[ "public", "static", "boolean", "isGetter", "(", "Method", "method", ")", "{", "String", "name", "=", "method", ".", "getName", "(", ")", ";", "String", "[", "]", "splitname", "=", "StringUtils", ".", "splitByCharacterTypeCamelCase", "(", "name", ")", ";", ...
Determine if the method is a getter. @param method @return
[ "Determine", "if", "the", "method", "is", "a", "getter", "." ]
f12e3185076ad920352ec4f6eb2a071a3683505f
https://github.com/eserating/siren4j/blob/f12e3185076ad920352ec4f6eb2a071a3683505f/src/main/java/com/google/code/siren4j/util/ReflectionUtils.java#L212-L217
train
Checks if the given method is a getter method.
Create a Java method that does the following: "Checks if the given method is a getter method.".
Of course, here is the Java code you requested: ```java public static boolean isGetter(Method method) { String name = method.getName(); String[] splitname = StringUtils.splitByCharacterTypeCamelCase(name); return !method.getReturnType().equals(void.class) && Modifier.isPublic(method.getModif...
kaazing/gateway
mina.core/core/src/main/java/org/apache/mina/filter/executor/ExecutorFilter.java
ExecutorFilter.filterClose
@Override public final void filterClose(NextFilter nextFilter, IoSession session) throws Exception { if (eventTypes.contains(IoEventType.CLOSE)) { IoFilterEvent event = new IoFilterEvent(nextFilter, IoEventType.CLOSE, session, null); fireEvent(event); ...
java
@Override public final void filterClose(NextFilter nextFilter, IoSession session) throws Exception { if (eventTypes.contains(IoEventType.CLOSE)) { IoFilterEvent event = new IoFilterEvent(nextFilter, IoEventType.CLOSE, session, null); fireEvent(event); ...
[ "@", "Override", "public", "final", "void", "filterClose", "(", "NextFilter", "nextFilter", ",", "IoSession", "session", ")", "throws", "Exception", "{", "if", "(", "eventTypes", ".", "contains", "(", "IoEventType", ".", "CLOSE", ")", ")", "{", "IoFilterEvent"...
{@inheritDoc}
[ "{" ]
06017b19273109b3b992e528e702586446168d57
https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/filter/executor/ExecutorFilter.java#L709-L719
train
Filter close.
Create a Java method that does the following: "Filter close.".
Of course, here is the Java code you requested: ```java @Override public final void filterClose(NextFilter nextFilter, IoSession session) throws Exception { if (eventTypes.contains(IoEventType.CLOSE)) { IoFilterEvent event = new IoFilterEvent(nextFilter, IoEventType.CLOSE, session, ...
meridor/perspective-backend
perspective-sql/src/main/java/org/meridor/perspective/sql/impl/parser/QueryParserImpl.java
QueryParserImpl.exitSelect_clause
@Override public void exitSelect_clause(SQLParser.Select_clauseContext ctx) { this.queryType = QueryType.SELECT; selectClauseContext = ctx; }
java
@Override public void exitSelect_clause(SQLParser.Select_clauseContext ctx) { this.queryType = QueryType.SELECT; selectClauseContext = ctx; }
[ "@", "Override", "public", "void", "exitSelect_clause", "(", "SQLParser", ".", "Select_clauseContext", "ctx", ")", "{", "this", ".", "queryType", "=", "QueryType", ".", "SELECT", ";", "selectClauseContext", "=", "ctx", ";", "}" ]
Select query
[ "Select", "query" ]
5f98083977a57115988678e97d1642ee83431258
https://github.com/meridor/perspective-backend/blob/5f98083977a57115988678e97d1642ee83431258/perspective-sql/src/main/java/org/meridor/perspective/sql/impl/parser/QueryParserImpl.java#L132-L136
train
Called when a SELECT clause is encountered.
Create a Java method that does the following: "Called when a SELECT clause is encountered.".
Of course, here is the Java code you requested: ```java @Override public void exitSelect_clause(SQLParser.Select_clauseContext ctx) { this.queryType = QueryType.SELECT; selectClauseContext = ctx; } ``` Hope this helps!
playn/playn
core/src/playn/core/json/JsonArray.java
JsonArray.get
Object get(int key) { return (key >= 0 && key < list.size()) ? list.get(key) : null; }
java
Object get(int key) { return (key >= 0 && key < list.size()) ? list.get(key) : null; }
[ "Object", "get", "(", "int", "key", ")", "{", "return", "(", "key", ">=", "0", "&&", "key", "<", "list", ".", "size", "(", ")", ")", "?", "list", ".", "get", "(", "key", ")", ":", "null", ";", "}" ]
Returns the underlying object at the given index, or null if it does not exist or is out of bounds (to match the HTML implementation).
[ "Returns", "the", "underlying", "object", "at", "the", "given", "index", "or", "null", "if", "it", "does", "not", "exist", "or", "is", "out", "of", "bounds", "(", "to", "match", "the", "HTML", "implementation", ")", "." ]
7e7a9d048ba6afe550dc0cdeaca3e1d5b0d01c66
https://github.com/playn/playn/blob/7e7a9d048ba6afe550dc0cdeaca3e1d5b0d01c66/core/src/playn/core/json/JsonArray.java#L280-L282
train
Get the value of the specified key.
Create a Java method that does the following: "Get the value of the specified key.".
Of course, here is the Java code you requested: ```java Object get(int key) { return (key >= 0 && key < list.size()) ? list.get(key) : null; } ``` Hope this helps!
jtrfp/javamod
src/main/java/de/quippy/mp3/decoder/OutputChannels.java
OutputChannels.fromInt
static public OutputChannels fromInt(int code) { switch (code) { case LEFT_CHANNEL: return LEFT; case RIGHT_CHANNEL: return RIGHT; case BOTH_CHANNELS: return BOTH; case DOWNMIX_CHANNELS: return DOWNMIX; default: throw new IllegalArgumentException("Invalid channel code: "+code); } }
java
static public OutputChannels fromInt(int code) { switch (code) { case LEFT_CHANNEL: return LEFT; case RIGHT_CHANNEL: return RIGHT; case BOTH_CHANNELS: return BOTH; case DOWNMIX_CHANNELS: return DOWNMIX; default: throw new IllegalArgumentException("Invalid channel code: "+code); } }
[ "static", "public", "OutputChannels", "fromInt", "(", "int", "code", ")", "{", "switch", "(", "code", ")", "{", "case", "LEFT_CHANNEL", ":", "return", "LEFT", ";", "case", "RIGHT_CHANNEL", ":", "return", "RIGHT", ";", "case", "BOTH_CHANNELS", ":", "return", ...
Creates an <code>OutputChannels</code> instance corresponding to the given channel code. @param code one of the OutputChannels channel code constants. @throws IllegalArgumentException if code is not a valid channel code.
[ "Creates", "an", "<code", ">", "OutputChannels<", "/", "code", ">", "instance", "corresponding", "to", "the", "given", "channel", "code", "." ]
cda4fe943a589dc49415f4413453e2eece72076a
https://github.com/jtrfp/javamod/blob/cda4fe943a589dc49415f4413453e2eece72076a/src/main/java/de/quippy/mp3/decoder/OutputChannels.java#L73-L88
train
Creates an OutputChannels object from the given channel code.
Create a Java method that does the following: "Creates an OutputChannels object from the given channel code.".
Of course, here is the Java code you requested: ```java static public OutputChannels fromInt(int code) { switch (code) { case LEFT_CHANNEL: return LEFT; case RIGHT_CHANNEL: return RIGHT; case BOTH_CHANNELS: return BOTH; case DOWNMIX_CHANNELS: return DOWNMIX; default: throw new IllegalArgu...
fcrepo3/fcrepo
fcrepo-server/src/main/java/org/fcrepo/server/management/FedoraAPIMImpl.java
FedoraAPIMImpl.export
@Override public byte[] export(String pid, String format, String context) { assertInitialized(); try { MessageContext ctx = FedoraAPIMImpl.this.context.getMessageContext(); StreamingOutput so = m_management.stream(ReadOnlyContext.getSoapContext(ctx), ...
java
@Override public byte[] export(String pid, String format, String context) { assertInitialized(); try { MessageContext ctx = FedoraAPIMImpl.this.context.getMessageContext(); StreamingOutput so = m_management.stream(ReadOnlyContext.getSoapContext(ctx), ...
[ "@", "Override", "public", "byte", "[", "]", "export", "(", "String", "pid", ",", "String", "format", ",", "String", "context", ")", "{", "assertInitialized", "(", ")", ";", "try", "{", "MessageContext", "ctx", "=", "FedoraAPIMImpl", ".", "this", ".", "c...
/* (non-Javadoc) @see org.fcrepo.server.management.FedoraAPIMMTOM#export(String pid ,)String format ,)String context )*
[ "/", "*", "(", "non", "-", "Javadoc", ")" ]
37df51b9b857fd12c6ab8269820d406c3c4ad774
https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-server/src/main/java/org/fcrepo/server/management/FedoraAPIMImpl.java#L157-L175
train
Export a single object to a byte array.
Create a Java method that does the following: "Export a single object to a byte array.".
Of course, here is the Java code you requested: ```java @Override public byte[] export(String pid, String format, String context) { assertInitialized(); try { MessageContext ctx = FedoraAPIMImpl.this.context.getMessageContext(); StreamingOutput so = m_man...
aws/aws-sdk-java
aws-java-sdk-ec2/src/main/java/com/amazonaws/services/ec2/model/DescribeVpcEndpointServicesResult.java
DescribeVpcEndpointServicesResult.setServiceNames
public void setServiceNames(java.util.Collection<String> serviceNames) { if (serviceNames == null) { this.serviceNames = null; return; } this.serviceNames = new com.amazonaws.internal.SdkInternalList<String>(serviceNames); }
java
public void setServiceNames(java.util.Collection<String> serviceNames) { if (serviceNames == null) { this.serviceNames = null; return; } this.serviceNames = new com.amazonaws.internal.SdkInternalList<String>(serviceNames); }
[ "public", "void", "setServiceNames", "(", "java", ".", "util", ".", "Collection", "<", "String", ">", "serviceNames", ")", "{", "if", "(", "serviceNames", "==", "null", ")", "{", "this", ".", "serviceNames", "=", "null", ";", "return", ";", "}", "this", ...
<p> A list of supported services. </p> @param serviceNames A list of supported services.
[ "<p", ">", "A", "list", "of", "supported", "services", ".", "<", "/", "p", ">" ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-ec2/src/main/java/com/amazonaws/services/ec2/model/DescribeVpcEndpointServicesResult.java#L72-L79
train
Sets the value serviceNames property.
Create a Java method that does the following: "Sets the value serviceNames property.".
Of course, here is the Java code you requested: ```java public void setServiceNames(java.util.Collection<String> serviceNames) { if (serviceNames == null) { this.serviceNames = null; return; } this.serviceNames = new com.amazonaws.internal.SdkInternalList<String>(servic...
facebookarchive/hadoop-20
src/contrib/benchmark/src/java/org/apache/hadoop/mapred/MapOutputCorrectness.java
MapOutputCorrectness.getPartitionStatic
public static int getPartitionStatic(LongWritable key, LongWritable value, int numPartitions) { return (int) (Math.abs(key.get()) % numPartitions); }
java
public static int getPartitionStatic(LongWritable key, LongWritable value, int numPartitions) { return (int) (Math.abs(key.get()) % numPartitions); }
[ "public", "static", "int", "getPartitionStatic", "(", "LongWritable", "key", ",", "LongWritable", "value", ",", "int", "numPartitions", ")", "{", "return", "(", "int", ")", "(", "Math", ".", "abs", "(", "key", ".", "get", "(", ")", ")", "%", "numPartitio...
Get a partition from the key only @param key Key to partition @param value Value (not used) @param numPartitions Number of partitions @return Destination partition
[ "Get", "a", "partition", "from", "the", "key", "only" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/benchmark/src/java/org/apache/hadoop/mapred/MapOutputCorrectness.java#L316-L319
train
Get the partition number from a key and value.
Create a Java method that does the following: "Get the partition number from a key and value.".
Of course, here is the Java code you requested: ```java public static int getPartitionStatic(LongWritable key, LongWritable value, int numPartitions) { return (int) (Math.abs(key.get()) % numPartitions); } ``` Hope this helps!
derari/cthul
xml/src/main/java/org/cthul/resolve/UriMappingResolver.java
UriMappingResolver.addResources
public UriMappingResolver addResources(String... resources) { if (resources.length % 2 == 1) { throw new IllegalArgumentException ("Expected even number of arguments"); } for (int i = 0; i < resources.length; i += 2) { addSchema(resources[i], res...
java
public UriMappingResolver addResources(String... resources) { if (resources.length % 2 == 1) { throw new IllegalArgumentException ("Expected even number of arguments"); } for (int i = 0; i < resources.length; i += 2) { addSchema(resources[i], res...
[ "public", "UriMappingResolver", "addResources", "(", "String", "...", "resources", ")", "{", "if", "(", "resources", ".", "length", "%", "2", "==", "1", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Expected even number of arguments\"", ")", ";", ...
Calls {@link #addResource(java.lang.String, java.lang.String)} with pairs taken from the argument array. @param resources array of uri-resource pairs @return this @throws IllegalArgumentException if length of resources is not even
[ "Calls", "{" ]
74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc
https://github.com/derari/cthul/blob/74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc/xml/src/main/java/org/cthul/resolve/UriMappingResolver.java#L98-L107
train
Adds the resources to the uri mapping resolver.
Create a Java method that does the following: "Adds the resources to the uri mapping resolver.".
Of course, here is the Java code you requested: ```java public UriMappingResolver addResources(String... resources) { if (resources.length % 2 == 1) { throw new IllegalArgumentException ("Expected even number of arguments"); } for (int i = 0; i < resources.l...
kiegroup/drools
drools-compiler/src/main/java/org/drools/compiler/rule/builder/dialect/java/parser/JavaParser.java
JavaParser.arguments
public final void arguments() throws RecognitionException { int arguments_StartIndex = input.index(); try { if ( state.backtracking>0 && alreadyParsedRule(input, 140) ) { return; } // src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1297:5: ( '(' ( expressionList )? ')' ) // src/main/r...
java
public final void arguments() throws RecognitionException { int arguments_StartIndex = input.index(); try { if ( state.backtracking>0 && alreadyParsedRule(input, 140) ) { return; } // src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1297:5: ( '(' ( expressionList )? ')' ) // src/main/r...
[ "public", "final", "void", "arguments", "(", ")", "throws", "RecognitionException", "{", "int", "arguments_StartIndex", "=", "input", ".", "index", "(", ")", ";", "try", "{", "if", "(", "state", ".", "backtracking", ">", "0", "&&", "alreadyParsedRule", "(", ...
src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1296:5: arguments : '(' ( expressionList )? ')' ;
[ "src", "/", "main", "/", "resources", "/", "org", "/", "drools", "/", "compiler", "/", "semantics", "/", "java", "/", "parser", "/", "Java", ".", "g", ":", "1296", ":", "5", ":", "arguments", ":", "(", "(", "expressionList", ")", "?", ")", ";" ]
22b0275d6dbe93070b8090948502cf46eda543c4
https://github.com/kiegroup/drools/blob/22b0275d6dbe93070b8090948502cf46eda543c4/drools-compiler/src/main/java/org/drools/compiler/rule/builder/dialect/java/parser/JavaParser.java#L12783-L12825
train
start of arguments
Create a Java method that does the following: "start of arguments".
Of course, here is the Java code you requested: ```java public final void arguments() throws RecognitionException { int arguments_StartIndex = input.index(); try { if ( state.backtracking>0 && alreadyParsedRule(input, 140) ) { return; } // src/main/resources/org/drools/compiler/semantics/java/parser/Java.g...
lucee/Lucee
core/src/main/java/lucee/runtime/reflection/Invoker.java
Invoker.callStaticMethod
public static Object callStaticMethod(Class staticClass, String methodName, Object[] values) throws PageException { if (values == null) values = new Object[0]; MethodParameterPair mp; try { mp = getMethodParameterPairIgnoreCase(staticClass, methodName, values); } catch (NoSuchMethodException e) { throw ...
java
public static Object callStaticMethod(Class staticClass, String methodName, Object[] values) throws PageException { if (values == null) values = new Object[0]; MethodParameterPair mp; try { mp = getMethodParameterPairIgnoreCase(staticClass, methodName, values); } catch (NoSuchMethodException e) { throw ...
[ "public", "static", "Object", "callStaticMethod", "(", "Class", "staticClass", ",", "String", "methodName", ",", "Object", "[", "]", "values", ")", "throws", "PageException", "{", "if", "(", "values", "==", "null", ")", "values", "=", "new", "Object", "[", ...
call of a static method of a Class @param staticClass class how contains method to invoke @param methodName method name to invoke @param values Arguments for the Method @return return value from method @throws PageException
[ "call", "of", "a", "static", "method", "of", "a", "Class" ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/reflection/Invoker.java#L409-L431
train
call a static method
Create a Java method that does the following: "call a static method".
Of course, here is the Java code you requested: ```java public static Object callStaticMethod(Class staticClass, String methodName, Object[] values) throws PageException { if (values == null) values = new Object[0]; MethodParameterPair mp; try { mp = getMethodParameterPairIgnoreCase(staticClass, methodName, v...
aws/aws-sdk-java
aws-java-sdk-ec2/src/main/java/com/amazonaws/services/ec2/model/ReservedInstancesListing.java
ReservedInstancesListing.withPriceSchedules
public ReservedInstancesListing withPriceSchedules(PriceSchedule... priceSchedules) { if (this.priceSchedules == null) { setPriceSchedules(new com.amazonaws.internal.SdkInternalList<PriceSchedule>(priceSchedules.length)); } for (PriceSchedule ele : priceSchedules) { this....
java
public ReservedInstancesListing withPriceSchedules(PriceSchedule... priceSchedules) { if (this.priceSchedules == null) { setPriceSchedules(new com.amazonaws.internal.SdkInternalList<PriceSchedule>(priceSchedules.length)); } for (PriceSchedule ele : priceSchedules) { this....
[ "public", "ReservedInstancesListing", "withPriceSchedules", "(", "PriceSchedule", "...", "priceSchedules", ")", "{", "if", "(", "this", ".", "priceSchedules", "==", "null", ")", "{", "setPriceSchedules", "(", "new", "com", ".", "amazonaws", ".", "internal", ".", ...
<p> The price of the Reserved Instance listing. </p> <p> <b>NOTE:</b> This method appends the values to the existing list (if any). Use {@link #setPriceSchedules(java.util.Collection)} or {@link #withPriceSchedules(java.util.Collection)} if you want to override the existing values. </p> @param priceSchedules The price...
[ "<p", ">", "The", "price", "of", "the", "Reserved", "Instance", "listing", ".", "<", "/", "p", ">", "<p", ">", "<b", ">", "NOTE", ":", "<", "/", "b", ">", "This", "method", "appends", "the", "values", "to", "the", "existing", "list", "(", "if", "...
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-ec2/src/main/java/com/amazonaws/services/ec2/model/ReservedInstancesListing.java#L312-L320
train
Adds the priceSchedules to the ReservedInstancesListing.
Create a Java method that does the following: "Adds the priceSchedules to the ReservedInstancesListing.".
Of course, here is the Java code you requested: ```java public ReservedInstancesListing withPriceSchedules(PriceSchedule... priceSchedules) { if (this.priceSchedules == null) { setPriceSchedules(new com.amazonaws.internal.SdkInternalList<PriceSchedule>(priceSchedules.length)); } for...
carewebframework/carewebframework-core
org.carewebframework.shell/src/main/java/org/carewebframework/shell/ancillary/RelatedClassMap.java
RelatedClassMap.getCardinalities
public Cardinalities getCardinalities(Class<? extends ElementBase> sourceClass) { Class<?> clazz = sourceClass; Cardinalities cardinalities = null; while (cardinalities == null && clazz != null) { cardinalities = map.get(clazz); clazz = clazz == ElementBase.class...
java
public Cardinalities getCardinalities(Class<? extends ElementBase> sourceClass) { Class<?> clazz = sourceClass; Cardinalities cardinalities = null; while (cardinalities == null && clazz != null) { cardinalities = map.get(clazz); clazz = clazz == ElementBase.class...
[ "public", "Cardinalities", "getCardinalities", "(", "Class", "<", "?", "extends", "ElementBase", ">", "sourceClass", ")", "{", "Class", "<", "?", ">", "clazz", "=", "sourceClass", ";", "Cardinalities", "cardinalities", "=", "null", ";", "while", "(", "cardinal...
Returns the cardinalities associated with this class or a superclass. @param sourceClass Class whose relation is sought. @return The cardinalities, or null if none found.
[ "Returns", "the", "cardinalities", "associated", "with", "this", "class", "or", "a", "superclass", "." ]
fa3252d4f7541dbe151b92c3d4f6f91433cd1673
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.shell/src/main/java/org/carewebframework/shell/ancillary/RelatedClassMap.java#L116-L126
train
Get the cardinalities for a class.
Create a Java method that does the following: "Get the cardinalities for a class.".
Of course, here is the Java code you requested: ```java public Cardinalities getCardinalities(Class<? extends ElementBase> sourceClass) { Class<?> clazz = sourceClass; Cardinalities cardinalities = null; while (cardinalities == null && clazz != null) { cardinalities = map.g...
roboconf/roboconf-platform
miscellaneous/roboconf-doc-generator/src/main/java/net/roboconf/doc/generator/internal/AbstractStructuredRenderer.java
AbstractStructuredRenderer.renderRecipe
private void renderRecipe() throws IOException { StringBuilder sb = new StringBuilder(); // First pages if( ! Constants.GENERATED.equalsIgnoreCase( this.applicationTemplate.getName())) { sb.append( renderDocumentTitle()); sb.append( renderPageBreak()); sb.append( renderParagraph( this.messages.get( "in...
java
private void renderRecipe() throws IOException { StringBuilder sb = new StringBuilder(); // First pages if( ! Constants.GENERATED.equalsIgnoreCase( this.applicationTemplate.getName())) { sb.append( renderDocumentTitle()); sb.append( renderPageBreak()); sb.append( renderParagraph( this.messages.get( "in...
[ "private", "void", "renderRecipe", "(", ")", "throws", "IOException", "{", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", ")", ";", "// First pages", "if", "(", "!", "Constants", ".", "GENERATED", ".", "equalsIgnoreCase", "(", "this", ".", "applicati...
Renders a recipe. @throws IOException
[ "Renders", "a", "recipe", "." ]
add54eead479effb138d0ff53a2d637902b82702
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/miscellaneous/roboconf-doc-generator/src/main/java/net/roboconf/doc/generator/internal/AbstractStructuredRenderer.java#L167-L202
train
Renders the recipe.
Create a Java method that does the following: "Renders the recipe.".
Of course, here is the Java code you requested: ```java private void renderRecipe() throws IOException { StringBuilder sb = new StringBuilder(); // First pages if( ! Constants.GENERATED.equalsIgnoreCase( this.applicationTemplate.getName())) { sb.append( renderDocumentTitle()); sb.append( renderPageBreak()...
DDTH/ddth-queue
ddth-queue-core/src/main/java/com/github/ddth/queue/impl/MongodbQueue.java
MongodbQueue.initCollection
protected void initCollection() { boolean collectionExists = MongoUtils.collectionExists(getDatabase(), getCollectionName()); if (!collectionExists) { LOGGER.info("Creating collection [" + getCollectionName() + "]..."); getDatabase().createCollection(getCollectionName()); ...
java
protected void initCollection() { boolean collectionExists = MongoUtils.collectionExists(getDatabase(), getCollectionName()); if (!collectionExists) { LOGGER.info("Creating collection [" + getCollectionName() + "]..."); getDatabase().createCollection(getCollectionName()); ...
[ "protected", "void", "initCollection", "(", ")", "{", "boolean", "collectionExists", "=", "MongoUtils", ".", "collectionExists", "(", "getDatabase", "(", ")", ",", "getCollectionName", "(", ")", ")", ";", "if", "(", "!", "collectionExists", ")", "{", "LOGGER",...
Initialize collection: <ul> <li>Check if collection exists.</li> <li>If collection does not exist, create collection and indexes.</li> </ul>
[ "Initialize", "collection", ":" ]
b20776850d23111d3d71fc8ed6023c590bc3621f
https://github.com/DDTH/ddth-queue/blob/b20776850d23111d3d71fc8ed6023c590bc3621f/ddth-queue-core/src/main/java/com/github/ddth/queue/impl/MongodbQueue.java#L185-L215
train
Initialize the collection.
Create a Java method that does the following: "Initialize the collection.".
Of course, here is the Java code you requested: ```java protected void initCollection() { boolean collectionExists = MongoUtils.collectionExists(getDatabase(), getCollectionName()); if (!collectionExists) { LOGGER.info("Creating collection [" + getCollectionName() + "]..."); get...
kuujo/vertigo
core/src/main/java/net/kuujo/vertigo/network/manager/NetworkManager.java
NetworkManager.unwatchInstance
private void unwatchInstance(final InstanceContext instance, final CountingCompletionHandler<Void> counter) { Handler<MapEvent<String, String>> watchHandler = watchHandlers.remove(instance.address()); if (watchHandler != null) { data.unwatch(instance.status(), watchHandler, new Handler<AsyncResult<Void>>(...
java
private void unwatchInstance(final InstanceContext instance, final CountingCompletionHandler<Void> counter) { Handler<MapEvent<String, String>> watchHandler = watchHandlers.remove(instance.address()); if (watchHandler != null) { data.unwatch(instance.status(), watchHandler, new Handler<AsyncResult<Void>>(...
[ "private", "void", "unwatchInstance", "(", "final", "InstanceContext", "instance", ",", "final", "CountingCompletionHandler", "<", "Void", ">", "counter", ")", "{", "Handler", "<", "MapEvent", "<", "String", ",", "String", ">", ">", "watchHandler", "=", "watchHa...
Unwatches a component instance's status and context.
[ "Unwatches", "a", "component", "instance", "s", "status", "and", "context", "." ]
c5869dbc5fff89eb5262e83f7a81719b01a5ba6f
https://github.com/kuujo/vertigo/blob/c5869dbc5fff89eb5262e83f7a81719b01a5ba6f/core/src/main/java/net/kuujo/vertigo/network/manager/NetworkManager.java#L984-L1014
train
Unwatch a single instance.
Create a Java method that does the following: "Unwatch a single instance.".
Of course, here is the Java code you requested: ```java private void unwatchInstance(final InstanceContext instance, final CountingCompletionHandler<Void> counter) { Handler<MapEvent<String, String>> watchHandler = watchHandlers.remove(instance.address()); if (watchHandler != null) { data.unwatch(instanc...
yan74/afplib
org.afplib/src/main/java/org/afplib/afplib/impl/ObjectOriginIdentifierImpl.java
ObjectOriginIdentifierImpl.setDSID
public void setDSID(byte[] newDSID) { byte[] oldDSID = dsid; dsid = newDSID; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, AfplibPackage.OBJECT_ORIGIN_IDENTIFIER__DSID, oldDSID, dsid)); }
java
public void setDSID(byte[] newDSID) { byte[] oldDSID = dsid; dsid = newDSID; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, AfplibPackage.OBJECT_ORIGIN_IDENTIFIER__DSID, oldDSID, dsid)); }
[ "public", "void", "setDSID", "(", "byte", "[", "]", "newDSID", ")", "{", "byte", "[", "]", "oldDSID", "=", "dsid", ";", "dsid", "=", "newDSID", ";", "if", "(", "eNotificationRequired", "(", ")", ")", "eNotify", "(", "new", "ENotificationImpl", "(", "th...
<!-- 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/ObjectOriginIdentifierImpl.java#L209-L214
train
Sets the DSID value.
Create a Java method that does the following: "Sets the DSID value.".
Of course, here is the Java code you requested: ```java public void setDSID(byte[] newDSID) { byte[] oldDSID = dsid; dsid = newDSID; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, AfplibPackage.OBJECT_ORIGIN_IDENTIFIER__DSID, oldDSID, dsid)); } ``` Hope this helps!
OpenLiberty/open-liberty
dev/com.ibm.ws.jaxws.webcontainer/src/com/ibm/ws/jaxws/webcontainer/JaxWsHttpServletRequestAdapter.java
JaxWsHttpServletRequestAdapter.getAsyncContext
@Override public AsyncContext getAsyncContext() { try { collaborator.preInvoke(componentMetaData); return request.getAsyncContext(); } finally { collaborator.postInvoke(); } }
java
@Override public AsyncContext getAsyncContext() { try { collaborator.preInvoke(componentMetaData); return request.getAsyncContext(); } finally { collaborator.postInvoke(); } }
[ "@", "Override", "public", "AsyncContext", "getAsyncContext", "(", ")", "{", "try", "{", "collaborator", ".", "preInvoke", "(", "componentMetaData", ")", ";", "return", "request", ".", "getAsyncContext", "(", ")", ";", "}", "finally", "{", "collaborator", ".",...
/* (non-Javadoc) @see javax.servlet.ServletRequest#getAsyncContext()
[ "/", "*", "(", "non", "-", "Javadoc", ")" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jaxws.webcontainer/src/com/ibm/ws/jaxws/webcontainer/JaxWsHttpServletRequestAdapter.java#L86-L94
train
Get the AsyncContext for the request.
Create a Java method that does the following: "Get the AsyncContext for the request.".
Of course, here is the Java code you requested: ```java @Override public AsyncContext getAsyncContext() { try { collaborator.preInvoke(componentMetaData); return request.getAsyncContext(); } finally { collaborator.postInvoke(); } } ``` Hope this help...
banq/jdonframework
src/main/java/com/jdon/util/UtilValidate.java
UtilValidate.isNonnegativeInteger
public static boolean isNonnegativeInteger(String s) { if (isEmpty(s)) return defaultEmptyOK; try { int temp = Integer.parseInt(s); if (temp >= 0) return true; return false; } catch (Exception e) { return false; } // ...
java
public static boolean isNonnegativeInteger(String s) { if (isEmpty(s)) return defaultEmptyOK; try { int temp = Integer.parseInt(s); if (temp >= 0) return true; return false; } catch (Exception e) { return false; } // ...
[ "public", "static", "boolean", "isNonnegativeInteger", "(", "String", "s", ")", "{", "if", "(", "isEmpty", "(", "s", ")", ")", "return", "defaultEmptyOK", ";", "try", "{", "int", "temp", "=", "Integer", ".", "parseInt", "(", "s", ")", ";", "if", "(", ...
Returns true if string s is an integer >= 0.
[ "Returns", "true", "if", "string", "s", "is", "an", "integer", ">", "=", "0", "." ]
72b451caac04f775e57f52aaed3d8775044ead53
https://github.com/banq/jdonframework/blob/72b451caac04f775e57f52aaed3d8775044ead53/src/main/java/com/jdon/util/UtilValidate.java#L383-L397
train
Checks if the string s is a nonnegative integer.
Create a Java method that does the following: "Checks if the string s is a nonnegative integer.".
Of course, here is the Java code you requested: ```java public static boolean isNonnegativeInteger(String s) { if (isEmpty(s)) return defaultEmptyOK; try { int temp = Integer.parseInt(s); if (temp >= 0) return true; return false; } catch (Exception ...
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/index/IndexGenerator.java
IndexGenerator.generate
public void generate() throws WikiApiException { Indexer data = null; try { data = new Indexer(config); System.out.println("GENERATING INDEX STARTED"); long bufferSize = config.getBufferSize(); Revision rev; long count = 0; long last = 0, now, start = System.currentTimeMillis(); Iterator<...
java
public void generate() throws WikiApiException { Indexer data = null; try { data = new Indexer(config); System.out.println("GENERATING INDEX STARTED"); long bufferSize = config.getBufferSize(); Revision rev; long count = 0; long last = 0, now, start = System.currentTimeMillis(); Iterator<...
[ "public", "void", "generate", "(", ")", "throws", "WikiApiException", "{", "Indexer", "data", "=", "null", ";", "try", "{", "data", "=", "new", "Indexer", "(", "config", ")", ";", "System", ".", "out", ".", "println", "(", "\"GENERATING INDEX STARTED\"", "...
Starts the generation of the indices. @throws WikiApiException if an error occurs
[ "Starts", "the", "generation", "of", "the", "indices", "." ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/index/IndexGenerator.java#L62-L104
train
Generates the index.
Create a Java method that does the following: "Generates the index.".
Of course, here is the Java code you requested: ```java public void generate() throws WikiApiException { Indexer data = null; try { data = new Indexer(config); System.out.println("GENERATING INDEX STARTED"); long bufferSize = config.getBufferSize(); Revision rev; long count = 0; long last = ...
albfernandez/itext2
src/main/java/com/lowagie/text/pdf/TrueTypeFontUnicode.java
TrueTypeFontUnicode.writeFont
void writeFont(PdfWriter writer, PdfIndirectReference ref, Object params[]) throws DocumentException, IOException { HashMap longTag = (HashMap)params[0]; addRangeUni(longTag, true, subset); Object metrics[] = longTag.values().toArray(); Arrays.sort(metrics, this); PdfIndirectRefe...
java
void writeFont(PdfWriter writer, PdfIndirectReference ref, Object params[]) throws DocumentException, IOException { HashMap longTag = (HashMap)params[0]; addRangeUni(longTag, true, subset); Object metrics[] = longTag.values().toArray(); Arrays.sort(metrics, this); PdfIndirectRefe...
[ "void", "writeFont", "(", "PdfWriter", "writer", ",", "PdfIndirectReference", "ref", ",", "Object", "params", "[", "]", ")", "throws", "DocumentException", ",", "IOException", "{", "HashMap", "longTag", "=", "(", "HashMap", ")", "params", "[", "0", "]", ";",...
Outputs to the writer the font dictionaries and streams. @param writer the writer for this document @param ref the font indirect reference @param params several parameters that depend on the font type @throws IOException on error @throws DocumentException error in generating the object
[ "Outputs", "to", "the", "writer", "the", "font", "dictionaries", "and", "streams", "." ]
438fc1899367fd13dfdfa8dfdca9a3c1a7783b84
https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/TrueTypeFontUnicode.java#L397-L468
train
Write a font to the document.
Create a Java method that does the following: "Write a font to the document.".
Of course, here is the Java code you requested: ```java void writeFont(PdfWriter writer, PdfIndirectReference ref, Object params[]) throws DocumentException, IOException { HashMap longTag = (HashMap)params[0]; addRangeUni(longTag, true, subset); Object metrics[] = longTag.values().toArray(); ...
androiddevelop/CommonBase
src/main/java/me/codeboy/common/base/util/CBStringUtil.java
CBStringUtil.containStatistics
public static int containStatistics(String srcString, String desString) { int length = desString.length(); String newString = srcString.replace(desString, ""); return (srcString.length() - newString.length()) / length; }
java
public static int containStatistics(String srcString, String desString) { int length = desString.length(); String newString = srcString.replace(desString, ""); return (srcString.length() - newString.length()) / length; }
[ "public", "static", "int", "containStatistics", "(", "String", "srcString", ",", "String", "desString", ")", "{", "int", "length", "=", "desString", ".", "length", "(", ")", ";", "String", "newString", "=", "srcString", ".", "replace", "(", "desString", ",",...
含子串的次数 @param srcString 原串 @param desString 目标子串 @return 次数
[ "含子串的次数" ]
9528eb3a040177596a3f131fa958a94c63614fc4
https://github.com/androiddevelop/CommonBase/blob/9528eb3a040177596a3f131fa958a94c63614fc4/src/main/java/me/codeboy/common/base/util/CBStringUtil.java#L105-L109
valid
Returns the number of times a string contains statistics.
Create a Java method that does the following: "Returns the number of times a string contains statistics.".
Of course, here is the Java code you requested: ```java public static int containStatistics(String srcString, String desString) { int length = desString.length(); String newString = srcString.replace(desString, ""); return (srcString.length() - newString.length()) / length; } ``` Hope this...
apache/groovy
src/main/java/org/codehaus/groovy/runtime/IOGroovyMethods.java
IOGroovyMethods.newWriter
public static Writer newWriter(OutputStream stream, String charset) throws UnsupportedEncodingException { return new OutputStreamWriter(stream, charset); }
java
public static Writer newWriter(OutputStream stream, String charset) throws UnsupportedEncodingException { return new OutputStreamWriter(stream, charset); }
[ "public", "static", "Writer", "newWriter", "(", "OutputStream", "stream", ",", "String", "charset", ")", "throws", "UnsupportedEncodingException", "{", "return", "new", "OutputStreamWriter", "(", "stream", ",", "charset", ")", ";", "}" ]
Creates a writer for this stream using the given charset. @param stream the stream which is used and then closed @param charset the charset used @return the newly created Writer @throws UnsupportedEncodingException if an encoding exception occurs. @since 2.2.0
[ "Creates", "a", "writer", "for", "this", "stream", "using", "the", "given", "charset", "." ]
71cf20addb611bb8d097a59e395fd20bc7f31772
https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/IOGroovyMethods.java#L1281-L1283
train
Create a new writer for the given stream using the specified encoding.
Create a Java method that does the following: "Create a new writer for the given stream using the specified encoding.".
Of course, here is the Java code you requested: ```java public static Writer newWriter(OutputStream stream, String charset) throws UnsupportedEncodingException { return new OutputStreamWriter(stream, charset); } ``` Hope this helps!
alkacon/opencms-core
src-gwt/org/opencms/ade/sitemap/client/alias/CmsImportView.java
CmsImportView.onClickSubmit
@UiHandler("m_submitButton") public void onClickSubmit(ClickEvent event) { String separator = ","; String selectedValue = m_separator.getText().trim(); if (!CmsStringUtil.isEmptyOrWhitespaceOnly(selectedValue)) { separator = selectedValue; } m_separatorFi...
java
@UiHandler("m_submitButton") public void onClickSubmit(ClickEvent event) { String separator = ","; String selectedValue = m_separator.getText().trim(); if (!CmsStringUtil.isEmptyOrWhitespaceOnly(selectedValue)) { separator = selectedValue; } m_separatorFi...
[ "@", "UiHandler", "(", "\"m_submitButton\"", ")", "public", "void", "onClickSubmit", "(", "ClickEvent", "event", ")", "{", "String", "separator", "=", "\",\"", ";", "String", "selectedValue", "=", "m_separator", ".", "getText", "(", ")", ".", "trim", "(", ")...
The event handler for the submit button.<p> @param event the click event
[ "The", "event", "handler", "for", "the", "submit", "button", ".", "<p", ">" ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/sitemap/client/alias/CmsImportView.java#L187-L197
train
Click event handler for submit button.
Create a Java method that does the following: "Click event handler for submit button.".
Of course, here is the Java code you requested: ```java @UiHandler("m_submitButton") public void onClickSubmit(ClickEvent event) { String separator = ","; String selectedValue = m_separator.getText().trim(); if (!CmsStringUtil.isEmptyOrWhitespaceOnly(selectedValue)) { sep...
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/cache/impl/journal/RingbufferCacheEventJournalImpl.java
RingbufferCacheEventJournalImpl.getRingbufferOrFail
private RingbufferContainer<InternalEventJournalCacheEvent, Object> getRingbufferOrFail(ObjectNamespace namespace, int partitionId) { RingbufferService ringbufferService = getRingbufferService(); RingbufferContai...
java
private RingbufferContainer<InternalEventJournalCacheEvent, Object> getRingbufferOrFail(ObjectNamespace namespace, int partitionId) { RingbufferService ringbufferService = getRingbufferService(); RingbufferContai...
[ "private", "RingbufferContainer", "<", "InternalEventJournalCacheEvent", ",", "Object", ">", "getRingbufferOrFail", "(", "ObjectNamespace", "namespace", ",", "int", "partitionId", ")", "{", "RingbufferService", "ringbufferService", "=", "getRingbufferService", "(", ")", "...
Gets or creates a ringbuffer for an event journal or throws an exception if no event journal is configured. The caller should call {@link #hasEventJournal(ObjectNamespace)} before invoking this method to avoid getting the exception. This method can be used to get the ringbuffer on which future events will be added once...
[ "Gets", "or", "creates", "a", "ringbuffer", "for", "an", "event", "journal", "or", "throws", "an", "exception", "if", "no", "event", "journal", "is", "configured", ".", "The", "caller", "should", "call", "{", "@link", "#hasEventJournal", "(", "ObjectNamespace"...
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/cache/impl/journal/RingbufferCacheEventJournalImpl.java#L242-L258
train
Gets the Ringbuffer container or creates it if it does not exist.
Create a Java method that does the following: "Gets the Ringbuffer container or creates it if it does not exist.".
Of course, here is the Java code you requested: ```java private RingbufferContainer<InternalEventJournalCacheEvent, Object> getRingbufferOrFail(ObjectNamespace namespace, int partitionId) { RingbufferService ringbufferS...
apache/flink
flink-connectors/flink-orc/src/main/java/org/apache/flink/orc/OrcBatchReader.java
OrcBatchReader.fillRows
static int fillRows(Row[] rows, TypeDescription schema, VectorizedRowBatch batch, int[] selectedFields) { int rowsToRead = Math.min((int) batch.count(), rows.length); List<TypeDescription> fieldTypes = schema.getChildren(); // read each selected field for (int fieldIdx = 0; fieldIdx < selectedFields.length; f...
java
static int fillRows(Row[] rows, TypeDescription schema, VectorizedRowBatch batch, int[] selectedFields) { int rowsToRead = Math.min((int) batch.count(), rows.length); List<TypeDescription> fieldTypes = schema.getChildren(); // read each selected field for (int fieldIdx = 0; fieldIdx < selectedFields.length; f...
[ "static", "int", "fillRows", "(", "Row", "[", "]", "rows", ",", "TypeDescription", "schema", ",", "VectorizedRowBatch", "batch", ",", "int", "[", "]", "selectedFields", ")", "{", "int", "rowsToRead", "=", "Math", ".", "min", "(", "(", "int", ")", "batch"...
Fills an ORC batch into an array of Row. @param rows The batch of rows need to be filled. @param schema The schema of the ORC data. @param batch The ORC data. @param selectedFields The list of selected ORC fields. @return The number of rows that were filled.
[ "Fills", "an", "ORC", "batch", "into", "an", "array", "of", "Row", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-orc/src/main/java/org/apache/flink/orc/OrcBatchReader.java#L135-L146
train
Fill rows with the rows from the given batch.
Create a Java method that does the following: "Fill rows with the rows from the given batch.".
Of course, here is the Java code you requested: ```java static int fillRows(Row[] rows, TypeDescription schema, VectorizedRowBatch batch, int[] selectedFields) { int rowsToRead = Math.min((int) batch.count(), rows.length); List<TypeDescription> fieldTypes = schema.getChildren(); // read each selected field f...
baratine/baratine
web/src/main/java/com/caucho/v5/http/protocol/RequestHttpBase.java
RequestHttpBase.addHeaderOutImpl
public void addHeaderOutImpl(String key, String value) { if (headerOutSpecial(key, value)) { return; } ArrayList<String> keys = _headerKeysOut; ArrayList<String> values = _headerValuesOut; int size = keys.size(); // webapp/1k32 for (int i = 0; i < size; i++) { if...
java
public void addHeaderOutImpl(String key, String value) { if (headerOutSpecial(key, value)) { return; } ArrayList<String> keys = _headerKeysOut; ArrayList<String> values = _headerValuesOut; int size = keys.size(); // webapp/1k32 for (int i = 0; i < size; i++) { if...
[ "public", "void", "addHeaderOutImpl", "(", "String", "key", ",", "String", "value", ")", "{", "if", "(", "headerOutSpecial", "(", "key", ",", "value", ")", ")", "{", "return", ";", "}", "ArrayList", "<", "String", ">", "keys", "=", "_headerKeysOut", ";",...
Adds a new header. If an old header with that name exists, both headers are output. @param key the header key. @param value the header value.
[ "Adds", "a", "new", "header", ".", "If", "an", "old", "header", "with", "that", "name", "exists", "both", "headers", "are", "output", "." ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/web/src/main/java/com/caucho/v5/http/protocol/RequestHttpBase.java#L1928-L1948
train
Add a header out.
Create a Java method that does the following: "Add a header out.".
Of course, here is the Java code you requested: ```java public void addHeaderOutImpl(String key, String value) { if (headerOutSpecial(key, value)) { return; } ArrayList<String> keys = _headerKeysOut; ArrayList<String> values = _headerValuesOut; int size = keys.size(); // ...
alkacon/opencms-core
src/org/opencms/ui/apps/lists/daterestrictions/CmsDateRestrictionParser.java
CmsDateRestrictionParser.parseDirection
private I_CmsListDateRestriction.TimeDirection parseDirection(CmsXmlContentValueLocation location) { try { return TimeDirection.valueOf(location.getValue().getStringValue(m_cms)); } catch (Exception e) { return null; } }
java
private I_CmsListDateRestriction.TimeDirection parseDirection(CmsXmlContentValueLocation location) { try { return TimeDirection.valueOf(location.getValue().getStringValue(m_cms)); } catch (Exception e) { return null; } }
[ "private", "I_CmsListDateRestriction", ".", "TimeDirection", "parseDirection", "(", "CmsXmlContentValueLocation", "location", ")", "{", "try", "{", "return", "TimeDirection", ".", "valueOf", "(", "location", ".", "getValue", "(", ")", ".", "getStringValue", "(", "m_...
Parses a time direction.<p> @param location the location of the time direction @return the time direction, or null if it could not be parsed
[ "Parses", "a", "time", "direction", ".", "<p", ">" ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/apps/lists/daterestrictions/CmsDateRestrictionParser.java#L138-L145
train
Parses the direction.
Create a Java method that does the following: "Parses the direction.".
Of course, here is the Java code you requested: ```java private I_CmsListDateRestriction.TimeDirection parseDirection(CmsXmlContentValueLocation location) { try { return TimeDirection.valueOf(location.getValue().getStringValue(m_cms)); } catch (Exception e) { return null; ...
ocelotds/ocelot
ocelot-processor/src/main/java/org/ocelotds/FileWriterServices.java
FileWriterServices.getFileObjectWriter
public Writer getFileObjectWriter(String path, String filename) throws IOException { File dir = new File(path); if (!dir.exists()) { dir.mkdirs(); } return new FileWriter(new File(dir, filename)); }
java
public Writer getFileObjectWriter(String path, String filename) throws IOException { File dir = new File(path); if (!dir.exists()) { dir.mkdirs(); } return new FileWriter(new File(dir, filename)); }
[ "public", "Writer", "getFileObjectWriter", "(", "String", "path", ",", "String", "filename", ")", "throws", "IOException", "{", "File", "dir", "=", "new", "File", "(", "path", ")", ";", "if", "(", "!", "dir", ".", "exists", "(", ")", ")", "{", "dir", ...
Create writer from file path/filename @param path @param filename @return @throws IOException
[ "Create", "writer", "from", "file", "path", "/", "filename" ]
5f0ac37afd8fa4dc9f7234a2aac8abbb522128e7
https://github.com/ocelotds/ocelot/blob/5f0ac37afd8fa4dc9f7234a2aac8abbb522128e7/ocelot-processor/src/main/java/org/ocelotds/FileWriterServices.java#L87-L93
train
Get a file object writer.
Create a Java method that does the following: "Get a file object writer.".
Of course, here is the Java code you requested: ```java public Writer getFileObjectWriter(String path, String filename) throws IOException { File dir = new File(path); if (!dir.exists()) { dir.mkdirs(); } return new FileWriter(new File(dir, filename)); } ``` Hope this helps!
jbundle/jbundle
main/msg/src/main/java/org/jbundle/main/msg/db/MessageProcessInfoField.java
MessageProcessInfoField.setupDefaultView
public ScreenComponent setupDefaultView(ScreenLoc itsLocation, ComponentParent targetScreen, Convert converter, int iDisplayFieldDesc, Map<String, Object> properties) { return this.setupTableLookup(itsLocation, targetScreen, iDisplayFieldDesc, this.makeReferenceRecord(), null, MessageProcessInfo.DESCRIPTION...
java
public ScreenComponent setupDefaultView(ScreenLoc itsLocation, ComponentParent targetScreen, Convert converter, int iDisplayFieldDesc, Map<String, Object> properties) { return this.setupTableLookup(itsLocation, targetScreen, iDisplayFieldDesc, this.makeReferenceRecord(), null, MessageProcessInfo.DESCRIPTION...
[ "public", "ScreenComponent", "setupDefaultView", "(", "ScreenLoc", "itsLocation", ",", "ComponentParent", "targetScreen", ",", "Convert", "converter", ",", "int", "iDisplayFieldDesc", ",", "Map", "<", "String", ",", "Object", ">", "properties", ")", "{", "return", ...
Set up the default screen control for this field. @param itsLocation Location of this component on screen (ie., GridBagConstraint). @param targetScreen Where to place this component (ie., Parent screen or GridBagLayout). @param converter The converter to set the screenfield to. @param iDisplayFieldDesc Display the labe...
[ "Set", "up", "the", "default", "screen", "control", "for", "this", "field", "." ]
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/main/msg/src/main/java/org/jbundle/main/msg/db/MessageProcessInfoField.java#L79-L82
train
Set up the default screen.
Create a Java method that does the following: "Set up the default screen.".
Of course, here is the Java code you requested: ```java public ScreenComponent setupDefaultView(ScreenLoc itsLocation, ComponentParent targetScreen, Convert converter, int iDisplayFieldDesc, Map<String, Object> properties) { return this.setupTableLookup(itsLocation, targetScreen, iDisplayFieldDesc, this.ma...
Carbonado/Carbonado
src/main/java/com/amazon/carbonado/filter/Filter.java
Filter.initialFilterValues
public FilterValues<S> initialFilterValues() { FilterValues<S> filterValues = mFilterValues; if (filterValues == null) { buildFilterValues(); filterValues = mFilterValues; } return filterValues; }
java
public FilterValues<S> initialFilterValues() { FilterValues<S> filterValues = mFilterValues; if (filterValues == null) { buildFilterValues(); filterValues = mFilterValues; } return filterValues; }
[ "public", "FilterValues", "<", "S", ">", "initialFilterValues", "(", ")", "{", "FilterValues", "<", "S", ">", "filterValues", "=", "mFilterValues", ";", "if", "(", "filterValues", "==", "null", ")", "{", "buildFilterValues", "(", ")", ";", "filterValues", "=...
Returns a FilterValues instance for assigning values to a Filter. Returns null if Filter has no parameters. <p>Note: The returned FilterValues instance may reference a different filter instance than this one. Call getFilter to retrieve it. The difference is caused by the filter property values being {@link #bind bound...
[ "Returns", "a", "FilterValues", "instance", "for", "assigning", "values", "to", "a", "Filter", ".", "Returns", "null", "if", "Filter", "has", "no", "parameters", "." ]
eee29b365a61c8f03e1a1dc6bed0692e6b04b1db
https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/filter/Filter.java#L190-L197
train
Returns the initial filter values.
Create a Java method that does the following: "Returns the initial filter values.".
Of course, here is the Java code you requested: ```java public FilterValues<S> initialFilterValues() { FilterValues<S> filterValues = mFilterValues; if (filterValues == null) { buildFilterValues(); filterValues = mFilterValues; } return filterValues; }...
alkacon/opencms-core
src/org/opencms/relations/CmsRelationFilter.java
CmsRelationFilter.filterUserDefined
public CmsRelationFilter filterUserDefined() { CmsRelationFilter filter = (CmsRelationFilter)clone(); if (filter.m_types.isEmpty()) { filter.m_types.addAll(CmsRelationType.getAllUserDefined()); } else { filter.m_types = new HashSet<CmsRelationType>(CmsRelationType.filter...
java
public CmsRelationFilter filterUserDefined() { CmsRelationFilter filter = (CmsRelationFilter)clone(); if (filter.m_types.isEmpty()) { filter.m_types.addAll(CmsRelationType.getAllUserDefined()); } else { filter.m_types = new HashSet<CmsRelationType>(CmsRelationType.filter...
[ "public", "CmsRelationFilter", "filterUserDefined", "(", ")", "{", "CmsRelationFilter", "filter", "=", "(", "CmsRelationFilter", ")", "clone", "(", ")", ";", "if", "(", "filter", ".", "m_types", ".", "isEmpty", "(", ")", ")", "{", "filter", ".", "m_types", ...
Returns an extended filter with user defined type restriction.<p> @return an extended filter with user defined type restriction
[ "Returns", "an", "extended", "filter", "with", "user", "defined", "type", "restriction", ".", "<p", ">" ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/relations/CmsRelationFilter.java#L259-L268
train
Returns a clone of this filter with all user defined relations.
Create a Java method that does the following: "Returns a clone of this filter with all user defined relations.".
Of course, here is the Java code you requested: ```java public CmsRelationFilter filterUserDefined() { CmsRelationFilter filter = (CmsRelationFilter)clone(); if (filter.m_types.isEmpty()) { filter.m_types.addAll(CmsRelationType.getAllUserDefined()); } else { filter.m_ty...
scalecube/scalecube-services
services-gateway-websocket/src/main/java/io/scalecube/services/gateway/ws/GatewayMessageCodec.java
GatewayMessageCodec.decode
public GatewayMessage decode(ByteBuf byteBuf) throws MessageCodecException { try (InputStream stream = new ByteBufInputStream(byteBuf, true)) { JsonParser jp = jsonFactory.createParser(stream); GatewayMessage.Builder result = GatewayMessage.builder(); JsonToken current = jp.nextToken(); if ...
java
public GatewayMessage decode(ByteBuf byteBuf) throws MessageCodecException { try (InputStream stream = new ByteBufInputStream(byteBuf, true)) { JsonParser jp = jsonFactory.createParser(stream); GatewayMessage.Builder result = GatewayMessage.builder(); JsonToken current = jp.nextToken(); if ...
[ "public", "GatewayMessage", "decode", "(", "ByteBuf", "byteBuf", ")", "throws", "MessageCodecException", "{", "try", "(", "InputStream", "stream", "=", "new", "ByteBufInputStream", "(", "byteBuf", ",", "true", ")", ")", "{", "JsonParser", "jp", "=", "jsonFactory...
Decodes {@link GatewayMessage} from given {@code byteBuf}. @param byteBuf - contains raw {@link GatewayMessage} to be decoded. @return Decoded {@link GatewayMessage}. @throws MessageCodecException - in case of issues during deserialization.
[ "Decodes", "{", "@link", "GatewayMessage", "}", "from", "given", "{", "@code", "byteBuf", "}", "." ]
76c8de6019e5480a1436d12b37acf163f70eea47
https://github.com/scalecube/scalecube-services/blob/76c8de6019e5480a1436d12b37acf163f70eea47/services-gateway-websocket/src/main/java/io/scalecube/services/gateway/ws/GatewayMessageCodec.java#L120-L161
train
Decodes a GatewayMessage from a byte buffer.
Create a Java method that does the following: "Decodes a GatewayMessage from a byte buffer.".
Of course, here is the Java code you requested: ```java public GatewayMessage decode(ByteBuf byteBuf) throws MessageCodecException { try (InputStream stream = new ByteBufInputStream(byteBuf, true)) { JsonParser jp = jsonFactory.createParser(stream); GatewayMessage.Builder result = GatewayMessage.builde...
killbilling/recurly-java-library
src/main/java/com/ning/billing/recurly/RecurlyClient.java
RecurlyClient.getCouponRedemptionsByInvoice
@Deprecated public Redemptions getCouponRedemptionsByInvoice(final Integer invoiceNumber, final QueryParams params) { return getCouponRedemptionsByInvoice(invoiceNumber.toString(), params); }
java
@Deprecated public Redemptions getCouponRedemptionsByInvoice(final Integer invoiceNumber, final QueryParams params) { return getCouponRedemptionsByInvoice(invoiceNumber.toString(), params); }
[ "@", "Deprecated", "public", "Redemptions", "getCouponRedemptionsByInvoice", "(", "final", "Integer", "invoiceNumber", ",", "final", "QueryParams", "params", ")", "{", "return", "getCouponRedemptionsByInvoice", "(", "invoiceNumber", ".", "toString", "(", ")", ",", "pa...
Lookup all coupon redemptions on an invoice given query params. @deprecated Prefer using Invoice#getId() as the id param (which is a String) @param invoiceNumber invoice number @param params {@link QueryParams} @return the coupon redemptions for this invoice on success, null otherwise
[ "Lookup", "all", "coupon", "redemptions", "on", "an", "invoice", "given", "query", "params", "." ]
5e05eedd91885a51e1aa8293bd41139d082cf7f4
https://github.com/killbilling/recurly-java-library/blob/5e05eedd91885a51e1aa8293bd41139d082cf7f4/src/main/java/com/ning/billing/recurly/RecurlyClient.java#L1677-L1680
train
Get a list of Redemptions for an invoice.
Create a Java method that does the following: "Get a list of Redemptions for an invoice.".
Of course, here is the Java code you requested: ```java @Deprecated public Redemptions getCouponRedemptionsByInvoice(final Integer invoiceNumber, final QueryParams params) { return getCouponRedemptionsByInvoice(invoiceNumber.toString(), params); } ``` Hope this helps!
Azure/azure-sdk-for-java
containerservice/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/containerservice/v2019_02_01/implementation/OpenShiftManagedClustersInner.java
OpenShiftManagedClustersInner.listByResourceGroupAsync
public Observable<Page<OpenShiftManagedClusterInner>> listByResourceGroupAsync(final String resourceGroupName) { return listByResourceGroupWithServiceResponseAsync(resourceGroupName) .map(new Func1<ServiceResponse<Page<OpenShiftManagedClusterInner>>, Page<OpenShiftManagedClusterInner>>() { ...
java
public Observable<Page<OpenShiftManagedClusterInner>> listByResourceGroupAsync(final String resourceGroupName) { return listByResourceGroupWithServiceResponseAsync(resourceGroupName) .map(new Func1<ServiceResponse<Page<OpenShiftManagedClusterInner>>, Page<OpenShiftManagedClusterInner>>() { ...
[ "public", "Observable", "<", "Page", "<", "OpenShiftManagedClusterInner", ">", ">", "listByResourceGroupAsync", "(", "final", "String", "resourceGroupName", ")", "{", "return", "listByResourceGroupWithServiceResponseAsync", "(", "resourceGroupName", ")", ".", "map", "(", ...
Lists OpenShift managed clusters in the specified subscription and resource group. Lists OpenShift managed clusters in the specified subscription and resource group. The operation returns properties of each OpenShift managed cluster. @param resourceGroupName The name of the resource group. @throws IllegalArgumentExcep...
[ "Lists", "OpenShift", "managed", "clusters", "in", "the", "specified", "subscription", "and", "resource", "group", ".", "Lists", "OpenShift", "managed", "clusters", "in", "the", "specified", "subscription", "and", "resource", "group", ".", "The", "operation", "ret...
aab183ddc6686c82ec10386d5a683d2691039626
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerservice/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/containerservice/v2019_02_01/implementation/OpenShiftManagedClustersInner.java#L275-L283
train
Gets a list of a CDNA managed cluster.
Create a Java method that does the following: "Gets a list of a CDNA managed cluster.".
Of course, here is the Java code you requested: ```java public Observable<Page<OpenShiftManagedClusterInner>> listByResourceGroupAsync(final String resourceGroupName) { return listByResourceGroupWithServiceResponseAsync(resourceGroupName) .map(new Func1<ServiceResponse<Page<OpenShiftManagedClusterI...
OpenLiberty/open-liberty
dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/el/unified/resolver/ScopedAttributeResolver.java
ScopedAttributeResolver.findScopedMap
private static Map<String, Object> findScopedMap(final FacesContext facesContext, final Object property) { if (facesContext == null) { return null; } final ExternalContext extContext = facesContext.getExternalContext(); if (extContext == null) { ...
java
private static Map<String, Object> findScopedMap(final FacesContext facesContext, final Object property) { if (facesContext == null) { return null; } final ExternalContext extContext = facesContext.getExternalContext(); if (extContext == null) { ...
[ "private", "static", "Map", "<", "String", ",", "Object", ">", "findScopedMap", "(", "final", "FacesContext", "facesContext", ",", "final", "Object", "property", ")", "{", "if", "(", "facesContext", "==", "null", ")", "{", "return", "null", ";", "}", "fina...
returns null if not found
[ "returns", "null", "if", "not", "found" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/el/unified/resolver/ScopedAttributeResolver.java#L191-L247
train
Find scoped map.
Create a Java method that does the following: "Find scoped map.".
Of course, here is the Java code you requested: ```java private static Map<String, Object> findScopedMap(final FacesContext facesContext, final Object property) { if (facesContext == null) { return null; } final ExternalContext extContext = facesContext.getExter...
lipangit/JiaoZiVideoPlayer
app/src/main/java/cn/jzvd/demo/ActivityApiCustomMedia.java
ActivityApiCustomMedia.onCreate
@Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setDisplayShowHomeEnabled(true); getSupportActionBar().setDisplayShowTitleEnabled(true); g...
java
@Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setDisplayShowHomeEnabled(true); getSupportActionBar().setDisplayShowTitleEnabled(true); g...
[ "@", "Override", "protected", "void", "onCreate", "(", "@", "Nullable", "Bundle", "savedInstanceState", ")", "{", "super", ".", "onCreate", "(", "savedInstanceState", ")", ";", "getSupportActionBar", "(", ")", ".", "setDisplayHomeAsUpEnabled", "(", "true", ")", ...
这里其实并不需要handler,为了防止播放中切换播放器引擎导致的崩溃,实际使用时一般不会遇到,可以随时调用JZVideoPlayer.setMediaInterface();
[ "这里其实并不需要handler,为了防止播放中切换播放器引擎导致的崩溃,实际使用时一般不会遇到,可以随时调用JZVideoPlayer", ".", "setMediaInterface", "()", ";" ]
52c7370c131173b5ac77051029f0bd62fcf883f9
https://github.com/lipangit/JiaoZiVideoPlayer/blob/52c7370c131173b5ac77051029f0bd62fcf883f9/app/src/main/java/cn/jzvd/demo/ActivityApiCustomMedia.java#L31-L60
train
Override onCreate to set up the application s attributes.
Create a Java method that does the following: "Override onCreate to set up the application s attributes.".
Of course, here is the Java code you requested: ```java @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setDisplayShowHomeEnabled(true); getSuppo...
wmdietl/jsr308-langtools
src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ConstantsSummaryBuilder.java
ConstantsSummaryBuilder.hasConstantField
private boolean hasConstantField (ClassDoc classDoc) { VisibleMemberMap visibleMemberMapFields = new VisibleMemberMap(classDoc, VisibleMemberMap.FIELDS, configuration); List<?> fields = visibleMemberMapFields.getLeafClassMembers(configuration); for (Iterator<?> iter = fields.iterator...
java
private boolean hasConstantField (ClassDoc classDoc) { VisibleMemberMap visibleMemberMapFields = new VisibleMemberMap(classDoc, VisibleMemberMap.FIELDS, configuration); List<?> fields = visibleMemberMapFields.getLeafClassMembers(configuration); for (Iterator<?> iter = fields.iterator...
[ "private", "boolean", "hasConstantField", "(", "ClassDoc", "classDoc", ")", "{", "VisibleMemberMap", "visibleMemberMapFields", "=", "new", "VisibleMemberMap", "(", "classDoc", ",", "VisibleMemberMap", ".", "FIELDS", ",", "configuration", ")", ";", "List", "<", "?", ...
Return true if the given class has constant fields to document. @param classDoc the class being checked. @return true if the given package has constant fields to document.
[ "Return", "true", "if", "the", "given", "class", "has", "constant", "fields", "to", "document", "." ]
8812d28c20f4de070a0dd6de1b45602431379834
https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ConstantsSummaryBuilder.java#L266-L278
train
Checks if a class has a constant field.
Create a Java method that does the following: "Checks if a class has a constant field.".
Of course, here is the Java code you requested: ```java private boolean hasConstantField (ClassDoc classDoc) { VisibleMemberMap visibleMemberMapFields = new VisibleMemberMap(classDoc, VisibleMemberMap.FIELDS, configuration); List<?> fields = visibleMemberMapFields.getLeafClassMembers(config...
aalmiray/Json-lib
src/main/java/net/sf/json/util/JSONUtils.java
JSONUtils.convertToJavaIdentifier
public static String convertToJavaIdentifier( String key, JsonConfig jsonConfig ) { try{ return jsonConfig.getJavaIdentifierTransformer() .transformToJavaIdentifier( key ); }catch( JSONException jsone ){ throw jsone; }catch( Exception e ){ throw new JSONExcept...
java
public static String convertToJavaIdentifier( String key, JsonConfig jsonConfig ) { try{ return jsonConfig.getJavaIdentifierTransformer() .transformToJavaIdentifier( key ); }catch( JSONException jsone ){ throw jsone; }catch( Exception e ){ throw new JSONExcept...
[ "public", "static", "String", "convertToJavaIdentifier", "(", "String", "key", ",", "JsonConfig", "jsonConfig", ")", "{", "try", "{", "return", "jsonConfig", ".", "getJavaIdentifierTransformer", "(", ")", ".", "transformToJavaIdentifier", "(", "key", ")", ";", "}"...
Transforms the string into a valid Java Identifier.<br> The default strategy is JavaIdentifierTransformer.NOOP @throws JSONException if the string can not be transformed.
[ "Transforms", "the", "string", "into", "a", "valid", "Java", "Identifier", ".", "<br", ">", "The", "default", "strategy", "is", "JavaIdentifierTransformer", ".", "NOOP" ]
9e2b3376ee8f511a48aa7ac05f75a7414e02280f
https://github.com/aalmiray/Json-lib/blob/9e2b3376ee8f511a48aa7ac05f75a7414e02280f/src/main/java/net/sf/json/util/JSONUtils.java#L84-L93
train
Convert a JSON string to a Java Identifier
Create a Java method that does the following: "Convert a JSON string to a Java Identifier".
Of course, here is the Java code you requested: ```java public static String convertToJavaIdentifier( String key, JsonConfig jsonConfig ) { try{ return jsonConfig.getJavaIdentifierTransformer() .transformToJavaIdentifier( key ); }catch( JSONException jsone ){ throw jsone; ...
oblac/jodd
jodd-json/src/main/java/jodd/json/JsonArray.java
JsonArray.add
public JsonArray add(final Enum value) { if (value == null) { list.add(null); } else { list.add(value.name()); } return this; }
java
public JsonArray add(final Enum value) { if (value == null) { list.add(null); } else { list.add(value.name()); } return this; }
[ "public", "JsonArray", "add", "(", "final", "Enum", "value", ")", "{", "if", "(", "value", "==", "null", ")", "{", "list", ".", "add", "(", "null", ")", ";", "}", "else", "{", "list", ".", "add", "(", "value", ".", "name", "(", ")", ")", ";", ...
Adds an enum to the JSON array. <p> JSON has no concept of encoding Enums, so the Enum will be converted to a String using the {@link java.lang.Enum#name} method and the value added as a String.
[ "Adds", "an", "enum", "to", "the", "JSON", "array", ".", "<p", ">", "JSON", "has", "no", "concept", "of", "encoding", "Enums", "so", "the", "Enum", "will", "be", "converted", "to", "a", "String", "using", "the", "{" ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-json/src/main/java/jodd/json/JsonArray.java#L202-L209
test
Add an enumeration value to the JsonArray.
Create a Java method that does the following: "Add an enumeration value to the JsonArray.".
Of course, here is the Java code you requested: ```java public JsonArray add(final Enum value) { if (value == null) { list.add(null); } else { list.add(value.name()); } return this; } ``` Hope this helps!
OpenLiberty/open-liberty
dev/com.ibm.ws.jdbc/src/com/ibm/ws/rsadapter/jdbc/WSJdbcDataSource.java
WSJdbcDataSource.getJDBCImplObject
@Override @SuppressWarnings("unchecked") protected <T> T getJDBCImplObject(Class<T> interfaceClass) throws SQLException { Object jdbcImplObject = getJDBCImplObject(); if(jdbcImplObject == null) { return null; } Object impl = WSJdbcTracer.getImpl(jdbcImplObject); ...
java
@Override @SuppressWarnings("unchecked") protected <T> T getJDBCImplObject(Class<T> interfaceClass) throws SQLException { Object jdbcImplObject = getJDBCImplObject(); if(jdbcImplObject == null) { return null; } Object impl = WSJdbcTracer.getImpl(jdbcImplObject); ...
[ "@", "Override", "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "protected", "<", "T", ">", "T", "getJDBCImplObject", "(", "Class", "<", "T", ">", "interfaceClass", ")", "throws", "SQLException", "{", "Object", "jdbcImplObject", "=", "getJDBCImplObject", "(...
Locate the underlying JDBC driver's implementation of the specified interface. @param interfaceClass the interface. @return the underlying JDBC driver's implementation of the specified interface, or NULL if none is found. @throws SQLException if an error occurs locating or unwrapping the implementation.
[ "Locate", "the", "underlying", "JDBC", "driver", "s", "implementation", "of", "the", "specified", "interface", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jdbc/src/com/ibm/ws/rsadapter/jdbc/WSJdbcDataSource.java#L241-L250
train
Get the JDBCImplObject for the specified interface class.
Create a Java method that does the following: "Get the JDBCImplObject for the specified interface class.".
Of course, here is the Java code you requested: ```java @Override @SuppressWarnings("unchecked") protected <T> T getJDBCImplObject(Class<T> interfaceClass) throws SQLException { Object jdbcImplObject = getJDBCImplObject(); if(jdbcImplObject == null) { return null; } ...
structr/structr
structr-ui/src/main/java/org/structr/web/auth/TwitterAuthClient.java
TwitterAuthClient.getEndUserAuthorizationRequestUri
@Override public String getEndUserAuthorizationRequestUri(final HttpServletRequest request) { RequestToken requestToken; try { // The following does not work, leads to the following error from Twitter: //String callbackUrl = getAbsoluteUrl(request, redirectUri); //logger.info("Callback URL: {}", callbac...
java
@Override public String getEndUserAuthorizationRequestUri(final HttpServletRequest request) { RequestToken requestToken; try { // The following does not work, leads to the following error from Twitter: //String callbackUrl = getAbsoluteUrl(request, redirectUri); //logger.info("Callback URL: {}", callbac...
[ "@", "Override", "public", "String", "getEndUserAuthorizationRequestUri", "(", "final", "HttpServletRequest", "request", ")", "{", "RequestToken", "requestToken", ";", "try", "{", "// The following does not work, leads to the following error from Twitter:", "//String callbackUrl = ...
Create an end-user authorization request Use with {@literal response.setRedirect(request.getLocationUri());} @param request @return auth request URI
[ "Create", "an", "end", "-", "user", "authorization", "request" ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-ui/src/main/java/org/structr/web/auth/TwitterAuthClient.java#L75-L114
train
Get the end user authorization request URI.
Create a Java method that does the following: "Get the end user authorization request URI.".
Of course, here is the Java code you requested: ```java @Override public String getEndUserAuthorizationRequestUri(final HttpServletRequest request) { RequestToken requestToken; try { // The following does not work, leads to the following error from Twitter: //String callbackUrl = getAbsoluteUrl(request, r...
OpenLiberty/open-liberty
dev/com.ibm.ws.container.service.compat/src/com/ibm/ws/util/UUID.java
UUID.isOldVersion
public boolean isOldVersion() { if (_unexpectedFormat) { return false; } else { final long version = _uuidHigh & _VERSION_MASK; return (version >= _OLD_VERSION_ID && version < _CURRENT_VERSION_ID); } }
java
public boolean isOldVersion() { if (_unexpectedFormat) { return false; } else { final long version = _uuidHigh & _VERSION_MASK; return (version >= _OLD_VERSION_ID && version < _CURRENT_VERSION_ID); } }
[ "public", "boolean", "isOldVersion", "(", ")", "{", "if", "(", "_unexpectedFormat", ")", "{", "return", "false", ";", "}", "else", "{", "final", "long", "version", "=", "_uuidHigh", "&", "_VERSION_MASK", ";", "return", "(", "version", ">=", "_OLD_VERSION_ID"...
/* ------------------------------------------------------------------------
[ "/", "*", "------------------------------------------------------------------------" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.container.service.compat/src/com/ibm/ws/util/UUID.java#L635-L647
train
Is the version of the log record in the old format?
Create a Java method that does the following: "Is the version of the log record in the old format?".
Of course, here is the Java code you requested: ```java public boolean isOldVersion() { if (_unexpectedFormat) { return false; } else { final long version = _uuidHigh & _VERSION_MASK; return (version >= _OLD_VERSION_ID && version < _CURRE...
citygml4j/citygml4j
src-gen/main/java/net/opengis/gml/ObjectFactory.java
ObjectFactory.createVerticalExtent
@XmlElementDecl(namespace = "http://www.opengis.net/gml", name = "verticalExtent") public JAXBElement<EnvelopeType> createVerticalExtent(EnvelopeType value) { return new JAXBElement<EnvelopeType>(_VerticalExtent_QNAME, EnvelopeType.class, null, value); }
java
@XmlElementDecl(namespace = "http://www.opengis.net/gml", name = "verticalExtent") public JAXBElement<EnvelopeType> createVerticalExtent(EnvelopeType value) { return new JAXBElement<EnvelopeType>(_VerticalExtent_QNAME, EnvelopeType.class, null, value); }
[ "@", "XmlElementDecl", "(", "namespace", "=", "\"http://www.opengis.net/gml\"", ",", "name", "=", "\"verticalExtent\"", ")", "public", "JAXBElement", "<", "EnvelopeType", ">", "createVerticalExtent", "(", "EnvelopeType", "value", ")", "{", "return", "new", "JAXBElemen...
Create an instance of {@link JAXBElement }{@code <}{@link EnvelopeType }{@code >} @param value Java instance representing xml element's value. @return the new instance of {@link JAXBElement }{@code <}{@link EnvelopeType }{@code >}
[ "Create", "an", "instance", "of", "{", "@link", "JAXBElement", "}", "{", "@code", "<", "}", "{", "@link", "EnvelopeType", "}", "{", "@code", ">", "}" ]
9155997d5ecf7e8f19411a02ba047f13375b97b9
https://github.com/citygml4j/citygml4j/blob/9155997d5ecf7e8f19411a02ba047f13375b97b9/src-gen/main/java/net/opengis/gml/ObjectFactory.java#L6746-L6749
train
Create an instance of the verticalExtent JAXBElement.
Create a Java method that does the following: "Create an instance of the verticalExtent JAXBElement.".
Of course, here is the Java code you requested: ```java @XmlElementDecl(namespace = "http://www.opengis.net/gml", name = "verticalExtent") public JAXBElement<EnvelopeType> createVerticalExtent(EnvelopeType value) { return new JAXBElement<EnvelopeType>(_VerticalExtent_QNAME, EnvelopeType.class, null, value)...
TheHortonMachine/hortonmachine
gears/src/main/java/org/hortonmachine/gears/io/geopaparazzi/geopap4/DaoNotes.java
DaoNotes.addNote
public static void addNote( Connection connection, long id, double lon, double lat, double altim, long timestamp, String text, String form ) throws Exception { String insertSQL = "INSERT INTO " + TableDescriptions.TABLE_NOTES + "(" + // TableDescriptions.NotesTableFields.COLUMN_ID.ge...
java
public static void addNote( Connection connection, long id, double lon, double lat, double altim, long timestamp, String text, String form ) throws Exception { String insertSQL = "INSERT INTO " + TableDescriptions.TABLE_NOTES + "(" + // TableDescriptions.NotesTableFields.COLUMN_ID.ge...
[ "public", "static", "void", "addNote", "(", "Connection", "connection", ",", "long", "id", ",", "double", "lon", ",", "double", "lat", ",", "double", "altim", ",", "long", "timestamp", ",", "String", "text", ",", "String", "form", ")", "throws", "Exception...
Add a new note to the database. @param id the id @param lon lon @param lat lat @param altim elevation @param timestamp the UTC timestamp in millis. @param text a text @param form the optional json form. @throws IOException if something goes wrong.
[ "Add", "a", "new", "note", "to", "the", "database", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/geopaparazzi/geopap4/DaoNotes.java#L118-L142
train
Add a new note to the database.
Create a Java method that does the following: "Add a new note to the database.".
Of course, here is the Java code you requested: ```java public static void addNote( Connection connection, long id, double lon, double lat, double altim, long timestamp, String text, String form ) throws Exception { String insertSQL = "INSERT INTO " + TableDescriptions.TABLE_NOTES + "(" + // ...
CenturyLinkCloud/mdw
mdw-common/src/com/centurylink/mdw/model/event/InternalEvent.java
InternalEvent.createProcessStartMessage
public static InternalEvent createProcessStartMessage( Long processId, String parentType, Long parentId, String masterRequestId, Long procInstId, String secondaryOwnerType, Long secondaryOwnerId) { InternalEvent event = new InternalEvent(); event.isProcess = true; ...
java
public static InternalEvent createProcessStartMessage( Long processId, String parentType, Long parentId, String masterRequestId, Long procInstId, String secondaryOwnerType, Long secondaryOwnerId) { InternalEvent event = new InternalEvent(); event.isProcess = true; ...
[ "public", "static", "InternalEvent", "createProcessStartMessage", "(", "Long", "processId", ",", "String", "parentType", ",", "Long", "parentId", ",", "String", "masterRequestId", ",", "Long", "procInstId", ",", "String", "secondaryOwnerType", ",", "Long", "secondaryO...
procInstId is populated when the process instance is already created. o/w null
[ "procInstId", "is", "populated", "when", "the", "process", "instance", "is", "already", "created", ".", "o", "/", "w", "null" ]
91167fe65a25a5d7022cdcf8b0fae8506f5b87ce
https://github.com/CenturyLinkCloud/mdw/blob/91167fe65a25a5d7022cdcf8b0fae8506f5b87ce/mdw-common/src/com/centurylink/mdw/model/event/InternalEvent.java#L120-L136
train
Create a START event.
Create a Java method that does the following: "Create a START event.".
Of course, here is the Java code you requested: ```java public static InternalEvent createProcessStartMessage( Long processId, String parentType, Long parentId, String masterRequestId, Long procInstId, String secondaryOwnerType, Long secondaryOwnerId) { InternalEvent event =...
codelibs/jcifs
src/main/java/jcifs/smb1/util/Encdec.java
Encdec.enc_time
public static int enc_time( Date date, byte[] dst, int di, int enc ) { long t; switch( enc ) { case TIME_1970_SEC_32BE: return enc_uint32be( (int)(date.getTime() / 1000L), dst, di ); case TIME_1970_SEC_32LE: return enc_uint32le( (int)(date.get...
java
public static int enc_time( Date date, byte[] dst, int di, int enc ) { long t; switch( enc ) { case TIME_1970_SEC_32BE: return enc_uint32be( (int)(date.getTime() / 1000L), dst, di ); case TIME_1970_SEC_32LE: return enc_uint32le( (int)(date.get...
[ "public", "static", "int", "enc_time", "(", "Date", "date", ",", "byte", "[", "]", "dst", ",", "int", "di", ",", "int", "enc", ")", "{", "long", "t", ";", "switch", "(", "enc", ")", "{", "case", "TIME_1970_SEC_32BE", ":", "return", "enc_uint32be", "(...
/* Encode times
[ "/", "*", "Encode", "times" ]
ac6a8ba2925648ae003ca2508aec32316065dc34
https://github.com/codelibs/jcifs/blob/ac6a8ba2925648ae003ca2508aec32316065dc34/src/main/java/jcifs/smb1/util/Encdec.java#L173-L201
train
enc_time This method is used to convert a java. util. Date into a byte array.
Create a Java method that does the following: "enc_time This method is used to convert a java. util. Date into a byte array.".
Of course, here is the Java code you requested: ```java public static int enc_time( Date date, byte[] dst, int di, int enc ) { long t; switch( enc ) { case TIME_1970_SEC_32BE: return enc_uint32be( (int)(date.getTime() / 1000L), dst, di ); case TIME_1970_SEC_...
jparsec/jparsec
jparsec/src/main/java/org/jparsec/Parser.java
Parser.prefix
public final Parser<T> prefix(Parser<? extends Function<? super T, ? extends T>> op) { return Parsers.sequence(op.many(), this, Parser::applyPrefixOperators); }
java
public final Parser<T> prefix(Parser<? extends Function<? super T, ? extends T>> op) { return Parsers.sequence(op.many(), this, Parser::applyPrefixOperators); }
[ "public", "final", "Parser", "<", "T", ">", "prefix", "(", "Parser", "<", "?", "extends", "Function", "<", "?", "super", "T", ",", "?", "extends", "T", ">", ">", "op", ")", "{", "return", "Parsers", ".", "sequence", "(", "op", ".", "many", "(", "...
A {@link Parser} that runs {@code op} for 0 or more times greedily, then runs {@code this}. The {@link Function} objects returned from {@code op} are applied from right to left to the return value of {@code p}. <p> {@code p.prefix(op)} is equivalent to {@code op* p} in EBNF.
[ "A", "{", "@link", "Parser", "}", "that", "runs", "{", "@code", "op", "}", "for", "0", "or", "more", "times", "greedily", "then", "runs", "{", "@code", "this", "}", ".", "The", "{", "@link", "Function", "}", "objects", "returned", "from", "{", "@code...
df1280259f5da9eb5ffc537437569dddba66cb94
https://github.com/jparsec/jparsec/blob/df1280259f5da9eb5ffc537437569dddba66cb94/jparsec/src/main/java/org/jparsec/Parser.java#L596-L598
train
Returns a parser that is a sequence of parsers that is a sequence of parsers that are prefixed by the given operators.
Create a Java method that does the following: "Returns a parser that is a sequence of parsers that is a sequence of parsers that are prefixed by the given operators.".
Of course, here is the Java code you requested: ```java public final Parser<T> prefix(Parser<? extends Function<? super T, ? extends T>> op) { return Parsers.sequence(op.many(), this, Parser::applyPrefixOperators); } ``` Hope this helps!
lightblue-platform/lightblue-migrator
migrator/src/main/java/com/redhat/lightblue/migrator/ThreadMonitor.java
ThreadMonitor.getThreads
private static Thread[] getThreads(ThreadGroup g) { int mul = 1; do { Thread[] arr = new Thread[g.activeCount() * mul + 1]; if (g.enumerate(arr) < arr.length) { return arr; } mul++; } while (true); }
java
private static Thread[] getThreads(ThreadGroup g) { int mul = 1; do { Thread[] arr = new Thread[g.activeCount() * mul + 1]; if (g.enumerate(arr) < arr.length) { return arr; } mul++; } while (true); }
[ "private", "static", "Thread", "[", "]", "getThreads", "(", "ThreadGroup", "g", ")", "{", "int", "mul", "=", "1", ";", "do", "{", "Thread", "[", "]", "arr", "=", "new", "Thread", "[", "g", ".", "activeCount", "(", ")", "*", "mul", "+", "1", "]", ...
Returns threads in an array. Some elements may be null.
[ "Returns", "threads", "in", "an", "array", ".", "Some", "elements", "may", "be", "null", "." ]
ec20748557b40d1f7851e1816d1b76dae48d2027
https://github.com/lightblue-platform/lightblue-migrator/blob/ec20748557b40d1f7851e1816d1b76dae48d2027/migrator/src/main/java/com/redhat/lightblue/migrator/ThreadMonitor.java#L185-L194
train
Get threads from a thread group.
Create a Java method that does the following: "Get threads from a thread group.".
Of course, here is the Java code you requested: ```java private static Thread[] getThreads(ThreadGroup g) { int mul = 1; do { Thread[] arr = new Thread[g.activeCount() * mul + 1]; if (g.enumerate(arr) < arr.length) { return arr; } mul++; ...
versionone/VersionOne.SDK.Java.ObjectModel
src/main/java/com/versionone/om/Member.java
Member.getTotalDone
public Double getTotalDone(WorkitemFilter filter) { filter = (filter != null) ? filter : new WorkitemFilter(); return getSum("OwnedWorkitems", filter, "Actuals.Value"); }
java
public Double getTotalDone(WorkitemFilter filter) { filter = (filter != null) ? filter : new WorkitemFilter(); return getSum("OwnedWorkitems", filter, "Actuals.Value"); }
[ "public", "Double", "getTotalDone", "(", "WorkitemFilter", "filter", ")", "{", "filter", "=", "(", "filter", "!=", "null", ")", "?", "filter", ":", "new", "WorkitemFilter", "(", ")", ";", "return", "getSum", "(", "\"OwnedWorkitems\"", ",", "filter", ",", "...
Return the total done for all workitems owned by this member optionally filtered. @param filter Criteria to filter workitems on. @return total done of selected Workitems.
[ "Return", "the", "total", "done", "for", "all", "workitems", "owned", "by", "this", "member", "optionally", "filtered", "." ]
59d35b67c849299631bca45ee94143237eb2ae1a
https://github.com/versionone/VersionOne.SDK.Java.ObjectModel/blob/59d35b67c849299631bca45ee94143237eb2ae1a/src/main/java/com/versionone/om/Member.java#L322-L326
train
Get the total done for all workitems owned by this user optionally filtered.
Create a Java method that does the following: "Get the total done for all workitems owned by this user optionally filtered.".
Of course, here is the Java code you requested: ```java public Double getTotalDone(WorkitemFilter filter) { filter = (filter != null) ? filter : new WorkitemFilter(); return getSum("OwnedWorkitems", filter, "Actuals.Value"); } ``` Hope this helps!