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
tiefaces/TieFaces
src/org/tiefaces/components/websheet/dataobjects/TieSheetNumberConverter.java
TieSheetNumberConverter.getAsString
@Override public final String getAsString(final FacesContext context, final UIComponent component, final Object value) { String strValue = null; String symbol = ""; try { strValue = (String) value; symbol = (String) component.getAttributes() .get(TieConstants.CELL_DATA_SYMBOL); if...
java
@Override public final String getAsString(final FacesContext context, final UIComponent component, final Object value) { String strValue = null; String symbol = ""; try { strValue = (String) value; symbol = (String) component.getAttributes() .get(TieConstants.CELL_DATA_SYMBOL); if...
[ "@", "Override", "public", "final", "String", "getAsString", "(", "final", "FacesContext", "context", ",", "final", "UIComponent", "component", ",", "final", "Object", "value", ")", "{", "String", "strValue", "=", "null", ";", "String", "symbol", "=", "\"\"", ...
/* (non-Javadoc) @see javax.faces.convert.Converter#getAsString(javax.faces.context. FacesContext, javax.faces.component.UIComponent, java.lang.Object)
[ "/", "*", "(", "non", "-", "Javadoc", ")" ]
3b57b9701ed0f080b5fa4fa78269cc0c422b34ba
https://github.com/tiefaces/TieFaces/blob/3b57b9701ed0f080b5fa4fa78269cc0c422b34ba/src/org/tiefaces/components/websheet/dataobjects/TieSheetNumberConverter.java#L86-L115
test
Override getAsString to return the value of the attribute.
Create a Java method that does the following: "Override getAsString to return the value of the attribute.".
Of course, here is the Java code you requested: ```java @Override public final String getAsString(final FacesContext context, final UIComponent component, final Object value) { String strValue = null; String symbol = ""; try { strValue = (String) value; symbol = (String) component.getAttribu...
yan74/afplib
org.afplib/src/main/java/org/afplib/afplib/impl/FontResolutionImpl.java
FontResolutionImpl.setRPUnits
public void setRPUnits(Integer newRPUnits) { Integer oldRPUnits = rpUnits; rpUnits = newRPUnits; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, AfplibPackage.FONT_RESOLUTION__RP_UNITS, oldRPUnits, rpUnits)); }
java
public void setRPUnits(Integer newRPUnits) { Integer oldRPUnits = rpUnits; rpUnits = newRPUnits; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, AfplibPackage.FONT_RESOLUTION__RP_UNITS, oldRPUnits, rpUnits)); }
[ "public", "void", "setRPUnits", "(", "Integer", "newRPUnits", ")", "{", "Integer", "oldRPUnits", "=", "rpUnits", ";", "rpUnits", "=", "newRPUnits", ";", "if", "(", "eNotificationRequired", "(", ")", ")", "eNotify", "(", "new", "ENotificationImpl", "(", "this",...
<!-- begin-user-doc --> <!-- end-user-doc --> @generated
[ "<!", "--", "begin", "-", "user", "-", "doc", "--", ">", "<!", "--", "end", "-", "user", "-", "doc", "--", ">" ]
9ff0513f9448bdf8c0b0e31dc4910c094c48fb2f
https://github.com/yan74/afplib/blob/9ff0513f9448bdf8c0b0e31dc4910c094c48fb2f/org.afplib/src/main/java/org/afplib/afplib/impl/FontResolutionImpl.java#L167-L172
train
Sets the RP units.
Create a Java method that does the following: "Sets the RP units.".
Of course, here is the Java code you requested: ```java public void setRPUnits(Integer newRPUnits) { Integer oldRPUnits = rpUnits; rpUnits = newRPUnits; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, AfplibPackage.FONT_RESOLUTION__RP_UNITS, oldRPUnits, rpUnits)); } ``` Ho...
james-hu/jabb-core
src/main/java/net/sf/jabb/util/stat/FrequencyCounter.java
FrequencyCounter.purge
public void purge(Date baseTime, long periodBefore, TimeUnit unit) { purge(baseTime.getTime(), periodBefore, unit); }
java
public void purge(Date baseTime, long periodBefore, TimeUnit unit) { purge(baseTime.getTime(), periodBefore, unit); }
[ "public", "void", "purge", "(", "Date", "baseTime", ",", "long", "periodBefore", ",", "TimeUnit", "unit", ")", "{", "purge", "(", "baseTime", ".", "getTime", "(", ")", ",", "periodBefore", ",", "unit", ")", ";", "}" ]
删除掉早于一定时间的记录 @param baseTime 从什么时间算起 @param periodBefore 多少时间之前的要删掉 @param unit 时间单位
[ "删除掉早于一定时间的记录" ]
bceed441595c5e5195a7418795f03b69fa7b61e4
https://github.com/james-hu/jabb-core/blob/bceed441595c5e5195a7418795f03b69fa7b61e4/src/main/java/net/sf/jabb/util/stat/FrequencyCounter.java#L199-L201
train
Purges the records in the database that have been created for the given time period.
Create a Java method that does the following: "Purges the records in the database that have been created for the given time period.".
Of course, here is the Java code you requested: ```java public void purge(Date baseTime, long periodBefore, TimeUnit unit) { purge(baseTime.getTime(), periodBefore, unit); } ``` Hope this helps!
jdereg/json-io
src/main/java/com/cedarsoftware/util/io/JsonWriter.java
JsonWriter.objectToJson
public static String objectToJson(Object item, Map<String, Object> optionalArgs) { try { ByteArrayOutputStream stream = new ByteArrayOutputStream(); JsonWriter writer = new JsonWriter(stream, optionalArgs); writer.write(item); writer.close(); ...
java
public static String objectToJson(Object item, Map<String, Object> optionalArgs) { try { ByteArrayOutputStream stream = new ByteArrayOutputStream(); JsonWriter writer = new JsonWriter(stream, optionalArgs); writer.write(item); writer.close(); ...
[ "public", "static", "String", "objectToJson", "(", "Object", "item", ",", "Map", "<", "String", ",", "Object", ">", "optionalArgs", ")", "{", "try", "{", "ByteArrayOutputStream", "stream", "=", "new", "ByteArrayOutputStream", "(", ")", ";", "JsonWriter", "writ...
Convert a Java Object to a JSON String. @param item Object to convert to a JSON String. @param optionalArgs (optional) Map of extra arguments indicating how dates are formatted, what fields are written out (optional). For Date parameters, use the public static DATE_TIME key, and then use the ISO_DATE or ISO_DATE_TIME...
[ "Convert", "a", "Java", "Object", "to", "a", "JSON", "String", "." ]
763da4e6fac93367febfda4c790ab44967054ba7
https://github.com/jdereg/json-io/blob/763da4e6fac93367febfda4c790ab44967054ba7/src/main/java/com/cedarsoftware/util/io/JsonWriter.java#L304-L318
valid
Convert a object to a JSON string.
Create a Java method that does the following: "Convert a object to a JSON string.".
Of course, here is the Java code you requested: ```java public static String objectToJson(Object item, Map<String, Object> optionalArgs) { try { ByteArrayOutputStream stream = new ByteArrayOutputStream(); JsonWriter writer = new JsonWriter(stream, optionalArgs); ...
eclipse/xtext-core
org.eclipse.xtext.xtext.generator/xtend-gen/org/eclipse/xtext/xtext/generator/model/project/RuntimeProjectConfig.java
RuntimeProjectConfig.getEcoreModelFolder
@Override public String getEcoreModelFolder() { boolean _startsWith = this.ecoreModel.getPath().startsWith(this.getRoot().getPath()); if (_startsWith) { final String relativePath = this.ecoreModel.getPath().substring(this.getRoot().getPath().length()).replace("\\", "/"); return CharMatcher.is('/')...
java
@Override public String getEcoreModelFolder() { boolean _startsWith = this.ecoreModel.getPath().startsWith(this.getRoot().getPath()); if (_startsWith) { final String relativePath = this.ecoreModel.getPath().substring(this.getRoot().getPath().length()).replace("\\", "/"); return CharMatcher.is('/')...
[ "@", "Override", "public", "String", "getEcoreModelFolder", "(", ")", "{", "boolean", "_startsWith", "=", "this", ".", "ecoreModel", ".", "getPath", "(", ")", ".", "startsWith", "(", "this", ".", "getRoot", "(", ")", ".", "getPath", "(", ")", ")", ";", ...
Returns the root-relative path of the folder where the generated .ecore and .genmodel can be found. The path is delimited by '/', but does not begin or end with a separator.
[ "Returns", "the", "root", "-", "relative", "path", "of", "the", "folder", "where", "the", "generated", ".", "ecore", "and", ".", "genmodel", "can", "be", "found", ".", "The", "path", "is", "delimited", "by", "/", "but", "does", "not", "begin", "or", "e...
bac941cb75cb24706519845ec174cfef874d7557
https://github.com/eclipse/xtext-core/blob/bac941cb75cb24706519845ec174cfef874d7557/org.eclipse.xtext.xtext.generator/xtend-gen/org/eclipse/xtext/xtext/generator/model/project/RuntimeProjectConfig.java#L41-L63
train
Returns the Ecore model folder from the project configuration.
Create a Java method that does the following: "Returns the Ecore model folder from the project configuration.".
Of course, here is the Java code you requested: ```java @Override public String getEcoreModelFolder() { boolean _startsWith = this.ecoreModel.getPath().startsWith(this.getRoot().getPath()); if (_startsWith) { final String relativePath = this.ecoreModel.getPath().substring(this.getRoot().getPath().lengt...
groupon/monsoon
remote_history/src/main/java/com/groupon/monsoon/remote/history/AbstractServer.java
AbstractServer.newGroupStream
private static group_stream_response newGroupStream(Stream<Map.Entry<DateTime, TimeSeriesValue>> tsc, int fetch) { final BufferedIterator<Map.Entry<DateTime, TimeSeriesValue>> iter = new BufferedIterator<>(tsc.iterator(), GROUP_STREAM_QUEUE_SIZE); final long idx = GROUP_STREAM_ITERS_ALLOC.getAndIncremen...
java
private static group_stream_response newGroupStream(Stream<Map.Entry<DateTime, TimeSeriesValue>> tsc, int fetch) { final BufferedIterator<Map.Entry<DateTime, TimeSeriesValue>> iter = new BufferedIterator<>(tsc.iterator(), GROUP_STREAM_QUEUE_SIZE); final long idx = GROUP_STREAM_ITERS_ALLOC.getAndIncremen...
[ "private", "static", "group_stream_response", "newGroupStream", "(", "Stream", "<", "Map", ".", "Entry", "<", "DateTime", ",", "TimeSeriesValue", ">", ">", "tsc", ",", "int", "fetch", ")", "{", "final", "BufferedIterator", "<", "Map", ".", "Entry", "<", "Dat...
Create a new group iterator from the given stream.
[ "Create", "a", "new", "group", "iterator", "from", "the", "given", "stream", "." ]
eb68d72ba4c01fe018dc981097dbee033908f5c7
https://github.com/groupon/monsoon/blob/eb68d72ba4c01fe018dc981097dbee033908f5c7/remote_history/src/main/java/com/groupon/monsoon/remote/history/AbstractServer.java#L199-L210
train
Creates a new group_stream_response from a stream.
Create a Java method that does the following: "Creates a new group_stream_response from a stream.".
Of course, here is the Java code you requested: ```java private static group_stream_response newGroupStream(Stream<Map.Entry<DateTime, TimeSeriesValue>> tsc, int fetch) { final BufferedIterator<Map.Entry<DateTime, TimeSeriesValue>> iter = new BufferedIterator<>(tsc.iterator(), GROUP_STREAM_QUEUE_SIZE); ...
Unidata/thredds
ui/src/main/java/ucar/nc2/ui/widget/BAMutil.java
BAMutil._makeButtconFromAction
private static AbstractButton _makeButtconFromAction( Action act) { // this prevents null pointer exception if user didnt call setProperties() Boolean tog = (Boolean) act.getValue( BAMutil.TOGGLE); boolean is_toggle = (tog == null ) ? false : tog.booleanValue(); return makeButtcon( (Icon) act.g...
java
private static AbstractButton _makeButtconFromAction( Action act) { // this prevents null pointer exception if user didnt call setProperties() Boolean tog = (Boolean) act.getValue( BAMutil.TOGGLE); boolean is_toggle = (tog == null ) ? false : tog.booleanValue(); return makeButtcon( (Icon) act.g...
[ "private", "static", "AbstractButton", "_makeButtconFromAction", "(", "Action", "act", ")", "{", "// this prevents null pointer exception if user didnt call setProperties()", "Boolean", "tog", "=", "(", "Boolean", ")", "act", ".", "getValue", "(", "BAMutil", ".", "TOGGLE"...
NB: doesnt add action to button
[ "NB", ":", "doesnt", "add", "action", "to", "button" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/ui/src/main/java/ucar/nc2/ui/widget/BAMutil.java#L276-L286
test
Create a button from an action.
Create a Java method that does the following: "Create a button from an action.".
Of course, here is the Java code you requested: ```java private static AbstractButton _makeButtconFromAction( Action act) { // this prevents null pointer exception if user didnt call setProperties() Boolean tog = (Boolean) act.getValue( BAMutil.TOGGLE); boolean is_toggle = (tog == null ) ? false : tog.bool...
mozilla/rhino
src/org/mozilla/javascript/Parser.java
Parser.statements
private AstNode statements(AstNode parent) throws IOException { if (currentToken != Token.LC // assertion can be invalid in bad code && !compilerEnv.isIdeMode()) codeBug(); int pos = ts.tokenBeg; AstNode block = parent != null ? parent : new Block(pos); block.setLineno(ts.li...
java
private AstNode statements(AstNode parent) throws IOException { if (currentToken != Token.LC // assertion can be invalid in bad code && !compilerEnv.isIdeMode()) codeBug(); int pos = ts.tokenBeg; AstNode block = parent != null ? parent : new Block(pos); block.setLineno(ts.li...
[ "private", "AstNode", "statements", "(", "AstNode", "parent", ")", "throws", "IOException", "{", "if", "(", "currentToken", "!=", "Token", ".", "LC", "// assertion can be invalid in bad code", "&&", "!", "compilerEnv", ".", "isIdeMode", "(", ")", ")", "codeBug", ...
node are given relative start positions and correct lengths.
[ "node", "are", "given", "relative", "start", "positions", "and", "correct", "lengths", "." ]
fa8a86df11d37623f5faa8d445a5876612bc47b0
https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/Parser.java#L1070-L1083
train
Parse a block of statements.
Create a Java method that does the following: "Parse a block of statements.".
Of course, here is the Java code you requested: ```java private AstNode statements(AstNode parent) throws IOException { if (currentToken != Token.LC // assertion can be invalid in bad code && !compilerEnv.isIdeMode()) codeBug(); int pos = ts.tokenBeg; AstNode block = parent != null...
TheHortonMachine/hortonmachine
extras/sideprojects/gps/src/main/java/org/hortonmachine/gps/utils/CurrentGpsInfo.java
CurrentGpsInfo.addGSA
public void addGSA( GSASentence gsa ) { try { if (gsa.isValid()) { gpsFixStatus = gsa.getFixStatus(); horizontalPrecision = gsa.getHorizontalDOP(); verticalPrecision = gsa.getVerticalDOP(); positionPrecision = gsa.getPositionDOP(); ...
java
public void addGSA( GSASentence gsa ) { try { if (gsa.isValid()) { gpsFixStatus = gsa.getFixStatus(); horizontalPrecision = gsa.getHorizontalDOP(); verticalPrecision = gsa.getVerticalDOP(); positionPrecision = gsa.getPositionDOP(); ...
[ "public", "void", "addGSA", "(", "GSASentence", "gsa", ")", "{", "try", "{", "if", "(", "gsa", ".", "isValid", "(", ")", ")", "{", "gpsFixStatus", "=", "gsa", ".", "getFixStatus", "(", ")", ";", "horizontalPrecision", "=", "gsa", ".", "getHorizontalDOP",...
Method to add a new {@link GSASentence}. @param gsa the sentence to add.
[ "Method", "to", "add", "a", "new", "{", "@link", "GSASentence", "}", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/extras/sideprojects/gps/src/main/java/org/hortonmachine/gps/utils/CurrentGpsInfo.java#L71-L84
train
Add a GSASentence to the image.
Create a Java method that does the following: "Add a GSASentence to the image.".
Of course, here is the Java code you requested: ```java public void addGSA( GSASentence gsa ) { try { if (gsa.isValid()) { gpsFixStatus = gsa.getFixStatus(); horizontalPrecision = gsa.getHorizontalDOP(); verticalPrecision = gsa.getVerticalDOP(); ...
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/MeasureFormat.java
MeasureFormat.formatMeasureRange
@Deprecated public final String formatMeasureRange(Measure lowValue, Measure highValue) { MeasureUnit unit = lowValue.getUnit(); if (!unit.equals(highValue.getUnit())) { throw new IllegalArgumentException("Units must match: " + unit + " ≠ " + highValue.getUnit()); } Numbe...
java
@Deprecated public final String formatMeasureRange(Measure lowValue, Measure highValue) { MeasureUnit unit = lowValue.getUnit(); if (!unit.equals(highValue.getUnit())) { throw new IllegalArgumentException("Units must match: " + unit + " ≠ " + highValue.getUnit()); } Numbe...
[ "@", "Deprecated", "public", "final", "String", "formatMeasureRange", "(", "Measure", "lowValue", ",", "Measure", "highValue", ")", "{", "MeasureUnit", "unit", "=", "lowValue", ".", "getUnit", "(", ")", ";", "if", "(", "!", "unit", ".", "equals", "(", "hig...
Format a range of measures, such as "3.4-5.1 meters". It is the caller’s responsibility to have the appropriate values in appropriate order, and using the appropriate Number values. <br>Note: If the format doesn’t have enough decimals, or lowValue ≥ highValue, the result will be a degenerate range, like “5-5 meters”. <...
[ "Format", "a", "range", "of", "measures", "such", "as", "3", ".", "4", "-", "5", ".", "1", "meters", ".", "It", "is", "the", "caller’s", "responsibility", "to", "have", "the", "appropriate", "values", "in", "appropriate", "order", "and", "using", "the", ...
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/MeasureFormat.java#L368-L442
train
Format a measure range.
Create a Java method that does the following: "Format a measure range.".
Of course, here is the Java code you requested: ```java @Deprecated public final String formatMeasureRange(Measure lowValue, Measure highValue) { MeasureUnit unit = lowValue.getUnit(); if (!unit.equals(highValue.getUnit())) { throw new IllegalArgumentException("Units must match: " + uni...
grails/grails-core
grails-web-common/src/main/groovy/org/grails/web/pages/GroovyPagesUriSupport.java
GroovyPagesUriSupport.getTemplateURI
public String getTemplateURI(String controllerName, String templateName) { return getTemplateURI(controllerName, templateName, true); }
java
public String getTemplateURI(String controllerName, String templateName) { return getTemplateURI(controllerName, templateName, true); }
[ "public", "String", "getTemplateURI", "(", "String", "controllerName", ",", "String", "templateName", ")", "{", "return", "getTemplateURI", "(", "controllerName", ",", "templateName", ",", "true", ")", ";", "}" ]
Obtains the URI to a template using the controller name and template name @param controllerName The controller name @param templateName The template name @return The template URI
[ "Obtains", "the", "URI", "to", "a", "template", "using", "the", "controller", "name", "and", "template", "name" ]
c0b08aa995b0297143b75d05642abba8cb7b4122
https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-web-common/src/main/groovy/org/grails/web/pages/GroovyPagesUriSupport.java#L106-L108
train
Get the URI of the template with the given parameters.
Create a Java method that does the following: "Get the URI of the template with the given parameters.".
Of course, here is the Java code you requested: ```java public String getTemplateURI(String controllerName, String templateName) { return getTemplateURI(controllerName, templateName, true); } ``` Hope this helps!
steveash/jopenfst
src/main/java/com/github/steveash/jopenfst/semiring/LogSemiring.java
LogSemiring.plus
@Override public double plus(double w1, double w2) { if (!isMember(w1) || !isMember(w2)) { return Double.NEGATIVE_INFINITY; } if (w1 == Double.POSITIVE_INFINITY) { return w2; } else if (w2 == Double.POSITIVE_INFINITY) { return w1; } return (double) -Math.log(Math.exp(-w1) + M...
java
@Override public double plus(double w1, double w2) { if (!isMember(w1) || !isMember(w2)) { return Double.NEGATIVE_INFINITY; } if (w1 == Double.POSITIVE_INFINITY) { return w2; } else if (w2 == Double.POSITIVE_INFINITY) { return w1; } return (double) -Math.log(Math.exp(-w1) + M...
[ "@", "Override", "public", "double", "plus", "(", "double", "w1", ",", "double", "w2", ")", "{", "if", "(", "!", "isMember", "(", "w1", ")", "||", "!", "isMember", "(", "w2", ")", ")", "{", "return", "Double", ".", "NEGATIVE_INFINITY", ";", "}", "i...
/* (non-Javadoc) @see edu.cmu.sphinx.fst.weight.Semiring#plus(edu.cmu.sphinx.fst.weight.float, edu.cmu.sphinx.fst.weight.float)
[ "/", "*", "(", "non", "-", "Javadoc", ")" ]
4c675203015c1cfad2072556cb532b6edc73261d
https://github.com/steveash/jopenfst/blob/4c675203015c1cfad2072556cb532b6edc73261d/src/main/java/com/github/steveash/jopenfst/semiring/LogSemiring.java#L43-L54
train
Add two vectors.
Create a Java method that does the following: "Add two vectors.".
Of course, here is the Java code you requested: ```java @Override public double plus(double w1, double w2) { if (!isMember(w1) || !isMember(w2)) { return Double.NEGATIVE_INFINITY; } if (w1 == Double.POSITIVE_INFINITY) { return w2; } else if (w2 == Double.POSITIVE_INFINITY) { return ...
jfinal/jfinal
src/main/java/com/jfinal/template/stat/Lexer.java
Lexer.addOutputToken
boolean addOutputToken(Token idToken, Token paraToken) { tokens.add(idToken); tokens.add(paraToken); previousTextToken = null; return prepareNextScan(0); }
java
boolean addOutputToken(Token idToken, Token paraToken) { tokens.add(idToken); tokens.add(paraToken); previousTextToken = null; return prepareNextScan(0); }
[ "boolean", "addOutputToken", "(", "Token", "idToken", ",", "Token", "paraToken", ")", "{", "tokens", ".", "add", "(", "idToken", ")", ";", "tokens", ".", "add", "(", "paraToken", ")", ";", "previousTextToken", "=", "null", ";", "return", "prepareNextScan", ...
输出指令不对前后空白与换行进行任何处理,直接调用 tokens.add(...)
[ "输出指令不对前后空白与换行进行任何处理,直接调用", "tokens", ".", "add", "(", "...", ")" ]
fc07f0f5d56e85ccd3cfcdd587b56b8dd9c663e9
https://github.com/jfinal/jfinal/blob/fc07f0f5d56e85ccd3cfcdd587b56b8dd9c663e9/src/main/java/com/jfinal/template/stat/Lexer.java#L476-L481
train
Add a token to the output.
Create a Java method that does the following: "Add a token to the output.".
Of course, here is the Java code you requested: ```java boolean addOutputToken(Token idToken, Token paraToken) { tokens.add(idToken); tokens.add(paraToken); previousTextToken = null; return prepareNextScan(0); } ``` Hope this helps!
leadware/jpersistence-tools
jpersistence-tools-api/src/main/java/net/leadware/persistence/tools/api/validator/jsr303ext/engine/JSR303ValidatorEngine.java
JSR303ValidatorEngine.setValidatorFactory
public void setValidatorFactory(ValidatorFactory validatorFactory) { // Si le paramètre n'est pas null if(validatorFactory != null) { // On positionne la fabrique this.validatorFactory = validatorFactory; // On construit le validateur this.validator = validatorFactory.getValidator()...
java
public void setValidatorFactory(ValidatorFactory validatorFactory) { // Si le paramètre n'est pas null if(validatorFactory != null) { // On positionne la fabrique this.validatorFactory = validatorFactory; // On construit le validateur this.validator = validatorFactory.getValidator()...
[ "public", "void", "setValidatorFactory", "(", "ValidatorFactory", "validatorFactory", ")", "{", "// Si le paramètre n'est pas null\r", "if", "(", "validatorFactory", "!=", "null", ")", "{", "// On positionne la fabrique\r", "this", ".", "validatorFactory", "=", "validatorFa...
Méthode de mise à jour de la fabrique de validateur @param validatorFactory Fabrique de validateur
[ "Méthode", "de", "mise", "à", "jour", "de", "la", "fabrique", "de", "validateur" ]
4c15372993584579d7dbb9b23dd4c0c0fdc9e789
https://github.com/leadware/jpersistence-tools/blob/4c15372993584579d7dbb9b23dd4c0c0fdc9e789/jpersistence-tools-api/src/main/java/net/leadware/persistence/tools/api/validator/jsr303ext/engine/JSR303ValidatorEngine.java#L97-L108
train
Set the validatorFactory.
Create a Java method that does the following: "Set the validatorFactory.".
Of course, here is the Java code you requested: ```java public void setValidatorFactory(ValidatorFactory validatorFactory) { // Si le paramètre n'est pas null if(validatorFactory != null) { // On positionne la fabrique this.validatorFactory = validatorFactory; // On construit le valida...
krummas/DrizzleJDBC
src/main/java/org/drizzle/jdbc/internal/mysql/MySQLProtocol.java
MySQLProtocol.close
public void close() throws QueryException { try { if(! (socket instanceof SSLSocket)) socket.shutdownInput(); } catch (IOException ignored) { } try { final ClosePacket closePacket = new ClosePacket(); closePacket.send(writer); ...
java
public void close() throws QueryException { try { if(! (socket instanceof SSLSocket)) socket.shutdownInput(); } catch (IOException ignored) { } try { final ClosePacket closePacket = new ClosePacket(); closePacket.send(writer); ...
[ "public", "void", "close", "(", ")", "throws", "QueryException", "{", "try", "{", "if", "(", "!", "(", "socket", "instanceof", "SSLSocket", ")", ")", "socket", ".", "shutdownInput", "(", ")", ";", "}", "catch", "(", "IOException", "ignored", ")", "{", ...
Closes socket and stream readers/writers @throws org.drizzle.jdbc.internal.common.QueryException if the socket or readers/writes cannot be closed
[ "Closes", "socket", "and", "stream", "readers", "/", "writers" ]
716f31fd71f3cc289edf69844d8117deb86d98d6
https://github.com/krummas/DrizzleJDBC/blob/716f31fd71f3cc289edf69844d8117deb86d98d6/src/main/java/org/drizzle/jdbc/internal/mysql/MySQLProtocol.java#L254-L281
train
Close the connection.
Create a Java method that does the following: "Close the connection.".
Of course, here is the Java code you requested: ```java public void close() throws QueryException { try { if(! (socket instanceof SSLSocket)) socket.shutdownInput(); } catch (IOException ignored) { } try { final ClosePacket closePacket = new Close...
protobufel/protobuf-el
protobufel-grammar/src/main/java/com/github/protobufel/grammar/ProtoFileParser.java
ProtoFileParser.exitStandardServiceOptionDeprecated
@Override public void exitStandardServiceOptionDeprecated(final StandardServiceOptionDeprecatedContext ctx) { verifyOptionNameUnique("deprecated", ctx.getStart()); scopes.getServiceOptions().setDeprecated(Boolean.valueOf(ctx.BooleanLiteral().getText())); }
java
@Override public void exitStandardServiceOptionDeprecated(final StandardServiceOptionDeprecatedContext ctx) { verifyOptionNameUnique("deprecated", ctx.getStart()); scopes.getServiceOptions().setDeprecated(Boolean.valueOf(ctx.BooleanLiteral().getText())); }
[ "@", "Override", "public", "void", "exitStandardServiceOptionDeprecated", "(", "final", "StandardServiceOptionDeprecatedContext", "ctx", ")", "{", "verifyOptionNameUnique", "(", "\"deprecated\"", ",", "ctx", ".", "getStart", "(", ")", ")", ";", "scopes", ".", "getServ...
**** Standard ServiceOptions
[ "****", "Standard", "ServiceOptions" ]
3a600e2f7a8e74b637f44eee0331ef6e57e7441c
https://github.com/protobufel/protobuf-el/blob/3a600e2f7a8e74b637f44eee0331ef6e57e7441c/protobufel-grammar/src/main/java/com/github/protobufel/grammar/ProtoFileParser.java#L324-L328
train
Handle a StandardServiceOptionDeprecated end.
Create a Java method that does the following: "Handle a StandardServiceOptionDeprecated end.".
Of course, here is the Java code you requested: ```java @Override public void exitStandardServiceOptionDeprecated(final StandardServiceOptionDeprecatedContext ctx) { verifyOptionNameUnique("deprecated", ctx.getStart()); scopes.getServiceOptions().setDeprecated(Boolean.valueOf(ctx.BooleanLiteral().getText(...
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-velocity/src/main/java/org/xwiki/velocity/tools/CollectionsTool.java
CollectionsTool.union
public <E> Collection<E> union(Collection<E> a, Collection<E> b) { if (a == null) { return b; } else if (b == null) { return a; } return CollectionUtils.union(a, b); }
java
public <E> Collection<E> union(Collection<E> a, Collection<E> b) { if (a == null) { return b; } else if (b == null) { return a; } return CollectionUtils.union(a, b); }
[ "public", "<", "E", ">", "Collection", "<", "E", ">", "union", "(", "Collection", "<", "E", ">", "a", ",", "Collection", "<", "E", ">", "b", ")", "{", "if", "(", "a", "==", "null", ")", "{", "return", "b", ";", "}", "else", "if", "(", "b", ...
Returns a {@link Collection} containing the union of the given {@link Collection}s. @param <E> the type of the elements in the collection @param a the first collection, must be non-null @param b the second collection, must be non-null @return the union of the two collections
[ "Returns", "a", "{", "@link", "Collection", "}", "containing", "the", "union", "of", "the", "given", "{", "@link", "Collection", "}", "s", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-velocity/src/main/java/org/xwiki/velocity/tools/CollectionsTool.java#L258-L266
train
Union two collections of type E.
Create a Java method that does the following: "Union two collections of type E.".
Of course, here is the Java code you requested: ```java public <E> Collection<E> union(Collection<E> a, Collection<E> b) { if (a == null) { return b; } else if (b == null) { return a; } return CollectionUtils.union(a, b); } ``` Hope this helps!
google/j2objc
translator/src/main/java/com/google/devtools/j2objc/translate/NilCheckResolver.java
NilCheckResolver.endVisit
@Override public void endVisit(FunctionInvocation node) { if (Objects.equals(node.getFunctionElement(), NIL_CHK_ELEM)) { VariableElement var = TreeUtil.getVariableElement(node.getArgument(0)); if (var != null) { addSafeVar(var); } } }
java
@Override public void endVisit(FunctionInvocation node) { if (Objects.equals(node.getFunctionElement(), NIL_CHK_ELEM)) { VariableElement var = TreeUtil.getVariableElement(node.getArgument(0)); if (var != null) { addSafeVar(var); } } }
[ "@", "Override", "public", "void", "endVisit", "(", "FunctionInvocation", "node", ")", "{", "if", "(", "Objects", ".", "equals", "(", "node", ".", "getFunctionElement", "(", ")", ",", "NIL_CHK_ELEM", ")", ")", "{", "VariableElement", "var", "=", "TreeUtil", ...
added nil_chk's.
[ "added", "nil_chk", "s", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/translator/src/main/java/com/google/devtools/j2objc/translate/NilCheckResolver.java#L814-L822
train
Override endVisit to add the CRASS code to the exception table.
Create a Java method that does the following: "Override endVisit to add the CRASS code to the exception table.".
Of course, here is the Java code you requested: ```java @Override public void endVisit(FunctionInvocation node) { if (Objects.equals(node.getFunctionElement(), NIL_CHK_ELEM)) { VariableElement var = TreeUtil.getVariableElement(node.getArgument(0)); if (var != null) { addSafeVar(var); } ...
Stratio/stratio-cassandra
src/java/org/apache/cassandra/metrics/ColumnFamilyMetrics.java
ColumnFamilyMetrics.createColumnFamilyCounter
protected Counter createColumnFamilyCounter(final String name) { Counter cfCounter = Metrics.newCounter(factory.createMetricName(name)); if (register(name, cfCounter)) { Metrics.newGauge(globalNameFactory.createMetricName(name), new Gauge<Long>() { pub...
java
protected Counter createColumnFamilyCounter(final String name) { Counter cfCounter = Metrics.newCounter(factory.createMetricName(name)); if (register(name, cfCounter)) { Metrics.newGauge(globalNameFactory.createMetricName(name), new Gauge<Long>() { pub...
[ "protected", "Counter", "createColumnFamilyCounter", "(", "final", "String", "name", ")", "{", "Counter", "cfCounter", "=", "Metrics", ".", "newCounter", "(", "factory", ".", "createMetricName", "(", "name", ")", ")", ";", "if", "(", "register", "(", "name", ...
Creates a counter that will also have a global counter thats the sum of all counters across different column families
[ "Creates", "a", "counter", "that", "will", "also", "have", "a", "global", "counter", "thats", "the", "sum", "of", "all", "counters", "across", "different", "column", "families" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/metrics/ColumnFamilyMetrics.java#L673-L692
train
Create a column family counter.
Create a Java method that does the following: "Create a column family counter.".
Of course, here is the Java code you requested: ```java protected Counter createColumnFamilyCounter(final String name) { Counter cfCounter = Metrics.newCounter(factory.createMetricName(name)); if (register(name, cfCounter)) { Metrics.newGauge(globalNameFactory.createMetricName(n...
oblac/jodd
jodd-proxetta/src/main/java/jodd/asm7/AnnotationWriter.java
AnnotationWriter.putAnnotations
void putAnnotations(final int attributeNameIndex, final ByteVector output) { int attributeLength = 2; // For num_annotations. int numAnnotations = 0; AnnotationWriter annotationWriter = this; AnnotationWriter firstAnnotation = null; while (annotationWriter != null) { // In case the user forgot...
java
void putAnnotations(final int attributeNameIndex, final ByteVector output) { int attributeLength = 2; // For num_annotations. int numAnnotations = 0; AnnotationWriter annotationWriter = this; AnnotationWriter firstAnnotation = null; while (annotationWriter != null) { // In case the user forgot...
[ "void", "putAnnotations", "(", "final", "int", "attributeNameIndex", ",", "final", "ByteVector", "output", ")", "{", "int", "attributeLength", "=", "2", ";", "// For num_annotations.", "int", "numAnnotations", "=", "0", ";", "AnnotationWriter", "annotationWriter", "...
Puts a Runtime[In]Visible[Type]Annotations attribute containing this annotations and all its <i>predecessors</i> (see {@link #previousAnnotation} in the given ByteVector. Annotations are put in the same order they have been visited. @param attributeNameIndex the constant pool index of the attribute name (one of "Runti...
[ "Puts", "a", "Runtime", "[", "In", "]", "Visible", "[", "Type", "]", "Annotations", "attribute", "containing", "this", "annotations", "and", "all", "its", "<i", ">", "predecessors<", "/", "i", ">", "(", "see", "{", "@link", "#previousAnnotation", "}", "in"...
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-proxetta/src/main/java/jodd/asm7/AnnotationWriter.java#L315-L336
test
Puts the annotations of this attribute into the specified ByteVector.
Create a Java method that does the following: "Puts the annotations of this attribute into the specified ByteVector.".
Of course, here is the Java code you requested: ```java void putAnnotations(final int attributeNameIndex, final ByteVector output) { int attributeLength = 2; // For num_annotations. int numAnnotations = 0; AnnotationWriter annotationWriter = this; AnnotationWriter firstAnnotation = null; while (ann...
kiegroup/drools
drools-core/src/main/java/org/drools/core/common/ObjectTypeConfigurationRegistry.java
ObjectTypeConfigurationRegistry.getObjectTypeConf
public ObjectTypeConf getObjectTypeConf(EntryPointId entrypoint, Object object) { // first see if it's a ClassObjectTypeConf Object key; if (object instanceof Activation) { key = ClassObjectType.Match_ObjectType.getClassTyp...
java
public ObjectTypeConf getObjectTypeConf(EntryPointId entrypoint, Object object) { // first see if it's a ClassObjectTypeConf Object key; if (object instanceof Activation) { key = ClassObjectType.Match_ObjectType.getClassTyp...
[ "public", "ObjectTypeConf", "getObjectTypeConf", "(", "EntryPointId", "entrypoint", ",", "Object", "object", ")", "{", "// first see if it's a ClassObjectTypeConf ", "Object", "key", ";", "if", "(", "object", "instanceof", "Activation", ")", "{", "key", "=", "C...
Returns the ObjectTypeConfiguration object for the given object or creates a new one if none is found in the cache
[ "Returns", "the", "ObjectTypeConfiguration", "object", "for", "the", "given", "object", "or", "creates", "a", "new", "one", "if", "none", "is", "found", "in", "the", "cache" ]
22b0275d6dbe93070b8090948502cf46eda543c4
https://github.com/kiegroup/drools/blob/22b0275d6dbe93070b8090948502cf46eda543c4/drools-core/src/main/java/org/drools/core/common/ObjectTypeConfigurationRegistry.java#L48-L80
train
Get the ObjectTypeConf object.
Create a Java method that does the following: "Get the ObjectTypeConf object.".
Of course, here is the Java code you requested: ```java public ObjectTypeConf getObjectTypeConf(EntryPointId entrypoint, Object object) { // first see if it's a ClassObjectTypeConf Object key; if (object instanceof Activation) { ...
CODAIT/stocator
src/main/java/com/ibm/stocator/fs/cos/COSDataBlocks.java
COSDataBlocks.createFactory
static BlockFactory createFactory(COSAPIClient owner, String name) { switch (name) { case COSConstants.FAST_UPLOAD_BUFFER_ARRAY: return new ArrayBlockFactory(owner); case COSConstants.FAST_UPLOAD_BUFFER_DISK: return new DiskBlockFactory(owner); default: throw new Ille...
java
static BlockFactory createFactory(COSAPIClient owner, String name) { switch (name) { case COSConstants.FAST_UPLOAD_BUFFER_ARRAY: return new ArrayBlockFactory(owner); case COSConstants.FAST_UPLOAD_BUFFER_DISK: return new DiskBlockFactory(owner); default: throw new Ille...
[ "static", "BlockFactory", "createFactory", "(", "COSAPIClient", "owner", ",", "String", "name", ")", "{", "switch", "(", "name", ")", "{", "case", "COSConstants", ".", "FAST_UPLOAD_BUFFER_ARRAY", ":", "return", "new", "ArrayBlockFactory", "(", "owner", ")", ";",...
Create a factory. @param owner factory owner @param name factory name -the option from {@link Constants} @return the factory, ready to be initialized @throws IllegalArgumentException if the name is unknown
[ "Create", "a", "factory", "." ]
35969cadd2e8faa6fdac45e8bec1799fdd3d8299
https://github.com/CODAIT/stocator/blob/35969cadd2e8faa6fdac45e8bec1799fdd3d8299/src/main/java/com/ibm/stocator/fs/cos/COSDataBlocks.java#L77-L88
train
Create a block factory.
Create a Java method that does the following: "Create a block factory.".
Of course, here is the Java code you requested: ```java static BlockFactory createFactory(COSAPIClient owner, String name) { switch (name) { case COSConstants.FAST_UPLOAD_BUFFER_ARRAY: return new ArrayBlockFactory(owner); case COSConstants.FAST_UPLOAD_BUFFER_DISK: return new DiskB...
steveohara/j2mod
src/main/java/com/ghgande/j2mod/modbus/io/ModbusSerialTransport.java
ModbusSerialTransport.open
private void open() throws ModbusIOException { if (commPort != null && !commPort.isOpen()) { setTimeout(timeout); try { commPort.open(); } catch (IOException e) { throw new ModbusIOException(String.format("Cannot open port %s - %s",...
java
private void open() throws ModbusIOException { if (commPort != null && !commPort.isOpen()) { setTimeout(timeout); try { commPort.open(); } catch (IOException e) { throw new ModbusIOException(String.format("Cannot open port %s - %s",...
[ "private", "void", "open", "(", ")", "throws", "ModbusIOException", "{", "if", "(", "commPort", "!=", "null", "&&", "!", "commPort", ".", "isOpen", "(", ")", ")", "{", "setTimeout", "(", "timeout", ")", ";", "try", "{", "commPort", ".", "open", "(", ...
Opens the port if it isn't already open @throws ModbusIOException If a problem with the port
[ "Opens", "the", "port", "if", "it", "isn", "t", "already", "open" ]
67162c55d7c02564e50211a9df06b8314953b5f2
https://github.com/steveohara/j2mod/blob/67162c55d7c02564e50211a9df06b8314953b5f2/src/main/java/com/ghgande/j2mod/modbus/io/ModbusSerialTransport.java#L161-L171
train
Open the port.
Create a Java method that does the following: "Open the port.".
Of course, here is the Java code you requested: ```java private void open() throws ModbusIOException { if (commPort != null && !commPort.isOpen()) { setTimeout(timeout); try { commPort.open(); } catch (IOException e) { throw new Mo...
eclipse/packagedrone
bundles/org.apache.jasper.glassfish/src/org/apache/jasper/xmlparser/TreeNode.java
TreeNode.findChildren
public Iterator<TreeNode> findChildren() { List<TreeNode> nodes; if (children == null) nodes = Collections.emptyList(); else nodes = children; return nodes.iterator(); }
java
public Iterator<TreeNode> findChildren() { List<TreeNode> nodes; if (children == null) nodes = Collections.emptyList(); else nodes = children; return nodes.iterator(); }
[ "public", "Iterator", "<", "TreeNode", ">", "findChildren", "(", ")", "{", "List", "<", "TreeNode", ">", "nodes", ";", "if", "(", "children", "==", "null", ")", "nodes", "=", "Collections", ".", "emptyList", "(", ")", ";", "else", "nodes", "=", "childr...
Return an Iterator of all children of this node. If there are no children, an empty Iterator is returned.
[ "Return", "an", "Iterator", "of", "all", "children", "of", "this", "node", ".", "If", "there", "are", "no", "children", "an", "empty", "Iterator", "is", "returned", "." ]
3869c1643cdc6f7cb8b26097a7b6994683b13d7e
https://github.com/eclipse/packagedrone/blob/3869c1643cdc6f7cb8b26097a7b6994683b13d7e/bundles/org.apache.jasper.glassfish/src/org/apache/jasper/xmlparser/TreeNode.java#L241-L249
test
Find all children of this node.
Create a Java method that does the following: "Find all children of this node.".
Of course, here is the Java code you requested: ```java public Iterator<TreeNode> findChildren() { List<TreeNode> nodes; if (children == null) nodes = Collections.emptyList(); else nodes = children; return nodes.iterator(); } ``` Hope this helps!
apiman/apiman
common/util/src/main/java/io/apiman/common/util/AbstractMessages.java
AbstractMessages.getBundle
private ResourceBundle getBundle() { String bundleKey = getBundleKey(); if (bundles.containsKey(bundleKey)) { return bundles.get(bundleKey); } else { ResourceBundle bundle = loadBundle(); bundles.put(bundleKey, bundle); return bundle; } ...
java
private ResourceBundle getBundle() { String bundleKey = getBundleKey(); if (bundles.containsKey(bundleKey)) { return bundles.get(bundleKey); } else { ResourceBundle bundle = loadBundle(); bundles.put(bundleKey, bundle); return bundle; } ...
[ "private", "ResourceBundle", "getBundle", "(", ")", "{", "String", "bundleKey", "=", "getBundleKey", "(", ")", ";", "if", "(", "bundles", ".", "containsKey", "(", "bundleKey", ")", ")", "{", "return", "bundles", ".", "get", "(", "bundleKey", ")", ";", "}...
Gets a bundle. First tries to find one in the cache, then loads it if it can't find one.
[ "Gets", "a", "bundle", ".", "First", "tries", "to", "find", "one", "in", "the", "cache", "then", "loads", "it", "if", "it", "can", "t", "find", "one", "." ]
8c049c2a2f2e4a69bbb6125686a15edd26f29c21
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/common/util/src/main/java/io/apiman/common/util/AbstractMessages.java#L61-L70
train
Gets the ResourceBundle.
Create a Java method that does the following: "Gets the ResourceBundle.".
Of course, here is the Java code you requested: ```java private ResourceBundle getBundle() { String bundleKey = getBundleKey(); if (bundles.containsKey(bundleKey)) { return bundles.get(bundleKey); } else { ResourceBundle bundle = loadBundle(); bundles.put(bun...
OpenLiberty/open-liberty
dev/com.ibm.ws.jpa.container.core/src/com/ibm/ws/jpa/management/JPAEMPool.java
JPAEMPool.getCache
@Override public Cache getCache() { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(tc, "getCache : " + this); throw new UnsupportedOperationException("This operation is not supported on a pooling EntityManagerFactory."); }
java
@Override public Cache getCache() { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(tc, "getCache : " + this); throw new UnsupportedOperationException("This operation is not supported on a pooling EntityManagerFactory."); }
[ "@", "Override", "public", "Cache", "getCache", "(", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "Tr", ".", "debug", "(", "tc", ",", "\"getCache : \"", "+", "this", ")", ...
Prohibit access to the cache via the pool. @throws UnsupportedOperationException
[ "Prohibit", "access", "to", "the", "cache", "via", "the", "pool", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jpa.container.core/src/com/ibm/ws/jpa/management/JPAEMPool.java#L292-L298
train
This method is used to get a cache object from the cache manager.
Create a Java method that does the following: "This method is used to get a cache object from the cache manager.".
Of course, here is the Java code you requested: ```java @Override public Cache getCache() { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(tc, "getCache : " + this); throw new UnsupportedOperationException("This operation is not supported on a pooling Enti...
Azure/azure-sdk-for-java
labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/GlobalUsersInner.java
GlobalUsersInner.register
public void register(String userName, String registrationCode) { registerWithServiceResponseAsync(userName, registrationCode).toBlocking().single().body(); }
java
public void register(String userName, String registrationCode) { registerWithServiceResponseAsync(userName, registrationCode).toBlocking().single().body(); }
[ "public", "void", "register", "(", "String", "userName", ",", "String", "registrationCode", ")", "{", "registerWithServiceResponseAsync", "(", "userName", ",", "registrationCode", ")", ".", "toBlocking", "(", ")", ".", "single", "(", ")", ".", "body", "(", ")"...
Register a user to a managed lab. @param userName The name of the user. @param registrationCode The registration code of the lab. @throws IllegalArgumentException thrown if parameters fail the validation @throws CloudException thrown if the request is rejected by server @throws RuntimeException all other wrapped check...
[ "Register", "a", "user", "to", "a", "managed", "lab", "." ]
aab183ddc6686c82ec10386d5a683d2691039626
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/GlobalUsersInner.java#L851-L853
train
Registers an App Service Identity.
Create a Java method that does the following: "Registers an App Service Identity.".
Of course, here is the Java code you requested: ```java public void register(String userName, String registrationCode) { registerWithServiceResponseAsync(userName, registrationCode).toBlocking().single().body(); } ``` Hope this helps!
infinispan/infinispan
cdi/common/src/main/java/org/infinispan/cdi/common/util/BeanBuilder.java
BeanBuilder.readFromType
public BeanBuilder<T> readFromType(AnnotatedType<T> type) { this.beanClass = type.getJavaClass(); InjectionTarget<T> injectionTarget; if (!type.getJavaClass().isInterface()) { injectionTarget = beanManager.createInjectionTarget(type); } else { injectionTarget = ne...
java
public BeanBuilder<T> readFromType(AnnotatedType<T> type) { this.beanClass = type.getJavaClass(); InjectionTarget<T> injectionTarget; if (!type.getJavaClass().isInterface()) { injectionTarget = beanManager.createInjectionTarget(type); } else { injectionTarget = ne...
[ "public", "BeanBuilder", "<", "T", ">", "readFromType", "(", "AnnotatedType", "<", "T", ">", "type", ")", "{", "this", ".", "beanClass", "=", "type", ".", "getJavaClass", "(", ")", ";", "InjectionTarget", "<", "T", ">", "injectionTarget", ";", "if", "(",...
<p> Read the {@link AnnotatedType}, creating a bean from the class and it's annotations. </p> <p/> <p> By default the bean lifecycle will wrap the result of calling {@link BeanManager#createInjectionTarget(AnnotatedType)}. </p> <p/> <p> {@link BeanBuilder} does <em>not</em> support reading members of the class to creat...
[ "<p", ">", "Read", "the", "{", "@link", "AnnotatedType", "}", "creating", "a", "bean", "from", "the", "class", "and", "it", "s", "annotations", ".", "<", "/", "p", ">", "<p", "/", ">", "<p", ">", "By", "default", "the", "bean", "lifecycle", "will", ...
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/cdi/common/src/main/java/org/infinispan/cdi/common/util/BeanBuilder.java#L89-L131
train
Reads the bean from the given annotated type.
Create a Java method that does the following: "Reads the bean from the given annotated type.".
Of course, here is the Java code you requested: ```java public BeanBuilder<T> readFromType(AnnotatedType<T> type) { this.beanClass = type.getJavaClass(); InjectionTarget<T> injectionTarget; if (!type.getJavaClass().isInterface()) { injectionTarget = beanManager.createInjectionTarget...
spring-projects/spring-loaded
springloaded/src/main/java/org/springsource/loaded/MethodCopier.java
MethodCopier.visitMethodInsn
@Override public void visitMethodInsn(final int opcode, final String owner, final String name, final String desc, boolean itf) { // Is it a private method call? // TODO r$ check here because we use invokespecial to avoid virtual dispatch on field changes... if (opcode == INVOKESPECIAL && name.charAt(0) != '<' &&...
java
@Override public void visitMethodInsn(final int opcode, final String owner, final String name, final String desc, boolean itf) { // Is it a private method call? // TODO r$ check here because we use invokespecial to avoid virtual dispatch on field changes... if (opcode == INVOKESPECIAL && name.charAt(0) != '<' &&...
[ "@", "Override", "public", "void", "visitMethodInsn", "(", "final", "int", "opcode", ",", "final", "String", "owner", ",", "final", "String", "name", ",", "final", "String", "desc", ",", "boolean", "itf", ")", "{", "// Is it a private method call?", "// TODO r$ ...
TODO maybe do something if 'itf==true'
[ "TODO", "maybe", "do", "something", "if", "itf", "==", "true" ]
59b32f957a05c6d9f149148158053605e2a6205a
https://github.com/spring-projects/spring-loaded/blob/59b32f957a05c6d9f149148158053605e2a6205a/springloaded/src/main/java/org/springsource/loaded/MethodCopier.java#L141-L183
train
overrides the visitor to look for private methods that are not private.
Create a Java method that does the following: "overrides the visitor to look for private methods that are not private.".
Of course, here is the Java code you requested: ```java @Override public void visitMethodInsn(final int opcode, final String owner, final String name, final String desc, boolean itf) { // Is it a private method call? // TODO r$ check here because we use invokespecial to avoid virtual dispatch on field changes... ...
jOOQ/jOOL
jOOL-java-8/src/main/java/org/jooq/lambda/Agg.java
Agg.maxAllBy
public static <T, U> Collector<T, ?, Seq<T>> maxAllBy(Function<? super T, ? extends U> function, Comparator<? super U> comparator) { class Accumulator { List<T> t = new ArrayList<>(); U u; void set(T t, U u) { this.t.clear(); this.t.add(t); ...
java
public static <T, U> Collector<T, ?, Seq<T>> maxAllBy(Function<? super T, ? extends U> function, Comparator<? super U> comparator) { class Accumulator { List<T> t = new ArrayList<>(); U u; void set(T t, U u) { this.t.clear(); this.t.add(t); ...
[ "public", "static", "<", "T", ",", "U", ">", "Collector", "<", "T", ",", "?", ",", "Seq", "<", "T", ">", ">", "maxAllBy", "(", "Function", "<", "?", "super", "T", ",", "?", "extends", "U", ">", "function", ",", "Comparator", "<", "?", "super", ...
Get a {@link Collector} that calculates the <code>MAX()</code> function, producing multiple results.
[ "Get", "a", "{" ]
889d87c85ca57bafd4eddd78e0f7ae2804d2ee86
https://github.com/jOOQ/jOOL/blob/889d87c85ca57bafd4eddd78e0f7ae2804d2ee86/jOOL-java-8/src/main/java/org/jooq/lambda/Agg.java#L364-L409
train
Collect sequence of all elements of type T and type U using maxAllBy method.
Create a Java method that does the following: "Collect sequence of all elements of type T and type U using maxAllBy method.".
Of course, here is the Java code you requested: ```java public static <T, U> Collector<T, ?, Seq<T>> maxAllBy(Function<? super T, ? extends U> function, Comparator<? super U> comparator) { class Accumulator { List<T> t = new ArrayList<>(); U u; void set(T t, U u) { ...
workplacesystems/utilsj
src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java
TransactionalBidiTreeMap.mostNode
private Node<K,V> mostNode(final Node<K,V> node, final int index) { Node<K,V> rval = node; if (rval != null) { while (rval.getRight(index) != null) { rval = rval.getRight(index); } } return rval; }
java
private Node<K,V> mostNode(final Node<K,V> node, final int index) { Node<K,V> rval = node; if (rval != null) { while (rval.getRight(index) != null) { rval = rval.getRight(index); } } return rval; }
[ "private", "Node", "<", "K", ",", "V", ">", "mostNode", "(", "final", "Node", "<", "K", ",", "V", ">", "node", ",", "final", "int", "index", ")", "{", "Node", "<", "K", ",", "V", ">", "rval", "=", "node", ";", "if", "(", "rval", "!=", "null",...
find the most node from a given node. @param node the node from which we will start searching @param index KEY or VALUE @return the largest node, from the specified node, in the specified mapping
[ "find", "the", "most", "node", "from", "a", "given", "node", "." ]
1b638be51997eafac4d368c14f62a16624a08d3e
https://github.com/workplacesystems/utilsj/blob/1b638be51997eafac4d368c14f62a16624a08d3e/src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java#L1044-L1055
test
Gets the most node of a tuple.
Create a Java method that does the following: "Gets the most node of a tuple.".
Of course, here is the Java code you requested: ```java private Node<K,V> mostNode(final Node<K,V> node, final int index) { Node<K,V> rval = node; if (rval != null) { while (rval.getRight(index) != null) { rval = rval.getRight(index); } } ...
jenkinsci/jenkins
core/src/main/java/hudson/slaves/RetentionStrategy.java
RetentionStrategy.all
public static DescriptorExtensionList<RetentionStrategy<?>,Descriptor<RetentionStrategy<?>>> all() { return (DescriptorExtensionList) Jenkins.get().getDescriptorList(RetentionStrategy.class); }
java
public static DescriptorExtensionList<RetentionStrategy<?>,Descriptor<RetentionStrategy<?>>> all() { return (DescriptorExtensionList) Jenkins.get().getDescriptorList(RetentionStrategy.class); }
[ "public", "static", "DescriptorExtensionList", "<", "RetentionStrategy", "<", "?", ">", ",", "Descriptor", "<", "RetentionStrategy", "<", "?", ">", ">", ">", "all", "(", ")", "{", "return", "(", "DescriptorExtensionList", ")", "Jenkins", ".", "get", "(", ")"...
Returns all the registered {@link RetentionStrategy} descriptors.
[ "Returns", "all", "the", "registered", "{" ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/slaves/RetentionStrategy.java#L106-L108
train
Get all the retention strategies.
Create a Java method that does the following: "Get all the retention strategies.".
Of course, here is the Java code you requested: ```java public static DescriptorExtensionList<RetentionStrategy<?>,Descriptor<RetentionStrategy<?>>> all() { return (DescriptorExtensionList) Jenkins.get().getDescriptorList(RetentionStrategy.class); } ``` Hope this helps!
FlyingHe/UtilsMaven
src/main/java/com/github/flyinghe/tools/XLSReader.java
XLSReader.processRecord
@Override public void processRecord(Record record) { int thisRow = -1; int thisColumn = -1; String thisStr = null; switch (record.getSid()) { case BOFRecord.sid: BOFRecord br = (BOFRecord) record; if (br.getType() == BOFRecord.TYPE_WORKSHE...
java
@Override public void processRecord(Record record) { int thisRow = -1; int thisColumn = -1; String thisStr = null; switch (record.getSid()) { case BOFRecord.sid: BOFRecord br = (BOFRecord) record; if (br.getType() == BOFRecord.TYPE_WORKSHE...
[ "@", "Override", "public", "void", "processRecord", "(", "Record", "record", ")", "{", "int", "thisRow", "=", "-", "1", ";", "int", "thisColumn", "=", "-", "1", ";", "String", "thisStr", "=", "null", ";", "switch", "(", "record", ".", "getSid", "(", ...
Main HSSFListener method, processes events, and outputs the CSV as the file is processed.
[ "Main", "HSSFListener", "method", "processes", "events", "and", "outputs", "the", "CSV", "as", "the", "file", "is", "processed", "." ]
d9605b7bfe0c28a05289252e12d163e114080b4a
https://github.com/FlyingHe/UtilsMaven/blob/d9605b7bfe0c28a05289252e12d163e114080b4a/src/main/java/com/github/flyinghe/tools/XLSReader.java#L270-L478
train
Process a single record.
Create a Java method that does the following: "Process a single record.".
Of course, here is the Java code you requested: ```java @Override public void processRecord(Record record) { int thisRow = -1; int thisColumn = -1; String thisStr = null; switch (record.getSid()) { case BOFRecord.sid: BOFRecord br = (BOFRecord) record; ...
bazaarvoice/emodb
common/uuid/src/main/java/com/bazaarvoice/emodb/common/uuid/UUIDs.java
UUIDs.asByteArray
public static byte[] asByteArray(UUID uuid) { long msb = uuid.getMostSignificantBits(); long lsb = uuid.getLeastSignificantBits(); byte[] buf = new byte[16]; for (int i = 0; i < 8; i++) { buf[i] = (byte) (msb >>> 8 * (7 - i)); buf[i + 8] = (byte) (lsb >>> 8 * ...
java
public static byte[] asByteArray(UUID uuid) { long msb = uuid.getMostSignificantBits(); long lsb = uuid.getLeastSignificantBits(); byte[] buf = new byte[16]; for (int i = 0; i < 8; i++) { buf[i] = (byte) (msb >>> 8 * (7 - i)); buf[i + 8] = (byte) (lsb >>> 8 * ...
[ "public", "static", "byte", "[", "]", "asByteArray", "(", "UUID", "uuid", ")", "{", "long", "msb", "=", "uuid", ".", "getMostSignificantBits", "(", ")", ";", "long", "lsb", "=", "uuid", ".", "getLeastSignificantBits", "(", ")", ";", "byte", "[", "]", "...
Returns the byte-array equivalent of the specified UUID in big-endian order.
[ "Returns", "the", "byte", "-", "array", "equivalent", "of", "the", "specified", "UUID", "in", "big", "-", "endian", "order", "." ]
97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb
https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/common/uuid/src/main/java/com/bazaarvoice/emodb/common/uuid/UUIDs.java#L13-L22
train
As byte array.
Create a Java method that does the following: "As byte array.".
Of course, here is the Java code you requested: ```java public static byte[] asByteArray(UUID uuid) { long msb = uuid.getMostSignificantBits(); long lsb = uuid.getLeastSignificantBits(); byte[] buf = new byte[16]; for (int i = 0; i < 8; i++) { buf[i] = (byte) (msb >>> 8 ...
aws/aws-sdk-java
aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/model/AddPermissionRequest.java
AddPermissionRequest.setActions
public void setActions(java.util.Collection<String> actions) { if (actions == null) { this.actions = null; return; } this.actions = new com.amazonaws.internal.SdkInternalList<String>(actions); }
java
public void setActions(java.util.Collection<String> actions) { if (actions == null) { this.actions = null; return; } this.actions = new com.amazonaws.internal.SdkInternalList<String>(actions); }
[ "public", "void", "setActions", "(", "java", ".", "util", ".", "Collection", "<", "String", ">", "actions", ")", "{", "if", "(", "actions", "==", "null", ")", "{", "this", ".", "actions", "=", "null", ";", "return", ";", "}", "this", ".", "actions", ...
<p> The action the client wants to allow for the specified principal. Valid values: the name of any action or <code>*</code>. </p> <p> For more information about these actions, see <a href= "http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-overview-of-managing-access.html" >Overview of Mana...
[ "<p", ">", "The", "action", "the", "client", "wants", "to", "allow", "for", "the", "specified", "principal", ".", "Valid", "values", ":", "the", "name", "of", "any", "action", "or", "<code", ">", "*", "<", "/", "code", ">", ".", "<", "/", "p", ">",...
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/model/AddPermissionRequest.java#L417-L424
train
Sets the value of the actions property.
Create a Java method that does the following: "Sets the value of the actions property.".
Of course, here is the Java code you requested: ```java public void setActions(java.util.Collection<String> actions) { if (actions == null) { this.actions = null; return; } this.actions = new com.amazonaws.internal.SdkInternalList<String>(actions); } ``` Hope this ...
Azure/azure-sdk-for-java
sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/SyncMembersInner.java
SyncMembersInner.listMemberSchemasAsync
public ServiceFuture<List<SyncFullSchemaPropertiesInner>> listMemberSchemasAsync(final String resourceGroupName, final String serverName, final String databaseName, final String syncGroupName, final String syncMemberName, final ListOperationCallback<SyncFullSchemaPropertiesInner> serviceCallback) { return Azure...
java
public ServiceFuture<List<SyncFullSchemaPropertiesInner>> listMemberSchemasAsync(final String resourceGroupName, final String serverName, final String databaseName, final String syncGroupName, final String syncMemberName, final ListOperationCallback<SyncFullSchemaPropertiesInner> serviceCallback) { return Azure...
[ "public", "ServiceFuture", "<", "List", "<", "SyncFullSchemaPropertiesInner", ">", ">", "listMemberSchemasAsync", "(", "final", "String", "resourceGroupName", ",", "final", "String", "serverName", ",", "final", "String", "databaseName", ",", "final", "String", "syncGr...
Gets a sync member database schema. @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 databaseName The name of the database on which the sync group is hosted. ...
[ "Gets", "a", "sync", "member", "database", "schema", "." ]
aab183ddc6686c82ec10386d5a683d2691039626
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/SyncMembersInner.java#L1027-L1037
train
Gets a list of all the schema definitions of a managed database.
Create a Java method that does the following: "Gets a list of all the schema definitions of a managed database.".
Of course, here is the Java code you requested: ```java public ServiceFuture<List<SyncFullSchemaPropertiesInner>> listMemberSchemasAsync(final String resourceGroupName, final String serverName, final String databaseName, final String syncGroupName, final String syncMemberName, final ListOperationCallback<SyncFullSchem...
meertensinstituut/mtas
src/main/java/mtas/solr/handler/MtasRequestHandler.java
MtasRequestHandler.finishStatus
public void finishStatus(MtasSolrStatus item) throws IOException { running.remove(item); if (item.error()) { error.add(item); } }
java
public void finishStatus(MtasSolrStatus item) throws IOException { running.remove(item); if (item.error()) { error.add(item); } }
[ "public", "void", "finishStatus", "(", "MtasSolrStatus", "item", ")", "throws", "IOException", "{", "running", ".", "remove", "(", "item", ")", ";", "if", "(", "item", ".", "error", "(", ")", ")", "{", "error", ".", "add", "(", "item", ")", ";", "}",...
Finish status. @param item the item @throws IOException Signals that an I/O exception has occurred.
[ "Finish", "status", "." ]
f02ae730848616bd88b553efa7f9eddc32818e64
https://github.com/meertensinstituut/mtas/blob/f02ae730848616bd88b553efa7f9eddc32818e64/src/main/java/mtas/solr/handler/MtasRequestHandler.java#L354-L359
train
Finishes the status of a single item.
Create a Java method that does the following: "Finishes the status of a single item.".
Of course, here is the Java code you requested: ```java public void finishStatus(MtasSolrStatus item) throws IOException { running.remove(item); if (item.error()) { error.add(item); } } ``` Hope this helps!
jtrfp/javamod
src/main/java/de/quippy/javamod/multimedia/mp3/id3/ID3v2Tag.java
ID3v2Tag.writeTag
public void writeTag(RandomAccessFile raf) throws FileNotFoundException, IOException { int curSize = getSize(); origPadding = padding; padding = getUpdatedPadding(); // This means that the file does not need to change size if ((padding > origPadding) || ((padding == origPadding) && (curSize == origSize))) ...
java
public void writeTag(RandomAccessFile raf) throws FileNotFoundException, IOException { int curSize = getSize(); origPadding = padding; padding = getUpdatedPadding(); // This means that the file does not need to change size if ((padding > origPadding) || ((padding == origPadding) && (curSize == origSize))) ...
[ "public", "void", "writeTag", "(", "RandomAccessFile", "raf", ")", "throws", "FileNotFoundException", ",", "IOException", "{", "int", "curSize", "=", "getSize", "(", ")", ";", "origPadding", "=", "padding", ";", "padding", "=", "getUpdatedPadding", "(", ")", "...
Saves all the information in the tag to the file passed to the constructor. If a tag doesn't exist, a tag is prepended to the file. If the padding has not changed since the creation of this object and the size is less than the original size + the original padding, then the previous tag and part of the previous padding...
[ "Saves", "all", "the", "information", "in", "the", "tag", "to", "the", "file", "passed", "to", "the", "constructor", ".", "If", "a", "tag", "doesn", "t", "exist", "a", "tag", "is", "prepended", "to", "the", "file", ".", "If", "the", "padding", "has", ...
cda4fe943a589dc49415f4413453e2eece72076a
https://github.com/jtrfp/javamod/blob/cda4fe943a589dc49415f4413453e2eece72076a/src/main/java/de/quippy/javamod/multimedia/mp3/id3/ID3v2Tag.java#L155-L194
train
Write the tag to the file.
Create a Java method that does the following: "Write the tag to the file.".
Of course, here is the Java code you requested: ```java public void writeTag(RandomAccessFile raf) throws FileNotFoundException, IOException { int curSize = getSize(); origPadding = padding; padding = getUpdatedPadding(); // This means that the file does not need to change size if ((padding > origPadding) ...
zk1931/jzab
src/main/java/com/github/zk1931/jzab/MessageBuilder.java
MessageBuilder.toProtoZxid
public static ZabMessage.Zxid toProtoZxid(Zxid zxid) { ZabMessage.Zxid z = ZabMessage.Zxid.newBuilder() .setEpoch(zxid.getEpoch()) .setXid(zxid.getXid()) .build(); return z; }
java
public static ZabMessage.Zxid toProtoZxid(Zxid zxid) { ZabMessage.Zxid z = ZabMessage.Zxid.newBuilder() .setEpoch(zxid.getEpoch()) .setXid(zxid.getXid()) .build(); return z; }
[ "public", "static", "ZabMessage", ".", "Zxid", "toProtoZxid", "(", "Zxid", "zxid", ")", "{", "ZabMessage", ".", "Zxid", "z", "=", "ZabMessage", ".", "Zxid", ".", "newBuilder", "(", ")", ".", "setEpoch", "(", "zxid", ".", "getEpoch", "(", ")", ")", ".",...
Converts Zxid object to protobuf Zxid object. @param zxid the Zxid object. @return the ZabMessage.Zxid
[ "Converts", "Zxid", "object", "to", "protobuf", "Zxid", "object", "." ]
2a8893bcc1a125f3aebdaddee80ad49c9761bba1
https://github.com/zk1931/jzab/blob/2a8893bcc1a125f3aebdaddee80ad49c9761bba1/src/main/java/com/github/zk1931/jzab/MessageBuilder.java#L59-L65
train
Converts a Zxid object to a proto Zxid object.
Create a Java method that does the following: "Converts a Zxid object to a proto Zxid object.".
Of course, here is the Java code you requested: ```java public static ZabMessage.Zxid toProtoZxid(Zxid zxid) { ZabMessage.Zxid z = ZabMessage.Zxid.newBuilder() .setEpoch(zxid.getEpoch()) .setXid(zxid.getXid()) .bu...
OpenLiberty/open-liberty
dev/com.ibm.ws.jpa.container.core/src/com/ibm/ws/jpa/management/JPAExEntityManager.java
JPAExEntityManager.hasAppManagedPC
static boolean hasAppManagedPC(Collection<InjectionBinding<?>> injectionBindings, String ejbName, Set<String> persistenceRefNames) { final boolean isTraceOn = TraceComponent.isAnyTracingEnabled(); if (isTraceOn && tc.isEntryEnable...
java
static boolean hasAppManagedPC(Collection<InjectionBinding<?>> injectionBindings, String ejbName, Set<String> persistenceRefNames) { final boolean isTraceOn = TraceComponent.isAnyTracingEnabled(); if (isTraceOn && tc.isEntryEnable...
[ "static", "boolean", "hasAppManagedPC", "(", "Collection", "<", "InjectionBinding", "<", "?", ">", ">", "injectionBindings", ",", "String", "ejbName", ",", "Set", "<", "String", ">", "persistenceRefNames", ")", "{", "final", "boolean", "isTraceOn", "=", "TraceCo...
d465813 // switch to 'bindings' d511673
[ "d465813", "//", "switch", "to", "bindings", "d511673" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jpa.container.core/src/com/ibm/ws/jpa/management/JPAExEntityManager.java#L427-L465
train
Check if the application managed container has a component with the specified name.
Create a Java method that does the following: "Check if the application managed container has a component with the specified name.".
Of course, here is the Java code you requested: ```java static boolean hasAppManagedPC(Collection<InjectionBinding<?>> injectionBindings, String ejbName, Set<String> persistenceRefNames) { final boolean isTraceOn = TraceComponent.isAnyTr...
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/jobexecutor/ExecuteJobHelper.java
ExecuteJobHelper.callFailedJobListenerWithRetries
private static OptimisticLockingException callFailedJobListenerWithRetries(CommandExecutor commandExecutor, FailedJobListener failedJobListener) { try { commandExecutor.execute(failedJobListener); return null; } catch (OptimisticLockingException ex) { failedJobListener.incrementCountRetries();...
java
private static OptimisticLockingException callFailedJobListenerWithRetries(CommandExecutor commandExecutor, FailedJobListener failedJobListener) { try { commandExecutor.execute(failedJobListener); return null; } catch (OptimisticLockingException ex) { failedJobListener.incrementCountRetries();...
[ "private", "static", "OptimisticLockingException", "callFailedJobListenerWithRetries", "(", "CommandExecutor", "commandExecutor", ",", "FailedJobListener", "failedJobListener", ")", "{", "try", "{", "commandExecutor", ".", "execute", "(", "failedJobListener", ")", ";", "ret...
Calls FailedJobListener, in case of OptimisticLockException retries configured amount of times. @return exception or null if succeeded
[ "Calls", "FailedJobListener", "in", "case", "of", "OptimisticLockException", "retries", "configured", "amount", "of", "times", "." ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/jobexecutor/ExecuteJobHelper.java#L93-L104
train
Call failedJobListener with retries.
Create a Java method that does the following: "Call failedJobListener with retries.".
Of course, here is the Java code you requested: ```java private static OptimisticLockingException callFailedJobListenerWithRetries(CommandExecutor commandExecutor, FailedJobListener failedJobListener) { try { commandExecutor.execute(failedJobListener); return null; } catch (OptimisticLockingExcepti...
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/sun/nio/ch/FileChannelImpl.java
FileChannelImpl.open
public static FileChannel open(FileDescriptor fd, String path, boolean readable, boolean writable, Object parent) { return new FileChannelImpl(fd, path, readable, writable, false, parent); }
java
public static FileChannel open(FileDescriptor fd, String path, boolean readable, boolean writable, Object parent) { return new FileChannelImpl(fd, path, readable, writable, false, parent); }
[ "public", "static", "FileChannel", "open", "(", "FileDescriptor", "fd", ",", "String", "path", ",", "boolean", "readable", ",", "boolean", "writable", ",", "Object", "parent", ")", "{", "return", "new", "FileChannelImpl", "(", "fd", ",", "path", ",", "readab...
Used by FileInputStream.getChannel() and RandomAccessFile.getChannel()
[ "Used", "by", "FileInputStream", ".", "getChannel", "()", "and", "RandomAccessFile", ".", "getChannel", "()" ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/nio/ch/FileChannelImpl.java#L90-L95
train
Create a new FileChannel object.
Create a Java method that does the following: "Create a new FileChannel object.".
Of course, here is the Java code you requested: ```java public static FileChannel open(FileDescriptor fd, String path, boolean readable, boolean writable, Object parent) { return new FileChannelImpl(fd, path, readable, writable, false, p...
gmessner/gitlab4j-api
src/main/java/org/gitlab4j/api/SnippetsApi.java
SnippetsApi.getSnippets
public List<Snippet> getSnippets(boolean downloadContent) throws GitLabApiException { Response response = get(Response.Status.OK, getDefaultPerPageParam(), "snippets"); List<Snippet> snippets = (response.readEntity(new GenericType<List<Snippet>>(){})); if (downloadContent) { for (S...
java
public List<Snippet> getSnippets(boolean downloadContent) throws GitLabApiException { Response response = get(Response.Status.OK, getDefaultPerPageParam(), "snippets"); List<Snippet> snippets = (response.readEntity(new GenericType<List<Snippet>>(){})); if (downloadContent) { for (S...
[ "public", "List", "<", "Snippet", ">", "getSnippets", "(", "boolean", "downloadContent", ")", "throws", "GitLabApiException", "{", "Response", "response", "=", "get", "(", "Response", ".", "Status", ".", "OK", ",", "getDefaultPerPageParam", "(", ")", ",", "\"s...
Get a list of the authenticated user's snippets. <pre><code>GitLab Endpoint: GET /snippets</code></pre> @param downloadContent indicating whether to download the snippet content @return a list of authenticated user's snippets @throws GitLabApiException if any exception occurs
[ "Get", "a", "list", "of", "the", "authenticated", "user", "s", "snippets", "." ]
ab045070abac0a8f4ccbf17b5ed9bfdef5723eed
https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/SnippetsApi.java#L31-L43
train
Get a list of all the snippets available in the GitLab instance.
Create a Java method that does the following: "Get a list of all the snippets available in the GitLab instance.".
Of course, here is the Java code you requested: ```java public List<Snippet> getSnippets(boolean downloadContent) throws GitLabApiException { Response response = get(Response.Status.OK, getDefaultPerPageParam(), "snippets"); List<Snippet> snippets = (response.readEntity(new GenericType<List<Snippet>>(...
twitter/elephant-bird
core/src/main/java/com/twitter/elephantbird/util/HadoopUtils.java
HadoopUtils.writeStringListToConfAsBase64
public static void writeStringListToConfAsBase64(String key, List<String> list, Configuration conf) { Preconditions.checkNotNull(list); Iterator<String> iter = list.iterator(); StringBuilder sb = new StringBuilder(); while(iter.hasNext()) { byte[] bytes = Base64.encodeBase64(iter.next().getByt...
java
public static void writeStringListToConfAsBase64(String key, List<String> list, Configuration conf) { Preconditions.checkNotNull(list); Iterator<String> iter = list.iterator(); StringBuilder sb = new StringBuilder(); while(iter.hasNext()) { byte[] bytes = Base64.encodeBase64(iter.next().getByt...
[ "public", "static", "void", "writeStringListToConfAsBase64", "(", "String", "key", ",", "List", "<", "String", ">", "list", ",", "Configuration", "conf", ")", "{", "Preconditions", ".", "checkNotNull", "(", "list", ")", ";", "Iterator", "<", "String", ">", "...
Writes a list of strings into a configuration by base64 encoding them and separating them with commas @param key for the configuration @param list to write @param conf to write to
[ "Writes", "a", "list", "of", "strings", "into", "a", "configuration", "by", "base64", "encoding", "them", "and", "separating", "them", "with", "commas" ]
62642c935198aa0ff968f48669c7e654b42dfbf0
https://github.com/twitter/elephant-bird/blob/62642c935198aa0ff968f48669c7e654b42dfbf0/core/src/main/java/com/twitter/elephantbird/util/HadoopUtils.java#L202-L215
valid
Write String List to Configuration as base64
Create a Java method that does the following: "Write String List to Configuration as base64".
Of course, here is the Java code you requested: ```java public static void writeStringListToConfAsBase64(String key, List<String> list, Configuration conf) { Preconditions.checkNotNull(list); Iterator<String> iter = list.iterator(); StringBuilder sb = new StringBuilder(); while(iter.hasNext()) { ...
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/internal/serialization/impl/PortableNavigatorContext.java
PortableNavigatorContext.populateAnyNavigationFrames
void populateAnyNavigationFrames(int pathTokenIndex, int len) { // populate "recursive" multi-positions if (multiPositions == null) { // lazy-init only if necessary multiPositions = new ArrayDeque<NavigationFrame>(); } for (int cellIndex = len - 1; cellIndex > 0; ...
java
void populateAnyNavigationFrames(int pathTokenIndex, int len) { // populate "recursive" multi-positions if (multiPositions == null) { // lazy-init only if necessary multiPositions = new ArrayDeque<NavigationFrame>(); } for (int cellIndex = len - 1; cellIndex > 0; ...
[ "void", "populateAnyNavigationFrames", "(", "int", "pathTokenIndex", ",", "int", "len", ")", "{", "// populate \"recursive\" multi-positions", "if", "(", "multiPositions", "==", "null", ")", "{", "// lazy-init only if necessary", "multiPositions", "=", "new", "ArrayDeque"...
Populates the context with multi-positions that have to be processed later on in the navigation process. The contract is that the cell[0] path is read in the non-multi-position navigation. Cells[1, len-1] are stored in the multi-positions and will be followed up on later on.
[ "Populates", "the", "context", "with", "multi", "-", "positions", "that", "have", "to", "be", "processed", "later", "on", "in", "the", "navigation", "process", ".", "The", "contract", "is", "that", "the", "cell", "[", "0", "]", "path", "is", "read", "in"...
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/internal/serialization/impl/PortableNavigatorContext.java#L179-L188
train
Populates the navigation frames in the result set.
Create a Java method that does the following: "Populates the navigation frames in the result set.".
Of course, here is the Java code you requested: ```java void populateAnyNavigationFrames(int pathTokenIndex, int len) { // populate "recursive" multi-positions if (multiPositions == null) { // lazy-init only if necessary multiPositions = new ArrayDeque<NavigationFrame>(); ...
finmath/finmath-lib
src/main/java/net/finmath/montecarlo/process/EulerSchemeFromProcessModel.java
EulerSchemeFromProcessModel.doPrecalculateProcess
private void doPrecalculateProcess() { if (discreteProcess != null && discreteProcess.length != 0) { return; } final int numberOfPaths = this.getNumberOfPaths(); final int numberOfFactors = this.getNumberOfFactors(); final int numberOfComponents = this.getNumberOfComponents(); // Allocate Memory d...
java
private void doPrecalculateProcess() { if (discreteProcess != null && discreteProcess.length != 0) { return; } final int numberOfPaths = this.getNumberOfPaths(); final int numberOfFactors = this.getNumberOfFactors(); final int numberOfComponents = this.getNumberOfComponents(); // Allocate Memory d...
[ "private", "void", "doPrecalculateProcess", "(", ")", "{", "if", "(", "discreteProcess", "!=", "null", "&&", "discreteProcess", ".", "length", "!=", "0", ")", "{", "return", ";", "}", "final", "int", "numberOfPaths", "=", "this", ".", "getNumberOfPaths", "("...
Calculates the whole (discrete) process.
[ "Calculates", "the", "whole", "(", "discrete", ")", "process", "." ]
a3c067d52dd33feb97d851df6cab130e4116759f
https://github.com/finmath/finmath-lib/blob/a3c067d52dd33feb97d851df6cab130e4116759f/src/main/java/net/finmath/montecarlo/process/EulerSchemeFromProcessModel.java#L136-L294
train
Precalculate the process.
Create a Java method that does the following: "Precalculate the process.".
Of course, here is the Java code you requested: ```java private void doPrecalculateProcess() { if (discreteProcess != null && discreteProcess.length != 0) { return; } final int numberOfPaths = this.getNumberOfPaths(); final int numberOfFactors = this.getNumberOfFactors(); final int numberOfComponents ...
OpenLiberty/open-liberty
dev/com.ibm.ws.kernel.feature.core/src/com/ibm/ws/kernel/feature/internal/Provisioner.java
Provisioner.resolveBundles
public void resolveBundles(BundleContext bContext, List<Bundle> bundlesToResolve) { if (bundlesToResolve == null || bundlesToResolve.size() == 0) { return; } FrameworkWiring wiring = adaptSystemBundle(bContext, FrameworkWiring.class); if (wiring != null) { Resolu...
java
public void resolveBundles(BundleContext bContext, List<Bundle> bundlesToResolve) { if (bundlesToResolve == null || bundlesToResolve.size() == 0) { return; } FrameworkWiring wiring = adaptSystemBundle(bContext, FrameworkWiring.class); if (wiring != null) { Resolu...
[ "public", "void", "resolveBundles", "(", "BundleContext", "bContext", ",", "List", "<", "Bundle", ">", "bundlesToResolve", ")", "{", "if", "(", "bundlesToResolve", "==", "null", "||", "bundlesToResolve", ".", "size", "(", ")", "==", "0", ")", "{", "return", ...
Utility for resolving bundles @param bundlesToResolve
[ "Utility", "for", "resolving", "bundles" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.feature.core/src/com/ibm/ws/kernel/feature/internal/Provisioner.java#L532-L553
train
Resolve the bundles.
Create a Java method that does the following: "Resolve the bundles.".
Of course, here is the Java code you requested: ```java public void resolveBundles(BundleContext bContext, List<Bundle> bundlesToResolve) { if (bundlesToResolve == null || bundlesToResolve.size() == 0) { return; } FrameworkWiring wiring = adaptSystemBundle(bContext, FrameworkWiring...
ixa-ehu/ixa-pipe-ml
src/main/java/eus/ixa/ixa/pipe/ml/eval/SequenceLabelerEvaluate.java
SequenceLabelerEvaluate.detailEvaluate
public final void detailEvaluate() throws IOException { final List<EvaluationMonitor<SequenceLabelSample>> listeners = new LinkedList<EvaluationMonitor<SequenceLabelSample>>(); final SequenceLabelerDetailedFMeasureListener detailedFListener = new SequenceLabelerDetailedFMeasureListener(); listeners.add(deta...
java
public final void detailEvaluate() throws IOException { final List<EvaluationMonitor<SequenceLabelSample>> listeners = new LinkedList<EvaluationMonitor<SequenceLabelSample>>(); final SequenceLabelerDetailedFMeasureListener detailedFListener = new SequenceLabelerDetailedFMeasureListener(); listeners.add(deta...
[ "public", "final", "void", "detailEvaluate", "(", ")", "throws", "IOException", "{", "final", "List", "<", "EvaluationMonitor", "<", "SequenceLabelSample", ">", ">", "listeners", "=", "new", "LinkedList", "<", "EvaluationMonitor", "<", "SequenceLabelSample", ">", ...
Evaluate and print the precision, recall and F measure per sequence class. @throws IOException if test corpus not loaded
[ "Evaluate", "and", "print", "the", "precision", "recall", "and", "F", "measure", "per", "sequence", "class", "." ]
c817fa1e40e96ed15fc79d22c3a7c25f1a40d172
https://github.com/ixa-ehu/ixa-pipe-ml/blob/c817fa1e40e96ed15fc79d22c3a7c25f1a40d172/src/main/java/eus/ixa/ixa/pipe/ml/eval/SequenceLabelerEvaluate.java#L146-L155
train
Detail evaluation of the Sequence Labeler.
Create a Java method that does the following: "Detail evaluation of the Sequence Labeler.".
Of course, here is the Java code you requested: ```java public final void detailEvaluate() throws IOException { final List<EvaluationMonitor<SequenceLabelSample>> listeners = new LinkedList<EvaluationMonitor<SequenceLabelSample>>(); final SequenceLabelerDetailedFMeasureListener detailedFListener = new Sequence...
aws/aws-sdk-java
aws-java-sdk-directconnect/src/main/java/com/amazonaws/services/directconnect/AmazonDirectConnectClient.java
AmazonDirectConnectClient.disassociateConnectionFromLag
@Override public DisassociateConnectionFromLagResult disassociateConnectionFromLag(DisassociateConnectionFromLagRequest request) { request = beforeClientExecution(request); return executeDisassociateConnectionFromLag(request); }
java
@Override public DisassociateConnectionFromLagResult disassociateConnectionFromLag(DisassociateConnectionFromLagRequest request) { request = beforeClientExecution(request); return executeDisassociateConnectionFromLag(request); }
[ "@", "Override", "public", "DisassociateConnectionFromLagResult", "disassociateConnectionFromLag", "(", "DisassociateConnectionFromLagRequest", "request", ")", "{", "request", "=", "beforeClientExecution", "(", "request", ")", ";", "return", "executeDisassociateConnectionFromLag"...
<p> Disassociates a connection from a link aggregation group (LAG). The connection is interrupted and re-established as a standalone connection (the connection is not deleted; to delete the connection, use the <a>DeleteConnection</a> request). If the LAG has associated virtual interfaces or hosted connections, they rem...
[ "<p", ">", "Disassociates", "a", "connection", "from", "a", "link", "aggregation", "group", "(", "LAG", ")", ".", "The", "connection", "is", "interrupted", "and", "re", "-", "established", "as", "a", "standalone", "connection", "(", "the", "connection", "is"...
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-directconnect/src/main/java/com/amazonaws/services/directconnect/AmazonDirectConnectClient.java#L3150-L3154
train
Disassociates a connection from an existing Lag.
Create a Java method that does the following: "Disassociates a connection from an existing Lag.".
Of course, here is the Java code you requested: ```java @Override public DisassociateConnectionFromLagResult disassociateConnectionFromLag(DisassociateConnectionFromLagRequest request) { request = beforeClientExecution(request); return executeDisassociateConnectionFromLag(request); } ``` Hope ...
Twitter4J/Twitter4J
twitter4j-stream/src/main/java/twitter4j/TwitterStreamImpl.java
TwitterStreamImpl.getFilterStream
StatusStream getFilterStream(FilterQuery query) throws TwitterException { ensureAuthorizationEnabled(); try { return new StatusStreamImpl(getDispatcher(), http.post(conf.getStreamBaseURL() + "statuses/filter.json" , query.asHttpParameterArray(stallWarn...
java
StatusStream getFilterStream(FilterQuery query) throws TwitterException { ensureAuthorizationEnabled(); try { return new StatusStreamImpl(getDispatcher(), http.post(conf.getStreamBaseURL() + "statuses/filter.json" , query.asHttpParameterArray(stallWarn...
[ "StatusStream", "getFilterStream", "(", "FilterQuery", "query", ")", "throws", "TwitterException", "{", "ensureAuthorizationEnabled", "(", ")", ";", "try", "{", "return", "new", "StatusStreamImpl", "(", "getDispatcher", "(", ")", ",", "http", ".", "post", "(", "...
Returns public statuses that match one or more filter predicates. At least one predicate parameter, follow, locations, or track must be specified. Multiple parameters may be specified which allows most clients to use a single connection to the Streaming API. Placing long parameters in the URL may cause the request to b...
[ "Returns", "public", "statuses", "that", "match", "one", "or", "more", "filter", "predicates", ".", "At", "least", "one", "predicate", "parameter", "follow", "locations", "or", "track", "must", "be", "specified", ".", "Multiple", "parameters", "may", "be", "sp...
8376fade8d557896bb9319fb46e39a55b134b166
https://github.com/Twitter4J/Twitter4J/blob/8376fade8d557896bb9319fb46e39a55b134b166/twitter4j-stream/src/main/java/twitter4j/TwitterStreamImpl.java#L277-L286
train
Gets a Stream of filter results.
Create a Java method that does the following: "Gets a Stream of filter results.".
Of course, here is the Java code you requested: ```java StatusStream getFilterStream(FilterQuery query) throws TwitterException { ensureAuthorizationEnabled(); try { return new StatusStreamImpl(getDispatcher(), http.post(conf.getStreamBaseURL() + "statuses/filter.json" ...
real-logic/aeron
aeron-client/src/main/java/io/aeron/Aeron.java
Context.close
public void close() { final MappedByteBuffer cncByteBuffer = this.cncByteBuffer; this.cncByteBuffer = null; IoUtil.unmap(cncByteBuffer); super.close(); }
java
public void close() { final MappedByteBuffer cncByteBuffer = this.cncByteBuffer; this.cncByteBuffer = null; IoUtil.unmap(cncByteBuffer); super.close(); }
[ "public", "void", "close", "(", ")", "{", "final", "MappedByteBuffer", "cncByteBuffer", "=", "this", ".", "cncByteBuffer", ";", "this", ".", "cncByteBuffer", "=", "null", ";", "IoUtil", ".", "unmap", "(", "cncByteBuffer", ")", ";", "super", ".", "close", "...
Clean up all resources that the client uses to communicate with the Media Driver.
[ "Clean", "up", "all", "resources", "that", "the", "client", "uses", "to", "communicate", "with", "the", "Media", "Driver", "." ]
045c32f0256d1ea35d562520216affc281a41239
https://github.com/real-logic/aeron/blob/045c32f0256d1ea35d562520216affc281a41239/aeron-client/src/main/java/io/aeron/Aeron.java#L1042-L1048
test
Close the record store.
Create a Java method that does the following: "Close the record store.".
Of course, here is the Java code you requested: ```java public void close() { final MappedByteBuffer cncByteBuffer = this.cncByteBuffer; this.cncByteBuffer = null; IoUtil.unmap(cncByteBuffer); super.close(); } ``` Hope this helps!
Metatavu/edelphi
edelphi/src/main/java/fi/metatavu/edelphi/utils/QueryDataUtils.java
QueryDataUtils.writeCsv
private static byte[] writeCsv(String[] columnHeaders, List<String[]> rows) throws IOException { return writeCsv(columnHeaders, rows.stream().toArray(String[][]::new)); }
java
private static byte[] writeCsv(String[] columnHeaders, List<String[]> rows) throws IOException { return writeCsv(columnHeaders, rows.stream().toArray(String[][]::new)); }
[ "private", "static", "byte", "[", "]", "writeCsv", "(", "String", "[", "]", "columnHeaders", ",", "List", "<", "String", "[", "]", ">", "rows", ")", "throws", "IOException", "{", "return", "writeCsv", "(", "columnHeaders", ",", "rows", ".", "stream", "("...
Writes a CSV file @param columnHeaders headers @param rows rows @return CSV file @throws IOException throws IOException when CSV writing fails
[ "Writes", "a", "CSV", "file" ]
d91a0b54f954b33b4ee674a1bdf03612d76c3305
https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/edelphi/src/main/java/fi/metatavu/edelphi/utils/QueryDataUtils.java#L244-L246
train
Write CSV data to byte array
Create a Java method that does the following: "Write CSV data to byte array".
Of course, here is the Java code you requested: ```java private static byte[] writeCsv(String[] columnHeaders, List<String[]> rows) throws IOException { return writeCsv(columnHeaders, rows.stream().toArray(String[][]::new)); } ``` Hope this helps!
EdwardRaff/JSAT
JSAT/src/jsat/linear/Matrix.java
Matrix.subtract
public Matrix subtract(Matrix B) { Matrix toReturn = getThisSideMatrix(B); toReturn.mutableSubtract(1.0, B); return toReturn; }
java
public Matrix subtract(Matrix B) { Matrix toReturn = getThisSideMatrix(B); toReturn.mutableSubtract(1.0, B); return toReturn; }
[ "public", "Matrix", "subtract", "(", "Matrix", "B", ")", "{", "Matrix", "toReturn", "=", "getThisSideMatrix", "(", "B", ")", ";", "toReturn", ".", "mutableSubtract", "(", "1.0", ",", "B", ")", ";", "return", "toReturn", ";", "}" ]
Creates a new Matrix that stores the result of <i>A-B</i> @param B the matrix to subtract from <i>this</i>. @return a new matrix equal to <i>A-B</i>
[ "Creates", "a", "new", "Matrix", "that", "stores", "the", "result", "of", "<i", ">", "A", "-", "B<", "/", "i", ">" ]
0ff53b7b39684b2379cc1da522f5b3a954b15cfb
https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/linear/Matrix.java#L167-L172
train
Subtracts this matrix from B.
Create a Java method that does the following: "Subtracts this matrix from B.".
Of course, here is the Java code you requested: ```java public Matrix subtract(Matrix B) { Matrix toReturn = getThisSideMatrix(B); toReturn.mutableSubtract(1.0, B); return toReturn; } ``` Hope this helps!
JodaOrg/joda-money
src/main/java/org/joda/money/MoneyUtils.java
MoneyUtils.max
public static Money max(Money money1, Money money2) { if (money1 == null) { return money2; } if (money2 == null) { return money1; } return money1.compareTo(money2) > 0 ? money1 : money2; }
java
public static Money max(Money money1, Money money2) { if (money1 == null) { return money2; } if (money2 == null) { return money1; } return money1.compareTo(money2) > 0 ? money1 : money2; }
[ "public", "static", "Money", "max", "(", "Money", "money1", ",", "Money", "money2", ")", "{", "if", "(", "money1", "==", "null", ")", "{", "return", "money2", ";", "}", "if", "(", "money2", "==", "null", ")", "{", "return", "money1", ";", "}", "ret...
Finds the maximum {@code Money} value, handing null. <p> This returns the greater of money1 or money2 where null is ignored. If both input values are null, then null is returned. @param money1 the first money instance, null returns money2 @param money2 the first money instance, null returns money1 @return the maximu...
[ "Finds", "the", "maximum", "{", "@code", "Money", "}", "value", "handing", "null", ".", "<p", ">", "This", "returns", "the", "greater", "of", "money1", "or", "money2", "where", "null", "is", "ignored", ".", "If", "both", "input", "values", "are", "null",...
e1f2de75aa36610a695358696c8a88a18ca66cde
https://github.com/JodaOrg/joda-money/blob/e1f2de75aa36610a695358696c8a88a18ca66cde/src/main/java/org/joda/money/MoneyUtils.java#L117-L125
train
Returns the max of two Money objects.
Create a Java method that does the following: "Returns the max of two Money objects.".
Of course, here is the Java code you requested: ```java public static Money max(Money money1, Money money2) { if (money1 == null) { return money2; } if (money2 == null) { return money1; } return money1.compareTo(money2) > 0 ? money1 : money2; ...
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/config/gui/panels/DebugPanel.java
DebugPanel.validateDebugSettings
private void validateDebugSettings() { verifyDiffCheckBox.setSelected(controller.isDiffVerificationEnabled()); verifyEncodingCheckBox.setSelected(controller .isEncodingVerificationEnabled()); statsOutputCheckBox.setSelected(controller.isStatsOutputEnabled()); boolean flagA = controller.isDiffVerification...
java
private void validateDebugSettings() { verifyDiffCheckBox.setSelected(controller.isDiffVerificationEnabled()); verifyEncodingCheckBox.setSelected(controller .isEncodingVerificationEnabled()); statsOutputCheckBox.setSelected(controller.isStatsOutputEnabled()); boolean flagA = controller.isDiffVerification...
[ "private", "void", "validateDebugSettings", "(", ")", "{", "verifyDiffCheckBox", ".", "setSelected", "(", "controller", ".", "isDiffVerificationEnabled", "(", ")", ")", ";", "verifyEncodingCheckBox", ".", "setSelected", "(", "controller", ".", "isEncodingVerificationEna...
Validates the debug settings.
[ "Validates", "the", "debug", "settings", "." ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/config/gui/panels/DebugPanel.java#L185-L203
train
Validate the debug settings.
Create a Java method that does the following: "Validate the debug settings.".
Of course, here is the Java code you requested: ```java private void validateDebugSettings() { verifyDiffCheckBox.setSelected(controller.isDiffVerificationEnabled()); verifyEncodingCheckBox.setSelected(controller .isEncodingVerificationEnabled()); statsOutputCheckBox.setSelected(controller.isStatsOutputEna...
snowflakedb/snowflake-jdbc
src/main/java/net/snowflake/client/jdbc/SnowflakeChunkDownloader.java
SnowflakeChunkDownloader.logOutOfMemoryError
private void logOutOfMemoryError() { logger.error("Dump some crucial information below:\n" + "Total milliseconds waiting for chunks: {},\n" + "Total memory used: {}, Max heap size: {}, total download time: {} millisec,\n" + "total parsing time: {} milliseconds, t...
java
private void logOutOfMemoryError() { logger.error("Dump some crucial information below:\n" + "Total milliseconds waiting for chunks: {},\n" + "Total memory used: {}, Max heap size: {}, total download time: {} millisec,\n" + "total parsing time: {} milliseconds, t...
[ "private", "void", "logOutOfMemoryError", "(", ")", "{", "logger", ".", "error", "(", "\"Dump some crucial information below:\\n\"", "+", "\"Total milliseconds waiting for chunks: {},\\n\"", "+", "\"Total memory used: {}, Max heap size: {}, total download time: {} millisec,\\n\"", "+",...
log out of memory error and provide the suggestion to avoid this error
[ "log", "out", "of", "memory", "error", "and", "provide", "the", "suggestion", "to", "avoid", "this", "error" ]
98567b5a57753f29d51446809640b969a099658f
https://github.com/snowflakedb/snowflake-jdbc/blob/98567b5a57753f29d51446809640b969a099658f/src/main/java/net/snowflake/client/jdbc/SnowflakeChunkDownloader.java#L611-L630
train
Logs out of memory error.
Create a Java method that does the following: "Logs out of memory error.".
Of course, here is the Java code you requested: ```java private void logOutOfMemoryError() { logger.error("Dump some crucial information below:\n" + "Total milliseconds waiting for chunks: {},\n" + "Total memory used: {}, Max heap size: {}, total download time: {} millisec,\n" +...
OpenLiberty/open-liberty
dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/persistent/filemgr/FileManagerImpl.java
FileManagerImpl.split_block
private long split_block(long block_addr, int request_size, int rem) throws IOException { allocated_words += request_size; allocated_blocks++; free_words -= request_size; ml_hits++; ml_splits++; seek_and_count(block_addr + request_size); writeInt(rem); ...
java
private long split_block(long block_addr, int request_size, int rem) throws IOException { allocated_words += request_size; allocated_blocks++; free_words -= request_size; ml_hits++; ml_splits++; seek_and_count(block_addr + request_size); writeInt(rem); ...
[ "private", "long", "split_block", "(", "long", "block_addr", ",", "int", "request_size", ",", "int", "rem", ")", "throws", "IOException", "{", "allocated_words", "+=", "request_size", ";", "allocated_blocks", "++", ";", "free_words", "-=", "request_size", ";", "...
/* Split a block on disk and return the appropriate address. We assume that this is only called to split a block on the misc list.
[ "/", "*", "Split", "a", "block", "on", "disk", "and", "return", "the", "appropriate", "address", ".", "We", "assume", "that", "this", "is", "only", "called", "to", "split", "a", "block", "on", "the", "misc", "list", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/persistent/filemgr/FileManagerImpl.java#L946-L959
train
Splits a block into a single block of words.
Create a Java method that does the following: "Splits a block into a single block of words.".
Of course, here is the Java code you requested: ```java private long split_block(long block_addr, int request_size, int rem) throws IOException { allocated_words += request_size; allocated_blocks++; free_words -= request_size; ml_hits++; ml_splits++; seek_and_cou...
demidenko05/beigesoft-webstore
src/main/java/org/beigesoft/webstore/processor/PrcRefreshItemsInList.java
PrcRefreshItemsInList.findFirstIdxFor
protected final <T extends AItemSpecifics<?, ?>> int findFirstIdxFor(final List<T> pOutdGdSpList, final IHasIdLongVersionName pItem) { int j = 0; while (!pOutdGdSpList.get(j).getItem().getItsId().equals(pItem.getItsId())) { j++; } return j; }
java
protected final <T extends AItemSpecifics<?, ?>> int findFirstIdxFor(final List<T> pOutdGdSpList, final IHasIdLongVersionName pItem) { int j = 0; while (!pOutdGdSpList.get(j).getItem().getItsId().equals(pItem.getItsId())) { j++; } return j; }
[ "protected", "final", "<", "T", "extends", "AItemSpecifics", "<", "?", ",", "?", ">", ">", "int", "findFirstIdxFor", "(", "final", "List", "<", "T", ">", "pOutdGdSpList", ",", "final", "IHasIdLongVersionName", "pItem", ")", "{", "int", "j", "=", "0", ";"...
<p>Find the first index of specific with given item.</p> @param <T> item specifics type @param pOutdGdSpList GS list @param pItem Goods @return the first index of specific with given item it throws Exception - if out of bounds
[ "<p", ">", "Find", "the", "first", "index", "of", "specific", "with", "given", "item", ".", "<", "/", "p", ">" ]
41ed2e2f1c640d37951d5fb235f26856008b87e1
https://github.com/demidenko05/beigesoft-webstore/blob/41ed2e2f1c640d37951d5fb235f26856008b87e1/src/main/java/org/beigesoft/webstore/processor/PrcRefreshItemsInList.java#L1170-L1176
train
Find the first index for the given item.
Create a Java method that does the following: "Find the first index for the given item.".
Of course, here is the Java code you requested: ```java protected final <T extends AItemSpecifics<?, ?>> int findFirstIdxFor(final List<T> pOutdGdSpList, final IHasIdLongVersionName pItem) { int j = 0; while (!pOutdGdSpList.get(j).getItem().getItsId().equals(pItem.getItsId())) { j++; } return j;...
pac4j/pac4j
pac4j-saml/src/main/java/org/pac4j/saml/sso/impl/SAML2AuthnResponseValidator.java
SAML2AuthnResponseValidator.validateSubject
@SuppressWarnings("unchecked") protected final void validateSubject(final Subject subject, final SAML2MessageContext context, final Decrypter decrypter) { boolean samlIDFound = false; // Read NameID/BaseID/EncryptedID from the subject. If not present directl...
java
@SuppressWarnings("unchecked") protected final void validateSubject(final Subject subject, final SAML2MessageContext context, final Decrypter decrypter) { boolean samlIDFound = false; // Read NameID/BaseID/EncryptedID from the subject. If not present directl...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "protected", "final", "void", "validateSubject", "(", "final", "Subject", "subject", ",", "final", "SAML2MessageContext", "context", ",", "final", "Decrypter", "decrypter", ")", "{", "boolean", "samlIDFound", "=", ...
Validate the given subject by finding a valid Bearer confirmation. If the subject is valid, put its nameID in the context. <p> NameID / BaseID / EncryptedID is first looked up directly in the Subject. If not present there, then all relevant SubjectConfirmations are parsed and the IDs are taken from them. @param subjec...
[ "Validate", "the", "given", "subject", "by", "finding", "a", "valid", "Bearer", "confirmation", ".", "If", "the", "subject", "is", "valid", "put", "its", "nameID", "in", "the", "context", ".", "<p", ">", "NameID", "/", "BaseID", "/", "EncryptedID", "is", ...
d9cd029f8783792b31dd48bf1e32f80628f2c4a3
https://github.com/pac4j/pac4j/blob/d9cd029f8783792b31dd48bf1e32f80628f2c4a3/pac4j-saml/src/main/java/org/pac4j/saml/sso/impl/SAML2AuthnResponseValidator.java#L353-L407
train
Validate the subject.
Create a Java method that does the following: "Validate the subject.".
Of course, here is the Java code you requested: ```java @SuppressWarnings("unchecked") protected final void validateSubject(final Subject subject, final SAML2MessageContext context, final Decrypter decrypter) { boolean samlIDFound = false; // Read NameID/Ba...
strator-dev/greenpepper
greenpepper/core/src/main/java/com/greenpepper/html/HtmlDocumentBuilder.java
HtmlDocumentBuilder.parse
public Example parse( String html ) { String text = removeComments( html ); return doParse(text); }
java
public Example parse( String html ) { String text = removeComments( html ); return doParse(text); }
[ "public", "Example", "parse", "(", "String", "html", ")", "{", "String", "text", "=", "removeComments", "(", "html", ")", ";", "return", "doParse", "(", "text", ")", ";", "}" ]
<p>parse.</p> @param html a {@link java.lang.String} object. @return a {@link com.greenpepper.Example} object.
[ "<p", ">", "parse", ".", "<", "/", "p", ">" ]
2a61e6c179b74085babcc559d677490b0cad2d30
https://github.com/strator-dev/greenpepper/blob/2a61e6c179b74085babcc559d677490b0cad2d30/greenpepper/core/src/main/java/com/greenpepper/html/HtmlDocumentBuilder.java#L122-L127
train
Parse HTML into a single example.
Create a Java method that does the following: "Parse HTML into a single example.".
Of course, here is the Java code you requested: ```java public Example parse( String html ) { String text = removeComments( html ); return doParse(text); } ``` Hope this helps!
wildfly/wildfly-core
patching/src/main/java/org/jboss/as/patching/tool/PatchOperationTarget.java
PatchOperationTarget.createLocal
public static final PatchOperationTarget createLocal(final File jbossHome, List<File> moduleRoots, List<File> bundlesRoots) throws IOException { final PatchTool tool = PatchTool.Factory.createLocalTool(jbossHome, moduleRoots, bundlesRoots); return new LocalPatchOperationTarget(tool); }
java
public static final PatchOperationTarget createLocal(final File jbossHome, List<File> moduleRoots, List<File> bundlesRoots) throws IOException { final PatchTool tool = PatchTool.Factory.createLocalTool(jbossHome, moduleRoots, bundlesRoots); return new LocalPatchOperationTarget(tool); }
[ "public", "static", "final", "PatchOperationTarget", "createLocal", "(", "final", "File", "jbossHome", ",", "List", "<", "File", ">", "moduleRoots", ",", "List", "<", "File", ">", "bundlesRoots", ")", "throws", "IOException", "{", "final", "PatchTool", "tool", ...
Create a local target. @param jbossHome the jboss home @param moduleRoots the module roots @param bundlesRoots the bundle roots @return the local target @throws IOException
[ "Create", "a", "local", "target", "." ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/patching/src/main/java/org/jboss/as/patching/tool/PatchOperationTarget.java#L76-L79
train
Create a local patch target.
Create a Java method that does the following: "Create a local patch target.".
Of course, here is the Java code you requested: ```java public static final PatchOperationTarget createLocal(final File jbossHome, List<File> moduleRoots, List<File> bundlesRoots) throws IOException { final PatchTool tool = PatchTool.Factory.createLocalTool(jbossHome, moduleRoots, bundlesRoots); return...
Alluxio/alluxio
core/common/src/main/java/alluxio/underfs/Fingerprint.java
Fingerprint.isValid
public boolean isValid() { if (mValues.isEmpty()) { return false; } // Check required tags for (Tag tag : REQUIRED_TAGS) { if (!mValues.containsKey(tag)) { return false; } } return true; }
java
public boolean isValid() { if (mValues.isEmpty()) { return false; } // Check required tags for (Tag tag : REQUIRED_TAGS) { if (!mValues.containsKey(tag)) { return false; } } return true; }
[ "public", "boolean", "isValid", "(", ")", "{", "if", "(", "mValues", ".", "isEmpty", "(", ")", ")", "{", "return", "false", ";", "}", "// Check required tags", "for", "(", "Tag", "tag", ":", "REQUIRED_TAGS", ")", "{", "if", "(", "!", "mValues", ".", ...
Checks if the fingerprint object was generated from an INVALID_UFS_FINGERPRINT. @return returns true if the fingerprint is valid
[ "Checks", "if", "the", "fingerprint", "object", "was", "generated", "from", "an", "INVALID_UFS_FINGERPRINT", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/underfs/Fingerprint.java#L165-L178
train
Check if the CBE is valid.
Create a Java method that does the following: "Check if the CBE is valid.".
Of course, here is the Java code you requested: ```java public boolean isValid() { if (mValues.isEmpty()) { return false; } // Check required tags for (Tag tag : REQUIRED_TAGS) { if (!mValues.containsKey(tag)) { return false; } } return true; } ``` Hope this helps...
btrplace/scheduler
btrpsl/src/main/java/org/btrplace/btrpsl/constraint/migration/BeforeBuilder.java
BeforeBuilder.buildConstraint
@Override public List<? extends SatConstraint> buildConstraint(BtrPlaceTree t, List<BtrpOperand> args) { if (!checkConformance(t, args)) { return Collections.emptyList(); } // Get the first parameter @SuppressWarnings("unchecked") List<VM> s = (List<VM>) params[...
java
@Override public List<? extends SatConstraint> buildConstraint(BtrPlaceTree t, List<BtrpOperand> args) { if (!checkConformance(t, args)) { return Collections.emptyList(); } // Get the first parameter @SuppressWarnings("unchecked") List<VM> s = (List<VM>) params[...
[ "@", "Override", "public", "List", "<", "?", "extends", "SatConstraint", ">", "buildConstraint", "(", "BtrPlaceTree", "t", ",", "List", "<", "BtrpOperand", ">", "args", ")", "{", "if", "(", "!", "checkConformance", "(", "t", ",", "args", ")", ")", "{", ...
Build a precedence constraint. @param t the current tree @param args can be a non-empty set of vms ({@see Precedence} constraint) or a timestamp string ({@see Deadline} constraint) @return a constraint
[ "Build", "a", "precedence", "constraint", "." ]
611063aad0b47a016e57ebf36fa4dfdf24de09e8
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/btrpsl/src/main/java/org/btrplace/btrpsl/constraint/migration/BeforeBuilder.java#L61-L98
train
Build a single SatConstraint.
Create a Java method that does the following: "Build a single SatConstraint.".
Of course, here is the Java code you requested: ```java @Override public List<? extends SatConstraint> buildConstraint(BtrPlaceTree t, List<BtrpOperand> args) { if (!checkConformance(t, args)) { return Collections.emptyList(); } // Get the first parameter @SuppressWarn...
OpenLiberty/open-liberty
dev/com.ibm.ws.jdbc/src/com/ibm/ws/rsadapter/impl/CacheMap.java
CacheMap.discardFromBucket
private Object discardFromBucket(int bucketIndex, int entryIndex) { numDiscards++; bucketSizes[bucketIndex]--; numEntries--; return values[bucketIndex][entryIndex]; }
java
private Object discardFromBucket(int bucketIndex, int entryIndex) { numDiscards++; bucketSizes[bucketIndex]--; numEntries--; return values[bucketIndex][entryIndex]; }
[ "private", "Object", "discardFromBucket", "(", "int", "bucketIndex", ",", "int", "entryIndex", ")", "{", "numDiscards", "++", ";", "bucketSizes", "[", "bucketIndex", "]", "--", ";", "numEntries", "--", ";", "return", "values", "[", "bucketIndex", "]", "[", "...
Discard an entry from the specified bucket. The actual entry is not nulled out because it will later be overwritten. @param bucketIndex the index of the bucket from which to discard an entry. @param entryIndex the index of the entry within the bucket to discard. @return the discarded value.
[ "Discard", "an", "entry", "from", "the", "specified", "bucket", ".", "The", "actual", "entry", "is", "not", "nulled", "out", "because", "it", "will", "later", "be", "overwritten", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jdbc/src/com/ibm/ws/rsadapter/impl/CacheMap.java#L194-L199
train
Discards the entry from the specified bucket.
Create a Java method that does the following: "Discards the entry from the specified bucket.".
Of course, here is the Java code you requested: ```java private Object discardFromBucket(int bucketIndex, int entryIndex) { numDiscards++; bucketSizes[bucketIndex]--; numEntries--; return values[bucketIndex][entryIndex]; } ``` Hope this helps!
liferay/com-liferay-commerce
commerce-price-list-service/src/main/java/com/liferay/commerce/price/list/service/persistence/impl/CommerceTierPriceEntryPersistenceImpl.java
CommerceTierPriceEntryPersistenceImpl.removeByC_ERC
@Override public CommerceTierPriceEntry removeByC_ERC(long companyId, String externalReferenceCode) throws NoSuchTierPriceEntryException { CommerceTierPriceEntry commerceTierPriceEntry = findByC_ERC(companyId, externalReferenceCode); return remove(commerceTierPriceEntry); }
java
@Override public CommerceTierPriceEntry removeByC_ERC(long companyId, String externalReferenceCode) throws NoSuchTierPriceEntryException { CommerceTierPriceEntry commerceTierPriceEntry = findByC_ERC(companyId, externalReferenceCode); return remove(commerceTierPriceEntry); }
[ "@", "Override", "public", "CommerceTierPriceEntry", "removeByC_ERC", "(", "long", "companyId", ",", "String", "externalReferenceCode", ")", "throws", "NoSuchTierPriceEntryException", "{", "CommerceTierPriceEntry", "commerceTierPriceEntry", "=", "findByC_ERC", "(", "companyId...
Removes the commerce tier price entry where companyId = &#63; and externalReferenceCode = &#63; from the database. @param companyId the company ID @param externalReferenceCode the external reference code @return the commerce tier price entry that was removed
[ "Removes", "the", "commerce", "tier", "price", "entry", "where", "companyId", "=", "&#63", ";", "and", "externalReferenceCode", "=", "&#63", ";", "from", "the", "database", "." ]
9e54362d7f59531fc684016ba49ee7cdc3a2f22b
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-price-list-service/src/main/java/com/liferay/commerce/price/list/service/persistence/impl/CommerceTierPriceEntryPersistenceImpl.java#L3991-L3998
train
Removes the commerce tier price entry with the matching external reference code and company.
Create a Java method that does the following: "Removes the commerce tier price entry with the matching external reference code and company.".
Of course, here is the Java code you requested: ```java @Override public CommerceTierPriceEntry removeByC_ERC(long companyId, String externalReferenceCode) throws NoSuchTierPriceEntryException { CommerceTierPriceEntry commerceTierPriceEntry = findByC_ERC(companyId, externalReferenceCode); return remove(com...
igniterealtime/Smack
smack-omemo/src/main/java/org/jivesoftware/smackx/omemo/OmemoManager.java
OmemoManager.getInstanceFor
public static synchronized OmemoManager getInstanceFor(XMPPConnection connection) { TreeMap<Integer, OmemoManager> managers = INSTANCES.get(connection); if (managers == null) { managers = new TreeMap<>(); INSTANCES.put(connection, managers); } OmemoManager manage...
java
public static synchronized OmemoManager getInstanceFor(XMPPConnection connection) { TreeMap<Integer, OmemoManager> managers = INSTANCES.get(connection); if (managers == null) { managers = new TreeMap<>(); INSTANCES.put(connection, managers); } OmemoManager manage...
[ "public", "static", "synchronized", "OmemoManager", "getInstanceFor", "(", "XMPPConnection", "connection", ")", "{", "TreeMap", "<", "Integer", ",", "OmemoManager", ">", "managers", "=", "INSTANCES", ".", "get", "(", "connection", ")", ";", "if", "(", "managers"...
Returns an OmemoManager instance for the given connection. If there was one manager for the connection before, return it. If there were multiple managers before, return the one with the lowest deviceId. If there was no manager before, return a new one. As soon as the connection gets authenticated, the manager will look...
[ "Returns", "an", "OmemoManager", "instance", "for", "the", "given", "connection", ".", "If", "there", "was", "one", "manager", "for", "the", "connection", "before", "return", "it", ".", "If", "there", "were", "multiple", "managers", "before", "return", "the", ...
870756997faec1e1bfabfac0cd6c2395b04da873
https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-omemo/src/main/java/org/jivesoftware/smackx/omemo/OmemoManager.java#L185-L203
train
Get the OmemoManager instance for a given connection.
Create a Java method that does the following: "Get the OmemoManager instance for a given connection.".
Of course, here is the Java code you requested: ```java public static synchronized OmemoManager getInstanceFor(XMPPConnection connection) { TreeMap<Integer, OmemoManager> managers = INSTANCES.get(connection); if (managers == null) { managers = new TreeMap<>(); INSTANCES.put(conn...
phax/ph-genericode
src/main/java/com/helger/genericode/Genericode10Helper.java
Genericode10Helper.getAllColumns
public static void getAllColumns (@Nonnull final ColumnSet aColumnSet, @Nonnull final Collection <Column> aTarget) { CollectionHelper.findAll (aColumnSet.getColumnChoice (), o -> o instanceof Column, o -> aTarget.add ((Column) o)); }
java
public static void getAllColumns (@Nonnull final ColumnSet aColumnSet, @Nonnull final Collection <Column> aTarget) { CollectionHelper.findAll (aColumnSet.getColumnChoice (), o -> o instanceof Column, o -> aTarget.add ((Column) o)); }
[ "public", "static", "void", "getAllColumns", "(", "@", "Nonnull", "final", "ColumnSet", "aColumnSet", ",", "@", "Nonnull", "final", "Collection", "<", "Column", ">", "aTarget", ")", "{", "CollectionHelper", ".", "findAll", "(", "aColumnSet", ".", "getColumnChoic...
Get all contained columns @param aColumnSet The column set to scan. May not be <code>null</code>. @param aTarget A non-<code>null</code> list where all columns should be added. May not be <code>null</code>.
[ "Get", "all", "contained", "columns" ]
76ef5bb0744af42bd3decd41c2bf0829c87ae71d
https://github.com/phax/ph-genericode/blob/76ef5bb0744af42bd3decd41c2bf0829c87ae71d/src/main/java/com/helger/genericode/Genericode10Helper.java#L147-L150
test
Get all columns from the passed column set.
Create a Java method that does the following: "Get all columns from the passed column set.".
Of course, here is the Java code you requested: ```java public static void getAllColumns (@Nonnull final ColumnSet aColumnSet, @Nonnull final Collection <Column> aTarget) { CollectionHelper.findAll (aColumnSet.getColumnChoice (), o -> o instanceof Column, o -> aTarget.add ((Column) o)); } ``` Hope this helps!
Evol-Instruct
N/A
N/A
java
[]
[]
train
Write a Java program to print the Fibonacci sequence starting from a given number. The Fibonacci sequence is a series of numbers in which each number is the sum of the two preceding ones. The sequence starts with 0 and 1. In this program, we will take a starting number from the user and generate the Fibonacci sequenc...
Here is the Java program to print the Fibonacci sequence starting from a given number: ```java import java.util.Scanner; public class FibonacciSequence { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); System.out.println("Enter the starting number: "); ...
aws/aws-sdk-java
aws-java-sdk-medialive/src/main/java/com/amazonaws/services/medialive/model/PauseStateScheduleActionSettings.java
PauseStateScheduleActionSettings.withPipelines
public PauseStateScheduleActionSettings withPipelines(PipelinePauseStateSettings... pipelines) { if (this.pipelines == null) { setPipelines(new java.util.ArrayList<PipelinePauseStateSettings>(pipelines.length)); } for (PipelinePauseStateSettings ele : pipelines) { this.pi...
java
public PauseStateScheduleActionSettings withPipelines(PipelinePauseStateSettings... pipelines) { if (this.pipelines == null) { setPipelines(new java.util.ArrayList<PipelinePauseStateSettings>(pipelines.length)); } for (PipelinePauseStateSettings ele : pipelines) { this.pi...
[ "public", "PauseStateScheduleActionSettings", "withPipelines", "(", "PipelinePauseStateSettings", "...", "pipelines", ")", "{", "if", "(", "this", ".", "pipelines", "==", "null", ")", "{", "setPipelines", "(", "new", "java", ".", "util", ".", "ArrayList", "<", "...
<p> <b>NOTE:</b> This method appends the values to the existing list (if any). Use {@link #setPipelines(java.util.Collection)} or {@link #withPipelines(java.util.Collection)} if you want to override the existing values. </p> @param pipelines @return Returns a reference to this object so that method calls can be chaine...
[ "<p", ">", "<b", ">", "NOTE", ":", "<", "/", "b", ">", "This", "method", "appends", "the", "values", "to", "the", "existing", "list", "(", "if", "any", ")", ".", "Use", "{", "@link", "#setPipelines", "(", "java", ".", "util", ".", "Collection", ")"...
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-medialive/src/main/java/com/amazonaws/services/medialive/model/PauseStateScheduleActionSettings.java#L63-L71
train
A list of pipelines to pause on this action.
Create a Java method that does the following: "A list of pipelines to pause on this action.".
Of course, here is the Java code you requested: ```java public PauseStateScheduleActionSettings withPipelines(PipelinePauseStateSettings... pipelines) { if (this.pipelines == null) { setPipelines(new java.util.ArrayList<PipelinePauseStateSettings>(pipelines.length)); } for (Pipeline...
akarnokd/ixjava
src/main/java/ix/Ix.java
Ix.sequenceEqual
public final Ix<Boolean> sequenceEqual(Iterable<? extends T> other) { return sequenceEqual(nullCheck(other, "other is null"), EqualityHelper.INSTANCE); }
java
public final Ix<Boolean> sequenceEqual(Iterable<? extends T> other) { return sequenceEqual(nullCheck(other, "other is null"), EqualityHelper.INSTANCE); }
[ "public", "final", "Ix", "<", "Boolean", ">", "sequenceEqual", "(", "Iterable", "<", "?", "extends", "T", ">", "other", ")", "{", "return", "sequenceEqual", "(", "nullCheck", "(", "other", ",", "\"other is null\"", ")", ",", "EqualityHelper", ".", "INSTANCE"...
Determines if two sequences have the same elements in the same order and are the same length based on null-safe object equality. <p> The result's iterator() doesn't support remove(). @param other the other sequence to compare with @return the new Ix instance @throws NullPointerException if other is null @since 1.0
[ "Determines", "if", "two", "sequences", "have", "the", "same", "elements", "in", "the", "same", "order", "and", "are", "the", "same", "length", "based", "on", "null", "-", "safe", "object", "equality", ".", "<p", ">", "The", "result", "s", "iterator", "(...
add721bba550c36541faa450e40a975bb65e78d7
https://github.com/akarnokd/ixjava/blob/add721bba550c36541faa450e40a975bb65e78d7/src/main/java/ix/Ix.java#L1955-L1957
train
Compares two sets of classes to determine if they are equal.
Create a Java method that does the following: "Compares two sets of classes to determine if they are equal.".
Of course, here is the Java code you requested: ```java public final Ix<Boolean> sequenceEqual(Iterable<? extends T> other) { return sequenceEqual(nullCheck(other, "other is null"), EqualityHelper.INSTANCE); } ``` Hope this helps!
VoltDB/voltdb
src/hsqldb19b3/org/hsqldb_voltpatches/jdbc/JDBCCallableStatement.java
JDBCCallableStatement.getTime
public synchronized Time getTime(int parameterIndex, Calendar cal) throws SQLException { TimeData t = (TimeData) getColumnInType(parameterIndex, Type.SQL_TIME); if (t == null) { return null; } long millis = t.getSeconds() * 1000; ...
java
public synchronized Time getTime(int parameterIndex, Calendar cal) throws SQLException { TimeData t = (TimeData) getColumnInType(parameterIndex, Type.SQL_TIME); if (t == null) { return null; } long millis = t.getSeconds() * 1000; ...
[ "public", "synchronized", "Time", "getTime", "(", "int", "parameterIndex", ",", "Calendar", "cal", ")", "throws", "SQLException", "{", "TimeData", "t", "=", "(", "TimeData", ")", "getColumnInType", "(", "parameterIndex", ",", "Type", ".", "SQL_TIME", ")", ";",...
<!-- start generic documentation --> Retrieves the value of the designated JDBC <code>TIME</code> parameter as a <code>java.sql.Time</code> object, using the given <code>Calendar</code> object to construct the time. With a <code>Calendar</code> object, the driver can calculate the time taking into account a custom tim...
[ "<!", "--", "start", "generic", "documentation", "--", ">" ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/jdbc/JDBCCallableStatement.java#L1301-L1324
train
Gets the value of the designated SQL TIME parameter as a java. sql. Time object.
Create a Java method that does the following: "Gets the value of the designated SQL TIME parameter as a java. sql. Time object.".
Of course, here is the Java code you requested: ```java public synchronized Time getTime(int parameterIndex, Calendar cal) throws SQLException { TimeData t = (TimeData) getColumnInType(parameterIndex, Type.SQL_TIME); if (t == null) { return null; ...
liferay/com-liferay-commerce
commerce-product-api/src/main/java/com/liferay/commerce/product/service/persistence/CProductUtil.java
CProductUtil.fetchByUuid_C_First
public static CProduct fetchByUuid_C_First(String uuid, long companyId, OrderByComparator<CProduct> orderByComparator) { return getPersistence() .fetchByUuid_C_First(uuid, companyId, orderByComparator); }
java
public static CProduct fetchByUuid_C_First(String uuid, long companyId, OrderByComparator<CProduct> orderByComparator) { return getPersistence() .fetchByUuid_C_First(uuid, companyId, orderByComparator); }
[ "public", "static", "CProduct", "fetchByUuid_C_First", "(", "String", "uuid", ",", "long", "companyId", ",", "OrderByComparator", "<", "CProduct", ">", "orderByComparator", ")", "{", "return", "getPersistence", "(", ")", ".", "fetchByUuid_C_First", "(", "uuid", ",...
Returns the first c product 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 first matching c product, or <code>null</code> if a matching c product cou...
[ "Returns", "the", "first", "c", "product", "in", "the", "ordered", "set", "where", "uuid", "=", "&#63", ";", "and", "companyId", "=", "&#63", ";", "." ]
9e54362d7f59531fc684016ba49ee7cdc3a2f22b
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-api/src/main/java/com/liferay/commerce/product/service/persistence/CProductUtil.java#L422-L426
train
Returns the first CProduct in the ordered set where uuid = &#63 ; and companyId = &#63 ;.
Create a Java method that does the following: "Returns the first CProduct in the ordered set where uuid = &#63 ; and companyId = &#63 ;.".
Of course, here is the Java code you requested: ```java public static CProduct fetchByUuid_C_First(String uuid, long companyId, OrderByComparator<CProduct> orderByComparator) { return getPersistence() .fetchByUuid_C_First(uuid, companyId, orderByComparator); } ``` Hope this helps!
Red5/red5-io
src/main/java/org/red5/codec/AACAudio.java
AACAudio.canHandleData
@Override public boolean canHandleData(IoBuffer data) { if (data.limit() == 0) { // Empty buffer return false; } byte first = data.get(); boolean result = (((first & 0xf0) >> 4) == AudioCodec.AAC.getId()); data.rewind(); return result;...
java
@Override public boolean canHandleData(IoBuffer data) { if (data.limit() == 0) { // Empty buffer return false; } byte first = data.get(); boolean result = (((first & 0xf0) >> 4) == AudioCodec.AAC.getId()); data.rewind(); return result;...
[ "@", "Override", "public", "boolean", "canHandleData", "(", "IoBuffer", "data", ")", "{", "if", "(", "data", ".", "limit", "(", ")", "==", "0", ")", "{", "// Empty buffer\r", "return", "false", ";", "}", "byte", "first", "=", "data", ".", "get", "(", ...
{@inheritDoc}
[ "{" ]
9bbbc506423c5a8f18169d46d400df56c0072a33
https://github.com/Red5/red5-io/blob/9bbbc506423c5a8f18169d46d400df56c0072a33/src/main/java/org/red5/codec/AACAudio.java#L68-L78
train
Override this method to check if the buffer contains a AAC record.
Create a Java method that does the following: "Override this method to check if the buffer contains a AAC record.".
Of course, here is the Java code you requested: ```java @Override public boolean canHandleData(IoBuffer data) { if (data.limit() == 0) { // Empty buffer return false; } byte first = data.get(); boolean result = (((first & 0xf0) >> 4) == AudioCodec.AAC....
VoltDB/voltdb
src/hsqldb19b3/org/hsqldb_voltpatches/dbinfo/DatabaseInformationFull.java
DatabaseInformationFull.SCHEMATA
Table SCHEMATA() { Table t = sysTables[SCHEMATA]; if (t == null) { t = createBlankTable(sysTableHsqlNames[SCHEMATA]); addColumn(t, "CATALOG_NAME", SQL_IDENTIFIER); addColumn(t, "SCHEMA_NAME", SQL_IDENTIFIER); addColumn(t, "SCHEMA_OWNER", SQL_IDENTIFIER)...
java
Table SCHEMATA() { Table t = sysTables[SCHEMATA]; if (t == null) { t = createBlankTable(sysTableHsqlNames[SCHEMATA]); addColumn(t, "CATALOG_NAME", SQL_IDENTIFIER); addColumn(t, "SCHEMA_NAME", SQL_IDENTIFIER); addColumn(t, "SCHEMA_OWNER", SQL_IDENTIFIER)...
[ "Table", "SCHEMATA", "(", ")", "{", "Table", "t", "=", "sysTables", "[", "SCHEMATA", "]", ";", "if", "(", "t", "==", "null", ")", "{", "t", "=", "createBlankTable", "(", "sysTableHsqlNames", "[", "SCHEMATA", "]", ")", ";", "addColumn", "(", "t", ",",...
SCHEMATA<p> <b>Function</b><p> The SCHEMATA view has one row for each accessible schema. <p> <b>Definition</b><p> <pre class="SqlCodeExample"> CREATE TABLE SCHEMATA ( CATALOG_NAME INFORMATION_SCHEMA.SQL_IDENTIFIER, SCHEMA_NAME INFORMATION_SCHEMA.SQL_IDENTIFIER, SCHEMA_OWNER INFORMATION_SCHEMA.SQL_IDENTIFIER CONSTRA...
[ "SCHEMATA<p", ">" ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/dbinfo/DatabaseInformationFull.java#L4727-L4800
train
SCHEMATA - Table for Crazy - Telephony
Create a Java method that does the following: "SCHEMATA - Table for Crazy - Telephony".
Of course, here is the Java code you requested: ```java Table SCHEMATA() { Table t = sysTables[SCHEMATA]; if (t == null) { t = createBlankTable(sysTableHsqlNames[SCHEMATA]); addColumn(t, "CATALOG_NAME", SQL_IDENTIFIER); addColumn(t, "SCHEMA_NAME", SQL_IDENTIFIER);...
alkacon/opencms-core
src/org/opencms/workflow/CmsExtendedPublishResourceFormatter.java
CmsExtendedPublishResourceFormatter.isWorkflowProject
protected boolean isWorkflowProject(CmsUUID projectId) { try { return m_workflowProjectStatus.get(projectId).booleanValue(); } catch (Exception e) { LOG.error(e.getLocalizedMessage(), e); return false; } }
java
protected boolean isWorkflowProject(CmsUUID projectId) { try { return m_workflowProjectStatus.get(projectId).booleanValue(); } catch (Exception e) { LOG.error(e.getLocalizedMessage(), e); return false; } }
[ "protected", "boolean", "isWorkflowProject", "(", "CmsUUID", "projectId", ")", "{", "try", "{", "return", "m_workflowProjectStatus", ".", "get", "(", "projectId", ")", ".", "booleanValue", "(", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "LOG", ...
Checks whether the project with the given id is a workflow project.<p> @param projectId the project id @return true if the project with the given id is a workflow project
[ "Checks", "whether", "the", "project", "with", "the", "given", "id", "is", "a", "workflow", "project", ".", "<p", ">" ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/workflow/CmsExtendedPublishResourceFormatter.java#L199-L207
train
Checks if the given projectId is a workflow project.
Create a Java method that does the following: "Checks if the given projectId is a workflow project.".
Of course, here is the Java code you requested: ```java protected boolean isWorkflowProject(CmsUUID projectId) { try { return m_workflowProjectStatus.get(projectId).booleanValue(); } catch (Exception e) { LOG.error(e.getLocalizedMessage(), e); return false; ...
yan74/afplib
org.afplib/src/main/java/org/afplib/afplib/impl/AfplibFactoryImpl.java
AfplibFactoryImpl.createColorFidelityRepCoExFromString
public ColorFidelityRepCoEx createColorFidelityRepCoExFromString(EDataType eDataType, String initialValue) { ColorFidelityRepCoEx result = ColorFidelityRepCoEx.get(initialValue); if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getN...
java
public ColorFidelityRepCoEx createColorFidelityRepCoExFromString(EDataType eDataType, String initialValue) { ColorFidelityRepCoEx result = ColorFidelityRepCoEx.get(initialValue); if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getN...
[ "public", "ColorFidelityRepCoEx", "createColorFidelityRepCoExFromString", "(", "EDataType", "eDataType", ",", "String", "initialValue", ")", "{", "ColorFidelityRepCoEx", "result", "=", "ColorFidelityRepCoEx", ".", "get", "(", "initialValue", ")", ";", "if", "(", "result...
<!-- begin-user-doc --> <!-- end-user-doc --> @generated
[ "<!", "--", "begin", "-", "user", "-", "doc", "--", ">", "<!", "--", "end", "-", "user", "-", "doc", "--", ">" ]
9ff0513f9448bdf8c0b0e31dc4910c094c48fb2f
https://github.com/yan74/afplib/blob/9ff0513f9448bdf8c0b0e31dc4910c094c48fb2f/org.afplib/src/main/java/org/afplib/afplib/impl/AfplibFactoryImpl.java#L7788-L7792
train
Create a ColorFidelityRepCoEx object from a string representation of a ColorFidelityRepCoEx.
Create a Java method that does the following: "Create a ColorFidelityRepCoEx object from a string representation of a ColorFidelityRepCoEx.".
Of course, here is the Java code you requested: ```java public ColorFidelityRepCoEx createColorFidelityRepCoExFromString(EDataType eDataType, String initialValue) { ColorFidelityRepCoEx result = ColorFidelityRepCoEx.get(initialValue); if (result == null) throw new IllegalArgumentException("The value '" + initialVa...
google/closure-templates
java/src/com/google/template/soy/parsepasses/contextautoesc/Inferences.java
Inferences.setEscapingDirectives
public void setEscapingDirectives( SoyNode node, Context context, List<EscapingMode> escapingModes) { Preconditions.checkArgument( (node instanceof PrintNode) || (node instanceof CallNode) || (node instanceof MsgFallbackGroupNode), "Escaping directives may only be set f...
java
public void setEscapingDirectives( SoyNode node, Context context, List<EscapingMode> escapingModes) { Preconditions.checkArgument( (node instanceof PrintNode) || (node instanceof CallNode) || (node instanceof MsgFallbackGroupNode), "Escaping directives may only be set f...
[ "public", "void", "setEscapingDirectives", "(", "SoyNode", "node", ",", "Context", "context", ",", "List", "<", "EscapingMode", ">", "escapingModes", ")", "{", "Preconditions", ".", "checkArgument", "(", "(", "node", "instanceof", "PrintNode", ")", "||", "(", ...
Records inferred escaping modes so a directive can be later added to the Soy parse tree.
[ "Records", "inferred", "escaping", "modes", "so", "a", "directive", "can", "be", "later", "added", "to", "the", "Soy", "parse", "tree", "." ]
cc61e1dff70ae97f24f417a57410081bc498bd56
https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/parsepasses/contextautoesc/Inferences.java#L100-L111
train
Sets the escaping directives for a Soy node.
Create a Java method that does the following: "Sets the escaping directives for a Soy node.".
Of course, here is the Java code you requested: ```java public void setEscapingDirectives( SoyNode node, Context context, List<EscapingMode> escapingModes) { Preconditions.checkArgument( (node instanceof PrintNode) || (node instanceof CallNode) || (node instanceof MsgFallbackG...
GojaFramework/goja
goja-core/src/main/java/goja/core/Validator.java
Validator.match
public static boolean match(String regex, String value) { Pattern pattern = Pattern.compile(regex); return pattern.matcher(value).find(); }
java
public static boolean match(String regex, String value) { Pattern pattern = Pattern.compile(regex); return pattern.matcher(value).find(); }
[ "public", "static", "boolean", "match", "(", "String", "regex", ",", "String", "value", ")", "{", "Pattern", "pattern", "=", "Pattern", ".", "compile", "(", "regex", ")", ";", "return", "pattern", ".", "matcher", "(", "value", ")", ".", "find", "(", ")...
Matches the regular expression @param regex regex @param value value @return boolean
[ "Matches", "the", "regular", "expression" ]
77179b495f668fc1fa20accc912991df6bb2d917
https://github.com/GojaFramework/goja/blob/77179b495f668fc1fa20accc912991df6bb2d917/goja-core/src/main/java/goja/core/Validator.java#L31-L34
test
Match a string with a regular expression.
Create a Java method that does the following: "Match a string with a regular expression.".
Of course, here is the Java code you requested: ```java public static boolean match(String regex, String value) { Pattern pattern = Pattern.compile(regex); return pattern.matcher(value).find(); } ``` Hope this helps!
Stratio/stratio-cassandra
src/java/org/apache/cassandra/concurrent/SEPExecutor.java
SEPExecutor.maybeSchedule
boolean maybeSchedule() { if (pool.spinningCount.get() > 0 || !takeWorkPermit(true)) return false; pool.schedule(new Work(this)); return true; }
java
boolean maybeSchedule() { if (pool.spinningCount.get() > 0 || !takeWorkPermit(true)) return false; pool.schedule(new Work(this)); return true; }
[ "boolean", "maybeSchedule", "(", ")", "{", "if", "(", "pool", ".", "spinningCount", ".", "get", "(", ")", ">", "0", "||", "!", "takeWorkPermit", "(", "true", ")", ")", "return", "false", ";", "pool", ".", "schedule", "(", "new", "Work", "(", "this", ...
will self-assign to it in the immediate future
[ "will", "self", "-", "assign", "to", "it", "in", "the", "immediate", "future" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/concurrent/SEPExecutor.java#L71-L78
train
Schedule a new work for a single calendar.
Create a Java method that does the following: "Schedule a new work for a single calendar.".
Of course, here is the Java code you requested: ```java boolean maybeSchedule() { if (pool.spinningCount.get() > 0 || !takeWorkPermit(true)) return false; pool.schedule(new Work(this)); return true; } ``` Hope this helps!
aws/aws-sdk-java
aws-java-sdk-secretsmanager/src/main/java/com/amazonaws/services/secretsmanager/AWSSecretsManagerClient.java
AWSSecretsManagerClient.getRandomPassword
@Override public GetRandomPasswordResult getRandomPassword(GetRandomPasswordRequest request) { request = beforeClientExecution(request); return executeGetRandomPassword(request); }
java
@Override public GetRandomPasswordResult getRandomPassword(GetRandomPasswordRequest request) { request = beforeClientExecution(request); return executeGetRandomPassword(request); }
[ "@", "Override", "public", "GetRandomPasswordResult", "getRandomPassword", "(", "GetRandomPasswordRequest", "request", ")", "{", "request", "=", "beforeClientExecution", "(", "request", ")", ";", "return", "executeGetRandomPassword", "(", "request", ")", ";", "}" ]
<p> Generates a random password of the specified complexity. This operation is intended for use in the Lambda rotation function. Per best practice, we recommend that you specify the maximum length and include every character type that the system you are generating a password for can support. </p> <p> <b>Minimum permiss...
[ "<p", ">", "Generates", "a", "random", "password", "of", "the", "specified", "complexity", ".", "This", "operation", "is", "intended", "for", "use", "in", "the", "Lambda", "rotation", "function", ".", "Per", "best", "practice", "we", "recommend", "that", "yo...
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-secretsmanager/src/main/java/com/amazonaws/services/secretsmanager/AWSSecretsManagerClient.java#L954-L958
train
Returns a random password for an app.
Create a Java method that does the following: "Returns a random password for an app.".
Of course, here is the Java code you requested: ```java @Override public GetRandomPasswordResult getRandomPassword(GetRandomPasswordRequest request) { request = beforeClientExecution(request); return executeGetRandomPassword(request); } ``` Hope this helps!
lessthanoptimal/ejml
main/ejml-simple/src/org/ejml/simple/SimpleBase.java
SimpleBase.set
public void set( int row , int col , double real , double imaginary ) { if( imaginary == 0 ) { set(row,col,real); } else { ops.set(mat,row,col, real, imaginary); } }
java
public void set( int row , int col , double real , double imaginary ) { if( imaginary == 0 ) { set(row,col,real); } else { ops.set(mat,row,col, real, imaginary); } }
[ "public", "void", "set", "(", "int", "row", ",", "int", "col", ",", "double", "real", ",", "double", "imaginary", ")", "{", "if", "(", "imaginary", "==", "0", ")", "{", "set", "(", "row", ",", "col", ",", "real", ")", ";", "}", "else", "{", "op...
Used to set the complex value of a matrix element. @param row The row of the element. @param col The column of the element. @param real Real component of assigned value @param imaginary Imaginary component of assigned value
[ "Used", "to", "set", "the", "complex", "value", "of", "a", "matrix", "element", "." ]
1444680cc487af5e866730e62f48f5f9636850d9
https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-simple/src/org/ejml/simple/SimpleBase.java#L642-L648
train
Sets the value of the attribute.
Create a Java method that does the following: "Sets the value of the attribute.".
Of course, here is the Java code you requested: ```java public void set( int row , int col , double real , double imaginary ) { if( imaginary == 0 ) { set(row,col,real); } else { ops.set(mat,row,col, real, imaginary); } } ``` Hope this helps!
atomix/atomix
protocols/raft/src/main/java/io/atomix/protocols/raft/roles/AbstractAppender.java
AbstractAppender.sendAppendRequest
protected void sendAppendRequest(RaftMemberContext member, AppendRequest request) { // If this is a heartbeat message and a heartbeat is already in progress, skip the request. if (request.entries().isEmpty() && !member.canHeartbeat()) { return; } // Start the append to the member. member.star...
java
protected void sendAppendRequest(RaftMemberContext member, AppendRequest request) { // If this is a heartbeat message and a heartbeat is already in progress, skip the request. if (request.entries().isEmpty() && !member.canHeartbeat()) { return; } // Start the append to the member. member.star...
[ "protected", "void", "sendAppendRequest", "(", "RaftMemberContext", "member", ",", "AppendRequest", "request", ")", "{", "// If this is a heartbeat message and a heartbeat is already in progress, skip the request.", "if", "(", "request", ".", "entries", "(", ")", ".", "isEmpt...
Connects to the member and sends a commit message.
[ "Connects", "to", "the", "member", "and", "sends", "a", "commit", "message", "." ]
3a94b7c80576d762dd0d396d4645df07a0b37c31
https://github.com/atomix/atomix/blob/3a94b7c80576d762dd0d396d4645df07a0b37c31/protocols/raft/src/main/java/io/atomix/protocols/raft/roles/AbstractAppender.java#L160-L193
train
Sends an append request to the given member.
Create a Java method that does the following: "Sends an append request to the given member.".
Of course, here is the Java code you requested: ```java protected void sendAppendRequest(RaftMemberContext member, AppendRequest request) { // If this is a heartbeat message and a heartbeat is already in progress, skip the request. if (request.entries().isEmpty() && !member.canHeartbeat()) { return; ...
OpenLiberty/open-liberty
dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/internal/HttpChain.java
HttpChain.stop
@FFDCIgnore(InvalidRuntimeStateException.class) public synchronized void stop() { if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) { Tr.event(this, tc, "stop chain " + this); } // When the chain is being stopped, remove the previously // registered EndPoi...
java
@FFDCIgnore(InvalidRuntimeStateException.class) public synchronized void stop() { if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) { Tr.event(this, tc, "stop chain " + this); } // When the chain is being stopped, remove the previously // registered EndPoi...
[ "@", "FFDCIgnore", "(", "InvalidRuntimeStateException", ".", "class", ")", "public", "synchronized", "void", "stop", "(", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEventEnabled", "(", ")", ")", "{", "Tr"...
Stop this chain. The chain will have to be recreated when port is updated notification/follow-on of stop operation is in the chainStopped listener method.
[ "Stop", "this", "chain", ".", "The", "chain", "will", "have", "to", "be", "recreated", "when", "port", "is", "updated", "notification", "/", "follow", "-", "on", "of", "stop", "operation", "is", "in", "the", "chainStopped", "listener", "method", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/internal/HttpChain.java#L202-L242
train
Stop the chain.
Create a Java method that does the following: "Stop the chain.".
Of course, here is the Java code you requested: ```java @FFDCIgnore(InvalidRuntimeStateException.class) public synchronized void stop() { if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) { Tr.event(this, tc, "stop chain " + this); } // When the chain is being st...
VoltDB/voltdb
third_party/java/src/com/google_voltpatches/common/util/concurrent/ListenerCallQueue.java
ListenerCallQueue.execute
void execute() { boolean scheduleTaskRunner = false; synchronized (this) { if (!isThreadScheduled) { isThreadScheduled = true; scheduleTaskRunner = true; } } if (scheduleTaskRunner) { try { executor.execute(this); } catch (RuntimeException e) { // ...
java
void execute() { boolean scheduleTaskRunner = false; synchronized (this) { if (!isThreadScheduled) { isThreadScheduled = true; scheduleTaskRunner = true; } } if (scheduleTaskRunner) { try { executor.execute(this); } catch (RuntimeException e) { // ...
[ "void", "execute", "(", ")", "{", "boolean", "scheduleTaskRunner", "=", "false", ";", "synchronized", "(", "this", ")", "{", "if", "(", "!", "isThreadScheduled", ")", "{", "isThreadScheduled", "=", "true", ";", "scheduleTaskRunner", "=", "true", ";", "}", ...
Executes all listeners {@linkplain #add added} prior to this call, serially and in order.
[ "Executes", "all", "listeners", "{" ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/com/google_voltpatches/common/util/concurrent/ListenerCallQueue.java#L77-L101
train
Execute the thread.
Create a Java method that does the following: "Execute the thread.".
Of course, here is the Java code you requested: ```java void execute() { boolean scheduleTaskRunner = false; synchronized (this) { if (!isThreadScheduled) { isThreadScheduled = true; scheduleTaskRunner = true; } } if (scheduleTaskRunner) { try { executor.execut...
aws/aws-sdk-java
aws-java-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/TaskStatisticsMarshaller.java
TaskStatisticsMarshaller.marshall
public void marshall(TaskStatistics taskStatistics, ProtocolMarshaller protocolMarshaller) { if (taskStatistics == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(taskStatistics.getTotalChecks(), TOTA...
java
public void marshall(TaskStatistics taskStatistics, ProtocolMarshaller protocolMarshaller) { if (taskStatistics == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(taskStatistics.getTotalChecks(), TOTA...
[ "public", "void", "marshall", "(", "TaskStatistics", "taskStatistics", ",", "ProtocolMarshaller", "protocolMarshaller", ")", "{", "if", "(", "taskStatistics", "==", "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-iot/src/main/java/com/amazonaws/services/iot/model/transform/TaskStatisticsMarshaller.java#L54-L71
train
marshalls the given taskStatistics to the JSON object.
Create a Java method that does the following: "marshalls the given taskStatistics to the JSON object.".
Of course, here is the Java code you requested: ```java public void marshall(TaskStatistics taskStatistics, ProtocolMarshaller protocolMarshaller) { if (taskStatistics == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocol...
teatrove/teatrove
build-tools/toolbox/src/main/java/org/teatrove/toolbox/beandoc/teadoc/ClassDoc.java
ClassDoc.getQualifiedTypeNameForFile
public String getQualifiedTypeNameForFile() { String typeName = getTypeNameForFile(); String qualifiedTypeName = mDoc.qualifiedTypeName(); int packageLength = qualifiedTypeName.length() - typeName.length(); if (packageLength <= 0) { return typeName; } Strin...
java
public String getQualifiedTypeNameForFile() { String typeName = getTypeNameForFile(); String qualifiedTypeName = mDoc.qualifiedTypeName(); int packageLength = qualifiedTypeName.length() - typeName.length(); if (packageLength <= 0) { return typeName; } Strin...
[ "public", "String", "getQualifiedTypeNameForFile", "(", ")", "{", "String", "typeName", "=", "getTypeNameForFile", "(", ")", ";", "String", "qualifiedTypeName", "=", "mDoc", ".", "qualifiedTypeName", "(", ")", ";", "int", "packageLength", "=", "qualifiedTypeName", ...
Converts inner class names.
[ "Converts", "inner", "class", "names", "." ]
7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea
https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/build-tools/toolbox/src/main/java/org/teatrove/toolbox/beandoc/teadoc/ClassDoc.java#L201-L214
train
Gets the qualified type name for a class file.
Create a Java method that does the following: "Gets the qualified type name for a class file.".
Of course, here is the Java code you requested: ```java public String getQualifiedTypeNameForFile() { String typeName = getTypeNameForFile(); String qualifiedTypeName = mDoc.qualifiedTypeName(); int packageLength = qualifiedTypeName.length() - typeName.length(); if (packageLength <= 0...
OpenLiberty/open-liberty
dev/com.ibm.ws.wsoc/src/com/ibm/ws/wsoc/outbound/WsocChain.java
WsocChain.init
public void init(String chainId, ChannelFramework cfw) { tcpName = "TCP-" + chainId; sslName = "SSL-" + chainId; httpName = "HTTP-" + chainId; chainName = chainId; this.cfw = cfw; // If there is a chain that is in the CFW with this name, it was potentially // le...
java
public void init(String chainId, ChannelFramework cfw) { tcpName = "TCP-" + chainId; sslName = "SSL-" + chainId; httpName = "HTTP-" + chainId; chainName = chainId; this.cfw = cfw; // If there is a chain that is in the CFW with this name, it was potentially // le...
[ "public", "void", "init", "(", "String", "chainId", ",", "ChannelFramework", "cfw", ")", "{", "tcpName", "=", "\"TCP-\"", "+", "chainId", ";", "sslName", "=", "\"SSL-\"", "+", "chainId", ";", "httpName", "=", "\"HTTP-\"", "+", "chainId", ";", "chainName", ...
Initialize this chain manager: Channel and chain names shouldn't fluctuate as config changes, so come up with names associated with this set of channels/chains that will be reused regardless of start/stop/enable/disable/modify @param endpointId The id of the httpEndpoint @param cfw Channel framework
[ "Initialize", "this", "chain", "manager", ":", "Channel", "and", "chain", "names", "shouldn", "t", "fluctuate", "as", "config", "changes", "so", "come", "up", "with", "names", "associated", "with", "this", "set", "of", "channels", "/", "chains", "that", "wil...
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.wsoc/src/com/ibm/ws/wsoc/outbound/WsocChain.java#L84-L109
train
This method is called by the application to initialize the instance of the class.
Create a Java method that does the following: "This method is called by the application to initialize the instance of the class.".
Of course, here is the Java code you requested: ```java public void init(String chainId, ChannelFramework cfw) { tcpName = "TCP-" + chainId; sslName = "SSL-" + chainId; httpName = "HTTP-" + chainId; chainName = chainId; this.cfw = cfw; // If there is a chain that is in...
fabric8io/docker-maven-plugin
src/main/java/io/fabric8/maven/docker/service/RunService.java
RunService.execInContainer
public String execInContainer(String containerId, String command, ImageConfiguration imageConfiguration) throws DockerAccessException, ExecException { Arguments arguments = new Arguments(); arguments.setExec(Arrays.asList(EnvUtil.splitOnSpaceWithEscape(command))); String execContainerId ...
java
public String execInContainer(String containerId, String command, ImageConfiguration imageConfiguration) throws DockerAccessException, ExecException { Arguments arguments = new Arguments(); arguments.setExec(Arrays.asList(EnvUtil.splitOnSpaceWithEscape(command))); String execContainerId ...
[ "public", "String", "execInContainer", "(", "String", "containerId", ",", "String", "command", ",", "ImageConfiguration", "imageConfiguration", ")", "throws", "DockerAccessException", ",", "ExecException", "{", "Arguments", "arguments", "=", "new", "Arguments", "(", "...
Create and start a Exec container with the given image configuration. @param containerId container id to run exec command against @param command command to execute @param imageConfiguration configuration of the container's image @return the exec container id @throws DockerAccessException if access to the docker backen...
[ "Create", "and", "start", "a", "Exec", "container", "with", "the", "given", "image", "configuration", ".", "@param", "containerId", "container", "id", "to", "run", "exec", "command", "against", "@param", "command", "command", "to", "execute", "@param", "imageCon...
70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3
https://github.com/fabric8io/docker-maven-plugin/blob/70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3/src/main/java/io/fabric8/maven/docker/service/RunService.java#L108-L122
train
Execute command in container
Create a Java method that does the following: "Execute command in container".
Of course, here is the Java code you requested: ```java public String execInContainer(String containerId, String command, ImageConfiguration imageConfiguration) throws DockerAccessException, ExecException { Arguments arguments = new Arguments(); arguments.setExec(Arrays.asList(EnvUtil.splitOnSp...
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/PluralRulesLoader.java
PluralRulesLoader.forLocale
public PluralRules forLocale(ULocale locale, PluralRules.PluralType type) { String rulesId = getRulesIdForLocale(locale, type); if (rulesId == null || rulesId.trim().length() == 0) { return PluralRules.DEFAULT; } PluralRules rules = getRulesForRulesId(rulesId); if (ru...
java
public PluralRules forLocale(ULocale locale, PluralRules.PluralType type) { String rulesId = getRulesIdForLocale(locale, type); if (rulesId == null || rulesId.trim().length() == 0) { return PluralRules.DEFAULT; } PluralRules rules = getRulesForRulesId(rulesId); if (ru...
[ "public", "PluralRules", "forLocale", "(", "ULocale", "locale", ",", "PluralRules", ".", "PluralType", "type", ")", "{", "String", "rulesId", "=", "getRulesIdForLocale", "(", "locale", ",", "type", ")", ";", "if", "(", "rulesId", "==", "null", "||", "rulesId...
Returns the plural rules for the the locale. If we don't have data, android.icu.text.PluralRules.DEFAULT is returned.
[ "Returns", "the", "plural", "rules", "for", "the", "the", "locale", ".", "If", "we", "don", "t", "have", "data", "android", ".", "icu", ".", "text", ".", "PluralRules", ".", "DEFAULT", "is", "returned", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/PluralRulesLoader.java#L239-L249
train
Gets the PluralRules for the given locale and plural type.
Create a Java method that does the following: "Gets the PluralRules for the given locale and plural type.".
Of course, here is the Java code you requested: ```java public PluralRules forLocale(ULocale locale, PluralRules.PluralType type) { String rulesId = getRulesIdForLocale(locale, type); if (rulesId == null || rulesId.trim().length() == 0) { return PluralRules.DEFAULT; } Plural...
vibe-project/vibe-java-platform
bridge-vertx2/src/main/java/org/atmosphere/vibe/platform/bridge/vertx2/VertxServerWebSocket.java
VertxServerWebSocket.unwrap
@Override public <T> T unwrap(Class<T> clazz) { return org.vertx.java.core.http.ServerWebSocket.class.isAssignableFrom(clazz) ? clazz.cast(socket) : null; }
java
@Override public <T> T unwrap(Class<T> clazz) { return org.vertx.java.core.http.ServerWebSocket.class.isAssignableFrom(clazz) ? clazz.cast(socket) : null; }
[ "@", "Override", "public", "<", "T", ">", "T", "unwrap", "(", "Class", "<", "T", ">", "clazz", ")", "{", "return", "org", ".", "vertx", ".", "java", ".", "core", ".", "http", ".", "ServerWebSocket", ".", "class", ".", "isAssignableFrom", "(", "clazz"...
{@link org.vertx.java.core.http.ServerWebSocket} is available.
[ "{" ]
eb896fbea6fed3eea631a554cb0b4e961d32e5df
https://github.com/vibe-project/vibe-java-platform/blob/eb896fbea6fed3eea631a554cb0b4e961d32e5df/bridge-vertx2/src/main/java/org/atmosphere/vibe/platform/bridge/vertx2/VertxServerWebSocket.java#L93-L98
train
Unwrap a class.
Create a Java method that does the following: "Unwrap a class.".
Of course, here is the Java code you requested: ```java @Override public <T> T unwrap(Class<T> clazz) { return org.vertx.java.core.http.ServerWebSocket.class.isAssignableFrom(clazz) ? clazz.cast(socket) : null; } ``` Hope this helps!
Azure/azure-sdk-for-java
containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/WebhooksInner.java
WebhooksInner.createAsync
public ServiceFuture<WebhookInner> createAsync(String resourceGroupName, String registryName, String webhookName, WebhookCreateParameters webhookCreateParameters, final ServiceCallback<WebhookInner> serviceCallback) { return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, registryNa...
java
public ServiceFuture<WebhookInner> createAsync(String resourceGroupName, String registryName, String webhookName, WebhookCreateParameters webhookCreateParameters, final ServiceCallback<WebhookInner> serviceCallback) { return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, registryNa...
[ "public", "ServiceFuture", "<", "WebhookInner", ">", "createAsync", "(", "String", "resourceGroupName", ",", "String", "registryName", ",", "String", "webhookName", ",", "WebhookCreateParameters", "webhookCreateParameters", ",", "final", "ServiceCallback", "<", "WebhookIn...
Creates a webhook for a container registry with the specified parameters. @param resourceGroupName The name of the resource group to which the container registry belongs. @param registryName The name of the container registry. @param webhookName The name of the webhook. @param webhookCreateParameters The parameters fo...
[ "Creates", "a", "webhook", "for", "a", "container", "registry", "with", "the", "specified", "parameters", "." ]
aab183ddc6686c82ec10386d5a683d2691039626
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/WebhooksInner.java#L240-L242
train
Creates a new CDN image webhook.
Create a Java method that does the following: "Creates a new CDN image webhook.".
Of course, here is the Java code you requested: ```java public ServiceFuture<WebhookInner> createAsync(String resourceGroupName, String registryName, String webhookName, WebhookCreateParameters webhookCreateParameters, final ServiceCallback<WebhookInner> serviceCallback) { return ServiceFuture.fromResponse(cre...
legsem/legstar-core2
legstar-cob2xsd/src/main/java/com/legstar/cob2xsd/Cob2Xsd.java
Cob2Xsd.parse
public CommonTree parse(final CommonTokenStream tokens) throws RecognizerException { if (_log.isDebugEnabled()) { _log.debug("3. Parsing tokens: {}", tokens.toString()); } try { CobolStructureParser parser = new CobolStructureParserImpl(tokens, ...
java
public CommonTree parse(final CommonTokenStream tokens) throws RecognizerException { if (_log.isDebugEnabled()) { _log.debug("3. Parsing tokens: {}", tokens.toString()); } try { CobolStructureParser parser = new CobolStructureParserImpl(tokens, ...
[ "public", "CommonTree", "parse", "(", "final", "CommonTokenStream", "tokens", ")", "throws", "RecognizerException", "{", "if", "(", "_log", ".", "isDebugEnabled", "(", ")", ")", "{", "_log", ".", "debug", "(", "\"3. Parsing tokens: {}\"", ",", "tokens", ".", "...
Apply Parser to produce an abstract syntax tree from a token stream. @param tokens the stream token produced by lexer @return an antlr abstract syntax tree @throws RecognizerException if source contains unsupported statements
[ "Apply", "Parser", "to", "produce", "an", "abstract", "syntax", "tree", "from", "a", "token", "stream", "." ]
f74d25d5b2b21a2ebaaaf2162b3fb7138dca40c6
https://github.com/legsem/legstar-core2/blob/f74d25d5b2b21a2ebaaaf2162b3fb7138dca40c6/legstar-cob2xsd/src/main/java/com/legstar/cob2xsd/Cob2Xsd.java#L206-L225
train
Parses the input stream.
Create a Java method that does the following: "Parses the input stream.".
Of course, here is the Java code you requested: ```java public CommonTree parse(final CommonTokenStream tokens) throws RecognizerException { if (_log.isDebugEnabled()) { _log.debug("3. Parsing tokens: {}", tokens.toString()); } try { CobolStructureParser pars...
dkmfbk/knowledgestore
ks-server-hbase/src/main/java/eu/fbk/knowledgestore/datastore/hbase/utils/HBaseUtils.java
HBaseUtils.createDelete
@Override public Delete createDelete(URI id, String tableName) throws IOException { Delete del = null; HTable hTable = getTable(tableName); if (hTable != null) { del = new Delete(Bytes.toBytes(id.toString())); } return del; }
java
@Override public Delete createDelete(URI id, String tableName) throws IOException { Delete del = null; HTable hTable = getTable(tableName); if (hTable != null) { del = new Delete(Bytes.toBytes(id.toString())); } return del; }
[ "@", "Override", "public", "Delete", "createDelete", "(", "URI", "id", ",", "String", "tableName", ")", "throws", "IOException", "{", "Delete", "del", "=", "null", ";", "HTable", "hTable", "=", "getTable", "(", "tableName", ")", ";", "if", "(", "hTable", ...
Creates deletes for HBase tables @param record @param tableName @param conf @return @throws IOException
[ "Creates", "deletes", "for", "HBase", "tables" ]
a548101b1dd67fcf72a1ec6f838ea7539bdbbe7a
https://github.com/dkmfbk/knowledgestore/blob/a548101b1dd67fcf72a1ec6f838ea7539bdbbe7a/ks-server-hbase/src/main/java/eu/fbk/knowledgestore/datastore/hbase/utils/HBaseUtils.java#L210-L218
train
Create a delete object from the id and tableName.
Create a Java method that does the following: "Create a delete object from the id and tableName.".
Of course, here is the Java code you requested: ```java @Override public Delete createDelete(URI id, String tableName) throws IOException { Delete del = null; HTable hTable = getTable(tableName); if (hTable != null) { del = new Delete(Bytes.toBytes(id.toString())); } ...
MenoData/Time4J
base/src/main/java/net/time4j/tz/threeten/NegativeDayOfMonthPattern.java
NegativeDayOfMonthPattern.getDate0
@Override protected PlainDate getDate0(int year) { int month = this.getMonth().getValue(); int dayOfMonth = GregorianMath.getLengthOfMonth(year, month) + 1 + this.domIndicator; int ref = GregorianMath.getDayOfWeek(year, month, dayOfMonth); PlainDate result = PlainDate.of(year, month...
java
@Override protected PlainDate getDate0(int year) { int month = this.getMonth().getValue(); int dayOfMonth = GregorianMath.getLengthOfMonth(year, month) + 1 + this.domIndicator; int ref = GregorianMath.getDayOfWeek(year, month, dayOfMonth); PlainDate result = PlainDate.of(year, month...
[ "@", "Override", "protected", "PlainDate", "getDate0", "(", "int", "year", ")", "{", "int", "month", "=", "this", ".", "getMonth", "(", ")", ".", "getValue", "(", ")", ";", "int", "dayOfMonth", "=", "GregorianMath", ".", "getLengthOfMonth", "(", "year", ...
~ Methoden ----------------------------------------------------------
[ "~", "Methoden", "----------------------------------------------------------" ]
08b2eda6b2dbb140b92011cf7071bb087edd46a5
https://github.com/MenoData/Time4J/blob/08b2eda6b2dbb140b92011cf7071bb087edd46a5/base/src/main/java/net/time4j/tz/threeten/NegativeDayOfMonthPattern.java#L85-L105
train
Gets the date 0.
Create a Java method that does the following: "Gets the date 0.".
Of course, here is the Java code you requested: ```java @Override protected PlainDate getDate0(int year) { int month = this.getMonth().getValue(); int dayOfMonth = GregorianMath.getLengthOfMonth(year, month) + 1 + this.domIndicator; int ref = GregorianMath.getDayOfWeek(year, month, dayOfMo...
moparisthebest/beehive
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/tree/InheritableState.java
InheritableState.getImageRoot
public String getImageRoot() { if (_imageRoot != null) return _imageRoot; if (_parent != null) return _parent.getImageRoot(); return null; }
java
public String getImageRoot() { if (_imageRoot != null) return _imageRoot; if (_parent != null) return _parent.getImageRoot(); return null; }
[ "public", "String", "getImageRoot", "(", ")", "{", "if", "(", "_imageRoot", "!=", "null", ")", "return", "_imageRoot", ";", "if", "(", "_parent", "!=", "null", ")", "return", "_parent", ".", "getImageRoot", "(", ")", ";", "return", "null", ";", "}" ]
Return the default location of all images. It is used as the location for the tree structure images. @return String
[ "Return", "the", "default", "location", "of", "all", "images", ".", "It", "is", "used", "as", "the", "location", "for", "the", "tree", "structure", "images", "." ]
4246a0cc40ce3c05f1a02c2da2653ac622703d77
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/tree/InheritableState.java#L253-L260
train
Gets the imageRoot.
Create a Java method that does the following: "Gets the imageRoot.".
Of course, here is the Java code you requested: ```java public String getImageRoot() { if (_imageRoot != null) return _imageRoot; if (_parent != null) return _parent.getImageRoot(); return null; } ``` Hope this helps!
ThreeTen/threetenbp
src/main/java/org/threeten/bp/zone/TzdbZoneRulesCompiler.java
TzdbZoneRulesCompiler.outputHelp
private static void outputHelp() { System.out.println("Usage: TzdbZoneRulesCompiler <options> <tzdb source filenames>"); System.out.println("where options include:"); System.out.println(" -srcdir <directory> Where to find source directories (required)"); System.out.println(" -dstdi...
java
private static void outputHelp() { System.out.println("Usage: TzdbZoneRulesCompiler <options> <tzdb source filenames>"); System.out.println("where options include:"); System.out.println(" -srcdir <directory> Where to find source directories (required)"); System.out.println(" -dstdi...
[ "private", "static", "void", "outputHelp", "(", ")", "{", "System", ".", "out", ".", "println", "(", "\"Usage: TzdbZoneRulesCompiler <options> <tzdb source filenames>\"", ")", ";", "System", ".", "out", ".", "println", "(", "\"where options include:\"", ")", ";", "S...
Output usage text for the command line.
[ "Output", "usage", "text", "for", "the", "command", "line", "." ]
5f05b649f89f205aabd96b2f83c36796ec616fe6
https://github.com/ThreeTen/threetenbp/blob/5f05b649f89f205aabd96b2f83c36796ec616fe6/src/main/java/org/threeten/bp/zone/TzdbZoneRulesCompiler.java#L209-L224
train
Output help message
Create a Java method that does the following: "Output help message".
Of course, here is the Java code you requested: ```java private static void outputHelp() { System.out.println("Usage: TzdbZoneRulesCompiler <options> <tzdb source filenames>"); System.out.println("where options include:"); System.out.println(" -srcdir <directory> Where to find source direct...
fozziethebeat/S-Space
src/main/java/edu/ucla/sspace/common/Similarity.java
Similarity.cosineSimilarity
public static double cosineSimilarity(double[] a, double[] b) { check(a,b); double dotProduct = 0.0; double aMagnitude = 0.0; double bMagnitude = 0.0; for (int i = 0; i < b.length ; i++) { double aValue = a[i]; double bValue = b[i]; aMagnitude ...
java
public static double cosineSimilarity(double[] a, double[] b) { check(a,b); double dotProduct = 0.0; double aMagnitude = 0.0; double bMagnitude = 0.0; for (int i = 0; i < b.length ; i++) { double aValue = a[i]; double bValue = b[i]; aMagnitude ...
[ "public", "static", "double", "cosineSimilarity", "(", "double", "[", "]", "a", ",", "double", "[", "]", "b", ")", "{", "check", "(", "a", ",", "b", ")", ";", "double", "dotProduct", "=", "0.0", ";", "double", "aMagnitude", "=", "0.0", ";", "double",...
Returns the cosine similarity of the two arrays. @throws IllegalArgumentException when the length of the two vectors are not the same.
[ "Returns", "the", "cosine", "similarity", "of", "the", "two", "arrays", "." ]
a608102737dfd3d59038a9ead33fe60356bc6029
https://github.com/fozziethebeat/S-Space/blob/a608102737dfd3d59038a9ead33fe60356bc6029/src/main/java/edu/ucla/sspace/common/Similarity.java#L325-L342
train
Cosine similarity of two sets of doubles.
Create a Java method that does the following: "Cosine similarity of two sets of doubles.".
Of course, here is the Java code you requested: ```java public static double cosineSimilarity(double[] a, double[] b) { check(a,b); double dotProduct = 0.0; double aMagnitude = 0.0; double bMagnitude = 0.0; for (int i = 0; i < b.length ; i++) { double aValue = a[i]; ...
lunisolar/magma
magma-func-builder/src/main/java/eu/lunisolar/magma/func/build/std/UnaryOperatorBuilder.java
UnaryOperatorBuilder.unaryOperator
@Nonnull public static <T> UnaryOperatorBuilder<T> unaryOperator(Consumer<UnaryOperator<T>> consumer) { return new UnaryOperatorBuilder(consumer); }
java
@Nonnull public static <T> UnaryOperatorBuilder<T> unaryOperator(Consumer<UnaryOperator<T>> consumer) { return new UnaryOperatorBuilder(consumer); }
[ "@", "Nonnull", "public", "static", "<", "T", ">", "UnaryOperatorBuilder", "<", "T", ">", "unaryOperator", "(", "Consumer", "<", "UnaryOperator", "<", "T", ">", ">", "consumer", ")", "{", "return", "new", "UnaryOperatorBuilder", "(", "consumer", ")", ";", ...
One of ways of creating builder. This might be the only way (considering all _functional_ builders) that might be utilize to specify generic params only once.
[ "One", "of", "ways", "of", "creating", "builder", ".", "This", "might", "be", "the", "only", "way", "(", "considering", "all", "_functional_", "builders", ")", "that", "might", "be", "utilize", "to", "specify", "generic", "params", "only", "once", "." ]
83809c6d1a33d913aec6c49920251e4f0be8b213
https://github.com/lunisolar/magma/blob/83809c6d1a33d913aec6c49920251e4f0be8b213/magma-func-builder/src/main/java/eu/lunisolar/magma/func/build/std/UnaryOperatorBuilder.java#L90-L93
train
Create a new UnaryOperatorBuilder.
Create a Java method that does the following: "Create a new UnaryOperatorBuilder.".
Of course, here is the Java code you requested: ```java @Nonnull public static <T> UnaryOperatorBuilder<T> unaryOperator(Consumer<UnaryOperator<T>> consumer) { return new UnaryOperatorBuilder(consumer); } ``` Hope this helps!
opentelecoms-org/zrtp-java
src/zorg/SRTP.java
SRTP.setRxMasterKey
public boolean setRxMasterKey(byte[] key) { boolean res = false; if ((key.length == MASTER_KEY_SIZE_32_BYTES) || (key.length == MASTER_KEY_SIZE_16_BYTES)) { rxMasterKey = null; rxMasterKey = platform.getUtils().copy(key); res = true; logDebug("setRxMasterKey " + platform.getUtils().byteToHexStr...
java
public boolean setRxMasterKey(byte[] key) { boolean res = false; if ((key.length == MASTER_KEY_SIZE_32_BYTES) || (key.length == MASTER_KEY_SIZE_16_BYTES)) { rxMasterKey = null; rxMasterKey = platform.getUtils().copy(key); res = true; logDebug("setRxMasterKey " + platform.getUtils().byteToHexStr...
[ "public", "boolean", "setRxMasterKey", "(", "byte", "[", "]", "key", ")", "{", "boolean", "res", "=", "false", ";", "if", "(", "(", "key", ".", "length", "==", "MASTER_KEY_SIZE_32_BYTES", ")", "||", "(", "key", ".", "length", "==", "MASTER_KEY_SIZE_16_BYTE...
Sets the Master Key to be used for generating the Receive session keys (only 256 bit keys supported - see PrivateGSM Tech Spec, 5.4.3) @param key Master Key string @return true if successfully set, false otherwise (invalid key length)
[ "Sets", "the", "Master", "Key", "to", "be", "used", "for", "generating", "the", "Receive", "session", "keys", "(", "only", "256", "bit", "keys", "supported", "-", "see", "PrivateGSM", "Tech", "Spec", "5", ".", "4", ".", "3", ")" ]
10a0c77866c5d1b1504df161db9a447f5069ed54
https://github.com/opentelecoms-org/zrtp-java/blob/10a0c77866c5d1b1504df161db9a447f5069ed54/src/zorg/SRTP.java#L682-L695
train
Set the RX master key.
Create a Java method that does the following: "Set the RX master key.".
Of course, here is the Java code you requested: ```java public boolean setRxMasterKey(byte[] key) { boolean res = false; if ((key.length == MASTER_KEY_SIZE_32_BYTES) || (key.length == MASTER_KEY_SIZE_16_BYTES)) { rxMasterKey = null; rxMasterKey = platform.getUtils().copy(key); res = true; logDebug(...
OpenLiberty/open-liberty
dev/com.ibm.ws.recoverylog/src/com/ibm/ws/recoverylog/spi/RecoverableUnitSectionImpl.java
RecoverableUnitSectionImpl.data
public LogCursor data() throws InternalLogException { if (tc.isEntryEnabled()) Tr.entry(tc, "data", this); // If the parent recovery log instance has experienced a serious internal error then prevent // this operation from executing. if (_recLog.failed()) { if (tc.isEntryEnabled()) Tr.exit(...
java
public LogCursor data() throws InternalLogException { if (tc.isEntryEnabled()) Tr.entry(tc, "data", this); // If the parent recovery log instance has experienced a serious internal error then prevent // this operation from executing. if (_recLog.failed()) { if (tc.isEntryEnabled()) Tr.exit(...
[ "public", "LogCursor", "data", "(", ")", "throws", "InternalLogException", "{", "if", "(", "tc", ".", "isEntryEnabled", "(", ")", ")", "Tr", ".", "entry", "(", "tc", ",", "\"data\"", ",", "this", ")", ";", "// If the parent recovery log instance has experienced ...
<p> Returns a LogCursor that can be used to itterate through all data contained by this recoverable unit section (both unwritten and written). The byte arrays will be returned in that they were added (ie FIFO) </p> <p> The LogCursor must be closed when it is no longer needed or its itteration is complete. (See the Log...
[ "<p", ">", "Returns", "a", "LogCursor", "that", "can", "be", "used", "to", "itterate", "through", "all", "data", "contained", "by", "this", "recoverable", "unit", "section", "(", "both", "unwritten", "and", "written", ")", ".", "The", "byte", "arrays", "wi...
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.recoverylog/src/com/ibm/ws/recoverylog/spi/RecoverableUnitSectionImpl.java#L744-L811
train
Returns the data of this RecoverableUnitSection.
Create a Java method that does the following: "Returns the data of this RecoverableUnitSection.".
Of course, here is the Java code you requested: ```java public LogCursor data() throws InternalLogException { if (tc.isEntryEnabled()) Tr.entry(tc, "data", this); // If the parent recovery log instance has experienced a serious internal error then prevent // this operation from executing. if (_recLo...