repo stringlengths 7 59 | path stringlengths 17 234 | func_name stringlengths 3 117 | original_string stringlengths 63 281k | language stringclasses 1
value | code stringlengths 63 281k | code_tokens listlengths 20 16.3k | docstring stringlengths 1 34k | docstring_tokens listlengths 1 3.44k | sha stringlengths 40 40 | url stringlengths 106 339 | partition stringclasses 3
values | summary stringlengths 3 248 | output stringlengths 142 281k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
apache/groovy | src/main/java/org/codehaus/groovy/runtime/IOGroovyMethods.java | IOGroovyMethods.newObjectInputStream | public static ObjectInputStream newObjectInputStream(InputStream inputStream, final ClassLoader classLoader) throws IOException {
return new ObjectInputStream(inputStream) {
protected Class<?> resolveClass(ObjectStreamClass desc) throws IOException, ClassNotFoundException {
return Cl... | java | public static ObjectInputStream newObjectInputStream(InputStream inputStream, final ClassLoader classLoader) throws IOException {
return new ObjectInputStream(inputStream) {
protected Class<?> resolveClass(ObjectStreamClass desc) throws IOException, ClassNotFoundException {
return Cl... | [
"public",
"static",
"ObjectInputStream",
"newObjectInputStream",
"(",
"InputStream",
"inputStream",
",",
"final",
"ClassLoader",
"classLoader",
")",
"throws",
"IOException",
"{",
"return",
"new",
"ObjectInputStream",
"(",
"inputStream",
")",
"{",
"protected",
"Class",
... | Create an object input stream for this input stream using the given class loader.
@param inputStream an input stream
@param classLoader the class loader to use when loading the class
@return an object input stream
@throws IOException if an IOException occurs.
@since 1.5.0 | [
"Create",
"an",
"object",
"input",
"stream",
"for",
"this",
"input",
"stream",
"using",
"the",
"given",
"class",
"loader",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/IOGroovyMethods.java#L280-L287 | train | Create an ObjectInputStream for an object input stream. | Of course, here is the Java code you requested:
```java
public static ObjectInputStream newObjectInputStream(InputStream inputStream, final ClassLoader classLoader) throws IOException {
return new ObjectInputStream(inputStream) {
protected Class<?> resolveClass(ObjectStreamClass desc) throws IOExce... |
atomix/atomix | protocols/gossip/src/main/java/io/atomix/protocols/gossip/map/AntiEntropyMapDelegate.java | AntiEntropyMapDelegate.handleBootstrap | private CompletableFuture<Void> handleBootstrap(MemberId peer) {
LOGGER.trace("Received bootstrap request from {} for {}", peer, bootstrapMessageSubject);
Function<List<UpdateEntry>, CompletableFuture<Void>> sendUpdates = updates -> {
LOGGER.trace("Initializing {} with {} entries", peer, updates.size());... | java | private CompletableFuture<Void> handleBootstrap(MemberId peer) {
LOGGER.trace("Received bootstrap request from {} for {}", peer, bootstrapMessageSubject);
Function<List<UpdateEntry>, CompletableFuture<Void>> sendUpdates = updates -> {
LOGGER.trace("Initializing {} with {} entries", peer, updates.size());... | [
"private",
"CompletableFuture",
"<",
"Void",
">",
"handleBootstrap",
"(",
"MemberId",
"peer",
")",
"{",
"LOGGER",
".",
"trace",
"(",
"\"Received bootstrap request from {} for {}\"",
",",
"peer",
",",
"bootstrapMessageSubject",
")",
";",
"Function",
"<",
"List",
"<",... | Handles a bootstrap request from a peer.
<p>
When handling a bootstrap request from a peer, the node sends batches of entries back to the peer and completes the
bootstrap request once all batches have been received and processed.
@param peer the peer that sent the bootstrap request
@return a future to be completed onc... | [
"Handles",
"a",
"bootstrap",
"request",
"from",
"a",
"peer",
".",
"<p",
">",
"When",
"handling",
"a",
"bootstrap",
"request",
"from",
"a",
"peer",
"the",
"node",
"sends",
"batches",
"of",
"entries",
"back",
"to",
"the",
"peer",
"and",
"completes",
"the",
... | 3a94b7c80576d762dd0d396d4645df07a0b37c31 | https://github.com/atomix/atomix/blob/3a94b7c80576d762dd0d396d4645df07a0b37c31/protocols/gossip/src/main/java/io/atomix/protocols/gossip/map/AntiEntropyMapDelegate.java#L809-L845 | train | Handle a bootstrap request. | Of course, here is the Java code you requested:
```java
private CompletableFuture<Void> handleBootstrap(MemberId peer) {
LOGGER.trace("Received bootstrap request from {} for {}", peer, bootstrapMessageSubject);
Function<List<UpdateEntry>, CompletableFuture<Void>> sendUpdates = updates -> {
LOGGER.trace(... |
DataSketches/sketches-core | src/main/java/com/yahoo/sketches/hll/HllEstimators.java | HllEstimators.getHllBitMapEstimate | private static final double getHllBitMapEstimate(
final int lgConfigK, final int curMin, final int numAtCurMin) {
final int configK = 1 << lgConfigK;
final int numUnhitBuckets = (curMin == 0) ? numAtCurMin : 0;
//This will eventually go away.
if (numUnhitBuckets == 0) {
return configK * Ma... | java | private static final double getHllBitMapEstimate(
final int lgConfigK, final int curMin, final int numAtCurMin) {
final int configK = 1 << lgConfigK;
final int numUnhitBuckets = (curMin == 0) ? numAtCurMin : 0;
//This will eventually go away.
if (numUnhitBuckets == 0) {
return configK * Ma... | [
"private",
"static",
"final",
"double",
"getHllBitMapEstimate",
"(",
"final",
"int",
"lgConfigK",
",",
"final",
"int",
"curMin",
",",
"final",
"int",
"numAtCurMin",
")",
"{",
"final",
"int",
"configK",
"=",
"1",
"<<",
"lgConfigK",
";",
"final",
"int",
"numUn... | In C: again-two-registers.c hhb_get_improved_linear_counting_estimate L1274 | [
"In",
"C",
":",
"again",
"-",
"two",
"-",
"registers",
".",
"c",
"hhb_get_improved_linear_counting_estimate",
"L1274"
] | 900c8c9668a1e2f1d54d453e956caad54702e540 | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/hll/HllEstimators.java#L140-L152 | train | Get the HLL bit map estimate. | Of course, here is the Java code you requested:
```java
private static final double getHllBitMapEstimate(
final int lgConfigK, final int curMin, final int numAtCurMin) {
final int configK = 1 << lgConfigK;
final int numUnhitBuckets = (curMin == 0) ? numAtCurMin : 0;
//This will eventually go away.
... |
Azure/azure-sdk-for-java | appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServiceEnvironmentsInner.java | AppServiceEnvironmentsInner.updateWorkerPoolWithServiceResponseAsync | public Observable<ServiceResponse<WorkerPoolResourceInner>> updateWorkerPoolWithServiceResponseAsync(String resourceGroupName, String name, String workerPoolName, WorkerPoolResourceInner workerPoolEnvelope) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGrou... | java | public Observable<ServiceResponse<WorkerPoolResourceInner>> updateWorkerPoolWithServiceResponseAsync(String resourceGroupName, String name, String workerPoolName, WorkerPoolResourceInner workerPoolEnvelope) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGrou... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"WorkerPoolResourceInner",
">",
">",
"updateWorkerPoolWithServiceResponseAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"name",
",",
"String",
"workerPoolName",
",",
"WorkerPoolResourceInner",
"workerPoolEnvelop... | Create or update a worker pool.
Create or update a worker pool.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param name Name of the App Service Environment.
@param workerPoolName Name of the worker pool.
@param workerPoolEnvelope Properties of the worker pool.
@throws IllegalArgu... | [
"Create",
"or",
"update",
"a",
"worker",
"pool",
".",
"Create",
"or",
"update",
"a",
"worker",
"pool",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServiceEnvironmentsInner.java#L5438-L5470 | train | Updates an existing Crafter Central application worker pool. | Of course, here is the Java code you requested:
```java
public Observable<ServiceResponse<WorkerPoolResourceInner>> updateWorkerPoolWithServiceResponseAsync(String resourceGroupName, String name, String workerPoolName, WorkerPoolResourceInner workerPoolEnvelope) {
if (resourceGroupName == null) {
t... |
apiman/apiman | manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/audit/AuditUtils.java | AuditUtils.asString_ApiPlanBeans | public static String asString_ApiPlanBeans(Set<ApiPlanBean> plans) {
TreeSet<ApiPlanBean> sortedPlans = new TreeSet<>(new Comparator<ApiPlanBean>() {
@Override
public int compare(ApiPlanBean o1, ApiPlanBean o2) {
String p1 = o1.getPlanId() + ":" + o1.getVersion(); //$NON-... | java | public static String asString_ApiPlanBeans(Set<ApiPlanBean> plans) {
TreeSet<ApiPlanBean> sortedPlans = new TreeSet<>(new Comparator<ApiPlanBean>() {
@Override
public int compare(ApiPlanBean o1, ApiPlanBean o2) {
String p1 = o1.getPlanId() + ":" + o1.getVersion(); //$NON-... | [
"public",
"static",
"String",
"asString_ApiPlanBeans",
"(",
"Set",
"<",
"ApiPlanBean",
">",
"plans",
")",
"{",
"TreeSet",
"<",
"ApiPlanBean",
">",
"sortedPlans",
"=",
"new",
"TreeSet",
"<>",
"(",
"new",
"Comparator",
"<",
"ApiPlanBean",
">",
"(",
")",
"{",
... | Converts the list of plans to a string for display/comparison.
@param plans the plans
@return the plans as a string | [
"Converts",
"the",
"list",
"of",
"plans",
"to",
"a",
"string",
"for",
"display",
"/",
"comparison",
"."
] | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/audit/AuditUtils.java#L806-L829 | train | Returns a string representation of the given set of ApiPlanBeans. | Of course, here is the Java code you requested:
```java
public static String asString_ApiPlanBeans(Set<ApiPlanBean> plans) {
TreeSet<ApiPlanBean> sortedPlans = new TreeSet<>(new Comparator<ApiPlanBean>() {
@Override
public int compare(ApiPlanBean o1, ApiPlanBean o2) {
St... |
Bedework/bw-util | bw-util-servlet/src/main/java/org/bedework/util/servlet/ReqUtil.java | ReqUtil.getSessionAttr | public Object getSessionAttr(final String attrName) {
final HttpSession sess = request.getSession(false);
if (sess == null) {
return null;
}
return sess.getAttribute(attrName);
} | java | public Object getSessionAttr(final String attrName) {
final HttpSession sess = request.getSession(false);
if (sess == null) {
return null;
}
return sess.getAttribute(attrName);
} | [
"public",
"Object",
"getSessionAttr",
"(",
"final",
"String",
"attrName",
")",
"{",
"final",
"HttpSession",
"sess",
"=",
"request",
".",
"getSession",
"(",
"false",
")",
";",
"if",
"(",
"sess",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return"... | Return the value of a named session attribute.
@param attrName Name of the attribute
@return Object Attribute value or null | [
"Return",
"the",
"value",
"of",
"a",
"named",
"session",
"attribute",
"."
] | f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad | https://github.com/Bedework/bw-util/blob/f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad/bw-util-servlet/src/main/java/org/bedework/util/servlet/ReqUtil.java#L309-L317 | train | Gets the session attribute. | Of course, here is the Java code you requested:
```java
public Object getSessionAttr(final String attrName) {
final HttpSession sess = request.getSession(false);
if (sess == null) {
return null;
}
return sess.getAttribute(attrName);
}
```
Hope this helps! |
VoltDB/voltdb | src/frontend/org/voltdb/expressions/AbstractExpression.java | AbstractExpression.validateExprsForIndexesAndMVs | public static boolean validateExprsForIndexesAndMVs(List<AbstractExpression> checkList, StringBuffer msg, boolean isMV) {
for (AbstractExpression expr : checkList) {
if (!expr.isValidExprForIndexesAndMVs(msg, isMV)) {
return false;
}
}
return true;
} | java | public static boolean validateExprsForIndexesAndMVs(List<AbstractExpression> checkList, StringBuffer msg, boolean isMV) {
for (AbstractExpression expr : checkList) {
if (!expr.isValidExprForIndexesAndMVs(msg, isMV)) {
return false;
}
}
return true;
} | [
"public",
"static",
"boolean",
"validateExprsForIndexesAndMVs",
"(",
"List",
"<",
"AbstractExpression",
">",
"checkList",
",",
"StringBuffer",
"msg",
",",
"boolean",
"isMV",
")",
"{",
"for",
"(",
"AbstractExpression",
"expr",
":",
"checkList",
")",
"{",
"if",
"(... | Return true if the all of the expressions in the list can be part of
an index expression or in group by and where clause of MV. As with
validateExprForIndexesAndMVs for individual expression, the StringBuffer
parameter, msg, contains the name of the index. Error messages should
be appended to it.
@param checkList
@p... | [
"Return",
"true",
"if",
"the",
"all",
"of",
"the",
"expressions",
"in",
"the",
"list",
"can",
"be",
"part",
"of",
"an",
"index",
"expression",
"or",
"in",
"group",
"by",
"and",
"where",
"clause",
"of",
"MV",
".",
"As",
"with",
"validateExprForIndexesAndMVs... | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/expressions/AbstractExpression.java#L1390-L1397 | train | Validate the list of expressions for indexes and MVs. | Of course, here is the Java code you requested:
```java
public static boolean validateExprsForIndexesAndMVs(List<AbstractExpression> checkList, StringBuffer msg, boolean isMV) {
for (AbstractExpression expr : checkList) {
if (!expr.isValidExprForIndexesAndMVs(msg, isMV)) {
return fa... |
vipshop/vjtools | vjkit/src/main/java/com/vip/vjtools/vjkit/collection/CollectionUtil.java | CollectionUtil.bottomN | public static <T> List<T> bottomN(Iterable<T> coll, int n, Comparator<? super T> comp) {
return Ordering.from(comp).leastOf(coll, n);
} | java | public static <T> List<T> bottomN(Iterable<T> coll, int n, Comparator<? super T> comp) {
return Ordering.from(comp).leastOf(coll, n);
} | [
"public",
"static",
"<",
"T",
">",
"List",
"<",
"T",
">",
"bottomN",
"(",
"Iterable",
"<",
"T",
">",
"coll",
",",
"int",
"n",
",",
"Comparator",
"<",
"?",
"super",
"T",
">",
"comp",
")",
"{",
"return",
"Ordering",
".",
"from",
"(",
"comp",
")",
... | 返回Iterable中最小的N个对象, back by guava. | [
"返回Iterable中最小的N个对象",
"back",
"by",
"guava",
"."
] | 60c743da35913d72f37f2d79afa90ad2bf73cb89 | https://github.com/vipshop/vjtools/blob/60c743da35913d72f37f2d79afa90ad2bf73cb89/vjkit/src/main/java/com/vip/vjtools/vjkit/collection/CollectionUtil.java#L178-L180 | train | Returns the list of the most n elements of the iterable coll sorted by the given comparator. | Of course, here is the Java code you requested:
```java
public static <T> List<T> bottomN(Iterable<T> coll, int n, Comparator<? super T> comp) {
return Ordering.from(comp).leastOf(coll, n);
}
```
Hope this helps! |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java | JavacParser.classOrInterfaceOrEnumDeclaration | protected JCStatement classOrInterfaceOrEnumDeclaration(JCModifiers mods, Comment dc) {
if (token.kind == CLASS) {
return classDeclaration(mods, dc);
} else if (token.kind == INTERFACE) {
return interfaceDeclaration(mods, dc);
} else if (token.kind == ENUM) {
... | java | protected JCStatement classOrInterfaceOrEnumDeclaration(JCModifiers mods, Comment dc) {
if (token.kind == CLASS) {
return classDeclaration(mods, dc);
} else if (token.kind == INTERFACE) {
return interfaceDeclaration(mods, dc);
} else if (token.kind == ENUM) {
... | [
"protected",
"JCStatement",
"classOrInterfaceOrEnumDeclaration",
"(",
"JCModifiers",
"mods",
",",
"Comment",
"dc",
")",
"{",
"if",
"(",
"token",
".",
"kind",
"==",
"CLASS",
")",
"{",
"return",
"classDeclaration",
"(",
"mods",
",",
"dc",
")",
";",
"}",
"else"... | ClassOrInterfaceOrEnumDeclaration = ModifiersOpt
(ClassDeclaration | InterfaceDeclaration | EnumDeclaration)
@param mods Any modifiers starting the class or interface declaration
@param dc The documentation comment for the class, or null. | [
"ClassOrInterfaceOrEnumDeclaration",
"=",
"ModifiersOpt",
"(",
"ClassDeclaration",
"|",
"InterfaceDeclaration",
"|",
"EnumDeclaration",
")"
] | a53d069bbdb2c60232ed3811c19b65e41c3e60e0 | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java#L3350-L3374 | train | Class or InterfaceOrEnumDeclaration | Of course, here is the Java code you requested:
```java
protected JCStatement classOrInterfaceOrEnumDeclaration(JCModifiers mods, Comment dc) {
if (token.kind == CLASS) {
return classDeclaration(mods, dc);
} else if (token.kind == INTERFACE) {
return interfaceDeclaration(mods, d... |
augustd/burp-suite-utils | src/main/java/com/codemagi/burp/RuleTableComponent.java | RuleTableComponent.resetButtonActionPerformed | private void resetButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_resetButtonActionPerformed
//clear the existing values from the table
DefaultTableModel model = (DefaultTableModel) rules.getModel();
model.setRowCount(0);
//remove existing match rule... | java | private void resetButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_resetButtonActionPerformed
//clear the existing values from the table
DefaultTableModel model = (DefaultTableModel) rules.getModel();
model.setRowCount(0);
//remove existing match rule... | [
"private",
"void",
"resetButtonActionPerformed",
"(",
"java",
".",
"awt",
".",
"event",
".",
"ActionEvent",
"evt",
")",
"{",
"//GEN-FIRST:event_resetButtonActionPerformed",
"//clear the existing values from the table ",
"DefaultTableModel",
"model",
"=",
"(",
"DefaultTable... | GEN-LAST:event_removeBtnActionPerformed | [
"GEN",
"-",
"LAST",
":",
"event_removeBtnActionPerformed"
] | 5e34a6b9147f5705382f98049dd9e4f387b78629 | https://github.com/augustd/burp-suite-utils/blob/5e34a6b9147f5705382f98049dd9e4f387b78629/src/main/java/com/codemagi/burp/RuleTableComponent.java#L435-L449 | train | The reset button has been pressed. Clear the existing values from the table
and load the defaults from the URLTextField. | Of course, here is the Java code you requested:
```java
private void resetButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_resetButtonActionPerformed
//clear the existing values from the table
DefaultTableModel model = (DefaultTableModel) rules.getModel();
model.setR... |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/Spliterators.java | Spliterators.spliterator | public static <T> Spliterator<T> spliterator(Object[] array, int fromIndex, int toIndex,
int additionalCharacteristics) {
checkFromToBounds(Objects.requireNonNull(array).length, fromIndex, toIndex);
return new ArraySpliterator<>(array, fromIndex, toIndex,... | java | public static <T> Spliterator<T> spliterator(Object[] array, int fromIndex, int toIndex,
int additionalCharacteristics) {
checkFromToBounds(Objects.requireNonNull(array).length, fromIndex, toIndex);
return new ArraySpliterator<>(array, fromIndex, toIndex,... | [
"public",
"static",
"<",
"T",
">",
"Spliterator",
"<",
"T",
">",
"spliterator",
"(",
"Object",
"[",
"]",
"array",
",",
"int",
"fromIndex",
",",
"int",
"toIndex",
",",
"int",
"additionalCharacteristics",
")",
"{",
"checkFromToBounds",
"(",
"Objects",
".",
"... | Creates a {@code Spliterator} covering a range of elements of a given
array, using a customized set of spliterator characteristics.
<p>This method is provided as an implementation convenience for
Spliterators which store portions of their elements in arrays, and need
fine control over Spliterator characteristics. Mos... | [
"Creates",
"a",
"{",
"@code",
"Spliterator",
"}",
"covering",
"a",
"range",
"of",
"elements",
"of",
"a",
"given",
"array",
"using",
"a",
"customized",
"set",
"of",
"spliterator",
"characteristics",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/Spliterators.java#L175-L179 | train | Create a new spliterator from the given array. | Of course, here is the Java code you requested:
```java
public static <T> Spliterator<T> spliterator(Object[] array, int fromIndex, int toIndex,
int additionalCharacteristics) {
checkFromToBounds(Objects.requireNonNull(array).length, fromIndex, toIndex);
... |
oblac/jodd | jodd-decora/src/main/java/jodd/decora/DecoraServletFilter.java | DecoraServletFilter.init | @Override
public void init(final FilterConfig filterConfig) throws ServletException {
//
final String decoraManagerClass = filterConfig.getInitParameter(PARAM_DECORA_MANAGER);
if (decoraManagerClass != null) {
try {
final Class decoraManagerType = ClassLoaderUtil.loadClass(decoraManagerClass);
deco... | java | @Override
public void init(final FilterConfig filterConfig) throws ServletException {
//
final String decoraManagerClass = filterConfig.getInitParameter(PARAM_DECORA_MANAGER);
if (decoraManagerClass != null) {
try {
final Class decoraManagerType = ClassLoaderUtil.loadClass(decoraManagerClass);
deco... | [
"@",
"Override",
"public",
"void",
"init",
"(",
"final",
"FilterConfig",
"filterConfig",
")",
"throws",
"ServletException",
"{",
"//",
"final",
"String",
"decoraManagerClass",
"=",
"filterConfig",
".",
"getInitParameter",
"(",
"PARAM_DECORA_MANAGER",
")",
";",
"if",... | Initializes Decora filter. Loads manager and parser from init parameters. | [
"Initializes",
"Decora",
"filter",
".",
"Loads",
"manager",
"and",
"parser",
"from",
"init",
"parameters",
"."
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-decora/src/main/java/jodd/decora/DecoraServletFilter.java#L85-L127 | test | Initialize the DecoraManager and DecoraParser. | Of course, here is the Java code you requested:
```java
@Override
public void init(final FilterConfig filterConfig) throws ServletException {
//
final String decoraManagerClass = filterConfig.getInitParameter(PARAM_DECORA_MANAGER);
if (decoraManagerClass != null) {
try {
final Class decoraManagerType ... |
micronaut-projects/micronaut-core | core/src/main/java/io/micronaut/core/util/StringUtils.java | StringUtils.hasText | public static boolean hasText(@Nullable CharSequence str) {
if (isEmpty(str)) {
return false;
}
int strLen = str.length();
for (int i = 0; i < strLen; i++) {
if (!Character.isWhitespace(str.charAt(i))) {
return true;
}
}
... | java | public static boolean hasText(@Nullable CharSequence str) {
if (isEmpty(str)) {
return false;
}
int strLen = str.length();
for (int i = 0; i < strLen; i++) {
if (!Character.isWhitespace(str.charAt(i))) {
return true;
}
}
... | [
"public",
"static",
"boolean",
"hasText",
"(",
"@",
"Nullable",
"CharSequence",
"str",
")",
"{",
"if",
"(",
"isEmpty",
"(",
"str",
")",
")",
"{",
"return",
"false",
";",
"}",
"int",
"strLen",
"=",
"str",
".",
"length",
"(",
")",
";",
"for",
"(",
"i... | Return whether the given string has non whitespace characters.
@param str The string
@return True if is | [
"Return",
"whether",
"the",
"given",
"string",
"has",
"non",
"whitespace",
"characters",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/core/src/main/java/io/micronaut/core/util/StringUtils.java#L83-L95 | train | Check if a CharSequence is a non - empty string and contains only whitespace characters. | Of course, here is the Java code you requested:
```java
public static boolean hasText(@Nullable CharSequence str) {
if (isEmpty(str)) {
return false;
}
int strLen = str.length();
for (int i = 0; i < strLen; i++) {
if (!Character.isWhitespace(str.charAt(i))) {
... |
atomix/atomix | storage/src/main/java/io/atomix/storage/journal/JournalSegmentFile.java | JournalSegmentFile.createSegmentFile | static File createSegmentFile(String name, File directory, long id) {
return new File(directory, String.format("%s-%d.log", checkNotNull(name, "name cannot be null"), id));
} | java | static File createSegmentFile(String name, File directory, long id) {
return new File(directory, String.format("%s-%d.log", checkNotNull(name, "name cannot be null"), id));
} | [
"static",
"File",
"createSegmentFile",
"(",
"String",
"name",
",",
"File",
"directory",
",",
"long",
"id",
")",
"{",
"return",
"new",
"File",
"(",
"directory",
",",
"String",
".",
"format",
"(",
"\"%s-%d.log\"",
",",
"checkNotNull",
"(",
"name",
",",
"\"na... | Creates a segment file for the given directory, log name, segment ID, and segment version. | [
"Creates",
"a",
"segment",
"file",
"for",
"the",
"given",
"directory",
"log",
"name",
"segment",
"ID",
"and",
"segment",
"version",
"."
] | 3a94b7c80576d762dd0d396d4645df07a0b37c31 | https://github.com/atomix/atomix/blob/3a94b7c80576d762dd0d396d4645df07a0b37c31/storage/src/main/java/io/atomix/storage/journal/JournalSegmentFile.java#L75-L77 | train | Creates a segment file. | Of course, here is the Java code you requested:
```java
static File createSegmentFile(String name, File directory, long id) {
return new File(directory, String.format("%s-%d.log", checkNotNull(name, "name cannot be null"), id));
}
```
Hope this helps! |
google/error-prone-javac | src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlTree.java | HtmlTree.DD | public static HtmlTree DD(Content body) {
HtmlTree htmltree = new HtmlTree(HtmlTag.DD, nullCheck(body));
return htmltree;
} | java | public static HtmlTree DD(Content body) {
HtmlTree htmltree = new HtmlTree(HtmlTag.DD, nullCheck(body));
return htmltree;
} | [
"public",
"static",
"HtmlTree",
"DD",
"(",
"Content",
"body",
")",
"{",
"HtmlTree",
"htmltree",
"=",
"new",
"HtmlTree",
"(",
"HtmlTag",
".",
"DD",
",",
"nullCheck",
"(",
"body",
")",
")",
";",
"return",
"htmltree",
";",
"}"
] | Generates a DD tag with some content.
@param body content for the tag
@return an HtmlTree object for the DD tag | [
"Generates",
"a",
"DD",
"tag",
"with",
"some",
"content",
"."
] | a53d069bbdb2c60232ed3811c19b65e41c3e60e0 | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlTree.java#L310-L313 | train | Generates a DD tag with some content. | Of course, here is the Java code you requested:
```java
public static HtmlTree DD(Content body) {
HtmlTree htmltree = new HtmlTree(HtmlTag.DD, nullCheck(body));
return htmltree;
}
```
Hope this helps! |
JOML-CI/JOML | src/org/joml/Vector2i.java | Vector2i.get | public IntBuffer get(int index, IntBuffer buffer) {
MemUtil.INSTANCE.put(this, index, buffer);
return buffer;
} | java | public IntBuffer get(int index, IntBuffer buffer) {
MemUtil.INSTANCE.put(this, index, buffer);
return buffer;
} | [
"public",
"IntBuffer",
"get",
"(",
"int",
"index",
",",
"IntBuffer",
"buffer",
")",
"{",
"MemUtil",
".",
"INSTANCE",
".",
"put",
"(",
"this",
",",
"index",
",",
"buffer",
")",
";",
"return",
"buffer",
";",
"}"
] | /* (non-Javadoc)
@see org.joml.Vector2ic#get(int, java.nio.IntBuffer) | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | ce2652fc236b42bda3875c591f8e6645048a678f | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Vector2i.java#L410-L413 | train | Get the value at the given index in the buffer. | Of course, here is the Java code you requested:
```java
public IntBuffer get(int index, IntBuffer buffer) {
MemUtil.INSTANCE.put(this, index, buffer);
return buffer;
}
```
Hope this helps! |
sagiegurari/fax4j | src/main/java/org/fax4j/spi/windows/WindowsProcessFaxClientSpi.java | WindowsProcessFaxClientSpi.createProcessCommandArgumentsForSubmitFaxJob | protected String createProcessCommandArgumentsForSubmitFaxJob(FaxJob faxJob)
{
//get values from fax job
String targetAddress=faxJob.getTargetAddress();
String targetName=faxJob.getTargetName();
String senderName=faxJob.getSenderName();
File file=faxJob.getFile();
Str... | java | protected String createProcessCommandArgumentsForSubmitFaxJob(FaxJob faxJob)
{
//get values from fax job
String targetAddress=faxJob.getTargetAddress();
String targetName=faxJob.getTargetName();
String senderName=faxJob.getSenderName();
File file=faxJob.getFile();
Str... | [
"protected",
"String",
"createProcessCommandArgumentsForSubmitFaxJob",
"(",
"FaxJob",
"faxJob",
")",
"{",
"//get values from fax job",
"String",
"targetAddress",
"=",
"faxJob",
".",
"getTargetAddress",
"(",
")",
";",
"String",
"targetName",
"=",
"faxJob",
".",
"getTarge... | This function creates and returns the command line arguments for the fax4j
external exe when running the submit fax job action.
@param faxJob
The fax job object
@return The full command line arguments line | [
"This",
"function",
"creates",
"and",
"returns",
"the",
"command",
"line",
"arguments",
"for",
"the",
"fax4j",
"external",
"exe",
"when",
"running",
"the",
"submit",
"fax",
"job",
"action",
"."
] | 42fa51acabe7bf279e27ab3dd1cf76146b27955f | https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/spi/windows/WindowsProcessFaxClientSpi.java#L341-L375 | train | This function creates the command line arguments for the submit fax job. | Of course, here is the Java code you requested:
```java
protected String createProcessCommandArgumentsForSubmitFaxJob(FaxJob faxJob)
{
//get values from fax job
String targetAddress=faxJob.getTargetAddress();
String targetName=faxJob.getTargetName();
String senderName=faxJob.getSend... |
netscaler/sdx_nitro | src/main/java/com/citrix/sdx/nitro/resource/config/mps/snmp_trap.java | snmp_trap.update | public static snmp_trap update(nitro_service client, snmp_trap resource) throws Exception
{
resource.validate("modify");
return ((snmp_trap[]) resource.update_resource(client))[0];
} | java | public static snmp_trap update(nitro_service client, snmp_trap resource) throws Exception
{
resource.validate("modify");
return ((snmp_trap[]) resource.update_resource(client))[0];
} | [
"public",
"static",
"snmp_trap",
"update",
"(",
"nitro_service",
"client",
",",
"snmp_trap",
"resource",
")",
"throws",
"Exception",
"{",
"resource",
".",
"validate",
"(",
"\"modify\"",
")",
";",
"return",
"(",
"(",
"snmp_trap",
"[",
"]",
")",
"resource",
".... | <pre>
Use this operation to modify snmp trap destination.
</pre> | [
"<pre",
">",
"Use",
"this",
"operation",
"to",
"modify",
"snmp",
"trap",
"destination",
".",
"<",
"/",
"pre",
">"
] | c840919f1a8f7c0a5634c0f23d34fa14d1765ff1 | https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/mps/snmp_trap.java#L218-L222 | train | Use this API to update snmp_trap. | Of course, here is the Java code you requested:
```java
public static snmp_trap update(nitro_service client, snmp_trap resource) throws Exception
{
resource.validate("modify");
return ((snmp_trap[]) resource.update_resource(client))[0];
}
```
Hope this helps! |
facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/protocol/DatanodeInfo.java | DatanodeInfo.write | public void write(DataOutput out) throws IOException {
super.write(out);
//TODO: move it to DatanodeID once DatanodeID is not stored in FSImage
out.writeShort(ipcPort);
out.writeLong(capacity);
out.writeLong(dfsUsed);
out.writeLong(remaining);
out.writeLong(lastUpdate);
out.writeInt(xc... | java | public void write(DataOutput out) throws IOException {
super.write(out);
//TODO: move it to DatanodeID once DatanodeID is not stored in FSImage
out.writeShort(ipcPort);
out.writeLong(capacity);
out.writeLong(dfsUsed);
out.writeLong(remaining);
out.writeLong(lastUpdate);
out.writeInt(xc... | [
"public",
"void",
"write",
"(",
"DataOutput",
"out",
")",
"throws",
"IOException",
"{",
"super",
".",
"write",
"(",
"out",
")",
";",
"//TODO: move it to DatanodeID once DatanodeID is not stored in FSImage",
"out",
".",
"writeShort",
"(",
"ipcPort",
")",
";",
"out",
... | {@inheritDoc} | [
"{"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/protocol/DatanodeInfo.java#L434-L448 | train | Write the data of this ClusterInfo to the specified output stream. | Of course, here is the Java code you requested:
```java
public void write(DataOutput out) throws IOException {
super.write(out);
//TODO: move it to DatanodeID once DatanodeID is not stored in FSImage
out.writeShort(ipcPort);
out.writeLong(capacity);
out.writeLong(dfsUsed);
out.writeLong(remai... |
ecclesia/kipeto | kipeto-core/src/main/java/de/ecclesia/kipeto/repository/WritingRepository.java | WritingRepository.createReference | public void createReference(String reference, String id) throws IOException {
Assert.isNotNull(reference);
Assert.isFalse(reference.length() == 0, "Die Referenz darf nicht leer sein");
Assert.isNotNull(id, "Es muss die Id des Items übergeben werden");
Assert.isTrue(id.length() > WritingRepositoryStrategy.SUBDIR... | java | public void createReference(String reference, String id) throws IOException {
Assert.isNotNull(reference);
Assert.isFalse(reference.length() == 0, "Die Referenz darf nicht leer sein");
Assert.isNotNull(id, "Es muss die Id des Items übergeben werden");
Assert.isTrue(id.length() > WritingRepositoryStrategy.SUBDIR... | [
"public",
"void",
"createReference",
"(",
"String",
"reference",
",",
"String",
"id",
")",
"throws",
"IOException",
"{",
"Assert",
".",
"isNotNull",
"(",
"reference",
")",
";",
"Assert",
".",
"isFalse",
"(",
"reference",
".",
"length",
"(",
")",
"==",
"0",... | Erzeugt eine Referenz (d.h. eine Art Link) unter dem Name
<code>reference</code>, welche auf das Blob mit der Id <code>id</code>
verweist.
@param reference
Name der Referenz
@param id
Id des Blobs welches referenziert werden soll
@throws IOException
@throws IdNotFoundException
falls unter <code>id</code> kein Blob abg... | [
"Erzeugt",
"eine",
"Referenz",
"(",
"d",
".",
"h",
".",
"eine",
"Art",
"Link",
")",
"unter",
"dem",
"Name",
"<code",
">",
"reference<",
"/",
"code",
">",
"welche",
"auf",
"das",
"Blob",
"mit",
"der",
"Id",
"<code",
">",
"id<",
"/",
"code",
">",
"ve... | ea39a10ae4eaa550f71a856ab2f2845270a64913 | https://github.com/ecclesia/kipeto/blob/ea39a10ae4eaa550f71a856ab2f2845270a64913/kipeto-core/src/main/java/de/ecclesia/kipeto/repository/WritingRepository.java#L89-L101 | train | Creates a reference. | Of course, here is the Java code you requested:
```java
public void createReference(String reference, String id) throws IOException {
Assert.isNotNull(reference);
Assert.isFalse(reference.length() == 0, "Die Referenz darf nicht leer sein");
Assert.isNotNull(id, "Es muss die Id des Items übergeben werden");
Ass... |
aws/aws-sdk-java | aws-java-sdk-connect/src/main/java/com/amazonaws/services/connect/model/transform/UpdateUserHierarchyRequestMarshaller.java | UpdateUserHierarchyRequestMarshaller.marshall | public void marshall(UpdateUserHierarchyRequest updateUserHierarchyRequest, ProtocolMarshaller protocolMarshaller) {
if (updateUserHierarchyRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(u... | java | public void marshall(UpdateUserHierarchyRequest updateUserHierarchyRequest, ProtocolMarshaller protocolMarshaller) {
if (updateUserHierarchyRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(u... | [
"public",
"void",
"marshall",
"(",
"UpdateUserHierarchyRequest",
"updateUserHierarchyRequest",
",",
"ProtocolMarshaller",
"protocolMarshaller",
")",
"{",
"if",
"(",
"updateUserHierarchyRequest",
"==",
"null",
")",
"{",
"throw",
"new",
"SdkClientException",
"(",
"\"Invalid... | Marshall the given parameter object. | [
"Marshall",
"the",
"given",
"parameter",
"object",
"."
] | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-connect/src/main/java/com/amazonaws/services/connect/model/transform/UpdateUserHierarchyRequestMarshaller.java#L46-L59 | train | marshalls the given parameter object. | Of course, here is the Java code you requested:
```java
public void marshall(UpdateUserHierarchyRequest updateUserHierarchyRequest, ProtocolMarshaller protocolMarshaller) {
if (updateUserHierarchyRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}... |
cerner/beadledom | client/beadledom-client/src/main/java/com/cerner/beadledom/client/BeadledomClientBuilder.java | BeadledomClientBuilder.buildTarget | public BeadledomWebTarget buildTarget(Link baseUrl) {
BeadledomClient beadledomClient = build();
return beadledomClient.target(baseUrl);
} | java | public BeadledomWebTarget buildTarget(Link baseUrl) {
BeadledomClient beadledomClient = build();
return beadledomClient.target(baseUrl);
} | [
"public",
"BeadledomWebTarget",
"buildTarget",
"(",
"Link",
"baseUrl",
")",
"{",
"BeadledomClient",
"beadledomClient",
"=",
"build",
"(",
")",
";",
"return",
"beadledomClient",
".",
"target",
"(",
"baseUrl",
")",
";",
"}"
] | Return a new instance of {@code {@link BeadledomWebTarget}} with the given Link path by using
the default builder implementation on the classpath found using SPI. | [
"Return",
"a",
"new",
"instance",
"of",
"{"
] | 75435bced5187d5455b46518fadf85c93cf32014 | https://github.com/cerner/beadledom/blob/75435bced5187d5455b46518fadf85c93cf32014/client/beadledom-client/src/main/java/com/cerner/beadledom/client/BeadledomClientBuilder.java#L88-L91 | train | Build a BeadledomWebTarget using the specified base URL. | Of course, here is the Java code you requested:
```java
public BeadledomWebTarget buildTarget(Link baseUrl) {
BeadledomClient beadledomClient = build();
return beadledomClient.target(baseUrl);
}
```
Hope this helps! |
mojohaus/webstart | webstart-jnlp-servlet/src/main/java/jnlp/sample/servlet/XMLParsing.java | XMLParsing.visitElements | static public void visitElements( XMLNode root, String path, ElementVisitor ev )
{
// Get last element in path
int idx = path.lastIndexOf( '<' );
String head = path.substring( 0, idx );
String tag = path.substring( idx + 1, path.length() - 1 );
XMLNode elem = findElementPath... | java | static public void visitElements( XMLNode root, String path, ElementVisitor ev )
{
// Get last element in path
int idx = path.lastIndexOf( '<' );
String head = path.substring( 0, idx );
String tag = path.substring( idx + 1, path.length() - 1 );
XMLNode elem = findElementPath... | [
"static",
"public",
"void",
"visitElements",
"(",
"XMLNode",
"root",
",",
"String",
"path",
",",
"ElementVisitor",
"ev",
")",
"{",
"// Get last element in path",
"int",
"idx",
"=",
"path",
".",
"lastIndexOf",
"(",
"'",
"'",
")",
";",
"String",
"head",
"=",
... | Visits all elements which matches the {@code path}. The iteration is only
done on the last element in the path.
@param root TODO
@param path TODO
@param ev TODO | [
"Visits",
"all",
"elements",
"which",
"matches",
"the",
"{",
"@code",
"path",
"}",
".",
"The",
"iteration",
"is",
"only",
"done",
"on",
"the",
"last",
"element",
"in",
"the",
"path",
"."
] | 38fdd1d21f063f21716cfcd61ebeabd963487576 | https://github.com/mojohaus/webstart/blob/38fdd1d21f063f21716cfcd61ebeabd963487576/webstart-jnlp-servlet/src/main/java/jnlp/sample/servlet/XMLParsing.java#L248-L271 | train | Visit all elements in the XMLNode tree rooted at the root element and the path. | Of course, here is the Java code you requested:
```java
static public void visitElements( XMLNode root, String path, ElementVisitor ev )
{
// Get last element in path
int idx = path.lastIndexOf( '<' );
String head = path.substring( 0, idx );
String tag = path.substring( idx + 1, pat... |
sagiegurari/fax4j | src/main/java/org/fax4j/spi/email/AbstractMailConnectionFactory.java | AbstractMailConnectionFactory.initializeImpl | @Override
protected void initializeImpl()
{
//create properties from configuration (all javax mail properties will be defined in the fax4j properties)
this.mailConnectionProperties=new Properties();
Map<String,String> configuration=this.factoryConfigurationHolder.getConfiguration();
... | java | @Override
protected void initializeImpl()
{
//create properties from configuration (all javax mail properties will be defined in the fax4j properties)
this.mailConnectionProperties=new Properties();
Map<String,String> configuration=this.factoryConfigurationHolder.getConfiguration();
... | [
"@",
"Override",
"protected",
"void",
"initializeImpl",
"(",
")",
"{",
"//create properties from configuration (all javax mail properties will be defined in the fax4j properties)",
"this",
".",
"mailConnectionProperties",
"=",
"new",
"Properties",
"(",
")",
";",
"Map",
"<",
"... | This function initializes the connection factory. | [
"This",
"function",
"initializes",
"the",
"connection",
"factory",
"."
] | 42fa51acabe7bf279e27ab3dd1cf76146b27955f | https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/spi/email/AbstractMailConnectionFactory.java#L43-L91 | train | This method initializes the entityId. | Of course, here is the Java code you requested:
```java
@Override
protected void initializeImpl()
{
//create properties from configuration (all javax mail properties will be defined in the fax4j properties)
this.mailConnectionProperties=new Properties();
Map<String,String> configuration... |
fuinorg/srcgen4j-commons | src/main/java/org/fuin/srcgen4j/commons/SrcGen4JConfig.java | SrcGen4JConfig.addParser | public final void addParser(@NotNull final ParserConfig parser) {
Contract.requireArgNotNull("parser", parser);
if (parsers == null) {
parsers = new Parsers();
}
parsers.addParser(parser);
} | java | public final void addParser(@NotNull final ParserConfig parser) {
Contract.requireArgNotNull("parser", parser);
if (parsers == null) {
parsers = new Parsers();
}
parsers.addParser(parser);
} | [
"public",
"final",
"void",
"addParser",
"(",
"@",
"NotNull",
"final",
"ParserConfig",
"parser",
")",
"{",
"Contract",
".",
"requireArgNotNull",
"(",
"\"parser\"",
",",
"parser",
")",
";",
"if",
"(",
"parsers",
"==",
"null",
")",
"{",
"parsers",
"=",
"new",... | Adds a parser to the configuration. If the list of parsers does not exist it will be created.
@param parser
Parser to add. | [
"Adds",
"a",
"parser",
"to",
"the",
"configuration",
".",
"If",
"the",
"list",
"of",
"parsers",
"does",
"not",
"exist",
"it",
"will",
"be",
"created",
"."
] | bce26fd3167ea91fb2f3ad3fc9a1836d3d9fb14b | https://github.com/fuinorg/srcgen4j-commons/blob/bce26fd3167ea91fb2f3ad3fc9a1836d3d9fb14b/src/main/java/org/fuin/srcgen4j/commons/SrcGen4JConfig.java#L193-L199 | train | Adds a parser to the list of parsers. | Of course, here is the Java code you requested:
```java
public final void addParser(@NotNull final ParserConfig parser) {
Contract.requireArgNotNull("parser", parser);
if (parsers == null) {
parsers = new Parsers();
}
parsers.addParser(parser);
}
```
Hope this hel... |
nyla-solutions/nyla | nyla.solutions.core/src/main/java/nyla/solutions/core/patterns/observer/SubjectRegistry.java | SubjectRegistry.removeRegistraion | @SuppressWarnings({ "unchecked", "rawtypes" })
public <T> void removeRegistraion(String subjectName, SubjectObserver<T> subjectObserver)
{
Subject subject = (Subject)this.registry.get(subjectName);
if(subject == null)
return;
subject.remove(subjectObserver);
... | java | @SuppressWarnings({ "unchecked", "rawtypes" })
public <T> void removeRegistraion(String subjectName, SubjectObserver<T> subjectObserver)
{
Subject subject = (Subject)this.registry.get(subjectName);
if(subject == null)
return;
subject.remove(subjectObserver);
... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"unchecked\"",
",",
"\"rawtypes\"",
"}",
")",
"public",
"<",
"T",
">",
"void",
"removeRegistraion",
"(",
"String",
"subjectName",
",",
"SubjectObserver",
"<",
"T",
">",
"subjectObserver",
")",
"{",
"Subject",
"subject",
"="... | Remove an observer for a registered observer
@param <T> the class type
@param subjectName the subject name to remove
@param subjectObserver the subject observer | [
"Remove",
"an",
"observer",
"for",
"a",
"registered",
"observer"
] | 38d5b843c76eae9762bbca20453ed0f0ad8412a9 | https://github.com/nyla-solutions/nyla/blob/38d5b843c76eae9762bbca20453ed0f0ad8412a9/nyla.solutions.core/src/main/java/nyla/solutions/core/patterns/observer/SubjectRegistry.java#L81-L91 | train | Remove a related Observer from the Subject. | Of course, here is the Java code you requested:
```java
@SuppressWarnings({ "unchecked", "rawtypes" })
public <T> void removeRegistraion(String subjectName, SubjectObserver<T> subjectObserver)
{
Subject subject = (Subject)this.registry.get(subjectName);
if(subject == null)
return... |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/chess/ChessboardCornerClusterToGrid.java | ChessboardCornerClusterToGrid.isRightHanded | static boolean isRightHanded( Node seed , int idxRow , int idxCol ) {
Node r = seed.edges[idxRow];
Node c = seed.edges[idxCol];
double dirRow = Math.atan2(r.y-seed.y,r.x-seed.x);
double dirCol = Math.atan2(c.y-seed.y,c.x-seed.x);
return UtilAngle.distanceCW(dirRow,dirCol) < Math.PI;
} | java | static boolean isRightHanded( Node seed , int idxRow , int idxCol ) {
Node r = seed.edges[idxRow];
Node c = seed.edges[idxCol];
double dirRow = Math.atan2(r.y-seed.y,r.x-seed.x);
double dirCol = Math.atan2(c.y-seed.y,c.x-seed.x);
return UtilAngle.distanceCW(dirRow,dirCol) < Math.PI;
} | [
"static",
"boolean",
"isRightHanded",
"(",
"Node",
"seed",
",",
"int",
"idxRow",
",",
"int",
"idxCol",
")",
"{",
"Node",
"r",
"=",
"seed",
".",
"edges",
"[",
"idxRow",
"]",
";",
"Node",
"c",
"=",
"seed",
".",
"edges",
"[",
"idxCol",
"]",
";",
"doub... | Checks to see if the rows and columns for a coordinate system which is right handed
@param idxRow Index for moving up a row
@param idxCol index for moving up a column | [
"Checks",
"to",
"see",
"if",
"the",
"rows",
"and",
"columns",
"for",
"a",
"coordinate",
"system",
"which",
"is",
"right",
"handed"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/chess/ChessboardCornerClusterToGrid.java#L244-L252 | train | Checks if the given node is right handed. | Of course, here is the Java code you requested:
```java
static boolean isRightHanded( Node seed , int idxRow , int idxCol ) {
Node r = seed.edges[idxRow];
Node c = seed.edges[idxCol];
double dirRow = Math.atan2(r.y-seed.y,r.x-seed.x);
double dirCol = Math.atan2(c.y-seed.y,c.x-seed.x);
return UtilAngle.dist... |
atomix/catalyst | common/src/main/java/io/atomix/catalyst/util/PropertiesReader.java | PropertiesReader.getDuration | public Duration getDuration(String property, Duration defaultValue) {
return getProperty(property, defaultValue, value -> {
try {
return Durations.of(value);
} catch (NumberFormatException e) {
throw new ConfigurationException("malformed property value: " + property + " must be a number"... | java | public Duration getDuration(String property, Duration defaultValue) {
return getProperty(property, defaultValue, value -> {
try {
return Durations.of(value);
} catch (NumberFormatException e) {
throw new ConfigurationException("malformed property value: " + property + " must be a number"... | [
"public",
"Duration",
"getDuration",
"(",
"String",
"property",
",",
"Duration",
"defaultValue",
")",
"{",
"return",
"getProperty",
"(",
"property",
",",
"defaultValue",
",",
"value",
"->",
"{",
"try",
"{",
"return",
"Durations",
".",
"of",
"(",
"value",
")"... | Reads a duration property.
@param property The property name.
@param defaultValue The default value to return if the property is not present
@return The property value. | [
"Reads",
"a",
"duration",
"property",
"."
] | 140e762cb975cd8ee1fd85119043c5b8bf917c5c | https://github.com/atomix/catalyst/blob/140e762cb975cd8ee1fd85119043c5b8bf917c5c/common/src/main/java/io/atomix/catalyst/util/PropertiesReader.java#L479-L487 | train | Gets a property as a duration. | Of course, here is the Java code you requested:
```java
public Duration getDuration(String property, Duration defaultValue) {
return getProperty(property, defaultValue, value -> {
try {
return Durations.of(value);
} catch (NumberFormatException e) {
throw new ConfigurationException("mal... |
pravega/pravega | client/src/main/java/io/pravega/client/netty/impl/FlowHandler.java | FlowHandler.closeFlow | public void closeFlow(ClientConnection clientConnection) {
final ClientConnectionImpl clientConnectionImpl = (ClientConnectionImpl) clientConnection;
int flow = clientConnectionImpl.getFlowId();
log.info("Closing Flow {} for endpoint {}", flow, clientConnectionImpl.getConnectionName());
... | java | public void closeFlow(ClientConnection clientConnection) {
final ClientConnectionImpl clientConnectionImpl = (ClientConnectionImpl) clientConnection;
int flow = clientConnectionImpl.getFlowId();
log.info("Closing Flow {} for endpoint {}", flow, clientConnectionImpl.getConnectionName());
... | [
"public",
"void",
"closeFlow",
"(",
"ClientConnection",
"clientConnection",
")",
"{",
"final",
"ClientConnectionImpl",
"clientConnectionImpl",
"=",
"(",
"ClientConnectionImpl",
")",
"clientConnection",
";",
"int",
"flow",
"=",
"clientConnectionImpl",
".",
"getFlowId",
"... | Close a flow. This is invoked when the ClientConnection is closed.
@param clientConnection Client Connection. | [
"Close",
"a",
"flow",
".",
"This",
"is",
"invoked",
"when",
"the",
"ClientConnection",
"is",
"closed",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/client/src/main/java/io/pravega/client/netty/impl/FlowHandler.java#L92-L97 | train | Close a flow. | Of course, here is the Java code you requested:
```java
public void closeFlow(ClientConnection clientConnection) {
final ClientConnectionImpl clientConnectionImpl = (ClientConnectionImpl) clientConnection;
int flow = clientConnectionImpl.getFlowId();
log.info("Closing Flow {} for endpoint {}", ... |
micronaut-projects/micronaut-core | http/src/main/java/io/micronaut/http/context/ServerRequestContext.java | ServerRequestContext.with | public static <T> T with(HttpRequest request, Supplier<T> callable) {
HttpRequest existing = REQUEST.get();
boolean isSet = false;
try {
if (request != existing) {
isSet = true;
REQUEST.set(request);
}
return callable.get();
... | java | public static <T> T with(HttpRequest request, Supplier<T> callable) {
HttpRequest existing = REQUEST.get();
boolean isSet = false;
try {
if (request != existing) {
isSet = true;
REQUEST.set(request);
}
return callable.get();
... | [
"public",
"static",
"<",
"T",
">",
"T",
"with",
"(",
"HttpRequest",
"request",
",",
"Supplier",
"<",
"T",
">",
"callable",
")",
"{",
"HttpRequest",
"existing",
"=",
"REQUEST",
".",
"get",
"(",
")",
";",
"boolean",
"isSet",
"=",
"false",
";",
"try",
"... | Wrap the execution of the given callable in request context processing.
@param request The request
@param callable The callable
@param <T> The return type of the callable
@return The return value of the callable | [
"Wrap",
"the",
"execution",
"of",
"the",
"given",
"callable",
"in",
"request",
"context",
"processing",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/http/src/main/java/io/micronaut/http/context/ServerRequestContext.java#L79-L93 | train | With a request and a callable that returns the result. | Of course, here is the Java code you requested:
```java
public static <T> T with(HttpRequest request, Supplier<T> callable) {
HttpRequest existing = REQUEST.get();
boolean isSet = false;
try {
if (request != existing) {
isSet = true;
REQUEST.set(reque... |
amplexus/java-flac-encoder | src/main/java/net/sourceforge/javaflacencoder/FLACEncoder.java | FLACEncoder.fullBlockSamplesAvailableToEncode | public int fullBlockSamplesAvailableToEncode() {
int available = 0;
int channels = streamConfig.getChannelCount();
for(BlockEncodeRequest ber : preparedRequests) {
int[] block = ber.samples;
available += block.length/channels;
}
return available;
} | java | public int fullBlockSamplesAvailableToEncode() {
int available = 0;
int channels = streamConfig.getChannelCount();
for(BlockEncodeRequest ber : preparedRequests) {
int[] block = ber.samples;
available += block.length/channels;
}
return available;
} | [
"public",
"int",
"fullBlockSamplesAvailableToEncode",
"(",
")",
"{",
"int",
"available",
"=",
"0",
";",
"int",
"channels",
"=",
"streamConfig",
".",
"getChannelCount",
"(",
")",
";",
"for",
"(",
"BlockEncodeRequest",
"ber",
":",
"preparedRequests",
")",
"{",
"... | Get number of samples which are ready to encode. More samples may exist
in the encoder as a partial block. Use samplesAvailableToEncode() if you
wish to include those as well.
@return number of samples in full blocks, ready to encode. | [
"Get",
"number",
"of",
"samples",
"which",
"are",
"ready",
"to",
"encode",
".",
"More",
"samples",
"may",
"exist",
"in",
"the",
"encoder",
"as",
"a",
"partial",
"block",
".",
"Use",
"samplesAvailableToEncode",
"()",
"if",
"you",
"wish",
"to",
"include",
"t... | 3d536b877dee2a3fd4ab2e0d9569e292cae93bc9 | https://github.com/amplexus/java-flac-encoder/blob/3d536b877dee2a3fd4ab2e0d9569e292cae93bc9/src/main/java/net/sourceforge/javaflacencoder/FLACEncoder.java#L654-L662 | train | Returns the number of samples that can be encoded to the output stream. | Of course, here is the Java code you requested:
```java
public int fullBlockSamplesAvailableToEncode() {
int available = 0;
int channels = streamConfig.getChannelCount();
for(BlockEncodeRequest ber : preparedRequests) {
int[] block = ber.samples;
available += block.length/channels;
}
re... |
fcrepo3/fcrepo | fcrepo-client/fcrepo-client-admin/src/main/java/org/fcrepo/client/utility/ingest/Ingest.java | Ingest.badArgs | public static void badArgs(String msg) {
System.err.println("Command: fedora-ingest");
System.err.println();
System.err
.println("Summary: Ingests one or more objects into a Fedora repository, from either");
System.err
.println(" the local filesyst... | java | public static void badArgs(String msg) {
System.err.println("Command: fedora-ingest");
System.err.println();
System.err
.println("Summary: Ingests one or more objects into a Fedora repository, from either");
System.err
.println(" the local filesyst... | [
"public",
"static",
"void",
"badArgs",
"(",
"String",
"msg",
")",
"{",
"System",
".",
"err",
".",
"println",
"(",
"\"Command: fedora-ingest\"",
")",
";",
"System",
".",
"err",
".",
"println",
"(",
")",
";",
"System",
".",
"err",
".",
"println",
"(",
"\... | Print error message and show usage for command-line interface. | [
"Print",
"error",
"message",
"and",
"show",
"usage",
"for",
"command",
"-",
"line",
"interface",
"."
] | 37df51b9b857fd12c6ab8269820d406c3c4ad774 | https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-client/fcrepo-client-admin/src/main/java/org/fcrepo/client/utility/ingest/Ingest.java#L293-L408 | train | The command fedora - ingest is a bad argument. | Of course, here is the Java code you requested:
```java
public static void badArgs(String msg) {
System.err.println("Command: fedora-ingest");
System.err.println();
System.err
.println("Summary: Ingests one or more objects into a Fedora repository, from either");
System.... |
javalite/activeweb | activeweb/src/main/java/org/javalite/activeweb/RouteBuilder.java | RouteBuilder.post | public RouteBuilder post(){
if(!methods.contains(HttpMethod.POST)){
methods.add(HttpMethod.POST);
}
return this;
} | java | public RouteBuilder post(){
if(!methods.contains(HttpMethod.POST)){
methods.add(HttpMethod.POST);
}
return this;
} | [
"public",
"RouteBuilder",
"post",
"(",
")",
"{",
"if",
"(",
"!",
"methods",
".",
"contains",
"(",
"HttpMethod",
".",
"POST",
")",
")",
"{",
"methods",
".",
"add",
"(",
"HttpMethod",
".",
"POST",
")",
";",
"}",
"return",
"this",
";",
"}"
] | Specifies that this route is mapped to HTTP POST method.
@return instance of {@link RouteBuilder}. | [
"Specifies",
"that",
"this",
"route",
"is",
"mapped",
"to",
"HTTP",
"POST",
"method",
"."
] | f25f589da94852b6f5625182360732e0861794a6 | https://github.com/javalite/activeweb/blob/f25f589da94852b6f5625182360732e0861794a6/activeweb/src/main/java/org/javalite/activeweb/RouteBuilder.java#L169-L175 | train | Add a POST method to the route. | Of course, here is the Java code you requested:
```java
public RouteBuilder post(){
if(!methods.contains(HttpMethod.POST)){
methods.add(HttpMethod.POST);
}
return this;
}
```
Hope this helps! |
aws/aws-sdk-java | aws-java-sdk-waf/src/main/java/com/amazonaws/services/waf/AWSWAFRegionalClient.java | AWSWAFRegionalClient.updateGeoMatchSet | @Override
public UpdateGeoMatchSetResult updateGeoMatchSet(UpdateGeoMatchSetRequest request) {
request = beforeClientExecution(request);
return executeUpdateGeoMatchSet(request);
} | java | @Override
public UpdateGeoMatchSetResult updateGeoMatchSet(UpdateGeoMatchSetRequest request) {
request = beforeClientExecution(request);
return executeUpdateGeoMatchSet(request);
} | [
"@",
"Override",
"public",
"UpdateGeoMatchSetResult",
"updateGeoMatchSet",
"(",
"UpdateGeoMatchSetRequest",
"request",
")",
"{",
"request",
"=",
"beforeClientExecution",
"(",
"request",
")",
";",
"return",
"executeUpdateGeoMatchSet",
"(",
"request",
")",
";",
"}"
] | <p>
Inserts or deletes <a>GeoMatchConstraint</a> objects in an <code>GeoMatchSet</code>. For each
<code>GeoMatchConstraint</code> object, you specify the following values:
</p>
<ul>
<li>
<p>
Whether to insert or delete the object from the array. If you want to change an <code>GeoMatchConstraint</code>
object, you delet... | [
"<p",
">",
"Inserts",
"or",
"deletes",
"<a",
">",
"GeoMatchConstraint<",
"/",
"a",
">",
"objects",
"in",
"an",
"<code",
">",
"GeoMatchSet<",
"/",
"code",
">",
".",
"For",
"each",
"<code",
">",
"GeoMatchConstraint<",
"/",
"code",
">",
"object",
"you",
"sp... | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-waf/src/main/java/com/amazonaws/services/waf/AWSWAFRegionalClient.java#L7078-L7082 | train | Updates an existing GeoMatchSet. | Of course, here is the Java code you requested:
```java
@Override
public UpdateGeoMatchSetResult updateGeoMatchSet(UpdateGeoMatchSetRequest request) {
request = beforeClientExecution(request);
return executeUpdateGeoMatchSet(request);
}
```
Hope this helps! |
mongodb/stitch-android-sdk | android/core/src/main/java/com/mongodb/stitch/android/core/auth/providers/userapikey/internal/UserApiKeyAuthProviderClientImpl.java | UserApiKeyAuthProviderClientImpl.enableApiKey | @Override
public Task<Void> enableApiKey(@NonNull final ObjectId id) {
return dispatcher.dispatchTask(new Callable<Void>() {
@Override
public Void call() {
enableApiKeyInternal(id);
return null;
}
});
} | java | @Override
public Task<Void> enableApiKey(@NonNull final ObjectId id) {
return dispatcher.dispatchTask(new Callable<Void>() {
@Override
public Void call() {
enableApiKeyInternal(id);
return null;
}
});
} | [
"@",
"Override",
"public",
"Task",
"<",
"Void",
">",
"enableApiKey",
"(",
"@",
"NonNull",
"final",
"ObjectId",
"id",
")",
"{",
"return",
"dispatcher",
".",
"dispatchTask",
"(",
"new",
"Callable",
"<",
"Void",
">",
"(",
")",
"{",
"@",
"Override",
"public"... | Enables a user API key associated with the current user.
@param id The id of the API key to enable.
@return A {@link Task} that completes when the API key is enabled. | [
"Enables",
"a",
"user",
"API",
"key",
"associated",
"with",
"the",
"current",
"user",
"."
] | 159b9334b1f1a827285544be5ee20cdf7b04e4cc | https://github.com/mongodb/stitch-android-sdk/blob/159b9334b1f1a827285544be5ee20cdf7b04e4cc/android/core/src/main/java/com/mongodb/stitch/android/core/auth/providers/userapikey/internal/UserApiKeyAuthProviderClientImpl.java#L115-L124 | train | Enable the API key. | Of course, here is the Java code you requested:
```java
@Override
public Task<Void> enableApiKey(@NonNull final ObjectId id) {
return dispatcher.dispatchTask(new Callable<Void>() {
@Override
public Void call() {
enableApiKeyInternal(id);
return null;
}
});
}
```
Hope this... |
exoplatform/jcr | exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/organization/Utils.java | Utils.getUserNode | Node getUserNode(Session session, String userName) throws PathNotFoundException, RepositoryException
{
return (Node)session.getItem(getUserNodePath(userName));
} | java | Node getUserNode(Session session, String userName) throws PathNotFoundException, RepositoryException
{
return (Node)session.getItem(getUserNodePath(userName));
} | [
"Node",
"getUserNode",
"(",
"Session",
"session",
",",
"String",
"userName",
")",
"throws",
"PathNotFoundException",
",",
"RepositoryException",
"{",
"return",
"(",
"Node",
")",
"session",
".",
"getItem",
"(",
"getUserNodePath",
"(",
"userName",
")",
")",
";",
... | Returns the node where defined user is stored. | [
"Returns",
"the",
"node",
"where",
"defined",
"user",
"is",
"stored",
"."
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/organization/Utils.java#L148-L151 | train | Get user node. | Of course, here is the Java code you requested:
```java
Node getUserNode(Session session, String userName) throws PathNotFoundException, RepositoryException
{
return (Node)session.getItem(getUserNodePath(userName));
}
```
Hope this helps! |
Red5/red5-server-common | src/main/java/org/red5/server/adapter/StatefulScopeWrappingAdapter.java | StatefulScopeWrappingAdapter.getAttribute | public Object getAttribute(String name, Object defaultValue) {
Object value = scope.getAttribute(name);
if (value == null) {
value = defaultValue;
}
return value;
} | java | public Object getAttribute(String name, Object defaultValue) {
Object value = scope.getAttribute(name);
if (value == null) {
value = defaultValue;
}
return value;
} | [
"public",
"Object",
"getAttribute",
"(",
"String",
"name",
",",
"Object",
"defaultValue",
")",
"{",
"Object",
"value",
"=",
"scope",
".",
"getAttribute",
"(",
"name",
")",
";",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"value",
"=",
"defaultValue",
";"... | {@inheritDoc} | [
"{"
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/adapter/StatefulScopeWrappingAdapter.java#L95-L101 | train | Gets the value of the attribute. | Of course, here is the Java code you requested:
```java
public Object getAttribute(String name, Object defaultValue) {
Object value = scope.getAttribute(name);
if (value == null) {
value = defaultValue;
}
return value;
}
```
Hope this helps! |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/snmp/snmpuser.java | snmpuser.update | public static base_response update(nitro_service client, snmpuser resource) throws Exception {
snmpuser updateresource = new snmpuser();
updateresource.name = resource.name;
updateresource.group = resource.group;
updateresource.authtype = resource.authtype;
updateresource.authpasswd = resource.authpasswd;
u... | java | public static base_response update(nitro_service client, snmpuser resource) throws Exception {
snmpuser updateresource = new snmpuser();
updateresource.name = resource.name;
updateresource.group = resource.group;
updateresource.authtype = resource.authtype;
updateresource.authpasswd = resource.authpasswd;
u... | [
"public",
"static",
"base_response",
"update",
"(",
"nitro_service",
"client",
",",
"snmpuser",
"resource",
")",
"throws",
"Exception",
"{",
"snmpuser",
"updateresource",
"=",
"new",
"snmpuser",
"(",
")",
";",
"updateresource",
".",
"name",
"=",
"resource",
".",... | Use this API to update snmpuser. | [
"Use",
"this",
"API",
"to",
"update",
"snmpuser",
"."
] | 2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4 | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/snmp/snmpuser.java#L324-L333 | train | Use this API to update snmpuser. | Of course, here is the Java code you requested:
```java
public static base_response update(nitro_service client, snmpuser resource) throws Exception {
snmpuser updateresource = new snmpuser();
updateresource.name = resource.name;
updateresource.group = resource.group;
updateresource.authtype = resource.authtyp... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/swing/DesktopUtil.java | DesktopUtil.browse | public static void browse(String url) {
final Desktop dsktop = getDsktop();
try {
dsktop.browse(URLUtil.toURI(url));
} catch (IOException e) {
throw new IORuntimeException(e);
}
} | java | public static void browse(String url) {
final Desktop dsktop = getDsktop();
try {
dsktop.browse(URLUtil.toURI(url));
} catch (IOException e) {
throw new IORuntimeException(e);
}
} | [
"public",
"static",
"void",
"browse",
"(",
"String",
"url",
")",
"{",
"final",
"Desktop",
"dsktop",
"=",
"getDsktop",
"(",
")",
";",
"try",
"{",
"dsktop",
".",
"browse",
"(",
"URLUtil",
".",
"toURI",
"(",
"url",
")",
")",
";",
"}",
"catch",
"(",
"I... | 使用平台默认浏览器打开指定URL地址
@param url URL地址 | [
"使用平台默认浏览器打开指定URL地址"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/swing/DesktopUtil.java#L33-L40 | train | Browse the specified URL. | Of course, here is the Java code you requested:
```java
public static void browse(String url) {
final Desktop dsktop = getDsktop();
try {
dsktop.browse(URLUtil.toURI(url));
} catch (IOException e) {
throw new IORuntimeException(e);
}
}
```
Hope this helps! |
Microsoft/azure-spring-boot | azure-spring-boot-samples/azure-active-directory-spring-boot-sample/src/main/java/sample/aad/controller/TodolistController.java | TodolistController.deleteTodoItem | @RequestMapping(value = "/api/todolist/{id}", method = RequestMethod.DELETE)
public ResponseEntity<String> deleteTodoItem(@PathVariable("id") int id,
PreAuthenticatedAuthenticationToken authToken) {
final UserPrincipal current = (UserPrincipal) authToken.getP... | java | @RequestMapping(value = "/api/todolist/{id}", method = RequestMethod.DELETE)
public ResponseEntity<String> deleteTodoItem(@PathVariable("id") int id,
PreAuthenticatedAuthenticationToken authToken) {
final UserPrincipal current = (UserPrincipal) authToken.getP... | [
"@",
"RequestMapping",
"(",
"value",
"=",
"\"/api/todolist/{id}\"",
",",
"method",
"=",
"RequestMethod",
".",
"DELETE",
")",
"public",
"ResponseEntity",
"<",
"String",
">",
"deleteTodoItem",
"(",
"@",
"PathVariable",
"(",
"\"id\"",
")",
"int",
"id",
",",
"PreA... | HTTP DELETE | [
"HTTP",
"DELETE"
] | 53d69d44587b483247a5108452145cd426fcf78c | https://github.com/Microsoft/azure-spring-boot/blob/53d69d44587b483247a5108452145cd426fcf78c/azure-spring-boot-samples/azure-active-directory-spring-boot-sample/src/main/java/sample/aad/controller/TodolistController.java#L83-L100 | valid | Delete a TodoItem. | Of course, here is the Java code you requested:
```java
@RequestMapping(value = "/api/todolist/{id}", method = RequestMethod.DELETE)
public ResponseEntity<String> deleteTodoItem(@PathVariable("id") int id,
PreAuthenticatedAuthenticationToken authToken) {
fin... |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/npe/IsNullValueFrame.java | IsNullValueFrame.downgradeOnControlSplit | public void downgradeOnControlSplit() {
final int numSlots = getNumSlots();
for (int i = 0; i < numSlots; ++i) {
IsNullValue value = getValue(i);
value = value.downgradeOnControlSplit();
setValue(i, value);
}
if (knownValueMap != null) {
f... | java | public void downgradeOnControlSplit() {
final int numSlots = getNumSlots();
for (int i = 0; i < numSlots; ++i) {
IsNullValue value = getValue(i);
value = value.downgradeOnControlSplit();
setValue(i, value);
}
if (knownValueMap != null) {
f... | [
"public",
"void",
"downgradeOnControlSplit",
"(",
")",
"{",
"final",
"int",
"numSlots",
"=",
"getNumSlots",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"numSlots",
";",
"++",
"i",
")",
"{",
"IsNullValue",
"value",
"=",
"getValue",
... | Downgrade all NSP values in frame. Should be called when a non-exception
control split occurs. | [
"Downgrade",
"all",
"NSP",
"values",
"in",
"frame",
".",
"Should",
"be",
"called",
"when",
"a",
"non",
"-",
"exception",
"control",
"split",
"occurs",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/npe/IsNullValueFrame.java#L294-L307 | train | Downgrade all IsNullValue objects on control split. | Of course, here is the Java code you requested:
```java
public void downgradeOnControlSplit() {
final int numSlots = getNumSlots();
for (int i = 0; i < numSlots; ++i) {
IsNullValue value = getValue(i);
value = value.downgradeOnControlSplit();
setValue(i, value);
... |
JM-Lab/utils-java8 | src/main/java/kr/jm/utils/collections/IndexAliasMap.java | IndexAliasMap.putAlias | synchronized public void putAlias(String alias, int index) {
JMLambda.runByBoolean(index < size(),
() -> aliasIndexMap.put(alias, index),
() -> JMExceptionManager.logRuntimeException(log,
"Wrong Index !!! - " + "dataList Size = " + dataList,
... | java | synchronized public void putAlias(String alias, int index) {
JMLambda.runByBoolean(index < size(),
() -> aliasIndexMap.put(alias, index),
() -> JMExceptionManager.logRuntimeException(log,
"Wrong Index !!! - " + "dataList Size = " + dataList,
... | [
"synchronized",
"public",
"void",
"putAlias",
"(",
"String",
"alias",
",",
"int",
"index",
")",
"{",
"JMLambda",
".",
"runByBoolean",
"(",
"index",
"<",
"size",
"(",
")",
",",
"(",
")",
"->",
"aliasIndexMap",
".",
"put",
"(",
"alias",
",",
"index",
")"... | Put alias.
@param alias the alias
@param index the index | [
"Put",
"alias",
"."
] | 9e407b3f28a7990418a1e877229fa8344f4d78a5 | https://github.com/JM-Lab/utils-java8/blob/9e407b3f28a7990418a1e877229fa8344f4d78a5/src/main/java/kr/jm/utils/collections/IndexAliasMap.java#L86-L92 | train | Put alias. | Of course, here is the Java code you requested:
```java
synchronized public void putAlias(String alias, int index) {
JMLambda.runByBoolean(index < size(),
() -> aliasIndexMap.put(alias, index),
() -> JMExceptionManager.logRuntimeException(log,
"Wrong Inde... |
apache/flink | flink-libraries/flink-streaming-python/src/main/java/org/apache/flink/streaming/python/api/datastream/PythonDataStream.java | PythonDataStream.add_sink | @PublicEvolving
public void add_sink(SinkFunction<PyObject> sink_func) throws IOException {
stream.addSink(new PythonSinkFunction(sink_func));
} | java | @PublicEvolving
public void add_sink(SinkFunction<PyObject> sink_func) throws IOException {
stream.addSink(new PythonSinkFunction(sink_func));
} | [
"@",
"PublicEvolving",
"public",
"void",
"add_sink",
"(",
"SinkFunction",
"<",
"PyObject",
">",
"sink_func",
")",
"throws",
"IOException",
"{",
"stream",
".",
"addSink",
"(",
"new",
"PythonSinkFunction",
"(",
"sink_func",
")",
")",
";",
"}"
] | A thin wrapper layer over {@link DataStream#addSink(SinkFunction)}.
@param sink_func The object containing the sink's invoke function. | [
"A",
"thin",
"wrapper",
"layer",
"over",
"{",
"@link",
"DataStream#addSink",
"(",
"SinkFunction",
")",
"}",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-streaming-python/src/main/java/org/apache/flink/streaming/python/api/datastream/PythonDataStream.java#L186-L189 | train | Adds a sink to the stream. | Of course, here is the Java code you requested:
```java
@PublicEvolving
public void add_sink(SinkFunction<PyObject> sink_func) throws IOException {
stream.addSink(new PythonSinkFunction(sink_func));
}
```
Hope this helps! |
fozziethebeat/S-Space | src/main/java/edu/ucla/sspace/vector/AtomicSparseVector.java | AtomicSparseVector.set | public void set(int index, double value) {
writeLock.lock();
vector.set(index, value);
writeLock.unlock();
} | java | public void set(int index, double value) {
writeLock.lock();
vector.set(index, value);
writeLock.unlock();
} | [
"public",
"void",
"set",
"(",
"int",
"index",
",",
"double",
"value",
")",
"{",
"writeLock",
".",
"lock",
"(",
")",
";",
"vector",
".",
"set",
"(",
"index",
",",
"value",
")",
";",
"writeLock",
".",
"unlock",
"(",
")",
";",
"}"
] | {@inheritDoc} | [
"{"
] | a608102737dfd3d59038a9ead33fe60356bc6029 | https://github.com/fozziethebeat/S-Space/blob/a608102737dfd3d59038a9ead33fe60356bc6029/src/main/java/edu/ucla/sspace/vector/AtomicSparseVector.java#L146-L150 | train | Sets the value of the specified entry in the set. | Of course, here is the Java code you requested:
```java
public void set(int index, double value) {
writeLock.lock();
vector.set(index, value);
writeLock.unlock();
}
```
Hope this helps! |
jpaoletti/java-presentation-manager | modules/jpm-core/src/main/java/jpaoletti/jpm/core/PresentationManager.java | PresentationManager.error | public void error(Object o) {
if (o instanceof Throwable) {
logger.error(o, (Throwable) o);
} else {
logger.error(o);
}
} | java | public void error(Object o) {
if (o instanceof Throwable) {
logger.error(o, (Throwable) o);
} else {
logger.error(o);
}
} | [
"public",
"void",
"error",
"(",
"Object",
"o",
")",
"{",
"if",
"(",
"o",
"instanceof",
"Throwable",
")",
"{",
"logger",
".",
"error",
"(",
"o",
",",
"(",
"Throwable",
")",
"o",
")",
";",
"}",
"else",
"{",
"logger",
".",
"error",
"(",
"o",
")",
... | Generate an error entry on the local logger
@param o Object to log | [
"Generate",
"an",
"error",
"entry",
"on",
"the",
"local",
"logger"
] | d5aab55638383695db244744b4bfe27c5200e04f | https://github.com/jpaoletti/java-presentation-manager/blob/d5aab55638383695db244744b4bfe27c5200e04f/modules/jpm-core/src/main/java/jpaoletti/jpm/core/PresentationManager.java#L481-L487 | train | Error method. | Of course, here is the Java code you requested:
```java
public void error(Object o) {
if (o instanceof Throwable) {
logger.error(o, (Throwable) o);
} else {
logger.error(o);
}
}
```
Hope this helps! |
spring-projects/spring-security | samples/xml/contacts/src/main/java/sample/contact/AdminPermissionController.java | AdminPermissionController.displayAdminPage | @RequestMapping(value = "/secure/adminPermission.htm", method = RequestMethod.GET)
public ModelAndView displayAdminPage(@RequestParam("contactId") int contactId) {
Contact contact = contactManager.getById(Long.valueOf(contactId));
Acl acl = aclService.readAclById(new ObjectIdentityImpl(contact));
Map<String, Ob... | java | @RequestMapping(value = "/secure/adminPermission.htm", method = RequestMethod.GET)
public ModelAndView displayAdminPage(@RequestParam("contactId") int contactId) {
Contact contact = contactManager.getById(Long.valueOf(contactId));
Acl acl = aclService.readAclById(new ObjectIdentityImpl(contact));
Map<String, Ob... | [
"@",
"RequestMapping",
"(",
"value",
"=",
"\"/secure/adminPermission.htm\"",
",",
"method",
"=",
"RequestMethod",
".",
"GET",
")",
"public",
"ModelAndView",
"displayAdminPage",
"(",
"@",
"RequestParam",
"(",
"\"contactId\"",
")",
"int",
"contactId",
")",
"{",
"Con... | Displays the permission admin page for a particular contact. | [
"Displays",
"the",
"permission",
"admin",
"page",
"for",
"a",
"particular",
"contact",
"."
] | 98a8467e4c2ae05b3e09c67ece856944fa48ed23 | https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/samples/xml/contacts/src/main/java/sample/contact/AdminPermissionController.java#L69-L79 | test | Display admin page. | Of course, here is the Java code you requested:
```java
@RequestMapping(value = "/secure/adminPermission.htm", method = RequestMethod.GET)
public ModelAndView displayAdminPage(@RequestParam("contactId") int contactId) {
Contact contact = contactManager.getById(Long.valueOf(contactId));
Acl acl = aclService.readAc... |
sarl/sarl | main/coreplugins/io.sarl.lang/src-gen/io/sarl/lang/sarl/impl/SarlCapacityUsesImpl.java | SarlCapacityUsesImpl.eIsSet | @Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case SarlPackage.SARL_CAPACITY_USES__CAPACITIES:
return capacities != null && !capacities.isEmpty();
}
return super.eIsSet(featureID);
} | java | @Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case SarlPackage.SARL_CAPACITY_USES__CAPACITIES:
return capacities != null && !capacities.isEmpty();
}
return super.eIsSet(featureID);
} | [
"@",
"Override",
"public",
"boolean",
"eIsSet",
"(",
"int",
"featureID",
")",
"{",
"switch",
"(",
"featureID",
")",
"{",
"case",
"SarlPackage",
".",
"SARL_CAPACITY_USES__CAPACITIES",
":",
"return",
"capacities",
"!=",
"null",
"&&",
"!",
"capacities",
".",
"isE... | <!-- begin-user-doc -->
<!-- end-user-doc -->
@generated | [
"<!",
"--",
"begin",
"-",
"user",
"-",
"doc",
"--",
">",
"<!",
"--",
"end",
"-",
"user",
"-",
"doc",
"--",
">"
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src-gen/io/sarl/lang/sarl/impl/SarlCapacityUsesImpl.java#L158-L167 | train | Replies if the feature is set to a value. | Of course, here is the Java code you requested:
```java
@Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case SarlPackage.SARL_CAPACITY_USES__CAPACITIES:
return capacities != null && !capacities.isEmpty();
}
return super.eIsSet(featureID);
}
```
Hope this helps! |
stratosphere/stratosphere | stratosphere-core/src/main/java/eu/stratosphere/core/memory/MemorySegment.java | MemorySegment.put | public final void put(DataInput in, int offset, int length) throws IOException {
in.readFully(this.memory, offset, length);
} | java | public final void put(DataInput in, int offset, int length) throws IOException {
in.readFully(this.memory, offset, length);
} | [
"public",
"final",
"void",
"put",
"(",
"DataInput",
"in",
",",
"int",
"offset",
",",
"int",
"length",
")",
"throws",
"IOException",
"{",
"in",
".",
"readFully",
"(",
"this",
".",
"memory",
",",
"offset",
",",
"length",
")",
";",
"}"
] | Bulk put method. Copies length memory from the given DataInput to the
memory starting at position offset.
@param in The DataInput to get the data from.
@param offset The position in the memory segment to copy the chunk to.
@param length The number of bytes to get.
@throws IOException Thrown, if the DataInput encounte... | [
"Bulk",
"put",
"method",
".",
"Copies",
"length",
"memory",
"from",
"the",
"given",
"DataInput",
"to",
"the",
"memory",
"starting",
"at",
"position",
"offset",
"."
] | c543a08f9676c5b2b0a7088123bd6e795a8ae0c8 | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-core/src/main/java/eu/stratosphere/core/memory/MemorySegment.java#L873-L875 | train | Put a block of data into the buffer. | Of course, here is the Java code you requested:
```java
public final void put(DataInput in, int offset, int length) throws IOException {
in.readFully(this.memory, offset, length);
}
```
Hope this helps! |
aws/aws-sdk-java | aws-java-sdk-emr/src/main/java/com/amazonaws/services/elasticmapreduce/model/transform/Ec2InstanceAttributesMarshaller.java | Ec2InstanceAttributesMarshaller.marshall | public void marshall(Ec2InstanceAttributes ec2InstanceAttributes, ProtocolMarshaller protocolMarshaller) {
if (ec2InstanceAttributes == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(ec2InstanceAttri... | java | public void marshall(Ec2InstanceAttributes ec2InstanceAttributes, ProtocolMarshaller protocolMarshaller) {
if (ec2InstanceAttributes == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(ec2InstanceAttri... | [
"public",
"void",
"marshall",
"(",
"Ec2InstanceAttributes",
"ec2InstanceAttributes",
",",
"ProtocolMarshaller",
"protocolMarshaller",
")",
"{",
"if",
"(",
"ec2InstanceAttributes",
"==",
"null",
")",
"{",
"throw",
"new",
"SdkClientException",
"(",
"\"Invalid argument passe... | Marshall the given parameter object. | [
"Marshall",
"the",
"given",
"parameter",
"object",
"."
] | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-emr/src/main/java/com/amazonaws/services/elasticmapreduce/model/transform/Ec2InstanceAttributesMarshaller.java#L63-L84 | train | marshalls the given EC2InstanceAttributes to the JSON object. | Of course, here is the Java code you requested:
```java
public void marshall(Ec2InstanceAttributes ec2InstanceAttributes, ProtocolMarshaller protocolMarshaller) {
if (ec2InstanceAttributes == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {... |
bullhorn/sdk-rest | src/main/java/com/bullhornsdk/data/api/StandardBullhornData.java | StandardBullhornData.search | @Override
public <T extends SearchEntity, L extends ListWrapper<T>> L search(Class<T> type, String query, Set<String> fieldSet,
SearchParams params) {
return this.handleSearchForEntities(type, query, fieldSet, params);
} | java | @Override
public <T extends SearchEntity, L extends ListWrapper<T>> L search(Class<T> type, String query, Set<String> fieldSet,
SearchParams params) {
return this.handleSearchForEntities(type, query, fieldSet, params);
} | [
"@",
"Override",
"public",
"<",
"T",
"extends",
"SearchEntity",
",",
"L",
"extends",
"ListWrapper",
"<",
"T",
">",
">",
"L",
"search",
"(",
"Class",
"<",
"T",
">",
"type",
",",
"String",
"query",
",",
"Set",
"<",
"String",
">",
"fieldSet",
",",
"Sear... | {@inheritDoc} | [
"{"
] | 0c75a141c768bb31510afc3a412c11bd101eca06 | https://github.com/bullhorn/sdk-rest/blob/0c75a141c768bb31510afc3a412c11bd101eca06/src/main/java/com/bullhornsdk/data/api/StandardBullhornData.java#L304-L308 | train | Override this method to perform a search for entities. | Of course, here is the Java code you requested:
```java
@Override
public <T extends SearchEntity, L extends ListWrapper<T>> L search(Class<T> type, String query, Set<String> fieldSet,
SearchParams params) {
return this.handleSearchForEn... |
Cleveroad/AdaptiveTableLayout | library/src/main/java/com/cleveroad/adaptivetablelayout/AdaptiveTableLayout.java | AdaptiveTableLayout.switchHeaders | @SuppressWarnings("unused")
private void switchHeaders(SparseArrayCompat<ViewHolder> map, int fromIndex, int toIndex, int type) {
ViewHolder fromVh = map.get(fromIndex);
if (fromVh != null) {
map.remove(fromIndex);
if (type == ViewHolderType.COLUMN_HEADER) {
... | java | @SuppressWarnings("unused")
private void switchHeaders(SparseArrayCompat<ViewHolder> map, int fromIndex, int toIndex, int type) {
ViewHolder fromVh = map.get(fromIndex);
if (fromVh != null) {
map.remove(fromIndex);
if (type == ViewHolderType.COLUMN_HEADER) {
... | [
"@",
"SuppressWarnings",
"(",
"\"unused\"",
")",
"private",
"void",
"switchHeaders",
"(",
"SparseArrayCompat",
"<",
"ViewHolder",
">",
"map",
",",
"int",
"fromIndex",
",",
"int",
"toIndex",
",",
"int",
"type",
")",
"{",
"ViewHolder",
"fromVh",
"=",
"map",
".... | Method switch view holders in map (map with headers view holders).
@param map header view holder's map
@param fromIndex index from view holder
@param toIndex index to view holder
@param type type of items (column header or row header) | [
"Method",
"switch",
"view",
"holders",
"in",
"map",
"(",
"map",
"with",
"headers",
"view",
"holders",
")",
"."
] | 188213b35e05e635497b03fe741799782dde7208 | https://github.com/Cleveroad/AdaptiveTableLayout/blob/188213b35e05e635497b03fe741799782dde7208/library/src/main/java/com/cleveroad/adaptivetablelayout/AdaptiveTableLayout.java#L1266-L1296 | train | Switch headers. | Of course, here is the Java code you requested:
```java
@SuppressWarnings("unused")
private void switchHeaders(SparseArrayCompat<ViewHolder> map, int fromIndex, int toIndex, int type) {
ViewHolder fromVh = map.get(fromIndex);
if (fromVh != null) {
map.remove(fromIndex);
if ... |
joaovicente/Tracy | src/main/java/com/apm4all/tracy/Tracy.java | Tracy.after | public static void after(String label) {
TracyThreadContext ctx = threadContext.get();
if (isValidContext(ctx)) {
ctx.pop();
}
} | java | public static void after(String label) {
TracyThreadContext ctx = threadContext.get();
if (isValidContext(ctx)) {
ctx.pop();
}
} | [
"public",
"static",
"void",
"after",
"(",
"String",
"label",
")",
"{",
"TracyThreadContext",
"ctx",
"=",
"threadContext",
".",
"get",
"(",
")",
";",
"if",
"(",
"isValidContext",
"(",
"ctx",
")",
")",
"{",
"ctx",
".",
"pop",
"(",
")",
";",
"}",
"}"
] | Call after finishing an operation you want to capture elapsed time for.<br>
@param label is the name you will see in the trace event report of graph node representation or timeline | [
"Call",
"after",
"finishing",
"an",
"operation",
"you",
"want",
"to",
"capture",
"elapsed",
"time",
"for",
".",
"<br",
">"
] | 822d3aa335c1801df25ae6e67c22466368de3747 | https://github.com/joaovicente/Tracy/blob/822d3aa335c1801df25ae6e67c22466368de3747/src/main/java/com/apm4all/tracy/Tracy.java#L100-L105 | train | Remove the Tracy tag from the TracyThreadContext | Of course, here is the Java code you requested:
```java
public static void after(String label) {
TracyThreadContext ctx = threadContext.get();
if (isValidContext(ctx)) {
ctx.pop();
}
}
```
Hope this helps! |
duracloud/duracloud | storeclient/src/main/java/org/duracloud/client/ContentStoreImpl.java | ContentStoreImpl.copyContent | @Override
public String copyContent(String srcSpaceId,
String srcContentId,
String destSpaceId,
String destContentId)
throws ContentStoreException {
return copyContent(srcSpaceId,
src... | java | @Override
public String copyContent(String srcSpaceId,
String srcContentId,
String destSpaceId,
String destContentId)
throws ContentStoreException {
return copyContent(srcSpaceId,
src... | [
"@",
"Override",
"public",
"String",
"copyContent",
"(",
"String",
"srcSpaceId",
",",
"String",
"srcContentId",
",",
"String",
"destSpaceId",
",",
"String",
"destContentId",
")",
"throws",
"ContentStoreException",
"{",
"return",
"copyContent",
"(",
"srcSpaceId",
","... | {@inheritDoc} | [
"{"
] | dc4f3a1716d43543cc3b2e1880605f9389849b66 | https://github.com/duracloud/duracloud/blob/dc4f3a1716d43543cc3b2e1880605f9389849b66/storeclient/src/main/java/org/duracloud/client/ContentStoreImpl.java#L775-L786 | train | Copy content. | Of course, here is the Java code you requested:
```java
@Override
public String copyContent(String srcSpaceId,
String srcContentId,
String destSpaceId,
String destContentId)
throws ContentStoreException {
retu... |
google/guava | android/guava/src/com/google/common/util/concurrent/Monitor.java | Monitor.signalNextWaiter | @GuardedBy("lock")
private void signalNextWaiter() {
for (Guard guard = activeGuards; guard != null; guard = guard.next) {
if (isSatisfied(guard)) {
guard.condition.signal();
break;
}
}
} | java | @GuardedBy("lock")
private void signalNextWaiter() {
for (Guard guard = activeGuards; guard != null; guard = guard.next) {
if (isSatisfied(guard)) {
guard.condition.signal();
break;
}
}
} | [
"@",
"GuardedBy",
"(",
"\"lock\"",
")",
"private",
"void",
"signalNextWaiter",
"(",
")",
"{",
"for",
"(",
"Guard",
"guard",
"=",
"activeGuards",
";",
"guard",
"!=",
"null",
";",
"guard",
"=",
"guard",
".",
"next",
")",
"{",
"if",
"(",
"isSatisfied",
"(... | Signals some other thread waiting on a satisfied guard, if one exists.
<p>We manage calls to this method carefully, to signal only when necessary, but never losing a
signal, which is the classic problem of this kind of concurrency construct. We must signal if
the current thread is about to relinquish the lock and may ... | [
"Signals",
"some",
"other",
"thread",
"waiting",
"on",
"a",
"satisfied",
"guard",
"if",
"one",
"exists",
"."
] | 7155d12b70a2406fa84d94d4b8b3bc108e89abfd | https://github.com/google/guava/blob/7155d12b70a2406fa84d94d4b8b3bc108e89abfd/android/guava/src/com/google/common/util/concurrent/Monitor.java#L980-L988 | valid | Signal the next waiter. | Of course, here is the Java code you requested:
```java
@GuardedBy("lock")
private void signalNextWaiter() {
for (Guard guard = activeGuards; guard != null; guard = guard.next) {
if (isSatisfied(guard)) {
guard.condition.signal();
break;
}
}
}
```
Hope this helps! |
baratine/baratine | framework/src/main/java/com/caucho/v5/vfs/MergePath.java | MergePath.list | public String []list() throws IOException
{
ArrayList<String> list = new ArrayList<String>();
String pathname = _pathname;
// XXX:??
if (pathname.startsWith("/"))
pathname = "." + pathname;
ArrayList<PathImpl> pathList = ((MergePath) _root)._pathList;
for (int i = 0; i < pathList.size(... | java | public String []list() throws IOException
{
ArrayList<String> list = new ArrayList<String>();
String pathname = _pathname;
// XXX:??
if (pathname.startsWith("/"))
pathname = "." + pathname;
ArrayList<PathImpl> pathList = ((MergePath) _root)._pathList;
for (int i = 0; i < pathList.size(... | [
"public",
"String",
"[",
"]",
"list",
"(",
")",
"throws",
"IOException",
"{",
"ArrayList",
"<",
"String",
">",
"list",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"String",
"pathname",
"=",
"_pathname",
";",
"// XXX:??",
"if",
"(",
"pat... | List the merged directories. | [
"List",
"the",
"merged",
"directories",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/vfs/MergePath.java#L565-L591 | train | List all the directories in the merge path. | Of course, here is the Java code you requested:
```java
public String []list() throws IOException
{
ArrayList<String> list = new ArrayList<String>();
String pathname = _pathname;
// XXX:??
if (pathname.startsWith("/"))
pathname = "." + pathname;
ArrayList<PathImpl> pathList = ((MergePath)... |
Jasig/uPortal | uPortal-security/uPortal-security-authn/src/main/java/org/apereo/portal/portlet/container/services/CasTicketUserInfoService.java | CasTicketUserInfoService.getProxyTicket | private String getProxyTicket(PortletRequest request) {
final HttpServletRequest httpServletRequest =
this.portalRequestUtils.getPortletHttpRequest(request);
// try to determine the URL for our portlet
String targetService = null;
try {
URL url = null;
... | java | private String getProxyTicket(PortletRequest request) {
final HttpServletRequest httpServletRequest =
this.portalRequestUtils.getPortletHttpRequest(request);
// try to determine the URL for our portlet
String targetService = null;
try {
URL url = null;
... | [
"private",
"String",
"getProxyTicket",
"(",
"PortletRequest",
"request",
")",
"{",
"final",
"HttpServletRequest",
"httpServletRequest",
"=",
"this",
".",
"portalRequestUtils",
".",
"getPortletHttpRequest",
"(",
"request",
")",
";",
"// try to determine the URL for our portl... | Attempt to get a proxy ticket for the current portlet.
@param request portlet request
@return a proxy ticket, or <code>null</code> if we were unsuccessful | [
"Attempt",
"to",
"get",
"a",
"proxy",
"ticket",
"for",
"the",
"current",
"portlet",
"."
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-security/uPortal-security-authn/src/main/java/org/apereo/portal/portlet/container/services/CasTicketUserInfoService.java#L177-L238 | train | Get the proxy ticket for the portlet. | Of course, here is the Java code you requested:
```java
private String getProxyTicket(PortletRequest request) {
final HttpServletRequest httpServletRequest =
this.portalRequestUtils.getPortletHttpRequest(request);
// try to determine the URL for our portlet
String targetServic... |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/string/StringParser.java | StringParser.parseByteObj | @Nullable
public static Byte parseByteObj (@Nullable final String sStr)
{
return parseByteObj (sStr, DEFAULT_RADIX, null);
} | java | @Nullable
public static Byte parseByteObj (@Nullable final String sStr)
{
return parseByteObj (sStr, DEFAULT_RADIX, null);
} | [
"@",
"Nullable",
"public",
"static",
"Byte",
"parseByteObj",
"(",
"@",
"Nullable",
"final",
"String",
"sStr",
")",
"{",
"return",
"parseByteObj",
"(",
"sStr",
",",
"DEFAULT_RADIX",
",",
"null",
")",
";",
"}"
] | Parse the given {@link String} as {@link Byte} with radix
{@value #DEFAULT_RADIX}.
@param sStr
The String to parse. May be <code>null</code>.
@return <code>null</code> if the string does not represent a valid value. | [
"Parse",
"the",
"given",
"{",
"@link",
"String",
"}",
"as",
"{",
"@link",
"Byte",
"}",
"with",
"radix",
"{",
"@value",
"#DEFAULT_RADIX",
"}",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringParser.java#L396-L400 | train | Parse a byte object from a string. | Of course, here is the Java code you requested:
```java
@Nullable
public static Byte parseByteObj (@Nullable final String sStr)
{
return parseByteObj (sStr, DEFAULT_RADIX, null);
}
```
Hope this helps! |
elibom/jogger | src/main/java/com/elibom/jogger/middleware/router/loader/AbstractFileRoutesLoader.java | AbstractFileRoutesLoader.getMethod | private Method getMethod(Object controller, String methodName) throws RoutesException {
try {
// try to retrieve the method and check if an exception is thrown
return controller.getClass().getMethod(methodName, Request.class, Response.class);
} catch (Exception e) {
throw new RoutesException(e);
}
} | java | private Method getMethod(Object controller, String methodName) throws RoutesException {
try {
// try to retrieve the method and check if an exception is thrown
return controller.getClass().getMethod(methodName, Request.class, Response.class);
} catch (Exception e) {
throw new RoutesException(e);
}
} | [
"private",
"Method",
"getMethod",
"(",
"Object",
"controller",
",",
"String",
"methodName",
")",
"throws",
"RoutesException",
"{",
"try",
"{",
"// try to retrieve the method and check if an exception is thrown",
"return",
"controller",
".",
"getClass",
"(",
")",
".",
"g... | Helper method. Retrieves the method with the specified <code>methodName</code> and from the specified object.
Notice that the method must received two parameters of types {@link Request} and {@link Response} respectively.
@param controller the object from which we will retrieve the method.
@param methodName the name o... | [
"Helper",
"method",
".",
"Retrieves",
"the",
"method",
"with",
"the",
"specified",
"<code",
">",
"methodName<",
"/",
"code",
">",
"and",
"from",
"the",
"specified",
"object",
".",
"Notice",
"that",
"the",
"method",
"must",
"received",
"two",
"parameters",
"o... | d5892ff45e76328d444a68b5a38c26e7bdd0692b | https://github.com/elibom/jogger/blob/d5892ff45e76328d444a68b5a38c26e7bdd0692b/src/main/java/com/elibom/jogger/middleware/router/loader/AbstractFileRoutesLoader.java#L267-L274 | train | Gets the method. | Of course, here is the Java code you requested:
```java
private Method getMethod(Object controller, String methodName) throws RoutesException {
try {
// try to retrieve the method and check if an exception is thrown
return controller.getClass().getMethod(methodName, Request.class, Response.class);
} catch (E... |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/deepboof/ClipAndReduce.java | ClipAndReduce.clipInput | T clipInput(T input, T output) {
double ratioInput = input.width/(double)input.height;
double ratioOutput = output.width/(double)output.height;
T a = input;
if( ratioInput > ratioOutput ) { // clip the width
int width = input.height*output.width/output.height;
int x0 = (input.width-width)/2;
int x1 =... | java | T clipInput(T input, T output) {
double ratioInput = input.width/(double)input.height;
double ratioOutput = output.width/(double)output.height;
T a = input;
if( ratioInput > ratioOutput ) { // clip the width
int width = input.height*output.width/output.height;
int x0 = (input.width-width)/2;
int x1 =... | [
"T",
"clipInput",
"(",
"T",
"input",
",",
"T",
"output",
")",
"{",
"double",
"ratioInput",
"=",
"input",
".",
"width",
"/",
"(",
"double",
")",
"input",
".",
"height",
";",
"double",
"ratioOutput",
"=",
"output",
".",
"width",
"/",
"(",
"double",
")"... | Clip the input image to ensure a constant aspect ratio | [
"Clip",
"the",
"input",
"image",
"to",
"ensure",
"a",
"constant",
"aspect",
"ratio"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/deepboof/ClipAndReduce.java#L94-L117 | train | Clips the input image to the output image. | Of course, here is the Java code you requested:
```java
T clipInput(T input, T output) {
double ratioInput = input.width/(double)input.height;
double ratioOutput = output.width/(double)output.height;
T a = input;
if( ratioInput > ratioOutput ) { // clip the width
int width = input.height*output.width/outp... |
citrusframework/citrus | modules/citrus-jdbc/src/main/java/com/consol/citrus/jdbc/server/JdbcEndpointAdapterController.java | JdbcEndpointAdapterController.rollbackStatements | @Override
public void rollbackStatements() {
if (log.isDebugEnabled()) {
log.debug(String.format("Received transaction rollback: '%s':%n",
endpointConfiguration.getServerConfiguration().getDatabaseName()));
}
if(!endpointConfiguration.isAutoTransactionHandlin... | java | @Override
public void rollbackStatements() {
if (log.isDebugEnabled()) {
log.debug(String.format("Received transaction rollback: '%s':%n",
endpointConfiguration.getServerConfiguration().getDatabaseName()));
}
if(!endpointConfiguration.isAutoTransactionHandlin... | [
"@",
"Override",
"public",
"void",
"rollbackStatements",
"(",
")",
"{",
"if",
"(",
"log",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"log",
".",
"debug",
"(",
"String",
".",
"format",
"(",
"\"Received transaction rollback: '%s':%n\"",
",",
"endpointConfiguration... | Performs a rollback on the current transaction | [
"Performs",
"a",
"rollback",
"on",
"the",
"current",
"transaction"
] | 55c58ef74c01d511615e43646ca25c1b2301c56d | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-jdbc/src/main/java/com/consol/citrus/jdbc/server/JdbcEndpointAdapterController.java#L283-L293 | train | Rollback statements. | Of course, here is the Java code you requested:
```java
@Override
public void rollbackStatements() {
if (log.isDebugEnabled()) {
log.debug(String.format("Received transaction rollback: '%s':%n",
endpointConfiguration.getServerConfiguration().getDatabaseName()));
}
... |
zaproxy/zaproxy | src/org/parosproxy/paros/model/Model.java | Model.loadContext | public void loadContext(Context ctx) {
validateContextNotNull(ctx);
for (ContextDataFactory cdf : this.contextDataFactories) {
cdf.loadContextData(getSession(), ctx);
}
} | java | public void loadContext(Context ctx) {
validateContextNotNull(ctx);
for (ContextDataFactory cdf : this.contextDataFactories) {
cdf.loadContextData(getSession(), ctx);
}
} | [
"public",
"void",
"loadContext",
"(",
"Context",
"ctx",
")",
"{",
"validateContextNotNull",
"(",
"ctx",
")",
";",
"for",
"(",
"ContextDataFactory",
"cdf",
":",
"this",
".",
"contextDataFactories",
")",
"{",
"cdf",
".",
"loadContextData",
"(",
"getSession",
"("... | Loads the given context, by calling all the {@link ContextDataFactory}ies.
@param ctx the context to load.
@throws IllegalArgumentException (since TODO add version) if the given context is {@code null}.
@see ContextDataFactory#loadContextData(Session, Context)
@since 2.0.0 | [
"Loads",
"the",
"given",
"context",
"by",
"calling",
"all",
"the",
"{",
"@link",
"ContextDataFactory",
"}",
"ies",
"."
] | 0cbe5121f2ae1ecca222513d182759210c569bec | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/parosproxy/paros/model/Model.java#L516-L522 | train | Loads the context data from the underlying data source. | Of course, here is the Java code you requested:
```java
public void loadContext(Context ctx) {
validateContextNotNull(ctx);
for (ContextDataFactory cdf : this.contextDataFactories) {
cdf.loadContextData(getSession(), ctx);
}
}
```
Hope this helps! |
eserating/siren4j | src/main/java/com/google/code/siren4j/converter/ResourceRegistryImpl.java | ResourceRegistryImpl.containsEntityEntry | public boolean containsEntityEntry(String entityName) {
if (StringUtils.isBlank(entityName)) {
throw new IllegalArgumentException("entityName cannot be null or empty.");
}
return entries.containsKey(entityName);
} | java | public boolean containsEntityEntry(String entityName) {
if (StringUtils.isBlank(entityName)) {
throw new IllegalArgumentException("entityName cannot be null or empty.");
}
return entries.containsKey(entityName);
} | [
"public",
"boolean",
"containsEntityEntry",
"(",
"String",
"entityName",
")",
"{",
"if",
"(",
"StringUtils",
".",
"isBlank",
"(",
"entityName",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"entityName cannot be null or empty.\"",
")",
";",
"}",
... | /* (non-Javadoc)
@see com.google.code.siren4j.converter.ResourceRegistry#containsEntityEntry(java.lang.String) | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | f12e3185076ad920352ec4f6eb2a071a3683505f | https://github.com/eserating/siren4j/blob/f12e3185076ad920352ec4f6eb2a071a3683505f/src/main/java/com/google/code/siren4j/converter/ResourceRegistryImpl.java#L70-L75 | train | Checks if the map contains a single entity entry. | Of course, here is the Java code you requested:
```java
public boolean containsEntityEntry(String entityName) {
if (StringUtils.isBlank(entityName)) {
throw new IllegalArgumentException("entityName cannot be null or empty.");
}
return entries.containsKey(entityName);
}
```
... |
alkacon/opencms-core | src-gwt/org/opencms/acacia/client/ui/CmsAttributeValueView.java | CmsAttributeValueView.updateWidth | void updateWidth() {
if (formCss().firstColumn().equals(m_compacteModeStyle.getValue())) {
int width = getElement().getParentElement().getOffsetWidth() - formCss().SECOND_COLUMN_WIDTH();
// if width could not be evaluated, fall back to a 'save' value
if (width < 0) {
... | java | void updateWidth() {
if (formCss().firstColumn().equals(m_compacteModeStyle.getValue())) {
int width = getElement().getParentElement().getOffsetWidth() - formCss().SECOND_COLUMN_WIDTH();
// if width could not be evaluated, fall back to a 'save' value
if (width < 0) {
... | [
"void",
"updateWidth",
"(",
")",
"{",
"if",
"(",
"formCss",
"(",
")",
".",
"firstColumn",
"(",
")",
".",
"equals",
"(",
"m_compacteModeStyle",
".",
"getValue",
"(",
")",
")",
")",
"{",
"int",
"width",
"=",
"getElement",
"(",
")",
".",
"getParentElement... | Updates the widget width according to the compact mode setting.<p> | [
"Updates",
"the",
"widget",
"width",
"according",
"to",
"the",
"compact",
"mode",
"setting",
".",
"<p",
">"
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/acacia/client/ui/CmsAttributeValueView.java#L1072-L1084 | train | Update the width of the element based on the width of the compacte mode. | Of course, here is the Java code you requested:
```java
void updateWidth() {
if (formCss().firstColumn().equals(m_compacteModeStyle.getValue())) {
int width = getElement().getParentElement().getOffsetWidth() - formCss().SECOND_COLUMN_WIDTH();
// if width could not be evaluated, fal... |
apache/incubator-druid | extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/ApproximateHistogram.java | ApproximateHistogram.foldMin | protected ApproximateHistogram foldMin(
ApproximateHistogram h,
float[] mergedPositions,
long[] mergedBins,
float[] deltas
)
{
// find common min / max
float mergedMin = this.min < h.min ? this.min : h.min;
float mergedMax = this.max > h.max ? this.max : h.max;
long mergedCou... | java | protected ApproximateHistogram foldMin(
ApproximateHistogram h,
float[] mergedPositions,
long[] mergedBins,
float[] deltas
)
{
// find common min / max
float mergedMin = this.min < h.min ? this.min : h.min;
float mergedMax = this.max > h.max ? this.max : h.max;
long mergedCou... | [
"protected",
"ApproximateHistogram",
"foldMin",
"(",
"ApproximateHistogram",
"h",
",",
"float",
"[",
"]",
"mergedPositions",
",",
"long",
"[",
"]",
"mergedBins",
",",
"float",
"[",
"]",
"deltas",
")",
"{",
"// find common min / max",
"float",
"mergedMin",
"=",
"... | approximate histogram solution using min heap to store location of min deltas | [
"approximate",
"histogram",
"solution",
"using",
"min",
"heap",
"to",
"store",
"location",
"of",
"min",
"deltas"
] | f776b9408962b9006cfcfe4d6c1794751972cc8e | https://github.com/apache/incubator-druid/blob/f776b9408962b9006cfcfe4d6c1794751972cc8e/extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/ApproximateHistogram.java#L533-L613 | train | Folds the given ApproximateHistogram into two arrays of the same size. | Of course, here is the Java code you requested:
```java
protected ApproximateHistogram foldMin(
ApproximateHistogram h,
float[] mergedPositions,
long[] mergedBins,
float[] deltas
)
{
// find common min / max
float mergedMin = this.min < h.min ? this.min : h.min;
float mergedMax ... |
jboss/jboss-common-core | src/main/java/org/jboss/util/xml/catalog/Resolver.java | Resolver.queryResolver | protected Resolver queryResolver(String resolver,
String command,
String arg1,
String arg2) {
String RFC2483 = resolver + "?command=" + command
+ "&format=tr9401&uri=" + arg1
+ "&uri2=" + arg2;
try {
URL url = new URL(RFC2483);
URLConnection urlCon = url.openConnecti... | java | protected Resolver queryResolver(String resolver,
String command,
String arg1,
String arg2) {
String RFC2483 = resolver + "?command=" + command
+ "&format=tr9401&uri=" + arg1
+ "&uri2=" + arg2;
try {
URL url = new URL(RFC2483);
URLConnection urlCon = url.openConnecti... | [
"protected",
"Resolver",
"queryResolver",
"(",
"String",
"resolver",
",",
"String",
"command",
",",
"String",
"arg1",
",",
"String",
"arg2",
")",
"{",
"String",
"RFC2483",
"=",
"resolver",
"+",
"\"?command=\"",
"+",
"command",
"+",
"\"&format=tr9401&uri=\"",
"+"... | Query an external RFC2483 resolver.
@param resolver The URL of the RFC2483 resolver.
@param command The command to send the resolver.
@param arg1 The first argument to the resolver.
@param arg2 The second argument to the resolver, usually null.
@return The Resolver constructed. | [
"Query",
"an",
"external",
"RFC2483",
"resolver",
"."
] | c191bb18db83fa106c6913cf34ed47989b65dc97 | https://github.com/jboss/jboss-common-core/blob/c191bb18db83fa106c6913cf34ed47989b65dc97/src/main/java/org/jboss/util/xml/catalog/Resolver.java#L362-L404 | test | Query resolver. | Of course, here is the Java code you requested:
```java
protected Resolver queryResolver(String resolver,
String command,
String arg1,
String arg2) {
String RFC2483 = resolver + "?command=" + command
+ "&format=tr9401&uri=" + arg1
+ "&uri2=" + arg2;
try {
URL url = new UR... |
facebook/fresco | imagepipeline-base/src/main/java/com/facebook/cache/common/WriterCallbacks.java | WriterCallbacks.from | public static WriterCallback from(final byte[] data) {
return new WriterCallback() {
@Override
public void write(OutputStream os) throws IOException {
os.write(data);
}
};
} | java | public static WriterCallback from(final byte[] data) {
return new WriterCallback() {
@Override
public void write(OutputStream os) throws IOException {
os.write(data);
}
};
} | [
"public",
"static",
"WriterCallback",
"from",
"(",
"final",
"byte",
"[",
"]",
"data",
")",
"{",
"return",
"new",
"WriterCallback",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
"write",
"(",
"OutputStream",
"os",
")",
"throws",
"IOException",
"{",
"os"... | Creates a writer callback that writes some byte array to the target stream.
<p>This writer can be used many times.
@param data the bytes to write
@return the writer callback | [
"Creates",
"a",
"writer",
"callback",
"that",
"writes",
"some",
"byte",
"array",
"to",
"the",
"target",
"stream",
"."
] | 0b85879d51c5036d5e46e627a6651afefc0b971a | https://github.com/facebook/fresco/blob/0b85879d51c5036d5e46e627a6651afefc0b971a/imagepipeline-base/src/main/java/com/facebook/cache/common/WriterCallbacks.java#L44-L51 | train | Create a new WriterCallback from the given byte array. | Of course, here is the Java code you requested:
```java
public static WriterCallback from(final byte[] data) {
return new WriterCallback() {
@Override
public void write(OutputStream os) throws IOException {
os.write(data);
}
};
}
```
Hope this helps! |
prestodb/presto | presto-main/src/main/java/com/facebook/presto/execution/executor/MultilevelSplitQueue.java | MultilevelSplitQueue.updatePriority | public Priority updatePriority(Priority oldPriority, long quantaNanos, long scheduledNanos)
{
int oldLevel = oldPriority.getLevel();
int newLevel = computeLevel(scheduledNanos);
long levelContribution = Math.min(quantaNanos, LEVEL_CONTRIBUTION_CAP);
if (oldLevel == newLevel) {
... | java | public Priority updatePriority(Priority oldPriority, long quantaNanos, long scheduledNanos)
{
int oldLevel = oldPriority.getLevel();
int newLevel = computeLevel(scheduledNanos);
long levelContribution = Math.min(quantaNanos, LEVEL_CONTRIBUTION_CAP);
if (oldLevel == newLevel) {
... | [
"public",
"Priority",
"updatePriority",
"(",
"Priority",
"oldPriority",
",",
"long",
"quantaNanos",
",",
"long",
"scheduledNanos",
")",
"{",
"int",
"oldLevel",
"=",
"oldPriority",
".",
"getLevel",
"(",
")",
";",
"int",
"newLevel",
"=",
"computeLevel",
"(",
"sc... | Presto 'charges' the quanta run time to the task <i>and</i> the level it belongs to in
an effort to maintain the target thread utilization ratios between levels and to
maintain fairness within a level.
<p>
Consider an example split where a read hung for several minutes. This is either a bug
or a failing dependency. In ... | [
"Presto",
"charges",
"the",
"quanta",
"run",
"time",
"to",
"the",
"task",
"<i",
">",
"and<",
"/",
"i",
">",
"the",
"level",
"it",
"belongs",
"to",
"in",
"an",
"effort",
"to",
"maintain",
"the",
"target",
"thread",
"utilization",
"ratios",
"between",
"lev... | 89de5e379d8f85e139d292b0add8c537a2a01a88 | https://github.com/prestodb/presto/blob/89de5e379d8f85e139d292b0add8c537a2a01a88/presto-main/src/main/java/com/facebook/presto/execution/executor/MultilevelSplitQueue.java#L217-L245 | train | Update the priority of a single exception. | Of course, here is the Java code you requested:
```java
public Priority updatePriority(Priority oldPriority, long quantaNanos, long scheduledNanos)
{
int oldLevel = oldPriority.getLevel();
int newLevel = computeLevel(scheduledNanos);
long levelContribution = Math.min(quantaNanos, LEVEL_CON... |
skuzzle/jeve | jeve/src/it/java/de/skuzzle/jeve/AWTEventProviderIT.java | AWTEventProviderIT.getParameters | @Parameters
public static final Collection<Object[]> getParameters() {
return Arrays.asList(
new Object[] {
(Function<ListenerStore, ? extends EventProvider>) store -> new AWTEventProvider(store, true),
(Supplier<ListenerStore>) () -> Performan... | java | @Parameters
public static final Collection<Object[]> getParameters() {
return Arrays.asList(
new Object[] {
(Function<ListenerStore, ? extends EventProvider>) store -> new AWTEventProvider(store, true),
(Supplier<ListenerStore>) () -> Performan... | [
"@",
"Parameters",
"public",
"static",
"final",
"Collection",
"<",
"Object",
"[",
"]",
">",
"getParameters",
"(",
")",
"{",
"return",
"Arrays",
".",
"asList",
"(",
"new",
"Object",
"[",
"]",
"{",
"(",
"Function",
"<",
"ListenerStore",
",",
"?",
"extends"... | Parameterizes the test instances.
@return Collection of parameters for the constructor of
{@link EventProviderTestBase}. | [
"Parameterizes",
"the",
"test",
"instances",
"."
] | 42cc18947c9c8596c34410336e4e375e9fcd7c47 | https://github.com/skuzzle/jeve/blob/42cc18947c9c8596c34410336e4e375e9fcd7c47/jeve/src/it/java/de/skuzzle/jeve/AWTEventProviderIT.java#L40-L60 | train | Returns the parameters of the AWT event provider. | Of course, here is the Java code you requested:
```java
@Parameters
public static final Collection<Object[]> getParameters() {
return Arrays.asList(
new Object[] {
(Function<ListenerStore, ? extends EventProvider>) store -> new AWTEventProvider(store, true),
... |
OpenLiberty/open-liberty | dev/com.ibm.ws.crypto.passwordutil/src/com/ibm/websphere/crypto/PasswordUtil.java | PasswordUtil.encode_password | public static String encode_password(String decoded_string, String crypto_algorithm, Map<String, String> properties) {
/*
* encoding process:
*
* -- check for empty algorithm tag
* -- convert input String to byte[] UTF8 conversion code
* -- encipher byte[]
... | java | public static String encode_password(String decoded_string, String crypto_algorithm, Map<String, String> properties) {
/*
* encoding process:
*
* -- check for empty algorithm tag
* -- convert input String to byte[] UTF8 conversion code
* -- encipher byte[]
... | [
"public",
"static",
"String",
"encode_password",
"(",
"String",
"decoded_string",
",",
"String",
"crypto_algorithm",
",",
"Map",
"<",
"String",
",",
"String",
">",
"properties",
")",
"{",
"/*\n * encoding process:\n * \n * -- check for empty algorithm ... | Encode the provided string by using the specified encoding algorithm and properties
@param decoded_string the string to be encoded.
@param crypto_algorithm the algorithm to be used for encoding. The supported values are xor, aes, or hash.
@param properties the properties for the encryption.
@return The encoded string.... | [
"Encode",
"the",
"provided",
"string",
"by",
"using",
"the",
"specified",
"encoding",
"algorithm",
"and",
"properties"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.crypto.passwordutil/src/com/ibm/websphere/crypto/PasswordUtil.java#L657-L732 | train | Encode password using specified crypto algorithm and properties | Of course, here is the Java code you requested:
```java
public static String encode_password(String decoded_string, String crypto_algorithm, Map<String, String> properties) {
/*
* encoding process:
*
* -- check for empty algorithm tag
* -- convert input String to byte[] UTF... |
camunda/camunda-bpmn-model | src/main/java/org/camunda/bpm/model/bpmn/builder/AbstractErrorEventDefinitionBuilder.java | AbstractErrorEventDefinitionBuilder.errorEventDefinitionDone | @SuppressWarnings({ "rawtypes", "unchecked" })
public <T extends AbstractFlowNodeBuilder> T errorEventDefinitionDone() {
return (T) ((Event) element.getParentElement()).builder();
} | java | @SuppressWarnings({ "rawtypes", "unchecked" })
public <T extends AbstractFlowNodeBuilder> T errorEventDefinitionDone() {
return (T) ((Event) element.getParentElement()).builder();
} | [
"@",
"SuppressWarnings",
"(",
"{",
"\"rawtypes\"",
",",
"\"unchecked\"",
"}",
")",
"public",
"<",
"T",
"extends",
"AbstractFlowNodeBuilder",
">",
"T",
"errorEventDefinitionDone",
"(",
")",
"{",
"return",
"(",
"T",
")",
"(",
"(",
"Event",
")",
"element",
".",... | Finishes the building of a error event definition.
@param <T>
@return the parent event builder | [
"Finishes",
"the",
"building",
"of",
"a",
"error",
"event",
"definition",
"."
] | debcadf041d10fa62b799de0307b832cea84e5d4 | https://github.com/camunda/camunda-bpmn-model/blob/debcadf041d10fa62b799de0307b832cea84e5d4/src/main/java/org/camunda/bpm/model/bpmn/builder/AbstractErrorEventDefinitionBuilder.java#L70-L73 | train | This method is called when an error event definition is done. | Of course, here is the Java code you requested:
```java
@SuppressWarnings({ "rawtypes", "unchecked" })
public <T extends AbstractFlowNodeBuilder> T errorEventDefinitionDone() {
return (T) ((Event) element.getParentElement()).builder();
}
```
Hope this helps! |
sd4324530/fastweixin | src/main/java/com/github/sd4324530/fastweixin/company/api/QYAgentAPI.java | QYAgentAPI.create | @Deprecated
public QYResultType create(QYAgent agent, String mediaId){
String url = BASE_API_URL + "cgi-bin/agent/set?access_token=#";
final Map<String, Object> params = new HashMap<String, Object>();
params.put("agentid", agent.getAgentId());
params.put("report_location_flag", Strin... | java | @Deprecated
public QYResultType create(QYAgent agent, String mediaId){
String url = BASE_API_URL + "cgi-bin/agent/set?access_token=#";
final Map<String, Object> params = new HashMap<String, Object>();
params.put("agentid", agent.getAgentId());
params.put("report_location_flag", Strin... | [
"@",
"Deprecated",
"public",
"QYResultType",
"create",
"(",
"QYAgent",
"agent",
",",
"String",
"mediaId",
")",
"{",
"String",
"url",
"=",
"BASE_API_URL",
"+",
"\"cgi-bin/agent/set?access_token=#\"",
";",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"params... | 设置应用信息
-----------------------------------------------
设置应用信息方法使用新的update方法代替。
-----------------------------------------------
@param agent 应用对象
@param mediaId 应用的logo
@return 创建结果 | [
"设置应用信息",
"-----------------------------------------------",
"设置应用信息方法使用新的update方法代替。",
"-----------------------------------------------"
] | 6bc0a7abfa23aad0dbad4c3123a47a7fb53f3447 | https://github.com/sd4324530/fastweixin/blob/6bc0a7abfa23aad0dbad4c3123a47a7fb53f3447/src/main/java/com/github/sd4324530/fastweixin/company/api/QYAgentAPI.java#L76-L90 | train | Create a new logo for an agent. | Of course, here is the Java code you requested:
```java
@Deprecated
public QYResultType create(QYAgent agent, String mediaId){
String url = BASE_API_URL + "cgi-bin/agent/set?access_token=#";
final Map<String, Object> params = new HashMap<String, Object>();
params.put("agentid", agent.getAge... |
MenoData/Time4J | base/src/main/java/net/time4j/range/DateInterval.java | DateInterval.emptyWithAnchor | public static DateInterval emptyWithAnchor(PlainDate anchor) {
return new DateInterval(
Boundary.of(CLOSED, anchor),
Boundary.of(OPEN, anchor));
} | java | public static DateInterval emptyWithAnchor(PlainDate anchor) {
return new DateInterval(
Boundary.of(CLOSED, anchor),
Boundary.of(OPEN, anchor));
} | [
"public",
"static",
"DateInterval",
"emptyWithAnchor",
"(",
"PlainDate",
"anchor",
")",
"{",
"return",
"new",
"DateInterval",
"(",
"Boundary",
".",
"of",
"(",
"CLOSED",
",",
"anchor",
")",
",",
"Boundary",
".",
"of",
"(",
"OPEN",
",",
"anchor",
")",
")",
... | /*[deutsch]
<p>Erzeugt ein leeres Intervall mit einem Ankerdatum. </p>
<p>Ein leeres Intervall enthält kein Datum, aber der Anker kann das Verhalten von Methoden
wie {@link IsoInterval#meets(IsoInterval)} modifizieren. Die untere Intervallgrenze ist geschlossen,
aber die obere Intervallgrenze ist offen. </p>
@pa... | [
"/",
"*",
"[",
"deutsch",
"]",
"<p",
">",
"Erzeugt",
"ein",
"leeres",
"Intervall",
"mit",
"einem",
"Ankerdatum",
".",
"<",
"/",
"p",
">"
] | 08b2eda6b2dbb140b92011cf7071bb087edd46a5 | https://github.com/MenoData/Time4J/blob/08b2eda6b2dbb140b92011cf7071bb087edd46a5/base/src/main/java/net/time4j/range/DateInterval.java#L380-L386 | train | Create an empty DateInterval with an anchor date. | Of course, here is the Java code you requested:
```java
public static DateInterval emptyWithAnchor(PlainDate anchor) {
return new DateInterval(
Boundary.of(CLOSED, anchor),
Boundary.of(OPEN, anchor));
}
```
Hope this helps! |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/date/DateTime.java | DateTime.setField | public DateTime setField(int field, int value) {
final Calendar calendar = toCalendar();
calendar.set(field, value);
DateTime dt = this;
if (false == mutable) {
dt = ObjectUtil.clone(this);
}
return dt.setTimeInternal(calendar.getTimeInMillis());
} | java | public DateTime setField(int field, int value) {
final Calendar calendar = toCalendar();
calendar.set(field, value);
DateTime dt = this;
if (false == mutable) {
dt = ObjectUtil.clone(this);
}
return dt.setTimeInternal(calendar.getTimeInMillis());
} | [
"public",
"DateTime",
"setField",
"(",
"int",
"field",
",",
"int",
"value",
")",
"{",
"final",
"Calendar",
"calendar",
"=",
"toCalendar",
"(",
")",
";",
"calendar",
".",
"set",
"(",
"field",
",",
"value",
")",
";",
"DateTime",
"dt",
"=",
"this",
";",
... | 设置日期的某个部分<br>
如果此对象为可变对象,返回自身,否则返回新对象,设置是否可变对象见{@link #setMutable(boolean)}
@param field 表示日期的哪个部分的int值 {@link Calendar}
@param value 值
@return {@link DateTime} | [
"设置日期的某个部分<br",
">",
"如果此对象为可变对象,返回自身,否则返回新对象,设置是否可变对象见",
"{",
"@link",
"#setMutable",
"(",
"boolean",
")",
"}"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/date/DateTime.java#L263-L272 | train | Sets the value of the specified field in this date time. | Of course, here is the Java code you requested:
```java
public DateTime setField(int field, int value) {
final Calendar calendar = toCalendar();
calendar.set(field, value);
DateTime dt = this;
if (false == mutable) {
dt = ObjectUtil.clone(this);
}
return dt.setTimeInternal(calendar.getTimeInMil... |
opengeospatial/teamengine | teamengine-core/src/main/java/com/occamlab/te/SetupOptions.java | SetupOptions.getBaseConfigDirectory | public static File getBaseConfigDirectory() {
if (null != teBaseDir) {
return teBaseDir;
}
String basePath = System.getProperty(TE_BASE);
if (null == basePath) {
basePath = System.getenv(TE_BASE);
}
if (null == basePath) {
basePath = System.getProperty("user.home")
... | java | public static File getBaseConfigDirectory() {
if (null != teBaseDir) {
return teBaseDir;
}
String basePath = System.getProperty(TE_BASE);
if (null == basePath) {
basePath = System.getenv(TE_BASE);
}
if (null == basePath) {
basePath = System.getProperty("user.home")
... | [
"public",
"static",
"File",
"getBaseConfigDirectory",
"(",
")",
"{",
"if",
"(",
"null",
"!=",
"teBaseDir",
")",
"{",
"return",
"teBaseDir",
";",
"}",
"String",
"basePath",
"=",
"System",
".",
"getProperty",
"(",
"TE_BASE",
")",
";",
"if",
"(",
"null",
"=... | Determines the location of the TE_BASE directory by looking for either 1)
a system property or 2) an environment variable named {@value #TE_BASE}.
Finally, if neither is set then the "teamengine" subdirectory is created
in the user home directory (${user.home}/teamengine).
@return A File denoting the location of the b... | [
"Determines",
"the",
"location",
"of",
"the",
"TE_BASE",
"directory",
"by",
"looking",
"for",
"either",
"1",
")",
"a",
"system",
"property",
"or",
"2",
")",
"an",
"environment",
"variable",
"named",
"{",
"@value",
"#TE_BASE",
"}",
".",
"Finally",
"if",
"ne... | b6b890214b6784bbe19460bf753bdf28a9514bee | https://github.com/opengeospatial/teamengine/blob/b6b890214b6784bbe19460bf753bdf28a9514bee/teamengine-core/src/main/java/com/occamlab/te/SetupOptions.java#L76-L95 | train | Get the base config directory | Of course, here is the Java code you requested:
```java
public static File getBaseConfigDirectory() {
if (null != teBaseDir) {
return teBaseDir;
}
String basePath = System.getProperty(TE_BASE);
if (null == basePath) {
basePath = System.getenv(TE_BASE);
}
if (null == basePath... |
actorapp/actor-platform | actor-sdk/sdk-core/core/core-shared/src/main/java/im/actor/core/modules/messaging/actions/SenderActor.java | SenderActor.doSendText | public void doSendText(@NotNull Peer peer, @NotNull String text,
@Nullable ArrayList<Integer> mentions, /*Ignored*/ @Nullable String markDownText,
boolean autoDetect) {
text = text.trim();
long rid = RandomUtils.nextRid();
long date = creat... | java | public void doSendText(@NotNull Peer peer, @NotNull String text,
@Nullable ArrayList<Integer> mentions, /*Ignored*/ @Nullable String markDownText,
boolean autoDetect) {
text = text.trim();
long rid = RandomUtils.nextRid();
long date = creat... | [
"public",
"void",
"doSendText",
"(",
"@",
"NotNull",
"Peer",
"peer",
",",
"@",
"NotNull",
"String",
"text",
",",
"@",
"Nullable",
"ArrayList",
"<",
"Integer",
">",
"mentions",
",",
"/*Ignored*/",
"@",
"Nullable",
"String",
"markDownText",
",",
"boolean",
"au... | Sending text | [
"Sending",
"text"
] | 5123c1584757c6eeea0ed2a0e7e043629871a0c6 | https://github.com/actorapp/actor-platform/blob/5123c1584757c6eeea0ed2a0e7e043629871a0c6/actor-sdk/sdk-core/core/core-shared/src/main/java/im/actor/core/modules/messaging/actions/SenderActor.java#L138-L182 | train | Sends a text message to a peer. | Of course, here is the Java code you requested:
```java
public void doSendText(@NotNull Peer peer, @NotNull String text,
@Nullable ArrayList<Integer> mentions, /*Ignored*/ @Nullable String markDownText,
boolean autoDetect) {
text = text.trim();
lo... |
apache/groovy | subprojects/groovy-json/src/main/java/groovy/json/DefaultJsonGenerator.java | DefaultJsonGenerator.writeArray | protected void writeArray(Class<?> arrayClass, Object array, CharBuf buffer) {
if (Object[].class.isAssignableFrom(arrayClass)) {
Object[] objArray = (Object[]) array;
writeIterator(Arrays.asList(objArray).iterator(), buffer);
return;
}
buffer.addChar(OPEN_BRA... | java | protected void writeArray(Class<?> arrayClass, Object array, CharBuf buffer) {
if (Object[].class.isAssignableFrom(arrayClass)) {
Object[] objArray = (Object[]) array;
writeIterator(Arrays.asList(objArray).iterator(), buffer);
return;
}
buffer.addChar(OPEN_BRA... | [
"protected",
"void",
"writeArray",
"(",
"Class",
"<",
"?",
">",
"arrayClass",
",",
"Object",
"array",
",",
"CharBuf",
"buffer",
")",
"{",
"if",
"(",
"Object",
"[",
"]",
".",
"class",
".",
"isAssignableFrom",
"(",
"arrayClass",
")",
")",
"{",
"Object",
... | Serializes array and writes it into specified buffer. | [
"Serializes",
"array",
"and",
"writes",
"it",
"into",
"specified",
"buffer",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-json/src/main/java/groovy/json/DefaultJsonGenerator.java#L282-L355 | train | Write array. | Of course, here is the Java code you requested:
```java
protected void writeArray(Class<?> arrayClass, Object array, CharBuf buffer) {
if (Object[].class.isAssignableFrom(arrayClass)) {
Object[] objArray = (Object[]) array;
writeIterator(Arrays.asList(objArray).iterator(), buffer);
... |
ibm-bluemix-mobile-services/bms-clientsdk-android-core | lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/core/api/Request.java | Request.send | public void send(Context context, String text, ResponseListener listener) {
setContext(context);
super.send(text, listener);
} | java | public void send(Context context, String text, ResponseListener listener) {
setContext(context);
super.send(text, listener);
} | [
"public",
"void",
"send",
"(",
"Context",
"context",
",",
"String",
"text",
",",
"ResponseListener",
"listener",
")",
"{",
"setContext",
"(",
"context",
")",
";",
"super",
".",
"send",
"(",
"text",
",",
"listener",
")",
";",
"}"
] | Send this resource request asynchronously, with the given string as the request body.
If no Content-Type header was set, this method will set it to "text/plain".
@param context The context that will be passed to authentication listener.
@param text The text to put in the request body
@param listener The listen... | [
"Send",
"this",
"resource",
"request",
"asynchronously",
"with",
"the",
"given",
"string",
"as",
"the",
"request",
"body",
".",
"If",
"no",
"Content",
"-",
"Type",
"header",
"was",
"set",
"this",
"method",
"will",
"set",
"it",
"to",
"text",
"/",
"plain",
... | 8db4f00d0d564792397bfc0e5bd57d52a238b858 | https://github.com/ibm-bluemix-mobile-services/bms-clientsdk-android-core/blob/8db4f00d0d564792397bfc0e5bd57d52a238b858/lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/core/api/Request.java#L166-L169 | train | Override send to set the context and response listener | Of course, here is the Java code you requested:
```java
public void send(Context context, String text, ResponseListener listener) {
setContext(context);
super.send(text, listener);
}
```
Hope this helps! |
twilio/twilio-java | src/main/java/com/twilio/example/TwiMLResponseExample.java | TwiMLResponseExample.main | public static void main(final String[] args) throws TwiMLException, URISyntaxException {
// Say
Say say = new Say.Builder("Hello World!")
.voice(Say.Voice.MAN)
.loop(5)
.build();
VoiceResponse response = new VoiceResponse.Builder()
.say(say)
... | java | public static void main(final String[] args) throws TwiMLException, URISyntaxException {
// Say
Say say = new Say.Builder("Hello World!")
.voice(Say.Voice.MAN)
.loop(5)
.build();
VoiceResponse response = new VoiceResponse.Builder()
.say(say)
... | [
"public",
"static",
"void",
"main",
"(",
"final",
"String",
"[",
"]",
"args",
")",
"throws",
"TwiMLException",
",",
"URISyntaxException",
"{",
"// Say",
"Say",
"say",
"=",
"new",
"Say",
".",
"Builder",
"(",
"\"Hello World!\"",
")",
".",
"voice",
"(",
"Say"... | TwiML example usage.
@param args command line args
@throws TwiMLException if cannot generate TwiML | [
"TwiML",
"example",
"usage",
"."
] | 0318974c0a6a152994af167d430255684d5e9b9f | https://github.com/twilio/twilio-java/blob/0318974c0a6a152994af167d430255684d5e9b9f/src/main/java/com/twilio/example/TwiMLResponseExample.java#L26-L71 | train | Example of the Sequence System. | Of course, here is the Java code you requested:
```java
public static void main(final String[] args) throws TwiMLException, URISyntaxException {
// Say
Say say = new Say.Builder("Hello World!")
.voice(Say.Voice.MAN)
.loop(5)
.build();
VoiceResponse response ... |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/lang/NonBlockingProperties.java | NonBlockingProperties.setProperty | @Nullable
public String setProperty (final String sKey, final String sValue)
{
return put (sKey, sValue);
} | java | @Nullable
public String setProperty (final String sKey, final String sValue)
{
return put (sKey, sValue);
} | [
"@",
"Nullable",
"public",
"String",
"setProperty",
"(",
"final",
"String",
"sKey",
",",
"final",
"String",
"sValue",
")",
"{",
"return",
"put",
"(",
"sKey",
",",
"sValue",
")",
";",
"}"
] | Calls the <tt>Hashtable</tt> method <code>put</code>. Provided for
parallelism with the <tt>getProperty</tt> method. Enforces use of strings
for property keys and values. The value returned is the result of the
<tt>Hashtable</tt> call to <code>put</code>.
@param sKey
the key to be placed into this property list.
@para... | [
"Calls",
"the",
"<tt",
">",
"Hashtable<",
"/",
"tt",
">",
"method",
"<code",
">",
"put<",
"/",
"code",
">",
".",
"Provided",
"for",
"parallelism",
"with",
"the",
"<tt",
">",
"getProperty<",
"/",
"tt",
">",
"method",
".",
"Enforces",
"use",
"of",
"strin... | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/lang/NonBlockingProperties.java#L137-L141 | train | Set the property. | Of course, here is the Java code you requested:
```java
@Nullable
public String setProperty (final String sKey, final String sValue)
{
return put (sKey, sValue);
}
```
Hope this helps! |
Harium/keel | src/main/java/com/harium/keel/catalano/math/function/Gamma.java | Gamma.Log | public static double Log(double x) {
double p, q, w, z;
double[] A =
{
8.11614167470508450300E-4,
-5.95061904284301438324E-4,
7.93650340457716943945E-4,
-2.77777777730099687205E-3,
... | java | public static double Log(double x) {
double p, q, w, z;
double[] A =
{
8.11614167470508450300E-4,
-5.95061904284301438324E-4,
7.93650340457716943945E-4,
-2.77777777730099687205E-3,
... | [
"public",
"static",
"double",
"Log",
"(",
"double",
"x",
")",
"{",
"double",
"p",
",",
"q",
",",
"w",
",",
"z",
";",
"double",
"[",
"]",
"A",
"=",
"{",
"8.11614167470508450300E-4",
",",
"-",
"5.95061904284301438324E-4",
",",
"7.93650340457716943945E-4",
",... | Natural logarithm of gamma function.
@param x Value.
@return Result. | [
"Natural",
"logarithm",
"of",
"gamma",
"function",
"."
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/function/Gamma.java#L468-L578 | train | Log - 1. | Of course, here is the Java code you requested:
```java
public static double Log(double x) {
double p, q, w, z;
double[] A =
{
8.11614167470508450300E-4,
-5.95061904284301438324E-4,
7.93650340457716943945E-4,
... |
lightblueseas/file-worker | src/main/java/de/alpharogroup/file/checksum/ChecksumExtensions.java | ChecksumExtensions.getChecksum | public static String getChecksum(final File file, final Algorithm algorithm)
throws NoSuchAlgorithmException, IOException
{
return getChecksum(file, algorithm.getAlgorithm());
} | java | public static String getChecksum(final File file, final Algorithm algorithm)
throws NoSuchAlgorithmException, IOException
{
return getChecksum(file, algorithm.getAlgorithm());
} | [
"public",
"static",
"String",
"getChecksum",
"(",
"final",
"File",
"file",
",",
"final",
"Algorithm",
"algorithm",
")",
"throws",
"NoSuchAlgorithmException",
",",
"IOException",
"{",
"return",
"getChecksum",
"(",
"file",
",",
"algorithm",
".",
"getAlgorithm",
"(",... | Gets the checksum from the given file with an instance of the given algorithm.
@param file
the file.
@param algorithm
the algorithm to get the checksum. This could be for instance "MD4", "MD5",
"SHA-1", "SHA-256", "SHA-384" or "SHA-512".
@return The checksum from the file as a String object.
@throws NoSuchAlgorithmExc... | [
"Gets",
"the",
"checksum",
"from",
"the",
"given",
"file",
"with",
"an",
"instance",
"of",
"the",
"given",
"algorithm",
"."
] | 2c81de10fb5d68de64c1abc3ed64ca681ce76da8 | https://github.com/lightblueseas/file-worker/blob/2c81de10fb5d68de64c1abc3ed64ca681ce76da8/src/main/java/de/alpharogroup/file/checksum/ChecksumExtensions.java#L196-L200 | train | Gets the checksum of the given file using the specified algorithm. | Of course, here is the Java code you requested:
```java
public static String getChecksum(final File file, final Algorithm algorithm)
throws NoSuchAlgorithmException, IOException
{
return getChecksum(file, algorithm.getAlgorithm());
}
```
Hope this helps! |
RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/Solo.java | Solo.waitForView | public boolean waitForView(int id, int minimumNumberOfMatches, int timeout, boolean scroll){
if(config.commandLogging){
Log.d(config.commandLoggingTag, "waitForView("+id+", "+minimumNumberOfMatches+", "+timeout+", "+scroll+")");
}
int index = minimumNumberOfMatches-1;
if(index < 1)
index = 0;
retur... | java | public boolean waitForView(int id, int minimumNumberOfMatches, int timeout, boolean scroll){
if(config.commandLogging){
Log.d(config.commandLoggingTag, "waitForView("+id+", "+minimumNumberOfMatches+", "+timeout+", "+scroll+")");
}
int index = minimumNumberOfMatches-1;
if(index < 1)
index = 0;
retur... | [
"public",
"boolean",
"waitForView",
"(",
"int",
"id",
",",
"int",
"minimumNumberOfMatches",
",",
"int",
"timeout",
",",
"boolean",
"scroll",
")",
"{",
"if",
"(",
"config",
".",
"commandLogging",
")",
"{",
"Log",
".",
"d",
"(",
"config",
".",
"commandLoggin... | Waits for a View matching the specified resource id.
@param id the R.id of the {@link View} to wait for
@param minimumNumberOfMatches the minimum number of matches that are expected to be found. {@code 0} means any number of matches
@param timeout the amount of time in milliseconds to wait
@param scroll {@code true} i... | [
"Waits",
"for",
"a",
"View",
"matching",
"the",
"specified",
"resource",
"id",
"."
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Solo.java#L486-L497 | train | Waits for a View matching the specified resource id. | Of course, here is the Java code you requested:
```java
public boolean waitForView(int id, int minimumNumberOfMatches, int timeout, boolean scroll){
if(config.commandLogging){
Log.d(config.commandLoggingTag, "waitForView("+id+", "+minimumNumberOfMatches+", "+timeout+", "+scroll+")");
}
int index = minimumN... |
HadoopGenomics/Hadoop-BAM | src/main/java/org/seqdoop/hadoop_bam/util/MurmurHash3.java | MurmurHash3.murmurhash3 | public static long murmurhash3(CharSequence chars, int seed) {
final int len = chars.length();
final int nblocks = len / 8;
long h1 = seed;
long h2 = seed;
final long c1 = 0x87c37b91114253d5L;
final long c2 = 0x4cf5ad432745937fL;
for (int i = 0; i < nblocks; ++i) {
int i0 = (i*2 + 0) * 4;
int i... | java | public static long murmurhash3(CharSequence chars, int seed) {
final int len = chars.length();
final int nblocks = len / 8;
long h1 = seed;
long h2 = seed;
final long c1 = 0x87c37b91114253d5L;
final long c2 = 0x4cf5ad432745937fL;
for (int i = 0; i < nblocks; ++i) {
int i0 = (i*2 + 0) * 4;
int i... | [
"public",
"static",
"long",
"murmurhash3",
"(",
"CharSequence",
"chars",
",",
"int",
"seed",
")",
"{",
"final",
"int",
"len",
"=",
"chars",
".",
"length",
"(",
")",
";",
"final",
"int",
"nblocks",
"=",
"len",
"/",
"8",
";",
"long",
"h1",
"=",
"seed",... | This version hashes the characters directly. It is not equivalent to
hashing chars.toString().getBytes(), as it hashes UTF-16 code units, but
it is much faster. | [
"This",
"version",
"hashes",
"the",
"characters",
"directly",
".",
"It",
"is",
"not",
"equivalent",
"to",
"hashing",
"chars",
".",
"toString",
"()",
".",
"getBytes",
"()",
"as",
"it",
"hashes",
"UTF",
"-",
"16",
"code",
"units",
"but",
"it",
"is",
"much"... | 9f974cf635a8d72f69604021cc3d5f3469d38d2f | https://github.com/HadoopGenomics/Hadoop-BAM/blob/9f974cf635a8d72f69604021cc3d5f3469d38d2f/src/main/java/org/seqdoop/hadoop_bam/util/MurmurHash3.java#L108-L171 | train | MurmurHash 3 - bit hash function. | Of course, here is the Java code you requested:
```java
public static long murmurhash3(CharSequence chars, int seed) {
final int len = chars.length();
final int nblocks = len / 8;
long h1 = seed;
long h2 = seed;
final long c1 = 0x87c37b91114253d5L;
final long c2 = 0x4cf5ad432745937fL;
for (int i = 0... |
ontop/ontop | client/protege/src/main/java/it/unibz/inf/ontop/protege/gui/treemodels/QueryControllerTreeModel.java | QueryControllerTreeModel.getNode | public TreeElement getNode(String element) {
TreeElement node = null;
Enumeration<TreeNode> elements = root.children();
while (elements.hasMoreElements()) {
TreeElement currentNode = (TreeElement) elements.nextElement();
if (currentNode instanceof QueryGroupTreeElement) {
QueryGroupTreeElement groupTEle... | java | public TreeElement getNode(String element) {
TreeElement node = null;
Enumeration<TreeNode> elements = root.children();
while (elements.hasMoreElements()) {
TreeElement currentNode = (TreeElement) elements.nextElement();
if (currentNode instanceof QueryGroupTreeElement) {
QueryGroupTreeElement groupTEle... | [
"public",
"TreeElement",
"getNode",
"(",
"String",
"element",
")",
"{",
"TreeElement",
"node",
"=",
"null",
";",
"Enumeration",
"<",
"TreeNode",
">",
"elements",
"=",
"root",
".",
"children",
"(",
")",
";",
"while",
"(",
"elements",
".",
"hasMoreElements",
... | Search a TreeElement node group or query and returns the object else
returns null. | [
"Search",
"a",
"TreeElement",
"node",
"group",
"or",
"query",
"and",
"returns",
"the",
"object",
"else",
"returns",
"null",
"."
] | ddf78b26981b6129ee9a1a59310016830f5352e4 | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/client/protege/src/main/java/it/unibz/inf/ontop/protege/gui/treemodels/QueryControllerTreeModel.java#L236-L257 | train | Gets the node with the given ID. | Of course, here is the Java code you requested:
```java
public TreeElement getNode(String element) {
TreeElement node = null;
Enumeration<TreeNode> elements = root.children();
while (elements.hasMoreElements()) {
TreeElement currentNode = (TreeElement) elements.nextElement();
if (currentNode instanceof Que... |
oblac/jodd | jodd-servlet/src/main/java/jodd/servlet/ServletUtil.java | ServletUtil.isAbsoluteUrl | public static boolean isAbsoluteUrl(final String url) {
if (url == null) { // a null URL is not absolute
return false;
}
int colonPos; // fast simple check first
if ((colonPos = url.indexOf(':')) == -1) {
return false;
}
// if we DO have a colon, ma... | java | public static boolean isAbsoluteUrl(final String url) {
if (url == null) { // a null URL is not absolute
return false;
}
int colonPos; // fast simple check first
if ((colonPos = url.indexOf(':')) == -1) {
return false;
}
// if we DO have a colon, ma... | [
"public",
"static",
"boolean",
"isAbsoluteUrl",
"(",
"final",
"String",
"url",
")",
"{",
"if",
"(",
"url",
"==",
"null",
")",
"{",
"// a null URL is not absolute",
"return",
"false",
";",
"}",
"int",
"colonPos",
";",
"// fast simple check first",
"if",
"(",
"(... | Returns <code>true</code> if current URL is absolute, <code>false</code> otherwise. | [
"Returns",
"<code",
">",
"true<",
"/",
"code",
">",
"if",
"current",
"URL",
"is",
"absolute",
"<code",
">",
"false<",
"/",
"code",
">",
"otherwise",
"."
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-servlet/src/main/java/jodd/servlet/ServletUtil.java#L501-L518 | test | Checks if the given URL is an absolute URL. | Of course, here is the Java code you requested:
```java
public static boolean isAbsoluteUrl(final String url) {
if (url == null) { // a null URL is not absolute
return false;
}
int colonPos; // fast simple check first
if ((colonPos = url.indexOf(':')) == -1) {
... |
amaembo/streamex | src/main/java/one/util/streamex/StreamEx.java | StreamEx.split | public static StreamEx<String> split(CharSequence str, char delimiter, boolean trimEmpty) {
if (str.length() == 0)
return of("");
return of(new CharSpliterator(str, delimiter, trimEmpty));
} | java | public static StreamEx<String> split(CharSequence str, char delimiter, boolean trimEmpty) {
if (str.length() == 0)
return of("");
return of(new CharSpliterator(str, delimiter, trimEmpty));
} | [
"public",
"static",
"StreamEx",
"<",
"String",
">",
"split",
"(",
"CharSequence",
"str",
",",
"char",
"delimiter",
",",
"boolean",
"trimEmpty",
")",
"{",
"if",
"(",
"str",
".",
"length",
"(",
")",
"==",
"0",
")",
"return",
"of",
"(",
"\"\"",
")",
";"... | Creates a stream from the given input sequence around matches of the
given character.
<p>
The stream returned by this method contains each substring of the input
sequence that is terminated by supplied delimiter character or is
terminated by the end of the input sequence. The substrings in the stream
are in the order ... | [
"Creates",
"a",
"stream",
"from",
"the",
"given",
"input",
"sequence",
"around",
"matches",
"of",
"the",
"given",
"character",
"."
] | 936bbd1b7dfbcf64a3b990682bfc848213441d14 | https://github.com/amaembo/streamex/blob/936bbd1b7dfbcf64a3b990682bfc848213441d14/src/main/java/one/util/streamex/StreamEx.java#L2654-L2658 | train | Split a char sequence into a stream. | Of course, here is the Java code you requested:
```java
public static StreamEx<String> split(CharSequence str, char delimiter, boolean trimEmpty) {
if (str.length() == 0)
return of("");
return of(new CharSpliterator(str, delimiter, trimEmpty));
}
```
Hope this helps! |
martinkirch/jlcm | src/main/java/fr/liglab/jlcm/internals/Selector.java | Selector.append | final Selector append(Selector s) {
if (this.next == null) {
return this.copy(s);
} else {
return this.copy(this.next.append(s));
}
} | java | final Selector append(Selector s) {
if (this.next == null) {
return this.copy(s);
} else {
return this.copy(this.next.append(s));
}
} | [
"final",
"Selector",
"append",
"(",
"Selector",
"s",
")",
"{",
"if",
"(",
"this",
".",
"next",
"==",
"null",
")",
"{",
"return",
"this",
".",
"copy",
"(",
"s",
")",
";",
"}",
"else",
"{",
"return",
"this",
".",
"copy",
"(",
"this",
".",
"next",
... | Note: prepending should simply be done by passing a chain at first
selector's instantiation. Appends the given selector at the end of
current list, and returns new list's head | [
"Note",
":",
"prepending",
"should",
"simply",
"be",
"done",
"by",
"passing",
"a",
"chain",
"at",
"first",
"selector",
"s",
"instantiation",
".",
"Appends",
"the",
"given",
"selector",
"at",
"the",
"end",
"of",
"current",
"list",
"and",
"returns",
"new",
"... | 6fbe53d3a1078028ac324c0f2382ec06925ffaa7 | https://github.com/martinkirch/jlcm/blob/6fbe53d3a1078028ac324c0f2382ec06925ffaa7/src/main/java/fr/liglab/jlcm/internals/Selector.java#L89-L95 | train | Appends the given selector to this one. | Of course, here is the Java code you requested:
```java
final Selector append(Selector s) {
if (this.next == null) {
return this.copy(s);
} else {
return this.copy(this.next.append(s));
}
}
```
Hope this helps! |
cfg4j/cfg4j | cfg4j-core/src/main/java/org/cfg4j/source/context/propertiesprovider/YamlBasedPropertiesProvider.java | YamlBasedPropertiesProvider.getProperties | @Override
public Properties getProperties(InputStream inputStream) {
requireNonNull(inputStream);
Yaml yaml = new Yaml();
Properties properties = new Properties();
try (Reader reader = new UnicodeReader(inputStream)) {
Object object = yaml.load(reader);
if (object != null) {
M... | java | @Override
public Properties getProperties(InputStream inputStream) {
requireNonNull(inputStream);
Yaml yaml = new Yaml();
Properties properties = new Properties();
try (Reader reader = new UnicodeReader(inputStream)) {
Object object = yaml.load(reader);
if (object != null) {
M... | [
"@",
"Override",
"public",
"Properties",
"getProperties",
"(",
"InputStream",
"inputStream",
")",
"{",
"requireNonNull",
"(",
"inputStream",
")",
";",
"Yaml",
"yaml",
"=",
"new",
"Yaml",
"(",
")",
";",
"Properties",
"properties",
"=",
"new",
"Properties",
"(",... | Get {@link Properties} for a given {@code inputStream} treating it as a YAML file.
@param inputStream input stream representing YAML file
@return properties representing values from {@code inputStream}
@throws IllegalStateException when unable to read properties | [
"Get",
"{",
"@link",
"Properties",
"}",
"for",
"a",
"given",
"{",
"@code",
"inputStream",
"}",
"treating",
"it",
"as",
"a",
"YAML",
"file",
"."
] | 47d4f63e5fc820c62631e557adc34a29d8ab396d | https://github.com/cfg4j/cfg4j/blob/47d4f63e5fc820c62631e557adc34a29d8ab396d/cfg4j-core/src/main/java/org/cfg4j/source/context/propertiesprovider/YamlBasedPropertiesProvider.java#L46-L68 | train | Get the properties from the provided input stream. | Of course, here is the Java code you requested:
```java
@Override
public Properties getProperties(InputStream inputStream) {
requireNonNull(inputStream);
Yaml yaml = new Yaml();
Properties properties = new Properties();
try (Reader reader = new UnicodeReader(inputStream)) {
Object object = ... |
RestComm/jdiameter | examples/guide1/src/main/java/org/example/server/ExampleServer.java | ExampleServer.processRequest | @Override
public Answer processRequest(Request request) {
dumpMessage(request,false);
if (request.getCommandCode() != commandCode) {
log.error("Received bad answer: " + request.getCommandCode());
return null;
}
AvpSet requestAvpSet = request.getAvps();
Avp exchangeTypeAvp = r... | java | @Override
public Answer processRequest(Request request) {
dumpMessage(request,false);
if (request.getCommandCode() != commandCode) {
log.error("Received bad answer: " + request.getCommandCode());
return null;
}
AvpSet requestAvpSet = request.getAvps();
Avp exchangeTypeAvp = r... | [
"@",
"Override",
"public",
"Answer",
"processRequest",
"(",
"Request",
"request",
")",
"{",
"dumpMessage",
"(",
"request",
",",
"false",
")",
";",
"if",
"(",
"request",
".",
"getCommandCode",
"(",
")",
"!=",
"commandCode",
")",
"{",
"log",
".",
"error",
... | /*
(non-Javadoc)
@see
org.jdiameter.api.NetworkReqListener#processRequest(org.jdiameter.api
.Request) | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | 672134c378ea9704bf06dbe1985872ad4ebf4640 | https://github.com/RestComm/jdiameter/blob/672134c378ea9704bf06dbe1985872ad4ebf4640/examples/guide1/src/main/java/org/example/server/ExampleServer.java#L262-L372 | train | Process a
request. | Of course, here is the Java code you requested:
```java
@Override
public Answer processRequest(Request request) {
dumpMessage(request,false);
if (request.getCommandCode() != commandCode) {
log.error("Received bad answer: " + request.getCommandCode());
return null;
}
AvpSet requestA... |
jayantk/jklol | src/com/jayantkrish/jklol/models/FactorGraph.java | FactorGraph.getMinimalFactors | public List<Factor> getMinimalFactors() {
// Sort factors in descending order of size.
List<Factor> sortedFactors = Lists.newArrayList(factors);
Collections.sort(sortedFactors, new Comparator<Factor>() {
public int compare(Factor f1, Factor f2) {
return f2.getVars().size() - f1.getVars().size(... | java | public List<Factor> getMinimalFactors() {
// Sort factors in descending order of size.
List<Factor> sortedFactors = Lists.newArrayList(factors);
Collections.sort(sortedFactors, new Comparator<Factor>() {
public int compare(Factor f1, Factor f2) {
return f2.getVars().size() - f1.getVars().size(... | [
"public",
"List",
"<",
"Factor",
">",
"getMinimalFactors",
"(",
")",
"{",
"// Sort factors in descending order of size.",
"List",
"<",
"Factor",
">",
"sortedFactors",
"=",
"Lists",
".",
"newArrayList",
"(",
"factors",
")",
";",
"Collections",
".",
"sort",
"(",
"... | Gets a list of factors in this. This method is similar to
{@link #getFactors()}, except that it merges together factors
defined over the same variables. Hence, no factor in the returned
list will be defined over a subset of the variables in another
factor. The returned factors define the same probability
distribution a... | [
"Gets",
"a",
"list",
"of",
"factors",
"in",
"this",
".",
"This",
"method",
"is",
"similar",
"to",
"{",
"@link",
"#getFactors",
"()",
"}",
"except",
"that",
"it",
"merges",
"together",
"factors",
"defined",
"over",
"the",
"same",
"variables",
".",
"Hence",
... | d27532ca83e212d51066cf28f52621acc3fd44cc | https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/models/FactorGraph.java#L229-L272 | train | Get the minimal factors of the C ++ model. | Of course, here is the Java code you requested:
```java
public List<Factor> getMinimalFactors() {
// Sort factors in descending order of size.
List<Factor> sortedFactors = Lists.newArrayList(factors);
Collections.sort(sortedFactors, new Comparator<Factor>() {
public int compare(Factor f1, Factor f2) ... |
eclipse/hawkbit | hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetBulkUpdateWindowLayout.java | TargetBulkUpdateWindowLayout.getWindow | public Window getWindow() {
managementUIState.setBulkUploadWindowMinimised(false);
bulkUploadWindow = new WindowBuilder(SPUIDefinitions.CREATE_UPDATE_WINDOW).caption("").content(this)
.buildWindow();
bulkUploadWindow.addStyleName("bulk-upload-window");
bulkUploadWindow.s... | java | public Window getWindow() {
managementUIState.setBulkUploadWindowMinimised(false);
bulkUploadWindow = new WindowBuilder(SPUIDefinitions.CREATE_UPDATE_WINDOW).caption("").content(this)
.buildWindow();
bulkUploadWindow.addStyleName("bulk-upload-window");
bulkUploadWindow.s... | [
"public",
"Window",
"getWindow",
"(",
")",
"{",
"managementUIState",
".",
"setBulkUploadWindowMinimised",
"(",
"false",
")",
";",
"bulkUploadWindow",
"=",
"new",
"WindowBuilder",
"(",
"SPUIDefinitions",
".",
"CREATE_UPDATE_WINDOW",
")",
".",
"caption",
"(",
"\"\"",
... | create and return window
@return Window window | [
"create",
"and",
"return",
"window"
] | 9884452ad42f3b4827461606d8a9215c8625a7fe | https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetBulkUpdateWindowLayout.java#L356-L369 | train | Gets the window. | Of course, here is the Java code you requested:
```java
public Window getWindow() {
managementUIState.setBulkUploadWindowMinimised(false);
bulkUploadWindow = new WindowBuilder(SPUIDefinitions.CREATE_UPDATE_WINDOW).caption("").content(this)
.buildWindow();
bulkUploadWindow.addSt... |
GoogleCloudPlatform/bigdata-interop | gcs/src/main/java/com/google/cloud/hadoop/fs/gcs/GoogleHadoopFileSystemBase.java | GoogleHadoopFileSystemBase.mkdirs | @Override
public boolean mkdirs(Path hadoopPath, FsPermission permission)
throws IOException {
long startTime = System.nanoTime();
Preconditions.checkArgument(hadoopPath != null, "hadoopPath must not be null");
checkOpen();
logger.atFine().log("GHFS.mkdirs: %s, perm: %s", hadoopPath, permissi... | java | @Override
public boolean mkdirs(Path hadoopPath, FsPermission permission)
throws IOException {
long startTime = System.nanoTime();
Preconditions.checkArgument(hadoopPath != null, "hadoopPath must not be null");
checkOpen();
logger.atFine().log("GHFS.mkdirs: %s, perm: %s", hadoopPath, permissi... | [
"@",
"Override",
"public",
"boolean",
"mkdirs",
"(",
"Path",
"hadoopPath",
",",
"FsPermission",
"permission",
")",
"throws",
"IOException",
"{",
"long",
"startTime",
"=",
"System",
".",
"nanoTime",
"(",
")",
";",
"Preconditions",
".",
"checkArgument",
"(",
"ha... | Makes the given path and all non-existent parents directories.
Has the semantics of Unix 'mkdir -p'.
@param hadoopPath Given path.
@param permission Permissions to set on the given directory.
@return true on success, false otherwise.
@throws IOException if an error occurs. | [
"Makes",
"the",
"given",
"path",
"and",
"all",
"non",
"-",
"existent",
"parents",
"directories",
".",
"Has",
"the",
"semantics",
"of",
"Unix",
"mkdir",
"-",
"p",
"."
] | 918d91c80a63e36046edb28972a5c65d3326a858 | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/gcs/src/main/java/com/google/cloud/hadoop/fs/gcs/GoogleHadoopFileSystemBase.java#L1046-L1070 | train | Create the directory at the given path. | Of course, here is the Java code you requested:
```java
@Override
public boolean mkdirs(Path hadoopPath, FsPermission permission)
throws IOException {
long startTime = System.nanoTime();
Preconditions.checkArgument(hadoopPath != null, "hadoopPath must not be null");
checkOpen();
logger.atFin... |
Bandwidth/java-bandwidth | src/main/java/com/bandwidth/sdk/model/PhoneNumber.java | PhoneNumber.list | public static ResourceList<PhoneNumber> list(final int page, final int size) throws IOException {
return list(BandwidthClient.getInstance(), page, size);
} | java | public static ResourceList<PhoneNumber> list(final int page, final int size) throws IOException {
return list(BandwidthClient.getInstance(), page, size);
} | [
"public",
"static",
"ResourceList",
"<",
"PhoneNumber",
">",
"list",
"(",
"final",
"int",
"page",
",",
"final",
"int",
"size",
")",
"throws",
"IOException",
"{",
"return",
"list",
"(",
"BandwidthClient",
".",
"getInstance",
"(",
")",
",",
"page",
",",
"siz... | Factory method for PhoneNumber list, returns list of PhoneNumber objects with page, size preferences
@param page the current page
@param size the page size
@return the PhoneNumber list
@throws IOException unexpected error. | [
"Factory",
"method",
"for",
"PhoneNumber",
"list",
"returns",
"list",
"of",
"PhoneNumber",
"objects",
"with",
"page",
"size",
"preferences"
] | 2124c85148ad6a54d2f2949cb952eb3985830e2a | https://github.com/Bandwidth/java-bandwidth/blob/2124c85148ad6a54d2f2949cb952eb3985830e2a/src/main/java/com/bandwidth/sdk/model/PhoneNumber.java#L106-L108 | train | List all phone numbers. | Of course, here is the Java code you requested:
```java
public static ResourceList<PhoneNumber> list(final int page, final int size) throws IOException {
return list(BandwidthClient.getInstance(), page, size);
}
```
Hope this helps! |
LinkedDataFragments/Server.Java | src/main/java/org/linkeddatafragments/views/LinkedDataFragmentWriterFactory.java | LinkedDataFragmentWriterFactory.create | public static ILinkedDataFragmentWriter create(Map <String, String> prefixes, HashMap<String, IDataSource> datasources, String mimeType) throws IOException {
switch (mimeType) {
case HTML:
return new HtmlTriplePatternFragmentWriterImpl(prefixes, datasources);
default:
... | java | public static ILinkedDataFragmentWriter create(Map <String, String> prefixes, HashMap<String, IDataSource> datasources, String mimeType) throws IOException {
switch (mimeType) {
case HTML:
return new HtmlTriplePatternFragmentWriterImpl(prefixes, datasources);
default:
... | [
"public",
"static",
"ILinkedDataFragmentWriter",
"create",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"prefixes",
",",
"HashMap",
"<",
"String",
",",
"IDataSource",
">",
"datasources",
",",
"String",
"mimeType",
")",
"throws",
"IOException",
"{",
"switch",
... | Creates {@link ILinkedDataFragmentWriter} for a given mimeType
@param prefixes Configured prefixes to be used in serialization
@param datasources Configured datasources
@param mimeType mimeType to create writer for
@return created writer
@throws IOException | [
"Creates",
"{",
"@link",
"ILinkedDataFragmentWriter",
"}",
"for",
"a",
"given",
"mimeType"
] | 15f72a0675cb761a986f0d0d40b36a83dd482b1e | https://github.com/LinkedDataFragments/Server.Java/blob/15f72a0675cb761a986f0d0d40b36a83dd482b1e/src/main/java/org/linkeddatafragments/views/LinkedDataFragmentWriterFactory.java#L26-L33 | train | Create a new ILinkedDataFragmentWriter. | Of course, here is the Java code you requested:
```java
public static ILinkedDataFragmentWriter create(Map <String, String> prefixes, HashMap<String, IDataSource> datasources, String mimeType) throws IOException {
switch (mimeType) {
case HTML:
return new HtmlTriplePatternFragmentWr... |
GoogleCloudPlatform/bigdata-interop | util/src/main/java/com/google/cloud/hadoop/util/ApiErrorExtractor.java | ApiErrorExtractor.isClientError | public boolean isClientError(IOException e) {
GoogleJsonResponseException jsonException = getJsonResponseExceptionOrNull(e);
if (jsonException != null) {
return (getHttpStatusCode(jsonException)) / 100 == 4;
}
return false;
} | java | public boolean isClientError(IOException e) {
GoogleJsonResponseException jsonException = getJsonResponseExceptionOrNull(e);
if (jsonException != null) {
return (getHttpStatusCode(jsonException)) / 100 == 4;
}
return false;
} | [
"public",
"boolean",
"isClientError",
"(",
"IOException",
"e",
")",
"{",
"GoogleJsonResponseException",
"jsonException",
"=",
"getJsonResponseExceptionOrNull",
"(",
"e",
")",
";",
"if",
"(",
"jsonException",
"!=",
"null",
")",
"{",
"return",
"(",
"getHttpStatusCode"... | Determines if the exception is a client error. | [
"Determines",
"if",
"the",
"exception",
"is",
"a",
"client",
"error",
"."
] | 918d91c80a63e36046edb28972a5c65d3326a858 | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/util/src/main/java/com/google/cloud/hadoop/util/ApiErrorExtractor.java#L135-L141 | train | Is the given exception a client error. | Of course, here is the Java code you requested:
```java
public boolean isClientError(IOException e) {
GoogleJsonResponseException jsonException = getJsonResponseExceptionOrNull(e);
if (jsonException != null) {
return (getHttpStatusCode(jsonException)) / 100 == 4;
}
return false;
}
```
Hope thi... |
jferard/fastods | fastods/src/main/java/com/github/jferard/fastods/CellValue.java | CellValue.fromObject | public static CellValue fromObject(final Object o) {
if (o == null)
return new VoidValue();
else if (o instanceof String)
return new StringValue((String) o);
else if (o instanceof Number) // BigDecimal, Byte, Short, Integer,
// Long, Float, Double
return new FloatValue((Number) o);
else if (o... | java | public static CellValue fromObject(final Object o) {
if (o == null)
return new VoidValue();
else if (o instanceof String)
return new StringValue((String) o);
else if (o instanceof Number) // BigDecimal, Byte, Short, Integer,
// Long, Float, Double
return new FloatValue((Number) o);
else if (o... | [
"public",
"static",
"CellValue",
"fromObject",
"(",
"final",
"Object",
"o",
")",
"{",
"if",
"(",
"o",
"==",
"null",
")",
"return",
"new",
"VoidValue",
"(",
")",
";",
"else",
"if",
"(",
"o",
"instanceof",
"String",
")",
"return",
"new",
"StringValue",
"... | Converts a value to a CellValue
@param o the value
@return the CellValue | [
"Converts",
"a",
"value",
"to",
"a",
"CellValue"
] | a034d173083ffa602dc525699b97f753082eaef9 | https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/CellValue.java#L39-L56 | train | Converts an object to a CellValue. | Of course, here is the Java code you requested:
```java
public static CellValue fromObject(final Object o) {
if (o == null)
return new VoidValue();
else if (o instanceof String)
return new StringValue((String) o);
else if (o instanceof Number) // BigDecimal, Byte, Short, Integer,
// Long, Float, ... |
wcm-io/wcm-io-handler | media/src/main/java/io/wcm/handler/media/markup/MediaMarkupBuilderUtil.java | MediaMarkupBuilderUtil.addDiffDecoration | @SuppressWarnings("null")
public static void addDiffDecoration(@NotNull HtmlElement<?> mediaElement, @NotNull Resource resource,
@NotNull String refProperty, @NotNull SlingHttpServletRequest request, @Nullable MediaHandlerConfig mediaHandlerConfig) {
PageManager pageManager = request.getResourceResolver().... | java | @SuppressWarnings("null")
public static void addDiffDecoration(@NotNull HtmlElement<?> mediaElement, @NotNull Resource resource,
@NotNull String refProperty, @NotNull SlingHttpServletRequest request, @Nullable MediaHandlerConfig mediaHandlerConfig) {
PageManager pageManager = request.getResourceResolver().... | [
"@",
"SuppressWarnings",
"(",
"\"null\"",
")",
"public",
"static",
"void",
"addDiffDecoration",
"(",
"@",
"NotNull",
"HtmlElement",
"<",
"?",
">",
"mediaElement",
",",
"@",
"NotNull",
"Resource",
"resource",
",",
"@",
"NotNull",
"String",
"refProperty",
",",
"... | Adds CSS classes that denote the changes to the media element when compared to a different version.
If no diff has been requested by the WCM UI, there won't be any changes to the element.
@param mediaElement Element to be decorated
@param resource Resource pointing to JCR node
@param refProperty Name of property for me... | [
"Adds",
"CSS",
"classes",
"that",
"denote",
"the",
"changes",
"to",
"the",
"media",
"element",
"when",
"compared",
"to",
"a",
"different",
"version",
".",
"If",
"no",
"diff",
"has",
"been",
"requested",
"by",
"the",
"WCM",
"UI",
"there",
"won",
"t",
"be"... | b0fc1c11a3ceb89efb73826dcfd480d6a00c19af | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/media/src/main/java/io/wcm/handler/media/markup/MediaMarkupBuilderUtil.java#L85-L144 | train | Add diff decoration for the specified resource. | Of course, here is the Java code you requested:
```java
@SuppressWarnings("null")
public static void addDiffDecoration(@NotNull HtmlElement<?> mediaElement, @NotNull Resource resource,
@NotNull String refProperty, @NotNull SlingHttpServletRequest request, @Nullable MediaHandlerConfig mediaHandlerConfig) {
... |
io7m/jtensors | com.io7m.jtensors.storage.bytebuffered/src/main/java/com/io7m/jtensors/storage/bytebuffered/VectorByteBufferedIntegral3s64.java | VectorByteBufferedIntegral3s64.createWithBase | public static VectorByteBufferedIntegral3s64 createWithBase(
final ByteBuffer b,
final MutableLongType base,
final int offset)
{
return new VectorByteBufferedIntegral3s64(b, base, offset);
} | java | public static VectorByteBufferedIntegral3s64 createWithBase(
final ByteBuffer b,
final MutableLongType base,
final int offset)
{
return new VectorByteBufferedIntegral3s64(b, base, offset);
} | [
"public",
"static",
"VectorByteBufferedIntegral3s64",
"createWithBase",
"(",
"final",
"ByteBuffer",
"b",
",",
"final",
"MutableLongType",
"base",
",",
"final",
"int",
"offset",
")",
"{",
"return",
"new",
"VectorByteBufferedIntegral3s64",
"(",
"b",
",",
"base",
",",
... | <p>Return a new vector that is backed by the given byte buffer {@code
b}</p>
<p>The data for the instance will be taken from the data at the current
value of {@code base.get() + offset}, each time a field is requested or
set.</p>
<p>No initialization of the data is performed.</p>
@param b The byte buffer
@param... | [
"<p",
">",
"Return",
"a",
"new",
"vector",
"that",
"is",
"backed",
"by",
"the",
"given",
"byte",
"buffer",
"{",
"@code",
"b",
"}",
"<",
"/",
"p",
">"
] | c760a2ded2f329c2a3e28bf76df5571c32b595aa | https://github.com/io7m/jtensors/blob/c760a2ded2f329c2a3e28bf76df5571c32b595aa/com.io7m.jtensors.storage.bytebuffered/src/main/java/com/io7m/jtensors/storage/bytebuffered/VectorByteBufferedIntegral3s64.java#L58-L64 | valid | Creates a new VectorByteBufferedIntegral3s64 with the specified base and offset. | Of course, here is the Java code you requested:
```java
public static VectorByteBufferedIntegral3s64 createWithBase(
final ByteBuffer b,
final MutableLongType base,
final int offset)
{
return new VectorByteBufferedIntegral3s64(b, base, offset);
}
```
Hope this helps! |
lucee/Lucee | core/src/main/java/lucee/runtime/PageContextImpl.java | PageContextImpl.getFunctionWithNamedValues | public Object getFunctionWithNamedValues(Object coll, Key key, Object[] args, Object defaultValue) {
return variableUtil.callFunctionWithNamedValues(this, coll, key, args, false, defaultValue);
} | java | public Object getFunctionWithNamedValues(Object coll, Key key, Object[] args, Object defaultValue) {
return variableUtil.callFunctionWithNamedValues(this, coll, key, args, false, defaultValue);
} | [
"public",
"Object",
"getFunctionWithNamedValues",
"(",
"Object",
"coll",
",",
"Key",
"key",
",",
"Object",
"[",
"]",
"args",
",",
"Object",
"defaultValue",
")",
"{",
"return",
"variableUtil",
".",
"callFunctionWithNamedValues",
"(",
"this",
",",
"coll",
",",
"... | FUTURE add to interface | [
"FUTURE",
"add",
"to",
"interface"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/PageContextImpl.java#L1690-L1692 | train | Get a function with named values. | Of course, here is the Java code you requested:
```java
public Object getFunctionWithNamedValues(Object coll, Key key, Object[] args, Object defaultValue) {
return variableUtil.callFunctionWithNamedValues(this, coll, key, args, false, defaultValue);
}
```
Hope this helps! |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/io/exif/ExifGpsWriter.java | ExifGpsWriter.insertGPSCoords | private IIOMetadata insertGPSCoords( IIOMetadata exif ) {
IIOMetadata outExif = null;
try {
TIFFDirectory ifd = TIFFDirectory.createFromMetadata(exif);
TIFFField gpsInfoPointer = null;
// first get the pointer from the directory if it's not there create a new one
... | java | private IIOMetadata insertGPSCoords( IIOMetadata exif ) {
IIOMetadata outExif = null;
try {
TIFFDirectory ifd = TIFFDirectory.createFromMetadata(exif);
TIFFField gpsInfoPointer = null;
// first get the pointer from the directory if it's not there create a new one
... | [
"private",
"IIOMetadata",
"insertGPSCoords",
"(",
"IIOMetadata",
"exif",
")",
"{",
"IIOMetadata",
"outExif",
"=",
"null",
";",
"try",
"{",
"TIFFDirectory",
"ifd",
"=",
"TIFFDirectory",
".",
"createFromMetadata",
"(",
"exif",
")",
";",
"TIFFField",
"gpsInfoPointer"... | Private method - adds gps information to the exif data
@param pos a GPSPosition object containing the information to encode
@param exif the exif metadata to add the position to | [
"Private",
"method",
"-",
"adds",
"gps",
"information",
"to",
"the",
"exif",
"data",
"@param",
"pos",
"a",
"GPSPosition",
"object",
"containing",
"the",
"information",
"to",
"encode",
"@param",
"exif",
"the",
"exif",
"metadata",
"to",
"add",
"the",
"position",... | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/exif/ExifGpsWriter.java#L357-L391 | train | Insert GPS metadata into the GPS directory. | Of course, here is the Java code you requested:
```java
private IIOMetadata insertGPSCoords( IIOMetadata exif ) {
IIOMetadata outExif = null;
try {
TIFFDirectory ifd = TIFFDirectory.createFromMetadata(exif);
TIFFField gpsInfoPointer = null;
// first get the pointer... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.