repository_name stringlengths 7 58 | func_path_in_repository stringlengths 11 204 | func_name stringlengths 5 103 | whole_func_string stringlengths 87 3.44k | language stringclasses 1
value | func_code_string stringlengths 87 3.44k | func_code_tokens listlengths 21 714 | func_documentation_string stringlengths 61 1.95k | func_documentation_tokens listlengths 1 482 | split_name stringclasses 1
value | func_code_url stringlengths 102 309 |
|---|---|---|---|---|---|---|---|---|---|---|
52inc/android-52Kit | library-drawer/src/main/java/com/ftinc/kit/drawer/items/ActionDrawerItem.java | ActionDrawerItem.onCreateView | @Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, int highlightColor) {
Context ctx = inflater.getContext();
View view = inflater.inflate(R.layout.navdrawer_item, container, false);
ImageView iconView = ButterKnife.findById(view, R.id.icon);
TextView t... | java | @Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, int highlightColor) {
Context ctx = inflater.getContext();
View view = inflater.inflate(R.layout.navdrawer_item, container, false);
ImageView iconView = ButterKnife.findById(view, R.id.icon);
TextView t... | [
"@",
"Override",
"public",
"View",
"onCreateView",
"(",
"LayoutInflater",
"inflater",
",",
"ViewGroup",
"container",
",",
"int",
"highlightColor",
")",
"{",
"Context",
"ctx",
"=",
"inflater",
".",
"getContext",
"(",
")",
";",
"View",
"view",
"=",
"inflater",
... | Called to create this view
@param inflater the layout inflater to inflate a layout from system
@param container the container the layout is going to be placed in
@return | [
"Called",
"to",
"create",
"this",
"view"
] | train | https://github.com/52inc/android-52Kit/blob/8644fab0f633477b1bb1dddd8147a9ef8bc03516/library-drawer/src/main/java/com/ftinc/kit/drawer/items/ActionDrawerItem.java#L61-L88 |
RKumsher/utils | src/main/java/com/github/rkumsher/collection/ArrayUtils.java | ArrayUtils.containsAll | @SafeVarargs
public static <T> boolean containsAll(T[] arrayToCheck, T... elementsToCheckFor) {
return containsAll(arrayToCheck, Arrays.asList(elementsToCheckFor));
} | java | @SafeVarargs
public static <T> boolean containsAll(T[] arrayToCheck, T... elementsToCheckFor) {
return containsAll(arrayToCheck, Arrays.asList(elementsToCheckFor));
} | [
"@",
"SafeVarargs",
"public",
"static",
"<",
"T",
">",
"boolean",
"containsAll",
"(",
"T",
"[",
"]",
"arrayToCheck",
",",
"T",
"...",
"elementsToCheckFor",
")",
"{",
"return",
"containsAll",
"(",
"arrayToCheck",
",",
"Arrays",
".",
"asList",
"(",
"elementsTo... | Returns whether or not the given array contains all the given elements to check for.
<pre>
ArrayUtils.containsAll(new String[] {}) = true;
ArrayUtils.containsAll(new String[] {"a"}, "a") = true;
ArrayUtils.containsAll(new String[] {"a"}, "b") = false;
ArrayUtils.containsAll(new String[] {"a", "b"}, "a", "b", "a", "b")... | [
"Returns",
"whether",
"or",
"not",
"the",
"given",
"array",
"contains",
"all",
"the",
"given",
"elements",
"to",
"check",
"for",
"."
] | train | https://github.com/RKumsher/utils/blob/fcdb190569cd0288249bf4b46fd418f8c01d1caf/src/main/java/com/github/rkumsher/collection/ArrayUtils.java#L78-L81 |
elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/projections/CanvasSize.java | CanvasSize.clipToMargin | public boolean clipToMargin(double[] origin, double[] target) {
assert (target.length == 2 && origin.length == 2);
if ((origin[0] < minx && target[0] < minx) //
|| (origin[0] > maxx && target[0] > maxx) //
|| (origin[1] < miny && target[1] < miny) //
|| (origin[1] > maxy && target[1] > m... | java | public boolean clipToMargin(double[] origin, double[] target) {
assert (target.length == 2 && origin.length == 2);
if ((origin[0] < minx && target[0] < minx) //
|| (origin[0] > maxx && target[0] > maxx) //
|| (origin[1] < miny && target[1] < miny) //
|| (origin[1] > maxy && target[1] > m... | [
"public",
"boolean",
"clipToMargin",
"(",
"double",
"[",
"]",
"origin",
",",
"double",
"[",
"]",
"target",
")",
"{",
"assert",
"(",
"target",
".",
"length",
"==",
"2",
"&&",
"origin",
".",
"length",
"==",
"2",
")",
";",
"if",
"(",
"(",
"origin",
"[... | Clip a line on the margin (modifies arrays!)
@param origin Origin point, <b>will be modified</b>
@param target Target point, <b>will be modified</b>
@return {@code false} if entirely outside the margin | [
"Clip",
"a",
"line",
"on",
"the",
"margin",
"(",
"modifies",
"arrays!",
")"
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/projections/CanvasSize.java#L141-L165 |
aws/aws-cloudtrail-processing-library | src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/utils/LibraryUtils.java | LibraryUtils.handleException | public static void handleException(ExceptionHandler exceptionHandler, ProgressStatus progressStatus, Exception e, String message) {
ProcessingLibraryException exception = new ProcessingLibraryException(message, e, progressStatus);
exceptionHandler.handleException(exception);
} | java | public static void handleException(ExceptionHandler exceptionHandler, ProgressStatus progressStatus, Exception e, String message) {
ProcessingLibraryException exception = new ProcessingLibraryException(message, e, progressStatus);
exceptionHandler.handleException(exception);
} | [
"public",
"static",
"void",
"handleException",
"(",
"ExceptionHandler",
"exceptionHandler",
",",
"ProgressStatus",
"progressStatus",
",",
"Exception",
"e",
",",
"String",
"message",
")",
"{",
"ProcessingLibraryException",
"exception",
"=",
"new",
"ProcessingLibraryExcepti... | A wrapper function of handling exceptions that have a known root cause, such as {@link AmazonServiceException}.
@param exceptionHandler the {@link ExceptionHandler} to handle exceptions.
@param progressStatus the current progress status {@link ProgressStatus}.
@param e the exception needs to be handled.
@param message ... | [
"A",
"wrapper",
"function",
"of",
"handling",
"exceptions",
"that",
"have",
"a",
"known",
"root",
"cause",
"such",
"as",
"{"
] | train | https://github.com/aws/aws-cloudtrail-processing-library/blob/411315808d8d3dc6b45e4182212e3e04d82e3782/src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/utils/LibraryUtils.java#L169-L172 |
haraldk/TwelveMonkeys | sandbox/sandbox-common/src/main/java/com/twelvemonkeys/util/DebugUtil.java | DebugUtil.printDebug | public static void printDebug(final Collection pCollection, final String pMethodName) {
printDebug(pCollection, pMethodName, System.out);
} | java | public static void printDebug(final Collection pCollection, final String pMethodName) {
printDebug(pCollection, pMethodName, System.out);
} | [
"public",
"static",
"void",
"printDebug",
"(",
"final",
"Collection",
"pCollection",
",",
"final",
"String",
"pMethodName",
")",
"{",
"printDebug",
"(",
"pCollection",
",",
"pMethodName",
",",
"System",
".",
"out",
")",
";",
"}"
] | Invokes a given method of every element in a {@code java.util.Collection} and prints the results to {@code System.out}.
The method to be invoked must have no formal parameters.
<p>
If an exception is throwed during the method invocation, the element's {@code toString()} method is called.
For bulk data types, recursive ... | [
"Invokes",
"a",
"given",
"method",
"of",
"every",
"element",
"in",
"a",
"{"
] | train | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/sandbox/sandbox-common/src/main/java/com/twelvemonkeys/util/DebugUtil.java#L520-L522 |
derari/cthul | matchers/src/main/java/org/cthul/matchers/diagnose/nested/Nested.java | Nested.useParentheses | public static boolean useParentheses(int pSelf, int pNested) {
if (pSelf == PrecedencedSelfDescribing.P_NONE
|| pSelf == PrecedencedSelfDescribing.P_UNARY_NO_PAREN) {
return false;
}
if (pNested < PrecedencedSelfDescribing.P_UNARY) {
return pNested <... | java | public static boolean useParentheses(int pSelf, int pNested) {
if (pSelf == PrecedencedSelfDescribing.P_NONE
|| pSelf == PrecedencedSelfDescribing.P_UNARY_NO_PAREN) {
return false;
}
if (pNested < PrecedencedSelfDescribing.P_UNARY) {
return pNested <... | [
"public",
"static",
"boolean",
"useParentheses",
"(",
"int",
"pSelf",
",",
"int",
"pNested",
")",
"{",
"if",
"(",
"pSelf",
"==",
"PrecedencedSelfDescribing",
".",
"P_NONE",
"||",
"pSelf",
"==",
"PrecedencedSelfDescribing",
".",
"P_UNARY_NO_PAREN",
")",
"{",
"ret... | Compares own precedence against nested and return
@param pSelf
@param pNested
@return true iff parentheses should be used | [
"Compares",
"own",
"precedence",
"against",
"nested",
"and",
"return"
] | train | https://github.com/derari/cthul/blob/74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc/matchers/src/main/java/org/cthul/matchers/diagnose/nested/Nested.java#L133-L143 |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/filter/binary/ThresholdBlock.java | ThresholdBlock.applyThreshold | protected void applyThreshold( T input, GrayU8 output ) {
for (int blockY = 0; blockY < stats.height; blockY++) {
for (int blockX = 0; blockX < stats.width; blockX++) {
original.thresholdBlock(blockX,blockY,input,stats,output);
}
}
} | java | protected void applyThreshold( T input, GrayU8 output ) {
for (int blockY = 0; blockY < stats.height; blockY++) {
for (int blockX = 0; blockX < stats.width; blockX++) {
original.thresholdBlock(blockX,blockY,input,stats,output);
}
}
} | [
"protected",
"void",
"applyThreshold",
"(",
"T",
"input",
",",
"GrayU8",
"output",
")",
"{",
"for",
"(",
"int",
"blockY",
"=",
"0",
";",
"blockY",
"<",
"stats",
".",
"height",
";",
"blockY",
"++",
")",
"{",
"for",
"(",
"int",
"blockX",
"=",
"0",
";... | Applies the dynamically computed threshold to each pixel in the image, one block at a time | [
"Applies",
"the",
"dynamically",
"computed",
"threshold",
"to",
"each",
"pixel",
"in",
"the",
"image",
"one",
"block",
"at",
"a",
"time"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/filter/binary/ThresholdBlock.java#L132-L138 |
rzwitserloot/lombok | src/core/lombok/javac/handlers/JavacHandlerUtil.java | JavacHandlerUtil.getFieldType | static JCExpression getFieldType(JavacNode field, FieldAccess fieldAccess) {
if (field.getKind() == Kind.METHOD) return ((JCMethodDecl) field.get()).restype;
boolean lookForGetter = lookForGetter(field, fieldAccess);
GetterMethod getter = lookForGetter ? findGetter(field) : null;
if (getter == null) {
... | java | static JCExpression getFieldType(JavacNode field, FieldAccess fieldAccess) {
if (field.getKind() == Kind.METHOD) return ((JCMethodDecl) field.get()).restype;
boolean lookForGetter = lookForGetter(field, fieldAccess);
GetterMethod getter = lookForGetter ? findGetter(field) : null;
if (getter == null) {
... | [
"static",
"JCExpression",
"getFieldType",
"(",
"JavacNode",
"field",
",",
"FieldAccess",
"fieldAccess",
")",
"{",
"if",
"(",
"field",
".",
"getKind",
"(",
")",
"==",
"Kind",
".",
"METHOD",
")",
"return",
"(",
"(",
"JCMethodDecl",
")",
"field",
".",
"get",
... | Returns the type of the field, unless a getter exists for this field, in which case the return type of the getter is returned.
@see #createFieldAccessor(TreeMaker, JavacNode, FieldAccess) | [
"Returns",
"the",
"type",
"of",
"the",
"field",
"unless",
"a",
"getter",
"exists",
"for",
"this",
"field",
"in",
"which",
"case",
"the",
"return",
"type",
"of",
"the",
"getter",
"is",
"returned",
"."
] | train | https://github.com/rzwitserloot/lombok/blob/75601240760bd81ff95fcde7a1b8185769ce64e8/src/core/lombok/javac/handlers/JavacHandlerUtil.java#L924-L936 |
StanKocken/EfficientAdapter | efficientadapter/src/main/java/com/skocken/efficientadapter/lib/util/ViewHelper.java | ViewHelper.setImageBitmap | public static void setImageBitmap(EfficientCacheView cacheView, int viewId, Bitmap bm) {
View view = cacheView.findViewByIdEfficient(viewId);
if (view instanceof ImageView) {
((ImageView) view).setImageBitmap(bm);
}
} | java | public static void setImageBitmap(EfficientCacheView cacheView, int viewId, Bitmap bm) {
View view = cacheView.findViewByIdEfficient(viewId);
if (view instanceof ImageView) {
((ImageView) view).setImageBitmap(bm);
}
} | [
"public",
"static",
"void",
"setImageBitmap",
"(",
"EfficientCacheView",
"cacheView",
",",
"int",
"viewId",
",",
"Bitmap",
"bm",
")",
"{",
"View",
"view",
"=",
"cacheView",
".",
"findViewByIdEfficient",
"(",
"viewId",
")",
";",
"if",
"(",
"view",
"instanceof",... | Equivalent to calling ImageView.setImageBitmap
@param cacheView The cache of views to get the view from
@param viewId The id of the view whose image should change
@param bm The bitmap to set | [
"Equivalent",
"to",
"calling",
"ImageView",
".",
"setImageBitmap"
] | train | https://github.com/StanKocken/EfficientAdapter/blob/0bcc3a20182cbce9d7901e1e2a9104251637167d/efficientadapter/src/main/java/com/skocken/efficientadapter/lib/util/ViewHelper.java#L231-L236 |
alkacon/opencms-core | src/org/opencms/jlan/CmsJlanDiskInterface.java | CmsJlanDiskInterface.getCms | protected CmsObjectWrapper getCms(SrvSession session, TreeConnection connection) throws CmsException {
CmsJlanRepository repository = ((CmsJlanDeviceContext)connection.getContext()).getRepository();
CmsObjectWrapper result = repository.getCms(session, connection);
return result;
} | java | protected CmsObjectWrapper getCms(SrvSession session, TreeConnection connection) throws CmsException {
CmsJlanRepository repository = ((CmsJlanDeviceContext)connection.getContext()).getRepository();
CmsObjectWrapper result = repository.getCms(session, connection);
return result;
} | [
"protected",
"CmsObjectWrapper",
"getCms",
"(",
"SrvSession",
"session",
",",
"TreeConnection",
"connection",
")",
"throws",
"CmsException",
"{",
"CmsJlanRepository",
"repository",
"=",
"(",
"(",
"CmsJlanDeviceContext",
")",
"connection",
".",
"getContext",
"(",
")",
... | Creates a CmsObjectWrapper for the current session.<p>
@param session the current session
@param connection the tree connection
@return the correctly configured CmsObjectWrapper for this session
@throws CmsException if something goes wrong | [
"Creates",
"a",
"CmsObjectWrapper",
"for",
"the",
"current",
"session",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jlan/CmsJlanDiskInterface.java#L430-L435 |
Azure/azure-sdk-for-java | sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/InstanceFailoverGroupsInner.java | InstanceFailoverGroupsInner.beginForceFailoverAllowDataLoss | public InstanceFailoverGroupInner beginForceFailoverAllowDataLoss(String resourceGroupName, String locationName, String failoverGroupName) {
return beginForceFailoverAllowDataLossWithServiceResponseAsync(resourceGroupName, locationName, failoverGroupName).toBlocking().single().body();
} | java | public InstanceFailoverGroupInner beginForceFailoverAllowDataLoss(String resourceGroupName, String locationName, String failoverGroupName) {
return beginForceFailoverAllowDataLossWithServiceResponseAsync(resourceGroupName, locationName, failoverGroupName).toBlocking().single().body();
} | [
"public",
"InstanceFailoverGroupInner",
"beginForceFailoverAllowDataLoss",
"(",
"String",
"resourceGroupName",
",",
"String",
"locationName",
",",
"String",
"failoverGroupName",
")",
"{",
"return",
"beginForceFailoverAllowDataLossWithServiceResponseAsync",
"(",
"resourceGroupName",... | Fails over from the current primary managed instance to this managed instance. This operation might result in data loss.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param locationName The name of the r... | [
"Fails",
"over",
"from",
"the",
"current",
"primary",
"managed",
"instance",
"to",
"this",
"managed",
"instance",
".",
"This",
"operation",
"might",
"result",
"in",
"data",
"loss",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/InstanceFailoverGroupsInner.java#L940-L942 |
gwtbootstrap3/gwtbootstrap3-extras | src/main/java/org/gwtbootstrap3/extras/animate/client/ui/Animate.java | Animate.getStyleNameFromAnimation | private static String getStyleNameFromAnimation(final String animation, int count, int duration, int delay) {
// fix input
if (count < 0) count = -1;
if (duration < 0) duration = -1;
if (delay < 0) delay = -1;
String styleName = "";
// for all valid animations
... | java | private static String getStyleNameFromAnimation(final String animation, int count, int duration, int delay) {
// fix input
if (count < 0) count = -1;
if (duration < 0) duration = -1;
if (delay < 0) delay = -1;
String styleName = "";
// for all valid animations
... | [
"private",
"static",
"String",
"getStyleNameFromAnimation",
"(",
"final",
"String",
"animation",
",",
"int",
"count",
",",
"int",
"duration",
",",
"int",
"delay",
")",
"{",
"// fix input",
"if",
"(",
"count",
"<",
"0",
")",
"count",
"=",
"-",
"1",
";",
"... | Helper method, which returns unique class name for combination of animation and it's settings.
@param animation Animation CSS class name.
@param count Number of animation repeats.
@param duration Animation duration in ms.
@param delay Delay before starting the animation loop in ms.
@return String representation of cla... | [
"Helper",
"method",
"which",
"returns",
"unique",
"class",
"name",
"for",
"combination",
"of",
"animation",
"and",
"it",
"s",
"settings",
"."
] | train | https://github.com/gwtbootstrap3/gwtbootstrap3-extras/blob/8e42aaffd2a082e9cb23a14c37a3c87b7cbdfa94/src/main/java/org/gwtbootstrap3/extras/animate/client/ui/Animate.java#L359-L382 |
geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/gfx/context/VmlGraphicsContext.java | VmlGraphicsContext.drawSymbolDefinition | public void drawSymbolDefinition(Object parent, String id, SymbolInfo symbol, ShapeStyle style,
Matrix transformation) {
if (isAttached()) {
if (symbol == null) {
return;
}
symbolDefs.put(id, new SymbolDefinition(symbol, style));
if (symbol.getImage() != null) {
// When it's an image symbol, ad... | java | public void drawSymbolDefinition(Object parent, String id, SymbolInfo symbol, ShapeStyle style,
Matrix transformation) {
if (isAttached()) {
if (symbol == null) {
return;
}
symbolDefs.put(id, new SymbolDefinition(symbol, style));
if (symbol.getImage() != null) {
// When it's an image symbol, ad... | [
"public",
"void",
"drawSymbolDefinition",
"(",
"Object",
"parent",
",",
"String",
"id",
",",
"SymbolInfo",
"symbol",
",",
"ShapeStyle",
"style",
",",
"Matrix",
"transformation",
")",
"{",
"if",
"(",
"isAttached",
"(",
")",
")",
"{",
"if",
"(",
"symbol",
"=... | Draw a type (shapetype for vml).
@param parent
the parent of the shapetype
@param id
the types's unique identifier
@param symbol
the symbol information
@param style
The default style to apply on the shape-type. Can be overridden when a shape uses this shape-type.
@param transformation
the transformation to apply on th... | [
"Draw",
"a",
"type",
"(",
"shapetype",
"for",
"vml",
")",
"."
] | train | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/gfx/context/VmlGraphicsContext.java#L358-L376 |
michel-kraemer/bson4jackson | src/main/java/de/undercouch/bson4jackson/BsonParser.java | BsonParser.regexStrToFlags | @SuppressWarnings("deprecation")
protected int regexStrToFlags(String pattern) throws JsonParseException {
int flags = 0;
for (int i = 0; i < pattern.length(); ++i) {
char c = pattern.charAt(i);
switch (c) {
case 'i':
flags |= Pattern.CASE_INSENSITIVE;
break;
case 'm':
flags |= Pattern... | java | @SuppressWarnings("deprecation")
protected int regexStrToFlags(String pattern) throws JsonParseException {
int flags = 0;
for (int i = 0; i < pattern.length(); ++i) {
char c = pattern.charAt(i);
switch (c) {
case 'i':
flags |= Pattern.CASE_INSENSITIVE;
break;
case 'm':
flags |= Pattern... | [
"@",
"SuppressWarnings",
"(",
"\"deprecation\"",
")",
"protected",
"int",
"regexStrToFlags",
"(",
"String",
"pattern",
")",
"throws",
"JsonParseException",
"{",
"int",
"flags",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"pattern",
".",... | Converts a BSON regex pattern string to a combined value of Java flags that
can be used in {@link Pattern#compile(String, int)}
@param pattern the regex pattern string
@return the Java flags
@throws JsonParseException if the pattern string contains a unsupported flag | [
"Converts",
"a",
"BSON",
"regex",
"pattern",
"string",
"to",
"a",
"combined",
"value",
"of",
"Java",
"flags",
"that",
"can",
"be",
"used",
"in",
"{"
] | train | https://github.com/michel-kraemer/bson4jackson/blob/32d2ab3c516b3c07490fdfcf0c5e4ed0a2ee3979/src/main/java/de/undercouch/bson4jackson/BsonParser.java#L480-L512 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCrossConnectionPeeringsInner.java | ExpressRouteCrossConnectionPeeringsInner.beginDelete | public void beginDelete(String resourceGroupName, String crossConnectionName, String peeringName) {
beginDeleteWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName).toBlocking().single().body();
} | java | public void beginDelete(String resourceGroupName, String crossConnectionName, String peeringName) {
beginDeleteWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName).toBlocking().single().body();
} | [
"public",
"void",
"beginDelete",
"(",
"String",
"resourceGroupName",
",",
"String",
"crossConnectionName",
",",
"String",
"peeringName",
")",
"{",
"beginDeleteWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"crossConnectionName",
",",
"peeringName",
")",
".",
... | Deletes the specified peering from the ExpressRouteCrossConnection.
@param resourceGroupName The name of the resource group.
@param crossConnectionName The name of the ExpressRouteCrossConnection.
@param peeringName The name of the peering.
@throws IllegalArgumentException thrown if parameters fail the validation
@thr... | [
"Deletes",
"the",
"specified",
"peering",
"from",
"the",
"ExpressRouteCrossConnection",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCrossConnectionPeeringsInner.java#L298-L300 |
UrielCh/ovh-java-sdk | ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java | ApiOvhCloud.project_serviceName_network_private_networkId_GET | public OvhNetwork project_serviceName_network_private_networkId_GET(String serviceName, String networkId) throws IOException {
String qPath = "/cloud/project/{serviceName}/network/private/{networkId}";
StringBuilder sb = path(qPath, serviceName, networkId);
String resp = exec(qPath, "GET", sb.toString(), null);
... | java | public OvhNetwork project_serviceName_network_private_networkId_GET(String serviceName, String networkId) throws IOException {
String qPath = "/cloud/project/{serviceName}/network/private/{networkId}";
StringBuilder sb = path(qPath, serviceName, networkId);
String resp = exec(qPath, "GET", sb.toString(), null);
... | [
"public",
"OvhNetwork",
"project_serviceName_network_private_networkId_GET",
"(",
"String",
"serviceName",
",",
"String",
"networkId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/cloud/project/{serviceName}/network/private/{networkId}\"",
";",
"StringBuilder",
... | Get private network
REST: GET /cloud/project/{serviceName}/network/private/{networkId}
@param networkId [required] Network id
@param serviceName [required] Service name | [
"Get",
"private",
"network"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java#L781-L786 |
cdapio/tigon | tigon-api/src/main/java/co/cask/tigon/api/common/Bytes.java | Bytes.putFloat | public static int putFloat(byte [] bytes, int offset, float f) {
return putInt(bytes, offset, Float.floatToRawIntBits(f));
} | java | public static int putFloat(byte [] bytes, int offset, float f) {
return putInt(bytes, offset, Float.floatToRawIntBits(f));
} | [
"public",
"static",
"int",
"putFloat",
"(",
"byte",
"[",
"]",
"bytes",
",",
"int",
"offset",
",",
"float",
"f",
")",
"{",
"return",
"putInt",
"(",
"bytes",
",",
"offset",
",",
"Float",
".",
"floatToRawIntBits",
"(",
"f",
")",
")",
";",
"}"
] | Put a float value out to the specified byte array position.
@param bytes byte array
@param offset offset to write to
@param f float value
@return New offset in <code>bytes</code> | [
"Put",
"a",
"float",
"value",
"out",
"to",
"the",
"specified",
"byte",
"array",
"position",
"."
] | train | https://github.com/cdapio/tigon/blob/5be6dffd7c79519d1211bb08f75be7dcfbbad392/tigon-api/src/main/java/co/cask/tigon/api/common/Bytes.java#L469-L471 |
Impetus/Kundera | src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/datahandler/CassandraDataHandlerBase.java | CassandraDataHandlerBase.getThriftRow | private ThriftRow getThriftRow(Object id, String columnFamily, Map<String, ThriftRow> thriftRows)
{
ThriftRow tr = thriftRows.get(columnFamily);
if (tr == null)
{
tr = new ThriftRow();
tr.setColumnFamilyName(columnFamily); // column-family name
tr.setId(id... | java | private ThriftRow getThriftRow(Object id, String columnFamily, Map<String, ThriftRow> thriftRows)
{
ThriftRow tr = thriftRows.get(columnFamily);
if (tr == null)
{
tr = new ThriftRow();
tr.setColumnFamilyName(columnFamily); // column-family name
tr.setId(id... | [
"private",
"ThriftRow",
"getThriftRow",
"(",
"Object",
"id",
",",
"String",
"columnFamily",
",",
"Map",
"<",
"String",
",",
"ThriftRow",
">",
"thriftRows",
")",
"{",
"ThriftRow",
"tr",
"=",
"thriftRows",
".",
"get",
"(",
"columnFamily",
")",
";",
"if",
"("... | Gets the thrift row.
@param id
the id
@param columnFamily
the column family
@param thriftRows
the thrift rows
@return the thrift row | [
"Gets",
"the",
"thrift",
"row",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/datahandler/CassandraDataHandlerBase.java#L436-L447 |
grpc/grpc-java | stub/src/main/java/io/grpc/stub/ClientCalls.java | ClientCalls.blockingUnaryCall | public static <ReqT, RespT> RespT blockingUnaryCall(
Channel channel, MethodDescriptor<ReqT, RespT> method, CallOptions callOptions, ReqT req) {
ThreadlessExecutor executor = new ThreadlessExecutor();
ClientCall<ReqT, RespT> call = channel.newCall(method, callOptions.withExecutor(executor));
try {
... | java | public static <ReqT, RespT> RespT blockingUnaryCall(
Channel channel, MethodDescriptor<ReqT, RespT> method, CallOptions callOptions, ReqT req) {
ThreadlessExecutor executor = new ThreadlessExecutor();
ClientCall<ReqT, RespT> call = channel.newCall(method, callOptions.withExecutor(executor));
try {
... | [
"public",
"static",
"<",
"ReqT",
",",
"RespT",
">",
"RespT",
"blockingUnaryCall",
"(",
"Channel",
"channel",
",",
"MethodDescriptor",
"<",
"ReqT",
",",
"RespT",
">",
"method",
",",
"CallOptions",
"callOptions",
",",
"ReqT",
"req",
")",
"{",
"ThreadlessExecutor... | Executes a unary call and blocks on the response. The {@code call} should not be already
started. After calling this method, {@code call} should no longer be used.
@return the single response message. | [
"Executes",
"a",
"unary",
"call",
"and",
"blocks",
"on",
"the",
"response",
".",
"The",
"{",
"@code",
"call",
"}",
"should",
"not",
"be",
"already",
"started",
".",
"After",
"calling",
"this",
"method",
"{",
"@code",
"call",
"}",
"should",
"no",
"longer"... | train | https://github.com/grpc/grpc-java/blob/973885457f9609de232d2553b82c67f6c3ff57bf/stub/src/main/java/io/grpc/stub/ClientCalls.java#L123-L146 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/NFSubstitution.java | NFSubstitution.doSubstitution | public void doSubstitution(long number, StringBuilder toInsertInto, int position, int recursionCount) {
// perform a transformation on the number that is dependent
// on the type of substitution this is, then just call its
// rule set's format() method to format the result
long numberToF... | java | public void doSubstitution(long number, StringBuilder toInsertInto, int position, int recursionCount) {
// perform a transformation on the number that is dependent
// on the type of substitution this is, then just call its
// rule set's format() method to format the result
long numberToF... | [
"public",
"void",
"doSubstitution",
"(",
"long",
"number",
",",
"StringBuilder",
"toInsertInto",
",",
"int",
"position",
",",
"int",
"recursionCount",
")",
"{",
"// perform a transformation on the number that is dependent",
"// on the type of substitution this is, then just call ... | Performs a mathematical operation on the number, formats it using
either ruleSet or decimalFormat, and inserts the result into
toInsertInto.
@param number The number being formatted.
@param toInsertInto The string we insert the result into
@param position The position in toInsertInto where the owning rule's
rule text b... | [
"Performs",
"a",
"mathematical",
"operation",
"on",
"the",
"number",
"formats",
"it",
"using",
"either",
"ruleSet",
"or",
"decimalFormat",
"and",
"inserts",
"the",
"result",
"into",
"toInsertInto",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/NFSubstitution.java#L293-L304 |
jparsec/jparsec | jparsec/src/main/java/org/jparsec/pattern/Patterns.java | Patterns.some | @Deprecated
public static Pattern some(int min, int max, CharPredicate predicate) {
return times(min, max, predicate);
} | java | @Deprecated
public static Pattern some(int min, int max, CharPredicate predicate) {
return times(min, max, predicate);
} | [
"@",
"Deprecated",
"public",
"static",
"Pattern",
"some",
"(",
"int",
"min",
",",
"int",
"max",
",",
"CharPredicate",
"predicate",
")",
"{",
"return",
"times",
"(",
"min",
",",
"max",
",",
"predicate",
")",
";",
"}"
] | Returns a {@link Pattern} that matches at least {@code min} and up to {@code max} number of characters satisfying
{@code predicate},
@deprecated Use {@link #times(int, int, CharPredicate)} instead. | [
"Returns",
"a",
"{"
] | train | https://github.com/jparsec/jparsec/blob/df1280259f5da9eb5ffc537437569dddba66cb94/jparsec/src/main/java/org/jparsec/pattern/Patterns.java#L400-L403 |
lessthanoptimal/BoofCV | integration/boofcv-android/src/main/java/boofcv/android/VisualizeImageData.java | VisualizeImageData.colorizeSign | public static void colorizeSign( GrayF32 input , float maxAbsValue , Bitmap output , byte[] storage ) {
shapeShape(input, output);
if( storage == null )
storage = declareStorage(output,null);
if( maxAbsValue < 0 )
maxAbsValue = ImageStatistics.maxAbs(input);
int indexDst = 0;
for( int y = 0; y < inp... | java | public static void colorizeSign( GrayF32 input , float maxAbsValue , Bitmap output , byte[] storage ) {
shapeShape(input, output);
if( storage == null )
storage = declareStorage(output,null);
if( maxAbsValue < 0 )
maxAbsValue = ImageStatistics.maxAbs(input);
int indexDst = 0;
for( int y = 0; y < inp... | [
"public",
"static",
"void",
"colorizeSign",
"(",
"GrayF32",
"input",
",",
"float",
"maxAbsValue",
",",
"Bitmap",
"output",
",",
"byte",
"[",
"]",
"storage",
")",
"{",
"shapeShape",
"(",
"input",
",",
"output",
")",
";",
"if",
"(",
"storage",
"==",
"null"... | Renders positive and negative values as two different colors.
@param input (Input) Image with positive and negative values.
@param maxAbsValue The largest absolute value of any pixel in the image. Set to < 0 if not known.
@param output (Output) Bitmap ARGB_8888 image.
@param storage Optional working buffer for Bitma... | [
"Renders",
"positive",
"and",
"negative",
"values",
"as",
"two",
"different",
"colors",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-android/src/main/java/boofcv/android/VisualizeImageData.java#L137-L166 |
jenkinsci/jenkins | core/src/main/java/hudson/model/User.java | User.getOrCreateByIdOrFullName | public static @Nonnull User getOrCreateByIdOrFullName(@Nonnull String idOrFullName) {
return get(idOrFullName, true, Collections.emptyMap());
} | java | public static @Nonnull User getOrCreateByIdOrFullName(@Nonnull String idOrFullName) {
return get(idOrFullName, true, Collections.emptyMap());
} | [
"public",
"static",
"@",
"Nonnull",
"User",
"getOrCreateByIdOrFullName",
"(",
"@",
"Nonnull",
"String",
"idOrFullName",
")",
"{",
"return",
"get",
"(",
"idOrFullName",
",",
"true",
",",
"Collections",
".",
"emptyMap",
"(",
")",
")",
";",
"}"
] | Get the user by ID or Full Name.
<p>
If the user does not exist, creates a new one on-demand.
<p>
Use {@link #getById} when you know you have an ID.
In this method Jenkins will try to resolve the {@link User} by full name with help of various
{@link hudson.tasks.UserNameResolver}.
This is slow (see JENKINS-23281).
@p... | [
"Get",
"the",
"user",
"by",
"ID",
"or",
"Full",
"Name",
".",
"<p",
">",
"If",
"the",
"user",
"does",
"not",
"exist",
"creates",
"a",
"new",
"one",
"on",
"-",
"demand",
"."
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/User.java#L569-L571 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/ThreadLocalRandom.java | ThreadLocalRandom.ints | public IntStream ints(long streamSize, int randomNumberOrigin,
int randomNumberBound) {
if (streamSize < 0L)
throw new IllegalArgumentException(BAD_SIZE);
if (randomNumberOrigin >= randomNumberBound)
throw new IllegalArgumentException(BAD_RANGE);
... | java | public IntStream ints(long streamSize, int randomNumberOrigin,
int randomNumberBound) {
if (streamSize < 0L)
throw new IllegalArgumentException(BAD_SIZE);
if (randomNumberOrigin >= randomNumberBound)
throw new IllegalArgumentException(BAD_RANGE);
... | [
"public",
"IntStream",
"ints",
"(",
"long",
"streamSize",
",",
"int",
"randomNumberOrigin",
",",
"int",
"randomNumberBound",
")",
"{",
"if",
"(",
"streamSize",
"<",
"0L",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"BAD_SIZE",
")",
";",
"if",
"(",
... | Returns a stream producing the given {@code streamSize} number
of pseudorandom {@code int} values, each conforming to the given
origin (inclusive) and bound (exclusive).
@param streamSize the number of values to generate
@param randomNumberOrigin the origin (inclusive) of each random value
@param randomNumberBound the... | [
"Returns",
"a",
"stream",
"producing",
"the",
"given",
"{",
"@code",
"streamSize",
"}",
"number",
"of",
"pseudorandom",
"{",
"@code",
"int",
"}",
"values",
"each",
"conforming",
"to",
"the",
"given",
"origin",
"(",
"inclusive",
")",
"and",
"bound",
"(",
"e... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/ThreadLocalRandom.java#L515-L525 |
domaframework/doma-gen | src/main/java/org/seasar/doma/extension/gen/Generator.java | Generator.createTemplateLoader | protected TemplateLoader createTemplateLoader(File templateFilePrimaryDir) {
TemplateLoader primary = null;
if (templateFilePrimaryDir != null) {
try {
primary = new FileTemplateLoader(templateFilePrimaryDir);
} catch (IOException e) {
throw new GenException(Message.DOMAGEN9001, e, e... | java | protected TemplateLoader createTemplateLoader(File templateFilePrimaryDir) {
TemplateLoader primary = null;
if (templateFilePrimaryDir != null) {
try {
primary = new FileTemplateLoader(templateFilePrimaryDir);
} catch (IOException e) {
throw new GenException(Message.DOMAGEN9001, e, e... | [
"protected",
"TemplateLoader",
"createTemplateLoader",
"(",
"File",
"templateFilePrimaryDir",
")",
"{",
"TemplateLoader",
"primary",
"=",
"null",
";",
"if",
"(",
"templateFilePrimaryDir",
"!=",
"null",
")",
"{",
"try",
"{",
"primary",
"=",
"new",
"FileTemplateLoader... | {@link TemplateLoader}を作成します。
@param templateFilePrimaryDir テンプレートファイルを格納したプライマリディレクトリ、プライマリディレクトリを使用しない場合{@code null}
@return {@link TemplateLoader} | [
"{",
"@link",
"TemplateLoader",
"}",
"を作成します。"
] | train | https://github.com/domaframework/doma-gen/blob/8046e0b28d2167d444125f206ce36e554b3ee616/src/main/java/org/seasar/doma/extension/gen/Generator.java#L70-L84 |
raydac/java-comment-preprocessor | jcp/src/main/java/com/igormaznitsa/meta/common/utils/Deferrers.java | Deferrers.processDeferredActions | @Weight(value = Weight.Unit.VARIABLE, comment = "Depends on the current call stack depth")
public static void processDeferredActions() {
final int stackDepth = ThreadUtils.stackDepth();
final List<Deferred> list = REGISTRY.get();
final Iterator<Deferred> iterator = list.iterator();
while (iterator.h... | java | @Weight(value = Weight.Unit.VARIABLE, comment = "Depends on the current call stack depth")
public static void processDeferredActions() {
final int stackDepth = ThreadUtils.stackDepth();
final List<Deferred> list = REGISTRY.get();
final Iterator<Deferred> iterator = list.iterator();
while (iterator.h... | [
"@",
"Weight",
"(",
"value",
"=",
"Weight",
".",
"Unit",
".",
"VARIABLE",
",",
"comment",
"=",
"\"Depends on the current call stack depth\"",
")",
"public",
"static",
"void",
"processDeferredActions",
"(",
")",
"{",
"final",
"int",
"stackDepth",
"=",
"ThreadUtils"... | Process all defer actions for the current stack depth level.
@since 1.0 | [
"Process",
"all",
"defer",
"actions",
"for",
"the",
"current",
"stack",
"depth",
"level",
"."
] | train | https://github.com/raydac/java-comment-preprocessor/blob/83ac87b575ac084914d77695a8c8673de3b8300c/jcp/src/main/java/com/igormaznitsa/meta/common/utils/Deferrers.java#L214-L237 |
baratine/baratine | framework/src/main/java/com/caucho/v5/vfs/ReadStreamOld.java | ReadStreamOld.writeToStream | public void writeToStream(OutputStream os, int len)
throws IOException
{
while (len > 0) {
if (_readLength <= _readOffset) {
if (! readBuffer())
return;
}
int sublen = Math.min(len, _readLength - _readOffset);
os.write(_readBuffer, _readOffset, sublen);
_readO... | java | public void writeToStream(OutputStream os, int len)
throws IOException
{
while (len > 0) {
if (_readLength <= _readOffset) {
if (! readBuffer())
return;
}
int sublen = Math.min(len, _readLength - _readOffset);
os.write(_readBuffer, _readOffset, sublen);
_readO... | [
"public",
"void",
"writeToStream",
"(",
"OutputStream",
"os",
",",
"int",
"len",
")",
"throws",
"IOException",
"{",
"while",
"(",
"len",
">",
"0",
")",
"{",
"if",
"(",
"_readLength",
"<=",
"_readOffset",
")",
"{",
"if",
"(",
"!",
"readBuffer",
"(",
")"... | Writes <code>len<code> bytes to the output stream from this stream.
@param os destination stream.
@param len bytes to write. | [
"Writes",
"<code",
">",
"len<code",
">",
"bytes",
"to",
"the",
"output",
"stream",
"from",
"this",
"stream",
"."
] | train | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/vfs/ReadStreamOld.java#L1072-L1087 |
atomix/atomix | utils/src/main/java/io/atomix/utils/logging/ContextualLoggerFactory.java | ContextualLoggerFactory.getLogger | public static ContextualLogger getLogger(String name, LoggerContext context) {
return new ContextualLogger(LoggerFactory.getLogger(name), context);
} | java | public static ContextualLogger getLogger(String name, LoggerContext context) {
return new ContextualLogger(LoggerFactory.getLogger(name), context);
} | [
"public",
"static",
"ContextualLogger",
"getLogger",
"(",
"String",
"name",
",",
"LoggerContext",
"context",
")",
"{",
"return",
"new",
"ContextualLogger",
"(",
"LoggerFactory",
".",
"getLogger",
"(",
"name",
")",
",",
"context",
")",
";",
"}"
] | Returns a contextual logger.
@param name the contextual logger name
@param context the logger context
@return the logger | [
"Returns",
"a",
"contextual",
"logger",
"."
] | train | https://github.com/atomix/atomix/blob/3a94b7c80576d762dd0d396d4645df07a0b37c31/utils/src/main/java/io/atomix/utils/logging/ContextualLoggerFactory.java#L32-L34 |
alkacon/opencms-core | src/org/opencms/db/CmsSecurityManager.java | CmsSecurityManager.readUser | public CmsUser readUser(CmsRequestContext context, String username, String password) throws CmsException {
CmsDbContext dbc = m_dbContextFactory.getDbContext(context);
CmsUser result = null;
try {
result = m_driverManager.readUser(dbc, CmsOrganizationalUnit.removeLeadingSeparator(us... | java | public CmsUser readUser(CmsRequestContext context, String username, String password) throws CmsException {
CmsDbContext dbc = m_dbContextFactory.getDbContext(context);
CmsUser result = null;
try {
result = m_driverManager.readUser(dbc, CmsOrganizationalUnit.removeLeadingSeparator(us... | [
"public",
"CmsUser",
"readUser",
"(",
"CmsRequestContext",
"context",
",",
"String",
"username",
",",
"String",
"password",
")",
"throws",
"CmsException",
"{",
"CmsDbContext",
"dbc",
"=",
"m_dbContextFactory",
".",
"getDbContext",
"(",
"context",
")",
";",
"CmsUse... | Returns a user object if the password for the user is correct.<p>
If the user/password pair is not valid a <code>{@link CmsException}</code> is thrown.<p>
@param context the current request context
@param username the user name of the user that is to be read
@param password the password of the user that is to be read... | [
"Returns",
"a",
"user",
"object",
"if",
"the",
"password",
"for",
"the",
"user",
"is",
"correct",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsSecurityManager.java#L5523-L5535 |
UrielCh/ovh-java-sdk | ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java | ApiOvhMe.deposit_depositId_payment_GET | public OvhPayment deposit_depositId_payment_GET(String depositId) throws IOException {
String qPath = "/me/deposit/{depositId}/payment";
StringBuilder sb = path(qPath, depositId);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhPayment.class);
} | java | public OvhPayment deposit_depositId_payment_GET(String depositId) throws IOException {
String qPath = "/me/deposit/{depositId}/payment";
StringBuilder sb = path(qPath, depositId);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhPayment.class);
} | [
"public",
"OvhPayment",
"deposit_depositId_payment_GET",
"(",
"String",
"depositId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/me/deposit/{depositId}/payment\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
",",
"depositId",
")",
";",
... | Get this object properties
REST: GET /me/deposit/{depositId}/payment
@param depositId [required] | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java#L3304-L3309 |
xcesco/kripton | kripton-core/src/main/java/com/abubusoft/kripton/common/StringUtils.java | StringUtils.string2Writer | public static void string2Writer(String source, Writer out) throws IOException {
char[] buffer = source.toCharArray();
for (int i = 0; i < buffer.length; i++) {
out.append(buffer[i]);
}
out.flush();
} | java | public static void string2Writer(String source, Writer out) throws IOException {
char[] buffer = source.toCharArray();
for (int i = 0; i < buffer.length; i++) {
out.append(buffer[i]);
}
out.flush();
} | [
"public",
"static",
"void",
"string2Writer",
"(",
"String",
"source",
",",
"Writer",
"out",
")",
"throws",
"IOException",
"{",
"char",
"[",
"]",
"buffer",
"=",
"source",
".",
"toCharArray",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"... | String 2 writer.
@param source the source
@param out the out
@throws IOException Signals that an I/O exception has occurred. | [
"String",
"2",
"writer",
"."
] | train | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-core/src/main/java/com/abubusoft/kripton/common/StringUtils.java#L211-L218 |
mcxiaoke/Android-Next | core/src/main/java/com/mcxiaoke/next/utils/TrafficUtils.java | TrafficUtils.current | public static long current(Context context, String tag) {
Long appRxValue = sReceivedBytes.get(tag);
Long appTxValue = sSendBytes.get(tag);
if (appRxValue == null || appTxValue == null) {
if (DEBUG) {
LogUtils.w(TAG, "current() appRxValue or appTxValue is null.");
... | java | public static long current(Context context, String tag) {
Long appRxValue = sReceivedBytes.get(tag);
Long appTxValue = sSendBytes.get(tag);
if (appRxValue == null || appTxValue == null) {
if (DEBUG) {
LogUtils.w(TAG, "current() appRxValue or appTxValue is null.");
... | [
"public",
"static",
"long",
"current",
"(",
"Context",
"context",
",",
"String",
"tag",
")",
"{",
"Long",
"appRxValue",
"=",
"sReceivedBytes",
".",
"get",
"(",
"tag",
")",
";",
"Long",
"appTxValue",
"=",
"sSendBytes",
".",
"get",
"(",
"tag",
")",
";",
... | 计算当前流量
@param context Context
@param tag traffic tag
@return received bytes | [
"计算当前流量"
] | train | https://github.com/mcxiaoke/Android-Next/blob/1bfdf99d0b81a849aa0fa6697c53ed673151ca39/core/src/main/java/com/mcxiaoke/next/utils/TrafficUtils.java#L59-L78 |
stephenc/simple-java-mail | src/main/java/org/codemonkey/simplejavamail/Mailer.java | Mailer.logSession | private void logSession(Session session, TransportStrategy transportStrategy) {
final String logmsg = "starting mail session (host: %s, port: %s, username: %s, authenticate: %s, transport: %s)";
Properties properties = session.getProperties();
logger.debug(String.format(logmsg, properties.get(transportStrategy... | java | private void logSession(Session session, TransportStrategy transportStrategy) {
final String logmsg = "starting mail session (host: %s, port: %s, username: %s, authenticate: %s, transport: %s)";
Properties properties = session.getProperties();
logger.debug(String.format(logmsg, properties.get(transportStrategy... | [
"private",
"void",
"logSession",
"(",
"Session",
"session",
",",
"TransportStrategy",
"transportStrategy",
")",
"{",
"final",
"String",
"logmsg",
"=",
"\"starting mail session (host: %s, port: %s, username: %s, authenticate: %s, transport: %s)\"",
";",
"Properties",
"properties",... | Simply logs host details, credentials used and whether authentication will take place and finally the transport protocol used. | [
"Simply",
"logs",
"host",
"details",
"credentials",
"used",
"and",
"whether",
"authentication",
"will",
"take",
"place",
"and",
"finally",
"the",
"transport",
"protocol",
"used",
"."
] | train | https://github.com/stephenc/simple-java-mail/blob/8c5897e6bbc23c11e7c7eb5064f407625c653923/src/main/java/org/codemonkey/simplejavamail/Mailer.java#L240-L246 |
stephanrauh/AngularFaces | AngularFaces_2.0/AngularFaces-core/src/main/java/de/beyondjava/angularFaces/core/transformation/AttributeUtilities.java | AttributeUtilities.getAttribute | public static Object getAttribute(UIComponent component, String attributeName) {
Object value = component.getPassThroughAttributes().get(attributeName);
if (null == value) {
value = component.getAttributes().get(attributeName);
}
if (null == value) {
if (!attributeName.equals(attributeName.toLowerCase()))... | java | public static Object getAttribute(UIComponent component, String attributeName) {
Object value = component.getPassThroughAttributes().get(attributeName);
if (null == value) {
value = component.getAttributes().get(attributeName);
}
if (null == value) {
if (!attributeName.equals(attributeName.toLowerCase()))... | [
"public",
"static",
"Object",
"getAttribute",
"(",
"UIComponent",
"component",
",",
"String",
"attributeName",
")",
"{",
"Object",
"value",
"=",
"component",
".",
"getPassThroughAttributes",
"(",
")",
".",
"get",
"(",
"attributeName",
")",
";",
"if",
"(",
"nul... | Apache MyFaces make HMTL attributes of HTML elements
pass-through-attributes. This method finds the attribute, no matter
whether it is stored as an ordinary or as an pass-through-attribute. | [
"Apache",
"MyFaces",
"make",
"HMTL",
"attributes",
"of",
"HTML",
"elements",
"pass",
"-",
"through",
"-",
"attributes",
".",
"This",
"method",
"finds",
"the",
"attribute",
"no",
"matter",
"whether",
"it",
"is",
"stored",
"as",
"an",
"ordinary",
"or",
"as",
... | train | https://github.com/stephanrauh/AngularFaces/blob/43d915f004645b1bbbf2625214294dab0858ba01/AngularFaces_2.0/AngularFaces-core/src/main/java/de/beyondjava/angularFaces/core/transformation/AttributeUtilities.java#L37-L51 |
a-schild/jave2 | jave-core/src/main/java/ws/schild/jave/DefaultFFMPEGLocator.java | DefaultFFMPEGLocator.copyFile | private void copyFile(String path, File dest) {
String resourceName= "native/" + path;
try
{
LOG.debug("Copy from resource <"+resourceName+"> to target <"+dest.getAbsolutePath()+">");
if (copy(getClass().getResourceAsStream(resourceName), dest.getAbsolutePath()))
... | java | private void copyFile(String path, File dest) {
String resourceName= "native/" + path;
try
{
LOG.debug("Copy from resource <"+resourceName+"> to target <"+dest.getAbsolutePath()+">");
if (copy(getClass().getResourceAsStream(resourceName), dest.getAbsolutePath()))
... | [
"private",
"void",
"copyFile",
"(",
"String",
"path",
",",
"File",
"dest",
")",
"{",
"String",
"resourceName",
"=",
"\"native/\"",
"+",
"path",
";",
"try",
"{",
"LOG",
".",
"debug",
"(",
"\"Copy from resource <\"",
"+",
"resourceName",
"+",
"\"> to target <\""... | Copies a file bundled in the package to the supplied destination.
@param path The name of the bundled file.
@param dest The destination.
@throws RuntimeException If an unexpected error occurs. | [
"Copies",
"a",
"file",
"bundled",
"in",
"the",
"package",
"to",
"the",
"supplied",
"destination",
"."
] | train | https://github.com/a-schild/jave2/blob/1e7d6a1ca7c27cc63570f1aabb5c84ee124f3e26/jave-core/src/main/java/ws/schild/jave/DefaultFFMPEGLocator.java#L127-L153 |
xwiki/xwiki-rendering | xwiki-rendering-wikimodel/src/main/java/org/xwiki/rendering/wikimodel/WikiPageUtil.java | WikiPageUtil.isValidXmlName | public static boolean isValidXmlName(String tagName, boolean colonEnabled)
{
boolean valid = false;
int len = tagName != null ? tagName.length() : 0;
for (int i = 0; i < len; i++) {
char ch = tagName.charAt(i);
if (i == 0) {
valid = isValidXmlNameStart... | java | public static boolean isValidXmlName(String tagName, boolean colonEnabled)
{
boolean valid = false;
int len = tagName != null ? tagName.length() : 0;
for (int i = 0; i < len; i++) {
char ch = tagName.charAt(i);
if (i == 0) {
valid = isValidXmlNameStart... | [
"public",
"static",
"boolean",
"isValidXmlName",
"(",
"String",
"tagName",
",",
"boolean",
"colonEnabled",
")",
"{",
"boolean",
"valid",
"=",
"false",
";",
"int",
"len",
"=",
"tagName",
"!=",
"null",
"?",
"tagName",
".",
"length",
"(",
")",
":",
"0",
";"... | This method checks the given string and returns <code>true</code> if it is a valid XML name
<p>
See http://www.w3.org/TR/xml/#NT-Name.
</p>
@param tagName the name to check
@param colonEnabled if this flag is <code>true</code> then this method accepts the ':' symbol in the name
@return <code>true</code> if the given s... | [
"This",
"method",
"checks",
"the",
"given",
"string",
"and",
"returns",
"<code",
">",
"true<",
"/",
"code",
">",
"if",
"it",
"is",
"a",
"valid",
"XML",
"name",
"<p",
">",
"See",
"http",
":",
"//",
"www",
".",
"w3",
".",
"org",
"/",
"TR",
"/",
"xm... | train | https://github.com/xwiki/xwiki-rendering/blob/a21cdfcb64ef5b76872e3eedf78c530f26d7beb0/xwiki-rendering-wikimodel/src/main/java/org/xwiki/rendering/wikimodel/WikiPageUtil.java#L236-L252 |
zaproxy/zaproxy | src/org/zaproxy/zap/extension/pscan/ExtensionPassiveScan.java | ExtensionPassiveScan.setPluginPassiveScannerAlertThreshold | void setPluginPassiveScannerAlertThreshold(int pluginId, Plugin.AlertThreshold alertThreshold) {
PluginPassiveScanner scanner = getPluginPassiveScanner(pluginId);
if (scanner != null) {
scanner.setAlertThreshold(alertThreshold);
scanner.setEnabled(!Plugin.AlertThreshold.OFF.equal... | java | void setPluginPassiveScannerAlertThreshold(int pluginId, Plugin.AlertThreshold alertThreshold) {
PluginPassiveScanner scanner = getPluginPassiveScanner(pluginId);
if (scanner != null) {
scanner.setAlertThreshold(alertThreshold);
scanner.setEnabled(!Plugin.AlertThreshold.OFF.equal... | [
"void",
"setPluginPassiveScannerAlertThreshold",
"(",
"int",
"pluginId",
",",
"Plugin",
".",
"AlertThreshold",
"alertThreshold",
")",
"{",
"PluginPassiveScanner",
"scanner",
"=",
"getPluginPassiveScanner",
"(",
"pluginId",
")",
";",
"if",
"(",
"scanner",
"!=",
"null",... | Sets the value of {@code alertThreshold} of the plug-in passive scanner with the given {@code pluginId}.
<p>
If the {@code alertThreshold} is {@code OFF} the scanner is also disabled. The call to this method has no effect if no
scanner with the given {@code pluginId} exist.
@param pluginId the ID of the plug-in passiv... | [
"Sets",
"the",
"value",
"of",
"{",
"@code",
"alertThreshold",
"}",
"of",
"the",
"plug",
"-",
"in",
"passive",
"scanner",
"with",
"the",
"given",
"{",
"@code",
"pluginId",
"}",
".",
"<p",
">",
"If",
"the",
"{",
"@code",
"alertThreshold",
"}",
"is",
"{",... | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/extension/pscan/ExtensionPassiveScan.java#L386-L393 |
kyoken74/gwt-angular | gwt-angular-user/src/main/java/com/asayama/gwt/angular/user/client/ui/directive/GwtWidget.java | GwtWidget.link | @Override
public void link(NGScope scope, JQElement element, JSON attrs) {
IsWidget widget = scope.get(getName());
String id = "gwt-widget-" + counter++;
element.attr("id", id);
RootPanel.get(id).add(widget);
} | java | @Override
public void link(NGScope scope, JQElement element, JSON attrs) {
IsWidget widget = scope.get(getName());
String id = "gwt-widget-" + counter++;
element.attr("id", id);
RootPanel.get(id).add(widget);
} | [
"@",
"Override",
"public",
"void",
"link",
"(",
"NGScope",
"scope",
",",
"JQElement",
"element",
",",
"JSON",
"attrs",
")",
"{",
"IsWidget",
"widget",
"=",
"scope",
".",
"get",
"(",
"getName",
"(",
")",
")",
";",
"String",
"id",
"=",
"\"gwt-widget-\"",
... | Replaces the element body with the GWT widget passed via gwt-widget
attribute. GWT widget must implement IsWidget interface. | [
"Replaces",
"the",
"element",
"body",
"with",
"the",
"GWT",
"widget",
"passed",
"via",
"gwt",
"-",
"widget",
"attribute",
".",
"GWT",
"widget",
"must",
"implement",
"IsWidget",
"interface",
"."
] | train | https://github.com/kyoken74/gwt-angular/blob/99a6efa277dd4771d9cba976b25fdf0ac4fdeca2/gwt-angular-user/src/main/java/com/asayama/gwt/angular/user/client/ui/directive/GwtWidget.java#L36-L42 |
roboconf/roboconf-platform | core/roboconf-messaging-rabbitmq/src/main/java/net/roboconf/messaging/rabbitmq/internal/utils/RabbitMqUtils.java | RabbitMqUtils.configureFactory | public static void configureFactory( ConnectionFactory factory, Map<String,String> configuration )
throws IOException {
final Logger logger = Logger.getLogger( RabbitMqUtils.class.getName());
logger.fine( "Configuring a connection factory for RabbitMQ." );
String messageServerIp = configuration.get( RABBITMQ_S... | java | public static void configureFactory( ConnectionFactory factory, Map<String,String> configuration )
throws IOException {
final Logger logger = Logger.getLogger( RabbitMqUtils.class.getName());
logger.fine( "Configuring a connection factory for RabbitMQ." );
String messageServerIp = configuration.get( RABBITMQ_S... | [
"public",
"static",
"void",
"configureFactory",
"(",
"ConnectionFactory",
"factory",
",",
"Map",
"<",
"String",
",",
"String",
">",
"configuration",
")",
"throws",
"IOException",
"{",
"final",
"Logger",
"logger",
"=",
"Logger",
".",
"getLogger",
"(",
"RabbitMqUt... | Configures the connection factory with the right settings.
@param factory the connection factory
@param configuration the messaging configuration
@throws IOException if something went wrong
@see RabbitMqConstants | [
"Configures",
"the",
"connection",
"factory",
"with",
"the",
"right",
"settings",
"."
] | train | https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-messaging-rabbitmq/src/main/java/net/roboconf/messaging/rabbitmq/internal/utils/RabbitMqUtils.java#L87-L154 |
lmdbjava/lmdbjava | src/main/java/org/lmdbjava/Env.java | Env.openDbi | public Dbi<T> openDbi(final String name, final DbiFlags... flags) {
final byte[] nameBytes = name == null ? null : name.getBytes(UTF_8);
return openDbi(nameBytes, flags);
} | java | public Dbi<T> openDbi(final String name, final DbiFlags... flags) {
final byte[] nameBytes = name == null ? null : name.getBytes(UTF_8);
return openDbi(nameBytes, flags);
} | [
"public",
"Dbi",
"<",
"T",
">",
"openDbi",
"(",
"final",
"String",
"name",
",",
"final",
"DbiFlags",
"...",
"flags",
")",
"{",
"final",
"byte",
"[",
"]",
"nameBytes",
"=",
"name",
"==",
"null",
"?",
"null",
":",
"name",
".",
"getBytes",
"(",
"UTF_8",... | Convenience method that opens a {@link Dbi} with a UTF-8 database name.
@param name name of the database (or null if no name is required)
@param flags to open the database with
@return a database that is ready to use | [
"Convenience",
"method",
"that",
"opens",
"a",
"{",
"@link",
"Dbi",
"}",
"with",
"a",
"UTF",
"-",
"8",
"database",
"name",
"."
] | train | https://github.com/lmdbjava/lmdbjava/blob/5912beb1037722c71f3ddc05e70fcbe739dfa272/src/main/java/org/lmdbjava/Env.java#L262-L265 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.comms.server/src/com/ibm/ws/sib/comms/server/clientsupport/CATAsynchConsumer.java | CATAsynchConsumer.sendMessage | private boolean sendMessage(SIBusMessage sibMessage, boolean lastMsg, Integer priority)
throws MessageEncodeFailedException,
IncorrectMessageTypeException,
MessageCopyFailedException,
UnsupportedEncodingException {
if (TraceComponen... | java | private boolean sendMessage(SIBusMessage sibMessage, boolean lastMsg, Integer priority)
throws MessageEncodeFailedException,
IncorrectMessageTypeException,
MessageCopyFailedException,
UnsupportedEncodingException {
if (TraceComponen... | [
"private",
"boolean",
"sendMessage",
"(",
"SIBusMessage",
"sibMessage",
",",
"boolean",
"lastMsg",
",",
"Integer",
"priority",
")",
"throws",
"MessageEncodeFailedException",
",",
"IncorrectMessageTypeException",
",",
"MessageCopyFailedException",
",",
"UnsupportedEncodingExce... | Method to perform a single send of a message to the client.
@param sibMessage The message to send.
@param lastMsg true if this is the last message in the batch.
@param priority The priority to sent the message
@return Returns false if a communications error prevented the message
from being sent.
@throws MessageEncod... | [
"Method",
"to",
"perform",
"a",
"single",
"send",
"of",
"a",
"message",
"to",
"the",
"client",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.server/src/com/ibm/ws/sib/comms/server/clientsupport/CATAsynchConsumer.java#L689-L712 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java | DefaultGroovyMethods.primitiveArrayGet | protected static Object primitiveArrayGet(Object self, int idx) {
return Array.get(self, normaliseIndex(idx, Array.getLength(self)));
} | java | protected static Object primitiveArrayGet(Object self, int idx) {
return Array.get(self, normaliseIndex(idx, Array.getLength(self)));
} | [
"protected",
"static",
"Object",
"primitiveArrayGet",
"(",
"Object",
"self",
",",
"int",
"idx",
")",
"{",
"return",
"Array",
".",
"get",
"(",
"self",
",",
"normaliseIndex",
"(",
"idx",
",",
"Array",
".",
"getLength",
"(",
"self",
")",
")",
")",
";",
"}... | Implements the getAt(int) method for primitive type arrays.
@param self an array object
@param idx the index of interest
@return the returned value from the array
@since 1.5.0 | [
"Implements",
"the",
"getAt",
"(",
"int",
")",
"method",
"for",
"primitive",
"type",
"arrays",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L14544-L14546 |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/io/las/ALasDataManager.java | ALasDataManager.getDataManager | public static ALasDataManager getDataManager( File dataFile, GridCoverage2D inDem, double elevThreshold,
CoordinateReferenceSystem inCrs ) {
String lcName = dataFile.getName().toLowerCase();
if (lcName.endsWith(".las")) {
return new LasFileDataManager(dataFile, inDem, elevThresho... | java | public static ALasDataManager getDataManager( File dataFile, GridCoverage2D inDem, double elevThreshold,
CoordinateReferenceSystem inCrs ) {
String lcName = dataFile.getName().toLowerCase();
if (lcName.endsWith(".las")) {
return new LasFileDataManager(dataFile, inDem, elevThresho... | [
"public",
"static",
"ALasDataManager",
"getDataManager",
"(",
"File",
"dataFile",
",",
"GridCoverage2D",
"inDem",
",",
"double",
"elevThreshold",
",",
"CoordinateReferenceSystem",
"inCrs",
")",
"{",
"String",
"lcName",
"=",
"dataFile",
".",
"getName",
"(",
")",
".... | Factory method to create {@link ALasDataManager}.
@param lasFile the las file or las folder index file.
@param inDem a dem to normalize the elevation. If <code>!null</code>, the height over the dtm is added as {@link LasRecord#groundElevation}.
@param elevThreshold a threshold to use for the elevation normalization.
@... | [
"Factory",
"method",
"to",
"create",
"{",
"@link",
"ALasDataManager",
"}",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/las/ALasDataManager.java#L73-L92 |
buschmais/jqa-java-plugin | src/main/java/com/buschmais/jqassistant/plugin/java/impl/scanner/visitor/AbstractAnnotationVisitor.java | AbstractAnnotationVisitor.addValue | private void addValue(String name, ValueDescriptor<?> value) {
if (arrayValueDescriptor != null && name == null) {
getArrayValue().add(value);
} else {
setValue(descriptor, value);
}
} | java | private void addValue(String name, ValueDescriptor<?> value) {
if (arrayValueDescriptor != null && name == null) {
getArrayValue().add(value);
} else {
setValue(descriptor, value);
}
} | [
"private",
"void",
"addValue",
"(",
"String",
"name",
",",
"ValueDescriptor",
"<",
"?",
">",
"value",
")",
"{",
"if",
"(",
"arrayValueDescriptor",
"!=",
"null",
"&&",
"name",
"==",
"null",
")",
"{",
"getArrayValue",
"(",
")",
".",
"add",
"(",
"value",
... | Add the descriptor as value to the current annotation or array value.
@param name
The name.
@param value
The value. | [
"Add",
"the",
"descriptor",
"as",
"value",
"to",
"the",
"current",
"annotation",
"or",
"array",
"value",
"."
] | train | https://github.com/buschmais/jqa-java-plugin/blob/4c050943e9c28cf1c4a08aa962d5b5bf03c4fe54/src/main/java/com/buschmais/jqassistant/plugin/java/impl/scanner/visitor/AbstractAnnotationVisitor.java#L121-L127 |
UrielCh/ovh-java-sdk | ovh-java-sdk-dedicatedCloud/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedCloud.java | ApiOvhDedicatedCloud.serviceName_datacenter_datacenterId_orderableHostProfiles_GET | public ArrayList<net.minidev.ovh.api.dedicatedcloud.host.OvhProfile> serviceName_datacenter_datacenterId_orderableHostProfiles_GET(String serviceName, Long datacenterId) throws IOException {
String qPath = "/dedicatedCloud/{serviceName}/datacenter/{datacenterId}/orderableHostProfiles";
StringBuilder sb = path(qPath... | java | public ArrayList<net.minidev.ovh.api.dedicatedcloud.host.OvhProfile> serviceName_datacenter_datacenterId_orderableHostProfiles_GET(String serviceName, Long datacenterId) throws IOException {
String qPath = "/dedicatedCloud/{serviceName}/datacenter/{datacenterId}/orderableHostProfiles";
StringBuilder sb = path(qPath... | [
"public",
"ArrayList",
"<",
"net",
".",
"minidev",
".",
"ovh",
".",
"api",
".",
"dedicatedcloud",
".",
"host",
".",
"OvhProfile",
">",
"serviceName_datacenter_datacenterId_orderableHostProfiles_GET",
"(",
"String",
"serviceName",
",",
"Long",
"datacenterId",
")",
"t... | List available hosts in a given Private Cloud Datacenter
REST: GET /dedicatedCloud/{serviceName}/datacenter/{datacenterId}/orderableHostProfiles
@param serviceName [required] Domain of the service
@param datacenterId [required] | [
"List",
"available",
"hosts",
"in",
"a",
"given",
"Private",
"Cloud",
"Datacenter"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dedicatedCloud/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedCloud.java#L2355-L2360 |
Azure/azure-sdk-for-java | hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ExtensionsInner.java | ExtensionsInner.getAsync | public Observable<ExtensionInner> getAsync(String resourceGroupName, String clusterName, String extensionName) {
return getWithServiceResponseAsync(resourceGroupName, clusterName, extensionName).map(new Func1<ServiceResponse<ExtensionInner>, ExtensionInner>() {
@Override
public Extension... | java | public Observable<ExtensionInner> getAsync(String resourceGroupName, String clusterName, String extensionName) {
return getWithServiceResponseAsync(resourceGroupName, clusterName, extensionName).map(new Func1<ServiceResponse<ExtensionInner>, ExtensionInner>() {
@Override
public Extension... | [
"public",
"Observable",
"<",
"ExtensionInner",
">",
"getAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"clusterName",
",",
"String",
"extensionName",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"clusterName",
",",
"ext... | Gets the extension properties for the specified HDInsight cluster extension.
@param resourceGroupName The name of the resource group.
@param clusterName The name of the cluster.
@param extensionName The name of the cluster extension.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the... | [
"Gets",
"the",
"extension",
"properties",
"for",
"the",
"specified",
"HDInsight",
"cluster",
"extension",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ExtensionsInner.java#L733-L740 |
aws/aws-sdk-java | aws-java-sdk-cloudsearch/src/main/java/com/amazonaws/services/cloudsearchdomain/model/Hit.java | Hit.withHighlights | public Hit withHighlights(java.util.Map<String, String> highlights) {
setHighlights(highlights);
return this;
} | java | public Hit withHighlights(java.util.Map<String, String> highlights) {
setHighlights(highlights);
return this;
} | [
"public",
"Hit",
"withHighlights",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"highlights",
")",
"{",
"setHighlights",
"(",
"highlights",
")",
";",
"return",
"this",
";",
"}"
] | <p>
The highlights returned from a document that matches the search request.
</p>
@param highlights
The highlights returned from a document that matches the search request.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"The",
"highlights",
"returned",
"from",
"a",
"document",
"that",
"matches",
"the",
"search",
"request",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-cloudsearch/src/main/java/com/amazonaws/services/cloudsearchdomain/model/Hit.java#L259-L262 |
google/closure-templates | java/src/com/google/template/soy/parsepasses/contextautoesc/SoyAutoescapeException.java | SoyAutoescapeException.createCausedWithNode | static SoyAutoescapeException createCausedWithNode(
String message, Throwable cause, SoyNode node) {
return new SoyAutoescapeException(message, cause, node);
} | java | static SoyAutoescapeException createCausedWithNode(
String message, Throwable cause, SoyNode node) {
return new SoyAutoescapeException(message, cause, node);
} | [
"static",
"SoyAutoescapeException",
"createCausedWithNode",
"(",
"String",
"message",
",",
"Throwable",
"cause",
",",
"SoyNode",
"node",
")",
"{",
"return",
"new",
"SoyAutoescapeException",
"(",
"message",
",",
"cause",
",",
"node",
")",
";",
"}"
] | Creates a SoyAutoescapeException, with meta info filled in based on the given Soy node.
@param message The error message.
@param cause The cause of this exception.
@param node The node from which to derive the exception meta info.
@return The new SoyAutoescapeException object. | [
"Creates",
"a",
"SoyAutoescapeException",
"with",
"meta",
"info",
"filled",
"in",
"based",
"on",
"the",
"given",
"Soy",
"node",
"."
] | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/parsepasses/contextautoesc/SoyAutoescapeException.java#L48-L51 |
Azure/azure-sdk-for-java | dns/resource-manager/v2016_04_01/src/main/java/com/microsoft/azure/management/dns/v2016_04_01/implementation/RecordSetsInner.java | RecordSetsInner.listByTypeAsync | public Observable<Page<RecordSetInner>> listByTypeAsync(final String resourceGroupName, final String zoneName, final RecordType recordType, final Integer top, final String recordsetnamesuffix) {
return listByTypeWithServiceResponseAsync(resourceGroupName, zoneName, recordType, top, recordsetnamesuffix)
... | java | public Observable<Page<RecordSetInner>> listByTypeAsync(final String resourceGroupName, final String zoneName, final RecordType recordType, final Integer top, final String recordsetnamesuffix) {
return listByTypeWithServiceResponseAsync(resourceGroupName, zoneName, recordType, top, recordsetnamesuffix)
... | [
"public",
"Observable",
"<",
"Page",
"<",
"RecordSetInner",
">",
">",
"listByTypeAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"zoneName",
",",
"final",
"RecordType",
"recordType",
",",
"final",
"Integer",
"top",
",",
"final",
"Str... | Lists the record sets of a specified type in a DNS zone.
@param resourceGroupName The name of the resource group.
@param zoneName The name of the DNS zone (without a terminating dot).
@param recordType The type of record sets to enumerate. Possible values include: 'A', 'AAAA', 'CNAME', 'MX', 'NS', 'PTR', 'SOA', 'SRV',... | [
"Lists",
"the",
"record",
"sets",
"of",
"a",
"specified",
"type",
"in",
"a",
"DNS",
"zone",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/dns/resource-manager/v2016_04_01/src/main/java/com/microsoft/azure/management/dns/v2016_04_01/implementation/RecordSetsInner.java#L1015-L1023 |
scaleset/scaleset-geo | src/main/java/com/scaleset/geo/math/GoogleMapsTileMath.java | GoogleMapsTileMath.lngLatToMeters | public Coordinate lngLatToMeters(Coordinate coord) {
double mx = coord.x * originShift / 180.0;
double my = Math.log(Math.tan((90 + coord.y) * Math.PI / 360.0)) / (Math.PI / 180.0);
my *= originShift / 180.0;
return new Coordinate(mx, my);
} | java | public Coordinate lngLatToMeters(Coordinate coord) {
double mx = coord.x * originShift / 180.0;
double my = Math.log(Math.tan((90 + coord.y) * Math.PI / 360.0)) / (Math.PI / 180.0);
my *= originShift / 180.0;
return new Coordinate(mx, my);
} | [
"public",
"Coordinate",
"lngLatToMeters",
"(",
"Coordinate",
"coord",
")",
"{",
"double",
"mx",
"=",
"coord",
".",
"x",
"*",
"originShift",
"/",
"180.0",
";",
"double",
"my",
"=",
"Math",
".",
"log",
"(",
"Math",
".",
"tan",
"(",
"(",
"90",
"+",
"coo... | Converts given coordinate in WGS84 Datum to XY in Spherical Mercator
EPSG:3857
@param coord The coordinate to convert
@return The coordinate transformed to EPSG:3857 | [
"Converts",
"given",
"coordinate",
"in",
"WGS84",
"Datum",
"to",
"XY",
"in",
"Spherical",
"Mercator",
"EPSG",
":",
"3857"
] | train | https://github.com/scaleset/scaleset-geo/blob/5cff2349668037dc287928a6c1a1f67c76d96b02/src/main/java/com/scaleset/geo/math/GoogleMapsTileMath.java#L64-L69 |
gallandarakhneorg/afc | core/vmutils/src/main/java/org/arakhne/afc/vmutil/asserts/AssertMessages.java | AssertMessages.outsideRangeInclusiveParameter | @Pure
@Inline(value = "AssertMessages.outsideRangeInclusiveParameter(0, $1, $2, $3)", imported = {AssertMessages.class})
public static String outsideRangeInclusiveParameter(Object currentValue,
Object minValue, Object maxValue) {
return outsideRangeInclusiveParameter(0, currentValue, minValue, maxValue);
} | java | @Pure
@Inline(value = "AssertMessages.outsideRangeInclusiveParameter(0, $1, $2, $3)", imported = {AssertMessages.class})
public static String outsideRangeInclusiveParameter(Object currentValue,
Object minValue, Object maxValue) {
return outsideRangeInclusiveParameter(0, currentValue, minValue, maxValue);
} | [
"@",
"Pure",
"@",
"Inline",
"(",
"value",
"=",
"\"AssertMessages.outsideRangeInclusiveParameter(0, $1, $2, $3)\"",
",",
"imported",
"=",
"{",
"AssertMessages",
".",
"class",
"}",
")",
"public",
"static",
"String",
"outsideRangeInclusiveParameter",
"(",
"Object",
"curren... | First parameter value is outside range.
@param currentValue current value.
@param minValue minimum value in range.
@param maxValue maximum value in range.
@return the error message. | [
"First",
"parameter",
"value",
"is",
"outside",
"range",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/vmutils/src/main/java/org/arakhne/afc/vmutil/asserts/AssertMessages.java#L250-L255 |
nmorel/gwt-jackson | gwt-jackson/src/main/java/com/github/nmorel/gwtjackson/client/ser/map/MapJsonSerializer.java | MapJsonSerializer.newInstance | public static <M extends Map<?, ?>> MapJsonSerializer<M, ?, ?> newInstance( KeySerializer<?> keySerializer, JsonSerializer<?>
valueSerializer ) {
return new MapJsonSerializer( keySerializer, valueSerializer );
} | java | public static <M extends Map<?, ?>> MapJsonSerializer<M, ?, ?> newInstance( KeySerializer<?> keySerializer, JsonSerializer<?>
valueSerializer ) {
return new MapJsonSerializer( keySerializer, valueSerializer );
} | [
"public",
"static",
"<",
"M",
"extends",
"Map",
"<",
"?",
",",
"?",
">",
">",
"MapJsonSerializer",
"<",
"M",
",",
"?",
",",
"?",
">",
"newInstance",
"(",
"KeySerializer",
"<",
"?",
">",
"keySerializer",
",",
"JsonSerializer",
"<",
"?",
">",
"valueSeria... | <p>newInstance</p>
@param keySerializer {@link KeySerializer} used to serialize the keys.
@param valueSerializer {@link JsonSerializer} used to serialize the values.
@return a new instance of {@link MapJsonSerializer}
@param <M> a M object. | [
"<p",
">",
"newInstance<",
"/",
"p",
">"
] | train | https://github.com/nmorel/gwt-jackson/blob/3fdc4350a27a9b64fc437d5fe516bf9191b74824/gwt-jackson/src/main/java/com/github/nmorel/gwtjackson/client/ser/map/MapJsonSerializer.java#L49-L52 |
Jasig/uPortal | uPortal-groups/uPortal-groups-core/src/main/java/org/apereo/portal/groups/EntityGroupImpl.java | EntityGroupImpl.getChildren | @Override
public Set<IGroupMember> getChildren() throws GroupsException {
final EntityIdentifier cacheKey = getUnderlyingEntityIdentifier();
Element element = childrenCache.get(cacheKey);
if (element == null) {
final Set<IGroupMember> children = buildChildrenSet();
... | java | @Override
public Set<IGroupMember> getChildren() throws GroupsException {
final EntityIdentifier cacheKey = getUnderlyingEntityIdentifier();
Element element = childrenCache.get(cacheKey);
if (element == null) {
final Set<IGroupMember> children = buildChildrenSet();
... | [
"@",
"Override",
"public",
"Set",
"<",
"IGroupMember",
">",
"getChildren",
"(",
")",
"throws",
"GroupsException",
"{",
"final",
"EntityIdentifier",
"cacheKey",
"=",
"getUnderlyingEntityIdentifier",
"(",
")",
";",
"Element",
"element",
"=",
"childrenCache",
".",
"g... | Returns an <code>Iterator</code> over the <code>GroupMembers</code> in our member <code>
Collection</code>. Reflects pending changes.
@return Iterator | [
"Returns",
"an",
"<code",
">",
"Iterator<",
"/",
"code",
">",
"over",
"the",
"<code",
">",
"GroupMembers<",
"/",
"code",
">",
"in",
"our",
"member",
"<code",
">",
"Collection<",
"/",
"code",
">",
".",
"Reflects",
"pending",
"changes",
"."
] | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-groups/uPortal-groups-core/src/main/java/org/apereo/portal/groups/EntityGroupImpl.java#L295-L310 |
zaproxy/zaproxy | src/org/zaproxy/zap/extension/spider/ExtensionSpider.java | ExtensionSpider.startScan | @SuppressWarnings({"fallthrough"})
@Override
public int startScan(String displayName, Target target, User user, Object[] customConfigurations) {
switch (Control.getSingleton().getMode()) {
case safe:
throw new IllegalStateException("Scans are not allowed in Safe mode");
case protect:
String uri = getTarge... | java | @SuppressWarnings({"fallthrough"})
@Override
public int startScan(String displayName, Target target, User user, Object[] customConfigurations) {
switch (Control.getSingleton().getMode()) {
case safe:
throw new IllegalStateException("Scans are not allowed in Safe mode");
case protect:
String uri = getTarge... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"fallthrough\"",
"}",
")",
"@",
"Override",
"public",
"int",
"startScan",
"(",
"String",
"displayName",
",",
"Target",
"target",
",",
"User",
"user",
",",
"Object",
"[",
"]",
"customConfigurations",
")",
"{",
"switch",
"(... | Starts a new spider scan, with the given display name, using the given target and, optionally, spidering from the
perspective of a user and with custom configurations.
<p>
<strong>Note:</strong> The preferred method to start the scan is with {@link #startScan(Target, User, Object[])}, unless
a custom display name is re... | [
"Starts",
"a",
"new",
"spider",
"scan",
"with",
"the",
"given",
"display",
"name",
"using",
"the",
"given",
"target",
"and",
"optionally",
"spidering",
"from",
"the",
"perspective",
"of",
"a",
"user",
"and",
"with",
"custom",
"configurations",
".",
"<p",
">"... | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/extension/spider/ExtensionSpider.java#L622-L645 |
Carbonado/Carbonado | src/main/java/com/amazon/carbonado/gen/StorableGenerator.java | StorableGenerator.loadStorageForFetch | private void loadStorageForFetch(CodeBuilder b, TypeDesc type) {
b.loadThis();
b.loadField(SUPPORT_FIELD_NAME, mSupportType);
TypeDesc storageType = TypeDesc.forClass(Storage.class);
TypeDesc repositoryType = TypeDesc.forClass(Repository.class);
b.invokeInterface
... | java | private void loadStorageForFetch(CodeBuilder b, TypeDesc type) {
b.loadThis();
b.loadField(SUPPORT_FIELD_NAME, mSupportType);
TypeDesc storageType = TypeDesc.forClass(Storage.class);
TypeDesc repositoryType = TypeDesc.forClass(Repository.class);
b.invokeInterface
... | [
"private",
"void",
"loadStorageForFetch",
"(",
"CodeBuilder",
"b",
",",
"TypeDesc",
"type",
")",
"{",
"b",
".",
"loadThis",
"(",
")",
";",
"b",
".",
"loadField",
"(",
"SUPPORT_FIELD_NAME",
",",
"mSupportType",
")",
";",
"TypeDesc",
"storageType",
"=",
"TypeD... | Generates code that loads a Storage instance on the stack, throwing a
FetchException if Storage request fails.
@param type type of Storage to request | [
"Generates",
"code",
"that",
"loads",
"a",
"Storage",
"instance",
"on",
"the",
"stack",
"throwing",
"a",
"FetchException",
"if",
"Storage",
"request",
"fails",
"."
] | train | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/gen/StorableGenerator.java#L2132-L2158 |
mapsforge/mapsforge | sqlite-android/src/main/java/org/sqlite/database/DatabaseUtils.java | DatabaseUtils.stringForQuery | public static String stringForQuery(SQLiteStatement prog, String[] selectionArgs) {
prog.bindAllArgsAsStrings(selectionArgs);
return prog.simpleQueryForString();
} | java | public static String stringForQuery(SQLiteStatement prog, String[] selectionArgs) {
prog.bindAllArgsAsStrings(selectionArgs);
return prog.simpleQueryForString();
} | [
"public",
"static",
"String",
"stringForQuery",
"(",
"SQLiteStatement",
"prog",
",",
"String",
"[",
"]",
"selectionArgs",
")",
"{",
"prog",
".",
"bindAllArgsAsStrings",
"(",
"selectionArgs",
")",
";",
"return",
"prog",
".",
"simpleQueryForString",
"(",
")",
";",... | Utility method to run the pre-compiled query and return the value in the
first column of the first row. | [
"Utility",
"method",
"to",
"run",
"the",
"pre",
"-",
"compiled",
"query",
"and",
"return",
"the",
"value",
"in",
"the",
"first",
"column",
"of",
"the",
"first",
"row",
"."
] | train | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/sqlite-android/src/main/java/org/sqlite/database/DatabaseUtils.java#L867-L870 |
radkovo/jStyleParser | src/main/java/cz/vutbr/web/domassign/MultiMap.java | MultiMap.hasPseudo | public boolean hasPseudo(E el, P pseudo)
{
HashMap<P, D> map = pseudoMaps.get(el);
if (map == null)
return false;
else
return map.containsKey(pseudo);
} | java | public boolean hasPseudo(E el, P pseudo)
{
HashMap<P, D> map = pseudoMaps.get(el);
if (map == null)
return false;
else
return map.containsKey(pseudo);
} | [
"public",
"boolean",
"hasPseudo",
"(",
"E",
"el",
",",
"P",
"pseudo",
")",
"{",
"HashMap",
"<",
"P",
",",
"D",
">",
"map",
"=",
"pseudoMaps",
".",
"get",
"(",
"el",
")",
";",
"if",
"(",
"map",
"==",
"null",
")",
"return",
"false",
";",
"else",
... | Checks if the given pseudo element is available for the given element
@param el The element
@param pseudo The tested pseudo element
@return true when there is some value associated with the given pair | [
"Checks",
"if",
"the",
"given",
"pseudo",
"element",
"is",
"available",
"for",
"the",
"given",
"element"
] | train | https://github.com/radkovo/jStyleParser/blob/8ab049ac6866aa52c4d7deee25c9e294e7191957/src/main/java/cz/vutbr/web/domassign/MultiMap.java#L180-L187 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/CursorRenderer.java | CursorRenderer.addImage | public void addImage(int id, Media media)
{
final Integer key = Integer.valueOf(id);
surfaces.put(key, Drawable.loadImage(media));
if (surfaceId == null)
{
surfaceId = key;
}
} | java | public void addImage(int id, Media media)
{
final Integer key = Integer.valueOf(id);
surfaces.put(key, Drawable.loadImage(media));
if (surfaceId == null)
{
surfaceId = key;
}
} | [
"public",
"void",
"addImage",
"(",
"int",
"id",
",",
"Media",
"media",
")",
"{",
"final",
"Integer",
"key",
"=",
"Integer",
".",
"valueOf",
"(",
"id",
")",
";",
"surfaces",
".",
"put",
"(",
"key",
",",
"Drawable",
".",
"loadImage",
"(",
"media",
")",... | Add a cursor image. Once there are no more images to add, a call to {@link #load()} will be necessary.
@param id The cursor id.
@param media The cursor media.
@throws LionEngineException If invalid media. | [
"Add",
"a",
"cursor",
"image",
".",
"Once",
"there",
"are",
"no",
"more",
"images",
"to",
"add",
"a",
"call",
"to",
"{",
"@link",
"#load",
"()",
"}",
"will",
"be",
"necessary",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/CursorRenderer.java#L89-L97 |
apache/incubator-gobblin | gobblin-runtime/src/main/java/org/apache/gobblin/runtime/JobLauncherFactory.java | JobLauncherFactory.newJobLauncher | public static @Nonnull JobLauncher newJobLauncher(Properties sysProps, Properties jobProps,
SharedResourcesBroker<GobblinScopeTypes> instanceBroker) throws Exception {
return newJobLauncher(sysProps, jobProps, instanceBroker, ImmutableList.of());
} | java | public static @Nonnull JobLauncher newJobLauncher(Properties sysProps, Properties jobProps,
SharedResourcesBroker<GobblinScopeTypes> instanceBroker) throws Exception {
return newJobLauncher(sysProps, jobProps, instanceBroker, ImmutableList.of());
} | [
"public",
"static",
"@",
"Nonnull",
"JobLauncher",
"newJobLauncher",
"(",
"Properties",
"sysProps",
",",
"Properties",
"jobProps",
",",
"SharedResourcesBroker",
"<",
"GobblinScopeTypes",
">",
"instanceBroker",
")",
"throws",
"Exception",
"{",
"return",
"newJobLauncher",... | Create a new {@link JobLauncher}.
<p>
This method will never return a {@code null}.
</p>
@param sysProps system configuration properties
@param jobProps job configuration properties
@param instanceBroker
@return newly created {@link JobLauncher} | [
"Create",
"a",
"new",
"{",
"@link",
"JobLauncher",
"}",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-runtime/src/main/java/org/apache/gobblin/runtime/JobLauncherFactory.java#L83-L86 |
RestComm/media-core | rtp/src/main/java/org/restcomm/media/core/rtp/crypto/SRTPCryptoContext.java | SRTPCryptoContext.reverseTransformPacket | public boolean reverseTransformPacket(RawPacket pkt) {
int seqNo = pkt.getSequenceNumber();
if (!seqNumSet) {
seqNumSet = true;
seqNum = seqNo;
}
// Guess the SRTP index (48 bit), see rFC 3711, 3.3.1
// Stores the guessed roc in this.guessedROC
long guessedIndex = guessIndex(seqNo);
// Replay c... | java | public boolean reverseTransformPacket(RawPacket pkt) {
int seqNo = pkt.getSequenceNumber();
if (!seqNumSet) {
seqNumSet = true;
seqNum = seqNo;
}
// Guess the SRTP index (48 bit), see rFC 3711, 3.3.1
// Stores the guessed roc in this.guessedROC
long guessedIndex = guessIndex(seqNo);
// Replay c... | [
"public",
"boolean",
"reverseTransformPacket",
"(",
"RawPacket",
"pkt",
")",
"{",
"int",
"seqNo",
"=",
"pkt",
".",
"getSequenceNumber",
"(",
")",
";",
"if",
"(",
"!",
"seqNumSet",
")",
"{",
"seqNumSet",
"=",
"true",
";",
"seqNum",
"=",
"seqNo",
";",
"}",... | Transform a SRTP packet into a RTP packet. This method is called when a
SRTP packet is received.
Operations done by the this operation include: Authentication check,
Packet replay check and Decryption.
Both encryption and authentication functionality can be turned off as
long as the SRTPPolicy used in this SRTPCrypto... | [
"Transform",
"a",
"SRTP",
"packet",
"into",
"a",
"RTP",
"packet",
".",
"This",
"method",
"is",
"called",
"when",
"a",
"SRTP",
"packet",
"is",
"received",
"."
] | train | https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/rtp/src/main/java/org/restcomm/media/core/rtp/crypto/SRTPCryptoContext.java#L397-L451 |
jeremylong/DependencyCheck | core/src/main/java/org/owasp/dependencycheck/dependency/Evidence.java | Evidence.compareToIgnoreCaseWithNullCheck | private int compareToIgnoreCaseWithNullCheck(String me, String other) {
if (me == null && other == null) {
return 0;
} else if (me == null) {
return -1; //the other string is greater than me
} else if (other == null) {
return 1; //me is greater than the other ... | java | private int compareToIgnoreCaseWithNullCheck(String me, String other) {
if (me == null && other == null) {
return 0;
} else if (me == null) {
return -1; //the other string is greater than me
} else if (other == null) {
return 1; //me is greater than the other ... | [
"private",
"int",
"compareToIgnoreCaseWithNullCheck",
"(",
"String",
"me",
",",
"String",
"other",
")",
"{",
"if",
"(",
"me",
"==",
"null",
"&&",
"other",
"==",
"null",
")",
"{",
"return",
"0",
";",
"}",
"else",
"if",
"(",
"me",
"==",
"null",
")",
"{... | Wrapper around
{@link java.lang.String#compareToIgnoreCase(java.lang.String) String.compareToIgnoreCase}
with an exhaustive, possibly duplicative, check against nulls.
@param me the value to be compared
@param other the other value to be compared
@return true if the values are equal; otherwise false | [
"Wrapper",
"around",
"{",
"@link",
"java",
".",
"lang",
".",
"String#compareToIgnoreCase",
"(",
"java",
".",
"lang",
".",
"String",
")",
"String",
".",
"compareToIgnoreCase",
"}",
"with",
"an",
"exhaustive",
"possibly",
"duplicative",
"check",
"against",
"nulls"... | train | https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/dependency/Evidence.java#L243-L252 |
wildfly/wildfly-core | server/src/main/java/org/jboss/as/server/mgmt/domain/HostControllerConnection.java | HostControllerConnection.openConnection | synchronized void openConnection(final ModelController controller, final ActiveOperation.CompletedCallback<ModelNode> callback) throws Exception {
boolean ok = false;
final Connection connection = connectionManager.connect();
try {
channelHandler.executeRequest(new ServerRegisterRequ... | java | synchronized void openConnection(final ModelController controller, final ActiveOperation.CompletedCallback<ModelNode> callback) throws Exception {
boolean ok = false;
final Connection connection = connectionManager.connect();
try {
channelHandler.executeRequest(new ServerRegisterRequ... | [
"synchronized",
"void",
"openConnection",
"(",
"final",
"ModelController",
"controller",
",",
"final",
"ActiveOperation",
".",
"CompletedCallback",
"<",
"ModelNode",
">",
"callback",
")",
"throws",
"Exception",
"{",
"boolean",
"ok",
"=",
"false",
";",
"final",
"Co... | Connect to the HC and retrieve the current model updates.
@param controller the server controller
@param callback the operation completed callback
@throws IOException for any error | [
"Connect",
"to",
"the",
"HC",
"and",
"retrieve",
"the",
"current",
"model",
"updates",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/server/src/main/java/org/jboss/as/server/mgmt/domain/HostControllerConnection.java#L126-L141 |
opsmatters/opsmatters-core | src/main/java/com/opsmatters/core/util/FormatUtilities.java | FormatUtilities.getFormattedTime | static public String getFormattedTime(long dt, String format, boolean isTime)
{
String ret = "";
SimpleDateFormat df = null;
try
{
if(dt > 0)
{
df = formatPool.getFormat(format);
if(isTime)
df.setTimeZone(Da... | java | static public String getFormattedTime(long dt, String format, boolean isTime)
{
String ret = "";
SimpleDateFormat df = null;
try
{
if(dt > 0)
{
df = formatPool.getFormat(format);
if(isTime)
df.setTimeZone(Da... | [
"static",
"public",
"String",
"getFormattedTime",
"(",
"long",
"dt",
",",
"String",
"format",
",",
"boolean",
"isTime",
")",
"{",
"String",
"ret",
"=",
"\"\"",
";",
"SimpleDateFormat",
"df",
"=",
"null",
";",
"try",
"{",
"if",
"(",
"dt",
">",
"0",
")",... | Returns the given time parsed using "HH:mm:ss".
@param dt The time to be parsed
@param format The format to use when parsing the date
@param isTime <CODE>true</CODE> if the given time has a timezone
@return The given time parsed using "HH:mm:ss" | [
"Returns",
"the",
"given",
"time",
"parsed",
"using",
"HH",
":",
"mm",
":",
"ss",
"."
] | train | https://github.com/opsmatters/opsmatters-core/blob/c48904f7e8d029fd45357811ec38a735e261e3fd/src/main/java/com/opsmatters/core/util/FormatUtilities.java#L392-L417 |
lucee/Lucee | core/src/main/java/lucee/runtime/ComponentImpl.java | ComponentImpl.registerUDF | @Override
public void registerUDF(Collection.Key key, UDF udf) throws ApplicationException {
registerUDF(key, (UDFPlus) udf, useShadow, false);
} | java | @Override
public void registerUDF(Collection.Key key, UDF udf) throws ApplicationException {
registerUDF(key, (UDFPlus) udf, useShadow, false);
} | [
"@",
"Override",
"public",
"void",
"registerUDF",
"(",
"Collection",
".",
"Key",
"key",
",",
"UDF",
"udf",
")",
"throws",
"ApplicationException",
"{",
"registerUDF",
"(",
"key",
",",
"(",
"UDFPlus",
")",
"udf",
",",
"useShadow",
",",
"false",
")",
";",
"... | /*
public void reg(Collection.Key key, UDFPlus udf) throws ApplicationException { registerUDF(key,
udf,useShadow,false); } public void reg(String key, UDFPlus udf) throws ApplicationException {
registerUDF(KeyImpl.init(key), udf,useShadow,false); } | [
"/",
"*",
"public",
"void",
"reg",
"(",
"Collection",
".",
"Key",
"key",
"UDFPlus",
"udf",
")",
"throws",
"ApplicationException",
"{",
"registerUDF",
"(",
"key",
"udf",
"useShadow",
"false",
")",
";",
"}",
"public",
"void",
"reg",
"(",
"String",
"key",
"... | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/ComponentImpl.java#L1663-L1666 |
Axway/Grapes | utils/src/main/java/org/axway/grapes/utils/client/GrapesClient.java | GrapesClient.postArtifact | public void postArtifact(final Artifact artifact, final String user, final String password) throws GrapesCommunicationException, AuthenticationException {
final Client client = getClient(user, password);
final WebResource resource = client.resource(serverURL).path(RequestUtils.artifactResourcePath());
... | java | public void postArtifact(final Artifact artifact, final String user, final String password) throws GrapesCommunicationException, AuthenticationException {
final Client client = getClient(user, password);
final WebResource resource = client.resource(serverURL).path(RequestUtils.artifactResourcePath());
... | [
"public",
"void",
"postArtifact",
"(",
"final",
"Artifact",
"artifact",
",",
"final",
"String",
"user",
",",
"final",
"String",
"password",
")",
"throws",
"GrapesCommunicationException",
",",
"AuthenticationException",
"{",
"final",
"Client",
"client",
"=",
"getClie... | Post an artifact to the Grapes server
@param artifact The artifact to post
@param user The user posting the information
@param password The user password
@throws GrapesCommunicationException
@throws javax.naming.AuthenticationException | [
"Post",
"an",
"artifact",
"to",
"the",
"Grapes",
"server"
] | train | https://github.com/Axway/Grapes/blob/ce9cc73d85f83eaa5fbc991abb593915a8c8374e/utils/src/main/java/org/axway/grapes/utils/client/GrapesClient.java#L418-L431 |
jbossws/jbossws-common | src/main/java/org/jboss/ws/common/DOMWriter.java | DOMWriter.printNode | public static String printNode(Node node, boolean prettyprint)
{
StringWriter strw = new StringWriter();
new DOMWriter(strw).setPrettyprint(prettyprint).print(node);
return strw.toString();
} | java | public static String printNode(Node node, boolean prettyprint)
{
StringWriter strw = new StringWriter();
new DOMWriter(strw).setPrettyprint(prettyprint).print(node);
return strw.toString();
} | [
"public",
"static",
"String",
"printNode",
"(",
"Node",
"node",
",",
"boolean",
"prettyprint",
")",
"{",
"StringWriter",
"strw",
"=",
"new",
"StringWriter",
"(",
")",
";",
"new",
"DOMWriter",
"(",
"strw",
")",
".",
"setPrettyprint",
"(",
"prettyprint",
")",
... | Print a node with explicit prettyprinting.
The defaults for all other DOMWriter properties apply. | [
"Print",
"a",
"node",
"with",
"explicit",
"prettyprinting",
".",
"The",
"defaults",
"for",
"all",
"other",
"DOMWriter",
"properties",
"apply",
"."
] | train | https://github.com/jbossws/jbossws-common/blob/fcff8a3ef9bfe046d6fa8c855a3fe4f62841add7/src/main/java/org/jboss/ws/common/DOMWriter.java#L150-L155 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/NodeSetDTM.java | NodeSetDTM.insertElementAt | public void insertElementAt(int value, int at)
{
if (!m_mutable)
throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESETDTM_NOT_MUTABLE, null)); //"This NodeSetDTM is not mutable!");
super.insertElementAt(value, at);
} | java | public void insertElementAt(int value, int at)
{
if (!m_mutable)
throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESETDTM_NOT_MUTABLE, null)); //"This NodeSetDTM is not mutable!");
super.insertElementAt(value, at);
} | [
"public",
"void",
"insertElementAt",
"(",
"int",
"value",
",",
"int",
"at",
")",
"{",
"if",
"(",
"!",
"m_mutable",
")",
"throw",
"new",
"RuntimeException",
"(",
"XSLMessages",
".",
"createXPATHMessage",
"(",
"XPATHErrorResources",
".",
"ER_NODESETDTM_NOT_MUTABLE",... | Inserts the specified node in this vector at the specified index.
Each component in this vector with an index greater or equal to
the specified index is shifted upward to have an index one greater
than the value it had previously.
@param value The node to be inserted.
@param at The index where the insert should occur.... | [
"Inserts",
"the",
"specified",
"node",
"in",
"this",
"vector",
"at",
"the",
"specified",
"index",
".",
"Each",
"component",
"in",
"this",
"vector",
"with",
"an",
"index",
"greater",
"or",
"equal",
"to",
"the",
"specified",
"index",
"is",
"shifted",
"upward",... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/NodeSetDTM.java#L913-L920 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/javax/net/ssl/SSLContext.java | SSLContext.createSSLEngine | public final SSLEngine createSSLEngine(String peerHost, int peerPort) {
try {
return contextSpi.engineCreateSSLEngine(peerHost, peerPort);
} catch (AbstractMethodError e) {
UnsupportedOperationException unsup =
new UnsupportedOperationException(
... | java | public final SSLEngine createSSLEngine(String peerHost, int peerPort) {
try {
return contextSpi.engineCreateSSLEngine(peerHost, peerPort);
} catch (AbstractMethodError e) {
UnsupportedOperationException unsup =
new UnsupportedOperationException(
... | [
"public",
"final",
"SSLEngine",
"createSSLEngine",
"(",
"String",
"peerHost",
",",
"int",
"peerPort",
")",
"{",
"try",
"{",
"return",
"contextSpi",
".",
"engineCreateSSLEngine",
"(",
"peerHost",
",",
"peerPort",
")",
";",
"}",
"catch",
"(",
"AbstractMethodError"... | Creates a new <code>SSLEngine</code> using this context using
advisory peer information.
<P>
Applications using this factory method are providing hints
for an internal session reuse strategy.
<P>
Some cipher suites (such as Kerberos) require remote hostname
information, in which case peerHost needs to be specified.
@p... | [
"Creates",
"a",
"new",
"<code",
">",
"SSLEngine<",
"/",
"code",
">",
"using",
"this",
"context",
"using",
"advisory",
"peer",
"information",
".",
"<P",
">",
"Applications",
"using",
"this",
"factory",
"method",
"are",
"providing",
"hints",
"for",
"an",
"inte... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/javax/net/ssl/SSLContext.java#L393-L404 |
Azure/azure-sdk-for-java | sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/LongTermRetentionBackupsInner.java | LongTermRetentionBackupsInner.beginDelete | public void beginDelete(String locationName, String longTermRetentionServerName, String longTermRetentionDatabaseName, String backupName) {
beginDeleteWithServiceResponseAsync(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName).toBlocking().single().body();
} | java | public void beginDelete(String locationName, String longTermRetentionServerName, String longTermRetentionDatabaseName, String backupName) {
beginDeleteWithServiceResponseAsync(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName).toBlocking().single().body();
} | [
"public",
"void",
"beginDelete",
"(",
"String",
"locationName",
",",
"String",
"longTermRetentionServerName",
",",
"String",
"longTermRetentionDatabaseName",
",",
"String",
"backupName",
")",
"{",
"beginDeleteWithServiceResponseAsync",
"(",
"locationName",
",",
"longTermRet... | Deletes a long term retention backup.
@param locationName The location of the database
@param longTermRetentionServerName the String value
@param longTermRetentionDatabaseName the String value
@param backupName The backup name.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudExce... | [
"Deletes",
"a",
"long",
"term",
"retention",
"backup",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/LongTermRetentionBackupsInner.java#L293-L295 |
j-easy/easy-random | easy-random-randomizers/src/main/java/org/jeasy/random/randomizers/EmailRandomizer.java | EmailRandomizer.aNewEmailRandomizer | public static EmailRandomizer aNewEmailRandomizer(final long seed, final Locale locale, final boolean safe) {
return new EmailRandomizer(seed, locale, safe);
} | java | public static EmailRandomizer aNewEmailRandomizer(final long seed, final Locale locale, final boolean safe) {
return new EmailRandomizer(seed, locale, safe);
} | [
"public",
"static",
"EmailRandomizer",
"aNewEmailRandomizer",
"(",
"final",
"long",
"seed",
",",
"final",
"Locale",
"locale",
",",
"final",
"boolean",
"safe",
")",
"{",
"return",
"new",
"EmailRandomizer",
"(",
"seed",
",",
"locale",
",",
"safe",
")",
";",
"}... | Create a new {@link EmailRandomizer}.
@param seed the initial seed
@param locale the locale to use
@param safe true to generate safe emails (invalid domains), false otherwise
@return a new {@link EmailRandomizer} | [
"Create",
"a",
"new",
"{",
"@link",
"EmailRandomizer",
"}",
"."
] | train | https://github.com/j-easy/easy-random/blob/816b0d6a74c7288af111e70ae1b0b57d7fe3b59d/easy-random-randomizers/src/main/java/org/jeasy/random/randomizers/EmailRandomizer.java#L114-L116 |
j-a-w-r/jawr-main-repo | jawr/jawr-core/src/main/java/net/jawr/web/config/jmx/JmxUtils.java | JmxUtils.unregisterJMXBean | public static void unregisterJMXBean(ServletContext servletContext, String resourceType, String mBeanPrefix) {
try {
MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
if (mbs != null) {
ObjectName jawrConfigMgrObjName = JmxUtils.getMBeanObjectName(servletContext, resourceType,
mBeanPre... | java | public static void unregisterJMXBean(ServletContext servletContext, String resourceType, String mBeanPrefix) {
try {
MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
if (mbs != null) {
ObjectName jawrConfigMgrObjName = JmxUtils.getMBeanObjectName(servletContext, resourceType,
mBeanPre... | [
"public",
"static",
"void",
"unregisterJMXBean",
"(",
"ServletContext",
"servletContext",
",",
"String",
"resourceType",
",",
"String",
"mBeanPrefix",
")",
"{",
"try",
"{",
"MBeanServer",
"mbs",
"=",
"ManagementFactory",
".",
"getPlatformMBeanServer",
"(",
")",
";",... | Unregister the JMX Bean
@param servletContext
the servlet context
@param resourceType
the resource type
@param mBeanPrefix
the mBeanPrefix | [
"Unregister",
"the",
"JMX",
"Bean"
] | train | https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/config/jmx/JmxUtils.java#L118-L144 |
ThreeTen/threetenbp | src/main/java/org/threeten/bp/zone/TzdbZoneRulesCompiler.java | TzdbZoneRulesCompiler.parseZoneLine | private boolean parseZoneLine(StringTokenizer st, List<TZDBZone> zoneList) {
TZDBZone zone = new TZDBZone();
zoneList.add(zone);
zone.standardOffset = parseOffset(st.nextToken());
String savingsRule = parseOptional(st.nextToken());
if (savingsRule == null) {
zone.fixe... | java | private boolean parseZoneLine(StringTokenizer st, List<TZDBZone> zoneList) {
TZDBZone zone = new TZDBZone();
zoneList.add(zone);
zone.standardOffset = parseOffset(st.nextToken());
String savingsRule = parseOptional(st.nextToken());
if (savingsRule == null) {
zone.fixe... | [
"private",
"boolean",
"parseZoneLine",
"(",
"StringTokenizer",
"st",
",",
"List",
"<",
"TZDBZone",
">",
"zoneList",
")",
"{",
"TZDBZone",
"zone",
"=",
"new",
"TZDBZone",
"(",
")",
";",
"zoneList",
".",
"add",
"(",
"zone",
")",
";",
"zone",
".",
"standard... | Parses a Zone line.
@param st the tokenizer, not null
@return true if the zone is complete | [
"Parses",
"a",
"Zone",
"line",
"."
] | train | https://github.com/ThreeTen/threetenbp/blob/5f05b649f89f205aabd96b2f83c36796ec616fe6/src/main/java/org/threeten/bp/zone/TzdbZoneRulesCompiler.java#L731-L758 |
elki-project/elki | elki-core-dbids/src/main/java/de/lmu/ifi/dbs/elki/database/ids/DBIDUtil.java | DBIDUtil.internalIntersectionSize | private static int internalIntersectionSize(DBIDs first, DBIDs second) {
second = second.size() > 16 && !(second instanceof SetDBIDs) ? newHashSet(second) : second;
int c = 0;
for(DBIDIter it = first.iter(); it.valid(); it.advance()) {
if(second.contains(it)) {
c++;
}
}
return c;... | java | private static int internalIntersectionSize(DBIDs first, DBIDs second) {
second = second.size() > 16 && !(second instanceof SetDBIDs) ? newHashSet(second) : second;
int c = 0;
for(DBIDIter it = first.iter(); it.valid(); it.advance()) {
if(second.contains(it)) {
c++;
}
}
return c;... | [
"private",
"static",
"int",
"internalIntersectionSize",
"(",
"DBIDs",
"first",
",",
"DBIDs",
"second",
")",
"{",
"second",
"=",
"second",
".",
"size",
"(",
")",
">",
"16",
"&&",
"!",
"(",
"second",
"instanceof",
"SetDBIDs",
")",
"?",
"newHashSet",
"(",
"... | Compute the set intersection size of two sets.
@param first First set
@param second Second set
@return size | [
"Compute",
"the",
"set",
"intersection",
"size",
"of",
"two",
"sets",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-dbids/src/main/java/de/lmu/ifi/dbs/elki/database/ids/DBIDUtil.java#L354-L363 |
joniles/mpxj | src/main/java/net/sf/mpxj/mspdi/MSPDITimephasedWorkNormaliser.java | MSPDITimephasedWorkNormaliser.validateSameDay | private void validateSameDay(ProjectCalendar calendar, LinkedList<TimephasedWork> list)
{
for (TimephasedWork assignment : list)
{
Date assignmentStart = assignment.getStart();
Date calendarStartTime = calendar.getStartTime(assignmentStart);
Date assignmentStartTime = DateHelpe... | java | private void validateSameDay(ProjectCalendar calendar, LinkedList<TimephasedWork> list)
{
for (TimephasedWork assignment : list)
{
Date assignmentStart = assignment.getStart();
Date calendarStartTime = calendar.getStartTime(assignmentStart);
Date assignmentStartTime = DateHelpe... | [
"private",
"void",
"validateSameDay",
"(",
"ProjectCalendar",
"calendar",
",",
"LinkedList",
"<",
"TimephasedWork",
">",
"list",
")",
"{",
"for",
"(",
"TimephasedWork",
"assignment",
":",
"list",
")",
"{",
"Date",
"assignmentStart",
"=",
"assignment",
".",
"getS... | Ensures that the start and end dates for ranges fit within the
working times for a given day.
@param calendar current calendar
@param list assignment data | [
"Ensures",
"that",
"the",
"start",
"and",
"end",
"dates",
"for",
"ranges",
"fit",
"within",
"the",
"working",
"times",
"for",
"a",
"given",
"day",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mspdi/MSPDITimephasedWorkNormaliser.java#L279-L309 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/xtal/CrystalCell.java | CrystalCell.transfToOrthonormal | public Matrix4d transfToOrthonormal(Matrix4d m) {
Vector3d trans = new Vector3d(m.m03,m.m13,m.m23);
transfToOrthonormal(trans);
Matrix3d rot = new Matrix3d();
m.getRotationScale(rot);
// see Giacovazzo section 2.E, eq. 2.E.1
// Rprime = MT-1 * R * MT
rot.mul(this.getMTranspose());
rot.mul(this.getMTran... | java | public Matrix4d transfToOrthonormal(Matrix4d m) {
Vector3d trans = new Vector3d(m.m03,m.m13,m.m23);
transfToOrthonormal(trans);
Matrix3d rot = new Matrix3d();
m.getRotationScale(rot);
// see Giacovazzo section 2.E, eq. 2.E.1
// Rprime = MT-1 * R * MT
rot.mul(this.getMTranspose());
rot.mul(this.getMTran... | [
"public",
"Matrix4d",
"transfToOrthonormal",
"(",
"Matrix4d",
"m",
")",
"{",
"Vector3d",
"trans",
"=",
"new",
"Vector3d",
"(",
"m",
".",
"m03",
",",
"m",
".",
"m13",
",",
"m",
".",
"m23",
")",
";",
"transfToOrthonormal",
"(",
"trans",
")",
";",
"Matrix... | Transform given Matrix4d in crystal basis to the orthonormal basis using
the PDB axes convention (NCODE=1)
@param m
@return | [
"Transform",
"given",
"Matrix4d",
"in",
"crystal",
"basis",
"to",
"the",
"orthonormal",
"basis",
"using",
"the",
"PDB",
"axes",
"convention",
"(",
"NCODE",
"=",
"1",
")"
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/xtal/CrystalCell.java#L280-L292 |
lionsoul2014/jcseg | jcseg-core/src/main/java/org/lionsoul/jcseg/util/Sort.java | Sort.bucketSort | public static void bucketSort( int[] arr, int m )
{
int[] count = new int[m];
int j, i = 0;
//System.out.println(count[0]==0?"true":"false");
for ( j = 0; j < arr.length; j++ ) {
count[ arr[j] ]++;
}
//loop and filter the elements
for ( j ... | java | public static void bucketSort( int[] arr, int m )
{
int[] count = new int[m];
int j, i = 0;
//System.out.println(count[0]==0?"true":"false");
for ( j = 0; j < arr.length; j++ ) {
count[ arr[j] ]++;
}
//loop and filter the elements
for ( j ... | [
"public",
"static",
"void",
"bucketSort",
"(",
"int",
"[",
"]",
"arr",
",",
"int",
"m",
")",
"{",
"int",
"[",
"]",
"count",
"=",
"new",
"int",
"[",
"m",
"]",
";",
"int",
"j",
",",
"i",
"=",
"0",
";",
"//System.out.println(count[0]==0?\"true\":\"false\"... | bucket sort algorithm
@param arr an int array
@param m the large-most one for all the Integers in arr | [
"bucket",
"sort",
"algorithm"
] | train | https://github.com/lionsoul2014/jcseg/blob/7c8a912e3bbcaf4f8de701180b9c24e2e444a94b/jcseg-core/src/main/java/org/lionsoul/jcseg/util/Sort.java#L356-L373 |
voldemort/voldemort | src/java/voldemort/rest/GetMetadataResponseSender.java | GetMetadataResponseSender.sendResponse | @Override
public void sendResponse(StoreStats performanceStats,
boolean isFromLocalZone,
long startTimeInMs) throws Exception {
ChannelBuffer responseContent = ChannelBuffers.dynamicBuffer(this.responseValue.length);
responseContent.writeByt... | java | @Override
public void sendResponse(StoreStats performanceStats,
boolean isFromLocalZone,
long startTimeInMs) throws Exception {
ChannelBuffer responseContent = ChannelBuffers.dynamicBuffer(this.responseValue.length);
responseContent.writeByt... | [
"@",
"Override",
"public",
"void",
"sendResponse",
"(",
"StoreStats",
"performanceStats",
",",
"boolean",
"isFromLocalZone",
",",
"long",
"startTimeInMs",
")",
"throws",
"Exception",
"{",
"ChannelBuffer",
"responseContent",
"=",
"ChannelBuffers",
".",
"dynamicBuffer",
... | Sends a normal HTTP response containing the serialization information in
a XML format | [
"Sends",
"a",
"normal",
"HTTP",
"response",
"containing",
"the",
"serialization",
"information",
"in",
"a",
"XML",
"format"
] | train | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/rest/GetMetadataResponseSender.java#L33-L62 |
UrielCh/ovh-java-sdk | ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java | ApiOvhOrder.cdn_webstorage_serviceName_storage_duration_POST | public OvhOrder cdn_webstorage_serviceName_storage_duration_POST(String serviceName, String duration, OvhOrderStorageEnum storage) throws IOException {
String qPath = "/order/cdn/webstorage/{serviceName}/storage/{duration}";
StringBuilder sb = path(qPath, serviceName, duration);
HashMap<String, Object>o = new Has... | java | public OvhOrder cdn_webstorage_serviceName_storage_duration_POST(String serviceName, String duration, OvhOrderStorageEnum storage) throws IOException {
String qPath = "/order/cdn/webstorage/{serviceName}/storage/{duration}";
StringBuilder sb = path(qPath, serviceName, duration);
HashMap<String, Object>o = new Has... | [
"public",
"OvhOrder",
"cdn_webstorage_serviceName_storage_duration_POST",
"(",
"String",
"serviceName",
",",
"String",
"duration",
",",
"OvhOrderStorageEnum",
"storage",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/order/cdn/webstorage/{serviceName}/storage/{d... | Create order
REST: POST /order/cdn/webstorage/{serviceName}/storage/{duration}
@param storage [required] Storage option that will be ordered
@param serviceName [required] The internal name of your CDN Static offer
@param duration [required] Duration | [
"Create",
"order"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java#L5498-L5505 |
line/armeria | core/src/main/java/com/linecorp/armeria/server/streaming/ServerSentEvents.java | ServerSentEvents.fromPublisher | public static HttpResponse fromPublisher(HttpHeaders headers,
Publisher<? extends ServerSentEvent> contentPublisher,
HttpHeaders trailingHeaders) {
requireNonNull(headers, "headers");
requireNonNull(contentPublishe... | java | public static HttpResponse fromPublisher(HttpHeaders headers,
Publisher<? extends ServerSentEvent> contentPublisher,
HttpHeaders trailingHeaders) {
requireNonNull(headers, "headers");
requireNonNull(contentPublishe... | [
"public",
"static",
"HttpResponse",
"fromPublisher",
"(",
"HttpHeaders",
"headers",
",",
"Publisher",
"<",
"?",
"extends",
"ServerSentEvent",
">",
"contentPublisher",
",",
"HttpHeaders",
"trailingHeaders",
")",
"{",
"requireNonNull",
"(",
"headers",
",",
"\"headers\""... | Creates a new Server-Sent Events stream from the specified {@link Publisher}.
@param headers the HTTP headers supposed to send
@param contentPublisher the {@link Publisher} which publishes the objects supposed to send as contents
@param trailingHeaders the trailing HTTP headers supposed to send | [
"Creates",
"a",
"new",
"Server",
"-",
"Sent",
"Events",
"stream",
"from",
"the",
"specified",
"{",
"@link",
"Publisher",
"}",
"."
] | train | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/server/streaming/ServerSentEvents.java#L109-L117 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/JsMessageHandleFactoryImpl.java | JsMessageHandleFactoryImpl.createJsMessageHandle | public final JsMessageHandle createJsMessageHandle(SIBUuid8 uuid
,long value
)
throws NullPointerException {
if (uuid == null) {
throw new NullPointe... | java | public final JsMessageHandle createJsMessageHandle(SIBUuid8 uuid
,long value
)
throws NullPointerException {
if (uuid == null) {
throw new NullPointe... | [
"public",
"final",
"JsMessageHandle",
"createJsMessageHandle",
"(",
"SIBUuid8",
"uuid",
",",
"long",
"value",
")",
"throws",
"NullPointerException",
"{",
"if",
"(",
"uuid",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"uuid\"",
")",
";"... | Create a new JsMessageHandle to represent an SIBusMessage.
@param destinationName The name of the SIBus Destination
@param localOnly Indicates that the Destination should be localized
to the local Messaging Engine.
@return JsMessageHandle The new JsMessageHandle.
@exception NullPointerException Thrown if eit... | [
"Create",
"a",
"new",
"JsMessageHandle",
"to",
"represent",
"an",
"SIBusMessage",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/JsMessageHandleFactoryImpl.java#L47-L56 |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/fs/FilterFileSystem.java | FilterFileSystem.startLocalOutput | public Path startLocalOutput(Path fsOutputFile, Path tmpLocalFile)
throws IOException {
return fs.startLocalOutput(fsOutputFile, tmpLocalFile);
} | java | public Path startLocalOutput(Path fsOutputFile, Path tmpLocalFile)
throws IOException {
return fs.startLocalOutput(fsOutputFile, tmpLocalFile);
} | [
"public",
"Path",
"startLocalOutput",
"(",
"Path",
"fsOutputFile",
",",
"Path",
"tmpLocalFile",
")",
"throws",
"IOException",
"{",
"return",
"fs",
".",
"startLocalOutput",
"(",
"fsOutputFile",
",",
"tmpLocalFile",
")",
";",
"}"
] | Returns a local File that the user can write output to. The caller
provides both the eventual FS target name and the local working
file. If the FS is local, we write directly into the target. If
the FS is remote, we write into the tmp local area. | [
"Returns",
"a",
"local",
"File",
"that",
"the",
"user",
"can",
"write",
"output",
"to",
".",
"The",
"caller",
"provides",
"both",
"the",
"eventual",
"FS",
"target",
"name",
"and",
"the",
"local",
"working",
"file",
".",
"If",
"the",
"FS",
"is",
"local",
... | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/fs/FilterFileSystem.java#L354-L357 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/ULocale.java | ULocale.getDisplayScriptInContext | @Deprecated
public static String getDisplayScriptInContext(String localeID, ULocale displayLocale) {
return getDisplayScriptInContextInternal(new ULocale(localeID), displayLocale);
} | java | @Deprecated
public static String getDisplayScriptInContext(String localeID, ULocale displayLocale) {
return getDisplayScriptInContextInternal(new ULocale(localeID), displayLocale);
} | [
"@",
"Deprecated",
"public",
"static",
"String",
"getDisplayScriptInContext",
"(",
"String",
"localeID",
",",
"ULocale",
"displayLocale",
")",
"{",
"return",
"getDisplayScriptInContextInternal",
"(",
"new",
"ULocale",
"(",
"localeID",
")",
",",
"displayLocale",
")",
... | <strong>[icu]</strong> Returns a locale's script localized for display in the provided locale.
@param localeID the id of the locale whose script will be displayed.
@param displayLocale the locale in which to display the name.
@return the localized script name.
@deprecated This API is ICU internal only.
@hide original d... | [
"<strong",
">",
"[",
"icu",
"]",
"<",
"/",
"strong",
">",
"Returns",
"a",
"locale",
"s",
"script",
"localized",
"for",
"display",
"in",
"the",
"provided",
"locale",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/ULocale.java#L1546-L1549 |
linkedin/dexmaker | dexmaker/src/main/java/com/android/dx/Code.java | Code.getThis | public <T> Local<T> getThis(TypeId<T> type) {
if (thisLocal == null) {
throw new IllegalStateException("static methods cannot access 'this'");
}
return coerce(thisLocal, type);
} | java | public <T> Local<T> getThis(TypeId<T> type) {
if (thisLocal == null) {
throw new IllegalStateException("static methods cannot access 'this'");
}
return coerce(thisLocal, type);
} | [
"public",
"<",
"T",
">",
"Local",
"<",
"T",
">",
"getThis",
"(",
"TypeId",
"<",
"T",
">",
"type",
")",
"{",
"if",
"(",
"thisLocal",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"static methods cannot access 'this'\"",
")",
";",
... | Returns the local for {@code this} of type {@code type}. It is an error
to call {@code getThis()} if this is a static method. | [
"Returns",
"the",
"local",
"for",
"{"
] | train | https://github.com/linkedin/dexmaker/blob/c58ffebcbb2564c7d1fa6fb58b48f351c330296d/dexmaker/src/main/java/com/android/dx/Code.java#L254-L259 |
square/okhttp | okhttp/src/main/java/okhttp3/internal/cache/CacheStrategy.java | CacheStrategy.isCacheable | public static boolean isCacheable(Response response, Request request) {
// Always go to network for uncacheable response codes (RFC 7231 section 6.1),
// This implementation doesn't support caching partial content.
switch (response.code()) {
case HTTP_OK:
case HTTP_NOT_AUTHORITATIVE:
case ... | java | public static boolean isCacheable(Response response, Request request) {
// Always go to network for uncacheable response codes (RFC 7231 section 6.1),
// This implementation doesn't support caching partial content.
switch (response.code()) {
case HTTP_OK:
case HTTP_NOT_AUTHORITATIVE:
case ... | [
"public",
"static",
"boolean",
"isCacheable",
"(",
"Response",
"response",
",",
"Request",
"request",
")",
"{",
"// Always go to network for uncacheable response codes (RFC 7231 section 6.1),",
"// This implementation doesn't support caching partial content.",
"switch",
"(",
"respons... | Returns true if {@code response} can be stored to later serve another request. | [
"Returns",
"true",
"if",
"{"
] | train | https://github.com/square/okhttp/blob/a8c65a822dd6cadd2de7d115bf94adf312e67868/okhttp/src/main/java/okhttp3/internal/cache/CacheStrategy.java#L63-L101 |
sagiegurari/fax4j | src/main/java/org/fax4j/util/IOHelper.java | IOHelper.writeFile | public static void writeFile(byte[] content,File file) throws IOException
{
OutputStream outputStream=null;
try
{
//create output stream to file
outputStream=new FileOutputStream(file);
//write to file
outputStream.write(content);
... | java | public static void writeFile(byte[] content,File file) throws IOException
{
OutputStream outputStream=null;
try
{
//create output stream to file
outputStream=new FileOutputStream(file);
//write to file
outputStream.write(content);
... | [
"public",
"static",
"void",
"writeFile",
"(",
"byte",
"[",
"]",
"content",
",",
"File",
"file",
")",
"throws",
"IOException",
"{",
"OutputStream",
"outputStream",
"=",
"null",
";",
"try",
"{",
"//create output stream to file",
"outputStream",
"=",
"new",
"FileOu... | Writes the content to the file.
@param content
The content to write to the provided file
@param file
The target file
@throws IOException
Any IO exception | [
"Writes",
"the",
"content",
"to",
"the",
"file",
"."
] | train | https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/util/IOHelper.java#L463-L479 |
primefaces/primefaces | src/main/java/org/primefaces/component/importconstants/ImportConstantsTagHandler.java | ImportConstantsTagHandler.getClassFromAttribute | protected Class<?> getClassFromAttribute(TagAttribute attribute, FaceletContext ctx) {
String type = attribute.getValue(ctx);
try {
return LangUtils.loadClassForName(type);
}
catch (ClassNotFoundException e) {
throw new FacesException("Class " + type + " not foun... | java | protected Class<?> getClassFromAttribute(TagAttribute attribute, FaceletContext ctx) {
String type = attribute.getValue(ctx);
try {
return LangUtils.loadClassForName(type);
}
catch (ClassNotFoundException e) {
throw new FacesException("Class " + type + " not foun... | [
"protected",
"Class",
"<",
"?",
">",
"getClassFromAttribute",
"(",
"TagAttribute",
"attribute",
",",
"FaceletContext",
"ctx",
")",
"{",
"String",
"type",
"=",
"attribute",
".",
"getValue",
"(",
"ctx",
")",
";",
"try",
"{",
"return",
"LangUtils",
".",
"loadCl... | Gets the {@link Class} from the {@link TagAttribute}.
@param attribute The {@link TagAttribute}.
@param ctx The {@link FaceletContext}.
@return The {@link Class}. | [
"Gets",
"the",
"{",
"@link",
"Class",
"}",
"from",
"the",
"{",
"@link",
"TagAttribute",
"}",
"."
] | train | https://github.com/primefaces/primefaces/blob/b8cdd5ed395d09826e40e3302d6b14901d3ef4e7/src/main/java/org/primefaces/component/importconstants/ImportConstantsTagHandler.java#L86-L95 |
finmath/finmath-lib | src/main/java/net/finmath/montecarlo/interestrate/products/BermudanSwaptionFromSwapSchedules.java | BermudanSwaptionFromSwapSchedules.getConditionalExpectationEstimator | public ConditionalExpectationEstimator getConditionalExpectationEstimator(double exerciseTime, LIBORModelMonteCarloSimulationModel model) throws CalculationException {
RandomVariable[] regressionBasisFunctions = regressionBasisFunctionProvider.getBasisFunctions(exerciseTime, model);
return conditionalExpectationR... | java | public ConditionalExpectationEstimator getConditionalExpectationEstimator(double exerciseTime, LIBORModelMonteCarloSimulationModel model) throws CalculationException {
RandomVariable[] regressionBasisFunctions = regressionBasisFunctionProvider.getBasisFunctions(exerciseTime, model);
return conditionalExpectationR... | [
"public",
"ConditionalExpectationEstimator",
"getConditionalExpectationEstimator",
"(",
"double",
"exerciseTime",
",",
"LIBORModelMonteCarloSimulationModel",
"model",
")",
"throws",
"CalculationException",
"{",
"RandomVariable",
"[",
"]",
"regressionBasisFunctions",
"=",
"regress... | The conditional expectation is calculated using a Monte-Carlo regression technique.
@param exerciseTime The exercise time
@param model The valuation model
@return The condition expectation estimator
@throws CalculationException Thrown if underlying model failed to calculate stochastic process. | [
"The",
"conditional",
"expectation",
"is",
"calculated",
"using",
"a",
"Monte",
"-",
"Carlo",
"regression",
"technique",
"."
] | train | https://github.com/finmath/finmath-lib/blob/a3c067d52dd33feb97d851df6cab130e4116759f/src/main/java/net/finmath/montecarlo/interestrate/products/BermudanSwaptionFromSwapSchedules.java#L324-L327 |
relayrides/pushy | pushy/src/main/java/com/turo/pushy/apns/util/ApnsPayloadBuilder.java | ApnsPayloadBuilder.addCustomProperty | public ApnsPayloadBuilder addCustomProperty(final String key, final Object value) {
this.customProperties.put(key, value);
return this;
} | java | public ApnsPayloadBuilder addCustomProperty(final String key, final Object value) {
this.customProperties.put(key, value);
return this;
} | [
"public",
"ApnsPayloadBuilder",
"addCustomProperty",
"(",
"final",
"String",
"key",
",",
"final",
"Object",
"value",
")",
"{",
"this",
".",
"customProperties",
".",
"put",
"(",
"key",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | <p>Adds a custom property to the payload. According to Apple's documentation:</p>
<blockquote>Providers can specify custom payload values outside the Apple-reserved {@code aps} namespace. Custom
values must use the JSON structured and primitive types: dictionary (object), array, string, number, and Boolean.
You should... | [
"<p",
">",
"Adds",
"a",
"custom",
"property",
"to",
"the",
"payload",
".",
"According",
"to",
"Apple",
"s",
"documentation",
":",
"<",
"/",
"p",
">"
] | train | https://github.com/relayrides/pushy/blob/1f6f9a0e07d785c815d74c2320a8d87c80231d36/pushy/src/main/java/com/turo/pushy/apns/util/ApnsPayloadBuilder.java#L680-L683 |
greenmail-mail-test/greenmail | greenmail-core/src/main/java/com/icegreen/greenmail/util/DummySSLSocketFactory.java | DummySSLSocketFactory.trySetFakeRemoteHost | private static void trySetFakeRemoteHost(Socket socket) {
try {
final Method setHostMethod = socket.getClass().getMethod("setHost", String.class);
String fakeHostName = "greenmailHost" + new BigInteger(130, new Random()).toString(32);
setHostMethod.invoke(socket, fakeHost... | java | private static void trySetFakeRemoteHost(Socket socket) {
try {
final Method setHostMethod = socket.getClass().getMethod("setHost", String.class);
String fakeHostName = "greenmailHost" + new BigInteger(130, new Random()).toString(32);
setHostMethod.invoke(socket, fakeHost... | [
"private",
"static",
"void",
"trySetFakeRemoteHost",
"(",
"Socket",
"socket",
")",
"{",
"try",
"{",
"final",
"Method",
"setHostMethod",
"=",
"socket",
".",
"getClass",
"(",
")",
".",
"getMethod",
"(",
"\"setHost\"",
",",
"String",
".",
"class",
")",
";",
"... | We set the host name of the remote machine because otherwise the SSL implementation is going to try
to try to do a reverse lookup to find out the host name for the host which is really slow.
Of course we don't know the host name of the remote machine so we just set a fake host name that is unique.
<p/>
This forces the ... | [
"We",
"set",
"the",
"host",
"name",
"of",
"the",
"remote",
"machine",
"because",
"otherwise",
"the",
"SSL",
"implementation",
"is",
"going",
"to",
"try",
"to",
"try",
"to",
"do",
"a",
"reverse",
"lookup",
"to",
"find",
"out",
"the",
"host",
"name",
"for"... | train | https://github.com/greenmail-mail-test/greenmail/blob/6d19a62233d1ef6fedbbd1f6fdde2d28e713834a/greenmail-core/src/main/java/com/icegreen/greenmail/util/DummySSLSocketFactory.java#L123-L135 |
albfernandez/itext2 | src/main/java/com/lowagie/text/pdf/PdfDocument.java | PdfDocument.remoteGoto | void remoteGoto(String filename, int page, float llx, float lly, float urx, float ury) {
addAnnotation(new PdfAnnotation(writer, llx, lly, urx, ury, new PdfAction(filename, page)));
} | java | void remoteGoto(String filename, int page, float llx, float lly, float urx, float ury) {
addAnnotation(new PdfAnnotation(writer, llx, lly, urx, ury, new PdfAction(filename, page)));
} | [
"void",
"remoteGoto",
"(",
"String",
"filename",
",",
"int",
"page",
",",
"float",
"llx",
",",
"float",
"lly",
",",
"float",
"urx",
",",
"float",
"ury",
")",
"{",
"addAnnotation",
"(",
"new",
"PdfAnnotation",
"(",
"writer",
",",
"llx",
",",
"lly",
",",... | Implements a link to another document.
@param filename the filename for the remote document
@param page the page to jump to
@param llx the lower left x corner of the activation area
@param lly the lower left y corner of the activation area
@param urx the upper right x corner of the activation area
@param ury the upper ... | [
"Implements",
"a",
"link",
"to",
"another",
"document",
"."
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/PdfDocument.java#L2040-L2042 |
JetBrains/xodus | vfs/src/main/java/jetbrains/exodus/vfs/VirtualFileSystem.java | VirtualFileSystem.writeFile | public OutputStream writeFile(@NotNull final Transaction txn, @NotNull final File file) {
return new VfsOutputStream(this, txn, file.getDescriptor(), new LastModifiedTrigger(txn, file, pathnames));
} | java | public OutputStream writeFile(@NotNull final Transaction txn, @NotNull final File file) {
return new VfsOutputStream(this, txn, file.getDescriptor(), new LastModifiedTrigger(txn, file, pathnames));
} | [
"public",
"OutputStream",
"writeFile",
"(",
"@",
"NotNull",
"final",
"Transaction",
"txn",
",",
"@",
"NotNull",
"final",
"File",
"file",
")",
"{",
"return",
"new",
"VfsOutputStream",
"(",
"this",
",",
"txn",
",",
"file",
".",
"getDescriptor",
"(",
")",
","... | Returns {@linkplain OutputStream} to write the contents of the specified file from the beginning.
@param txn {@linkplain Transaction} instance
@param file {@linkplain File} instance
@return {@linkplain OutputStream} to write the contents of the specified file from the beginning
@see #readFile(Transaction, File)
@see ... | [
"Returns",
"{",
"@linkplain",
"OutputStream",
"}",
"to",
"write",
"the",
"contents",
"of",
"the",
"specified",
"file",
"from",
"the",
"beginning",
"."
] | train | https://github.com/JetBrains/xodus/blob/7b3476c4e81db66f9c7529148c761605cc8eea6d/vfs/src/main/java/jetbrains/exodus/vfs/VirtualFileSystem.java#L494-L496 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/query/QueryFactory.java | QueryFactory.addCriteriaForOjbConcreteClasses | private static Criteria addCriteriaForOjbConcreteClasses(ClassDescriptor cld, Criteria crit)
{
/**
* 1. check if this class has a ojbConcreteClass attribute
*/
Criteria concreteClassDiscriminator = null;
Collection classes = getExtentClasses(cld);
/**
... | java | private static Criteria addCriteriaForOjbConcreteClasses(ClassDescriptor cld, Criteria crit)
{
/**
* 1. check if this class has a ojbConcreteClass attribute
*/
Criteria concreteClassDiscriminator = null;
Collection classes = getExtentClasses(cld);
/**
... | [
"private",
"static",
"Criteria",
"addCriteriaForOjbConcreteClasses",
"(",
"ClassDescriptor",
"cld",
",",
"Criteria",
"crit",
")",
"{",
"/**\r\n * 1. check if this class has a ojbConcreteClass attribute\r\n */",
"Criteria",
"concreteClassDiscriminator",
"=",
"null",
... | Searches the class descriptor for the ojbConcrete class attribute
if it finds the concrete class attribute, append a where clause which
specifies we can load all classes that are this type or extents of this type.
@param cld
@param crit
@return the passed in Criteria object + optionally and'ed criteria with OR'd class
... | [
"Searches",
"the",
"class",
"descriptor",
"for",
"the",
"ojbConcrete",
"class",
"attribute",
"if",
"it",
"finds",
"the",
"concrete",
"class",
"attribute",
"append",
"a",
"where",
"clause",
"which",
"specifies",
"we",
"can",
"load",
"all",
"classes",
"that",
"a... | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/query/QueryFactory.java#L216-L263 |
JDBDT/jdbdt | src/main/java/org/jdbdt/DataSource.java | DataSource.theEmptySet | final DataSet theEmptySet() {
if (theEmptyOne == null) {
theEmptyOne = new DataSet(this, EMPTY_ROW_LIST);
theEmptyOne.setReadOnly();
}
return theEmptyOne;
} | java | final DataSet theEmptySet() {
if (theEmptyOne == null) {
theEmptyOne = new DataSet(this, EMPTY_ROW_LIST);
theEmptyOne.setReadOnly();
}
return theEmptyOne;
} | [
"final",
"DataSet",
"theEmptySet",
"(",
")",
"{",
"if",
"(",
"theEmptyOne",
"==",
"null",
")",
"{",
"theEmptyOne",
"=",
"new",
"DataSet",
"(",
"this",
",",
"EMPTY_ROW_LIST",
")",
";",
"theEmptyOne",
".",
"setReadOnly",
"(",
")",
";",
"}",
"return",
"theE... | Return an empty, read-only data set,
for use by {@link JDBDT#empty(DataSource)}
@return Empty, read-only data set. | [
"Return",
"an",
"empty",
"read",
"-",
"only",
"data",
"set",
"for",
"use",
"by",
"{"
] | train | https://github.com/JDBDT/jdbdt/blob/7e32845ad41dfbc5d6fd0fd561e3613697186df4/src/main/java/org/jdbdt/DataSource.java#L188-L194 |
acromusashi/acromusashi-stream | src/main/java/acromusashi/stream/client/DrpcRequestClient.java | DrpcRequestClient.createClient | protected DRPCClient createClient(String host, int port, int timeout)
{
return new DRPCClient(host, port, timeout);
} | java | protected DRPCClient createClient(String host, int port, int timeout)
{
return new DRPCClient(host, port, timeout);
} | [
"protected",
"DRPCClient",
"createClient",
"(",
"String",
"host",
",",
"int",
"port",
",",
"int",
"timeout",
")",
"{",
"return",
"new",
"DRPCClient",
"(",
"host",
",",
"port",
",",
"timeout",
")",
";",
"}"
] | DRPCClientを生成する。
@param host DRPCServerホスト
@param port DRPCServerポート
@param timeout DRPCタイムアウト(ミリ秒単位)
@return DRPCClient | [
"DRPCClientを生成する。"
] | train | https://github.com/acromusashi/acromusashi-stream/blob/65b1f335d771d657c5640a2056ab5c8546eddec9/src/main/java/acromusashi/stream/client/DrpcRequestClient.java#L168-L171 |
mgormley/pacaya | src/main/java/edu/jhu/pacaya/gm/model/globalfac/ProjDepTreeFactor.java | ProjDepTreeFactor.addMsgs | private void addMsgs(VarTensor[] msgs, Tensor t, int tf) {
assert msgs[0].getAlgebra().equals(t.getAlgebra());
EdgeScores es = EdgeScores.tensorToEdgeScores(t);
for (VarTensor msg : msgs) {
LinkVar link = (LinkVar) msg.getVars().get(0);
double val = es.getScore(link.getPa... | java | private void addMsgs(VarTensor[] msgs, Tensor t, int tf) {
assert msgs[0].getAlgebra().equals(t.getAlgebra());
EdgeScores es = EdgeScores.tensorToEdgeScores(t);
for (VarTensor msg : msgs) {
LinkVar link = (LinkVar) msg.getVars().get(0);
double val = es.getScore(link.getPa... | [
"private",
"void",
"addMsgs",
"(",
"VarTensor",
"[",
"]",
"msgs",
",",
"Tensor",
"t",
",",
"int",
"tf",
")",
"{",
"assert",
"msgs",
"[",
"0",
"]",
".",
"getAlgebra",
"(",
")",
".",
"equals",
"(",
"t",
".",
"getAlgebra",
"(",
")",
")",
";",
"EdgeS... | Adds to messages on a Messages[].
@param msgs The output messages.
@param t The input messages.
@param tf Whether to set TRUE or FALSE messages. | [
"Adds",
"to",
"messages",
"on",
"a",
"Messages",
"[]",
"."
] | train | https://github.com/mgormley/pacaya/blob/786294cbac7cc65dbc32210c10acc32ed0c69233/src/main/java/edu/jhu/pacaya/gm/model/globalfac/ProjDepTreeFactor.java#L318-L326 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCircuitsInner.java | ExpressRouteCircuitsInner.getByResourceGroup | public ExpressRouteCircuitInner getByResourceGroup(String resourceGroupName, String circuitName) {
return getByResourceGroupWithServiceResponseAsync(resourceGroupName, circuitName).toBlocking().single().body();
} | java | public ExpressRouteCircuitInner getByResourceGroup(String resourceGroupName, String circuitName) {
return getByResourceGroupWithServiceResponseAsync(resourceGroupName, circuitName).toBlocking().single().body();
} | [
"public",
"ExpressRouteCircuitInner",
"getByResourceGroup",
"(",
"String",
"resourceGroupName",
",",
"String",
"circuitName",
")",
"{",
"return",
"getByResourceGroupWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"circuitName",
")",
".",
"toBlocking",
"(",
")",
... | Gets information about the specified express route circuit.
@param resourceGroupName The name of the resource group.
@param circuitName The name of express route circuit.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if the request is rejected by server
@throws... | [
"Gets",
"information",
"about",
"the",
"specified",
"express",
"route",
"circuit",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCircuitsInner.java#L310-L312 |
liferay/com-liferay-commerce | commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CPDAvailabilityEstimatePersistenceImpl.java | CPDAvailabilityEstimatePersistenceImpl.removeByUuid_C | @Override
public void removeByUuid_C(String uuid, long companyId) {
for (CPDAvailabilityEstimate cpdAvailabilityEstimate : findByUuid_C(
uuid, companyId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
remove(cpdAvailabilityEstimate);
}
} | java | @Override
public void removeByUuid_C(String uuid, long companyId) {
for (CPDAvailabilityEstimate cpdAvailabilityEstimate : findByUuid_C(
uuid, companyId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
remove(cpdAvailabilityEstimate);
}
} | [
"@",
"Override",
"public",
"void",
"removeByUuid_C",
"(",
"String",
"uuid",
",",
"long",
"companyId",
")",
"{",
"for",
"(",
"CPDAvailabilityEstimate",
"cpdAvailabilityEstimate",
":",
"findByUuid_C",
"(",
"uuid",
",",
"companyId",
",",
"QueryUtil",
".",
"ALL_POS",
... | Removes all the cpd availability estimates where uuid = ? and companyId = ? from the database.
@param uuid the uuid
@param companyId the company ID | [
"Removes",
"all",
"the",
"cpd",
"availability",
"estimates",
"where",
"uuid",
"=",
"?",
";",
"and",
"companyId",
"=",
"?",
";",
"from",
"the",
"database",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CPDAvailabilityEstimatePersistenceImpl.java#L1416-L1422 |
skyscreamer/JSONassert | src/main/java/org/skyscreamer/jsonassert/JSONCompare.java | JSONCompare.compareJSON | public static JSONCompareResult compareJSON(JSONArray expected, JSONArray actual, JSONComparator comparator)
throws JSONException {
return comparator.compareJSON(expected, actual);
} | java | public static JSONCompareResult compareJSON(JSONArray expected, JSONArray actual, JSONComparator comparator)
throws JSONException {
return comparator.compareJSON(expected, actual);
} | [
"public",
"static",
"JSONCompareResult",
"compareJSON",
"(",
"JSONArray",
"expected",
",",
"JSONArray",
"actual",
",",
"JSONComparator",
"comparator",
")",
"throws",
"JSONException",
"{",
"return",
"comparator",
".",
"compareJSON",
"(",
"expected",
",",
"actual",
")... | Compares JSON object provided to the expected JSON object using provided comparator, and returns the results of
the comparison.
@param expected expected json array
@param actual actual json array
@param comparator comparator to use
@return result of the comparison
@throws JSONException JSON parsing error | [
"Compares",
"JSON",
"object",
"provided",
"to",
"the",
"expected",
"JSON",
"object",
"using",
"provided",
"comparator",
"and",
"returns",
"the",
"results",
"of",
"the",
"comparison",
"."
] | train | https://github.com/skyscreamer/JSONassert/blob/830efcf546d07f955d8a213cc5c8a1db34d78f04/src/main/java/org/skyscreamer/jsonassert/JSONCompare.java#L91-L94 |
GenesysPureEngage/workspace-client-java | src/main/java/com/genesys/internal/workspace/api/ChatApi.java | ChatApi.sendCustomNotification | public ApiSuccessResponse sendCustomNotification(String id, CustomNotificationData customNotificationData) throws ApiException {
ApiResponse<ApiSuccessResponse> resp = sendCustomNotificationWithHttpInfo(id, customNotificationData);
return resp.getData();
} | java | public ApiSuccessResponse sendCustomNotification(String id, CustomNotificationData customNotificationData) throws ApiException {
ApiResponse<ApiSuccessResponse> resp = sendCustomNotificationWithHttpInfo(id, customNotificationData);
return resp.getData();
} | [
"public",
"ApiSuccessResponse",
"sendCustomNotification",
"(",
"String",
"id",
",",
"CustomNotificationData",
"customNotificationData",
")",
"throws",
"ApiException",
"{",
"ApiResponse",
"<",
"ApiSuccessResponse",
">",
"resp",
"=",
"sendCustomNotificationWithHttpInfo",
"(",
... | Send a custom notification
Send a custom notification to the specified chat. The notification is typically used as a trigger for some custom behavior on the recipient's end.
@param id The ID of the chat interaction. (required)
@param customNotificationData Request parameters. (optional)
@return ApiSuccessResponse
@... | [
"Send",
"a",
"custom",
"notification",
"Send",
"a",
"custom",
"notification",
"to",
"the",
"specified",
"chat",
".",
"The",
"notification",
"is",
"typically",
"used",
"as",
"a",
"trigger",
"for",
"some",
"custom",
"behavior",
"on",
"the",
"recipient'",
";",... | train | https://github.com/GenesysPureEngage/workspace-client-java/blob/509fdd9e89b9359d012f9a72be95037a3cef53e6/src/main/java/com/genesys/internal/workspace/api/ChatApi.java#L1445-L1448 |
kiswanij/jk-util | src/main/java/com/jk/util/model/table/JKDefaultTableModel.java | JKDefaultTableModel.insertRow | public void insertRow(final int row, final Vector rowData) {
this.dataVector.insertElementAt(rowData, row);
justifyRows(row, row + 1);
fireTableRowsInserted(row, row);
} | java | public void insertRow(final int row, final Vector rowData) {
this.dataVector.insertElementAt(rowData, row);
justifyRows(row, row + 1);
fireTableRowsInserted(row, row);
} | [
"public",
"void",
"insertRow",
"(",
"final",
"int",
"row",
",",
"final",
"Vector",
"rowData",
")",
"{",
"this",
".",
"dataVector",
".",
"insertElementAt",
"(",
"rowData",
",",
"row",
")",
";",
"justifyRows",
"(",
"row",
",",
"row",
"+",
"1",
")",
";",
... | Inserts a row at <code>row</code> in the model. The new row will contain
<code>null</code> values unless <code>rowData</code> is specified.
Notification of the row being added will be generated.
@param row the row index of the row to be inserted
@param rowData optional data of the row being added
@exception ArrayI... | [
"Inserts",
"a",
"row",
"at",
"<code",
">",
"row<",
"/",
"code",
">",
"in",
"the",
"model",
".",
"The",
"new",
"row",
"will",
"contain",
"<code",
">",
"null<",
"/",
"code",
">",
"values",
"unless",
"<code",
">",
"rowData<",
"/",
"code",
">",
"is",
"... | train | https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/model/table/JKDefaultTableModel.java#L437-L441 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.