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
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.comms.server/src/com/ibm/ws/sib/comms/server/clientsupport/CATMainConsumer.java
CATMainConsumer.incremenetMessageBatchNumber
protected void incremenetMessageBatchNumber() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "incremenetMessageBatchNumber"); checkNotBrowserSession(); // F171893 this.messageBatchNumber++; if (TraceComponent.isAnyTra...
java
protected void incremenetMessageBatchNumber() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "incremenetMessageBatchNumber"); checkNotBrowserSession(); // F171893 this.messageBatchNumber++; if (TraceComponent.isAnyTra...
[ "protected", "void", "incremenetMessageBatchNumber", "(", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "this", ",", "tc", ",", "\"incremenetMessageBat...
This method will increment the message batch number and is usually done when the client requests an <code>unlockAll()</code>.
[ "This", "method", "will", "increment", "the", "message", "batch", "number", "and", "is", "usually", "done", "when", "the", "client", "requests", "an", "<code", ">", "unlockAll", "()", "<", "/", "code", ">", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.server/src/com/ibm/ws/sib/comms/server/clientsupport/CATMainConsumer.java#L388-L395
train
Increments the message batch number.
Create a Java method that does the following: "Increments the message batch number.".
Of course, here is the Java code you requested: ```java protected void incremenetMessageBatchNumber() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "incremenetMessageBatchNumber"); checkNotBrowserSession(); // F171893 thi...
cdk/cdk
legacy/src/main/java/org/openscience/cdk/math/IMatrix.java
IMatrix.getVectorFromDiagonal
public IVector getVectorFromDiagonal() { int size = Math.min(rows, columns); IVector result = new IVector(size); for (int i = 0; i < rows; i++) { result.realvector[i] = realmatrix[i][i]; result.imagvector[i] = imagmatrix[i][i]; } return result; }
java
public IVector getVectorFromDiagonal() { int size = Math.min(rows, columns); IVector result = new IVector(size); for (int i = 0; i < rows; i++) { result.realvector[i] = realmatrix[i][i]; result.imagvector[i] = imagmatrix[i][i]; } return result; }
[ "public", "IVector", "getVectorFromDiagonal", "(", ")", "{", "int", "size", "=", "Math", ".", "min", "(", "rows", ",", "columns", ")", ";", "IVector", "result", "=", "new", "IVector", "(", "size", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i...
Creates a vector with the content of the diagonal elements from this matrix
[ "Creates", "a", "vector", "with", "the", "content", "of", "the", "diagonal", "elements", "from", "this", "matrix" ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/legacy/src/main/java/org/openscience/cdk/math/IMatrix.java#L109-L117
train
Get the vector from diagonal.
Create a Java method that does the following: "Get the vector from diagonal.".
Of course, here is the Java code you requested: ```java public IVector getVectorFromDiagonal() { int size = Math.min(rows, columns); IVector result = new IVector(size); for (int i = 0; i < rows; i++) { result.realvector[i] = realmatrix[i][i]; result.imagvector[i] = imagm...
calimero-project/calimero-core
src/tuwien/auto/calimero/buffer/cache/ExpiringCache.java
ExpiringCache.removeExpired
@Override public void removeExpired() { if (timeToExpire == 0 || !(map instanceof LinkedHashMap)) return; final long now = System.currentTimeMillis(); final long duration = timeToExpire * 1000L; CacheObject o = null; synchronized (this) { for (final Iterator<CacheObject> i = map.values().iterator(); i...
java
@Override public void removeExpired() { if (timeToExpire == 0 || !(map instanceof LinkedHashMap)) return; final long now = System.currentTimeMillis(); final long duration = timeToExpire * 1000L; CacheObject o = null; synchronized (this) { for (final Iterator<CacheObject> i = map.values().iterator(); i...
[ "@", "Override", "public", "void", "removeExpired", "(", ")", "{", "if", "(", "timeToExpire", "==", "0", "||", "!", "(", "map", "instanceof", "LinkedHashMap", ")", ")", "return", ";", "final", "long", "now", "=", "System", ".", "currentTimeMillis", "(", ...
Removes all {@link CacheObject}s, where<br> <code>{@link CacheObject#getTimestamp()} + timeToExpire &lt;= now</code>, with <code>timeToExpire &gt; 0</code> and <code>now</code> is the point of time {@link #removeExpired()} is invoked. <br> If no expiring time was specified at creation of cache, no cache object will be ...
[ "Removes", "all", "{" ]
7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8
https://github.com/calimero-project/calimero-core/blob/7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8/src/tuwien/auto/calimero/buffer/cache/ExpiringCache.java#L115-L134
train
Remove expired objects from the cache.
Create a Java method that does the following: "Remove expired objects from the cache.".
Of course, here is the Java code you requested: ```java @Override public void removeExpired() { if (timeToExpire == 0 || !(map instanceof LinkedHashMap)) return; final long now = System.currentTimeMillis(); final long duration = timeToExpire * 1000L; CacheObject o = null; synchronized (this) { for (f...
Netflix/astyanax
astyanax-entity-mapper/src/main/java/com/netflix/astyanax/entitystore/CompositeEntityMapper.java
CompositeEntityMapper.fromColumn
Object fromColumn(K id, com.netflix.astyanax.model.Column<ByteBuffer> c) { try { // Allocate a new entity Object entity = clazz.newInstance(); idMapper.setValue(entity, id); setEntityFieldsFromColumnName(entity, c.getRawName().duplicate()); ...
java
Object fromColumn(K id, com.netflix.astyanax.model.Column<ByteBuffer> c) { try { // Allocate a new entity Object entity = clazz.newInstance(); idMapper.setValue(entity, id); setEntityFieldsFromColumnName(entity, c.getRawName().duplicate()); ...
[ "Object", "fromColumn", "(", "K", "id", ",", "com", ".", "netflix", ".", "astyanax", ".", "model", ".", "Column", "<", "ByteBuffer", ">", "c", ")", "{", "try", "{", "// Allocate a new entity", "Object", "entity", "=", "clazz", ".", "newInstance", "(", ")...
Return an object from the column @param cl @return
[ "Return", "an", "object", "from", "the", "column" ]
bcc3fd26e2dda05a923751aa32b139f6209fecdf
https://github.com/Netflix/astyanax/blob/bcc3fd26e2dda05a923751aa32b139f6209fecdf/astyanax-entity-mapper/src/main/java/com/netflix/astyanax/entitystore/CompositeEntityMapper.java#L312-L324
train
Creates an entity from a CVE column.
Create a Java method that does the following: "Creates an entity from a CVE column.".
Of course, here is the Java code you requested: ```java Object fromColumn(K id, com.netflix.astyanax.model.Column<ByteBuffer> c) { try { // Allocate a new entity Object entity = clazz.newInstance(); idMapper.setValue(entity, id); setEntityFie...
apollographql/apollo-android
apollo-runtime/src/main/java/com/apollographql/apollo/internal/json/JsonUtf8Writer.java
JsonUtf8Writer.beforeValue
@SuppressWarnings("fallthrough") private void beforeValue() throws IOException { switch (peekScope()) { case NONEMPTY_DOCUMENT: if (!lenient) { throw new IllegalStateException( "JSON must have only one top-level value."); } // fall-through case EMPTY_DOC...
java
@SuppressWarnings("fallthrough") private void beforeValue() throws IOException { switch (peekScope()) { case NONEMPTY_DOCUMENT: if (!lenient) { throw new IllegalStateException( "JSON must have only one top-level value."); } // fall-through case EMPTY_DOC...
[ "@", "SuppressWarnings", "(", "\"fallthrough\"", ")", "private", "void", "beforeValue", "(", ")", "throws", "IOException", "{", "switch", "(", "peekScope", "(", ")", ")", "{", "case", "NONEMPTY_DOCUMENT", ":", "if", "(", "!", "lenient", ")", "{", "throw", ...
Inserts any necessary separators and whitespace before a literal value, inline array, or inline object. Also adjusts the stack to expect either a closing bracket or another element.
[ "Inserts", "any", "necessary", "separators", "and", "whitespace", "before", "a", "literal", "value", "inline", "array", "or", "inline", "object", ".", "Also", "adjusts", "the", "stack", "to", "expect", "either", "a", "closing", "bracket", "or", "another", "ele...
a78869a76e17f77e42c7a88f0099914fe7ffa5b6
https://github.com/apollographql/apollo-android/blob/a78869a76e17f77e42c7a88f0099914fe7ffa5b6/apollo-runtime/src/main/java/com/apollographql/apollo/internal/json/JsonUtf8Writer.java#L341-L372
train
This method is called before the value of a CID segment is read.
Create a Java method that does the following: "This method is called before the value of a CID segment is read.".
Of course, here is the Java code you requested: ```java @SuppressWarnings("fallthrough") private void beforeValue() throws IOException { switch (peekScope()) { case NONEMPTY_DOCUMENT: if (!lenient) { throw new IllegalStateException( "JSON must have only one top-level value."...
elki-project/elki
elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/lof/LOF.java
LOF.run
public OutlierResult run(Database database, Relation<O> relation) { StepProgress stepprog = LOG.isVerbose() ? new StepProgress("LOF", 3) : null; DBIDs ids = relation.getDBIDs(); LOG.beginStep(stepprog, 1, "Materializing nearest-neighbor sets."); KNNQuery<O> knnq = DatabaseUtil.precomputedKNNQuery(datab...
java
public OutlierResult run(Database database, Relation<O> relation) { StepProgress stepprog = LOG.isVerbose() ? new StepProgress("LOF", 3) : null; DBIDs ids = relation.getDBIDs(); LOG.beginStep(stepprog, 1, "Materializing nearest-neighbor sets."); KNNQuery<O> knnq = DatabaseUtil.precomputedKNNQuery(datab...
[ "public", "OutlierResult", "run", "(", "Database", "database", ",", "Relation", "<", "O", ">", "relation", ")", "{", "StepProgress", "stepprog", "=", "LOG", ".", "isVerbose", "(", ")", "?", "new", "StepProgress", "(", "\"LOF\"", ",", "3", ")", ":", "null...
Runs the LOF algorithm on the given database. @param database Database to query @param relation Data to process @return LOF outlier result
[ "Runs", "the", "LOF", "algorithm", "on", "the", "given", "database", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/lof/LOF.java#L125-L150
train
Run LOF on the given database.
Create a Java method that does the following: "Run LOF on the given database.".
Of course, here is the Java code you requested: ```java public OutlierResult run(Database database, Relation<O> relation) { StepProgress stepprog = LOG.isVerbose() ? new StepProgress("LOF", 3) : null; DBIDs ids = relation.getDBIDs(); LOG.beginStep(stepprog, 1, "Materializing nearest-neighbor sets."); ...
fabric8io/fabric8-maven-plugin
core/src/main/java/io/fabric8/maven/core/service/openshift/OpenshiftBuildService.java
OpenshiftBuildService.waitUntilPodIsReady
private void waitUntilPodIsReady(String podName, int nAwaitTimeout, final Logger log) throws InterruptedException { final CountDownLatch readyLatch = new CountDownLatch(1); try (Watch watch = client.pods().withName(podName).watch(new Watcher<Pod>() { @Override public void eventRe...
java
private void waitUntilPodIsReady(String podName, int nAwaitTimeout, final Logger log) throws InterruptedException { final CountDownLatch readyLatch = new CountDownLatch(1); try (Watch watch = client.pods().withName(podName).watch(new Watcher<Pod>() { @Override public void eventRe...
[ "private", "void", "waitUntilPodIsReady", "(", "String", "podName", ",", "int", "nAwaitTimeout", ",", "final", "Logger", "log", ")", "throws", "InterruptedException", "{", "final", "CountDownLatch", "readyLatch", "=", "new", "CountDownLatch", "(", "1", ")", ";", ...
A Simple utility function to watch over pod until it gets ready @param podName Name of the pod @param nAwaitTimeout Time in seconds upto which pod must be watched @param log Logger object @throws InterruptedException
[ "A", "Simple", "utility", "function", "to", "watch", "over", "pod", "until", "it", "gets", "ready" ]
b0e7ad860a5bbe4ab71be3d0613862a1f14a8be3
https://github.com/fabric8io/fabric8-maven-plugin/blob/b0e7ad860a5bbe4ab71be3d0613862a1f14a8be3/core/src/main/java/io/fabric8/maven/core/service/openshift/OpenshiftBuildService.java#L573-L592
test
Wait until the pod is ready.
Create a Java method that does the following: "Wait until the pod is ready.".
Of course, here is the Java code you requested: ```java private void waitUntilPodIsReady(String podName, int nAwaitTimeout, final Logger log) throws InterruptedException { final CountDownLatch readyLatch = new CountDownLatch(1); try (Watch watch = client.pods().withName(podName).watch(new Watcher<Pod>(...
Deep-Symmetry/beat-link
src/main/java/org/deepsymmetry/beatlink/data/ArtFinder.java
ArtFinder.deliverAlbumArtUpdate
private void deliverAlbumArtUpdate(int player, AlbumArt art) { if (!getAlbumArtListeners().isEmpty()) { final AlbumArtUpdate update = new AlbumArtUpdate(player, art); for (final AlbumArtListener listener : getAlbumArtListeners()) { try { listener.album...
java
private void deliverAlbumArtUpdate(int player, AlbumArt art) { if (!getAlbumArtListeners().isEmpty()) { final AlbumArtUpdate update = new AlbumArtUpdate(player, art); for (final AlbumArtListener listener : getAlbumArtListeners()) { try { listener.album...
[ "private", "void", "deliverAlbumArtUpdate", "(", "int", "player", ",", "AlbumArt", "art", ")", "{", "if", "(", "!", "getAlbumArtListeners", "(", ")", ".", "isEmpty", "(", ")", ")", "{", "final", "AlbumArtUpdate", "update", "=", "new", "AlbumArtUpdate", "(", ...
Send an album art update announcement to all registered listeners.
[ "Send", "an", "album", "art", "update", "announcement", "to", "all", "registered", "listeners", "." ]
f958a2a70e8a87a31a75326d7b4db77c2f0b4212
https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/ArtFinder.java#L450-L462
train
Send an album art update to all registered listeners.
Create a Java method that does the following: "Send an album art update to all registered listeners.".
Of course, here is the Java code you requested: ```java private void deliverAlbumArtUpdate(int player, AlbumArt art) { if (!getAlbumArtListeners().isEmpty()) { final AlbumArtUpdate update = new AlbumArtUpdate(player, art); for (final AlbumArtListener listener : getAlbumArtListeners()) {...
TeachingKidsProgramming/TeachingKidsProgramming.Source.Java
src/main/java/org/teachingextensions/logo/utils/MazeUtils/StdDraw.java
StdDraw.picture
public static void picture(double x, double y, String filename) { Image image = getImageFromFile(filename); double xs = scaleX(x); double ys = scaleY(y); int ws = image.getWidth(null); int hs = image.getHeight(null); if (ws < 0 || hs < 0) throw new IllegalArgumentException("image " + fil...
java
public static void picture(double x, double y, String filename) { Image image = getImageFromFile(filename); double xs = scaleX(x); double ys = scaleY(y); int ws = image.getWidth(null); int hs = image.getHeight(null); if (ws < 0 || hs < 0) throw new IllegalArgumentException("image " + fil...
[ "public", "static", "void", "picture", "(", "double", "x", ",", "double", "y", ",", "String", "filename", ")", "{", "Image", "image", "=", "getImageFromFile", "(", "filename", ")", ";", "double", "xs", "=", "scaleX", "(", "x", ")", ";", "double", "ys",...
Draws the specified image centered at (<em>x</em>, <em>y</em>). The supported image formats are JPEG, PNG, and GIF. As an optimization, the picture is cached, so there is no performance penalty for redrawing the same image multiple times (e.g., in an animation). However, if you change the picture file after drawing it,...
[ "Draws", "the", "specified", "image", "centered", "at", "(", "<em", ">", "x<", "/", "em", ">", "<em", ">", "y<", "/", "em", ">", ")", ".", "The", "supported", "image", "formats", "are", "JPEG", "PNG", "and", "GIF", ".", "As", "an", "optimization", ...
516fee15e537ecdb3f4dcbe3695c5cfde7e930da
https://github.com/TeachingKidsProgramming/TeachingKidsProgramming.Source.Java/blob/516fee15e537ecdb3f4dcbe3695c5cfde7e930da/src/main/java/org/teachingextensions/logo/utils/MazeUtils/StdDraw.java#L668-L679
test
Draw a single image in the image space.
Create a Java method that does the following: "Draw a single image in the image space.".
Of course, here is the Java code you requested: ```java public static void picture(double x, double y, String filename) { Image image = getImageFromFile(filename); double xs = scaleX(x); double ys = scaleY(y); int ws = image.getWidth(null); int hs = image.getHeight(null); if (ws < 0 || hs < 0...
Evol-Instruct
N/A
N/A
java
[]
[]
train
Implement a switch-case statement in Java that takes in a string as input and performs different operations based on the value of the string. Requirements: - The input string can only contain lowercase alphabets (a-z). - The switch-case statement should handle at least 10 different cases. - Each case should perform a ...
Here is an example implementation of a switch-case statement in Java that meets the given requirements: ```java public class SwitchCaseExample { public static void main(String[] args) { String input = "g"; switch (input) { case "a": System.out.println("Perform o...
aws/aws-sdk-java
aws-java-sdk-robomaker/src/main/java/com/amazonaws/services/robomaker/AWSRoboMakerClient.java
AWSRoboMakerClient.deleteSimulationApplication
@Override public DeleteSimulationApplicationResult deleteSimulationApplication(DeleteSimulationApplicationRequest request) { request = beforeClientExecution(request); return executeDeleteSimulationApplication(request); }
java
@Override public DeleteSimulationApplicationResult deleteSimulationApplication(DeleteSimulationApplicationRequest request) { request = beforeClientExecution(request); return executeDeleteSimulationApplication(request); }
[ "@", "Override", "public", "DeleteSimulationApplicationResult", "deleteSimulationApplication", "(", "DeleteSimulationApplicationRequest", "request", ")", "{", "request", "=", "beforeClientExecution", "(", "request", ")", ";", "return", "executeDeleteSimulationApplication", "(",...
<p> Deletes a simulation application. </p> @param deleteSimulationApplicationRequest @return Result of the DeleteSimulationApplication operation returned by the service. @throws InvalidParameterException A parameter specified in a request is not valid, is unsupported, or cannot be used. The returned message provides a...
[ "<p", ">", "Deletes", "a", "simulation", "application", ".", "<", "/", "p", ">" ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-robomaker/src/main/java/com/amazonaws/services/robomaker/AWSRoboMakerClient.java#L1022-L1026
train
Deletes a simulation application.
Create a Java method that does the following: "Deletes a simulation application.".
Of course, here is the Java code you requested: ```java @Override public DeleteSimulationApplicationResult deleteSimulationApplication(DeleteSimulationApplicationRequest request) { request = beforeClientExecution(request); return executeDeleteSimulationApplication(request); } ``` Hope this hel...
aws/aws-sdk-java
aws-java-sdk-servicecatalog/src/main/java/com/amazonaws/services/servicecatalog/model/transform/ProvisionedProductPlanDetailsMarshaller.java
ProvisionedProductPlanDetailsMarshaller.marshall
public void marshall(ProvisionedProductPlanDetails provisionedProductPlanDetails, ProtocolMarshaller protocolMarshaller) { if (provisionedProductPlanDetails == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.m...
java
public void marshall(ProvisionedProductPlanDetails provisionedProductPlanDetails, ProtocolMarshaller protocolMarshaller) { if (provisionedProductPlanDetails == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.m...
[ "public", "void", "marshall", "(", "ProvisionedProductPlanDetails", "provisionedProductPlanDetails", ",", "ProtocolMarshaller", "protocolMarshaller", ")", "{", "if", "(", "provisionedProductPlanDetails", "==", "null", ")", "{", "throw", "new", "SdkClientException", "(", "...
Marshall the given parameter object.
[ "Marshall", "the", "given", "parameter", "object", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-servicecatalog/src/main/java/com/amazonaws/services/servicecatalog/model/transform/ProvisionedProductPlanDetailsMarshaller.java#L71-L96
train
marshalls the provisionedProductPlanDetails to the JSON object.
Create a Java method that does the following: "marshalls the provisionedProductPlanDetails to the JSON object.".
Of course, here is the Java code you requested: ```java public void marshall(ProvisionedProductPlanDetails provisionedProductPlanDetails, ProtocolMarshaller protocolMarshaller) { if (provisionedProductPlanDetails == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); ...
rythmengine/rythmengine
src/main/java/org/rythmengine/utils/S.java
S.len
@Transformer public static int len(Object o) { if (o instanceof Collection) { return ((Collection)o).size(); } else if (o instanceof Map) { return ((Map)o).size(); } else if (o.getClass().isArray()) { return Array.getLength(o); } else { ...
java
@Transformer public static int len(Object o) { if (o instanceof Collection) { return ((Collection)o).size(); } else if (o instanceof Map) { return ((Map)o).size(); } else if (o.getClass().isArray()) { return Array.getLength(o); } else { ...
[ "@", "Transformer", "public", "static", "int", "len", "(", "Object", "o", ")", "{", "if", "(", "o", "instanceof", "Collection", ")", "{", "return", "(", "(", "Collection", ")", "o", ")", ".", "size", "(", ")", ";", "}", "else", "if", "(", "o", "i...
get length of specified object <ul> <li>If o is a Collection or Map, then return size of it</li> <li>If o is an array, then return length of it</li> <li>Otherwise return length() of String representation of the object</li> </ul> @param o @return length
[ "get", "length", "of", "specified", "object" ]
064b565f08d9da07378bf77a9dd856ea5831cc92
https://github.com/rythmengine/rythmengine/blob/064b565f08d9da07378bf77a9dd856ea5831cc92/src/main/java/org/rythmengine/utils/S.java#L939-L950
train
Get the length of the object.
Create a Java method that does the following: "Get the length of the object.".
Of course, here is the Java code you requested: ```java @Transformer public static int len(Object o) { if (o instanceof Collection) { return ((Collection)o).size(); } else if (o instanceof Map) { return ((Map)o).size(); } else if (o.getClass().isArray()) { ...
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/authentication/authenticationtacacspolicy_authenticationvserver_binding.java
authenticationtacacspolicy_authenticationvserver_binding.get
public static authenticationtacacspolicy_authenticationvserver_binding[] get(nitro_service service, String name) throws Exception{ authenticationtacacspolicy_authenticationvserver_binding obj = new authenticationtacacspolicy_authenticationvserver_binding(); obj.set_name(name); authenticationtacacspolicy_authentic...
java
public static authenticationtacacspolicy_authenticationvserver_binding[] get(nitro_service service, String name) throws Exception{ authenticationtacacspolicy_authenticationvserver_binding obj = new authenticationtacacspolicy_authenticationvserver_binding(); obj.set_name(name); authenticationtacacspolicy_authentic...
[ "public", "static", "authenticationtacacspolicy_authenticationvserver_binding", "[", "]", "get", "(", "nitro_service", "service", ",", "String", "name", ")", "throws", "Exception", "{", "authenticationtacacspolicy_authenticationvserver_binding", "obj", "=", "new", "authentica...
Use this API to fetch authenticationtacacspolicy_authenticationvserver_binding resources of given name .
[ "Use", "this", "API", "to", "fetch", "authenticationtacacspolicy_authenticationvserver_binding", "resources", "of", "given", "name", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/authentication/authenticationtacacspolicy_authenticationvserver_binding.java#L132-L137
train
Use this API to fetch authenticationtacacspolicy_authenticationvserver_binding resources of given name.
Create a Java method that does the following: "Use this API to fetch authenticationtacacspolicy_authenticationvserver_binding resources of given name.".
Of course, here is the Java code you requested: ```java public static authenticationtacacspolicy_authenticationvserver_binding[] get(nitro_service service, String name) throws Exception{ authenticationtacacspolicy_authenticationvserver_binding obj = new authenticationtacacspolicy_authenticationvserver_binding(); o...
BlueBrain/bluima
modules/bluima_utils/src/main/java/ch/epfl/bbp/uima/BlueCasUtil.java
BlueCasUtil.asList
public static <T extends TOP> List<T> asList(Iterable<T> select) { return Lists.newLinkedList(select); }
java
public static <T extends TOP> List<T> asList(Iterable<T> select) { return Lists.newLinkedList(select); }
[ "public", "static", "<", "T", "extends", "TOP", ">", "List", "<", "T", ">", "asList", "(", "Iterable", "<", "T", ">", "select", ")", "{", "return", "Lists", ".", "newLinkedList", "(", "select", ")", ";", "}" ]
(Potentially) Slow, but convenient @param select comes from {@link JCasUtil} select.
[ "(", "Potentially", ")", "Slow", "but", "convenient" ]
793ea3f46761dce72094e057a56cddfa677156ae
https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_utils/src/main/java/ch/epfl/bbp/uima/BlueCasUtil.java#L433-L435
train
Returns a list of all the objects in the given iterable.
Create a Java method that does the following: "Returns a list of all the objects in the given iterable.".
Of course, here is the Java code you requested: ```java public static <T extends TOP> List<T> asList(Iterable<T> select) { return Lists.newLinkedList(select); } ``` Hope this helps!
opensourceBIM/BIMserver
PluginBase/generated/org/bimserver/models/ifc2x3tc1/impl/Ifc2x3tc1PackageImpl.java
Ifc2x3tc1PackageImpl.getIfcUnitEnum
public EEnum getIfcUnitEnum() { if (ifcUnitEnumEEnum == null) { ifcUnitEnumEEnum = (EEnum) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI) .getEClassifiers().get(923); } return ifcUnitEnumEEnum; }
java
public EEnum getIfcUnitEnum() { if (ifcUnitEnumEEnum == null) { ifcUnitEnumEEnum = (EEnum) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI) .getEClassifiers().get(923); } return ifcUnitEnumEEnum; }
[ "public", "EEnum", "getIfcUnitEnum", "(", ")", "{", "if", "(", "ifcUnitEnumEEnum", "==", "null", ")", "{", "ifcUnitEnumEEnum", "=", "(", "EEnum", ")", "EPackage", ".", "Registry", ".", "INSTANCE", ".", "getEPackage", "(", "Ifc2x3tc1Package", ".", "eNS_URI", ...
<!-- 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/ifc2x3tc1/impl/Ifc2x3tc1PackageImpl.java#L38312-L38318
train
Get the EEnum for the ifcUnitEnum attribute.
Create a Java method that does the following: "Get the EEnum for the ifcUnitEnum attribute.".
Of course, here is the Java code you requested: ```java public EEnum getIfcUnitEnum() { if (ifcUnitEnumEEnum == null) { ifcUnitEnumEEnum = (EEnum) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI) .getEClassifiers().get(923); } return ifcUnitEnumEEnum; } ``` Hope this helps!
samskivert/pythagoras
src/main/java/pythagoras/f/Quaternion.java
Quaternion.fromAngles
public Quaternion fromAngles (Vector3 angles) { return fromAngles(angles.x, angles.y, angles.z); }
java
public Quaternion fromAngles (Vector3 angles) { return fromAngles(angles.x, angles.y, angles.z); }
[ "public", "Quaternion", "fromAngles", "(", "Vector3", "angles", ")", "{", "return", "fromAngles", "(", "angles", ".", "x", ",", "angles", ".", "y", ",", "angles", ".", "z", ")", ";", "}" ]
Sets this quaternion to one that first rotates about x by the specified number of radians, then rotates about y, then about z.
[ "Sets", "this", "quaternion", "to", "one", "that", "first", "rotates", "about", "x", "by", "the", "specified", "number", "of", "radians", "then", "rotates", "about", "y", "then", "about", "z", "." ]
b8fea743ee8a7d742ad9c06ee4f11f50571fbd32
https://github.com/samskivert/pythagoras/blob/b8fea743ee8a7d742ad9c06ee4f11f50571fbd32/src/main/java/pythagoras/f/Quaternion.java#L206-L208
train
Create a Quaternion from the given angle vector.
Create a Java method that does the following: "Create a Quaternion from the given angle vector.".
Of course, here is the Java code you requested: ```java public Quaternion fromAngles (Vector3 angles) { return fromAngles(angles.x, angles.y, angles.z); } ``` Hope this helps!
lucee/Lucee
core/src/main/java/lucee/runtime/text/xml/XMLCaster.java
XMLCaster.toNode
@Deprecated public static Node toNode(Object o) throws PageException { if (o instanceof XMLStruct) return ((XMLStruct) o).toNode(); if (o instanceof Node) return (Node) o; throw new CasterException(o, "node"); }
java
@Deprecated public static Node toNode(Object o) throws PageException { if (o instanceof XMLStruct) return ((XMLStruct) o).toNode(); if (o instanceof Node) return (Node) o; throw new CasterException(o, "node"); }
[ "@", "Deprecated", "public", "static", "Node", "toNode", "(", "Object", "o", ")", "throws", "PageException", "{", "if", "(", "o", "instanceof", "XMLStruct", ")", "return", "(", "(", "XMLStruct", ")", "o", ")", ".", "toNode", "(", ")", ";", "if", "(", ...
casts a value to a XML Node @param doc XML Document @param o Object to cast @return XML Element Object @throws PageException @deprecated replaced with toRawNode
[ "casts", "a", "value", "to", "a", "XML", "Node" ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/text/xml/XMLCaster.java#L331-L336
train
casts a Object to a XML Node
Create a Java method that does the following: "casts a Object to a XML Node".
Of course, here is the Java code you requested: ```java @Deprecated public static Node toNode(Object o) throws PageException { if (o instanceof XMLStruct) return ((XMLStruct) o).toNode(); if (o instanceof Node) return (Node) o; throw new CasterException(o, "node"); } ``` Hope this helps!
nyla-solutions/gedi-geode
gedi-geode-extensions-core/src/main/java/gedi/solutions/geode/listeners/CacheListenerBridge.java
CacheListenerBridge.forAfterPut
public static<K, V> CacheListenerBridge<K, V> forAfterPut(Consumer<EntryEvent<K, V>> consumer) { return new CacheListenerBridge<K, V>(consumer,null); }
java
public static<K, V> CacheListenerBridge<K, V> forAfterPut(Consumer<EntryEvent<K, V>> consumer) { return new CacheListenerBridge<K, V>(consumer,null); }
[ "public", "static", "<", "K", ",", "V", ">", "CacheListenerBridge", "<", "K", ",", "V", ">", "forAfterPut", "(", "Consumer", "<", "EntryEvent", "<", "K", ",", "V", ">", ">", "consumer", ")", "{", "return", "new", "CacheListenerBridge", "<", "K", ",", ...
Factory method for put events registration @param <K> the key type @param <V> the value type @param consumer the observer to notify @return the listener
[ "Factory", "method", "for", "put", "events", "registration" ]
3dd71d6e66e941ce350b306b70677ee95a7d9eee
https://github.com/nyla-solutions/gedi-geode/blob/3dd71d6e66e941ce350b306b70677ee95a7d9eee/gedi-geode-extensions-core/src/main/java/gedi/solutions/geode/listeners/CacheListenerBridge.java#L43-L46
test
Create a CacheListenerBridge for the CacheListener for after put.
Create a Java method that does the following: "Create a CacheListenerBridge for the CacheListener for after put.".
Of course, here is the Java code you requested: ```java public static<K, V> CacheListenerBridge<K, V> forAfterPut(Consumer<EntryEvent<K, V>> consumer) { return new CacheListenerBridge<K, V>(consumer,null); } ``` Hope this helps!
RestComm/sip-servlets
sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/message/SipServletMessageImpl.java
SipServletMessageImpl.getTo
public Address getTo() { ToHeader to = (ToHeader) this.message .getHeader(getCorrectHeaderName(ToHeader.NAME)); // return new AddressImpl(to.getAddress(), AddressImpl.getParameters((Parameters)to), ModifiableRule.To); // https://code.google.com/p/sipservlets/issues/detail?id=245 try { return new ...
java
public Address getTo() { ToHeader to = (ToHeader) this.message .getHeader(getCorrectHeaderName(ToHeader.NAME)); // return new AddressImpl(to.getAddress(), AddressImpl.getParameters((Parameters)to), ModifiableRule.To); // https://code.google.com/p/sipservlets/issues/detail?id=245 try { return new ...
[ "public", "Address", "getTo", "(", ")", "{", "ToHeader", "to", "=", "(", "ToHeader", ")", "this", ".", "message", ".", "getHeader", "(", "getCorrectHeaderName", "(", "ToHeader", ".", "NAME", ")", ")", ";", "// return new AddressImpl(to.getAddress(), AddressImpl.ge...
/* (non-Javadoc) @see javax.servlet.sip.SipServletMessage#getTo()
[ "/", "*", "(", "non", "-", "Javadoc", ")" ]
fd7011d2803ab1d205b140768a760c8c69e0c997
https://github.com/RestComm/sip-servlets/blob/fd7011d2803ab1d205b140768a760c8c69e0c997/sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/message/SipServletMessageImpl.java#L1299-L1309
train
Gets the To header.
Create a Java method that does the following: "Gets the To header.".
Of course, here is the Java code you requested: ```java public Address getTo() { ToHeader to = (ToHeader) this.message .getHeader(getCorrectHeaderName(ToHeader.NAME)); // return new AddressImpl(to.getAddress(), AddressImpl.getParameters((Parameters)to), ModifiableRule.To); // https://code.google.com/p/sipserv...
cdapio/tephra
tephra-core/src/main/java/co/cask/tephra/TransactionContext.java
TransactionContext.finish
public void finish() throws TransactionFailureException { Preconditions.checkState(currentTx != null, "Cannot finish tx that has not been started"); // each of these steps will abort and rollback the tx in case if errors, and throw an exception checkForConflicts(); persist(); commit(); postCommi...
java
public void finish() throws TransactionFailureException { Preconditions.checkState(currentTx != null, "Cannot finish tx that has not been started"); // each of these steps will abort and rollback the tx in case if errors, and throw an exception checkForConflicts(); persist(); commit(); postCommi...
[ "public", "void", "finish", "(", ")", "throws", "TransactionFailureException", "{", "Preconditions", ".", "checkState", "(", "currentTx", "!=", "null", ",", "\"Cannot finish tx that has not been started\"", ")", ";", "// each of these steps will abort and rollback the tx in cas...
Commits the current transaction. This will: check for any conflicts, based on the change set aggregated from all registered {@link TransactionAware} instances; flush any pending writes from the {@code TransactionAware}s; commit the current transaction with the {@link TransactionSystemClient}; and clear the current tra...
[ "Commits", "the", "current", "transaction", ".", "This", "will", ":", "check", "for", "any", "conflicts", "based", "on", "the", "change", "set", "aggregated", "from", "all", "registered", "{", "@link", "TransactionAware", "}", "instances", ";", "flush", "any",...
082c56c15c6ece15002631ff6f89206a00d8915c
https://github.com/cdapio/tephra/blob/082c56c15c6ece15002631ff6f89206a00d8915c/tephra-core/src/main/java/co/cask/tephra/TransactionContext.java#L111-L119
train
Finishes the transaction.
Create a Java method that does the following: "Finishes the transaction.".
Of course, here is the Java code you requested: ```java public void finish() throws TransactionFailureException { Preconditions.checkState(currentTx != null, "Cannot finish tx that has not been started"); // each of these steps will abort and rollback the tx in case if errors, and throw an exception checkF...
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/MariaDbConnection.java
MariaDbConnection.setTransactionIsolation
public void setTransactionIsolation(final int level) throws SQLException { try { stateFlag |= ConnectionState.STATE_TRANSACTION_ISOLATION; protocol.setTransactionIsolation(level); } catch (SQLException e) { throw ExceptionMapper.getException(e, this, null, false); } }
java
public void setTransactionIsolation(final int level) throws SQLException { try { stateFlag |= ConnectionState.STATE_TRANSACTION_ISOLATION; protocol.setTransactionIsolation(level); } catch (SQLException e) { throw ExceptionMapper.getException(e, this, null, false); } }
[ "public", "void", "setTransactionIsolation", "(", "final", "int", "level", ")", "throws", "SQLException", "{", "try", "{", "stateFlag", "|=", "ConnectionState", ".", "STATE_TRANSACTION_ISOLATION", ";", "protocol", ".", "setTransactionIsolation", "(", "level", ")", "...
<p>Attempts to change the transaction isolation level for this <code>Connection</code> object to the one given. The constants defined in the interface <code>Connection</code> are the possible transaction isolation levels.</p> <p><B>Note:</B> If this method is called during a transaction, the result is implementation-de...
[ "<p", ">", "Attempts", "to", "change", "the", "transaction", "isolation", "level", "for", "this", "<code", ">", "Connection<", "/", "code", ">", "object", "to", "the", "one", "given", ".", "The", "constants", "defined", "in", "the", "interface", "<code", "...
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/MariaDbConnection.java#L974-L981
train
Set the transaction isolation level.
Create a Java method that does the following: "Set the transaction isolation level.".
Of course, here is the Java code you requested: ```java public void setTransactionIsolation(final int level) throws SQLException { try { stateFlag |= ConnectionState.STATE_TRANSACTION_ISOLATION; protocol.setTransactionIsolation(level); } catch (SQLException e) { throw ExceptionMapper.getExcep...
apache/incubator-gobblin
gobblin-utility/src/main/java/org/apache/gobblin/util/limiter/DefaultLimiterFactory.java
DefaultLimiterFactory.newLimiter
public static Limiter newLimiter(State state) { state = convertDeprecatedConfigs(state); Preconditions.checkArgument(state.contains(EXTRACT_LIMIT_TYPE_KEY), String.format("Missing configuration property %s for the Limiter type", EXTRACT_LIMIT_TYPE_KEY)); BaseLimiterType type = BaseLimiterType.forNam...
java
public static Limiter newLimiter(State state) { state = convertDeprecatedConfigs(state); Preconditions.checkArgument(state.contains(EXTRACT_LIMIT_TYPE_KEY), String.format("Missing configuration property %s for the Limiter type", EXTRACT_LIMIT_TYPE_KEY)); BaseLimiterType type = BaseLimiterType.forNam...
[ "public", "static", "Limiter", "newLimiter", "(", "State", "state", ")", "{", "state", "=", "convertDeprecatedConfigs", "(", "state", ")", ";", "Preconditions", ".", "checkArgument", "(", "state", ".", "contains", "(", "EXTRACT_LIMIT_TYPE_KEY", ")", ",", "String...
Create a new {@link Limiter} instance of one of the types in {@link BaseLimiterType}. <p> Note this method will always return a new {@link Limiter} instance of one of the supported types defined in {@link BaseLimiterType} as long as the input configuration specifies a supported {@link BaseLimiterType}. It will throw a...
[ "Create", "a", "new", "{", "@link", "Limiter", "}", "instance", "of", "one", "of", "the", "types", "in", "{", "@link", "BaseLimiterType", "}", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/limiter/DefaultLimiterFactory.java#L79-L113
train
Creates a new Limiter instance from the given configuration.
Create a Java method that does the following: "Creates a new Limiter instance from the given configuration.".
Of course, here is the Java code you requested: ```java public static Limiter newLimiter(State state) { state = convertDeprecatedConfigs(state); Preconditions.checkArgument(state.contains(EXTRACT_LIMIT_TYPE_KEY), String.format("Missing configuration property %s for the Limiter type", EXTRACT_LIMIT_TYPE...
deeplearning4j/deeplearning4j
datavec/datavec-spark/src/main/java/org/datavec/spark/transform/AnalyzeSpark.java
AnalyzeSpark.sampleInvalidFromColumn
public static List<Writable> sampleInvalidFromColumn(int numToSample, String columnName, Schema schema, JavaRDD<List<Writable>> data) { return sampleInvalidFromColumn(numToSample, columnName, schema, data, false); }
java
public static List<Writable> sampleInvalidFromColumn(int numToSample, String columnName, Schema schema, JavaRDD<List<Writable>> data) { return sampleInvalidFromColumn(numToSample, columnName, schema, data, false); }
[ "public", "static", "List", "<", "Writable", ">", "sampleInvalidFromColumn", "(", "int", "numToSample", ",", "String", "columnName", ",", "Schema", "schema", ",", "JavaRDD", "<", "List", "<", "Writable", ">", ">", "data", ")", "{", "return", "sampleInvalidFrom...
Randomly sample a set of invalid values from a specified column. Values are considered invalid according to the Schema / ColumnMetaData @param numToSample Maximum number of invalid values to sample @param columnName Same of the column from which to sample invalid values @param schema Data schema @param ...
[ "Randomly", "sample", "a", "set", "of", "invalid", "values", "from", "a", "specified", "column", ".", "Values", "are", "considered", "invalid", "according", "to", "the", "Schema", "/", "ColumnMetaData" ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-spark/src/main/java/org/datavec/spark/transform/AnalyzeSpark.java#L312-L315
train
Sample invalid from column
Create a Java method that does the following: "Sample invalid from column".
Of course, here is the Java code you requested: ```java public static List<Writable> sampleInvalidFromColumn(int numToSample, String columnName, Schema schema, JavaRDD<List<Writable>> data) { return sampleInvalidFromColumn(numToSample, columnName, schema, data, false); } ``` Hope this ...
Alluxio/alluxio
core/client/fs/src/main/java/alluxio/client/file/FileSystemUtils.java
FileSystemUtils.persistAndWait
public static void persistAndWait(final FileSystem fs, final AlluxioURI uri, int timeoutMs) throws FileDoesNotExistException, IOException, AlluxioException, TimeoutException, InterruptedException { fs.persist(uri); CommonUtils.waitFor(String.format("%s to be persisted", uri) , () -> { try { ...
java
public static void persistAndWait(final FileSystem fs, final AlluxioURI uri, int timeoutMs) throws FileDoesNotExistException, IOException, AlluxioException, TimeoutException, InterruptedException { fs.persist(uri); CommonUtils.waitFor(String.format("%s to be persisted", uri) , () -> { try { ...
[ "public", "static", "void", "persistAndWait", "(", "final", "FileSystem", "fs", ",", "final", "AlluxioURI", "uri", ",", "int", "timeoutMs", ")", "throws", "FileDoesNotExistException", ",", "IOException", ",", "AlluxioException", ",", "TimeoutException", ",", "Interr...
Persists the given path to the under file system and returns once the persist is complete. Note that if this method times out, the persist may still occur after the timeout period. @param fs {@link FileSystem} to carry out Alluxio operations @param uri the uri of the file to persist @param timeoutMs max amount of time...
[ "Persists", "the", "given", "path", "to", "the", "under", "file", "system", "and", "returns", "once", "the", "persist", "is", "complete", ".", "Note", "that", "if", "this", "method", "times", "out", "the", "persist", "may", "still", "occur", "after", "the"...
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/client/fs/src/main/java/alluxio/client/file/FileSystemUtils.java#L150-L163
train
Persist and wait for a timeout.
Create a Java method that does the following: "Persist and wait for a timeout.".
Of course, here is the Java code you requested: ```java public static void persistAndWait(final FileSystem fs, final AlluxioURI uri, int timeoutMs) throws FileDoesNotExistException, IOException, AlluxioException, TimeoutException, InterruptedException { fs.persist(uri); CommonUtils.waitFor(String.f...
mozilla/rhino
src/org/mozilla/javascript/NativeArray.java
NativeArray.getRawElem
private static Object getRawElem(Scriptable target, long index) { if (index > Integer.MAX_VALUE) { return ScriptableObject.getProperty(target, Long.toString(index)); } return ScriptableObject.getProperty(target, (int)index); }
java
private static Object getRawElem(Scriptable target, long index) { if (index > Integer.MAX_VALUE) { return ScriptableObject.getProperty(target, Long.toString(index)); } return ScriptableObject.getProperty(target, (int)index); }
[ "private", "static", "Object", "getRawElem", "(", "Scriptable", "target", ",", "long", "index", ")", "{", "if", "(", "index", ">", "Integer", ".", "MAX_VALUE", ")", "{", "return", "ScriptableObject", ".", "getProperty", "(", "target", ",", "Long", ".", "to...
same as getElem, but without converting NOT_FOUND to undefined
[ "same", "as", "getElem", "but", "without", "converting", "NOT_FOUND", "to", "undefined" ]
fa8a86df11d37623f5faa8d445a5876612bc47b0
https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/NativeArray.java#L793-L798
train
Get the raw element of a class.
Create a Java method that does the following: "Get the raw element of a class.".
Of course, here is the Java code you requested: ```java private static Object getRawElem(Scriptable target, long index) { if (index > Integer.MAX_VALUE) { return ScriptableObject.getProperty(target, Long.toString(index)); } return ScriptableObject.getProperty(target, (int)index); ...
jenkinsci/jenkins
core/src/main/java/hudson/model/Job.java
Job.getBuildDiscarder
public synchronized BuildDiscarder getBuildDiscarder() { BuildDiscarderProperty prop = _getProperty(BuildDiscarderProperty.class); return prop != null ? prop.getStrategy() : /* settings compatibility */ logRotator; }
java
public synchronized BuildDiscarder getBuildDiscarder() { BuildDiscarderProperty prop = _getProperty(BuildDiscarderProperty.class); return prop != null ? prop.getStrategy() : /* settings compatibility */ logRotator; }
[ "public", "synchronized", "BuildDiscarder", "getBuildDiscarder", "(", ")", "{", "BuildDiscarderProperty", "prop", "=", "_getProperty", "(", "BuildDiscarderProperty", ".", "class", ")", ";", "return", "prop", "!=", "null", "?", "prop", ".", "getStrategy", "(", ")",...
Returns the configured build discarder for this job, via {@link BuildDiscarderProperty}, or null if none.
[ "Returns", "the", "configured", "build", "discarder", "for", "this", "job", "via", "{" ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/Job.java#L423-L426
train
Get the build discarder.
Create a Java method that does the following: "Get the build discarder.".
Of course, here is the Java code you requested: ```java public synchronized BuildDiscarder getBuildDiscarder() { BuildDiscarderProperty prop = _getProperty(BuildDiscarderProperty.class); return prop != null ? prop.getStrategy() : /* settings compatibility */ logRotator; } ``` Hope this helps!
meertensinstituut/mtas
src/main/java/mtas/codec/util/CodecCollector.java
CodecCollector.createQueryFromGroupHit
private static MtasSpanQuery createQueryFromGroupHit(Set<String> prefixes, String field, GroupHit hit) { // initial check if (prefixes == null || field == null || hit == null) { return null; } else { MtasSpanQuery query = null; // check for missing if (hit.missingLeft != null &...
java
private static MtasSpanQuery createQueryFromGroupHit(Set<String> prefixes, String field, GroupHit hit) { // initial check if (prefixes == null || field == null || hit == null) { return null; } else { MtasSpanQuery query = null; // check for missing if (hit.missingLeft != null &...
[ "private", "static", "MtasSpanQuery", "createQueryFromGroupHit", "(", "Set", "<", "String", ">", "prefixes", ",", "String", "field", ",", "GroupHit", "hit", ")", "{", "// initial check", "if", "(", "prefixes", "==", "null", "||", "field", "==", "null", "||", ...
Creates the query from group hit. @param prefixes the prefixes @param field the field @param hit the hit @return the mtas span query
[ "Creates", "the", "query", "from", "group", "hit", "." ]
f02ae730848616bd88b553efa7f9eddc32818e64
https://github.com/meertensinstituut/mtas/blob/f02ae730848616bd88b553efa7f9eddc32818e64/src/main/java/mtas/codec/util/CodecCollector.java#L1108-L1154
train
Create query from group hit.
Create a Java method that does the following: "Create query from group hit.".
Of course, here is the Java code you requested: ```java private static MtasSpanQuery createQueryFromGroupHit(Set<String> prefixes, String field, GroupHit hit) { // initial check if (prefixes == null || field == null || hit == null) { return null; } else { MtasSpanQuery query = null; ...
jcuda/jcublas
JCublasJava/src/main/java/jcuda/jcublas/JCublas.java
JCublas.cublasCgemv
public static void cublasCgemv(char trans, int m, int n, cuComplex alpha, Pointer A, int lda, Pointer x, int incx, cuComplex beta, Pointer y, int incy) { cublasCgemvNative(trans, m, n, alpha, A, lda, x, incx, beta, y, incy); checkResultBLAS(); }
java
public static void cublasCgemv(char trans, int m, int n, cuComplex alpha, Pointer A, int lda, Pointer x, int incx, cuComplex beta, Pointer y, int incy) { cublasCgemvNative(trans, m, n, alpha, A, lda, x, incx, beta, y, incy); checkResultBLAS(); }
[ "public", "static", "void", "cublasCgemv", "(", "char", "trans", ",", "int", "m", ",", "int", "n", ",", "cuComplex", "alpha", ",", "Pointer", "A", ",", "int", "lda", ",", "Pointer", "x", ",", "int", "incx", ",", "cuComplex", "beta", ",", "Pointer", "...
<pre> cublasCgemv (char trans, int m, int n, cuComplex alpha, const cuComplex *A, int lda, const cuComplex *x, int incx, cuComplex beta, cuComplex *y, int incy) performs one of the matrix-vector operations y = alpha * op(A) * x + beta * y, where op(A) is one of op(A) = A or op(A) = transpose(A) or op(A) = conju...
[ "<pre", ">", "cublasCgemv", "(", "char", "trans", "int", "m", "int", "n", "cuComplex", "alpha", "const", "cuComplex", "*", "A", "int", "lda", "const", "cuComplex", "*", "x", "int", "incx", "cuComplex", "beta", "cuComplex", "*", "y", "int", "incy", ")" ]
80875235d24562073f4d66651dd17263f306427d
https://github.com/jcuda/jcublas/blob/80875235d24562073f4d66651dd17263f306427d/JCublasJava/src/main/java/jcuda/jcublas/JCublas.java#L4655-L4659
test
Cublas C GEMV operation
Create a Java method that does the following: "Cublas C GEMV operation".
Of course, here is the Java code you requested: ```java public static void cublasCgemv(char trans, int m, int n, cuComplex alpha, Pointer A, int lda, Pointer x, int incx, cuComplex beta, Pointer y, int incy) { cublasCgemvNative(trans, m, n, alpha, A, lda, x, incx, beta, y, incy); checkResultBLAS...
mgormley/pacaya
src/main/java/edu/jhu/pacaya/parse/dep/ParentsArray.java
ParentsArray.containsCycle
public static boolean containsCycle(int[] parents) { for (int i=0; i<parents.length; i++) { int numAncestors = 0; int parent = parents[i]; while(parent != ParentsArray.WALL_POSITION) { numAncestors += 1; if (numAncestors > parents.length - 1) {...
java
public static boolean containsCycle(int[] parents) { for (int i=0; i<parents.length; i++) { int numAncestors = 0; int parent = parents[i]; while(parent != ParentsArray.WALL_POSITION) { numAncestors += 1; if (numAncestors > parents.length - 1) {...
[ "public", "static", "boolean", "containsCycle", "(", "int", "[", "]", "parents", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "parents", ".", "length", ";", "i", "++", ")", "{", "int", "numAncestors", "=", "0", ";", "int", "parent", ...
Checks if a dependency tree represented as a parents array contains a cycle. @param parents A parents array where parents[i] contains the index of the parent of the word at position i, with parents[i] = -1 indicating that the parent of word i is the wall node. @return True if the tree specified by the parents array co...
[ "Checks", "if", "a", "dependency", "tree", "represented", "as", "a", "parents", "array", "contains", "a", "cycle", "." ]
786294cbac7cc65dbc32210c10acc32ed0c69233
https://github.com/mgormley/pacaya/blob/786294cbac7cc65dbc32210c10acc32ed0c69233/src/main/java/edu/jhu/pacaya/parse/dep/ParentsArray.java#L123-L136
train
Checks if the array of parents contains cycles.
Create a Java method that does the following: "Checks if the array of parents contains cycles.".
Of course, here is the Java code you requested: ```java public static boolean containsCycle(int[] parents) { for (int i=0; i<parents.length; i++) { int numAncestors = 0; int parent = parents[i]; while(parent != ParentsArray.WALL_POSITION) { numAncestors += 1;...
joachimvda/jtransfo
core/src/main/java/org/jtransfo/internal/ConverterHelper.java
ConverterHelper.findField
SyntheticField[] findField(List<SyntheticField> domainFields, String fieldName, String[] path, Class<?> type, boolean readOnlyField) throws JTransfoException { List<SyntheticField> fields = domainFields; SyntheticField[] result = new SyntheticField[path.length + 1]; int index = 0; ...
java
SyntheticField[] findField(List<SyntheticField> domainFields, String fieldName, String[] path, Class<?> type, boolean readOnlyField) throws JTransfoException { List<SyntheticField> fields = domainFields; SyntheticField[] result = new SyntheticField[path.length + 1]; int index = 0; ...
[ "SyntheticField", "[", "]", "findField", "(", "List", "<", "SyntheticField", ">", "domainFields", ",", "String", "fieldName", ",", "String", "[", "]", "path", ",", "Class", "<", "?", ">", "type", ",", "boolean", "readOnlyField", ")", "throws", "JTransfoExcep...
Find one field in a list of fields. @param domainFields list of fields in domain object @param fieldName field to search @param path list of intermediate fields for transitive fields @param type type of object to find fields in @param readOnlyField is the requested field read only @return field with requested name or ...
[ "Find", "one", "field", "in", "a", "list", "of", "fields", "." ]
eb1c72b64b09d6f3b6212bd3f1579cac5c983ea8
https://github.com/joachimvda/jtransfo/blob/eb1c72b64b09d6f3b6212bd3f1579cac5c983ea8/core/src/main/java/org/jtransfo/internal/ConverterHelper.java#L269-L298
train
Find field.
Create a Java method that does the following: "Find field.".
Of course, here is the Java code you requested: ```java SyntheticField[] findField(List<SyntheticField> domainFields, String fieldName, String[] path, Class<?> type, boolean readOnlyField) throws JTransfoException { List<SyntheticField> fields = domainFields; SyntheticField[] result = new S...
kite-sdk/kite
kite-data/kite-data-hbase/src/main/java/org/kitesdk/data/hbase/impl/EntitySerDe.java
EntitySerDe.deserializeKeyAsColumn
private Object deserializeKeyAsColumn(String fieldName, byte[] family, String prefix, Result result) { // Construct a map of keyAsColumn field values. From this we'll be able // to use the entityComposer to construct the entity field value. byte[] prefixBytes = prefix != null ? prefix.getBytes() : nul...
java
private Object deserializeKeyAsColumn(String fieldName, byte[] family, String prefix, Result result) { // Construct a map of keyAsColumn field values. From this we'll be able // to use the entityComposer to construct the entity field value. byte[] prefixBytes = prefix != null ? prefix.getBytes() : nul...
[ "private", "Object", "deserializeKeyAsColumn", "(", "String", "fieldName", ",", "byte", "[", "]", "family", ",", "String", "prefix", ",", "Result", "result", ")", "{", "// Construct a map of keyAsColumn field values. From this we'll be able", "// to use the entityComposer to ...
Deserialize the entity field that has a keyAsColumn mapping. @param fieldName The name of the entity's field we are deserializing. @param family The column family this field is mapped to @param prefix The column qualifier prefix each @param result The HBase Result that represents a row in HBase. @return The deserializ...
[ "Deserialize", "the", "entity", "field", "that", "has", "a", "keyAsColumn", "mapping", "." ]
72bfb4b1a881af85808cd7f14bc3e15160a1e811
https://github.com/kite-sdk/kite/blob/72bfb4b1a881af85808cd7f14bc3e15160a1e811/kite-data/kite-data-hbase/src/main/java/org/kitesdk/data/hbase/impl/EntitySerDe.java#L324-L351
train
Deserialize a keyAsColumn field value.
Create a Java method that does the following: "Deserialize a keyAsColumn field value.".
Of course, here is the Java code you requested: ```java private Object deserializeKeyAsColumn(String fieldName, byte[] family, String prefix, Result result) { // Construct a map of keyAsColumn field values. From this we'll be able // to use the entityComposer to construct the entity field value. byte...
timewalker74/ffmq
core/src/main/java/net/timewalker/ffmq4/common/connection/AbstractConnection.java
AbstractConnection.waitForDeliverySync
protected final void waitForDeliverySync() { List<AbstractSession> sessionsSnapshot = new ArrayList<>(sessions.size()); synchronized (sessions) { sessionsSnapshot.addAll(sessions.values()); } for(int n=0;n<sessionsSnapshot.size();n++) { AbstractSessi...
java
protected final void waitForDeliverySync() { List<AbstractSession> sessionsSnapshot = new ArrayList<>(sessions.size()); synchronized (sessions) { sessionsSnapshot.addAll(sessions.values()); } for(int n=0;n<sessionsSnapshot.size();n++) { AbstractSessi...
[ "protected", "final", "void", "waitForDeliverySync", "(", ")", "{", "List", "<", "AbstractSession", ">", "sessionsSnapshot", "=", "new", "ArrayList", "<>", "(", "sessions", ".", "size", "(", ")", ")", ";", "synchronized", "(", "sessions", ")", "{", "sessions...
Wait for sessions to finish the current deliveridispatching
[ "Wait", "for", "sessions", "to", "finish", "the", "current", "deliveridispatching" ]
638773ee29a4a5f9c6119ed74ad14ac9c46382b3
https://github.com/timewalker74/ffmq/blob/638773ee29a4a5f9c6119ed74ad14ac9c46382b3/core/src/main/java/net/timewalker/ffmq4/common/connection/AbstractConnection.java#L379-L391
train
Wait for delivery sync.
Create a Java method that does the following: "Wait for delivery sync.".
Of course, here is the Java code you requested: ```java protected final void waitForDeliverySync() { List<AbstractSession> sessionsSnapshot = new ArrayList<>(sessions.size()); synchronized (sessions) { sessionsSnapshot.addAll(sessions.values()); } for(int n=0;n<session...
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/internal/journal/EventJournalReadOperation.java
EventJournalReadOperation.beforeRun
@Override public void beforeRun() { namespace = new DistributedObjectNamespace(getServiceName(), name); final EventJournal<J> journal = getJournal(); if (!journal.hasEventJournal(namespace)) { throw new UnsupportedOperationException( "Cannot subscribe to even...
java
@Override public void beforeRun() { namespace = new DistributedObjectNamespace(getServiceName(), name); final EventJournal<J> journal = getJournal(); if (!journal.hasEventJournal(namespace)) { throw new UnsupportedOperationException( "Cannot subscribe to even...
[ "@", "Override", "public", "void", "beforeRun", "(", ")", "{", "namespace", "=", "new", "DistributedObjectNamespace", "(", "getServiceName", "(", ")", ",", "name", ")", ";", "final", "EventJournal", "<", "J", ">", "journal", "=", "getJournal", "(", ")", ";...
{@inheritDoc} Checks the precondition that the start sequence is already available (in the event journal) or is the sequence of the next event to be added into the journal.
[ "{" ]
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/internal/journal/EventJournalReadOperation.java#L75-L96
train
This method is called before the cache is started.
Create a Java method that does the following: "This method is called before the cache is started.".
Of course, here is the Java code you requested: ```java @Override public void beforeRun() { namespace = new DistributedObjectNamespace(getServiceName(), name); final EventJournal<J> journal = getJournal(); if (!journal.hasEventJournal(namespace)) { throw new UnsupportedOperatio...
jmapper-framework/jmapper-core
JMapper Framework/src/main/java/com/googlecode/jmapper/config/Error.java
Error.absentRelationship
public static void absentRelationship(Class<?> configuredClass, Class<?> targetClass){ throw new AbsentRelationshipException(MSG.INSTANCE.message(noRelationshipException,configuredClass.getSimpleName(),targetClass.getSimpleName())); }
java
public static void absentRelationship(Class<?> configuredClass, Class<?> targetClass){ throw new AbsentRelationshipException(MSG.INSTANCE.message(noRelationshipException,configuredClass.getSimpleName(),targetClass.getSimpleName())); }
[ "public", "static", "void", "absentRelationship", "(", "Class", "<", "?", ">", "configuredClass", ",", "Class", "<", "?", ">", "targetClass", ")", "{", "throw", "new", "AbsentRelationshipException", "(", "MSG", ".", "INSTANCE", ".", "message", "(", "noRelation...
Thrown when there isn't correspondence between classes. @param configuredClass configured class @param targetClass target class
[ "Thrown", "when", "there", "isn", "t", "correspondence", "between", "classes", "." ]
b48fd3527f35055b8b4a30f53a51136f183acc90
https://github.com/jmapper-framework/jmapper-core/blob/b48fd3527f35055b8b4a30f53a51136f183acc90/JMapper Framework/src/main/java/com/googlecode/jmapper/config/Error.java#L609-L611
train
Thrown when an absent relationship is not found in the configured class.
Create a Java method that does the following: "Thrown when an absent relationship is not found in the configured class.".
Of course, here is the Java code you requested: ```java public static void absentRelationship(Class<?> configuredClass, Class<?> targetClass){ throw new AbsentRelationshipException(MSG.INSTANCE.message(noRelationshipException,configuredClass.getSimpleName(),targetClass.getSimpleName())); } ``` Hope this helps!
aws/aws-sdk-java
aws-java-sdk-ssm/src/main/java/com/amazonaws/services/simplesystemsmanagement/model/transform/AutomationExecutionFilterMarshaller.java
AutomationExecutionFilterMarshaller.marshall
public void marshall(AutomationExecutionFilter automationExecutionFilter, ProtocolMarshaller protocolMarshaller) { if (automationExecutionFilter == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(auto...
java
public void marshall(AutomationExecutionFilter automationExecutionFilter, ProtocolMarshaller protocolMarshaller) { if (automationExecutionFilter == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(auto...
[ "public", "void", "marshall", "(", "AutomationExecutionFilter", "automationExecutionFilter", ",", "ProtocolMarshaller", "protocolMarshaller", ")", "{", "if", "(", "automationExecutionFilter", "==", "null", ")", "{", "throw", "new", "SdkClientException", "(", "\"Invalid ar...
Marshall the given parameter object.
[ "Marshall", "the", "given", "parameter", "object", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-ssm/src/main/java/com/amazonaws/services/simplesystemsmanagement/model/transform/AutomationExecutionFilterMarshaller.java#L45-L57
train
marshalls the given automationExecutionFilter to the JSON - compatible parameter object.
Create a Java method that does the following: "marshalls the given automationExecutionFilter to the JSON - compatible parameter object.".
Of course, here is the Java code you requested: ```java public void marshall(AutomationExecutionFilter automationExecutionFilter, ProtocolMarshaller protocolMarshaller) { if (automationExecutionFilter == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } ...
sebastiangraf/treetank
interfacemodules/xml/src/main/java/org/treetank/service/xml/xpath/parser/XPathParser.java
XPathParser.parseAttributeNameOrWildcard
private String parseAttributeNameOrWildcard() { String name; if (is(TokenType.STAR, true)) { name = mToken.getContent(); } else { name = parseAttributeName(); } return name; }
java
private String parseAttributeNameOrWildcard() { String name; if (is(TokenType.STAR, true)) { name = mToken.getContent(); } else { name = parseAttributeName(); } return name; }
[ "private", "String", "parseAttributeNameOrWildcard", "(", ")", "{", "String", "name", ";", "if", "(", "is", "(", "TokenType", ".", "STAR", ",", "true", ")", ")", "{", "name", "=", "mToken", ".", "getContent", "(", ")", ";", "}", "else", "{", "name", ...
Parses the the rule AttributeOrWildcard according to the following production rule: <p> [60] AttribNameOrWildcard ::= AttributeName | "*" . </p> @return name
[ "Parses", "the", "the", "rule", "AttributeOrWildcard", "according", "to", "the", "following", "production", "rule", ":", "<p", ">", "[", "60", "]", "AttribNameOrWildcard", "::", "=", "AttributeName", "|", "*", ".", "<", "/", "p", ">" ]
9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60
https://github.com/sebastiangraf/treetank/blob/9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60/interfacemodules/xml/src/main/java/org/treetank/service/xml/xpath/parser/XPathParser.java#L1655-L1666
train
Parse a name or wildcard.
Create a Java method that does the following: "Parse a name or wildcard.".
Of course, here is the Java code you requested: ```java private String parseAttributeNameOrWildcard() { String name; if (is(TokenType.STAR, true)) { name = mToken.getContent(); } else { name = parseAttributeName(); } return name; } ``` Hope this h...
geomajas/geomajas-project-client-gwt2
plugin/editing/common/src/main/java/org/geomajas/plugin/editing/client/controller/AbstractGeometryIndexController.java
AbstractGeometryIndexController.getSnappedLocationWithinMaxBounds
public Coordinate getSnappedLocationWithinMaxBounds(HumanInputEvent<?> event) { Coordinate location = getLocation(event, RenderSpace.WORLD); location = getLocationWithinMaxBounds(location); if (snappingEnabled) { location = snappingService.snap(location); } return location; }
java
public Coordinate getSnappedLocationWithinMaxBounds(HumanInputEvent<?> event) { Coordinate location = getLocation(event, RenderSpace.WORLD); location = getLocationWithinMaxBounds(location); if (snappingEnabled) { location = snappingService.snap(location); } return location; }
[ "public", "Coordinate", "getSnappedLocationWithinMaxBounds", "(", "HumanInputEvent", "<", "?", ">", "event", ")", "{", "Coordinate", "location", "=", "getLocation", "(", "event", ",", "RenderSpace", ".", "WORLD", ")", ";", "location", "=", "getLocationWithinMaxBound...
Get the snapped real world location of the event, while making sure it is within the maximum bounds. If no maximum bounds have been set, the snapped location of the event in world space is returned. @param event The event to extract the location from. @return The location within maximum bounds.
[ "Get", "the", "snapped", "real", "world", "location", "of", "the", "event", "while", "making", "sure", "it", "is", "within", "the", "maximum", "bounds", ".", "If", "no", "maximum", "bounds", "have", "been", "set", "the", "snapped", "location", "of", "the",...
bd8d7904e861fa80522eed7b83c4ea99844180c7
https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/plugin/editing/common/src/main/java/org/geomajas/plugin/editing/client/controller/AbstractGeometryIndexController.java#L87-L94
train
Get the snapped location within the maximum bounds of the event.
Create a Java method that does the following: "Get the snapped location within the maximum bounds of the event.".
Of course, here is the Java code you requested: ```java public Coordinate getSnappedLocationWithinMaxBounds(HumanInputEvent<?> event) { Coordinate location = getLocation(event, RenderSpace.WORLD); location = getLocationWithinMaxBounds(location); if (snappingEnabled) { location = snappingService.snap(location)...
apache/incubator-atlas
webapp/src/main/java/org/apache/atlas/web/service/ActiveInstanceElectorService.java
ActiveInstanceElectorService.stop
@Override public void stop() { if (!HAConfiguration.isHAEnabled(configuration)) { LOG.info("HA is not enabled, no need to stop leader election service"); return; } try { leaderLatch.close(); curatorFactory.close(); } catch (IOException ...
java
@Override public void stop() { if (!HAConfiguration.isHAEnabled(configuration)) { LOG.info("HA is not enabled, no need to stop leader election service"); return; } try { leaderLatch.close(); curatorFactory.close(); } catch (IOException ...
[ "@", "Override", "public", "void", "stop", "(", ")", "{", "if", "(", "!", "HAConfiguration", ".", "isHAEnabled", "(", "configuration", ")", ")", "{", "LOG", ".", "info", "(", "\"HA is not enabled, no need to stop leader election service\"", ")", ";", "return", "...
Leave leader election process and clean up resources on shutting down. If Atlas High Availability configuration is disabled, this operation is a no-op. @throws AtlasException
[ "Leave", "leader", "election", "process", "and", "clean", "up", "resources", "on", "shutting", "down", "." ]
e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b
https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/webapp/src/main/java/org/apache/atlas/web/service/ActiveInstanceElectorService.java#L121-L133
train
Stop the leader election service.
Create a Java method that does the following: "Stop the leader election service.".
Of course, here is the Java code you requested: ```java @Override public void stop() { if (!HAConfiguration.isHAEnabled(configuration)) { LOG.info("HA is not enabled, no need to stop leader election service"); return; } try { leaderLatch.close(); ...
javers/javers
javers-core/src/main/java/org/javers/core/metamodel/object/CdoSnapshotState.java
CdoSnapshotState.getPropertyValue
public Object getPropertyValue(Property property) { Validate.argumentIsNotNull(property); Object val = properties.get(property.getName()); if (val == null){ return Defaults.defaultValue(property.getGenericType()); } return val; }
java
public Object getPropertyValue(Property property) { Validate.argumentIsNotNull(property); Object val = properties.get(property.getName()); if (val == null){ return Defaults.defaultValue(property.getGenericType()); } return val; }
[ "public", "Object", "getPropertyValue", "(", "Property", "property", ")", "{", "Validate", ".", "argumentIsNotNull", "(", "property", ")", ";", "Object", "val", "=", "properties", ".", "get", "(", "property", ".", "getName", "(", ")", ")", ";", "if", "(", ...
returns default values for null primitives
[ "returns", "default", "values", "for", "null", "primitives" ]
a51511be7d8bcee3e1812db8b7e69a45330b4e14
https://github.com/javers/javers/blob/a51511be7d8bcee3e1812db8b7e69a45330b4e14/javers-core/src/main/java/org/javers/core/metamodel/object/CdoSnapshotState.java#L32-L39
train
Get the value of a class attribute.
Create a Java method that does the following: "Get the value of a class attribute.".
Of course, here is the Java code you requested: ```java public Object getPropertyValue(Property property) { Validate.argumentIsNotNull(property); Object val = properties.get(property.getName()); if (val == null){ return Defaults.defaultValue(property.getGenericType()); } ...
netty/netty
transport-native-epoll/src/main/java/io/netty/channel/epoll/EpollDatagramChannelConfig.java
EpollDatagramChannelConfig.setIpTransparent
public EpollDatagramChannelConfig setIpTransparent(boolean ipTransparent) { try { ((EpollDatagramChannel) channel).socket.setIpTransparent(ipTransparent); return this; } catch (IOException e) { throw new ChannelException(e); } }
java
public EpollDatagramChannelConfig setIpTransparent(boolean ipTransparent) { try { ((EpollDatagramChannel) channel).socket.setIpTransparent(ipTransparent); return this; } catch (IOException e) { throw new ChannelException(e); } }
[ "public", "EpollDatagramChannelConfig", "setIpTransparent", "(", "boolean", "ipTransparent", ")", "{", "try", "{", "(", "(", "EpollDatagramChannel", ")", "channel", ")", ".", "socket", ".", "setIpTransparent", "(", "ipTransparent", ")", ";", "return", "this", ";",...
If {@code true} is used <a href="http://man7.org/linux/man-pages/man7/ip.7.html">IP_TRANSPARENT</a> is enabled, {@code false} for disable it. Default is disabled.
[ "If", "{" ]
ba06eafa1c1824bd154f1a380019e7ea2edf3c4c
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/transport-native-epoll/src/main/java/io/netty/channel/epoll/EpollDatagramChannelConfig.java#L406-L413
train
Sets the ipTransparent flag.
Create a Java method that does the following: "Sets the ipTransparent flag.".
Of course, here is the Java code you requested: ```java public EpollDatagramChannelConfig setIpTransparent(boolean ipTransparent) { try { ((EpollDatagramChannel) channel).socket.setIpTransparent(ipTransparent); return this; } catch (IOException e) { throw new Channel...
adorsys/hbci4java-adorsys
src/main/java/org/kapott/hbci/protocol/Message.java
Message.propagateUserData
private void propagateUserData(HashMap<String, String> clientValues) { String dottedName = getName() + "."; clientValues.forEach((key, value) -> { if (key.startsWith(dottedName) && value != null && value.length() != 0) { if (!propagateValue(key, value, TRY_TO_CREATE, DONT_ALL...
java
private void propagateUserData(HashMap<String, String> clientValues) { String dottedName = getName() + "."; clientValues.forEach((key, value) -> { if (key.startsWith(dottedName) && value != null && value.length() != 0) { if (!propagateValue(key, value, TRY_TO_CREATE, DONT_ALL...
[ "private", "void", "propagateUserData", "(", "HashMap", "<", "String", ",", "String", ">", "clientValues", ")", "{", "String", "dottedName", "=", "getName", "(", ")", "+", "\".\"", ";", "clientValues", ".", "forEach", "(", "(", "key", ",", "value", ")", ...
in 'clientValues' wird eine hashtable uebergeben, die als schluessel den pfadnames und als wert den wert eines zu setzenden elementes enthaelt. mit der methode werden vom nutzer einzugebenede daten (wie kontonummern, namen usw.) in die generierte nachricht eingebaut
[ "in", "clientValues", "wird", "eine", "hashtable", "uebergeben", "die", "als", "schluessel", "den", "pfadnames", "und", "als", "wert", "den", "wert", "eines", "zu", "setzenden", "elementes", "enthaelt", ".", "mit", "der", "methode", "werden", "vom", "nutzer", ...
5e24f7e429d6b555e1d993196b4cf1adda6433cf
https://github.com/adorsys/hbci4java-adorsys/blob/5e24f7e429d6b555e1d993196b4cf1adda6433cf/src/main/java/org/kapott/hbci/protocol/Message.java#L82-L91
train
Propagate user - defined data into the message.
Create a Java method that does the following: "Propagate user - defined data into the message.".
Of course, here is the Java code you requested: ```java private void propagateUserData(HashMap<String, String> clientValues) { String dottedName = getName() + "."; clientValues.forEach((key, value) -> { if (key.startsWith(dottedName) && value != null && value.length() != 0) { ...
couchbase/couchbase-lite-java
src/main/java/com/couchbase/lite/Dictionary.java
Dictionary.getValue
@Override public Object getValue(@NonNull String key) { if (key == null) { throw new IllegalArgumentException("key cannot be null."); } synchronized (lock) { return getMValue(internalDict, key).asNative(internalDict); } }
java
@Override public Object getValue(@NonNull String key) { if (key == null) { throw new IllegalArgumentException("key cannot be null."); } synchronized (lock) { return getMValue(internalDict, key).asNative(internalDict); } }
[ "@", "Override", "public", "Object", "getValue", "(", "@", "NonNull", "String", "key", ")", "{", "if", "(", "key", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"key cannot be null.\"", ")", ";", "}", "synchronized", "(", "lock",...
Gets a property's value as an object. The object types are Blob, Array, Dictionary, Number, or String based on the underlying data type; or nil if the property value is null or the property doesn't exist. @param key the key. @return the object value or nil.
[ "Gets", "a", "property", "s", "value", "as", "an", "object", ".", "The", "object", "types", "are", "Blob", "Array", "Dictionary", "Number", "or", "String", "based", "on", "the", "underlying", "data", "type", ";", "or", "nil", "if", "the", "property", "va...
cb72c44186456e6191a9ad0a7feb310011d0b081
https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/Dictionary.java#L114-L121
train
Gets the value of a single key.
Create a Java method that does the following: "Gets the value of a single key.".
Of course, here is the Java code you requested: ```java @Override public Object getValue(@NonNull String key) { if (key == null) { throw new IllegalArgumentException("key cannot be null."); } synchronized (lock) { return getMValue(internalDict, key).asNative(internalDict); } ...
nyla-solutions/gedi-geode
gedi-geode-extensions-core/src/main/java/gedi/solutions/geode/operations/stats/AbstractValue.java
AbstractValue.calcStats
protected void calcStats(double[] values) { if (statsValid) { return; } size = values.length; if (size == 0) { min = 0.0; max = 0.0; avg = 0.0; stddev = 0.0; mostRecent = 0.0; } else { min = values[0]; max = values[0]; ...
java
protected void calcStats(double[] values) { if (statsValid) { return; } size = values.length; if (size == 0) { min = 0.0; max = 0.0; avg = 0.0; stddev = 0.0; mostRecent = 0.0; } else { min = values[0]; max = values[0]; ...
[ "protected", "void", "calcStats", "(", "double", "[", "]", "values", ")", "{", "if", "(", "statsValid", ")", "{", "return", ";", "}", "size", "=", "values", ".", "length", ";", "if", "(", "size", "==", "0", ")", "{", "min", "=", "0.0", ";", "max"...
/* Calculates each stat given the result of calling getSnapshots
[ "/", "*", "Calculates", "each", "stat", "given", "the", "result", "of", "calling", "getSnapshots" ]
3dd71d6e66e941ce350b306b70677ee95a7d9eee
https://github.com/nyla-solutions/gedi-geode/blob/3dd71d6e66e941ce350b306b70677ee95a7d9eee/gedi-geode-extensions-core/src/main/java/gedi/solutions/geode/operations/stats/AbstractValue.java#L85-L121
test
Calculate statistics for the exception class.
Create a Java method that does the following: "Calculate statistics for the exception class.".
Of course, here is the Java code you requested: ```java protected void calcStats(double[] values) { if (statsValid) { return; } size = values.length; if (size == 0) { min = 0.0; max = 0.0; avg = 0.0; stddev = 0.0; mostRecent = 0.0; } else { ...
Azure/azure-sdk-for-java
sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/DatabasesInner.java
DatabasesInner.listByElasticPool
public PagedList<DatabaseInner> listByElasticPool(final String resourceGroupName, final String serverName, final String elasticPoolName) { ServiceResponse<Page<DatabaseInner>> response = listByElasticPoolSinglePageAsync(resourceGroupName, serverName, elasticPoolName).toBlocking().single(); return new Pa...
java
public PagedList<DatabaseInner> listByElasticPool(final String resourceGroupName, final String serverName, final String elasticPoolName) { ServiceResponse<Page<DatabaseInner>> response = listByElasticPoolSinglePageAsync(resourceGroupName, serverName, elasticPoolName).toBlocking().single(); return new Pa...
[ "public", "PagedList", "<", "DatabaseInner", ">", "listByElasticPool", "(", "final", "String", "resourceGroupName", ",", "final", "String", "serverName", ",", "final", "String", "elasticPoolName", ")", "{", "ServiceResponse", "<", "Page", "<", "DatabaseInner", ">>",...
Gets a list of databases in an elastic pool. @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. @param serverName The name of the server. @param elasticPoolName The name of the elastic pool. @throws IllegalArg...
[ "Gets", "a", "list", "of", "databases", "in", "an", "elastic", "pool", "." ]
aab183ddc6686c82ec10386d5a683d2691039626
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/DatabasesInner.java#L1268-L1276
train
List all databases in an elastic pool.
Create a Java method that does the following: "List all databases in an elastic pool.".
Of course, here is the Java code you requested: ```java public PagedList<DatabaseInner> listByElasticPool(final String resourceGroupName, final String serverName, final String elasticPoolName) { ServiceResponse<Page<DatabaseInner>> response = listByElasticPoolSinglePageAsync(resourceGroupName, serverName, elas...
googleapis/cloud-bigtable-client
bigtable-client-core-parent/bigtable-client-core/src/main/java/com/google/cloud/bigtable/grpc/BigtableDataClientWrapper.java
BigtableDataClientWrapper.mutateRowAsync
@Override public ApiFuture<Void> mutateRowAsync(RowMutation rowMutation) { ListenableFuture<MutateRowResponse> response = delegate.mutateRowAsync(rowMutation.toProto(requestContext)); return ApiFutureUtil.transformAndAdapt(response, new Function<MutateRowResponse, Void>() { @Nullable @Ove...
java
@Override public ApiFuture<Void> mutateRowAsync(RowMutation rowMutation) { ListenableFuture<MutateRowResponse> response = delegate.mutateRowAsync(rowMutation.toProto(requestContext)); return ApiFutureUtil.transformAndAdapt(response, new Function<MutateRowResponse, Void>() { @Nullable @Ove...
[ "@", "Override", "public", "ApiFuture", "<", "Void", ">", "mutateRowAsync", "(", "RowMutation", "rowMutation", ")", "{", "ListenableFuture", "<", "MutateRowResponse", ">", "response", "=", "delegate", ".", "mutateRowAsync", "(", "rowMutation", ".", "toProto", "(",...
{@inheritDoc}
[ "{" ]
53543f36e4d6f9ed1963640d91a35be2a2047656
https://github.com/googleapis/cloud-bigtable-client/blob/53543f36e4d6f9ed1963640d91a35be2a2047656/bigtable-client-core-parent/bigtable-client-core/src/main/java/com/google/cloud/bigtable/grpc/BigtableDataClientWrapper.java#L75-L86
train
Asynchronously mutate a single row.
Create a Java method that does the following: "Asynchronously mutate a single row.".
Of course, here is the Java code you requested: ```java @Override public ApiFuture<Void> mutateRowAsync(RowMutation rowMutation) { ListenableFuture<MutateRowResponse> response = delegate.mutateRowAsync(rowMutation.toProto(requestContext)); return ApiFutureUtil.transformAndAdapt(response, new Functio...
google/error-prone-javac
src/jdk.compiler/share/classes/com/sun/source/util/DocTreeScanner.java
DocTreeScanner.visitProvides
@Override public R visitProvides(ProvidesTree node, P p) { R r = scan(node.getServiceType(), p); r = scanAndReduce(node.getDescription(), p, r); return r; }
java
@Override public R visitProvides(ProvidesTree node, P p) { R r = scan(node.getServiceType(), p); r = scanAndReduce(node.getDescription(), p, r); return r; }
[ "@", "Override", "public", "R", "visitProvides", "(", "ProvidesTree", "node", ",", "P", "p", ")", "{", "R", "r", "=", "scan", "(", "node", ".", "getServiceType", "(", ")", ",", "p", ")", ";", "r", "=", "scanAndReduce", "(", "node", ".", "getDescripti...
{@inheritDoc} This implementation scans the children in left to right order. @param node {@inheritDoc} @param p {@inheritDoc} @return the result of scanning
[ "{", "@inheritDoc", "}", "This", "implementation", "scans", "the", "children", "in", "left", "to", "right", "order", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/source/util/DocTreeScanner.java#L334-L339
train
Visit a ProvideTree. This implementation scans the service type and description of the provides and returns the corresponding resource.
Create a Java method that does the following: "Visit a ProvideTree. This implementation scans the service type and description of the provides and returns the corresponding resource.".
Of course, here is the Java code you requested: ```java @Override public R visitProvides(ProvidesTree node, P p) { R r = scan(node.getServiceType(), p); r = scanAndReduce(node.getDescription(), p, r); return r; } ``` Hope this helps!
hypercube1024/firefly
firefly/src/main/java/com/firefly/codec/http2/model/MultiPartOutputStream.java
MultiPartOutputStream.startPart
public void startPart(String contentType, String[] headers) throws IOException { if (inPart) out.write(__CRLF); inPart = true; out.write(__DASHDASH); out.write(boundaryBytes); out.write(__CRLF); if (contentType != null) out.write(("Content-Type: " ...
java
public void startPart(String contentType, String[] headers) throws IOException { if (inPart) out.write(__CRLF); inPart = true; out.write(__DASHDASH); out.write(boundaryBytes); out.write(__CRLF); if (contentType != null) out.write(("Content-Type: " ...
[ "public", "void", "startPart", "(", "String", "contentType", ",", "String", "[", "]", "headers", ")", "throws", "IOException", "{", "if", "(", "inPart", ")", "out", ".", "write", "(", "__CRLF", ")", ";", "inPart", "=", "true", ";", "out", ".", "write",...
Start creation of the next Content. @param contentType the content type of the part @param headers the part headers @throws IOException if unable to write the part
[ "Start", "creation", "of", "the", "next", "Content", "." ]
ed3fc75b7c54a65b1e7d8141d01b49144bb423a3
https://github.com/hypercube1024/firefly/blob/ed3fc75b7c54a65b1e7d8141d01b49144bb423a3/firefly/src/main/java/com/firefly/codec/http2/model/MultiPartOutputStream.java#L89-L104
train
Start a new HTTP request.
Create a Java method that does the following: "Start a new HTTP request.".
Of course, here is the Java code you requested: ```java public void startPart(String contentType, String[] headers) throws IOException { if (inPart) out.write(__CRLF); inPart = true; out.write(__DASHDASH); out.write(boundaryBytes); out.write(__CRLF); if (cont...
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/JobInProgress.java
JobInProgress.obtainTaskCleanupTask
public Task obtainTaskCleanupTask(TaskTrackerStatus tts, boolean isMapSlot) throws IOException { if (!tasksInited.get()) { return null; } if (this.status.getRunState() != JobStatus.RUNNING || jobFailed || jobKilled) { return null; }...
java
public Task obtainTaskCleanupTask(TaskTrackerStatus tts, boolean isMapSlot) throws IOException { if (!tasksInited.get()) { return null; } if (this.status.getRunState() != JobStatus.RUNNING || jobFailed || jobKilled) { return null; }...
[ "public", "Task", "obtainTaskCleanupTask", "(", "TaskTrackerStatus", "tts", ",", "boolean", "isMapSlot", ")", "throws", "IOException", "{", "if", "(", "!", "tasksInited", ".", "get", "(", ")", ")", "{", "return", "null", ";", "}", "if", "(", "this", ".", ...
/* Return task cleanup attempt if any, to run on a given tracker
[ "/", "*", "Return", "task", "cleanup", "attempt", "if", "any", "to", "run", "on", "a", "given", "tracker" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/JobInProgress.java#L1441-L1488
train
obtainTaskCleanupTask This method is called from the TaskTrackerImpl. obtainTaskCleanupTask method.
Create a Java method that does the following: "obtainTaskCleanupTask This method is called from the TaskTrackerImpl. obtainTaskCleanupTask method.".
Of course, here is the Java code you requested: ```java public Task obtainTaskCleanupTask(TaskTrackerStatus tts, boolean isMapSlot) throws IOException { if (!tasksInited.get()) { return null; } if (this.status.getRunState() != JobStatus.RUNNING || ...
Activiti/Activiti
activiti-engine/src/main/java/org/activiti/engine/impl/agenda/AbstractOperation.java
AbstractOperation.executeExecutionListeners
protected void executeExecutionListeners(HasExecutionListeners elementWithExecutionListeners, ExecutionEntity executionEntity, String eventType) { commandContext.getProcessEngineConfiguration().getListenerNotificationHelper() .executeExecutionListeners(elementWithExecutionListeners, executionEntity, eve...
java
protected void executeExecutionListeners(HasExecutionListeners elementWithExecutionListeners, ExecutionEntity executionEntity, String eventType) { commandContext.getProcessEngineConfiguration().getListenerNotificationHelper() .executeExecutionListeners(elementWithExecutionListeners, executionEntity, eve...
[ "protected", "void", "executeExecutionListeners", "(", "HasExecutionListeners", "elementWithExecutionListeners", ",", "ExecutionEntity", "executionEntity", ",", "String", "eventType", ")", "{", "commandContext", ".", "getProcessEngineConfiguration", "(", ")", ".", "getListene...
Executes the execution listeners defined on the given element, with the given event type, and passing the provided execution to the {@link ExecutionListener} instances.
[ "Executes", "the", "execution", "listeners", "defined", "on", "the", "given", "element", "with", "the", "given", "event", "type", "and", "passing", "the", "provided", "execution", "to", "the", "{" ]
82e2b2cd2083b2f734ca0efc7815389c0f2517d9
https://github.com/Activiti/Activiti/blob/82e2b2cd2083b2f734ca0efc7815389c0f2517d9/activiti-engine/src/main/java/org/activiti/engine/impl/agenda/AbstractOperation.java#L78-L82
train
Execute the execution listeners of the element with the given type
Create a Java method that does the following: "Execute the execution listeners of the element with the given type".
Of course, here is the Java code you requested: ```java protected void executeExecutionListeners(HasExecutionListeners elementWithExecutionListeners, ExecutionEntity executionEntity, String eventType) { commandContext.getProcessEngineConfiguration().getListenerNotificationHelper() .executeExecutionList...
opensourceBIM/BIMserver
PluginBase/generated/org/bimserver/models/ifc2x3tc1/impl/Ifc2x3tc1FactoryImpl.java
Ifc2x3tc1FactoryImpl.createIfcPipeFittingTypeEnumFromString
public IfcPipeFittingTypeEnum createIfcPipeFittingTypeEnumFromString(EDataType eDataType, String initialValue) { IfcPipeFittingTypeEnum result = IfcPipeFittingTypeEnum.get(initialValue); if (result == null) throw new IllegalArgumentException( "The value '" + initialValue + "' is not a valid enumerator o...
java
public IfcPipeFittingTypeEnum createIfcPipeFittingTypeEnumFromString(EDataType eDataType, String initialValue) { IfcPipeFittingTypeEnum result = IfcPipeFittingTypeEnum.get(initialValue); if (result == null) throw new IllegalArgumentException( "The value '" + initialValue + "' is not a valid enumerator o...
[ "public", "IfcPipeFittingTypeEnum", "createIfcPipeFittingTypeEnumFromString", "(", "EDataType", "eDataType", ",", "String", "initialValue", ")", "{", "IfcPipeFittingTypeEnum", "result", "=", "IfcPipeFittingTypeEnum", ".", "get", "(", "initialValue", ")", ";", "if", "(", ...
<!-- 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/ifc2x3tc1/impl/Ifc2x3tc1FactoryImpl.java#L12266-L12272
train
Gets the IfcPipeFittingTypeEnum from the given String.
Create a Java method that does the following: "Gets the IfcPipeFittingTypeEnum from the given String.".
Of course, here is the Java code you requested: ```java public IfcPipeFittingTypeEnum createIfcPipeFittingTypeEnumFromString(EDataType eDataType, String initialValue) { IfcPipeFittingTypeEnum result = IfcPipeFittingTypeEnum.get(initialValue); if (result == null) throw new IllegalArgumentException( "The...
aws/aws-sdk-java
aws-java-sdk-chime/src/main/java/com/amazonaws/services/chime/model/transform/PhoneNumberErrorMarshaller.java
PhoneNumberErrorMarshaller.marshall
public void marshall(PhoneNumberError phoneNumberError, ProtocolMarshaller protocolMarshaller) { if (phoneNumberError == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(phoneNumberError.getPhoneNumber...
java
public void marshall(PhoneNumberError phoneNumberError, ProtocolMarshaller protocolMarshaller) { if (phoneNumberError == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(phoneNumberError.getPhoneNumber...
[ "public", "void", "marshall", "(", "PhoneNumberError", "phoneNumberError", ",", "ProtocolMarshaller", "protocolMarshaller", ")", "{", "if", "(", "phoneNumberError", "==", "null", ")", "{", "throw", "new", "SdkClientException", "(", "\"Invalid argument passed to marshall(....
Marshall the given parameter object.
[ "Marshall", "the", "given", "parameter", "object", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-chime/src/main/java/com/amazonaws/services/chime/model/transform/PhoneNumberErrorMarshaller.java#L46-L59
train
marshalls the given phoneNumberError to the JSON object.
Create a Java method that does the following: "marshalls the given phoneNumberError to the JSON object.".
Of course, here is the Java code you requested: ```java public void marshall(PhoneNumberError phoneNumberError, ProtocolMarshaller protocolMarshaller) { if (phoneNumberError == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { pr...
alkacon/opencms-core
src/org/opencms/jsp/CmsJspTagBundle.java
CmsJspTagBundle.getLocale
static Locale getLocale(PageContext pageContext, String name) { Locale loc = null; Object obj = javax.servlet.jsp.jstl.core.Config.find(pageContext, name); if (obj != null) { if (obj instanceof Locale) { loc = (Locale)obj; } else { ...
java
static Locale getLocale(PageContext pageContext, String name) { Locale loc = null; Object obj = javax.servlet.jsp.jstl.core.Config.find(pageContext, name); if (obj != null) { if (obj instanceof Locale) { loc = (Locale)obj; } else { ...
[ "static", "Locale", "getLocale", "(", "PageContext", "pageContext", ",", "String", "name", ")", "{", "Locale", "loc", "=", "null", ";", "Object", "obj", "=", "javax", ".", "servlet", ".", "jsp", ".", "jstl", ".", "core", ".", "Config", ".", "find", "("...
Returns the locale specified by the named scoped attribute or context configuration parameter. <p> The named scoped attribute is searched in the page, request, session (if valid), and application scope(s) (in this order). If no such attribute exists in any of the scopes, the locale is taken from the named context conf...
[ "Returns", "the", "locale", "specified", "by", "the", "named", "scoped", "attribute", "or", "context", "configuration", "parameter", "." ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/CmsJspTagBundle.java#L135-L149
train
Gets the Locale object for a given name.
Create a Java method that does the following: "Gets the Locale object for a given name.".
Of course, here is the Java code you requested: ```java static Locale getLocale(PageContext pageContext, String name) { Locale loc = null; Object obj = javax.servlet.jsp.jstl.core.Config.find(pageContext, name); if (obj != null) { if (obj instanceof Locale) { ...
aws/aws-sdk-java
aws-java-sdk-lexmodelbuilding/src/main/java/com/amazonaws/services/lexmodelbuilding/model/GetBotAliasesResult.java
GetBotAliasesResult.withBotAliases
public GetBotAliasesResult withBotAliases(BotAliasMetadata... botAliases) { if (this.botAliases == null) { setBotAliases(new java.util.ArrayList<BotAliasMetadata>(botAliases.length)); } for (BotAliasMetadata ele : botAliases) { this.botAliases.add(ele); } ...
java
public GetBotAliasesResult withBotAliases(BotAliasMetadata... botAliases) { if (this.botAliases == null) { setBotAliases(new java.util.ArrayList<BotAliasMetadata>(botAliases.length)); } for (BotAliasMetadata ele : botAliases) { this.botAliases.add(ele); } ...
[ "public", "GetBotAliasesResult", "withBotAliases", "(", "BotAliasMetadata", "...", "botAliases", ")", "{", "if", "(", "this", ".", "botAliases", "==", "null", ")", "{", "setBotAliases", "(", "new", "java", ".", "util", ".", "ArrayList", "<", "BotAliasMetadata", ...
<p> An array of <code>BotAliasMetadata</code> objects, each describing a bot alias. </p> <p> <b>NOTE:</b> This method appends the values to the existing list (if any). Use {@link #setBotAliases(java.util.Collection)} or {@link #withBotAliases(java.util.Collection)} if you want to override the existing values. </p> @pa...
[ "<p", ">", "An", "array", "of", "<code", ">", "BotAliasMetadata<", "/", "code", ">", "objects", "each", "describing", "a", "bot", "alias", ".", "<", "/", "p", ">", "<p", ">", "<b", ">", "NOTE", ":", "<", "/", "b", ">", "This", "method", "appends", ...
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-lexmodelbuilding/src/main/java/com/amazonaws/services/lexmodelbuilding/model/GetBotAliasesResult.java#L86-L94
train
Gets the value of the BotAliases property.
Create a Java method that does the following: "Gets the value of the BotAliases property.".
Of course, here is the Java code you requested: ```java public GetBotAliasesResult withBotAliases(BotAliasMetadata... botAliases) { if (this.botAliases == null) { setBotAliases(new java.util.ArrayList<BotAliasMetadata>(botAliases.length)); } for (BotAliasMetadata ele : botAliases) {...
phax/ph-commons
ph-json/src/main/java/com/helger/json/serialize/JsonReader.java
JsonReader.readFromFile
@Nullable public static IJson readFromFile (@Nonnull final File aFile, @Nonnull final Charset aFallbackCharset, @Nullable final IJsonParseExceptionCallback aCustomExceptionHandler) { return readFromStream (new FileSystemResource (aFile), aF...
java
@Nullable public static IJson readFromFile (@Nonnull final File aFile, @Nonnull final Charset aFallbackCharset, @Nullable final IJsonParseExceptionCallback aCustomExceptionHandler) { return readFromStream (new FileSystemResource (aFile), aF...
[ "@", "Nullable", "public", "static", "IJson", "readFromFile", "(", "@", "Nonnull", "final", "File", "aFile", ",", "@", "Nonnull", "final", "Charset", "aFallbackCharset", ",", "@", "Nullable", "final", "IJsonParseExceptionCallback", "aCustomExceptionHandler", ")", "{...
Read the Json from the passed File. @param aFile The file containing the Json to be parsed. May not be <code>null</code>. @param aFallbackCharset The charset to be used in case no BOM is present. May not be <code>null</code>. @param aCustomExceptionHandler An optional custom exception handler that can be used to colle...
[ "Read", "the", "Json", "from", "the", "passed", "File", "." ]
d28c03565f44a0b804d96028d0969f9bb38c4313
https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-json/src/main/java/com/helger/json/serialize/JsonReader.java#L508-L514
train
Read a node from a file.
Create a Java method that does the following: "Read a node from a file.".
Of course, here is the Java code you requested: ```java @Nullable public static IJson readFromFile (@Nonnull final File aFile, @Nonnull final Charset aFallbackCharset, @Nullable final IJsonParseExceptionCallback aCustomExceptionHandler) { ...
Wikidata/Wikidata-Toolkit
wdtk-datamodel/src/main/java/org/wikidata/wdtk/datamodel/helpers/DatamodelConverter.java
DatamodelConverter.copy
public SiteLink copy(SiteLink object) { return dataObjectFactory.getSiteLink(object.getPageTitle(), object.getSiteKey(), object.getBadges()); }
java
public SiteLink copy(SiteLink object) { return dataObjectFactory.getSiteLink(object.getPageTitle(), object.getSiteKey(), object.getBadges()); }
[ "public", "SiteLink", "copy", "(", "SiteLink", "object", ")", "{", "return", "dataObjectFactory", ".", "getSiteLink", "(", "object", ".", "getPageTitle", "(", ")", ",", "object", ".", "getSiteKey", "(", ")", ",", "object", ".", "getBadges", "(", ")", ")", ...
Copies a {@link SiteLink}. <p> This method is not affected by the setting made via {@link #setOptionSiteLinkFilter(Set)}. @param object object to copy @return copied object
[ "Copies", "a", "{", "@link", "SiteLink", "}", ".", "<p", ">", "This", "method", "is", "not", "affected", "by", "the", "setting", "made", "via", "{", "@link", "#setOptionSiteLinkFilter", "(", "Set", ")", "}", "." ]
7732851dda47e1febff406fba27bfec023f4786e
https://github.com/Wikidata/Wikidata-Toolkit/blob/7732851dda47e1febff406fba27bfec023f4786e/wdtk-datamodel/src/main/java/org/wikidata/wdtk/datamodel/helpers/DatamodelConverter.java#L489-L492
train
Create a deep copy of the passed in object.
Create a Java method that does the following: "Create a deep copy of the passed in object.".
Of course, here is the Java code you requested: ```java public SiteLink copy(SiteLink object) { return dataObjectFactory.getSiteLink(object.getPageTitle(), object.getSiteKey(), object.getBadges()); } ``` Hope this helps!
spring-projects/spring-boot
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/client/RestTemplateBuilder.java
RestTemplateBuilder.setConnectTimeout
public RestTemplateBuilder setConnectTimeout(Duration connectTimeout) { return new RestTemplateBuilder(this.detectRequestFactory, this.rootUri, this.messageConverters, this.requestFactorySupplier, this.uriTemplateHandler, this.errorHandler, this.basicAuthentication, this.restTemplateCustomizers, this....
java
public RestTemplateBuilder setConnectTimeout(Duration connectTimeout) { return new RestTemplateBuilder(this.detectRequestFactory, this.rootUri, this.messageConverters, this.requestFactorySupplier, this.uriTemplateHandler, this.errorHandler, this.basicAuthentication, this.restTemplateCustomizers, this....
[ "public", "RestTemplateBuilder", "setConnectTimeout", "(", "Duration", "connectTimeout", ")", "{", "return", "new", "RestTemplateBuilder", "(", "this", ".", "detectRequestFactory", ",", "this", ".", "rootUri", ",", "this", ".", "messageConverters", ",", "this", ".",...
Sets the connection timeout on the underlying {@link ClientHttpRequestFactory}. @param connectTimeout the connection timeout @return a new builder instance. @since 2.1.0
[ "Sets", "the", "connection", "timeout", "on", "the", "underlying", "{" ]
0b27f7c70e164b2b1a96477f1d9c1acba56790c1
https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/client/RestTemplateBuilder.java#L466-L473
train
Sets the connect timeout.
Create a Java method that does the following: "Sets the connect timeout.".
Of course, here is the Java code you requested: ```java public RestTemplateBuilder setConnectTimeout(Duration connectTimeout) { return new RestTemplateBuilder(this.detectRequestFactory, this.rootUri, this.messageConverters, this.requestFactorySupplier, this.uriTemplateHandler, this.errorHandler, this.basicAu...
wellner/jcarafe
jcarafe-core/src/main/java/cern/colt/list/ObjectArrayList.java
ObjectArrayList.replaceFromWith
public void replaceFromWith(int from, java.util.Collection other) { checkRange(from,size); java.util.Iterator e = other.iterator(); int index=from; int limit = Math.min(size-from, other.size()); for (int i=0; i<limit; i++) elements[index++] = e.next(); //delta }
java
public void replaceFromWith(int from, java.util.Collection other) { checkRange(from,size); java.util.Iterator e = other.iterator(); int index=from; int limit = Math.min(size-from, other.size()); for (int i=0; i<limit; i++) elements[index++] = e.next(); //delta }
[ "public", "void", "replaceFromWith", "(", "int", "from", ",", "java", ".", "util", ".", "Collection", "other", ")", "{", "checkRange", "(", "from", ",", "size", ")", ";", "java", ".", "util", ".", "Iterator", "e", "=", "other", ".", "iterator", "(", ...
Replaces the part of the receiver starting at <code>from</code> (inclusive) with all the elements of the specified collection. Does not alter the size of the receiver. Replaces exactly <tt>Math.max(0,Math.min(size()-from, other.size()))</tt> elements. @param from the index at which to copy the first element from the s...
[ "Replaces", "the", "part", "of", "the", "receiver", "starting", "at", "<code", ">", "from<", "/", "code", ">", "(", "inclusive", ")", "with", "all", "the", "elements", "of", "the", "specified", "collection", ".", "Does", "not", "alter", "the", "size", "o...
ab8b0a83dbf600fe80c27711815c90bd3055b217
https://github.com/wellner/jcarafe/blob/ab8b0a83dbf600fe80c27711815c90bd3055b217/jcarafe-core/src/main/java/cern/colt/list/ObjectArrayList.java#L780-L787
train
Replaces all elements in this collection with the elements in the other collection.
Create a Java method that does the following: "Replaces all elements in this collection with the elements in the other collection.".
Of course, here is the Java code you requested: ```java public void replaceFromWith(int from, java.util.Collection other) { checkRange(from,size); java.util.Iterator e = other.iterator(); int index=from; int limit = Math.min(size-from, other.size()); for (int i=0; i<limit; i++) elements[index++] = e.ne...
haifengl/smile
plot/src/main/java/smile/plot/PlotCanvas.java
PlotCanvas.histogram
public Histogram histogram(String id, int[] data, double[] breaks, Color color) { if (base.dimension != 2) { throw new IllegalArgumentException("Histogram can be only painted in a 2D canvas."); } Histogram histogram = new Histogram(data, breaks); histogram.setID(id); ...
java
public Histogram histogram(String id, int[] data, double[] breaks, Color color) { if (base.dimension != 2) { throw new IllegalArgumentException("Histogram can be only painted in a 2D canvas."); } Histogram histogram = new Histogram(data, breaks); histogram.setID(id); ...
[ "public", "Histogram", "histogram", "(", "String", "id", ",", "int", "[", "]", "data", ",", "double", "[", "]", "breaks", ",", "Color", "color", ")", "{", "if", "(", "base", ".", "dimension", "!=", "2", ")", "{", "throw", "new", "IllegalArgumentExcepti...
Adds a histogram to this canvas. @param id the id of the plot. @param data a sample set. @param breaks an array of size k+1 giving the breakpoints between histogram cells. Must be in ascending order.
[ "Adds", "a", "histogram", "to", "this", "canvas", "." ]
e27e43e90fbaacce3f99d30120cf9dd6a764c33d
https://github.com/haifengl/smile/blob/e27e43e90fbaacce3f99d30120cf9dd6a764c33d/plot/src/main/java/smile/plot/PlotCanvas.java#L2207-L2229
train
Create a histogram in the image.
Create a Java method that does the following: "Create a histogram in the image.".
Of course, here is the Java code you requested: ```java public Histogram histogram(String id, int[] data, double[] breaks, Color color) { if (base.dimension != 2) { throw new IllegalArgumentException("Histogram can be only painted in a 2D canvas."); } Histogram histogram = new Hist...
spring-projects/spring-loaded
springloaded/src/main/java/org/springsource/loaded/ReloadableType.java
ReloadableType.getSuperRtype
public ReloadableType getSuperRtype() { if (superRtype != null) { return superRtype; } if (superclazz == null) { // Not filled in yet? Why is this code different to the interface case? String name = this.getSlashedSupertypeName(); if (name == null) { return null; } else { ReloadableType ...
java
public ReloadableType getSuperRtype() { if (superRtype != null) { return superRtype; } if (superclazz == null) { // Not filled in yet? Why is this code different to the interface case? String name = this.getSlashedSupertypeName(); if (name == null) { return null; } else { ReloadableType ...
[ "public", "ReloadableType", "getSuperRtype", "(", ")", "{", "if", "(", "superRtype", "!=", "null", ")", "{", "return", "superRtype", ";", "}", "if", "(", "superclazz", "==", "null", ")", "{", "// Not filled in yet? Why is this code different to the interface case?", ...
Return the ReloadableType representing the superclass of this type. If the supertype is not reloadable, this method will return null. The ReloadableType that is returned may not be within the same type registry, if the supertype was loaded by a different classloader. @return the ReloadableType for the supertype or nul...
[ "Return", "the", "ReloadableType", "representing", "the", "superclass", "of", "this", "type", ".", "If", "the", "supertype", "is", "not", "reloadable", "this", "method", "will", "return", "null", ".", "The", "ReloadableType", "that", "is", "returned", "may", "...
59b32f957a05c6d9f149148158053605e2a6205a
https://github.com/spring-projects/spring-loaded/blob/59b32f957a05c6d9f149148158053605e2a6205a/springloaded/src/main/java/org/springsource/loaded/ReloadableType.java#L1631-L1653
train
Gets the ReloadableType for this type.
Create a Java method that does the following: "Gets the ReloadableType for this type.".
Of course, here is the Java code you requested: ```java public ReloadableType getSuperRtype() { if (superRtype != null) { return superRtype; } if (superclazz == null) { // Not filled in yet? Why is this code different to the interface case? String name = this.getSlashedSupertypeName(); if (name == nu...
liferay/com-liferay-commerce
commerce-product-service/src/main/java/com/liferay/commerce/product/service/base/CPDefinitionLinkLocalServiceBaseImpl.java
CPDefinitionLinkLocalServiceBaseImpl.addCPDefinitionLink
@Indexable(type = IndexableType.REINDEX) @Override public CPDefinitionLink addCPDefinitionLink( CPDefinitionLink cpDefinitionLink) { cpDefinitionLink.setNew(true); return cpDefinitionLinkPersistence.update(cpDefinitionLink); }
java
@Indexable(type = IndexableType.REINDEX) @Override public CPDefinitionLink addCPDefinitionLink( CPDefinitionLink cpDefinitionLink) { cpDefinitionLink.setNew(true); return cpDefinitionLinkPersistence.update(cpDefinitionLink); }
[ "@", "Indexable", "(", "type", "=", "IndexableType", ".", "REINDEX", ")", "@", "Override", "public", "CPDefinitionLink", "addCPDefinitionLink", "(", "CPDefinitionLink", "cpDefinitionLink", ")", "{", "cpDefinitionLink", ".", "setNew", "(", "true", ")", ";", "return...
Adds the cp definition link to the database. Also notifies the appropriate model listeners. @param cpDefinitionLink the cp definition link @return the cp definition link that was added
[ "Adds", "the", "cp", "definition", "link", "to", "the", "database", ".", "Also", "notifies", "the", "appropriate", "model", "listeners", "." ]
9e54362d7f59531fc684016ba49ee7cdc3a2f22b
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/base/CPDefinitionLinkLocalServiceBaseImpl.java#L114-L121
train
Adds the cp definition link to the database. Also notifies the appropriate model listeners.
Create a Java method that does the following: "Adds the cp definition link to the database. Also notifies the appropriate model listeners.".
Of course, here is the Java code you requested: ```java @Indexable(type = IndexableType.REINDEX) @Override public CPDefinitionLink addCPDefinitionLink( CPDefinitionLink cpDefinitionLink) { cpDefinitionLink.setNew(true); return cpDefinitionLinkPersistence.update(cpDefinitionLink); } ``` Hope this helps!
lunisolar/magma
magma-func-builder/src/main/java/eu/lunisolar/magma/func/build/predicate/LObjLongPredicateBuilder.java
LObjLongPredicateBuilder.objLongPredicateFrom
@Nonnull public static <T> LObjLongPredicate<T> objLongPredicateFrom(Consumer<LObjLongPredicateBuilder<T>> buildingFunction) { LObjLongPredicateBuilder builder = new LObjLongPredicateBuilder(); buildingFunction.accept(builder); return builder.build(); }
java
@Nonnull public static <T> LObjLongPredicate<T> objLongPredicateFrom(Consumer<LObjLongPredicateBuilder<T>> buildingFunction) { LObjLongPredicateBuilder builder = new LObjLongPredicateBuilder(); buildingFunction.accept(builder); return builder.build(); }
[ "@", "Nonnull", "public", "static", "<", "T", ">", "LObjLongPredicate", "<", "T", ">", "objLongPredicateFrom", "(", "Consumer", "<", "LObjLongPredicateBuilder", "<", "T", ">", ">", "buildingFunction", ")", "{", "LObjLongPredicateBuilder", "builder", "=", "new", ...
One of ways of creating builder. This is possibly the least verbose way where compiler should be able to guess the generic parameters.
[ "One", "of", "ways", "of", "creating", "builder", ".", "This", "is", "possibly", "the", "least", "verbose", "way", "where", "compiler", "should", "be", "able", "to", "guess", "the", "generic", "parameters", "." ]
83809c6d1a33d913aec6c49920251e4f0be8b213
https://github.com/lunisolar/magma/blob/83809c6d1a33d913aec6c49920251e4f0be8b213/magma-func-builder/src/main/java/eu/lunisolar/magma/func/build/predicate/LObjLongPredicateBuilder.java#L82-L87
train
Create a LObjLongPredicate from a Consumer.
Create a Java method that does the following: "Create a LObjLongPredicate from a Consumer.".
Of course, here is the Java code you requested: ```java @Nonnull public static <T> LObjLongPredicate<T> objLongPredicateFrom(Consumer<LObjLongPredicateBuilder<T>> buildingFunction) { LObjLongPredicateBuilder builder = new LObjLongPredicateBuilder(); buildingFunction.accept(builder); return builder.build(); } `...
aws/aws-sdk-java
aws-java-sdk-rdsdata/src/main/java/com/amazonaws/services/rdsdata/model/ExecuteSqlResult.java
ExecuteSqlResult.withSqlStatementResults
public ExecuteSqlResult withSqlStatementResults(SqlStatementResult... sqlStatementResults) { if (this.sqlStatementResults == null) { setSqlStatementResults(new java.util.ArrayList<SqlStatementResult>(sqlStatementResults.length)); } for (SqlStatementResult ele : sqlStatementResults) {...
java
public ExecuteSqlResult withSqlStatementResults(SqlStatementResult... sqlStatementResults) { if (this.sqlStatementResults == null) { setSqlStatementResults(new java.util.ArrayList<SqlStatementResult>(sqlStatementResults.length)); } for (SqlStatementResult ele : sqlStatementResults) {...
[ "public", "ExecuteSqlResult", "withSqlStatementResults", "(", "SqlStatementResult", "...", "sqlStatementResults", ")", "{", "if", "(", "this", ".", "sqlStatementResults", "==", "null", ")", "{", "setSqlStatementResults", "(", "new", "java", ".", "util", ".", "ArrayL...
Results returned by executing the sql statement(s) <p> <b>NOTE:</b> This method appends the values to the existing list (if any). Use {@link #setSqlStatementResults(java.util.Collection)} or {@link #withSqlStatementResults(java.util.Collection)} if you want to override the existing values. </p> @param sqlStatementResu...
[ "Results", "returned", "by", "executing", "the", "sql", "statement", "(", "s", ")", "<p", ">", "<b", ">", "NOTE", ":", "<", "/", "b", ">", "This", "method", "appends", "the", "values", "to", "the", "existing", "list", "(", "if", "any", ")", ".", "U...
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-rdsdata/src/main/java/com/amazonaws/services/rdsdata/model/ExecuteSqlResult.java#L69-L77
train
A list of SQL statement results.
Create a Java method that does the following: "A list of SQL statement results.".
Of course, here is the Java code you requested: ```java public ExecuteSqlResult withSqlStatementResults(SqlStatementResult... sqlStatementResults) { if (this.sqlStatementResults == null) { setSqlStatementResults(new java.util.ArrayList<SqlStatementResult>(sqlStatementResults.length)); } ...
FedericoPecora/meta-csp-framework
src/main/java/org/metacsp/utility/UI/PlotBoxTLSmall.java
PlotBoxTLSmall.createChart
@SuppressWarnings("deprecation") private JFreeChart createChart(CategoryDataset dataset) { // String s = name; String s = null; String tit = null; String ax = null; // if (first) // tit = title + " (EST)"; // else if (last) // ax = "Time"; tit = this.name; chart = ChartFactory...
java
@SuppressWarnings("deprecation") private JFreeChart createChart(CategoryDataset dataset) { // String s = name; String s = null; String tit = null; String ax = null; // if (first) // tit = title + " (EST)"; // else if (last) // ax = "Time"; tit = this.name; chart = ChartFactory...
[ "@", "SuppressWarnings", "(", "\"deprecation\"", ")", "private", "JFreeChart", "createChart", "(", "CategoryDataset", "dataset", ")", "{", "//\t\tString s = name;\r", "String", "s", "=", "null", ";", "String", "tit", "=", "null", ";", "String", "ax", "=", "null"...
Creates a chart for the PlotBoxBehavior @param dataset A dataset for the chart. @return A chart where the PlotBoxBehavior will be plotted.
[ "Creates", "a", "chart", "for", "the", "PlotBoxBehavior" ]
42aaef2e2b76d0f738427f0dd9653c4f62b40517
https://github.com/FedericoPecora/meta-csp-framework/blob/42aaef2e2b76d0f738427f0dd9653c4f62b40517/src/main/java/org/metacsp/utility/UI/PlotBoxTLSmall.java#L205-L293
train
Create a chart for the NCSU - 2 specification.
Create a Java method that does the following: "Create a chart for the NCSU - 2 specification.".
Of course, here is the Java code you requested: ```java @SuppressWarnings("deprecation") private JFreeChart createChart(CategoryDataset dataset) { // String s = name; String s = null; String tit = null; String ax = null; // if (first) // tit = title + " (EST)"; // else if (last) // ax = "Time"...
apereo/cas
support/cas-server-support-token-core-api/src/main/java/org/apereo/cas/token/JwtTokenCipherSigningPublicKeyEndpoint.java
JwtTokenCipherSigningPublicKeyEndpoint.fetchPublicKey
@ReadOperation(produces = MediaType.TEXT_PLAIN_VALUE) public String fetchPublicKey(@Nullable final String service) throws Exception { val factory = KeyFactory.getInstance("RSA"); var signingKey = tokenCipherExecutor.getSigningKey(); if (StringUtils.isNotBlank(service)) { val reg...
java
@ReadOperation(produces = MediaType.TEXT_PLAIN_VALUE) public String fetchPublicKey(@Nullable final String service) throws Exception { val factory = KeyFactory.getInstance("RSA"); var signingKey = tokenCipherExecutor.getSigningKey(); if (StringUtils.isNotBlank(service)) { val reg...
[ "@", "ReadOperation", "(", "produces", "=", "MediaType", ".", "TEXT_PLAIN_VALUE", ")", "public", "String", "fetchPublicKey", "(", "@", "Nullable", "final", "String", "service", ")", "throws", "Exception", "{", "val", "factory", "=", "KeyFactory", ".", "getInstan...
Fetch public key. @param service the service @return the string @throws Exception the exception
[ "Fetch", "public", "key", "." ]
b4b306433a8782cef803a39bea5b1f96740e0e9b
https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-token-core-api/src/main/java/org/apereo/cas/token/JwtTokenCipherSigningPublicKeyEndpoint.java#L50-L73
train
Fetch public key.
Create a Java method that does the following: "Fetch public key.".
Of course, here is the Java code you requested: ```java @ReadOperation(produces = MediaType.TEXT_PLAIN_VALUE) public String fetchPublicKey(@Nullable final String service) throws Exception { val factory = KeyFactory.getInstance("RSA"); var signingKey = tokenCipherExecutor.getSigningKey(); i...
Whiley/WhileyCompiler
src/main/java/wyil/interpreter/Interpreter.java
Interpreter.executeExpression
public <T extends RValue> T executeExpression(Class<T> expected, Expr expr, CallStack frame) { RValue val; switch (expr.getOpcode()) { case WyilFile.EXPR_constant: val = executeConst((Expr.Constant) expr, frame); break; case WyilFile.EXPR_cast: val = executeConvert((Expr.Cast) expr, frame); break; ...
java
public <T extends RValue> T executeExpression(Class<T> expected, Expr expr, CallStack frame) { RValue val; switch (expr.getOpcode()) { case WyilFile.EXPR_constant: val = executeConst((Expr.Constant) expr, frame); break; case WyilFile.EXPR_cast: val = executeConvert((Expr.Cast) expr, frame); break; ...
[ "public", "<", "T", "extends", "RValue", ">", "T", "executeExpression", "(", "Class", "<", "T", ">", "expected", ",", "Expr", "expr", ",", "CallStack", "frame", ")", "{", "RValue", "val", ";", "switch", "(", "expr", ".", "getOpcode", "(", ")", ")", "...
Execute a single expression which is expected to return a single result of an expected type. If a result of an incorrect type is returned, then an exception is raised. @param expected The expected type of the result @param expr The expression to be executed @param frame The frame in which the expression is executing @...
[ "Execute", "a", "single", "expression", "which", "is", "expected", "to", "return", "a", "single", "result", "of", "an", "expected", "type", ".", "If", "a", "result", "of", "an", "incorrect", "type", "is", "returned", "then", "an", "exception", "is", "raise...
680f8a657d3fc286f8cc422755988b6d74ab3f4c
https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyil/interpreter/Interpreter.java#L543-L680
train
Execute an expression on the stack.
Create a Java method that does the following: "Execute an expression on the stack.".
Of course, here is the Java code you requested: ```java public <T extends RValue> T executeExpression(Class<T> expected, Expr expr, CallStack frame) { RValue val; switch (expr.getOpcode()) { case WyilFile.EXPR_constant: val = executeConst((Expr.Constant) expr, frame); break; case WyilFile.EXPR_cast: v...
leancloud/java-sdk-all
realtime/src/main/java/cn/leancloud/im/v2/AVIMConversation.java
AVIMConversation.setAttributes
public void setAttributes(Map<String, Object> attr) { pendingAttributes.clear(); pendingAttributes.putAll(attr); }
java
public void setAttributes(Map<String, Object> attr) { pendingAttributes.clear(); pendingAttributes.putAll(attr); }
[ "public", "void", "setAttributes", "(", "Map", "<", "String", ",", "Object", ">", "attr", ")", "{", "pendingAttributes", ".", "clear", "(", ")", ";", "pendingAttributes", ".", "putAll", "(", "attr", ")", ";", "}" ]
设置当前聊天对话的属性 @param attr @since 3.0
[ "设置当前聊天对话的属性" ]
323f8e7ee38051b1350790e5192304768c5c9f5f
https://github.com/leancloud/java-sdk-all/blob/323f8e7ee38051b1350790e5192304768c5c9f5f/realtime/src/main/java/cn/leancloud/im/v2/AVIMConversation.java#L374-L377
train
Sets the attributes of this node.
Create a Java method that does the following: "Sets the attributes of this node.".
Of course, here is the Java code you requested: ```java public void setAttributes(Map<String, Object> attr) { pendingAttributes.clear(); pendingAttributes.putAll(attr); } ``` Hope this helps!
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.utils/src/com/ibm/ws/sib/utils/ffdc/SibDiagnosticModule.java
SibDiagnosticModule.toFFDCStringSingleObject
protected String toFFDCStringSingleObject(Object obj) { if (obj == null) { return "<null>"; } else if (obj instanceof Traceable) { return ((Traceable) obj).toTraceString(); } else if (obj instanceof String) { return ((String) obj); } else if (obj instanceof by...
java
protected String toFFDCStringSingleObject(Object obj) { if (obj == null) { return "<null>"; } else if (obj instanceof Traceable) { return ((Traceable) obj).toTraceString(); } else if (obj instanceof String) { return ((String) obj); } else if (obj instanceof by...
[ "protected", "String", "toFFDCStringSingleObject", "(", "Object", "obj", ")", "{", "if", "(", "obj", "==", "null", ")", "{", "return", "\"<null>\"", ";", "}", "else", "if", "(", "obj", "instanceof", "Traceable", ")", "{", "return", "(", "(", "Traceable", ...
Generates a string representation of an object for FFDC. @param obj Object to generate a string representation of @return The string representation of the object
[ "Generates", "a", "string", "representation", "of", "an", "object", "for", "FFDC", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.utils/src/com/ibm/ws/sib/utils/ffdc/SibDiagnosticModule.java#L317-L339
train
To FFDC String Single Object
Create a Java method that does the following: "To FFDC String Single Object".
Of course, here is the Java code you requested: ```java protected String toFFDCStringSingleObject(Object obj) { if (obj == null) { return "<null>"; } else if (obj instanceof Traceable) { return ((Traceable) obj).toTraceString(); } else if (obj instanceof String) { re...
groupon/monsoon
intf/src/main/java/com/groupon/lex/metrics/resolver/NamedResolverMap.java
NamedResolverMap.intKeySet
public Set<Integer> intKeySet() { return data.keySet().stream() .map(Any2::getLeft) .flatMap(opt -> opt.map(Stream::of).orElseGet(Stream::empty)) .collect(Collectors.toSet()); }
java
public Set<Integer> intKeySet() { return data.keySet().stream() .map(Any2::getLeft) .flatMap(opt -> opt.map(Stream::of).orElseGet(Stream::empty)) .collect(Collectors.toSet()); }
[ "public", "Set", "<", "Integer", ">", "intKeySet", "(", ")", "{", "return", "data", ".", "keySet", "(", ")", ".", "stream", "(", ")", ".", "map", "(", "Any2", "::", "getLeft", ")", ".", "flatMap", "(", "opt", "->", "opt", ".", "map", "(", "Stream...
The numeric set of keys held by the resolver map. @return the numberic set of keys held by the resolver map.
[ "The", "numeric", "set", "of", "keys", "held", "by", "the", "resolver", "map", "." ]
eb68d72ba4c01fe018dc981097dbee033908f5c7
https://github.com/groupon/monsoon/blob/eb68d72ba4c01fe018dc981097dbee033908f5c7/intf/src/main/java/com/groupon/lex/metrics/resolver/NamedResolverMap.java#L211-L216
train
Get the set of identifiers of the data.
Create a Java method that does the following: "Get the set of identifiers of the data.".
Of course, here is the Java code you requested: ```java public Set<Integer> intKeySet() { return data.keySet().stream() .map(Any2::getLeft) .flatMap(opt -> opt.map(Stream::of).orElseGet(Stream::empty)) .collect(Collectors.toSet()); } ``` Hope this helps!
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/ToHTMLStream.java
ToHTMLStream.setOutputFormat
public void setOutputFormat(Properties format) { /* * If "format" does not contain the property * S_USE_URL_ESCAPING, then don't set this value at all, * just leave as-is rather than explicitly setting it. */ String value; value = format.getProperty(Outpu...
java
public void setOutputFormat(Properties format) { /* * If "format" does not contain the property * S_USE_URL_ESCAPING, then don't set this value at all, * just leave as-is rather than explicitly setting it. */ String value; value = format.getProperty(Outpu...
[ "public", "void", "setOutputFormat", "(", "Properties", "format", ")", "{", "/*\n * If \"format\" does not contain the property\n * S_USE_URL_ESCAPING, then don't set this value at all,\n * just leave as-is rather than explicitly setting it.\n */", "String", "valu...
Specifies an output format for this serializer. It the serializer has already been associated with an output format, it will switch to the new format. This method should not be called while the serializer is in the process of serializing a document. This method can be called multiple times before starting the serializ...
[ "Specifies", "an", "output", "format", "for", "this", "serializer", ".", "It", "the", "serializer", "has", "already", "been", "associated", "with", "an", "output", "format", "it", "will", "switch", "to", "the", "new", "format", ".", "This", "method", "should...
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/ToHTMLStream.java#L566-L596
train
Sets the output format.
Create a Java method that does the following: "Sets the output format.".
Of course, here is the Java code you requested: ```java public void setOutputFormat(Properties format) { /* * If "format" does not contain the property * S_USE_URL_ESCAPING, then don't set this value at all, * just leave as-is rather than explicitly setting it. */ ...
bitcoinj/bitcoinj
core/src/main/java/org/bitcoinj/net/BlockingClient.java
BlockingClient.runReadLoop
public static void runReadLoop(InputStream stream, StreamConnection connection) throws Exception { ByteBuffer dbuf = ByteBuffer.allocateDirect(Math.min(Math.max(connection.getMaxMessageSize(), BUFFER_SIZE_LOWER_BOUND), BUFFER_SIZE_UPPER_BOUND)); byte[] readBuff = new byte[dbuf.capacity()]; while...
java
public static void runReadLoop(InputStream stream, StreamConnection connection) throws Exception { ByteBuffer dbuf = ByteBuffer.allocateDirect(Math.min(Math.max(connection.getMaxMessageSize(), BUFFER_SIZE_LOWER_BOUND), BUFFER_SIZE_UPPER_BOUND)); byte[] readBuff = new byte[dbuf.capacity()]; while...
[ "public", "static", "void", "runReadLoop", "(", "InputStream", "stream", ",", "StreamConnection", "connection", ")", "throws", "Exception", "{", "ByteBuffer", "dbuf", "=", "ByteBuffer", ".", "allocateDirect", "(", "Math", ".", "min", "(", "Math", ".", "max", "...
A blocking call that never returns, except by throwing an exception. It reads bytes from the input stream and feeds them to the provided {@link StreamConnection}, for example, a {@link Peer}.
[ "A", "blocking", "call", "that", "never", "returns", "except", "by", "throwing", "an", "exception", ".", "It", "reads", "bytes", "from", "the", "input", "stream", "and", "feeds", "them", "to", "the", "provided", "{" ]
9cf13d29315014ed59cf4fc5944e5f227e8df9a6
https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/net/BlockingClient.java#L108-L128
train
Run the read loop.
Create a Java method that does the following: "Run the read loop.".
Of course, here is the Java code you requested: ```java public static void runReadLoop(InputStream stream, StreamConnection connection) throws Exception { ByteBuffer dbuf = ByteBuffer.allocateDirect(Math.min(Math.max(connection.getMaxMessageSize(), BUFFER_SIZE_LOWER_BOUND), BUFFER_SIZE_UPPER_BOUND)); b...
spring-projects/spring-data-solr
src/main/java/org/springframework/data/solr/core/mapping/SimpleSolrPersistentProperty.java
SimpleSolrPersistentProperty.getDefaultValue
@Override public Object getDefaultValue() { Indexed indexedAnnotation = getIndexAnnotation(); if (indexedAnnotation != null && StringUtils.hasText(indexedAnnotation.defaultValue())) { return indexedAnnotation.defaultValue(); } return null; }
java
@Override public Object getDefaultValue() { Indexed indexedAnnotation = getIndexAnnotation(); if (indexedAnnotation != null && StringUtils.hasText(indexedAnnotation.defaultValue())) { return indexedAnnotation.defaultValue(); } return null; }
[ "@", "Override", "public", "Object", "getDefaultValue", "(", ")", "{", "Indexed", "indexedAnnotation", "=", "getIndexAnnotation", "(", ")", ";", "if", "(", "indexedAnnotation", "!=", "null", "&&", "StringUtils", ".", "hasText", "(", "indexedAnnotation", ".", "de...
/* (non-Javadoc) @see org.springframework.data.solr.core.mapping.SolrPersistentProperty#getDefaultValue()
[ "/", "*", "(", "non", "-", "Javadoc", ")" ]
20be5cb82498b70134dfda6c1a91ad21f8e657e0
https://github.com/spring-projects/spring-data-solr/blob/20be5cb82498b70134dfda6c1a91ad21f8e657e0/src/main/java/org/springframework/data/solr/core/mapping/SimpleSolrPersistentProperty.java#L206-L214
train
Returns the default value of the index annotation.
Create a Java method that does the following: "Returns the default value of the index annotation.".
Of course, here is the Java code you requested: ```java @Override public Object getDefaultValue() { Indexed indexedAnnotation = getIndexAnnotation(); if (indexedAnnotation != null && StringUtils.hasText(indexedAnnotation.defaultValue())) { return indexedAnnotation.defaultValue(); } return null; } ``` Ho...
FasterXML/woodstox
src/main/java/com/ctc/wstx/dtd/FullDTDReader.java
FullDTDReader.handleEntityDecl
private void handleEntityDecl(boolean suppressPEDecl) throws XMLStreamException { /* Hmmh. It seems that PE reference are actually accepted * even here... which makes distinguishing definition from * reference bit challenging. */ char c = dtdNextFromCurr(); ...
java
private void handleEntityDecl(boolean suppressPEDecl) throws XMLStreamException { /* Hmmh. It seems that PE reference are actually accepted * even here... which makes distinguishing definition from * reference bit challenging. */ char c = dtdNextFromCurr(); ...
[ "private", "void", "handleEntityDecl", "(", "boolean", "suppressPEDecl", ")", "throws", "XMLStreamException", "{", "/* Hmmh. It seems that PE reference are actually accepted\n * even here... which makes distinguishing definition from\n * reference bit challenging.\n */", ...
This method is tricky to implement, since it can contain parameter entities in multiple combinations... and yet declare one as well. @param suppressPEDecl If true, will need to take of enabling/disabling of flattened output.
[ "This", "method", "is", "tricky", "to", "implement", "since", "it", "can", "contain", "parameter", "entities", "in", "multiple", "combinations", "...", "and", "yet", "declare", "one", "as", "well", "." ]
ffcaabdc06672d9564c48c25d601d029b7fd6548
https://github.com/FasterXML/woodstox/blob/ffcaabdc06672d9564c48c25d601d029b7fd6548/src/main/java/com/ctc/wstx/dtd/FullDTDReader.java#L2351-L2514
train
Handle an ENTITY declaration.
Create a Java method that does the following: "Handle an ENTITY declaration.".
Of course, here is the Java code you requested: ```java private void handleEntityDecl(boolean suppressPEDecl) throws XMLStreamException { /* Hmmh. It seems that PE reference are actually accepted * even here... which makes distinguishing definition from * reference bit challenging...
Kurento/kurento-module-creator
src/main/java/com/github/zafarkhaja/semver/VersionParser.java
VersionParser.preReleaseIdentifier
private String preReleaseIdentifier() { checkForEmptyIdentifier(); CharType boundary = nearestCharType(CharType.DOT, CharType.PLUS, CharType.EOL); if (chars.positiveLookaheadBefore(boundary, CharType.LETTER, CharType.HYPHEN)) { return alphanumericIdentifier(); } else { return numericIdentifi...
java
private String preReleaseIdentifier() { checkForEmptyIdentifier(); CharType boundary = nearestCharType(CharType.DOT, CharType.PLUS, CharType.EOL); if (chars.positiveLookaheadBefore(boundary, CharType.LETTER, CharType.HYPHEN)) { return alphanumericIdentifier(); } else { return numericIdentifi...
[ "private", "String", "preReleaseIdentifier", "(", ")", "{", "checkForEmptyIdentifier", "(", ")", ";", "CharType", "boundary", "=", "nearestCharType", "(", "CharType", ".", "DOT", ",", "CharType", ".", "PLUS", ",", "CharType", ".", "EOL", ")", ";", "if", "(",...
Parses the {@literal <pre-release identifier>} non-terminal. <pre> {@literal <pre-release identifier> ::= <alphanumeric identifier> | <numeric identifier> } </pre> @return a single pre-release identifier
[ "Parses", "the", "{", "@literal", "<pre", "-", "release", "identifier", ">", "}", "non", "-", "terminal", "." ]
c371516c665b902b5476433496a5aefcbca86d64
https://github.com/Kurento/kurento-module-creator/blob/c371516c665b902b5476433496a5aefcbca86d64/src/main/java/com/github/zafarkhaja/semver/VersionParser.java#L382-L390
train
Pre - release identifier.
Create a Java method that does the following: "Pre - release identifier.".
Of course, here is the Java code you requested: ```java private String preReleaseIdentifier() { checkForEmptyIdentifier(); CharType boundary = nearestCharType(CharType.DOT, CharType.PLUS, CharType.EOL); if (chars.positiveLookaheadBefore(boundary, CharType.LETTER, CharType.HYPHEN)) { return alphanumer...
KyoriPowered/lunar
src/main/java/net/kyori/lunar/Pair.java
Pair.of
public static <L, R> @NonNull Pair<L, R> of(final @Nullable L left, final @Nullable R right) { return new Pair<>(left, right); }
java
public static <L, R> @NonNull Pair<L, R> of(final @Nullable L left, final @Nullable R right) { return new Pair<>(left, right); }
[ "public", "static", "<", "L", ",", "R", ">", "@", "NonNull", "Pair", "<", "L", ",", "R", ">", "of", "(", "final", "@", "Nullable", "L", "left", ",", "final", "@", "Nullable", "R", "right", ")", "{", "return", "new", "Pair", "<>", "(", "left", "...
Creates a new pair. @param left the left value @param right the right value @param <L> the left type @param <R> the right type @return the pair
[ "Creates", "a", "new", "pair", "." ]
6856747d9034a2fe0c8d0a8a0150986797732b5c
https://github.com/KyoriPowered/lunar/blob/6856747d9034a2fe0c8d0a8a0150986797732b5c/src/main/java/net/kyori/lunar/Pair.java#L89-L91
train
Creates a pair of two items.
Create a Java method that does the following: "Creates a pair of two items.".
Of course, here is the Java code you requested: ```java public static <L, R> @NonNull Pair<L, R> of(final @Nullable L left, final @Nullable R right) { return new Pair<>(left, right); } ``` Hope this helps!
dita-ot/dita-ot
src/main/java/org/dita/dost/reader/GenListModuleReader.java
GenListModuleReader.isOutFile
private boolean isOutFile(final URI toCheckPath) { final String path = toCheckPath.getPath(); return !(path != null && path.startsWith(rootDir.getPath())); }
java
private boolean isOutFile(final URI toCheckPath) { final String path = toCheckPath.getPath(); return !(path != null && path.startsWith(rootDir.getPath())); }
[ "private", "boolean", "isOutFile", "(", "final", "URI", "toCheckPath", ")", "{", "final", "String", "path", "=", "toCheckPath", ".", "getPath", "(", ")", ";", "return", "!", "(", "path", "!=", "null", "&&", "path", ".", "startsWith", "(", "rootDir", ".",...
Check if path walks up in parent directories @param toCheckPath path to check @return {@code true} if path walks up, otherwise {@code false}
[ "Check", "if", "path", "walks", "up", "in", "parent", "directories" ]
ea776b3c60c03d9f033b6f7ea072349e49dbcdd2
https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/reader/GenListModuleReader.java#L742-L745
train
Checks if the path is a directory.
Create a Java method that does the following: "Checks if the path is a directory.".
Of course, here is the Java code you requested: ```java private boolean isOutFile(final URI toCheckPath) { final String path = toCheckPath.getPath(); return !(path != null && path.startsWith(rootDir.getPath())); } ``` Hope this helps!
liferay/com-liferay-commerce
commerce-discount-api/src/main/java/com/liferay/commerce/discount/service/persistence/CommerceDiscountUtil.java
CommerceDiscountUtil.fetchByUuid_C_Last
public static CommerceDiscount fetchByUuid_C_Last(String uuid, long companyId, OrderByComparator<CommerceDiscount> orderByComparator) { return getPersistence() .fetchByUuid_C_Last(uuid, companyId, orderByComparator); }
java
public static CommerceDiscount fetchByUuid_C_Last(String uuid, long companyId, OrderByComparator<CommerceDiscount> orderByComparator) { return getPersistence() .fetchByUuid_C_Last(uuid, companyId, orderByComparator); }
[ "public", "static", "CommerceDiscount", "fetchByUuid_C_Last", "(", "String", "uuid", ",", "long", "companyId", ",", "OrderByComparator", "<", "CommerceDiscount", ">", "orderByComparator", ")", "{", "return", "getPersistence", "(", ")", ".", "fetchByUuid_C_Last", "(", ...
Returns the last commerce discount in the ordered set where uuid = &#63; and companyId = &#63;. @param uuid the uuid @param companyId the company ID @param orderByComparator the comparator to order the set by (optionally <code>null</code>) @return the last matching commerce discount, or <code>null</code> if a matching...
[ "Returns", "the", "last", "commerce", "discount", "in", "the", "ordered", "set", "where", "uuid", "=", "&#63", ";", "and", "companyId", "=", "&#63", ";", "." ]
9e54362d7f59531fc684016ba49ee7cdc3a2f22b
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-discount-api/src/main/java/com/liferay/commerce/discount/service/persistence/CommerceDiscountUtil.java#L461-L465
train
Returns the commerce discount with the UUID and company from the ordered set.
Create a Java method that does the following: "Returns the commerce discount with the UUID and company from the ordered set.".
Of course, here is the Java code you requested: ```java public static CommerceDiscount fetchByUuid_C_Last(String uuid, long companyId, OrderByComparator<CommerceDiscount> orderByComparator) { return getPersistence() .fetchByUuid_C_Last(uuid, companyId, orderByComparator); } ``` Hope this helps!
cdk/cdk
base/standard/src/main/java/org/openscience/cdk/fingerprint/HybridizationFingerprinter.java
HybridizationFingerprinter.isSP2Bond
private boolean isSP2Bond(IBond bond) { return bond.getAtomCount() == 2 && bond.getBegin().getHybridization() == Hybridization.SP2 && bond.getEnd().getHybridization() == Hybridization.SP2; }
java
private boolean isSP2Bond(IBond bond) { return bond.getAtomCount() == 2 && bond.getBegin().getHybridization() == Hybridization.SP2 && bond.getEnd().getHybridization() == Hybridization.SP2; }
[ "private", "boolean", "isSP2Bond", "(", "IBond", "bond", ")", "{", "return", "bond", ".", "getAtomCount", "(", ")", "==", "2", "&&", "bond", ".", "getBegin", "(", ")", ".", "getHybridization", "(", ")", "==", "Hybridization", ".", "SP2", "&&", "bond", ...
Returns true if the bond binds two atoms, and both atoms are SP2.
[ "Returns", "true", "if", "the", "bond", "binds", "two", "atoms", "and", "both", "atoms", "are", "SP2", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/fingerprint/HybridizationFingerprinter.java#L118-L121
train
Checks if the bond is a SP2 bond.
Create a Java method that does the following: "Checks if the bond is a SP2 bond.".
Of course, here is the Java code you requested: ```java private boolean isSP2Bond(IBond bond) { return bond.getAtomCount() == 2 && bond.getBegin().getHybridization() == Hybridization.SP2 && bond.getEnd().getHybridization() == Hybridization.SP2; } ``` Hope this helps!
MenoData/Time4J
base/src/main/java/net/time4j/DayPeriod.java
DayPeriod.of
static DayPeriod of( Locale locale, String calendarType ) { String lang = locale.getLanguage(); // NPE-check if (lang.equals("nn")) { locale = new Locale("nb"); // CLDR 29 contains no data for language nn } Map<String, String> resourceMap = loadTextForm...
java
static DayPeriod of( Locale locale, String calendarType ) { String lang = locale.getLanguage(); // NPE-check if (lang.equals("nn")) { locale = new Locale("nb"); // CLDR 29 contains no data for language nn } Map<String, String> resourceMap = loadTextForm...
[ "static", "DayPeriod", "of", "(", "Locale", "locale", ",", "String", "calendarType", ")", "{", "String", "lang", "=", "locale", ".", "getLanguage", "(", ")", ";", "// NPE-check", "if", "(", "lang", ".", "equals", "(", "\"nn\"", ")", ")", "{", "locale", ...
package-private because used in deserialization
[ "package", "-", "private", "because", "used", "in", "deserialization" ]
08b2eda6b2dbb140b92011cf7071bb087edd46a5
https://github.com/MenoData/Time4J/blob/08b2eda6b2dbb140b92011cf7071bb087edd46a5/base/src/main/java/net/time4j/DayPeriod.java#L441-L495
train
Get DayPeriod object from a calendar type and a phrase.
Create a Java method that does the following: "Get DayPeriod object from a calendar type and a phrase.".
Of course, here is the Java code you requested: ```java static DayPeriod of( Locale locale, String calendarType ) { String lang = locale.getLanguage(); // NPE-check if (lang.equals("nn")) { locale = new Locale("nb"); // CLDR 29 contains no data for language nn ...
netty/netty
handler/src/main/java/io/netty/handler/ssl/OpenSslSessionStats.java
OpenSslSessionStats.acceptGood
public long acceptGood() { Lock readerLock = context.ctxLock.readLock(); readerLock.lock(); try { return SSLContext.sessionAcceptGood(context.ctx); } finally { readerLock.unlock(); } }
java
public long acceptGood() { Lock readerLock = context.ctxLock.readLock(); readerLock.lock(); try { return SSLContext.sessionAcceptGood(context.ctx); } finally { readerLock.unlock(); } }
[ "public", "long", "acceptGood", "(", ")", "{", "Lock", "readerLock", "=", "context", ".", "ctxLock", ".", "readLock", "(", ")", ";", "readerLock", ".", "lock", "(", ")", ";", "try", "{", "return", "SSLContext", ".", "sessionAcceptGood", "(", "context", "...
Returns the number of successfully established SSL/TLS sessions in server mode.
[ "Returns", "the", "number", "of", "successfully", "established", "SSL", "/", "TLS", "sessions", "in", "server", "mode", "." ]
ba06eafa1c1824bd154f1a380019e7ea2edf3c4c
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/handler/src/main/java/io/netty/handler/ssl/OpenSslSessionStats.java#L108-L116
train
Returns the number of good sessions.
Create a Java method that does the following: "Returns the number of good sessions.".
Of course, here is the Java code you requested: ```java public long acceptGood() { Lock readerLock = context.ctxLock.readLock(); readerLock.lock(); try { return SSLContext.sessionAcceptGood(context.ctx); } finally { readerLock.unlock(); } } ``` Hope ...
GojaFramework/goja
goja-web/src/main/java/goja/Invoker.java
Invoker.invokeInThread
public static void invokeInThread(DirectInvocation invocation) { boolean retry = true; while (retry) { invocation.run(); if (invocation.retry == null) { retry = false; } else { try { if (invocation.retry.task != null...
java
public static void invokeInThread(DirectInvocation invocation) { boolean retry = true; while (retry) { invocation.run(); if (invocation.retry == null) { retry = false; } else { try { if (invocation.retry.task != null...
[ "public", "static", "void", "invokeInThread", "(", "DirectInvocation", "invocation", ")", "{", "boolean", "retry", "=", "true", ";", "while", "(", "retry", ")", "{", "invocation", ".", "run", "(", ")", ";", "if", "(", "invocation", ".", "retry", "==", "n...
Run the code in the same thread than caller. @param invocation The code to run
[ "Run", "the", "code", "in", "the", "same", "thread", "than", "caller", "." ]
77179b495f668fc1fa20accc912991df6bb2d917
https://github.com/GojaFramework/goja/blob/77179b495f668fc1fa20accc912991df6bb2d917/goja-web/src/main/java/goja/Invoker.java#L87-L106
test
Invoke the direct invocation in a thread.
Create a Java method that does the following: "Invoke the direct invocation in a thread.".
Of course, here is the Java code you requested: ```java public static void invokeInThread(DirectInvocation invocation) { boolean retry = true; while (retry) { invocation.run(); if (invocation.retry == null) { retry = false; } else { tr...
baratine/baratine
framework/src/main/java/com/caucho/v5/http/pod/PodApp.java
PodApp.postClassLoaderInit
public void postClassLoaderInit() { // bartender.setLocalShard(pod.getNode(podNode)); ServiceManagerBuilderAmp builder = ServicesAmp.newManager(); builder.name(EnvLoader.getEnvironmentName()); BartenderSystem bartender = BartenderSystem.current(); if (bartender != null) { PodBartender p...
java
public void postClassLoaderInit() { // bartender.setLocalShard(pod.getNode(podNode)); ServiceManagerBuilderAmp builder = ServicesAmp.newManager(); builder.name(EnvLoader.getEnvironmentName()); BartenderSystem bartender = BartenderSystem.current(); if (bartender != null) { PodBartender p...
[ "public", "void", "postClassLoaderInit", "(", ")", "{", "// bartender.setLocalShard(pod.getNode(podNode));", "ServiceManagerBuilderAmp", "builder", "=", "ServicesAmp", ".", "newManager", "(", ")", ";", "builder", ".", "name", "(", "EnvLoader", ".", "getEnvironmentName", ...
/* @Override public void preConfigInit() throws Exception { }
[ "/", "*" ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/http/pod/PodApp.java#L283-L328
train
Called after the class loader initialization.
Create a Java method that does the following: "Called after the class loader initialization.".
Of course, here is the Java code you requested: ```java public void postClassLoaderInit() { // bartender.setLocalShard(pod.getNode(podNode)); ServiceManagerBuilderAmp builder = ServicesAmp.newManager(); builder.name(EnvLoader.getEnvironmentName()); BartenderSystem bartender = BartenderSystem.cur...
b3log/latke
latke-core/src/main/java/org/b3log/latke/repository/jdbc/JdbcRepository.java
JdbcRepository.buildSelect
private void buildSelect(final StringBuilder selectBuilder, final List<Projection> projections) { selectBuilder.append("SELECT "); if (null == projections || projections.isEmpty()) { selectBuilder.append(" * "); return; } selectBuilder.append(projections.stream(...
java
private void buildSelect(final StringBuilder selectBuilder, final List<Projection> projections) { selectBuilder.append("SELECT "); if (null == projections || projections.isEmpty()) { selectBuilder.append(" * "); return; } selectBuilder.append(projections.stream(...
[ "private", "void", "buildSelect", "(", "final", "StringBuilder", "selectBuilder", ",", "final", "List", "<", "Projection", ">", "projections", ")", "{", "selectBuilder", ".", "append", "(", "\"SELECT \"", ")", ";", "if", "(", "null", "==", "projections", "||",...
Builds 'SELECT' part with the specified select build and projections. @param selectBuilder the specified select builder @param projections the specified projections
[ "Builds", "SELECT", "part", "with", "the", "specified", "select", "build", "and", "projections", "." ]
f7e08a47eeecea5f7c94006382c24f353585de33
https://github.com/b3log/latke/blob/f7e08a47eeecea5f7c94006382c24f353585de33/latke-core/src/main/java/org/b3log/latke/repository/jdbc/JdbcRepository.java#L581-L590
train
Build a SELECT statement.
Create a Java method that does the following: "Build a SELECT statement.".
Of course, here is the Java code you requested: ```java private void buildSelect(final StringBuilder selectBuilder, final List<Projection> projections) { selectBuilder.append("SELECT "); if (null == projections || projections.isEmpty()) { selectBuilder.append(" * "); return; ...
lastaflute/lastaflute
src/main/java/org/lastaflute/web/validation/ActionValidator.java
ActionValidator.comeOnHibernateValidator
protected Validator comeOnHibernateValidator(Supplier<VaConfigSetupper> configSetupperSupplier) { if (isSuppressHibernateValidatorCache()) { return createHibernateValidator(configSetupperSupplier); } else { // basically here if (cachedValidator != null) { return c...
java
protected Validator comeOnHibernateValidator(Supplier<VaConfigSetupper> configSetupperSupplier) { if (isSuppressHibernateValidatorCache()) { return createHibernateValidator(configSetupperSupplier); } else { // basically here if (cachedValidator != null) { return c...
[ "protected", "Validator", "comeOnHibernateValidator", "(", "Supplier", "<", "VaConfigSetupper", ">", "configSetupperSupplier", ")", "{", "if", "(", "isSuppressHibernateValidatorCache", "(", ")", ")", "{", "return", "createHibernateValidator", "(", "configSetupperSupplier", ...
-----------------
[ "-----------------" ]
17b56dda8322e4c6d79043532c1dda917d6b60a8
https://github.com/lastaflute/lastaflute/blob/17b56dda8322e4c6d79043532c1dda917d6b60a8/src/main/java/org/lastaflute/web/validation/ActionValidator.java#L362-L377
train
This method is called by the HibernateValidatorFactory to get the correct Hibernate Validator instance.
Create a Java method that does the following: "This method is called by the HibernateValidatorFactory to get the correct Hibernate Validator instance.".
Of course, here is the Java code you requested: ```java protected Validator comeOnHibernateValidator(Supplier<VaConfigSetupper> configSetupperSupplier) { if (isSuppressHibernateValidatorCache()) { return createHibernateValidator(configSetupperSupplier); } else { // basically here ...
liferay/com-liferay-commerce
commerce-product-type-grouped-api/src/main/java/com/liferay/commerce/product/type/grouped/service/CPDefinitionGroupedEntryLocalServiceUtil.java
CPDefinitionGroupedEntryLocalServiceUtil.getCPDefinitionGroupedEntriesByUuidAndCompanyId
public static java.util.List<com.liferay.commerce.product.type.grouped.model.CPDefinitionGroupedEntry> getCPDefinitionGroupedEntriesByUuidAndCompanyId( String uuid, long companyId) { return getService() .getCPDefinitionGroupedEntriesByUuidAndCompanyId(uuid, companyId); }
java
public static java.util.List<com.liferay.commerce.product.type.grouped.model.CPDefinitionGroupedEntry> getCPDefinitionGroupedEntriesByUuidAndCompanyId( String uuid, long companyId) { return getService() .getCPDefinitionGroupedEntriesByUuidAndCompanyId(uuid, companyId); }
[ "public", "static", "java", ".", "util", ".", "List", "<", "com", ".", "liferay", ".", "commerce", ".", "product", ".", "type", ".", "grouped", ".", "model", ".", "CPDefinitionGroupedEntry", ">", "getCPDefinitionGroupedEntriesByUuidAndCompanyId", "(", "String", ...
Returns all the cp definition grouped entries matching the UUID and company. @param uuid the UUID of the cp definition grouped entries @param companyId the primary key of the company @return the matching cp definition grouped entries, or an empty list if no matches were found
[ "Returns", "all", "the", "cp", "definition", "grouped", "entries", "matching", "the", "UUID", "and", "company", "." ]
9e54362d7f59531fc684016ba49ee7cdc3a2f22b
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-type-grouped-api/src/main/java/com/liferay/commerce/product/type/grouped/service/CPDefinitionGroupedEntryLocalServiceUtil.java#L321-L326
train
Returns the cp definition grouped entries matching the UUID and company.
Create a Java method that does the following: "Returns the cp definition grouped entries matching the UUID and company.".
Of course, here is the Java code you requested: ```java public static java.util.List<com.liferay.commerce.product.type.grouped.model.CPDefinitionGroupedEntry> getCPDefinitionGroupedEntriesByUuidAndCompanyId( String uuid, long companyId) { return getService() .getCPDefinitionGroupedEntriesByUuidAndCompanyId(...
Azure/azure-sdk-for-java
edgegateway/resource-manager/v2019_03_01/src/main/java/com/microsoft/azure/management/edgegateway/v2019_03_01/implementation/StorageAccountCredentialsInner.java
StorageAccountCredentialsInner.createOrUpdateAsync
public Observable<StorageAccountCredentialInner> createOrUpdateAsync(String deviceName, String name, String resourceGroupName, StorageAccountCredentialInner storageAccountCredential) { return createOrUpdateWithServiceResponseAsync(deviceName, name, resourceGroupName, storageAccountCredential).map(new Func1<Serv...
java
public Observable<StorageAccountCredentialInner> createOrUpdateAsync(String deviceName, String name, String resourceGroupName, StorageAccountCredentialInner storageAccountCredential) { return createOrUpdateWithServiceResponseAsync(deviceName, name, resourceGroupName, storageAccountCredential).map(new Func1<Serv...
[ "public", "Observable", "<", "StorageAccountCredentialInner", ">", "createOrUpdateAsync", "(", "String", "deviceName", ",", "String", "name", ",", "String", "resourceGroupName", ",", "StorageAccountCredentialInner", "storageAccountCredential", ")", "{", "return", "createOrU...
Creates or updates the storage account credential. @param deviceName The device name. @param name The storage account credential name. @param resourceGroupName The resource group name. @param storageAccountCredential The storage account credential. @throws IllegalArgumentException thrown if parameters fail the validat...
[ "Creates", "or", "updates", "the", "storage", "account", "credential", "." ]
aab183ddc6686c82ec10386d5a683d2691039626
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/edgegateway/resource-manager/v2019_03_01/src/main/java/com/microsoft/azure/management/edgegateway/v2019_03_01/implementation/StorageAccountCredentialsInner.java#L351-L358
train
Creates or updates a storage account credential.
Create a Java method that does the following: "Creates or updates a storage account credential.".
Of course, here is the Java code you requested: ```java public Observable<StorageAccountCredentialInner> createOrUpdateAsync(String deviceName, String name, String resourceGroupName, StorageAccountCredentialInner storageAccountCredential) { return createOrUpdateWithServiceResponseAsync(deviceName, name, resour...
citrusframework/citrus
modules/citrus-core/src/main/java/com/consol/citrus/xml/namespace/NamespaceContextBuilder.java
NamespaceContextBuilder.buildContext
public NamespaceContext buildContext(Message receivedMessage, Map<String, String> namespaces) { SimpleNamespaceContext simpleNamespaceContext = new SimpleNamespaceContext(); //first add default namespace definitions if (namespaceMappings.size() > 0) { simpleNamespaceContext....
java
public NamespaceContext buildContext(Message receivedMessage, Map<String, String> namespaces) { SimpleNamespaceContext simpleNamespaceContext = new SimpleNamespaceContext(); //first add default namespace definitions if (namespaceMappings.size() > 0) { simpleNamespaceContext....
[ "public", "NamespaceContext", "buildContext", "(", "Message", "receivedMessage", ",", "Map", "<", "String", ",", "String", ">", "namespaces", ")", "{", "SimpleNamespaceContext", "simpleNamespaceContext", "=", "new", "SimpleNamespaceContext", "(", ")", ";", "//first ad...
Construct a basic namespace context from the received message and explicit namespace mappings. @param receivedMessage the actual message received. @param namespaces explicit namespace mappings for this construction. @return the constructed namespace context.
[ "Construct", "a", "basic", "namespace", "context", "from", "the", "received", "message", "and", "explicit", "namespace", "mappings", "." ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/xml/namespace/NamespaceContextBuilder.java#L52-L76
train
Build namespace context from received message.
Create a Java method that does the following: "Build namespace context from received message.".
Of course, here is the Java code you requested: ```java public NamespaceContext buildContext(Message receivedMessage, Map<String, String> namespaces) { SimpleNamespaceContext simpleNamespaceContext = new SimpleNamespaceContext(); //first add default namespace definitions if (namespaceM...
haraldk/TwelveMonkeys
common/common-lang/src/main/java/com/twelvemonkeys/lang/SystemUtil.java
SystemUtil.main
public static void main(String[] args) throws CloneNotSupportedException { System.out.println("clone: " + args.clone().length + " (" + args.length + ")"); System.out.println("copy: " + ((String[]) clone(args)).length + " (" + args.length + ")"); int[] ints = {1,2,3}; int[] copies...
java
public static void main(String[] args) throws CloneNotSupportedException { System.out.println("clone: " + args.clone().length + " (" + args.length + ")"); System.out.println("copy: " + ((String[]) clone(args)).length + " (" + args.length + ")"); int[] ints = {1,2,3}; int[] copies...
[ "public", "static", "void", "main", "(", "String", "[", "]", "args", ")", "throws", "CloneNotSupportedException", "{", "System", ".", "out", ".", "println", "(", "\"clone: \"", "+", "args", ".", "clone", "(", ")", ".", "length", "+", "\" (\"", "+", "args...
}
[ "}" ]
7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d
https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/common/common-lang/src/main/java/com/twelvemonkeys/lang/SystemUtil.java#L504-L566
train
Main method to run the class.
Create a Java method that does the following: "Main method to run the class.".
Of course, here is the Java code you requested: ```java public static void main(String[] args) throws CloneNotSupportedException { System.out.println("clone: " + args.clone().length + " (" + args.length + ")"); System.out.println("copy: " + ((String[]) clone(args)).length + " (" + args.length + ")"...
ckpoint/CheckPoint
src/main/java/hsim/checkpoint/util/ValidationObjUtil.java
ValidationObjUtil.isGetterMethod
public static boolean isGetterMethod(Method m) { String methodName = m.getName(); if (methodName.equals("getClass")) { return false; } if (!methodName.startsWith(GET_METHOD_PREFIX) && !methodName.startsWith(IS_METHOD_PREFIX)) { return false; } i...
java
public static boolean isGetterMethod(Method m) { String methodName = m.getName(); if (methodName.equals("getClass")) { return false; } if (!methodName.startsWith(GET_METHOD_PREFIX) && !methodName.startsWith(IS_METHOD_PREFIX)) { return false; } i...
[ "public", "static", "boolean", "isGetterMethod", "(", "Method", "m", ")", "{", "String", "methodName", "=", "m", ".", "getName", "(", ")", ";", "if", "(", "methodName", ".", "equals", "(", "\"getClass\"", ")", ")", "{", "return", "false", ";", "}", "if...
Is getter method boolean. @param m the m @return the boolean
[ "Is", "getter", "method", "boolean", "." ]
2c2b1a87a88485d49ea6afa34acdf16ef4134f19
https://github.com/ckpoint/CheckPoint/blob/2c2b1a87a88485d49ea6afa34acdf16ef4134f19/src/main/java/hsim/checkpoint/util/ValidationObjUtil.java#L370-L386
train
Checks if the method is a getter method.
Create a Java method that does the following: "Checks if the method is a getter method.".
Of course, here is the Java code you requested: ```java public static boolean isGetterMethod(Method m) { String methodName = m.getName(); if (methodName.equals("getClass")) { return false; } if (!methodName.startsWith(GET_METHOD_PREFIX) && !methodName.startsWith(IS_METHOD...
kuali/ojb-1.0.4
src/java/org/apache/ojb/broker/metadata/RepositoryTags.java
RepositoryTags.getIdByTag
public int getIdByTag(String tag) { Integer value = (Integer) table.getValueByKey(tag); if (value == null) LoggerFactory.getDefaultLogger().error( "** " + this.getClass().getName() + ": Tag '" + tag + "' is not defined. **"); return value.intValue(); }
java
public int getIdByTag(String tag) { Integer value = (Integer) table.getValueByKey(tag); if (value == null) LoggerFactory.getDefaultLogger().error( "** " + this.getClass().getName() + ": Tag '" + tag + "' is not defined. **"); return value.intValue(); }
[ "public", "int", "getIdByTag", "(", "String", "tag", ")", "{", "Integer", "value", "=", "(", "Integer", ")", "table", ".", "getValueByKey", "(", "tag", ")", ";", "if", "(", "value", "==", "null", ")", "LoggerFactory", ".", "getDefaultLogger", "(", ")", ...
returns the repository element id associated with the xml-tag literal <code>tag</code>. @return the resulting repository element id. @throws NullPointerException if no value was found for <b>tag</b>
[ "returns", "the", "repository", "element", "id", "associated", "with", "the", "xml", "-", "tag", "literal", "<code", ">", "tag<", "/", "code", ">", "." ]
9a544372f67ce965f662cdc71609dd03683c8f04
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/metadata/RepositoryTags.java#L263-L270
train
Gets the ID of a single SECTYPE tag.
Create a Java method that does the following: "Gets the ID of a single SECTYPE tag.".
Of course, here is the Java code you requested: ```java public int getIdByTag(String tag) { Integer value = (Integer) table.getValueByKey(tag); if (value == null) LoggerFactory.getDefaultLogger().error( "** " + this.getClass().getName() + ": Tag '" + tag + "' is not...
OpenEstate/OpenEstate-IO
OpenImmo/src/main/jaxb/org/openestate/io/openimmo/xml/ObjectFactory.java
ObjectFactory.createErbpacht
@XmlElementDecl(namespace = "", name = "erbpacht") @XmlJavaTypeAdapter(Adapter2 .class) public JAXBElement<BigDecimal> createErbpacht(BigDecimal value) { return new JAXBElement<BigDecimal>(_Erbpacht_QNAME, BigDecimal.class, null, value); }
java
@XmlElementDecl(namespace = "", name = "erbpacht") @XmlJavaTypeAdapter(Adapter2 .class) public JAXBElement<BigDecimal> createErbpacht(BigDecimal value) { return new JAXBElement<BigDecimal>(_Erbpacht_QNAME, BigDecimal.class, null, value); }
[ "@", "XmlElementDecl", "(", "namespace", "=", "\"\"", ",", "name", "=", "\"erbpacht\"", ")", "@", "XmlJavaTypeAdapter", "(", "Adapter2", ".", "class", ")", "public", "JAXBElement", "<", "BigDecimal", ">", "createErbpacht", "(", "BigDecimal", "value", ")", "{",...
Create an instance of {@link JAXBElement }{@code <}{@link BigDecimal }{@code >}}
[ "Create", "an", "instance", "of", "{", "@link", "JAXBElement", "}", "{", "@code", "<", "}", "{", "@link", "BigDecimal", "}", "{", "@code", ">", "}}" ]
f961dae78f40823f05a8c0d4e59d639e718aa18a
https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/OpenImmo/src/main/jaxb/org/openestate/io/openimmo/xml/ObjectFactory.java#L1813-L1817
test
Create an instance of an erbpacht type.
Create a Java method that does the following: "Create an instance of an erbpacht type.".
Of course, here is the Java code you requested: ```java @XmlElementDecl(namespace = "", name = "erbpacht") @XmlJavaTypeAdapter(Adapter2 .class) public JAXBElement<BigDecimal> createErbpacht(BigDecimal value) { return new JAXBElement<BigDecimal>(_Erbpacht_QNAME, BigDecimal.class, null, value); } ```...
liferay/com-liferay-commerce
commerce-api/src/main/java/com/liferay/commerce/service/persistence/CommerceSubscriptionEntryUtil.java
CommerceSubscriptionEntryUtil.findBySubscriptionStatus_First
public static CommerceSubscriptionEntry findBySubscriptionStatus_First( int subscriptionStatus, OrderByComparator<CommerceSubscriptionEntry> orderByComparator) throws com.liferay.commerce.exception.NoSuchSubscriptionEntryException { return getPersistence() .findBySubscriptionStatus_First(subscriptionStat...
java
public static CommerceSubscriptionEntry findBySubscriptionStatus_First( int subscriptionStatus, OrderByComparator<CommerceSubscriptionEntry> orderByComparator) throws com.liferay.commerce.exception.NoSuchSubscriptionEntryException { return getPersistence() .findBySubscriptionStatus_First(subscriptionStat...
[ "public", "static", "CommerceSubscriptionEntry", "findBySubscriptionStatus_First", "(", "int", "subscriptionStatus", ",", "OrderByComparator", "<", "CommerceSubscriptionEntry", ">", "orderByComparator", ")", "throws", "com", ".", "liferay", ".", "commerce", ".", "exception"...
Returns the first commerce subscription entry in the ordered set where subscriptionStatus = &#63;. @param subscriptionStatus the subscription status @param orderByComparator the comparator to order the set by (optionally <code>null</code>) @return the first matching commerce subscription entry @throws NoSuchSubscripti...
[ "Returns", "the", "first", "commerce", "subscription", "entry", "in", "the", "ordered", "set", "where", "subscriptionStatus", "=", "&#63", ";", "." ]
9e54362d7f59531fc684016ba49ee7cdc3a2f22b
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-api/src/main/java/com/liferay/commerce/service/persistence/CommerceSubscriptionEntryUtil.java#L758-L765
train
Returns the first commerce subscription entry in the ordered set where subscriptionStatus = &#63 ; and orderByComparator = &#63 ;.
Create a Java method that does the following: "Returns the first commerce subscription entry in the ordered set where subscriptionStatus = &#63 ; and orderByComparator = &#63 ;.".
Of course, here is the Java code you requested: ```java public static CommerceSubscriptionEntry findBySubscriptionStatus_First( int subscriptionStatus, OrderByComparator<CommerceSubscriptionEntry> orderByComparator) throws com.liferay.commerce.exception.NoSuchSubscriptionEntryException { return getPersistence(...
spockframework/spock
spock-core/src/main/java/org/spockframework/runtime/GroovyRuntimeUtil.java
GroovyRuntimeUtil.asIterator
public static Iterator<Object> asIterator(Object object) { try { return InvokerHelper.asIterator(object); } catch (InvokerInvocationException e) { ExceptionUtil.sneakyThrow(e.getCause()); return null; // never reached } }
java
public static Iterator<Object> asIterator(Object object) { try { return InvokerHelper.asIterator(object); } catch (InvokerInvocationException e) { ExceptionUtil.sneakyThrow(e.getCause()); return null; // never reached } }
[ "public", "static", "Iterator", "<", "Object", ">", "asIterator", "(", "Object", "object", ")", "{", "try", "{", "return", "InvokerHelper", ".", "asIterator", "(", "object", ")", ";", "}", "catch", "(", "InvokerInvocationException", "e", ")", "{", "Exception...
Note: This method may throw checked exceptions although it doesn't say so.
[ "Note", ":", "This", "method", "may", "throw", "checked", "exceptions", "although", "it", "doesn", "t", "say", "so", "." ]
d751a0abd8d5a2ec5338aa10bc2d19371b3b3ad9
https://github.com/spockframework/spock/blob/d751a0abd8d5a2ec5338aa10bc2d19371b3b3ad9/spock-core/src/main/java/org/spockframework/runtime/GroovyRuntimeUtil.java#L224-L231
train
Returns an iterator over the given object.
Create a Java method that does the following: "Returns an iterator over the given object.".
Of course, here is the Java code you requested: ```java public static Iterator<Object> asIterator(Object object) { try { return InvokerHelper.asIterator(object); } catch (InvokerInvocationException e) { ExceptionUtil.sneakyThrow(e.getCause()); return null; // never reached } } ``` Hope...
aws/aws-sdk-java
aws-java-sdk-cognitoidentity/src/main/java/com/amazonaws/services/cognitoidentity/model/UnlinkIdentityRequest.java
UnlinkIdentityRequest.withLoginsToRemove
public UnlinkIdentityRequest withLoginsToRemove(String... loginsToRemove) { if (this.loginsToRemove == null) { setLoginsToRemove(new java.util.ArrayList<String>(loginsToRemove.length)); } for (String ele : loginsToRemove) { this.loginsToRemove.add(ele); } ...
java
public UnlinkIdentityRequest withLoginsToRemove(String... loginsToRemove) { if (this.loginsToRemove == null) { setLoginsToRemove(new java.util.ArrayList<String>(loginsToRemove.length)); } for (String ele : loginsToRemove) { this.loginsToRemove.add(ele); } ...
[ "public", "UnlinkIdentityRequest", "withLoginsToRemove", "(", "String", "...", "loginsToRemove", ")", "{", "if", "(", "this", ".", "loginsToRemove", "==", "null", ")", "{", "setLoginsToRemove", "(", "new", "java", ".", "util", ".", "ArrayList", "<", "String", ...
<p> Provider names to unlink from this identity. </p> <p> <b>NOTE:</b> This method appends the values to the existing list (if any). Use {@link #setLoginsToRemove(java.util.Collection)} or {@link #withLoginsToRemove(java.util.Collection)} if you want to override the existing values. </p> @param loginsToRemove Provider...
[ "<p", ">", "Provider", "names", "to", "unlink", "from", "this", "identity", ".", "<", "/", "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-cognitoidentity/src/main/java/com/amazonaws/services/cognitoidentity/model/UnlinkIdentityRequest.java#L196-L204
train
A list of logins to remove from the identity table.
Create a Java method that does the following: "A list of logins to remove from the identity table.".
Of course, here is the Java code you requested: ```java public UnlinkIdentityRequest withLoginsToRemove(String... loginsToRemove) { if (this.loginsToRemove == null) { setLoginsToRemove(new java.util.ArrayList<String>(loginsToRemove.length)); } for (String ele : loginsToRemove) { ...
Azure/azure-sdk-for-java
applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/implementation/EventsImpl.java
EventsImpl.getByTypeAsync
public ServiceFuture<EventsResults> getByTypeAsync(String appId, EventType eventType, final ServiceCallback<EventsResults> serviceCallback) { return ServiceFuture.fromResponse(getByTypeWithServiceResponseAsync(appId, eventType), serviceCallback); }
java
public ServiceFuture<EventsResults> getByTypeAsync(String appId, EventType eventType, final ServiceCallback<EventsResults> serviceCallback) { return ServiceFuture.fromResponse(getByTypeWithServiceResponseAsync(appId, eventType), serviceCallback); }
[ "public", "ServiceFuture", "<", "EventsResults", ">", "getByTypeAsync", "(", "String", "appId", ",", "EventType", "eventType", ",", "final", "ServiceCallback", "<", "EventsResults", ">", "serviceCallback", ")", "{", "return", "ServiceFuture", ".", "fromResponse", "(...
Execute OData query. Executes an OData query for events. @param appId ID of the application. This is Application ID from the API Access settings blade in the Azure portal. @param eventType The type of events to query; either a standard event type (`traces`, `customEvents`, `pageViews`, `requests`, `dependencies`, `exc...
[ "Execute", "OData", "query", ".", "Executes", "an", "OData", "query", "for", "events", "." ]
aab183ddc6686c82ec10386d5a683d2691039626
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/implementation/EventsImpl.java#L92-L94
train
Gets an App Service Environment by type.
Create a Java method that does the following: "Gets an App Service Environment by type.".
Of course, here is the Java code you requested: ```java public ServiceFuture<EventsResults> getByTypeAsync(String appId, EventType eventType, final ServiceCallback<EventsResults> serviceCallback) { return ServiceFuture.fromResponse(getByTypeWithServiceResponseAsync(appId, eventType), serviceCallback); } ``...
davityle/ngAndroid
ng-processor/src/main/java/com/github/davityle/ngprocessor/util/TypeUtils.java
TypeUtils.getOperatorKind
public TypeMirror getOperatorKind(TypeMirror leftMirror, TypeMirror rightMirror , TokenType.BinaryOperator operator){ if(leftMirror == null || rightMirror == null) return null; TypeKind leftKind = leftMirror.getKind(); TypeKind rightKind = rightMirror.getKind(); if(isStrin...
java
public TypeMirror getOperatorKind(TypeMirror leftMirror, TypeMirror rightMirror , TokenType.BinaryOperator operator){ if(leftMirror == null || rightMirror == null) return null; TypeKind leftKind = leftMirror.getKind(); TypeKind rightKind = rightMirror.getKind(); if(isStrin...
[ "public", "TypeMirror", "getOperatorKind", "(", "TypeMirror", "leftMirror", ",", "TypeMirror", "rightMirror", ",", "TokenType", ".", "BinaryOperator", "operator", ")", "{", "if", "(", "leftMirror", "==", "null", "||", "rightMirror", "==", "null", ")", "return", ...
rules for this method are found here http://docs.oracle.com/javase/specs/jls/se7/html/jls-5.html#jls-5.6.2 If any operand is of a reference type, it is subjected to unboxing conversion (§5.1.8). Widening primitive conversion (§5.1.2) is applied to convert either or both operands as specified by the following rules: I...
[ "rules", "for", "this", "method", "are", "found", "here" ]
1497a9752cd3d4918035531cd072fd01576328e9
https://github.com/davityle/ngAndroid/blob/1497a9752cd3d4918035531cd072fd01576328e9/ng-processor/src/main/java/com/github/davityle/ngprocessor/util/TypeUtils.java#L79-L138
train
Gets the operator kind.
Create a Java method that does the following: "Gets the operator kind.".
Of course, here is the Java code you requested: ```java public TypeMirror getOperatorKind(TypeMirror leftMirror, TypeMirror rightMirror , TokenType.BinaryOperator operator){ if(leftMirror == null || rightMirror == null) return null; TypeKind leftKind = leftMirror.getKind(); TypeKi...
apache/incubator-druid
processing/src/main/java/org/apache/druid/segment/filter/Filters.java
Filters.toFilter
@Nullable public static Filter toFilter(@Nullable DimFilter dimFilter) { return dimFilter == null ? null : dimFilter.toFilter(); }
java
@Nullable public static Filter toFilter(@Nullable DimFilter dimFilter) { return dimFilter == null ? null : dimFilter.toFilter(); }
[ "@", "Nullable", "public", "static", "Filter", "toFilter", "(", "@", "Nullable", "DimFilter", "dimFilter", ")", "{", "return", "dimFilter", "==", "null", "?", "null", ":", "dimFilter", ".", "toFilter", "(", ")", ";", "}" ]
Convert a DimFilter to a Filter. @param dimFilter dimFilter @return converted filter, or null if input was null
[ "Convert", "a", "DimFilter", "to", "a", "Filter", "." ]
f776b9408962b9006cfcfe4d6c1794751972cc8e
https://github.com/apache/incubator-druid/blob/f776b9408962b9006cfcfe4d6c1794751972cc8e/processing/src/main/java/org/apache/druid/segment/filter/Filters.java#L104-L108
train
Convert a DimFilter to a CDN Filter.
Create a Java method that does the following: "Convert a DimFilter to a CDN Filter.".
Of course, here is the Java code you requested: ```java @Nullable public static Filter toFilter(@Nullable DimFilter dimFilter) { return dimFilter == null ? null : dimFilter.toFilter(); } ``` Hope this helps!
CODAIT/stocator
src/main/java/com/ibm/stocator/fs/swift/SwiftAPIClient.java
SwiftAPIClient.createObject
@Override public FSDataOutputStream createObject(String objName, String contentType, Map<String, String> metadata, Statistics statistics) throws IOException { final URL url = new URL(mJossAccount.getAccessURL() + "/" + getURLEncodedObjName(objName)); LOG.debug("PUT {}. Content-Type : {}", url.toString()...
java
@Override public FSDataOutputStream createObject(String objName, String contentType, Map<String, String> metadata, Statistics statistics) throws IOException { final URL url = new URL(mJossAccount.getAccessURL() + "/" + getURLEncodedObjName(objName)); LOG.debug("PUT {}. Content-Type : {}", url.toString()...
[ "@", "Override", "public", "FSDataOutputStream", "createObject", "(", "String", "objName", ",", "String", "contentType", ",", "Map", "<", "String", ",", "String", ">", "metadata", ",", "Statistics", "statistics", ")", "throws", "IOException", "{", "final", "URL"...
Direct HTTP PUT request without JOSS package @param objName name of the object @param contentType content type @return HttpURLConnection
[ "Direct", "HTTP", "PUT", "request", "without", "JOSS", "package" ]
35969cadd2e8faa6fdac45e8bec1799fdd3d8299
https://github.com/CODAIT/stocator/blob/35969cadd2e8faa6fdac45e8bec1799fdd3d8299/src/main/java/com/ibm/stocator/fs/swift/SwiftAPIClient.java#L641-L665
train
Create an object.
Create a Java method that does the following: "Create an object.".
Of course, here is the Java code you requested: ```java @Override public FSDataOutputStream createObject(String objName, String contentType, Map<String, String> metadata, Statistics statistics) throws IOException { final URL url = new URL(mJossAccount.getAccessURL() + "/" + getURLEncodedObjName(objName)); ...
OWASP/java-html-sanitizer
src/main/java/org/owasp/html/Encoding.java
Encoding.encodeHtmlOnto
@TCB private static void encodeHtmlOnto( String plainText, Appendable output, @Nullable String braceReplacement) throws IOException { int n = plainText.length(); int pos = 0; for (int i = 0; i < n; ++i) { char ch = plainText.charAt(i); if (ch < REPLACEMENTS.length) { // Handle...
java
@TCB private static void encodeHtmlOnto( String plainText, Appendable output, @Nullable String braceReplacement) throws IOException { int n = plainText.length(); int pos = 0; for (int i = 0; i < n; ++i) { char ch = plainText.charAt(i); if (ch < REPLACEMENTS.length) { // Handle...
[ "@", "TCB", "private", "static", "void", "encodeHtmlOnto", "(", "String", "plainText", ",", "Appendable", "output", ",", "@", "Nullable", "String", "braceReplacement", ")", "throws", "IOException", "{", "int", "n", "=", "plainText", ".", "length", "(", ")", ...
Writes the HTML equivalent of the given plain text to output. For example, {@code escapeHtmlOnto("1 < 2", w)}, is equivalent to {@code w.append("1 &lt; 2")} but possibly with fewer smaller appends. Elides code-units that are not valid XML Characters. @see <a href="http://www.w3.org/TR/2008/REC-xml-20081126/#charsets">X...
[ "Writes", "the", "HTML", "equivalent", "of", "the", "given", "plain", "text", "to", "output", ".", "For", "example", "{" ]
a30315fe9a41e19c449628e7ef3488b3a7856009
https://github.com/OWASP/java-html-sanitizer/blob/a30315fe9a41e19c449628e7ef3488b3a7856009/src/main/java/org/owasp/html/Encoding.java#L187-L285
train
Encode HTML to output.
Create a Java method that does the following: "Encode HTML to output.".
Of course, here is the Java code you requested: ```java @TCB private static void encodeHtmlOnto( String plainText, Appendable output, @Nullable String braceReplacement) throws IOException { int n = plainText.length(); int pos = 0; for (int i = 0; i < n; ++i) { char ch = plainText.ch...
alkacon/opencms-core
src/org/opencms/flex/CmsFlexBucketConfiguration.java
CmsFlexBucketConfiguration.shouldClearAll
public boolean shouldClearAll(List<CmsPublishedResource> publishedResources) { for (CmsPublishedResource pubRes : publishedResources) { for (String clearPath : m_clearAll) { if (CmsStringUtil.isPrefixPath(clearPath, pubRes.getRootPath())) { return true; ...
java
public boolean shouldClearAll(List<CmsPublishedResource> publishedResources) { for (CmsPublishedResource pubRes : publishedResources) { for (String clearPath : m_clearAll) { if (CmsStringUtil.isPrefixPath(clearPath, pubRes.getRootPath())) { return true; ...
[ "public", "boolean", "shouldClearAll", "(", "List", "<", "CmsPublishedResource", ">", "publishedResources", ")", "{", "for", "(", "CmsPublishedResource", "pubRes", ":", "publishedResources", ")", "{", "for", "(", "String", "clearPath", ":", "m_clearAll", ")", "{",...
Returns true if for the given publish list, the complete Flex cache should be cleared based on this configuration.<p> @param publishedResources a publish list @return true if the complete Flex cache should be cleared
[ "Returns", "true", "if", "for", "the", "given", "publish", "list", "the", "complete", "Flex", "cache", "should", "be", "cleared", "based", "on", "this", "configuration", ".", "<p", ">" ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/flex/CmsFlexBucketConfiguration.java#L313-L323
train
Checks if all the content should be cleared.
Create a Java method that does the following: "Checks if all the content should be cleared.".
Of course, here is the Java code you requested: ```java public boolean shouldClearAll(List<CmsPublishedResource> publishedResources) { for (CmsPublishedResource pubRes : publishedResources) { for (String clearPath : m_clearAll) { if (CmsStringUtil.isPrefixPath(clearPath, pubRes.get...