repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
headius/invokebinder | src/main/java/com/headius/invokebinder/Binder.java | Binder.branch | public MethodHandle branch(MethodHandle test, MethodHandle truePath, MethodHandle falsePath) {
return invoke(MethodHandles.guardWithTest(test, truePath, falsePath));
} | java | public MethodHandle branch(MethodHandle test, MethodHandle truePath, MethodHandle falsePath) {
return invoke(MethodHandles.guardWithTest(test, truePath, falsePath));
} | [
"public",
"MethodHandle",
"branch",
"(",
"MethodHandle",
"test",
",",
"MethodHandle",
"truePath",
",",
"MethodHandle",
"falsePath",
")",
"{",
"return",
"invoke",
"(",
"MethodHandles",
".",
"guardWithTest",
"(",
"test",
",",
"truePath",
",",
"falsePath",
")",
")"... | Apply the chain of transforms and bind them to a boolean branch as from
java.lang.invoke.MethodHandles.guardWithTest. As with GWT, the current endpoint
signature must match the given target and fallback signatures.
@param test the test handle
@param truePath the target handle
@param falsePath the fallback handle... | [
"Apply",
"the",
"chain",
"of",
"transforms",
"and",
"bind",
"them",
"to",
"a",
"boolean",
"branch",
"as",
"from",
"java",
".",
"lang",
".",
"invoke",
".",
"MethodHandles",
".",
"guardWithTest",
".",
"As",
"with",
"GWT",
"the",
"current",
"endpoint",
"signa... | ce6bfeb8e33265480daa7b797989dd915d51238d | https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/Binder.java#L1650-L1652 | train |
headius/invokebinder | src/main/java/com/headius/invokebinder/Binder.java | Binder.toJava | public String toJava(MethodType incoming) {
StringBuilder builder = new StringBuilder();
boolean second = false;
for (Transform transform : transforms) {
if (second) builder.append('\n');
second = true;
builder.append(transform.toJava(incoming));
}
... | java | public String toJava(MethodType incoming) {
StringBuilder builder = new StringBuilder();
boolean second = false;
for (Transform transform : transforms) {
if (second) builder.append('\n');
second = true;
builder.append(transform.toJava(incoming));
}
... | [
"public",
"String",
"toJava",
"(",
"MethodType",
"incoming",
")",
"{",
"StringBuilder",
"builder",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"boolean",
"second",
"=",
"false",
";",
"for",
"(",
"Transform",
"transform",
":",
"transforms",
")",
"{",
"if",
... | Produce Java code that would perform equivalent operations to this binder.
@return Java code for the handle adaptations this Binder would produce. | [
"Produce",
"Java",
"code",
"that",
"would",
"perform",
"equivalent",
"operations",
"to",
"this",
"binder",
"."
] | ce6bfeb8e33265480daa7b797989dd915d51238d | https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/Binder.java#L1669-L1678 | train |
stickfigure/batchfb | src/main/java/com/googlecode/batchfb/util/GraphRequestBuilder.java | GraphRequestBuilder.execute | @Override
public HttpResponse execute() throws IOException {
if (this.method == HttpMethod.GET) {
String url = this.toString();
if (url.length() > this.cutoff) {
if (log.isLoggable(Level.FINER))
log.finer("URL length " + url.length() + " too long, converting GET to POST: " + url);
Str... | java | @Override
public HttpResponse execute() throws IOException {
if (this.method == HttpMethod.GET) {
String url = this.toString();
if (url.length() > this.cutoff) {
if (log.isLoggable(Level.FINER))
log.finer("URL length " + url.length() + " too long, converting GET to POST: " + url);
Str... | [
"@",
"Override",
"public",
"HttpResponse",
"execute",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"this",
".",
"method",
"==",
"HttpMethod",
".",
"GET",
")",
"{",
"String",
"url",
"=",
"this",
".",
"toString",
"(",
")",
";",
"if",
"(",
"url",
... | Replace excessively-long GET requests with a POST. | [
"Replace",
"excessively",
"-",
"long",
"GET",
"requests",
"with",
"a",
"POST",
"."
] | ceeda78aa6d8397eec032ab1d8997adb7378e9e2 | https://github.com/stickfigure/batchfb/blob/ceeda78aa6d8397eec032ab1d8997adb7378e9e2/src/main/java/com/googlecode/batchfb/util/GraphRequestBuilder.java#L82-L96 | train |
stickfigure/batchfb | src/main/java/com/googlecode/batchfb/impl/Batch.java | Batch.graph | private <T> GraphRequest<T> graph(String object, JavaType type, Param... params) {
this.checkForBatchExecution();
// The data is transformed through a chain of wrappers
GraphRequest<T> req =
new GraphRequest<T>(object, params, this.mapper, this.<T>createMappingChain(type));
this.graphRequests.ad... | java | private <T> GraphRequest<T> graph(String object, JavaType type, Param... params) {
this.checkForBatchExecution();
// The data is transformed through a chain of wrappers
GraphRequest<T> req =
new GraphRequest<T>(object, params, this.mapper, this.<T>createMappingChain(type));
this.graphRequests.ad... | [
"private",
"<",
"T",
">",
"GraphRequest",
"<",
"T",
">",
"graph",
"(",
"String",
"object",
",",
"JavaType",
"type",
",",
"Param",
"...",
"params",
")",
"{",
"this",
".",
"checkForBatchExecution",
"(",
")",
";",
"// The data is transformed through a chain of wrap... | The actual implementation of this, after we've converted to proper Jackson JavaType | [
"The",
"actual",
"implementation",
"of",
"this",
"after",
"we",
"ve",
"converted",
"to",
"proper",
"Jackson",
"JavaType"
] | ceeda78aa6d8397eec032ab1d8997adb7378e9e2 | https://github.com/stickfigure/batchfb/blob/ceeda78aa6d8397eec032ab1d8997adb7378e9e2/src/main/java/com/googlecode/batchfb/impl/Batch.java#L187-L196 | train |
stickfigure/batchfb | src/main/java/com/googlecode/batchfb/impl/Batch.java | Batch.query | private <T> QueryRequest<T> query(String fql, JavaType type) {
this.checkForBatchExecution();
if (this.multiqueryRequest == null) {
this.multiqueryRequest = new MultiqueryRequest(mapper, this.createUnmappedChain());
this.graphRequests.add(this.multiqueryRequest);
}
// There is a circular ref... | java | private <T> QueryRequest<T> query(String fql, JavaType type) {
this.checkForBatchExecution();
if (this.multiqueryRequest == null) {
this.multiqueryRequest = new MultiqueryRequest(mapper, this.createUnmappedChain());
this.graphRequests.add(this.multiqueryRequest);
}
// There is a circular ref... | [
"private",
"<",
"T",
">",
"QueryRequest",
"<",
"T",
">",
"query",
"(",
"String",
"fql",
",",
"JavaType",
"type",
")",
"{",
"this",
".",
"checkForBatchExecution",
"(",
")",
";",
"if",
"(",
"this",
".",
"multiqueryRequest",
"==",
"null",
")",
"{",
"this"... | Implementation now that we have chosen a Jackson JavaType for the return value | [
"Implementation",
"now",
"that",
"we",
"have",
"chosen",
"a",
"Jackson",
"JavaType",
"for",
"the",
"return",
"value"
] | ceeda78aa6d8397eec032ab1d8997adb7378e9e2 | https://github.com/stickfigure/batchfb/blob/ceeda78aa6d8397eec032ab1d8997adb7378e9e2/src/main/java/com/googlecode/batchfb/impl/Batch.java#L233-L255 | train |
stickfigure/batchfb | src/main/java/com/googlecode/batchfb/impl/Batch.java | Batch.createMappingChain | private <T> MapperWrapper<T> createMappingChain(JavaType type) {
return new MapperWrapper<T>(type, this.mapper, this.createUnmappedChain());
} | java | private <T> MapperWrapper<T> createMappingChain(JavaType type) {
return new MapperWrapper<T>(type, this.mapper, this.createUnmappedChain());
} | [
"private",
"<",
"T",
">",
"MapperWrapper",
"<",
"T",
">",
"createMappingChain",
"(",
"JavaType",
"type",
")",
"{",
"return",
"new",
"MapperWrapper",
"<",
"T",
">",
"(",
"type",
",",
"this",
".",
"mapper",
",",
"this",
".",
"createUnmappedChain",
"(",
")"... | Adds mapping to the basic unmapped chain. | [
"Adds",
"mapping",
"to",
"the",
"basic",
"unmapped",
"chain",
"."
] | ceeda78aa6d8397eec032ab1d8997adb7378e9e2 | https://github.com/stickfigure/batchfb/blob/ceeda78aa6d8397eec032ab1d8997adb7378e9e2/src/main/java/com/googlecode/batchfb/impl/Batch.java#L332-L334 | train |
stickfigure/batchfb | src/main/java/com/googlecode/batchfb/impl/Batch.java | Batch.createUnmappedChain | private ErrorDetectingWrapper createUnmappedChain() {
int nextIndex = this.graphRequests.size();
return
new ErrorDetectingWrapper(
new GraphNodeExtractor(nextIndex, this.mapper,
new ErrorDetectingWrapper(this)));
} | java | private ErrorDetectingWrapper createUnmappedChain() {
int nextIndex = this.graphRequests.size();
return
new ErrorDetectingWrapper(
new GraphNodeExtractor(nextIndex, this.mapper,
new ErrorDetectingWrapper(this)));
} | [
"private",
"ErrorDetectingWrapper",
"createUnmappedChain",
"(",
")",
"{",
"int",
"nextIndex",
"=",
"this",
".",
"graphRequests",
".",
"size",
"(",
")",
";",
"return",
"new",
"ErrorDetectingWrapper",
"(",
"new",
"GraphNodeExtractor",
"(",
"nextIndex",
",",
"this",
... | Creates the common chain of wrappers that will select out one graph request
from the batch and error check it both at the batch level and at the individual
request level. Result will be an unmapped JsonNode. | [
"Creates",
"the",
"common",
"chain",
"of",
"wrappers",
"that",
"will",
"select",
"out",
"one",
"graph",
"request",
"from",
"the",
"batch",
"and",
"error",
"check",
"it",
"both",
"at",
"the",
"batch",
"level",
"and",
"at",
"the",
"individual",
"request",
"l... | ceeda78aa6d8397eec032ab1d8997adb7378e9e2 | https://github.com/stickfigure/batchfb/blob/ceeda78aa6d8397eec032ab1d8997adb7378e9e2/src/main/java/com/googlecode/batchfb/impl/Batch.java#L341-L348 | train |
stickfigure/batchfb | src/main/java/com/googlecode/batchfb/impl/Batch.java | Batch.getRawBatchResult | private Later<JsonNode> getRawBatchResult() {
if (this.rawBatchResult == null) {
// Use LaterWrapper to cache the result so we don't fetch over and over
this.rawBatchResult = new LaterWrapper<JsonNode, JsonNode>(this.createFetcher());
// Also let the master know it's time to kick off any other batch... | java | private Later<JsonNode> getRawBatchResult() {
if (this.rawBatchResult == null) {
// Use LaterWrapper to cache the result so we don't fetch over and over
this.rawBatchResult = new LaterWrapper<JsonNode, JsonNode>(this.createFetcher());
// Also let the master know it's time to kick off any other batch... | [
"private",
"Later",
"<",
"JsonNode",
">",
"getRawBatchResult",
"(",
")",
"{",
"if",
"(",
"this",
".",
"rawBatchResult",
"==",
"null",
")",
"{",
"// Use LaterWrapper to cache the result so we don't fetch over and over\r",
"this",
".",
"rawBatchResult",
"=",
"new",
"Lat... | Get the batch result, firing it off if necessary | [
"Get",
"the",
"batch",
"result",
"firing",
"it",
"off",
"if",
"necessary"
] | ceeda78aa6d8397eec032ab1d8997adb7378e9e2 | https://github.com/stickfigure/batchfb/blob/ceeda78aa6d8397eec032ab1d8997adb7378e9e2/src/main/java/com/googlecode/batchfb/impl/Batch.java#L370-L383 | train |
stickfigure/batchfb | src/main/java/com/googlecode/batchfb/impl/Batch.java | Batch.createFetcher | private Later<JsonNode> createFetcher() {
final RequestBuilder call = new GraphRequestBuilder(getGraphEndpoint(), HttpMethod.POST, this.timeout, this.retries);
// This actually creates the correct JSON structure as an array
String batchValue = JSONUtils.toJSON(this.graphRequests, this.mapper);
if (log.i... | java | private Later<JsonNode> createFetcher() {
final RequestBuilder call = new GraphRequestBuilder(getGraphEndpoint(), HttpMethod.POST, this.timeout, this.retries);
// This actually creates the correct JSON structure as an array
String batchValue = JSONUtils.toJSON(this.graphRequests, this.mapper);
if (log.i... | [
"private",
"Later",
"<",
"JsonNode",
">",
"createFetcher",
"(",
")",
"{",
"final",
"RequestBuilder",
"call",
"=",
"new",
"GraphRequestBuilder",
"(",
"getGraphEndpoint",
"(",
")",
",",
"HttpMethod",
".",
"POST",
",",
"this",
".",
"timeout",
",",
"this",
".",
... | Constructs the batch query and executes it, possibly asynchronously.
@return an asynchronous handle to the raw batch result, whatever it may be. | [
"Constructs",
"the",
"batch",
"query",
"and",
"executes",
"it",
"possibly",
"asynchronously",
"."
] | ceeda78aa6d8397eec032ab1d8997adb7378e9e2 | https://github.com/stickfigure/batchfb/blob/ceeda78aa6d8397eec032ab1d8997adb7378e9e2/src/main/java/com/googlecode/batchfb/impl/Batch.java#L398-L442 | train |
stickfigure/batchfb | src/main/java/com/googlecode/batchfb/impl/ErrorDetectingWrapper.java | ErrorDetectingWrapper.throwPageMigratedException | private void throwPageMigratedException(String msg, int code, int subcode, String userTitle, String userMsg) {
// This SUCKS ASS. Messages look like:
// (#21) Page ID 114267748588304 was migrated to page ID 111013272313096. Please update your API calls to the new ID
Matcher matcher = ID_PATTERN.matcher(msg... | java | private void throwPageMigratedException(String msg, int code, int subcode, String userTitle, String userMsg) {
// This SUCKS ASS. Messages look like:
// (#21) Page ID 114267748588304 was migrated to page ID 111013272313096. Please update your API calls to the new ID
Matcher matcher = ID_PATTERN.matcher(msg... | [
"private",
"void",
"throwPageMigratedException",
"(",
"String",
"msg",
",",
"int",
"code",
",",
"int",
"subcode",
",",
"String",
"userTitle",
",",
"String",
"userMsg",
")",
"{",
"// This SUCKS ASS. Messages look like:\r",
"// (#21) Page ID 114267748588304 was migrated to p... | Builds the proper exception and throws it.
@throws PageMigratedException always | [
"Builds",
"the",
"proper",
"exception",
"and",
"throws",
"it",
"."
] | ceeda78aa6d8397eec032ab1d8997adb7378e9e2 | https://github.com/stickfigure/batchfb/blob/ceeda78aa6d8397eec032ab1d8997adb7378e9e2/src/main/java/com/googlecode/batchfb/impl/ErrorDetectingWrapper.java#L138-L148 | train |
stickfigure/batchfb | src/main/java/com/googlecode/batchfb/impl/ErrorDetectingWrapper.java | ErrorDetectingWrapper.extractNextId | private long extractNextId(Matcher matcher, String msg) {
if (!matcher.find())
throw new IllegalStateException("Facebook changed the error msg for page migration to something unfamiliar. The new msg is: " + msg);
String idStr = matcher.group().substring("ID ".length());
return Long.parseLong(idStr);
} | java | private long extractNextId(Matcher matcher, String msg) {
if (!matcher.find())
throw new IllegalStateException("Facebook changed the error msg for page migration to something unfamiliar. The new msg is: " + msg);
String idStr = matcher.group().substring("ID ".length());
return Long.parseLong(idStr);
} | [
"private",
"long",
"extractNextId",
"(",
"Matcher",
"matcher",
",",
"String",
"msg",
")",
"{",
"if",
"(",
"!",
"matcher",
".",
"find",
"(",
")",
")",
"throw",
"new",
"IllegalStateException",
"(",
"\"Facebook changed the error msg for page migration to something unfami... | Gets the next id out of the matcher | [
"Gets",
"the",
"next",
"id",
"out",
"of",
"the",
"matcher"
] | ceeda78aa6d8397eec032ab1d8997adb7378e9e2 | https://github.com/stickfigure/batchfb/blob/ceeda78aa6d8397eec032ab1d8997adb7378e9e2/src/main/java/com/googlecode/batchfb/impl/ErrorDetectingWrapper.java#L153-L159 | train |
stickfigure/batchfb | src/main/java/com/googlecode/batchfb/impl/ErrorDetectingWrapper.java | ErrorDetectingWrapper.throwCodeAndMessage | protected void throwCodeAndMessage(int code, String msg) {
switch (code) {
case 0:
case 101:
case 102:
case 190: throw new OAuthException(msg, "OAuthException", code, null, null, null);
default: throw new ErrorFacebookException(msg + " (code " + code +")", null, code, null, null, null);
}... | java | protected void throwCodeAndMessage(int code, String msg) {
switch (code) {
case 0:
case 101:
case 102:
case 190: throw new OAuthException(msg, "OAuthException", code, null, null, null);
default: throw new ErrorFacebookException(msg + " (code " + code +")", null, code, null, null, null);
}... | [
"protected",
"void",
"throwCodeAndMessage",
"(",
"int",
"code",
",",
"String",
"msg",
")",
"{",
"switch",
"(",
"code",
")",
"{",
"case",
"0",
":",
"case",
"101",
":",
"case",
"102",
":",
"case",
"190",
":",
"throw",
"new",
"OAuthException",
"(",
"msg",... | Throw the appropriate exception for the given legacy code and message.
Always throws, never returns. | [
"Throw",
"the",
"appropriate",
"exception",
"for",
"the",
"given",
"legacy",
"code",
"and",
"message",
".",
"Always",
"throws",
"never",
"returns",
"."
] | ceeda78aa6d8397eec032ab1d8997adb7378e9e2 | https://github.com/stickfigure/batchfb/blob/ceeda78aa6d8397eec032ab1d8997adb7378e9e2/src/main/java/com/googlecode/batchfb/impl/ErrorDetectingWrapper.java#L227-L236 | train |
premium-minds/pm-wicket-utils | src/main/java/com/premiumminds/webapp/wicket/repeaters/AjaxListSetView.java | AjaxListSetView.newItem | protected ListSetItem<T> newItem(IModel<T> itemModel)
{
ListSetItem<T> item = new ListSetItem<T>(Integer.toString(counter++), itemModel);
populateItem(item);
return item;
} | java | protected ListSetItem<T> newItem(IModel<T> itemModel)
{
ListSetItem<T> item = new ListSetItem<T>(Integer.toString(counter++), itemModel);
populateItem(item);
return item;
} | [
"protected",
"ListSetItem",
"<",
"T",
">",
"newItem",
"(",
"IModel",
"<",
"T",
">",
"itemModel",
")",
"{",
"ListSetItem",
"<",
"T",
">",
"item",
"=",
"new",
"ListSetItem",
"<",
"T",
">",
"(",
"Integer",
".",
"toString",
"(",
"counter",
"++",
")",
","... | Create a new ListSetItem for list item.
@param itemModel object in the list that the item represents
@return ListSetItem | [
"Create",
"a",
"new",
"ListSetItem",
"for",
"list",
"item",
"."
] | ed28f4bfb2084dfb2649d9fa283754cb76894d2d | https://github.com/premium-minds/pm-wicket-utils/blob/ed28f4bfb2084dfb2649d9fa283754cb76894d2d/src/main/java/com/premiumminds/webapp/wicket/repeaters/AjaxListSetView.java#L175-L180 | train |
premium-minds/pm-wicket-utils | src/main/java/com/premiumminds/webapp/wicket/bootstrap/BootstrapDatePicker.java | BootstrapDatePicker.getDateTextField | public DateTextField getDateTextField(){
DateTextField component = visitChildren(DateTextField.class, new IVisitor<DateTextField, DateTextField>() {
@Override
public void component(DateTextField arg0, IVisit<DateTextField> arg1) {
arg1.stop(arg0);
}
});
if (component == null)
throw new WicketRunt... | java | public DateTextField getDateTextField(){
DateTextField component = visitChildren(DateTextField.class, new IVisitor<DateTextField, DateTextField>() {
@Override
public void component(DateTextField arg0, IVisit<DateTextField> arg1) {
arg1.stop(arg0);
}
});
if (component == null)
throw new WicketRunt... | [
"public",
"DateTextField",
"getDateTextField",
"(",
")",
"{",
"DateTextField",
"component",
"=",
"visitChildren",
"(",
"DateTextField",
".",
"class",
",",
"new",
"IVisitor",
"<",
"DateTextField",
",",
"DateTextField",
">",
"(",
")",
"{",
"@",
"Override",
"public... | Gets the DateTextField inside this datepicker wrapper.
@return the date field | [
"Gets",
"the",
"DateTextField",
"inside",
"this",
"datepicker",
"wrapper",
"."
] | ed28f4bfb2084dfb2649d9fa283754cb76894d2d | https://github.com/premium-minds/pm-wicket-utils/blob/ed28f4bfb2084dfb2649d9fa283754cb76894d2d/src/main/java/com/premiumminds/webapp/wicket/bootstrap/BootstrapDatePicker.java#L85-L97 | train |
davidmarquis/fluent-interface-proxy | src/main/java/com/fluentinterface/proxy/internal/BestMatchingConstructor.java | BestMatchingConstructor.typesAreCompatible | private boolean typesAreCompatible(Class<?>[] paramTypes, Class<?>[] constructorParamTypes) {
boolean matches = true;
for (int i = 0; i < paramTypes.length; i++) {
Class<?> paramType = paramTypes[i];
if (paramType != null) {
Class<?> inputParamType = translateFro... | java | private boolean typesAreCompatible(Class<?>[] paramTypes, Class<?>[] constructorParamTypes) {
boolean matches = true;
for (int i = 0; i < paramTypes.length; i++) {
Class<?> paramType = paramTypes[i];
if (paramType != null) {
Class<?> inputParamType = translateFro... | [
"private",
"boolean",
"typesAreCompatible",
"(",
"Class",
"<",
"?",
">",
"[",
"]",
"paramTypes",
",",
"Class",
"<",
"?",
">",
"[",
"]",
"constructorParamTypes",
")",
"{",
"boolean",
"matches",
"=",
"true",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
... | Checks if a set of types are compatible with the given set of constructor parameter types. If an input type is
null, then it is considered as a wildcard for matching purposes, and always matches.
@param paramTypes A set of input types that are to be matched against constructor parameters.
@param constructor... | [
"Checks",
"if",
"a",
"set",
"of",
"types",
"are",
"compatible",
"with",
"the",
"given",
"set",
"of",
"constructor",
"parameter",
"types",
".",
"If",
"an",
"input",
"type",
"is",
"null",
"then",
"it",
"is",
"considered",
"as",
"a",
"wildcard",
"for",
"mat... | 8e72fff6cd1f496c76a01773269caead994fea65 | https://github.com/davidmarquis/fluent-interface-proxy/blob/8e72fff6cd1f496c76a01773269caead994fea65/src/main/java/com/fluentinterface/proxy/internal/BestMatchingConstructor.java#L112-L132 | train |
rbuck/java-retry | src/main/java/com/github/rbuck/retry/RetryPolicy.java | RetryPolicy.action | public V action(Callable<V> callable) throws Exception {
Exception re;
RetryState retryState = retryStrategy.getRetryState();
do {
try {
return callable.call();
} catch (Exception e) {
re = e;
if (Thread.interrupted() || isI... | java | public V action(Callable<V> callable) throws Exception {
Exception re;
RetryState retryState = retryStrategy.getRetryState();
do {
try {
return callable.call();
} catch (Exception e) {
re = e;
if (Thread.interrupted() || isI... | [
"public",
"V",
"action",
"(",
"Callable",
"<",
"V",
">",
"callable",
")",
"throws",
"Exception",
"{",
"Exception",
"re",
";",
"RetryState",
"retryState",
"=",
"retryStrategy",
".",
"getRetryState",
"(",
")",
";",
"do",
"{",
"try",
"{",
"return",
"callable"... | Perform the specified action under the defined retry semantics.
@param callable the action to perform under retry
@return the result of the action
@throws Exception inspect cause to determine reason, or interrupt status | [
"Perform",
"the",
"specified",
"action",
"under",
"the",
"defined",
"retry",
"semantics",
"."
] | 660137ac6226bc3dd1ee6544efa4a02be27aaa66 | https://github.com/rbuck/java-retry/blob/660137ac6226bc3dd1ee6544efa4a02be27aaa66/src/main/java/com/github/rbuck/retry/RetryPolicy.java#L35-L55 | train |
rbuck/java-retry | src/main/java/com/github/rbuck/retry/RetryPolicy.java | RetryPolicy.isInterruptTransitively | private boolean isInterruptTransitively(Throwable e) {
do {
if (e instanceof InterruptedException) {
return true;
}
e = e.getCause();
} while (e != null);
return false;
} | java | private boolean isInterruptTransitively(Throwable e) {
do {
if (e instanceof InterruptedException) {
return true;
}
e = e.getCause();
} while (e != null);
return false;
} | [
"private",
"boolean",
"isInterruptTransitively",
"(",
"Throwable",
"e",
")",
"{",
"do",
"{",
"if",
"(",
"e",
"instanceof",
"InterruptedException",
")",
"{",
"return",
"true",
";",
"}",
"e",
"=",
"e",
".",
"getCause",
"(",
")",
";",
"}",
"while",
"(",
"... | Special case during shutdown.
@param e possible instance of, or has cause for, an InterruptedException
@return true if it is transitively an InterruptedException | [
"Special",
"case",
"during",
"shutdown",
"."
] | 660137ac6226bc3dd1ee6544efa4a02be27aaa66 | https://github.com/rbuck/java-retry/blob/660137ac6226bc3dd1ee6544efa4a02be27aaa66/src/main/java/com/github/rbuck/retry/RetryPolicy.java#L63-L71 | train |
knightliao/apollo | src/main/java/com/github/knightliao/apollo/redis/RedisClient.java | RedisClient.getSet | public Object getSet(String key, Object value, Integer expiration) throws Exception {
Jedis jedis = null;
try {
jedis = this.jedisPool.getResource();
long begin = System.currentTimeMillis();
// 操作expire成功返回1,失败返回0,仅当均返回1时,实际操作成功
byte[] val = jedis.getSet... | java | public Object getSet(String key, Object value, Integer expiration) throws Exception {
Jedis jedis = null;
try {
jedis = this.jedisPool.getResource();
long begin = System.currentTimeMillis();
// 操作expire成功返回1,失败返回0,仅当均返回1时,实际操作成功
byte[] val = jedis.getSet... | [
"public",
"Object",
"getSet",
"(",
"String",
"key",
",",
"Object",
"value",
",",
"Integer",
"expiration",
")",
"throws",
"Exception",
"{",
"Jedis",
"jedis",
"=",
"null",
";",
"try",
"{",
"jedis",
"=",
"this",
".",
"jedisPool",
".",
"getResource",
"(",
")... | get old value and set new value
@param key
@param value
@param expiration
@return false if redis did not execute the option
@throws Exception
@author wangchongjie | [
"get",
"old",
"value",
"and",
"set",
"new",
"value"
] | d7a283659fa3e67af6375db8969b2d065a8ce6eb | https://github.com/knightliao/apollo/blob/d7a283659fa3e67af6375db8969b2d065a8ce6eb/src/main/java/com/github/knightliao/apollo/redis/RedisClient.java#L162-L197 | train |
knightliao/apollo | src/main/java/com/github/knightliao/apollo/redis/RedisClient.java | RedisClient.add | public boolean add(String key, Object value, Integer expiration) throws Exception {
Jedis jedis = null;
try {
jedis = this.jedisPool.getResource();
long begin = System.currentTimeMillis();
// 操作setnx与expire成功返回1,失败返回0,仅当均返回1时,实际操作成功
Long result = jedis.s... | java | public boolean add(String key, Object value, Integer expiration) throws Exception {
Jedis jedis = null;
try {
jedis = this.jedisPool.getResource();
long begin = System.currentTimeMillis();
// 操作setnx与expire成功返回1,失败返回0,仅当均返回1时,实际操作成功
Long result = jedis.s... | [
"public",
"boolean",
"add",
"(",
"String",
"key",
",",
"Object",
"value",
",",
"Integer",
"expiration",
")",
"throws",
"Exception",
"{",
"Jedis",
"jedis",
"=",
"null",
";",
"try",
"{",
"jedis",
"=",
"this",
".",
"jedisPool",
".",
"getResource",
"(",
")",... | add if not exists
@param key
@param value
@param expiration
@return false if redis did not execute the option
@throws Exception | [
"add",
"if",
"not",
"exists"
] | d7a283659fa3e67af6375db8969b2d065a8ce6eb | https://github.com/knightliao/apollo/blob/d7a283659fa3e67af6375db8969b2d065a8ce6eb/src/main/java/com/github/knightliao/apollo/redis/RedisClient.java#L293-L322 | train |
knightliao/apollo | src/main/java/com/github/knightliao/apollo/redis/RedisClient.java | RedisClient.exists | public boolean exists(String key) throws Exception {
boolean isExist = false;
Jedis jedis = null;
try {
jedis = this.jedisPool.getResource();
isExist = jedis.exists(SafeEncoder.encode(key));
} catch (Exception e) {
logger.error(e.getMessage(), e);
... | java | public boolean exists(String key) throws Exception {
boolean isExist = false;
Jedis jedis = null;
try {
jedis = this.jedisPool.getResource();
isExist = jedis.exists(SafeEncoder.encode(key));
} catch (Exception e) {
logger.error(e.getMessage(), e);
... | [
"public",
"boolean",
"exists",
"(",
"String",
"key",
")",
"throws",
"Exception",
"{",
"boolean",
"isExist",
"=",
"false",
";",
"Jedis",
"jedis",
"=",
"null",
";",
"try",
"{",
"jedis",
"=",
"this",
".",
"jedisPool",
".",
"getResource",
"(",
")",
";",
"i... | Test if the specified key exists.
@param key
@return
@throws Exception | [
"Test",
"if",
"the",
"specified",
"key",
"exists",
"."
] | d7a283659fa3e67af6375db8969b2d065a8ce6eb | https://github.com/knightliao/apollo/blob/d7a283659fa3e67af6375db8969b2d065a8ce6eb/src/main/java/com/github/knightliao/apollo/redis/RedisClient.java#L347-L364 | train |
knightliao/apollo | src/main/java/com/github/knightliao/apollo/redis/RedisClient.java | RedisClient.delete | public boolean delete(String key) {
Jedis jedis = null;
try {
jedis = this.jedisPool.getResource();
jedis.del(SafeEncoder.encode(key));
logger.info("delete key:" + key);
return true;
} catch (Exception e) {
logger.error(e.getMessage(),... | java | public boolean delete(String key) {
Jedis jedis = null;
try {
jedis = this.jedisPool.getResource();
jedis.del(SafeEncoder.encode(key));
logger.info("delete key:" + key);
return true;
} catch (Exception e) {
logger.error(e.getMessage(),... | [
"public",
"boolean",
"delete",
"(",
"String",
"key",
")",
"{",
"Jedis",
"jedis",
"=",
"null",
";",
"try",
"{",
"jedis",
"=",
"this",
".",
"jedisPool",
".",
"getResource",
"(",
")",
";",
"jedis",
".",
"del",
"(",
"SafeEncoder",
".",
"encode",
"(",
"ke... | Remove the specified keys.
@param key
@return false if redis did not execute the option | [
"Remove",
"the",
"specified",
"keys",
"."
] | d7a283659fa3e67af6375db8969b2d065a8ce6eb | https://github.com/knightliao/apollo/blob/d7a283659fa3e67af6375db8969b2d065a8ce6eb/src/main/java/com/github/knightliao/apollo/redis/RedisClient.java#L373-L390 | train |
knightliao/apollo | src/main/java/com/github/knightliao/apollo/redis/RedisClient.java | RedisClient.flushall | public boolean flushall() {
String result = "";
Jedis jedis = null;
try {
jedis = this.jedisPool.getResource();
result = jedis.flushAll();
logger.info("redis client name: " + this.getCacheName() + " flushall.");
} catch (Exception e) {
log... | java | public boolean flushall() {
String result = "";
Jedis jedis = null;
try {
jedis = this.jedisPool.getResource();
result = jedis.flushAll();
logger.info("redis client name: " + this.getCacheName() + " flushall.");
} catch (Exception e) {
log... | [
"public",
"boolean",
"flushall",
"(",
")",
"{",
"String",
"result",
"=",
"\"\"",
";",
"Jedis",
"jedis",
"=",
"null",
";",
"try",
"{",
"jedis",
"=",
"this",
".",
"jedisPool",
".",
"getResource",
"(",
")",
";",
"result",
"=",
"jedis",
".",
"flushAll",
... | Delete all the keys of all the existing databases, not just the currently selected one.
@return false if redis did not execute the option | [
"Delete",
"all",
"the",
"keys",
"of",
"all",
"the",
"existing",
"databases",
"not",
"just",
"the",
"currently",
"selected",
"one",
"."
] | d7a283659fa3e67af6375db8969b2d065a8ce6eb | https://github.com/knightliao/apollo/blob/d7a283659fa3e67af6375db8969b2d065a8ce6eb/src/main/java/com/github/knightliao/apollo/redis/RedisClient.java#L423-L440 | train |
davidmarquis/fluent-interface-proxy | src/main/java/com/fluentinterface/beans/reflect/Property.java | Property.get | public Object get(Object obj) throws ReflectionException {
try {
if (isPublic(readMethod)) {
return readMethod.invoke(obj);
} else {
throw new ReflectionException("Cannot get the value of " + this + ", as it is write-only.");
}
} catch ... | java | public Object get(Object obj) throws ReflectionException {
try {
if (isPublic(readMethod)) {
return readMethod.invoke(obj);
} else {
throw new ReflectionException("Cannot get the value of " + this + ", as it is write-only.");
}
} catch ... | [
"public",
"Object",
"get",
"(",
"Object",
"obj",
")",
"throws",
"ReflectionException",
"{",
"try",
"{",
"if",
"(",
"isPublic",
"(",
"readMethod",
")",
")",
"{",
"return",
"readMethod",
".",
"invoke",
"(",
"obj",
")",
";",
"}",
"else",
"{",
"throw",
"ne... | Returns the value of the representation of this property from the specified object.
<p> The underlying property's value is obtained trying to invoke the {@code readMethod}.
<p> If this {@link Property} object has no public {@code readMethod},
it is considered write-only, and the action will be prevented throwing
a {@... | [
"Returns",
"the",
"value",
"of",
"the",
"representation",
"of",
"this",
"property",
"from",
"the",
"specified",
"object",
"."
] | 8e72fff6cd1f496c76a01773269caead994fea65 | https://github.com/davidmarquis/fluent-interface-proxy/blob/8e72fff6cd1f496c76a01773269caead994fea65/src/main/java/com/fluentinterface/beans/reflect/Property.java#L403-L413 | train |
davidmarquis/fluent-interface-proxy | src/main/java/com/fluentinterface/beans/reflect/Property.java | Property.set | public void set(Object obj, Object value) throws ReflectionException {
try {
if (isPublic(writeMethod)) {
writeMethod.invoke(obj, value);
} else {
throw new ReflectionException("Cannot set the value of " + this + ", as it is read-only.");
}
... | java | public void set(Object obj, Object value) throws ReflectionException {
try {
if (isPublic(writeMethod)) {
writeMethod.invoke(obj, value);
} else {
throw new ReflectionException("Cannot set the value of " + this + ", as it is read-only.");
}
... | [
"public",
"void",
"set",
"(",
"Object",
"obj",
",",
"Object",
"value",
")",
"throws",
"ReflectionException",
"{",
"try",
"{",
"if",
"(",
"isPublic",
"(",
"writeMethod",
")",
")",
"{",
"writeMethod",
".",
"invoke",
"(",
"obj",
",",
"value",
")",
";",
"}... | Sets a new value to the representation of this property on the specified object.
<p> The underlying property's value will be updated trying
to invoke the {@code writeMethod}.
<p> If this {@link Property} object has no public {@code writeMethod}, it is considered read-only,
and the action will be prevented throwing a ... | [
"Sets",
"a",
"new",
"value",
"to",
"the",
"representation",
"of",
"this",
"property",
"on",
"the",
"specified",
"object",
"."
] | 8e72fff6cd1f496c76a01773269caead994fea65 | https://github.com/davidmarquis/fluent-interface-proxy/blob/8e72fff6cd1f496c76a01773269caead994fea65/src/main/java/com/fluentinterface/beans/reflect/Property.java#L431-L441 | train |
premium-minds/pm-wicket-utils | src/main/java/com/premiumminds/webapp/wicket/TemporalTextField.java | TemporalTextField.getConverter | @SuppressWarnings("unchecked")
@Override
public <C> IConverter<C> getConverter(final Class<C> type)
{
if (Temporal.class.isAssignableFrom(type))
{
return (IConverter<C>)converter;
}
else
{
return super.getConverter(type);
}
} | java | @SuppressWarnings("unchecked")
@Override
public <C> IConverter<C> getConverter(final Class<C> type)
{
if (Temporal.class.isAssignableFrom(type))
{
return (IConverter<C>)converter;
}
else
{
return super.getConverter(type);
}
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"@",
"Override",
"public",
"<",
"C",
">",
"IConverter",
"<",
"C",
">",
"getConverter",
"(",
"final",
"Class",
"<",
"C",
">",
"type",
")",
"{",
"if",
"(",
"Temporal",
".",
"class",
".",
"isAssignableFrom... | Returns the default converter if created without pattern; otherwise it returns a
pattern-specific converter.
@param type
The type for which the convertor should work
@return A pattern-specific converter
@see org.apache.wicket.markup.html.form.TextField | [
"Returns",
"the",
"default",
"converter",
"if",
"created",
"without",
"pattern",
";",
"otherwise",
"it",
"returns",
"a",
"pattern",
"-",
"specific",
"converter",
"."
] | ed28f4bfb2084dfb2649d9fa283754cb76894d2d | https://github.com/premium-minds/pm-wicket-utils/blob/ed28f4bfb2084dfb2649d9fa283754cb76894d2d/src/main/java/com/premiumminds/webapp/wicket/TemporalTextField.java#L111-L123 | train |
rbuck/java-retry | src/main/java/com/github/rbuck/retry/SqlTransientExceptionDetector.java | SqlTransientExceptionDetector.isSqlStateDuplicateValueInUniqueIndex | public static boolean isSqlStateDuplicateValueInUniqueIndex(SQLException se) {
String sqlState = se.getSQLState();
return sqlState != null && (sqlState.equals("23505") || se.getMessage().contains("duplicate value in unique index"));
} | java | public static boolean isSqlStateDuplicateValueInUniqueIndex(SQLException se) {
String sqlState = se.getSQLState();
return sqlState != null && (sqlState.equals("23505") || se.getMessage().contains("duplicate value in unique index"));
} | [
"public",
"static",
"boolean",
"isSqlStateDuplicateValueInUniqueIndex",
"(",
"SQLException",
"se",
")",
"{",
"String",
"sqlState",
"=",
"se",
".",
"getSQLState",
"(",
")",
";",
"return",
"sqlState",
"!=",
"null",
"&&",
"(",
"sqlState",
".",
"equals",
"(",
"\"2... | Determines if the SQL exception a duplicate value in unique index.
@param se the exception
@return true if it is a code 23505, otherwise false | [
"Determines",
"if",
"the",
"SQL",
"exception",
"a",
"duplicate",
"value",
"in",
"unique",
"index",
"."
] | 660137ac6226bc3dd1ee6544efa4a02be27aaa66 | https://github.com/rbuck/java-retry/blob/660137ac6226bc3dd1ee6544efa4a02be27aaa66/src/main/java/com/github/rbuck/retry/SqlTransientExceptionDetector.java#L51-L54 | train |
rbuck/java-retry | src/main/java/com/github/rbuck/retry/SqlTransientExceptionDetector.java | SqlTransientExceptionDetector.isSqlStateConnectionException | public static boolean isSqlStateConnectionException(SQLException se) {
String sqlState = se.getSQLState();
return sqlState != null && sqlState.startsWith("08");
} | java | public static boolean isSqlStateConnectionException(SQLException se) {
String sqlState = se.getSQLState();
return sqlState != null && sqlState.startsWith("08");
} | [
"public",
"static",
"boolean",
"isSqlStateConnectionException",
"(",
"SQLException",
"se",
")",
"{",
"String",
"sqlState",
"=",
"se",
".",
"getSQLState",
"(",
")",
";",
"return",
"sqlState",
"!=",
"null",
"&&",
"sqlState",
".",
"startsWith",
"(",
"\"08\"",
")"... | Determines if the SQL exception is a connection exception
@param se the exception
@return true if it is a code 08nnn, otherwise false | [
"Determines",
"if",
"the",
"SQL",
"exception",
"is",
"a",
"connection",
"exception"
] | 660137ac6226bc3dd1ee6544efa4a02be27aaa66 | https://github.com/rbuck/java-retry/blob/660137ac6226bc3dd1ee6544efa4a02be27aaa66/src/main/java/com/github/rbuck/retry/SqlTransientExceptionDetector.java#L62-L65 | train |
rbuck/java-retry | src/main/java/com/github/rbuck/retry/SqlTransientExceptionDetector.java | SqlTransientExceptionDetector.isSqlStateRollbackException | public static boolean isSqlStateRollbackException(SQLException se) {
String sqlState = se.getSQLState();
return sqlState != null && sqlState.startsWith("40");
} | java | public static boolean isSqlStateRollbackException(SQLException se) {
String sqlState = se.getSQLState();
return sqlState != null && sqlState.startsWith("40");
} | [
"public",
"static",
"boolean",
"isSqlStateRollbackException",
"(",
"SQLException",
"se",
")",
"{",
"String",
"sqlState",
"=",
"se",
".",
"getSQLState",
"(",
")",
";",
"return",
"sqlState",
"!=",
"null",
"&&",
"sqlState",
".",
"startsWith",
"(",
"\"40\"",
")",
... | Determines if the SQL exception is a rollback exception
@param se the exception
@return true if it is a code 40nnn, otherwise false | [
"Determines",
"if",
"the",
"SQL",
"exception",
"is",
"a",
"rollback",
"exception"
] | 660137ac6226bc3dd1ee6544efa4a02be27aaa66 | https://github.com/rbuck/java-retry/blob/660137ac6226bc3dd1ee6544efa4a02be27aaa66/src/main/java/com/github/rbuck/retry/SqlTransientExceptionDetector.java#L73-L76 | train |
knightliao/apollo | src/main/java/com/github/knightliao/apollo/utils/time/DateUtils.java | DateUtils.getPreviousDay | public static Date getPreviousDay(Date dt) {
if (dt == null) {
return dt;
}
Calendar cal = Calendar.getInstance();
cal.setTime(dt);
cal.add(Calendar.DAY_OF_YEAR, -1);
return cal.getTime();
} | java | public static Date getPreviousDay(Date dt) {
if (dt == null) {
return dt;
}
Calendar cal = Calendar.getInstance();
cal.setTime(dt);
cal.add(Calendar.DAY_OF_YEAR, -1);
return cal.getTime();
} | [
"public",
"static",
"Date",
"getPreviousDay",
"(",
"Date",
"dt",
")",
"{",
"if",
"(",
"dt",
"==",
"null",
")",
"{",
"return",
"dt",
";",
"}",
"Calendar",
"cal",
"=",
"Calendar",
".",
"getInstance",
"(",
")",
";",
"cal",
".",
"setTime",
"(",
"dt",
"... | added by zhuqian 2009-03-25 | [
"added",
"by",
"zhuqian",
"2009",
"-",
"03",
"-",
"25"
] | d7a283659fa3e67af6375db8969b2d065a8ce6eb | https://github.com/knightliao/apollo/blob/d7a283659fa3e67af6375db8969b2d065a8ce6eb/src/main/java/com/github/knightliao/apollo/utils/time/DateUtils.java#L559-L568 | train |
knightliao/apollo | src/main/java/com/github/knightliao/apollo/redis/eviction/EvictionTimer.java | EvictionTimer.cancel | public static synchronized void cancel(TimerTask task) {
if (task == null) {
return;
}
task.cancel();
usageCount.decrementAndGet();
if (usageCount.get() == 0) {
timer.cancel();
timer = null;
}
} | java | public static synchronized void cancel(TimerTask task) {
if (task == null) {
return;
}
task.cancel();
usageCount.decrementAndGet();
if (usageCount.get() == 0) {
timer.cancel();
timer = null;
}
} | [
"public",
"static",
"synchronized",
"void",
"cancel",
"(",
"TimerTask",
"task",
")",
"{",
"if",
"(",
"task",
"==",
"null",
")",
"{",
"return",
";",
"}",
"task",
".",
"cancel",
"(",
")",
";",
"usageCount",
".",
"decrementAndGet",
"(",
")",
";",
"if",
... | Remove the specified eviction task from the timer.
@param task Task to be scheduled | [
"Remove",
"the",
"specified",
"eviction",
"task",
"from",
"the",
"timer",
"."
] | d7a283659fa3e67af6375db8969b2d065a8ce6eb | https://github.com/knightliao/apollo/blob/d7a283659fa3e67af6375db8969b2d065a8ce6eb/src/main/java/com/github/knightliao/apollo/redis/eviction/EvictionTimer.java#L45-L55 | train |
premium-minds/pm-wicket-utils | src/main/java/com/premiumminds/webapp/wicket/drawer/DrawerManager.java | DrawerManager.push | public void push(AbstractDrawer drawer, AjaxRequestTarget target, String cssClass) {
ListItem item = new ListItem("next", drawer, this, cssClass);
drawers.push(item);
if (first == null) {
first = item;
addOrReplace(first);
} else {
ListItem iter = first;
while (iter.next != null) {
iter = iter.... | java | public void push(AbstractDrawer drawer, AjaxRequestTarget target, String cssClass) {
ListItem item = new ListItem("next", drawer, this, cssClass);
drawers.push(item);
if (first == null) {
first = item;
addOrReplace(first);
} else {
ListItem iter = first;
while (iter.next != null) {
iter = iter.... | [
"public",
"void",
"push",
"(",
"AbstractDrawer",
"drawer",
",",
"AjaxRequestTarget",
"target",
",",
"String",
"cssClass",
")",
"{",
"ListItem",
"item",
"=",
"new",
"ListItem",
"(",
"\"next\"",
",",
"drawer",
",",
"this",
",",
"cssClass",
")",
";",
"drawers",... | Push and display a drawer on the page during an AJAX request,
and inject an optional CSS class onto the drawer's immediate container.
@param drawer
The drawer to be pushed. Cannot be null.
@param target
The current AJAX target.
@param cssClass
The name of the class to be injected. | [
"Push",
"and",
"display",
"a",
"drawer",
"on",
"the",
"page",
"during",
"an",
"AJAX",
"request",
"and",
"inject",
"an",
"optional",
"CSS",
"class",
"onto",
"the",
"drawer",
"s",
"immediate",
"container",
"."
] | ed28f4bfb2084dfb2649d9fa283754cb76894d2d | https://github.com/premium-minds/pm-wicket-utils/blob/ed28f4bfb2084dfb2649d9fa283754cb76894d2d/src/main/java/com/premiumminds/webapp/wicket/drawer/DrawerManager.java#L158-L184 | train |
premium-minds/pm-wicket-utils | src/main/java/com/premiumminds/webapp/wicket/drawer/DrawerManager.java | DrawerManager.replaceLast | public void replaceLast(AbstractDrawer newDrawer, AjaxRequestTarget target) {
if (!drawers.isEmpty()) {
ListItem last = drawers.getFirst();
last.drawer.replaceWith(newDrawer);
last.drawer = newDrawer;
newDrawer.setManager(this);
target.add(newDrawer);
}
} | java | public void replaceLast(AbstractDrawer newDrawer, AjaxRequestTarget target) {
if (!drawers.isEmpty()) {
ListItem last = drawers.getFirst();
last.drawer.replaceWith(newDrawer);
last.drawer = newDrawer;
newDrawer.setManager(this);
target.add(newDrawer);
}
} | [
"public",
"void",
"replaceLast",
"(",
"AbstractDrawer",
"newDrawer",
",",
"AjaxRequestTarget",
"target",
")",
"{",
"if",
"(",
"!",
"drawers",
".",
"isEmpty",
"(",
")",
")",
"{",
"ListItem",
"last",
"=",
"drawers",
".",
"getFirst",
"(",
")",
";",
"last",
... | Replaces the topmost open drawer with a new one. If there is no open drawer, this method does nothing.
This method requires an AJAX request. DrawerManager does not support swapping drawers during page construction.
@param newDrawer
The new drawer to open. Cannot be null.
@param target
The current AJAX target. Cannot b... | [
"Replaces",
"the",
"topmost",
"open",
"drawer",
"with",
"a",
"new",
"one",
".",
"If",
"there",
"is",
"no",
"open",
"drawer",
"this",
"method",
"does",
"nothing",
".",
"This",
"method",
"requires",
"an",
"AJAX",
"request",
".",
"DrawerManager",
"does",
"not... | ed28f4bfb2084dfb2649d9fa283754cb76894d2d | https://github.com/premium-minds/pm-wicket-utils/blob/ed28f4bfb2084dfb2649d9fa283754cb76894d2d/src/main/java/com/premiumminds/webapp/wicket/drawer/DrawerManager.java#L220-L228 | train |
premium-minds/pm-wicket-utils | src/main/java/com/premiumminds/webapp/wicket/drawer/DrawerManager.java | DrawerManager.renderHead | @Override
public void renderHead(IHeaderResponse response) {
super.renderHead(response);
response.render(JavaScriptHeaderItem.forReference(DRAWER_JAVASCRIPT));
response.render(JavaScriptHeaderItem.forReference(MANAGER_JAVASCRIPT));
response.render(CssHeaderItem.forReference(DRAWER_CSS));
Iterator<ListItem>... | java | @Override
public void renderHead(IHeaderResponse response) {
super.renderHead(response);
response.render(JavaScriptHeaderItem.forReference(DRAWER_JAVASCRIPT));
response.render(JavaScriptHeaderItem.forReference(MANAGER_JAVASCRIPT));
response.render(CssHeaderItem.forReference(DRAWER_CSS));
Iterator<ListItem>... | [
"@",
"Override",
"public",
"void",
"renderHead",
"(",
"IHeaderResponse",
"response",
")",
"{",
"super",
".",
"renderHead",
"(",
"response",
")",
";",
"response",
".",
"render",
"(",
"JavaScriptHeaderItem",
".",
"forReference",
"(",
"DRAWER_JAVASCRIPT",
")",
")",... | pressing the Back button and landing on a page with open drawers. | [
"pressing",
"the",
"Back",
"button",
"and",
"landing",
"on",
"a",
"page",
"with",
"open",
"drawers",
"."
] | ed28f4bfb2084dfb2649d9fa283754cb76894d2d | https://github.com/premium-minds/pm-wicket-utils/blob/ed28f4bfb2084dfb2649d9fa283754cb76894d2d/src/main/java/com/premiumminds/webapp/wicket/drawer/DrawerManager.java#L309-L330 | train |
davidmarquis/fluent-interface-proxy | src/main/java/com/fluentinterface/beans/ObjectWrapper.java | ObjectWrapper.setWrappedObject | public void setWrappedObject(Object obj) {
if (obj == null) {
throw new IllegalArgumentException("Cannot warp a 'null' object.");
}
this.object = obj;
this.bean = Bean.forClass(obj.getClass());
} | java | public void setWrappedObject(Object obj) {
if (obj == null) {
throw new IllegalArgumentException("Cannot warp a 'null' object.");
}
this.object = obj;
this.bean = Bean.forClass(obj.getClass());
} | [
"public",
"void",
"setWrappedObject",
"(",
"Object",
"obj",
")",
"{",
"if",
"(",
"obj",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Cannot warp a 'null' object.\"",
")",
";",
"}",
"this",
".",
"object",
"=",
"obj",
";",
"this"... | Changes, at any time, the wrapped object with a new object.
@param obj the new object to wrap
@throws IllegalArgumentException if the obj parameter is {@code null} | [
"Changes",
"at",
"any",
"time",
"the",
"wrapped",
"object",
"with",
"a",
"new",
"object",
"."
] | 8e72fff6cd1f496c76a01773269caead994fea65 | https://github.com/davidmarquis/fluent-interface-proxy/blob/8e72fff6cd1f496c76a01773269caead994fea65/src/main/java/com/fluentinterface/beans/ObjectWrapper.java#L91-L98 | train |
davidmarquis/fluent-interface-proxy | src/main/java/com/fluentinterface/beans/ObjectWrapper.java | ObjectWrapper.getIndexedValue | public Object getIndexedValue(String propertyName, int index) {
return getIndexedValue(object, getPropertyOrThrow(bean, propertyName), index, this);
} | java | public Object getIndexedValue(String propertyName, int index) {
return getIndexedValue(object, getPropertyOrThrow(bean, propertyName), index, this);
} | [
"public",
"Object",
"getIndexedValue",
"(",
"String",
"propertyName",
",",
"int",
"index",
")",
"{",
"return",
"getIndexedValue",
"(",
"object",
",",
"getPropertyOrThrow",
"(",
"bean",
",",
"propertyName",
")",
",",
"index",
",",
"this",
")",
";",
"}"
] | Returns the value of the specified indexed property from the wrapped object.
@param propertyName the name of the indexed property whose value is to be extracted, cannot be {@code null}
@param index the index of the property value to be extracted
@return the indexed property value
@throws ReflectionException ... | [
"Returns",
"the",
"value",
"of",
"the",
"specified",
"indexed",
"property",
"from",
"the",
"wrapped",
"object",
"."
] | 8e72fff6cd1f496c76a01773269caead994fea65 | https://github.com/davidmarquis/fluent-interface-proxy/blob/8e72fff6cd1f496c76a01773269caead994fea65/src/main/java/com/fluentinterface/beans/ObjectWrapper.java#L237-L239 | train |
davidmarquis/fluent-interface-proxy | src/main/java/com/fluentinterface/beans/ObjectWrapper.java | ObjectWrapper.setSimpleValue | public void setSimpleValue(String propertyName, Object value) {
setSimpleValue(object, getPropertyOrThrow(bean, propertyName), value);
} | java | public void setSimpleValue(String propertyName, Object value) {
setSimpleValue(object, getPropertyOrThrow(bean, propertyName), value);
} | [
"public",
"void",
"setSimpleValue",
"(",
"String",
"propertyName",
",",
"Object",
"value",
")",
"{",
"setSimpleValue",
"(",
"object",
",",
"getPropertyOrThrow",
"(",
"bean",
",",
"propertyName",
")",
",",
"value",
")",
";",
"}"
] | Sets the value of the specified property in the wrapped object.
@param propertyName the name of the simple property whose value is to be updated, cannot be {@code null}
@param value the value to set, can be {@code null}
@throws IllegalArgumentException if the property parameter is {@code null}
@throws NullPoint... | [
"Sets",
"the",
"value",
"of",
"the",
"specified",
"property",
"in",
"the",
"wrapped",
"object",
"."
] | 8e72fff6cd1f496c76a01773269caead994fea65 | https://github.com/davidmarquis/fluent-interface-proxy/blob/8e72fff6cd1f496c76a01773269caead994fea65/src/main/java/com/fluentinterface/beans/ObjectWrapper.java#L314-L316 | train |
davidmarquis/fluent-interface-proxy | src/main/java/com/fluentinterface/utils/TypeConversionUtils.java | TypeConversionUtils.translateFromPrimitive | public static Class<?> translateFromPrimitive(Class<?> paramType) {
if (paramType == int.class) {
return Integer.class;
} else if (paramType == char.class) {
return Character.class;
} else if (paramType == byte.class) {
return Byte.class;
} else if (p... | java | public static Class<?> translateFromPrimitive(Class<?> paramType) {
if (paramType == int.class) {
return Integer.class;
} else if (paramType == char.class) {
return Character.class;
} else if (paramType == byte.class) {
return Byte.class;
} else if (p... | [
"public",
"static",
"Class",
"<",
"?",
">",
"translateFromPrimitive",
"(",
"Class",
"<",
"?",
">",
"paramType",
")",
"{",
"if",
"(",
"paramType",
"==",
"int",
".",
"class",
")",
"{",
"return",
"Integer",
".",
"class",
";",
"}",
"else",
"if",
"(",
"pa... | From a primitive type class, tries to return the corresponding wrapper class.
@param paramType a primitive type (ex: int, short, float, etc.) to convert
@return the corresponding wrapper class for the type, or the type itself if not a known primitive. | [
"From",
"a",
"primitive",
"type",
"class",
"tries",
"to",
"return",
"the",
"corresponding",
"wrapper",
"class",
"."
] | 8e72fff6cd1f496c76a01773269caead994fea65 | https://github.com/davidmarquis/fluent-interface-proxy/blob/8e72fff6cd1f496c76a01773269caead994fea65/src/main/java/com/fluentinterface/utils/TypeConversionUtils.java#L10-L31 | train |
premium-minds/pm-wicket-utils | src/main/java/com/premiumminds/webapp/wicket/repeaters/AbstractRepeater2.java | AbstractRepeater2.onRender | @Override
protected final void onRender()
{
Iterator<? extends Component> it = renderIterator();
while (it.hasNext())
{
Component child = it.next();
if (child == null)
{
throw new IllegalStateException(
"The render iterator returned null for a child. Container: " + this.toString() +
"; I... | java | @Override
protected final void onRender()
{
Iterator<? extends Component> it = renderIterator();
while (it.hasNext())
{
Component child = it.next();
if (child == null)
{
throw new IllegalStateException(
"The render iterator returned null for a child. Container: " + this.toString() +
"; I... | [
"@",
"Override",
"protected",
"final",
"void",
"onRender",
"(",
")",
"{",
"Iterator",
"<",
"?",
"extends",
"Component",
">",
"it",
"=",
"renderIterator",
"(",
")",
";",
"while",
"(",
"it",
".",
"hasNext",
"(",
")",
")",
"{",
"Component",
"child",
"=",
... | Renders all child items in no specified order | [
"Renders",
"all",
"child",
"items",
"in",
"no",
"specified",
"order"
] | ed28f4bfb2084dfb2649d9fa283754cb76894d2d | https://github.com/premium-minds/pm-wicket-utils/blob/ed28f4bfb2084dfb2649d9fa283754cb76894d2d/src/main/java/com/premiumminds/webapp/wicket/repeaters/AbstractRepeater2.java#L81-L96 | train |
groupon/monsoon | history/src/main/java/com/groupon/lex/metrics/history/xdr/TSDataScanDir.java | TSDataScanDir.metadata_end_cmp_ | private static int metadata_end_cmp_(MetaData x, MetaData y) {
return x.getEnd().compareTo(y.getEnd());
} | java | private static int metadata_end_cmp_(MetaData x, MetaData y) {
return x.getEnd().compareTo(y.getEnd());
} | [
"private",
"static",
"int",
"metadata_end_cmp_",
"(",
"MetaData",
"x",
",",
"MetaData",
"y",
")",
"{",
"return",
"x",
".",
"getEnd",
"(",
")",
".",
"compareTo",
"(",
"y",
".",
"getEnd",
"(",
")",
")",
";",
"}"
] | Comparator, in order to sort MetaData based on the end timestamp.
@param x One of the MetaData to compare.
@param y Another one of the MetaData to compare.
@return Comparator result. | [
"Comparator",
"in",
"order",
"to",
"sort",
"MetaData",
"based",
"on",
"the",
"end",
"timestamp",
"."
] | eb68d72ba4c01fe018dc981097dbee033908f5c7 | https://github.com/groupon/monsoon/blob/eb68d72ba4c01fe018dc981097dbee033908f5c7/history/src/main/java/com/groupon/lex/metrics/history/xdr/TSDataScanDir.java#L186-L188 | train |
groupon/monsoon | history/src/main/java/com/groupon/lex/metrics/history/xdr/TSDataScanDir.java | TSDataScanDir.file_listing_ | private static List<Path> file_listing_(Path dir) throws IOException {
try (Stream<Path> files = Files.list(dir)) {
return files.collect(Collectors.toList());
}
} | java | private static List<Path> file_listing_(Path dir) throws IOException {
try (Stream<Path> files = Files.list(dir)) {
return files.collect(Collectors.toList());
}
} | [
"private",
"static",
"List",
"<",
"Path",
">",
"file_listing_",
"(",
"Path",
"dir",
")",
"throws",
"IOException",
"{",
"try",
"(",
"Stream",
"<",
"Path",
">",
"files",
"=",
"Files",
".",
"list",
"(",
"dir",
")",
")",
"{",
"return",
"files",
".",
"col... | Scan a directory for files. This method reads the entire stream and
closes it immediately.
@param dir The directory to scan for files.
@throws IOException if the directory cannot be listed. | [
"Scan",
"a",
"directory",
"for",
"files",
".",
"This",
"method",
"reads",
"the",
"entire",
"stream",
"and",
"closes",
"it",
"immediately",
"."
] | eb68d72ba4c01fe018dc981097dbee033908f5c7 | https://github.com/groupon/monsoon/blob/eb68d72ba4c01fe018dc981097dbee033908f5c7/history/src/main/java/com/groupon/lex/metrics/history/xdr/TSDataScanDir.java#L208-L212 | train |
groupon/monsoon | history/src/main/java/com/groupon/lex/metrics/history/xdr/TSDataScanDir.java | TSDataScanDir.filterUpgradable | public TSDataScanDir filterUpgradable() {
return new TSDataScanDir(getDir(), getFiles().stream().filter(MetaData::isUpgradable).collect(Collectors.toList()));
} | java | public TSDataScanDir filterUpgradable() {
return new TSDataScanDir(getDir(), getFiles().stream().filter(MetaData::isUpgradable).collect(Collectors.toList()));
} | [
"public",
"TSDataScanDir",
"filterUpgradable",
"(",
")",
"{",
"return",
"new",
"TSDataScanDir",
"(",
"getDir",
"(",
")",
",",
"getFiles",
"(",
")",
".",
"stream",
"(",
")",
".",
"filter",
"(",
"MetaData",
"::",
"isUpgradable",
")",
".",
"collect",
"(",
"... | Filter the list of files to contain only upgradable files.
Note that the current instance is untouched and a new instance is
returned.
@return A new instance of TSDataScanDir, describing only files that are
upgradable. | [
"Filter",
"the",
"list",
"of",
"files",
"to",
"contain",
"only",
"upgradable",
"files",
"."
] | eb68d72ba4c01fe018dc981097dbee033908f5c7 | https://github.com/groupon/monsoon/blob/eb68d72ba4c01fe018dc981097dbee033908f5c7/history/src/main/java/com/groupon/lex/metrics/history/xdr/TSDataScanDir.java#L251-L253 | train |
threerings/nenya | core/src/main/java/com/threerings/media/animation/ExplodeAnimation.java | ExplodeAnimation.init | protected void init (ExplodeInfo info, int x, int y, int width, int height)
{
_info = info;
_ox = x;
_oy = y;
_owid = width;
_ohei = height;
_info.rvel = (float)((2.0f * Math.PI) * _info.rvel);
_chunkcount = (_info.xchunk * _info.ychunk);
_cxpos = new... | java | protected void init (ExplodeInfo info, int x, int y, int width, int height)
{
_info = info;
_ox = x;
_oy = y;
_owid = width;
_ohei = height;
_info.rvel = (float)((2.0f * Math.PI) * _info.rvel);
_chunkcount = (_info.xchunk * _info.ychunk);
_cxpos = new... | [
"protected",
"void",
"init",
"(",
"ExplodeInfo",
"info",
",",
"int",
"x",
",",
"int",
"y",
",",
"int",
"width",
",",
"int",
"height",
")",
"{",
"_info",
"=",
"info",
";",
"_ox",
"=",
"x",
";",
"_oy",
"=",
"y",
";",
"_owid",
"=",
"width",
";",
"... | Initializes the animation with the attributes of the given explode info object. | [
"Initializes",
"the",
"animation",
"with",
"the",
"attributes",
"of",
"the",
"given",
"explode",
"info",
"object",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/animation/ExplodeAnimation.java#L112-L149 | train |
groupon/monsoon | intf/src/main/java/com/groupon/lex/metrics/MetricValue.java | MetricValue.fromNumberValue | public static MetricValue fromNumberValue(Number number) {
if (number == null) {
return EMPTY;
} else if (number instanceof Float || number instanceof Double) {
return fromDblValue(number.doubleValue());
} else if (number instanceof Byte || number instanceof Short || numb... | java | public static MetricValue fromNumberValue(Number number) {
if (number == null) {
return EMPTY;
} else if (number instanceof Float || number instanceof Double) {
return fromDblValue(number.doubleValue());
} else if (number instanceof Byte || number instanceof Short || numb... | [
"public",
"static",
"MetricValue",
"fromNumberValue",
"(",
"Number",
"number",
")",
"{",
"if",
"(",
"number",
"==",
"null",
")",
"{",
"return",
"EMPTY",
";",
"}",
"else",
"if",
"(",
"number",
"instanceof",
"Float",
"||",
"number",
"instanceof",
"Double",
"... | Construct a metric value from a Number implementation.
@param number A floating point or integral type.
@return a MetricValue holding the specified number.
@throws IllegalArgumentException if the derived type of Number is not recognized. | [
"Construct",
"a",
"metric",
"value",
"from",
"a",
"Number",
"implementation",
"."
] | eb68d72ba4c01fe018dc981097dbee033908f5c7 | https://github.com/groupon/monsoon/blob/eb68d72ba4c01fe018dc981097dbee033908f5c7/intf/src/main/java/com/groupon/lex/metrics/MetricValue.java#L75-L85 | train |
threerings/nenya | core/src/main/java/com/threerings/media/animation/AnimationArranger.java | AnimationArranger.positionAvoidAnimation | public void positionAvoidAnimation (Animation anim, Rectangle viewBounds)
{
Rectangle abounds = new Rectangle(anim.getBounds());
@SuppressWarnings("unchecked") ArrayList<Animation> avoidables =
(ArrayList<Animation>) _avoidAnims.clone();
// if we are able to place it somewhere, d... | java | public void positionAvoidAnimation (Animation anim, Rectangle viewBounds)
{
Rectangle abounds = new Rectangle(anim.getBounds());
@SuppressWarnings("unchecked") ArrayList<Animation> avoidables =
(ArrayList<Animation>) _avoidAnims.clone();
// if we are able to place it somewhere, d... | [
"public",
"void",
"positionAvoidAnimation",
"(",
"Animation",
"anim",
",",
"Rectangle",
"viewBounds",
")",
"{",
"Rectangle",
"abounds",
"=",
"new",
"Rectangle",
"(",
"anim",
".",
"getBounds",
"(",
")",
")",
";",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
"... | Position the specified animation so that it is not overlapping
any still-running animations previously passed to this method. | [
"Position",
"the",
"specified",
"animation",
"so",
"that",
"it",
"is",
"not",
"overlapping",
"any",
"still",
"-",
"running",
"animations",
"previously",
"passed",
"to",
"this",
"method",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/animation/AnimationArranger.java#L41-L55 | train |
threerings/nenya | core/src/main/java/com/threerings/media/RegionManager.java | RegionManager.invalidateRegion | public void invalidateRegion (int x, int y, int width, int height)
{
if (isValidSize(width, height)) {
addDirtyRegion(new Rectangle(x, y, width, height));
}
} | java | public void invalidateRegion (int x, int y, int width, int height)
{
if (isValidSize(width, height)) {
addDirtyRegion(new Rectangle(x, y, width, height));
}
} | [
"public",
"void",
"invalidateRegion",
"(",
"int",
"x",
",",
"int",
"y",
",",
"int",
"width",
",",
"int",
"height",
")",
"{",
"if",
"(",
"isValidSize",
"(",
"width",
",",
"height",
")",
")",
"{",
"addDirtyRegion",
"(",
"new",
"Rectangle",
"(",
"x",
",... | Invalidates the specified region. | [
"Invalidates",
"the",
"specified",
"region",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/RegionManager.java#L40-L45 | train |
threerings/nenya | core/src/main/java/com/threerings/media/RegionManager.java | RegionManager.isValidSize | protected final boolean isValidSize (int width, int height)
{
if (width < 0 || height < 0) {
log.warning("Attempt to add invalid dirty region?!",
"size", (width + "x" + height), new Exception());
return false;
} else if (width == 0 || height == 0) {
... | java | protected final boolean isValidSize (int width, int height)
{
if (width < 0 || height < 0) {
log.warning("Attempt to add invalid dirty region?!",
"size", (width + "x" + height), new Exception());
return false;
} else if (width == 0 || height == 0) {
... | [
"protected",
"final",
"boolean",
"isValidSize",
"(",
"int",
"width",
",",
"int",
"height",
")",
"{",
"if",
"(",
"width",
"<",
"0",
"||",
"height",
"<",
"0",
")",
"{",
"log",
".",
"warning",
"(",
"\"Attempt to add invalid dirty region?!\"",
",",
"\"size\"",
... | Used to ensure our dirty regions are not invalid. | [
"Used",
"to",
"ensure",
"our",
"dirty",
"regions",
"are",
"not",
"invalid",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/RegionManager.java#L90-L104 | train |
threerings/nenya | core/src/main/java/com/threerings/media/RegionManager.java | RegionManager.getDirtyRegions | public Rectangle[] getDirtyRegions ()
{
List<Rectangle> merged = Lists.newArrayList();
for (int ii = _dirty.size() - 1; ii >= 0; ii--) {
// pop the next rectangle from the dirty list
Rectangle mr = _dirty.remove(ii);
// merge in any overlapping rectangles
... | java | public Rectangle[] getDirtyRegions ()
{
List<Rectangle> merged = Lists.newArrayList();
for (int ii = _dirty.size() - 1; ii >= 0; ii--) {
// pop the next rectangle from the dirty list
Rectangle mr = _dirty.remove(ii);
// merge in any overlapping rectangles
... | [
"public",
"Rectangle",
"[",
"]",
"getDirtyRegions",
"(",
")",
"{",
"List",
"<",
"Rectangle",
">",
"merged",
"=",
"Lists",
".",
"newArrayList",
"(",
")",
";",
"for",
"(",
"int",
"ii",
"=",
"_dirty",
".",
"size",
"(",
")",
"-",
"1",
";",
"ii",
">=",
... | Merges all outstanding dirty regions into a single list of rectangles and returns that to
the caller. Internally, the list of accumulated dirty regions is cleared out and prepared
for the next frame. | [
"Merges",
"all",
"outstanding",
"dirty",
"regions",
"into",
"a",
"single",
"list",
"of",
"rectangles",
"and",
"returns",
"that",
"to",
"the",
"caller",
".",
"Internally",
"the",
"list",
"of",
"accumulated",
"dirty",
"regions",
"is",
"cleared",
"out",
"and",
... | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/RegionManager.java#L130-L155 | train |
groupon/monsoon | intf/src/main/java/com/groupon/lex/metrics/lib/StringTemplate.java | StringTemplate.getArguments | public List<Any2<Integer, String>> getArguments() {
final List<Any2<Integer, String>> result = new ArrayList<>();
elements_.forEach(elem -> elem.keys(result::add));
return result;
} | java | public List<Any2<Integer, String>> getArguments() {
final List<Any2<Integer, String>> result = new ArrayList<>();
elements_.forEach(elem -> elem.keys(result::add));
return result;
} | [
"public",
"List",
"<",
"Any2",
"<",
"Integer",
",",
"String",
">",
">",
"getArguments",
"(",
")",
"{",
"final",
"List",
"<",
"Any2",
"<",
"Integer",
",",
"String",
">",
">",
"result",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"elements_",
".",
... | Retrieve the variables used to render this string.
@return The list of variables used to render this string. | [
"Retrieve",
"the",
"variables",
"used",
"to",
"render",
"this",
"string",
"."
] | eb68d72ba4c01fe018dc981097dbee033908f5c7 | https://github.com/groupon/monsoon/blob/eb68d72ba4c01fe018dc981097dbee033908f5c7/intf/src/main/java/com/groupon/lex/metrics/lib/StringTemplate.java#L210-L214 | train |
threerings/nenya | core/src/main/java/com/threerings/media/tile/TrimmedObjectTileSet.java | TrimmedObjectTileSet.hasConstraint | public boolean hasConstraint (int tileIdx, String constraint)
{
return (_bits == null || _bits[tileIdx].constraints == null) ? false :
ListUtil.contains(_bits[tileIdx].constraints, constraint);
} | java | public boolean hasConstraint (int tileIdx, String constraint)
{
return (_bits == null || _bits[tileIdx].constraints == null) ? false :
ListUtil.contains(_bits[tileIdx].constraints, constraint);
} | [
"public",
"boolean",
"hasConstraint",
"(",
"int",
"tileIdx",
",",
"String",
"constraint",
")",
"{",
"return",
"(",
"_bits",
"==",
"null",
"||",
"_bits",
"[",
"tileIdx",
"]",
".",
"constraints",
"==",
"null",
")",
"?",
"false",
":",
"ListUtil",
".",
"cont... | Checks whether the tile at the specified index has the given constraint. | [
"Checks",
"whether",
"the",
"tile",
"at",
"the",
"specified",
"index",
"has",
"the",
"given",
"constraint",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/tile/TrimmedObjectTileSet.java#L96-L100 | train |
threerings/nenya | core/src/main/java/com/threerings/media/tile/TrimmedObjectTileSet.java | TrimmedObjectTileSet.trimObjectTileSet | public static TrimmedObjectTileSet trimObjectTileSet (
ObjectTileSet source, OutputStream destImage)
throws IOException
{
return trimObjectTileSet(source, destImage, FastImageIO.FILE_SUFFIX);
} | java | public static TrimmedObjectTileSet trimObjectTileSet (
ObjectTileSet source, OutputStream destImage)
throws IOException
{
return trimObjectTileSet(source, destImage, FastImageIO.FILE_SUFFIX);
} | [
"public",
"static",
"TrimmedObjectTileSet",
"trimObjectTileSet",
"(",
"ObjectTileSet",
"source",
",",
"OutputStream",
"destImage",
")",
"throws",
"IOException",
"{",
"return",
"trimObjectTileSet",
"(",
"source",
",",
"destImage",
",",
"FastImageIO",
".",
"FILE_SUFFIX",
... | Convenience function to trim the tile set to a file using FastImageIO. | [
"Convenience",
"function",
"to",
"trim",
"the",
"tile",
"set",
"to",
"a",
"file",
"using",
"FastImageIO",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/tile/TrimmedObjectTileSet.java#L174-L179 | train |
threerings/nenya | core/src/main/java/com/threerings/media/AbstractMedia.java | AbstractMedia.renderCompareTo | public int renderCompareTo (AbstractMedia other)
{
int result = Ints.compare(_renderOrder, other._renderOrder);
return (result != 0) ? result : naturalCompareTo(other);
} | java | public int renderCompareTo (AbstractMedia other)
{
int result = Ints.compare(_renderOrder, other._renderOrder);
return (result != 0) ? result : naturalCompareTo(other);
} | [
"public",
"int",
"renderCompareTo",
"(",
"AbstractMedia",
"other",
")",
"{",
"int",
"result",
"=",
"Ints",
".",
"compare",
"(",
"_renderOrder",
",",
"other",
".",
"_renderOrder",
")",
";",
"return",
"(",
"result",
"!=",
"0",
")",
"?",
"result",
":",
"nat... | Compares this media to the specified media by render order. | [
"Compares",
"this",
"media",
"to",
"the",
"specified",
"media",
"by",
"render",
"order",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/AbstractMedia.java#L167-L171 | train |
threerings/nenya | core/src/main/java/com/threerings/media/AbstractMedia.java | AbstractMedia.queueNotification | public void queueNotification (ObserverList.ObserverOp<Object> amop)
{
if (_observers != null) {
if (_mgr != null) {
_mgr.queueNotification(_observers, amop);
} else {
log.warning("Have no manager, dropping notification", "media", this, "op", amop);
... | java | public void queueNotification (ObserverList.ObserverOp<Object> amop)
{
if (_observers != null) {
if (_mgr != null) {
_mgr.queueNotification(_observers, amop);
} else {
log.warning("Have no manager, dropping notification", "media", this, "op", amop);
... | [
"public",
"void",
"queueNotification",
"(",
"ObserverList",
".",
"ObserverOp",
"<",
"Object",
">",
"amop",
")",
"{",
"if",
"(",
"_observers",
"!=",
"null",
")",
"{",
"if",
"(",
"_mgr",
"!=",
"null",
")",
"{",
"_mgr",
".",
"queueNotification",
"(",
"_obse... | Queues the supplied notification up to be dispatched to this abstract media's observers. | [
"Queues",
"the",
"supplied",
"notification",
"up",
"to",
"be",
"dispatched",
"to",
"this",
"abstract",
"media",
"s",
"observers",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/AbstractMedia.java#L205-L214 | train |
threerings/nenya | core/src/main/java/com/threerings/media/AbstractMedia.java | AbstractMedia.addObserver | protected void addObserver (Object obs)
{
if (_observers == null) {
_observers = ObserverList.newFastUnsafe();
}
_observers.add(obs);
} | java | protected void addObserver (Object obs)
{
if (_observers == null) {
_observers = ObserverList.newFastUnsafe();
}
_observers.add(obs);
} | [
"protected",
"void",
"addObserver",
"(",
"Object",
"obs",
")",
"{",
"if",
"(",
"_observers",
"==",
"null",
")",
"{",
"_observers",
"=",
"ObserverList",
".",
"newFastUnsafe",
"(",
")",
";",
"}",
"_observers",
".",
"add",
"(",
"obs",
")",
";",
"}"
] | Add the specified observer to this media element. | [
"Add",
"the",
"specified",
"observer",
"to",
"this",
"media",
"element",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/AbstractMedia.java#L314-L320 | train |
kaazing/java.client | bridge/src/main/java/org/kaazing/gateway/bridge/CrossOriginProxy.java | CrossOriginProxy.dispatchEvent | private void dispatchEvent(XoaEvent event) {
LOG.entering(CLASS_NAME, "dispatchEvent", event);
try {
Integer handlerId = event.getHandlerId();
XoaEventKind eventKind = event.getEvent();
if (LOG.isLoggable(Level.FINEST)) {
LOG.fine... | java | private void dispatchEvent(XoaEvent event) {
LOG.entering(CLASS_NAME, "dispatchEvent", event);
try {
Integer handlerId = event.getHandlerId();
XoaEventKind eventKind = event.getEvent();
if (LOG.isLoggable(Level.FINEST)) {
LOG.fine... | [
"private",
"void",
"dispatchEvent",
"(",
"XoaEvent",
"event",
")",
"{",
"LOG",
".",
"entering",
"(",
"CLASS_NAME",
",",
"\"dispatchEvent\"",
",",
"event",
")",
";",
"try",
"{",
"Integer",
"handlerId",
"=",
"event",
".",
"getHandlerId",
"(",
")",
";",
"XoaE... | Dispatch an event to Source Origin
@param event | [
"Dispatch",
"an",
"event",
"to",
"Source",
"Origin"
] | 25ad2ae5bb24aa9d6b79400fce649b518dcfbe26 | https://github.com/kaazing/java.client/blob/25ad2ae5bb24aa9d6b79400fce649b518dcfbe26/bridge/src/main/java/org/kaazing/gateway/bridge/CrossOriginProxy.java#L140-L171 | train |
threerings/nenya | core/src/main/java/com/threerings/media/util/BobblePath.java | BobblePath.setVariance | public void setVariance (int dx, int dy)
{
if ((dx < 0) || (dy < 0) || ((dx == 0) && (dy == 0))) {
throw new IllegalArgumentException(
"Variance values must be positive, and at least one must be non-zero.");
} else {
_dx = dx;
_dy = dy;
}
... | java | public void setVariance (int dx, int dy)
{
if ((dx < 0) || (dy < 0) || ((dx == 0) && (dy == 0))) {
throw new IllegalArgumentException(
"Variance values must be positive, and at least one must be non-zero.");
} else {
_dx = dx;
_dy = dy;
}
... | [
"public",
"void",
"setVariance",
"(",
"int",
"dx",
",",
"int",
"dy",
")",
"{",
"if",
"(",
"(",
"dx",
"<",
"0",
")",
"||",
"(",
"dy",
"<",
"0",
")",
"||",
"(",
"(",
"dx",
"==",
"0",
")",
"&&",
"(",
"dy",
"==",
"0",
")",
")",
")",
"{",
"t... | Set the variance of bobblin' in each direction. | [
"Set",
"the",
"variance",
"of",
"bobblin",
"in",
"each",
"direction",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/util/BobblePath.java#L62-L71 | train |
threerings/nenya | core/src/main/java/com/threerings/media/util/BobblePath.java | BobblePath.updatePositionTo | protected boolean updatePositionTo (Pathable pable, int x, int y)
{
if ((pable.getX() == x) && (pable.getY() == y)) {
return false;
} else {
pable.setLocation(x, y);
return true;
}
} | java | protected boolean updatePositionTo (Pathable pable, int x, int y)
{
if ((pable.getX() == x) && (pable.getY() == y)) {
return false;
} else {
pable.setLocation(x, y);
return true;
}
} | [
"protected",
"boolean",
"updatePositionTo",
"(",
"Pathable",
"pable",
",",
"int",
"x",
",",
"int",
"y",
")",
"{",
"if",
"(",
"(",
"pable",
".",
"getX",
"(",
")",
"==",
"x",
")",
"&&",
"(",
"pable",
".",
"getY",
"(",
")",
"==",
"y",
")",
")",
"{... | Update the position of the pathable or return false if it's already there. | [
"Update",
"the",
"position",
"of",
"the",
"pathable",
"or",
"return",
"false",
"if",
"it",
"s",
"already",
"there",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/util/BobblePath.java#L156-L164 | train |
threerings/nenya | core/src/main/java/com/threerings/media/util/ModeUtil.java | ModeUtil.getDisplayMode | public static DisplayMode getDisplayMode (
GraphicsDevice gd, int width, int height, int desiredDepth, int minimumDepth)
{
DisplayMode[] modes = gd.getDisplayModes();
final int ddepth = desiredDepth;
// we sort modes in order of desirability
Comparator<DisplayMode> mcomp = n... | java | public static DisplayMode getDisplayMode (
GraphicsDevice gd, int width, int height, int desiredDepth, int minimumDepth)
{
DisplayMode[] modes = gd.getDisplayModes();
final int ddepth = desiredDepth;
// we sort modes in order of desirability
Comparator<DisplayMode> mcomp = n... | [
"public",
"static",
"DisplayMode",
"getDisplayMode",
"(",
"GraphicsDevice",
"gd",
",",
"int",
"width",
",",
"int",
"height",
",",
"int",
"desiredDepth",
",",
"int",
"minimumDepth",
")",
"{",
"DisplayMode",
"[",
"]",
"modes",
"=",
"gd",
".",
"getDisplayModes",
... | Gets a display mode that matches the specified parameters. The
screen resolution must match the specified resolution exactly, the
specified desired depth will be used if it is available, and if
not, the highest depth greater than or equal to the specified
minimum depth is used. The highest refresh rate available for th... | [
"Gets",
"a",
"display",
"mode",
"that",
"matches",
"the",
"specified",
"parameters",
".",
"The",
"screen",
"resolution",
"must",
"match",
"the",
"specified",
"resolution",
"exactly",
"the",
"specified",
"desired",
"depth",
"will",
"be",
"used",
"if",
"it",
"is... | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/util/ModeUtil.java#L41-L82 | train |
threerings/nenya | core/src/main/java/com/threerings/cast/util/CastUtil.java | CastUtil.getRandomDescriptor | public static CharacterDescriptor getRandomDescriptor (
ComponentRepository crepo, String gender, String[] COMP_CLASSES,
ColorPository cpos, String[] COLOR_CLASSES)
{
// get all available classes
ArrayList<ComponentClass> classes = Lists.newArrayList();
for (String element : ... | java | public static CharacterDescriptor getRandomDescriptor (
ComponentRepository crepo, String gender, String[] COMP_CLASSES,
ColorPository cpos, String[] COLOR_CLASSES)
{
// get all available classes
ArrayList<ComponentClass> classes = Lists.newArrayList();
for (String element : ... | [
"public",
"static",
"CharacterDescriptor",
"getRandomDescriptor",
"(",
"ComponentRepository",
"crepo",
",",
"String",
"gender",
",",
"String",
"[",
"]",
"COMP_CLASSES",
",",
"ColorPository",
"cpos",
",",
"String",
"[",
"]",
"COLOR_CLASSES",
")",
"{",
"// get all ava... | Returns a new character descriptor populated with a random set of components. | [
"Returns",
"a",
"new",
"character",
"descriptor",
"populated",
"with",
"a",
"random",
"set",
"of",
"components",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/cast/util/CastUtil.java#L47-L104 | train |
groupon/monsoon | history/src/main/java/com/groupon/lex/metrics/history/xdr/TSDataOptimizerTask.java | TSDataOptimizerTask.run | public CompletableFuture<NewFile> run() {
LOG.log(Level.FINE, "starting optimized file creation for {0} files", files.size());
CompletableFuture<NewFile> fileCreation = new CompletableFuture<>();
final List<TSData> fjpFiles = this.files; // We clear out files below, which makes createTmpFile se... | java | public CompletableFuture<NewFile> run() {
LOG.log(Level.FINE, "starting optimized file creation for {0} files", files.size());
CompletableFuture<NewFile> fileCreation = new CompletableFuture<>();
final List<TSData> fjpFiles = this.files; // We clear out files below, which makes createTmpFile se... | [
"public",
"CompletableFuture",
"<",
"NewFile",
">",
"run",
"(",
")",
"{",
"LOG",
".",
"log",
"(",
"Level",
".",
"FINE",
",",
"\"starting optimized file creation for {0} files\"",
",",
"files",
".",
"size",
"(",
")",
")",
";",
"CompletableFuture",
"<",
"NewFile... | Start creating the optimized file. This operation resets the state of the
optimizer task, so it can be re-used for subsequent invocations.
@return A completeable future that yields the newly created file. | [
"Start",
"creating",
"the",
"optimized",
"file",
".",
"This",
"operation",
"resets",
"the",
"state",
"of",
"the",
"optimizer",
"task",
"so",
"it",
"can",
"be",
"re",
"-",
"used",
"for",
"subsequent",
"invocations",
"."
] | eb68d72ba4c01fe018dc981097dbee033908f5c7 | https://github.com/groupon/monsoon/blob/eb68d72ba4c01fe018dc981097dbee033908f5c7/history/src/main/java/com/groupon/lex/metrics/history/xdr/TSDataOptimizerTask.java#L186-L196 | train |
groupon/monsoon | history/src/main/java/com/groupon/lex/metrics/history/xdr/TSDataOptimizerTask.java | TSDataOptimizerTask.createTmpFile | private static void createTmpFile(CompletableFuture<NewFile> fileCreation, Path destDir, List<TSData> files, Compression compression) {
LOG.log(Level.FINE, "starting temporary file creation...");
try {
Collections.sort(files, Comparator.comparing(TSData::getBegin));
final FileC... | java | private static void createTmpFile(CompletableFuture<NewFile> fileCreation, Path destDir, List<TSData> files, Compression compression) {
LOG.log(Level.FINE, "starting temporary file creation...");
try {
Collections.sort(files, Comparator.comparing(TSData::getBegin));
final FileC... | [
"private",
"static",
"void",
"createTmpFile",
"(",
"CompletableFuture",
"<",
"NewFile",
">",
"fileCreation",
",",
"Path",
"destDir",
",",
"List",
"<",
"TSData",
">",
"files",
",",
"Compression",
"compression",
")",
"{",
"LOG",
".",
"log",
"(",
"Level",
".",
... | The fork-join task that creates a new file. This function creates a
temporary file with the result contents, then passes it on to the install
thread which will put the final file in place.
@param fileCreation the future that is to be completed after the
operation.
@param destDir the destination directory for the resul... | [
"The",
"fork",
"-",
"join",
"task",
"that",
"creates",
"a",
"new",
"file",
".",
"This",
"function",
"creates",
"a",
"temporary",
"file",
"with",
"the",
"result",
"contents",
"then",
"passes",
"it",
"on",
"to",
"the",
"install",
"thread",
"which",
"will",
... | eb68d72ba4c01fe018dc981097dbee033908f5c7 | https://github.com/groupon/monsoon/blob/eb68d72ba4c01fe018dc981097dbee033908f5c7/history/src/main/java/com/groupon/lex/metrics/history/xdr/TSDataOptimizerTask.java#L209-L251 | train |
groupon/monsoon | history/src/main/java/com/groupon/lex/metrics/history/xdr/TSDataOptimizerTask.java | TSDataOptimizerTask.install | private static void install(CompletableFuture<NewFile> fileCreation, Path destDir, FileChannel tmpFile, DateTime begin) {
try {
try {
synchronized (OUTSTANDING) {
OUTSTANDING.remove(fileCreation);
}
if (fileCreation.isCancelled())
... | java | private static void install(CompletableFuture<NewFile> fileCreation, Path destDir, FileChannel tmpFile, DateTime begin) {
try {
try {
synchronized (OUTSTANDING) {
OUTSTANDING.remove(fileCreation);
}
if (fileCreation.isCancelled())
... | [
"private",
"static",
"void",
"install",
"(",
"CompletableFuture",
"<",
"NewFile",
">",
"fileCreation",
",",
"Path",
"destDir",
",",
"FileChannel",
"tmpFile",
",",
"DateTime",
"begin",
")",
"{",
"try",
"{",
"try",
"{",
"synchronized",
"(",
"OUTSTANDING",
")",
... | Installs the newly created file. This function runs on the install thread
and essentially performs a copy-operation from the temporary file to the
final file.
@param fileCreation the completeable future that receives the newly
created file.
@param destDir the destination directory in which to install the result
file.
... | [
"Installs",
"the",
"newly",
"created",
"file",
".",
"This",
"function",
"runs",
"on",
"the",
"install",
"thread",
"and",
"essentially",
"performs",
"a",
"copy",
"-",
"operation",
"from",
"the",
"temporary",
"file",
"to",
"the",
"final",
"file",
"."
] | eb68d72ba4c01fe018dc981097dbee033908f5c7 | https://github.com/groupon/monsoon/blob/eb68d72ba4c01fe018dc981097dbee033908f5c7/history/src/main/java/com/groupon/lex/metrics/history/xdr/TSDataOptimizerTask.java#L267-L306 | train |
groupon/monsoon | history/src/main/java/com/groupon/lex/metrics/history/xdr/TSDataOptimizerTask.java | TSDataOptimizerTask.prefixForTimestamp | private static String prefixForTimestamp(DateTime timestamp) {
return String.format("monsoon-%04d%02d%02d-%02d%02d", timestamp.getYear(), timestamp.getMonthOfYear(), timestamp.getDayOfMonth(), timestamp.getHourOfDay(), timestamp.getMinuteOfHour());
} | java | private static String prefixForTimestamp(DateTime timestamp) {
return String.format("monsoon-%04d%02d%02d-%02d%02d", timestamp.getYear(), timestamp.getMonthOfYear(), timestamp.getDayOfMonth(), timestamp.getHourOfDay(), timestamp.getMinuteOfHour());
} | [
"private",
"static",
"String",
"prefixForTimestamp",
"(",
"DateTime",
"timestamp",
")",
"{",
"return",
"String",
".",
"format",
"(",
"\"monsoon-%04d%02d%02d-%02d%02d\"",
",",
"timestamp",
".",
"getYear",
"(",
")",
",",
"timestamp",
".",
"getMonthOfYear",
"(",
")",... | Compute a prefix for a to-be-installed file.
@param timestamp the timestamp on which to base the prefix.
@return a file prefix that represents the timestamp in its name. | [
"Compute",
"a",
"prefix",
"for",
"a",
"to",
"-",
"be",
"-",
"installed",
"file",
"."
] | eb68d72ba4c01fe018dc981097dbee033908f5c7 | https://github.com/groupon/monsoon/blob/eb68d72ba4c01fe018dc981097dbee033908f5c7/history/src/main/java/com/groupon/lex/metrics/history/xdr/TSDataOptimizerTask.java#L314-L316 | train |
jboss/jboss-jsp-api_spec | src/main/java/javax/servlet/jsp/PageContext.java | PageContext.getErrorData | public ErrorData getErrorData() {
return new ErrorData(
(Throwable)getRequest().getAttribute( "javax.servlet.error.exception" ),
((Integer)getRequest().getAttribute(
"javax.servlet.error.status_code" )).intValue(),
(String)getRequest().getAttribute( "javax.servlet.error.request_uri" ),
(String)... | java | public ErrorData getErrorData() {
return new ErrorData(
(Throwable)getRequest().getAttribute( "javax.servlet.error.exception" ),
((Integer)getRequest().getAttribute(
"javax.servlet.error.status_code" )).intValue(),
(String)getRequest().getAttribute( "javax.servlet.error.request_uri" ),
(String)... | [
"public",
"ErrorData",
"getErrorData",
"(",
")",
"{",
"return",
"new",
"ErrorData",
"(",
"(",
"Throwable",
")",
"getRequest",
"(",
")",
".",
"getAttribute",
"(",
"\"javax.servlet.error.exception\"",
")",
",",
"(",
"(",
"Integer",
")",
"getRequest",
"(",
")",
... | Provides convenient access to error information.
@return an ErrorData instance containing information about the
error, as obtained from the request attributes, as per the
Servlet specification. If this is not an error page (that is,
if the isErrorPage attribute of the page directive is not set
to "true"), the informa... | [
"Provides",
"convenient",
"access",
"to",
"error",
"information",
"."
] | da53166619f33a5134dc3315a3264990cc1f541f | https://github.com/jboss/jboss-jsp-api_spec/blob/da53166619f33a5134dc3315a3264990cc1f541f/src/main/java/javax/servlet/jsp/PageContext.java#L551-L558 | train |
groupon/robo-remote | RoboRemoteClientCommon/src/main/com/groupon/roboremote/roboremoteclientcommon/Device.java | Device.storeLogs | public static void storeLogs(String sourceLogFileName, String destLogFileName) throws Exception {
// assumes eventmanager is running
// store logs
String tmpdir = System.getProperty("java.io.tmpdir");
if (tmpdir == null || tmpdir == "null") {
tmpdir = "/tmp";
}
F... | java | public static void storeLogs(String sourceLogFileName, String destLogFileName) throws Exception {
// assumes eventmanager is running
// store logs
String tmpdir = System.getProperty("java.io.tmpdir");
if (tmpdir == null || tmpdir == "null") {
tmpdir = "/tmp";
}
F... | [
"public",
"static",
"void",
"storeLogs",
"(",
"String",
"sourceLogFileName",
",",
"String",
"destLogFileName",
")",
"throws",
"Exception",
"{",
"// assumes eventmanager is running",
"// store logs",
"String",
"tmpdir",
"=",
"System",
".",
"getProperty",
"(",
"\"java.io.... | Stores the specified log for this test
@throws Exception | [
"Stores",
"the",
"specified",
"log",
"for",
"this",
"test"
] | 12d242faad50bf90f98657ca9a0c0c3ae1993f07 | https://github.com/groupon/robo-remote/blob/12d242faad50bf90f98657ca9a0c0c3ae1993f07/RoboRemoteClientCommon/src/main/com/groupon/roboremote/roboremoteclientcommon/Device.java#L61-L72 | train |
threerings/nenya | core/src/main/java/com/threerings/cast/builder/ClassEditor.java | ClassEditor.setSelectedComponent | protected void setSelectedComponent (int idx)
{
int cid = _components.get(idx).intValue();
_model.setSelectedComponent(_cclass, cid);
} | java | protected void setSelectedComponent (int idx)
{
int cid = _components.get(idx).intValue();
_model.setSelectedComponent(_cclass, cid);
} | [
"protected",
"void",
"setSelectedComponent",
"(",
"int",
"idx",
")",
"{",
"int",
"cid",
"=",
"_components",
".",
"get",
"(",
"idx",
")",
".",
"intValue",
"(",
")",
";",
"_model",
".",
"setSelectedComponent",
"(",
"_cclass",
",",
"cid",
")",
";",
"}"
] | Sets the selected component in the builder model for the
component class associated with this editor to the component at
the given index in this editor's list of available components. | [
"Sets",
"the",
"selected",
"component",
"in",
"the",
"builder",
"model",
"for",
"the",
"component",
"class",
"associated",
"with",
"this",
"editor",
"to",
"the",
"component",
"at",
"the",
"given",
"index",
"in",
"this",
"editor",
"s",
"list",
"of",
"availabl... | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/cast/builder/ClassEditor.java#L91-L95 | train |
kaazing/java.client | amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/ChannelEvent.java | ChannelEvent.isFlowActive | public boolean isFlowActive() {
Object val = this.getArgument("active");
if (val instanceof Integer) {
return ((Integer)val).intValue() == 1;
}
else {
throw new IllegalStateException("ChannelEvent does not contain the 'active' argument");
}
} | java | public boolean isFlowActive() {
Object val = this.getArgument("active");
if (val instanceof Integer) {
return ((Integer)val).intValue() == 1;
}
else {
throw new IllegalStateException("ChannelEvent does not contain the 'active' argument");
}
} | [
"public",
"boolean",
"isFlowActive",
"(",
")",
"{",
"Object",
"val",
"=",
"this",
".",
"getArgument",
"(",
"\"active\"",
")",
";",
"if",
"(",
"val",
"instanceof",
"Integer",
")",
"{",
"return",
"(",
"(",
"Integer",
")",
"val",
")",
".",
"intValue",
"("... | Returns For flow events, returns true if flow is active
@return boolean true if event specifies flow is active
@throws IllegalStateException if this event is not a flow event | [
"Returns",
"For",
"flow",
"events",
"returns",
"true",
"if",
"flow",
"is",
"active"
] | 25ad2ae5bb24aa9d6b79400fce649b518dcfbe26 | https://github.com/kaazing/java.client/blob/25ad2ae5bb24aa9d6b79400fce649b518dcfbe26/amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/ChannelEvent.java#L219-L227 | train |
stephenc/redmine-java-api | src/main/java/org/redmine/ta/internal/RedmineJSONBuilder.java | RedmineJSONBuilder.writeTracker | static void writeTracker(JSONWriter writer, Tracker tracker)
throws JSONException {
writer.key("id");
writer.value(tracker.getId());
writer.key("name");
writer.value(tracker.getName());
} | java | static void writeTracker(JSONWriter writer, Tracker tracker)
throws JSONException {
writer.key("id");
writer.value(tracker.getId());
writer.key("name");
writer.value(tracker.getName());
} | [
"static",
"void",
"writeTracker",
"(",
"JSONWriter",
"writer",
",",
"Tracker",
"tracker",
")",
"throws",
"JSONException",
"{",
"writer",
".",
"key",
"(",
"\"id\"",
")",
";",
"writer",
".",
"value",
"(",
"tracker",
".",
"getId",
"(",
")",
")",
";",
"write... | Writes a tracker.
@param writer
used writer.
@param tracker
tracker to writer.
@throws JSONException
if error occurs. | [
"Writes",
"a",
"tracker",
"."
] | 7e5270c84aba32d74a506260ec47ff86ab6c9d84 | https://github.com/stephenc/redmine-java-api/blob/7e5270c84aba32d74a506260ec47ff86ab6c9d84/src/main/java/org/redmine/ta/internal/RedmineJSONBuilder.java#L161-L167 | train |
stephenc/redmine-java-api | src/main/java/org/redmine/ta/internal/RedmineJSONBuilder.java | RedmineJSONBuilder.addFull | public static void addFull(JSONWriter writer, String field, Date value)
throws JSONException {
final SimpleDateFormat format = RedmineDateUtils.FULL_DATE_FORMAT.get();
JsonOutput.add(writer, field, value, format);
} | java | public static void addFull(JSONWriter writer, String field, Date value)
throws JSONException {
final SimpleDateFormat format = RedmineDateUtils.FULL_DATE_FORMAT.get();
JsonOutput.add(writer, field, value, format);
} | [
"public",
"static",
"void",
"addFull",
"(",
"JSONWriter",
"writer",
",",
"String",
"field",
",",
"Date",
"value",
")",
"throws",
"JSONException",
"{",
"final",
"SimpleDateFormat",
"format",
"=",
"RedmineDateUtils",
".",
"FULL_DATE_FORMAT",
".",
"get",
"(",
")",
... | Adds a value to a writer.
@param writer
writer to add object to.
@param field
field name to set.
@param value
field value.
@throws JSONException
if io error occurs. | [
"Adds",
"a",
"value",
"to",
"a",
"writer",
"."
] | 7e5270c84aba32d74a506260ec47ff86ab6c9d84 | https://github.com/stephenc/redmine-java-api/blob/7e5270c84aba32d74a506260ec47ff86ab6c9d84/src/main/java/org/redmine/ta/internal/RedmineJSONBuilder.java#L383-L387 | train |
groupon/monsoon | lib/src/main/java/com/groupon/lex/metrics/lib/MemoidOne.java | MemoidOne.match_ | private Optional<Data<Input, Output>> match_(Input input) {
return Optional.ofNullable(recent_.get())
.filter((Data<Input, Output> data) -> equality_.test(data.getInput(), input));
} | java | private Optional<Data<Input, Output>> match_(Input input) {
return Optional.ofNullable(recent_.get())
.filter((Data<Input, Output> data) -> equality_.test(data.getInput(), input));
} | [
"private",
"Optional",
"<",
"Data",
"<",
"Input",
",",
"Output",
">",
">",
"match_",
"(",
"Input",
"input",
")",
"{",
"return",
"Optional",
".",
"ofNullable",
"(",
"recent_",
".",
"get",
"(",
")",
")",
".",
"filter",
"(",
"(",
"Data",
"<",
"Input",
... | Try to match an input against the most recent calculation.
@param input The most recent input.
@return An optional Data object, if the input matches the remembered calculation. | [
"Try",
"to",
"match",
"an",
"input",
"against",
"the",
"most",
"recent",
"calculation",
"."
] | eb68d72ba4c01fe018dc981097dbee033908f5c7 | https://github.com/groupon/monsoon/blob/eb68d72ba4c01fe018dc981097dbee033908f5c7/lib/src/main/java/com/groupon/lex/metrics/lib/MemoidOne.java#L93-L96 | train |
groupon/monsoon | lib/src/main/java/com/groupon/lex/metrics/lib/MemoidOne.java | MemoidOne.derive_ | private Data<Input, Output> derive_(Input input) {
Data<Input, Output> result = new Data<>(input, fn_.apply(input));
recent_.set(result);
return result;
} | java | private Data<Input, Output> derive_(Input input) {
Data<Input, Output> result = new Data<>(input, fn_.apply(input));
recent_.set(result);
return result;
} | [
"private",
"Data",
"<",
"Input",
",",
"Output",
">",
"derive_",
"(",
"Input",
"input",
")",
"{",
"Data",
"<",
"Input",
",",
"Output",
">",
"result",
"=",
"new",
"Data",
"<>",
"(",
"input",
",",
"fn_",
".",
"apply",
"(",
"input",
")",
")",
";",
"r... | Derive and remember a calculation.
Future invocations of match_(input) will return the returned Data instance.
@param input The input for the calculation.
@return A data object, holding the result of the calculation. | [
"Derive",
"and",
"remember",
"a",
"calculation",
"."
] | eb68d72ba4c01fe018dc981097dbee033908f5c7 | https://github.com/groupon/monsoon/blob/eb68d72ba4c01fe018dc981097dbee033908f5c7/lib/src/main/java/com/groupon/lex/metrics/lib/MemoidOne.java#L105-L109 | train |
groupon/monsoon | lib/src/main/java/com/groupon/lex/metrics/lib/MemoidOne.java | MemoidOne.apply | @Override
public Output apply(Input input) {
if (input == null) return fn_.apply(input);
return match_(input)
.orElseGet(() -> derive_(input))
.getOutput();
} | java | @Override
public Output apply(Input input) {
if (input == null) return fn_.apply(input);
return match_(input)
.orElseGet(() -> derive_(input))
.getOutput();
} | [
"@",
"Override",
"public",
"Output",
"apply",
"(",
"Input",
"input",
")",
"{",
"if",
"(",
"input",
"==",
"null",
")",
"return",
"fn_",
".",
"apply",
"(",
"input",
")",
";",
"return",
"match_",
"(",
"input",
")",
".",
"orElseGet",
"(",
"(",
")",
"->... | Functional implementation.
The actual calculation will only be performed if the input doesn't match
the input from the most recent invocation.
Null inputs are never remembered.
@param input Argument to the calculation.
@return The output of the calculation. | [
"Functional",
"implementation",
"."
] | eb68d72ba4c01fe018dc981097dbee033908f5c7 | https://github.com/groupon/monsoon/blob/eb68d72ba4c01fe018dc981097dbee033908f5c7/lib/src/main/java/com/groupon/lex/metrics/lib/MemoidOne.java#L121-L127 | train |
threerings/nenya | core/src/main/java/com/threerings/media/TimerView.java | TimerView.setWarning | public void setWarning (float warnPercent, ResultListener<TimerView> warner)
{
// This warning hasn't triggered yet
_warned = false;
// Here are the details
_warnPercent = warnPercent;
_warner = warner;
} | java | public void setWarning (float warnPercent, ResultListener<TimerView> warner)
{
// This warning hasn't triggered yet
_warned = false;
// Here are the details
_warnPercent = warnPercent;
_warner = warner;
} | [
"public",
"void",
"setWarning",
"(",
"float",
"warnPercent",
",",
"ResultListener",
"<",
"TimerView",
">",
"warner",
")",
"{",
"// This warning hasn't triggered yet",
"_warned",
"=",
"false",
";",
"// Here are the details",
"_warnPercent",
"=",
"warnPercent",
";",
"_w... | Setup a warning to trigger after the timer is "warnPercent"
or more completed. If "warner" is non-null, it will be
called at that time. | [
"Setup",
"a",
"warning",
"to",
"trigger",
"after",
"the",
"timer",
"is",
"warnPercent",
"or",
"more",
"completed",
".",
"If",
"warner",
"is",
"non",
"-",
"null",
"it",
"will",
"be",
"called",
"at",
"that",
"time",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/TimerView.java#L93-L101 | train |
threerings/nenya | core/src/main/java/com/threerings/media/TimerView.java | TimerView.start | public void start (float startPercent, long duration, ResultListener<TimerView> finisher)
{
// Sanity check input arguments
if (startPercent < 0.0f || startPercent >= 1.0f) {
throw new IllegalArgumentException(
"Invalid starting percent " + startPercent);
}
... | java | public void start (float startPercent, long duration, ResultListener<TimerView> finisher)
{
// Sanity check input arguments
if (startPercent < 0.0f || startPercent >= 1.0f) {
throw new IllegalArgumentException(
"Invalid starting percent " + startPercent);
}
... | [
"public",
"void",
"start",
"(",
"float",
"startPercent",
",",
"long",
"duration",
",",
"ResultListener",
"<",
"TimerView",
">",
"finisher",
")",
"{",
"// Sanity check input arguments",
"if",
"(",
"startPercent",
"<",
"0.0f",
"||",
"startPercent",
">=",
"1.0f",
"... | Start the timer running from the specified percentage complete,
to expire at the specified time.
@param startPercent a value in [0f, 1f) indicating how much
hourglass time has already elapsed when the timer starts.
@param duration The time interval over which the timer would
run if it started at 0%.
@param finisher a ... | [
"Start",
"the",
"timer",
"running",
"from",
"the",
"specified",
"percentage",
"complete",
"to",
"expire",
"at",
"the",
"specified",
"time",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/TimerView.java#L131-L162 | train |
threerings/nenya | core/src/main/java/com/threerings/media/TimerView.java | TimerView.unpause | public void unpause ()
{
// Don't unpause the timer if it wasn't paused to begin with
if (_lastUpdate == Long.MIN_VALUE || _start == Long.MIN_VALUE) {
return;
}
// Adjust the starting time when the timer next ticks
_processUnpause = true;
// Start things... | java | public void unpause ()
{
// Don't unpause the timer if it wasn't paused to begin with
if (_lastUpdate == Long.MIN_VALUE || _start == Long.MIN_VALUE) {
return;
}
// Adjust the starting time when the timer next ticks
_processUnpause = true;
// Start things... | [
"public",
"void",
"unpause",
"(",
")",
"{",
"// Don't unpause the timer if it wasn't paused to begin with",
"if",
"(",
"_lastUpdate",
"==",
"Long",
".",
"MIN_VALUE",
"||",
"_start",
"==",
"Long",
".",
"MIN_VALUE",
")",
"{",
"return",
";",
"}",
"// Adjust the startin... | Unpause the timer. | [
"Unpause",
"the",
"timer",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/TimerView.java#L200-L212 | train |
threerings/nenya | core/src/main/java/com/threerings/media/TimerView.java | TimerView.changeComplete | public void changeComplete (float complete)
{
// Store the new state
_complete = complete;
// Determine the percentage difference between the "actual"
// completion state and the completion amount to render during
// the smooth interpolation
_renderOffset = _renderCo... | java | public void changeComplete (float complete)
{
// Store the new state
_complete = complete;
// Determine the percentage difference between the "actual"
// completion state and the completion amount to render during
// the smooth interpolation
_renderOffset = _renderCo... | [
"public",
"void",
"changeComplete",
"(",
"float",
"complete",
")",
"{",
"// Store the new state",
"_complete",
"=",
"complete",
";",
"// Determine the percentage difference between the \"actual\"",
"// completion state and the completion amount to render during",
"// the smooth interpo... | Generate an unexpected change in the timer's completion and
set up the necessary details to render interpolation from the old
to new states | [
"Generate",
"an",
"unexpected",
"change",
"in",
"the",
"timer",
"s",
"completion",
"and",
"set",
"up",
"the",
"necessary",
"details",
"to",
"render",
"interpolation",
"from",
"the",
"old",
"to",
"new",
"states"
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/TimerView.java#L219-L232 | train |
threerings/nenya | core/src/main/java/com/threerings/media/TimerView.java | TimerView.invalidate | protected void invalidate ()
{
// Schedule the timer's location on screen to get repainted
_invalidated = true;
_host.repaint(_bounds.x, _bounds.y, _bounds.width, _bounds.height);
} | java | protected void invalidate ()
{
// Schedule the timer's location on screen to get repainted
_invalidated = true;
_host.repaint(_bounds.x, _bounds.y, _bounds.width, _bounds.height);
} | [
"protected",
"void",
"invalidate",
"(",
")",
"{",
"// Schedule the timer's location on screen to get repainted",
"_invalidated",
"=",
"true",
";",
"_host",
".",
"repaint",
"(",
"_bounds",
".",
"x",
",",
"_bounds",
".",
"y",
",",
"_bounds",
".",
"width",
",",
"_b... | Invalidates this view's bounds via the host component. | [
"Invalidates",
"this",
"view",
"s",
"bounds",
"via",
"the",
"host",
"component",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/TimerView.java#L294-L299 | train |
threerings/nenya | core/src/main/java/com/threerings/media/TimerView.java | TimerView.checkFrameParticipation | public void checkFrameParticipation ()
{
// Determine whether or not the timer should participate in
// media ticks
boolean participate = _host.isShowing();
// Start participating if necessary
if (participate && !_participating)
{
_fmgr.registerFrameParti... | java | public void checkFrameParticipation ()
{
// Determine whether or not the timer should participate in
// media ticks
boolean participate = _host.isShowing();
// Start participating if necessary
if (participate && !_participating)
{
_fmgr.registerFrameParti... | [
"public",
"void",
"checkFrameParticipation",
"(",
")",
"{",
"// Determine whether or not the timer should participate in",
"// media ticks",
"boolean",
"participate",
"=",
"_host",
".",
"isShowing",
"(",
")",
";",
"// Start participating if necessary",
"if",
"(",
"participate... | Check that the frame knows about the timer. | [
"Check",
"that",
"the",
"frame",
"knows",
"about",
"the",
"timer",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/TimerView.java#L418-L437 | train |
threerings/nenya | core/src/main/java/com/threerings/media/tile/TileUtil.java | TileUtil.getTileHash | public static int getTileHash (int x, int y)
{
long seed = (((x << 2) ^ y) ^ MULTIPLIER) & MASK;
long hash = (seed * MULTIPLIER + ADDEND) & MASK;
return (int) (hash >>> 30);
} | java | public static int getTileHash (int x, int y)
{
long seed = (((x << 2) ^ y) ^ MULTIPLIER) & MASK;
long hash = (seed * MULTIPLIER + ADDEND) & MASK;
return (int) (hash >>> 30);
} | [
"public",
"static",
"int",
"getTileHash",
"(",
"int",
"x",
",",
"int",
"y",
")",
"{",
"long",
"seed",
"=",
"(",
"(",
"(",
"x",
"<<",
"2",
")",
"^",
"y",
")",
"^",
"MULTIPLIER",
")",
"&",
"MASK",
";",
"long",
"hash",
"=",
"(",
"seed",
"*",
"MU... | Compute some hash value for "randomizing" tileset picks
based on x and y coordinates.
@return a positive, seemingly random number based on x and y. | [
"Compute",
"some",
"hash",
"value",
"for",
"randomizing",
"tileset",
"picks",
"based",
"on",
"x",
"and",
"y",
"coordinates",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/tile/TileUtil.java#L58-L63 | train |
groupon/monsoon | history/src/main/java/com/groupon/lex/metrics/history/v2/xdr/Util.java | Util.fixSequence | public static ObjectSequence<TimeSeriesCollection> fixSequence(ObjectSequence<TimeSeriesCollection> seq) {
seq = seq.sort(); // Does nothing if already sorted.
if (!seq.isDistinct() && !seq.isEmpty()) {
List<ObjectSequence<TimeSeriesCollection>> toConcat = new ArrayList<>();
in... | java | public static ObjectSequence<TimeSeriesCollection> fixSequence(ObjectSequence<TimeSeriesCollection> seq) {
seq = seq.sort(); // Does nothing if already sorted.
if (!seq.isDistinct() && !seq.isEmpty()) {
List<ObjectSequence<TimeSeriesCollection>> toConcat = new ArrayList<>();
in... | [
"public",
"static",
"ObjectSequence",
"<",
"TimeSeriesCollection",
">",
"fixSequence",
"(",
"ObjectSequence",
"<",
"TimeSeriesCollection",
">",
"seq",
")",
"{",
"seq",
"=",
"seq",
".",
"sort",
"(",
")",
";",
"// Does nothing if already sorted.",
"if",
"(",
"!",
... | Fix a sequence to contain only distinct, sorted elements. | [
"Fix",
"a",
"sequence",
"to",
"contain",
"only",
"distinct",
"sorted",
"elements",
"."
] | eb68d72ba4c01fe018dc981097dbee033908f5c7 | https://github.com/groupon/monsoon/blob/eb68d72ba4c01fe018dc981097dbee033908f5c7/history/src/main/java/com/groupon/lex/metrics/history/v2/xdr/Util.java#L92-L129 | train |
groupon/monsoon | history/src/main/java/com/groupon/lex/metrics/history/v2/xdr/Util.java | Util.mergeSequences | public static ObjectSequence<TimeSeriesCollection> mergeSequences(ObjectSequence<TimeSeriesCollection>... tsSeq) {
if (tsSeq.length == 0)
return ObjectSequence.empty();
if (tsSeq.length == 1)
return tsSeq[0];
// Sort sequences and remove any that are empty.
final... | java | public static ObjectSequence<TimeSeriesCollection> mergeSequences(ObjectSequence<TimeSeriesCollection>... tsSeq) {
if (tsSeq.length == 0)
return ObjectSequence.empty();
if (tsSeq.length == 1)
return tsSeq[0];
// Sort sequences and remove any that are empty.
final... | [
"public",
"static",
"ObjectSequence",
"<",
"TimeSeriesCollection",
">",
"mergeSequences",
"(",
"ObjectSequence",
"<",
"TimeSeriesCollection",
">",
"...",
"tsSeq",
")",
"{",
"if",
"(",
"tsSeq",
".",
"length",
"==",
"0",
")",
"return",
"ObjectSequence",
".",
"empt... | Given zero or more sequences, that are all sorted and distinct, merge
them together.
@param tsSeq Zero or more sequences to process.
@return A merged sequence. | [
"Given",
"zero",
"or",
"more",
"sequences",
"that",
"are",
"all",
"sorted",
"and",
"distinct",
"merge",
"them",
"together",
"."
] | eb68d72ba4c01fe018dc981097dbee033908f5c7 | https://github.com/groupon/monsoon/blob/eb68d72ba4c01fe018dc981097dbee033908f5c7/history/src/main/java/com/groupon/lex/metrics/history/v2/xdr/Util.java#L138-L198 | train |
threerings/nenya | core/src/main/java/com/threerings/openal/ResourceStream.java | ResourceStream.queueResource | public void queueResource (String bundle, String resource, boolean loop)
{
try {
queueURL(new URL("resource://" + bundle + "/" + resource), loop);
} catch (MalformedURLException e) {
log.warning("Invalid resource url.", "resource", resource, e);
}
} | java | public void queueResource (String bundle, String resource, boolean loop)
{
try {
queueURL(new URL("resource://" + bundle + "/" + resource), loop);
} catch (MalformedURLException e) {
log.warning("Invalid resource url.", "resource", resource, e);
}
} | [
"public",
"void",
"queueResource",
"(",
"String",
"bundle",
",",
"String",
"resource",
",",
"boolean",
"loop",
")",
"{",
"try",
"{",
"queueURL",
"(",
"new",
"URL",
"(",
"\"resource://\"",
"+",
"bundle",
"+",
"\"/\"",
"+",
"resource",
")",
",",
"loop",
")... | Adds a resource to the queue of files to play.
@param loop if true, play this file in a loop if there's nothing else
on the queue | [
"Adds",
"a",
"resource",
"to",
"the",
"queue",
"of",
"files",
"to",
"play",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/openal/ResourceStream.java#L76-L83 | train |
calrissian/mango | mango-core/src/main/java/org/calrissian/mango/net/MoreInetAddresses.java | MoreInetAddresses.isMappedIPv4Address | public static boolean isMappedIPv4Address(Inet6Address ip) {
byte bytes[] = ip.getAddress();
return ((bytes[0] == 0x00) && (bytes[1] == 0x00) &&
(bytes[2] == 0x00) && (bytes[3] == 0x00) &&
(bytes[4] == 0x00) && (bytes[5] == 0x00) &&
(bytes[6] == 0x00) && (... | java | public static boolean isMappedIPv4Address(Inet6Address ip) {
byte bytes[] = ip.getAddress();
return ((bytes[0] == 0x00) && (bytes[1] == 0x00) &&
(bytes[2] == 0x00) && (bytes[3] == 0x00) &&
(bytes[4] == 0x00) && (bytes[5] == 0x00) &&
(bytes[6] == 0x00) && (... | [
"public",
"static",
"boolean",
"isMappedIPv4Address",
"(",
"Inet6Address",
"ip",
")",
"{",
"byte",
"bytes",
"[",
"]",
"=",
"ip",
".",
"getAddress",
"(",
")",
";",
"return",
"(",
"(",
"bytes",
"[",
"0",
"]",
"==",
"0x00",
")",
"&&",
"(",
"bytes",
"[",... | Evaluates whether the argument is an IPv6 "mapped" address.
<p>An "IPv4 mapped", or "mapped", address is one with 80 leading
bits of zero followed by 16 bits of 1, with the remaining 32 bits interpreted as an
IPv4 address. These are conventionally represented in string
literals as {@code "::ffff:192.168.0.1"}, though... | [
"Evaluates",
"whether",
"the",
"argument",
"is",
"an",
"IPv6",
"mapped",
"address",
"."
] | a95aa5e77af9aa0e629787228d80806560023452 | https://github.com/calrissian/mango/blob/a95aa5e77af9aa0e629787228d80806560023452/mango-core/src/main/java/org/calrissian/mango/net/MoreInetAddresses.java#L167-L175 | train |
calrissian/mango | mango-core/src/main/java/org/calrissian/mango/net/MoreInetAddresses.java | MoreInetAddresses.getMappedIPv4Address | public static Inet4Address getMappedIPv4Address(Inet6Address ip) {
if (!isMappedIPv4Address(ip))
throw new IllegalArgumentException(String.format("Address '%s' is not IPv4-mapped.", toAddrString(ip)));
return getInet4Address(copyOfRange(ip.getAddress(), 12, 16));
} | java | public static Inet4Address getMappedIPv4Address(Inet6Address ip) {
if (!isMappedIPv4Address(ip))
throw new IllegalArgumentException(String.format("Address '%s' is not IPv4-mapped.", toAddrString(ip)));
return getInet4Address(copyOfRange(ip.getAddress(), 12, 16));
} | [
"public",
"static",
"Inet4Address",
"getMappedIPv4Address",
"(",
"Inet6Address",
"ip",
")",
"{",
"if",
"(",
"!",
"isMappedIPv4Address",
"(",
"ip",
")",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"String",
".",
"format",
"(",
"\"Address '%s' is not IPv4-ma... | Returns the IPv4 address embedded in an IPv4 mapped address.
@param ip {@link Inet6Address} to be examined for an embedded IPv4 address
@return {@link Inet4Address} of the embedded IPv4 address
@throws IllegalArgumentException if the argument is not a valid IPv4 mapped address | [
"Returns",
"the",
"IPv4",
"address",
"embedded",
"in",
"an",
"IPv4",
"mapped",
"address",
"."
] | a95aa5e77af9aa0e629787228d80806560023452 | https://github.com/calrissian/mango/blob/a95aa5e77af9aa0e629787228d80806560023452/mango-core/src/main/java/org/calrissian/mango/net/MoreInetAddresses.java#L184-L189 | train |
threerings/nenya | core/src/main/java/com/threerings/util/IdleTracker.java | IdleTracker.checkIdle | protected void checkIdle ()
{
long now = getTimeStamp();
switch (_state) {
case ACTIVE:
// check whether they've idled out
if (now >= (_lastEvent + _toIdleTime)) {
log.info("User idle for " + (now-_lastEvent) + "ms.");
_state = IDLE;
... | java | protected void checkIdle ()
{
long now = getTimeStamp();
switch (_state) {
case ACTIVE:
// check whether they've idled out
if (now >= (_lastEvent + _toIdleTime)) {
log.info("User idle for " + (now-_lastEvent) + "ms.");
_state = IDLE;
... | [
"protected",
"void",
"checkIdle",
"(",
")",
"{",
"long",
"now",
"=",
"getTimeStamp",
"(",
")",
";",
"switch",
"(",
"_state",
")",
"{",
"case",
"ACTIVE",
":",
"// check whether they've idled out",
"if",
"(",
"now",
">=",
"(",
"_lastEvent",
"+",
"_toIdleTime",... | Checks the last user event time and posts a command to idle them
out if they've been inactive for too long, or log them out if
they've been idle for too long. | [
"Checks",
"the",
"last",
"user",
"event",
"time",
"and",
"posts",
"a",
"command",
"to",
"idle",
"them",
"out",
"if",
"they",
"ve",
"been",
"inactive",
"for",
"too",
"long",
"or",
"log",
"them",
"out",
"if",
"they",
"ve",
"been",
"idle",
"for",
"too",
... | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/util/IdleTracker.java#L144-L168 | train |
groupon/monsoon | impl/src/main/java/com/groupon/lex/metrics/PushProcessorPipeline.java | PushProcessorPipeline.run_implementation_ | private void run_implementation_(PushProcessor p) throws Exception {
final Map<GroupName, Alert> alerts = registry_.getCollectionAlerts();
final TimeSeriesCollection tsdata = registry_.getCollectionData();
p.accept(tsdata, unmodifiableMap(alerts), registry_.getFailedCollections());
} | java | private void run_implementation_(PushProcessor p) throws Exception {
final Map<GroupName, Alert> alerts = registry_.getCollectionAlerts();
final TimeSeriesCollection tsdata = registry_.getCollectionData();
p.accept(tsdata, unmodifiableMap(alerts), registry_.getFailedCollections());
} | [
"private",
"void",
"run_implementation_",
"(",
"PushProcessor",
"p",
")",
"throws",
"Exception",
"{",
"final",
"Map",
"<",
"GroupName",
",",
"Alert",
">",
"alerts",
"=",
"registry_",
".",
"getCollectionAlerts",
"(",
")",
";",
"final",
"TimeSeriesCollection",
"ts... | Run the implementation of uploading the values and alerts.
@throws java.lang.Exception thrown by implementation. | [
"Run",
"the",
"implementation",
"of",
"uploading",
"the",
"values",
"and",
"alerts",
"."
] | eb68d72ba4c01fe018dc981097dbee033908f5c7 | https://github.com/groupon/monsoon/blob/eb68d72ba4c01fe018dc981097dbee033908f5c7/impl/src/main/java/com/groupon/lex/metrics/PushProcessorPipeline.java#L81-L85 | train |
groupon/monsoon | impl/src/main/java/com/groupon/lex/metrics/PushProcessorPipeline.java | PushProcessorPipeline.run | @Override
public final void run() {
try {
registry_.updateCollection();
final long t0 = System.nanoTime();
processors_.forEach(p -> {
try {
run_implementation_(p);
} catch (Exception ex) {
logger.lo... | java | @Override
public final void run() {
try {
registry_.updateCollection();
final long t0 = System.nanoTime();
processors_.forEach(p -> {
try {
run_implementation_(p);
} catch (Exception ex) {
logger.lo... | [
"@",
"Override",
"public",
"final",
"void",
"run",
"(",
")",
"{",
"try",
"{",
"registry_",
".",
"updateCollection",
"(",
")",
";",
"final",
"long",
"t0",
"=",
"System",
".",
"nanoTime",
"(",
")",
";",
"processors_",
".",
"forEach",
"(",
"p",
"->",
"{... | Run the collection cycle. | [
"Run",
"the",
"collection",
"cycle",
"."
] | eb68d72ba4c01fe018dc981097dbee033908f5c7 | https://github.com/groupon/monsoon/blob/eb68d72ba4c01fe018dc981097dbee033908f5c7/impl/src/main/java/com/groupon/lex/metrics/PushProcessorPipeline.java#L90-L115 | train |
threerings/nenya | core/src/main/java/com/threerings/miso/client/SceneBlockResolver.java | SceneBlockResolver.resolveBlock | public void resolveBlock (SceneBlock block, boolean hipri)
{
log.debug("Queueing block for resolution", "block", block, "hipri", hipri);
if (hipri) {
_queue.prepend(block);
} else {
_queue.append(block);
}
} | java | public void resolveBlock (SceneBlock block, boolean hipri)
{
log.debug("Queueing block for resolution", "block", block, "hipri", hipri);
if (hipri) {
_queue.prepend(block);
} else {
_queue.append(block);
}
} | [
"public",
"void",
"resolveBlock",
"(",
"SceneBlock",
"block",
",",
"boolean",
"hipri",
")",
"{",
"log",
".",
"debug",
"(",
"\"Queueing block for resolution\"",
",",
"\"block\"",
",",
"block",
",",
"\"hipri\"",
",",
"hipri",
")",
";",
"if",
"(",
"hipri",
")",... | Queues up a scene block for resolution. | [
"Queues",
"up",
"a",
"scene",
"block",
"for",
"resolution",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/miso/client/SceneBlockResolver.java#L43-L51 | train |
groupon/robo-remote | UIAutomatorClient/src/main/com/groupon/roboremote/uiautomatorclient/components/UiDevice.java | UiDevice.openNotification | public static boolean openNotification() throws Exception {
boolean success = false;
// get API level
int apiLevel = Client.getInstance().mapField("android.os.Build$VERSION", "SDK_INT").getInt(0);
if (apiLevel >= 18) {
success = Client.getInstance().map(Constants.UIAUTOMATO... | java | public static boolean openNotification() throws Exception {
boolean success = false;
// get API level
int apiLevel = Client.getInstance().mapField("android.os.Build$VERSION", "SDK_INT").getInt(0);
if (apiLevel >= 18) {
success = Client.getInstance().map(Constants.UIAUTOMATO... | [
"public",
"static",
"boolean",
"openNotification",
"(",
")",
"throws",
"Exception",
"{",
"boolean",
"success",
"=",
"false",
";",
"// get API level",
"int",
"apiLevel",
"=",
"Client",
".",
"getInstance",
"(",
")",
".",
"mapField",
"(",
"\"android.os.Build$VERSION\... | Open notification shade
@return
@throws Exception | [
"Open",
"notification",
"shade"
] | 12d242faad50bf90f98657ca9a0c0c3ae1993f07 | https://github.com/groupon/robo-remote/blob/12d242faad50bf90f98657ca9a0c0c3ae1993f07/UIAutomatorClient/src/main/com/groupon/roboremote/uiautomatorclient/components/UiDevice.java#L44-L63 | train |
groupon/robo-remote | UIAutomatorClient/src/main/com/groupon/roboremote/uiautomatorclient/components/UiDevice.java | UiDevice.click | public static boolean click(int x, int y) throws Exception {
return Client.getInstance().map(Constants.UIAUTOMATOR_UIDEVICE, "click", x, y).getBoolean(0);
} | java | public static boolean click(int x, int y) throws Exception {
return Client.getInstance().map(Constants.UIAUTOMATOR_UIDEVICE, "click", x, y).getBoolean(0);
} | [
"public",
"static",
"boolean",
"click",
"(",
"int",
"x",
",",
"int",
"y",
")",
"throws",
"Exception",
"{",
"return",
"Client",
".",
"getInstance",
"(",
")",
".",
"map",
"(",
"Constants",
".",
"UIAUTOMATOR_UIDEVICE",
",",
"\"click\"",
",",
"x",
",",
"y",
... | Click at x,y position
@param x
@param y
@return
@throws Exception | [
"Click",
"at",
"x",
"y",
"position"
] | 12d242faad50bf90f98657ca9a0c0c3ae1993f07 | https://github.com/groupon/robo-remote/blob/12d242faad50bf90f98657ca9a0c0c3ae1993f07/UIAutomatorClient/src/main/com/groupon/roboremote/uiautomatorclient/components/UiDevice.java#L72-L74 | train |
threerings/nenya | core/src/main/java/com/threerings/media/sprite/FadableImageSprite.java | FadableImageSprite.moveAndFadeIn | public void moveAndFadeIn (Path path, long pathDuration, float fadePortion)
{
move(path);
setAlpha(0.0f);
_fadeInDuration = (long)(pathDuration * fadePortion);
} | java | public void moveAndFadeIn (Path path, long pathDuration, float fadePortion)
{
move(path);
setAlpha(0.0f);
_fadeInDuration = (long)(pathDuration * fadePortion);
} | [
"public",
"void",
"moveAndFadeIn",
"(",
"Path",
"path",
",",
"long",
"pathDuration",
",",
"float",
"fadePortion",
")",
"{",
"move",
"(",
"path",
")",
";",
"setAlpha",
"(",
"0.0f",
")",
";",
"_fadeInDuration",
"=",
"(",
"long",
")",
"(",
"pathDuration",
"... | Puts this sprite on the specified path and fades it in over the specified duration.
@param path the path to move along
@param fadePortion the portion of time to spend fading in, from 0.0f (no time) to 1.0f (the
entire time) | [
"Puts",
"this",
"sprite",
"on",
"the",
"specified",
"path",
"and",
"fades",
"it",
"in",
"over",
"the",
"specified",
"duration",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/sprite/FadableImageSprite.java#L89-L96 | train |
threerings/nenya | core/src/main/java/com/threerings/media/sprite/FadableImageSprite.java | FadableImageSprite.moveAndFadeOut | public void moveAndFadeOut (Path path, long pathDuration, float fadePortion)
{
move(path);
setAlpha(1.0f);
_fadeStamp = 0;
_pathDuration = pathDuration;
_fadeOutDuration = (long)(pathDuration * fadePortion);
_fadeDelay = _pathDuration - _fadeOutDuration;
} | java | public void moveAndFadeOut (Path path, long pathDuration, float fadePortion)
{
move(path);
setAlpha(1.0f);
_fadeStamp = 0;
_pathDuration = pathDuration;
_fadeOutDuration = (long)(pathDuration * fadePortion);
_fadeDelay = _pathDuration - _fadeOutDuration;
} | [
"public",
"void",
"moveAndFadeOut",
"(",
"Path",
"path",
",",
"long",
"pathDuration",
",",
"float",
"fadePortion",
")",
"{",
"move",
"(",
"path",
")",
";",
"setAlpha",
"(",
"1.0f",
")",
";",
"_fadeStamp",
"=",
"0",
";",
"_pathDuration",
"=",
"pathDuration"... | Puts this sprite on the specified path and fades it out over the specified duration.
@param path the path to move along
@param pathDuration the duration of the path
@param fadePortion the portion of time to spend fading out, from 0.0f (no time) to 1.0f
(the entire time) | [
"Puts",
"this",
"sprite",
"on",
"the",
"specified",
"path",
"and",
"fades",
"it",
"out",
"over",
"the",
"specified",
"duration",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/sprite/FadableImageSprite.java#L106-L116 | train |
threerings/nenya | core/src/main/java/com/threerings/media/sprite/FadableImageSprite.java | FadableImageSprite.moveAndFadeInAndOut | public void moveAndFadeInAndOut (Path path, long pathDuration, float fadePortion)
{
move(path);
setAlpha(0.0f);
_pathDuration = pathDuration;
_fadeInDuration = _fadeOutDuration = (long)(pathDuration * fadePortion);
} | java | public void moveAndFadeInAndOut (Path path, long pathDuration, float fadePortion)
{
move(path);
setAlpha(0.0f);
_pathDuration = pathDuration;
_fadeInDuration = _fadeOutDuration = (long)(pathDuration * fadePortion);
} | [
"public",
"void",
"moveAndFadeInAndOut",
"(",
"Path",
"path",
",",
"long",
"pathDuration",
",",
"float",
"fadePortion",
")",
"{",
"move",
"(",
"path",
")",
";",
"setAlpha",
"(",
"0.0f",
")",
";",
"_pathDuration",
"=",
"pathDuration",
";",
"_fadeInDuration",
... | Puts this sprite on the specified path, fading it in over the specified duration at the
beginning and fading it out at the end.
@param path the path to move along
@param pathDuration the duration of the path
@param fadePortion the portion of time to spend fading in/out, from 0.0f (no time) to 1.0f
(the entire time) | [
"Puts",
"this",
"sprite",
"on",
"the",
"specified",
"path",
"fading",
"it",
"in",
"over",
"the",
"specified",
"duration",
"at",
"the",
"beginning",
"and",
"fading",
"it",
"out",
"at",
"the",
"end",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/sprite/FadableImageSprite.java#L127-L135 | train |
threerings/nenya | core/src/main/java/com/threerings/media/sprite/FadableImageSprite.java | FadableImageSprite.setAlpha | public void setAlpha (float alpha)
{
if (alpha < 0.0f) {
alpha = 0.0f;
} else if (alpha > 1.0f) {
alpha = 1.0f;
}
if (alpha != _alphaComposite.getAlpha()) {
_alphaComposite = AlphaComposite.getInstance(AlphaComposite.SRC_OVER, alpha);
... | java | public void setAlpha (float alpha)
{
if (alpha < 0.0f) {
alpha = 0.0f;
} else if (alpha > 1.0f) {
alpha = 1.0f;
}
if (alpha != _alphaComposite.getAlpha()) {
_alphaComposite = AlphaComposite.getInstance(AlphaComposite.SRC_OVER, alpha);
... | [
"public",
"void",
"setAlpha",
"(",
"float",
"alpha",
")",
"{",
"if",
"(",
"alpha",
"<",
"0.0f",
")",
"{",
"alpha",
"=",
"0.0f",
";",
"}",
"else",
"if",
"(",
"alpha",
">",
"1.0f",
")",
"{",
"alpha",
"=",
"1.0f",
";",
"}",
"if",
"(",
"alpha",
"!=... | Sets the alpha value of this sprite. | [
"Sets",
"the",
"alpha",
"value",
"of",
"this",
"sprite",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/sprite/FadableImageSprite.java#L229-L243 | train |
threerings/nenya | core/src/main/java/com/threerings/media/util/PerformanceMonitor.java | PerformanceMonitor.register | public static void register (PerformanceObserver obs, String name, long delta)
{
// get the observer's action hashtable
Map<String, PerformanceAction> actions = _observers.get(obs);
if (actions == null) {
// create it if it didn't exist
_observers.put(obs, actions = M... | java | public static void register (PerformanceObserver obs, String name, long delta)
{
// get the observer's action hashtable
Map<String, PerformanceAction> actions = _observers.get(obs);
if (actions == null) {
// create it if it didn't exist
_observers.put(obs, actions = M... | [
"public",
"static",
"void",
"register",
"(",
"PerformanceObserver",
"obs",
",",
"String",
"name",
",",
"long",
"delta",
")",
"{",
"// get the observer's action hashtable",
"Map",
"<",
"String",
",",
"PerformanceAction",
">",
"actions",
"=",
"_observers",
".",
"get... | Register a new action with an observer, the action name, and the milliseconds to wait
between checkpointing the action's performance.
@param obs the action observer.
@param name the action name.
@param delta the milliseconds between checkpoints. | [
"Register",
"a",
"new",
"action",
"with",
"an",
"observer",
"the",
"action",
"name",
"and",
"the",
"milliseconds",
"to",
"wait",
"between",
"checkpointing",
"the",
"action",
"s",
"performance",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/util/PerformanceMonitor.java#L58-L69 | train |
threerings/nenya | core/src/main/java/com/threerings/media/util/PerformanceMonitor.java | PerformanceMonitor.unregister | public static void unregister (PerformanceObserver obs, String name)
{
// get the observer's action hashtable
Map<String, PerformanceAction> actions = _observers.get(obs);
if (actions == null) {
log.warning("Attempt to unregister by unknown observer " +
"[... | java | public static void unregister (PerformanceObserver obs, String name)
{
// get the observer's action hashtable
Map<String, PerformanceAction> actions = _observers.get(obs);
if (actions == null) {
log.warning("Attempt to unregister by unknown observer " +
"[... | [
"public",
"static",
"void",
"unregister",
"(",
"PerformanceObserver",
"obs",
",",
"String",
"name",
")",
"{",
"// get the observer's action hashtable",
"Map",
"<",
"String",
",",
"PerformanceAction",
">",
"actions",
"=",
"_observers",
".",
"get",
"(",
"obs",
")",
... | Un-register the named action associated with the given observer.
@param obs the action observer.
@param name the action name. | [
"Un",
"-",
"register",
"the",
"named",
"action",
"associated",
"with",
"the",
"given",
"observer",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/util/PerformanceMonitor.java#L77-L100 | train |
threerings/nenya | core/src/main/java/com/threerings/media/util/PerformanceMonitor.java | PerformanceMonitor.tick | public static void tick (PerformanceObserver obs, String name)
{
// get the observer's action hashtable
Map<String, PerformanceAction> actions = _observers.get(obs);
if (actions == null) {
log.warning("Attempt to tick by unknown observer " +
"[observer=" +... | java | public static void tick (PerformanceObserver obs, String name)
{
// get the observer's action hashtable
Map<String, PerformanceAction> actions = _observers.get(obs);
if (actions == null) {
log.warning("Attempt to tick by unknown observer " +
"[observer=" +... | [
"public",
"static",
"void",
"tick",
"(",
"PerformanceObserver",
"obs",
",",
"String",
"name",
")",
"{",
"// get the observer's action hashtable",
"Map",
"<",
"String",
",",
"PerformanceAction",
">",
"actions",
"=",
"_observers",
".",
"get",
"(",
"obs",
")",
";",... | Tick the named action associated with the given observer.
@param obs the action observer.
@param name the action name. | [
"Tick",
"the",
"named",
"action",
"associated",
"with",
"the",
"given",
"observer",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/util/PerformanceMonitor.java#L108-L128 | train |
kaazing/java.client | ws/ws/src/main/java/org/kaazing/net/ws/impl/url/WsURLStreamHandlerImpl.java | WsURLStreamHandlerImpl._getSpecURI | private URI _getSpecURI(String spec) {
URI specURI = URI.create(spec);
if (_scheme.indexOf(':') == -1) {
return specURI;
}
String schemeSpecificPart = specURI.getSchemeSpecificPart();
return URI.create(schemeSpecificPart);
} | java | private URI _getSpecURI(String spec) {
URI specURI = URI.create(spec);
if (_scheme.indexOf(':') == -1) {
return specURI;
}
String schemeSpecificPart = specURI.getSchemeSpecificPart();
return URI.create(schemeSpecificPart);
} | [
"private",
"URI",
"_getSpecURI",
"(",
"String",
"spec",
")",
"{",
"URI",
"specURI",
"=",
"URI",
".",
"create",
"(",
"spec",
")",
";",
"if",
"(",
"_scheme",
".",
"indexOf",
"(",
"'",
"'",
")",
"==",
"-",
"1",
")",
"{",
"return",
"specURI",
";",
"}... | the appropriate URI that can be used to retrieve the needed parts. | [
"the",
"appropriate",
"URI",
"that",
"can",
"be",
"used",
"to",
"retrieve",
"the",
"needed",
"parts",
"."
] | 25ad2ae5bb24aa9d6b79400fce649b518dcfbe26 | https://github.com/kaazing/java.client/blob/25ad2ae5bb24aa9d6b79400fce649b518dcfbe26/ws/ws/src/main/java/org/kaazing/net/ws/impl/url/WsURLStreamHandlerImpl.java#L81-L90 | train |
threerings/nenya | core/src/main/java/com/threerings/media/tile/TileSet.java | TileSet.checkTileIndex | protected boolean checkTileIndex (int tileIndex)
{
int tcount = getTileCount();
if (tileIndex >= 0 && tileIndex < tcount) {
return true;
} else {
log.warning("Requested invalid tile [tset=" + this + ", index=" + tileIndex + "].",
new Exception(... | java | protected boolean checkTileIndex (int tileIndex)
{
int tcount = getTileCount();
if (tileIndex >= 0 && tileIndex < tcount) {
return true;
} else {
log.warning("Requested invalid tile [tset=" + this + ", index=" + tileIndex + "].",
new Exception(... | [
"protected",
"boolean",
"checkTileIndex",
"(",
"int",
"tileIndex",
")",
"{",
"int",
"tcount",
"=",
"getTileCount",
"(",
")",
";",
"if",
"(",
"tileIndex",
">=",
"0",
"&&",
"tileIndex",
"<",
"tcount",
")",
"{",
"return",
"true",
";",
"}",
"else",
"{",
"l... | Used to ensure that the specified tile index is valid. | [
"Used",
"to",
"ensure",
"that",
"the",
"specified",
"tile",
"index",
"is",
"valid",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/tile/TileSet.java#L332-L342 | train |
jboss/jboss-jsp-api_spec | src/main/java/javax/servlet/jsp/tagext/TagLibraryInfo.java | TagLibraryInfo.getTag | public TagInfo getTag(String shortname) {
TagInfo tags[] = getTags();
if (tags == null || tags.length == 0) {
return null;
}
for (int i=0; i < tags.length; i++) {
if (tags[i].getTagName().equals(shortname)) {
return tags[i];
}
... | java | public TagInfo getTag(String shortname) {
TagInfo tags[] = getTags();
if (tags == null || tags.length == 0) {
return null;
}
for (int i=0; i < tags.length; i++) {
if (tags[i].getTagName().equals(shortname)) {
return tags[i];
}
... | [
"public",
"TagInfo",
"getTag",
"(",
"String",
"shortname",
")",
"{",
"TagInfo",
"tags",
"[",
"]",
"=",
"getTags",
"(",
")",
";",
"if",
"(",
"tags",
"==",
"null",
"||",
"tags",
".",
"length",
"==",
"0",
")",
"{",
"return",
"null",
";",
"}",
"for",
... | Get the TagInfo for a given tag name, looking through all the
tags in this tag library.
@param shortname The short name (no prefix) of the tag
@return the TagInfo for the tag with the specified short name, or
null if no such tag is found | [
"Get",
"the",
"TagInfo",
"for",
"a",
"given",
"tag",
"name",
"looking",
"through",
"all",
"the",
"tags",
"in",
"this",
"tag",
"library",
"."
] | da53166619f33a5134dc3315a3264990cc1f541f | https://github.com/jboss/jboss-jsp-api_spec/blob/da53166619f33a5134dc3315a3264990cc1f541f/src/main/java/javax/servlet/jsp/tagext/TagLibraryInfo.java#L185-L198 | train |
jboss/jboss-jsp-api_spec | src/main/java/javax/servlet/jsp/tagext/TagLibraryInfo.java | TagLibraryInfo.getTagFile | public TagFileInfo getTagFile(String shortname) {
TagFileInfo tagFiles[] = getTagFiles();
if (tagFiles == null || tagFiles.length == 0) {
return null;
}
for (int i=0; i < tagFiles.length; i++) {
if (tagFiles[i].getName().equals(shortname)) {
retu... | java | public TagFileInfo getTagFile(String shortname) {
TagFileInfo tagFiles[] = getTagFiles();
if (tagFiles == null || tagFiles.length == 0) {
return null;
}
for (int i=0; i < tagFiles.length; i++) {
if (tagFiles[i].getName().equals(shortname)) {
retu... | [
"public",
"TagFileInfo",
"getTagFile",
"(",
"String",
"shortname",
")",
"{",
"TagFileInfo",
"tagFiles",
"[",
"]",
"=",
"getTagFiles",
"(",
")",
";",
"if",
"(",
"tagFiles",
"==",
"null",
"||",
"tagFiles",
".",
"length",
"==",
"0",
")",
"{",
"return",
"nul... | Get the TagFileInfo for a given tag name, looking through all the
tag files in this tag library.
@param shortname The short name (no prefix) of the tag
@return the TagFileInfo for the specified Tag file, or null
if no Tag file is found
@since JSP 2.0 | [
"Get",
"the",
"TagFileInfo",
"for",
"a",
"given",
"tag",
"name",
"looking",
"through",
"all",
"the",
"tag",
"files",
"in",
"this",
"tag",
"library",
"."
] | da53166619f33a5134dc3315a3264990cc1f541f | https://github.com/jboss/jboss-jsp-api_spec/blob/da53166619f33a5134dc3315a3264990cc1f541f/src/main/java/javax/servlet/jsp/tagext/TagLibraryInfo.java#L209-L222 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.