repo stringclasses 199
values | path stringlengths 28 169 | func_name stringlengths 6 98 | original_string stringlengths 91 27.2k | language stringclasses 1
value | code stringlengths 91 27.2k | code_tokens listlengths 21 5.01k | docstring stringlengths 1 6.47k | docstring_tokens listlengths 1 587 | sha stringclasses 199
values | url stringlengths 117 257 | partition stringclasses 1
value | summary stringlengths 3 207 | output stringlengths 170 27.3k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
abmargb/jamppa | src/main/java/org/jivesoftware/smack/util/collections/AbstractReferenceMap.java | AbstractReferenceMap.put | public V put(K key, V value) {
if (key == null) {
throw new NullPointerException("null keys not allowed");
}
if (value == null) {
throw new NullPointerException("null values not allowed");
}
purgeBeforeWrite();
return super.put(key, value);
} | java | public V put(K key, V value) {
if (key == null) {
throw new NullPointerException("null keys not allowed");
}
if (value == null) {
throw new NullPointerException("null values not allowed");
}
purgeBeforeWrite();
return super.put(key, value);
} | [
"public",
"V",
"put",
"(",
"K",
"key",
",",
"V",
"value",
")",
"{",
"if",
"(",
"key",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"null keys not allowed\"",
")",
";",
"}",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"throw"... | Puts a key-value mapping into this map. Neither the key nor the value may
be null.
@param key
the key to add, must not be null
@param value
the value to add, must not be null
@return the value previously mapped to this key, null if none
@throws NullPointerException
if either the key or value is null | [
"Puts",
"a",
"key",
"-",
"value",
"mapping",
"into",
"this",
"map",
".",
"Neither",
"the",
"key",
"nor",
"the",
"value",
"may",
"be",
"null",
"."
] | 76f253239923df40904c462e3b88e7278b36b282 | https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jivesoftware/smack/util/collections/AbstractReferenceMap.java#L263-L273 | test | Override put to remove the value from the cache. | Of course, here is the Java code you requested:
```java
public V put(K key, V value) {
if (key == null) {
throw new NullPointerException("null keys not allowed");
}
if (value == null) {
throw new NullPointerException("null values not allowed");
}
purgeBe... |
spring-projects/spring-security | web/src/main/java/org/springframework/security/web/reactive/result/method/annotation/CurrentSecurityContextArgumentResolver.java | CurrentSecurityContextArgumentResolver.resolveArgument | @Override
public Mono<Object> resolveArgument(MethodParameter parameter, BindingContext bindingContext,
ServerWebExchange exchange) {
ReactiveAdapter adapter = getAdapterRegistry().getAdapter(parameter.getParameterType());
Mono<SecurityContext> reactiveSecurityContext = ReactiveSecurityContextHolder.getContext(... | java | @Override
public Mono<Object> resolveArgument(MethodParameter parameter, BindingContext bindingContext,
ServerWebExchange exchange) {
ReactiveAdapter adapter = getAdapterRegistry().getAdapter(parameter.getParameterType());
Mono<SecurityContext> reactiveSecurityContext = ReactiveSecurityContextHolder.getContext(... | [
"@",
"Override",
"public",
"Mono",
"<",
"Object",
">",
"resolveArgument",
"(",
"MethodParameter",
"parameter",
",",
"BindingContext",
"bindingContext",
",",
"ServerWebExchange",
"exchange",
")",
"{",
"ReactiveAdapter",
"adapter",
"=",
"getAdapterRegistry",
"(",
")",
... | resolve the argument to inject into the controller parameter.
@param parameter the method parameter.
@param bindingContext the binding context.
@param exchange the server web exchange.
@return the reactive mono object result. | [
"resolve",
"the",
"argument",
"to",
"inject",
"into",
"the",
"controller",
"parameter",
"."
] | 98a8467e4c2ae05b3e09c67ece856944fa48ed23 | https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/web/src/main/java/org/springframework/security/web/reactive/result/method/annotation/CurrentSecurityContextArgumentResolver.java#L86-L100 | test | Override to override the default implementation of the method. | Of course, here is the Java code you requested:
```java
@Override
public Mono<Object> resolveArgument(MethodParameter parameter, BindingContext bindingContext,
ServerWebExchange exchange) {
ReactiveAdapter adapter = getAdapterRegistry().getAdapter(parameter.getParameterType());
Mono<SecurityContext> reactiveSe... |
sikuli/sikuli-slides | apps/src/main/java/com/sampullara/cli/PropertiesArgs.java | PropertiesArgs.parse | public static void parse(Object target, Properties arguments) {
Class clazz;
if (target instanceof Class) {
clazz = (Class) target;
} else {
clazz = target.getClass();
}
for (Field field : clazz.getDeclaredFields()) {
processField(target, field... | java | public static void parse(Object target, Properties arguments) {
Class clazz;
if (target instanceof Class) {
clazz = (Class) target;
} else {
clazz = target.getClass();
}
for (Field field : clazz.getDeclaredFields()) {
processField(target, field... | [
"public",
"static",
"void",
"parse",
"(",
"Object",
"target",
",",
"Properties",
"arguments",
")",
"{",
"Class",
"clazz",
";",
"if",
"(",
"target",
"instanceof",
"Class",
")",
"{",
"clazz",
"=",
"(",
"Class",
")",
"target",
";",
"}",
"else",
"{",
"claz... | Parse properties instead of String arguments. Any additional arguments need to be passed some other way.
This is often used in a second pass when the property filename is passed on the command line. Because of
required properties you must be careful to set them all in the property file.
@param target Either an in... | [
"Parse",
"properties",
"instead",
"of",
"String",
"arguments",
".",
"Any",
"additional",
"arguments",
"need",
"to",
"be",
"passed",
"some",
"other",
"way",
".",
"This",
"is",
"often",
"used",
"in",
"a",
"second",
"pass",
"when",
"the",
"property",
"filename"... | 1a4a82cd97f577e0d7abe4218bf702e053acf003 | https://github.com/sikuli/sikuli-slides/blob/1a4a82cd97f577e0d7abe4218bf702e053acf003/apps/src/main/java/com/sampullara/cli/PropertiesArgs.java#L27-L45 | test | Parse the target object and the properties. | Of course, here is the Java code you requested:
```java
public static void parse(Object target, Properties arguments) {
Class clazz;
if (target instanceof Class) {
clazz = (Class) target;
} else {
clazz = target.getClass();
}
for (Field field : clazz.getD... |
spring-projects/spring-security | core/src/main/java/org/springframework/security/access/method/MapBasedMethodSecurityMetadataSource.java | MapBasedMethodSecurityMetadataSource.findAttributes | @Override
protected Collection<ConfigAttribute> findAttributes(Method method,
Class<?> targetClass) {
if (targetClass == null) {
return null;
}
return findAttributesSpecifiedAgainst(method, targetClass);
} | java | @Override
protected Collection<ConfigAttribute> findAttributes(Method method,
Class<?> targetClass) {
if (targetClass == null) {
return null;
}
return findAttributesSpecifiedAgainst(method, targetClass);
} | [
"@",
"Override",
"protected",
"Collection",
"<",
"ConfigAttribute",
">",
"findAttributes",
"(",
"Method",
"method",
",",
"Class",
"<",
"?",
">",
"targetClass",
")",
"{",
"if",
"(",
"targetClass",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return"... | Will walk the method inheritance tree to find the most specific declaration
applicable. | [
"Will",
"walk",
"the",
"method",
"inheritance",
"tree",
"to",
"find",
"the",
"most",
"specific",
"declaration",
"applicable",
"."
] | 98a8467e4c2ae05b3e09c67ece856944fa48ed23 | https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/core/src/main/java/org/springframework/security/access/method/MapBasedMethodSecurityMetadataSource.java#L87-L95 | test | Find attributes specified for a method. | Of course, here is the Java code you requested:
```java
@Override
protected Collection<ConfigAttribute> findAttributes(Method method,
Class<?> targetClass) {
if (targetClass == null) {
return null;
}
return findAttributesSpecifiedAgainst(method, targetClass);
}
```
Hope this helps! |
rupertlssmith/lojix | lojix/power_model/src/main/com/thesett/aima/attribute/time/TimeUtils.java | TimeUtils.ticksWithMinutesSetTo | public static long ticksWithMinutesSetTo(long ticks, int minutes)
{
long oldMinutes = ticksToMinutes(ticks);
return ticks - (oldMinutes * MILLIS_PER_MINUTE) + (minutes * MILLIS_PER_MINUTE);
} | java | public static long ticksWithMinutesSetTo(long ticks, int minutes)
{
long oldMinutes = ticksToMinutes(ticks);
return ticks - (oldMinutes * MILLIS_PER_MINUTE) + (minutes * MILLIS_PER_MINUTE);
} | [
"public",
"static",
"long",
"ticksWithMinutesSetTo",
"(",
"long",
"ticks",
",",
"int",
"minutes",
")",
"{",
"long",
"oldMinutes",
"=",
"ticksToMinutes",
"(",
"ticks",
")",
";",
"return",
"ticks",
"-",
"(",
"oldMinutes",
"*",
"MILLIS_PER_MINUTE",
")",
"+",
"(... | Sets the minutes component of the timestamp, returning the new timestamp with updated component.
@param ticks The time in ticks.
@param minutes The new minutes field.
@return The new time in ticks. | [
"Sets",
"the",
"minutes",
"component",
"of",
"the",
"timestamp",
"returning",
"the",
"new",
"timestamp",
"with",
"updated",
"component",
"."
] | ad494dc8bce2345567de7689d42291d4b30fbd51 | https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/power_model/src/main/com/thesett/aima/attribute/time/TimeUtils.java#L361-L366 | test | Returns the ticks with the given number of minutes set to the given number of milliseconds. | Of course, here is the Java code you requested:
```java
public static long ticksWithMinutesSetTo(long ticks, int minutes)
{
long oldMinutes = ticksToMinutes(ticks);
return ticks - (oldMinutes * MILLIS_PER_MINUTE) + (minutes * MILLIS_PER_MINUTE);
}
```
Hope this helps! |
arnohaase/a-foundation | a-foundation/src/main/java/com/ajjpj/afoundation/concurrent/ExecutorServiceWrapper.java | ExecutorServiceWrapper.shutdown | @Override public void shutdown () {
if (poolWithAdmin == null) throw new UnsupportedOperationException ("shutdown only supported for AThreadPoolWithAdmin");
shutdown.set (AFuture.lift (AThreadPool.SYNC_THREADPOOL, poolWithAdmin.shutdown (AThreadPoolWithAdmin.ShutdownMode.ExecuteSubmitted)));
} | java | @Override public void shutdown () {
if (poolWithAdmin == null) throw new UnsupportedOperationException ("shutdown only supported for AThreadPoolWithAdmin");
shutdown.set (AFuture.lift (AThreadPool.SYNC_THREADPOOL, poolWithAdmin.shutdown (AThreadPoolWithAdmin.ShutdownMode.ExecuteSubmitted)));
} | [
"@",
"Override",
"public",
"void",
"shutdown",
"(",
")",
"{",
"if",
"(",
"poolWithAdmin",
"==",
"null",
")",
"throw",
"new",
"UnsupportedOperationException",
"(",
"\"shutdown only supported for AThreadPoolWithAdmin\"",
")",
";",
"shutdown",
".",
"set",
"(",
"AFuture... | ------------------- shutdown handling below this point --------------------- | [
"-------------------",
"shutdown",
"handling",
"below",
"this",
"point",
"---------------------"
] | f3eef2ca89d67775f202a4c28140230a6229291e | https://github.com/arnohaase/a-foundation/blob/f3eef2ca89d67775f202a4c28140230a6229291e/a-foundation/src/main/java/com/ajjpj/afoundation/concurrent/ExecutorServiceWrapper.java#L32-L35 | test | Shuts down the thread pool. | Of course, here is the Java code you requested:
```java
@Override public void shutdown () {
if (poolWithAdmin == null) throw new UnsupportedOperationException ("shutdown only supported for AThreadPoolWithAdmin");
shutdown.set (AFuture.lift (AThreadPool.SYNC_THREADPOOL, poolWithAdmin.shutdown (AThreadPo... |
rupertlssmith/lojix | lojix/wam_prolog/src/main/com/thesett/aima/logic/fol/wam/optimizer/OptimizeInstructions.java | OptimizeInstructions.isConstant | public boolean isConstant(WAMInstruction instruction)
{
Integer name = instruction.getFunctorNameReg1();
if (name != null)
{
FunctorName functorName = interner.getDeinternedFunctorName(name);
if (functorName.getArity() == 0)
{
return true... | java | public boolean isConstant(WAMInstruction instruction)
{
Integer name = instruction.getFunctorNameReg1();
if (name != null)
{
FunctorName functorName = interner.getDeinternedFunctorName(name);
if (functorName.getArity() == 0)
{
return true... | [
"public",
"boolean",
"isConstant",
"(",
"WAMInstruction",
"instruction",
")",
"{",
"Integer",
"name",
"=",
"instruction",
".",
"getFunctorNameReg1",
"(",
")",
";",
"if",
"(",
"name",
"!=",
"null",
")",
"{",
"FunctorName",
"functorName",
"=",
"interner",
".",
... | Checks if the term argument to an instruction was a constant.
@param instruction The instruction to test.
@return <tt>true</tt> iff the term argument to an instruction was a constant. <tt>false</tt> will be returned if
this information was not recorded, and cannot be determined. | [
"Checks",
"if",
"the",
"term",
"argument",
"to",
"an",
"instruction",
"was",
"a",
"constant",
"."
] | ad494dc8bce2345567de7689d42291d4b30fbd51 | https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/wam_prolog/src/main/com/thesett/aima/logic/fol/wam/optimizer/OptimizeInstructions.java#L261-L276 | test | Is a CRA - SECTYPE instruction a constant? | Of course, here is the Java code you requested:
```java
public boolean isConstant(WAMInstruction instruction)
{
Integer name = instruction.getFunctorNameReg1();
if (name != null)
{
FunctorName functorName = interner.getDeinternedFunctorName(name);
if (functorName.g... |
Unidata/thredds | opendap/src/main/java/opendap/servers/parsers/AST.java | ASTprojection.walk | void walk(CEEvaluator ceEval)
throws DAP2ServerSideException, DAP2Exception,
NoSuchFunctionException, NoSuchVariableException
{
if(fcn != null) {
SubClause subclause = fcn.translate();
getCeEval().appendClause(subclause);
} else {
Stack components ... | java | void walk(CEEvaluator ceEval)
throws DAP2ServerSideException, DAP2Exception,
NoSuchFunctionException, NoSuchVariableException
{
if(fcn != null) {
SubClause subclause = fcn.translate();
getCeEval().appendClause(subclause);
} else {
Stack components ... | [
"void",
"walk",
"(",
"CEEvaluator",
"ceEval",
")",
"throws",
"DAP2ServerSideException",
",",
"DAP2Exception",
",",
"NoSuchFunctionException",
",",
"NoSuchVariableException",
"{",
"if",
"(",
"fcn",
"!=",
"null",
")",
"{",
"SubClause",
"subclause",
"=",
"fcn",
".",
... | /*
public String toString()
{
if(var != null)
return var.toString();
else
return fcn.toString();
} | [
"/",
"*",
"public",
"String",
"toString",
"()",
"{",
"if",
"(",
"var",
"!",
"=",
"null",
")",
"return",
"var",
".",
"toString",
"()",
";",
"else",
"return",
"fcn",
".",
"toString",
"()",
";",
"}"
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/opendap/src/main/java/opendap/servers/parsers/AST.java#L164-L176 | test | Walk the CEEvaluator to find the correct CCN and append it to the CCN. | Of course, here is the Java code you requested:
```java
void walk(CEEvaluator ceEval)
throws DAP2ServerSideException, DAP2Exception,
NoSuchFunctionException, NoSuchVariableException
{
if(fcn != null) {
SubClause subclause = fcn.translate();
getCeEval().appendClause(s... |
eclipse/packagedrone | bundles/org.eclipse.packagedrone.repo.trigger/src/org/eclipse/packagedrone/repo/trigger/ProcessorFactoryTracker.java | ProcessorFactoryTracker.getFactoriesFor | public List<ProcessorFactoryInformation> getFactoriesFor ( final Class<?>[] contextClasses )
{
requireNonNull ( contextClasses );
final List<ProcessorFactoryInformation> result = new ArrayList<> ();
this.tracker.consumeAll ( stream -> stream.filter ( service -> isMatch ( service, contextCla... | java | public List<ProcessorFactoryInformation> getFactoriesFor ( final Class<?>[] contextClasses )
{
requireNonNull ( contextClasses );
final List<ProcessorFactoryInformation> result = new ArrayList<> ();
this.tracker.consumeAll ( stream -> stream.filter ( service -> isMatch ( service, contextCla... | [
"public",
"List",
"<",
"ProcessorFactoryInformation",
">",
"getFactoriesFor",
"(",
"final",
"Class",
"<",
"?",
">",
"[",
"]",
"contextClasses",
")",
"{",
"requireNonNull",
"(",
"contextClasses",
")",
";",
"final",
"List",
"<",
"ProcessorFactoryInformation",
">",
... | Get a list of matching factories
<p>
The returned list is a copy of the current state. The list may be
modified by the caller, but will not be updated by this tracker when the
state changes.
</p>
@param contextClasses
the provided context classes
@return a list of matching processor factors, never returns {@code null} | [
"Get",
"a",
"list",
"of",
"matching",
"factories",
"<p",
">",
"The",
"returned",
"list",
"is",
"a",
"copy",
"of",
"the",
"current",
"state",
".",
"The",
"list",
"may",
"be",
"modified",
"by",
"the",
"caller",
"but",
"will",
"not",
"be",
"updated",
"by"... | 3869c1643cdc6f7cb8b26097a7b6994683b13d7e | https://github.com/eclipse/packagedrone/blob/3869c1643cdc6f7cb8b26097a7b6994683b13d7e/bundles/org.eclipse.packagedrone.repo.trigger/src/org/eclipse/packagedrone/repo/trigger/ProcessorFactoryTracker.java#L82-L89 | test | Gets the factories for the given context classes. | Of course, here is the Java code you requested:
```java
public List<ProcessorFactoryInformation> getFactoriesFor ( final Class<?>[] contextClasses )
{
requireNonNull ( contextClasses );
final List<ProcessorFactoryInformation> result = new ArrayList<> ();
this.tracker.consumeAll ( stream ->... |
Unidata/thredds | cdm/src/main/java/ucar/unidata/geoloc/projection/ProjectionAdapter.java | ProjectionAdapter.projToLatLon | public LatLonPoint projToLatLon(ProjectionPoint world,
LatLonPointImpl result) {
return proj.projToLatLon(world, result);
} | java | public LatLonPoint projToLatLon(ProjectionPoint world,
LatLonPointImpl result) {
return proj.projToLatLon(world, result);
} | [
"public",
"LatLonPoint",
"projToLatLon",
"(",
"ProjectionPoint",
"world",
",",
"LatLonPointImpl",
"result",
")",
"{",
"return",
"proj",
".",
"projToLatLon",
"(",
"world",
",",
"result",
")",
";",
"}"
] | Convert projection coordinates to a LatLonPoint
Note: a new object is not created on each call for the return value.
@param world convert from these projection coordinates
@param result the object to write to
@return LatLonPoint convert to these lat/lon coordinates | [
"Convert",
"projection",
"coordinates",
"to",
"a",
"LatLonPoint",
"Note",
":",
"a",
"new",
"object",
"is",
"not",
"created",
"on",
"each",
"call",
"for",
"the",
"return",
"value",
"."
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/unidata/geoloc/projection/ProjectionAdapter.java#L109-L112 | test | Convert a projection point to a LatLonPoint | Of course, here is the Java code you requested:
```java
public LatLonPoint projToLatLon(ProjectionPoint world,
LatLonPointImpl result) {
return proj.projToLatLon(world, result);
}
```
Hope this helps! |
nyla-solutions/gedi-geode | gedi-geode-extensions-core/src/main/java/gedi/solutions/geode/util/GemFireMgmt.java | GemFireMgmt.toDistributeSystem | private static DistributedSystemMXBean toDistributeSystem(JMX jmx) throws MalformedObjectNameException
{
ObjectName objectName = new ObjectName("GemFire:service=System,type=Distributed");
//DistributedSystemMXBean distributedSystemMXBean =
DistributedSystemMXBean bean = jmx.newBean(DistributedSystemMXBean.c... | java | private static DistributedSystemMXBean toDistributeSystem(JMX jmx) throws MalformedObjectNameException
{
ObjectName objectName = new ObjectName("GemFire:service=System,type=Distributed");
//DistributedSystemMXBean distributedSystemMXBean =
DistributedSystemMXBean bean = jmx.newBean(DistributedSystemMXBean.c... | [
"private",
"static",
"DistributedSystemMXBean",
"toDistributeSystem",
"(",
"JMX",
"jmx",
")",
"throws",
"MalformedObjectNameException",
"{",
"ObjectName",
"objectName",
"=",
"new",
"ObjectName",
"(",
"\"GemFire:service=System,type=Distributed\"",
")",
";",
"//DistributedSyste... | -------------------------------------------------------- | [
"--------------------------------------------------------"
] | 3dd71d6e66e941ce350b306b70677ee95a7d9eee | https://github.com/nyla-solutions/gedi-geode/blob/3dd71d6e66e941ce350b306b70677ee95a7d9eee/gedi-geode-extensions-core/src/main/java/gedi/solutions/geode/util/GemFireMgmt.java#L187-L194 | test | Converts the managed object to a distributed system bean. | Of course, here is the Java code you requested:
```java
private static DistributedSystemMXBean toDistributeSystem(JMX jmx) throws MalformedObjectNameException
{
ObjectName objectName = new ObjectName("GemFire:service=System,type=Distributed");
//DistributedSystemMXBean distributedSystemMXBean =
Distributed... |
Unidata/thredds | tds/src/main/java/thredds/server/radarServer2/RadarServerConfig.java | RadarServerConfig.getProvider | private static FileSystemProvider getProvider(URI uri) throws IOException {
if(fsproviders.containsKey(uri.getScheme())) {
return fsproviders.get(uri.getScheme());
} else {
FileSystem fs;
try {
fs = FileSystems.newFileSystem(uri,
... | java | private static FileSystemProvider getProvider(URI uri) throws IOException {
if(fsproviders.containsKey(uri.getScheme())) {
return fsproviders.get(uri.getScheme());
} else {
FileSystem fs;
try {
fs = FileSystems.newFileSystem(uri,
... | [
"private",
"static",
"FileSystemProvider",
"getProvider",
"(",
"URI",
"uri",
")",
"throws",
"IOException",
"{",
"if",
"(",
"fsproviders",
".",
"containsKey",
"(",
"uri",
".",
"getScheme",
"(",
")",
")",
")",
"{",
"return",
"fsproviders",
".",
"get",
"(",
"... | filesystem can't be re-created either. | [
"filesystem",
"can",
"t",
"be",
"re",
"-",
"created",
"either",
"."
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/tds/src/main/java/thredds/server/radarServer2/RadarServerConfig.java#L129-L144 | test | Get the FileSystemProvider for the URI. | Of course, here is the Java code you requested:
```java
private static FileSystemProvider getProvider(URI uri) throws IOException {
if(fsproviders.containsKey(uri.getScheme())) {
return fsproviders.get(uri.getScheme());
} else {
FileSystem fs;
try {
f... |
jboss/jboss-common-core | src/main/java/org/jboss/util/TimedCachePolicy.java | TimedCachePolicy.remove | public void remove(Object key)
{
TimedEntry entry = (TimedEntry) entryMap.remove(key);
if( entry != null )
entry.destroy();
} | java | public void remove(Object key)
{
TimedEntry entry = (TimedEntry) entryMap.remove(key);
if( entry != null )
entry.destroy();
} | [
"public",
"void",
"remove",
"(",
"Object",
"key",
")",
"{",
"TimedEntry",
"entry",
"=",
"(",
"TimedEntry",
")",
"entryMap",
".",
"remove",
"(",
"key",
")",
";",
"if",
"(",
"entry",
"!=",
"null",
")",
"entry",
".",
"destroy",
"(",
")",
";",
"}"
] | Remove the entry associated with key and call destroy on the entry
if found. | [
"Remove",
"the",
"entry",
"associated",
"with",
"key",
"and",
"call",
"destroy",
"on",
"the",
"entry",
"if",
"found",
"."
] | c191bb18db83fa106c6913cf34ed47989b65dc97 | https://github.com/jboss/jboss-common-core/blob/c191bb18db83fa106c6913cf34ed47989b65dc97/src/main/java/org/jboss/util/TimedCachePolicy.java#L312-L317 | test | Remove a entry from the map. | Of course, here is the Java code you requested:
```java
public void remove(Object key)
{
TimedEntry entry = (TimedEntry) entryMap.remove(key);
if( entry != null )
entry.destroy();
}
```
Hope this helps! |
deeplearning4j/nd4j | nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/complex/BaseComplexNDArray.java | BaseComplexNDArray.epsi | @Override
public IComplexNDArray epsi(INDArray other) {
IComplexNDArray linear = linearView();
if (other instanceof IComplexNDArray) {
IComplexNDArray otherComplex = (IComplexNDArray) other;
IComplexNDArray otherComplexLinear = otherComplex.linearView();
for (in... | java | @Override
public IComplexNDArray epsi(INDArray other) {
IComplexNDArray linear = linearView();
if (other instanceof IComplexNDArray) {
IComplexNDArray otherComplex = (IComplexNDArray) other;
IComplexNDArray otherComplexLinear = otherComplex.linearView();
for (in... | [
"@",
"Override",
"public",
"IComplexNDArray",
"epsi",
"(",
"INDArray",
"other",
")",
"{",
"IComplexNDArray",
"linear",
"=",
"linearView",
"(",
")",
";",
"if",
"(",
"other",
"instanceof",
"IComplexNDArray",
")",
"{",
"IComplexNDArray",
"otherComplex",
"=",
"(",
... | In place epsilon equals than comparison:
If the given number is less than the
comparison number the item is 0 otherwise 1
@param other the number to compare
@return | [
"In",
"place",
"epsilon",
"equals",
"than",
"comparison",
":",
"If",
"the",
"given",
"number",
"is",
"less",
"than",
"the",
"comparison",
"number",
"the",
"item",
"is",
"0",
"otherwise",
"1"
] | 8f005bcecb240d1fbb83b9d390ad801d1d3b6933 | https://github.com/deeplearning4j/nd4j/blob/8f005bcecb240d1fbb83b9d390ad801d1d3b6933/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/complex/BaseComplexNDArray.java#L764-L789 | test | This method is used to set the epsi values of the two complex numbers | Of course, here is the Java code you requested:
```java
@Override
public IComplexNDArray epsi(INDArray other) {
IComplexNDArray linear = linearView();
if (other instanceof IComplexNDArray) {
IComplexNDArray otherComplex = (IComplexNDArray) other;
IComplexNDArray otherComple... |
wro4j/wro4j | wro4j-core/src/main/java/ro/isdc/wro/model/group/DefaultGroupExtractor.java | DefaultGroupExtractor.getResourceType | public ResourceType getResourceType(final HttpServletRequest request) {
Validate.notNull(request);
final String uri = request.getRequestURI();
Validate.notNull(uri);
ResourceType type = null;
try {
type = ResourceType.get(FilenameUtils.getExtension(stripSessionID(uri)));
} catch (final Ill... | java | public ResourceType getResourceType(final HttpServletRequest request) {
Validate.notNull(request);
final String uri = request.getRequestURI();
Validate.notNull(uri);
ResourceType type = null;
try {
type = ResourceType.get(FilenameUtils.getExtension(stripSessionID(uri)));
} catch (final Ill... | [
"public",
"ResourceType",
"getResourceType",
"(",
"final",
"HttpServletRequest",
"request",
")",
"{",
"Validate",
".",
"notNull",
"(",
"request",
")",
";",
"final",
"String",
"uri",
"=",
"request",
".",
"getRequestURI",
"(",
")",
";",
"Validate",
".",
"notNull... | Extracts the resource type, by parsing the uri & finds the extension. If extension is valid ('css' or 'js'),
returns corresponding ResourceType, otherwise throws exception.
<p>
Valid examples of uri are: <code>/context/somePath/test.js</code> or <code>/context/somePath/test.css</code>
{@inheritDoc} | [
"Extracts",
"the",
"resource",
"type",
"by",
"parsing",
"the",
"uri",
"&",
"finds",
"the",
"extension",
".",
"If",
"extension",
"is",
"valid",
"(",
"css",
"or",
"js",
")",
"returns",
"corresponding",
"ResourceType",
"otherwise",
"throws",
"exception",
".",
"... | d2a3de71ab8bf0af7061fb6327501e08198338df | https://github.com/wro4j/wro4j/blob/d2a3de71ab8bf0af7061fb6327501e08198338df/wro4j-core/src/main/java/ro/isdc/wro/model/group/DefaultGroupExtractor.java#L56-L67 | test | Get the resource type from the request URI. | Of course, here is the Java code you requested:
```java
public ResourceType getResourceType(final HttpServletRequest request) {
Validate.notNull(request);
final String uri = request.getRequestURI();
Validate.notNull(uri);
ResourceType type = null;
try {
type = ResourceType.get(FilenameUtils.g... |
oblac/jodd | jodd-http/src/main/java/jodd/http/HttpRequest.java | HttpRequest.basicAuthentication | public HttpRequest basicAuthentication(final String username, final String password) {
if (username != null && password != null) {
String data = username.concat(StringPool.COLON).concat(password);
String base64 = Base64.encodeToString(data);
headerOverwrite(HEADER_AUTHORIZATION, "Basic " + base64);
}
... | java | public HttpRequest basicAuthentication(final String username, final String password) {
if (username != null && password != null) {
String data = username.concat(StringPool.COLON).concat(password);
String base64 = Base64.encodeToString(data);
headerOverwrite(HEADER_AUTHORIZATION, "Basic " + base64);
}
... | [
"public",
"HttpRequest",
"basicAuthentication",
"(",
"final",
"String",
"username",
",",
"final",
"String",
"password",
")",
"{",
"if",
"(",
"username",
"!=",
"null",
"&&",
"password",
"!=",
"null",
")",
"{",
"String",
"data",
"=",
"username",
".",
"concat",... | Enables basic authentication by adding required header. | [
"Enables",
"basic",
"authentication",
"by",
"adding",
"required",
"header",
"."
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-http/src/main/java/jodd/http/HttpRequest.java#L550-L560 | test | Sets the Authorization header to be used for basic authentication. | Of course, here is the Java code you requested:
```java
public HttpRequest basicAuthentication(final String username, final String password) {
if (username != null && password != null) {
String data = username.concat(StringPool.COLON).concat(password);
String base64 = Base64.encodeToString(data);
headerOv... |
subchen/jetbrick-all-1x | jetbrick-commons/src/main/java/jetbrick/lang/LocaleUtils.java | LocaleUtils.getDateFormatSymbols | public static DateFormatSymbols getDateFormatSymbols(Locale locale) {
LocaleInfo info = lookupLocaleInfo(locale);
DateFormatSymbols dfs = info.dateFormatSymbols;
if (dfs == null) {
dfs = new DateFormatSymbols(locale);
info.dateFormatSymbols = dfs;
}
return... | java | public static DateFormatSymbols getDateFormatSymbols(Locale locale) {
LocaleInfo info = lookupLocaleInfo(locale);
DateFormatSymbols dfs = info.dateFormatSymbols;
if (dfs == null) {
dfs = new DateFormatSymbols(locale);
info.dateFormatSymbols = dfs;
}
return... | [
"public",
"static",
"DateFormatSymbols",
"getDateFormatSymbols",
"(",
"Locale",
"locale",
")",
"{",
"LocaleInfo",
"info",
"=",
"lookupLocaleInfo",
"(",
"locale",
")",
";",
"DateFormatSymbols",
"dfs",
"=",
"info",
".",
"dateFormatSymbols",
";",
"if",
"(",
"dfs",
... | Returns cached <code>DateFormatSymbols</code> instance for specified locale. | [
"Returns",
"cached",
"<code",
">",
"DateFormatSymbols<",
"/",
"code",
">",
"instance",
"for",
"specified",
"locale",
"."
] | abe54629a508592287afe5ca4ffc93bf8bf4940c | https://github.com/subchen/jetbrick-all-1x/blob/abe54629a508592287afe5ca4ffc93bf8bf4940c/jetbrick-commons/src/main/java/jetbrick/lang/LocaleUtils.java#L91-L99 | test | Get the DateFormatSymbols object for the given locale. | Of course, here is the Java code you requested:
```java
public static DateFormatSymbols getDateFormatSymbols(Locale locale) {
LocaleInfo info = lookupLocaleInfo(locale);
DateFormatSymbols dfs = info.dateFormatSymbols;
if (dfs == null) {
dfs = new DateFormatSymbols(locale);
... |
oaqa/baseqa | src/main/java/edu/cmu/lti/oaqa/type/nlp/Token.java | Token.getPartOfSpeech | public String getPartOfSpeech() {
if (Token_Type.featOkTst && ((Token_Type)jcasType).casFeat_partOfSpeech == null)
jcasType.jcas.throwFeatMissing("partOfSpeech", "edu.cmu.lti.oaqa.type.nlp.Token");
return jcasType.ll_cas.ll_getStringValue(addr, ((Token_Type)jcasType).casFeatCode_partOfSpeech);} | java | public String getPartOfSpeech() {
if (Token_Type.featOkTst && ((Token_Type)jcasType).casFeat_partOfSpeech == null)
jcasType.jcas.throwFeatMissing("partOfSpeech", "edu.cmu.lti.oaqa.type.nlp.Token");
return jcasType.ll_cas.ll_getStringValue(addr, ((Token_Type)jcasType).casFeatCode_partOfSpeech);} | [
"public",
"String",
"getPartOfSpeech",
"(",
")",
"{",
"if",
"(",
"Token_Type",
".",
"featOkTst",
"&&",
"(",
"(",
"Token_Type",
")",
"jcasType",
")",
".",
"casFeat_partOfSpeech",
"==",
"null",
")",
"jcasType",
".",
"jcas",
".",
"throwFeatMissing",
"(",
"\"par... | getter for partOfSpeech - gets Coarse-grained part of speech. --- Example: noun, verb, adj, cord
@generated
@return value of the feature | [
"getter",
"for",
"partOfSpeech",
"-",
"gets",
"Coarse",
"-",
"grained",
"part",
"of",
"speech",
".",
"---",
"Example",
":",
"noun",
"verb",
"adj",
"cord"
] | 6ea632d8e51e3e617d4876fc1185c49be0ad7eb8 | https://github.com/oaqa/baseqa/blob/6ea632d8e51e3e617d4876fc1185c49be0ad7eb8/src/main/java/edu/cmu/lti/oaqa/type/nlp/Token.java#L152-L155 | test | getter for partOfSpeech - gets | Of course, here is the Java code you requested:
```java
public String getPartOfSpeech() {
if (Token_Type.featOkTst && ((Token_Type)jcasType).casFeat_partOfSpeech == null)
jcasType.jcas.throwFeatMissing("partOfSpeech", "edu.cmu.lti.oaqa.type.nlp.Token");
return jcasType.ll_cas.ll_getStringValue(addr, ((To... |
oblac/jodd | jodd-bean/src/main/java/jodd/bean/BeanVisitor.java | BeanVisitor.resolveProperties | protected String[] resolveProperties(final Object bean, final boolean declared) {
String[] properties;
if (bean instanceof Map) {
Set keys = ((Map) bean).keySet();
properties = new String[keys.size()];
int ndx = 0;
for (Object key : keys) {
properties[ndx] = key.toString();
ndx++;
}
} els... | java | protected String[] resolveProperties(final Object bean, final boolean declared) {
String[] properties;
if (bean instanceof Map) {
Set keys = ((Map) bean).keySet();
properties = new String[keys.size()];
int ndx = 0;
for (Object key : keys) {
properties[ndx] = key.toString();
ndx++;
}
} els... | [
"protected",
"String",
"[",
"]",
"resolveProperties",
"(",
"final",
"Object",
"bean",
",",
"final",
"boolean",
"declared",
")",
"{",
"String",
"[",
"]",
"properties",
";",
"if",
"(",
"bean",
"instanceof",
"Map",
")",
"{",
"Set",
"keys",
"=",
"(",
"(",
... | Returns an array of bean properties. If bean is a <code>Map</code>,
all its keys will be returned. | [
"Returns",
"an",
"array",
"of",
"bean",
"properties",
".",
"If",
"bean",
"is",
"a",
"<code",
">",
"Map<",
"/",
"code",
">",
"all",
"its",
"keys",
"will",
"be",
"returned",
"."
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-bean/src/main/java/jodd/bean/BeanVisitor.java#L121-L138 | test | Resolves the properties of the given bean. | Of course, here is the Java code you requested:
```java
protected String[] resolveProperties(final Object bean, final boolean declared) {
String[] properties;
if (bean instanceof Map) {
Set keys = ((Map) bean).keySet();
properties = new String[keys.size()];
int ndx = 0;
for (Object key : keys) {
... |
jcuda/jcublas | JCublasJava/src/main/java/jcuda/jcublas/JCublas.java | JCublas.cublasCsyr2k | public static void cublasCsyr2k(char uplo, char trans, int n, int k, cuComplex alpha, Pointer A, int lda, Pointer B, int ldb, cuComplex beta, Pointer C, int ldc)
{
cublasCsyr2kNative(uplo, trans, n, k, alpha, A, lda, B, ldb, beta, C, ldc);
checkResultBLAS();
} | java | public static void cublasCsyr2k(char uplo, char trans, int n, int k, cuComplex alpha, Pointer A, int lda, Pointer B, int ldb, cuComplex beta, Pointer C, int ldc)
{
cublasCsyr2kNative(uplo, trans, n, k, alpha, A, lda, B, ldb, beta, C, ldc);
checkResultBLAS();
} | [
"public",
"static",
"void",
"cublasCsyr2k",
"(",
"char",
"uplo",
",",
"char",
"trans",
",",
"int",
"n",
",",
"int",
"k",
",",
"cuComplex",
"alpha",
",",
"Pointer",
"A",
",",
"int",
"lda",
",",
"Pointer",
"B",
",",
"int",
"ldb",
",",
"cuComplex",
"bet... | <pre>
void
cublasCsyr2k (char uplo, char trans, int n, int k, cuComplex alpha,
const cuComplex *A, int lda, const cuComplex *B, int ldb,
cuComplex beta, cuComplex *C, int ldc)
performs one of the symmetric rank 2k operations
C = alpha * A * transpose(B) + alpha * B * transpose(A) + beta * C, or
C = alpha * transpose(... | [
"<pre",
">",
"void",
"cublasCsyr2k",
"(",
"char",
"uplo",
"char",
"trans",
"int",
"n",
"int",
"k",
"cuComplex",
"alpha",
"const",
"cuComplex",
"*",
"A",
"int",
"lda",
"const",
"cuComplex",
"*",
"B",
"int",
"ldb",
"cuComplex",
"beta",
"cuComplex",
"*",
"C... | 80875235d24562073f4d66651dd17263f306427d | https://github.com/jcuda/jcublas/blob/80875235d24562073f4d66651dd17263f306427d/JCublasJava/src/main/java/jcuda/jcublas/JCublas.java#L6723-L6727 | test | Cublas syr2k. | Of course, here is the Java code you requested:
```java
public static void cublasCsyr2k(char uplo, char trans, int n, int k, cuComplex alpha, Pointer A, int lda, Pointer B, int ldb, cuComplex beta, Pointer C, int ldc)
{
cublasCsyr2kNative(uplo, trans, n, k, alpha, A, lda, B, ldb, beta, C, ldc);
... |
Unidata/thredds | ui/src/main/java/ucar/nc2/ui/image/PicturePane.java | PicturePane.setPicture | public void setPicture( URL filenameURL, String legendParam, double rotation ) {
legend = legendParam;
centerWhenScaled = true;
sclPic.setScaleSize(getSize());
sclPic.stopLoadingExcept( filenameURL );
sclPic.loadAndScalePictureInThread( filenameURL, Thread.MAX_PRIORITY, rotation );
} | java | public void setPicture( URL filenameURL, String legendParam, double rotation ) {
legend = legendParam;
centerWhenScaled = true;
sclPic.setScaleSize(getSize());
sclPic.stopLoadingExcept( filenameURL );
sclPic.loadAndScalePictureInThread( filenameURL, Thread.MAX_PRIORITY, rotation );
} | [
"public",
"void",
"setPicture",
"(",
"URL",
"filenameURL",
",",
"String",
"legendParam",
",",
"double",
"rotation",
")",
"{",
"legend",
"=",
"legendParam",
";",
"centerWhenScaled",
"=",
"true",
";",
"sclPic",
".",
"setScaleSize",
"(",
"getSize",
"(",
")",
")... | brings up the indicated picture on the display.
@param filenameURL The URL of the picture to display
@param legendParam The description of the picture
@param rotation The rotation that should be applied | [
"brings",
"up",
"the",
"indicated",
"picture",
"on",
"the",
"display",
"."
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/ui/src/main/java/ucar/nc2/ui/image/PicturePane.java#L184-L191 | test | Sets the picture of the image. | Of course, here is the Java code you requested:
```java
public void setPicture( URL filenameURL, String legendParam, double rotation ) {
legend = legendParam;
centerWhenScaled = true;
sclPic.setScaleSize(getSize());
sclPic.stopLoadingExcept( filenameURL );
sclPic.loadAndScalePictureInThread( filen... |
ReactiveX/RxJava | src/main/java/io/reactivex/Flowable.java | Flowable.concatArrayEager | @CheckReturnValue
@NonNull
@BackpressureSupport(BackpressureKind.FULL)
@SchedulerSupport(SchedulerSupport.NONE)
@SuppressWarnings({ "rawtypes", "unchecked" })
public static <T> Flowable<T> concatArrayEager(int maxConcurrency, int prefetch, Publisher<? extends T>... sources) {
ObjectHelper.re... | java | @CheckReturnValue
@NonNull
@BackpressureSupport(BackpressureKind.FULL)
@SchedulerSupport(SchedulerSupport.NONE)
@SuppressWarnings({ "rawtypes", "unchecked" })
public static <T> Flowable<T> concatArrayEager(int maxConcurrency, int prefetch, Publisher<? extends T>... sources) {
ObjectHelper.re... | [
"@",
"CheckReturnValue",
"@",
"NonNull",
"@",
"BackpressureSupport",
"(",
"BackpressureKind",
".",
"FULL",
")",
"@",
"SchedulerSupport",
"(",
"SchedulerSupport",
".",
"NONE",
")",
"@",
"SuppressWarnings",
"(",
"{",
"\"rawtypes\"",
",",
"\"unchecked\"",
"}",
")",
... | Concatenates an array of Publishers eagerly into a single stream of values.
<p>
<img width="640" height="406" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/Flowable.concatArrayEager.nn.png" alt="">
<p>
Eager concatenation means that once a subscriber subscribes, this operator subscribes to all o... | [
"Concatenates",
"an",
"array",
"of",
"Publishers",
"eagerly",
"into",
"a",
"single",
"stream",
"of",
"values",
".",
"<p",
">",
"<img",
"width",
"=",
"640",
"height",
"=",
"406",
"src",
"=",
"https",
":",
"//",
"raw",
".",
"github",
".",
"com",
"/",
"... | ac84182aa2bd866b53e01c8e3fe99683b882c60e | https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Flowable.java#L1487-L1497 | test | Concatenates an array of Publishers into an array of Publishers. | Of course, here is the Java code you requested:
```java
@CheckReturnValue
@NonNull
@BackpressureSupport(BackpressureKind.FULL)
@SchedulerSupport(SchedulerSupport.NONE)
@SuppressWarnings({ "rawtypes", "unchecked" })
public static <T> Flowable<T> concatArrayEager(int maxConcurrency, int prefetch, Pub... |
objectify/objectify | src/main/java/com/googlecode/objectify/impl/QueryImpl.java | QueryImpl.addOrder | void addOrder(String condition) {
condition = condition.trim();
boolean descending = false;
if (condition.startsWith("-")) {
descending = true;
condition = condition.substring(1).trim();
}
// Prevent ordering by @Id or @Parent fields, which are really part of the key
if (this.classRestrict... | java | void addOrder(String condition) {
condition = condition.trim();
boolean descending = false;
if (condition.startsWith("-")) {
descending = true;
condition = condition.substring(1).trim();
}
// Prevent ordering by @Id or @Parent fields, which are really part of the key
if (this.classRestrict... | [
"void",
"addOrder",
"(",
"String",
"condition",
")",
"{",
"condition",
"=",
"condition",
".",
"trim",
"(",
")",
";",
"boolean",
"descending",
"=",
"false",
";",
"if",
"(",
"condition",
".",
"startsWith",
"(",
"\"-\"",
")",
")",
"{",
"descending",
"=",
... | Modifies the instance | [
"Modifies",
"the",
"instance"
] | 4bf325d2e49b400326416977c7d9bbdf5380175b | https://github.com/objectify/objectify/blob/4bf325d2e49b400326416977c7d9bbdf5380175b/src/main/java/com/googlecode/objectify/impl/QueryImpl.java#L177-L199 | test | Add order to the list of records that belong to this entity. | Of course, here is the Java code you requested:
```java
void addOrder(String condition) {
condition = condition.trim();
boolean descending = false;
if (condition.startsWith("-")) {
descending = true;
condition = condition.substring(1).trim();
}
// Prevent ordering by @Id or @Parent fields, w... |
oblac/jodd | jodd-db/src/main/java/jodd/db/oom/sqlgen/DbEntitySql.java | DbEntitySql.update | public DbSqlBuilder update(final Object entity) {
String tableRef = createTableRefName(entity);
if (!dbOomConfig.isUpdateAcceptsTableAlias()) {
tableRef = null;
}
return sql().$(UPDATE).table(entity, tableRef).set(tableRef, entity).$(WHERE).matchIds(tableRef, entity);
} | java | public DbSqlBuilder update(final Object entity) {
String tableRef = createTableRefName(entity);
if (!dbOomConfig.isUpdateAcceptsTableAlias()) {
tableRef = null;
}
return sql().$(UPDATE).table(entity, tableRef).set(tableRef, entity).$(WHERE).matchIds(tableRef, entity);
} | [
"public",
"DbSqlBuilder",
"update",
"(",
"final",
"Object",
"entity",
")",
"{",
"String",
"tableRef",
"=",
"createTableRefName",
"(",
"entity",
")",
";",
"if",
"(",
"!",
"dbOomConfig",
".",
"isUpdateAcceptsTableAlias",
"(",
")",
")",
"{",
"tableRef",
"=",
"n... | Creates UPDATE query that updates all non-null values of an entity that is matched by id. | [
"Creates",
"UPDATE",
"query",
"that",
"updates",
"all",
"non",
"-",
"null",
"values",
"of",
"an",
"entity",
"that",
"is",
"matched",
"by",
"id",
"."
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-db/src/main/java/jodd/db/oom/sqlgen/DbEntitySql.java#L89-L97 | test | Update the entity in the database. | Of course, here is the Java code you requested:
```java
public DbSqlBuilder update(final Object entity) {
String tableRef = createTableRefName(entity);
if (!dbOomConfig.isUpdateAcceptsTableAlias()) {
tableRef = null;
}
return sql().$(UPDATE).table(entity, tableRef).set(tableRef, entity).$(WHERE).matchIds(... |
rupertlssmith/lojix | base/common/src/main/com/thesett/common/swing/workflow/WorkFlowButtonsPanel.java | WorkFlowButtonsPanel.updateButtonsForWorkFlow | public void updateButtonsForWorkFlow(WorkFlowState state)
{
// Check if it is in the NOT_INITIALIZED state
if (state.getState().equals(WorkFlowState.NOT_INITIALIZED))
{
backButton.setEnabled(false);
nextButton.setEnabled(false);
finishButton.setEnabled(fal... | java | public void updateButtonsForWorkFlow(WorkFlowState state)
{
// Check if it is in the NOT_INITIALIZED state
if (state.getState().equals(WorkFlowState.NOT_INITIALIZED))
{
backButton.setEnabled(false);
nextButton.setEnabled(false);
finishButton.setEnabled(fal... | [
"public",
"void",
"updateButtonsForWorkFlow",
"(",
"WorkFlowState",
"state",
")",
"{",
"// Check if it is in the NOT_INITIALIZED state",
"if",
"(",
"state",
".",
"getState",
"(",
")",
".",
"equals",
"(",
"WorkFlowState",
".",
"NOT_INITIALIZED",
")",
")",
"{",
"backB... | Updates the buttons enabled/disabled status to reflect the current work flow state.
@param state The new work flow state. | [
"Updates",
"the",
"buttons",
"enabled",
"/",
"disabled",
"status",
"to",
"reflect",
"the",
"current",
"work",
"flow",
"state",
"."
] | ad494dc8bce2345567de7689d42291d4b30fbd51 | https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/base/common/src/main/com/thesett/common/swing/workflow/WorkFlowButtonsPanel.java#L184-L211 | test | Update the buttons for the work flow. | Of course, here is the Java code you requested:
```java
public void updateButtonsForWorkFlow(WorkFlowState state)
{
// Check if it is in the NOT_INITIALIZED state
if (state.getState().equals(WorkFlowState.NOT_INITIALIZED))
{
backButton.setEnabled(false);
nextButton.s... |
wildfly/wildfly | undertow/src/main/java/org/wildfly/extension/undertow/deployment/WarStructureDeploymentProcessor.java | WarStructureDeploymentProcessor.createResourceRoots | private List<ResourceRoot> createResourceRoots(final VirtualFile deploymentRoot, final DeploymentUnit deploymentUnit) throws IOException, DeploymentUnitProcessingException {
final List<ResourceRoot> entries = new ArrayList<ResourceRoot>();
// WEB-INF classes
final VirtualFile webinfClasses = dep... | java | private List<ResourceRoot> createResourceRoots(final VirtualFile deploymentRoot, final DeploymentUnit deploymentUnit) throws IOException, DeploymentUnitProcessingException {
final List<ResourceRoot> entries = new ArrayList<ResourceRoot>();
// WEB-INF classes
final VirtualFile webinfClasses = dep... | [
"private",
"List",
"<",
"ResourceRoot",
">",
"createResourceRoots",
"(",
"final",
"VirtualFile",
"deploymentRoot",
",",
"final",
"DeploymentUnit",
"deploymentUnit",
")",
"throws",
"IOException",
",",
"DeploymentUnitProcessingException",
"{",
"final",
"List",
"<",
"Resou... | Create the resource roots for a .war deployment
@param deploymentRoot the deployment root
@return the resource roots
@throws java.io.IOException for any error | [
"Create",
"the",
"resource",
"roots",
"for",
"a",
".",
"war",
"deployment"
] | 64896f1500fe465ad83d96ede9fa19d0c3747f18 | https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/undertow/src/main/java/org/wildfly/extension/undertow/deployment/WarStructureDeploymentProcessor.java#L199-L235 | test | Create the list of resource roots from the deployment. | Of course, here is the Java code you requested:
```java
private List<ResourceRoot> createResourceRoots(final VirtualFile deploymentRoot, final DeploymentUnit deploymentUnit) throws IOException, DeploymentUnitProcessingException {
final List<ResourceRoot> entries = new ArrayList<ResourceRoot>();
// WEB-... |
RestComm/jain-slee | container/profiles/src/main/java/org/mobicents/slee/container/profile/ProfileTableImpl.java | ProfileTableImpl.find | public ProfileLocalObject find(String profileName)
throws NullPointerException, TransactionRequiredLocalException,
SLEEException {
if (profileName == null) {
throw new NullPointerException();
}
ProfileObjectImpl profileObject = getProfile(profileName);
return profileObject == null ? null : prof... | java | public ProfileLocalObject find(String profileName)
throws NullPointerException, TransactionRequiredLocalException,
SLEEException {
if (profileName == null) {
throw new NullPointerException();
}
ProfileObjectImpl profileObject = getProfile(profileName);
return profileObject == null ? null : prof... | [
"public",
"ProfileLocalObject",
"find",
"(",
"String",
"profileName",
")",
"throws",
"NullPointerException",
",",
"TransactionRequiredLocalException",
",",
"SLEEException",
"{",
"if",
"(",
"profileName",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
... | /*
(non-Javadoc)
@see javax.slee.profile.ProfileTable#find(java.lang.String) | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | 0eaa16ff2d4b6faf43f0d99260e88878fd54dee0 | https://github.com/RestComm/jain-slee/blob/0eaa16ff2d4b6faf43f0d99260e88878fd54dee0/container/profiles/src/main/java/org/mobicents/slee/container/profile/ProfileTableImpl.java#L277-L287 | test | Returns the ProfileLocalObject object for the specified profile name. | Of course, here is the Java code you requested:
```java
public ProfileLocalObject find(String profileName)
throws NullPointerException, TransactionRequiredLocalException,
SLEEException {
if (profileName == null) {
throw new NullPointerException();
}
ProfileObjectImpl profileObject = getProfile(p... |
wro4j/wro4j | wro4j-core/src/main/java/ro/isdc/wro/model/resource/processor/decorator/MinimizeAwareProcessorDecorator.java | MinimizeAwareProcessorDecorator.isEnabled | @Override
protected boolean isEnabled(final Resource resource) {
// apply processor only when minimize is required or the processor is not minimize aware
final boolean applyProcessor = (resource != null && resource.isMinimize() && minimize)
|| (resource == null && minimize) || !isMinimize();
retur... | java | @Override
protected boolean isEnabled(final Resource resource) {
// apply processor only when minimize is required or the processor is not minimize aware
final boolean applyProcessor = (resource != null && resource.isMinimize() && minimize)
|| (resource == null && minimize) || !isMinimize();
retur... | [
"@",
"Override",
"protected",
"boolean",
"isEnabled",
"(",
"final",
"Resource",
"resource",
")",
"{",
"// apply processor only when minimize is required or the processor is not minimize aware",
"final",
"boolean",
"applyProcessor",
"=",
"(",
"resource",
"!=",
"null",
"&&",
... | {@inheritDoc} | [
"{"
] | d2a3de71ab8bf0af7061fb6327501e08198338df | https://github.com/wro4j/wro4j/blob/d2a3de71ab8bf0af7061fb6327501e08198338df/wro4j-core/src/main/java/ro/isdc/wro/model/resource/processor/decorator/MinimizeAwareProcessorDecorator.java#L46-L52 | test | Override to apply minimize aware CID taxonomy to the resource | Of course, here is the Java code you requested:
```java
@Override
protected boolean isEnabled(final Resource resource) {
// apply processor only when minimize is required or the processor is not minimize aware
final boolean applyProcessor = (resource != null && resource.isMinimize() && minimize)
|| (... |
RestComm/jain-slee | tools/slee-management-console/server/src/main/java/org/mobicents/slee/container/management/console/server/log/LogServiceImpl.java | LogServiceImpl.fetchLoggerInfo | public LoggerInfo fetchLoggerInfo(String loggerName) throws ManagementConsoleException {
if (!sleeConnection.getSleeManagementMBeanUtils().getLogManagementMBeanUtils().getLoggerNames(null).contains(loggerName))
sleeConnection.getSleeManagementMBeanUtils().getLogManagementMBeanUtils().addLogger(loggerName,... | java | public LoggerInfo fetchLoggerInfo(String loggerName) throws ManagementConsoleException {
if (!sleeConnection.getSleeManagementMBeanUtils().getLogManagementMBeanUtils().getLoggerNames(null).contains(loggerName))
sleeConnection.getSleeManagementMBeanUtils().getLogManagementMBeanUtils().addLogger(loggerName,... | [
"public",
"LoggerInfo",
"fetchLoggerInfo",
"(",
"String",
"loggerName",
")",
"throws",
"ManagementConsoleException",
"{",
"if",
"(",
"!",
"sleeConnection",
".",
"getSleeManagementMBeanUtils",
"(",
")",
".",
"getLogManagementMBeanUtils",
"(",
")",
".",
"getLoggerNames",
... | /*
(non-Javadoc)
@see org.mobicents.slee.container.management.console.client.log.LogService#fetchLoggerInfo(java.lang.String) | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | 0eaa16ff2d4b6faf43f0d99260e88878fd54dee0 | https://github.com/RestComm/jain-slee/blob/0eaa16ff2d4b6faf43f0d99260e88878fd54dee0/tools/slee-management-console/server/src/main/java/org/mobicents/slee/container/management/console/server/log/LogServiceImpl.java#L86-L111 | test | Fetch the information about a logger. | Of course, here is the Java code you requested:
```java
public LoggerInfo fetchLoggerInfo(String loggerName) throws ManagementConsoleException {
if (!sleeConnection.getSleeManagementMBeanUtils().getLogManagementMBeanUtils().getLoggerNames(null).contains(loggerName))
sleeConnection.getSleeManagementMBeanU... |
ReactiveX/RxJava | src/main/java/io/reactivex/Flowable.java | Flowable.switchOnNextDelayError | @CheckReturnValue
@BackpressureSupport(BackpressureKind.FULL)
@SchedulerSupport(SchedulerSupport.NONE)
public static <T> Flowable<T> switchOnNextDelayError(Publisher<? extends Publisher<? extends T>> sources, int prefetch) {
return fromPublisher(sources).switchMapDelayError(Functions.<Publisher<? ex... | java | @CheckReturnValue
@BackpressureSupport(BackpressureKind.FULL)
@SchedulerSupport(SchedulerSupport.NONE)
public static <T> Flowable<T> switchOnNextDelayError(Publisher<? extends Publisher<? extends T>> sources, int prefetch) {
return fromPublisher(sources).switchMapDelayError(Functions.<Publisher<? ex... | [
"@",
"CheckReturnValue",
"@",
"BackpressureSupport",
"(",
"BackpressureKind",
".",
"FULL",
")",
"@",
"SchedulerSupport",
"(",
"SchedulerSupport",
".",
"NONE",
")",
"public",
"static",
"<",
"T",
">",
"Flowable",
"<",
"T",
">",
"switchOnNextDelayError",
"(",
"Publ... | Converts a Publisher that emits Publishers into a Publisher that emits the items emitted by the
most recently emitted of those Publishers and delays any exception until all Publishers terminate.
<p>
<img width="640" height="370" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/switchDo.png" alt="">... | [
"Converts",
"a",
"Publisher",
"that",
"emits",
"Publishers",
"into",
"a",
"Publisher",
"that",
"emits",
"the",
"items",
"emitted",
"by",
"the",
"most",
"recently",
"emitted",
"of",
"those",
"Publishers",
"and",
"delays",
"any",
"exception",
"until",
"all",
"Pu... | ac84182aa2bd866b53e01c8e3fe99683b882c60e | https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Flowable.java#L4319-L4324 | test | Switch on next delay error. | Of course, here is the Java code you requested:
```java
@CheckReturnValue
@BackpressureSupport(BackpressureKind.FULL)
@SchedulerSupport(SchedulerSupport.NONE)
public static <T> Flowable<T> switchOnNextDelayError(Publisher<? extends Publisher<? extends T>> sources, int prefetch) {
return fromPublish... |
oblac/jodd | jodd-db/src/main/java/jodd/db/DbQuery.java | DbQuery.setBigInteger | public Q setBigInteger(final int index, final BigInteger value) {
if (value == null) {
setNull(index, Types.NUMERIC);
}
else {
setLong(index, value.longValue());
}
return _this();
} | java | public Q setBigInteger(final int index, final BigInteger value) {
if (value == null) {
setNull(index, Types.NUMERIC);
}
else {
setLong(index, value.longValue());
}
return _this();
} | [
"public",
"Q",
"setBigInteger",
"(",
"final",
"int",
"index",
",",
"final",
"BigInteger",
"value",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"setNull",
"(",
"index",
",",
"Types",
".",
"NUMERIC",
")",
";",
"}",
"else",
"{",
"setLong",
"("... | ---------------------------------------------------------------- big integer | [
"----------------------------------------------------------------",
"big",
"integer"
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-db/src/main/java/jodd/db/DbQuery.java#L729-L737 | test | Sets the value of an integer column. | Of course, here is the Java code you requested:
```java
public Q setBigInteger(final int index, final BigInteger value) {
if (value == null) {
setNull(index, Types.NUMERIC);
}
else {
setLong(index, value.longValue());
}
return _this();
}
```
Hope this helps! |
Unidata/thredds | cdm/src/main/java/ucar/nc2/ft/point/PointIteratorAdapter.java | PointIteratorAdapter.next | @Override
public PointFeature next() throws NoSuchElementException {
if (!hasNext()) {
throw new NoSuchElementException("The iteration has no more elements.");
}
PointFeature pointFeat = pointIter.next();
assert pointFeat != null : "hasNext() should have been false. WTF?... | java | @Override
public PointFeature next() throws NoSuchElementException {
if (!hasNext()) {
throw new NoSuchElementException("The iteration has no more elements.");
}
PointFeature pointFeat = pointIter.next();
assert pointFeat != null : "hasNext() should have been false. WTF?... | [
"@",
"Override",
"public",
"PointFeature",
"next",
"(",
")",
"throws",
"NoSuchElementException",
"{",
"if",
"(",
"!",
"hasNext",
"(",
")",
")",
"{",
"throw",
"new",
"NoSuchElementException",
"(",
"\"The iteration has no more elements.\"",
")",
";",
"}",
"PointFeat... | but we can define a stronger contract. | [
"but",
"we",
"can",
"define",
"a",
"stronger",
"contract",
"."
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/ft/point/PointIteratorAdapter.java#L56-L67 | test | Returns the next PointFeature in the iterator. | Of course, here is the Java code you requested:
```java
@Override
public PointFeature next() throws NoSuchElementException {
if (!hasNext()) {
throw new NoSuchElementException("The iteration has no more elements.");
}
PointFeature pointFeat = pointIter.next();
assert po... |
kocakosm/pitaya | src/org/kocakosm/pitaya/charset/ASCII.java | ASCII.isAlphabetic | public static boolean isAlphabetic(String str)
{
for (char c : str.toCharArray()) {
if (!isLetter(c)) {
return false;
}
}
return true;
} | java | public static boolean isAlphabetic(String str)
{
for (char c : str.toCharArray()) {
if (!isLetter(c)) {
return false;
}
}
return true;
} | [
"public",
"static",
"boolean",
"isAlphabetic",
"(",
"String",
"str",
")",
"{",
"for",
"(",
"char",
"c",
":",
"str",
".",
"toCharArray",
"(",
")",
")",
"{",
"if",
"(",
"!",
"isLetter",
"(",
"c",
")",
")",
"{",
"return",
"false",
";",
"}",
"}",
"re... | Returns whether the given {@code String} is an alphabetic sequence,
that is, a sequence which only contains letters.
@param str the {@code String} to test.
@return whether the given {@code String} is an alphabetic sequence.
@throws NullPointerException if {@code str} is {@code null}. | [
"Returns",
"whether",
"the",
"given",
"{",
"@code",
"String",
"}",
"is",
"an",
"alphabetic",
"sequence",
"that",
"is",
"a",
"sequence",
"which",
"only",
"contains",
"letters",
"."
] | f2b203b6cdb32723bd1249a1325a3bb5918bf99a | https://github.com/kocakosm/pitaya/blob/f2b203b6cdb32723bd1249a1325a3bb5918bf99a/src/org/kocakosm/pitaya/charset/ASCII.java#L250-L258 | test | Checks if a String is a letters. | Of course, here is the Java code you requested:
```java
public static boolean isAlphabetic(String str)
{
for (char c : str.toCharArray()) {
if (!isLetter(c)) {
return false;
}
}
return true;
}
```
Hope this helps! |
tiefaces/TieFaces | src/org/tiefaces/components/websheet/service/ValidationHandler.java | ValidationHandler.preValidation | public boolean preValidation() {
String currentTabName = parent.getCurrent().getCurrentTabName();
String tabName = null;
String firstInvalidTabName = null;
boolean reload = false;
for (Map.Entry<String, SheetConfiguration> entry : parent.getSheetConfigMap().entrySet()) {
tabName = entry.getKey(... | java | public boolean preValidation() {
String currentTabName = parent.getCurrent().getCurrentTabName();
String tabName = null;
String firstInvalidTabName = null;
boolean reload = false;
for (Map.Entry<String, SheetConfiguration> entry : parent.getSheetConfigMap().entrySet()) {
tabName = entry.getKey(... | [
"public",
"boolean",
"preValidation",
"(",
")",
"{",
"String",
"currentTabName",
"=",
"parent",
".",
"getCurrent",
"(",
")",
".",
"getCurrentTabName",
"(",
")",
";",
"String",
"tabName",
"=",
"null",
";",
"String",
"firstInvalidTabName",
"=",
"null",
";",
"b... | triggered validation process before actions like save or submit.
@return true (pass) false (failed) | [
"triggered",
"validation",
"process",
"before",
"actions",
"like",
"save",
"or",
"submit",
"."
] | 3b57b9701ed0f080b5fa4fa78269cc0c422b34ba | https://github.com/tiefaces/TieFaces/blob/3b57b9701ed0f080b5fa4fa78269cc0c422b34ba/src/org/tiefaces/components/websheet/service/ValidationHandler.java#L486-L511 | test | This method is called before the validation of the worksheet. | Of course, here is the Java code you requested:
```java
public boolean preValidation() {
String currentTabName = parent.getCurrent().getCurrentTabName();
String tabName = null;
String firstInvalidTabName = null;
boolean reload = false;
for (Map.Entry<String, SheetConfiguration> entry : parent.getS... |
Unidata/thredds | cdm/src/main/java/ucar/unidata/geoloc/projection/proj4/PolyconicProjection.java | PolyconicProjection.latLonToProj | @Override
public ProjectionPoint latLonToProj(LatLonPoint latlon, ProjectionPointImpl result) {
double fromLat = Math.toRadians(latlon.getLatitude());
double theta = Math.toRadians(latlon.getLongitude());
if (projectionLongitude != 0 && !Double.isNaN(theta)) {
theta = MapMath.normalizeLongitude... | java | @Override
public ProjectionPoint latLonToProj(LatLonPoint latlon, ProjectionPointImpl result) {
double fromLat = Math.toRadians(latlon.getLatitude());
double theta = Math.toRadians(latlon.getLongitude());
if (projectionLongitude != 0 && !Double.isNaN(theta)) {
theta = MapMath.normalizeLongitude... | [
"@",
"Override",
"public",
"ProjectionPoint",
"latLonToProj",
"(",
"LatLonPoint",
"latlon",
",",
"ProjectionPointImpl",
"result",
")",
"{",
"double",
"fromLat",
"=",
"Math",
".",
"toRadians",
"(",
"latlon",
".",
"getLatitude",
"(",
")",
")",
";",
"double",
"th... | Convert a LatLonPoint to projection coordinates
@param latlon convert from these lat, lon coordinates
@param result the object to write to
@return the given result | [
"Convert",
"a",
"LatLonPoint",
"to",
"projection",
"coordinates"
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/unidata/geoloc/projection/proj4/PolyconicProjection.java#L423-L435 | test | Converts a LatLonPoint object into a ProjectionPoint object. | Of course, here is the Java code you requested:
```java
@Override
public ProjectionPoint latLonToProj(LatLonPoint latlon, ProjectionPointImpl result) {
double fromLat = Math.toRadians(latlon.getLatitude());
double theta = Math.toRadians(latlon.getLongitude());
if (projectionLongitude != 0 && !Double.... |
arnohaase/a-foundation | a-foundation/src/main/java/com/ajjpj/afoundation/concurrent/LocalQueue.java | LocalQueue.push | void push (Runnable task) {
final long _base = UNSAFE.getLongVolatile (this, OFFS_BASE); // read base first (and only once)
final long _top = top;
if (_top == _base + mask) {
throw new RejectedExecutionExceptionWithoutStacktrace ("local queue overflow");
}
tasks[asAr... | java | void push (Runnable task) {
final long _base = UNSAFE.getLongVolatile (this, OFFS_BASE); // read base first (and only once)
final long _top = top;
if (_top == _base + mask) {
throw new RejectedExecutionExceptionWithoutStacktrace ("local queue overflow");
}
tasks[asAr... | [
"void",
"push",
"(",
"Runnable",
"task",
")",
"{",
"final",
"long",
"_base",
"=",
"UNSAFE",
".",
"getLongVolatile",
"(",
"this",
",",
"OFFS_BASE",
")",
";",
"// read base first (and only once)",
"final",
"long",
"_top",
"=",
"top",
";",
"if",
"(",
"_top",
... | Add a new task to the top of the localQueue, incrementing 'top'. This is only ever called from the owning thread. | [
"Add",
"a",
"new",
"task",
"to",
"the",
"top",
"of",
"the",
"localQueue",
"incrementing",
"top",
".",
"This",
"is",
"only",
"ever",
"called",
"from",
"the",
"owning",
"thread",
"."
] | f3eef2ca89d67775f202a4c28140230a6229291e | https://github.com/arnohaase/a-foundation/blob/f3eef2ca89d67775f202a4c28140230a6229291e/a-foundation/src/main/java/com/ajjpj/afoundation/concurrent/LocalQueue.java#L68-L84 | test | Push a task onto the local queue. | Of course, here is the Java code you requested:
```java
void push (Runnable task) {
final long _base = UNSAFE.getLongVolatile (this, OFFS_BASE); // read base first (and only once)
final long _top = top;
if (_top == _base + mask) {
throw new RejectedExecutionExceptionWithoutStacktrac... |
Unidata/thredds | ui/src/main/java/ucar/nc2/ui/grid/ColorScale.java | ColorScale.setNumColors | public void setNumColors(int n) {
if (n != ncolors) {
colors = new Color[n];
int prevn = Math.min(ncolors, n);
System.arraycopy(useColors, 0, colors, 0, prevn);
for (int i = ncolors; i < n; i++)
colors[i] = Color.white;
useColors = colors;
ncolors = n;
ed... | java | public void setNumColors(int n) {
if (n != ncolors) {
colors = new Color[n];
int prevn = Math.min(ncolors, n);
System.arraycopy(useColors, 0, colors, 0, prevn);
for (int i = ncolors; i < n; i++)
colors[i] = Color.white;
useColors = colors;
ncolors = n;
ed... | [
"public",
"void",
"setNumColors",
"(",
"int",
"n",
")",
"{",
"if",
"(",
"n",
"!=",
"ncolors",
")",
"{",
"colors",
"=",
"new",
"Color",
"[",
"n",
"]",
";",
"int",
"prevn",
"=",
"Math",
".",
"min",
"(",
"ncolors",
",",
"n",
")",
";",
"System",
".... | Set the number of colors in the colorscale. | [
"Set",
"the",
"number",
"of",
"colors",
"in",
"the",
"colorscale",
"."
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/ui/src/main/java/ucar/nc2/ui/grid/ColorScale.java#L263-L276 | test | Sets the number of colors in the image. | Of course, here is the Java code you requested:
```java
public void setNumColors(int n) {
if (n != ncolors) {
colors = new Color[n];
int prevn = Math.min(ncolors, n);
System.arraycopy(useColors, 0, colors, 0, prevn);
for (int i = ncolors; i < n; i++)
colors[i] = Color.white;
... |
Unidata/thredds | dap4/d4core/src/main/java/dap4/core/util/DapUtil.java | DapUtil.indexToSlices | static public List<Slice>
indexToSlices(Index indices)
throws DapException
{
// short circuit the scalar case
if(indices.getRank() == 0)
return Slice.SCALARSLICES;
// offset = d3*(d2*(d1*(x1))+x2)+x3
List<Slice> slices = new ArrayList<>(indices.rank);
... | java | static public List<Slice>
indexToSlices(Index indices)
throws DapException
{
// short circuit the scalar case
if(indices.getRank() == 0)
return Slice.SCALARSLICES;
// offset = d3*(d2*(d1*(x1))+x2)+x3
List<Slice> slices = new ArrayList<>(indices.rank);
... | [
"static",
"public",
"List",
"<",
"Slice",
">",
"indexToSlices",
"(",
"Index",
"indices",
")",
"throws",
"DapException",
"{",
"// short circuit the scalar case",
"if",
"(",
"indices",
".",
"getRank",
"(",
")",
"==",
"0",
")",
"return",
"Slice",
".",
"SCALARSLIC... | Given an offset (single index) and a set of dimensions
compute the set of dimension indices that correspond
to the offset. | [
"Given",
"an",
"offset",
"(",
"single",
"index",
")",
"and",
"a",
"set",
"of",
"dimensions",
"compute",
"the",
"set",
"of",
"dimension",
"indices",
"that",
"correspond",
"to",
"the",
"offset",
"."
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/dap4/d4core/src/main/java/dap4/core/util/DapUtil.java#L730-L744 | test | Convert an Index to a List of Slice objects. | Of course, here is the Java code you requested:
```java
static public List<Slice>
indexToSlices(Index indices)
throws DapException
{
// short circuit the scalar case
if(indices.getRank() == 0)
return Slice.SCALARSLICES;
// offset = d3*(d2*(d1*(x1))+x2)+x3
... |
oblac/jodd | jodd-proxetta/src/main/java/jodd/asm7/ClassWriter.java | ClassWriter.toByteArray | public byte[] toByteArray() throws ClassTooLargeException, MethodTooLargeException {
// First step: compute the size in bytes of the ClassFile structure.
// The magic field uses 4 bytes, 10 mandatory fields (minor_version, major_version,
// constant_pool_count, access_flags, this_class, super_class, interfa... | java | public byte[] toByteArray() throws ClassTooLargeException, MethodTooLargeException {
// First step: compute the size in bytes of the ClassFile structure.
// The magic field uses 4 bytes, 10 mandatory fields (minor_version, major_version,
// constant_pool_count, access_flags, this_class, super_class, interfa... | [
"public",
"byte",
"[",
"]",
"toByteArray",
"(",
")",
"throws",
"ClassTooLargeException",
",",
"MethodTooLargeException",
"{",
"// First step: compute the size in bytes of the ClassFile structure.",
"// The magic field uses 4 bytes, 10 mandatory fields (minor_version, major_version,",
"//... | Returns the content of the class file that was built by this ClassWriter.
@return the binary content of the JVMS ClassFile structure that was built by this ClassWriter.
@throws ClassTooLargeException if the constant pool of the class is too large.
@throws MethodTooLargeException if the Code attribute of a method is to... | [
"Returns",
"the",
"content",
"of",
"the",
"class",
"file",
"that",
"was",
"built",
"by",
"this",
"ClassWriter",
"."
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-proxetta/src/main/java/jodd/asm7/ClassWriter.java#L441-L663 | test | Returns the byte array representation of this class file. | Of course, here is the Java code you requested:
```java
public byte[] toByteArray() throws ClassTooLargeException, MethodTooLargeException {
// First step: compute the size in bytes of the ClassFile structure.
// The magic field uses 4 bytes, 10 mandatory fields (minor_version, major_version,
// constant_p... |
ReactiveX/RxJava | src/main/java/io/reactivex/parallel/ParallelFlowable.java | ParallelFlowable.doOnRequest | @CheckReturnValue
@NonNull
public final ParallelFlowable<T> doOnRequest(@NonNull LongConsumer onRequest) {
ObjectHelper.requireNonNull(onRequest, "onRequest is null");
return RxJavaPlugins.onAssembly(new ParallelPeek<T>(this,
Functions.emptyConsumer(),
Functions.e... | java | @CheckReturnValue
@NonNull
public final ParallelFlowable<T> doOnRequest(@NonNull LongConsumer onRequest) {
ObjectHelper.requireNonNull(onRequest, "onRequest is null");
return RxJavaPlugins.onAssembly(new ParallelPeek<T>(this,
Functions.emptyConsumer(),
Functions.e... | [
"@",
"CheckReturnValue",
"@",
"NonNull",
"public",
"final",
"ParallelFlowable",
"<",
"T",
">",
"doOnRequest",
"(",
"@",
"NonNull",
"LongConsumer",
"onRequest",
")",
"{",
"ObjectHelper",
".",
"requireNonNull",
"(",
"onRequest",
",",
"\"onRequest is null\"",
")",
";... | Call the specified consumer with the request amount if any rail receives a request.
@param onRequest the callback
@return the new ParallelFlowable instance | [
"Call",
"the",
"specified",
"consumer",
"with",
"the",
"request",
"amount",
"if",
"any",
"rail",
"receives",
"a",
"request",
"."
] | ac84182aa2bd866b53e01c8e3fe99683b882c60e | https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/parallel/ParallelFlowable.java#L692-L706 | test | Creates a parallel flowable that will consume all items from the source source. | Of course, here is the Java code you requested:
```java
@CheckReturnValue
@NonNull
public final ParallelFlowable<T> doOnRequest(@NonNull LongConsumer onRequest) {
ObjectHelper.requireNonNull(onRequest, "onRequest is null");
return RxJavaPlugins.onAssembly(new ParallelPeek<T>(this,
... |
cglib/cglib | cglib/src/main/java/net/sf/cglib/reflect/FastClassEmitter.java | FastClassEmitter.emitIndexBySignature | private void emitIndexBySignature(List methods) {
CodeEmitter e = begin_method(Constants.ACC_PUBLIC, SIGNATURE_GET_INDEX, null);
List signatures = CollectionUtils.transform(methods, new Transformer() {
public Object transform(Object obj) {
return ReflectUtils.getSignature((Me... | java | private void emitIndexBySignature(List methods) {
CodeEmitter e = begin_method(Constants.ACC_PUBLIC, SIGNATURE_GET_INDEX, null);
List signatures = CollectionUtils.transform(methods, new Transformer() {
public Object transform(Object obj) {
return ReflectUtils.getSignature((Me... | [
"private",
"void",
"emitIndexBySignature",
"(",
"List",
"methods",
")",
"{",
"CodeEmitter",
"e",
"=",
"begin_method",
"(",
"Constants",
".",
"ACC_PUBLIC",
",",
"SIGNATURE_GET_INDEX",
",",
"null",
")",
";",
"List",
"signatures",
"=",
"CollectionUtils",
".",
"tran... | TODO: support constructor indices ("<init>") | [
"TODO",
":",
"support",
"constructor",
"indices",
"(",
"<init",
">",
")"
] | cd01695c11fd3c66641b295b9596f74cf13c548b | https://github.com/cglib/cglib/blob/cd01695c11fd3c66641b295b9596f74cf13c548b/cglib/src/main/java/net/sf/cglib/reflect/FastClassEmitter.java#L112-L123 | test | Emit index by signature. | Of course, here is the Java code you requested:
```java
private void emitIndexBySignature(List methods) {
CodeEmitter e = begin_method(Constants.ACC_PUBLIC, SIGNATURE_GET_INDEX, null);
List signatures = CollectionUtils.transform(methods, new Transformer() {
public Object transform(Object ob... |
orientechnologies/orientdb | core/src/main/java/com/orientechnologies/orient/core/storage/impl/local/statistic/OSessionStoragePerformanceStatistic.java | OSessionStoragePerformanceStatistic.getAmountOfPagesWrittenInCache | public long getAmountOfPagesWrittenInCache(String componentName) {
if (componentName == null)
return performanceCountersHolder.getAmountOfPagesWrittenInCache();
final PerformanceCountersHolder cHolder = countersByComponent.get(componentName);
if (cHolder != null)
return cHolder.getAmountOfPages... | java | public long getAmountOfPagesWrittenInCache(String componentName) {
if (componentName == null)
return performanceCountersHolder.getAmountOfPagesWrittenInCache();
final PerformanceCountersHolder cHolder = countersByComponent.get(componentName);
if (cHolder != null)
return cHolder.getAmountOfPages... | [
"public",
"long",
"getAmountOfPagesWrittenInCache",
"(",
"String",
"componentName",
")",
"{",
"if",
"(",
"componentName",
"==",
"null",
")",
"return",
"performanceCountersHolder",
".",
"getAmountOfPagesWrittenInCache",
"(",
")",
";",
"final",
"PerformanceCountersHolder",
... | Amount of pages written to cache for component name of which is passed as method argument. If null value is passed then value
for whole system will be returned. If data for component with passed in name does not exist then <code>-1</code> will be
returned.
@param componentName Name of component data of which should be... | [
"Amount",
"of",
"pages",
"written",
"to",
"cache",
"for",
"component",
"name",
"of",
"which",
"is",
"passed",
"as",
"method",
"argument",
".",
"If",
"null",
"value",
"is",
"passed",
"then",
"value",
"for",
"whole",
"system",
"will",
"be",
"returned",
".",
... | d970b12033f0462f0239ea0ad8ed41207e6e26f1 | https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/core/src/main/java/com/orientechnologies/orient/core/storage/impl/local/statistic/OSessionStoragePerformanceStatistic.java#L366-L375 | test | Get the amount of pages written in cache for the specified component name. | Of course, here is the Java code you requested:
```java
public long getAmountOfPagesWrittenInCache(String componentName) {
if (componentName == null)
return performanceCountersHolder.getAmountOfPagesWrittenInCache();
final PerformanceCountersHolder cHolder = countersByComponent.get(componentName);
i... |
Unidata/thredds | cdm/src/main/java/ucar/nc2/ft/fmrc/GridDatasetInv.java | GridDatasetInv.readXML | private static GridDatasetInv readXML(byte[] xmlString) throws IOException {
InputStream is = new BufferedInputStream(new ByteArrayInputStream(xmlString));
org.jdom2.Document doc;
try {
SAXBuilder builder = new SAXBuilder();
doc = builder.build(is);
} catch (JDOMException e) {
t... | java | private static GridDatasetInv readXML(byte[] xmlString) throws IOException {
InputStream is = new BufferedInputStream(new ByteArrayInputStream(xmlString));
org.jdom2.Document doc;
try {
SAXBuilder builder = new SAXBuilder();
doc = builder.build(is);
} catch (JDOMException e) {
t... | [
"private",
"static",
"GridDatasetInv",
"readXML",
"(",
"byte",
"[",
"]",
"xmlString",
")",
"throws",
"IOException",
"{",
"InputStream",
"is",
"=",
"new",
"BufferedInputStream",
"(",
"new",
"ByteArrayInputStream",
"(",
"xmlString",
")",
")",
";",
"org",
".",
"j... | Construct a GridDatasetInv from its XML representation
@param xmlString the xml string
@return ForecastModelRun
@throws IOException on io error | [
"Construct",
"a",
"GridDatasetInv",
"from",
"its",
"XML",
"representation"
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/ft/fmrc/GridDatasetInv.java#L538-L645 | test | Reads a single XML file and returns a GridDatasetInv object. | Of course, here is the Java code you requested:
```java
private static GridDatasetInv readXML(byte[] xmlString) throws IOException {
InputStream is = new BufferedInputStream(new ByteArrayInputStream(xmlString));
org.jdom2.Document doc;
try {
SAXBuilder builder = new SAXBuilder();
doc = bui... |
dbmdz/iiif-apis | src/main/java/de/digitalcollections/iiif/model/ModelUtilities.java | ModelUtilities.getCompleteness | public static Completeness getCompleteness(Object res, Class<?> type) {
Set<Method> getters = ReflectionUtils.getAllMethods(
type,
ReflectionUtils.withModifier(Modifier.PUBLIC),
ReflectionUtils.withPrefix("get"));
Set<String> gettersWithValues = getters.stream()
.filter(g -> g.ge... | java | public static Completeness getCompleteness(Object res, Class<?> type) {
Set<Method> getters = ReflectionUtils.getAllMethods(
type,
ReflectionUtils.withModifier(Modifier.PUBLIC),
ReflectionUtils.withPrefix("get"));
Set<String> gettersWithValues = getters.stream()
.filter(g -> g.ge... | [
"public",
"static",
"Completeness",
"getCompleteness",
"(",
"Object",
"res",
",",
"Class",
"<",
"?",
">",
"type",
")",
"{",
"Set",
"<",
"Method",
">",
"getters",
"=",
"ReflectionUtils",
".",
"getAllMethods",
"(",
"type",
",",
"ReflectionUtils",
".",
"withMod... | Obtain the "completeness" (i.e. "empty", "id and type", "it, type and label", "id only" or "complex") of
a IIIF resource. Can be useful for determining how to serialize the resource, e.g. often resources with only
an id are serialized as a string.
@param res The IIIF resource to check the completeness of
@param type T... | [
"Obtain",
"the",
"completeness",
"(",
"i",
".",
"e",
".",
"empty",
"id",
"and",
"type",
"it",
"type",
"and",
"label",
"id",
"only",
"or",
"complex",
")",
"of",
"a",
"IIIF",
"resource",
".",
"Can",
"be",
"useful",
"for",
"determining",
"how",
"to",
"s... | 3e77c1044ca4bf4acabb38269c7d72af2f042fc8 | https://github.com/dbmdz/iiif-apis/blob/3e77c1044ca4bf4acabb38269c7d72af2f042fc8/src/main/java/de/digitalcollections/iiif/model/ModelUtilities.java#L35-L59 | test | Get the completion of the object | Of course, here is the Java code you requested:
```java
public static Completeness getCompleteness(Object res, Class<?> type) {
Set<Method> getters = ReflectionUtils.getAllMethods(
type,
ReflectionUtils.withModifier(Modifier.PUBLIC),
ReflectionUtils.withPrefix("get"));
Set<String> gette... |
1gravity/Android-RTEditor | RTEditor/src/main/java/com/onegravity/rteditor/RTManager.java | RTManager.onEventMainThread | @Subscribe(sticky = true, threadMode = ThreadMode.MAIN)
public void onEventMainThread(MediaEvent event) {
RTEditText editor = mEditors.get(mActiveEditor);
RTMedia media = event.getMedia();
if (editor != null && media instanceof RTImage) {
insertImage(editor, (RTImage) media);
... | java | @Subscribe(sticky = true, threadMode = ThreadMode.MAIN)
public void onEventMainThread(MediaEvent event) {
RTEditText editor = mEditors.get(mActiveEditor);
RTMedia media = event.getMedia();
if (editor != null && media instanceof RTImage) {
insertImage(editor, (RTImage) media);
... | [
"@",
"Subscribe",
"(",
"sticky",
"=",
"true",
",",
"threadMode",
"=",
"ThreadMode",
".",
"MAIN",
")",
"public",
"void",
"onEventMainThread",
"(",
"MediaEvent",
"event",
")",
"{",
"RTEditText",
"editor",
"=",
"mEditors",
".",
"get",
"(",
"mActiveEditor",
")",... | Media file was picked -> process the result. | [
"Media",
"file",
"was",
"picked",
"-",
">",
"process",
"the",
"result",
"."
] | 9d8fb4bb865b3b3d011e7633afedcdfb8d21754f | https://github.com/1gravity/Android-RTEditor/blob/9d8fb4bb865b3b3d011e7633afedcdfb8d21754f/RTEditor/src/main/java/com/onegravity/rteditor/RTManager.java#L710-L719 | test | On event main thread. | Of course, here is the Java code you requested:
```java
@Subscribe(sticky = true, threadMode = ThreadMode.MAIN)
public void onEventMainThread(MediaEvent event) {
RTEditText editor = mEditors.get(mActiveEditor);
RTMedia media = event.getMedia();
if (editor != null && media instanceof RTImage... |
fabric8io/fabric8-maven-plugin | core/src/main/java/io/fabric8/maven/core/util/kubernetes/ServiceUrlUtil.java | ServiceUrlUtil.getServiceHostAndPort | private static String getServiceHostAndPort(String serviceName, String defaultHost, String defaultPort) {
String serviceEnvVarPrefix = getServiceEnvVarPrefix(serviceName);
String hostEnvVar = serviceEnvVarPrefix + "_HOST";
String portEnvVar = serviceEnvVarPrefix + "_PORT";
String host =... | java | private static String getServiceHostAndPort(String serviceName, String defaultHost, String defaultPort) {
String serviceEnvVarPrefix = getServiceEnvVarPrefix(serviceName);
String hostEnvVar = serviceEnvVarPrefix + "_HOST";
String portEnvVar = serviceEnvVarPrefix + "_PORT";
String host =... | [
"private",
"static",
"String",
"getServiceHostAndPort",
"(",
"String",
"serviceName",
",",
"String",
"defaultHost",
",",
"String",
"defaultPort",
")",
"{",
"String",
"serviceEnvVarPrefix",
"=",
"getServiceEnvVarPrefix",
"(",
"serviceName",
")",
";",
"String",
"hostEnv... | Returns the service host and port for the given environment variable name.
@param serviceName the name of the service which is used as a prefix to access the <code>${serviceName}_SERVICE_HOST</code> and <code>${serviceName}_SERVICE_PORT</code> environment variables to find the hos and port
@param defaultHost the defau... | [
"Returns",
"the",
"service",
"host",
"and",
"port",
"for",
"the",
"given",
"environment",
"variable",
"name",
"."
] | b0e7ad860a5bbe4ab71be3d0613862a1f14a8be3 | https://github.com/fabric8io/fabric8-maven-plugin/blob/b0e7ad860a5bbe4ab71be3d0613862a1f14a8be3/core/src/main/java/io/fabric8/maven/core/util/kubernetes/ServiceUrlUtil.java#L320-L330 | test | Get the host and port from the service name. | Of course, here is the Java code you requested:
```java
private static String getServiceHostAndPort(String serviceName, String defaultHost, String defaultPort) {
String serviceEnvVarPrefix = getServiceEnvVarPrefix(serviceName);
String hostEnvVar = serviceEnvVarPrefix + "_HOST";
String portEnvVa... |
rupertlssmith/lojix | base/common/src/main/com/thesett/common/util/queues/Queues.java | Queues.getTransactionalQueue | public static <E> Queue<E> getTransactionalQueue(java.util.Queue<E> queue)
{
return new WrapperQueue<E>(queue, new LinkedList<E>(), true, false, false);
} | java | public static <E> Queue<E> getTransactionalQueue(java.util.Queue<E> queue)
{
return new WrapperQueue<E>(queue, new LinkedList<E>(), true, false, false);
} | [
"public",
"static",
"<",
"E",
">",
"Queue",
"<",
"E",
">",
"getTransactionalQueue",
"(",
"java",
".",
"util",
".",
"Queue",
"<",
"E",
">",
"queue",
")",
"{",
"return",
"new",
"WrapperQueue",
"<",
"E",
">",
"(",
"queue",
",",
"new",
"LinkedList",
"<",... | Provides a transactional queue, that delays all queue manipulation operations until the transaction is committed,
or erases them if it is rolled back.
@param queue The queue to make transactional.
@param <E> The type of queue element.
@return A transactional queue. | [
"Provides",
"a",
"transactional",
"queue",
"that",
"delays",
"all",
"queue",
"manipulation",
"operations",
"until",
"the",
"transaction",
"is",
"committed",
"or",
"erases",
"them",
"if",
"it",
"is",
"rolled",
"back",
"."
] | ad494dc8bce2345567de7689d42291d4b30fbd51 | https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/base/common/src/main/com/thesett/common/util/queues/Queues.java#L143-L146 | test | Gets a transactional queue. | Of course, here is the Java code you requested:
```java
public static <E> Queue<E> getTransactionalQueue(java.util.Queue<E> queue)
{
return new WrapperQueue<E>(queue, new LinkedList<E>(), true, false, false);
}
```
Hope this helps! |
rupertlssmith/lojix | lojix/wam_prolog/src/main/com/thesett/aima/logic/fol/wam/machine/WAMResolvingMachine.java | WAMResolvingMachine.emmitCode | public void emmitCode(WAMCompiledPredicate predicate) throws LinkageException
{
// Keep track of the offset into which the code was loaded.
int entryPoint = codeBuffer.position();
int length = (int) predicate.sizeof();
// If the code is for a program clause, store the programs entry... | java | public void emmitCode(WAMCompiledPredicate predicate) throws LinkageException
{
// Keep track of the offset into which the code was loaded.
int entryPoint = codeBuffer.position();
int length = (int) predicate.sizeof();
// If the code is for a program clause, store the programs entry... | [
"public",
"void",
"emmitCode",
"(",
"WAMCompiledPredicate",
"predicate",
")",
"throws",
"LinkageException",
"{",
"// Keep track of the offset into which the code was loaded.",
"int",
"entryPoint",
"=",
"codeBuffer",
".",
"position",
"(",
")",
";",
"int",
"length",
"=",
... | {@inheritDoc} | [
"{"
] | ad494dc8bce2345567de7689d42291d4b30fbd51 | https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/wam_prolog/src/main/com/thesett/aima/logic/fol/wam/machine/WAMResolvingMachine.java#L89-L109 | test | Emmit code for a WAM compiled predicate. | Of course, here is the Java code you requested:
```java
public void emmitCode(WAMCompiledPredicate predicate) throws LinkageException
{
// Keep track of the offset into which the code was loaded.
int entryPoint = codeBuffer.position();
int length = (int) predicate.sizeof();
// If t... |
playframework/playframework | core/play/src/main/java/play/http/HttpEntity.java | HttpEntity.chunked | public static final HttpEntity chunked(Source<ByteString, ?> data, Optional<String> contentType) {
return new Chunked(data.map(HttpChunk.Chunk::new), contentType);
} | java | public static final HttpEntity chunked(Source<ByteString, ?> data, Optional<String> contentType) {
return new Chunked(data.map(HttpChunk.Chunk::new), contentType);
} | [
"public",
"static",
"final",
"HttpEntity",
"chunked",
"(",
"Source",
"<",
"ByteString",
",",
"?",
">",
"data",
",",
"Optional",
"<",
"String",
">",
"contentType",
")",
"{",
"return",
"new",
"Chunked",
"(",
"data",
".",
"map",
"(",
"HttpChunk",
".",
"Chun... | Convert the given source of ByteStrings to a chunked entity.
@param data The source.
@param contentType The optional content type.
@return The ByteStrings. | [
"Convert",
"the",
"given",
"source",
"of",
"ByteStrings",
"to",
"a",
"chunked",
"entity",
"."
] | 3c46dca803d24e715d85de678c59dcfac9525a00 | https://github.com/playframework/playframework/blob/3c46dca803d24e715d85de678c59dcfac9525a00/core/play/src/main/java/play/http/HttpEntity.java#L100-L102 | test | Creates a new chunked entity from the given data. | Of course, here is the Java code you requested:
```java
public static final HttpEntity chunked(Source<ByteString, ?> data, Optional<String> contentType) {
return new Chunked(data.map(HttpChunk.Chunk::new), contentType);
}
```
Hope this helps! |
ngageoint/geopackage-android | geopackage-sdk/src/main/java/mil/nga/geopackage/tiles/user/TileDao.java | TileDao.count | public int count(long zoomLevel) {
String where = buildWhere(TileTable.COLUMN_ZOOM_LEVEL, zoomLevel);
String[] whereArgs = buildWhereArgs(zoomLevel);
return count(where, whereArgs);
} | java | public int count(long zoomLevel) {
String where = buildWhere(TileTable.COLUMN_ZOOM_LEVEL, zoomLevel);
String[] whereArgs = buildWhereArgs(zoomLevel);
return count(where, whereArgs);
} | [
"public",
"int",
"count",
"(",
"long",
"zoomLevel",
")",
"{",
"String",
"where",
"=",
"buildWhere",
"(",
"TileTable",
".",
"COLUMN_ZOOM_LEVEL",
",",
"zoomLevel",
")",
";",
"String",
"[",
"]",
"whereArgs",
"=",
"buildWhereArgs",
"(",
"zoomLevel",
")",
";",
... | Count of Tiles at a zoom level
@param zoomLevel zoom level
@return count | [
"Count",
"of",
"Tiles",
"at",
"a",
"zoom",
"level"
] | d19e9fcc636462c0f0ae1b7eca4acafae48de21b | https://github.com/ngageoint/geopackage-android/blob/d19e9fcc636462c0f0ae1b7eca4acafae48de21b/geopackage-sdk/src/main/java/mil/nga/geopackage/tiles/user/TileDao.java#L544-L548 | test | Count the number of tiles in the specified zoom level. | Of course, here is the Java code you requested:
```java
public int count(long zoomLevel) {
String where = buildWhere(TileTable.COLUMN_ZOOM_LEVEL, zoomLevel);
String[] whereArgs = buildWhereArgs(zoomLevel);
return count(where, whereArgs);
}
```
Hope this helps! |
oblac/jodd | jodd-proxetta/src/main/java/jodd/methref/Methref.java | Methref.ref | public String ref(final Object dummy) {
if (dummy != null) {
if (dummy instanceof String) {
return (String) dummy;
}
throw new MethrefException("Target method not collected");
}
return ref();
} | java | public String ref(final Object dummy) {
if (dummy != null) {
if (dummy instanceof String) {
return (String) dummy;
}
throw new MethrefException("Target method not collected");
}
return ref();
} | [
"public",
"String",
"ref",
"(",
"final",
"Object",
"dummy",
")",
"{",
"if",
"(",
"dummy",
"!=",
"null",
")",
"{",
"if",
"(",
"dummy",
"instanceof",
"String",
")",
"{",
"return",
"(",
"String",
")",
"dummy",
";",
"}",
"throw",
"new",
"MethrefException",... | Resolves method name of method reference. Argument is used so {@link #to()}
can be called in convenient way. For methods that returns string,
value will be returned immediately. | [
"Resolves",
"method",
"name",
"of",
"method",
"reference",
".",
"Argument",
"is",
"used",
"so",
"{"
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-proxetta/src/main/java/jodd/methref/Methref.java#L130-L138 | test | Returns a reference to a dummy object. | Of course, here is the Java code you requested:
```java
public String ref(final Object dummy) {
if (dummy != null) {
if (dummy instanceof String) {
return (String) dummy;
}
throw new MethrefException("Target method not collected");
}
return ref();
}
```
Hope this helps! |
wildfly/wildfly | ee/src/main/java/org/jboss/as/ee/component/interceptors/InterceptorClassDescription.java | InterceptorClassDescription.merge | public static InterceptorClassDescription merge(InterceptorClassDescription existing, InterceptorClassDescription override) {
if (existing == null && override == null) {
return EMPTY_INSTANCE;
}
if (override == null) {
return existing;
}
if (existing == nu... | java | public static InterceptorClassDescription merge(InterceptorClassDescription existing, InterceptorClassDescription override) {
if (existing == null && override == null) {
return EMPTY_INSTANCE;
}
if (override == null) {
return existing;
}
if (existing == nu... | [
"public",
"static",
"InterceptorClassDescription",
"merge",
"(",
"InterceptorClassDescription",
"existing",
",",
"InterceptorClassDescription",
"override",
")",
"{",
"if",
"(",
"existing",
"==",
"null",
"&&",
"override",
"==",
"null",
")",
"{",
"return",
"EMPTY_INSTAN... | Merges two descriptors, either of the parameters will be null.
<p/>
this method will never return null;
@param existing
@param override
@return | [
"Merges",
"two",
"descriptors",
"either",
"of",
"the",
"parameters",
"will",
"be",
"null",
".",
"<p",
"/",
">",
"this",
"method",
"will",
"never",
"return",
"null",
";"
] | 64896f1500fe465ad83d96ede9fa19d0c3747f18 | https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/ee/src/main/java/org/jboss/as/ee/component/interceptors/InterceptorClassDescription.java#L61-L94 | test | Merge two InterceptorClassDescriptions. | Of course, here is the Java code you requested:
```java
public static InterceptorClassDescription merge(InterceptorClassDescription existing, InterceptorClassDescription override) {
if (existing == null && override == null) {
return EMPTY_INSTANCE;
}
if (override == null) {
... |
Unidata/thredds | cdm/src/main/java/ucar/nc2/ft2/coverage/HorizCoordSys.java | HorizCoordSys.calcConnectedLatLonBoundaryPoints | public List<LatLonPointNoNormalize> calcConnectedLatLonBoundaryPoints(int maxPointsInYEdge, int maxPointsInXEdge) {
List<LatLonPoint> points;
if (isProjection) {
points = calcLatLonBoundaryPointsFromProjection(maxPointsInYEdge, maxPointsInXEdge);
} else if (isLatLon1D) {
points = calcLatLon1DBo... | java | public List<LatLonPointNoNormalize> calcConnectedLatLonBoundaryPoints(int maxPointsInYEdge, int maxPointsInXEdge) {
List<LatLonPoint> points;
if (isProjection) {
points = calcLatLonBoundaryPointsFromProjection(maxPointsInYEdge, maxPointsInXEdge);
} else if (isLatLon1D) {
points = calcLatLon1DBo... | [
"public",
"List",
"<",
"LatLonPointNoNormalize",
">",
"calcConnectedLatLonBoundaryPoints",
"(",
"int",
"maxPointsInYEdge",
",",
"int",
"maxPointsInXEdge",
")",
"{",
"List",
"<",
"LatLonPoint",
">",
"points",
";",
"if",
"(",
"isProjection",
")",
"{",
"points",
"=",... | Calculates the latitude/longitude boundary of this coordinate reference system. The boundary starts at the lower
left corner of the coverage--i.e. {@code (y[0], x[0])}--and consists of the points that lie along the bottom,
right, top, and left edges, in that order.
<p>
The {@code maxPointsInYEdge} parameter establishes... | [
"Calculates",
"the",
"latitude",
"/",
"longitude",
"boundary",
"of",
"this",
"coordinate",
"reference",
"system",
".",
"The",
"boundary",
"starts",
"at",
"the",
"lower",
"left",
"corner",
"of",
"the",
"coverage",
"--",
"i",
".",
"e",
".",
"{",
"@code",
"("... | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/ft2/coverage/HorizCoordSys.java#L492-L506 | test | Calculate the connected lat lon boundary points. | Of course, here is the Java code you requested:
```java
public List<LatLonPointNoNormalize> calcConnectedLatLonBoundaryPoints(int maxPointsInYEdge, int maxPointsInXEdge) {
List<LatLonPoint> points;
if (isProjection) {
points = calcLatLonBoundaryPointsFromProjection(maxPointsInYEdge, maxPointsInXEdge);
... |
fracpete/ptstemmer-weka-package | src/main/java/weka/core/stemmers/PTStemmer.java | PTStemmer.setStemmer | public void setStemmer(SelectedTag value) {
if (value.getTags() == TAGS_STEMMERS) {
m_Stemmer = value.getSelectedTag().getID();
invalidate();
}
} | java | public void setStemmer(SelectedTag value) {
if (value.getTags() == TAGS_STEMMERS) {
m_Stemmer = value.getSelectedTag().getID();
invalidate();
}
} | [
"public",
"void",
"setStemmer",
"(",
"SelectedTag",
"value",
")",
"{",
"if",
"(",
"value",
".",
"getTags",
"(",
")",
"==",
"TAGS_STEMMERS",
")",
"{",
"m_Stemmer",
"=",
"value",
".",
"getSelectedTag",
"(",
")",
".",
"getID",
"(",
")",
";",
"invalidate",
... | Sets the stemmer type to use
@param value the type | [
"Sets",
"the",
"stemmer",
"type",
"to",
"use"
] | 58a038cff07e7bef2519bc9c2a2d641f0073bd6a | https://github.com/fracpete/ptstemmer-weka-package/blob/58a038cff07e7bef2519bc9c2a2d641f0073bd6a/src/main/java/weka/core/stemmers/PTStemmer.java#L267-L272 | test | Sets the stemmer. | Of course, here is the Java code you requested:
```java
public void setStemmer(SelectedTag value) {
if (value.getTags() == TAGS_STEMMERS) {
m_Stemmer = value.getSelectedTag().getID();
invalidate();
}
}
```
Hope this helps! |
wildfly/wildfly | legacy/jacorb/src/main/java/org/jboss/as/jacorb/JacORBSubsystemParser.java | JacORBSubsystemParser.parseAttributes | private void parseAttributes(XMLExtendedStreamReader reader, ModelNode node, EnumSet<Attribute> expectedAttributes,
EnumSet<Attribute> requiredAttributes) throws XMLStreamException {
EnumSet<Attribute> parsedAttributes = EnumSet.noneOf(Attribute.class);
if (requiredAttr... | java | private void parseAttributes(XMLExtendedStreamReader reader, ModelNode node, EnumSet<Attribute> expectedAttributes,
EnumSet<Attribute> requiredAttributes) throws XMLStreamException {
EnumSet<Attribute> parsedAttributes = EnumSet.noneOf(Attribute.class);
if (requiredAttr... | [
"private",
"void",
"parseAttributes",
"(",
"XMLExtendedStreamReader",
"reader",
",",
"ModelNode",
"node",
",",
"EnumSet",
"<",
"Attribute",
">",
"expectedAttributes",
",",
"EnumSet",
"<",
"Attribute",
">",
"requiredAttributes",
")",
"throws",
"XMLStreamException",
"{"... | <p>
Parses all attributes from the current element and sets them in the specified {@code ModelNode}.
</p>
@param reader the {@code XMLExtendedStreamReader} used to read the configuration XML.
@param node the {@code ModelNode} that will hold the parsed attributes.
@param expectedAttributes an ... | [
"<p",
">",
"Parses",
"all",
"attributes",
"from",
"the",
"current",
"element",
"and",
"sets",
"them",
"in",
"the",
"specified",
"{",
"@code",
"ModelNode",
"}",
".",
"<",
"/",
"p",
">"
] | 64896f1500fe465ad83d96ede9fa19d0c3747f18 | https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/legacy/jacorb/src/main/java/org/jboss/as/jacorb/JacORBSubsystemParser.java#L743-L771 | test | Parses the attributes of the resource. | Of course, here is the Java code you requested:
```java
private void parseAttributes(XMLExtendedStreamReader reader, ModelNode node, EnumSet<Attribute> expectedAttributes,
EnumSet<Attribute> requiredAttributes) throws XMLStreamException {
EnumSet<Attribute> parsedAttributes = ... |
ReactiveX/RxJava | src/main/java/io/reactivex/Maybe.java | Maybe.switchIfEmpty | @CheckReturnValue
@NonNull
@SchedulerSupport(SchedulerSupport.NONE)
public final Single<T> switchIfEmpty(SingleSource<? extends T> other) {
ObjectHelper.requireNonNull(other, "other is null");
return RxJavaPlugins.onAssembly(new MaybeSwitchIfEmptySingle<T>(this, other));
} | java | @CheckReturnValue
@NonNull
@SchedulerSupport(SchedulerSupport.NONE)
public final Single<T> switchIfEmpty(SingleSource<? extends T> other) {
ObjectHelper.requireNonNull(other, "other is null");
return RxJavaPlugins.onAssembly(new MaybeSwitchIfEmptySingle<T>(this, other));
} | [
"@",
"CheckReturnValue",
"@",
"NonNull",
"@",
"SchedulerSupport",
"(",
"SchedulerSupport",
".",
"NONE",
")",
"public",
"final",
"Single",
"<",
"T",
">",
"switchIfEmpty",
"(",
"SingleSource",
"<",
"?",
"extends",
"T",
">",
"other",
")",
"{",
"ObjectHelper",
"... | Returns a Single that emits the items emitted by the source Maybe or the item of an alternate
SingleSource if the current Maybe is empty.
<p>
<img width="640" height="445" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/switchifempty.m.png" alt="">
<dl>
<dt><b>Scheduler:</b></dt>
<dd>{@code switch... | [
"Returns",
"a",
"Single",
"that",
"emits",
"the",
"items",
"emitted",
"by",
"the",
"source",
"Maybe",
"or",
"the",
"item",
"of",
"an",
"alternate",
"SingleSource",
"if",
"the",
"current",
"Maybe",
"is",
"empty",
".",
"<p",
">",
"<img",
"width",
"=",
"640... | ac84182aa2bd866b53e01c8e3fe99683b882c60e | https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Maybe.java#L4403-L4409 | test | Switch the source Single to Single if it is empty. | Of course, here is the Java code you requested:
```java
@CheckReturnValue
@NonNull
@SchedulerSupport(SchedulerSupport.NONE)
public final Single<T> switchIfEmpty(SingleSource<? extends T> other) {
ObjectHelper.requireNonNull(other, "other is null");
return RxJavaPlugins.onAssembly(new MaybeS... |
fuinorg/srcgen4j-core | src/main/java/org/fuin/srcgen4j/core/emf/AbstractEMFParser.java | AbstractEMFParser.setModelDirs | protected final void setModelDirs(final File... modelDirs) {
if (modelDirs == null) {
this.modelDirs = null;
} else {
this.modelDirs = new ArrayList<File>();
this.modelDirs.addAll(Arrays.asList(modelDirs));
}
} | java | protected final void setModelDirs(final File... modelDirs) {
if (modelDirs == null) {
this.modelDirs = null;
} else {
this.modelDirs = new ArrayList<File>();
this.modelDirs.addAll(Arrays.asList(modelDirs));
}
} | [
"protected",
"final",
"void",
"setModelDirs",
"(",
"final",
"File",
"...",
"modelDirs",
")",
"{",
"if",
"(",
"modelDirs",
"==",
"null",
")",
"{",
"this",
".",
"modelDirs",
"=",
"null",
";",
"}",
"else",
"{",
"this",
".",
"modelDirs",
"=",
"new",
"Array... | Sets the model directories to parse. If no list exists internally, it will be created if necessary.
@param modelDirs
Array of model directories or NULL. | [
"Sets",
"the",
"model",
"directories",
"to",
"parse",
".",
"If",
"no",
"list",
"exists",
"internally",
"it",
"will",
"be",
"created",
"if",
"necessary",
"."
] | da2bc58370993e6294ddc4eb7e696fe255f979db | https://github.com/fuinorg/srcgen4j-core/blob/da2bc58370993e6294ddc4eb7e696fe255f979db/src/main/java/org/fuin/srcgen4j/core/emf/AbstractEMFParser.java#L375-L382 | test | Sets the modelDirs property. | Of course, here is the Java code you requested:
```java
protected final void setModelDirs(final File... modelDirs) {
if (modelDirs == null) {
this.modelDirs = null;
} else {
this.modelDirs = new ArrayList<File>();
this.modelDirs.addAll(Arrays.asList(modelDirs));... |
Unidata/thredds | legacy/src/main/java/thredds/crawlabledataset/CrawlableDatasetFactory.java | CrawlableDatasetFactory.normalizePath | public static String normalizePath( String path )
{
// Replace any occurance of a backslash ("\") with a slash ("/").
// NOTE: Both String and Pattern escape backslash, so need four backslashes to find one.
// NOTE: No longer replace multiple backslashes with one slash, which allows for UNC pathnames (Win... | java | public static String normalizePath( String path )
{
// Replace any occurance of a backslash ("\") with a slash ("/").
// NOTE: Both String and Pattern escape backslash, so need four backslashes to find one.
// NOTE: No longer replace multiple backslashes with one slash, which allows for UNC pathnames (Win... | [
"public",
"static",
"String",
"normalizePath",
"(",
"String",
"path",
")",
"{",
"// Replace any occurance of a backslash (\"\\\") with a slash (\"/\").",
"// NOTE: Both String and Pattern escape backslash, so need four backslashes to find one.",
"// NOTE: No longer replace multiple backslashes... | Normalize the given path so that it can be used in the creation of a CrawlableDataset.
This method can be used on absolute or relative paths.
Normal uses slashes ("/") as path seperator, not backslashes ("\"), and does
not use trailing slashes. This function allows users to specify Windows
pathnames and UNC pathnames ... | [
"Normalize",
"the",
"given",
"path",
"so",
"that",
"it",
"can",
"be",
"used",
"in",
"the",
"creation",
"of",
"a",
"CrawlableDataset",
".",
"This",
"method",
"can",
"be",
"used",
"on",
"absolute",
"or",
"relative",
"paths",
"."
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/legacy/src/main/java/thredds/crawlabledataset/CrawlableDatasetFactory.java#L112-L125 | test | Normalize the path. | Of course, here is the Java code you requested:
```java
public static String normalizePath( String path )
{
// Replace any occurance of a backslash ("\") with a slash ("/").
// NOTE: Both String and Pattern escape backslash, so need four backslashes to find one.
// NOTE: No longer replace multiple backsl... |
ReactiveX/RxJava | src/main/java/io/reactivex/Completable.java | Completable.toMaybe | @CheckReturnValue
@SuppressWarnings("unchecked")
@SchedulerSupport(SchedulerSupport.NONE)
public final <T> Maybe<T> toMaybe() {
if (this instanceof FuseToMaybe) {
return ((FuseToMaybe<T>)this).fuseToMaybe();
}
return RxJavaPlugins.onAssembly(new MaybeFromCompletable<T>(th... | java | @CheckReturnValue
@SuppressWarnings("unchecked")
@SchedulerSupport(SchedulerSupport.NONE)
public final <T> Maybe<T> toMaybe() {
if (this instanceof FuseToMaybe) {
return ((FuseToMaybe<T>)this).fuseToMaybe();
}
return RxJavaPlugins.onAssembly(new MaybeFromCompletable<T>(th... | [
"@",
"CheckReturnValue",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"@",
"SchedulerSupport",
"(",
"SchedulerSupport",
".",
"NONE",
")",
"public",
"final",
"<",
"T",
">",
"Maybe",
"<",
"T",
">",
"toMaybe",
"(",
")",
"{",
"if",
"(",
"this",
"instanc... | Converts this Completable into a {@link Maybe}.
<p>
<img width="640" height="585" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/Completable.toMaybe.png" alt="">
<dl>
<dt><b>Scheduler:</b></dt>
<dd>{@code toMaybe} does not operate by default on a particular {@link Scheduler}.</dd>
</dl>
@param <... | [
"Converts",
"this",
"Completable",
"into",
"a",
"{",
"@link",
"Maybe",
"}",
".",
"<p",
">",
"<img",
"width",
"=",
"640",
"height",
"=",
"585",
"src",
"=",
"https",
":",
"//",
"raw",
".",
"github",
".",
"com",
"/",
"wiki",
"/",
"ReactiveX",
"/",
"Rx... | ac84182aa2bd866b53e01c8e3fe99683b882c60e | https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Completable.java#L2642-L2650 | test | Converts a complete object to a Maybe. | Of course, here is the Java code you requested:
```java
@CheckReturnValue
@SuppressWarnings("unchecked")
@SchedulerSupport(SchedulerSupport.NONE)
public final <T> Maybe<T> toMaybe() {
if (this instanceof FuseToMaybe) {
return ((FuseToMaybe<T>)this).fuseToMaybe();
}
retur... |
medcl/elasticsearch-analysis-ik | src/main/java/org/wltea/analyzer/dic/Dictionary.java | Dictionary.matchInQuantifierDict | public Hit matchInQuantifierDict(char[] charArray, int begin, int length) {
return singleton._QuantifierDict.match(charArray, begin, length);
} | java | public Hit matchInQuantifierDict(char[] charArray, int begin, int length) {
return singleton._QuantifierDict.match(charArray, begin, length);
} | [
"public",
"Hit",
"matchInQuantifierDict",
"(",
"char",
"[",
"]",
"charArray",
",",
"int",
"begin",
",",
"int",
"length",
")",
"{",
"return",
"singleton",
".",
"_QuantifierDict",
".",
"match",
"(",
"charArray",
",",
"begin",
",",
"length",
")",
";",
"}"
] | 检索匹配量词词典
@return Hit 匹配结果描述 | [
"检索匹配量词词典"
] | a1d6ba8ca206d750e68bbf3e53a25284100174bd | https://github.com/medcl/elasticsearch-analysis-ik/blob/a1d6ba8ca206d750e68bbf3e53a25284100174bd/src/main/java/org/wltea/analyzer/dic/Dictionary.java#L357-L359 | test | Returns true if the specified range of characters is in the quantifier dictionary. | Of course, here is the Java code you requested:
```java
public Hit matchInQuantifierDict(char[] charArray, int begin, int length) {
return singleton._QuantifierDict.match(charArray, begin, length);
}
```
Hope this helps! |
OpenEstate/OpenEstate-IO | Core/src/main/java/org/openestate/io/core/XmlUtils.java | XmlUtils.countNodes | public static int countNodes(String xpathExpression, Document doc) throws JaxenException {
return XmlUtils.countNodes(xpathExpression, doc, doc);
} | java | public static int countNodes(String xpathExpression, Document doc) throws JaxenException {
return XmlUtils.countNodes(xpathExpression, doc, doc);
} | [
"public",
"static",
"int",
"countNodes",
"(",
"String",
"xpathExpression",
",",
"Document",
"doc",
")",
"throws",
"JaxenException",
"{",
"return",
"XmlUtils",
".",
"countNodes",
"(",
"xpathExpression",
",",
"doc",
",",
"doc",
")",
";",
"}"
] | Count the number of nodes, that are matching against an XPath expression.
@param xpathExpression the XPath expression to match
@param doc the document, on which the XPath expression is evaluated
@return number of matching nodes
@throws JaxenException if the XPath evaluation failed | [
"Count",
"the",
"number",
"of",
"nodes",
"that",
"are",
"matching",
"against",
"an",
"XPath",
"expression",
"."
] | f961dae78f40823f05a8c0d4e59d639e718aa18a | https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/Core/src/main/java/org/openestate/io/core/XmlUtils.java#L101-L103 | test | Count the number of nodes matching the XPath expression. | Of course, here is the Java code you requested:
```java
public static int countNodes(String xpathExpression, Document doc) throws JaxenException {
return XmlUtils.countNodes(xpathExpression, doc, doc);
}
```
Hope this helps! |
Unidata/thredds | cdm/src/main/java/ucar/util/prefs/PreferencesExt.java | PreferencesExt.keysSpi | protected Collection keysSpi(String nodePath) {
HashSet allKeys = new HashSet();
try {
if (nodeExists( nodePath)) {
PreferencesExt node = (PreferencesExt) node( nodePath);
//show( "subKeys1 "+nodePath, node.keyValues.keySet());
allKeys.addAll( node.keyValues.keySet());
... | java | protected Collection keysSpi(String nodePath) {
HashSet allKeys = new HashSet();
try {
if (nodeExists( nodePath)) {
PreferencesExt node = (PreferencesExt) node( nodePath);
//show( "subKeys1 "+nodePath, node.keyValues.keySet());
allKeys.addAll( node.keyValues.keySet());
... | [
"protected",
"Collection",
"keysSpi",
"(",
"String",
"nodePath",
")",
"{",
"HashSet",
"allKeys",
"=",
"new",
"HashSet",
"(",
")",
";",
"try",
"{",
"if",
"(",
"nodeExists",
"(",
"nodePath",
")",
")",
"{",
"PreferencesExt",
"node",
"=",
"(",
"PreferencesExt"... | /* Find all keys of named node (or of identically named nodes in
storedDefaults) | [
"/",
"*",
"Find",
"all",
"keys",
"of",
"named",
"node",
"(",
"or",
"of",
"identically",
"named",
"nodes",
"in",
"storedDefaults",
")"
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/util/prefs/PreferencesExt.java#L276-L293 | test | Returns the keys of the node with the given path. | Of course, here is the Java code you requested:
```java
protected Collection keysSpi(String nodePath) {
HashSet allKeys = new HashSet();
try {
if (nodeExists( nodePath)) {
PreferencesExt node = (PreferencesExt) node( nodePath);
//show( "subKeys1 "+nodePath, node.keyValues.keySet... |
eclipse/packagedrone | bundles/org.apache.jasper.glassfish/src/org/apache/jasper/compiler/Generator.java | Generator.compileTagHandlerPoolList | private void compileTagHandlerPoolList(Node.Nodes page)
throws JasperException {
class TagHandlerPoolVisitor extends Node.Visitor {
private Set<String> names = new HashSet<String>();
/*
* Constructor
*
* @param v Set of tag handler pool n... | java | private void compileTagHandlerPoolList(Node.Nodes page)
throws JasperException {
class TagHandlerPoolVisitor extends Node.Visitor {
private Set<String> names = new HashSet<String>();
/*
* Constructor
*
* @param v Set of tag handler pool n... | [
"private",
"void",
"compileTagHandlerPoolList",
"(",
"Node",
".",
"Nodes",
"page",
")",
"throws",
"JasperException",
"{",
"class",
"TagHandlerPoolVisitor",
"extends",
"Node",
".",
"Visitor",
"{",
"private",
"Set",
"<",
"String",
">",
"names",
"=",
"new",
"HashSe... | Compiles list of tag handler pool names. | [
"Compiles",
"list",
"of",
"tag",
"handler",
"pool",
"names",
"."
] | 3869c1643cdc6f7cb8b26097a7b6994683b13d7e | https://github.com/eclipse/packagedrone/blob/3869c1643cdc6f7cb8b26097a7b6994683b13d7e/bundles/org.apache.jasper.glassfish/src/org/apache/jasper/compiler/Generator.java#L253-L323 | test | Compile tag handler pool list. | Of course, here is the Java code you requested:
```java
private void compileTagHandlerPoolList(Node.Nodes page)
throws JasperException {
class TagHandlerPoolVisitor extends Node.Visitor {
private Set<String> names = new HashSet<String>();
/*
* Constructor
... |
orientechnologies/orientdb | client/src/main/java/com/orientechnologies/orient/client/remote/OServerAdmin.java | OServerAdmin.getServerInfo | @Deprecated
public synchronized ODocument getServerInfo() throws IOException {
OServerInfoRequest request = new OServerInfoRequest();
OServerInfoResponse response = networkAdminOperation(request, "Cannot retrieve server information");
ODocument res = new ODocument();
res.fromJSON(response.getResu... | java | @Deprecated
public synchronized ODocument getServerInfo() throws IOException {
OServerInfoRequest request = new OServerInfoRequest();
OServerInfoResponse response = networkAdminOperation(request, "Cannot retrieve server information");
ODocument res = new ODocument();
res.fromJSON(response.getResu... | [
"@",
"Deprecated",
"public",
"synchronized",
"ODocument",
"getServerInfo",
"(",
")",
"throws",
"IOException",
"{",
"OServerInfoRequest",
"request",
"=",
"new",
"OServerInfoRequest",
"(",
")",
";",
"OServerInfoResponse",
"response",
"=",
"networkAdminOperation",
"(",
"... | Returns the server information in form of document.
@throws IOException | [
"Returns",
"the",
"server",
"information",
"in",
"form",
"of",
"document",
"."
] | d970b12033f0462f0239ea0ad8ed41207e6e26f1 | https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/client/src/main/java/com/orientechnologies/orient/client/remote/OServerAdmin.java#L164-L171 | test | Retrieves the server information. | Of course, here is the Java code you requested:
```java
@Deprecated
public synchronized ODocument getServerInfo() throws IOException {
OServerInfoRequest request = new OServerInfoRequest();
OServerInfoResponse response = networkAdminOperation(request, "Cannot retrieve server information");
ODocument ... |
PistoiaHELM/HELMNotationParser | src/main/java/org/helm/notation2/parser/notation/polymer/MonomerNotationGroupOr.java | MonomerNotationGroupOr.toHELM2 | @Override
public String toHELM2() {
StringBuilder notation = new StringBuilder();
DecimalFormat d = new DecimalFormat("#.##");
notation.append("(");
for (int i = 0; i < elements.size(); i++) {
String text = elements.get(i).getMonomerNotation().getUnit();
if (!(elements.get(i).isDefa... | java | @Override
public String toHELM2() {
StringBuilder notation = new StringBuilder();
DecimalFormat d = new DecimalFormat("#.##");
notation.append("(");
for (int i = 0; i < elements.size(); i++) {
String text = elements.get(i).getMonomerNotation().getUnit();
if (!(elements.get(i).isDefa... | [
"@",
"Override",
"public",
"String",
"toHELM2",
"(",
")",
"{",
"StringBuilder",
"notation",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"DecimalFormat",
"d",
"=",
"new",
"DecimalFormat",
"(",
"\"#.##\"",
")",
";",
"notation",
".",
"append",
"(",
"\"(\"",
"... | {@inheritDoc} | [
"{"
] | 685d7ab7886e9b5cc15fb904025fe6eee703f8f6 | https://github.com/PistoiaHELM/HELMNotationParser/blob/685d7ab7886e9b5cc15fb904025fe6eee703f8f6/src/main/java/org/helm/notation2/parser/notation/polymer/MonomerNotationGroupOr.java#L87-L122 | test | Converts the HELM to HELM 2 format. | Of course, here is the Java code you requested:
```java
@Override
public String toHELM2() {
StringBuilder notation = new StringBuilder();
DecimalFormat d = new DecimalFormat("#.##");
notation.append("(");
for (int i = 0; i < elements.size(); i++) {
String text = elements.get(i).getMonomer... |
ReactiveX/RxJava | src/main/java/io/reactivex/Single.java | Single.doOnDispose | @CheckReturnValue
@NonNull
@SchedulerSupport(SchedulerSupport.NONE)
public final Single<T> doOnDispose(final Action onDispose) {
ObjectHelper.requireNonNull(onDispose, "onDispose is null");
return RxJavaPlugins.onAssembly(new SingleDoOnDispose<T>(this, onDispose));
} | java | @CheckReturnValue
@NonNull
@SchedulerSupport(SchedulerSupport.NONE)
public final Single<T> doOnDispose(final Action onDispose) {
ObjectHelper.requireNonNull(onDispose, "onDispose is null");
return RxJavaPlugins.onAssembly(new SingleDoOnDispose<T>(this, onDispose));
} | [
"@",
"CheckReturnValue",
"@",
"NonNull",
"@",
"SchedulerSupport",
"(",
"SchedulerSupport",
".",
"NONE",
")",
"public",
"final",
"Single",
"<",
"T",
">",
"doOnDispose",
"(",
"final",
"Action",
"onDispose",
")",
"{",
"ObjectHelper",
".",
"requireNonNull",
"(",
"... | Calls the shared {@code Action} if a SingleObserver subscribed to the current Single
disposes the common Disposable it received via onSubscribe.
<p>
<img width="640" height="332" src="https://raw.githubusercontent.com/wiki/ReactiveX/RxJava/images/rx-operators/Single.doOnDispose.png" alt="">
</p>
<dl>
<dt><b>Scheduler:<... | [
"Calls",
"the",
"shared",
"{"
] | ac84182aa2bd866b53e01c8e3fe99683b882c60e | https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Single.java#L2603-L2609 | test | Disposes the source Single. | Of course, here is the Java code you requested:
```java
@CheckReturnValue
@NonNull
@SchedulerSupport(SchedulerSupport.NONE)
public final Single<T> doOnDispose(final Action onDispose) {
ObjectHelper.requireNonNull(onDispose, "onDispose is null");
return RxJavaPlugins.onAssembly(new SingleDoO... |
wildfly/wildfly | security/subsystem/src/main/java/org/jboss/as/security/elytron/ElytronIntegrationResourceDefinitions.java | ElytronIntegrationResourceDefinitions.getElytronRealmResourceDefinition | public static ResourceDefinition getElytronRealmResourceDefinition() {
final AttributeDefinition[] attributes = new AttributeDefinition[] {LEGACY_JAAS_CONFIG, APPLY_ROLE_MAPPERS};
final AbstractAddStepHandler addHandler = new BasicAddHandler<SecurityRealm>(attributes, SECURITY_REALM_RUNTIME_CAPABILITY)... | java | public static ResourceDefinition getElytronRealmResourceDefinition() {
final AttributeDefinition[] attributes = new AttributeDefinition[] {LEGACY_JAAS_CONFIG, APPLY_ROLE_MAPPERS};
final AbstractAddStepHandler addHandler = new BasicAddHandler<SecurityRealm>(attributes, SECURITY_REALM_RUNTIME_CAPABILITY)... | [
"public",
"static",
"ResourceDefinition",
"getElytronRealmResourceDefinition",
"(",
")",
"{",
"final",
"AttributeDefinition",
"[",
"]",
"attributes",
"=",
"new",
"AttributeDefinition",
"[",
"]",
"{",
"LEGACY_JAAS_CONFIG",
",",
"APPLY_ROLE_MAPPERS",
"}",
";",
"final",
... | Defines a resource that represents an Elytron-compatible realm that can be exported by the legacy security subsystem.
The constructed {@code SecurityRealm} wraps a legacy {@code SecurityDomainContext} and delegates authentication
decisions to that context.
To export the realm the resource uses a {@code BasicAddHandler... | [
"Defines",
"a",
"resource",
"that",
"represents",
"an",
"Elytron",
"-",
"compatible",
"realm",
"that",
"can",
"be",
"exported",
"by",
"the",
"legacy",
"security",
"subsystem",
".",
"The",
"constructed",
"{",
"@code",
"SecurityRealm",
"}",
"wraps",
"a",
"legacy... | 64896f1500fe465ad83d96ede9fa19d0c3747f18 | https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/security/subsystem/src/main/java/org/jboss/as/security/elytron/ElytronIntegrationResourceDefinitions.java#L91-L113 | test | Gets the resource definition for the Elytron realm. | Of course, here is the Java code you requested:
```java
public static ResourceDefinition getElytronRealmResourceDefinition() {
final AttributeDefinition[] attributes = new AttributeDefinition[] {LEGACY_JAAS_CONFIG, APPLY_ROLE_MAPPERS};
final AbstractAddStepHandler addHandler = new BasicAddHandler<Secu... |
deeplearning4j/nd4j | nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/util/ComplexUtil.java | ComplexUtil.complexNumbersFor | public static IComplexNumber[][] complexNumbersFor(float[][] realComponents) {
IComplexNumber[][] ret = new IComplexNumber[realComponents.length][realComponents[0].length];
for (int i = 0; i < realComponents.length; i++)
for (int j = 0; j < realComponents[i].length; j++)
ret[... | java | public static IComplexNumber[][] complexNumbersFor(float[][] realComponents) {
IComplexNumber[][] ret = new IComplexNumber[realComponents.length][realComponents[0].length];
for (int i = 0; i < realComponents.length; i++)
for (int j = 0; j < realComponents[i].length; j++)
ret[... | [
"public",
"static",
"IComplexNumber",
"[",
"]",
"[",
"]",
"complexNumbersFor",
"(",
"float",
"[",
"]",
"[",
"]",
"realComponents",
")",
"{",
"IComplexNumber",
"[",
"]",
"[",
"]",
"ret",
"=",
"new",
"IComplexNumber",
"[",
"realComponents",
".",
"length",
"]... | Create complex number where the
@param realComponents the real components for the complex
@return the complex numbers based on the given real components | [
"Create",
"complex",
"number",
"where",
"the"
] | 8f005bcecb240d1fbb83b9d390ad801d1d3b6933 | https://github.com/deeplearning4j/nd4j/blob/8f005bcecb240d1fbb83b9d390ad801d1d3b6933/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/util/ComplexUtil.java#L40-L46 | test | Create a list of complex numbers for a matrix of real components | Of course, here is the Java code you requested:
```java
public static IComplexNumber[][] complexNumbersFor(float[][] realComponents) {
IComplexNumber[][] ret = new IComplexNumber[realComponents.length][realComponents[0].length];
for (int i = 0; i < realComponents.length; i++)
for (int j = 0... |
wildfly/wildfly | iiop-openjdk/src/main/java/org/wildfly/iiop/openjdk/rmi/marshal/strategy/StubStrategy.java | StubStrategy.isDeclaredException | public boolean isDeclaredException(Throwable t) {
Iterator<Class<?>> iterator = exceptionList.iterator();
while (iterator.hasNext()) {
if (((Class<?>) iterator.next()).isInstance(t)) {
return true;
}
}
return false;
} | java | public boolean isDeclaredException(Throwable t) {
Iterator<Class<?>> iterator = exceptionList.iterator();
while (iterator.hasNext()) {
if (((Class<?>) iterator.next()).isInstance(t)) {
return true;
}
}
return false;
} | [
"public",
"boolean",
"isDeclaredException",
"(",
"Throwable",
"t",
")",
"{",
"Iterator",
"<",
"Class",
"<",
"?",
">",
">",
"iterator",
"=",
"exceptionList",
".",
"iterator",
"(",
")",
";",
"while",
"(",
"iterator",
".",
"hasNext",
"(",
")",
")",
"{",
"... | Checks if a given <code>Throwable</code> instance corresponds to an
exception declared by this <code>StubStrategy</code>'s method.
@param t an exception class
@return true if <code>t</code> is an instance of any of the
exceptions declared by this <code>StubStrategy</code>'s
method, false otherwise. | [
"Checks",
"if",
"a",
"given",
"<code",
">",
"Throwable<",
"/",
"code",
">",
"instance",
"corresponds",
"to",
"an",
"exception",
"declared",
"by",
"this",
"<code",
">",
"StubStrategy<",
"/",
"code",
">",
"s",
"method",
"."
] | 64896f1500fe465ad83d96ede9fa19d0c3747f18 | https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/iiop-openjdk/src/main/java/org/wildfly/iiop/openjdk/rmi/marshal/strategy/StubStrategy.java#L250-L258 | test | Is the exception declared in this exception set? | Of course, here is the Java code you requested:
```java
public boolean isDeclaredException(Throwable t) {
Iterator<Class<?>> iterator = exceptionList.iterator();
while (iterator.hasNext()) {
if (((Class<?>) iterator.next()).isInstance(t)) {
return true;
}
... |
playframework/playframework | core/play/src/main/java/play/i18n/MessagesApi.java | MessagesApi.wrapArgsToListIfNeeded | @SafeVarargs
private static <T> List<T> wrapArgsToListIfNeeded(final T... args) {
List<T> out;
if (args != null && args.length == 1 && args[0] instanceof List) {
out = (List<T>) args[0];
} else {
out = Arrays.asList(args);
}
return out;
} | java | @SafeVarargs
private static <T> List<T> wrapArgsToListIfNeeded(final T... args) {
List<T> out;
if (args != null && args.length == 1 && args[0] instanceof List) {
out = (List<T>) args[0];
} else {
out = Arrays.asList(args);
}
return out;
} | [
"@",
"SafeVarargs",
"private",
"static",
"<",
"T",
">",
"List",
"<",
"T",
">",
"wrapArgsToListIfNeeded",
"(",
"final",
"T",
"...",
"args",
")",
"{",
"List",
"<",
"T",
">",
"out",
";",
"if",
"(",
"args",
"!=",
"null",
"&&",
"args",
".",
"length",
"=... | Wraps arguments passed into a list if necessary.
<p>Returns the first value as is if it is the only argument and a subtype of `java.util.List`
Otherwise, it calls Arrays.asList on args
@param args arguments as a List | [
"Wraps",
"arguments",
"passed",
"into",
"a",
"list",
"if",
"necessary",
"."
] | 3c46dca803d24e715d85de678c59dcfac9525a00 | https://github.com/playframework/playframework/blob/3c46dca803d24e715d85de678c59dcfac9525a00/core/play/src/main/java/play/i18n/MessagesApi.java#L58-L67 | test | Wrap the given arguments into a list if necessary. | Of course, here is the Java code you requested:
```java
@SafeVarargs
private static <T> List<T> wrapArgsToListIfNeeded(final T... args) {
List<T> out;
if (args != null && args.length == 1 && args[0] instanceof List) {
out = (List<T>) args[0];
} else {
out = Arrays.asList(args);
}
retu... |
fabric8io/fabric8-maven-plugin | core/src/main/java/io/fabric8/maven/core/service/PatchService.java | PatchService.bcPatcher | private static EntityPatcher<BuildConfig> bcPatcher() {
return (KubernetesClient client, String namespace, BuildConfig newObj, BuildConfig oldObj) -> {
if (UserConfigurationCompare.configEqual(newObj, oldObj)) {
return oldObj;
}
OpenShiftClient openShiftClient... | java | private static EntityPatcher<BuildConfig> bcPatcher() {
return (KubernetesClient client, String namespace, BuildConfig newObj, BuildConfig oldObj) -> {
if (UserConfigurationCompare.configEqual(newObj, oldObj)) {
return oldObj;
}
OpenShiftClient openShiftClient... | [
"private",
"static",
"EntityPatcher",
"<",
"BuildConfig",
">",
"bcPatcher",
"(",
")",
"{",
"return",
"(",
"KubernetesClient",
"client",
",",
"String",
"namespace",
",",
"BuildConfig",
"newObj",
",",
"BuildConfig",
"oldObj",
")",
"->",
"{",
"if",
"(",
"UserConf... | ================= | [
"================="
] | b0e7ad860a5bbe4ab71be3d0613862a1f14a8be3 | https://github.com/fabric8io/fabric8-maven-plugin/blob/b0e7ad860a5bbe4ab71be3d0613862a1f14a8be3/core/src/main/java/io/fabric8/maven/core/service/PatchService.java#L211-L235 | test | Creates a patcher for a build config. | Of course, here is the Java code you requested:
```java
private static EntityPatcher<BuildConfig> bcPatcher() {
return (KubernetesClient client, String namespace, BuildConfig newObj, BuildConfig oldObj) -> {
if (UserConfigurationCompare.configEqual(newObj, oldObj)) {
return oldObj;
... |
Unidata/thredds | opendap/src/main/java/opendap/servers/parsers/CeParser.java | CeParser.parse | public boolean parse () throws ParseException, ParseException
{
/* Lookahead and lookahead in internal form. */
int yychar = yyempty_;
int yytoken = 0;
/* State. */
int yyn = 0;
int yylen = 0;
int yystate = 0;
YYStack yystack = new YYStack ();
int label = YYNEWSTATE;
... | java | public boolean parse () throws ParseException, ParseException
{
/* Lookahead and lookahead in internal form. */
int yychar = yyempty_;
int yytoken = 0;
/* State. */
int yyn = 0;
int yylen = 0;
int yystate = 0;
YYStack yystack = new YYStack ();
int label = YYNEWSTATE;
... | [
"public",
"boolean",
"parse",
"(",
")",
"throws",
"ParseException",
",",
"ParseException",
"{",
"/* Lookahead and lookahead in internal form. */",
"int",
"yychar",
"=",
"yyempty_",
";",
"int",
"yytoken",
"=",
"0",
";",
"/* State. */",
"int",
"yyn",
"=",
"0",
";"... | Parse input from the scanner that was specified at object construction
time. Return whether the end of the input was reached successfully.
@return <tt>true</tt> if the parsing succeeds. Note that this does not
imply that there were no syntax errors. | [
"Parse",
"input",
"from",
"the",
"scanner",
"that",
"was",
"specified",
"at",
"object",
"construction",
"time",
".",
"Return",
"whether",
"the",
"end",
"of",
"the",
"input",
"was",
"reached",
"successfully",
"."
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/opendap/src/main/java/opendap/servers/parsers/CeParser.java#L774-L1013 | test | Parses the input stream. | Of course, here is the Java code you requested:
```java
public boolean parse () throws ParseException, ParseException
{
/* Lookahead and lookahead in internal form. */
int yychar = yyempty_;
int yytoken = 0;
/* State. */
int yyn = 0;
int yylen = 0;
int yystate = 0;
YYStack ... |
wildfly/wildfly | ejb3/src/main/java/org/jboss/as/ejb3/timerservice/TimerServiceImpl.java | TimerServiceImpl.isLifecycleCallbackInvocation | protected boolean isLifecycleCallbackInvocation() {
final InterceptorContext currentInvocationContext = CurrentInvocationContext.get();
if (currentInvocationContext == null) {
return false;
}
// If the method in current invocation context is null,
// then it represent... | java | protected boolean isLifecycleCallbackInvocation() {
final InterceptorContext currentInvocationContext = CurrentInvocationContext.get();
if (currentInvocationContext == null) {
return false;
}
// If the method in current invocation context is null,
// then it represent... | [
"protected",
"boolean",
"isLifecycleCallbackInvocation",
"(",
")",
"{",
"final",
"InterceptorContext",
"currentInvocationContext",
"=",
"CurrentInvocationContext",
".",
"get",
"(",
")",
";",
"if",
"(",
"currentInvocationContext",
"==",
"null",
")",
"{",
"return",
"fal... | Returns true if the {@link CurrentInvocationContext} represents a lifecycle
callback invocation. Else returns false.
<p>
This method internally relies on {@link CurrentInvocationContext#get()} to obtain
the current invocation context.
<ul>
<li>If the context is available then it looks for the method that was invoked.
T... | [
"Returns",
"true",
"if",
"the",
"{",
"@link",
"CurrentInvocationContext",
"}",
"represents",
"a",
"lifecycle",
"callback",
"invocation",
".",
"Else",
"returns",
"false",
".",
"<p",
">",
"This",
"method",
"internally",
"relies",
"on",
"{",
"@link",
"CurrentInvoca... | 64896f1500fe465ad83d96ede9fa19d0c3747f18 | https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/ejb3/src/main/java/org/jboss/as/ejb3/timerservice/TimerServiceImpl.java#L855-L869 | test | Checks if the current invocation is a lifecycle callback invocation. | Of course, here is the Java code you requested:
```java
protected boolean isLifecycleCallbackInvocation() {
final InterceptorContext currentInvocationContext = CurrentInvocationContext.get();
if (currentInvocationContext == null) {
return false;
}
// If the method in current... |
alipay/sofa-bolt | src/main/java/com/alipay/remoting/rpc/RpcClient.java | RpcClient.invokeWithFuture | public RpcResponseFuture invokeWithFuture(final Connection conn, final Object request,
int timeoutMillis) throws RemotingException {
return this.rpcRemoting.invokeWithFuture(conn, request, null, timeoutMillis);
} | java | public RpcResponseFuture invokeWithFuture(final Connection conn, final Object request,
int timeoutMillis) throws RemotingException {
return this.rpcRemoting.invokeWithFuture(conn, request, null, timeoutMillis);
} | [
"public",
"RpcResponseFuture",
"invokeWithFuture",
"(",
"final",
"Connection",
"conn",
",",
"final",
"Object",
"request",
",",
"int",
"timeoutMillis",
")",
"throws",
"RemotingException",
"{",
"return",
"this",
".",
"rpcRemoting",
".",
"invokeWithFuture",
"(",
"conn"... | Future invocation using a {@link Connection} <br>
You can get result use the returned {@link RpcResponseFuture}.
<p>
Notice:<br>
<b>DO NOT modify the request object concurrently when this method is called.</b>
@param conn
@param request
@param timeoutMillis
@return
@throws RemotingException | [
"Future",
"invocation",
"using",
"a",
"{",
"@link",
"Connection",
"}",
"<br",
">",
"You",
"can",
"get",
"result",
"use",
"the",
"returned",
"{",
"@link",
"RpcResponseFuture",
"}",
".",
"<p",
">",
"Notice",
":",
"<br",
">",
"<b",
">",
"DO",
"NOT",
"modi... | 0ad7b46b2649bfc4e2ecc1f5e1c1f935d179c046 | https://github.com/alipay/sofa-bolt/blob/0ad7b46b2649bfc4e2ecc1f5e1c1f935d179c046/src/main/java/com/alipay/remoting/rpc/RpcClient.java#L502-L505 | test | Invoke with future. | Of course, here is the Java code you requested:
```java
public RpcResponseFuture invokeWithFuture(final Connection conn, final Object request,
int timeoutMillis) throws RemotingException {
return this.rpcRemoting.invokeWithFuture(conn, request, null, timeoutMillis)... |
objectify/objectify | src/main/java/com/googlecode/objectify/Ref.java | Ref.create | public static <T> Ref<T> create(T value) {
Key<T> key = Key.create(value);
return create(key);
} | java | public static <T> Ref<T> create(T value) {
Key<T> key = Key.create(value);
return create(key);
} | [
"public",
"static",
"<",
"T",
">",
"Ref",
"<",
"T",
">",
"create",
"(",
"T",
"value",
")",
"{",
"Key",
"<",
"T",
">",
"key",
"=",
"Key",
".",
"create",
"(",
"value",
")",
";",
"return",
"create",
"(",
"key",
")",
";",
"}"
] | Creates a Ref from a registered pojo entity | [
"Creates",
"a",
"Ref",
"from",
"a",
"registered",
"pojo",
"entity"
] | 4bf325d2e49b400326416977c7d9bbdf5380175b | https://github.com/objectify/objectify/blob/4bf325d2e49b400326416977c7d9bbdf5380175b/src/main/java/com/googlecode/objectify/Ref.java#L30-L33 | test | Create a new instance of a managed type. | Of course, here is the Java code you requested:
```java
public static <T> Ref<T> create(T value) {
Key<T> key = Key.create(value);
return create(key);
}
```
Hope this helps! |
RestComm/jain-slee | container/activities/src/main/java/org/mobicents/slee/runtime/activity/ActivityContextInterfaceImpl.java | ActivityContextInterfaceImpl.attach | public void attach(SbbLocalObject sbbLocalObject)
throws NullPointerException, TransactionRequiredLocalException,
TransactionRolledbackLocalException, SLEEException {
if (doTraceLogs) {
logger.trace("attach( ac = "+activityContext+" , sbbLocalObject = " + sbbLocalObject + " )");
}
if (sbbLocalO... | java | public void attach(SbbLocalObject sbbLocalObject)
throws NullPointerException, TransactionRequiredLocalException,
TransactionRolledbackLocalException, SLEEException {
if (doTraceLogs) {
logger.trace("attach( ac = "+activityContext+" , sbbLocalObject = " + sbbLocalObject + " )");
}
if (sbbLocalO... | [
"public",
"void",
"attach",
"(",
"SbbLocalObject",
"sbbLocalObject",
")",
"throws",
"NullPointerException",
",",
"TransactionRequiredLocalException",
",",
"TransactionRolledbackLocalException",
",",
"SLEEException",
"{",
"if",
"(",
"doTraceLogs",
")",
"{",
"logger",
".",
... | /*
(non-Javadoc)
@see javax.slee.ActivityContextInterface#attach(javax.slee.SbbLocalObject) | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | 0eaa16ff2d4b6faf43f0d99260e88878fd54dee0 | https://github.com/RestComm/jain-slee/blob/0eaa16ff2d4b6faf43f0d99260e88878fd54dee0/container/activities/src/main/java/org/mobicents/slee/runtime/activity/ActivityContextInterfaceImpl.java#L99-L164 | test | Attaches the SbbLocalObject to the ActivityContext. | Of course, here is the Java code you requested:
```java
public void attach(SbbLocalObject sbbLocalObject)
throws NullPointerException, TransactionRequiredLocalException,
TransactionRolledbackLocalException, SLEEException {
if (doTraceLogs) {
logger.trace("attach( ac = "+activityContext+" , sbbLocalOb... |
lessthanoptimal/GeoRegression | main/src/georegression/geometry/UtilPolygons2D_F64.java | UtilPolygons2D_F64.convexHull | public static void convexHull( List<Point2D_F64> points , Polygon2D_F64 hull ) {
Point2D_F64[] array = new Point2D_F64[points.size()];
for (int i = 0; i < points.size(); i++) {
array[i] = points.get(i);
}
AndrewMonotoneConvexHull_F64 andrew = new AndrewMonotoneConvexHull_F64();
andrew.process(array,array... | java | public static void convexHull( List<Point2D_F64> points , Polygon2D_F64 hull ) {
Point2D_F64[] array = new Point2D_F64[points.size()];
for (int i = 0; i < points.size(); i++) {
array[i] = points.get(i);
}
AndrewMonotoneConvexHull_F64 andrew = new AndrewMonotoneConvexHull_F64();
andrew.process(array,array... | [
"public",
"static",
"void",
"convexHull",
"(",
"List",
"<",
"Point2D_F64",
">",
"points",
",",
"Polygon2D_F64",
"hull",
")",
"{",
"Point2D_F64",
"[",
"]",
"array",
"=",
"new",
"Point2D_F64",
"[",
"points",
".",
"size",
"(",
")",
"]",
";",
"for",
"(",
"... | Computes the convex hull of the set of points.
<p>
NOTE: This method declares a temporary array. If you want to avoid that invoke {@link AndrewMonotoneConvexHull_F64}
directly.
</p>
@param points (Input) Set of points.
@param hull (output) storage for convex hull. Will be in counter-clockwise order | [
"Computes",
"the",
"convex",
"hull",
"of",
"the",
"set",
"of",
"points",
"."
] | c067cd44a4e95bd826119f6e658bd82386ef289f | https://github.com/lessthanoptimal/GeoRegression/blob/c067cd44a4e95bd826119f6e658bd82386ef289f/main/src/georegression/geometry/UtilPolygons2D_F64.java#L408-L417 | test | Computes the convex hull from a list of points | Of course, here is the Java code you requested:
```java
public static void convexHull( List<Point2D_F64> points , Polygon2D_F64 hull ) {
Point2D_F64[] array = new Point2D_F64[points.size()];
for (int i = 0; i < points.size(); i++) {
array[i] = points.get(i);
}
AndrewMonotoneConvexHull_F64 andrew = new And... |
Unidata/thredds | cdm/src/main/java/ucar/unidata/util/StringUtil2.java | StringUtil2.filter7bits | static public String filter7bits(String s) {
if (s == null) return null;
char[] bo = new char[s.length()];
int count = 0;
for (int i = 0; i < s.length(); i++) {
char c = s.charAt(i);
if ((c < 128) && (c > 31) || ((c == '\n') || (c == '\t'))) {
bo[count++] = c;
}
}
... | java | static public String filter7bits(String s) {
if (s == null) return null;
char[] bo = new char[s.length()];
int count = 0;
for (int i = 0; i < s.length(); i++) {
char c = s.charAt(i);
if ((c < 128) && (c > 31) || ((c == '\n') || (c == '\t'))) {
bo[count++] = c;
}
}
... | [
"static",
"public",
"String",
"filter7bits",
"(",
"String",
"s",
")",
"{",
"if",
"(",
"s",
"==",
"null",
")",
"return",
"null",
";",
"char",
"[",
"]",
"bo",
"=",
"new",
"char",
"[",
"s",
".",
"length",
"(",
")",
"]",
";",
"int",
"count",
"=",
"... | Remove all but printable ascii
@param s filter this string
@return filtered string. | [
"Remove",
"all",
"but",
"printable",
"ascii"
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/unidata/util/StringUtil2.java#L143-L155 | test | Filter 7 bits in a String | Of course, here is the Java code you requested:
```java
static public String filter7bits(String s) {
if (s == null) return null;
char[] bo = new char[s.length()];
int count = 0;
for (int i = 0; i < s.length(); i++) {
char c = s.charAt(i);
if ((c < 128) && (c > 31) || ((c == '\n') || (... |
rupertlssmith/lojix | base/common/src/main/com/thesett/common/util/FileUtils.java | FileUtils.readStreamAsString | private static String readStreamAsString(BufferedInputStream is)
{
try
{
byte[] data = new byte[4096];
StringBuffer inBuffer = new StringBuffer();
int read;
while ((read = is.read(data)) != -1)
{
String s = new String(dat... | java | private static String readStreamAsString(BufferedInputStream is)
{
try
{
byte[] data = new byte[4096];
StringBuffer inBuffer = new StringBuffer();
int read;
while ((read = is.read(data)) != -1)
{
String s = new String(dat... | [
"private",
"static",
"String",
"readStreamAsString",
"(",
"BufferedInputStream",
"is",
")",
"{",
"try",
"{",
"byte",
"[",
"]",
"data",
"=",
"new",
"byte",
"[",
"4096",
"]",
";",
"StringBuffer",
"inBuffer",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"int",
... | Reads the contents of a reader, one line at a time until the end of stream is encountered, and returns all
together as a string.
@param is The reader.
@return The contents of the reader. | [
"Reads",
"the",
"contents",
"of",
"a",
"reader",
"one",
"line",
"at",
"a",
"time",
"until",
"the",
"end",
"of",
"stream",
"is",
"encountered",
"and",
"returns",
"all",
"together",
"as",
"a",
"string",
"."
] | ad494dc8bce2345567de7689d42291d4b30fbd51 | https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/base/common/src/main/com/thesett/common/util/FileUtils.java#L130-L152 | test | read a stream of bytes to a String | Of course, here is the Java code you requested:
```java
private static String readStreamAsString(BufferedInputStream is)
{
try
{
byte[] data = new byte[4096];
StringBuffer inBuffer = new StringBuffer();
int read;
while ((read = is.read(data)) != -1... |
oblac/jodd | jodd-db/src/main/java/jodd/db/oom/sqlgen/TemplateData.java | TemplateData.resetSoft | protected void resetSoft() {
columnCount = 0;
paramCount = 0;
hintCount = 0;
if (tableRefs != null) {
tableRefs.clear();
}
// objectRefs = null;
if (columnData != null) {
columnData.clear();
}
if (parameters != null) {
parameters.clear();
}
if (hints != null) {
hints.clear();
}
//c... | java | protected void resetSoft() {
columnCount = 0;
paramCount = 0;
hintCount = 0;
if (tableRefs != null) {
tableRefs.clear();
}
// objectRefs = null;
if (columnData != null) {
columnData.clear();
}
if (parameters != null) {
parameters.clear();
}
if (hints != null) {
hints.clear();
}
//c... | [
"protected",
"void",
"resetSoft",
"(",
")",
"{",
"columnCount",
"=",
"0",
";",
"paramCount",
"=",
"0",
";",
"hintCount",
"=",
"0",
";",
"if",
"(",
"tableRefs",
"!=",
"null",
")",
"{",
"tableRefs",
".",
"clear",
"(",
")",
";",
"}",
"//\t\tobjectRefs = n... | Resets the builder so it can be used again. Not everything is reset:
object references and column alias type is not. | [
"Resets",
"the",
"builder",
"so",
"it",
"can",
"be",
"used",
"again",
".",
"Not",
"everything",
"is",
"reset",
":",
"object",
"references",
"and",
"column",
"alias",
"type",
"is",
"not",
"."
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-db/src/main/java/jodd/db/oom/sqlgen/TemplateData.java#L60-L79 | test | Resets the soft values. | Of course, here is the Java code you requested:
```java
protected void resetSoft() {
columnCount = 0;
paramCount = 0;
hintCount = 0;
if (tableRefs != null) {
tableRefs.clear();
}
// objectRefs = null;
if (columnData != null) {
columnData.clear();
}
if (parameters != null) {
parameters.clear(... |
orientechnologies/orientdb | core/src/main/java/com/orientechnologies/orient/core/command/script/OScriptManager.java | OScriptManager.getLibrary | public String getLibrary(final ODatabase<?> db, final String iLanguage) {
if (db == null)
// NO DB = NO LIBRARY
return null;
final StringBuilder code = new StringBuilder();
final Set<String> functions = db.getMetadata().getFunctionLibrary().getFunctionNames();
for (String fName : f... | java | public String getLibrary(final ODatabase<?> db, final String iLanguage) {
if (db == null)
// NO DB = NO LIBRARY
return null;
final StringBuilder code = new StringBuilder();
final Set<String> functions = db.getMetadata().getFunctionLibrary().getFunctionNames();
for (String fName : f... | [
"public",
"String",
"getLibrary",
"(",
"final",
"ODatabase",
"<",
"?",
">",
"db",
",",
"final",
"String",
"iLanguage",
")",
"{",
"if",
"(",
"db",
"==",
"null",
")",
"// NO DB = NO LIBRARY\r",
"return",
"null",
";",
"final",
"StringBuilder",
"code",
"=",
"n... | Formats the library of functions for a language.
@param db Current database instance
@param iLanguage Language as filter
@return String containing all the functions | [
"Formats",
"the",
"library",
"of",
"functions",
"for",
"a",
"language",
"."
] | d970b12033f0462f0239ea0ad8ed41207e6e26f1 | https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/core/src/main/java/com/orientechnologies/orient/core/command/script/OScriptManager.java#L138-L162 | test | Returns the library name for the database. | Of course, here is the Java code you requested:
```java
public String getLibrary(final ODatabase<?> db, final String iLanguage) {
if (db == null)
// NO DB = NO LIBRARY
return null;
final StringBuilder code = new StringBuilder();
final Set<String> functions = db.getMetadata().getFunctio... |
square/retrofit | retrofit-mock/src/main/java/retrofit2/mock/NetworkBehavior.java | NetworkBehavior.createErrorResponse | public Response<?> createErrorResponse() {
Response<?> call;
try {
call = errorFactory.call();
} catch (Exception e) {
throw new IllegalStateException("Error factory threw an exception.", e);
}
if (call == null) {
throw new IllegalStateException("Error factory returned null.");
... | java | public Response<?> createErrorResponse() {
Response<?> call;
try {
call = errorFactory.call();
} catch (Exception e) {
throw new IllegalStateException("Error factory threw an exception.", e);
}
if (call == null) {
throw new IllegalStateException("Error factory returned null.");
... | [
"public",
"Response",
"<",
"?",
">",
"createErrorResponse",
"(",
")",
"{",
"Response",
"<",
"?",
">",
"call",
";",
"try",
"{",
"call",
"=",
"errorFactory",
".",
"call",
"(",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"throw",
"new",
"... | The HTTP error to be used when an error is triggered. | [
"The",
"HTTP",
"error",
"to",
"be",
"used",
"when",
"an",
"error",
"is",
"triggered",
"."
] | 81a6193a7b3f2b1bf25e78adc2638681b0514fe8 | https://github.com/square/retrofit/blob/81a6193a7b3f2b1bf25e78adc2638681b0514fe8/retrofit-mock/src/main/java/retrofit2/mock/NetworkBehavior.java#L161-L175 | test | Create an error response. | Of course, here is the Java code you requested:
```java
public Response<?> createErrorResponse() {
Response<?> call;
try {
call = errorFactory.call();
} catch (Exception e) {
throw new IllegalStateException("Error factory threw an exception.", e);
}
if (call == null) {
throw new I... |
ngageoint/geopackage-android | geopackage-sdk/src/main/java/mil/nga/geopackage/io/ContextIOUtils.java | ContextIOUtils.getInternalFilePath | public static String getInternalFilePath(Context context, String filePath) {
return getInternalFile(context, filePath).getAbsolutePath();
} | java | public static String getInternalFilePath(Context context, String filePath) {
return getInternalFile(context, filePath).getAbsolutePath();
} | [
"public",
"static",
"String",
"getInternalFilePath",
"(",
"Context",
"context",
",",
"String",
"filePath",
")",
"{",
"return",
"getInternalFile",
"(",
"context",
",",
"filePath",
")",
".",
"getAbsolutePath",
"(",
")",
";",
"}"
] | Get the internal storage patch for the file path
@param context context
@param filePath file path
@return file path | [
"Get",
"the",
"internal",
"storage",
"patch",
"for",
"the",
"file",
"path"
] | d19e9fcc636462c0f0ae1b7eca4acafae48de21b | https://github.com/ngageoint/geopackage-android/blob/d19e9fcc636462c0f0ae1b7eca4acafae48de21b/geopackage-sdk/src/main/java/mil/nga/geopackage/io/ContextIOUtils.java#L38-L40 | test | Get the absolute path of the file in the context. | Of course, here is the Java code you requested:
```java
public static String getInternalFilePath(Context context, String filePath) {
return getInternalFile(context, filePath).getAbsolutePath();
}
```
Hope this helps! |
jpush/jiguang-java-client-common | src/main/java/cn/jiguang/common/utils/sm2/BCECUtil.java | BCECUtil.convertECPrivateKeyToSEC1 | public static byte[] convertECPrivateKeyToSEC1(ECPrivateKeyParameters priKey,
ECPublicKeyParameters pubKey) throws IOException {
byte[] pkcs8Bytes = convertECPrivateKeyToPKCS8(priKey, pubKey);
PrivateKeyInfo pki = PrivateKeyInfo.getInstance(pkcs8Bytes);
ASN1Encodable encodable = pki.pars... | java | public static byte[] convertECPrivateKeyToSEC1(ECPrivateKeyParameters priKey,
ECPublicKeyParameters pubKey) throws IOException {
byte[] pkcs8Bytes = convertECPrivateKeyToPKCS8(priKey, pubKey);
PrivateKeyInfo pki = PrivateKeyInfo.getInstance(pkcs8Bytes);
ASN1Encodable encodable = pki.pars... | [
"public",
"static",
"byte",
"[",
"]",
"convertECPrivateKeyToSEC1",
"(",
"ECPrivateKeyParameters",
"priKey",
",",
"ECPublicKeyParameters",
"pubKey",
")",
"throws",
"IOException",
"{",
"byte",
"[",
"]",
"pkcs8Bytes",
"=",
"convertECPrivateKeyToPKCS8",
"(",
"priKey",
","... | 将ECC私钥转换为SEC1标准的字节流
openssl d2i_ECPrivateKey函数要求的DER编码的私钥也是SEC1标准的,
这个工具函数的主要目的就是为了能生成一个openssl可以直接“识别”的ECC私钥.
相对RSA私钥的PKCS1标准,ECC私钥的标准为SEC1
@param priKey
@param pubKey
@return
@throws IOException | [
"将ECC私钥转换为SEC1标准的字节流",
"openssl",
"d2i_ECPrivateKey函数要求的DER编码的私钥也是SEC1标准的,",
"这个工具函数的主要目的就是为了能生成一个openssl可以直接“识别”的ECC私钥",
".",
"相对RSA私钥的PKCS1标准,ECC私钥的标准为SEC1"
] | 5fc5a7f3433568131e198d54b315e7d23c4f2626 | https://github.com/jpush/jiguang-java-client-common/blob/5fc5a7f3433568131e198d54b315e7d23c4f2626/src/main/java/cn/jiguang/common/utils/sm2/BCECUtil.java#L230-L238 | test | Convert an ECPrivateKey to a SECPublicKey. | Of course, here is the Java code you requested:
```java
public static byte[] convertECPrivateKeyToSEC1(ECPrivateKeyParameters priKey,
ECPublicKeyParameters pubKey) throws IOException {
byte[] pkcs8Bytes = convertECPrivateKeyToPKCS8(priKey, pubKey);
PrivateKeyInfo pki = PrivateKeyInfo.getInstanc... |
spring-projects/spring-security | core/src/main/java/org/springframework/security/core/SpringSecurityCoreVersion.java | SpringSecurityCoreVersion.performVersionChecks | private static void performVersionChecks(String minSpringVersion) {
if (minSpringVersion == null) {
return;
}
// Check Spring Compatibility
String springVersion = SpringVersion.getVersion();
String version = getVersion();
if (disableChecks(springVersion, version)) {
return;
}
logger.info("You ar... | java | private static void performVersionChecks(String minSpringVersion) {
if (minSpringVersion == null) {
return;
}
// Check Spring Compatibility
String springVersion = SpringVersion.getVersion();
String version = getVersion();
if (disableChecks(springVersion, version)) {
return;
}
logger.info("You ar... | [
"private",
"static",
"void",
"performVersionChecks",
"(",
"String",
"minSpringVersion",
")",
"{",
"if",
"(",
"minSpringVersion",
"==",
"null",
")",
"{",
"return",
";",
"}",
"// Check Spring Compatibility",
"String",
"springVersion",
"=",
"SpringVersion",
".",
"getVe... | Perform version checks with specific min Spring Version
@param minSpringVersion | [
"Perform",
"version",
"checks",
"with",
"specific",
"min",
"Spring",
"Version"
] | 98a8467e4c2ae05b3e09c67ece856944fa48ed23 | https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/core/src/main/java/org/springframework/security/core/SpringSecurityCoreVersion.java#L69-L87 | test | Perform version checks. | Of course, here is the Java code you requested:
```java
private static void performVersionChecks(String minSpringVersion) {
if (minSpringVersion == null) {
return;
}
// Check Spring Compatibility
String springVersion = SpringVersion.getVersion();
String version = getVersion();
if (disableChecks(springV... |
oblac/jodd | jodd-http/src/main/java/jodd/http/HttpRequest.java | HttpRequest.options | public static HttpRequest options(final String destination) {
return new HttpRequest()
.method(HttpMethod.OPTIONS)
.set(destination);
} | java | public static HttpRequest options(final String destination) {
return new HttpRequest()
.method(HttpMethod.OPTIONS)
.set(destination);
} | [
"public",
"static",
"HttpRequest",
"options",
"(",
"final",
"String",
"destination",
")",
"{",
"return",
"new",
"HttpRequest",
"(",
")",
".",
"method",
"(",
"HttpMethod",
".",
"OPTIONS",
")",
".",
"set",
"(",
"destination",
")",
";",
"}"
] | Builds an OPTIONS request. | [
"Builds",
"an",
"OPTIONS",
"request",
"."
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-http/src/main/java/jodd/http/HttpRequest.java#L283-L287 | test | Create an OPTIONS request with the specified destination. | Of course, here is the Java code you requested:
```java
public static HttpRequest options(final String destination) {
return new HttpRequest()
.method(HttpMethod.OPTIONS)
.set(destination);
}
```
Hope this helps! |
ngageoint/geopackage-android | geopackage-sdk/src/main/java/mil/nga/geopackage/user/custom/UserCustomDao.java | UserCustomDao.count | protected int count(UserCustomCursor cursor) {
int count = 0;
try {
count = cursor.getCount();
} finally {
cursor.close();
}
return count;
} | java | protected int count(UserCustomCursor cursor) {
int count = 0;
try {
count = cursor.getCount();
} finally {
cursor.close();
}
return count;
} | [
"protected",
"int",
"count",
"(",
"UserCustomCursor",
"cursor",
")",
"{",
"int",
"count",
"=",
"0",
";",
"try",
"{",
"count",
"=",
"cursor",
".",
"getCount",
"(",
")",
";",
"}",
"finally",
"{",
"cursor",
".",
"close",
"(",
")",
";",
"}",
"return",
... | Get the count of the cursor and close it
@param cursor cursor
@return count | [
"Get",
"the",
"count",
"of",
"the",
"cursor",
"and",
"close",
"it"
] | d19e9fcc636462c0f0ae1b7eca4acafae48de21b | https://github.com/ngageoint/geopackage-android/blob/d19e9fcc636462c0f0ae1b7eca4acafae48de21b/geopackage-sdk/src/main/java/mil/nga/geopackage/user/custom/UserCustomDao.java#L103-L111 | test | Count the number of records in the user custom cursor. | Of course, here is the Java code you requested:
```java
protected int count(UserCustomCursor cursor) {
int count = 0;
try {
count = cursor.getCount();
} finally {
cursor.close();
}
return count;
}
```
Hope this helps! |
robeio/robe | robe-common/src/main/java/io/robe/common/exception/RobeRuntimeException.java | RobeRuntimeException.getResponse | public Response getResponse() {
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(builder.build()).build();
} | java | public Response getResponse() {
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(builder.build()).build();
} | [
"public",
"Response",
"getResponse",
"(",
")",
"{",
"return",
"Response",
".",
"status",
"(",
"Response",
".",
"Status",
".",
"INTERNAL_SERVER_ERROR",
")",
".",
"entity",
"(",
"builder",
".",
"build",
"(",
")",
")",
".",
"build",
"(",
")",
";",
"}"
] | Gets current response created with exception parameters.
@return current response | [
"Gets",
"current",
"response",
"created",
"with",
"exception",
"parameters",
"."
] | a0a8c7cebd1f70f78cf24a66a002859e937badfe | https://github.com/robeio/robe/blob/a0a8c7cebd1f70f78cf24a66a002859e937badfe/robe-common/src/main/java/io/robe/common/exception/RobeRuntimeException.java#L88-L90 | test | Get the response. | Of course, here is the Java code you requested:
```java
public Response getResponse() {
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(builder.build()).build();
}
```
Hope this helps! |
jkuhnert/ognl | src/main/java/ognl/OgnlOps.java | OgnlOps.longValue | public static long longValue(Object value)
throws NumberFormatException
{
if (value == null) return 0L;
Class c = value.getClass();
if (c.getSuperclass() == Number.class) return ((Number) value).longValue();
if (c == Boolean.class) return ((Boolean) value).booleanValue() ? 1 ... | java | public static long longValue(Object value)
throws NumberFormatException
{
if (value == null) return 0L;
Class c = value.getClass();
if (c.getSuperclass() == Number.class) return ((Number) value).longValue();
if (c == Boolean.class) return ((Boolean) value).booleanValue() ? 1 ... | [
"public",
"static",
"long",
"longValue",
"(",
"Object",
"value",
")",
"throws",
"NumberFormatException",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"return",
"0L",
";",
"Class",
"c",
"=",
"value",
".",
"getClass",
"(",
")",
";",
"if",
"(",
"c",
".",
... | Evaluates the given object as a long integer.
@param value
an object to interpret as a long integer
@return the long integer value implied by the given object
@throws NumberFormatException
if the given object can't be understood as a long integer | [
"Evaluates",
"the",
"given",
"object",
"as",
"a",
"long",
"integer",
"."
] | 53d51a30c8c299b750dede779d05cb84beee73c3 | https://github.com/jkuhnert/ognl/blob/53d51a30c8c299b750dede779d05cb84beee73c3/src/main/java/ognl/OgnlOps.java#L213-L222 | test | Get the long value from the object. | Of course, here is the Java code you requested:
```java
public static long longValue(Object value)
throws NumberFormatException
{
if (value == null) return 0L;
Class c = value.getClass();
if (c.getSuperclass() == Number.class) return ((Number) value).longValue();
if (c == Bo... |
Unidata/thredds | opendap/src/main/java/opendap/servers/SDArray.java | SDArray.setProject | public void setProject(boolean state, boolean all) {
setProjected(state);
PrimitiveVector vals = getPrimitiveVector();
((ServerMethods) (vals.getTemplate())).setProject(state, all);
} | java | public void setProject(boolean state, boolean all) {
setProjected(state);
PrimitiveVector vals = getPrimitiveVector();
((ServerMethods) (vals.getTemplate())).setProject(state, all);
} | [
"public",
"void",
"setProject",
"(",
"boolean",
"state",
",",
"boolean",
"all",
")",
"{",
"setProjected",
"(",
"state",
")",
";",
"PrimitiveVector",
"vals",
"=",
"getPrimitiveVector",
"(",
")",
";",
"(",
"(",
"ServerMethods",
")",
"(",
"vals",
".",
"getTem... | Set the state of this variable's projection. <code>true</code> means
that this variable is part of the current projection as defined by
the current constraint expression, otherwise the current projection
for this variable should be <code>false</code>.
@param state <code>true</code> if the variable is part of the curre... | [
"Set",
"the",
"state",
"of",
"this",
"variable",
"s",
"projection",
".",
"<code",
">",
"true<",
"/",
"code",
">",
"means",
"that",
"this",
"variable",
"is",
"part",
"of",
"the",
"current",
"projection",
"as",
"defined",
"by",
"the",
"current",
"constraint"... | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/opendap/src/main/java/opendap/servers/SDArray.java#L241-L245 | test | Sets the project flag. | Of course, here is the Java code you requested:
```java
public void setProject(boolean state, boolean all) {
setProjected(state);
PrimitiveVector vals = getPrimitiveVector();
((ServerMethods) (vals.getTemplate())).setProject(state, all);
}
```
Hope this helps! |
jkuhnert/ognl | src/main/java/ognl/OgnlOps.java | OgnlOps.compareWithConversion | public static int compareWithConversion(Object v1, Object v2)
{
int result;
if (v1 == v2) {
result = 0;
} else {
int t1 = getNumericType(v1), t2 = getNumericType(v2), type = getNumericType(t1, t2, true);
switch(type) {
case BIGINT:
... | java | public static int compareWithConversion(Object v1, Object v2)
{
int result;
if (v1 == v2) {
result = 0;
} else {
int t1 = getNumericType(v1), t2 = getNumericType(v2), type = getNumericType(t1, t2, true);
switch(type) {
case BIGINT:
... | [
"public",
"static",
"int",
"compareWithConversion",
"(",
"Object",
"v1",
",",
"Object",
"v2",
")",
"{",
"int",
"result",
";",
"if",
"(",
"v1",
"==",
"v2",
")",
"{",
"result",
"=",
"0",
";",
"}",
"else",
"{",
"int",
"t1",
"=",
"getNumericType",
"(",
... | Compares two objects for equality, even if it has to convert one of them to the other type.
If both objects are numeric they are converted to the widest type and compared. If one is
non-numeric and one is numeric the non-numeric is converted to double and compared to the
double numeric value. If both are non-numeric an... | [
"Compares",
"two",
"objects",
"for",
"equality",
"even",
"if",
"it",
"has",
"to",
"convert",
"one",
"of",
"them",
"to",
"the",
"other",
"type",
".",
"If",
"both",
"objects",
"are",
"numeric",
"they",
"are",
"converted",
"to",
"the",
"widest",
"type",
"an... | 53d51a30c8c299b750dede779d05cb84beee73c3 | https://github.com/jkuhnert/ognl/blob/53d51a30c8c299b750dede779d05cb84beee73c3/src/main/java/ognl/OgnlOps.java#L69-L113 | test | Compare two objects using the Java standard compare method. | Of course, here is the Java code you requested:
```java
public static int compareWithConversion(Object v1, Object v2)
{
int result;
if (v1 == v2) {
result = 0;
} else {
int t1 = getNumericType(v1), t2 = getNumericType(v2), type = getNumericType(t1, t2, true);
... |
dmfs/iterators | src/main/java/org/dmfs/iterators/CsvIterator.java | CsvIterator.findNextSeparator | private void findNextSeparator()
{
boolean isQuoted = false;
mLastSeparatorPos = mNextSeparatorPos;
while (++mNextSeparatorPos < mValue.length())
{
char c = mValue.charAt(mNextSeparatorPos);
if (c == mSeparator)
{
if (!isQuoted)
... | java | private void findNextSeparator()
{
boolean isQuoted = false;
mLastSeparatorPos = mNextSeparatorPos;
while (++mNextSeparatorPos < mValue.length())
{
char c = mValue.charAt(mNextSeparatorPos);
if (c == mSeparator)
{
if (!isQuoted)
... | [
"private",
"void",
"findNextSeparator",
"(",
")",
"{",
"boolean",
"isQuoted",
"=",
"false",
";",
"mLastSeparatorPos",
"=",
"mNextSeparatorPos",
";",
"while",
"(",
"++",
"mNextSeparatorPos",
"<",
"mValue",
".",
"length",
"(",
")",
")",
"{",
"char",
"c",
"=",
... | Move {@link #mNextSeparatorPos} to the next (unquoted) separator (or the end of the {@link String} if no other
separator exists in {@link #mValue}). | [
"Move",
"{"
] | 3a07bd39455ee669fafac40ec6ac849ef079101c | https://github.com/dmfs/iterators/blob/3a07bd39455ee669fafac40ec6ac849ef079101c/src/main/java/org/dmfs/iterators/CsvIterator.java#L137-L157 | test | Find the next separator in mValue. | Of course, here is the Java code you requested:
```java
private void findNextSeparator()
{
boolean isQuoted = false;
mLastSeparatorPos = mNextSeparatorPos;
while (++mNextSeparatorPos < mValue.length())
{
char c = mValue.charAt(mNextSeparatorPos);
if (c == mSe... |
workplacesystems/utilsj | src/main/java/com/workplacesystems/utilsj/collections/TransactionalHashMap.java | TransactionalHashMap.rollback | public void rollback()
{
if (auto_commit)
return;
String id = getCurrentThreadId();
Entry<K,V> tab[] = table;
for (int i = 0; i < tab.length ; i++)
{
Entry<K,V> prev = table[i];
Entry<K,V> e = prev;
... | java | public void rollback()
{
if (auto_commit)
return;
String id = getCurrentThreadId();
Entry<K,V> tab[] = table;
for (int i = 0; i < tab.length ; i++)
{
Entry<K,V> prev = table[i];
Entry<K,V> e = prev;
... | [
"public",
"void",
"rollback",
"(",
")",
"{",
"if",
"(",
"auto_commit",
")",
"return",
";",
"String",
"id",
"=",
"getCurrentThreadId",
"(",
")",
";",
"Entry",
"<",
"K",
",",
"V",
">",
"tab",
"[",
"]",
"=",
"table",
";",
"for",
"(",
"int",
"i",
"="... | Rolls back the changes to the map. | [
"Rolls",
"back",
"the",
"changes",
"to",
"the",
"map",
"."
] | 1b638be51997eafac4d368c14f62a16624a08d3e | https://github.com/workplacesystems/utilsj/blob/1b638be51997eafac4d368c14f62a16624a08d3e/src/main/java/com/workplacesystems/utilsj/collections/TransactionalHashMap.java#L252-L285 | test | Rollback the table. | Of course, here is the Java code you requested:
```java
public void rollback()
{
if (auto_commit)
return;
String id = getCurrentThreadId();
Entry<K,V> tab[] = table;
for (int i = 0; i < tab.length ; i++)
{
Entry<K... |
RestComm/jain-slee | container/components/components/src/main/java/org/mobicents/slee/container/component/ProfileSpecificationComponentImpl.java | ProfileSpecificationComponentImpl.buildProfileAttributeMap | private void buildProfileAttributeMap() throws DeploymentException {
HashMap<String, ProfileAttribute> map = new HashMap<String, ProfileAttribute>();
Class<?> cmpInterface = getProfileCmpInterfaceClass();
String attributeGetterMethodPrefix = "get";
for (Method method : cmpInterface.getMethods()) {
... | java | private void buildProfileAttributeMap() throws DeploymentException {
HashMap<String, ProfileAttribute> map = new HashMap<String, ProfileAttribute>();
Class<?> cmpInterface = getProfileCmpInterfaceClass();
String attributeGetterMethodPrefix = "get";
for (Method method : cmpInterface.getMethods()) {
... | [
"private",
"void",
"buildProfileAttributeMap",
"(",
")",
"throws",
"DeploymentException",
"{",
"HashMap",
"<",
"String",
",",
"ProfileAttribute",
">",
"map",
"=",
"new",
"HashMap",
"<",
"String",
",",
"ProfileAttribute",
">",
"(",
")",
";",
"Class",
"<",
"?",
... | Builds the profile attribute map using the cmp interface class
@throws DeploymentException | [
"Builds",
"the",
"profile",
"attribute",
"map",
"using",
"the",
"cmp",
"interface",
"class"
] | 0eaa16ff2d4b6faf43f0d99260e88878fd54dee0 | https://github.com/RestComm/jain-slee/blob/0eaa16ff2d4b6faf43f0d99260e88878fd54dee0/container/components/components/src/main/java/org/mobicents/slee/container/component/ProfileSpecificationComponentImpl.java#L181-L224 | test | Build the map of profile attributes from the profile cmp interface. | Of course, here is the Java code you requested:
```java
private void buildProfileAttributeMap() throws DeploymentException {
HashMap<String, ProfileAttribute> map = new HashMap<String, ProfileAttribute>();
Class<?> cmpInterface = getProfileCmpInterfaceClass();
String attributeGetterMethodPrefix = "get";
... |
orientechnologies/orientdb | core/src/main/java/com/orientechnologies/orient/core/storage/impl/local/OAbstractPaginatedStorage.java | OAbstractPaginatedStorage.recordsChangedRecently | public Set<ORecordId> recordsChangedRecently(final int maxEntries) {
final SortedSet<ORecordId> result = new TreeSet<>();
try {
if (!OGlobalConfiguration.STORAGE_TRACK_CHANGED_RECORDS_IN_WAL.getValueAsBoolean()) {
throw new IllegalStateException(
"Cannot find records which were change... | java | public Set<ORecordId> recordsChangedRecently(final int maxEntries) {
final SortedSet<ORecordId> result = new TreeSet<>();
try {
if (!OGlobalConfiguration.STORAGE_TRACK_CHANGED_RECORDS_IN_WAL.getValueAsBoolean()) {
throw new IllegalStateException(
"Cannot find records which were change... | [
"public",
"Set",
"<",
"ORecordId",
">",
"recordsChangedRecently",
"(",
"final",
"int",
"maxEntries",
")",
"{",
"final",
"SortedSet",
"<",
"ORecordId",
">",
"result",
"=",
"new",
"TreeSet",
"<>",
"(",
")",
";",
"try",
"{",
"if",
"(",
"!",
"OGlobalConfigurat... | This method finds all the records changed in the last X transactions.
@param maxEntries Maximum number of entries to check back from last log.
@return A set of record ids of the changed records
@see OGlobalConfiguration#STORAGE_TRACK_CHANGED_RECORDS_IN_WAL | [
"This",
"method",
"finds",
"all",
"the",
"records",
"changed",
"in",
"the",
"last",
"X",
"transactions",
"."
] | d970b12033f0462f0239ea0ad8ed41207e6e26f1 | https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/core/src/main/java/com/orientechnologies/orient/core/storage/impl/local/OAbstractPaginatedStorage.java#L1252-L1354 | test | Returns the records which have been changed recently in the database. | Of course, here is the Java code you requested:
```java
public Set<ORecordId> recordsChangedRecently(final int maxEntries) {
final SortedSet<ORecordId> result = new TreeSet<>();
try {
if (!OGlobalConfiguration.STORAGE_TRACK_CHANGED_RECORDS_IN_WAL.getValueAsBoolean()) {
throw new IllegalStateExce... |
oblac/jodd | jodd-madvoc/src/main/java/jodd/madvoc/component/ScopeDataInspector.java | ScopeDataInspector.buildInjectionPoint | protected InjectionPoint buildInjectionPoint(
final String annotationValue,
final String propertyName,
final Class propertyType,
final Class<? extends MadvocScope> scope) {
final String value = annotationValue.trim();
final String name, targetName;
if (StringUtil.isNotBlank(value)) {
name = value... | java | protected InjectionPoint buildInjectionPoint(
final String annotationValue,
final String propertyName,
final Class propertyType,
final Class<? extends MadvocScope> scope) {
final String value = annotationValue.trim();
final String name, targetName;
if (StringUtil.isNotBlank(value)) {
name = value... | [
"protected",
"InjectionPoint",
"buildInjectionPoint",
"(",
"final",
"String",
"annotationValue",
",",
"final",
"String",
"propertyName",
",",
"final",
"Class",
"propertyType",
",",
"final",
"Class",
"<",
"?",
"extends",
"MadvocScope",
">",
"scope",
")",
"{",
"fina... | Builds injection point. | [
"Builds",
"injection",
"point",
"."
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-madvoc/src/main/java/jodd/madvoc/component/ScopeDataInspector.java#L164-L182 | test | Build an InjectionPoint from the annotation value. | Of course, here is the Java code you requested:
```java
protected InjectionPoint buildInjectionPoint(
final String annotationValue,
final String propertyName,
final Class propertyType,
final Class<? extends MadvocScope> scope) {
final String value = annotationValue.trim();
final String name, targetNam... |
open-korean-text/open-korean-text | src/main/java/org/openkoreantext/processor/OpenKoreanTextProcessorJava.java | OpenKoreanTextProcessorJava.tokensToJavaStringList | public static List<String> tokensToJavaStringList(Seq<KoreanToken> tokens, boolean keepSpace) {
Iterator<KoreanToken> tokenized = tokens.iterator();
List<String> output = new LinkedList<>();
while (tokenized.hasNext()) {
final KoreanToken token = tokenized.next();
if (keepSpace || token.pos() !... | java | public static List<String> tokensToJavaStringList(Seq<KoreanToken> tokens, boolean keepSpace) {
Iterator<KoreanToken> tokenized = tokens.iterator();
List<String> output = new LinkedList<>();
while (tokenized.hasNext()) {
final KoreanToken token = tokenized.next();
if (keepSpace || token.pos() !... | [
"public",
"static",
"List",
"<",
"String",
">",
"tokensToJavaStringList",
"(",
"Seq",
"<",
"KoreanToken",
">",
"tokens",
",",
"boolean",
"keepSpace",
")",
"{",
"Iterator",
"<",
"KoreanToken",
">",
"tokenized",
"=",
"tokens",
".",
"iterator",
"(",
")",
";",
... | Tokenize with the builder options into a String Iterable.
@param tokens Korean tokens (output of tokenize(CharSequence text)).
@return List of token strings. | [
"Tokenize",
"with",
"the",
"builder",
"options",
"into",
"a",
"String",
"Iterable",
"."
] | ed815a224b986e5a5d03fbd8f5c8d154e84e5b40 | https://github.com/open-korean-text/open-korean-text/blob/ed815a224b986e5a5d03fbd8f5c8d154e84e5b40/src/main/java/org/openkoreantext/processor/OpenKoreanTextProcessorJava.java#L131-L142 | test | Tokenize a sequence of tokens into a Java String List | Of course, here is the Java code you requested:
```java
public static List<String> tokensToJavaStringList(Seq<KoreanToken> tokens, boolean keepSpace) {
Iterator<KoreanToken> tokenized = tokens.iterator();
List<String> output = new LinkedList<>();
while (tokenized.hasNext()) {
final KoreanToken token ... |
lessthanoptimal/GeoRegression | main/src/georegression/geometry/UtilPolygons2D_I32.java | UtilPolygons2D_I32.isIdentical | public static boolean isIdentical(Polygon2D_I32 a , Polygon2D_I32 b ) {
if( a.size() != b.size())
return false;
for (int i = 0; i < a.size(); i++) {
if( !a.get(i).equals(b.get(i)) )
return false;
}
return true;
} | java | public static boolean isIdentical(Polygon2D_I32 a , Polygon2D_I32 b ) {
if( a.size() != b.size())
return false;
for (int i = 0; i < a.size(); i++) {
if( !a.get(i).equals(b.get(i)) )
return false;
}
return true;
} | [
"public",
"static",
"boolean",
"isIdentical",
"(",
"Polygon2D_I32",
"a",
",",
"Polygon2D_I32",
"b",
")",
"{",
"if",
"(",
"a",
".",
"size",
"(",
")",
"!=",
"b",
".",
"size",
"(",
")",
")",
"return",
"false",
";",
"for",
"(",
"int",
"i",
"=",
"0",
... | Checks to see if the vertexes of the two polygon's are the same up to the specified tolerance
@param a Polygon
@param b Polygon
@return true if identical up to tolerance or false if not | [
"Checks",
"to",
"see",
"if",
"the",
"vertexes",
"of",
"the",
"two",
"polygon",
"s",
"are",
"the",
"same",
"up",
"to",
"the",
"specified",
"tolerance"
] | c067cd44a4e95bd826119f6e658bd82386ef289f | https://github.com/lessthanoptimal/GeoRegression/blob/c067cd44a4e95bd826119f6e658bd82386ef289f/main/src/georegression/geometry/UtilPolygons2D_I32.java#L184-L193 | test | Checks if two polygons are identical. | Of course, here is the Java code you requested:
```java
public static boolean isIdentical(Polygon2D_I32 a , Polygon2D_I32 b ) {
if( a.size() != b.size())
return false;
for (int i = 0; i < a.size(); i++) {
if( !a.get(i).equals(b.get(i)) )
return false;
}
return true;
}
```
Hope this helps! |
patrickfav/slf4j-timber | slf4j-timber/src/main/java/org/slf4j/impl/TimberAndroidLoggerAdapter.java | TimberAndroidLoggerAdapter.debug | public void debug(String format, Object arg) {
formatAndLog(Log.DEBUG, format, arg);
} | java | public void debug(String format, Object arg) {
formatAndLog(Log.DEBUG, format, arg);
} | [
"public",
"void",
"debug",
"(",
"String",
"format",
",",
"Object",
"arg",
")",
"{",
"formatAndLog",
"(",
"Log",
".",
"DEBUG",
",",
"format",
",",
"arg",
")",
";",
"}"
] | Log a message at level DEBUG according to the specified format and argument.
<p>
<p>
This form avoids superfluous object creation when the logger is disabled
for level DEBUG.
</p>
@param format the format string
@param arg the argument | [
"Log",
"a",
"message",
"at",
"level",
"DEBUG",
"according",
"to",
"the",
"specified",
"format",
"and",
"argument",
".",
"<p",
">",
"<p",
">",
"This",
"form",
"avoids",
"superfluous",
"object",
"creation",
"when",
"the",
"logger",
"is",
"disabled",
"for",
"... | bb6be99a0ee7c6d764c58b00e7d46f94d5b86160 | https://github.com/patrickfav/slf4j-timber/blob/bb6be99a0ee7c6d764c58b00e7d46f94d5b86160/slf4j-timber/src/main/java/org/slf4j/impl/TimberAndroidLoggerAdapter.java#L195-L197 | test | Log a message at DEBUG level. | Of course, here is the Java code you requested:
```java
public void debug(String format, Object arg) {
formatAndLog(Log.DEBUG, format, arg);
}
```
Hope this helps! |
RestComm/jain-slee | container/timers/src/main/java/org/mobicents/slee/runtime/facilities/TimerFacilityImpl.java | TimerFacilityImpl.cancelTimer | public void cancelTimer(TimerID timerID) throws NullPointerException,
TransactionRolledbackLocalException, FacilityException {
if (logger.isDebugEnabled()) {
logger.debug("cancelTimer: timerID = "+timerID);
}
if (timerID == null)
throw new NullPointerException("Null TimerID");
SleeTran... | java | public void cancelTimer(TimerID timerID) throws NullPointerException,
TransactionRolledbackLocalException, FacilityException {
if (logger.isDebugEnabled()) {
logger.debug("cancelTimer: timerID = "+timerID);
}
if (timerID == null)
throw new NullPointerException("Null TimerID");
SleeTran... | [
"public",
"void",
"cancelTimer",
"(",
"TimerID",
"timerID",
")",
"throws",
"NullPointerException",
",",
"TransactionRolledbackLocalException",
",",
"FacilityException",
"{",
"if",
"(",
"logger",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"logger",
".",
"debug",
"(... | /*
(non-Javadoc)
@see javax.slee.facilities.TimerFacility#cancelTimer(javax.slee.facilities.TimerID) | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | 0eaa16ff2d4b6faf43f0d99260e88878fd54dee0 | https://github.com/RestComm/jain-slee/blob/0eaa16ff2d4b6faf43f0d99260e88878fd54dee0/container/timers/src/main/java/org/mobicents/slee/runtime/facilities/TimerFacilityImpl.java#L201-L225 | test | Cancels a timer. | Of course, here is the Java code you requested:
```java
public void cancelTimer(TimerID timerID) throws NullPointerException,
TransactionRolledbackLocalException, FacilityException {
if (logger.isDebugEnabled()) {
logger.debug("cancelTimer: timerID = "+timerID);
}
if (timerID == null)
thro... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.