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
dmak/jaxb-xew-plugin
src/main/java/com/sun/tools/xjc/addon/xew/CommonUtils.java
CommonUtils.isListedAsParametrisation
public static boolean isListedAsParametrisation(JClass classToCheck, JType type) { return type instanceof JClass && ((JClass) type).getTypeParameters().contains(classToCheck); }
java
public static boolean isListedAsParametrisation(JClass classToCheck, JType type) { return type instanceof JClass && ((JClass) type).getTypeParameters().contains(classToCheck); }
[ "public", "static", "boolean", "isListedAsParametrisation", "(", "JClass", "classToCheck", ",", "JType", "type", ")", "{", "return", "type", "instanceof", "JClass", "&&", "(", "(", "JClass", ")", "type", ")", ".", "getTypeParameters", "(", ")", ".", "contains"...
Returns <code>true</code> of the given <code>type</code> is {@link JClass} and contains <code>classToCheck</code> in the list of parametrisations.
[ "Returns", "<code", ">", "true<", "/", "code", ">", "of", "the", "given", "<code", ">", "type<", "/", "code", ">", "is", "{" ]
d564d6bf8e50c46b056cdb4b46d1d4bee4adfbe3
https://github.com/dmak/jaxb-xew-plugin/blob/d564d6bf8e50c46b056cdb4b46d1d4bee4adfbe3/src/main/java/com/sun/tools/xjc/addon/xew/CommonUtils.java#L49-L51
train
Checks if the type is a listed as parameter.
Create a Java method that does the following: "Checks if the type is a listed as parameter.".
Of course, here is the Java code you requested: ```java public static boolean isListedAsParametrisation(JClass classToCheck, JType type) { return type instanceof JClass && ((JClass) type).getTypeParameters().contains(classToCheck); } ``` Hope this helps!
sshtools/j2ssh-maverick
j2ssh-maverick/src/main/java/com/sshtools/ssh/components/SshKeyPair.java
SshKeyPair.getKeyPair
public static SshKeyPair getKeyPair(SshPrivateKey prv, SshPublicKey pub) { SshKeyPair pair = new SshKeyPair(); pair.publickey = pub; pair.privatekey = prv; return pair; }
java
public static SshKeyPair getKeyPair(SshPrivateKey prv, SshPublicKey pub) { SshKeyPair pair = new SshKeyPair(); pair.publickey = pub; pair.privatekey = prv; return pair; }
[ "public", "static", "SshKeyPair", "getKeyPair", "(", "SshPrivateKey", "prv", ",", "SshPublicKey", "pub", ")", "{", "SshKeyPair", "pair", "=", "new", "SshKeyPair", "(", ")", ";", "pair", ".", "publickey", "=", "pub", ";", "pair", ".", "privatekey", "=", "pr...
Wraps a public/private key pair into an SshKeyPair instance. @param prv @param pub @return SshKeyPair
[ "Wraps", "a", "public", "/", "private", "key", "pair", "into", "an", "SshKeyPair", "instance", "." ]
ce11ceaf0aa0b129b54327a6891973e1e34689f7
https://github.com/sshtools/j2ssh-maverick/blob/ce11ceaf0aa0b129b54327a6891973e1e34689f7/j2ssh-maverick/src/main/java/com/sshtools/ssh/components/SshKeyPair.java#L57-L62
train
Get a new SshKeyPair object with the specified private key and public key.
Create a Java method that does the following: "Get a new SshKeyPair object with the specified private key and public key.".
Of course, here is the Java code you requested: ```java public static SshKeyPair getKeyPair(SshPrivateKey prv, SshPublicKey pub) { SshKeyPair pair = new SshKeyPair(); pair.publickey = pub; pair.privatekey = prv; return pair; } ``` Hope this helps!
jMetal/jMetal
jmetal-core/src/main/java/org/uma/jmetal/operator/impl/localsearch/BasicLocalSearch.java
BasicLocalSearch.execute
@SuppressWarnings("unchecked") public S execute(S solution) { int best; evaluations = 0; numberOfNonComparableSolutions = 0; int rounds = improvementRounds; int i = 0; while (i < rounds) { S mutatedSolution = mutationOperator.execute((S) solution.copy()); problem.evaluate(mutate...
java
@SuppressWarnings("unchecked") public S execute(S solution) { int best; evaluations = 0; numberOfNonComparableSolutions = 0; int rounds = improvementRounds; int i = 0; while (i < rounds) { S mutatedSolution = mutationOperator.execute((S) solution.copy()); problem.evaluate(mutate...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "S", "execute", "(", "S", "solution", ")", "{", "int", "best", ";", "evaluations", "=", "0", ";", "numberOfNonComparableSolutions", "=", "0", ";", "int", "rounds", "=", "improvementRounds", ";", "...
Executes the local search. @param solution The solution to improve @return An improved solution
[ "Executes", "the", "local", "search", "." ]
bc981e6aede275d26c5216c9a01227d9675b0cf7
https://github.com/jMetal/jMetal/blob/bc981e6aede275d26c5216c9a01227d9675b0cf7/jmetal-core/src/main/java/org/uma/jmetal/operator/impl/localsearch/BasicLocalSearch.java#L76-L114
train
Execute the CDI mutation operator.
Create a Java method that does the following: "Execute the CDI mutation operator.".
Of course, here is the Java code you requested: ```java @SuppressWarnings("unchecked") public S execute(S solution) { int best; evaluations = 0; numberOfNonComparableSolutions = 0; int rounds = improvementRounds; int i = 0; while (i < rounds) { S mutatedSolution = mutationOperator.exe...
sitoolkit/sit-wt-all
sit-wt-runtime/src/main/java/io/sitoolkit/wt/app/selenium2script/Selenium2Script.java
Selenium2Script.parse
private Document parse(File file) { try { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = factory.newDocumentBuilder(); builder.setEntityResolver(new EntityResolver() { @Override public Inp...
java
private Document parse(File file) { try { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = factory.newDocumentBuilder(); builder.setEntityResolver(new EntityResolver() { @Override public Inp...
[ "private", "Document", "parse", "(", "File", "file", ")", "{", "try", "{", "DocumentBuilderFactory", "factory", "=", "DocumentBuilderFactory", ".", "newInstance", "(", ")", ";", "DocumentBuilder", "builder", "=", "factory", ".", "newDocumentBuilder", "(", ")", "...
XMLファイルを読み込んでDOMにパースします。 @param file XMLファイル @return DOM
[ "XMLファイルを読み込んでDOMにパースします。" ]
efabde27aa731a5602d2041e137721a22f4fd27a
https://github.com/sitoolkit/sit-wt-all/blob/efabde27aa731a5602d2041e137721a22f4fd27a/sit-wt-runtime/src/main/java/io/sitoolkit/wt/app/selenium2script/Selenium2Script.java#L198-L214
train
Parse a file containing a alternative.
Create a Java method that does the following: "Parse a file containing a alternative.".
Of course, here is the Java code you requested: ```java private Document parse(File file) { try { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = factory.newDocumentBuilder(); builder.setEntityResolver(new EntityResolver()...
baidubce/bce-sdk-java
src/main/java/com/baidubce/services/ocr/OcrClient.java
OcrClient.idcardRecognition
public IdcardRecognitionResponse idcardRecognition(String image, String side, Boolean direction) { IdcardRecognitionRequest request = new IdcardRecognitionRequest().withImage(image) .withSide(side).withDirection(direction); return idcardRecognition(request); ...
java
public IdcardRecognitionResponse idcardRecognition(String image, String side, Boolean direction) { IdcardRecognitionRequest request = new IdcardRecognitionRequest().withImage(image) .withSide(side).withDirection(direction); return idcardRecognition(request); ...
[ "public", "IdcardRecognitionResponse", "idcardRecognition", "(", "String", "image", ",", "String", "side", ",", "Boolean", "direction", ")", "{", "IdcardRecognitionRequest", "request", "=", "new", "IdcardRecognitionRequest", "(", ")", ".", "withImage", "(", "image", ...
Gets the idcard recognition properties of specific image resource. <p> The caller <i>must</i> authenticate with a valid BCE Access Key / Private Key pair. @param image The image data which needs to be base64 @param side The side of idcard image. (front/back) @param direction Decide if the image has been rotated (true...
[ "Gets", "the", "idcard", "recognition", "properties", "of", "specific", "image", "resource", "." ]
f7140f28dd82121515c88ded7bfe769a37d0ec4a
https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/ocr/OcrClient.java#L139-L143
train
Perform a Idcard Recognition operation on the AZS3 server.
Create a Java method that does the following: "Perform a Idcard Recognition operation on the AZS3 server.".
Of course, here is the Java code you requested: ```java public IdcardRecognitionResponse idcardRecognition(String image, String side, Boolean direction) { IdcardRecognitionRequest request = new IdcardRecognitionRequest().withImage(image) .withSide(side).withDirection...
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/BusHandler.java
BusHandler.isForeignBus
public boolean isForeignBus() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "isForeignBus"); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "isForeignBus",Boolean.TRUE); return true; }
java
public boolean isForeignBus() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "isForeignBus"); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "isForeignBus",Boolean.TRUE); return true; }
[ "public", "boolean", "isForeignBus", "(", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"isForeignBus\"", ")", ";", "if", "(", "Trac...
/* (non-Javadoc) @see com.ibm.ws.sib.processor.impl.interfaces.DestinationHandler#isForeignBus()
[ "/", "*", "(", "non", "-", "Javadoc", ")" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/BusHandler.java#L772-L781
train
Is the target bus a foreign bus?
Create a Java method that does the following: "Is the target bus a foreign bus?".
Of course, here is the Java code you requested: ```java public boolean isForeignBus() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "isForeignBus"); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "isForeignBus",Boolean.TRUE); ...
jimmoores/quandl4j
core/src/main/java/com/jimmoores/quandl/Row.java
Row.getLocalDate
public LocalDate getLocalDate(final String column) { int index = _headerDefinition.columnIndex(column); return getLocalDate(index); }
java
public LocalDate getLocalDate(final String column) { int index = _headerDefinition.columnIndex(column); return getLocalDate(index); }
[ "public", "LocalDate", "getLocalDate", "(", "final", "String", "column", ")", "{", "int", "index", "=", "_headerDefinition", ".", "columnIndex", "(", "column", ")", ";", "return", "getLocalDate", "(", "index", ")", ";", "}" ]
Returns an entry from a given column name as a LocalDate (possibly null). Throws an IllegalArgumentException if the name is not defined in the header definition. Throws a DateTimeParseException if the underlying data is not a date in ISO local date format (YYYY-MM-DD). @param column the column name of the entry, not n...
[ "Returns", "an", "entry", "from", "a", "given", "column", "name", "as", "a", "LocalDate", "(", "possibly", "null", ")", ".", "Throws", "an", "IllegalArgumentException", "if", "the", "name", "is", "not", "defined", "in", "the", "header", "definition", ".", ...
5d67ae60279d889da93ae7aa3bf6b7d536f88822
https://github.com/jimmoores/quandl4j/blob/5d67ae60279d889da93ae7aa3bf6b7d536f88822/core/src/main/java/com/jimmoores/quandl/Row.java#L92-L95
train
Gets the local date of the specified column.
Create a Java method that does the following: "Gets the local date of the specified column.".
Of course, here is the Java code you requested: ```java public LocalDate getLocalDate(final String column) { int index = _headerDefinition.columnIndex(column); return getLocalDate(index); } ``` Hope this helps!
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.api/src/main/java/de/tudarmstadt/ukp/wikipedia/util/OS.java
OS.getOsType
public static String getOsType() { String osType = "unknown"; String osName = System.getProperty("os.name"); if (osName.contains("Windows")) { osType = "Windows"; } else if (osName.contains("Linux")) { osType = "Linux"; } return osType; ...
java
public static String getOsType() { String osType = "unknown"; String osName = System.getProperty("os.name"); if (osName.contains("Windows")) { osType = "Windows"; } else if (osName.contains("Linux")) { osType = "Linux"; } return osType; ...
[ "public", "static", "String", "getOsType", "(", ")", "{", "String", "osType", "=", "\"unknown\"", ";", "String", "osName", "=", "System", ".", "getProperty", "(", "\"os.name\"", ")", ";", "if", "(", "osName", ".", "contains", "(", "\"Windows\"", ")", ")", ...
Tries to determine the tpye of OS the application is running on. At the moment only Windows and Linux are supported. @return The type of OS the application is running on. Or "unknown" if the system is unknown.
[ "Tries", "to", "determine", "the", "tpye", "of", "OS", "the", "application", "is", "running", "on", ".", "At", "the", "moment", "only", "Windows", "and", "Linux", "are", "supported", "." ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.api/src/main/java/de/tudarmstadt/ukp/wikipedia/util/OS.java#L26-L36
train
Get the OS type.
Create a Java method that does the following: "Get the OS type.".
Of course, here is the Java code you requested: ```java public static String getOsType() { String osType = "unknown"; String osName = System.getProperty("os.name"); if (osName.contains("Windows")) { osType = "Windows"; } else if (osName.contains("Linux")) { ...
seancfoley/IPAddress
IPAddress/src/inet.ipaddr/inet/ipaddr/mac/MACAddressSection.java
MACAddressSection.iterator
protected Iterator<MACAddress> iterator(MACAddress original) { MACAddressCreator creator = getAddressCreator(); boolean isSingle = !isMultiple(); return iterator( isSingle ? original : null, creator,//using a lambda for this one results in a big performance hit isSingle ? null : segmentsIterato...
java
protected Iterator<MACAddress> iterator(MACAddress original) { MACAddressCreator creator = getAddressCreator(); boolean isSingle = !isMultiple(); return iterator( isSingle ? original : null, creator,//using a lambda for this one results in a big performance hit isSingle ? null : segmentsIterato...
[ "protected", "Iterator", "<", "MACAddress", ">", "iterator", "(", "MACAddress", "original", ")", "{", "MACAddressCreator", "creator", "=", "getAddressCreator", "(", ")", ";", "boolean", "isSingle", "=", "!", "isMultiple", "(", ")", ";", "return", "iterator", "...
these are the iterators used by MACAddress
[ "these", "are", "the", "iterators", "used", "by", "MACAddress" ]
90493d0673511d673100c36d020dd93dd870111a
https://github.com/seancfoley/IPAddress/blob/90493d0673511d673100c36d020dd93dd870111a/IPAddress/src/inet.ipaddr/inet/ipaddr/mac/MACAddressSection.java#L1204-L1212
train
Returns an iterator over the MAC addresses in the given order.
Create a Java method that does the following: "Returns an iterator over the MAC addresses in the given order.".
Of course, here is the Java code you requested: ```java protected Iterator<MACAddress> iterator(MACAddress original) { MACAddressCreator creator = getAddressCreator(); boolean isSingle = !isMultiple(); return iterator( isSingle ? original : null, creator,//using a lambda for this one results in a b...
kochedykov/jlibmodbus
src/com/intelligt/modbus/jlibmodbus/master/ModbusMaster.java
ModbusMaster.writeSingleCoil
final public void writeSingleCoil(int serverAddress, int startAddress, boolean flag) throws ModbusProtocolException, ModbusNumberException, ModbusIOException { processRequest(ModbusRequestBuilder.getInstance().buildWriteSingleCoil(serverAddress, startAddress, flag)); }
java
final public void writeSingleCoil(int serverAddress, int startAddress, boolean flag) throws ModbusProtocolException, ModbusNumberException, ModbusIOException { processRequest(ModbusRequestBuilder.getInstance().buildWriteSingleCoil(serverAddress, startAddress, flag)); }
[ "final", "public", "void", "writeSingleCoil", "(", "int", "serverAddress", ",", "int", "startAddress", ",", "boolean", "flag", ")", "throws", "ModbusProtocolException", ",", "ModbusNumberException", ",", "ModbusIOException", "{", "processRequest", "(", "ModbusRequestBui...
This function code is used to write a single output to either ON or OFF in a remote device. The requested ON/OFF state is specified by a constant in the request data field. A value of TRUE requests the output to be ON. A value of FALSE requests it to be OFF. The Request PDU specifies the address of the coil to be force...
[ "This", "function", "code", "is", "used", "to", "write", "a", "single", "output", "to", "either", "ON", "or", "OFF", "in", "a", "remote", "device", ".", "The", "requested", "ON", "/", "OFF", "state", "is", "specified", "by", "a", "constant", "in", "the...
197cb39e2649e61a6fe3cb7dc91a701d847e14be
https://github.com/kochedykov/jlibmodbus/blob/197cb39e2649e61a6fe3cb7dc91a701d847e14be/src/com/intelligt/modbus/jlibmodbus/master/ModbusMaster.java#L283-L286
train
This function code is used to write a single Coil to a slave.
Create a Java method that does the following: "This function code is used to write a single Coil to a slave.".
Of course, here is the Java code you requested: ```java final public void writeSingleCoil(int serverAddress, int startAddress, boolean flag) throws ModbusProtocolException, ModbusNumberException, ModbusIOException { processRequest(ModbusRequestBuilder.getInstance().buildWriteSingleCoil(serverAddres...
micrometer-metrics/micrometer
micrometer-core/src/main/java/io/micrometer/core/instrument/MeterRegistry.java
MeterRegistry.counter
Counter counter(Meter.Id id) { return registerMeterIfNecessary(Counter.class, id, this::newCounter, NoopCounter::new); }
java
Counter counter(Meter.Id id) { return registerMeterIfNecessary(Counter.class, id, this::newCounter, NoopCounter::new); }
[ "Counter", "counter", "(", "Meter", ".", "Id", "id", ")", "{", "return", "registerMeterIfNecessary", "(", "Counter", ".", "class", ",", "id", ",", "this", "::", "newCounter", ",", "NoopCounter", "::", "new", ")", ";", "}" ]
Only used by {@link Counter#builder(String)}. @param id The identifier for this counter. @return A new or existing counter.
[ "Only", "used", "by", "{", "@link", "Counter#builder", "(", "String", ")", "}", "." ]
127fa3265325cc894f368312ed8890b76a055d88
https://github.com/micrometer-metrics/micrometer/blob/127fa3265325cc894f368312ed8890b76a055d88/micrometer-core/src/main/java/io/micrometer/core/instrument/MeterRegistry.java#L244-L246
train
Register a counter.
Create a Java method that does the following: "Register a counter.".
Of course, here is the Java code you requested: ```java Counter counter(Meter.Id id) { return registerMeterIfNecessary(Counter.class, id, this::newCounter, NoopCounter::new); } ``` Hope this helps!
liferay/com-liferay-commerce
commerce-tax-engine-fixed-service/src/main/java/com/liferay/commerce/tax/engine/fixed/service/persistence/impl/CommerceTaxFixedRateAddressRelPersistenceImpl.java
CommerceTaxFixedRateAddressRelPersistenceImpl.findByCPTaxCategoryId
@Override public List<CommerceTaxFixedRateAddressRel> findByCPTaxCategoryId( long CPTaxCategoryId) { return findByCPTaxCategoryId(CPTaxCategoryId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null); }
java
@Override public List<CommerceTaxFixedRateAddressRel> findByCPTaxCategoryId( long CPTaxCategoryId) { return findByCPTaxCategoryId(CPTaxCategoryId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null); }
[ "@", "Override", "public", "List", "<", "CommerceTaxFixedRateAddressRel", ">", "findByCPTaxCategoryId", "(", "long", "CPTaxCategoryId", ")", "{", "return", "findByCPTaxCategoryId", "(", "CPTaxCategoryId", ",", "QueryUtil", ".", "ALL_POS", ",", "QueryUtil", ".", "ALL_P...
Returns all the commerce tax fixed rate address rels where CPTaxCategoryId = &#63;. @param CPTaxCategoryId the cp tax category ID @return the matching commerce tax fixed rate address rels
[ "Returns", "all", "the", "commerce", "tax", "fixed", "rate", "address", "rels", "where", "CPTaxCategoryId", "=", "&#63", ";", "." ]
9e54362d7f59531fc684016ba49ee7cdc3a2f22b
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-tax-engine-fixed-service/src/main/java/com/liferay/commerce/tax/engine/fixed/service/persistence/impl/CommerceTaxFixedRateAddressRelPersistenceImpl.java#L656-L661
train
Returns all the commerce tax fixed rate address rels where CPTaxCategoryId = &#63 ;.
Create a Java method that does the following: "Returns all the commerce tax fixed rate address rels where CPTaxCategoryId = &#63 ;.".
Of course, here is the Java code you requested: ```java @Override public List<CommerceTaxFixedRateAddressRel> findByCPTaxCategoryId( long CPTaxCategoryId) { return findByCPTaxCategoryId(CPTaxCategoryId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null); } ``` Hope this helps!
google/closure-templates
java/src/com/google/template/soy/jssrc/dsl/SoyJsPluginUtils.java
SoyJsPluginUtils.genJsExprUsingSoySyntax
public static JsExpr genJsExprUsingSoySyntax(Operator op, List<JsExpr> operandJsExprs) { List<Expression> operands = Lists.transform(operandJsExprs, input -> fromExpr(input, ImmutableList.<GoogRequire>of())); return Expression.operation(op, operands).assertExpr(); }
java
public static JsExpr genJsExprUsingSoySyntax(Operator op, List<JsExpr> operandJsExprs) { List<Expression> operands = Lists.transform(operandJsExprs, input -> fromExpr(input, ImmutableList.<GoogRequire>of())); return Expression.operation(op, operands).assertExpr(); }
[ "public", "static", "JsExpr", "genJsExprUsingSoySyntax", "(", "Operator", "op", ",", "List", "<", "JsExpr", ">", "operandJsExprs", ")", "{", "List", "<", "Expression", ">", "operands", "=", "Lists", ".", "transform", "(", "operandJsExprs", ",", "input", "->", ...
Generates a JS expression for the given operator and operands.
[ "Generates", "a", "JS", "expression", "for", "the", "given", "operator", "and", "operands", "." ]
cc61e1dff70ae97f24f417a57410081bc498bd56
https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/jssrc/dsl/SoyJsPluginUtils.java#L57-L61
train
Generate a JsExpr using Soy syntax.
Create a Java method that does the following: "Generate a JsExpr using Soy syntax.".
Of course, here is the Java code you requested: ```java public static JsExpr genJsExprUsingSoySyntax(Operator op, List<JsExpr> operandJsExprs) { List<Expression> operands = Lists.transform(operandJsExprs, input -> fromExpr(input, ImmutableList.<GoogRequire>of())); return Expression.operation(op, operan...
UrielCh/ovh-java-sdk
ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java
ApiOvhCloud.price_GET
public OvhPrice price_GET(String flavorId, String region) throws IOException { String qPath = "/cloud/price"; StringBuilder sb = path(qPath); query(sb, "flavorId", flavorId); query(sb, "region", region); String resp = exec(qPath, "GET", sb.toString(), null); return convertTo(resp, OvhPrice.class); }
java
public OvhPrice price_GET(String flavorId, String region) throws IOException { String qPath = "/cloud/price"; StringBuilder sb = path(qPath); query(sb, "flavorId", flavorId); query(sb, "region", region); String resp = exec(qPath, "GET", sb.toString(), null); return convertTo(resp, OvhPrice.class); }
[ "public", "OvhPrice", "price_GET", "(", "String", "flavorId", ",", "String", "region", ")", "throws", "IOException", "{", "String", "qPath", "=", "\"/cloud/price\"", ";", "StringBuilder", "sb", "=", "path", "(", "qPath", ")", ";", "query", "(", "sb", ",", ...
Get services prices REST: GET /cloud/price @param region [required] Region @param flavorId [required] OVH cloud flavor id @deprecated
[ "Get", "services", "prices" ]
6d531a40e56e09701943e334c25f90f640c55701
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java#L2388-L2395
train
Get the price of a cloud
Create a Java method that does the following: "Get the price of a cloud".
Of course, here is the Java code you requested: ```java public OvhPrice price_GET(String flavorId, String region) throws IOException { String qPath = "/cloud/price"; StringBuilder sb = path(qPath); query(sb, "flavorId", flavorId); query(sb, "region", region); String resp = exec(qPath, "GET", sb.toString(), n...
haifengl/smile
demo/src/main/java/smile/demo/classification/ClassificationDemo.java
ClassificationDemo.error
double error(int[] x, int[] y) { int e = 0; for (int i = 0; i < x.length; i++) { if (x[i] != y[i]) { e++; } } return (double) e / x.length; }
java
double error(int[] x, int[] y) { int e = 0; for (int i = 0; i < x.length; i++) { if (x[i] != y[i]) { e++; } } return (double) e / x.length; }
[ "double", "error", "(", "int", "[", "]", "x", ",", "int", "[", "]", "y", ")", "{", "int", "e", "=", "0", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "x", ".", "length", ";", "i", "++", ")", "{", "if", "(", "x", "[", "i", "]"...
Returns the error rate.
[ "Returns", "the", "error", "rate", "." ]
e27e43e90fbaacce3f99d30120cf9dd6a764c33d
https://github.com/haifengl/smile/blob/e27e43e90fbaacce3f99d30120cf9dd6a764c33d/demo/src/main/java/smile/demo/classification/ClassificationDemo.java#L142-L152
train
Compute the error of two sets of integers.
Create a Java method that does the following: "Compute the error of two sets of integers.".
Of course, here is the Java code you requested: ```java double error(int[] x, int[] y) { int e = 0; for (int i = 0; i < x.length; i++) { if (x[i] != y[i]) { e++; } } return (double) e / x.length; } ``` Hope this helps!
codeprimate-software/cp-elements
src/main/java/org/cp/elements/util/ArrayUtils.java
ArrayUtils.filter
@SuppressWarnings("unchecked") public static <T> T[] filter(T[] array, Filter<T> filter) { Assert.notNull(array, "Array is required"); Assert.notNull(filter, "Filter is required"); List<T> arrayList = stream(array).filter(filter::accept).collect(Collectors.toList()); return arrayList.toArray((T[]) ...
java
@SuppressWarnings("unchecked") public static <T> T[] filter(T[] array, Filter<T> filter) { Assert.notNull(array, "Array is required"); Assert.notNull(filter, "Filter is required"); List<T> arrayList = stream(array).filter(filter::accept).collect(Collectors.toList()); return arrayList.toArray((T[]) ...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "static", "<", "T", ">", "T", "[", "]", "filter", "(", "T", "[", "]", "array", ",", "Filter", "<", "T", ">", "filter", ")", "{", "Assert", ".", "notNull", "(", "array", ",", "\"Array is re...
Filters the elements in the array. @param <T> Class type of the elements in the array. @param array array to filter. @param filter {@link Filter} used to filter the array elements. @return a new array of the array class component type containing only elements from the given array accepted by the {@link Filter}. @throw...
[ "Filters", "the", "elements", "in", "the", "array", "." ]
f2163c149fbbef05015e688132064ebcac7c49ab
https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/util/ArrayUtils.java#L348-L357
train
Filter the array.
Create a Java method that does the following: "Filter the array.".
Of course, here is the Java code you requested: ```java @SuppressWarnings("unchecked") public static <T> T[] filter(T[] array, Filter<T> filter) { Assert.notNull(array, "Array is required"); Assert.notNull(filter, "Filter is required"); List<T> arrayList = stream(array).filter(filter::accept).collect(C...
yavijava/yavijava
src/main/java/com/vmware/vim25/mo/InventoryNavigator.java
InventoryNavigator.searchManagedEntities
public ManagedEntity[] searchManagedEntities(String[][] typeinfo, boolean recurse) throws InvalidProperty, RuntimeFault, RemoteException { ObjectContent[] ocs = retrieveObjectContents(typeinfo, recurse); return createManagedEntities(ocs); }
java
public ManagedEntity[] searchManagedEntities(String[][] typeinfo, boolean recurse) throws InvalidProperty, RuntimeFault, RemoteException { ObjectContent[] ocs = retrieveObjectContents(typeinfo, recurse); return createManagedEntities(ocs); }
[ "public", "ManagedEntity", "[", "]", "searchManagedEntities", "(", "String", "[", "]", "[", "]", "typeinfo", ",", "boolean", "recurse", ")", "throws", "InvalidProperty", ",", "RuntimeFault", ",", "RemoteException", "{", "ObjectContent", "[", "]", "ocs", "=", "...
Retrieve content recursively with multiple properties. the typeinfo array contains typename + properties to retrieve. @param typeinfo 2D array of properties for each typename @param recurse retrieve contents recursively from the root down @return retrieved object contents @throws RemoteException @throws RuntimeFault ...
[ "Retrieve", "content", "recursively", "with", "multiple", "properties", ".", "the", "typeinfo", "array", "contains", "typename", "+", "properties", "to", "retrieve", "." ]
27fd2c5826115782d5eeb934f86e3e39240179cd
https://github.com/yavijava/yavijava/blob/27fd2c5826115782d5eeb934f86e3e39240179cd/src/main/java/com/vmware/vim25/mo/InventoryNavigator.java#L52-L55
train
Search for managed entities in the specified typeinfo.
Create a Java method that does the following: "Search for managed entities in the specified typeinfo.".
Of course, here is the Java code you requested: ```java public ManagedEntity[] searchManagedEntities(String[][] typeinfo, boolean recurse) throws InvalidProperty, RuntimeFault, RemoteException { ObjectContent[] ocs = retrieveObjectContents(typeinfo, recurse); return createManagedEntities(ocs); }...
lucee/Lucee
core/src/main/java/lucee/runtime/PageContextImpl.java
PageContextImpl.doInclude
public void doInclude(String realPath, boolean runOnce, Object cachedWithin) throws PageException { if (cachedWithin == null) cachedWithin = getCachedWithin(ConfigWeb.CACHEDWITHIN_INCLUDE); _doInclude(getRelativePageSources(realPath), runOnce, cachedWithin); }
java
public void doInclude(String realPath, boolean runOnce, Object cachedWithin) throws PageException { if (cachedWithin == null) cachedWithin = getCachedWithin(ConfigWeb.CACHEDWITHIN_INCLUDE); _doInclude(getRelativePageSources(realPath), runOnce, cachedWithin); }
[ "public", "void", "doInclude", "(", "String", "realPath", ",", "boolean", "runOnce", ",", "Object", "cachedWithin", ")", "throws", "PageException", "{", "if", "(", "cachedWithin", "==", "null", ")", "cachedWithin", "=", "getCachedWithin", "(", "ConfigWeb", ".", ...
used by the transformer
[ "used", "by", "the", "transformer" ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/PageContextImpl.java#L789-L792
train
include the page
Create a Java method that does the following: "include the page".
Of course, here is the Java code you requested: ```java public void doInclude(String realPath, boolean runOnce, Object cachedWithin) throws PageException { if (cachedWithin == null) cachedWithin = getCachedWithin(ConfigWeb.CACHEDWITHIN_INCLUDE); _doInclude(getRelativePageSources(realPath), runOnce, cachedWithin); ...
VoltDB/voltdb
third_party/java/src/com/google_voltpatches/common/collect/Collections2.java
Collections2.safeContains
static boolean safeContains(Collection<?> collection, @Nullable Object object) { checkNotNull(collection); try { return collection.contains(object); } catch (ClassCastException e) { return false; } catch (NullPointerException e) { return false; } }
java
static boolean safeContains(Collection<?> collection, @Nullable Object object) { checkNotNull(collection); try { return collection.contains(object); } catch (ClassCastException e) { return false; } catch (NullPointerException e) { return false; } }
[ "static", "boolean", "safeContains", "(", "Collection", "<", "?", ">", "collection", ",", "@", "Nullable", "Object", "object", ")", "{", "checkNotNull", "(", "collection", ")", ";", "try", "{", "return", "collection", ".", "contains", "(", "object", ")", "...
Delegates to {@link Collection#contains}. Returns {@code false} if the {@code contains} method throws a {@code ClassCastException} or {@code NullPointerException}.
[ "Delegates", "to", "{" ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/com/google_voltpatches/common/collect/Collections2.java#L101-L110
train
Checks if the given object is contained in the given collection.
Create a Java method that does the following: "Checks if the given object is contained in the given collection.".
Of course, here is the Java code you requested: ```java static boolean safeContains(Collection<?> collection, @Nullable Object object) { checkNotNull(collection); try { return collection.contains(object); } catch (ClassCastException e) { return false; } catch (NullPointerException e) { ...
kaazing/gateway
util/src/main/java/org/kaazing/gateway/util/asn1/Asn1Utils.java
Asn1Utils.encodeBitString
public static int encodeBitString(BitSet value, int nbits, ByteBuffer buf) { if (value == null || nbits < value.length()) { throw new IllegalArgumentException(); } int pos = buf.position(); int contentLength = (int) Math.ceil(nbits / 8.0d); for (int i = contentLength...
java
public static int encodeBitString(BitSet value, int nbits, ByteBuffer buf) { if (value == null || nbits < value.length()) { throw new IllegalArgumentException(); } int pos = buf.position(); int contentLength = (int) Math.ceil(nbits / 8.0d); for (int i = contentLength...
[ "public", "static", "int", "encodeBitString", "(", "BitSet", "value", ",", "int", "nbits", ",", "ByteBuffer", "buf", ")", "{", "if", "(", "value", "==", "null", "||", "nbits", "<", "value", ".", "length", "(", ")", ")", "{", "throw", "new", "IllegalArg...
Encode an ASN.1 BIT STRING. @param value the value to be encoded @param nbits the number of bits in the bit string @param buf the buffer with space to the left of current position where the value will be encoded @return the length of the encoded data
[ "Encode", "an", "ASN", ".", "1", "BIT", "STRING", "." ]
06017b19273109b3b992e528e702586446168d57
https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/util/src/main/java/org/kaazing/gateway/util/asn1/Asn1Utils.java#L241-L268
train
Encode a bit string in ASN. 1 format.
Create a Java method that does the following: "Encode a bit string in ASN. 1 format.".
Of course, here is the Java code you requested: ```java public static int encodeBitString(BitSet value, int nbits, ByteBuffer buf) { if (value == null || nbits < value.length()) { throw new IllegalArgumentException(); } int pos = buf.position(); int contentLength = (int) Ma...
mirage-sql/mirage
src/main/java/com/miragesql/miragesql/naming/Inflection.java
Inflection.match
public boolean match(String word) { int flags = 0; if (ignoreCase) { flags = flags | Pattern.CASE_INSENSITIVE; } return Pattern.compile(pattern, flags).matcher(word).find(); }
java
public boolean match(String word) { int flags = 0; if (ignoreCase) { flags = flags | Pattern.CASE_INSENSITIVE; } return Pattern.compile(pattern, flags).matcher(word).find(); }
[ "public", "boolean", "match", "(", "String", "word", ")", "{", "int", "flags", "=", "0", ";", "if", "(", "ignoreCase", ")", "{", "flags", "=", "flags", "|", "Pattern", ".", "CASE_INSENSITIVE", ";", "}", "return", "Pattern", ".", "compile", "(", "patter...
Does the given word match? @param word The word @return True if it matches the inflection pattern
[ "Does", "the", "given", "word", "match?" ]
29a44b7ad267b5a48bc250cd0ef7d74813d46889
https://github.com/mirage-sql/mirage/blob/29a44b7ad267b5a48bc250cd0ef7d74813d46889/src/main/java/com/miragesql/miragesql/naming/Inflection.java#L207-L213
train
Match a word against this class.
Create a Java method that does the following: "Match a word against this class.".
Of course, here is the Java code you requested: ```java public boolean match(String word) { int flags = 0; if (ignoreCase) { flags = flags | Pattern.CASE_INSENSITIVE; } return Pattern.compile(pattern, flags).matcher(word).find(); } ``` Hope this helps!
eFaps/eFaps-Kernel
src/main/java/org/efaps/admin/ui/AbstractCommand.java
AbstractCommand.setProperty
@Override protected void setProperty(final String _name, final String _value) throws CacheReloadException { if ("AskUser".equals(_name)) { askUser = "true".equalsIgnoreCase(_value); } else if ("DefaultSelected".equals(_name)) { defau...
java
@Override protected void setProperty(final String _name, final String _value) throws CacheReloadException { if ("AskUser".equals(_name)) { askUser = "true".equalsIgnoreCase(_value); } else if ("DefaultSelected".equals(_name)) { defau...
[ "@", "Override", "protected", "void", "setProperty", "(", "final", "String", "_name", ",", "final", "String", "_value", ")", "throws", "CacheReloadException", "{", "if", "(", "\"AskUser\"", ".", "equals", "(", "_name", ")", ")", "{", "askUser", "=", "\"true\...
The instance method sets a new property value. @param _name name of the property @param _value value of the property @throws CacheReloadException on error during reload
[ "The", "instance", "method", "sets", "a", "new", "property", "value", "." ]
04b96548f518c2386a93f5ec2b9349f9b9063859
https://github.com/eFaps/eFaps-Kernel/blob/04b96548f518c2386a93f5ec2b9349f9b9063859/src/main/java/org/efaps/admin/ui/AbstractCommand.java#L935-L1014
train
Sets the property.
Create a Java method that does the following: "Sets the property.".
Of course, here is the Java code you requested: ```java @Override protected void setProperty(final String _name, final String _value) throws CacheReloadException { if ("AskUser".equals(_name)) { askUser = "true".equalsIgnoreCase(_value); } else...
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/helper/CompensationUtil.java
CompensationUtil.throwCompensationEvent
public static void throwCompensationEvent(List<EventSubscriptionEntity> eventSubscriptions, ActivityExecution execution, boolean async) { // first spawn the compensating executions for (EventSubscriptionEntity eventSubscription : eventSubscriptions) { // check whether compensating execution is already cr...
java
public static void throwCompensationEvent(List<EventSubscriptionEntity> eventSubscriptions, ActivityExecution execution, boolean async) { // first spawn the compensating executions for (EventSubscriptionEntity eventSubscription : eventSubscriptions) { // check whether compensating execution is already cr...
[ "public", "static", "void", "throwCompensationEvent", "(", "List", "<", "EventSubscriptionEntity", ">", "eventSubscriptions", ",", "ActivityExecution", "execution", ",", "boolean", "async", ")", "{", "// first spawn the compensating executions", "for", "(", "EventSubscripti...
we create a separate execution for each compensation handler invocation.
[ "we", "create", "a", "separate", "execution", "for", "each", "compensation", "handler", "invocation", "." ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/helper/CompensationUtil.java#L55-L89
train
Throw a compensation event.
Create a Java method that does the following: "Throw a compensation event.".
Of course, here is the Java code you requested: ```java public static void throwCompensationEvent(List<EventSubscriptionEntity> eventSubscriptions, ActivityExecution execution, boolean async) { // first spawn the compensating executions for (EventSubscriptionEntity eventSubscription : eventSubscriptions) { ...
JodaOrg/joda-beans
src/main/java/org/joda/beans/gen/BeanCodeGen.java
BeanCodeGen.createFromArgs
public static BeanCodeGen createFromArgs(String[] args) { if (args == null) { throw new IllegalArgumentException("Arguments must not be null"); } String indent = " "; String prefix = ""; String defaultStyle = null; boolean recurse = false; i...
java
public static BeanCodeGen createFromArgs(String[] args) { if (args == null) { throw new IllegalArgumentException("Arguments must not be null"); } String indent = " "; String prefix = ""; String defaultStyle = null; boolean recurse = false; i...
[ "public", "static", "BeanCodeGen", "createFromArgs", "(", "String", "[", "]", "args", ")", "{", "if", "(", "args", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Arguments must not be null\"", ")", ";", "}", "String", "indent", "="...
Creates an instance of {@code BeanCodeGen} from arguments. <p> This is intended for tools and does not call {@code System.exit}. @param args the arguments, not null @return the code generator, not null @throws RuntimeException if unable to create
[ "Creates", "an", "instance", "of", "{", "@code", "BeanCodeGen", "}", "from", "arguments", ".", "<p", ">", "This", "is", "intended", "for", "tools", "and", "does", "not", "call", "{", "@code", "System", ".", "exit", "}", "." ]
f07dbe42947150b23a173f35984c6ab33c5529bf
https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/gen/BeanCodeGen.java#L87-L148
train
Creates a BeanCodeGen object from the specified arguments.
Create a Java method that does the following: "Creates a BeanCodeGen object from the specified arguments.".
Of course, here is the Java code you requested: ```java public static BeanCodeGen createFromArgs(String[] args) { if (args == null) { throw new IllegalArgumentException("Arguments must not be null"); } String indent = " "; String prefix = ""; String defaultS...
carrotsearch/hppc
hppc/src/main/templates/com/carrotsearch/hppc/KTypeHashSet.java
KTypeHashSet.indexReplace
public KType indexReplace(int index, KType equivalentKey) { assert index >= 0 : "The index must point at an existing key."; assert index <= mask || (index == mask + 1 && hasEmptyKey); assert Intrinsics.equals(this, keys[index], equivalentKey); KType previousValue = Intrinsics.<KType> cast(ke...
java
public KType indexReplace(int index, KType equivalentKey) { assert index >= 0 : "The index must point at an existing key."; assert index <= mask || (index == mask + 1 && hasEmptyKey); assert Intrinsics.equals(this, keys[index], equivalentKey); KType previousValue = Intrinsics.<KType> cast(ke...
[ "public", "KType", "indexReplace", "(", "int", "index", ",", "KType", "equivalentKey", ")", "{", "assert", "index", ">=", "0", ":", "\"The index must point at an existing key.\"", ";", "assert", "index", "<=", "mask", "||", "(", "index", "==", "mask", "+", "1"...
Replaces the existing equivalent key with the given one and returns any previous value stored for that key. @see #indexOf @param index The index of an existing key. @param equivalentKey The key to put in the set as a replacement. Must be equivalent to the key currently stored at the provided index. @return Returns th...
[ "Replaces", "the", "existing", "equivalent", "key", "with", "the", "given", "one", "and", "returns", "any", "previous", "value", "stored", "for", "that", "key", "." ]
e359e9da358e846fcbffc64a765611df954ba3f6
https://github.com/carrotsearch/hppc/blob/e359e9da358e846fcbffc64a765611df954ba3f6/hppc/src/main/templates/com/carrotsearch/hppc/KTypeHashSet.java#L659-L668
train
Replaces the value of the specified key with the specified equivalent key.
Create a Java method that does the following: "Replaces the value of the specified key with the specified equivalent key.".
Of course, here is the Java code you requested: ```java public KType indexReplace(int index, KType equivalentKey) { assert index >= 0 : "The index must point at an existing key."; assert index <= mask || (index == mask + 1 && hasEmptyKey); assert Intrinsics.equals(this, keys[index], equivalentKe...
paymill/paymill-java
src/main/java/com/paymill/services/SubscriptionService.java
SubscriptionService.create
public Subscription create( Payment payment, Client client, Offer offer, Integer amount, String currency, Interval.PeriodWithChargeDay interval, Date startAt, String name, Interval.Period periodOfValidity ) { if( offer == null && (amount == null || currency == null || interval == null) ) { throw new Il...
java
public Subscription create( Payment payment, Client client, Offer offer, Integer amount, String currency, Interval.PeriodWithChargeDay interval, Date startAt, String name, Interval.Period periodOfValidity ) { if( offer == null && (amount == null || currency == null || interval == null) ) { throw new Il...
[ "public", "Subscription", "create", "(", "Payment", "payment", ",", "Client", "client", ",", "Offer", "offer", ",", "Integer", "amount", ",", "String", "currency", ",", "Interval", ".", "PeriodWithChargeDay", "interval", ",", "Date", "startAt", ",", "String", ...
This function creates a {@link Subscription} between a {@link Client} and an {@link Offer}.<br> <br> A {@link Client} can have several {@link Subscription}s to different {@link Offer}s, but only one {@link Subscription} to the same {@link Offer}. The {@link Client}s is charged for each billing interval entered. <br> <s...
[ "This", "function", "creates", "a", "{" ]
17281a0d4376c76f1711af9f09bfc138c90ba65a
https://github.com/paymill/paymill-java/blob/17281a0d4376c76f1711af9f09bfc138c90ba65a/src/main/java/com/paymill/services/SubscriptionService.java#L142-L184
train
Create a Subscription object
Create a Java method that does the following: "Create a Subscription object".
Of course, here is the Java code you requested: ```java public Subscription create( Payment payment, Client client, Offer offer, Integer amount, String currency, Interval.PeriodWithChargeDay interval, Date startAt, String name, Interval.Period periodOfValidity ) { if( offer == null && (amount == null || cur...
elki-project/elki
elki-gui-minigui/src/main/java/de/lmu/ifi/dbs/elki/gui/util/LogPanel.java
LogPanel.removeProgressBar
private void removeProgressBar(Progress prog, JProgressBar pbar) { synchronized(pbarmap) { pbarmap.remove(prog); SwingUtilities.invokeLater(() -> removeProgressBar(pbar)); } }
java
private void removeProgressBar(Progress prog, JProgressBar pbar) { synchronized(pbarmap) { pbarmap.remove(prog); SwingUtilities.invokeLater(() -> removeProgressBar(pbar)); } }
[ "private", "void", "removeProgressBar", "(", "Progress", "prog", ",", "JProgressBar", "pbar", ")", "{", "synchronized", "(", "pbarmap", ")", "{", "pbarmap", ".", "remove", "(", "prog", ")", ";", "SwingUtilities", ".", "invokeLater", "(", "(", ")", "->", "r...
Remove a progress bar @param prog Progress @param pbar Associated progress bar
[ "Remove", "a", "progress", "bar" ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-gui-minigui/src/main/java/de/lmu/ifi/dbs/elki/gui/util/LogPanel.java#L192-L197
train
Remove a progress bar from the progress bar map.
Create a Java method that does the following: "Remove a progress bar from the progress bar map.".
Of course, here is the Java code you requested: ```java private void removeProgressBar(Progress prog, JProgressBar pbar) { synchronized(pbarmap) { pbarmap.remove(prog); SwingUtilities.invokeLater(() -> removeProgressBar(pbar)); } } ``` Hope this helps!
forge/core
ui/api/src/main/java/org/jboss/forge/addon/ui/util/InputComponents.java
InputComponents.convertToUIInputValue
public static Object convertToUIInputValue(final ConverterFactory converterFactory, final InputComponent<?, ?> input, final Object value) { final Object result; Class<Object> sourceType = (Class<Object>) value.getClass(); Class<Object> targetType = (Class<Object>) input.getValueType(); ...
java
public static Object convertToUIInputValue(final ConverterFactory converterFactory, final InputComponent<?, ?> input, final Object value) { final Object result; Class<Object> sourceType = (Class<Object>) value.getClass(); Class<Object> targetType = (Class<Object>) input.getValueType(); ...
[ "public", "static", "Object", "convertToUIInputValue", "(", "final", "ConverterFactory", "converterFactory", ",", "final", "InputComponent", "<", "?", ",", "?", ">", "input", ",", "final", "Object", "value", ")", "{", "final", "Object", "result", ";", "Class", ...
Returns the converted value that matches the input.
[ "Returns", "the", "converted", "value", "that", "matches", "the", "input", "." ]
e140eb03bbe2b3409478ad70c86c3edbef6d9a0c
https://github.com/forge/core/blob/e140eb03bbe2b3409478ad70c86c3edbef6d9a0c/ui/api/src/main/java/org/jboss/forge/addon/ui/util/InputComponents.java#L179-L290
train
Convert the value to the UI input value.
Create a Java method that does the following: "Convert the value to the UI input value.".
Of course, here is the Java code you requested: ```java public static Object convertToUIInputValue(final ConverterFactory converterFactory, final InputComponent<?, ?> input, final Object value) { final Object result; Class<Object> sourceType = (Class<Object>) value.getClass(); Class<Ob...
GenesysPureEngage/provisioning-client-java
src/main/java/com/genesys/internal/provisioning/api/OptionsApi.java
OptionsApi.optionsPutAsync
public com.squareup.okhttp.Call optionsPutAsync(OptionsPut body, final ApiCallback<OptionsPutResponseStatusSuccess> callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequestListener progressRequestListener = null; if (cal...
java
public com.squareup.okhttp.Call optionsPutAsync(OptionsPut body, final ApiCallback<OptionsPutResponseStatusSuccess> callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequestListener progressRequestListener = null; if (cal...
[ "public", "com", ".", "squareup", ".", "okhttp", ".", "Call", "optionsPutAsync", "(", "OptionsPut", "body", ",", "final", "ApiCallback", "<", "OptionsPutResponseStatusSuccess", ">", "callback", ")", "throws", "ApiException", "{", "ProgressResponseBody", ".", "Progre...
Add/Change/Delete options. (asynchronously) The PUT operation will add, change or delete values in CloudCluster/Options. @param body Body Data (required) @param callback The callback to be executed when the API call finishes @return The request call @throws ApiException If fail to process the API call, e.g. serializing...
[ "Add", "/", "Change", "/", "Delete", "options", ".", "(", "asynchronously", ")", "The", "PUT", "operation", "will", "add", "change", "or", "delete", "values", "in", "CloudCluster", "/", "Options", "." ]
1ad594c3767cec83052168e350994f922a26f75e
https://github.com/GenesysPureEngage/provisioning-client-java/blob/1ad594c3767cec83052168e350994f922a26f75e/src/main/java/com/genesys/internal/provisioning/api/OptionsApi.java#L407-L432
train
Options Put asynchronous. Put a single user Identity
Create a Java method that does the following: "Options Put asynchronous. Put a single user Identity".
Of course, here is the Java code you requested: ```java public com.squareup.okhttp.Call optionsPutAsync(OptionsPut body, final ApiCallback<OptionsPutResponseStatusSuccess> callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequest...
exoplatform/jcr
exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/DateField.java
DateField.timeToString
public static String timeToString(long time) { time += DATE_SHIFT; if (time < 0) { throw new IllegalArgumentException("time too early"); } String s = Long.toString(time, Character.MAX_RADIX); if (s.length() > DATE_LEN) { throw new IllegalArgumentExcep...
java
public static String timeToString(long time) { time += DATE_SHIFT; if (time < 0) { throw new IllegalArgumentException("time too early"); } String s = Long.toString(time, Character.MAX_RADIX); if (s.length() > DATE_LEN) { throw new IllegalArgumentExcep...
[ "public", "static", "String", "timeToString", "(", "long", "time", ")", "{", "time", "+=", "DATE_SHIFT", ";", "if", "(", "time", "<", "0", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"time too early\"", ")", ";", "}", "String", "s", "=", ...
Converts a millisecond time to a string suitable for indexing. Supported date range is: 30 BC - 3189 @throws IllegalArgumentException if the given <code>time</code> is not within the supported date range.
[ "Converts", "a", "millisecond", "time", "to", "a", "string", "suitable", "for", "indexing", ".", "Supported", "date", "range", "is", ":", "30", "BC", "-", "3189" ]
3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2
https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/DateField.java#L80-L105
train
Method timeToString.
Create a Java method that does the following: "Method timeToString.".
Of course, here is the Java code you requested: ```java public static String timeToString(long time) { time += DATE_SHIFT; if (time < 0) { throw new IllegalArgumentException("time too early"); } String s = Long.toString(time, Character.MAX_RADIX); if (s.length()...
jMotif/GI
src/main/java/net/seninp/gi/sequitur/SAXRule.java
SAXRule.expandRules
private static void expandRules() { // long start = System.currentTimeMillis(); // iterate over all SAX containers // ArrayList<SAXMapEntry<Integer, Integer>> recs = new ArrayList<SAXMapEntry<Integer, Integer>>( // arrRuleRecords.size()); // // for (GrammarRuleRecord ruleRecord : arrRu...
java
private static void expandRules() { // long start = System.currentTimeMillis(); // iterate over all SAX containers // ArrayList<SAXMapEntry<Integer, Integer>> recs = new ArrayList<SAXMapEntry<Integer, Integer>>( // arrRuleRecords.size()); // // for (GrammarRuleRecord ruleRecord : arrRu...
[ "private", "static", "void", "expandRules", "(", ")", "{", "// long start = System.currentTimeMillis();\r", "// iterate over all SAX containers\r", "// ArrayList<SAXMapEntry<Integer, Integer>> recs = new ArrayList<SAXMapEntry<Integer, Integer>>(\r", "// arrRuleRecords.size());\r", "//\r", "/...
Manfred's cool trick to get out all expanded rules. Expands the rule of each SAX container into SAX words string. Can be rewritten recursively though.
[ "Manfred", "s", "cool", "trick", "to", "get", "out", "all", "expanded", "rules", ".", "Expands", "the", "rule", "of", "each", "SAX", "container", "into", "SAX", "words", "string", ".", "Can", "be", "rewritten", "recursively", "though", "." ]
381212dd4f193246a6df82bd46f0d2bcd04a68d6
https://github.com/jMotif/GI/blob/381212dd4f193246a6df82bd46f0d2bcd04a68d6/src/main/java/net/seninp/gi/sequitur/SAXRule.java#L295-L362
train
Expand the rules in the grammar.
Create a Java method that does the following: "Expand the rules in the grammar.".
Of course, here is the Java code you requested: ```java private static void expandRules() { // long start = System.currentTimeMillis(); // iterate over all SAX containers // ArrayList<SAXMapEntry<Integer, Integer>> recs = new ArrayList<SAXMapEntry<Integer, Integer>>( // arrRuleRecords.size()); ...
KyoriPowered/text
api/src/main/java/net/kyori/text/TranslatableComponent.java
TranslatableComponent.of
public static TranslatableComponent of(final @NonNull String key, final @Nullable TextColor color, final @NonNull Set<TextDecoration> decorations, final @NonNull List<Component> args) { return builder() .color(color) .decorations(decorations, true) .key(key) .args(args) .build(); }
java
public static TranslatableComponent of(final @NonNull String key, final @Nullable TextColor color, final @NonNull Set<TextDecoration> decorations, final @NonNull List<Component> args) { return builder() .color(color) .decorations(decorations, true) .key(key) .args(args) .build(); }
[ "public", "static", "TranslatableComponent", "of", "(", "final", "@", "NonNull", "String", "key", ",", "final", "@", "Nullable", "TextColor", "color", ",", "final", "@", "NonNull", "Set", "<", "TextDecoration", ">", "decorations", ",", "final", "@", "NonNull",...
Creates a translatable component with a translation key and arguments. @param key the translation key @param color the color @param decorations the decorations @param args the translation arguments @return the translatable component
[ "Creates", "a", "translatable", "component", "with", "a", "translation", "key", "and", "arguments", "." ]
4496c593bf89e8fb036dd6efe26f8ac60f7655c9
https://github.com/KyoriPowered/text/blob/4496c593bf89e8fb036dd6efe26f8ac60f7655c9/api/src/main/java/net/kyori/text/TranslatableComponent.java#L182-L189
train
Create a translation component from a key and a set of text decorations.
Create a Java method that does the following: "Create a translation component from a key and a set of text decorations.".
Of course, here is the Java code you requested: ```java public static TranslatableComponent of(final @NonNull String key, final @Nullable TextColor color, final @NonNull Set<TextDecoration> decorations, final @NonNull List<Component> args) { return builder() .color(color) .decorations(decorations, true...
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/cache/cacheforwardproxy.java
cacheforwardproxy.delete
public static base_responses delete(nitro_service client, String ipaddress[]) throws Exception { base_responses result = null; if (ipaddress != null && ipaddress.length > 0) { cacheforwardproxy deleteresources[] = new cacheforwardproxy[ipaddress.length]; for (int i=0;i<ipaddress.length;i++){ deleteresourc...
java
public static base_responses delete(nitro_service client, String ipaddress[]) throws Exception { base_responses result = null; if (ipaddress != null && ipaddress.length > 0) { cacheforwardproxy deleteresources[] = new cacheforwardproxy[ipaddress.length]; for (int i=0;i<ipaddress.length;i++){ deleteresourc...
[ "public", "static", "base_responses", "delete", "(", "nitro_service", "client", ",", "String", "ipaddress", "[", "]", ")", "throws", "Exception", "{", "base_responses", "result", "=", "null", ";", "if", "(", "ipaddress", "!=", "null", "&&", "ipaddress", ".", ...
Use this API to delete cacheforwardproxy resources of given names.
[ "Use", "this", "API", "to", "delete", "cacheforwardproxy", "resources", "of", "given", "names", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/cache/cacheforwardproxy.java#L167-L178
train
Use this API to delete cacheforwardproxy resources of given names.
Create a Java method that does the following: "Use this API to delete cacheforwardproxy resources of given names.".
Of course, here is the Java code you requested: ```java public static base_responses delete(nitro_service client, String ipaddress[]) throws Exception { base_responses result = null; if (ipaddress != null && ipaddress.length > 0) { cacheforwardproxy deleteresources[] = new cacheforwardproxy[ipaddress.length]; ...
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/ConsumerSessionImpl.java
ConsumerSessionImpl.unlockSet
@Override public void unlockSet(SIMessageHandle[] msgHandles) throws SIMPMessageNotLockedException, SISessionUnavailableException, SIConnectionLostException, SIIncorrectCallException, SIResourceException, SIErrorException { if (TraceComponent.isAnyTracingEnabled()...
java
@Override public void unlockSet(SIMessageHandle[] msgHandles) throws SIMPMessageNotLockedException, SISessionUnavailableException, SIConnectionLostException, SIIncorrectCallException, SIResourceException, SIErrorException { if (TraceComponent.isAnyTracingEnabled()...
[ "@", "Override", "public", "void", "unlockSet", "(", "SIMessageHandle", "[", "]", "msgHandles", ")", "throws", "SIMPMessageNotLockedException", ",", "SISessionUnavailableException", ",", "SIConnectionLostException", ",", "SIIncorrectCallException", ",", "SIResourceException",...
/* (non-Javadoc) @see com.ibm.wsspi.sib.core.ConsumerSession#unlockSet(long[])
[ "/", "*", "(", "non", "-", "Javadoc", ")" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/ConsumerSessionImpl.java#L680-L695
train
UnlockSet is called by the application to unlock a set of messages.
Create a Java method that does the following: "UnlockSet is called by the application to unlock a set of messages.".
Of course, here is the Java code you requested: ```java @Override public void unlockSet(SIMessageHandle[] msgHandles) throws SIMPMessageNotLockedException, SISessionUnavailableException, SIConnectionLostException, SIIncorrectCallException, SIResourceException, SIErrorExcepti...
kuali/kc-s2sgen
coeus-s2sgen-impl/src/main/java/org/kuali/coeus/s2sgen/impl/generate/support/RRFedNonFedBudgetV1_0Generator.java
RRFedNonFedBudgetV1_0Generator.getGraduateStudents
private GraduateStudents getGraduateStudents(OtherPersonnelDto otherPersonnel) { GraduateStudents graduate = GraduateStudents.Factory.newInstance(); if (otherPersonnel != null) { graduate.setNumberOfPersonnel(otherPersonnel.getNumberPersonnel()); graduate.setProjectRole(otherPer...
java
private GraduateStudents getGraduateStudents(OtherPersonnelDto otherPersonnel) { GraduateStudents graduate = GraduateStudents.Factory.newInstance(); if (otherPersonnel != null) { graduate.setNumberOfPersonnel(otherPersonnel.getNumberPersonnel()); graduate.setProjectRole(otherPer...
[ "private", "GraduateStudents", "getGraduateStudents", "(", "OtherPersonnelDto", "otherPersonnel", ")", "{", "GraduateStudents", "graduate", "=", "GraduateStudents", ".", "Factory", ".", "newInstance", "(", ")", ";", "if", "(", "otherPersonnel", "!=", "null", ")", "{...
This method gets the GraduateStudents details,ProjectRole, NumberOfPersonnel,Compensation based on OtherPersonnelInfo for the RRFedNonFedBudget, if it is a GraduateStudents type. @param otherPersonnel (OtherPersonnelInfo) other personnel info entry. @return GraduateStudents details corresponding to the OtherPersonnelI...
[ "This", "method", "gets", "the", "GraduateStudents", "details", "ProjectRole", "NumberOfPersonnel", "Compensation", "based", "on", "OtherPersonnelInfo", "for", "the", "RRFedNonFedBudget", "if", "it", "is", "a", "GraduateStudents", "type", "." ]
2886380e1e3cb8bdd732ba99b2afa6ffc630bb37
https://github.com/kuali/kc-s2sgen/blob/2886380e1e3cb8bdd732ba99b2afa6ffc630bb37/coeus-s2sgen-impl/src/main/java/org/kuali/coeus/s2sgen/impl/generate/support/RRFedNonFedBudgetV1_0Generator.java#L919-L928
train
This method gets the GraduateStudents object from OtherPersonnelInfo for a SectB.
Create a Java method that does the following: "This method gets the GraduateStudents object from OtherPersonnelInfo for a SectB.".
Of course, here is the Java code you requested: ```java private GraduateStudents getGraduateStudents(OtherPersonnelDto otherPersonnel) { GraduateStudents graduate = GraduateStudents.Factory.newInstance(); if (otherPersonnel != null) { graduate.setNumberOfPersonnel(otherPersonnel.getNumberP...
bazaarvoice/emodb
table/src/main/java/com/bazaarvoice/emodb/table/db/tableset/BlockFileTableSet.java
BlockFileTableSet.readTable
private Table readTable(int index) { // Get the block TableBlock block = _blocks.get(getBlock(index)); // Return the table located at the block offset return block.getTable(getBlockOffset(index)); }
java
private Table readTable(int index) { // Get the block TableBlock block = _blocks.get(getBlock(index)); // Return the table located at the block offset return block.getTable(getBlockOffset(index)); }
[ "private", "Table", "readTable", "(", "int", "index", ")", "{", "// Get the block", "TableBlock", "block", "=", "_blocks", ".", "get", "(", "getBlock", "(", "index", ")", ")", ";", "// Return the table located at the block offset", "return", "block", ".", "getTabl...
Reads the table located at the given index.
[ "Reads", "the", "table", "located", "at", "the", "given", "index", "." ]
97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb
https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/table/src/main/java/com/bazaarvoice/emodb/table/db/tableset/BlockFileTableSet.java#L136-L141
train
Read a table from the index.
Create a Java method that does the following: "Read a table from the index.".
Of course, here is the Java code you requested: ```java private Table readTable(int index) { // Get the block TableBlock block = _blocks.get(getBlock(index)); // Return the table located at the block offset return block.getTable(getBlockOffset(index)); } ``` Hope this helps!
aws/aws-sdk-java
aws-java-sdk-ec2/src/main/java/com/amazonaws/services/ec2/model/AssociateTransitGatewayRouteTableRequest.java
AssociateTransitGatewayRouteTableRequest.getDryRunRequest
@Override public Request<AssociateTransitGatewayRouteTableRequest> getDryRunRequest() { Request<AssociateTransitGatewayRouteTableRequest> request = new AssociateTransitGatewayRouteTableRequestMarshaller().marshall(this); request.addParameter("DryRun", Boolean.toString(true)); return request;...
java
@Override public Request<AssociateTransitGatewayRouteTableRequest> getDryRunRequest() { Request<AssociateTransitGatewayRouteTableRequest> request = new AssociateTransitGatewayRouteTableRequestMarshaller().marshall(this); request.addParameter("DryRun", Boolean.toString(true)); return request;...
[ "@", "Override", "public", "Request", "<", "AssociateTransitGatewayRouteTableRequest", ">", "getDryRunRequest", "(", ")", "{", "Request", "<", "AssociateTransitGatewayRouteTableRequest", ">", "request", "=", "new", "AssociateTransitGatewayRouteTableRequestMarshaller", "(", ")...
This method is intended for internal use only. Returns the marshaled request configured with additional parameters to enable operation dry-run.
[ "This", "method", "is", "intended", "for", "internal", "use", "only", ".", "Returns", "the", "marshaled", "request", "configured", "with", "additional", "parameters", "to", "enable", "operation", "dry", "-", "run", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-ec2/src/main/java/com/amazonaws/services/ec2/model/AssociateTransitGatewayRouteTableRequest.java#L126-L131
train
Gets the request that will be used to associate a resource with a resource in the Service.
Create a Java method that does the following: "Gets the request that will be used to associate a resource with a resource in the Service.".
Of course, here is the Java code you requested: ```java @Override public Request<AssociateTransitGatewayRouteTableRequest> getDryRunRequest() { Request<AssociateTransitGatewayRouteTableRequest> request = new AssociateTransitGatewayRouteTableRequestMarshaller().marshall(this); request.addParameter("...
overturetool/overture
core/codegen/platform/src/main/java/org/overture/codegen/ir/CodeGenBase.java
CodeGenBase.preProcessAst
protected void preProcessAst(List<INode> ast) throws AnalysisException { generator.computeDefTable(getUserModules(ast)); removeUnreachableStms(ast); handleOldNames(ast); for (INode node : ast) { if (getInfo().getAssistantManager().getDeclAssistant().isLibrary(node)) { simplifyLibrary(node); } e...
java
protected void preProcessAst(List<INode> ast) throws AnalysisException { generator.computeDefTable(getUserModules(ast)); removeUnreachableStms(ast); handleOldNames(ast); for (INode node : ast) { if (getInfo().getAssistantManager().getDeclAssistant().isLibrary(node)) { simplifyLibrary(node); } e...
[ "protected", "void", "preProcessAst", "(", "List", "<", "INode", ">", "ast", ")", "throws", "AnalysisException", "{", "generator", ".", "computeDefTable", "(", "getUserModules", "(", "ast", ")", ")", ";", "removeUnreachableStms", "(", "ast", ")", ";", "handleO...
This method pre-processes the VDM AST by<br> (1) computing a definition table that can be used during the analysis of the IR to determine if a VDM identifier state designator is local or not.<br> (2) Removing unreachable statements from the VDM AST <br> (3) Normalizing old names by replacing tilde signs '~' with unders...
[ "This", "method", "pre", "-", "processes", "the", "VDM", "AST", "by<br", ">", "(", "1", ")", "computing", "a", "definition", "table", "that", "can", "be", "used", "during", "the", "analysis", "of", "the", "IR", "to", "determine", "if", "a", "VDM", "ide...
83175dc6c24fa171cde4fcf61ecb648eba3bdbc1
https://github.com/overturetool/overture/blob/83175dc6c24fa171cde4fcf61ecb648eba3bdbc1/core/codegen/platform/src/main/java/org/overture/codegen/ir/CodeGenBase.java#L177-L193
train
Pre - process the AST.
Create a Java method that does the following: "Pre - process the AST.".
Of course, here is the Java code you requested: ```java protected void preProcessAst(List<INode> ast) throws AnalysisException { generator.computeDefTable(getUserModules(ast)); removeUnreachableStms(ast); handleOldNames(ast); for (INode node : ast) { if (getInfo().getAssistantManager().getDeclAssistant(...
elki-project/elki
elki-core/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/pca/AutotuningPCA.java
AutotuningPCA.reversed
private static double[] reversed(double[] a) { // TODO: there doesn't appear to be a nicer version in Java, unfortunately. Arrays.sort(a); for(int i = 0, j = a.length - 1; i < j; i++, j--) { double tmp = a[i]; a[i] = a[j]; a[j] = tmp; } return a; }
java
private static double[] reversed(double[] a) { // TODO: there doesn't appear to be a nicer version in Java, unfortunately. Arrays.sort(a); for(int i = 0, j = a.length - 1; i < j; i++, j--) { double tmp = a[i]; a[i] = a[j]; a[j] = tmp; } return a; }
[ "private", "static", "double", "[", "]", "reversed", "(", "double", "[", "]", "a", ")", "{", "// TODO: there doesn't appear to be a nicer version in Java, unfortunately.", "Arrays", ".", "sort", "(", "a", ")", ";", "for", "(", "int", "i", "=", "0", ",", "j", ...
Sort an array of doubles in descending order. @param a Values @return Values in descending order
[ "Sort", "an", "array", "of", "doubles", "in", "descending", "order", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/pca/AutotuningPCA.java#L201-L210
train
Reverses the array.
Create a Java method that does the following: "Reverses the array.".
Of course, here is the Java code you requested: ```java private static double[] reversed(double[] a) { // TODO: there doesn't appear to be a nicer version in Java, unfortunately. Arrays.sort(a); for(int i = 0, j = a.length - 1; i < j; i++, j--) { double tmp = a[i]; a[i] = a[j]; a[j] = tmp...
Netflix/Nicobar
nicobar-manager/src/main/java/com/netflix/nicobar/manager/explorer/resources/ArchiveRepositoriesResource.java
ArchiveRepositoriesResource.getArchiveSummaries
@GET @Path("/archivesummaries") public Map<String, List<ArchiveSummary>> getArchiveSummaries(@QueryParam("repositoryIds") Set<String> repositoryIds) { if (CollectionUtils.isEmpty(repositoryIds)) { repositoryIds = repositories.keySet(); } Map<String, List<ArchiveSummary>> resu...
java
@GET @Path("/archivesummaries") public Map<String, List<ArchiveSummary>> getArchiveSummaries(@QueryParam("repositoryIds") Set<String> repositoryIds) { if (CollectionUtils.isEmpty(repositoryIds)) { repositoryIds = repositories.keySet(); } Map<String, List<ArchiveSummary>> resu...
[ "@", "GET", "@", "Path", "(", "\"/archivesummaries\"", ")", "public", "Map", "<", "String", ",", "List", "<", "ArchiveSummary", ">", ">", "getArchiveSummaries", "(", "@", "QueryParam", "(", "\"repositoryIds\"", ")", "Set", "<", "String", ">", "repositoryIds", ...
Get a map of summaries from different repositories. @param repositoryIds ids for repositories to query. if empty, then all repositories will be queried. @return map of repository id to list of summaries in the respective repository
[ "Get", "a", "map", "of", "summaries", "from", "different", "repositories", "." ]
507173dcae4a86a955afc3df222a855862fab8d7
https://github.com/Netflix/Nicobar/blob/507173dcae4a86a955afc3df222a855862fab8d7/nicobar-manager/src/main/java/com/netflix/nicobar/manager/explorer/resources/ArchiveRepositoriesResource.java#L91-L103
train
Get a map of all the summaries of all the archivesummaries in a set of repositories.
Create a Java method that does the following: "Get a map of all the summaries of all the archivesummaries in a set of repositories.".
Of course, here is the Java code you requested: ```java @GET @Path("/archivesummaries") public Map<String, List<ArchiveSummary>> getArchiveSummaries(@QueryParam("repositoryIds") Set<String> repositoryIds) { if (CollectionUtils.isEmpty(repositoryIds)) { repositoryIds = repositories.keySet();...
mcdiae/kludje
kludje-experimental/src/main/java/uk/kludje/experimental/fluent/Mutator.java
Mutator.bi
public <A, B> Mutator<T> bi(TriConsumer<? super T, A, B> consumer, A a, B b) { consumer.accept(t, a, b); return this; }
java
public <A, B> Mutator<T> bi(TriConsumer<? super T, A, B> consumer, A a, B b) { consumer.accept(t, a, b); return this; }
[ "public", "<", "A", ",", "B", ">", "Mutator", "<", "T", ">", "bi", "(", "TriConsumer", "<", "?", "super", "T", ",", "A", ",", "B", ">", "consumer", ",", "A", "a", ",", "B", "b", ")", "{", "consumer", ".", "accept", "(", "t", ",", "a", ",", ...
Passes the underlying value to a consumer, with two arguments. Usage: <pre> Map&lt;String, String&gt; map = mutate(new HashMap&lt;String, String&gt;()) .nil(Map::put, "a", "A") .nil(Map::put, "b", "B") .nil(Map::put, "c", "C") .map(Collections::unmodifiableMap) .get(); </pre> @param consumer typically a method referen...
[ "Passes", "the", "underlying", "value", "to", "a", "consumer", "with", "two", "arguments", ".", "Usage", ":", "<pre", ">", "Map&lt", ";", "String", "String&gt", ";", "map", "=", "mutate", "(", "new", "HashMap&lt", ";", "String", "String&gt", ";", "()", "...
9ed80cd183ebf162708d5922d784f79ac3841dfc
https://github.com/mcdiae/kludje/blob/9ed80cd183ebf162708d5922d784f79ac3841dfc/kludje-experimental/src/main/java/uk/kludje/experimental/fluent/Mutator.java#L113-L116
train
Produces Mutator for TriConsumer
Create a Java method that does the following: "Produces Mutator for TriConsumer".
Of course, here is the Java code you requested: ```java public <A, B> Mutator<T> bi(TriConsumer<? super T, A, B> consumer, A a, B b) { consumer.accept(t, a, b); return this; } ``` Hope this helps!
atomix/atomix
cluster/src/main/java/io/atomix/cluster/NodeConfig.java
NodeConfig.setId
public NodeConfig setId(NodeId id) { this.id = id != null ? id : NodeId.anonymous(); return this; }
java
public NodeConfig setId(NodeId id) { this.id = id != null ? id : NodeId.anonymous(); return this; }
[ "public", "NodeConfig", "setId", "(", "NodeId", "id", ")", "{", "this", ".", "id", "=", "id", "!=", "null", "?", "id", ":", "NodeId", ".", "anonymous", "(", ")", ";", "return", "this", ";", "}" ]
Sets the node identifier. @param id the node identifier @return the node configuration
[ "Sets", "the", "node", "identifier", "." ]
3a94b7c80576d762dd0d396d4645df07a0b37c31
https://github.com/atomix/atomix/blob/3a94b7c80576d762dd0d396d4645df07a0b37c31/cluster/src/main/java/io/atomix/cluster/NodeConfig.java#L54-L57
train
Sets the node id.
Create a Java method that does the following: "Sets the node id.".
Of course, here is the Java code you requested: ```java public NodeConfig setId(NodeId id) { this.id = id != null ? id : NodeId.anonymous(); return this; } ``` Hope this helps!
bazaarvoice/jersey-hmac-auth
common/src/main/java/com/bazaarvoice/auth/hmac/server/AbstractCachingAuthenticator.java
AbstractCachingAuthenticator.getPrincipal
@Override protected final Principal getPrincipal(final Credentials credentials) { try { Optional<Principal> principalOptional = cache.get(credentials.getApiKey(), new Callable<Optional<Principal>>() { public Optional<Principal> call() throws Exception { return...
java
@Override protected final Principal getPrincipal(final Credentials credentials) { try { Optional<Principal> principalOptional = cache.get(credentials.getApiKey(), new Callable<Optional<Principal>>() { public Optional<Principal> call() throws Exception { return...
[ "@", "Override", "protected", "final", "Principal", "getPrincipal", "(", "final", "Credentials", "credentials", ")", "{", "try", "{", "Optional", "<", "Principal", ">", "principalOptional", "=", "cache", ".", "get", "(", "credentials", ".", "getApiKey", "(", "...
If the Principal for this Credentials is already cached, return it. Otherwise call {@link #loadPrincipal} and cache the results.
[ "If", "the", "Principal", "for", "this", "Credentials", "is", "already", "cached", "return", "it", ".", "Otherwise", "call", "{" ]
17e2a40a4b7b783de4d77ad97f8a623af6baf688
https://github.com/bazaarvoice/jersey-hmac-auth/blob/17e2a40a4b7b783de4d77ad97f8a623af6baf688/common/src/main/java/com/bazaarvoice/auth/hmac/server/AbstractCachingAuthenticator.java#L46-L59
train
Get the principal from the cache.
Create a Java method that does the following: "Get the principal from the cache.".
Of course, here is the Java code you requested: ```java @Override protected final Principal getPrincipal(final Credentials credentials) { try { Optional<Principal> principalOptional = cache.get(credentials.getApiKey(), new Callable<Optional<Principal>>() { public Optional<Princi...
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/tools/offlineEditsViewer/EditsLoaderCurrent.java
EditsLoaderCurrent.loadEdits
@Override public void loadEdits() throws IOException { try { v.start(); v.visitEnclosingElement(EditsElement.EDITS); IntToken editsVersionToken = v.visitInt(EditsElement.EDITS_VERSION); editsVersion = editsVersionToken.value; if(!canLoadVersion(editsVersion)) { throw new IO...
java
@Override public void loadEdits() throws IOException { try { v.start(); v.visitEnclosingElement(EditsElement.EDITS); IntToken editsVersionToken = v.visitInt(EditsElement.EDITS_VERSION); editsVersion = editsVersionToken.value; if(!canLoadVersion(editsVersion)) { throw new IO...
[ "@", "Override", "public", "void", "loadEdits", "(", ")", "throws", "IOException", "{", "try", "{", "v", ".", "start", "(", ")", ";", "v", ".", "visitEnclosingElement", "(", "EditsElement", ".", "EDITS", ")", ";", "IntToken", "editsVersionToken", "=", "v",...
Loads edits file, uses visitor to process all elements
[ "Loads", "edits", "file", "uses", "visitor", "to", "process", "all", "elements" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/tools/offlineEditsViewer/EditsLoaderCurrent.java#L575-L626
train
Load the edits from the edit log.
Create a Java method that does the following: "Load the edits from the edit log.".
Of course, here is the Java code you requested: ```java @Override public void loadEdits() throws IOException { try { v.start(); v.visitEnclosingElement(EditsElement.EDITS); IntToken editsVersionToken = v.visitInt(EditsElement.EDITS_VERSION); editsVersion = editsVersionToken.value; ...
haifengl/smile
core/src/main/java/smile/association/ARM.java
ARM.getPowerSet
private static int[][] getPowerSet(int[] set) { int[][] sets = new int[getPowerSetSize(set.length)][]; getPowerSet(set, 0, null, sets, 0); return sets; }
java
private static int[][] getPowerSet(int[] set) { int[][] sets = new int[getPowerSetSize(set.length)][]; getPowerSet(set, 0, null, sets, 0); return sets; }
[ "private", "static", "int", "[", "]", "[", "]", "getPowerSet", "(", "int", "[", "]", "set", ")", "{", "int", "[", "]", "[", "]", "sets", "=", "new", "int", "[", "getPowerSetSize", "(", "set", ".", "length", ")", "]", "[", "", "]", ";", "getPowe...
Returns all possible subsets except null and full set.
[ "Returns", "all", "possible", "subsets", "except", "null", "and", "full", "set", "." ]
e27e43e90fbaacce3f99d30120cf9dd6a764c33d
https://github.com/haifengl/smile/blob/e27e43e90fbaacce3f99d30120cf9dd6a764c33d/core/src/main/java/smile/association/ARM.java#L248-L252
train
Get the set of power sets.
Create a Java method that does the following: "Get the set of power sets.".
Of course, here is the Java code you requested: ```java private static int[][] getPowerSet(int[] set) { int[][] sets = new int[getPowerSetSize(set.length)][]; getPowerSet(set, 0, null, sets, 0); return sets; } ``` Hope this helps!
jboss/jboss-el-api_spec
src/main/java/javax/el/CompositeELResolver.java
CompositeELResolver.getType
public Class<?> getType(ELContext context, Object base, Object property) { context.setPropertyResolved(false); Class<?> type; for (int i = 0; i < size; i++) { type = elResolvers[i].getType(context, base, property); if ...
java
public Class<?> getType(ELContext context, Object base, Object property) { context.setPropertyResolved(false); Class<?> type; for (int i = 0; i < size; i++) { type = elResolvers[i].getType(context, base, property); if ...
[ "public", "Class", "<", "?", ">", "getType", "(", "ELContext", "context", ",", "Object", "base", ",", "Object", "property", ")", "{", "context", ".", "setPropertyResolved", "(", "false", ")", ";", "Class", "<", "?", ">", "type", ";", "for", "(", "int",...
For a given <code>base</code> and <code>property</code>, attempts to identify the most general type that is acceptable for an object to be passed as the <code>value</code> parameter in a future call to the {@link #setValue} method. The result is obtained by querying all component resolvers. <p>If this resolver handles...
[ "For", "a", "given", "<code", ">", "base<", "/", "code", ">", "and", "<code", ">", "property<", "/", "code", ">", "attempts", "to", "identify", "the", "most", "general", "type", "that", "is", "acceptable", "for", "an", "object", "to", "be", "passed", "...
4cef117cae3ccf9f76439845687a8d219ad2eb43
https://github.com/jboss/jboss-el-api_spec/blob/4cef117cae3ccf9f76439845687a8d219ad2eb43/src/main/java/javax/el/CompositeELResolver.java#L319-L333
train
Get the type from the list of base and property.
Create a Java method that does the following: "Get the type from the list of base and property.".
Of course, here is the Java code you requested: ```java public Class<?> getType(ELContext context, Object base, Object property) { context.setPropertyResolved(false); Class<?> type; for (int i = 0; i < size; i++) { type = elResol...
baratine/baratine
web/src/main/java/com/caucho/v5/subsystem/SystemManager.java
SystemManager.addSystem
public void addSystem(SubSystem system) { @SuppressWarnings("unchecked") Class<SubSystem> cl = (Class<SubSystem>) system.getClass(); addSystem(cl, system); }
java
public void addSystem(SubSystem system) { @SuppressWarnings("unchecked") Class<SubSystem> cl = (Class<SubSystem>) system.getClass(); addSystem(cl, system); }
[ "public", "void", "addSystem", "(", "SubSystem", "system", ")", "{", "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "Class", "<", "SubSystem", ">", "cl", "=", "(", "Class", "<", "SubSystem", ">", ")", "system", ".", "getClass", "(", ")", ";", "addSy...
Adds a new system.
[ "Adds", "a", "new", "system", "." ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/web/src/main/java/com/caucho/v5/subsystem/SystemManager.java#L392-L398
train
Add a single sub - system to the sequence.
Create a Java method that does the following: "Add a single sub - system to the sequence.".
Of course, here is the Java code you requested: ```java public void addSystem(SubSystem system) { @SuppressWarnings("unchecked") Class<SubSystem> cl = (Class<SubSystem>) system.getClass(); addSystem(cl, system); } ``` Hope this helps!
alkacon/opencms-core
src/org/opencms/ui/apps/CmsWorkplaceAppManager.java
CmsWorkplaceAppManager.getDefaultQuickLaunchConfigurations
public List<I_CmsWorkplaceAppConfiguration> getDefaultQuickLaunchConfigurations() { if (m_standardQuickLaunchApps == null) { m_standardQuickLaunchApps = Collections.unmodifiableList(getAppConfigurations(STANDARD_APPS)); } return m_standardQuickLaunchApps; }
java
public List<I_CmsWorkplaceAppConfiguration> getDefaultQuickLaunchConfigurations() { if (m_standardQuickLaunchApps == null) { m_standardQuickLaunchApps = Collections.unmodifiableList(getAppConfigurations(STANDARD_APPS)); } return m_standardQuickLaunchApps; }
[ "public", "List", "<", "I_CmsWorkplaceAppConfiguration", ">", "getDefaultQuickLaunchConfigurations", "(", ")", "{", "if", "(", "m_standardQuickLaunchApps", "==", "null", ")", "{", "m_standardQuickLaunchApps", "=", "Collections", ".", "unmodifiableList", "(", "getAppConfig...
Gets all configured quick launch apps, independent of the current user.<p> @return the quick launch apps
[ "Gets", "all", "configured", "quick", "launch", "apps", "independent", "of", "the", "current", "user", ".", "<p", ">" ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/apps/CmsWorkplaceAppManager.java#L450-L457
train
Returns the default list of quick launch configurations.
Create a Java method that does the following: "Returns the default list of quick launch configurations.".
Of course, here is the Java code you requested: ```java public List<I_CmsWorkplaceAppConfiguration> getDefaultQuickLaunchConfigurations() { if (m_standardQuickLaunchApps == null) { m_standardQuickLaunchApps = Collections.unmodifiableList(getAppConfigurations(STANDARD_APPS)); } ret...
teatrove/teatrove
teaservlet/src/main/java/org/teatrove/teaservlet/TeaServlet.java
TeaServlet.processResource
private boolean processResource(ApplicationRequest appRequest, ApplicationResponse appResponse) throws IOException { // get the associated system path String requestURI = null; if ((requestURI = appRequest.getPathInfo()) == null) { ...
java
private boolean processResource(ApplicationRequest appRequest, ApplicationResponse appResponse) throws IOException { // get the associated system path String requestURI = null; if ((requestURI = appRequest.getPathInfo()) == null) { ...
[ "private", "boolean", "processResource", "(", "ApplicationRequest", "appRequest", ",", "ApplicationResponse", "appResponse", ")", "throws", "IOException", "{", "// get the associated system path", "String", "requestURI", "=", "null", ";", "if", "(", "(", "requestURI", "...
Inserts a plugin to expose parts of the teaservlet via the EngineAccess interface. private void createEngineAccessPlugin(PluginContext context) { Plugin engineAccess = new EngineAccessPlugin(this); context.addPlugin(engineAccess); context.addPluginListener(engineAccess); }
[ "Inserts", "a", "plugin", "to", "expose", "parts", "of", "the", "teaservlet", "via", "the", "EngineAccess", "interface", "." ]
7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea
https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/teaservlet/src/main/java/org/teatrove/teaservlet/TeaServlet.java#L862-L900
train
Process a resource.
Create a Java method that does the following: "Process a resource.".
Of course, here is the Java code you requested: ```java private boolean processResource(ApplicationRequest appRequest, ApplicationResponse appResponse) throws IOException { // get the associated system path String requestURI = null; if ((req...
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/JsJmsStreamMessageImpl.java
JsJmsStreamMessageImpl.writeShort
public void writeShort(short value) throws UnsupportedEncodingException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "writeShort", Short.valueOf(value)); getBodyList().add(Short.valueOf(value)); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibT...
java
public void writeShort(short value) throws UnsupportedEncodingException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "writeShort", Short.valueOf(value)); getBodyList().add(Short.valueOf(value)); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibT...
[ "public", "void", "writeShort", "(", "short", "value", ")", "throws", "UnsupportedEncodingException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "this", ...
/* Write a short value into the payload Stream. Javadoc description supplied by JsJmsMessage interface.
[ "/", "*", "Write", "a", "short", "value", "into", "the", "payload", "Stream", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/JsJmsStreamMessageImpl.java#L283-L287
train
Write a short to the message header.
Create a Java method that does the following: "Write a short to the message header.".
Of course, here is the Java code you requested: ```java public void writeShort(short value) throws UnsupportedEncodingException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "writeShort", Short.valueOf(value)); getBodyList().add(Short.valueOf(value)); if (TraceCom...
lazy-koala/java-toolkit
fast-toolkit/src/main/java/com/thankjava/toolkit/core/http/JDKHttp.java
JDKHttp.urlEncode
public static String urlEncode(String string) { try { return URLEncoder.encode(string, CHARSET); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } return null; }
java
public static String urlEncode(String string) { try { return URLEncoder.encode(string, CHARSET); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } return null; }
[ "public", "static", "String", "urlEncode", "(", "String", "string", ")", "{", "try", "{", "return", "URLEncoder", ".", "encode", "(", "string", ",", "CHARSET", ")", ";", "}", "catch", "(", "UnsupportedEncodingException", "e", ")", "{", "e", ".", "printStac...
参数Encode <p>Function: encode</p> <p>Description: </p> @param string @return @author acexy@thankjava.com @date 2016年1月12日 上午11:55:53 @version 1.0
[ "参数Encode", "<p", ">", "Function", ":", "encode<", "/", "p", ">", "<p", ">", "Description", ":", "<", "/", "p", ">" ]
f46055fae0cc73049597a3708e515f5c6582d27a
https://github.com/lazy-koala/java-toolkit/blob/f46055fae0cc73049597a3708e515f5c6582d27a/fast-toolkit/src/main/java/com/thankjava/toolkit/core/http/JDKHttp.java#L146-L153
train
URL encode a string.
Create a Java method that does the following: "URL encode a string.".
Of course, here is the Java code you requested: ```java public static String urlEncode(String string) { try { return URLEncoder.encode(string, CHARSET); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } return null; } ``` Hope this helps!
spring-projects/spring-security
config/src/main/java/org/springframework/security/config/annotation/method/configuration/MethodSecurityMetadataSourceAdvisorRegistrar.java
MethodSecurityMetadataSourceAdvisorRegistrar.registerBeanDefinitions
public void registerBeanDefinitions(AnnotationMetadata importingClassMetadata, BeanDefinitionRegistry registry) { BeanDefinitionBuilder advisor = BeanDefinitionBuilder .rootBeanDefinition(MethodSecurityMetadataSourceAdvisor.class); advisor.setRole(BeanDefinition.ROLE_INFRASTRUCTURE); advisor.addConstructo...
java
public void registerBeanDefinitions(AnnotationMetadata importingClassMetadata, BeanDefinitionRegistry registry) { BeanDefinitionBuilder advisor = BeanDefinitionBuilder .rootBeanDefinition(MethodSecurityMetadataSourceAdvisor.class); advisor.setRole(BeanDefinition.ROLE_INFRASTRUCTURE); advisor.addConstructo...
[ "public", "void", "registerBeanDefinitions", "(", "AnnotationMetadata", "importingClassMetadata", ",", "BeanDefinitionRegistry", "registry", ")", "{", "BeanDefinitionBuilder", "advisor", "=", "BeanDefinitionBuilder", ".", "rootBeanDefinition", "(", "MethodSecurityMetadataSourceAd...
Register, escalate, and configure the AspectJ auto proxy creator based on the value of the @{@link EnableGlobalMethodSecurity#proxyTargetClass()} attribute on the importing {@code @Configuration} class.
[ "Register", "escalate", "and", "configure", "the", "AspectJ", "auto", "proxy", "creator", "based", "on", "the", "value", "of", "the" ]
98a8467e4c2ae05b3e09c67ece856944fa48ed23
https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/config/src/main/java/org/springframework/security/config/annotation/method/configuration/MethodSecurityMetadataSourceAdvisorRegistrar.java#L43-L61
test
Register bean definitions for the MethodSecurityMetadataSourceAdvisor.
Create a Java method that does the following: "Register bean definitions for the MethodSecurityMetadataSourceAdvisor.".
Of course, here is the Java code you requested: ```java public void registerBeanDefinitions(AnnotationMetadata importingClassMetadata, BeanDefinitionRegistry registry) { BeanDefinitionBuilder advisor = BeanDefinitionBuilder .rootBeanDefinition(MethodSecurityMetadataSourceAdvisor.class); advisor.setRole(Bea...
icode/ameba
src/main/java/ameba/db/ebean/internal/ModelInterceptor.java
ModelInterceptor.applyPageConfig
public static void applyPageConfig(MultivaluedMap<String, String> queryParams, Query query) { Integer maxRows = getSingleIntegerParam(queryParams.get(PER_PAGE_PARAM_NAME)); if (maxRows == null && DEFAULT_PER_PAGE != null && DEFAULT_PER_PAGE > 0) { maxRows = DEFAULT_PER_PAGE; } ...
java
public static void applyPageConfig(MultivaluedMap<String, String> queryParams, Query query) { Integer maxRows = getSingleIntegerParam(queryParams.get(PER_PAGE_PARAM_NAME)); if (maxRows == null && DEFAULT_PER_PAGE != null && DEFAULT_PER_PAGE > 0) { maxRows = DEFAULT_PER_PAGE; } ...
[ "public", "static", "void", "applyPageConfig", "(", "MultivaluedMap", "<", "String", ",", "String", ">", "queryParams", ",", "Query", "query", ")", "{", "Integer", "maxRows", "=", "getSingleIntegerParam", "(", "queryParams", ".", "get", "(", "PER_PAGE_PARAM_NAME",...
<p>applyPageConfig.</p> @param queryParams a {@link javax.ws.rs.core.MultivaluedMap} object. @param query a {@link io.ebean.Query} object.
[ "<p", ">", "applyPageConfig", ".", "<", "/", "p", ">" ]
9d4956e935898e41331b2745e400ef869cd265e0
https://github.com/icode/ameba/blob/9d4956e935898e41331b2745e400ef869cd265e0/src/main/java/ameba/db/ebean/internal/ModelInterceptor.java#L283-L309
train
Apply page config to query
Create a Java method that does the following: "Apply page config to query".
Of course, here is the Java code you requested: ```java public static void applyPageConfig(MultivaluedMap<String, String> queryParams, Query query) { Integer maxRows = getSingleIntegerParam(queryParams.get(PER_PAGE_PARAM_NAME)); if (maxRows == null && DEFAULT_PER_PAGE != null && DEFAULT_PER_PAGE > 0) ...
tango-controls/JTango
dao/src/main/java/fr/esrf/TangoDs/PollThread.java
PollThread.insert_in_list
void insert_in_list(final WorkItem new_work) { int i; boolean done = false; for (i = 0; i < works.size() && !done; i++) { final WorkItem item = (WorkItem) works.elementAt(i); if (item.wake_up_date.tv_sec < new_work.wake_up_date.tv_sec) { continue; } else if (item.wake_up_date.tv_sec == new_work.wake...
java
void insert_in_list(final WorkItem new_work) { int i; boolean done = false; for (i = 0; i < works.size() && !done; i++) { final WorkItem item = (WorkItem) works.elementAt(i); if (item.wake_up_date.tv_sec < new_work.wake_up_date.tv_sec) { continue; } else if (item.wake_up_date.tv_sec == new_work.wake...
[ "void", "insert_in_list", "(", "final", "WorkItem", "new_work", ")", "{", "int", "i", ";", "boolean", "done", "=", "false", ";", "for", "(", "i", "=", "0", ";", "i", "<", "works", ".", "size", "(", ")", "&&", "!", "done", ";", "i", "++", ")", "...
===============================================================
[ "===============================================================" ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/dao/src/main/java/fr/esrf/TangoDs/PollThread.java#L298-L320
train
Insert a new work in the list.
Create a Java method that does the following: "Insert a new work in the list.".
Of course, here is the Java code you requested: ```java void insert_in_list(final WorkItem new_work) { int i; boolean done = false; for (i = 0; i < works.size() && !done; i++) { final WorkItem item = (WorkItem) works.elementAt(i); if (item.wake_up_date.tv_sec < new_work.wake_up_date.tv_sec) { continue; ...
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/qjournal/server/Journal.java
Journal.formatJournal
private void formatJournal(NamespaceInfo nsInfo) throws IOException { Preconditions.checkState(nsInfo.getNamespaceID() != 0, "can't format with uninitialized namespace info: %s", nsInfo.toColonSeparatedString()); LOG.info("Formatting journal" + this.getJournalId() + " with namespace info...
java
private void formatJournal(NamespaceInfo nsInfo) throws IOException { Preconditions.checkState(nsInfo.getNamespaceID() != 0, "can't format with uninitialized namespace info: %s", nsInfo.toColonSeparatedString()); LOG.info("Formatting journal" + this.getJournalId() + " with namespace info...
[ "private", "void", "formatJournal", "(", "NamespaceInfo", "nsInfo", ")", "throws", "IOException", "{", "Preconditions", ".", "checkState", "(", "nsInfo", ".", "getNamespaceID", "(", ")", "!=", "0", ",", "\"can't format with uninitialized namespace info: %s\"", ",", "n...
Format the local storage with the given namespace.
[ "Format", "the", "local", "storage", "with", "the", "given", "namespace", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/qjournal/server/Journal.java#L377-L386
train
Format the cache with the given namespace info.
Create a Java method that does the following: "Format the cache with the given namespace info.".
Of course, here is the Java code you requested: ```java private void formatJournal(NamespaceInfo nsInfo) throws IOException { Preconditions.checkState(nsInfo.getNamespaceID() != 0, "can't format with uninitialized namespace info: %s", nsInfo.toColonSeparatedString()); LOG.info("Formatting journ...
jenetics/jenetics
jenetics.ext/src/main/java/io/jenetics/ext/moea/ParetoFront.java
ParetoFront.toParetoFront
public static <C extends Comparable<? super C>> Collector<C, ?, ParetoFront<C>> toParetoFront() { return toParetoFront(Comparator.naturalOrder()); }
java
public static <C extends Comparable<? super C>> Collector<C, ?, ParetoFront<C>> toParetoFront() { return toParetoFront(Comparator.naturalOrder()); }
[ "public", "static", "<", "C", "extends", "Comparable", "<", "?", "super", "C", ">", ">", "Collector", "<", "C", ",", "?", ",", "ParetoFront", "<", "C", ">", ">", "toParetoFront", "(", ")", "{", "return", "toParetoFront", "(", "Comparator", ".", "natura...
Return a pareto-front collector. The natural order of the elements is used as pareto-dominance order. @param <C> the element type @return a new pareto-front collector
[ "Return", "a", "pareto", "-", "front", "collector", ".", "The", "natural", "order", "of", "the", "elements", "is", "used", "as", "pareto", "-", "dominance", "order", "." ]
ee516770c65ef529b27deb283f071c85f344eff4
https://github.com/jenetics/jenetics/blob/ee516770c65ef529b27deb283f071c85f344eff4/jenetics.ext/src/main/java/io/jenetics/ext/moea/ParetoFront.java#L228-L231
train
Get a ParetoFront collector.
Create a Java method that does the following: "Get a ParetoFront collector.".
Of course, here is the Java code you requested: ```java public static <C extends Comparable<? super C>> Collector<C, ?, ParetoFront<C>> toParetoFront() { return toParetoFront(Comparator.naturalOrder()); } ``` Hope this helps!
alibaba/otter
manager/biz/src/main/java/com/alibaba/otter/manager/biz/config/datamedia/impl/DataMediaServiceImpl.java
DataMediaServiceImpl.createReturnId
@Override public Long createReturnId(DataMedia dataMedia) { Assert.assertNotNull(dataMedia); try { DataMediaDO dataMediaDo = modelToDo(dataMedia); dataMediaDo.setId(0L); DataMediaDO dataMediaDoInDb = dataMediaDao.checkUniqueAndReturnExist(dataMediaDo); ...
java
@Override public Long createReturnId(DataMedia dataMedia) { Assert.assertNotNull(dataMedia); try { DataMediaDO dataMediaDo = modelToDo(dataMedia); dataMediaDo.setId(0L); DataMediaDO dataMediaDoInDb = dataMediaDao.checkUniqueAndReturnExist(dataMediaDo); ...
[ "@", "Override", "public", "Long", "createReturnId", "(", "DataMedia", "dataMedia", ")", "{", "Assert", ".", "assertNotNull", "(", "dataMedia", ")", ";", "try", "{", "DataMediaDO", "dataMediaDo", "=", "modelToDo", "(", "dataMedia", ")", ";", "dataMediaDo", "."...
添加
[ "添加" ]
c7b5f94a0dd162e01ddffaf3a63cade7d23fca55
https://github.com/alibaba/otter/blob/c7b5f94a0dd162e01ddffaf3a63cade7d23fca55/manager/biz/src/main/java/com/alibaba/otter/manager/biz/config/datamedia/impl/DataMediaServiceImpl.java#L115-L134
train
Create a new return id.
Create a Java method that does the following: "Create a new return id.".
Of course, here is the Java code you requested: ```java @Override public Long createReturnId(DataMedia dataMedia) { Assert.assertNotNull(dataMedia); try { DataMediaDO dataMediaDo = modelToDo(dataMedia); dataMediaDo.setId(0L); DataMediaDO dataMediaDoInDb = dataMed...
graphql-java/graphql-java
src/main/java/graphql/execution/ExecutionStrategy.java
ExecutionStrategy.resolveField
protected CompletableFuture<ExecutionResult> resolveField(ExecutionContext executionContext, ExecutionStrategyParameters parameters) { return resolveFieldWithInfo(executionContext, parameters).thenCompose(FieldValueInfo::getFieldValue); }
java
protected CompletableFuture<ExecutionResult> resolveField(ExecutionContext executionContext, ExecutionStrategyParameters parameters) { return resolveFieldWithInfo(executionContext, parameters).thenCompose(FieldValueInfo::getFieldValue); }
[ "protected", "CompletableFuture", "<", "ExecutionResult", ">", "resolveField", "(", "ExecutionContext", "executionContext", ",", "ExecutionStrategyParameters", "parameters", ")", "{", "return", "resolveFieldWithInfo", "(", "executionContext", ",", "parameters", ")", ".", ...
Called to fetch a value for a field and resolve it further in terms of the graphql query. This will call #fetchField followed by #completeField and the completed {@link ExecutionResult} is returned. <p> An execution strategy can iterate the fields to be executed and call this method for each one <p> Graphql fragments ...
[ "Called", "to", "fetch", "a", "value", "for", "a", "field", "and", "resolve", "it", "further", "in", "terms", "of", "the", "graphql", "query", ".", "This", "will", "call", "#fetchField", "followed", "by", "#completeField", "and", "the", "completed", "{", "...
9214b6044317849388bd88a14b54fc1c18c9f29f
https://github.com/graphql-java/graphql-java/blob/9214b6044317849388bd88a14b54fc1c18c9f29f/src/main/java/graphql/execution/ExecutionStrategy.java#L169-L171
train
Resolves the field with the given parameters.
Create a Java method that does the following: "Resolves the field with the given parameters.".
Of course, here is the Java code you requested: ```java protected CompletableFuture<ExecutionResult> resolveField(ExecutionContext executionContext, ExecutionStrategyParameters parameters) { return resolveFieldWithInfo(executionContext, parameters).thenCompose(FieldValueInfo::getFieldValue); } ``` Hope th...
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/ICUResourceBundle.java
ICUResourceBundle.getLocaleList
public static final Locale[] getLocaleList(ULocale[] ulocales) { ArrayList<Locale> list = new ArrayList<Locale>(ulocales.length); HashSet<Locale> uniqueSet = new HashSet<Locale>(); for (int i = 0; i < ulocales.length; i++) { Locale loc = ulocales[i].toLocale(); if (!uniqu...
java
public static final Locale[] getLocaleList(ULocale[] ulocales) { ArrayList<Locale> list = new ArrayList<Locale>(ulocales.length); HashSet<Locale> uniqueSet = new HashSet<Locale>(); for (int i = 0; i < ulocales.length; i++) { Locale loc = ulocales[i].toLocale(); if (!uniqu...
[ "public", "static", "final", "Locale", "[", "]", "getLocaleList", "(", "ULocale", "[", "]", "ulocales", ")", "{", "ArrayList", "<", "Locale", ">", "list", "=", "new", "ArrayList", "<", "Locale", ">", "(", "ulocales", ".", "length", ")", ";", "HashSet", ...
Convert a list of ULocales to a list of Locales. ULocales with a script code will not be converted since they cannot be represented as a Locale. This means that the two lists will <b>not</b> match one-to-one, and that the returned list might be shorter than the input list. @param ulocales a list of ULocales to conver...
[ "Convert", "a", "list", "of", "ULocales", "to", "a", "list", "of", "Locales", ".", "ULocales", "with", "a", "script", "code", "will", "not", "be", "converted", "since", "they", "cannot", "be", "represented", "as", "a", "Locale", ".", "This", "means", "th...
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/ICUResourceBundle.java#L510-L521
train
Gets the Locale list.
Create a Java method that does the following: "Gets the Locale list.".
Of course, here is the Java code you requested: ```java public static final Locale[] getLocaleList(ULocale[] ulocales) { ArrayList<Locale> list = new ArrayList<Locale>(ulocales.length); HashSet<Locale> uniqueSet = new HashSet<Locale>(); for (int i = 0; i < ulocales.length; i++) { Lo...
YahooArchive/samoa
samoa-s4/src/main/java/com/yahoo/labs/samoa/topology/impl/S4DoTask.java
S4DoTask.onInit
@Override protected void onInit() { logger.info("DoTaskApp onInit"); // ConsoleReporters prints S4 metrics // MetricsRegistry mr = new MetricsRegistry(); // // CsvReporter.enable(new File(System.getProperty("user.home") // + "/monitor/"), 10, TimeUnit.SECONDS); ...
java
@Override protected void onInit() { logger.info("DoTaskApp onInit"); // ConsoleReporters prints S4 metrics // MetricsRegistry mr = new MetricsRegistry(); // // CsvReporter.enable(new File(System.getProperty("user.home") // + "/monitor/"), 10, TimeUnit.SECONDS); ...
[ "@", "Override", "protected", "void", "onInit", "(", ")", "{", "logger", ".", "info", "(", "\"DoTaskApp onInit\"", ")", ";", "// ConsoleReporters prints S4 metrics", "// MetricsRegistry mr = new MetricsRegistry();", "//", "// CsvReporter.enable(new File(System.getProperty(\"user....
/* (non-Javadoc) @see org.apache.s4.core.App#onInit()
[ "/", "*", "(", "non", "-", "Javadoc", ")" ]
540a2c30167ac85c432b593baabd5ca97e7e8a0f
https://github.com/YahooArchive/samoa/blob/540a2c30167ac85c432b593baabd5ca97e7e8a0f/samoa-s4/src/main/java/com/yahoo/labs/samoa/topology/impl/S4DoTask.java#L100-L159
train
Initialize the application.
Create a Java method that does the following: "Initialize the application.".
Of course, here is the Java code you requested: ```java @Override protected void onInit() { logger.info("DoTaskApp onInit"); // ConsoleReporters prints S4 metrics // MetricsRegistry mr = new MetricsRegistry(); // // CsvReporter.enable(new File(System.getProperty("user.home")...
couchbase/couchbase-lite-java
src/main/java/com/couchbase/lite/ValueIndexItem.java
ValueIndexItem.property
@NonNull public static ValueIndexItem property(@NonNull String property) { if (property == null) { throw new IllegalArgumentException("property cannot be null."); } return new ValueIndexItem(Expression.property(property)); }
java
@NonNull public static ValueIndexItem property(@NonNull String property) { if (property == null) { throw new IllegalArgumentException("property cannot be null."); } return new ValueIndexItem(Expression.property(property)); }
[ "@", "NonNull", "public", "static", "ValueIndexItem", "property", "(", "@", "NonNull", "String", "property", ")", "{", "if", "(", "property", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"property cannot be null.\"", ")", ";", "}", ...
Creates a value index item with the given property. @param property the property name @return The value index item
[ "Creates", "a", "value", "index", "item", "with", "the", "given", "property", "." ]
cb72c44186456e6191a9ad0a7feb310011d0b081
https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/ValueIndexItem.java#L33-L39
train
Create a value index item from a property expression.
Create a Java method that does the following: "Create a value index item from a property expression.".
Of course, here is the Java code you requested: ```java @NonNull public static ValueIndexItem property(@NonNull String property) { if (property == null) { throw new IllegalArgumentException("property cannot be null."); } return new ValueIndexItem(Expression.property(property)); ...
spotify/ssh-agent-proxy
src/main/java/com/spotify/sshagentproxy/Rsa.java
Rsa.from
static RSAPublicKey from(final byte[] key) throws InvalidKeyException, NoSuchAlgorithmException, InvalidKeySpecException { final String s = new String(key); final byte[] encoded; final String decoded; if (s.startsWith(RSA_LABEL)) { decoded = s.split(" ")[1]; encoded = Base64.decodeBas...
java
static RSAPublicKey from(final byte[] key) throws InvalidKeyException, NoSuchAlgorithmException, InvalidKeySpecException { final String s = new String(key); final byte[] encoded; final String decoded; if (s.startsWith(RSA_LABEL)) { decoded = s.split(" ")[1]; encoded = Base64.decodeBas...
[ "static", "RSAPublicKey", "from", "(", "final", "byte", "[", "]", "key", ")", "throws", "InvalidKeyException", ",", "NoSuchAlgorithmException", ",", "InvalidKeySpecException", "{", "final", "String", "s", "=", "new", "String", "(", "key", ")", ";", "final", "b...
Create an {@link RSAPublicKey} from bytes. @param key Array of bytes representing Rsa public key. @return {@link RSAPublicKey}
[ "Create", "an", "{" ]
b678792750c0157bd5ed3fb6a18895ff95effbc4
https://github.com/spotify/ssh-agent-proxy/blob/b678792750c0157bd5ed3fb6a18895ff95effbc4/src/main/java/com/spotify/sshagentproxy/Rsa.java#L61-L86
train
Create an RSA public key from a byte array.
Create a Java method that does the following: "Create an RSA public key from a byte array.".
Of course, here is the Java code you requested: ```java static RSAPublicKey from(final byte[] key) throws InvalidKeyException, NoSuchAlgorithmException, InvalidKeySpecException { final String s = new String(key); final byte[] encoded; final String decoded; if (s.startsWith(RSA_LABEL)) { de...
JOML-CI/JOML
src/org/joml/Intersectionf.java
Intersectionf.intersectRayAab
public static boolean intersectRayAab(Vector3fc origin, Vector3fc dir, Vector3fc min, Vector3fc max, Vector2f result) { return intersectRayAab(origin.x(), origin.y(), origin.z(), dir.x(), dir.y(), dir.z(), min.x(), min.y(), min.z(), max.x(), max.y(), max.z(), result); }
java
public static boolean intersectRayAab(Vector3fc origin, Vector3fc dir, Vector3fc min, Vector3fc max, Vector2f result) { return intersectRayAab(origin.x(), origin.y(), origin.z(), dir.x(), dir.y(), dir.z(), min.x(), min.y(), min.z(), max.x(), max.y(), max.z(), result); }
[ "public", "static", "boolean", "intersectRayAab", "(", "Vector3fc", "origin", ",", "Vector3fc", "dir", ",", "Vector3fc", "min", ",", "Vector3fc", "max", ",", "Vector2f", "result", ")", "{", "return", "intersectRayAab", "(", "origin", ".", "x", "(", ")", ",",...
Test whether the ray with the given <code>origin</code> and direction <code>dir</code> intersects the axis-aligned box specified as its minimum corner <code>min</code> and maximum corner <code>max</code>, and return the values of the parameter <i>t</i> in the ray equation <i>p(t) = origin + t * dir</i> of the near and ...
[ "Test", "whether", "the", "ray", "with", "the", "given", "<code", ">", "origin<", "/", "code", ">", "and", "direction", "<code", ">", "dir<", "/", "code", ">", "intersects", "the", "axis", "-", "aligned", "box", "specified", "as", "its", "minimum", "corn...
ce2652fc236b42bda3875c591f8e6645048a678f
https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Intersectionf.java#L2411-L2413
train
Intersects the ray AAB.
Create a Java method that does the following: "Intersects the ray AAB.".
Of course, here is the Java code you requested: ```java public static boolean intersectRayAab(Vector3fc origin, Vector3fc dir, Vector3fc min, Vector3fc max, Vector2f result) { return intersectRayAab(origin.x(), origin.y(), origin.z(), dir.x(), dir.y(), dir.z(), min.x(), min.y(), min.z(), max.x(), max.y(), max....
GeoLatte/geolatte-common
src/main/java/org/geolatte/common/dataformats/json/jackson/LineStringSerializer.java
LineStringSerializer.writeShapeSpecificSerialization
@Override public void writeShapeSpecificSerialization(LineString value, JsonGenerator jgen, SerializerProvider provider) throws IOException { jgen.writeFieldName("type"); jgen.writeString("LineString"); jgen.writeArrayFieldStart("coordinates"); // set beanproperty to null...
java
@Override public void writeShapeSpecificSerialization(LineString value, JsonGenerator jgen, SerializerProvider provider) throws IOException { jgen.writeFieldName("type"); jgen.writeString("LineString"); jgen.writeArrayFieldStart("coordinates"); // set beanproperty to null...
[ "@", "Override", "public", "void", "writeShapeSpecificSerialization", "(", "LineString", "value", ",", "JsonGenerator", "jgen", ",", "SerializerProvider", "provider", ")", "throws", "IOException", "{", "jgen", ".", "writeFieldName", "(", "\"type\"", ")", ";", "jgen"...
Method that can be called to ask implementation to serialize values of type this serializer handles. @param value Value to serialize; can not be null. @param jgen Generator used to output resulting Json content @param provider Provider that can be used to get serializers for serializing Objects value contains, ...
[ "Method", "that", "can", "be", "called", "to", "ask", "implementation", "to", "serialize", "values", "of", "type", "this", "serializer", "handles", "." ]
dc7f92b04d8c6cb706e78cb95e746d8f12089d95
https://github.com/GeoLatte/geolatte-common/blob/dc7f92b04d8c6cb706e78cb95e746d8f12089d95/src/main/java/org/geolatte/common/dataformats/json/jackson/LineStringSerializer.java#L60-L76
train
Write shape specific serialization.
Create a Java method that does the following: "Write shape specific serialization.".
Of course, here is the Java code you requested: ```java @Override public void writeShapeSpecificSerialization(LineString value, JsonGenerator jgen, SerializerProvider provider) throws IOException { jgen.writeFieldName("type"); jgen.writeString("LineString"); jgen.writeArrayField...
alkacon/opencms-core
src-gwt/org/opencms/ade/galleries/client/ui/A_CmsListTab.java
A_CmsListTab.searchTreeItem
protected CmsTreeItem searchTreeItem(CmsList<? extends I_CmsListItem> list, String categoryPath) { CmsTreeItem resultItem = (CmsTreeItem)list.getItem(categoryPath); // item is not in this tree level if (resultItem == null) { // if list is not empty for (int i = 0; i < li...
java
protected CmsTreeItem searchTreeItem(CmsList<? extends I_CmsListItem> list, String categoryPath) { CmsTreeItem resultItem = (CmsTreeItem)list.getItem(categoryPath); // item is not in this tree level if (resultItem == null) { // if list is not empty for (int i = 0; i < li...
[ "protected", "CmsTreeItem", "searchTreeItem", "(", "CmsList", "<", "?", "extends", "I_CmsListItem", ">", "list", ",", "String", "categoryPath", ")", "{", "CmsTreeItem", "resultItem", "=", "(", "CmsTreeItem", ")", "list", ".", "getItem", "(", "categoryPath", ")",...
Searches in the categories tree or list the item and returns it.<p> @param list the list of items to start from @param categoryPath the category id to search @return the category item widget
[ "Searches", "in", "the", "categories", "tree", "or", "list", "the", "item", "and", "returns", "it", ".", "<p", ">" ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/galleries/client/ui/A_CmsListTab.java#L675-L695
train
Search the tree item.
Create a Java method that does the following: "Search the tree item.".
Of course, here is the Java code you requested: ```java protected CmsTreeItem searchTreeItem(CmsList<? extends I_CmsListItem> list, String categoryPath) { CmsTreeItem resultItem = (CmsTreeItem)list.getItem(categoryPath); // item is not in this tree level if (resultItem == null) { /...
s1-platform/s1
s1-core/src/java/org/s1/objects/ObjectType.java
ObjectType.cast
static <T> T cast(Object obj, Class<T> type) { if (type == String.class) { if (obj == null) obj = ""; obj = obj.toString(); } else if (type == BigInteger.class) { if (obj == null || (""+obj).isEmpty()) obj = "0"; obj = new B...
java
static <T> T cast(Object obj, Class<T> type) { if (type == String.class) { if (obj == null) obj = ""; obj = obj.toString(); } else if (type == BigInteger.class) { if (obj == null || (""+obj).isEmpty()) obj = "0"; obj = new B...
[ "static", "<", "T", ">", "T", "cast", "(", "Object", "obj", ",", "Class", "<", "T", ">", "type", ")", "{", "if", "(", "type", "==", "String", ".", "class", ")", "{", "if", "(", "obj", "==", "null", ")", "obj", "=", "\"\"", ";", "obj", "=", ...
Cast object to type @param obj @param type @param <T> @return
[ "Cast", "object", "to", "type" ]
370101c13fef01af524bc171bcc1a97e5acc76e8
https://github.com/s1-platform/s1/blob/370101c13fef01af524bc171bcc1a97e5acc76e8/s1-core/src/java/org/s1/objects/ObjectType.java#L80-L160
train
Casts an object to a class of the specified type.
Create a Java method that does the following: "Casts an object to a class of the specified type.".
Of course, here is the Java code you requested: ```java static <T> T cast(Object obj, Class<T> type) { if (type == String.class) { if (obj == null) obj = ""; obj = obj.toString(); } else if (type == BigInteger.class) { if (obj == null || (""+obj).isEm...
powermock/powermock
powermock-api/powermock-api-support/src/main/java/org/powermock/api/support/ClassLoaderUtil.java
ClassLoaderUtil.loadClass
@SuppressWarnings("unchecked") public static <T> Class<T> loadClass(Class<T> type, ClassLoader classloader) { return loadClass(type.getName(), classloader); }
java
@SuppressWarnings("unchecked") public static <T> Class<T> loadClass(Class<T> type, ClassLoader classloader) { return loadClass(type.getName(), classloader); }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "static", "<", "T", ">", "Class", "<", "T", ">", "loadClass", "(", "Class", "<", "T", ">", "type", ",", "ClassLoader", "classloader", ")", "{", "return", "loadClass", "(", "type", ".", "getNam...
Loads a class with a specific classloader, wraps the {@link ClassNotFoundException} in a runtime exeception.
[ "Loads", "a", "class", "with", "a", "specific", "classloader", "wraps", "the", "{" ]
e8cd68026c284c6a7efe66959809eeebd8d1f9ad
https://github.com/powermock/powermock/blob/e8cd68026c284c6a7efe66959809eeebd8d1f9ad/powermock-api/powermock-api-support/src/main/java/org/powermock/api/support/ClassLoaderUtil.java#L24-L27
train
Load a class from a class loader.
Create a Java method that does the following: "Load a class from a class loader.".
Of course, here is the Java code you requested: ```java @SuppressWarnings("unchecked") public static <T> Class<T> loadClass(Class<T> type, ClassLoader classloader) { return loadClass(type.getName(), classloader); } ``` Hope this helps!
OpenLiberty/open-liberty
dev/wlp.lib.extract/src/wlp/lib/extract/SelfExtractor.java
SelfExtractor.obtainLicenseAgreement
private static boolean obtainLicenseAgreement(LicenseProvider licenseProvider) { // Prompt for word-wrapped display of license agreement & information boolean view; SelfExtract.wordWrappedOut(SelfExtract.format("showAgreement", "--viewLicenseAgreement")); view = SelfExtract.getResponse(...
java
private static boolean obtainLicenseAgreement(LicenseProvider licenseProvider) { // Prompt for word-wrapped display of license agreement & information boolean view; SelfExtract.wordWrappedOut(SelfExtract.format("showAgreement", "--viewLicenseAgreement")); view = SelfExtract.getResponse(...
[ "private", "static", "boolean", "obtainLicenseAgreement", "(", "LicenseProvider", "licenseProvider", ")", "{", "// Prompt for word-wrapped display of license agreement & information", "boolean", "view", ";", "SelfExtract", ".", "wordWrappedOut", "(", "SelfExtract", ".", "format...
Display and obtain agreement for the license terms
[ "Display", "and", "obtain", "agreement", "for", "the", "license", "terms" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/wlp.lib.extract/src/wlp/lib/extract/SelfExtractor.java#L1412-L1439
train
Obtain the license agreement and information from the license provider.
Create a Java method that does the following: "Obtain the license agreement and information from the license provider.".
Of course, here is the Java code you requested: ```java private static boolean obtainLicenseAgreement(LicenseProvider licenseProvider) { // Prompt for word-wrapped display of license agreement & information boolean view; SelfExtract.wordWrappedOut(SelfExtract.format("showAgreement", "--viewLic...
Mozu/mozu-java
mozu-javaasync-core/src/main/java/com/mozu/api/urls/commerce/customer/accounts/TransactionUrl.java
TransactionUrl.getTransactionsUrl
public static MozuUrl getTransactionsUrl(Integer accountId) { UrlFormatter formatter = new UrlFormatter("/api/commerce/customer/accounts/{accountId}/transactions"); formatter.formatUrl("accountId", accountId); return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ; }
java
public static MozuUrl getTransactionsUrl(Integer accountId) { UrlFormatter formatter = new UrlFormatter("/api/commerce/customer/accounts/{accountId}/transactions"); formatter.formatUrl("accountId", accountId); return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ; }
[ "public", "static", "MozuUrl", "getTransactionsUrl", "(", "Integer", "accountId", ")", "{", "UrlFormatter", "formatter", "=", "new", "UrlFormatter", "(", "\"/api/commerce/customer/accounts/{accountId}/transactions\"", ")", ";", "formatter", ".", "formatUrl", "(", "\"accou...
Get Resource Url for GetTransactions @param accountId Unique identifier of the customer account. @return String Resource Url
[ "Get", "Resource", "Url", "for", "GetTransactions" ]
5beadde73601a859f845e3e2fc1077b39c8bea83
https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-javaasync-core/src/main/java/com/mozu/api/urls/commerce/customer/accounts/TransactionUrl.java#L21-L26
train
Get Resource Url for GetTransactions
Create a Java method that does the following: "Get Resource Url for GetTransactions".
Of course, here is the Java code you requested: ```java public static MozuUrl getTransactionsUrl(Integer accountId) { UrlFormatter formatter = new UrlFormatter("/api/commerce/customer/accounts/{accountId}/transactions"); formatter.formatUrl("accountId", accountId); return new MozuUrl(formatter.getResourceUr...
aws/aws-sdk-java
aws-java-sdk-storagegateway/src/main/java/com/amazonaws/services/storagegateway/AWSStorageGatewayClient.java
AWSStorageGatewayClient.describeStorediSCSIVolumes
@Override public DescribeStorediSCSIVolumesResult describeStorediSCSIVolumes(DescribeStorediSCSIVolumesRequest request) { request = beforeClientExecution(request); return executeDescribeStorediSCSIVolumes(request); }
java
@Override public DescribeStorediSCSIVolumesResult describeStorediSCSIVolumes(DescribeStorediSCSIVolumesRequest request) { request = beforeClientExecution(request); return executeDescribeStorediSCSIVolumes(request); }
[ "@", "Override", "public", "DescribeStorediSCSIVolumesResult", "describeStorediSCSIVolumes", "(", "DescribeStorediSCSIVolumesRequest", "request", ")", "{", "request", "=", "beforeClientExecution", "(", "request", ")", ";", "return", "executeDescribeStorediSCSIVolumes", "(", "...
<p> Returns the description of the gateway volumes specified in the request. The list of gateway volumes in the request must be from one gateway. In the response Amazon Storage Gateway returns volume information sorted by volume ARNs. This operation is only supported in stored volume gateway type. </p> @param describe...
[ "<p", ">", "Returns", "the", "description", "of", "the", "gateway", "volumes", "specified", "in", "the", "request", ".", "The", "list", "of", "gateway", "volumes", "in", "the", "request", "must", "be", "from", "one", "gateway", ".", "In", "the", "response"...
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-storagegateway/src/main/java/com/amazonaws/services/storagegateway/AWSStorageGatewayClient.java#L2763-L2767
train
Returns a list of StorediSCSI volumes for a specific user.
Create a Java method that does the following: "Returns a list of StorediSCSI volumes for a specific user.".
Of course, here is the Java code you requested: ```java @Override public DescribeStorediSCSIVolumesResult describeStorediSCSIVolumes(DescribeStorediSCSIVolumesRequest request) { request = beforeClientExecution(request); return executeDescribeStorediSCSIVolumes(request); } ``` Hope this helps!
b3dgs/lionengine
lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/transition/TransitionsExtractorImpl.java
TransitionsExtractorImpl.getTransitions
@Override public Map<Transition, Collection<TileRef>> getTransitions(Collection<Media> levels, Media sheetsConfig, Media groupsConfig) { final Collection<MapTile> mapsSet = ...
java
@Override public Map<Transition, Collection<TileRef>> getTransitions(Collection<Media> levels, Media sheetsConfig, Media groupsConfig) { final Collection<MapTile> mapsSet = ...
[ "@", "Override", "public", "Map", "<", "Transition", ",", "Collection", "<", "TileRef", ">", ">", "getTransitions", "(", "Collection", "<", "Media", ">", "levels", ",", "Media", "sheetsConfig", ",", "Media", "groupsConfig", ")", "{", "final", "Collection", "...
/* TransitionsExtractor
[ "/", "*", "TransitionsExtractor" ]
cac3d5578532cf11724a737b9f09e71bf9995ab2
https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/transition/TransitionsExtractorImpl.java#L114-L131
train
Gets the transitions and feature maps from the levels.
Create a Java method that does the following: "Gets the transitions and feature maps from the levels.".
Of course, here is the Java code you requested: ```java @Override public Map<Transition, Collection<TileRef>> getTransitions(Collection<Media> levels, Media sheetsConfig, Media groupsCon...
tango-controls/JTango
dao/src/main/java/fr/esrf/TangoApi/events/NotifdEventConsumer.java
NotifdEventConsumer.reconnect_to_event
void reconnect_to_event(String name) { Enumeration callback_structs = event_callback_map.elements(); while (callback_structs.hasMoreElements()) { EventCallBackStruct callback_struct = (EventCallBackStruct) callback_structs.nextElement(); if (callback_struct.channel_name.equals(n...
java
void reconnect_to_event(String name) { Enumeration callback_structs = event_callback_map.elements(); while (callback_structs.hasMoreElements()) { EventCallBackStruct callback_struct = (EventCallBackStruct) callback_structs.nextElement(); if (callback_struct.channel_name.equals(n...
[ "void", "reconnect_to_event", "(", "String", "name", ")", "{", "Enumeration", "callback_structs", "=", "event_callback_map", ".", "elements", "(", ")", ";", "while", "(", "callback_structs", ".", "hasMoreElements", "(", ")", ")", "{", "EventCallBackStruct", "callb...
===============================================================
[ "===============================================================" ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/dao/src/main/java/fr/esrf/TangoApi/events/NotifdEventConsumer.java#L857-L873
train
Reconnect to an event
Create a Java method that does the following: "Reconnect to an event".
Of course, here is the Java code you requested: ```java void reconnect_to_event(String name) { Enumeration callback_structs = event_callback_map.elements(); while (callback_structs.hasMoreElements()) { EventCallBackStruct callback_struct = (EventCallBackStruct) callback_structs.nextElement...
baratine/baratine
web/src/main/java/com/caucho/v5/http/protocol/InContentLength.java
InContentLength.read
@Override public int read(byte []buffer, int offset, int length) throws IOException { try { if (_length < length) length = (int) _length; if (length <= 0) return -1; int len = _next.read(buffer, offset, length); if (len > 0) { _length -= len; } else { ...
java
@Override public int read(byte []buffer, int offset, int length) throws IOException { try { if (_length < length) length = (int) _length; if (length <= 0) return -1; int len = _next.read(buffer, offset, length); if (len > 0) { _length -= len; } else { ...
[ "@", "Override", "public", "int", "read", "(", "byte", "[", "]", "buffer", ",", "int", "offset", ",", "int", "length", ")", "throws", "IOException", "{", "try", "{", "if", "(", "_length", "<", "length", ")", "length", "=", "(", "int", ")", "_length",...
Reads from the buffer, limiting to the content length. @param buffer the buffer containing the results. @param offset the offset into the result buffer @param length the length of the buffer. @return the number of bytes read or -1 for the end of the file.
[ "Reads", "from", "the", "buffer", "limiting", "to", "the", "content", "length", "." ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/web/src/main/java/com/caucho/v5/http/protocol/InContentLength.java#L92-L116
train
read method for the base class
Create a Java method that does the following: "read method for the base class".
Of course, here is the Java code you requested: ```java @Override public int read(byte []buffer, int offset, int length) throws IOException { try { if (_length < length) length = (int) _length; if (length <= 0) return -1; int len = _next.read(buffer, offset, length); if...
opensourceBIM/BIMserver
PluginBase/generated/org/bimserver/models/ifc4/impl/Ifc4PackageImpl.java
Ifc4PackageImpl.getIfcTableRow
@Override public EClass getIfcTableRow() { if (ifcTableRowEClass == null) { ifcTableRowEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI).getEClassifiers() .get(697); } return ifcTableRowEClass; }
java
@Override public EClass getIfcTableRow() { if (ifcTableRowEClass == null) { ifcTableRowEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI).getEClassifiers() .get(697); } return ifcTableRowEClass; }
[ "@", "Override", "public", "EClass", "getIfcTableRow", "(", ")", "{", "if", "(", "ifcTableRowEClass", "==", "null", ")", "{", "ifcTableRowEClass", "=", "(", "EClass", ")", "EPackage", ".", "Registry", ".", "INSTANCE", ".", "getEPackage", "(", "Ifc4Package", ...
<!-- begin-user-doc --> <!-- end-user-doc --> @generated
[ "<!", "--", "begin", "-", "user", "-", "doc", "--", ">", "<!", "--", "end", "-", "user", "-", "doc", "--", ">" ]
116803c3047d1b32217366757cee1bb3880fda63
https://github.com/opensourceBIM/BIMserver/blob/116803c3047d1b32217366757cee1bb3880fda63/PluginBase/generated/org/bimserver/models/ifc4/impl/Ifc4PackageImpl.java#L35598-L35605
train
Get the IfcTableRowEClass attribute of the ifcTableRow class.
Create a Java method that does the following: "Get the IfcTableRowEClass attribute of the ifcTableRow class.".
Of course, here is the Java code you requested: ```java @Override public EClass getIfcTableRow() { if (ifcTableRowEClass == null) { ifcTableRowEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI).getEClassifiers() .get(697); } return ifcTableRowEClass; } ``` Hope this h...
threerings/nenya
core/src/main/java/com/threerings/miso/client/SceneBlock.java
SceneBlock.getBaseTile
public BaseTile getBaseTile (int tx, int ty) { BaseTile tile = _base[index(tx, ty)]; if (tile == null && _defset != null) { tile = (BaseTile)_defset.getTile( TileUtil.getTileHash(tx, ty) % _defset.getTileCount()); } return tile; }
java
public BaseTile getBaseTile (int tx, int ty) { BaseTile tile = _base[index(tx, ty)]; if (tile == null && _defset != null) { tile = (BaseTile)_defset.getTile( TileUtil.getTileHash(tx, ty) % _defset.getTileCount()); } return tile; }
[ "public", "BaseTile", "getBaseTile", "(", "int", "tx", ",", "int", "ty", ")", "{", "BaseTile", "tile", "=", "_base", "[", "index", "(", "tx", ",", "ty", ")", "]", ";", "if", "(", "tile", "==", "null", "&&", "_defset", "!=", "null", ")", "{", "til...
Returns the base tile at the specified coordinates or null if there's no tile at said coordinates.
[ "Returns", "the", "base", "tile", "at", "the", "specified", "coordinates", "or", "null", "if", "there", "s", "no", "tile", "at", "said", "coordinates", "." ]
3165a012fd859009db3367f87bd2a5b820cc760a
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/miso/client/SceneBlock.java#L288-L296
train
Get the base tile for the specified tile coordinates.
Create a Java method that does the following: "Get the base tile for the specified tile coordinates.".
Of course, here is the Java code you requested: ```java public BaseTile getBaseTile (int tx, int ty) { BaseTile tile = _base[index(tx, ty)]; if (tile == null && _defset != null) { tile = (BaseTile)_defset.getTile( TileUtil.getTileHash(tx, ty) % _defset.getTileCount()); ...
lettuce-io/lettuce-core
src/main/java/io/lettuce/core/cluster/PooledClusterConnectionProvider.java
PooledClusterConnectionProvider.resetFastConnectionCache
private void resetFastConnectionCache() { synchronized (stateLock) { Arrays.fill(writers, null); Arrays.fill(readers, null); } }
java
private void resetFastConnectionCache() { synchronized (stateLock) { Arrays.fill(writers, null); Arrays.fill(readers, null); } }
[ "private", "void", "resetFastConnectionCache", "(", ")", "{", "synchronized", "(", "stateLock", ")", "{", "Arrays", ".", "fill", "(", "writers", ",", "null", ")", ";", "Arrays", ".", "fill", "(", "readers", ",", "null", ")", ";", "}", "}" ]
Reset the internal connection cache. This is necessary because the {@link Partitions} have no reference to the connection cache. Synchronize on {@code stateLock} to initiate a happens-before relation and clear the thread caches of other threads.
[ "Reset", "the", "internal", "connection", "cache", ".", "This", "is", "necessary", "because", "the", "{", "@link", "Partitions", "}", "have", "no", "reference", "to", "the", "connection", "cache", "." ]
b6de74e384dea112e3656684ca3f50cdfd6c8e0d
https://github.com/lettuce-io/lettuce-core/blob/b6de74e384dea112e3656684ca3f50cdfd6c8e0d/src/main/java/io/lettuce/core/cluster/PooledClusterConnectionProvider.java#L586-L592
train
Reset the fast connection cache.
Create a Java method that does the following: "Reset the fast connection cache.".
Of course, here is the Java code you requested: ```java private void resetFastConnectionCache() { synchronized (stateLock) { Arrays.fill(writers, null); Arrays.fill(readers, null); } } ``` Hope this helps!
enioka/jqm
jqm-all/jqm-runner/jqm-runner-java/src/main/java/com/enioka/jqm/tools/PayloadClassLoader.java
PayloadClassLoader.launchJar
void launchJar(JobInstance job, Map<String, String> parameters, ClassloaderManager clm, EngineApiProxy h) throws JobRunnerException { // 1 - Create the proxy. Object proxy = null; Class injInt; try { injInt = this.loadClass("com.enioka.jqm.api.JobManager"); ...
java
void launchJar(JobInstance job, Map<String, String> parameters, ClassloaderManager clm, EngineApiProxy h) throws JobRunnerException { // 1 - Create the proxy. Object proxy = null; Class injInt; try { injInt = this.loadClass("com.enioka.jqm.api.JobManager"); ...
[ "void", "launchJar", "(", "JobInstance", "job", ",", "Map", "<", "String", ",", "String", ">", "parameters", ",", "ClassloaderManager", "clm", ",", "EngineApiProxy", "h", ")", "throws", "JobRunnerException", "{", "// 1 - Create the proxy.", "Object", "proxy", "=",...
Everything here can run without the database. @param job the JI to run. @param parameters already resolved runtime parameters @param clm the CLM having created this CL. @param h given as parameter because its constructor needs the database. @throws JqmEngineException
[ "Everything", "here", "can", "run", "without", "the", "database", "." ]
391733b8e291404b97c714c3727a241c4a861f98
https://github.com/enioka/jqm/blob/391733b8e291404b97c714c3727a241c4a861f98/jqm-all/jqm-runner/jqm-runner-java/src/main/java/com/enioka/jqm/tools/PayloadClassLoader.java#L93-L240
train
Launch the job.
Create a Java method that does the following: "Launch the job.".
Of course, here is the Java code you requested: ```java void launchJar(JobInstance job, Map<String, String> parameters, ClassloaderManager clm, EngineApiProxy h) throws JobRunnerException { // 1 - Create the proxy. Object proxy = null; Class injInt; try { injInt ...
zxing/zxing
core/src/main/java/com/google/zxing/oned/OneDReader.java
OneDReader.doDecode
private Result doDecode(BinaryBitmap image, Map<DecodeHintType,?> hints) throws NotFoundException { int width = image.getWidth(); int height = image.getHeight(); BitArray row = new BitArray(width); boolean tryHarder = hints != null && hints.containsKey(DecodeHintType.TRY_HARDE...
java
private Result doDecode(BinaryBitmap image, Map<DecodeHintType,?> hints) throws NotFoundException { int width = image.getWidth(); int height = image.getHeight(); BitArray row = new BitArray(width); boolean tryHarder = hints != null && hints.containsKey(DecodeHintType.TRY_HARDE...
[ "private", "Result", "doDecode", "(", "BinaryBitmap", "image", ",", "Map", "<", "DecodeHintType", ",", "?", ">", "hints", ")", "throws", "NotFoundException", "{", "int", "width", "=", "image", ".", "getWidth", "(", ")", ";", "int", "height", "=", "image", ...
We're going to examine rows from the middle outward, searching alternately above and below the middle, and farther out each time. rowStep is the number of rows between each successive attempt above and below the middle. So we'd scan row middle, then middle - rowStep, then middle + rowStep, then middle - (2 * rowStep), ...
[ "We", "re", "going", "to", "examine", "rows", "from", "the", "middle", "outward", "searching", "alternately", "above", "and", "below", "the", "middle", "and", "farther", "out", "each", "time", ".", "rowStep", "is", "the", "number", "of", "rows", "between", ...
653ac2a3beb11481eff82e7d5f2bab8a745f7fac
https://github.com/zxing/zxing/blob/653ac2a3beb11481eff82e7d5f2bab8a745f7fac/core/src/main/java/com/google/zxing/oned/OneDReader.java#L103-L175
train
This method is called by the decode method to perform the actual decoding.
Create a Java method that does the following: "This method is called by the decode method to perform the actual decoding.".
Of course, here is the Java code you requested: ```java private Result doDecode(BinaryBitmap image, Map<DecodeHintType,?> hints) throws NotFoundException { int width = image.getWidth(); int height = image.getHeight(); BitArray row = new BitArray(width); boolean tryHarder = hi...
lessthanoptimal/GeoRegression
main/src/georegression/geometry/UtilPoint3D_F64.java
UtilPoint3D_F64.distance
public static double distance( double x0 , double y0 , double z0 , double x1 , double y1 , double z1) { return norm(x1-x0,y1-y0,z1-z0); }
java
public static double distance( double x0 , double y0 , double z0 , double x1 , double y1 , double z1) { return norm(x1-x0,y1-y0,z1-z0); }
[ "public", "static", "double", "distance", "(", "double", "x0", ",", "double", "y0", ",", "double", "z0", ",", "double", "x1", ",", "double", "y1", ",", "double", "z1", ")", "{", "return", "norm", "(", "x1", "-", "x0", ",", "y1", "-", "y0", ",", "...
Euclidean distance between the two specified points @param x0 x-axis on Point 0 @param y0 y-axis on Point 0 @param z0 z-axis on Point 0 @param x1 x-axis on Point 1 @param y1 y-axis on Point 1 @param z1 z-axis on Point 1 @return Euclidean distance
[ "Euclidean", "distance", "between", "the", "two", "specified", "points" ]
c067cd44a4e95bd826119f6e658bd82386ef289f
https://github.com/lessthanoptimal/GeoRegression/blob/c067cd44a4e95bd826119f6e658bd82386ef289f/main/src/georegression/geometry/UtilPoint3D_F64.java#L47-L50
test
Compute the distance between two points.
Create a Java method that does the following: "Compute the distance between two points.".
Of course, here is the Java code you requested: ```java public static double distance( double x0 , double y0 , double z0 , double x1 , double y1 , double z1) { return norm(x1-x0,y1-y0,z1-z0); } ``` Hope this helps!
facebook/fresco
drawee/src/main/java/com/facebook/drawee/generic/WrappingUtils.java
WrappingUtils.applyLeafRounding
private static Drawable applyLeafRounding( Drawable drawable, RoundingParams roundingParams, Resources resources) { if (drawable instanceof BitmapDrawable) { final BitmapDrawable bitmapDrawable = (BitmapDrawable) drawable; RoundedBitmapDrawable roundedBitmapDrawable = new Rou...
java
private static Drawable applyLeafRounding( Drawable drawable, RoundingParams roundingParams, Resources resources) { if (drawable instanceof BitmapDrawable) { final BitmapDrawable bitmapDrawable = (BitmapDrawable) drawable; RoundedBitmapDrawable roundedBitmapDrawable = new Rou...
[ "private", "static", "Drawable", "applyLeafRounding", "(", "Drawable", "drawable", ",", "RoundingParams", "roundingParams", ",", "Resources", "resources", ")", "{", "if", "(", "drawable", "instanceof", "BitmapDrawable", ")", "{", "final", "BitmapDrawable", "bitmapDraw...
Rounds the given drawable with a {@link RoundedBitmapDrawable} or {@link RoundedColorDrawable}. <p> If the given drawable is not a {@link BitmapDrawable} or a {@link ColorDrawable}, it is returned without being rounded. @return the rounded drawable, or the original drawable if rounding didn't take place
[ "Rounds", "the", "given", "drawable", "with", "a", "{", "@link", "RoundedBitmapDrawable", "}", "or", "{", "@link", "RoundedColorDrawable", "}", "." ]
0b85879d51c5036d5e46e627a6651afefc0b971a
https://github.com/facebook/fresco/blob/0b85879d51c5036d5e46e627a6651afefc0b971a/drawee/src/main/java/com/facebook/drawee/generic/WrappingUtils.java#L295-L324
train
This method is used to apply the leaf rounding to a drawable.
Create a Java method that does the following: "This method is used to apply the leaf rounding to a drawable.".
Of course, here is the Java code you requested: ```java private static Drawable applyLeafRounding( Drawable drawable, RoundingParams roundingParams, Resources resources) { if (drawable instanceof BitmapDrawable) { final BitmapDrawable bitmapDrawable = (BitmapDrawable) drawable; Rounde...
mygreen/xlsmapper
src/main/java/com/gh/mygreen/xlsmapper/fieldprocessor/impl/VerticalRecordsProcessor.java
VerticalRecordsProcessor.isAvailabledRecord
private boolean isAvailabledRecord(final Optional<Method> ignoreMethod, final Object record) throws AnnotationReadException, AnnotationInvalidException { if(!ignoreMethod.isPresent()) { // 判定用のメソッドが存在しない場合 return true; } try { boolean ig...
java
private boolean isAvailabledRecord(final Optional<Method> ignoreMethod, final Object record) throws AnnotationReadException, AnnotationInvalidException { if(!ignoreMethod.isPresent()) { // 判定用のメソッドが存在しない場合 return true; } try { boolean ig...
[ "private", "boolean", "isAvailabledRecord", "(", "final", "Optional", "<", "Method", ">", "ignoreMethod", ",", "final", "Object", "record", ")", "throws", "AnnotationReadException", ",", "AnnotationInvalidException", "{", "if", "(", "!", "ignoreMethod", ".", "isPres...
レコードが有効かどうか判定する <p>アノテーション{@link XlsIgnorable}のメソッドで判定を行う。 @param ignoreMethod レコードの判定を無視するかどうかの判定に使用するメソッド @param record 判定対象のレコードのインスタンス。 @return trueの場合は有効。
[ "レコードが有効かどうか判定する", "<p", ">", "アノテーション", "{" ]
a0c6b25c622e5f3a50b199ef685d2ee46ad5483c
https://github.com/mygreen/xlsmapper/blob/a0c6b25c622e5f3a50b199ef685d2ee46ad5483c/src/main/java/com/gh/mygreen/xlsmapper/fieldprocessor/impl/VerticalRecordsProcessor.java#L791-L807
train
Is a record accessible by the ignoreable method?
Create a Java method that does the following: "Is a record accessible by the ignoreable method?".
Of course, here is the Java code you requested: ```java private boolean isAvailabledRecord(final Optional<Method> ignoreMethod, final Object record) throws AnnotationReadException, AnnotationInvalidException { if(!ignoreMethod.isPresent()) { // 判定用のメソッドが存在しない場合 return ...
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/Instant.java
Instant.minusMillis
public Instant minusMillis(long millisToSubtract) { if (millisToSubtract == Long.MIN_VALUE) { return plusMillis(Long.MAX_VALUE).plusMillis(1); } return plusMillis(-millisToSubtract); }
java
public Instant minusMillis(long millisToSubtract) { if (millisToSubtract == Long.MIN_VALUE) { return plusMillis(Long.MAX_VALUE).plusMillis(1); } return plusMillis(-millisToSubtract); }
[ "public", "Instant", "minusMillis", "(", "long", "millisToSubtract", ")", "{", "if", "(", "millisToSubtract", "==", "Long", ".", "MIN_VALUE", ")", "{", "return", "plusMillis", "(", "Long", ".", "MAX_VALUE", ")", ".", "plusMillis", "(", "1", ")", ";", "}", ...
Returns a copy of this instant with the specified duration in milliseconds subtracted. <p> This instance is immutable and unaffected by this method call. @param millisToSubtract the milliseconds to subtract, positive or negative @return an {@code Instant} based on this instant with the specified milliseconds subtract...
[ "Returns", "a", "copy", "of", "this", "instant", "with", "the", "specified", "duration", "in", "milliseconds", "subtracted", ".", "<p", ">", "This", "instance", "is", "immutable", "and", "unaffected", "by", "this", "method", "call", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/Instant.java#L1004-L1009
train
Gets a copy of this instant with the specified number of milliseconds subtracted.
Create a Java method that does the following: "Gets a copy of this instant with the specified number of milliseconds subtracted.".
Of course, here is the Java code you requested: ```java public Instant minusMillis(long millisToSubtract) { if (millisToSubtract == Long.MIN_VALUE) { return plusMillis(Long.MAX_VALUE).plusMillis(1); } return plusMillis(-millisToSubtract); } ``` Hope this helps!
OpenLiberty/open-liberty
dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/StatefulBeanO.java
StatefulBeanO.unlock
public final void unlock(Object lockObject) { // Only unlock the bean instance if it is in a state where it can be // made eligible for use on other threads. For example, for CM, this // might be when no longer in a transaction; for BM, this might be // when not in a method, etc. ...
java
public final void unlock(Object lockObject) { // Only unlock the bean instance if it is in a state where it can be // made eligible for use on other threads. For example, for CM, this // might be when no longer in a transaction; for BM, this might be // when not in a method, etc. ...
[ "public", "final", "void", "unlock", "(", "Object", "lockObject", ")", "{", "// Only unlock the bean instance if it is in a state where it can be", "// made eligible for use on other threads. For example, for CM, this", "// might be when no longer in a transaction; for BM, this might be", "/...
d650932
[ "d650932" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/StatefulBeanO.java#L1914-L1939
train
Unlock the specified object.
Create a Java method that does the following: "Unlock the specified object.".
Of course, here is the Java code you requested: ```java public final void unlock(Object lockObject) { // Only unlock the bean instance if it is in a state where it can be // made eligible for use on other threads. For example, for CM, this // might be when no longer in a transaction; for BM, th...
aws/aws-sdk-java
aws-java-sdk-ses/src/main/java/com/amazonaws/services/simpleemail/model/ListCustomVerificationEmailTemplatesResult.java
ListCustomVerificationEmailTemplatesResult.setCustomVerificationEmailTemplates
public void setCustomVerificationEmailTemplates(java.util.Collection<CustomVerificationEmailTemplate> customVerificationEmailTemplates) { if (customVerificationEmailTemplates == null) { this.customVerificationEmailTemplates = null; return; } this.customVerificationEmailT...
java
public void setCustomVerificationEmailTemplates(java.util.Collection<CustomVerificationEmailTemplate> customVerificationEmailTemplates) { if (customVerificationEmailTemplates == null) { this.customVerificationEmailTemplates = null; return; } this.customVerificationEmailT...
[ "public", "void", "setCustomVerificationEmailTemplates", "(", "java", ".", "util", ".", "Collection", "<", "CustomVerificationEmailTemplate", ">", "customVerificationEmailTemplates", ")", "{", "if", "(", "customVerificationEmailTemplates", "==", "null", ")", "{", "this", ...
<p> A list of the custom verification email templates that exist in your account. </p> @param customVerificationEmailTemplates A list of the custom verification email templates that exist in your account.
[ "<p", ">", "A", "list", "of", "the", "custom", "verification", "email", "templates", "that", "exist", "in", "your", "account", ".", "<", "/", "p", ">" ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-ses/src/main/java/com/amazonaws/services/simpleemail/model/ListCustomVerificationEmailTemplatesResult.java#L69-L76
train
Sets the value of the customVerificationEmailTemplates property.
Create a Java method that does the following: "Sets the value of the customVerificationEmailTemplates property.".
Of course, here is the Java code you requested: ```java public void setCustomVerificationEmailTemplates(java.util.Collection<CustomVerificationEmailTemplate> customVerificationEmailTemplates) { if (customVerificationEmailTemplates == null) { this.customVerificationEmailTemplates = null; ...
HanSolo/tilesfx
src/main/java/eu/hansolo/tilesfx/skins/TileSkin.java
TileSkin.initGraphics
protected void initGraphics() { // Set initial size if (Double.compare(tile.getPrefWidth(), 0.0) <= 0 || Double.compare(tile.getPrefHeight(), 0.0) <= 0 || Double.compare(tile.getWidth(), 0.0) <= 0 || Double.compare(tile.getHeight(), 0.0) <= 0) { if (tile.getPrefWidth() > 0 && til...
java
protected void initGraphics() { // Set initial size if (Double.compare(tile.getPrefWidth(), 0.0) <= 0 || Double.compare(tile.getPrefHeight(), 0.0) <= 0 || Double.compare(tile.getWidth(), 0.0) <= 0 || Double.compare(tile.getHeight(), 0.0) <= 0) { if (tile.getPrefWidth() > 0 && til...
[ "protected", "void", "initGraphics", "(", ")", "{", "// Set initial size", "if", "(", "Double", ".", "compare", "(", "tile", ".", "getPrefWidth", "(", ")", ",", "0.0", ")", "<=", "0", "||", "Double", ".", "compare", "(", "tile", ".", "getPrefHeight", "("...
******************** Initialization ************************************
[ "********************", "Initialization", "************************************" ]
36eb07b1119017beb851dad95256439224d1fcf4
https://github.com/HanSolo/tilesfx/blob/36eb07b1119017beb851dad95256439224d1fcf4/src/main/java/eu/hansolo/tilesfx/skins/TileSkin.java#L128-L163
train
Initialize the graphics.
Create a Java method that does the following: "Initialize the graphics.".
Of course, here is the Java code you requested: ```java protected void initGraphics() { // Set initial size if (Double.compare(tile.getPrefWidth(), 0.0) <= 0 || Double.compare(tile.getPrefHeight(), 0.0) <= 0 || Double.compare(tile.getWidth(), 0.0) <= 0 || Double.compare(tile.getHeight(), 0....
liferay/com-liferay-commerce
commerce-product-service/src/main/java/com/liferay/commerce/product/service/base/CPTaxCategoryServiceBaseImpl.java
CPTaxCategoryServiceBaseImpl.setCPInstanceLocalService
public void setCPInstanceLocalService( com.liferay.commerce.product.service.CPInstanceLocalService cpInstanceLocalService) { this.cpInstanceLocalService = cpInstanceLocalService; }
java
public void setCPInstanceLocalService( com.liferay.commerce.product.service.CPInstanceLocalService cpInstanceLocalService) { this.cpInstanceLocalService = cpInstanceLocalService; }
[ "public", "void", "setCPInstanceLocalService", "(", "com", ".", "liferay", ".", "commerce", ".", "product", ".", "service", ".", "CPInstanceLocalService", "cpInstanceLocalService", ")", "{", "this", ".", "cpInstanceLocalService", "=", "cpInstanceLocalService", ";", "}...
Sets the cp instance local service. @param cpInstanceLocalService the cp instance local service
[ "Sets", "the", "cp", "instance", "local", "service", "." ]
9e54362d7f59531fc684016ba49ee7cdc3a2f22b
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/base/CPTaxCategoryServiceBaseImpl.java#L566-L569
train
Sets the cp instance local service.
Create a Java method that does the following: "Sets the cp instance local service.".
Of course, here is the Java code you requested: ```java public void setCPInstanceLocalService( com.liferay.commerce.product.service.CPInstanceLocalService cpInstanceLocalService) { this.cpInstanceLocalService = cpInstanceLocalService; } ``` Hope this helps!
weld/core
environments/se/core/src/main/java/org/jboss/weld/environment/se/Weld.java
Weld.addExtension
public Weld addExtension(Extension extension) { extensions.add(new MetadataImpl<Extension>(extension, SYNTHETIC_LOCATION_PREFIX + extension.getClass().getName())); return this; }
java
public Weld addExtension(Extension extension) { extensions.add(new MetadataImpl<Extension>(extension, SYNTHETIC_LOCATION_PREFIX + extension.getClass().getName())); return this; }
[ "public", "Weld", "addExtension", "(", "Extension", "extension", ")", "{", "extensions", ".", "add", "(", "new", "MetadataImpl", "<", "Extension", ">", "(", "extension", ",", "SYNTHETIC_LOCATION_PREFIX", "+", "extension", ".", "getClass", "(", ")", ".", "getNa...
Add an extension to the set of extensions. @param extension an extension
[ "Add", "an", "extension", "to", "the", "set", "of", "extensions", "." ]
567a2eaf95b168597d23a56be89bf05a7834b2aa
https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/environments/se/core/src/main/java/org/jboss/weld/environment/se/Weld.java#L426-L429
train
Add an extension to the set of extensions.
Create a Java method that does the following: "Add an extension to the set of extensions.".
Of course, here is the Java code you requested: ```java public Weld addExtension(Extension extension) { extensions.add(new MetadataImpl<Extension>(extension, SYNTHETIC_LOCATION_PREFIX + extension.getClass().getName())); return this; } ``` Hope this helps!
gocd/gocd
base/src/main/java/com/thoughtworks/go/util/DirectoryScanner.java
DirectoryScanner.isIncluded
protected boolean isIncluded(String name) { ensureNonPatternSetsReady(); if (isCaseSensitive() ? includeNonPatterns.contains(name) : includeNonPatterns.contains(name.toUpperCase())) { return true; } for (int i = 0; i < includePatterns.length; i++) { ...
java
protected boolean isIncluded(String name) { ensureNonPatternSetsReady(); if (isCaseSensitive() ? includeNonPatterns.contains(name) : includeNonPatterns.contains(name.toUpperCase())) { return true; } for (int i = 0; i < includePatterns.length; i++) { ...
[ "protected", "boolean", "isIncluded", "(", "String", "name", ")", "{", "ensureNonPatternSetsReady", "(", ")", ";", "if", "(", "isCaseSensitive", "(", ")", "?", "includeNonPatterns", ".", "contains", "(", "name", ")", ":", "includeNonPatterns", ".", "contains", ...
Test whether or not a name matches against at least one include pattern. @param name The name to match. Must not be <code>null</code>. @return <code>true</code> when the name matches against at least one include pattern, or <code>false</code> otherwise.
[ "Test", "whether", "or", "not", "a", "name", "matches", "against", "at", "least", "one", "include", "pattern", "." ]
59a8480e23d6c06de39127635108dff57603cb71
https://github.com/gocd/gocd/blob/59a8480e23d6c06de39127635108dff57603cb71/base/src/main/java/com/thoughtworks/go/util/DirectoryScanner.java#L1176-L1190
train
Check if a name is included in the include patterns.
Create a Java method that does the following: "Check if a name is included in the include patterns.".
Of course, here is the Java code you requested: ```java protected boolean isIncluded(String name) { ensureNonPatternSetsReady(); if (isCaseSensitive() ? includeNonPatterns.contains(name) : includeNonPatterns.contains(name.toUpperCase())) { return true; } ...
sarl/sarl
sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/services/network/NetworkUtil.java
NetworkUtil.getLoopbackAddress
public static InetAddress getLoopbackAddress() { try { final Enumeration<NetworkInterface> interfaces = NetworkInterface.getNetworkInterfaces(); if (interfaces != null) { NetworkInterface inter; InetAddress adr; Enumeration<InetAddress> addrs; while (interfaces.hasMoreElements()) { inter = ...
java
public static InetAddress getLoopbackAddress() { try { final Enumeration<NetworkInterface> interfaces = NetworkInterface.getNetworkInterfaces(); if (interfaces != null) { NetworkInterface inter; InetAddress adr; Enumeration<InetAddress> addrs; while (interfaces.hasMoreElements()) { inter = ...
[ "public", "static", "InetAddress", "getLoopbackAddress", "(", ")", "{", "try", "{", "final", "Enumeration", "<", "NetworkInterface", ">", "interfaces", "=", "NetworkInterface", ".", "getNetworkInterfaces", "(", ")", ";", "if", "(", "interfaces", "!=", "null", ")...
Replies the IPv4 loopback address. @return the IPv4 loopback address or <code>null</code> if none.
[ "Replies", "the", "IPv4", "loopback", "address", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/services/network/NetworkUtil.java#L95-L119
train
Get the loopback address.
Create a Java method that does the following: "Get the loopback address.".
Of course, here is the Java code you requested: ```java public static InetAddress getLoopbackAddress() { try { final Enumeration<NetworkInterface> interfaces = NetworkInterface.getNetworkInterfaces(); if (interfaces != null) { NetworkInterface inter; InetAddress adr; Enumeration<InetAddress> addrs;...
google/closure-compiler
src/com/google/javascript/jscomp/LiveVariablesAnalysis.java
LiveVariablesAnalysis.addScopeVariables
private void addScopeVariables() { int num = 0; for (Var v : orderedVars) { scopeVariables.put(v.getName(), num); num++; } }
java
private void addScopeVariables() { int num = 0; for (Var v : orderedVars) { scopeVariables.put(v.getName(), num); num++; } }
[ "private", "void", "addScopeVariables", "(", ")", "{", "int", "num", "=", "0", ";", "for", "(", "Var", "v", ":", "orderedVars", ")", "{", "scopeVariables", ".", "put", "(", "v", ".", "getName", "(", ")", ",", "num", ")", ";", "num", "++", ";", "}...
Parameters belong to the function scope, but variables defined in the function body belong to the function body scope. Assign a unique index to each variable, regardless of which scope it's in.
[ "Parameters", "belong", "to", "the", "function", "scope", "but", "variables", "defined", "in", "the", "function", "body", "belong", "to", "the", "function", "body", "scope", ".", "Assign", "a", "unique", "index", "to", "each", "variable", "regardless", "of", ...
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/LiveVariablesAnalysis.java#L170-L176
train
Add scope variables to the scopeVariables map.
Create a Java method that does the following: "Add scope variables to the scopeVariables map.".
Of course, here is the Java code you requested: ```java private void addScopeVariables() { int num = 0; for (Var v : orderedVars) { scopeVariables.put(v.getName(), num); num++; } } ``` Hope this helps!
bazaarvoice/jolt
cli/src/main/java/com/bazaarvoice/jolt/JoltCliUtilities.java
JoltCliUtilities.printJsonObject
public static boolean printJsonObject( Object output, Boolean uglyPrint, boolean suppressOutput ) { try { if ( uglyPrint ) { printToStandardOut( JsonUtils.toJsonString( output ), suppressOutput ); } else { printToStandardOut( JsonUtils.toPrettyJsonString( ...
java
public static boolean printJsonObject( Object output, Boolean uglyPrint, boolean suppressOutput ) { try { if ( uglyPrint ) { printToStandardOut( JsonUtils.toJsonString( output ), suppressOutput ); } else { printToStandardOut( JsonUtils.toPrettyJsonString( ...
[ "public", "static", "boolean", "printJsonObject", "(", "Object", "output", ",", "Boolean", "uglyPrint", ",", "boolean", "suppressOutput", ")", "{", "try", "{", "if", "(", "uglyPrint", ")", "{", "printToStandardOut", "(", "JsonUtils", ".", "toJsonString", "(", ...
Prints the given json object to standard out, accounting for pretty printing and suppressed output. @param output The object to print. This method will fail if this object is not well formed JSON. @param uglyPrint ignore pretty print @param suppressOutput suppress output to standard out @return true if printing operat...
[ "Prints", "the", "given", "json", "object", "to", "standard", "out", "accounting", "for", "pretty", "printing", "and", "suppressed", "output", "." ]
4cf866a9f4222142da41b50dbcccce022a956bff
https://github.com/bazaarvoice/jolt/blob/4cf866a9f4222142da41b50dbcccce022a956bff/cli/src/main/java/com/bazaarvoice/jolt/JoltCliUtilities.java#L74-L86
train
Print a JSON object to standard out.
Create a Java method that does the following: "Print a JSON object to standard out.".
Of course, here is the Java code you requested: ```java public static boolean printJsonObject( Object output, Boolean uglyPrint, boolean suppressOutput ) { try { if ( uglyPrint ) { printToStandardOut( JsonUtils.toJsonString( output ), suppressOutput ); } else { ...
kefirfromperm/kefirbb
src/org/kefirsf/bb/proc/ProcUrl.java
ProcUrl.findIn
@Override public int findIn(Source source) { if (schemaless) { return -1; } int start = source.getOffset(); int sourceLength = source.length(); int index; int length = -1; do { index = sourceLength; // Prepare URL's prefi...
java
@Override public int findIn(Source source) { if (schemaless) { return -1; } int start = source.getOffset(); int sourceLength = source.length(); int index; int length = -1; do { index = sourceLength; // Prepare URL's prefi...
[ "@", "Override", "public", "int", "findIn", "(", "Source", "source", ")", "{", "if", "(", "schemaless", ")", "{", "return", "-", "1", ";", "}", "int", "start", "=", "source", ".", "getOffset", "(", ")", ";", "int", "sourceLength", "=", "source", ".",...
{@inheritDoc}
[ "{" ]
8c36fc3d3dc27459b0cdc179b87582df30420856
https://github.com/kefirfromperm/kefirbb/blob/8c36fc3d3dc27459b0cdc179b87582df30420856/src/org/kefirsf/bb/proc/ProcUrl.java#L53-L92
train
Find the first occurrence of a CRA - 2 SECTYPE in the source.
Create a Java method that does the following: "Find the first occurrence of a CRA - 2 SECTYPE in the source.".
Of course, here is the Java code you requested: ```java @Override public int findIn(Source source) { if (schemaless) { return -1; } int start = source.getOffset(); int sourceLength = source.length(); int index; int length = -1; do { ...
ddf-project/DDF
core/src/main/java/io/ddf/DDF.java
DDF.putObject
public String putObject(Object obj) { String objectId = UUID.randomUUID().toString(); cachedObjects.put(objectId, obj); return objectId; }
java
public String putObject(Object obj) { String objectId = UUID.randomUUID().toString(); cachedObjects.put(objectId, obj); return objectId; }
[ "public", "String", "putObject", "(", "Object", "obj", ")", "{", "String", "objectId", "=", "UUID", ".", "randomUUID", "(", ")", ".", "toString", "(", ")", ";", "cachedObjects", ".", "put", "(", "objectId", ",", "obj", ")", ";", "return", "objectId", "...
Save a given object in memory for later (quick server-side) retrieval @param obj @return
[ "Save", "a", "given", "object", "in", "memory", "for", "later", "(", "quick", "server", "-", "side", ")", "retrieval" ]
e4e68315dcec1ed8b287bf1ee73baa88e7e41eba
https://github.com/ddf-project/DDF/blob/e4e68315dcec1ed8b287bf1ee73baa88e7e41eba/core/src/main/java/io/ddf/DDF.java#L128-L132
train
Put a new object in the cache.
Create a Java method that does the following: "Put a new object in the cache.".
Of course, here is the Java code you requested: ```java public String putObject(Object obj) { String objectId = UUID.randomUUID().toString(); cachedObjects.put(objectId, obj); return objectId; } ``` Hope this helps!
fcrepo3/fcrepo
fcrepo-server/src/main/java/org/fcrepo/server/resourceIndex/ResourceIndexImpl.java
ResourceIndexImpl.getLocalizedTriple
private Triple getLocalizedTriple(Triple triple) { try { return _connector.getElementFactory().createTriple( getLocalizedResource(triple.getSubject()), getLocalizedResource(triple.getPredicate()), getLocalizedObject(triple.getObject())); ...
java
private Triple getLocalizedTriple(Triple triple) { try { return _connector.getElementFactory().createTriple( getLocalizedResource(triple.getSubject()), getLocalizedResource(triple.getPredicate()), getLocalizedObject(triple.getObject())); ...
[ "private", "Triple", "getLocalizedTriple", "(", "Triple", "triple", ")", "{", "try", "{", "return", "_connector", ".", "getElementFactory", "(", ")", ".", "createTriple", "(", "getLocalizedResource", "(", "triple", ".", "getSubject", "(", ")", ")", ",", "getLo...
Gets a Triple appropriate for writing to the store.
[ "Gets", "a", "Triple", "appropriate", "for", "writing", "to", "the", "store", "." ]
37df51b9b857fd12c6ab8269820d406c3c4ad774
https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-server/src/main/java/org/fcrepo/server/resourceIndex/ResourceIndexImpl.java#L220-L229
train
Get the localized triple.
Create a Java method that does the following: "Get the localized triple.".
Of course, here is the Java code you requested: ```java private Triple getLocalizedTriple(Triple triple) { try { return _connector.getElementFactory().createTriple( getLocalizedResource(triple.getSubject()), getLocalizedResource(triple.getPredicate()), ...
srikalyc/Sql4D
Sql4DCompiler/src/main/java/com/yahoo/sql4d/converter/druidGParser.java
druidGParser.aggFunc
public final String aggFunc() throws RecognitionException { String name = null; try { // druidG.g:470:2: ( LONG_SUM | DOUBLE_SUM | UNIQUE | HYPER_UNIQUE | MIN | MAX | JAVASCRIPT ) int alt199=7; switch ( input.LA(1) ) { case LONG_SUM: { alt199=1; } break; case DOUBLE_SUM: { a...
java
public final String aggFunc() throws RecognitionException { String name = null; try { // druidG.g:470:2: ( LONG_SUM | DOUBLE_SUM | UNIQUE | HYPER_UNIQUE | MIN | MAX | JAVASCRIPT ) int alt199=7; switch ( input.LA(1) ) { case LONG_SUM: { alt199=1; } break; case DOUBLE_SUM: { a...
[ "public", "final", "String", "aggFunc", "(", ")", "throws", "RecognitionException", "{", "String", "name", "=", "null", ";", "try", "{", "// druidG.g:470:2: ( LONG_SUM | DOUBLE_SUM | UNIQUE | HYPER_UNIQUE | MIN | MAX | JAVASCRIPT )", "int", "alt199", "=", "7", ";", "switc...
druidG.g:469:1: aggFunc returns [String name] : ( LONG_SUM | DOUBLE_SUM | UNIQUE | HYPER_UNIQUE | MIN | MAX | JAVASCRIPT );
[ "druidG", ".", "g", ":", "469", ":", "1", ":", "aggFunc", "returns", "[", "String", "name", "]", ":", "(", "LONG_SUM", "|", "DOUBLE_SUM", "|", "UNIQUE", "|", "HYPER_UNIQUE", "|", "MIN", "|", "MAX", "|", "JAVASCRIPT", ")", ";" ]
2c052fe60ead5a16277c798a3440de7d4f6f24f6
https://github.com/srikalyc/Sql4D/blob/2c052fe60ead5a16277c798a3440de7d4f6f24f6/Sql4DCompiler/src/main/java/com/yahoo/sql4d/converter/druidGParser.java#L6116-L6225
train
Use this method to perform an aggregation of the Hibernate expressions.
Create a Java method that does the following: "Use this method to perform an aggregation of the Hibernate expressions.".
Of course, here is the Java code you requested: ```java public final String aggFunc() throws RecognitionException { String name = null; try { // druidG.g:470:2: ( LONG_SUM | DOUBLE_SUM | UNIQUE | HYPER_UNIQUE | MIN | MAX | JAVASCRIPT ) int alt199=7; switch ( input.LA(1) ) { case LONG_SUM: { a...
aws/aws-sdk-java
aws-java-sdk-greengrass/src/main/java/com/amazonaws/services/greengrass/model/transform/CreateSoftwareUpdateJobRequestMarshaller.java
CreateSoftwareUpdateJobRequestMarshaller.marshall
public void marshall(CreateSoftwareUpdateJobRequest createSoftwareUpdateJobRequest, ProtocolMarshaller protocolMarshaller) { if (createSoftwareUpdateJobRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshalle...
java
public void marshall(CreateSoftwareUpdateJobRequest createSoftwareUpdateJobRequest, ProtocolMarshaller protocolMarshaller) { if (createSoftwareUpdateJobRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshalle...
[ "public", "void", "marshall", "(", "CreateSoftwareUpdateJobRequest", "createSoftwareUpdateJobRequest", ",", "ProtocolMarshaller", "protocolMarshaller", ")", "{", "if", "(", "createSoftwareUpdateJobRequest", "==", "null", ")", "{", "throw", "new", "SdkClientException", "(", ...
Marshall the given parameter object.
[ "Marshall", "the", "given", "parameter", "object", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-greengrass/src/main/java/com/amazonaws/services/greengrass/model/transform/CreateSoftwareUpdateJobRequestMarshaller.java#L55-L72
train
marshalls the given parameter object.
Create a Java method that does the following: "marshalls the given parameter object.".
Of course, here is the Java code you requested: ```java public void marshall(CreateSoftwareUpdateJobRequest createSoftwareUpdateJobRequest, ProtocolMarshaller protocolMarshaller) { if (createSoftwareUpdateJobRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"...
kiegroup/drools
drools-compiler/src/main/java/org/drools/compiler/rule/builder/dialect/java/parser/JavaParser.java
JavaParser.methodBody
public final void methodBody() throws RecognitionException { int methodBody_StartIndex = input.index(); try { if ( state.backtracking>0 && alreadyParsedRule(input, 59) ) { return; } // src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:579:5: ( block ) // src/main/resources/org/drools/co...
java
public final void methodBody() throws RecognitionException { int methodBody_StartIndex = input.index(); try { if ( state.backtracking>0 && alreadyParsedRule(input, 59) ) { return; } // src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:579:5: ( block ) // src/main/resources/org/drools/co...
[ "public", "final", "void", "methodBody", "(", ")", "throws", "RecognitionException", "{", "int", "methodBody_StartIndex", "=", "input", ".", "index", "(", ")", ";", "try", "{", "if", "(", "state", ".", "backtracking", ">", "0", "&&", "alreadyParsedRule", "("...
src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:578:1: methodBody : block ;
[ "src", "/", "main", "/", "resources", "/", "org", "/", "drools", "/", "compiler", "/", "semantics", "/", "java", "/", "parser", "/", "Java", ".", "g", ":", "578", ":", "1", ":", "methodBody", ":", "block", ";" ]
22b0275d6dbe93070b8090948502cf46eda543c4
https://github.com/kiegroup/drools/blob/22b0275d6dbe93070b8090948502cf46eda543c4/drools-compiler/src/main/java/org/drools/compiler/rule/builder/dialect/java/parser/JavaParser.java#L4929-L4954
train
Generates the method body of a method.
Create a Java method that does the following: "Generates the method body of a method.".
Of course, here is the Java code you requested: ```java public final void methodBody() throws RecognitionException { int methodBody_StartIndex = input.index(); try { if ( state.backtracking>0 && alreadyParsedRule(input, 59) ) { return; } // src/main/resources/org/drools/compiler/semantics/java/parser/Java....
ineunetOS/knife-commons
knife-commons-utils/src/main/java/com/ineunet/knife/util/CryptUtils.java
CryptUtils.encryptToMD5
public static String encryptToMD5(String info) { byte[] digesta = null; try { MessageDigest alga = MessageDigest.getInstance("MD5"); alga.update(info.getBytes()); digesta = alga.digest(); } catch (NoSuchAlgorithmException e) { e.printStackTrace(); } // to string return byte2hex(digesta); }
java
public static String encryptToMD5(String info) { byte[] digesta = null; try { MessageDigest alga = MessageDigest.getInstance("MD5"); alga.update(info.getBytes()); digesta = alga.digest(); } catch (NoSuchAlgorithmException e) { e.printStackTrace(); } // to string return byte2hex(digesta); }
[ "public", "static", "String", "encryptToMD5", "(", "String", "info", ")", "{", "byte", "[", "]", "digesta", "=", "null", ";", "try", "{", "MessageDigest", "alga", "=", "MessageDigest", ".", "getInstance", "(", "\"MD5\"", ")", ";", "alga", ".", "update", ...
进行MD5加密 @param info 要加密的信息 @return String 加密后的字符串
[ "进行MD5加密" ]
eae9e59afa020a00ae8977c10d43ac8ae46ae236
https://github.com/ineunetOS/knife-commons/blob/eae9e59afa020a00ae8977c10d43ac8ae46ae236/knife-commons-utils/src/main/java/com/ineunet/knife/util/CryptUtils.java#L47-L58
train
Encrypts the given string to MD5
Create a Java method that does the following: "Encrypts the given string to MD5".
Of course, here is the Java code you requested: ```java public static String encryptToMD5(String info) { byte[] digesta = null; try { MessageDigest alga = MessageDigest.getInstance("MD5"); alga.update(info.getBytes()); digesta = alga.digest(); } catch (NoSuchAlgorithmException e) { e.printStackTrace(...
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/DestinationManager.java
DestinationManager.callDestinationListener
private void callDestinationListener(String destinationName) throws SIResourceException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "callDestinationListener", new Object[] { destinationName }); DestinationListenerDataObject listenerDataObject = nul...
java
private void callDestinationListener(String destinationName) throws SIResourceException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "callDestinationListener", new Object[] { destinationName }); DestinationListenerDataObject listenerDataObject = nul...
[ "private", "void", "callDestinationListener", "(", "String", "destinationName", ")", "throws", "SIResourceException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", ...
/* This method will call the destination listener if the destination that is created meeting the criteria that the listener has set out.
[ "/", "*", "This", "method", "will", "call", "the", "destination", "listener", "if", "the", "destination", "that", "is", "created", "meeting", "the", "criteria", "that", "the", "listener", "has", "set", "out", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/DestinationManager.java#L7037-L7123
train
This method is called by the DestinationListener to call the destinationListener for the destination.
Create a Java method that does the following: "This method is called by the DestinationListener to call the destinationListener for the destination.".
Of course, here is the Java code you requested: ```java private void callDestinationListener(String destinationName) throws SIResourceException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "callDestinationListener", new Object[] { destinationName }); ...
OpenLiberty/open-liberty
dev/com.ibm.websphere.security.wim.base/src/com/ibm/wsspi/security/wim/model/LoginAccount.java
LoginAccount.getPropertyNames
public static synchronized List getPropertyNames(String entityTypeName) { if (propertyNames != null) { return propertyNames; } else { { List names = new ArrayList(); names.add(PROP_PRINCIPAL_NAME); names.add(PROP_PASSWORD); ...
java
public static synchronized List getPropertyNames(String entityTypeName) { if (propertyNames != null) { return propertyNames; } else { { List names = new ArrayList(); names.add(PROP_PRINCIPAL_NAME); names.add(PROP_PASSWORD); ...
[ "public", "static", "synchronized", "List", "getPropertyNames", "(", "String", "entityTypeName", ")", "{", "if", "(", "propertyNames", "!=", "null", ")", "{", "return", "propertyNames", ";", "}", "else", "{", "{", "List", "names", "=", "new", "ArrayList", "(...
Gets a list of all supported properties for this model object, <b>LoginAccount</b> @param entityTypeName allowed object is {@link String} @return returned object is {@link List}
[ "Gets", "a", "list", "of", "all", "supported", "properties", "for", "this", "model", "object", "<b", ">", "LoginAccount<", "/", "b", ">" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.websphere.security.wim.base/src/com/ibm/wsspi/security/wim/model/LoginAccount.java#L429-L444
train
Gets the property names.
Create a Java method that does the following: "Gets the property names.".
Of course, here is the Java code you requested: ```java public static synchronized List getPropertyNames(String entityTypeName) { if (propertyNames != null) { return propertyNames; } else { { List names = new ArrayList(); names.add(PROP_PRINCIPAL_...