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
apache/groovy
src/main/java/org/codehaus/groovy/vmplugin/v8/PluginDefaultGroovyMethods.java
PluginDefaultGroovyMethods.collect
public static <S,T> Optional<T> collect(Optional<S> self, @ClosureParams(FirstParam.FirstGenericType.class) Closure<T> transform) { Objects.requireNonNull(self); Objects.requireNonNull(transform); if (!self.isPresent()) { return self.empty(); } return Optional.ofNulla...
java
public static <S,T> Optional<T> collect(Optional<S> self, @ClosureParams(FirstParam.FirstGenericType.class) Closure<T> transform) { Objects.requireNonNull(self); Objects.requireNonNull(transform); if (!self.isPresent()) { return self.empty(); } return Optional.ofNulla...
[ "public", "static", "<", "S", ",", "T", ">", "Optional", "<", "T", ">", "collect", "(", "Optional", "<", "S", ">", "self", ",", "@", "ClosureParams", "(", "FirstParam", ".", "FirstGenericType", ".", "class", ")", "Closure", "<", "T", ">", "transform", ...
If the optional contains a value, returns an optional containing the transformed value obtained using the <code>transform</code> closure or otherwise an empty optional. <pre class="groovyTestCase"> assert Optional.of("foobar").collect{ it.size() }.get() == 6 assert !Optional.empty().collect{ it.size() }.isPresent() </p...
[ "If", "the", "optional", "contains", "a", "value", "returns", "an", "optional", "containing", "the", "transformed", "value", "obtained", "using", "the", "<code", ">", "transform<", "/", "code", ">", "closure", "or", "otherwise", "an", "empty", "optional", ".",...
71cf20addb611bb8d097a59e395fd20bc7f31772
https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/vmplugin/v8/PluginDefaultGroovyMethods.java#L76-L83
train
Collects an Optional of type T from the Optional.
Create a Java method that does the following: "Collects an Optional of type T from the Optional.".
Of course, here is the Java code you requested: ```java public static <S,T> Optional<T> collect(Optional<S> self, @ClosureParams(FirstParam.FirstGenericType.class) Closure<T> transform) { Objects.requireNonNull(self); Objects.requireNonNull(transform); if (!self.isPresent()) { retur...
tobato/FastDFS_Client
src/main/java/com/github/tobato/fastdfs/domain/proto/mapper/FdfsParamMapper.java
FdfsParamMapper.map
public static <T> T map(byte[] content, Class<T> genericType, Charset charset) { // 获取映射对象 ObjectMetaData objectMap = getObjectMap(genericType); if (LOGGER.isDebugEnabled()) { objectMap.dumpObjectMetaData(); } try { return mapByIndex(content, genericType,...
java
public static <T> T map(byte[] content, Class<T> genericType, Charset charset) { // 获取映射对象 ObjectMetaData objectMap = getObjectMap(genericType); if (LOGGER.isDebugEnabled()) { objectMap.dumpObjectMetaData(); } try { return mapByIndex(content, genericType,...
[ "public", "static", "<", "T", ">", "T", "map", "(", "byte", "[", "]", "content", ",", "Class", "<", "T", ">", "genericType", ",", "Charset", "charset", ")", "{", "// 获取映射对象", "ObjectMetaData", "objectMap", "=", "getObjectMap", "(", "genericType", ")", ";...
将byte解码为对象 @param content @param genericType @param charset @param <T> @return
[ "将byte解码为对象" ]
8e3bfe712f1739028beed7f3a6b2cc4579a231e4
https://github.com/tobato/FastDFS_Client/blob/8e3bfe712f1739028beed7f3a6b2cc4579a231e4/src/main/java/com/github/tobato/fastdfs/domain/proto/mapper/FdfsParamMapper.java#L44-L63
train
Map content to a single object.
Create a Java method that does the following: "Map content to a single object.".
Of course, here is the Java code you requested: ```java public static <T> T map(byte[] content, Class<T> genericType, Charset charset) { // 获取映射对象 ObjectMetaData objectMap = getObjectMap(genericType); if (LOGGER.isDebugEnabled()) { objectMap.dumpObjectMetaData(); } ...
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/network/nd6.java
nd6.add
public static base_response add(nitro_service client, nd6 resource) throws Exception { nd6 addresource = new nd6(); addresource.neighbor = resource.neighbor; addresource.mac = resource.mac; addresource.ifnum = resource.ifnum; addresource.vlan = resource.vlan; addresource.td = resource.td; return addresour...
java
public static base_response add(nitro_service client, nd6 resource) throws Exception { nd6 addresource = new nd6(); addresource.neighbor = resource.neighbor; addresource.mac = resource.mac; addresource.ifnum = resource.ifnum; addresource.vlan = resource.vlan; addresource.td = resource.td; return addresour...
[ "public", "static", "base_response", "add", "(", "nitro_service", "client", ",", "nd6", "resource", ")", "throws", "Exception", "{", "nd6", "addresource", "=", "new", "nd6", "(", ")", ";", "addresource", ".", "neighbor", "=", "resource", ".", "neighbor", ";"...
Use this API to add nd6.
[ "Use", "this", "API", "to", "add", "nd6", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/network/nd6.java#L230-L238
train
Use this API to add nd6.
Create a Java method that does the following: "Use this API to add nd6.".
Of course, here is the Java code you requested: ```java public static base_response add(nitro_service client, nd6 resource) throws Exception { nd6 addresource = new nd6(); addresource.neighbor = resource.neighbor; addresource.mac = resource.mac; addresource.ifnum = resource.ifnum; addresource.vlan = resource...
Erudika/para
para-core/src/main/java/com/erudika/para/core/User.java
User.isValidEmailConfirmationToken
public final boolean isValidEmailConfirmationToken(String token) { Sysprop s = CoreUtils.getInstance().getDao().read(getAppid(), identifier); return isValidToken(s, Config._EMAIL_TOKEN, token); }
java
public final boolean isValidEmailConfirmationToken(String token) { Sysprop s = CoreUtils.getInstance().getDao().read(getAppid(), identifier); return isValidToken(s, Config._EMAIL_TOKEN, token); }
[ "public", "final", "boolean", "isValidEmailConfirmationToken", "(", "String", "token", ")", "{", "Sysprop", "s", "=", "CoreUtils", ".", "getInstance", "(", ")", ".", "getDao", "(", ")", ".", "read", "(", "getAppid", "(", ")", ",", "identifier", ")", ";", ...
Validates a token sent for email confirmation. @param token a token @return true if valid
[ "Validates", "a", "token", "sent", "for", "email", "confirmation", "." ]
5ba096c477042ea7b18e9a0e8b5b1ee0f5bd6ce9
https://github.com/Erudika/para/blob/5ba096c477042ea7b18e9a0e8b5b1ee0f5bd6ce9/para-core/src/main/java/com/erudika/para/core/User.java#L728-L731
train
Checks if the given token is a valid email confirmation token.
Create a Java method that does the following: "Checks if the given token is a valid email confirmation token.".
Of course, here is the Java code you requested: ```java public final boolean isValidEmailConfirmationToken(String token) { Sysprop s = CoreUtils.getInstance().getDao().read(getAppid(), identifier); return isValidToken(s, Config._EMAIL_TOKEN, token); } ``` Hope this helps!
mozilla/rhino
src/org/mozilla/javascript/typedarrays/NativeTypedArrayView.java
NativeTypedArrayView.findPrototypeId
@Override protected int findPrototypeId(String s) { int id; // #generated# Last update: 2018-05-13 12:51:10 MESZ L0: { id = 0; String X = null; int c; int s_length = s.length(); if (s_length==3) { c=s.charAt(0); if (c=='g') { if (s.charAt(2...
java
@Override protected int findPrototypeId(String s) { int id; // #generated# Last update: 2018-05-13 12:51:10 MESZ L0: { id = 0; String X = null; int c; int s_length = s.length(); if (s_length==3) { c=s.charAt(0); if (c=='g') { if (s.charAt(2...
[ "@", "Override", "protected", "int", "findPrototypeId", "(", "String", "s", ")", "{", "int", "id", ";", "// #generated# Last update: 2018-05-13 12:51:10 MESZ", "L0", ":", "{", "id", "=", "0", ";", "String", "X", "=", "null", ";", "int", "c", ";", "int", "s...
#string_id_map#
[ "#string_id_map#" ]
fa8a86df11d37623f5faa8d445a5876612bc47b0
https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/typedarrays/NativeTypedArrayView.java#L368-L391
train
Override method to find the prototype id for a single class.
Create a Java method that does the following: "Override method to find the prototype id for a single class.".
Of course, here is the Java code you requested: ```java @Override protected int findPrototypeId(String s) { int id; // #generated# Last update: 2018-05-13 12:51:10 MESZ L0: { id = 0; String X = null; int c; int s_length = s.length(); if (s_length==3) { c=...
atomix/atomix
protocols/raft/src/main/java/io/atomix/protocols/raft/session/RaftSession.java
RaftSession.clearEvents
private void clearEvents(long index) { if (index > completeIndex) { EventHolder event = events.peek(); while (event != null && event.eventIndex <= index) { events.remove(); completeIndex = event.eventIndex; event = events.peek(); } completeIndex = index; } }
java
private void clearEvents(long index) { if (index > completeIndex) { EventHolder event = events.peek(); while (event != null && event.eventIndex <= index) { events.remove(); completeIndex = event.eventIndex; event = events.peek(); } completeIndex = index; } }
[ "private", "void", "clearEvents", "(", "long", "index", ")", "{", "if", "(", "index", ">", "completeIndex", ")", "{", "EventHolder", "event", "=", "events", ".", "peek", "(", ")", ";", "while", "(", "event", "!=", "null", "&&", "event", ".", "eventInde...
Clears events up to the given sequence. @param index The index to clear.
[ "Clears", "events", "up", "to", "the", "given", "sequence", "." ]
3a94b7c80576d762dd0d396d4645df07a0b37c31
https://github.com/atomix/atomix/blob/3a94b7c80576d762dd0d396d4645df07a0b37c31/protocols/raft/src/main/java/io/atomix/protocols/raft/session/RaftSession.java#L505-L515
train
Clear the events at the given index.
Create a Java method that does the following: "Clear the events at the given index.".
Of course, here is the Java code you requested: ```java private void clearEvents(long index) { if (index > completeIndex) { EventHolder event = events.peek(); while (event != null && event.eventIndex <= index) { events.remove(); completeIndex = event.eventIndex; event = events.p...
apache/flink
flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/typeutils/BinaryRowSerializer.java
BinaryRowSerializer.pointTo
public void pointTo(int length, BinaryRow reuse, AbstractPagedInputView headerLessView) throws IOException { checkArgument(headerLessView.getHeaderLength() == 0); if (length < 0) { throw new IOException(String.format( "Read unexpected bytes in source of positionInSegment[%d] and limitInSegment[%d]", ...
java
public void pointTo(int length, BinaryRow reuse, AbstractPagedInputView headerLessView) throws IOException { checkArgument(headerLessView.getHeaderLength() == 0); if (length < 0) { throw new IOException(String.format( "Read unexpected bytes in source of positionInSegment[%d] and limitInSegment[%d]", ...
[ "public", "void", "pointTo", "(", "int", "length", ",", "BinaryRow", "reuse", ",", "AbstractPagedInputView", "headerLessView", ")", "throws", "IOException", "{", "checkArgument", "(", "headerLessView", ".", "getHeaderLength", "(", ")", "==", "0", ")", ";", "if",...
Point row to memory segments with offset(in the AbstractPagedInputView) and length. @param length row length. @param reuse reuse BinaryRow object. @param headerLessView source memory segments container.
[ "Point", "row", "to", "memory", "segments", "with", "offset", "(", "in", "the", "AbstractPagedInputView", ")", "and", "length", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/typeutils/BinaryRowSerializer.java#L224-L253
train
This method points to the given length of the input.
Create a Java method that does the following: "This method points to the given length of the input.".
Of course, here is the Java code you requested: ```java public void pointTo(int length, BinaryRow reuse, AbstractPagedInputView headerLessView) throws IOException { checkArgument(headerLessView.getHeaderLength() == 0); if (length < 0) { throw new IOException(String.format( "Read unexpected bytes in sour...
OpenLiberty/open-liberty
dev/com.ibm.ws.session.cache/src/com/ibm/ws/session/store/cache/CacheHashMap.java
CacheHashMap.doInvalidations
@FFDCIgnore(NoSuchElementException.class) private void doInvalidations() { final boolean trace = TraceComponent.isAnyTracingEnabled(); try { long now = System.currentTimeMillis(); // loop through all the candidates eligible for invalidation BackedSession pmiStat...
java
@FFDCIgnore(NoSuchElementException.class) private void doInvalidations() { final boolean trace = TraceComponent.isAnyTracingEnabled(); try { long now = System.currentTimeMillis(); // loop through all the candidates eligible for invalidation BackedSession pmiStat...
[ "@", "FFDCIgnore", "(", "NoSuchElementException", ".", "class", ")", "private", "void", "doInvalidations", "(", ")", "{", "final", "boolean", "trace", "=", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", ";", "try", "{", "long", "now", "=", "System", ...
Copied from DatabaseHashMap.doInvalidations. this method removes timed out sessions that do not require listener processing
[ "Copied", "from", "DatabaseHashMap", ".", "doInvalidations", ".", "this", "method", "removes", "timed", "out", "sessions", "that", "do", "not", "require", "listener", "processing" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.session.cache/src/com/ibm/ws/session/store/cache/CacheHashMap.java#L268-L371
train
Do invalidations.
Create a Java method that does the following: "Do invalidations.".
Of course, here is the Java code you requested: ```java @FFDCIgnore(NoSuchElementException.class) private void doInvalidations() { final boolean trace = TraceComponent.isAnyTracingEnabled(); try { long now = System.currentTimeMillis(); // loop through all the candidates el...
HanSolo/Medusa
src/main/java/eu/hansolo/medusa/Gauge.java
Gauge.setAverageVisible
public void setAverageVisible(final boolean VISIBLE) { if (null == averageVisible) { _averageVisible = VISIBLE; fireUpdateEvent(VISIBILITY_EVENT); } else { averageVisible.set(VISIBLE); } }
java
public void setAverageVisible(final boolean VISIBLE) { if (null == averageVisible) { _averageVisible = VISIBLE; fireUpdateEvent(VISIBILITY_EVENT); } else { averageVisible.set(VISIBLE); } }
[ "public", "void", "setAverageVisible", "(", "final", "boolean", "VISIBLE", ")", "{", "if", "(", "null", "==", "averageVisible", ")", "{", "_averageVisible", "=", "VISIBLE", ";", "fireUpdateEvent", "(", "VISIBILITY_EVENT", ")", ";", "}", "else", "{", "averageVi...
Defines if the average indicator should be drawn @param VISIBLE
[ "Defines", "if", "the", "average", "indicator", "should", "be", "drawn" ]
1321e4925dcde659028d4b296e49e316494c114c
https://github.com/HanSolo/Medusa/blob/1321e4925dcde659028d4b296e49e316494c114c/src/main/java/eu/hansolo/medusa/Gauge.java#L3975-L3982
train
Defines if the average visible state of the calendar is to be used.
Create a Java method that does the following: "Defines if the average visible state of the calendar is to be used.".
Of course, here is the Java code you requested: ```java public void setAverageVisible(final boolean VISIBLE) { if (null == averageVisible) { _averageVisible = VISIBLE; fireUpdateEvent(VISIBILITY_EVENT); } else { averageVisible.set(VISIBLE); } } ``` Hope ...
tango-controls/JTango
dao/src/main/java/fr/esrf/TangoApi/TacoTangoDeviceDAODefaultImpl.java
TacoTangoDeviceDAODefaultImpl.init
public void init(TacoTangoDevice tacoDevice, String devname, String nethost) throws DevFailed { Except.throw_exception("Api_TacoFailed", "Taco protocol not supported.\n" + "Patch JTango.jar if Taco is needed.", "TacoTangoDeviceDAODefaultImpl.TacoTangoDevic...
java
public void init(TacoTangoDevice tacoDevice, String devname, String nethost) throws DevFailed { Except.throw_exception("Api_TacoFailed", "Taco protocol not supported.\n" + "Patch JTango.jar if Taco is needed.", "TacoTangoDeviceDAODefaultImpl.TacoTangoDevic...
[ "public", "void", "init", "(", "TacoTangoDevice", "tacoDevice", ",", "String", "devname", ",", "String", "nethost", ")", "throws", "DevFailed", "{", "Except", ".", "throw_exception", "(", "\"Api_TacoFailed\"", ",", "\"Taco protocol not supported.\\n\"", "+", "\"Patch ...
======================================================
[ "======================================================" ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/dao/src/main/java/fr/esrf/TangoApi/TacoTangoDeviceDAODefaultImpl.java#L66-L71
train
Init method.
Create a Java method that does the following: "Init method.".
Of course, here is the Java code you requested: ```java public void init(TacoTangoDevice tacoDevice, String devname, String nethost) throws DevFailed { Except.throw_exception("Api_TacoFailed", "Taco protocol not supported.\n" + "Patch JTango.jar if Taco is needed.", ...
apereo/cas
support/cas-server-support-pac4j-webflow/src/main/java/org/apereo/cas/web/saml2/Saml2ClientMetadataController.java
Saml2ClientMetadataController.getServiceProviderMetadataByName
@GetMapping("/sp/{client}/metadata") public ResponseEntity<String> getServiceProviderMetadataByName(@PathVariable("client") final String client) { val saml2Client = (SAML2Client) builtClients.findClient(client); if (saml2Client != null) { return getSaml2ClientServiceProviderMetadataRespo...
java
@GetMapping("/sp/{client}/metadata") public ResponseEntity<String> getServiceProviderMetadataByName(@PathVariable("client") final String client) { val saml2Client = (SAML2Client) builtClients.findClient(client); if (saml2Client != null) { return getSaml2ClientServiceProviderMetadataRespo...
[ "@", "GetMapping", "(", "\"/sp/{client}/metadata\"", ")", "public", "ResponseEntity", "<", "String", ">", "getServiceProviderMetadataByName", "(", "@", "PathVariable", "(", "\"client\"", ")", "final", "String", "client", ")", "{", "val", "saml2Client", "=", "(", "...
Gets service provider metadata by name. @param client the client @return the service provider metadata by name
[ "Gets", "service", "provider", "metadata", "by", "name", "." ]
b4b306433a8782cef803a39bea5b1f96740e0e9b
https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-pac4j-webflow/src/main/java/org/apereo/cas/web/saml2/Saml2ClientMetadataController.java#L71-L78
train
Gets service provider metadata by name.
Create a Java method that does the following: "Gets service provider metadata by name.".
Of course, here is the Java code you requested: ```java @GetMapping("/sp/{client}/metadata") public ResponseEntity<String> getServiceProviderMetadataByName(@PathVariable("client") final String client) { val saml2Client = (SAML2Client) builtClients.findClient(client); if (saml2Client != null) { ...
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/cache/statemodel/ListStatistics.java
ListStatistics.incrementRemoving
public final void incrementRemoving(int sizeInBytes) throws SevereMessageStoreException { boolean doCallback = false; synchronized(this) { _countRemoving++; doCallback = _incrementTotal(sizeInBytes); } if (doCallback) { _owningSt...
java
public final void incrementRemoving(int sizeInBytes) throws SevereMessageStoreException { boolean doCallback = false; synchronized(this) { _countRemoving++; doCallback = _incrementTotal(sizeInBytes); } if (doCallback) { _owningSt...
[ "public", "final", "void", "incrementRemoving", "(", "int", "sizeInBytes", ")", "throws", "SevereMessageStoreException", "{", "boolean", "doCallback", "=", "false", ";", "synchronized", "(", "this", ")", "{", "_countRemoving", "++", ";", "doCallback", "=", "_incre...
Defect 510343.1
[ "Defect", "510343", ".", "1" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/cache/statemodel/ListStatistics.java#L448-L463
train
Increment the number of removing elements.
Create a Java method that does the following: "Increment the number of removing elements.".
Of course, here is the Java code you requested: ```java public final void incrementRemoving(int sizeInBytes) throws SevereMessageStoreException { boolean doCallback = false; synchronized(this) { _countRemoving++; doCallback = _incrementTotal(sizeInBytes); }...
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/ns/nsip.java
nsip.disable
public static base_responses disable(nitro_service client, nsip resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { nsip disableresources[] = new nsip[resources.length]; for (int i=0;i<resources.length;i++){ disableresources[i] = new nsip(); d...
java
public static base_responses disable(nitro_service client, nsip resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { nsip disableresources[] = new nsip[resources.length]; for (int i=0;i<resources.length;i++){ disableresources[i] = new nsip(); d...
[ "public", "static", "base_responses", "disable", "(", "nitro_service", "client", ",", "nsip", "resources", "[", "]", ")", "throws", "Exception", "{", "base_responses", "result", "=", "null", ";", "if", "(", "resources", "!=", "null", "&&", "resources", ".", ...
Use this API to disable nsip resources.
[ "Use", "this", "API", "to", "disable", "nsip", "resources", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/ns/nsip.java#L1126-L1138
train
Use this API to disable nsip resources.
Create a Java method that does the following: "Use this API to disable nsip resources.".
Of course, here is the Java code you requested: ```java public static base_responses disable(nitro_service client, nsip resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { nsip disableresources[] = new nsip[resources.length]; for (int i=0;i<resources...
facebookarchive/hadoop-20
src/core/org/apache/hadoop/conf/ConfServlet.java
ConfServlet.writeResponse
static void writeResponse(Configuration conf, Writer out, String format) throws IOException, BadFormatException { if (FORMAT_JSON.equals(format)) { Configuration.dumpConfiguration(conf, out); } else if (FORMAT_XML.equals(format)) { conf.writeXml(out); } else { throw new BadFormatExcept...
java
static void writeResponse(Configuration conf, Writer out, String format) throws IOException, BadFormatException { if (FORMAT_JSON.equals(format)) { Configuration.dumpConfiguration(conf, out); } else if (FORMAT_XML.equals(format)) { conf.writeXml(out); } else { throw new BadFormatExcept...
[ "static", "void", "writeResponse", "(", "Configuration", "conf", ",", "Writer", "out", ",", "String", "format", ")", "throws", "IOException", ",", "BadFormatException", "{", "if", "(", "FORMAT_JSON", ".", "equals", "(", "format", ")", ")", "{", "Configuration"...
Guts of the servlet - extracted for easy testing.
[ "Guts", "of", "the", "servlet", "-", "extracted", "for", "easy", "testing", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/conf/ConfServlet.java#L78-L87
train
Write a CRS response from a configuration to a Writer.
Create a Java method that does the following: "Write a CRS response from a configuration to a Writer.".
Of course, here is the Java code you requested: ```java static void writeResponse(Configuration conf, Writer out, String format) throws IOException, BadFormatException { if (FORMAT_JSON.equals(format)) { Configuration.dumpConfiguration(conf, out); } else if (FORMAT_XML.equals(format)) { conf.wr...
alkacon/opencms-core
src-modules/org/opencms/workplace/commons/CmsPropertyCustom.java
CmsPropertyCustom.isHideButtonAdvanced
protected boolean isHideButtonAdvanced() { I_CmsDialogHandler handler = OpenCms.getWorkplaceManager().getDialogHandler(getDialogHandler()); CmsParameterConfiguration handlerParams = handler.getConfiguration(); if ((handlerParams != null) && handlerParams.containsKey(PARAM_HIDEADVANCED)) { ...
java
protected boolean isHideButtonAdvanced() { I_CmsDialogHandler handler = OpenCms.getWorkplaceManager().getDialogHandler(getDialogHandler()); CmsParameterConfiguration handlerParams = handler.getConfiguration(); if ((handlerParams != null) && handlerParams.containsKey(PARAM_HIDEADVANCED)) { ...
[ "protected", "boolean", "isHideButtonAdvanced", "(", ")", "{", "I_CmsDialogHandler", "handler", "=", "OpenCms", ".", "getWorkplaceManager", "(", ")", ".", "getDialogHandler", "(", "getDialogHandler", "(", ")", ")", ";", "CmsParameterConfiguration", "handlerParams", "=...
Checks the optional parameters of the handler configuration. <p> Decides if the "advanced" button should be shown or not. The "advanced" button is shown if no parameters are given (default) or the "hideadvanced" attribute is set to false. The "advanced" button is hidden only, if "hideadvanced" is true and the user is ...
[ "Checks", "the", "optional", "parameters", "of", "the", "handler", "configuration", ".", "<p", ">" ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/commons/CmsPropertyCustom.java#L598-L632
train
Checks if the hide advanced button is set to true.
Create a Java method that does the following: "Checks if the hide advanced button is set to true.".
Of course, here is the Java code you requested: ```java protected boolean isHideButtonAdvanced() { I_CmsDialogHandler handler = OpenCms.getWorkplaceManager().getDialogHandler(getDialogHandler()); CmsParameterConfiguration handlerParams = handler.getConfiguration(); if ((handlerParams != null) ...
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/AbstractExtension.java
AbstractExtension.get
@Override public <T> T get(String fieldName) { switch (fieldName.toLowerCase()) { case FIELD_REPOSITORY: return (T) getRepository(); case FIELD_ID: return (T) getId().getId(); case FIELD_VERSION: return (T) getId().getVe...
java
@Override public <T> T get(String fieldName) { switch (fieldName.toLowerCase()) { case FIELD_REPOSITORY: return (T) getRepository(); case FIELD_ID: return (T) getId().getId(); case FIELD_VERSION: return (T) getId().getVe...
[ "@", "Override", "public", "<", "T", ">", "T", "get", "(", "String", "fieldName", ")", "{", "switch", "(", "fieldName", ".", "toLowerCase", "(", ")", ")", "{", "case", "FIELD_REPOSITORY", ":", "return", "(", "T", ")", "getRepository", "(", ")", ";", ...
Get an extension field by name. Fallback on properties. @param fieldName the field name; @return the field value or null if none could be found
[ "Get", "an", "extension", "field", "by", "name", ".", "Fallback", "on", "properties", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/AbstractExtension.java#L208-L257
train
Gets the value of the passed in field in the n - gram page.
Create a Java method that does the following: "Gets the value of the passed in field in the n - gram page.".
Of course, here is the Java code you requested: ```java @Override public <T> T get(String fieldName) { switch (fieldName.toLowerCase()) { case FIELD_REPOSITORY: return (T) getRepository(); case FIELD_ID: return (T) getId().getId(); cas...
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsSessionImpl.java
JmsSessionImpl.getPassThruProps
Map getPassThruProps() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "getPassThruProps"); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "getPassThruProps", passThruProps); return passThruPr...
java
Map getPassThruProps() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "getPassThruProps"); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "getPassThruProps", passThruProps); return passThruPr...
[ "Map", "getPassThruProps", "(", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "this", ",", "tc", ",", "\"getPassThruProps\"", ")", ";", "if", "("...
Return the passThruProps for this Session.
[ "Return", "the", "passThruProps", "for", "this", "Session", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsSessionImpl.java#L1586-L1592
train
Get the passThruProps property.
Create a Java method that does the following: "Get the passThruProps property.".
Of course, here is the Java code you requested: ```java Map getPassThruProps() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "getPassThruProps"); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "get...
RestComm/sipunit
src/main/java/org/cafesip/sipunit/SipCall.java
SipCall.respondToCancel
public boolean respondToCancel(SipTransaction siptrans, int statusCode, String reasonPhrase, int expires) { return respondToCancel(siptrans, statusCode, reasonPhrase, expires, null, null, null); }
java
public boolean respondToCancel(SipTransaction siptrans, int statusCode, String reasonPhrase, int expires) { return respondToCancel(siptrans, statusCode, reasonPhrase, expires, null, null, null); }
[ "public", "boolean", "respondToCancel", "(", "SipTransaction", "siptrans", ",", "int", "statusCode", ",", "String", "reasonPhrase", ",", "int", "expires", ")", "{", "return", "respondToCancel", "(", "siptrans", ",", "statusCode", ",", "reasonPhrase", ",", "expires...
This method sends a basic response to a previously received CANCEL request. The response is constructed based on the parameters passed in. Call this method after waitForCancel() returns non-null. Call this method multiple times to send multiple responses to the received CANCEL. @param siptrans This is the object that ...
[ "This", "method", "sends", "a", "basic", "response", "to", "a", "previously", "received", "CANCEL", "request", ".", "The", "response", "is", "constructed", "based", "on", "the", "parameters", "passed", "in", ".", "Call", "this", "method", "after", "waitForCanc...
18a6be2e29be3fbdc14226e8c41b25e2d57378b1
https://github.com/RestComm/sipunit/blob/18a6be2e29be3fbdc14226e8c41b25e2d57378b1/src/main/java/org/cafesip/sipunit/SipCall.java#L3255-L3258
train
This method is used to respond to a cancel request.
Create a Java method that does the following: "This method is used to respond to a cancel request.".
Of course, here is the Java code you requested: ```java public boolean respondToCancel(SipTransaction siptrans, int statusCode, String reasonPhrase, int expires) { return respondToCancel(siptrans, statusCode, reasonPhrase, expires, null, null, null); } ``` Hope this helps!
aerogear/aerogear-android-store
library/src/main/java/org/jboss/aerogear/android/store/memory/MemoryStore.java
MemoryStore.save
@Override public void save(T item) { Serializable idValue = getOrGenerateIdValue(item); save(idValue, item); }
java
@Override public void save(T item) { Serializable idValue = getOrGenerateIdValue(item); save(idValue, item); }
[ "@", "Override", "public", "void", "save", "(", "T", "item", ")", "{", "Serializable", "idValue", "=", "getOrGenerateIdValue", "(", "item", ")", ";", "save", "(", "idValue", ",", "item", ")", ";", "}" ]
/* {@inheritDoc}
[ "/", "*", "{" ]
525ca981cd94846fcb0729cf3314de84c9359923
https://github.com/aerogear/aerogear-android-store/blob/525ca981cd94846fcb0729cf3314de84c9359923/library/src/main/java/org/jboss/aerogear/android/store/memory/MemoryStore.java#L65-L69
train
Saves the record in the database.
Create a Java method that does the following: "Saves the record in the database.".
Of course, here is the Java code you requested: ```java @Override public void save(T item) { Serializable idValue = getOrGenerateIdValue(item); save(idValue, item); } ``` Hope this helps!
Unidata/thredds
dap4/d4servlet/src/main/java/dap4/servlet/SerialWriter.java
SerialWriter.writeCount
public void writeCount(long count) throws IOException { countbuffer.clear(); countbuffer.putLong(count); byte[] countbuf = countbuffer.array(); int len = countbuffer.position(); writeBytes(countbuf, len); if(DEBUG) { System.err.printf("coun...
java
public void writeCount(long count) throws IOException { countbuffer.clear(); countbuffer.putLong(count); byte[] countbuf = countbuffer.array(); int len = countbuffer.position(); writeBytes(countbuf, len); if(DEBUG) { System.err.printf("coun...
[ "public", "void", "writeCount", "(", "long", "count", ")", "throws", "IOException", "{", "countbuffer", ".", "clear", "(", ")", ";", "countbuffer", ".", "putLong", "(", "count", ")", ";", "byte", "[", "]", "countbuf", "=", "countbuffer", ".", "array", "(...
Write out a prefix count @param count the count to write out @throws IOException
[ "Write", "out", "a", "prefix", "count" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/dap4/d4servlet/src/main/java/dap4/servlet/SerialWriter.java#L274-L286
test
Write a count value to the underlying stream.
Create a Java method that does the following: "Write a count value to the underlying stream.".
Of course, here is the Java code you requested: ```java public void writeCount(long count) throws IOException { countbuffer.clear(); countbuffer.putLong(count); byte[] countbuf = countbuffer.array(); int len = countbuffer.position(); writeBytes(countbuf, len)...
tango-controls/JTango
common/src/main/java/org/tango/utils/ArrayUtils.java
ArrayUtils.copyOf
public static <T> T[][] copyOf(final T[][] nums) { final int lengthY = Array.getLength(nums); int lengthX = 0; if (Array.getLength(nums) > 0) { lengthX = Array.getLength(nums[0]); } @SuppressWarnings("unchecked") final T[][] copy = (T[][]) Array.newInstance(nu...
java
public static <T> T[][] copyOf(final T[][] nums) { final int lengthY = Array.getLength(nums); int lengthX = 0; if (Array.getLength(nums) > 0) { lengthX = Array.getLength(nums[0]); } @SuppressWarnings("unchecked") final T[][] copy = (T[][]) Array.newInstance(nu...
[ "public", "static", "<", "T", ">", "T", "[", "]", "[", "]", "copyOf", "(", "final", "T", "[", "]", "[", "]", "nums", ")", "{", "final", "int", "lengthY", "=", "Array", ".", "getLength", "(", "nums", ")", ";", "int", "lengthX", "=", "0", ";", ...
Make a copy for a 2D array @param nums @return
[ "Make", "a", "copy", "for", "a", "2D", "array" ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/common/src/main/java/org/tango/utils/ArrayUtils.java#L444-L460
train
Copy the array of the given array to a new array.
Create a Java method that does the following: "Copy the array of the given array to a new array.".
Of course, here is the Java code you requested: ```java public static <T> T[][] copyOf(final T[][] nums) { final int lengthY = Array.getLength(nums); int lengthX = 0; if (Array.getLength(nums) > 0) { lengthX = Array.getLength(nums[0]); } @SuppressWarnings("unchecked"...
aws/aws-sdk-java
aws-java-sdk-servicecatalog/src/main/java/com/amazonaws/services/servicecatalog/AWSServiceCatalogClient.java
AWSServiceCatalogClient.listProvisioningArtifactsForServiceAction
@Override public ListProvisioningArtifactsForServiceActionResult listProvisioningArtifactsForServiceAction(ListProvisioningArtifactsForServiceActionRequest request) { request = beforeClientExecution(request); return executeListProvisioningArtifactsForServiceAction(request); }
java
@Override public ListProvisioningArtifactsForServiceActionResult listProvisioningArtifactsForServiceAction(ListProvisioningArtifactsForServiceActionRequest request) { request = beforeClientExecution(request); return executeListProvisioningArtifactsForServiceAction(request); }
[ "@", "Override", "public", "ListProvisioningArtifactsForServiceActionResult", "listProvisioningArtifactsForServiceAction", "(", "ListProvisioningArtifactsForServiceActionRequest", "request", ")", "{", "request", "=", "beforeClientExecution", "(", "request", ")", ";", "return", "e...
<p> Lists all provisioning artifacts (also known as versions) for the specified self-service action. </p> @param listProvisioningArtifactsForServiceActionRequest @return Result of the ListProvisioningArtifactsForServiceAction operation returned by the service. @throws ResourceNotFoundException The specified resource w...
[ "<p", ">", "Lists", "all", "provisioning", "artifacts", "(", "also", "known", "as", "versions", ")", "for", "the", "specified", "self", "-", "service", "action", ".", "<", "/", "p", ">" ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-servicecatalog/src/main/java/com/amazonaws/services/servicecatalog/AWSServiceCatalogClient.java#L3739-L3743
train
Lists the provisioning artifacts for a service action.
Create a Java method that does the following: "Lists the provisioning artifacts for a service action.".
Of course, here is the Java code you requested: ```java @Override public ListProvisioningArtifactsForServiceActionResult listProvisioningArtifactsForServiceAction(ListProvisioningArtifactsForServiceActionRequest request) { request = beforeClientExecution(request); return executeListProvisioningArti...
xerial/snappy-java
src/main/java/org/xerial/snappy/SnappyFramedInputStream.java
SnappyFramedInputStream.transferTo
public long transferTo(OutputStream os) throws IOException { if (os == null) { throw new IllegalArgumentException("os is null"); } if (closed) { throw new ClosedChannelException(); } long totTransfered = 0; while (ensureBuffer())...
java
public long transferTo(OutputStream os) throws IOException { if (os == null) { throw new IllegalArgumentException("os is null"); } if (closed) { throw new ClosedChannelException(); } long totTransfered = 0; while (ensureBuffer())...
[ "public", "long", "transferTo", "(", "OutputStream", "os", ")", "throws", "IOException", "{", "if", "(", "os", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"os is null\"", ")", ";", "}", "if", "(", "closed", ")", "{", "throw",...
Transfers the entire content of this {@link InputStream} to <i>os</i>. This potentially limits the amount of buffering required to decompress content. <p> Unlike {@link #read(byte[], int, int)}, this method does not need to be called multiple times. A single call will transfer all available content. Any calls after the...
[ "Transfers", "the", "entire", "content", "of", "this", "{", "@link", "InputStream", "}", "to", "<i", ">", "os<", "/", "i", ">", ".", "This", "potentially", "limits", "the", "amount", "of", "buffering", "required", "to", "decompress", "content", ".", "<p", ...
9df6ed7bbce88186c82f2e7cdcb7b974421b3340
https://github.com/xerial/snappy-java/blob/9df6ed7bbce88186c82f2e7cdcb7b974421b3340/src/main/java/org/xerial/snappy/SnappyFramedInputStream.java#L281-L302
train
Transfer the contents of this buffer to the specified output stream.
Create a Java method that does the following: "Transfer the contents of this buffer to the specified output stream.".
Of course, here is the Java code you requested: ```java public long transferTo(OutputStream os) throws IOException { if (os == null) { throw new IllegalArgumentException("os is null"); } if (closed) { throw new ClosedChannelException(); } ...
lessthanoptimal/ejml
main/ejml-ddense/src/org/ejml/dense/row/linsol/qr/BaseLinearSolverQrp_DDRM.java
BaseLinearSolverQrp_DDRM.upgradeSolution
protected void upgradeSolution( DMatrixRMaj X ) { DMatrixRMaj z = Y; // recycle Y // compute the z which will minimize the 2-norm of X // because of the identity matrix tacked onto the end 'A' should never be singular if( !internalSolver.setA(W) ) throw new RuntimeException(...
java
protected void upgradeSolution( DMatrixRMaj X ) { DMatrixRMaj z = Y; // recycle Y // compute the z which will minimize the 2-norm of X // because of the identity matrix tacked onto the end 'A' should never be singular if( !internalSolver.setA(W) ) throw new RuntimeException(...
[ "protected", "void", "upgradeSolution", "(", "DMatrixRMaj", "X", ")", "{", "DMatrixRMaj", "z", "=", "Y", ";", "// recycle Y", "// compute the z which will minimize the 2-norm of X", "// because of the identity matrix tacked onto the end 'A' should never be singular", "if", "(", "...
<p> Upgrades the basic solution to the optimal 2-norm solution. </p> <pre> First solves for 'z' || x_b - P*[ R_11^-1 * R_12 ] * z ||2 min z || [ - I_{n-r} ] || </pre> @param X basic solution, also output solution
[ "<p", ">", "Upgrades", "the", "basic", "solution", "to", "the", "optimal", "2", "-", "norm", "solution", ".", "<", "/", "p", ">" ]
1444680cc487af5e866730e62f48f5f9636850d9
https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/row/linsol/qr/BaseLinearSolverQrp_DDRM.java#L164-L176
train
Upgrade the solution by computing the A and then computing the X matrix.
Create a Java method that does the following: "Upgrade the solution by computing the A and then computing the X matrix.".
Of course, here is the Java code you requested: ```java protected void upgradeSolution( DMatrixRMaj X ) { DMatrixRMaj z = Y; // recycle Y // compute the z which will minimize the 2-norm of X // because of the identity matrix tacked onto the end 'A' should never be singular if( !interna...
j-a-w-r/jawr-main-repo
jawr-dwr2.x/jawr-dwr2.x-extension/src/main/java/net/jawr/web/resource/bundle/generator/dwr/DWRBeanGenerator.java
DWRBeanGenerator.createResource
public Reader createResource(GeneratorContext context) { ServletContext servletContext = context.getServletContext(); StringBuffer data = null; String path = context.getPath(); if(ENGINE_KEY.equals(path)) { data = buildEngineScript(readDWRScript(ENGINE_PATH),servletContext); } else if(DWR_LIBRARIES.conta...
java
public Reader createResource(GeneratorContext context) { ServletContext servletContext = context.getServletContext(); StringBuffer data = null; String path = context.getPath(); if(ENGINE_KEY.equals(path)) { data = buildEngineScript(readDWRScript(ENGINE_PATH),servletContext); } else if(DWR_LIBRARIES.conta...
[ "public", "Reader", "createResource", "(", "GeneratorContext", "context", ")", "{", "ServletContext", "servletContext", "=", "context", ".", "getServletContext", "(", ")", ";", "StringBuffer", "data", "=", "null", ";", "String", "path", "=", "context", ".", "get...
/* (non-Javadoc) @see net.jawr.web.resource.bundle.generator.ResourceGenerator#createResource(java.lang.String, java.nio.charset.Charset)
[ "/", "*", "(", "non", "-", "Javadoc", ")" ]
5381f6acf461cd2502593c67a77bd6ef9eab848d
https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr-dwr2.x/jawr-dwr2.x-extension/src/main/java/net/jawr/web/resource/bundle/generator/dwr/DWRBeanGenerator.java#L130-L153
train
Create a resource from the generator context.
Create a Java method that does the following: "Create a resource from the generator context.".
Of course, here is the Java code you requested: ```java public Reader createResource(GeneratorContext context) { ServletContext servletContext = context.getServletContext(); StringBuffer data = null; String path = context.getPath(); if(ENGINE_KEY.equals(path)) { data = buildEngineScript(readDWRScript(ENGINE...
nutzam/nutz
src/org/nutz/img/Images.java
Images.createAvatar
public static BufferedImage createAvatar(String name) { return createAvatar(name, 0, null, null, null, 0, Font.BOLD); }
java
public static BufferedImage createAvatar(String name) { return createAvatar(name, 0, null, null, null, 0, Font.BOLD); }
[ "public", "static", "BufferedImage", "createAvatar", "(", "String", "name", ")", "{", "return", "createAvatar", "(", "name", ",", "0", ",", "null", ",", "null", ",", "null", ",", "0", ",", "Font", ".", "BOLD", ")", ";", "}" ]
根据名字生成头像,英文采用第一个字母,中文2个字使用2个字,超过2个字采用第一个字 @param name 名字 @return 头像
[ "根据名字生成头像,英文采用第一个字母,中文2个字使用2个字,超过2个字采用第一个字" ]
a38694d5cbda2692e7931ab093c168487a6a4bfe
https://github.com/nutzam/nutz/blob/a38694d5cbda2692e7931ab093c168487a6a4bfe/src/org/nutz/img/Images.java#L1336-L1338
valid
Create an image of type image.
Create a Java method that does the following: "Create an image of type image.".
Of course, here is the Java code you requested: ```java public static BufferedImage createAvatar(String name) { return createAvatar(name, 0, null, null, null, 0, Font.BOLD); } ``` Hope this helps!
ManfredTremmel/gwt-commons-lang3
src/main/java/org/apache/commons/lang3/StringUtils.java
StringUtils.indexOfDifference
public static int indexOfDifference(final CharSequence... css) { if (css == null || css.length <= 1) { return INDEX_NOT_FOUND; } boolean anyStringNull = false; boolean allStringsNull = true; final int arrayLen = css.length; int shortestStrLen = Integer.MAX_VAL...
java
public static int indexOfDifference(final CharSequence... css) { if (css == null || css.length <= 1) { return INDEX_NOT_FOUND; } boolean anyStringNull = false; boolean allStringsNull = true; final int arrayLen = css.length; int shortestStrLen = Integer.MAX_VAL...
[ "public", "static", "int", "indexOfDifference", "(", "final", "CharSequence", "...", "css", ")", "{", "if", "(", "css", "==", "null", "||", "css", ".", "length", "<=", "1", ")", "{", "return", "INDEX_NOT_FOUND", ";", "}", "boolean", "anyStringNull", "=", ...
<p>Compares all CharSequences in an array and returns the index at which the CharSequences begin to differ.</p> <p>For example, <code>indexOfDifference(new String[] {"i am a machine", "i am a robot"}) -&gt; 7</code></p> <pre> StringUtils.indexOfDifference(null) = -1 StringUtils.indexOfDifference(new String[] {}) = -1...
[ "<p", ">", "Compares", "all", "CharSequences", "in", "an", "array", "and", "returns", "the", "index", "at", "which", "the", "CharSequences", "begin", "to", "differ", ".", "<", "/", "p", ">" ]
9e2dfbbda3668cfa5d935fe76479d1426c294504
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/StringUtils.java#L7897-L7953
train
Gets the index of the first difference between the two CharSequences.
Create a Java method that does the following: "Gets the index of the first difference between the two CharSequences.".
Of course, here is the Java code you requested: ```java public static int indexOfDifference(final CharSequence... css) { if (css == null || css.length <= 1) { return INDEX_NOT_FOUND; } boolean anyStringNull = false; boolean allStringsNull = true; final int arrayLen =...
citrusframework/citrus
modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/functions/Functions.java
Functions.readFile
public static String readFile(String filePath, TestContext context) { return new ReadFileResourceFunction().execute(Collections.singletonList(filePath), context); }
java
public static String readFile(String filePath, TestContext context) { return new ReadFileResourceFunction().execute(Collections.singletonList(filePath), context); }
[ "public", "static", "String", "readFile", "(", "String", "filePath", ",", "TestContext", "context", ")", "{", "return", "new", "ReadFileResourceFunction", "(", ")", ".", "execute", "(", "Collections", ".", "singletonList", "(", "filePath", ")", ",", "context", ...
Reads the file resource and returns the complete file content. @param filePath @return
[ "Reads", "the", "file", "resource", "and", "returns", "the", "complete", "file", "content", "." ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/functions/Functions.java#L235-L237
train
Read file from file path.
Create a Java method that does the following: "Read file from file path.".
Of course, here is the Java code you requested: ```java public static String readFile(String filePath, TestContext context) { return new ReadFileResourceFunction().execute(Collections.singletonList(filePath), context); } ``` Hope this helps!
OpenTSDB/opentsdb
src/tsd/client/QueryUi.java
QueryUi.setOffsetHeight
private static void setOffsetHeight(final Widget widget, int height) { widget.setHeight(height + "px"); final int offset = widget.getOffsetHeight(); if (offset > 0) { height -= offset - height; if (height > 0) { widget.setHeight(height + "px"); } } }
java
private static void setOffsetHeight(final Widget widget, int height) { widget.setHeight(height + "px"); final int offset = widget.getOffsetHeight(); if (offset > 0) { height -= offset - height; if (height > 0) { widget.setHeight(height + "px"); } } }
[ "private", "static", "void", "setOffsetHeight", "(", "final", "Widget", "widget", ",", "int", "height", ")", "{", "widget", ".", "setHeight", "(", "height", "+", "\"px\"", ")", ";", "final", "int", "offset", "=", "widget", ".", "getOffsetHeight", "(", ")",...
Properly sets the total height of a widget. This takes into account decorations such as border, margin, and padding.
[ "Properly", "sets", "the", "total", "height", "of", "a", "widget", ".", "This", "takes", "into", "account", "decorations", "such", "as", "border", "margin", "and", "padding", "." ]
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tsd/client/QueryUi.java#L1428-L1437
train
Set the height of the widget.
Create a Java method that does the following: "Set the height of the widget.".
Of course, here is the Java code you requested: ```java private static void setOffsetHeight(final Widget widget, int height) { widget.setHeight(height + "px"); final int offset = widget.getOffsetHeight(); if (offset > 0) { height -= offset - height; if (height > 0) { widget.setHeight(he...
PawelAdamski/HttpClientMock
src/main/java/com/github/paweladamski/httpclientmock/HttpClientMockBuilder.java
HttpClientMockBuilder.doReturnXML
public HttpClientResponseBuilder doReturnXML(String response, Charset charset) { return responseBuilder.doReturnXML(response, charset); }
java
public HttpClientResponseBuilder doReturnXML(String response, Charset charset) { return responseBuilder.doReturnXML(response, charset); }
[ "public", "HttpClientResponseBuilder", "doReturnXML", "(", "String", "response", ",", "Charset", "charset", ")", "{", "return", "responseBuilder", ".", "doReturnXML", "(", "response", ",", "charset", ")", ";", "}" ]
Adds action which returns provided XML in UTF-8 and status 200. Additionally it sets "Content-type" header to "application/xml". @param response JSON to return @return response builder
[ "Adds", "action", "which", "returns", "provided", "XML", "in", "UTF", "-", "8", "and", "status", "200", ".", "Additionally", "it", "sets", "Content", "-", "type", "header", "to", "application", "/", "xml", "." ]
0205498434bbc0c78c187a51181cac9b266a28fb
https://github.com/PawelAdamski/HttpClientMock/blob/0205498434bbc0c78c187a51181cac9b266a28fb/src/main/java/com/github/paweladamski/httpclientmock/HttpClientMockBuilder.java#L255-L257
train
This method is used to return an XML response.
Create a Java method that does the following: "This method is used to return an XML response.".
Of course, here is the Java code you requested: ```java public HttpClientResponseBuilder doReturnXML(String response, Charset charset) { return responseBuilder.doReturnXML(response, charset); } ``` Hope this helps!
spring-cloud/spring-cloud-sleuth
spring-cloud-sleuth-core/src/main/java/org/springframework/cloud/sleuth/annotation/SleuthAnnotationUtils.java
SleuthAnnotationUtils.findAnnotation
static <T extends Annotation> T findAnnotation(Method method, Class<T> clazz) { T annotation = AnnotationUtils.findAnnotation(method, clazz); if (annotation == null) { try { annotation = AnnotationUtils.findAnnotation(method.getDeclaringClass() .getMethod(method.getName(), method.getParameterTypes()), ...
java
static <T extends Annotation> T findAnnotation(Method method, Class<T> clazz) { T annotation = AnnotationUtils.findAnnotation(method, clazz); if (annotation == null) { try { annotation = AnnotationUtils.findAnnotation(method.getDeclaringClass() .getMethod(method.getName(), method.getParameterTypes()), ...
[ "static", "<", "T", "extends", "Annotation", ">", "T", "findAnnotation", "(", "Method", "method", ",", "Class", "<", "T", ">", "clazz", ")", "{", "T", "annotation", "=", "AnnotationUtils", ".", "findAnnotation", "(", "method", ",", "clazz", ")", ";", "if...
Searches for an annotation either on a method or inside the method parameters. @param <T> - annotation @param clazz - class with annotation @param method - annotated method @return annotation
[ "Searches", "for", "an", "annotation", "either", "on", "a", "method", "or", "inside", "the", "method", "parameters", "." ]
f29c05fb8fba33e23aa21bb13aeb13ab8d27b485
https://github.com/spring-cloud/spring-cloud-sleuth/blob/f29c05fb8fba33e23aa21bb13aeb13ab8d27b485/spring-cloud-sleuth-core/src/main/java/org/springframework/cloud/sleuth/annotation/SleuthAnnotationUtils.java#L77-L92
train
Find the annotation for the given method.
Create a Java method that does the following: "Find the annotation for the given method.".
Of course, here is the Java code you requested: ```java static <T extends Annotation> T findAnnotation(Method method, Class<T> clazz) { T annotation = AnnotationUtils.findAnnotation(method, clazz); if (annotation == null) { try { annotation = AnnotationUtils.findAnnotation(method.getDeclaringClass() ....
googleapis/google-cloud-java
google-cloud-clients/google-cloud-automl/src/main/java/com/google/cloud/automl/v1beta1/AutoMlClient.java
AutoMlClient.createDataset
public final Dataset createDataset(LocationName parent, Dataset dataset) { CreateDatasetRequest request = CreateDatasetRequest.newBuilder() .setParent(parent == null ? null : parent.toString()) .setDataset(dataset) .build(); return createDataset(request); }
java
public final Dataset createDataset(LocationName parent, Dataset dataset) { CreateDatasetRequest request = CreateDatasetRequest.newBuilder() .setParent(parent == null ? null : parent.toString()) .setDataset(dataset) .build(); return createDataset(request); }
[ "public", "final", "Dataset", "createDataset", "(", "LocationName", "parent", ",", "Dataset", "dataset", ")", "{", "CreateDatasetRequest", "request", "=", "CreateDatasetRequest", ".", "newBuilder", "(", ")", ".", "setParent", "(", "parent", "==", "null", "?", "n...
Creates a dataset. <p>Sample code: <pre><code> try (AutoMlClient autoMlClient = AutoMlClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); Dataset dataset = Dataset.newBuilder().build(); Dataset response = autoMlClient.createDataset(parent, dataset); } </code></pre> @param parent The ...
[ "Creates", "a", "dataset", "." ]
d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a
https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-automl/src/main/java/com/google/cloud/automl/v1beta1/AutoMlClient.java#L203-L211
train
Creates a dataset in the NCSA language.
Create a Java method that does the following: "Creates a dataset in the NCSA language.".
Of course, here is the Java code you requested: ```java public final Dataset createDataset(LocationName parent, Dataset dataset) { CreateDatasetRequest request = CreateDatasetRequest.newBuilder() .setParent(parent == null ? null : parent.toString()) .setDataset(dataset) ...
ktoso/janbanery
janbanery-core/src/main/java/pl/project13/janbanery/exceptions/kanbanery/InvalidEntityKanbaneryException.java
InvalidEntityKanbaneryException.mostSpecializedException
public static InvalidEntityKanbaneryException mostSpecializedException(String response) { //todo refactor this!!! if (response == null || "".equals(response)) { return new InvalidEntityKanbaneryException(response); } else if (TaskAlreadyInFirstColumnException.isBestExceptionFor(response)) { retu...
java
public static InvalidEntityKanbaneryException mostSpecializedException(String response) { //todo refactor this!!! if (response == null || "".equals(response)) { return new InvalidEntityKanbaneryException(response); } else if (TaskAlreadyInFirstColumnException.isBestExceptionFor(response)) { retu...
[ "public", "static", "InvalidEntityKanbaneryException", "mostSpecializedException", "(", "String", "response", ")", "{", "//todo refactor this!!!", "if", "(", "response", "==", "null", "||", "\"\"", ".", "equals", "(", "response", ")", ")", "{", "return", "new", "I...
May be used as "Exception factory" to determine the "best" exception to be thrown for such JSON response. For example we may throw "TaskAlreadyInFirstColumnException" if the JSON contains a message informing us about this. @param response the JSON server response, containing a error messages @return the "best" excepti...
[ "May", "be", "used", "as", "Exception", "factory", "to", "determine", "the", "best", "exception", "to", "be", "thrown", "for", "such", "JSON", "response", ".", "For", "example", "we", "may", "throw", "TaskAlreadyInFirstColumnException", "if", "the", "JSON", "c...
cd77b774814c7fbb2a0c9c55d4c3f7e76affa636
https://github.com/ktoso/janbanery/blob/cd77b774814c7fbb2a0c9c55d4c3f7e76affa636/janbanery-core/src/main/java/pl/project13/janbanery/exceptions/kanbanery/InvalidEntityKanbaneryException.java#L56-L85
train
Get the most specific exception for the given response string.
Create a Java method that does the following: "Get the most specific exception for the given response string.".
Of course, here is the Java code you requested: ```java public static InvalidEntityKanbaneryException mostSpecializedException(String response) { //todo refactor this!!! if (response == null || "".equals(response)) { return new InvalidEntityKanbaneryException(response); } else if (TaskAlreadyInFirstC...
dita-ot/dita-ot
src/main/java/org/dita/dost/util/CatalogUtils.java
CatalogUtils.getCatalogResolver
public static synchronized CatalogResolver getCatalogResolver() { if (catalogResolver == null) { final CatalogManager manager = new CatalogManager(); manager.setIgnoreMissingProperties(true); manager.setUseStaticCatalog(false); // We'll use a private catalog. mana...
java
public static synchronized CatalogResolver getCatalogResolver() { if (catalogResolver == null) { final CatalogManager manager = new CatalogManager(); manager.setIgnoreMissingProperties(true); manager.setUseStaticCatalog(false); // We'll use a private catalog. mana...
[ "public", "static", "synchronized", "CatalogResolver", "getCatalogResolver", "(", ")", "{", "if", "(", "catalogResolver", "==", "null", ")", "{", "final", "CatalogManager", "manager", "=", "new", "CatalogManager", "(", ")", ";", "manager", ".", "setIgnoreMissingPr...
Get CatalogResolver. @return CatalogResolver
[ "Get", "CatalogResolver", "." ]
ea776b3c60c03d9f033b6f7ea072349e49dbcdd2
https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/CatalogUtils.java#L50-L63
train
Get the catalog resolver.
Create a Java method that does the following: "Get the catalog resolver.".
Of course, here is the Java code you requested: ```java public static synchronized CatalogResolver getCatalogResolver() { if (catalogResolver == null) { final CatalogManager manager = new CatalogManager(); manager.setIgnoreMissingProperties(true); manager.setUseStaticCatalog...
knightliao/disconf
disconf-core/src/main/java/com/baidu/disconf/core/common/restful/impl/RestfulMgrImpl.java
RestfulMgrImpl.retry4ConfDownload
private Object retry4ConfDownload(RemoteUrl remoteUrl, File localTmpFile, int retryTimes, int sleepSeconds) throws Exception { Exception ex = null; for (URL url : remoteUrl.getUrls()) { // 可重试的下载 UnreliableInterface unreliableImpl = new FetchConfFile(url, localTmpFil...
java
private Object retry4ConfDownload(RemoteUrl remoteUrl, File localTmpFile, int retryTimes, int sleepSeconds) throws Exception { Exception ex = null; for (URL url : remoteUrl.getUrls()) { // 可重试的下载 UnreliableInterface unreliableImpl = new FetchConfFile(url, localTmpFil...
[ "private", "Object", "retry4ConfDownload", "(", "RemoteUrl", "remoteUrl", ",", "File", "localTmpFile", ",", "int", "retryTimes", ",", "int", "sleepSeconds", ")", "throws", "Exception", "{", "Exception", "ex", "=", "null", ";", "for", "(", "URL", "url", ":", ...
Retry封装 RemoteUrl 支持多Server的下载 @param remoteUrl @param localTmpFile @param retryTimes @param sleepSeconds @return
[ "Retry封装", "RemoteUrl", "支持多Server的下载" ]
d413cbce9334fe38a5a24982ce4db3a6ed8e98ea
https://github.com/knightliao/disconf/blob/d413cbce9334fe38a5a24982ce4db3a6ed8e98ea/disconf-core/src/main/java/com/baidu/disconf/core/common/restful/impl/RestfulMgrImpl.java#L217-L240
train
retry 4 conf download
Create a Java method that does the following: "retry 4 conf download".
Of course, here is the Java code you requested: ```java private Object retry4ConfDownload(RemoteUrl remoteUrl, File localTmpFile, int retryTimes, int sleepSeconds) throws Exception { Exception ex = null; for (URL url : remoteUrl.getUrls()) { // 可重试的下载 UnreliableInte...
albfernandez/javadbf
src/main/java/com/linuxense/javadbf/DBFUtils.java
DBFUtils.readNumericStoredAsText
public static Number readNumericStoredAsText(DataInputStream dataInput, int length) throws IOException { try { byte t_float[] = new byte[length]; int readed = dataInput.read(t_float); if (readed != length) { throw new EOFException("failed to read:" + length + " bytes"); } t_float = DBFUtils.removeS...
java
public static Number readNumericStoredAsText(DataInputStream dataInput, int length) throws IOException { try { byte t_float[] = new byte[length]; int readed = dataInput.read(t_float); if (readed != length) { throw new EOFException("failed to read:" + length + " bytes"); } t_float = DBFUtils.removeS...
[ "public", "static", "Number", "readNumericStoredAsText", "(", "DataInputStream", "dataInput", ",", "int", "length", ")", "throws", "IOException", "{", "try", "{", "byte", "t_float", "[", "]", "=", "new", "byte", "[", "length", "]", ";", "int", "readed", "=",...
Reads a number from a stream, @param dataInput the stream data @param length the legth of the number @return The number as a Number (BigDecimal) @throws IOException if an IO error happens @throws EOFException if reached end of file before length bytes
[ "Reads", "a", "number", "from", "a", "stream" ]
ac9867b46786cb055bce9323e2cf074365207693
https://github.com/albfernandez/javadbf/blob/ac9867b46786cb055bce9323e2cf074365207693/src/main/java/com/linuxense/javadbf/DBFUtils.java#L62-L83
train
Read a number stored as text.
Create a Java method that does the following: "Read a number stored as text.".
Of course, here is the Java code you requested: ```java public static Number readNumericStoredAsText(DataInputStream dataInput, int length) throws IOException { try { byte t_float[] = new byte[length]; int readed = dataInput.read(t_float); if (readed != length) { throw new EOFException("failed to read:"...
b3dgs/lionengine
lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/transition/circuit/CircuitsExtractorImpl.java
CircuitsExtractorImpl.checkTransitionGroups
private static void checkTransitionGroups(Map<Circuit, Collection<TileRef>> circuits, Circuit circuit, MapTile map, TileRef ref) { final MapTileGroup mapGroup = map....
java
private static void checkTransitionGroups(Map<Circuit, Collection<TileRef>> circuits, Circuit circuit, MapTile map, TileRef ref) { final MapTileGroup mapGroup = map....
[ "private", "static", "void", "checkTransitionGroups", "(", "Map", "<", "Circuit", ",", "Collection", "<", "TileRef", ">", ">", "circuits", ",", "Circuit", "circuit", ",", "MapTile", "map", ",", "TileRef", "ref", ")", "{", "final", "MapTileGroup", "mapGroup", ...
Check transitions groups, and create compatible circuit on the fly. @param circuits The circuits collection. @param circuit The circuit found. @param map The map reference. @param ref The tile ref to add.
[ "Check", "transitions", "groups", "and", "create", "compatible", "circuit", "on", "the", "fly", "." ]
cac3d5578532cf11724a737b9f09e71bf9995ab2
https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/transition/circuit/CircuitsExtractorImpl.java#L98-L114
train
Check the transition groups for a single tile.
Create a Java method that does the following: "Check the transition groups for a single tile.".
Of course, here is the Java code you requested: ```java private static void checkTransitionGroups(Map<Circuit, Collection<TileRef>> circuits, Circuit circuit, MapTile map, TileRe...
OpenLiberty/open-liberty
dev/com.ibm.ws.security.social/src/com/ibm/ws/security/social/internal/SslRefInfoImpl.java
SslRefInfoImpl.init
void init() throws SocialLoginException { if (sslSupport != null) { Properties sslProps = null; this.jsseHelper = sslSupport.getJSSEHelper(); if (this.jsseHelper != null) { try { if (sslRef != null) { sslProps = this...
java
void init() throws SocialLoginException { if (sslSupport != null) { Properties sslProps = null; this.jsseHelper = sslSupport.getJSSEHelper(); if (this.jsseHelper != null) { try { if (sslRef != null) { sslProps = this...
[ "void", "init", "(", ")", "throws", "SocialLoginException", "{", "if", "(", "sslSupport", "!=", "null", ")", "{", "Properties", "sslProps", "=", "null", ";", "this", ".", "jsseHelper", "=", "sslSupport", ".", "getJSSEHelper", "(", ")", ";", "if", "(", "t...
init when needed
[ "init", "when", "needed" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.social/src/com/ibm/ws/security/social/internal/SslRefInfoImpl.java#L74-L103
train
Initialize the authentication context.
Create a Java method that does the following: "Initialize the authentication context.".
Of course, here is the Java code you requested: ```java void init() throws SocialLoginException { if (sslSupport != null) { Properties sslProps = null; this.jsseHelper = sslSupport.getJSSEHelper(); if (this.jsseHelper != null) { try { if (...
looly/hutool
hutool-core/src/main/java/cn/hutool/core/util/ReflectUtil.java
ReflectUtil.getField
public static Field getField(Class<?> beanClass, String name) throws SecurityException { final Field[] fields = getFields(beanClass); if (ArrayUtil.isNotEmpty(fields)) { for (Field field : fields) { if ((name.equals(field.getName()))) { return field; } } } return null; }
java
public static Field getField(Class<?> beanClass, String name) throws SecurityException { final Field[] fields = getFields(beanClass); if (ArrayUtil.isNotEmpty(fields)) { for (Field field : fields) { if ((name.equals(field.getName()))) { return field; } } } return null; }
[ "public", "static", "Field", "getField", "(", "Class", "<", "?", ">", "beanClass", ",", "String", "name", ")", "throws", "SecurityException", "{", "final", "Field", "[", "]", "fields", "=", "getFields", "(", "beanClass", ")", ";", "if", "(", "ArrayUtil", ...
查找指定类中的所有字段(包括非public字段),也包括父类和Object类的字段, 字段不存在则返回<code>null</code> @param beanClass 被查找字段的类,不能为null @param name 字段名 @return 字段 @throws SecurityException 安全异常
[ "查找指定类中的所有字段(包括非public字段),也包括父类和Object类的字段,", "字段不存在则返回<code", ">", "null<", "/", "code", ">" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ReflectUtil.java#L115-L125
train
Gets the field with the specified name from the specified class.
Create a Java method that does the following: "Gets the field with the specified name from the specified class.".
Of course, here is the Java code you requested: ```java public static Field getField(Class<?> beanClass, String name) throws SecurityException { final Field[] fields = getFields(beanClass); if (ArrayUtil.isNotEmpty(fields)) { for (Field field : fields) { if ((name.equals(field.getName()))) { retur...
demidenko05/beigesoft-bcommon
src/main/java/org/beigesoft/holder/HldMatchForeign.java
HldMatchForeign.getFor
public final MatchForeign getFor(final Map<String, Object> pReqVars, final Long pId) throws Exception { MatchForeign mf = getSrvOrm().retrieveEntityById(pReqVars, MatchForeign.class, pId); mf.setItsLines(getSrvOrm().retrieveListWithConditions(pReqVars, MatchForeignLine.class, "where ITSOWNER=" +...
java
public final MatchForeign getFor(final Map<String, Object> pReqVars, final Long pId) throws Exception { MatchForeign mf = getSrvOrm().retrieveEntityById(pReqVars, MatchForeign.class, pId); mf.setItsLines(getSrvOrm().retrieveListWithConditions(pReqVars, MatchForeignLine.class, "where ITSOWNER=" +...
[ "public", "final", "MatchForeign", "getFor", "(", "final", "Map", "<", "String", ",", "Object", ">", "pReqVars", ",", "final", "Long", "pId", ")", "throws", "Exception", "{", "MatchForeign", "mf", "=", "getSrvOrm", "(", ")", ".", "retrieveEntityById", "(", ...
<p>Get match foreign given ID.</p> @param pReqVars additional param @param pId ID @return match foreign @throws Exception an Exception
[ "<p", ">", "Get", "match", "foreign", "given", "ID", ".", "<", "/", "p", ">" ]
bb446822b4fc9b5a6a8cd3cc98d0b3d83d718daf
https://github.com/demidenko05/beigesoft-bcommon/blob/bb446822b4fc9b5a6a8cd3cc98d0b3d83d718daf/src/main/java/org/beigesoft/holder/HldMatchForeign.java#L41-L48
train
Get a MatchForeign object for a given id.
Create a Java method that does the following: "Get a MatchForeign object for a given id.".
Of course, here is the Java code you requested: ```java public final MatchForeign getFor(final Map<String, Object> pReqVars, final Long pId) throws Exception { MatchForeign mf = getSrvOrm().retrieveEntityById(pReqVars, MatchForeign.class, pId); mf.setItsLines(getSrvOrm().retrieveListWithConditions(pR...
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/java/security/AccessController.java
AccessController.doPrivileged
public static <T> T doPrivileged(PrivilegedAction<T> action, AccessControlContext context) { return action.run(); }
java
public static <T> T doPrivileged(PrivilegedAction<T> action, AccessControlContext context) { return action.run(); }
[ "public", "static", "<", "T", ">", "T", "doPrivileged", "(", "PrivilegedAction", "<", "T", ">", "action", ",", "AccessControlContext", "context", ")", "{", "return", "action", ".", "run", "(", ")", ";", "}" ]
Calls {@code action.run()}.
[ "Calls", "{" ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/security/AccessController.java#L55-L58
train
Run a privileged action on the application.
Create a Java method that does the following: "Run a privileged action on the application.".
Of course, here is the Java code you requested: ```java public static <T> T doPrivileged(PrivilegedAction<T> action, AccessControlContext context) { return action.run(); } ``` Hope this helps!
jeppetto/jeppetto
jeppetto-dao/src/main/java/org/iternine/jeppetto/dao/persistable/PersistableList.java
PersistableList.__isDirty
@Override public boolean __isDirty() { return rewrite || delegate.size() > firstAppendedIndex || !modifiedIndexes.isEmpty() || __getDirtyFields().hasNext(); }
java
@Override public boolean __isDirty() { return rewrite || delegate.size() > firstAppendedIndex || !modifiedIndexes.isEmpty() || __getDirtyFields().hasNext(); }
[ "@", "Override", "public", "boolean", "__isDirty", "(", ")", "{", "return", "rewrite", "||", "delegate", ".", "size", "(", ")", ">", "firstAppendedIndex", "||", "!", "modifiedIndexes", ".", "isEmpty", "(", ")", "||", "__getDirtyFields", "(", ")", ".", "has...
-------------------------------------------------------------
[ "-------------------------------------------------------------" ]
bd2796dcf53376052f590e727931990a2902a933
https://github.com/jeppetto/jeppetto/blob/bd2796dcf53376052f590e727931990a2902a933/jeppetto-dao/src/main/java/org/iternine/jeppetto/dao/persistable/PersistableList.java#L85-L91
train
Returns true if the cache is dirty.
Create a Java method that does the following: "Returns true if the cache is dirty.".
Of course, here is the Java code you requested: ```java @Override public boolean __isDirty() { return rewrite || delegate.size() > firstAppendedIndex || !modifiedIndexes.isEmpty() || __getDirtyFields().hasNext(); } ``` Hope this helps!
networknt/light-4j
metrics/src/main/java/io/dropwizard/metrics/MetricName.java
MetricName.build
public static MetricName build(String... parts) { if (parts == null || parts.length == 0) return MetricName.EMPTY; if (parts.length == 1) return new MetricName(parts[0], EMPTY_TAGS); return new MetricName(buildName(parts), EMPTY_TAGS); }
java
public static MetricName build(String... parts) { if (parts == null || parts.length == 0) return MetricName.EMPTY; if (parts.length == 1) return new MetricName(parts[0], EMPTY_TAGS); return new MetricName(buildName(parts), EMPTY_TAGS); }
[ "public", "static", "MetricName", "build", "(", "String", "...", "parts", ")", "{", "if", "(", "parts", "==", "null", "||", "parts", ".", "length", "==", "0", ")", "return", "MetricName", ".", "EMPTY", ";", "if", "(", "parts", ".", "length", "==", "1...
Build a new metric name using the specific path components. @param parts Path of the new metric name. @return A newly created metric name with the specified path.
[ "Build", "a", "new", "metric", "name", "using", "the", "specific", "path", "components", "." ]
2a60257c60663684c8f6dc8b5ea3cf184e534db6
https://github.com/networknt/light-4j/blob/2a60257c60663684c8f6dc8b5ea3cf184e534db6/metrics/src/main/java/io/dropwizard/metrics/MetricName.java#L176-L184
train
Build a metric name from the given parts.
Create a Java method that does the following: "Build a metric name from the given parts.".
Of course, here is the Java code you requested: ```java public static MetricName build(String... parts) { if (parts == null || parts.length == 0) return MetricName.EMPTY; if (parts.length == 1) return new MetricName(parts[0], EMPTY_TAGS); return new MetricName(buildNam...
hypercube1024/firefly
firefly-common/src/main/java/com/firefly/utils/io/PathResource.java
PathResource.getOutputStream
@Override public OutputStream getOutputStream() throws IOException { if (Files.isDirectory(this.path)) { throw new FileNotFoundException(getPath() + " (is a directory)"); } return Files.newOutputStream(this.path); }
java
@Override public OutputStream getOutputStream() throws IOException { if (Files.isDirectory(this.path)) { throw new FileNotFoundException(getPath() + " (is a directory)"); } return Files.newOutputStream(this.path); }
[ "@", "Override", "public", "OutputStream", "getOutputStream", "(", ")", "throws", "IOException", "{", "if", "(", "Files", ".", "isDirectory", "(", "this", ".", "path", ")", ")", "{", "throw", "new", "FileNotFoundException", "(", "getPath", "(", ")", "+", "...
This implementation opens a OutputStream for the underlying file. @see java.nio.file.spi.FileSystemProvider#newOutputStream(Path, OpenOption...)
[ "This", "implementation", "opens", "a", "OutputStream", "for", "the", "underlying", "file", "." ]
ed3fc75b7c54a65b1e7d8141d01b49144bb423a3
https://github.com/hypercube1024/firefly/blob/ed3fc75b7c54a65b1e7d8141d01b49144bb423a3/firefly-common/src/main/java/com/firefly/utils/io/PathResource.java#L130-L136
train
Get an OutputStream for this file.
Create a Java method that does the following: "Get an OutputStream for this file.".
Of course, here is the Java code you requested: ```java @Override public OutputStream getOutputStream() throws IOException { if (Files.isDirectory(this.path)) { throw new FileNotFoundException(getPath() + " (is a directory)"); } return Files.newOutputStream(this.path); } ```...
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/BugInstance.java
BugInstance.addMethod
@Nonnull public BugInstance addMethod(JavaClass javaClass, Method method) { MethodAnnotation methodAnnotation = new MethodAnnotation(javaClass.getClassName(), method.getName(), method.getSignature(), method.isStatic()); SourceLineAnnotation methodSourceLines = SourceLineAnnotation.fo...
java
@Nonnull public BugInstance addMethod(JavaClass javaClass, Method method) { MethodAnnotation methodAnnotation = new MethodAnnotation(javaClass.getClassName(), method.getName(), method.getSignature(), method.isStatic()); SourceLineAnnotation methodSourceLines = SourceLineAnnotation.fo...
[ "@", "Nonnull", "public", "BugInstance", "addMethod", "(", "JavaClass", "javaClass", ",", "Method", "method", ")", "{", "MethodAnnotation", "methodAnnotation", "=", "new", "MethodAnnotation", "(", "javaClass", ".", "getClassName", "(", ")", ",", "method", ".", "...
Add a method annotation. If this is the first method annotation added, it becomes the primary method annotation. If the method has source line information, then a SourceLineAnnotation is added to the method. @param javaClass the class the method is defined in @param method the method @return this object
[ "Add", "a", "method", "annotation", ".", "If", "this", "is", "the", "first", "method", "annotation", "added", "it", "becomes", "the", "primary", "method", "annotation", ".", "If", "the", "method", "has", "source", "line", "information", "then", "a", "SourceL...
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/BugInstance.java#L1363-L1371
train
Add a method annotation to this bug instance.
Create a Java method that does the following: "Add a method annotation to this bug instance.".
Of course, here is the Java code you requested: ```java @Nonnull public BugInstance addMethod(JavaClass javaClass, Method method) { MethodAnnotation methodAnnotation = new MethodAnnotation(javaClass.getClassName(), method.getName(), method.getSignature(), method.isStatic()); SourceL...
KyoriPowered/lunar
src/main/java/net/kyori/lunar/Pair.java
Pair.of
public static <L, R> @NonNull Pair<L, R> of(final Map.Entry<L, R> entry) { return of(entry.getKey(), entry.getValue()); }
java
public static <L, R> @NonNull Pair<L, R> of(final Map.Entry<L, R> entry) { return of(entry.getKey(), entry.getValue()); }
[ "public", "static", "<", "L", ",", "R", ">", "@", "NonNull", "Pair", "<", "L", ",", "R", ">", "of", "(", "final", "Map", ".", "Entry", "<", "L", ",", "R", ">", "entry", ")", "{", "return", "of", "(", "entry", ".", "getKey", "(", ")", ",", "...
Creates a new pair from a map entry. @param entry the entry @param <L> the left type @param <R> the right type @return the pair
[ "Creates", "a", "new", "pair", "from", "a", "map", "entry", "." ]
6856747d9034a2fe0c8d0a8a0150986797732b5c
https://github.com/KyoriPowered/lunar/blob/6856747d9034a2fe0c8d0a8a0150986797732b5c/src/main/java/net/kyori/lunar/Pair.java#L76-L78
train
Create a Pair from a Map. Entry.
Create a Java method that does the following: "Create a Pair from a Map. Entry.".
Of course, here is the Java code you requested: ```java public static <L, R> @NonNull Pair<L, R> of(final Map.Entry<L, R> entry) { return of(entry.getKey(), entry.getValue()); } ``` Hope this helps!
udevbe/wayland-java-bindings
stubs-server/src/main/java/org/freedesktop/wayland/server/Resource.java
Resource.postEvent
public void postEvent(final int opcode, final Arguments args) { WaylandServerCore.INSTANCE() .wl_resource_post_event_array(this.pointer, opcode, args.p...
java
public void postEvent(final int opcode, final Arguments args) { WaylandServerCore.INSTANCE() .wl_resource_post_event_array(this.pointer, opcode, args.p...
[ "public", "void", "postEvent", "(", "final", "int", "opcode", ",", "final", "Arguments", "args", ")", "{", "WaylandServerCore", ".", "INSTANCE", "(", ")", ".", "wl_resource_post_event_array", "(", "this", ".", "pointer", ",", "opcode", ",", "args", ".", "poi...
Post an event to the client's object referred to by 'resource'. 'opcode' is the event number generated from the protocol XML description (the event name). The variable arguments are the event parameters, in the order they appear in the protocol XML specification. <p/> The variable arguments' types are: <ul> <li>type=ui...
[ "Post", "an", "event", "to", "the", "client", "s", "object", "referred", "to", "by", "resource", ".", "opcode", "is", "the", "event", "number", "generated", "from", "the", "protocol", "XML", "description", "(", "the", "event", "name", ")", ".", "The", "v...
c0551e74cd0597f3e81e2f976b255ee492160e5e
https://github.com/udevbe/wayland-java-bindings/blob/c0551e74cd0597f3e81e2f976b255ee492160e5e/stubs-server/src/main/java/org/freedesktop/wayland/server/Resource.java#L160-L167
train
Post an event to the resource.
Create a Java method that does the following: "Post an event to the resource.".
Of course, here is the Java code you requested: ```java public void postEvent(final int opcode, final Arguments args) { WaylandServerCore.INSTANCE() .wl_resource_post_event_array(this.pointer, opcode, ...
haifengl/smile
plot/src/main/java/smile/plot/Dendrogram.java
Dendrogram.plot
public static PlotCanvas plot(String id, int[][] merge, double[] height) { int n = merge.length + 1; Dendrogram dendrogram = new Dendrogram(merge, height); double[] lowerBound = {-n / 100, 0}; double[] upperBound = {n + n / 100, 1.01 * dendrogram.getHeight()}; PlotCanvas canvas...
java
public static PlotCanvas plot(String id, int[][] merge, double[] height) { int n = merge.length + 1; Dendrogram dendrogram = new Dendrogram(merge, height); double[] lowerBound = {-n / 100, 0}; double[] upperBound = {n + n / 100, 1.01 * dendrogram.getHeight()}; PlotCanvas canvas...
[ "public", "static", "PlotCanvas", "plot", "(", "String", "id", ",", "int", "[", "]", "[", "]", "merge", ",", "double", "[", "]", "height", ")", "{", "int", "n", "=", "merge", ".", "length", "+", "1", ";", "Dendrogram", "dendrogram", "=", "new", "De...
Create a dendrogram plot. @param id the id of the plot. @param merge an n-1 by 2 matrix of which row i describes the merging of clusters at step i of the clustering. If an element j in the row is less than n, then observation j was merged at this stage. If j &ge; n then the merge was with the cluster formed at the (ear...
[ "Create", "a", "dendrogram", "plot", "." ]
e27e43e90fbaacce3f99d30120cf9dd6a764c33d
https://github.com/haifengl/smile/blob/e27e43e90fbaacce3f99d30120cf9dd6a764c33d/plot/src/main/java/smile/plot/Dendrogram.java#L185-L200
train
Create a plot canvas for a single image.
Create a Java method that does the following: "Create a plot canvas for a single image.".
Of course, here is the Java code you requested: ```java public static PlotCanvas plot(String id, int[][] merge, double[] height) { int n = merge.length + 1; Dendrogram dendrogram = new Dendrogram(merge, height); double[] lowerBound = {-n / 100, 0}; double[] upperBound = {n + n / 100, 1...
aws/aws-sdk-java
aws-java-sdk-ec2/src/main/java/com/amazonaws/services/ec2/model/SecurityGroup.java
SecurityGroup.withIpPermissionsEgress
public SecurityGroup withIpPermissionsEgress(IpPermission... ipPermissionsEgress) { if (this.ipPermissionsEgress == null) { setIpPermissionsEgress(new com.amazonaws.internal.SdkInternalList<IpPermission>(ipPermissionsEgress.length)); } for (IpPermission ele : ipPermissionsEgress) { ...
java
public SecurityGroup withIpPermissionsEgress(IpPermission... ipPermissionsEgress) { if (this.ipPermissionsEgress == null) { setIpPermissionsEgress(new com.amazonaws.internal.SdkInternalList<IpPermission>(ipPermissionsEgress.length)); } for (IpPermission ele : ipPermissionsEgress) { ...
[ "public", "SecurityGroup", "withIpPermissionsEgress", "(", "IpPermission", "...", "ipPermissionsEgress", ")", "{", "if", "(", "this", ".", "ipPermissionsEgress", "==", "null", ")", "{", "setIpPermissionsEgress", "(", "new", "com", ".", "amazonaws", ".", "internal", ...
<p> [VPC only] The outbound rules associated with the security group. </p> <p> <b>NOTE:</b> This method appends the values to the existing list (if any). Use {@link #setIpPermissionsEgress(java.util.Collection)} or {@link #withIpPermissionsEgress(java.util.Collection)} if you want to override the existing values. </p> ...
[ "<p", ">", "[", "VPC", "only", "]", "The", "outbound", "rules", "associated", "with", "the", "security", "group", ".", "<", "/", "p", ">", "<p", ">", "<b", ">", "NOTE", ":", "<", "/", "b", ">", "This", "method", "appends", "the", "values", "to", ...
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-ec2/src/main/java/com/amazonaws/services/ec2/model/SecurityGroup.java#L359-L367
train
Sets the value of the ipPermissionsEgress property.
Create a Java method that does the following: "Sets the value of the ipPermissionsEgress property.".
Of course, here is the Java code you requested: ```java public SecurityGroup withIpPermissionsEgress(IpPermission... ipPermissionsEgress) { if (this.ipPermissionsEgress == null) { setIpPermissionsEgress(new com.amazonaws.internal.SdkInternalList<IpPermission>(ipPermissionsEgress.length)); }...
Activiti/Activiti
activiti-engine/src/main/java/org/activiti/engine/impl/bpmn/helper/ScopeUtil.java
ScopeUtil.createCopyOfSubProcessExecutionForCompensation
public static void createCopyOfSubProcessExecutionForCompensation(ExecutionEntity subProcessExecution) { EventSubscriptionEntityManager eventSubscriptionEntityManager = Context.getCommandContext().getEventSubscriptionEntityManager(); List<EventSubscriptionEntity> eventSubscriptions = eventSubscriptionEntityMa...
java
public static void createCopyOfSubProcessExecutionForCompensation(ExecutionEntity subProcessExecution) { EventSubscriptionEntityManager eventSubscriptionEntityManager = Context.getCommandContext().getEventSubscriptionEntityManager(); List<EventSubscriptionEntity> eventSubscriptions = eventSubscriptionEntityMa...
[ "public", "static", "void", "createCopyOfSubProcessExecutionForCompensation", "(", "ExecutionEntity", "subProcessExecution", ")", "{", "EventSubscriptionEntityManager", "eventSubscriptionEntityManager", "=", "Context", ".", "getCommandContext", "(", ")", ".", "getEventSubscriptio...
Creates a new event scope execution and moves existing event subscriptions to this new execution
[ "Creates", "a", "new", "event", "scope", "execution", "and", "moves", "existing", "event", "subscriptions", "to", "this", "new", "execution" ]
82e2b2cd2083b2f734ca0efc7815389c0f2517d9
https://github.com/Activiti/Activiti/blob/82e2b2cd2083b2f734ca0efc7815389c0f2517d9/activiti-engine/src/main/java/org/activiti/engine/impl/bpmn/helper/ScopeUtil.java#L75-L113
train
Create a copy of the given sub - process execution for compensation.
Create a Java method that does the following: "Create a copy of the given sub - process execution for compensation.".
Of course, here is the Java code you requested: ```java public static void createCopyOfSubProcessExecutionForCompensation(ExecutionEntity subProcessExecution) { EventSubscriptionEntityManager eventSubscriptionEntityManager = Context.getCommandContext().getEventSubscriptionEntityManager(); List<EventSubscript...
yan74/afplib
org.afplib/src/main/java/org/afplib/afplib/impl/ImageSizeImpl.java
ImageSizeImpl.setHRESOL
public void setHRESOL(Integer newHRESOL) { Integer oldHRESOL = hresol; hresol = newHRESOL; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, AfplibPackage.IMAGE_SIZE__HRESOL, oldHRESOL, hresol)); }
java
public void setHRESOL(Integer newHRESOL) { Integer oldHRESOL = hresol; hresol = newHRESOL; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, AfplibPackage.IMAGE_SIZE__HRESOL, oldHRESOL, hresol)); }
[ "public", "void", "setHRESOL", "(", "Integer", "newHRESOL", ")", "{", "Integer", "oldHRESOL", "=", "hresol", ";", "hresol", "=", "newHRESOL", ";", "if", "(", "eNotificationRequired", "(", ")", ")", "eNotify", "(", "new", "ENotificationImpl", "(", "this", ","...
<!-- begin-user-doc --> <!-- end-user-doc --> @generated
[ "<!", "--", "begin", "-", "user", "-", "doc", "--", ">", "<!", "--", "end", "-", "user", "-", "doc", "--", ">" ]
9ff0513f9448bdf8c0b0e31dc4910c094c48fb2f
https://github.com/yan74/afplib/blob/9ff0513f9448bdf8c0b0e31dc4910c094c48fb2f/org.afplib/src/main/java/org/afplib/afplib/impl/ImageSizeImpl.java#L188-L193
train
Sets the HRESOL value.
Create a Java method that does the following: "Sets the HRESOL value.".
Of course, here is the Java code you requested: ```java public void setHRESOL(Integer newHRESOL) { Integer oldHRESOL = hresol; hresol = newHRESOL; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, AfplibPackage.IMAGE_SIZE__HRESOL, oldHRESOL, hresol)); } ``` Hope this helps!
Cornutum/tcases
tcases-lib/src/main/java/org/cornutum/tcases/util/MapBuilder.java
MapBuilder.of
public static <K,V> MapBuilder<K,V> of( K key, V value) { return new MapBuilder<K,V>().put( key, value); }
java
public static <K,V> MapBuilder<K,V> of( K key, V value) { return new MapBuilder<K,V>().put( key, value); }
[ "public", "static", "<", "K", ",", "V", ">", "MapBuilder", "<", "K", ",", "V", ">", "of", "(", "K", "key", ",", "V", "value", ")", "{", "return", "new", "MapBuilder", "<", "K", ",", "V", ">", "(", ")", ".", "put", "(", "key", ",", "value", ...
Returns a new MapBuilder with the given entry.
[ "Returns", "a", "new", "MapBuilder", "with", "the", "given", "entry", "." ]
21e15cf107fa149620c40f4bda1829c1224fcfb1
https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/util/MapBuilder.java#L46-L49
train
Create a new MapBuilder with the specified key and value.
Create a Java method that does the following: "Create a new MapBuilder with the specified key and value.".
Of course, here is the Java code you requested: ```java public static <K,V> MapBuilder<K,V> of( K key, V value) { return new MapBuilder<K,V>().put( key, value); } ``` Hope this helps!
ThreeTen/threetenbp
src/main/java/org/threeten/bp/Period.java
Period.plusDays
public Period plusDays(long daysToAdd) { if (daysToAdd == 0) { return this; } return create(years, months, Jdk8Methods.safeToInt(Jdk8Methods.safeAdd(days, daysToAdd))); }
java
public Period plusDays(long daysToAdd) { if (daysToAdd == 0) { return this; } return create(years, months, Jdk8Methods.safeToInt(Jdk8Methods.safeAdd(days, daysToAdd))); }
[ "public", "Period", "plusDays", "(", "long", "daysToAdd", ")", "{", "if", "(", "daysToAdd", "==", "0", ")", "{", "return", "this", ";", "}", "return", "create", "(", "years", ",", "months", ",", "Jdk8Methods", ".", "safeToInt", "(", "Jdk8Methods", ".", ...
Returns a copy of this period with the specified days added. <p> This adds the amount to the days unit in a copy of this period. The years and months units are unaffected. For example, "1 year, 6 months and 3 days" plus 2 days returns "1 year, 6 months and 5 days". <p> This instance is immutable and unaffected by this ...
[ "Returns", "a", "copy", "of", "this", "period", "with", "the", "specified", "days", "added", ".", "<p", ">", "This", "adds", "the", "amount", "to", "the", "days", "unit", "in", "a", "copy", "of", "this", "period", ".", "The", "years", "and", "months", ...
5f05b649f89f205aabd96b2f83c36796ec616fe6
https://github.com/ThreeTen/threetenbp/blob/5f05b649f89f205aabd96b2f83c36796ec616fe6/src/main/java/org/threeten/bp/Period.java#L609-L614
train
Returns a new period with the specified number of days added.
Create a Java method that does the following: "Returns a new period with the specified number of days added.".
Of course, here is the Java code you requested: ```java public Period plusDays(long daysToAdd) { if (daysToAdd == 0) { return this; } return create(years, months, Jdk8Methods.safeToInt(Jdk8Methods.safeAdd(days, daysToAdd))); } ``` Hope this helps!
aws/aws-sdk-java
aws-java-sdk-sagemaker/src/main/java/com/amazonaws/services/sagemaker/model/transform/StoppingConditionMarshaller.java
StoppingConditionMarshaller.marshall
public void marshall(StoppingCondition stoppingCondition, ProtocolMarshaller protocolMarshaller) { if (stoppingCondition == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(stoppingCondition.getMaxRunt...
java
public void marshall(StoppingCondition stoppingCondition, ProtocolMarshaller protocolMarshaller) { if (stoppingCondition == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(stoppingCondition.getMaxRunt...
[ "public", "void", "marshall", "(", "StoppingCondition", "stoppingCondition", ",", "ProtocolMarshaller", "protocolMarshaller", ")", "{", "if", "(", "stoppingCondition", "==", "null", ")", "{", "throw", "new", "SdkClientException", "(", "\"Invalid argument passed to marshal...
Marshall the given parameter object.
[ "Marshall", "the", "given", "parameter", "object", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-sagemaker/src/main/java/com/amazonaws/services/sagemaker/model/transform/StoppingConditionMarshaller.java#L42-L53
train
marshalls the given stoppingCondition to the JSON - compatible parameter object.
Create a Java method that does the following: "marshalls the given stoppingCondition to the JSON - compatible parameter object.".
Of course, here is the Java code you requested: ```java public void marshall(StoppingCondition stoppingCondition, ProtocolMarshaller protocolMarshaller) { if (stoppingCondition == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { ...
jamesagnew/hapi-fhir
hapi-fhir-base/src/main/java/ca/uhn/fhir/context/ProvidedResourceScanner.java
ProvidedResourceScanner.scanForProvidedResources
@SuppressWarnings("unchecked") public void scanForProvidedResources(Object theProvider) { ProvidesResources annotation = theProvider.getClass().getAnnotation(ProvidesResources.class); if (annotation == null) return; for (Class<?> clazz : annotation.resources()) { if (IBaseResource.class.isAssignableFrom(cl...
java
@SuppressWarnings("unchecked") public void scanForProvidedResources(Object theProvider) { ProvidesResources annotation = theProvider.getClass().getAnnotation(ProvidesResources.class); if (annotation == null) return; for (Class<?> clazz : annotation.resources()) { if (IBaseResource.class.isAssignableFrom(cl...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "void", "scanForProvidedResources", "(", "Object", "theProvider", ")", "{", "ProvidesResources", "annotation", "=", "theProvider", ".", "getClass", "(", ")", ".", "getAnnotation", "(", "ProvidesResources", ...
If {@code theProvider} is tagged with the {@code ProvidesResources} annotation, this method will add every resource listed by the {@code resources} method. <p> Notes: </p> <ul> <li>if {@code theProvider} isn't annotated with {@code resources} nothing is done; it's expected that most RestfulServers and ResourceProviders...
[ "If", "{", "@code", "theProvider", "}", "is", "tagged", "with", "the", "{", "@code", "ProvidesResources", "}", "annotation", "this", "method", "will", "add", "every", "resource", "listed", "by", "the", "{", "@code", "resources", "}", "method", ".", "<p", "...
150a84d52fe691b7f48fcb28247c4bddb7aec352
https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/ProvidedResourceScanner.java#L65-L77
train
Scan for provided resources
Create a Java method that does the following: "Scan for provided resources".
Of course, here is the Java code you requested: ```java @SuppressWarnings("unchecked") public void scanForProvidedResources(Object theProvider) { ProvidesResources annotation = theProvider.getClass().getAnnotation(ProvidesResources.class); if (annotation == null) return; for (Class<?> clazz : annotation.reso...
QSFT/Doradus
doradus-server/src/main/java/com/dell/doradus/core/ServerParams.java
ServerParams.addConfigParam
private void addConfigParam(String name, Object value) throws ConfigurationException { if (isModuleName(name)) { Utils.require(value instanceof Map, "Value for module '%s' should be a map: %s", name, value.toString()); updateMap(m_params, name, value); ...
java
private void addConfigParam(String name, Object value) throws ConfigurationException { if (isModuleName(name)) { Utils.require(value instanceof Map, "Value for module '%s' should be a map: %s", name, value.toString()); updateMap(m_params, name, value); ...
[ "private", "void", "addConfigParam", "(", "String", "name", ",", "Object", "value", ")", "throws", "ConfigurationException", "{", "if", "(", "isModuleName", "(", "name", ")", ")", "{", "Utils", ".", "require", "(", "value", "instanceof", "Map", ",", "\"Value...
(e.g., DBService) or a legacy YAML file option (e.g., dbhost).
[ "(", "e", ".", "g", ".", "DBService", ")", "or", "a", "legacy", "YAML", "file", "option", "(", "e", ".", "g", ".", "dbhost", ")", "." ]
ad64d3c37922eefda68ec8869ef089c1ca604b70
https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/core/ServerParams.java#L490-L498
train
Adds a configuration parameter to the configuration.
Create a Java method that does the following: "Adds a configuration parameter to the configuration.".
Of course, here is the Java code you requested: ```java private void addConfigParam(String name, Object value) throws ConfigurationException { if (isModuleName(name)) { Utils.require(value instanceof Map, "Value for module '%s' should be a map: %s", name, value.toString...
aws/aws-sdk-java
aws-java-sdk-core/src/main/java/com/amazonaws/util/BinaryUtils.java
BinaryUtils.copyBytesFrom
public static byte[] copyBytesFrom(ByteBuffer bb) { if (bb == null) { return null; } if (bb.hasArray()) { return Arrays.copyOfRange( bb.array(), bb.arrayOffset() + bb.position(), bb.arrayOffset() + bb.limit()); ...
java
public static byte[] copyBytesFrom(ByteBuffer bb) { if (bb == null) { return null; } if (bb.hasArray()) { return Arrays.copyOfRange( bb.array(), bb.arrayOffset() + bb.position(), bb.arrayOffset() + bb.limit()); ...
[ "public", "static", "byte", "[", "]", "copyBytesFrom", "(", "ByteBuffer", "bb", ")", "{", "if", "(", "bb", "==", "null", ")", "{", "return", "null", ";", "}", "if", "(", "bb", ".", "hasArray", "(", ")", ")", "{", "return", "Arrays", ".", "copyOfRan...
Returns a copy of the bytes from the given <code>ByteBuffer</code>, ranging from the the buffer's current position to the buffer's limit; or null if the input is null. <p> The internal states of the given byte buffer will be restored when this method completes execution. <p> When handling <code>ByteBuffer</code> from u...
[ "Returns", "a", "copy", "of", "the", "bytes", "from", "the", "given", "<code", ">", "ByteBuffer<", "/", "code", ">", "ranging", "from", "the", "the", "buffer", "s", "current", "position", "to", "the", "buffer", "s", "limit", ";", "or", "null", "if", "t...
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/util/BinaryUtils.java#L138-L153
train
Copy bytes from ByteBuffer to byte array
Create a Java method that does the following: "Copy bytes from ByteBuffer to byte array".
Of course, here is the Java code you requested: ```java public static byte[] copyBytesFrom(ByteBuffer bb) { if (bb == null) { return null; } if (bb.hasArray()) { return Arrays.copyOfRange( bb.array(), bb.arrayOffset() + bb.positio...
teatrove/teatrove
trove/src/main/java/org/teatrove/trove/util/CompleteIntrospector.java
CompleteIntrospector.main
public static void main(String[] args) throws Exception { Map map = getAllProperties(Class.forName(args[0])); Iterator keys = map.keySet().iterator(); while (keys.hasNext()) { String key = (String)keys.next(); PropertyDescriptor desc = (PropertyDescriptor)map.get(key); ...
java
public static void main(String[] args) throws Exception { Map map = getAllProperties(Class.forName(args[0])); Iterator keys = map.keySet().iterator(); while (keys.hasNext()) { String key = (String)keys.next(); PropertyDescriptor desc = (PropertyDescriptor)map.get(key); ...
[ "public", "static", "void", "main", "(", "String", "[", "]", "args", ")", "throws", "Exception", "{", "Map", "map", "=", "getAllProperties", "(", "Class", ".", "forName", "(", "args", "[", "0", "]", ")", ")", ";", "Iterator", "keys", "=", "map", ".",...
Test program.
[ "Test", "program", "." ]
7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea
https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/trove/src/main/java/org/teatrove/trove/util/CompleteIntrospector.java#L48-L56
train
Main method to get all the properties of a class.
Create a Java method that does the following: "Main method to get all the properties of a class.".
Of course, here is the Java code you requested: ```java public static void main(String[] args) throws Exception { Map map = getAllProperties(Class.forName(args[0])); Iterator keys = map.keySet().iterator(); while (keys.hasNext()) { String key = (String)keys.next(); Prope...
leancloud/java-sdk-all
core/src/main/java/cn/leancloud/AVObject.java
AVObject.hasCircleReference
public boolean hasCircleReference(Map<AVObject, Boolean> markMap) { if (null == markMap) { return false; } markMap.put(this, true); boolean rst = false; for (ObjectFieldOperation op: operations.values()) { rst = rst || op.checkCircleReference(markMap); } return rst; }
java
public boolean hasCircleReference(Map<AVObject, Boolean> markMap) { if (null == markMap) { return false; } markMap.put(this, true); boolean rst = false; for (ObjectFieldOperation op: operations.values()) { rst = rst || op.checkCircleReference(markMap); } return rst; }
[ "public", "boolean", "hasCircleReference", "(", "Map", "<", "AVObject", ",", "Boolean", ">", "markMap", ")", "{", "if", "(", "null", "==", "markMap", ")", "{", "return", "false", ";", "}", "markMap", ".", "put", "(", "this", ",", "true", ")", ";", "b...
judge operations' value include circle reference or not. notice: internal used, pls not invoke it. @param markMap @return
[ "judge", "operations", "value", "include", "circle", "reference", "or", "not", "." ]
323f8e7ee38051b1350790e5192304768c5c9f5f
https://github.com/leancloud/java-sdk-all/blob/323f8e7ee38051b1350790e5192304768c5c9f5f/core/src/main/java/cn/leancloud/AVObject.java#L621-L631
train
Check if this object has a circle reference.
Create a Java method that does the following: "Check if this object has a circle reference.".
Of course, here is the Java code you requested: ```java public boolean hasCircleReference(Map<AVObject, Boolean> markMap) { if (null == markMap) { return false; } markMap.put(this, true); boolean rst = false; for (ObjectFieldOperation op: operations.values()) { rst = rst || op.checkCirc...
HanSolo/Medusa
src/main/java/eu/hansolo/medusa/skins/SlimSkin.java
SlimSkin.resizeValueText
private void resizeValueText() { double maxWidth = size * 0.86466165; double fontSize = size * 0.2556391; valueText.setFont(Fonts.latoLight(fontSize)); if (valueText.getLayoutBounds().getWidth() > maxWidth) { Helper.adjustTextSize(valueText, maxWidth, fontSize); } valueText.reloc...
java
private void resizeValueText() { double maxWidth = size * 0.86466165; double fontSize = size * 0.2556391; valueText.setFont(Fonts.latoLight(fontSize)); if (valueText.getLayoutBounds().getWidth() > maxWidth) { Helper.adjustTextSize(valueText, maxWidth, fontSize); } valueText.reloc...
[ "private", "void", "resizeValueText", "(", ")", "{", "double", "maxWidth", "=", "size", "*", "0.86466165", ";", "double", "fontSize", "=", "size", "*", "0.2556391", ";", "valueText", ".", "setFont", "(", "Fonts", ".", "latoLight", "(", "fontSize", ")", ")"...
******************** Resizing ******************************************
[ "********************", "Resizing", "******************************************" ]
1321e4925dcde659028d4b296e49e316494c114c
https://github.com/HanSolo/Medusa/blob/1321e4925dcde659028d4b296e49e316494c114c/src/main/java/eu/hansolo/medusa/skins/SlimSkin.java#L205-L211
train
Resize the valueText to fit the size of the image.
Create a Java method that does the following: "Resize the valueText to fit the size of the image.".
Of course, here is the Java code you requested: ```java private void resizeValueText() { double maxWidth = size * 0.86466165; double fontSize = size * 0.2556391; valueText.setFont(Fonts.latoLight(fontSize)); if (valueText.getLayoutBounds().getWidth() > maxWidth) { Helper.adjustTextSize(...
projectodd/jrapidoc
jrapidoc-rest-plugin/src/main/java/org/jboss/resteasy/spi/metadata/ResourceBuilder.java
ResourceBuilder.constructor
public static ResourceConstructor constructor(Class<?> annotatedResourceClass) { Constructor constructor = PickConstructor.pickPerRequestConstructor(annotatedResourceClass); if (constructor == null) { throw new RuntimeException("Could not find constructor for class: " + annotatedResourceC...
java
public static ResourceConstructor constructor(Class<?> annotatedResourceClass) { Constructor constructor = PickConstructor.pickPerRequestConstructor(annotatedResourceClass); if (constructor == null) { throw new RuntimeException("Could not find constructor for class: " + annotatedResourceC...
[ "public", "static", "ResourceConstructor", "constructor", "(", "Class", "<", "?", ">", "annotatedResourceClass", ")", "{", "Constructor", "constructor", "=", "PickConstructor", ".", "pickPerRequestConstructor", "(", "annotatedResourceClass", ")", ";", "if", "(", "cons...
Picks a constructor from an annotated resource class based on spec rules @param annotatedResourceClass @return
[ "Picks", "a", "constructor", "from", "an", "annotated", "resource", "class", "based", "on", "spec", "rules" ]
2c461f6fed22374e280b13c3c297e724294a1ceb
https://github.com/projectodd/jrapidoc/blob/2c461f6fed22374e280b13c3c297e724294a1ceb/jrapidoc-rest-plugin/src/main/java/org/jboss/resteasy/spi/metadata/ResourceBuilder.java#L629-L640
valid
Gets the constructor for the specified class.
Create a Java method that does the following: "Gets the constructor for the specified class.".
Of course, here is the Java code you requested: ```java public static ResourceConstructor constructor(Class<?> annotatedResourceClass) { Constructor constructor = PickConstructor.pickPerRequestConstructor(annotatedResourceClass); if (constructor == null) { throw new RuntimeException("Cou...
HeidelTime/heideltime
src/jvntextpro/service/TaggingService.java
TaggingService.run
public void run(){ System.out.println("Starting tagging service!"); try { this.socket = new ServerSocket(this.port); } catch (IOException ioe){ System.out.println(ioe); System.exit(1); } init(); System.out.println("Tagging service is started successfully"); while (true){ Sock...
java
public void run(){ System.out.println("Starting tagging service!"); try { this.socket = new ServerSocket(this.port); } catch (IOException ioe){ System.out.println(ioe); System.exit(1); } init(); System.out.println("Tagging service is started successfully"); while (true){ Sock...
[ "public", "void", "run", "(", ")", "{", "System", ".", "out", ".", "println", "(", "\"Starting tagging service!\"", ")", ";", "try", "{", "this", ".", "socket", "=", "new", "ServerSocket", "(", "this", ".", "port", ")", ";", "}", "catch", "(", "IOExcep...
/* (non-Javadoc) @see java.lang.Thread#run()
[ "/", "*", "(", "non", "-", "Javadoc", ")" ]
4ef5002eb5ecfeb818086ff7e394e792ee360335
https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/jvntextpro/service/TaggingService.java#L131-L165
train
Starts the tagging service.
Create a Java method that does the following: "Starts the tagging service.".
Of course, here is the Java code you requested: ```java public void run(){ System.out.println("Starting tagging service!"); try { this.socket = new ServerSocket(this.port); } catch (IOException ioe){ System.out.println(ioe); System.exit(1); } init(); System.out.println("Tagging ser...
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/html/Table.java
Table.newHeading
public Table newHeading() { newBlock("th"); if (_defaultHead!=null) { cell.setAttributesFrom(_defaultHead); if (_defaultHead.size()>0) cell.add(_defaultHead.contents()); } return this; }
java
public Table newHeading() { newBlock("th"); if (_defaultHead!=null) { cell.setAttributesFrom(_defaultHead); if (_defaultHead.size()>0) cell.add(_defaultHead.contents()); } return this; }
[ "public", "Table", "newHeading", "(", ")", "{", "newBlock", "(", "\"th\"", ")", ";", "if", "(", "_defaultHead", "!=", "null", ")", "{", "cell", ".", "setAttributesFrom", "(", "_defaultHead", ")", ";", "if", "(", "_defaultHead", ".", "size", "(", ")", "...
/* Create a new Heading in the current row. Adds to the table after this call and before next call to newRow, newCell or newHeader are added to the cell.
[ "/", "*", "Create", "a", "new", "Heading", "in", "the", "current", "row", ".", "Adds", "to", "the", "table", "after", "this", "call", "and", "before", "next", "call", "to", "newRow", "newCell", "or", "newHeader", "are", "added", "to", "the", "cell", "....
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/html/Table.java#L183-L193
train
This method is called to create a new heading.
Create a Java method that does the following: "This method is called to create a new heading.".
Of course, here is the Java code you requested: ```java public Table newHeading() { newBlock("th"); if (_defaultHead!=null) { cell.setAttributesFrom(_defaultHead); if (_defaultHead.size()>0) cell.add(_defaultHead.contents()); } return ...
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldTracker.java
TldTracker.hypothesisFusion
protected boolean hypothesisFusion( boolean trackingWorked , boolean detectionWorked ) { valid = false; boolean uniqueDetection = detectionWorked && !detection.isAmbiguous(); TldRegion detectedRegion = detection.getBest(); double confidenceTarget; if( trackingWorked ) { // get the scores from tracking...
java
protected boolean hypothesisFusion( boolean trackingWorked , boolean detectionWorked ) { valid = false; boolean uniqueDetection = detectionWorked && !detection.isAmbiguous(); TldRegion detectedRegion = detection.getBest(); double confidenceTarget; if( trackingWorked ) { // get the scores from tracking...
[ "protected", "boolean", "hypothesisFusion", "(", "boolean", "trackingWorked", ",", "boolean", "detectionWorked", ")", "{", "valid", "=", "false", ";", "boolean", "uniqueDetection", "=", "detectionWorked", "&&", "!", "detection", ".", "isAmbiguous", "(", ")", ";", ...
Combines hypotheses from tracking and detection. @param trackingWorked If the sequential tracker updated the track region successfully or not @return true a hypothesis was found, false if it failed to find a hypothesis
[ "Combines", "hypotheses", "from", "tracking", "and", "detection", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldTracker.java#L332-L385
train
This method is used to determine if hypothesis is fusion.
Create a Java method that does the following: "This method is used to determine if hypothesis is fusion.".
Of course, here is the Java code you requested: ```java protected boolean hypothesisFusion( boolean trackingWorked , boolean detectionWorked ) { valid = false; boolean uniqueDetection = detectionWorked && !detection.isAmbiguous(); TldRegion detectedRegion = detection.getBest(); double confidenceTarget; i...
jenkinsci/sectioned-view-plugin
src/main/java/hudson/plugins/sectioned_view/SectionedViewSection.java
SectionedViewSection.all
public static DescriptorExtensionList<SectionedViewSection, SectionedViewSectionDescriptor> all() { return Hudson.getInstance().<SectionedViewSection, SectionedViewSectionDescriptor>getDescriptorList(SectionedViewSection.class); }
java
public static DescriptorExtensionList<SectionedViewSection, SectionedViewSectionDescriptor> all() { return Hudson.getInstance().<SectionedViewSection, SectionedViewSectionDescriptor>getDescriptorList(SectionedViewSection.class); }
[ "public", "static", "DescriptorExtensionList", "<", "SectionedViewSection", ",", "SectionedViewSectionDescriptor", ">", "all", "(", ")", "{", "return", "Hudson", ".", "getInstance", "(", ")", ".", "<", "SectionedViewSection", ",", "SectionedViewSectionDescriptor", ">", ...
Returns all the registered {@link SectionedViewSection} descriptors.
[ "Returns", "all", "the", "registered", "{" ]
dc8a23c018c4c329b8e75e91cea2b7f466ce0320
https://github.com/jenkinsci/sectioned-view-plugin/blob/dc8a23c018c4c329b8e75e91cea2b7f466ce0320/src/main/java/hudson/plugins/sectioned_view/SectionedViewSection.java#L90-L92
train
Get all the section descriptions.
Create a Java method that does the following: "Get all the section descriptions.".
Of course, here is the Java code you requested: ```java public static DescriptorExtensionList<SectionedViewSection, SectionedViewSectionDescriptor> all() { return Hudson.getInstance().<SectionedViewSection, SectionedViewSectionDescriptor>getDescriptorList(SectionedViewSection.class); } ``` Hope this helps...
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/utils/index/FilteredIndexIterator.java
FilteredIndexIterator.hasNext
public synchronized boolean hasNext() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "hasNext"); if(next == null) { synchronized(index) { next = (Index.Entry) cursor.next(); if(filter != null) { while(next != null && ...
java
public synchronized boolean hasNext() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "hasNext"); if(next == null) { synchronized(index) { next = (Index.Entry) cursor.next(); if(filter != null) { while(next != null && ...
[ "public", "synchronized", "boolean", "hasNext", "(", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"hasNext\"", ")", ";", "if", "(",...
/* (non-Javadoc) @see java.util.Iterator#hasNext()
[ "/", "*", "(", "non", "-", "Javadoc", ")" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/utils/index/FilteredIndexIterator.java#L68-L92
train
Returns true if there is at least one entry in the index.
Create a Java method that does the following: "Returns true if there is at least one entry in the index.".
Of course, here is the Java code you requested: ```java public synchronized boolean hasNext() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "hasNext"); if(next == null) { synchronized(index) { next = (Index.Entry) cursor.next(); if(f...
demidenko05/beigesoft-orm
src/main/java/org/beigesoft/orm/factory/FctBnEntitiesProcessors.java
FctBnEntitiesProcessors.createPutPrcEntityPbSave
protected final PrcEntityPbSave<RS, IPersistableBase> createPutPrcEntityPbSave() throws Exception { PrcEntityPbSave<RS, IPersistableBase> proc = new PrcEntityPbSave<RS, IPersistableBase>(); proc.setSrvOrm(getSrvOrm()); //assigning fully initialized object: this.processorsMap .put(PrcEnti...
java
protected final PrcEntityPbSave<RS, IPersistableBase> createPutPrcEntityPbSave() throws Exception { PrcEntityPbSave<RS, IPersistableBase> proc = new PrcEntityPbSave<RS, IPersistableBase>(); proc.setSrvOrm(getSrvOrm()); //assigning fully initialized object: this.processorsMap .put(PrcEnti...
[ "protected", "final", "PrcEntityPbSave", "<", "RS", ",", "IPersistableBase", ">", "createPutPrcEntityPbSave", "(", ")", "throws", "Exception", "{", "PrcEntityPbSave", "<", "RS", ",", "IPersistableBase", ">", "proc", "=", "new", "PrcEntityPbSave", "<", "RS", ",", ...
<p>Get PrcEntityPbSave (create and put into map).</p> @return requested PrcEntityPbSave @throws Exception - an exception
[ "<p", ">", "Get", "PrcEntityPbSave", "(", "create", "and", "put", "into", "map", ")", ".", "<", "/", "p", ">" ]
f1b2c70701a111741a436911ca24ef9d38eba0b9
https://github.com/demidenko05/beigesoft-orm/blob/f1b2c70701a111741a436911ca24ef9d38eba0b9/src/main/java/org/beigesoft/orm/factory/FctBnEntitiesProcessors.java#L491-L500
train
Create a PrcEntityPbSave object.
Create a Java method that does the following: "Create a PrcEntityPbSave object.".
Of course, here is the Java code you requested: ```java protected final PrcEntityPbSave<RS, IPersistableBase> createPutPrcEntityPbSave() throws Exception { PrcEntityPbSave<RS, IPersistableBase> proc = new PrcEntityPbSave<RS, IPersistableBase>(); proc.setSrvOrm(getSrvOrm()); //assigning fully init...
Unidata/thredds
ui/src/main/java/ucar/nc2/ui/table/TreeTableModelAbstract.java
TreeTableModelAbstract.fireTreeNodesRemoved
protected void fireTreeNodesRemoved(Object source, Object[] path, int[] childIndices, Object[] children) { // Guaranteed to return a non-null array Object[] listeners = listenerList.getListenerList(); TreeModelE...
java
protected void fireTreeNodesRemoved(Object source, Object[] path, int[] childIndices, Object[] children) { // Guaranteed to return a non-null array Object[] listeners = listenerList.getListenerList(); TreeModelE...
[ "protected", "void", "fireTreeNodesRemoved", "(", "Object", "source", ",", "Object", "[", "]", "path", ",", "int", "[", "]", "childIndices", ",", "Object", "[", "]", "children", ")", "{", "// Guaranteed to return a non-null array\r", "Object", "[", "]", "listene...
/* Notify all listeners that have registered interest for notification on this event type. The event instance is lazily created using the parameters passed into the fire method. @see EventListenerList
[ "/", "*", "Notify", "all", "listeners", "that", "have", "registered", "interest", "for", "notification", "on", "this", "event", "type", ".", "The", "event", "instance", "is", "lazily", "created", "using", "the", "parameters", "passed", "into", "the", "fire", ...
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/ui/src/main/java/ucar/nc2/ui/table/TreeTableModelAbstract.java#L149-L166
test
Fires an event if the related listeners have been registered to fire a event.
Create a Java method that does the following: "Fires an event if the related listeners have been registered to fire a event.".
Of course, here is the Java code you requested: ```java protected void fireTreeNodesRemoved(Object source, Object[] path, int[] childIndices, Object[] children) { // Guaranteed to return a non-null array Object[] listen...
ltearno/hexa.tools
hexa.persistence/src/main/java/fr/lteconsulting/hexa/persistence/client/hqlParser.java
hqlParser.selectFrom
public final hqlParser.selectFrom_return selectFrom() throws RecognitionException { hqlParser.selectFrom_return retval = new hqlParser.selectFrom_return(); retval.start = input.LT(1); CommonTree root_0 = null; ParserRuleReturnScope s =null; ParserRuleReturnScope f =null; RewriteRuleSubtreeStream stream_s...
java
public final hqlParser.selectFrom_return selectFrom() throws RecognitionException { hqlParser.selectFrom_return retval = new hqlParser.selectFrom_return(); retval.start = input.LT(1); CommonTree root_0 = null; ParserRuleReturnScope s =null; ParserRuleReturnScope f =null; RewriteRuleSubtreeStream stream_s...
[ "public", "final", "hqlParser", ".", "selectFrom_return", "selectFrom", "(", ")", "throws", "RecognitionException", "{", "hqlParser", ".", "selectFrom_return", "retval", "=", "new", "hqlParser", ".", "selectFrom_return", "(", ")", ";", "retval", ".", "start", "=",...
hql.g:242:1: selectFrom : (s= selectClause )? (f= fromClause )? -> {$f.tree == null && filter}? ^( SELECT_FROM FROM[\"{filter-implied FROM}\"] ( selectClause )? ) -> ^( SELECT_FROM ( fromClause )? ( selectClause )? ) ;
[ "hql", ".", "g", ":", "242", ":", "1", ":", "selectFrom", ":", "(", "s", "=", "selectClause", ")", "?", "(", "f", "=", "fromClause", ")", "?", "-", ">", "{", "$f", ".", "tree", "==", "null", "&&", "filter", "}", "?", "^", "(", "SELECT_FROM", ...
604c804901b1bb13fe10b3823cc4a639f8993363
https://github.com/ltearno/hexa.tools/blob/604c804901b1bb13fe10b3823cc4a639f8993363/hexa.persistence/src/main/java/fr/lteconsulting/hexa/persistence/client/hqlParser.java#L1541-L1676
train
Use this method to return the selectFrom statement in the HQL
Create a Java method that does the following: "Use this method to return the selectFrom statement in the HQL".
Of course, here is the Java code you requested: ```java public final hqlParser.selectFrom_return selectFrom() throws RecognitionException { hqlParser.selectFrom_return retval = new hqlParser.selectFrom_return(); retval.start = input.LT(1); CommonTree root_0 = null; ParserRuleReturnScope s =null; ParserRule...
shrinkwrap/descriptors
metadata-parser/src/main/java/org/jboss/shrinkwrap/descriptor/metadata/PackageInfo.java
PackageInfo.deleteExistingPackageInfo
public static void deleteExistingPackageInfo(final String destDirectory, final boolean verbose) { final File htmlFile = new File(destDirectory + File.separatorChar + PACKAGE_HTML_NAME); final File javaFile = new File(destDirectory + File.separatorChar + PACKAGE_JAVA_NAME); final Boolean isHtmlDe...
java
public static void deleteExistingPackageInfo(final String destDirectory, final boolean verbose) { final File htmlFile = new File(destDirectory + File.separatorChar + PACKAGE_HTML_NAME); final File javaFile = new File(destDirectory + File.separatorChar + PACKAGE_JAVA_NAME); final Boolean isHtmlDe...
[ "public", "static", "void", "deleteExistingPackageInfo", "(", "final", "String", "destDirectory", ",", "final", "boolean", "verbose", ")", "{", "final", "File", "htmlFile", "=", "new", "File", "(", "destDirectory", "+", "File", ".", "separatorChar", "+", "PACKAG...
Deletes package.html or package-info.java from the given directory. @param destDirectory @param verbose
[ "Deletes", "package", ".", "html", "or", "package", "-", "info", ".", "java", "from", "the", "given", "directory", "." ]
023ba080e6396b9f4dd8275dc4e5c0ebb6b5e6ba
https://github.com/shrinkwrap/descriptors/blob/023ba080e6396b9f4dd8275dc4e5c0ebb6b5e6ba/metadata-parser/src/main/java/org/jboss/shrinkwrap/descriptor/metadata/PackageInfo.java#L91-L101
train
Delete existing package info.
Create a Java method that does the following: "Delete existing package info.".
Of course, here is the Java code you requested: ```java public static void deleteExistingPackageInfo(final String destDirectory, final boolean verbose) { final File htmlFile = new File(destDirectory + File.separatorChar + PACKAGE_HTML_NAME); final File javaFile = new File(destDirectory + File.separator...
Stratio/stratio-cassandra
src/java/com/stratio/cassandra/index/service/TokenMapperGeneric.java
TokenMapperGeneric.query
@Override public Query query(Token token) { BytesRef ref = bytesRef(token); Term term = new Term(FIELD_NAME, ref); return new TermQuery(term); }
java
@Override public Query query(Token token) { BytesRef ref = bytesRef(token); Term term = new Term(FIELD_NAME, ref); return new TermQuery(term); }
[ "@", "Override", "public", "Query", "query", "(", "Token", "token", ")", "{", "BytesRef", "ref", "=", "bytesRef", "(", "token", ")", ";", "Term", "term", "=", "new", "Term", "(", "FIELD_NAME", ",", "ref", ")", ";", "return", "new", "TermQuery", "(", ...
{@inheritDoc}
[ "{" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/com/stratio/cassandra/index/service/TokenMapperGeneric.java#L71-L76
train
Query for a single token.
Create a Java method that does the following: "Query for a single token.".
Of course, here is the Java code you requested: ```java @Override public Query query(Token token) { BytesRef ref = bytesRef(token); Term term = new Term(FIELD_NAME, ref); return new TermQuery(term); } ``` Hope this helps!
google/error-prone-javac
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/MemberSummaryBuilder.java
MemberSummaryBuilder.getInstance
public static MemberSummaryBuilder getInstance( AnnotationTypeWriter annotationTypeWriter, Context context) { MemberSummaryBuilder builder = new MemberSummaryBuilder(context, annotationTypeWriter.getAnnotationTypeElement()); WriterFactory wf = context.configuration.getWriterF...
java
public static MemberSummaryBuilder getInstance( AnnotationTypeWriter annotationTypeWriter, Context context) { MemberSummaryBuilder builder = new MemberSummaryBuilder(context, annotationTypeWriter.getAnnotationTypeElement()); WriterFactory wf = context.configuration.getWriterF...
[ "public", "static", "MemberSummaryBuilder", "getInstance", "(", "AnnotationTypeWriter", "annotationTypeWriter", ",", "Context", "context", ")", "{", "MemberSummaryBuilder", "builder", "=", "new", "MemberSummaryBuilder", "(", "context", ",", "annotationTypeWriter", ".", "g...
Construct a new MemberSummaryBuilder. @param annotationTypeWriter the writer for the class whose members are being summarized. @param configuration the current configuration of the doclet.
[ "Construct", "a", "new", "MemberSummaryBuilder", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/MemberSummaryBuilder.java#L123-L135
train
Get a builder for the class.
Create a Java method that does the following: "Get a builder for the class.".
Of course, here is the Java code you requested: ```java public static MemberSummaryBuilder getInstance( AnnotationTypeWriter annotationTypeWriter, Context context) { MemberSummaryBuilder builder = new MemberSummaryBuilder(context, annotationTypeWriter.getAnnotationTypeElement()); ...
eFaps/eFaps-Kernel
src/main/java/org/efaps/db/AbstractPrintQuery.java
AbstractPrintQuery.addPhrase
public AbstractPrintQuery addPhrase(final String _key, final String _phraseStmt) throws EFapsException { ValueList list = null; final ValueParser parser = new ValueParser(new StringReader(_phraseStmt)); try { list = parser.Expressi...
java
public AbstractPrintQuery addPhrase(final String _key, final String _phraseStmt) throws EFapsException { ValueList list = null; final ValueParser parser = new ValueParser(new StringReader(_phraseStmt)); try { list = parser.Expressi...
[ "public", "AbstractPrintQuery", "addPhrase", "(", "final", "String", "_key", ",", "final", "String", "_phraseStmt", ")", "throws", "EFapsException", "{", "ValueList", "list", "=", "null", ";", "final", "ValueParser", "parser", "=", "new", "ValueParser", "(", "ne...
Add a Phrase to this PrintQuery. A Phrase is something like: <code>"$&lt;attribute[LastName]&gt; - $&lt;attribute[FirstName]&gt;"</code> This would return " John - Doe". One Phrase can contain various selects as defined for {@link #addSelect(String...)} and string to connect them. @param _key key the phrase can be acc...
[ "Add", "a", "Phrase", "to", "this", "PrintQuery", ".", "A", "Phrase", "is", "something", "like", ":", "<code", ">", "$&lt", ";", "attribute", "[", "LastName", "]", "&gt", ";", "-", "$&lt", ";", "attribute", "[", "FirstName", "]", "&gt", ";", "<", "/"...
04b96548f518c2386a93f5ec2b9349f9b9063859
https://github.com/eFaps/eFaps-Kernel/blob/04b96548f518c2386a93f5ec2b9349f9b9063859/src/main/java/org/efaps/db/AbstractPrintQuery.java#L400-L422
train
Add a phrase to the query.
Create a Java method that does the following: "Add a phrase to the query.".
Of course, here is the Java code you requested: ```java public AbstractPrintQuery addPhrase(final String _key, final String _phraseStmt) throws EFapsException { ValueList list = null; final ValueParser parser = new ValueParser(new StringReader(_phras...
sarl/sarl
main/coreplugins/io.sarl.lang/src/io/sarl/lang/validation/SARLValidator.java
SARLValidator.checkParameterName
@Check(CheckType.FAST) public void checkParameterName(XVariableDeclaration variable) { if (this.grammarAccess.getOccurrenceKeyword().equals(variable.getName())) { error(MessageFormat.format( Messages.SARLValidator_15, this.grammarAccess.getOccurrenceKeyword()), variable, XbasePackage.Literals....
java
@Check(CheckType.FAST) public void checkParameterName(XVariableDeclaration variable) { if (this.grammarAccess.getOccurrenceKeyword().equals(variable.getName())) { error(MessageFormat.format( Messages.SARLValidator_15, this.grammarAccess.getOccurrenceKeyword()), variable, XbasePackage.Literals....
[ "@", "Check", "(", "CheckType", ".", "FAST", ")", "public", "void", "checkParameterName", "(", "XVariableDeclaration", "variable", ")", "{", "if", "(", "this", ".", "grammarAccess", ".", "getOccurrenceKeyword", "(", ")", ".", "equals", "(", "variable", ".", ...
Check if the given local variable has a valid name. @param variable the variable to test. @see SARLFeatureNameValidator
[ "Check", "if", "the", "given", "local", "variable", "has", "a", "valid", "name", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/validation/SARLValidator.java#L1414-L1425
train
Check if the parameter name is a valid name.
Create a Java method that does the following: "Check if the parameter name is a valid name.".
Of course, here is the Java code you requested: ```java @Check(CheckType.FAST) public void checkParameterName(XVariableDeclaration variable) { if (this.grammarAccess.getOccurrenceKeyword().equals(variable.getName())) { error(MessageFormat.format( Messages.SARLValidator_15, this.grammarAccess.getOccurre...
lunisolar/magma
magma-func-builder/src/main/java/eu/lunisolar/magma/func/build/function/from/LObjCharFunctionBuilder.java
LObjCharFunctionBuilder.aCase
@Nonnull public <V extends T> LObjCharFunctionBuilder<T, R> aCase(Class<V> argC1, LObjCharFunction<V, R> function) { PartialCaseWithProduct.The pc = partialCaseFactoryMethod((a1, a2) -> (argC1 == null || argC1.isInstance(a1))); pc.evaluate(function); return self(); }
java
@Nonnull public <V extends T> LObjCharFunctionBuilder<T, R> aCase(Class<V> argC1, LObjCharFunction<V, R> function) { PartialCaseWithProduct.The pc = partialCaseFactoryMethod((a1, a2) -> (argC1 == null || argC1.isInstance(a1))); pc.evaluate(function); return self(); }
[ "@", "Nonnull", "public", "<", "V", "extends", "T", ">", "LObjCharFunctionBuilder", "<", "T", ",", "R", ">", "aCase", "(", "Class", "<", "V", ">", "argC1", ",", "LObjCharFunction", "<", "V", ",", "R", ">", "function", ")", "{", "PartialCaseWithProduct", ...
Adds full new case for the argument that are of specific classes (matched by instanceOf, null is a wildcard).
[ "Adds", "full", "new", "case", "for", "the", "argument", "that", "are", "of", "specific", "classes", "(", "matched", "by", "instanceOf", "null", "is", "a", "wildcard", ")", "." ]
83809c6d1a33d913aec6c49920251e4f0be8b213
https://github.com/lunisolar/magma/blob/83809c6d1a33d913aec6c49920251e4f0be8b213/magma-func-builder/src/main/java/eu/lunisolar/magma/func/build/function/from/LObjCharFunctionBuilder.java#L116-L122
train
A case of a LObjCharFunction.
Create a Java method that does the following: "A case of a LObjCharFunction.".
Of course, here is the Java code you requested: ```java @Nonnull public <V extends T> LObjCharFunctionBuilder<T, R> aCase(Class<V> argC1, LObjCharFunction<V, R> function) { PartialCaseWithProduct.The pc = partialCaseFactoryMethod((a1, a2) -> (argC1 == null || argC1.isInstance(a1))); pc.evaluate(function); retu...
mozilla/rhino
src/org/mozilla/javascript/optimizer/OptRuntime.java
OptRuntime.call0
public static Object call0(Callable fun, Scriptable thisObj, Context cx, Scriptable scope) { return fun.call(cx, scope, thisObj, ScriptRuntime.emptyArgs); }
java
public static Object call0(Callable fun, Scriptable thisObj, Context cx, Scriptable scope) { return fun.call(cx, scope, thisObj, ScriptRuntime.emptyArgs); }
[ "public", "static", "Object", "call0", "(", "Callable", "fun", ",", "Scriptable", "thisObj", ",", "Context", "cx", ",", "Scriptable", "scope", ")", "{", "return", "fun", ".", "call", "(", "cx", ",", "scope", ",", "thisObj", ",", "ScriptRuntime", ".", "em...
Implement ....() call shrinking optimizer code.
[ "Implement", "....", "()", "call", "shrinking", "optimizer", "code", "." ]
fa8a86df11d37623f5faa8d445a5876612bc47b0
https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/optimizer/OptRuntime.java#L33-L37
train
A version of the call method that is not public.
Create a Java method that does the following: "A version of the call method that is not public.".
Of course, here is the Java code you requested: ```java public static Object call0(Callable fun, Scriptable thisObj, Context cx, Scriptable scope) { return fun.call(cx, scope, thisObj, ScriptRuntime.emptyArgs); } ``` Hope this helps!
googleads/googleads-java-lib
examples/adwords_axis/src/main/java/adwords/axis/v201809/extensions/AddPrices.java
AddPrices.runExample
public static void runExample( AdWordsServicesInterface adWordsServices, AdWordsSession session, Long campaignId) throws ApiException, RemoteException { // Get the CustomerExtensionSettingService. CustomerExtensionSettingServiceInterface customerExtensionSettingService = adWordsServices.get(...
java
public static void runExample( AdWordsServicesInterface adWordsServices, AdWordsSession session, Long campaignId) throws ApiException, RemoteException { // Get the CustomerExtensionSettingService. CustomerExtensionSettingServiceInterface customerExtensionSettingService = adWordsServices.get(...
[ "public", "static", "void", "runExample", "(", "AdWordsServicesInterface", "adWordsServices", ",", "AdWordsSession", "session", ",", "Long", "campaignId", ")", "throws", "ApiException", ",", "RemoteException", "{", "// Get the CustomerExtensionSettingService.", "CustomerExten...
Runs the example. @param adWordsServices the services factory. @param session the session. @param campaignId the ID of the campaign where price feed items will be added. @throws ApiException if the API request failed with one or more service errors. @throws RemoteException if the API request failed due to other errors...
[ "Runs", "the", "example", "." ]
967957cc4f6076514e3a7926fe653e4f1f7cc9c9
https://github.com/googleads/googleads-java-lib/blob/967957cc4f6076514e3a7926fe653e4f1f7cc9c9/examples/adwords_axis/src/main/java/adwords/axis/v201809/extensions/AddPrices.java#L148-L228
train
Runs the example.
Create a Java method that does the following: "Runs the example.".
Of course, here is the Java code you requested: ```java public static void runExample( AdWordsServicesInterface adWordsServices, AdWordsSession session, Long campaignId) throws ApiException, RemoteException { // Get the CustomerExtensionSettingService. CustomerExtensionSettingServiceInterface custo...
steveohara/j2mod
src/main/java/com/ghgande/j2mod/modbus/net/TCPMasterConnection.java
TCPMasterConnection.connect
public void connect(boolean useRtuOverTcp) throws Exception { if (!isConnected()) { logger.debug("connect()"); // Create a socket without auto-connecting socket = new Socket(); socket.setReuseAddress(true); socket.setSoLinger(true, 1); so...
java
public void connect(boolean useRtuOverTcp) throws Exception { if (!isConnected()) { logger.debug("connect()"); // Create a socket without auto-connecting socket = new Socket(); socket.setReuseAddress(true); socket.setSoLinger(true, 1); so...
[ "public", "void", "connect", "(", "boolean", "useRtuOverTcp", ")", "throws", "Exception", "{", "if", "(", "!", "isConnected", "(", ")", ")", "{", "logger", ".", "debug", "(", "\"connect()\"", ")", ";", "// Create a socket without auto-connecting", "socket", "=",...
Opens this <tt>TCPMasterConnection</tt>. @param useRtuOverTcp True if the RTU protocol should be used over TCP @throws Exception if there is a network failure.
[ "Opens", "this", "<tt", ">", "TCPMasterConnection<", "/", "tt", ">", "." ]
67162c55d7c02564e50211a9df06b8314953b5f2
https://github.com/steveohara/j2mod/blob/67162c55d7c02564e50211a9df06b8314953b5f2/src/main/java/com/ghgande/j2mod/modbus/net/TCPMasterConnection.java#L122-L143
train
Connect to the server.
Create a Java method that does the following: "Connect to the server.".
Of course, here is the Java code you requested: ```java public void connect(boolean useRtuOverTcp) throws Exception { if (!isConnected()) { logger.debug("connect()"); // Create a socket without auto-connecting socket = new Socket(); socket.setReuseAddress(true)...
GCRC/nunaliit
nunaliit2-auth-common/src/main/java/ca/carleton/gcrc/auth/common/AuthenticationUtils.java
AuthenticationUtils.userToCookieString
static public String userToCookieString(boolean loggedIn, User user) throws Exception { JSONObject cookieObj = new JSONObject(); cookieObj.put("logged", loggedIn); JSONObject userObj = user.toJSON(); cookieObj.put("user", userObj); StringWriter sw = new StringWriter(); cookieObj.write(sw); String...
java
static public String userToCookieString(boolean loggedIn, User user) throws Exception { JSONObject cookieObj = new JSONObject(); cookieObj.put("logged", loggedIn); JSONObject userObj = user.toJSON(); cookieObj.put("user", userObj); StringWriter sw = new StringWriter(); cookieObj.write(sw); String...
[ "static", "public", "String", "userToCookieString", "(", "boolean", "loggedIn", ",", "User", "user", ")", "throws", "Exception", "{", "JSONObject", "cookieObj", "=", "new", "JSONObject", "(", ")", ";", "cookieObj", ".", "put", "(", "\"logged\"", ",", "loggedIn...
Converts an instance of User to JSON object, fit for a cookie @param user Instance of User to convert @return JSON string containing the user state @throws Exception
[ "Converts", "an", "instance", "of", "User", "to", "JSON", "object", "fit", "for", "a", "cookie" ]
0b4abfc64eef2eb8b94f852ce697de2e851d8e67
https://github.com/GCRC/nunaliit/blob/0b4abfc64eef2eb8b94f852ce697de2e851d8e67/nunaliit2-auth-common/src/main/java/ca/carleton/gcrc/auth/common/AuthenticationUtils.java#L110-L126
train
Convert a logged in user to a cookie string.
Create a Java method that does the following: "Convert a logged in user to a cookie string.".
Of course, here is the Java code you requested: ```java static public String userToCookieString(boolean loggedIn, User user) throws Exception { JSONObject cookieObj = new JSONObject(); cookieObj.put("logged", loggedIn); JSONObject userObj = user.toJSON(); cookieObj.put("user", userObj); StringWriter...
qspin/qtaste
kernel/src/main/java/com/qspin/qtaste/ui/debug/VariableNode.java
VariableNode.getChildren
protected Object[] getChildren() { if (children != null) { return children; } ArrayList<DebugVariable> fields = mVariable.getFieldList(); if (fields != null) { children = new VariableNode[fields.size()]; for (int i = 0; i < fields.size(); i++) { ...
java
protected Object[] getChildren() { if (children != null) { return children; } ArrayList<DebugVariable> fields = mVariable.getFieldList(); if (fields != null) { children = new VariableNode[fields.size()]; for (int i = 0; i < fields.size(); i++) { ...
[ "protected", "Object", "[", "]", "getChildren", "(", ")", "{", "if", "(", "children", "!=", "null", ")", "{", "return", "children", ";", "}", "ArrayList", "<", "DebugVariable", ">", "fields", "=", "mVariable", ".", "getFieldList", "(", ")", ";", "if", ...
Loads the children, caching the results in the children ivar.
[ "Loads", "the", "children", "caching", "the", "results", "in", "the", "children", "ivar", "." ]
ba45d4d86eb29b92f157c6e98536dee2002ddfdc
https://github.com/qspin/qtaste/blob/ba45d4d86eb29b92f157c6e98536dee2002ddfdc/kernel/src/main/java/com/qspin/qtaste/ui/debug/VariableNode.java#L52-L67
train
Gets the children.
Create a Java method that does the following: "Gets the children.".
Of course, here is the Java code you requested: ```java protected Object[] getChildren() { if (children != null) { return children; } ArrayList<DebugVariable> fields = mVariable.getFieldList(); if (fields != null) { children = new VariableNode[fields.size()]; ...
grpc/grpc-java
api/src/main/java/io/grpc/InternalChannelz.java
InternalChannelz.getRootChannels
public RootChannelList getRootChannels(long fromId, int maxPageSize) { List<InternalInstrumented<ChannelStats>> channelList = new ArrayList<>(); Iterator<InternalInstrumented<ChannelStats>> iterator = rootChannels.tailMap(fromId).values().iterator(); while (iterator.hasNext() && channelList...
java
public RootChannelList getRootChannels(long fromId, int maxPageSize) { List<InternalInstrumented<ChannelStats>> channelList = new ArrayList<>(); Iterator<InternalInstrumented<ChannelStats>> iterator = rootChannels.tailMap(fromId).values().iterator(); while (iterator.hasNext() && channelList...
[ "public", "RootChannelList", "getRootChannels", "(", "long", "fromId", ",", "int", "maxPageSize", ")", "{", "List", "<", "InternalInstrumented", "<", "ChannelStats", ">>", "channelList", "=", "new", "ArrayList", "<>", "(", ")", ";", "Iterator", "<", "InternalIns...
Returns a {@link RootChannelList}.
[ "Returns", "a", "{" ]
973885457f9609de232d2553b82c67f6c3ff57bf
https://github.com/grpc/grpc-java/blob/973885457f9609de232d2553b82c67f6c3ff57bf/api/src/main/java/io/grpc/InternalChannelz.java#L145-L155
train
Get the root channels from the given id.
Create a Java method that does the following: "Get the root channels from the given id.".
Of course, here is the Java code you requested: ```java public RootChannelList getRootChannels(long fromId, int maxPageSize) { List<InternalInstrumented<ChannelStats>> channelList = new ArrayList<>(); Iterator<InternalInstrumented<ChannelStats>> iterator = rootChannels.tailMap(fromId).values()....
apache/groovy
src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java
DefaultGroovyMethods.isCase
public static boolean isCase(Map caseValue, Object switchValue) { return DefaultTypeTransformation.castToBoolean(caseValue.get(switchValue)); }
java
public static boolean isCase(Map caseValue, Object switchValue) { return DefaultTypeTransformation.castToBoolean(caseValue.get(switchValue)); }
[ "public", "static", "boolean", "isCase", "(", "Map", "caseValue", ",", "Object", "switchValue", ")", "{", "return", "DefaultTypeTransformation", ".", "castToBoolean", "(", "caseValue", ".", "get", "(", "switchValue", ")", ")", ";", "}" ]
'Case' implementation for maps which tests the groovy truth value obtained using the 'switch' operand as key. For example: <pre class="groovyTestCase">switch( 'foo' ) { case [foo:true, bar:false]: assert true break default: assert false }</pre> @param caseValue the case value @param switchValue the switch value @ret...
[ "Case", "implementation", "for", "maps", "which", "tests", "the", "groovy", "truth", "value", "obtained", "using", "the", "switch", "operand", "as", "key", ".", "For", "example", ":", "<pre", "class", "=", "groovyTestCase", ">", "switch", "(", "foo", ")", ...
71cf20addb611bb8d097a59e395fd20bc7f31772
https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L1181-L1183
train
Checks if the case value is a case.
Create a Java method that does the following: "Checks if the case value is a case.".
Of course, here is the Java code you requested: ```java public static boolean isCase(Map caseValue, Object switchValue) { return DefaultTypeTransformation.castToBoolean(caseValue.get(switchValue)); } ``` Hope this helps!
jcuda/jcuda
JCudaJava/src/main/java/jcuda/nvrtc/JNvrtc.java
JNvrtc.nvrtcGetLoweredName
public static int nvrtcGetLoweredName(nvrtcProgram prog, String name_expression, String lowered_name[]) { return checkResult(nvrtcGetLoweredNameNative(prog, name_expression, lowered_name)); }
java
public static int nvrtcGetLoweredName(nvrtcProgram prog, String name_expression, String lowered_name[]) { return checkResult(nvrtcGetLoweredNameNative(prog, name_expression, lowered_name)); }
[ "public", "static", "int", "nvrtcGetLoweredName", "(", "nvrtcProgram", "prog", ",", "String", "name_expression", ",", "String", "lowered_name", "[", "]", ")", "{", "return", "checkResult", "(", "nvrtcGetLoweredNameNative", "(", "prog", ",", "name_expression", ",", ...
Extracts the lowered (mangled) name for a __global__ function or function template instantiation, and updates *lowered_name to point to it. The memory containing the name is released when the NVRTC program is destroyed by nvrtcDestroyProgram.<br> <br> The identical name expression must have been previously provided to ...
[ "Extracts", "the", "lowered", "(", "mangled", ")", "name", "for", "a", "__global__", "function", "or", "function", "template", "instantiation", "and", "updates", "*", "lowered_name", "to", "point", "to", "it", ".", "The", "memory", "containing", "the", "name",...
468528b5b9b37dfceb6ed83fcfd889e9b359f984
https://github.com/jcuda/jcuda/blob/468528b5b9b37dfceb6ed83fcfd889e9b359f984/JCudaJava/src/main/java/jcuda/nvrtc/JNvrtc.java#L327-L330
train
Get the name of a NVRTC file that is represented by a NVRTC file expression.
Create a Java method that does the following: "Get the name of a NVRTC file that is represented by a NVRTC file expression.".
Of course, here is the Java code you requested: ```java public static int nvrtcGetLoweredName(nvrtcProgram prog, String name_expression, String lowered_name[]) { return checkResult(nvrtcGetLoweredNameNative(prog, name_expression, lowered_name)); } ``` Hope this helps!
auth0/Lock.Android
lib/src/main/java/com/auth0/android/lock/utils/EnterpriseConnectionMatcher.java
EnterpriseConnectionMatcher.extractDomain
@Nullable private String extractDomain(String email) { int indexAt = email.indexOf(AT_SYMBOL) + 1; if (indexAt == 0) { return null; } String domain = email.substring(indexAt); if (domain.isEmpty()) { return null; } return domain; }
java
@Nullable private String extractDomain(String email) { int indexAt = email.indexOf(AT_SYMBOL) + 1; if (indexAt == 0) { return null; } String domain = email.substring(indexAt); if (domain.isEmpty()) { return null; } return domain; }
[ "@", "Nullable", "private", "String", "extractDomain", "(", "String", "email", ")", "{", "int", "indexAt", "=", "email", ".", "indexOf", "(", "AT_SYMBOL", ")", "+", "1", ";", "if", "(", "indexAt", "==", "0", ")", "{", "return", "null", ";", "}", "Str...
Extracts the domain part from the email @param email to parse @return the domain String if found, an empty String otherwise
[ "Extracts", "the", "domain", "part", "from", "the", "email" ]
8eb2a979048d2eb6cf0ec631e82e6c3fe6e7d220
https://github.com/auth0/Lock.Android/blob/8eb2a979048d2eb6cf0ec631e82e6c3fe6e7d220/lib/src/main/java/com/auth0/android/lock/utils/EnterpriseConnectionMatcher.java#L106-L117
train
Extract the domain from the email.
Create a Java method that does the following: "Extract the domain from the email.".
Of course, here is the Java code you requested: ```java @Nullable private String extractDomain(String email) { int indexAt = email.indexOf(AT_SYMBOL) + 1; if (indexAt == 0) { return null; } String domain = email.substring(indexAt); if (domain.isEmpty()) { ...
cdk/cdk
tool/sdg/src/main/java/org/openscience/cdk/layout/StructureDiagramGenerator.java
StructureDiagramGenerator.hasFixedPart
private boolean hasFixedPart(final IAtomContainer mol) { if (afix.isEmpty()) return false; for (IAtom atom : mol.atoms()) if (afix.contains(atom)) return true; return false; }
java
private boolean hasFixedPart(final IAtomContainer mol) { if (afix.isEmpty()) return false; for (IAtom atom : mol.atoms()) if (afix.contains(atom)) return true; return false; }
[ "private", "boolean", "hasFixedPart", "(", "final", "IAtomContainer", "mol", ")", "{", "if", "(", "afix", ".", "isEmpty", "(", ")", ")", "return", "false", ";", "for", "(", "IAtom", "atom", ":", "mol", ".", "atoms", "(", ")", ")", "if", "(", "afix", ...
Determine if any atoms in a connected molecule are fixed (i.e. already have coordinates/ have been placed). @param mol the moleucle to check @return atoms are fixed
[ "Determine", "if", "any", "atoms", "in", "a", "connected", "molecule", "are", "fixed", "(", "i", ".", "e", ".", "already", "have", "coordinates", "/", "have", "been", "placed", ")", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/sdg/src/main/java/org/openscience/cdk/layout/StructureDiagramGenerator.java#L690-L696
train
Checks if the molecule has a fixed part.
Create a Java method that does the following: "Checks if the molecule has a fixed part.".
Of course, here is the Java code you requested: ```java private boolean hasFixedPart(final IAtomContainer mol) { if (afix.isEmpty()) return false; for (IAtom atom : mol.atoms()) if (afix.contains(atom)) return true; return false; } ``` Hope this helps!
OpenNTF/JavascriptAggregator
jaggr-core/src/main/java/com/ibm/jaggr/core/util/BooleanFormula.java
BooleanFormula.add
@Override public boolean add(BooleanTerm booleanTerm) { boolean modified = false; if (booleanTerm.isTrue()) { modified = booleanTerms != null; booleanTerms = null; } else if (booleanTerms != null && !booleanTerm.isFalse()) { for (BooleanTerm term : booleanTerms) { if (booleanTerm.containsAll...
java
@Override public boolean add(BooleanTerm booleanTerm) { boolean modified = false; if (booleanTerm.isTrue()) { modified = booleanTerms != null; booleanTerms = null; } else if (booleanTerms != null && !booleanTerm.isFalse()) { for (BooleanTerm term : booleanTerms) { if (booleanTerm.containsAll...
[ "@", "Override", "public", "boolean", "add", "(", "BooleanTerm", "booleanTerm", ")", "{", "boolean", "modified", "=", "false", ";", "if", "(", "booleanTerm", ".", "isTrue", "(", ")", ")", "{", "modified", "=", "booleanTerms", "!=", "null", ";", "booleanTer...
Adds the term to the formula. Note that if the formula has previously been simplified and determined to evaluate to true, then adding any term will have no effect. <p> A null term represents an expression of true and sets the formula to true (null). @return true if the formula was modified
[ "Adds", "the", "term", "to", "the", "formula", ".", "Note", "that", "if", "the", "formula", "has", "previously", "been", "simplified", "and", "determined", "to", "evaluate", "to", "true", "then", "adding", "any", "term", "will", "have", "no", "effect", "."...
9f47a96d778251638b1df9a368462176216d5b29
https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/util/BooleanFormula.java#L408-L433
train
Adds the specified BooleanTerm to the list of Terms.
Create a Java method that does the following: "Adds the specified BooleanTerm to the list of Terms.".
Of course, here is the Java code you requested: ```java @Override public boolean add(BooleanTerm booleanTerm) { boolean modified = false; if (booleanTerm.isTrue()) { modified = booleanTerms != null; booleanTerms = null; } else if (booleanTerms != null && !booleanTerm.isFalse()) { for (BooleanTer...
weblicht/wlfxb
src/main/java/eu/clarin/weblicht/wlfxb/lx/xb/LexiconStored.java
LexiconStored.connectLayers
protected void connectLayers() { for (int i = 0; i < this.layersInOrder.length; i++) { if (layersInOrder[i] != null) { layersInOrder[i].setLayersConnector(connector); } } }
java
protected void connectLayers() { for (int i = 0; i < this.layersInOrder.length; i++) { if (layersInOrder[i] != null) { layersInOrder[i].setLayersConnector(connector); } } }
[ "protected", "void", "connectLayers", "(", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "this", ".", "layersInOrder", ".", "length", ";", "i", "++", ")", "{", "if", "(", "layersInOrder", "[", "i", "]", "!=", "null", ")", "{", "layer...
}
[ "}" ]
a50f3c31062a3d617ed9018aabcc1180a8ceb464
https://github.com/weblicht/wlfxb/blob/a50f3c31062a3d617ed9018aabcc1180a8ceb464/src/main/java/eu/clarin/weblicht/wlfxb/lx/xb/LexiconStored.java#L207-L213
train
Connect the layers to the connector.
Create a Java method that does the following: "Connect the layers to the connector.".
Of course, here is the Java code you requested: ```java protected void connectLayers() { for (int i = 0; i < this.layersInOrder.length; i++) { if (layersInOrder[i] != null) { layersInOrder[i].setLayersConnector(connector); } } } ``` Hope this helps!
cogroo/cogroo4
cogroo-gc/src/main/java/org/cogroo/tools/checker/rules/applier/SuggestionBuilder.java
SuggestionBuilder.extractTokens
private Token[] extractTokens(List<SyntacticChunk> matched) { List<Token> out = new ArrayList<Token>(); for (SyntacticChunk sc : matched) { out.addAll(sc.getTokens()); } return out.toArray(new Token[out.size()]); }
java
private Token[] extractTokens(List<SyntacticChunk> matched) { List<Token> out = new ArrayList<Token>(); for (SyntacticChunk sc : matched) { out.addAll(sc.getTokens()); } return out.toArray(new Token[out.size()]); }
[ "private", "Token", "[", "]", "extractTokens", "(", "List", "<", "SyntacticChunk", ">", "matched", ")", "{", "List", "<", "Token", ">", "out", "=", "new", "ArrayList", "<", "Token", ">", "(", ")", ";", "for", "(", "SyntacticChunk", "sc", ":", "matched"...
}
[ "}" ]
b6228900c20c6b37eac10a03708a9669dd562f52
https://github.com/cogroo/cogroo4/blob/b6228900c20c6b37eac10a03708a9669dd562f52/cogroo-gc/src/main/java/org/cogroo/tools/checker/rules/applier/SuggestionBuilder.java#L544-L550
train
Extract tokens from a list of syntactic chunks.
Create a Java method that does the following: "Extract tokens from a list of syntactic chunks.".
Of course, here is the Java code you requested: ```java private Token[] extractTokens(List<SyntacticChunk> matched) { List<Token> out = new ArrayList<Token>(); for (SyntacticChunk sc : matched) { out.addAll(sc.getTokens()); } return out.toArray(new Token[out.size()]); } ``` Hope this helps!
OpenBEL/openbel-framework
org.openbel.framework.api/src/main/java/org/openbel/framework/api/KamImpl.java
KamImpl.getAdjacentEdges
@Override public Set<KamEdge> getAdjacentEdges(KamNode kamNode, EdgeFilter filter) { return getAdjacentEdges(kamNode, EdgeDirectionType.BOTH, filter); }
java
@Override public Set<KamEdge> getAdjacentEdges(KamNode kamNode, EdgeFilter filter) { return getAdjacentEdges(kamNode, EdgeDirectionType.BOTH, filter); }
[ "@", "Override", "public", "Set", "<", "KamEdge", ">", "getAdjacentEdges", "(", "KamNode", "kamNode", ",", "EdgeFilter", "filter", ")", "{", "return", "getAdjacentEdges", "(", "kamNode", ",", "EdgeDirectionType", ".", "BOTH", ",", "filter", ")", ";", "}" ]
{@inheritDoc}
[ "{" ]
149f80b1d6eabb15ab15815b6f745b0afa9fd2d3
https://github.com/OpenBEL/openbel-framework/blob/149f80b1d6eabb15ab15815b6f745b0afa9fd2d3/org.openbel.framework.api/src/main/java/org/openbel/framework/api/KamImpl.java#L385-L388
train
Get the set of edges adjacent to the kamNode.
Create a Java method that does the following: "Get the set of edges adjacent to the kamNode.".
Of course, here is the Java code you requested: ```java @Override public Set<KamEdge> getAdjacentEdges(KamNode kamNode, EdgeFilter filter) { return getAdjacentEdges(kamNode, EdgeDirectionType.BOTH, filter); } ``` Hope this helps!
kuali/ojb-1.0.4
src/tools/org/apache/ojb/tools/mapping/reversedb/gui/DBColumnPropertySheet.java
DBColumnPropertySheet.tfJavaFieldNameFocusLost
private void tfJavaFieldNameFocusLost(java.awt.event.FocusEvent evt)//GEN-FIRST:event_tfJavaFieldNameFocusLost {//GEN-HEADEREND:event_tfJavaFieldNameFocusLost // Commit the new value to the column if the focus is lost aColumn.setJavaFieldName(tfJavaFieldName.getText()); }
java
private void tfJavaFieldNameFocusLost(java.awt.event.FocusEvent evt)//GEN-FIRST:event_tfJavaFieldNameFocusLost {//GEN-HEADEREND:event_tfJavaFieldNameFocusLost // Commit the new value to the column if the focus is lost aColumn.setJavaFieldName(tfJavaFieldName.getText()); }
[ "private", "void", "tfJavaFieldNameFocusLost", "(", "java", ".", "awt", ".", "event", ".", "FocusEvent", "evt", ")", "//GEN-FIRST:event_tfJavaFieldNameFocusLost\r", "{", "//GEN-HEADEREND:event_tfJavaFieldNameFocusLost\r", "// Commit the new value to the column if the focus is lost\r"...
GEN-LAST:event_tfJavaFieldNameKeyTyped
[ "GEN", "-", "LAST", ":", "event_tfJavaFieldNameKeyTyped" ]
9a544372f67ce965f662cdc71609dd03683c8f04
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/tools/org/apache/ojb/tools/mapping/reversedb/gui/DBColumnPropertySheet.java#L226-L230
train
The user pressed the field name of the table column that is being used to access a table column.
Create a Java method that does the following: "The user pressed the field name of the table column that is being used to access a table column.".
Of course, here is the Java code you requested: ```java private void tfJavaFieldNameFocusLost(java.awt.event.FocusEvent evt)//GEN-FIRST:event_tfJavaFieldNameFocusLost {//GEN-HEADEREND:event_tfJavaFieldNameFocusLost // Commit the new value to the column if the focus is lost aColumn.setJavaFieldNa...
couchbase/couchbase-lite-java
src/main/java/com/couchbase/lite/LiteCoreException.java
LiteCoreException.throwException
public static void throwException(int domain, int code, String msg) throws LiteCoreException { throw new LiteCoreException(domain, code, msg); }
java
public static void throwException(int domain, int code, String msg) throws LiteCoreException { throw new LiteCoreException(domain, code, msg); }
[ "public", "static", "void", "throwException", "(", "int", "domain", ",", "int", "code", ",", "String", "msg", ")", "throws", "LiteCoreException", "{", "throw", "new", "LiteCoreException", "(", "domain", ",", "code", ",", "msg", ")", ";", "}" ]
NOTE called to throw LiteCoreException from native code to Java
[ "NOTE", "called", "to", "throw", "LiteCoreException", "from", "native", "code", "to", "Java" ]
cb72c44186456e6191a9ad0a7feb310011d0b081
https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/LiteCoreException.java#L25-L27
train
Throw an exception.
Create a Java method that does the following: "Throw an exception.".
Of course, here is the Java code you requested: ```java public static void throwException(int domain, int code, String msg) throws LiteCoreException { throw new LiteCoreException(domain, code, msg); } ``` Hope this helps!
netscaler/sdx_nitro
src/main/java/com/citrix/sdx/nitro/resource/base/Json.java
Json.resource_to_string
public String resource_to_string(base_resource resrc, options option) { String result = "{ "; if (option != null && option.get_action() != null) result = result + "\"params\": {\"action\":\"" + option.get_action() + "\"},"; result = result + "\"" + resrc.get_object_type() + "\":" + this.resource_to_str...
java
public String resource_to_string(base_resource resrc, options option) { String result = "{ "; if (option != null && option.get_action() != null) result = result + "\"params\": {\"action\":\"" + option.get_action() + "\"},"; result = result + "\"" + resrc.get_object_type() + "\":" + this.resource_to_str...
[ "public", "String", "resource_to_string", "(", "base_resource", "resrc", ",", "options", "option", ")", "{", "String", "result", "=", "\"{ \"", ";", "if", "(", "option", "!=", "null", "&&", "option", ".", "get_action", "(", ")", "!=", "null", ")", "result"...
Converts NetScaler SDX resource to Json string. @param resrc API resource. @param option options class object. @return returns a String
[ "Converts", "NetScaler", "SDX", "resource", "to", "Json", "string", "." ]
c840919f1a8f7c0a5634c0f23d34fa14d1765ff1
https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/base/Json.java#L64-L72
train
Converts a base_resource to string for .
Create a Java method that does the following: "Converts a base_resource to string for .".
Of course, here is the Java code you requested: ```java public String resource_to_string(base_resource resrc, options option) { String result = "{ "; if (option != null && option.get_action() != null) result = result + "\"params\": {\"action\":\"" + option.get_action() + "\"},"; result = result + "\""...
ben-manes/caffeine
caffeine/src/main/java/com/github/benmanes/caffeine/base/UnsafeAccess.java
UnsafeAccess.objectFieldOffset
public static long objectFieldOffset(Class<?> clazz, String fieldName) { try { return UNSAFE.objectFieldOffset(clazz.getDeclaredField(fieldName)); } catch (NoSuchFieldException | SecurityException e) { throw new Error(e); } }
java
public static long objectFieldOffset(Class<?> clazz, String fieldName) { try { return UNSAFE.objectFieldOffset(clazz.getDeclaredField(fieldName)); } catch (NoSuchFieldException | SecurityException e) { throw new Error(e); } }
[ "public", "static", "long", "objectFieldOffset", "(", "Class", "<", "?", ">", "clazz", ",", "String", "fieldName", ")", "{", "try", "{", "return", "UNSAFE", ".", "objectFieldOffset", "(", "clazz", ".", "getDeclaredField", "(", "fieldName", ")", ")", ";", "...
Returns the location of a given static field. @param clazz the class containing the field @param fieldName the name of the field @return the address offset of the field
[ "Returns", "the", "location", "of", "a", "given", "static", "field", "." ]
4cf6d6e6a18ea2e8088f166261e5949343b0f2eb
https://github.com/ben-manes/caffeine/blob/4cf6d6e6a18ea2e8088f166261e5949343b0f2eb/caffeine/src/main/java/com/github/benmanes/caffeine/base/UnsafeAccess.java#L55-L61
train
Get the offset of the specified field in the class.
Create a Java method that does the following: "Get the offset of the specified field in the class.".
Of course, here is the Java code you requested: ```java public static long objectFieldOffset(Class<?> clazz, String fieldName) { try { return UNSAFE.objectFieldOffset(clazz.getDeclaredField(fieldName)); } catch (NoSuchFieldException | SecurityException e) { throw new Error(e); } } ``` Hope t...
apache/flink
flink-libraries/flink-streaming-python/src/main/java/org/apache/flink/streaming/python/api/datastream/PythonDataStream.java
PythonDataStream.split
public PythonSplitStream split(OutputSelector<PyObject> output_selector) throws IOException { return new PythonSplitStream(this.stream.split(new PythonOutputSelector(output_selector))); }
java
public PythonSplitStream split(OutputSelector<PyObject> output_selector) throws IOException { return new PythonSplitStream(this.stream.split(new PythonOutputSelector(output_selector))); }
[ "public", "PythonSplitStream", "split", "(", "OutputSelector", "<", "PyObject", ">", "output_selector", ")", "throws", "IOException", "{", "return", "new", "PythonSplitStream", "(", "this", ".", "stream", ".", "split", "(", "new", "PythonOutputSelector", "(", "out...
A thin wrapper layer over {@link DataStream#split(OutputSelector)}. @param output_selector The user defined {@link OutputSelector} for directing the tuples. @return The {@link PythonSplitStream}
[ "A", "thin", "wrapper", "layer", "over", "{", "@link", "DataStream#split", "(", "OutputSelector", ")", "}", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-streaming-python/src/main/java/org/apache/flink/streaming/python/api/datastream/PythonDataStream.java#L91-L93
train
Splits this stream into two using the given output selector.
Create a Java method that does the following: "Splits this stream into two using the given output selector.".
Of course, here is the Java code you requested: ```java public PythonSplitStream split(OutputSelector<PyObject> output_selector) throws IOException { return new PythonSplitStream(this.stream.split(new PythonOutputSelector(output_selector))); } ``` Hope this helps!
killbill/killbill
profiles/killbill/src/main/java/org/killbill/billing/server/log/obfuscators/LuhnMaskingObfuscator.java
LuhnMaskingObfuscator.stripSeparators
@VisibleForTesting String stripSeparators(final String cardNumber) { final int length = cardNumber.length(); final char[] result = new char[length]; int count = 0; char cur; for (int i = 0; i < length; i++) { cur = cardNumber.charAt(i); if (!(cur == ' ...
java
@VisibleForTesting String stripSeparators(final String cardNumber) { final int length = cardNumber.length(); final char[] result = new char[length]; int count = 0; char cur; for (int i = 0; i < length; i++) { cur = cardNumber.charAt(i); if (!(cur == ' ...
[ "@", "VisibleForTesting", "String", "stripSeparators", "(", "final", "String", "cardNumber", ")", "{", "final", "int", "length", "=", "cardNumber", ".", "length", "(", ")", ";", "final", "char", "[", "]", "result", "=", "new", "char", "[", "length", "]", ...
Remove any ` ` and `-` characters from the given string. @param cardNumber the number to clean up @return if the given string contains no ` ` or `-` characters, the string itself is returned, otherwise a new string containing no ` ` or `-` characters is returned
[ "Remove", "any", "and", "-", "characters", "from", "the", "given", "string", "." ]
6457b485fb32a182c76197a83f428123331f1380
https://github.com/killbill/killbill/blob/6457b485fb32a182c76197a83f428123331f1380/profiles/killbill/src/main/java/org/killbill/billing/server/log/obfuscators/LuhnMaskingObfuscator.java#L181-L197
train
Strip separators from a string.
Create a Java method that does the following: "Strip separators from a string.".
Of course, here is the Java code you requested: ```java @VisibleForTesting String stripSeparators(final String cardNumber) { final int length = cardNumber.length(); final char[] result = new char[length]; int count = 0; char cur; for (int i = 0; i < length; i++) { ...
looly/hutool
hutool-poi/src/main/java/cn/hutool/poi/excel/ExcelUtil.java
ExcelUtil.getWriter
public static ExcelWriter getWriter() { try { return new ExcelWriter(); } catch (NoClassDefFoundError e) { throw new DependencyException(ObjectUtil.defaultIfNull(e.getCause(), e), PoiChecker.NO_POI_ERROR_MSG); } }
java
public static ExcelWriter getWriter() { try { return new ExcelWriter(); } catch (NoClassDefFoundError e) { throw new DependencyException(ObjectUtil.defaultIfNull(e.getCause(), e), PoiChecker.NO_POI_ERROR_MSG); } }
[ "public", "static", "ExcelWriter", "getWriter", "(", ")", "{", "try", "{", "return", "new", "ExcelWriter", "(", ")", ";", "}", "catch", "(", "NoClassDefFoundError", "e", ")", "{", "throw", "new", "DependencyException", "(", "ObjectUtil", ".", "defaultIfNull", ...
获得{@link ExcelWriter},默认写出到第一个sheet<br> 不传入写出的Excel文件路径,只能调用{@link ExcelWriter#flush(OutputStream)}方法写出到流<br> 若写出到文件,还需调用{@link ExcelWriter#setDestFile(File)}方法自定义写出的文件,然后调用{@link ExcelWriter#flush()}方法写出到文件 @return {@link ExcelWriter} @since 3.2.1
[ "获得", "{", "@link", "ExcelWriter", "}", ",默认写出到第一个sheet<br", ">", "不传入写出的Excel文件路径,只能调用", "{", "@link", "ExcelWriter#flush", "(", "OutputStream", ")", "}", "方法写出到流<br", ">", "若写出到文件,还需调用", "{", "@link", "ExcelWriter#setDestFile", "(", "File", ")", "}", "方法自定义写出的文件,然...
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-poi/src/main/java/cn/hutool/poi/excel/ExcelUtil.java#L355-L361
train
Returns a writer for the Excel file.
Create a Java method that does the following: "Returns a writer for the Excel file.".
Of course, here is the Java code you requested: ```java public static ExcelWriter getWriter() { try { return new ExcelWriter(); } catch (NoClassDefFoundError e) { throw new DependencyException(ObjectUtil.defaultIfNull(e.getCause(), e), PoiChecker.NO_POI_ERROR_MSG); } } ``` Hope this helps!
google/closure-templates
java/src/com/google/template/soy/jbcsrc/restricted/BytecodeUtils.java
BytecodeUtils.doIsAssignableFrom
private static boolean doIsAssignableFrom(Type left, Type right, boolean failOpen) { if (left.equals(right)) { return true; } if (left.getSort() != right.getSort()) { return false; } if (left.getSort() != Type.OBJECT) { return false; // all other sorts require exact equality (even ...
java
private static boolean doIsAssignableFrom(Type left, Type right, boolean failOpen) { if (left.equals(right)) { return true; } if (left.getSort() != right.getSort()) { return false; } if (left.getSort() != Type.OBJECT) { return false; // all other sorts require exact equality (even ...
[ "private", "static", "boolean", "doIsAssignableFrom", "(", "Type", "left", ",", "Type", "right", ",", "boolean", "failOpen", ")", "{", "if", "(", "left", ".", "equals", "(", "right", ")", ")", "{", "return", "true", ";", "}", "if", "(", "left", ".", ...
Checks if {@code left} is assignable from {@code right}, however if we don't have information about one of the types then this returns {@code failOpen}.
[ "Checks", "if", "{" ]
cc61e1dff70ae97f24f417a57410081bc498bd56
https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/jbcsrc/restricted/BytecodeUtils.java#L192-L212
train
Checks if left is assignable from right.
Create a Java method that does the following: "Checks if left is assignable from right.".
Of course, here is the Java code you requested: ```java private static boolean doIsAssignableFrom(Type left, Type right, boolean failOpen) { if (left.equals(right)) { return true; } if (left.getSort() != right.getSort()) { return false; } if (left.getSort() != Type.OBJECT) { retur...
alkacon/opencms-core
src-gwt/org/opencms/ade/containerpage/client/CmsContainerpageController.java
CmsContainerpageController.matchesCurrentEditLevel
private boolean matchesCurrentEditLevel(I_CmsDropContainer container) { boolean result = !(container instanceof CmsContainerPageContainer) || (m_currentEditLevel == -1) || (m_currentEditLevel == ((CmsContainerPageContainer)container).getContainerLevel()); return result; }
java
private boolean matchesCurrentEditLevel(I_CmsDropContainer container) { boolean result = !(container instanceof CmsContainerPageContainer) || (m_currentEditLevel == -1) || (m_currentEditLevel == ((CmsContainerPageContainer)container).getContainerLevel()); return result; }
[ "private", "boolean", "matchesCurrentEditLevel", "(", "I_CmsDropContainer", "container", ")", "{", "boolean", "result", "=", "!", "(", "container", "instanceof", "CmsContainerPageContainer", ")", "||", "(", "m_currentEditLevel", "==", "-", "1", ")", "||", "(", "m_...
Checks whether the given container matches the current edit level.<p> @param container the container to check @return <code>true</code> if the given container matches the current edit level
[ "Checks", "whether", "the", "given", "container", "matches", "the", "current", "edit", "level", ".", "<p", ">" ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/containerpage/client/CmsContainerpageController.java#L4001-L4007
train
Checks if the container is a container page container and the current edit level matches the container level.
Create a Java method that does the following: "Checks if the container is a container page container and the current edit level matches the container level.".
Of course, here is the Java code you requested: ```java private boolean matchesCurrentEditLevel(I_CmsDropContainer container) { boolean result = !(container instanceof CmsContainerPageContainer) || (m_currentEditLevel == -1) || (m_currentEditLevel == ((CmsContainerPageContainer)contain...
BlueBrain/bluima
modules/bluima_jsre/src/main/java/org/itc/irst/tcc/sre/util/FeatureIndex.java
FeatureIndex.getIndex
public int getIndex(String feature) { //logger.debug("FeatureIndex.get : " + feature + "(" + count + ")"); Integer index = (Integer) map.get(feature); if (index == null) return -1; return index.intValue(); }
java
public int getIndex(String feature) { //logger.debug("FeatureIndex.get : " + feature + "(" + count + ")"); Integer index = (Integer) map.get(feature); if (index == null) return -1; return index.intValue(); }
[ "public", "int", "getIndex", "(", "String", "feature", ")", "{", "//logger.debug(\"FeatureIndex.get : \" + feature + \"(\" + count + \")\");", "Integer", "index", "=", "(", "Integer", ")", "map", ".", "get", "(", "feature", ")", ";", "if", "(", "index", "==", "nul...
Returns the <i>index</i> of the specified feature and adds the feature to the index if it is not present yet. @param feature the feature. @return the <i>index</i> of the specified feature.
[ "Returns", "the", "<i", ">", "index<", "/", "i", ">", "of", "the", "specified", "feature", "and", "adds", "the", "feature", "to", "the", "index", "if", "it", "is", "not", "present", "yet", "." ]
793ea3f46761dce72094e057a56cddfa677156ae
https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_jsre/src/main/java/org/itc/irst/tcc/sre/util/FeatureIndex.java#L121-L130
train
Get the feature index.
Create a Java method that does the following: "Get the feature index.".
Of course, here is the Java code you requested: ```java public int getIndex(String feature) { //logger.debug("FeatureIndex.get : " + feature + "(" + count + ")"); Integer index = (Integer) map.get(feature); if (index == null) return -1; return index.intValue(); } ``` Hope this helps!
j-a-w-r/jawr-main-repo
jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/factory/postprocessor/JSPostProcessorChainFactory.java
JSPostProcessorChainFactory.buildProcessorByKey
@Override protected AbstractChainedResourceBundlePostProcessor buildProcessorByKey(String procesorKey) { if (PostProcessFactoryConstant.JSMIN.equals(procesorKey)) return buildJSMinPostProcessor(); else if (PostProcessFactoryConstant.LICENSE_INCLUDER.equals(procesorKey)) return buildLicensesProcessor(); els...
java
@Override protected AbstractChainedResourceBundlePostProcessor buildProcessorByKey(String procesorKey) { if (PostProcessFactoryConstant.JSMIN.equals(procesorKey)) return buildJSMinPostProcessor(); else if (PostProcessFactoryConstant.LICENSE_INCLUDER.equals(procesorKey)) return buildLicensesProcessor(); els...
[ "@", "Override", "protected", "AbstractChainedResourceBundlePostProcessor", "buildProcessorByKey", "(", "String", "procesorKey", ")", "{", "if", "(", "PostProcessFactoryConstant", ".", "JSMIN", ".", "equals", "(", "procesorKey", ")", ")", "return", "buildJSMinPostProcesso...
/* (non-Javadoc) @see net.jawr.web.resource.bundle.factory.processor.PostProcessorChainFactory# getPostProcessor(java.lang.String)
[ "/", "*", "(", "non", "-", "Javadoc", ")" ]
5381f6acf461cd2502593c67a77bd6ef9eab848d
https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/factory/postprocessor/JSPostProcessorChainFactory.java#L84-L99
train
Build a ResourceBundlePostProcessor by the supplied key.
Create a Java method that does the following: "Build a ResourceBundlePostProcessor by the supplied key.".
Of course, here is the Java code you requested: ```java @Override protected AbstractChainedResourceBundlePostProcessor buildProcessorByKey(String procesorKey) { if (PostProcessFactoryConstant.JSMIN.equals(procesorKey)) return buildJSMinPostProcessor(); else if (PostProcessFactoryConstant.LICENSE_INCLUDER.equal...