repository_name stringlengths 7 58 | func_path_in_repository stringlengths 11 218 | func_name stringlengths 4 140 | whole_func_string stringlengths 153 5.32k | language stringclasses 1
value | func_code_string stringlengths 72 4k | func_code_tokens listlengths 20 832 | func_documentation_string stringlengths 61 2k | func_documentation_tokens listlengths 1 647 | split_name stringclasses 1
value | func_code_url stringlengths 102 339 |
|---|---|---|---|---|---|---|---|---|---|---|
roboconf/roboconf-platform | core/roboconf-dm/src/main/java/net/roboconf/dm/internal/utils/ConfigurationUtils.java | ConfigurationUtils.saveApplicationBindings | public static void saveApplicationBindings( Application app ) {
"""
Saves the application bindings into the DM's directory.
@param app a non-null application
@param configurationDirectory the DM's configuration directory
"""
File descDir = new File( app.getDirectory(), Constants.PROJECT_DIR_DESC );
File... | java | public static void saveApplicationBindings( Application app ) {
File descDir = new File( app.getDirectory(), Constants.PROJECT_DIR_DESC );
File appBindingsFile = new File( descDir, APP_BINDINGS_FILE );
// Convert the bindings map
Map<String,String> format = new HashMap<> ();
for( Map.Entry<String,Set<String... | [
"public",
"static",
"void",
"saveApplicationBindings",
"(",
"Application",
"app",
")",
"{",
"File",
"descDir",
"=",
"new",
"File",
"(",
"app",
".",
"getDirectory",
"(",
")",
",",
"Constants",
".",
"PROJECT_DIR_DESC",
")",
";",
"File",
"appBindingsFile",
"=",
... | Saves the application bindings into the DM's directory.
@param app a non-null application
@param configurationDirectory the DM's configuration directory | [
"Saves",
"the",
"application",
"bindings",
"into",
"the",
"DM",
"s",
"directory",
"."
] | train | https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-dm/src/main/java/net/roboconf/dm/internal/utils/ConfigurationUtils.java#L202-L227 |
alkacon/opencms-core | src-modules/org/opencms/workplace/editors/CmsDialogProperty.java | CmsDialogProperty.addCurrentTemplate | private void addCurrentTemplate(String currentTemplate, List<String> options, List<String> values) {
"""
Adds the currently selected template value to the option and value list.<p>
@param currentTemplate the currently selected template to add
@param options the option list
@param values the value list
"""... | java | private void addCurrentTemplate(String currentTemplate, List<String> options, List<String> values) {
CmsMessages messages = Messages.get().getBundle(getLocale());
// template was not found in regular template folders, add current template value
if (CmsStringUtil.isEmpty(currentTemplate)) {
... | [
"private",
"void",
"addCurrentTemplate",
"(",
"String",
"currentTemplate",
",",
"List",
"<",
"String",
">",
"options",
",",
"List",
"<",
"String",
">",
"values",
")",
"{",
"CmsMessages",
"messages",
"=",
"Messages",
".",
"get",
"(",
")",
".",
"getBundle",
... | Adds the currently selected template value to the option and value list.<p>
@param currentTemplate the currently selected template to add
@param options the option list
@param values the value list | [
"Adds",
"the",
"currently",
"selected",
"template",
"value",
"to",
"the",
"option",
"and",
"value",
"list",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/editors/CmsDialogProperty.java#L300-L330 |
google/j2objc | jre_emul/openjdk/src/share/classes/java/math/BigDecimal.java | BigDecimal.divideAndRound | private static BigInteger divideAndRound(BigInteger bdividend, BigInteger bdivisor, int roundingMode) {
"""
Divides {@code BigInteger} value by {@code BigInteger} value and
do rounding based on the passed in roundingMode.
"""
boolean isRemainderZero; // record remainder is zero or not
int qsig... | java | private static BigInteger divideAndRound(BigInteger bdividend, BigInteger bdivisor, int roundingMode) {
boolean isRemainderZero; // record remainder is zero or not
int qsign; // quotient sign
// Descend into mutables for faster remainder checks
MutableBigInteger mdividend = new MutableBi... | [
"private",
"static",
"BigInteger",
"divideAndRound",
"(",
"BigInteger",
"bdividend",
",",
"BigInteger",
"bdivisor",
",",
"int",
"roundingMode",
")",
"{",
"boolean",
"isRemainderZero",
";",
"// record remainder is zero or not",
"int",
"qsign",
";",
"// quotient sign",
"/... | Divides {@code BigInteger} value by {@code BigInteger} value and
do rounding based on the passed in roundingMode. | [
"Divides",
"{"
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/openjdk/src/share/classes/java/math/BigDecimal.java#L4293-L4309 |
SvenEwald/xmlbeam | src/main/java/org/xmlbeam/io/UrlIO.java | UrlIO.addRequestProperties | @Scope(DocScope.IO)
public UrlIO addRequestProperties(final Map<String, String> params) {
"""
Allows to add some request properties.
@param params
@return this for convenience.
"""
requestProperties.putAll(params);
return this;
} | java | @Scope(DocScope.IO)
public UrlIO addRequestProperties(final Map<String, String> params) {
requestProperties.putAll(params);
return this;
} | [
"@",
"Scope",
"(",
"DocScope",
".",
"IO",
")",
"public",
"UrlIO",
"addRequestProperties",
"(",
"final",
"Map",
"<",
"String",
",",
"String",
">",
"params",
")",
"{",
"requestProperties",
".",
"putAll",
"(",
"params",
")",
";",
"return",
"this",
";",
"}"
... | Allows to add some request properties.
@param params
@return this for convenience. | [
"Allows",
"to",
"add",
"some",
"request",
"properties",
"."
] | train | https://github.com/SvenEwald/xmlbeam/blob/acaac1b8fa28d246f17187f5e3c6696458a0b447/src/main/java/org/xmlbeam/io/UrlIO.java#L98-L102 |
Azure/azure-sdk-for-java | network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/NetworkWatchersInner.java | NetworkWatchersInner.getTroubleshootingResultAsync | public Observable<TroubleshootingResultInner> getTroubleshootingResultAsync(String resourceGroupName, String networkWatcherName, String targetResourceId) {
"""
Get the last completed troubleshooting result on a specified resource.
@param resourceGroupName The name of the resource group.
@param networkWatcherNa... | java | public Observable<TroubleshootingResultInner> getTroubleshootingResultAsync(String resourceGroupName, String networkWatcherName, String targetResourceId) {
return getTroubleshootingResultWithServiceResponseAsync(resourceGroupName, networkWatcherName, targetResourceId).map(new Func1<ServiceResponse<Troubleshooti... | [
"public",
"Observable",
"<",
"TroubleshootingResultInner",
">",
"getTroubleshootingResultAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"networkWatcherName",
",",
"String",
"targetResourceId",
")",
"{",
"return",
"getTroubleshootingResultWithServiceResponseAsync",
"... | Get the last completed troubleshooting result on a specified resource.
@param resourceGroupName The name of the resource group.
@param networkWatcherName The name of the network watcher resource.
@param targetResourceId The target resource ID to query the troubleshooting result.
@throws IllegalArgumentException thrown... | [
"Get",
"the",
"last",
"completed",
"troubleshooting",
"result",
"on",
"a",
"specified",
"resource",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/NetworkWatchersInner.java#L1659-L1666 |
jnr/jnr-x86asm | src/main/java/jnr/x86asm/Asm.java | Asm.tword_ptr_abs | public static final Mem tword_ptr_abs(long target, Register index, int shift, long disp, SEGMENT segmentPrefix) {
"""
Create tword (10 Bytes) pointer operand (used for 80 bit floating points).
"""
return _ptr_build_abs(target, index, shift, disp, segmentPrefix, SIZE_TWORD);
} | java | public static final Mem tword_ptr_abs(long target, Register index, int shift, long disp, SEGMENT segmentPrefix) {
return _ptr_build_abs(target, index, shift, disp, segmentPrefix, SIZE_TWORD);
} | [
"public",
"static",
"final",
"Mem",
"tword_ptr_abs",
"(",
"long",
"target",
",",
"Register",
"index",
",",
"int",
"shift",
",",
"long",
"disp",
",",
"SEGMENT",
"segmentPrefix",
")",
"{",
"return",
"_ptr_build_abs",
"(",
"target",
",",
"index",
",",
"shift",
... | Create tword (10 Bytes) pointer operand (used for 80 bit floating points). | [
"Create",
"tword",
"(",
"10",
"Bytes",
")",
"pointer",
"operand",
"(",
"used",
"for",
"80",
"bit",
"floating",
"points",
")",
"."
] | train | https://github.com/jnr/jnr-x86asm/blob/fdcf68fb3dae49e607a49e33399e3dad1ada5536/src/main/java/jnr/x86asm/Asm.java#L470-L472 |
NordicSemiconductor/Android-DFU-Library | dfu/src/main/java/no/nordicsemi/android/dfu/SecureDfuImpl.java | SecureDfuImpl.setPacketReceiptNotifications | private void setPacketReceiptNotifications(final int number)
throws DfuException, DeviceDisconnectedException, UploadAbortedException,
UnknownResponseException, RemoteDfuException {
"""
Sets the number of packets that needs to be sent to receive the Packet Receipt Notification.
Value 0 disables PRNs. By def... | java | private void setPacketReceiptNotifications(final int number)
throws DfuException, DeviceDisconnectedException, UploadAbortedException,
UnknownResponseException, RemoteDfuException {
if (!mConnected)
throw new DeviceDisconnectedException("Unable to read Checksum: device disconnected");
// Send the number o... | [
"private",
"void",
"setPacketReceiptNotifications",
"(",
"final",
"int",
"number",
")",
"throws",
"DfuException",
",",
"DeviceDisconnectedException",
",",
"UploadAbortedException",
",",
"UnknownResponseException",
",",
"RemoteDfuException",
"{",
"if",
"(",
"!",
"mConnecte... | Sets the number of packets that needs to be sent to receive the Packet Receipt Notification.
Value 0 disables PRNs. By default this is disabled. The PRNs may be used to send both the
Data and Command object, but this Secure DFU implementation can handle them only during Data transfer.
<p>
The intention of having PRNs i... | [
"Sets",
"the",
"number",
"of",
"packets",
"that",
"needs",
"to",
"be",
"sent",
"to",
"receive",
"the",
"Packet",
"Receipt",
"Notification",
".",
"Value",
"0",
"disables",
"PRNs",
".",
"By",
"default",
"this",
"is",
"disabled",
".",
"The",
"PRNs",
"may",
... | train | https://github.com/NordicSemiconductor/Android-DFU-Library/blob/ec14c8c522bebe801a9a4c3dfbbeb1f53262c03f/dfu/src/main/java/no/nordicsemi/android/dfu/SecureDfuImpl.java#L759-L777 |
khuxtable/seaglass | src/main/java/com/seaglasslookandfeel/painter/util/ShapeGenerator.java | ShapeGenerator.createOpenRectangle | public Shape createOpenRectangle(final int x, final int y, final int w, final int h) {
"""
Return a path for a rectangle with square corners and no right side. This
is used for text fields that are part of a larger control, which is
placed to their left, e.g. spinners and editable combo boxes.
<p>This path is... | java | public Shape createOpenRectangle(final int x, final int y, final int w, final int h) {
path.reset();
path.moveTo(x + w, y);
path.lineTo(x, y);
path.lineTo(x, y + h);
path.lineTo(x + w, y + h);
return path;
} | [
"public",
"Shape",
"createOpenRectangle",
"(",
"final",
"int",
"x",
",",
"final",
"int",
"y",
",",
"final",
"int",
"w",
",",
"final",
"int",
"h",
")",
"{",
"path",
".",
"reset",
"(",
")",
";",
"path",
".",
"moveTo",
"(",
"x",
"+",
"w",
",",
"y",
... | Return a path for a rectangle with square corners and no right side. This
is used for text fields that are part of a larger control, which is
placed to their left, e.g. spinners and editable combo boxes.
<p>This path is suitable for drawing, not for filling.</p>
@param x the X coordinate of the upper-left corner of ... | [
"Return",
"a",
"path",
"for",
"a",
"rectangle",
"with",
"square",
"corners",
"and",
"no",
"right",
"side",
".",
"This",
"is",
"used",
"for",
"text",
"fields",
"that",
"are",
"part",
"of",
"a",
"larger",
"control",
"which",
"is",
"placed",
"to",
"their",
... | train | https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/painter/util/ShapeGenerator.java#L258-L266 |
groovy/groovy-core | src/main/org/codehaus/groovy/runtime/ResourceGroovyMethods.java | ResourceGroovyMethods.splitEachLine | public static <T> T splitEachLine(File self, String regex, @ClosureParams(value=SimpleType.class, options="java.lang.String[]") Closure<T> closure) throws IOException {
"""
Iterates through this file line by line, splitting each line using
the given regex separator. For each line, the given closure is called with... | java | public static <T> T splitEachLine(File self, String regex, @ClosureParams(value=SimpleType.class, options="java.lang.String[]") Closure<T> closure) throws IOException {
return IOGroovyMethods.splitEachLine(newReader(self), regex, closure);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"splitEachLine",
"(",
"File",
"self",
",",
"String",
"regex",
",",
"@",
"ClosureParams",
"(",
"value",
"=",
"SimpleType",
".",
"class",
",",
"options",
"=",
"\"java.lang.String[]\"",
")",
"Closure",
"<",
"T",
">",
... | Iterates through this file line by line, splitting each line using
the given regex separator. For each line, the given closure is called with
a single parameter being the list of strings computed by splitting the line
around matches of the given regular expression.
Finally the resources used for processing the file are... | [
"Iterates",
"through",
"this",
"file",
"line",
"by",
"line",
"splitting",
"each",
"line",
"using",
"the",
"given",
"regex",
"separator",
".",
"For",
"each",
"line",
"the",
"given",
"closure",
"is",
"called",
"with",
"a",
"single",
"parameter",
"being",
"the"... | train | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/org/codehaus/groovy/runtime/ResourceGroovyMethods.java#L378-L380 |
jpaoletti/java-presentation-manager | modules/jpm-core/src/main/java/jpaoletti/jpm/converter/Converter.java | Converter.getValue | protected Object getValue(EntityInstanceWrapper einstance, Field field) {
"""
Getter for the value
@param einstance The entity instance wrapper
@param field The field
@return The field value on the entity instance
"""
return getValue(einstance.getInstance(), field);
} | java | protected Object getValue(EntityInstanceWrapper einstance, Field field) {
return getValue(einstance.getInstance(), field);
} | [
"protected",
"Object",
"getValue",
"(",
"EntityInstanceWrapper",
"einstance",
",",
"Field",
"field",
")",
"{",
"return",
"getValue",
"(",
"einstance",
".",
"getInstance",
"(",
")",
",",
"field",
")",
";",
"}"
] | Getter for the value
@param einstance The entity instance wrapper
@param field The field
@return The field value on the entity instance | [
"Getter",
"for",
"the",
"value"
] | train | https://github.com/jpaoletti/java-presentation-manager/blob/d5aab55638383695db244744b4bfe27c5200e04f/modules/jpm-core/src/main/java/jpaoletti/jpm/converter/Converter.java#L103-L105 |
unbescape/unbescape | src/main/java/org/unbescape/java/JavaEscape.java | JavaEscape.escapeJava | public static void escapeJava(final Reader reader, final Writer writer, final JavaEscapeLevel level)
throws IOException {
"""
<p>
Perform a (configurable) Java <strong>escape</strong> operation on a <tt>Reader</tt> input,
writing results to a <tt>Writer</tt>.
</p>
<p>
This method will perform an e... | java | public static void escapeJava(final Reader reader, final Writer writer, final JavaEscapeLevel level)
throws IOException {
if (writer == null) {
throw new IllegalArgumentException("Argument 'writer' cannot be null");
}
if (level == null) {
throw new IllegalAr... | [
"public",
"static",
"void",
"escapeJava",
"(",
"final",
"Reader",
"reader",
",",
"final",
"Writer",
"writer",
",",
"final",
"JavaEscapeLevel",
"level",
")",
"throws",
"IOException",
"{",
"if",
"(",
"writer",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalAr... | <p>
Perform a (configurable) Java <strong>escape</strong> operation on a <tt>Reader</tt> input,
writing results to a <tt>Writer</tt>.
</p>
<p>
This method will perform an escape operation according to the specified
{@link org.unbescape.java.JavaEscapeLevel} argument value.
</p>
<p>
All other <tt>String</tt>/<tt>Writer<... | [
"<p",
">",
"Perform",
"a",
"(",
"configurable",
")",
"Java",
"<strong",
">",
"escape<",
"/",
"strong",
">",
"operation",
"on",
"a",
"<tt",
">",
"Reader<",
"/",
"tt",
">",
"input",
"writing",
"results",
"to",
"a",
"<tt",
">",
"Writer<",
"/",
"tt",
">"... | train | https://github.com/unbescape/unbescape/blob/ec5435fb3508c2eed25d8165dc27ded2602cae13/src/main/java/org/unbescape/java/JavaEscape.java#L639-L652 |
lecousin/java-framework-core | net.lecousin.core/src/main/java/net/lecousin/framework/memory/Cache.java | Cache.free | public synchronized void free(Value value, CloseableListenable user) {
"""
Signal that the given cached data is not anymore used by the given user.
"""
Data<Value> data = values.get(value);
if (data == null) return;
data.lastUsage = System.currentTimeMillis();
data.users.remove(user);
} | java | public synchronized void free(Value value, CloseableListenable user) {
Data<Value> data = values.get(value);
if (data == null) return;
data.lastUsage = System.currentTimeMillis();
data.users.remove(user);
} | [
"public",
"synchronized",
"void",
"free",
"(",
"Value",
"value",
",",
"CloseableListenable",
"user",
")",
"{",
"Data",
"<",
"Value",
">",
"data",
"=",
"values",
".",
"get",
"(",
"value",
")",
";",
"if",
"(",
"data",
"==",
"null",
")",
"return",
";",
... | Signal that the given cached data is not anymore used by the given user. | [
"Signal",
"that",
"the",
"given",
"cached",
"data",
"is",
"not",
"anymore",
"used",
"by",
"the",
"given",
"user",
"."
] | train | https://github.com/lecousin/java-framework-core/blob/b0c893b44bfde2c03f90ea846a49ef5749d598f3/net.lecousin.core/src/main/java/net/lecousin/framework/memory/Cache.java#L67-L72 |
looly/hutool | hutool-poi/src/main/java/cn/hutool/poi/excel/style/StyleUtil.java | StyleUtil.setColor | public static CellStyle setColor(CellStyle cellStyle, short color, FillPatternType fillPattern) {
"""
给cell设置颜色
@param cellStyle {@link CellStyle}
@param color 背景颜色
@param fillPattern 填充方式 {@link FillPatternType}枚举
@return {@link CellStyle}
"""
cellStyle.setFillForegroundColor(color);
cellStyle.set... | java | public static CellStyle setColor(CellStyle cellStyle, short color, FillPatternType fillPattern) {
cellStyle.setFillForegroundColor(color);
cellStyle.setFillPattern(fillPattern);
return cellStyle;
} | [
"public",
"static",
"CellStyle",
"setColor",
"(",
"CellStyle",
"cellStyle",
",",
"short",
"color",
",",
"FillPatternType",
"fillPattern",
")",
"{",
"cellStyle",
".",
"setFillForegroundColor",
"(",
"color",
")",
";",
"cellStyle",
".",
"setFillPattern",
"(",
"fillPa... | 给cell设置颜色
@param cellStyle {@link CellStyle}
@param color 背景颜色
@param fillPattern 填充方式 {@link FillPatternType}枚举
@return {@link CellStyle} | [
"给cell设置颜色"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-poi/src/main/java/cn/hutool/poi/excel/style/StyleUtil.java#L105-L109 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_AddPoint.java | ST_AddPoint.computeDistance | private static double computeDistance(Geometry geometry, Point vertexPoint, double tolerance) {
"""
Return minimum distance between a geometry and a point.
@param geometry
@param vertexPoint
@param tolerance
@return
"""
DistanceOp distanceOp = new DistanceOp(geometry, vertexPoint, tolerance);
... | java | private static double computeDistance(Geometry geometry, Point vertexPoint, double tolerance) {
DistanceOp distanceOp = new DistanceOp(geometry, vertexPoint, tolerance);
return distanceOp.distance();
} | [
"private",
"static",
"double",
"computeDistance",
"(",
"Geometry",
"geometry",
",",
"Point",
"vertexPoint",
",",
"double",
"tolerance",
")",
"{",
"DistanceOp",
"distanceOp",
"=",
"new",
"DistanceOp",
"(",
"geometry",
",",
"vertexPoint",
",",
"tolerance",
")",
";... | Return minimum distance between a geometry and a point.
@param geometry
@param vertexPoint
@param tolerance
@return | [
"Return",
"minimum",
"distance",
"between",
"a",
"geometry",
"and",
"a",
"point",
"."
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_AddPoint.java#L234-L237 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/util/logging/Redwood.java | Redwood.appendHandler | protected static void appendHandler(Class<? extends LogRecordHandler> parent, LogRecordHandler child) {
"""
Append a Handler to every parent of the given class
@param parent The class of the parents to add the child to
@param child The Handler to add.
"""
List<LogRecordHandler> toAdd = new LinkedList<Lo... | java | protected static void appendHandler(Class<? extends LogRecordHandler> parent, LogRecordHandler child){
List<LogRecordHandler> toAdd = new LinkedList<LogRecordHandler>();
//--Find Parents
for(LogRecordHandler term : handlers){
if(parent.isAssignableFrom(term.getClass())){
toAdd.add(term);
... | [
"protected",
"static",
"void",
"appendHandler",
"(",
"Class",
"<",
"?",
"extends",
"LogRecordHandler",
">",
"parent",
",",
"LogRecordHandler",
"child",
")",
"{",
"List",
"<",
"LogRecordHandler",
">",
"toAdd",
"=",
"new",
"LinkedList",
"<",
"LogRecordHandler",
">... | Append a Handler to every parent of the given class
@param parent The class of the parents to add the child to
@param child The Handler to add. | [
"Append",
"a",
"Handler",
"to",
"every",
"parent",
"of",
"the",
"given",
"class"
] | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/util/logging/Redwood.java#L327-L339 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/Hierarchy.java | Hierarchy.isMonitorNotify | public static boolean isMonitorNotify(String methodName, String methodSig) {
"""
Determine if method whose name and signature is specified is a monitor
notify operation.
@param methodName
name of the method
@param methodSig
signature of the method
@return true if the method is a monitor notify, false if no... | java | public static boolean isMonitorNotify(String methodName, String methodSig) {
return ("notify".equals(methodName) || "notifyAll".equals(methodName)) && "()V".equals(methodSig);
} | [
"public",
"static",
"boolean",
"isMonitorNotify",
"(",
"String",
"methodName",
",",
"String",
"methodSig",
")",
"{",
"return",
"(",
"\"notify\"",
".",
"equals",
"(",
"methodName",
")",
"||",
"\"notifyAll\"",
".",
"equals",
"(",
"methodName",
")",
")",
"&&",
... | Determine if method whose name and signature is specified is a monitor
notify operation.
@param methodName
name of the method
@param methodSig
signature of the method
@return true if the method is a monitor notify, false if not | [
"Determine",
"if",
"method",
"whose",
"name",
"and",
"signature",
"is",
"specified",
"is",
"a",
"monitor",
"notify",
"operation",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/Hierarchy.java#L190-L192 |
redkale/redkale | src/org/redkale/asm/ClassReader.java | ClassReader.createDebugLabel | private void createDebugLabel(int offset, Label[] labels) {
"""
Creates a label with the Label.DEBUG flag set, if there is no already
existing label for the given offset (otherwise does nothing). The label
is created with a call to {@link #readLabel}.
@param offset
a bytecode offset in a method.
@param labe... | java | private void createDebugLabel(int offset, Label[] labels) {
if (labels[offset] == null) {
readLabel(offset, labels).status |= Label.DEBUG;
}
} | [
"private",
"void",
"createDebugLabel",
"(",
"int",
"offset",
",",
"Label",
"[",
"]",
"labels",
")",
"{",
"if",
"(",
"labels",
"[",
"offset",
"]",
"==",
"null",
")",
"{",
"readLabel",
"(",
"offset",
",",
"labels",
")",
".",
"status",
"|=",
"Label",
".... | Creates a label with the Label.DEBUG flag set, if there is no already
existing label for the given offset (otherwise does nothing). The label
is created with a call to {@link #readLabel}.
@param offset
a bytecode offset in a method.
@param labels
the already created labels, indexed by their offset. | [
"Creates",
"a",
"label",
"with",
"the",
"Label",
".",
"DEBUG",
"flag",
"set",
"if",
"there",
"is",
"no",
"already",
"existing",
"label",
"for",
"the",
"given",
"offset",
"(",
"otherwise",
"does",
"nothing",
")",
".",
"The",
"label",
"is",
"created",
"wit... | train | https://github.com/redkale/redkale/blob/ea5169b5c5ea7412fd762331c0c497165832e901/src/org/redkale/asm/ClassReader.java#L2417-L2421 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/matchspace/selector/impl/TransformerImpl.java | TransformerImpl.processANDRight | private static Selector processANDRight(Selector sel0, Selector sel1) {
"""
Subroutine of DNF0 to process AND nodes whose left child is an atom
"""
if (sel1 instanceof Operator) {
Operator oper = (Operator) sel1;
if (oper.getOp() == Selector.OR)
return makeOR(processANDRight(sel0, oper.... | java | private static Selector processANDRight(Selector sel0, Selector sel1) {
if (sel1 instanceof Operator) {
Operator oper = (Operator) sel1;
if (oper.getOp() == Selector.OR)
return makeOR(processANDRight(sel0, oper.getOperands()[0]),
processANDRight(sel0, oper.getOperands()[1])... | [
"private",
"static",
"Selector",
"processANDRight",
"(",
"Selector",
"sel0",
",",
"Selector",
"sel1",
")",
"{",
"if",
"(",
"sel1",
"instanceof",
"Operator",
")",
"{",
"Operator",
"oper",
"=",
"(",
"Operator",
")",
"sel1",
";",
"if",
"(",
"oper",
".",
"ge... | Subroutine of DNF0 to process AND nodes whose left child is an atom | [
"Subroutine",
"of",
"DNF0",
"to",
"process",
"AND",
"nodes",
"whose",
"left",
"child",
"is",
"an",
"atom"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/matchspace/selector/impl/TransformerImpl.java#L119-L128 |
gitblit/fathom | fathom-rest-swagger/src/main/java/fathom/rest/swagger/SwaggerBuilder.java | SwaggerBuilder.registerResponse | protected void registerResponse(Swagger swagger, Operation operation, Return aReturn) {
"""
Registers a declared response for the operation.
@param swagger
@param operation
@param aReturn
"""
Response response = new Response();
response.setDescription(translate(aReturn.descriptionKey(), aR... | java | protected void registerResponse(Swagger swagger, Operation operation, Return aReturn) {
Response response = new Response();
response.setDescription(translate(aReturn.descriptionKey(), aReturn.description()));
Class<?> resultType = aReturn.onResult();
if (Exception.class.isAssignableFrom... | [
"protected",
"void",
"registerResponse",
"(",
"Swagger",
"swagger",
",",
"Operation",
"operation",
",",
"Return",
"aReturn",
")",
"{",
"Response",
"response",
"=",
"new",
"Response",
"(",
")",
";",
"response",
".",
"setDescription",
"(",
"translate",
"(",
"aRe... | Registers a declared response for the operation.
@param swagger
@param operation
@param aReturn | [
"Registers",
"a",
"declared",
"response",
"for",
"the",
"operation",
"."
] | train | https://github.com/gitblit/fathom/blob/f2f820eb16e9fea1e36ad4eda4ed51b35f056538/fathom-rest-swagger/src/main/java/fathom/rest/swagger/SwaggerBuilder.java#L459-L497 |
EdwardRaff/JSAT | JSAT/src/jsat/math/optimization/NelderMead.java | NelderMead.setShrink | public void setShrink(double shrink) {
"""
Sets the shrinkage constant, which must be in the range (0, 1)
@param shrink
"""
if(shrink >= 1 || shrink <= 0 || Double.isNaN(shrink) || Double.isInfinite(shrink) )
throw new ArithmeticException("Shrinkage constant must be > 0 and < 1, not " + sh... | java | public void setShrink(double shrink)
{
if(shrink >= 1 || shrink <= 0 || Double.isNaN(shrink) || Double.isInfinite(shrink) )
throw new ArithmeticException("Shrinkage constant must be > 0 and < 1, not " + shrink);
this.shrink = shrink;
} | [
"public",
"void",
"setShrink",
"(",
"double",
"shrink",
")",
"{",
"if",
"(",
"shrink",
">=",
"1",
"||",
"shrink",
"<=",
"0",
"||",
"Double",
".",
"isNaN",
"(",
"shrink",
")",
"||",
"Double",
".",
"isInfinite",
"(",
"shrink",
")",
")",
"throw",
"new",... | Sets the shrinkage constant, which must be in the range (0, 1)
@param shrink | [
"Sets",
"the",
"shrinkage",
"constant",
"which",
"must",
"be",
"in",
"the",
"range",
"(",
"0",
"1",
")"
] | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/math/optimization/NelderMead.java#L96-L101 |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/scheduler/RoundRobinScheduler.java | RoundRobinScheduler.getWeightedQueue | private WeightedQueue getWeightedQueue(String id) {
"""
/*
Get the Queue for the respective id, if one is not available
create a new queue for that corresponding id and return it
"""
WeightedQueue weightedQueue = queues.get(id);
if (weightedQueue != null)
// queue existed
... | java | private WeightedQueue getWeightedQueue(String id)
{
WeightedQueue weightedQueue = queues.get(id);
if (weightedQueue != null)
// queue existed
return weightedQueue;
WeightedQueue maybenew = new WeightedQueue(id, getWeight(id));
weightedQueue = queues.putIfAbse... | [
"private",
"WeightedQueue",
"getWeightedQueue",
"(",
"String",
"id",
")",
"{",
"WeightedQueue",
"weightedQueue",
"=",
"queues",
".",
"get",
"(",
"id",
")",
";",
"if",
"(",
"weightedQueue",
"!=",
"null",
")",
"// queue existed",
"return",
"weightedQueue",
";",
... | /*
Get the Queue for the respective id, if one is not available
create a new queue for that corresponding id and return it | [
"/",
"*",
"Get",
"the",
"Queue",
"for",
"the",
"respective",
"id",
"if",
"one",
"is",
"not",
"available",
"create",
"a",
"new",
"queue",
"for",
"that",
"corresponding",
"id",
"and",
"return",
"it"
] | train | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/scheduler/RoundRobinScheduler.java#L137-L155 |
google/error-prone | check_api/src/main/java/com/google/errorprone/scanner/ErrorProneScanner.java | ErrorProneScanner.visitExpressionStatement | @Override
public Void visitExpressionStatement(ExpressionStatementTree tree, VisitorState visitorState) {
"""
Intentionally skip visitErroneous -- we don't analyze malformed expressions.
"""
VisitorState state =
processMatchers(
expressionStatementMatchers,
tree,
... | java | @Override
public Void visitExpressionStatement(ExpressionStatementTree tree, VisitorState visitorState) {
VisitorState state =
processMatchers(
expressionStatementMatchers,
tree,
ExpressionStatementTreeMatcher::matchExpressionStatement,
visitorState);
re... | [
"@",
"Override",
"public",
"Void",
"visitExpressionStatement",
"(",
"ExpressionStatementTree",
"tree",
",",
"VisitorState",
"visitorState",
")",
"{",
"VisitorState",
"state",
"=",
"processMatchers",
"(",
"expressionStatementMatchers",
",",
"tree",
",",
"ExpressionStatemen... | Intentionally skip visitErroneous -- we don't analyze malformed expressions. | [
"Intentionally",
"skip",
"visitErroneous",
"--",
"we",
"don",
"t",
"analyze",
"malformed",
"expressions",
"."
] | train | https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/check_api/src/main/java/com/google/errorprone/scanner/ErrorProneScanner.java#L611-L620 |
qos-ch/slf4j | jcl-over-slf4j/src/main/java/org/apache/commons/logging/impl/SLF4JLog.java | SLF4JLog.warn | public void warn(Object message, Throwable t) {
"""
Converts the first input parameter to String and then delegates to the
wrapped <code>org.slf4j.Logger</code> instance.
@param message
the message to log. Converted to {@link String}
@param t
the exception to log
"""
logger.warn(String.valueOf(m... | java | public void warn(Object message, Throwable t) {
logger.warn(String.valueOf(message), t);
} | [
"public",
"void",
"warn",
"(",
"Object",
"message",
",",
"Throwable",
"t",
")",
"{",
"logger",
".",
"warn",
"(",
"String",
".",
"valueOf",
"(",
"message",
")",
",",
"t",
")",
";",
"}"
] | Converts the first input parameter to String and then delegates to the
wrapped <code>org.slf4j.Logger</code> instance.
@param message
the message to log. Converted to {@link String}
@param t
the exception to log | [
"Converts",
"the",
"first",
"input",
"parameter",
"to",
"String",
"and",
"then",
"delegates",
"to",
"the",
"wrapped",
"<code",
">",
"org",
".",
"slf4j",
".",
"Logger<",
"/",
"code",
">",
"instance",
"."
] | train | https://github.com/qos-ch/slf4j/blob/905443f39fadd88a8dd2c467e44affd8cb072a4d/jcl-over-slf4j/src/main/java/org/apache/commons/logging/impl/SLF4JLog.java#L188-L190 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/CopyJobConfiguration.java | CopyJobConfiguration.newBuilder | public static Builder newBuilder(TableId destinationTable, List<TableId> sourceTables) {
"""
Creates a builder for a BigQuery Copy Job configuration given destination and source tables.
"""
return new Builder().setDestinationTable(destinationTable).setSourceTables(sourceTables);
} | java | public static Builder newBuilder(TableId destinationTable, List<TableId> sourceTables) {
return new Builder().setDestinationTable(destinationTable).setSourceTables(sourceTables);
} | [
"public",
"static",
"Builder",
"newBuilder",
"(",
"TableId",
"destinationTable",
",",
"List",
"<",
"TableId",
">",
"sourceTables",
")",
"{",
"return",
"new",
"Builder",
"(",
")",
".",
"setDestinationTable",
"(",
"destinationTable",
")",
".",
"setSourceTables",
"... | Creates a builder for a BigQuery Copy Job configuration given destination and source tables. | [
"Creates",
"a",
"builder",
"for",
"a",
"BigQuery",
"Copy",
"Job",
"configuration",
"given",
"destination",
"and",
"source",
"tables",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/CopyJobConfiguration.java#L262-L264 |
joniles/mpxj | src/main/java/net/sf/mpxj/mpd/MPD9AbstractReader.java | MPD9AbstractReader.processField | protected void processField(Row row, String fieldIDColumn, String entityIDColumn, Object value) {
"""
Generic method to process an extended attribute field.
@param row extended attribute data
@param fieldIDColumn column containing the field ID
@param entityIDColumn column containing the entity ID
@param valu... | java | protected void processField(Row row, String fieldIDColumn, String entityIDColumn, Object value)
{
processField(row, fieldIDColumn, row.getInteger(entityIDColumn), value);
} | [
"protected",
"void",
"processField",
"(",
"Row",
"row",
",",
"String",
"fieldIDColumn",
",",
"String",
"entityIDColumn",
",",
"Object",
"value",
")",
"{",
"processField",
"(",
"row",
",",
"fieldIDColumn",
",",
"row",
".",
"getInteger",
"(",
"entityIDColumn",
"... | Generic method to process an extended attribute field.
@param row extended attribute data
@param fieldIDColumn column containing the field ID
@param entityIDColumn column containing the entity ID
@param value field value | [
"Generic",
"method",
"to",
"process",
"an",
"extended",
"attribute",
"field",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpd/MPD9AbstractReader.java#L716-L719 |
OpenTSDB/opentsdb | src/tsd/QueryRpc.java | QueryRpc.execute | @Override
public void execute(final TSDB tsdb, final HttpQuery query)
throws IOException {
"""
Implements the /api/query endpoint to fetch data from OpenTSDB.
@param tsdb The TSDB to use for fetching data
@param query The HTTP query for parsing and responding
"""
// only accept GET/POST/DELET... | java | @Override
public void execute(final TSDB tsdb, final HttpQuery query)
throws IOException {
// only accept GET/POST/DELETE
if (query.method() != HttpMethod.GET && query.method() != HttpMethod.POST &&
query.method() != HttpMethod.DELETE) {
throw new BadRequestException(HttpResponseStatus... | [
"@",
"Override",
"public",
"void",
"execute",
"(",
"final",
"TSDB",
"tsdb",
",",
"final",
"HttpQuery",
"query",
")",
"throws",
"IOException",
"{",
"// only accept GET/POST/DELETE",
"if",
"(",
"query",
".",
"method",
"(",
")",
"!=",
"HttpMethod",
".",
"GET",
... | Implements the /api/query endpoint to fetch data from OpenTSDB.
@param tsdb The TSDB to use for fetching data
@param query The HTTP query for parsing and responding | [
"Implements",
"the",
"/",
"api",
"/",
"query",
"endpoint",
"to",
"fetch",
"data",
"from",
"OpenTSDB",
"."
] | train | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tsd/QueryRpc.java#L88-L119 |
coopernurse/barrister-java | src/main/java/com/bitmechanic/barrister/Contract.java | Contract.getFunction | public Function getFunction(String iface, String func) throws RpcException {
"""
Returns the Function associated with the given interface and function name.
@param iface Interface name
@param func Function name in the interface
@return Function that matches iface and func on this Contract
@throws RpcExceptio... | java | public Function getFunction(String iface, String func) throws RpcException {
Interface i = interfaces.get(iface);
if (i == null) {
String msg = "Interface '" + iface + "' not found";
throw RpcException.Error.METHOD_NOT_FOUND.exc(msg);
}
Function f = i.getFunction... | [
"public",
"Function",
"getFunction",
"(",
"String",
"iface",
",",
"String",
"func",
")",
"throws",
"RpcException",
"{",
"Interface",
"i",
"=",
"interfaces",
".",
"get",
"(",
"iface",
")",
";",
"if",
"(",
"i",
"==",
"null",
")",
"{",
"String",
"msg",
"=... | Returns the Function associated with the given interface and function name.
@param iface Interface name
@param func Function name in the interface
@return Function that matches iface and func on this Contract
@throws RpcException If no Function matches | [
"Returns",
"the",
"Function",
"associated",
"with",
"the",
"given",
"interface",
"and",
"function",
"name",
"."
] | train | https://github.com/coopernurse/barrister-java/blob/c2b639634c88a25002b66d1fb4a8f5fb51ade6a2/src/main/java/com/bitmechanic/barrister/Contract.java#L232-L246 |
Whiley/WhileyCompiler | src/main/java/wyc/io/WhileyFileLexer.java | WhileyFileLexer.scanIndent | public Token scanIndent() {
"""
Scan one or more spaces or tab characters, combining them to form an
"indent".
@return
"""
int start = pos;
while (pos < input.length()
&& (input.charAt(pos) == ' ' || input.charAt(pos) == '\t')) {
pos++;
}
return new Token(Token.Kind.Indent, input.substring(s... | java | public Token scanIndent() {
int start = pos;
while (pos < input.length()
&& (input.charAt(pos) == ' ' || input.charAt(pos) == '\t')) {
pos++;
}
return new Token(Token.Kind.Indent, input.substring(start, pos), start);
} | [
"public",
"Token",
"scanIndent",
"(",
")",
"{",
"int",
"start",
"=",
"pos",
";",
"while",
"(",
"pos",
"<",
"input",
".",
"length",
"(",
")",
"&&",
"(",
"input",
".",
"charAt",
"(",
"pos",
")",
"==",
"'",
"'",
"||",
"input",
".",
"charAt",
"(",
... | Scan one or more spaces or tab characters, combining them to form an
"indent".
@return | [
"Scan",
"one",
"or",
"more",
"spaces",
"or",
"tab",
"characters",
"combining",
"them",
"to",
"form",
"an",
"indent",
"."
] | train | https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyc/io/WhileyFileLexer.java#L472-L479 |
airbnb/AirMapView | library/src/main/java/com/airbnb/android/airmapview/DefaultAirMapViewBuilder.java | DefaultAirMapViewBuilder.getWebMapViewBuilder | private AirMapViewBuilder getWebMapViewBuilder() {
"""
Decides what the Map Web provider should be used and generates a builder for it.
@return The AirMapViewBuilder for the selected Map Web provider.
"""
if (context != null) {
try {
ApplicationInfo ai = context.getPackageManager()
... | java | private AirMapViewBuilder getWebMapViewBuilder() {
if (context != null) {
try {
ApplicationInfo ai = context.getPackageManager()
.getApplicationInfo(context.getPackageName(), PackageManager.GET_META_DATA);
Bundle bundle = ai.metaData;
String accessToken = bundle.getString("... | [
"private",
"AirMapViewBuilder",
"getWebMapViewBuilder",
"(",
")",
"{",
"if",
"(",
"context",
"!=",
"null",
")",
"{",
"try",
"{",
"ApplicationInfo",
"ai",
"=",
"context",
".",
"getPackageManager",
"(",
")",
".",
"getApplicationInfo",
"(",
"context",
".",
"getPa... | Decides what the Map Web provider should be used and generates a builder for it.
@return The AirMapViewBuilder for the selected Map Web provider. | [
"Decides",
"what",
"the",
"Map",
"Web",
"provider",
"should",
"be",
"used",
"and",
"generates",
"a",
"builder",
"for",
"it",
"."
] | train | https://github.com/airbnb/AirMapView/blob/f715197db2cc2903e8d70f78385d339c3f6a1c3b/library/src/main/java/com/airbnb/android/airmapview/DefaultAirMapViewBuilder.java#L78-L95 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java | DTMDocumentImpl.appendChild | public void appendChild(int newChild, boolean clone, boolean cloneDepth) {
"""
Append a child to the end of the child list of the current node. Please note that the node
is always cloned if it is owned by another document.
<p>%REVIEW% "End of the document" needs to be defined more clearly.
Does it become the ... | java | public void appendChild(int newChild, boolean clone, boolean cloneDepth) {
boolean sameDoc = ((newChild & DOCHANDLE_MASK) == m_docHandle);
if (clone || !sameDoc) {
} else {
}
} | [
"public",
"void",
"appendChild",
"(",
"int",
"newChild",
",",
"boolean",
"clone",
",",
"boolean",
"cloneDepth",
")",
"{",
"boolean",
"sameDoc",
"=",
"(",
"(",
"newChild",
"&",
"DOCHANDLE_MASK",
")",
"==",
"m_docHandle",
")",
";",
"if",
"(",
"clone",
"||",
... | Append a child to the end of the child list of the current node. Please note that the node
is always cloned if it is owned by another document.
<p>%REVIEW% "End of the document" needs to be defined more clearly.
Does it become the last child of the Document? Of the root element?</p>
@param newChild Must be a valid ne... | [
"Append",
"a",
"child",
"to",
"the",
"end",
"of",
"the",
"child",
"list",
"of",
"the",
"current",
"node",
".",
"Please",
"note",
"that",
"the",
"node",
"is",
"always",
"cloned",
"if",
"it",
"is",
"owned",
"by",
"another",
"document",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java#L2055-L2062 |
joniles/mpxj | src/main/java/net/sf/mpxj/json/JsonWriter.java | JsonWriter.writeDoubleField | private void writeDoubleField(String fieldName, Object value) throws IOException {
"""
Write an double field to the JSON file.
@param fieldName field name
@param value field value
"""
double val = ((Number) value).doubleValue();
if (val != 0)
{
m_writer.writeNameValuePair(fieldNa... | java | private void writeDoubleField(String fieldName, Object value) throws IOException
{
double val = ((Number) value).doubleValue();
if (val != 0)
{
m_writer.writeNameValuePair(fieldName, val);
}
} | [
"private",
"void",
"writeDoubleField",
"(",
"String",
"fieldName",
",",
"Object",
"value",
")",
"throws",
"IOException",
"{",
"double",
"val",
"=",
"(",
"(",
"Number",
")",
"value",
")",
".",
"doubleValue",
"(",
")",
";",
"if",
"(",
"val",
"!=",
"0",
"... | Write an double field to the JSON file.
@param fieldName field name
@param value field value | [
"Write",
"an",
"double",
"field",
"to",
"the",
"JSON",
"file",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/json/JsonWriter.java#L385-L392 |
bitcoinj/bitcoinj | core/src/main/java/org/bitcoinj/core/PeerGroup.java | PeerGroup.removeDataEventListenerFromPeer | private static void removeDataEventListenerFromPeer(Peer peer, PeerDataEventListener listener) {
"""
Remove a registered data event listener against a single peer (i.e. for
blockchain download). Handling registration/deregistration on peer death/add is
outside the scope of these methods.
"""
peer.rem... | java | private static void removeDataEventListenerFromPeer(Peer peer, PeerDataEventListener listener) {
peer.removeBlocksDownloadedEventListener(listener);
peer.removeChainDownloadStartedEventListener(listener);
peer.removeGetDataEventListener(listener);
peer.removePreMessageReceivedEventListen... | [
"private",
"static",
"void",
"removeDataEventListenerFromPeer",
"(",
"Peer",
"peer",
",",
"PeerDataEventListener",
"listener",
")",
"{",
"peer",
".",
"removeBlocksDownloadedEventListener",
"(",
"listener",
")",
";",
"peer",
".",
"removeChainDownloadStartedEventListener",
... | Remove a registered data event listener against a single peer (i.e. for
blockchain download). Handling registration/deregistration on peer death/add is
outside the scope of these methods. | [
"Remove",
"a",
"registered",
"data",
"event",
"listener",
"against",
"a",
"single",
"peer",
"(",
"i",
".",
"e",
".",
"for",
"blockchain",
"download",
")",
".",
"Handling",
"registration",
"/",
"deregistration",
"on",
"peer",
"death",
"/",
"add",
"is",
"out... | train | https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/core/PeerGroup.java#L1442-L1447 |
dustin/java-memcached-client | src/main/java/net/spy/memcached/MemcachedConnection.java | MemcachedConnection.handleReadsAndWrites | private void handleReadsAndWrites(final SelectionKey sk, final MemcachedNode node) throws IOException {
"""
A helper method for {@link #handleIO(java.nio.channels.SelectionKey)} to
handle reads and writes if appropriate.
@param sk the selection key to use.
@param node th enode to read write from.
@throws IOE... | java | private void handleReadsAndWrites(final SelectionKey sk, final MemcachedNode node) throws IOException {
if (sk.isValid() && sk.isReadable()) {
handleReads(node);
}
if (sk.isValid() && sk.isWritable()) {
handleWrites(node);
}
} | [
"private",
"void",
"handleReadsAndWrites",
"(",
"final",
"SelectionKey",
"sk",
",",
"final",
"MemcachedNode",
"node",
")",
"throws",
"IOException",
"{",
"if",
"(",
"sk",
".",
"isValid",
"(",
")",
"&&",
"sk",
".",
"isReadable",
"(",
")",
")",
"{",
"handleRe... | A helper method for {@link #handleIO(java.nio.channels.SelectionKey)} to
handle reads and writes if appropriate.
@param sk the selection key to use.
@param node th enode to read write from.
@throws IOException if an error occurs during read/write. | [
"A",
"helper",
"method",
"for",
"{",
"@link",
"#handleIO",
"(",
"java",
".",
"nio",
".",
"channels",
".",
"SelectionKey",
")",
"}",
"to",
"handle",
"reads",
"and",
"writes",
"if",
"appropriate",
"."
] | train | https://github.com/dustin/java-memcached-client/blob/c232307ad8e0c7ccc926e495dd7d5aad2d713318/src/main/java/net/spy/memcached/MemcachedConnection.java#L733-L741 |
minio/minio-java | api/src/main/java/io/minio/MinioClient.java | MinioClient.abortMultipartUpload | private void abortMultipartUpload(String bucketName, String objectName, String uploadId)
throws InvalidBucketNameException, NoSuchAlgorithmException, InsufficientDataException, IOException,
InvalidKeyException, NoResponseException, XmlPullParserException, ErrorResponseException,
InternalExcept... | java | private void abortMultipartUpload(String bucketName, String objectName, String uploadId)
throws InvalidBucketNameException, NoSuchAlgorithmException, InsufficientDataException, IOException,
InvalidKeyException, NoResponseException, XmlPullParserException, ErrorResponseException,
InternalExcept... | [
"private",
"void",
"abortMultipartUpload",
"(",
"String",
"bucketName",
",",
"String",
"objectName",
",",
"String",
"uploadId",
")",
"throws",
"InvalidBucketNameException",
",",
"NoSuchAlgorithmException",
",",
"InsufficientDataException",
",",
"IOException",
",",
"Invali... | Aborts multipart upload of given bucket name, object name and upload ID. | [
"Aborts",
"multipart",
"upload",
"of",
"given",
"bucket",
"name",
"object",
"name",
"and",
"upload",
"ID",
"."
] | train | https://github.com/minio/minio-java/blob/b2028f56403c89ce2d5900ae813bc1314c87bc7f/api/src/main/java/io/minio/MinioClient.java#L4907-L4914 |
apache/incubator-shardingsphere | sharding-core/sharding-core-optimize/src/main/java/org/apache/shardingsphere/core/optimize/result/insert/InsertOptimizeResultUnit.java | InsertOptimizeResultUnit.setColumnValue | public final void setColumnValue(final String columnName, final Object columnValue) {
"""
Set column value.
@param columnName column name
@param columnValue column value
"""
SQLExpression sqlExpression = values[getColumnIndex(columnName)];
if (sqlExpression instanceof SQLParameterMarkerExpr... | java | public final void setColumnValue(final String columnName, final Object columnValue) {
SQLExpression sqlExpression = values[getColumnIndex(columnName)];
if (sqlExpression instanceof SQLParameterMarkerExpression) {
parameters[getParameterIndex(sqlExpression)] = columnValue;
} else {
... | [
"public",
"final",
"void",
"setColumnValue",
"(",
"final",
"String",
"columnName",
",",
"final",
"Object",
"columnValue",
")",
"{",
"SQLExpression",
"sqlExpression",
"=",
"values",
"[",
"getColumnIndex",
"(",
"columnName",
")",
"]",
";",
"if",
"(",
"sqlExpressio... | Set column value.
@param columnName column name
@param columnValue column value | [
"Set",
"column",
"value",
"."
] | train | https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-core/sharding-core-optimize/src/main/java/org/apache/shardingsphere/core/optimize/result/insert/InsertOptimizeResultUnit.java#L87-L95 |
google/j2objc | translator/src/main/java/com/google/devtools/j2objc/translate/Functionizer.java | Functionizer.makeAllocatingConstructor | private FunctionDeclaration makeAllocatingConstructor(
MethodDeclaration method, boolean releasing) {
"""
Create a wrapper for a constructor that does the object allocation.
"""
assert method.isConstructor();
ExecutableElement element = method.getExecutableElement();
TypeElement declaringClas... | java | private FunctionDeclaration makeAllocatingConstructor(
MethodDeclaration method, boolean releasing) {
assert method.isConstructor();
ExecutableElement element = method.getExecutableElement();
TypeElement declaringClass = ElementUtil.getDeclaringClass(element);
String name = releasing ? nameTable.... | [
"private",
"FunctionDeclaration",
"makeAllocatingConstructor",
"(",
"MethodDeclaration",
"method",
",",
"boolean",
"releasing",
")",
"{",
"assert",
"method",
".",
"isConstructor",
"(",
")",
";",
"ExecutableElement",
"element",
"=",
"method",
".",
"getExecutableElement",... | Create a wrapper for a constructor that does the object allocation. | [
"Create",
"a",
"wrapper",
"for",
"a",
"constructor",
"that",
"does",
"the",
"object",
"allocation",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/translator/src/main/java/com/google/devtools/j2objc/translate/Functionizer.java#L456-L482 |
igniterealtime/Smack | smack-extensions/src/main/java/org/jivesoftware/smackx/amp/AMPManager.java | AMPManager.isConditionSupported | public static boolean isConditionSupported(XMPPConnection connection, String conditionName) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
"""
Check if server supports specified condition.
@param connection active xmpp connection
@param conditionName name of conditi... | java | public static boolean isConditionSupported(XMPPConnection connection, String conditionName) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
String featureName = AMPExtension.NAMESPACE + "?condition=" + conditionName;
return isFeatureSupportedByServer(connect... | [
"public",
"static",
"boolean",
"isConditionSupported",
"(",
"XMPPConnection",
"connection",
",",
"String",
"conditionName",
")",
"throws",
"NoResponseException",
",",
"XMPPErrorException",
",",
"NotConnectedException",
",",
"InterruptedException",
"{",
"String",
"featureNam... | Check if server supports specified condition.
@param connection active xmpp connection
@param conditionName name of condition to check
@return true if this condition is supported.
@throws XMPPErrorException
@throws NoResponseException
@throws NotConnectedException
@throws InterruptedException
@see AMPDeliverCondition
@... | [
"Check",
"if",
"server",
"supports",
"specified",
"condition",
"."
] | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-extensions/src/main/java/org/jivesoftware/smackx/amp/AMPManager.java#L111-L114 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java | FileUtil.readUtf8Lines | public static <T extends Collection<String>> T readUtf8Lines(String path, T collection) throws IORuntimeException {
"""
从文件中读取每一行的UTF-8编码数据
@param <T> 集合类型
@param path 文件路径
@param collection 集合
@return 文件中的每行内容的集合
@throws IORuntimeException IO异常
@since 3.1.1
"""
return readLines(path, CharsetUtil.CH... | java | public static <T extends Collection<String>> T readUtf8Lines(String path, T collection) throws IORuntimeException {
return readLines(path, CharsetUtil.CHARSET_UTF_8, collection);
} | [
"public",
"static",
"<",
"T",
"extends",
"Collection",
"<",
"String",
">",
">",
"T",
"readUtf8Lines",
"(",
"String",
"path",
",",
"T",
"collection",
")",
"throws",
"IORuntimeException",
"{",
"return",
"readLines",
"(",
"path",
",",
"CharsetUtil",
".",
"CHARS... | 从文件中读取每一行的UTF-8编码数据
@param <T> 集合类型
@param path 文件路径
@param collection 集合
@return 文件中的每行内容的集合
@throws IORuntimeException IO异常
@since 3.1.1 | [
"从文件中读取每一行的UTF",
"-",
"8编码数据"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java#L2164-L2166 |
ops4j/org.ops4j.pax.swissbox | pax-swissbox-tracker/src/main/java/org/ops4j/pax/swissbox/tracker/ServiceLookup.java | ServiceLookup.getServiceByFilter | public static Object getServiceByFilter( BundleContext bc, String ldapFilter ) {
"""
Returns a service matching the given filter.
@param bc bundle context for accessing the OSGi registry
@param ldapFilter LDAP filter to be matched by the service. The class name must be part of the
filter.
@return matching se... | java | public static Object getServiceByFilter( BundleContext bc, String ldapFilter )
{
return getServiceByFilter( bc, ldapFilter, DEFAULT_TIMEOUT );
} | [
"public",
"static",
"Object",
"getServiceByFilter",
"(",
"BundleContext",
"bc",
",",
"String",
"ldapFilter",
")",
"{",
"return",
"getServiceByFilter",
"(",
"bc",
",",
"ldapFilter",
",",
"DEFAULT_TIMEOUT",
")",
";",
"}"
] | Returns a service matching the given filter.
@param bc bundle context for accessing the OSGi registry
@param ldapFilter LDAP filter to be matched by the service. The class name must be part of the
filter.
@return matching service (not null)
@throws ServiceLookupException when no matching service has been found after t... | [
"Returns",
"a",
"service",
"matching",
"the",
"given",
"filter",
"."
] | train | https://github.com/ops4j/org.ops4j.pax.swissbox/blob/00b0ee16cdbe8017984a4d7ba808b10d985c5b5c/pax-swissbox-tracker/src/main/java/org/ops4j/pax/swissbox/tracker/ServiceLookup.java#L313-L316 |
xmlunit/xmlunit | xmlunit-core/src/main/java/org/xmlunit/diff/DefaultComparisonFormatter.java | DefaultComparisonFormatter.appendElement | protected void appendElement(StringBuilder sb, Element aNode) {
"""
Formats a placeholder for an element for {@link #getShortString}.
@param sb the builder to append to
@param aNode the element
@since XMLUnit 2.4.0
"""
sb.append("<")
.append(aNode.getNodeName()).append("...")
... | java | protected void appendElement(StringBuilder sb, Element aNode) {
sb.append("<")
.append(aNode.getNodeName()).append("...")
.append(">");
} | [
"protected",
"void",
"appendElement",
"(",
"StringBuilder",
"sb",
",",
"Element",
"aNode",
")",
"{",
"sb",
".",
"append",
"(",
"\"<\"",
")",
".",
"append",
"(",
"aNode",
".",
"getNodeName",
"(",
")",
")",
".",
"append",
"(",
"\"...\"",
")",
".",
"appen... | Formats a placeholder for an element for {@link #getShortString}.
@param sb the builder to append to
@param aNode the element
@since XMLUnit 2.4.0 | [
"Formats",
"a",
"placeholder",
"for",
"an",
"element",
"for",
"{",
"@link",
"#getShortString",
"}",
"."
] | train | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-core/src/main/java/org/xmlunit/diff/DefaultComparisonFormatter.java#L303-L307 |
btrplace/scheduler | split/src/main/java/org/btrplace/scheduler/runner/disjoint/model/SubMapping.java | SubMapping.fillVMIndex | public void fillVMIndex(TIntIntHashMap index, int p) {
"""
Fill an index with the VM presents in this mapping
@param index the index to fill
@param p the index value to use for each VM in the mapping
"""
for (Node n : scope) {
for (VM v : parent.getRunningVMs(n)) {
i... | java | public void fillVMIndex(TIntIntHashMap index, int p) {
for (Node n : scope) {
for (VM v : parent.getRunningVMs(n)) {
index.put(v.id(), p);
}
for (VM v : parent.getSleepingVMs(n)) {
index.put(v.id(), p);
}
}
for (VM v... | [
"public",
"void",
"fillVMIndex",
"(",
"TIntIntHashMap",
"index",
",",
"int",
"p",
")",
"{",
"for",
"(",
"Node",
"n",
":",
"scope",
")",
"{",
"for",
"(",
"VM",
"v",
":",
"parent",
".",
"getRunningVMs",
"(",
"n",
")",
")",
"{",
"index",
".",
"put",
... | Fill an index with the VM presents in this mapping
@param index the index to fill
@param p the index value to use for each VM in the mapping | [
"Fill",
"an",
"index",
"with",
"the",
"VM",
"presents",
"in",
"this",
"mapping"
] | train | https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/split/src/main/java/org/btrplace/scheduler/runner/disjoint/model/SubMapping.java#L269-L281 |
beihaifeiwu/dolphin | dolphin-common/src/main/java/com/freetmp/common/util/BridgeMethodResolver.java | BridgeMethodResolver.searchCandidates | private static Method searchCandidates(List<Method> candidateMethods, Method bridgeMethod) {
"""
Searches for the bridged method in the given candidates.
@param candidateMethods the List of candidate Methods
@param bridgeMethod the bridge method
@return the bridged method, or {@code null} if none found
"""
... | java | private static Method searchCandidates(List<Method> candidateMethods, Method bridgeMethod) {
if (candidateMethods.isEmpty()) {
return null;
}
Method previousMethod = null;
boolean sameSig = true;
for (Method candidateMethod : candidateMethods) {
if (isBridgeMethodFor(bridgeMethod, candidateMethod, bridg... | [
"private",
"static",
"Method",
"searchCandidates",
"(",
"List",
"<",
"Method",
">",
"candidateMethods",
",",
"Method",
"bridgeMethod",
")",
"{",
"if",
"(",
"candidateMethods",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"Method",
"previou... | Searches for the bridged method in the given candidates.
@param candidateMethods the List of candidate Methods
@param bridgeMethod the bridge method
@return the bridged method, or {@code null} if none found | [
"Searches",
"for",
"the",
"bridged",
"method",
"in",
"the",
"given",
"candidates",
"."
] | train | https://github.com/beihaifeiwu/dolphin/blob/b100579cc6986dce5eba5593ebb5fbae7bad9d1a/dolphin-common/src/main/java/com/freetmp/common/util/BridgeMethodResolver.java#L104-L121 |
lessthanoptimal/BoofCV | main/boofcv-types/src/main/java/boofcv/alg/InputSanityCheck.java | InputSanityCheck.checkDeclare | public static <In extends ImageGray,Out extends ImageGray>
Out checkDeclare(In input, Out output , Class<Out> typeOut) {
"""
If the output has not been declared a new instance is declared. If an instance of the output
is provided its bounds are checked.
"""
if (output == null) {
output = (Out) Generali... | java | public static <In extends ImageGray,Out extends ImageGray>
Out checkDeclare(In input, Out output , Class<Out> typeOut) {
if (output == null) {
output = (Out) GeneralizedImageOps.createSingleBand(typeOut, input.width, input.height);
} else {
output.reshape(input.width, input.height);
}
return output;
} | [
"public",
"static",
"<",
"In",
"extends",
"ImageGray",
",",
"Out",
"extends",
"ImageGray",
">",
"Out",
"checkDeclare",
"(",
"In",
"input",
",",
"Out",
"output",
",",
"Class",
"<",
"Out",
">",
"typeOut",
")",
"{",
"if",
"(",
"output",
"==",
"null",
")",... | If the output has not been declared a new instance is declared. If an instance of the output
is provided its bounds are checked. | [
"If",
"the",
"output",
"has",
"not",
"been",
"declared",
"a",
"new",
"instance",
"is",
"declared",
".",
"If",
"an",
"instance",
"of",
"the",
"output",
"is",
"provided",
"its",
"bounds",
"are",
"checked",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-types/src/main/java/boofcv/alg/InputSanityCheck.java#L71-L79 |
classgraph/classgraph | src/main/java/io/github/classgraph/AnnotationInfoList.java | AnnotationInfoList.findMetaAnnotations | private static void findMetaAnnotations(final AnnotationInfo ai, final AnnotationInfoList allAnnotationsOut,
final Set<ClassInfo> visited) {
"""
Find the transitive closure of meta-annotations.
@param ai
the annotationInfo object
@param allAnnotationsOut
annotations out
@param visited
visited
... | java | private static void findMetaAnnotations(final AnnotationInfo ai, final AnnotationInfoList allAnnotationsOut,
final Set<ClassInfo> visited) {
final ClassInfo annotationClassInfo = ai.getClassInfo();
if (annotationClassInfo != null && annotationClassInfo.annotationInfo != null
// Don't... | [
"private",
"static",
"void",
"findMetaAnnotations",
"(",
"final",
"AnnotationInfo",
"ai",
",",
"final",
"AnnotationInfoList",
"allAnnotationsOut",
",",
"final",
"Set",
"<",
"ClassInfo",
">",
"visited",
")",
"{",
"final",
"ClassInfo",
"annotationClassInfo",
"=",
"ai"... | Find the transitive closure of meta-annotations.
@param ai
the annotationInfo object
@param allAnnotationsOut
annotations out
@param visited
visited | [
"Find",
"the",
"transitive",
"closure",
"of",
"meta",
"-",
"annotations",
"."
] | train | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/AnnotationInfoList.java#L268-L286 |
snowflakedb/snowflake-jdbc | src/main/java/net/snowflake/client/core/AssertUtil.java | AssertUtil.assertTrue | static void assertTrue(boolean condition, String internalErrorMesg)
throws SFException {
"""
Assert the condition is true, otherwise throw an internal error
exception with the given message.
@param condition
@param internalErrorMesg
@throws SFException
"""
if (!condition)
{
throw new SFEx... | java | static void assertTrue(boolean condition, String internalErrorMesg)
throws SFException
{
if (!condition)
{
throw new SFException(ErrorCode.INTERNAL_ERROR, internalErrorMesg);
}
} | [
"static",
"void",
"assertTrue",
"(",
"boolean",
"condition",
",",
"String",
"internalErrorMesg",
")",
"throws",
"SFException",
"{",
"if",
"(",
"!",
"condition",
")",
"{",
"throw",
"new",
"SFException",
"(",
"ErrorCode",
".",
"INTERNAL_ERROR",
",",
"internalError... | Assert the condition is true, otherwise throw an internal error
exception with the given message.
@param condition
@param internalErrorMesg
@throws SFException | [
"Assert",
"the",
"condition",
"is",
"true",
"otherwise",
"throw",
"an",
"internal",
"error",
"exception",
"with",
"the",
"given",
"message",
"."
] | train | https://github.com/snowflakedb/snowflake-jdbc/blob/98567b5a57753f29d51446809640b969a099658f/src/main/java/net/snowflake/client/core/AssertUtil.java#L22-L29 |
ralscha/wampspring | src/main/java/ch/rasc/wampspring/EventMessenger.java | EventMessenger.sendToAllExcept | public void sendToAllExcept(String topicURI, Object event,
Set<String> excludeWebSocketSessionIds) {
"""
Send an {@link EventMessage} to every client that is currently subscribed to the
provided topicURI except the ones listed in the excludeSessionIds set.
@param topicURI the name of the topic
@param event... | java | public void sendToAllExcept(String topicURI, Object event,
Set<String> excludeWebSocketSessionIds) {
EventMessage eventMessage = new EventMessage(topicURI, event);
eventMessage.setExcludeWebSocketSessionIds(excludeWebSocketSessionIds);
send(eventMessage);
} | [
"public",
"void",
"sendToAllExcept",
"(",
"String",
"topicURI",
",",
"Object",
"event",
",",
"Set",
"<",
"String",
">",
"excludeWebSocketSessionIds",
")",
"{",
"EventMessage",
"eventMessage",
"=",
"new",
"EventMessage",
"(",
"topicURI",
",",
"event",
")",
";",
... | Send an {@link EventMessage} to every client that is currently subscribed to the
provided topicURI except the ones listed in the excludeSessionIds set.
@param topicURI the name of the topic
@param event the payload of the {@link EventMessage}
@param excludeWebSocketSessionIds a set of WebSocket session ids that will b... | [
"Send",
"an",
"{",
"@link",
"EventMessage",
"}",
"to",
"every",
"client",
"that",
"is",
"currently",
"subscribed",
"to",
"the",
"provided",
"topicURI",
"except",
"the",
"ones",
"listed",
"in",
"the",
"excludeSessionIds",
"set",
"."
] | train | https://github.com/ralscha/wampspring/blob/7571bb6773b848c580b29890587eb35397bfe5b5/src/main/java/ch/rasc/wampspring/EventMessenger.java#L99-L104 |
jparsec/jparsec | jparsec/src/main/java/org/jparsec/Parser.java | Parser.sepBy1 | public final Parser<List<T>> sepBy1(Parser<?> delim) {
"""
A {@link Parser} that runs {@code this} 1 or more times separated by {@code delim}.
<p>The return values are collected in a {@link List}.
"""
final Parser<T> afterFirst = delim.asDelimiter().next(this);
return next((Function<T, Parser<List<T... | java | public final Parser<List<T>> sepBy1(Parser<?> delim) {
final Parser<T> afterFirst = delim.asDelimiter().next(this);
return next((Function<T, Parser<List<T>>>) firstValue ->
new RepeatAtLeastParser<T>(
afterFirst, 0, ListFactory.arrayListFactoryWithFirstElement(firstValue)));
} | [
"public",
"final",
"Parser",
"<",
"List",
"<",
"T",
">",
">",
"sepBy1",
"(",
"Parser",
"<",
"?",
">",
"delim",
")",
"{",
"final",
"Parser",
"<",
"T",
">",
"afterFirst",
"=",
"delim",
".",
"asDelimiter",
"(",
")",
".",
"next",
"(",
"this",
")",
";... | A {@link Parser} that runs {@code this} 1 or more times separated by {@code delim}.
<p>The return values are collected in a {@link List}. | [
"A",
"{",
"@link",
"Parser",
"}",
"that",
"runs",
"{",
"@code",
"this",
"}",
"1",
"or",
"more",
"times",
"separated",
"by",
"{",
"@code",
"delim",
"}",
"."
] | train | https://github.com/jparsec/jparsec/blob/df1280259f5da9eb5ffc537437569dddba66cb94/jparsec/src/main/java/org/jparsec/Parser.java#L533-L538 |
mojohaus/jaxb2-maven-plugin | src/main/java/org/codehaus/mojo/jaxb2/AbstractJaxbMojo.java | AbstractJaxbMojo.getStaleFile | protected final File getStaleFile() {
"""
Acquires the staleFile for this execution
@return the staleFile (used to define where) for this execution
"""
final String staleFileName = "."
+ (getExecution() == null ? "nonExecutionJaxb" : getExecution().getExecutionId())
+... | java | protected final File getStaleFile() {
final String staleFileName = "."
+ (getExecution() == null ? "nonExecutionJaxb" : getExecution().getExecutionId())
+ "-" + getStaleFileName();
return new File(staleFileDirectory, staleFileName);
} | [
"protected",
"final",
"File",
"getStaleFile",
"(",
")",
"{",
"final",
"String",
"staleFileName",
"=",
"\".\"",
"+",
"(",
"getExecution",
"(",
")",
"==",
"null",
"?",
"\"nonExecutionJaxb\"",
":",
"getExecution",
"(",
")",
".",
"getExecutionId",
"(",
")",
")",... | Acquires the staleFile for this execution
@return the staleFile (used to define where) for this execution | [
"Acquires",
"the",
"staleFile",
"for",
"this",
"execution"
] | train | https://github.com/mojohaus/jaxb2-maven-plugin/blob/e3c4e47943b15282e5a6e850bbfb1588d8452a0a/src/main/java/org/codehaus/mojo/jaxb2/AbstractJaxbMojo.java#L472-L477 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/jmf/impl/JSListCoder.java | JSListCoder.sanityCheck | public static void sanityCheck(int length, byte[] frame, int offset) throws JMFMessageCorruptionException {
"""
A method to sanity check a 32 bit length value read from the message prior to allocating
storage based on the value. The length is not allowed to be negative or to exceed
the length of the remaining p... | java | public static void sanityCheck(int length, byte[] frame, int offset) throws JMFMessageCorruptionException {
if (length < 0 || offset + 4 + length > frame.length) {
JMFMessageCorruptionException jmce = new JMFMessageCorruptionException(
"Bad length: " + HexUtil.toString(new int[] { length }) + " at ... | [
"public",
"static",
"void",
"sanityCheck",
"(",
"int",
"length",
",",
"byte",
"[",
"]",
"frame",
",",
"int",
"offset",
")",
"throws",
"JMFMessageCorruptionException",
"{",
"if",
"(",
"length",
"<",
"0",
"||",
"offset",
"+",
"4",
"+",
"length",
">",
"fram... | A method to sanity check a 32 bit length value read from the message prior to allocating
storage based on the value. The length is not allowed to be negative or to exceed
the length of the remaining portion of the message's frame, assuming that the length
field is immediately followed by the data whose length it is.
... | [
"A",
"method",
"to",
"sanity",
"check",
"a",
"32",
"bit",
"length",
"value",
"read",
"from",
"the",
"message",
"prior",
"to",
"allocating",
"storage",
"based",
"on",
"the",
"value",
".",
"The",
"length",
"is",
"not",
"allowed",
"to",
"be",
"negative",
"o... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/jmf/impl/JSListCoder.java#L183-L191 |
twilio/twilio-java | src/main/java/com/twilio/rest/voice/v1/dialingpermissions/country/HighriskSpecialPrefixReader.java | HighriskSpecialPrefixReader.firstPage | @Override
@SuppressWarnings("checkstyle:linelength")
public Page<HighriskSpecialPrefix> firstPage(final TwilioRestClient client) {
"""
Make the request to the Twilio API to perform the read.
@param client TwilioRestClient with which to make the request
@return HighriskSpecialPrefix ResourceSet
"""
... | java | @Override
@SuppressWarnings("checkstyle:linelength")
public Page<HighriskSpecialPrefix> firstPage(final TwilioRestClient client) {
Request request = new Request(
HttpMethod.GET,
Domains.VOICE.toString(),
"/v1/DialingPermissions/Countries/" + this.pathIsoCode + "/HighR... | [
"@",
"Override",
"@",
"SuppressWarnings",
"(",
"\"checkstyle:linelength\"",
")",
"public",
"Page",
"<",
"HighriskSpecialPrefix",
">",
"firstPage",
"(",
"final",
"TwilioRestClient",
"client",
")",
"{",
"Request",
"request",
"=",
"new",
"Request",
"(",
"HttpMethod",
... | Make the request to the Twilio API to perform the read.
@param client TwilioRestClient with which to make the request
@return HighriskSpecialPrefix ResourceSet | [
"Make",
"the",
"request",
"to",
"the",
"Twilio",
"API",
"to",
"perform",
"the",
"read",
"."
] | train | https://github.com/twilio/twilio-java/blob/0318974c0a6a152994af167d430255684d5e9b9f/src/main/java/com/twilio/rest/voice/v1/dialingpermissions/country/HighriskSpecialPrefixReader.java#L56-L68 |
hawkular/hawkular-apm | examples/polyglot-zipkin/java-dropwizard/src/main/java/org/hawkular/apm/example/dropwizard/util/DatabaseUtils.java | DatabaseUtils.readSqlStatements | private static String[] readSqlStatements(URL url) {
"""
Reads SQL statements from file. SQL commands in file must be separated by
a semicolon.
@param url url of the file
@return array of command strings
"""
try {
char buffer[] = new char[256];
StringBuilder result = new S... | java | private static String[] readSqlStatements(URL url) {
try {
char buffer[] = new char[256];
StringBuilder result = new StringBuilder();
InputStreamReader reader = new InputStreamReader(url.openStream(), "UTF-8");
while (true) {
int count = reader.rea... | [
"private",
"static",
"String",
"[",
"]",
"readSqlStatements",
"(",
"URL",
"url",
")",
"{",
"try",
"{",
"char",
"buffer",
"[",
"]",
"=",
"new",
"char",
"[",
"256",
"]",
";",
"StringBuilder",
"result",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"InputSt... | Reads SQL statements from file. SQL commands in file must be separated by
a semicolon.
@param url url of the file
@return array of command strings | [
"Reads",
"SQL",
"statements",
"from",
"file",
".",
"SQL",
"commands",
"in",
"file",
"must",
"be",
"separated",
"by",
"a",
"semicolon",
"."
] | train | https://github.com/hawkular/hawkular-apm/blob/57a4df0611b359597626563ea5f9ac64d4bb2533/examples/polyglot-zipkin/java-dropwizard/src/main/java/org/hawkular/apm/example/dropwizard/util/DatabaseUtils.java#L74-L90 |
alkacon/opencms-core | src/org/opencms/security/CmsPrincipal.java | CmsPrincipal.readPrincipal | public static I_CmsPrincipal readPrincipal(CmsObject cms, String type, String name) throws CmsException {
"""
Utility function to read a principal of the given type from the OpenCms database using the
provided OpenCms user context.<p>
The type must either be <code>{@link I_CmsPrincipal#PRINCIPAL_GROUP}</code> ... | java | public static I_CmsPrincipal readPrincipal(CmsObject cms, String type, String name) throws CmsException {
if (CmsStringUtil.isNotEmpty(type)) {
String upperCaseType = type.toUpperCase();
if (PRINCIPAL_GROUP.equals(upperCaseType)) {
// this principal is a group
... | [
"public",
"static",
"I_CmsPrincipal",
"readPrincipal",
"(",
"CmsObject",
"cms",
",",
"String",
"type",
",",
"String",
"name",
")",
"throws",
"CmsException",
"{",
"if",
"(",
"CmsStringUtil",
".",
"isNotEmpty",
"(",
"type",
")",
")",
"{",
"String",
"upperCaseTyp... | Utility function to read a principal of the given type from the OpenCms database using the
provided OpenCms user context.<p>
The type must either be <code>{@link I_CmsPrincipal#PRINCIPAL_GROUP}</code> or
<code>{@link I_CmsPrincipal#PRINCIPAL_USER}</code>.<p>
@param cms the OpenCms user context to use when reading the... | [
"Utility",
"function",
"to",
"read",
"a",
"principal",
"of",
"the",
"given",
"type",
"from",
"the",
"OpenCms",
"database",
"using",
"the",
"provided",
"OpenCms",
"user",
"context",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/security/CmsPrincipal.java#L310-L325 |
jpaoletti/java-presentation-manager | modules/jpm-core/src/main/java/jpaoletti/jpm/core/PMContext.java | PMContext.getBoolean | public boolean getBoolean(String key, boolean def) {
"""
Getter for a boolean value.
@param key The key
@param def Default value if there is no item at key
@return A boolean
"""
try {
if (!contains(key)) {
return def;
}
return (Boolean) get(key);... | java | public boolean getBoolean(String key, boolean def) {
try {
if (!contains(key)) {
return def;
}
return (Boolean) get(key);
} catch (Exception e) {
return def;
}
} | [
"public",
"boolean",
"getBoolean",
"(",
"String",
"key",
",",
"boolean",
"def",
")",
"{",
"try",
"{",
"if",
"(",
"!",
"contains",
"(",
"key",
")",
")",
"{",
"return",
"def",
";",
"}",
"return",
"(",
"Boolean",
")",
"get",
"(",
"key",
")",
";",
"}... | Getter for a boolean value.
@param key The key
@param def Default value if there is no item at key
@return A boolean | [
"Getter",
"for",
"a",
"boolean",
"value",
"."
] | train | https://github.com/jpaoletti/java-presentation-manager/blob/d5aab55638383695db244744b4bfe27c5200e04f/modules/jpm-core/src/main/java/jpaoletti/jpm/core/PMContext.java#L315-L324 |
inferred/FreeBuilder | src/main/java/org/inferred/freebuilder/processor/source/ObjectsExcerpts.java | ObjectsExcerpts.notEquals | public static Excerpt notEquals(Object a, Object b, TypeKind kind) {
"""
Returns an Excerpt equivalent to {@code !Objects.equals(a, b)}.
<p>Uses != for primitive types, as this avoids boxing.
"""
return equalsExcerpt(false, a, b, kind);
} | java | public static Excerpt notEquals(Object a, Object b, TypeKind kind) {
return equalsExcerpt(false, a, b, kind);
} | [
"public",
"static",
"Excerpt",
"notEquals",
"(",
"Object",
"a",
",",
"Object",
"b",
",",
"TypeKind",
"kind",
")",
"{",
"return",
"equalsExcerpt",
"(",
"false",
",",
"a",
",",
"b",
",",
"kind",
")",
";",
"}"
] | Returns an Excerpt equivalent to {@code !Objects.equals(a, b)}.
<p>Uses != for primitive types, as this avoids boxing. | [
"Returns",
"an",
"Excerpt",
"equivalent",
"to",
"{",
"@code",
"!Objects",
".",
"equals",
"(",
"a",
"b",
")",
"}",
"."
] | train | https://github.com/inferred/FreeBuilder/blob/d5a222f90648aece135da4b971c55a60afe8649c/src/main/java/org/inferred/freebuilder/processor/source/ObjectsExcerpts.java#L25-L27 |
Azure/azure-sdk-for-java | datamigration/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/datamigration/v2018_03_31_preview/implementation/TasksInner.java | TasksInner.getAsync | public Observable<ProjectTaskInner> getAsync(String groupName, String serviceName, String projectName, String taskName) {
"""
Get task information.
The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The GET method retrieves information about a task.
@param groupN... | java | public Observable<ProjectTaskInner> getAsync(String groupName, String serviceName, String projectName, String taskName) {
return getWithServiceResponseAsync(groupName, serviceName, projectName, taskName).map(new Func1<ServiceResponse<ProjectTaskInner>, ProjectTaskInner>() {
@Override
pub... | [
"public",
"Observable",
"<",
"ProjectTaskInner",
">",
"getAsync",
"(",
"String",
"groupName",
",",
"String",
"serviceName",
",",
"String",
"projectName",
",",
"String",
"taskName",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"groupName",
",",
"serviceNam... | Get task information.
The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The GET method retrieves information about a task.
@param groupName Name of the resource group
@param serviceName Name of the service
@param projectName Name of the project
@param taskName Name of t... | [
"Get",
"task",
"information",
".",
"The",
"tasks",
"resource",
"is",
"a",
"nested",
"proxy",
"-",
"only",
"resource",
"representing",
"work",
"performed",
"by",
"a",
"DMS",
"instance",
".",
"The",
"GET",
"method",
"retrieves",
"information",
"about",
"a",
"t... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/datamigration/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/datamigration/v2018_03_31_preview/implementation/TasksInner.java#L524-L531 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkInterfacesInner.java | NetworkInterfacesInner.beginGetEffectiveRouteTableAsync | public Observable<EffectiveRouteListResultInner> beginGetEffectiveRouteTableAsync(String resourceGroupName, String networkInterfaceName) {
"""
Gets all route tables applied to a network interface.
@param resourceGroupName The name of the resource group.
@param networkInterfaceName The name of the network inter... | java | public Observable<EffectiveRouteListResultInner> beginGetEffectiveRouteTableAsync(String resourceGroupName, String networkInterfaceName) {
return beginGetEffectiveRouteTableWithServiceResponseAsync(resourceGroupName, networkInterfaceName).map(new Func1<ServiceResponse<EffectiveRouteListResultInner>, EffectiveRo... | [
"public",
"Observable",
"<",
"EffectiveRouteListResultInner",
">",
"beginGetEffectiveRouteTableAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"networkInterfaceName",
")",
"{",
"return",
"beginGetEffectiveRouteTableWithServiceResponseAsync",
"(",
"resourceGroupName",
"... | Gets all route tables applied to a network interface.
@param resourceGroupName The name of the resource group.
@param networkInterfaceName The name of the network interface.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the EffectiveRouteListResultInner object | [
"Gets",
"all",
"route",
"tables",
"applied",
"to",
"a",
"network",
"interface",
"."
] | 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/NetworkInterfacesInner.java#L1284-L1291 |
facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/Utilities.java | Utilities.getUnitResourceRequest | public static ResourceRequest getUnitResourceRequest(ResourceType type) {
"""
Get a {@link ResourceRequest} object for a given resource type
Will cache the resource request after the first time it is created
@param type the type to return the {@link ResourceRequest} for
@return the {@link ResourceRequest} obj... | java | public static ResourceRequest getUnitResourceRequest(ResourceType type) {
ResourceRequest req = unitResourceRequestMap.get(type);
if (req == null) {
req = new ResourceRequest(1, type);
req.setSpecs(UNIT_COMPUTE_SPECS);
// instead of using concurrent classes or locking - we clone and replace
... | [
"public",
"static",
"ResourceRequest",
"getUnitResourceRequest",
"(",
"ResourceType",
"type",
")",
"{",
"ResourceRequest",
"req",
"=",
"unitResourceRequestMap",
".",
"get",
"(",
"type",
")",
";",
"if",
"(",
"req",
"==",
"null",
")",
"{",
"req",
"=",
"new",
"... | Get a {@link ResourceRequest} object for a given resource type
Will cache the resource request after the first time it is created
@param type the type to return the {@link ResourceRequest} for
@return the {@link ResourceRequest} object for a given type | [
"Get",
"a",
"{",
"@link",
"ResourceRequest",
"}",
"object",
"for",
"a",
"given",
"resource",
"type",
"Will",
"cache",
"the",
"resource",
"request",
"after",
"the",
"first",
"time",
"it",
"is",
"created"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/Utilities.java#L61-L81 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/img/ImgUtil.java | ImgUtil.writePng | public static void writePng(Image image, OutputStream out) throws IORuntimeException {
"""
写出图像为PNG格式
@param image {@link Image}
@param out 写出到的目标流
@throws IORuntimeException IO异常
@since 4.0.10
"""
write(image, IMAGE_TYPE_PNG, out);
} | java | public static void writePng(Image image, OutputStream out) throws IORuntimeException {
write(image, IMAGE_TYPE_PNG, out);
} | [
"public",
"static",
"void",
"writePng",
"(",
"Image",
"image",
",",
"OutputStream",
"out",
")",
"throws",
"IORuntimeException",
"{",
"write",
"(",
"image",
",",
"IMAGE_TYPE_PNG",
",",
"out",
")",
";",
"}"
] | 写出图像为PNG格式
@param image {@link Image}
@param out 写出到的目标流
@throws IORuntimeException IO异常
@since 4.0.10 | [
"写出图像为PNG格式"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/img/ImgUtil.java#L1389-L1391 |
amzn/ion-java | src/com/amazon/ion/impl/lite/ReverseBinaryEncoder.java | ReverseBinaryEncoder.writeLocalSymbolTable | private void writeLocalSymbolTable(SymbolTable symTab) {
"""
Write contents of a local symbol table as a struct.
The contents are the IST:: annotation, declared symbols, and import
declarations (that refer to shared symtabs) if they exist.
@param symTab the local symbol table, not shared, not system
"""
... | java | private void writeLocalSymbolTable(SymbolTable symTab)
{
assert symTab.isLocalTable();
final int originalOffset = myBuffer.length - myOffset;
// Write declared local symbol strings if any exists
writeSymbolsField(symTab);
// Write import declarations if any exists
... | [
"private",
"void",
"writeLocalSymbolTable",
"(",
"SymbolTable",
"symTab",
")",
"{",
"assert",
"symTab",
".",
"isLocalTable",
"(",
")",
";",
"final",
"int",
"originalOffset",
"=",
"myBuffer",
".",
"length",
"-",
"myOffset",
";",
"// Write declared local symbol string... | Write contents of a local symbol table as a struct.
The contents are the IST:: annotation, declared symbols, and import
declarations (that refer to shared symtabs) if they exist.
@param symTab the local symbol table, not shared, not system | [
"Write",
"contents",
"of",
"a",
"local",
"symbol",
"table",
"as",
"a",
"struct",
".",
"The",
"contents",
"are",
"the",
"IST",
"::",
"annotation",
"declared",
"symbols",
"and",
"import",
"declarations",
"(",
"that",
"refer",
"to",
"shared",
"symtabs",
")",
... | train | https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/impl/lite/ReverseBinaryEncoder.java#L1333-L1356 |
google/closure-compiler | src/com/google/javascript/jscomp/ProcessClosurePrimitives.java | ProcessClosurePrimitives.validateUnaliasablePrimitiveCall | private boolean validateUnaliasablePrimitiveCall(NodeTraversal t, Node n, String methodName) {
"""
Verifies that a) the call is in the global scope and b) the return value is unused
<p>This method is for primitives that never return a value.
"""
return validatePrimitiveCallWithMessage(t, n, methodName, ... | java | private boolean validateUnaliasablePrimitiveCall(NodeTraversal t, Node n, String methodName) {
return validatePrimitiveCallWithMessage(t, n, methodName, CLOSURE_CALL_CANNOT_BE_ALIASED_ERROR);
} | [
"private",
"boolean",
"validateUnaliasablePrimitiveCall",
"(",
"NodeTraversal",
"t",
",",
"Node",
"n",
",",
"String",
"methodName",
")",
"{",
"return",
"validatePrimitiveCallWithMessage",
"(",
"t",
",",
"n",
",",
"methodName",
",",
"CLOSURE_CALL_CANNOT_BE_ALIASED_ERROR"... | Verifies that a) the call is in the global scope and b) the return value is unused
<p>This method is for primitives that never return a value. | [
"Verifies",
"that",
"a",
")",
"the",
"call",
"is",
"in",
"the",
"global",
"scope",
"and",
"b",
")",
"the",
"return",
"value",
"is",
"unused"
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/ProcessClosurePrimitives.java#L323-L325 |
loicoudot/java4cpp-core | src/main/java/com/github/loicoudot/java4cpp/FileManager.java | FileManager.saveFile | private synchronized void saveFile(String fileContent, File fileName) {
"""
Write the file {@code fileName} in the target directory with
{@code fileContent}. If {@code useHash} is true, then the file is save if
it's doesn't exist or if the content has changed.
"""
try {
if (imports.getS... | java | private synchronized void saveFile(String fileContent, File fileName) {
try {
if (imports.getSymbols().contains(fileName.getName())) {
logInfo(" imported " + fileName);
++imported;
} else {
export.getSymbols().add(fileName.getName()... | [
"private",
"synchronized",
"void",
"saveFile",
"(",
"String",
"fileContent",
",",
"File",
"fileName",
")",
"{",
"try",
"{",
"if",
"(",
"imports",
".",
"getSymbols",
"(",
")",
".",
"contains",
"(",
"fileName",
".",
"getName",
"(",
")",
")",
")",
"{",
"l... | Write the file {@code fileName} in the target directory with
{@code fileContent}. If {@code useHash} is true, then the file is save if
it's doesn't exist or if the content has changed. | [
"Write",
"the",
"file",
"{"
] | train | https://github.com/loicoudot/java4cpp-core/blob/7fe5a5dd5a29c3f95b62f46eaacbb8f8778b9493/src/main/java/com/github/loicoudot/java4cpp/FileManager.java#L230-L259 |
Gagravarr/VorbisJava | core/src/main/java/org/gagravarr/ogg/OggPacketReader.java | OggPacketReader.skipToSequenceNumber | public void skipToSequenceNumber(int sid, int sequenceNumber) throws IOException {
"""
Skips forward until the first packet with a Sequence Number
of equal or greater than that specified. Call {@link #getNextPacket()}
to retrieve this packet.
This method advances across all streams, but only searches the
speci... | java | public void skipToSequenceNumber(int sid, int sequenceNumber) throws IOException {
OggPacket p = null;
while( (p = getNextPacket()) != null ) {
if(p.getSid() == sid && p.getSequenceNumber() >= sequenceNumber) {
nextPacket = p;
break;
}
}
... | [
"public",
"void",
"skipToSequenceNumber",
"(",
"int",
"sid",
",",
"int",
"sequenceNumber",
")",
"throws",
"IOException",
"{",
"OggPacket",
"p",
"=",
"null",
";",
"while",
"(",
"(",
"p",
"=",
"getNextPacket",
"(",
")",
")",
"!=",
"null",
")",
"{",
"if",
... | Skips forward until the first packet with a Sequence Number
of equal or greater than that specified. Call {@link #getNextPacket()}
to retrieve this packet.
This method advances across all streams, but only searches the
specified one.
@param sid The ID of the stream who's packets we will search
@param sequenceNumber The... | [
"Skips",
"forward",
"until",
"the",
"first",
"packet",
"with",
"a",
"Sequence",
"Number",
"of",
"equal",
"or",
"greater",
"than",
"that",
"specified",
".",
"Call",
"{"
] | train | https://github.com/Gagravarr/VorbisJava/blob/22b4d645b00386d59d17a336a2bc9d54db08df16/core/src/main/java/org/gagravarr/ogg/OggPacketReader.java#L171-L179 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/nio/channels/Channels.java | Channels.newOutputStream | public static OutputStream newOutputStream(final WritableByteChannel ch) {
"""
Constructs a stream that writes bytes to the given channel.
<p> The <tt>write</tt> methods of the resulting stream will throw an
{@link IllegalBlockingModeException} if invoked while the underlying
channel is in non-blocking mode. ... | java | public static OutputStream newOutputStream(final WritableByteChannel ch) {
checkNotNull(ch, "ch");
return new OutputStream() {
private ByteBuffer bb = null;
private byte[] bs = null; // Invoker's previous array
private byte[] b1 = null;
... | [
"public",
"static",
"OutputStream",
"newOutputStream",
"(",
"final",
"WritableByteChannel",
"ch",
")",
"{",
"checkNotNull",
"(",
"ch",
",",
"\"ch\"",
")",
";",
"return",
"new",
"OutputStream",
"(",
")",
"{",
"private",
"ByteBuffer",
"bb",
"=",
"null",
";",
"... | Constructs a stream that writes bytes to the given channel.
<p> The <tt>write</tt> methods of the resulting stream will throw an
{@link IllegalBlockingModeException} if invoked while the underlying
channel is in non-blocking mode. The stream will not be buffered. The
stream will be safe for access by multiple concur... | [
"Constructs",
"a",
"stream",
"that",
"writes",
"bytes",
"to",
"the",
"given",
"channel",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/nio/channels/Channels.java#L143-L183 |
jnidzwetzki/bitfinex-v2-wss-api-java | src/main/java/com/github/jnidzwetzki/bitfinex/v2/manager/BiConsumerCallbackManager.java | BiConsumerCallbackManager.removeCallback | public boolean removeCallback(final S symbol, final BiConsumer<S, T> callback) throws BitfinexClientException {
"""
Remove the a callback
@param symbol
@param callback
@return
@throws BitfinexClientException
"""
final List<BiConsumer<S, T>> callbackList = callbacks.get(symbol);
if(callbackList == n... | java | public boolean removeCallback(final S symbol, final BiConsumer<S, T> callback) throws BitfinexClientException {
final List<BiConsumer<S, T>> callbackList = callbacks.get(symbol);
if(callbackList == null) {
throw new BitfinexClientException("Unknown ticker string: " + symbol);
}
return callbackList.... | [
"public",
"boolean",
"removeCallback",
"(",
"final",
"S",
"symbol",
",",
"final",
"BiConsumer",
"<",
"S",
",",
"T",
">",
"callback",
")",
"throws",
"BitfinexClientException",
"{",
"final",
"List",
"<",
"BiConsumer",
"<",
"S",
",",
"T",
">",
">",
"callbackL... | Remove the a callback
@param symbol
@param callback
@return
@throws BitfinexClientException | [
"Remove",
"the",
"a",
"callback"
] | train | https://github.com/jnidzwetzki/bitfinex-v2-wss-api-java/blob/2e6adf1eb6f8cd4c8722f1619f78ab2cc3c600ee/src/main/java/com/github/jnidzwetzki/bitfinex/v2/manager/BiConsumerCallbackManager.java#L64-L73 |
Azure/azure-sdk-for-java | mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AccountFiltersInner.java | AccountFiltersInner.listAsync | public Observable<Page<AccountFilterInner>> listAsync(final String resourceGroupName, final String accountName) {
"""
List Account Filters.
List Account Filters in the Media Services account.
@param resourceGroupName The name of the resource group within the Azure subscription.
@param accountName The Media Se... | java | public Observable<Page<AccountFilterInner>> listAsync(final String resourceGroupName, final String accountName) {
return listWithServiceResponseAsync(resourceGroupName, accountName)
.map(new Func1<ServiceResponse<Page<AccountFilterInner>>, Page<AccountFilterInner>>() {
@Override
... | [
"public",
"Observable",
"<",
"Page",
"<",
"AccountFilterInner",
">",
">",
"listAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"accountName",
")",
"{",
"return",
"listWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"accountName",... | List Account Filters.
List Account Filters in the Media Services account.
@param resourceGroupName The name of the resource group within the Azure subscription.
@param accountName The Media Services account name.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the Pa... | [
"List",
"Account",
"Filters",
".",
"List",
"Account",
"Filters",
"in",
"the",
"Media",
"Services",
"account",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AccountFiltersInner.java#L143-L151 |
lessthanoptimal/BoofCV | main/boofcv-io/src/main/java/boofcv/io/UtilIO.java | UtilIO.getSourcePath | public static String getSourcePath(String pkg, String app) {
"""
Constructs the path for a source code file residing in the examples or demonstrations directory
In the case of the file not being in either directory, an empty string is returned
The expected parameters are class.getPackage().getName(), class.getSi... | java | public static String getSourcePath(String pkg, String app) {
String path = "";
if(pkg == null || app == null)
return path;
String pathToBase = getPathToBase();
if( pathToBase != null ) {
if(pkg.contains("examples"))
path = new File(pathToBase,"examples/src/main/java/").getAbsolutePath();
else if... | [
"public",
"static",
"String",
"getSourcePath",
"(",
"String",
"pkg",
",",
"String",
"app",
")",
"{",
"String",
"path",
"=",
"\"\"",
";",
"if",
"(",
"pkg",
"==",
"null",
"||",
"app",
"==",
"null",
")",
"return",
"path",
";",
"String",
"pathToBase",
"=",... | Constructs the path for a source code file residing in the examples or demonstrations directory
In the case of the file not being in either directory, an empty string is returned
The expected parameters are class.getPackage().getName(), class.getSimpleName()
@param pkg package containing the class
@param app simple cla... | [
"Constructs",
"the",
"path",
"for",
"a",
"source",
"code",
"file",
"residing",
"in",
"the",
"examples",
"or",
"demonstrations",
"directory",
"In",
"the",
"case",
"of",
"the",
"file",
"not",
"being",
"in",
"either",
"directory",
"an",
"empty",
"string",
"is",... | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-io/src/main/java/boofcv/io/UtilIO.java#L388-L415 |
relayrides/pushy | pushy/src/main/java/com/turo/pushy/apns/auth/ApnsSigningKey.java | ApnsSigningKey.loadFromPkcs8File | public static ApnsSigningKey loadFromPkcs8File(final File pkcs8File, final String teamId, final String keyId) throws IOException, NoSuchAlgorithmException, InvalidKeyException {
"""
Loads a signing key from the given PKCS#8 file.
@param pkcs8File the file from which to load the key
@param teamId the ten-charac... | java | public static ApnsSigningKey loadFromPkcs8File(final File pkcs8File, final String teamId, final String keyId) throws IOException, NoSuchAlgorithmException, InvalidKeyException {
try (final FileInputStream fileInputStream = new FileInputStream(pkcs8File)) {
return ApnsSigningKey.loadFromInputStream(f... | [
"public",
"static",
"ApnsSigningKey",
"loadFromPkcs8File",
"(",
"final",
"File",
"pkcs8File",
",",
"final",
"String",
"teamId",
",",
"final",
"String",
"keyId",
")",
"throws",
"IOException",
",",
"NoSuchAlgorithmException",
",",
"InvalidKeyException",
"{",
"try",
"(... | Loads a signing key from the given PKCS#8 file.
@param pkcs8File the file from which to load the key
@param teamId the ten-character, Apple-issued identifier for the team to which the key belongs
@param keyId the ten-character, Apple-issued identitifier for the key itself
@return an APNs signing key with the given ke... | [
"Loads",
"a",
"signing",
"key",
"from",
"the",
"given",
"PKCS#8",
"file",
"."
] | train | https://github.com/relayrides/pushy/blob/1f6f9a0e07d785c815d74c2320a8d87c80231d36/pushy/src/main/java/com/turo/pushy/apns/auth/ApnsSigningKey.java#L105-L109 |
zxing/zxing | core/src/main/java/com/google/zxing/datamatrix/detector/Detector.java | Detector.transitionsBetween | private int transitionsBetween(ResultPoint from, ResultPoint to) {
"""
Counts the number of black/white transitions between two points, using something like Bresenham's algorithm.
"""
// See QR Code Detector, sizeOfBlackWhiteBlackRun()
int fromX = (int) from.getX();
int fromY = (int) from.getY();
... | java | private int transitionsBetween(ResultPoint from, ResultPoint to) {
// See QR Code Detector, sizeOfBlackWhiteBlackRun()
int fromX = (int) from.getX();
int fromY = (int) from.getY();
int toX = (int) to.getX();
int toY = (int) to.getY();
boolean steep = Math.abs(toY - fromY) > Math.abs(toX - fromX)... | [
"private",
"int",
"transitionsBetween",
"(",
"ResultPoint",
"from",
",",
"ResultPoint",
"to",
")",
"{",
"// See QR Code Detector, sizeOfBlackWhiteBlackRun()",
"int",
"fromX",
"=",
"(",
"int",
")",
"from",
".",
"getX",
"(",
")",
";",
"int",
"fromY",
"=",
"(",
"... | Counts the number of black/white transitions between two points, using something like Bresenham's algorithm. | [
"Counts",
"the",
"number",
"of",
"black",
"/",
"white",
"transitions",
"between",
"two",
"points",
"using",
"something",
"like",
"Bresenham",
"s",
"algorithm",
"."
] | train | https://github.com/zxing/zxing/blob/653ac2a3beb11481eff82e7d5f2bab8a745f7fac/core/src/main/java/com/google/zxing/datamatrix/detector/Detector.java#L341-L380 |
code4everything/util | src/main/java/com/zhazhapan/util/Utils.java | Utils.rightTrim | public static String rightTrim(String value, String rightTrim) {
"""
裁剪字符串
@param value 值
@param rightTrim 需要裁剪的值
@return 裁剪后的字符串
@since 1.0.8
"""
if (Checker.isEmpty(value) || Checker.isEmpty(rightTrim)) {
return value;
}
int idx = value.length() - rightTrim.lengt... | java | public static String rightTrim(String value, String rightTrim) {
if (Checker.isEmpty(value) || Checker.isEmpty(rightTrim)) {
return value;
}
int idx = value.length() - rightTrim.length();
return value.lastIndexOf(rightTrim) == idx ? rightTrim(value.substring(0, idx), rightTri... | [
"public",
"static",
"String",
"rightTrim",
"(",
"String",
"value",
",",
"String",
"rightTrim",
")",
"{",
"if",
"(",
"Checker",
".",
"isEmpty",
"(",
"value",
")",
"||",
"Checker",
".",
"isEmpty",
"(",
"rightTrim",
")",
")",
"{",
"return",
"value",
";",
... | 裁剪字符串
@param value 值
@param rightTrim 需要裁剪的值
@return 裁剪后的字符串
@since 1.0.8 | [
"裁剪字符串"
] | train | https://github.com/code4everything/util/blob/1fc9f0ead1108f4d7208ba7c000df4244f708418/src/main/java/com/zhazhapan/util/Utils.java#L171-L177 |
arnaudroger/SimpleFlatMapper | sfm-springjdbc/src/main/java/org/simpleflatmapper/jdbc/spring/JdbcTemplateCrud.java | JdbcTemplateCrud.create | public <RH extends CheckedConsumer<? super K>> RH create(final T value, final RH keyConsumer) throws DataAccessException {
"""
insert value into the db through the specified connection.
Callback keyConsumer with the generated key if one was.
@param value the value
@param keyConsumer the key consumer
@p... | java | public <RH extends CheckedConsumer<? super K>> RH create(final T value, final RH keyConsumer) throws DataAccessException {
return
jdbcTemplate.execute(new ConnectionCallback<RH>() {
@Override
public RH doInConnection(Connection connection) throws SQLException, DataAcc... | [
"public",
"<",
"RH",
"extends",
"CheckedConsumer",
"<",
"?",
"super",
"K",
">",
">",
"RH",
"create",
"(",
"final",
"T",
"value",
",",
"final",
"RH",
"keyConsumer",
")",
"throws",
"DataAccessException",
"{",
"return",
"jdbcTemplate",
".",
"execute",
"(",
"n... | insert value into the db through the specified connection.
Callback keyConsumer with the generated key if one was.
@param value the value
@param keyConsumer the key consumer
@param <RH> the type of keyConsumer
@return the keyConsumer
@throws DataAccessException | [
"insert",
"value",
"into",
"the",
"db",
"through",
"the",
"specified",
"connection",
".",
"Callback",
"keyConsumer",
"with",
"the",
"generated",
"key",
"if",
"one",
"was",
"."
] | train | https://github.com/arnaudroger/SimpleFlatMapper/blob/93435438c18f26c87963d5e0f3ebf0f264dcd8c2/sfm-springjdbc/src/main/java/org/simpleflatmapper/jdbc/spring/JdbcTemplateCrud.java#L67-L75 |
greatman/craftconomy3 | src/main/java/com/greatmancode/craftconomy3/Common.java | Common.addMetricsGraph | public void addMetricsGraph(String title, String value) {
"""
Add a graph to Metrics
@param title The title of the Graph
@param value The value of the entry
"""
if (metrics != null) {
Metrics.Graph graph = metrics.createGraph(title);
graph.addPlotter(new Metrics.Plotter(valu... | java | public void addMetricsGraph(String title, String value) {
if (metrics != null) {
Metrics.Graph graph = metrics.createGraph(title);
graph.addPlotter(new Metrics.Plotter(value) {
@Override
public int getValue() {
return 1;
... | [
"public",
"void",
"addMetricsGraph",
"(",
"String",
"title",
",",
"String",
"value",
")",
"{",
"if",
"(",
"metrics",
"!=",
"null",
")",
"{",
"Metrics",
".",
"Graph",
"graph",
"=",
"metrics",
".",
"createGraph",
"(",
"title",
")",
";",
"graph",
".",
"ad... | Add a graph to Metrics
@param title The title of the Graph
@param value The value of the entry | [
"Add",
"a",
"graph",
"to",
"Metrics"
] | train | https://github.com/greatman/craftconomy3/blob/51b1b3de7d039e20c7418d1e70b8c4b02b8cf840/src/main/java/com/greatmancode/craftconomy3/Common.java#L460-L470 |
JOML-CI/JOML | src/org/joml/Matrix3f.java | Matrix3f.setRow | public Matrix3f setRow(int row, Vector3fc src) throws IndexOutOfBoundsException {
"""
Set the row at the given <code>row</code> index, starting with <code>0</code>.
@param row
the row index in <code>[0..2]</code>
@param src
the row components to set
@return this
@throws IndexOutOfBoundsException if <code>r... | java | public Matrix3f setRow(int row, Vector3fc src) throws IndexOutOfBoundsException {
return setRow(row, src.x(), src.y(), src.z());
} | [
"public",
"Matrix3f",
"setRow",
"(",
"int",
"row",
",",
"Vector3fc",
"src",
")",
"throws",
"IndexOutOfBoundsException",
"{",
"return",
"setRow",
"(",
"row",
",",
"src",
".",
"x",
"(",
")",
",",
"src",
".",
"y",
"(",
")",
",",
"src",
".",
"z",
"(",
... | Set the row at the given <code>row</code> index, starting with <code>0</code>.
@param row
the row index in <code>[0..2]</code>
@param src
the row components to set
@return this
@throws IndexOutOfBoundsException if <code>row</code> is not in <code>[0..2]</code> | [
"Set",
"the",
"row",
"at",
"the",
"given",
"<code",
">",
"row<",
"/",
"code",
">",
"index",
"starting",
"with",
"<code",
">",
"0<",
"/",
"code",
">",
"."
] | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix3f.java#L3248-L3250 |
netheosgithub/pcs_api | java/src/main/java/net/netheos/pcsapi/storage/StorageFacade.java | StorageFacade.forProvider | public static StorageBuilder forProvider( String providerName ) {
"""
Get a {@link StorageBuilder} by its name
@param providerName The provider name
@return The builder used to configure a {@link StorageProvider}
"""
Class<?> providerClass = PROVIDERS.get( providerName );
if ( providerClas... | java | public static StorageBuilder forProvider( String providerName )
{
Class<?> providerClass = PROVIDERS.get( providerName );
if ( providerClass == null ) {
throw new IllegalArgumentException( "No provider implementation registered for name: " + providerName );
}
return new... | [
"public",
"static",
"StorageBuilder",
"forProvider",
"(",
"String",
"providerName",
")",
"{",
"Class",
"<",
"?",
">",
"providerClass",
"=",
"PROVIDERS",
".",
"get",
"(",
"providerName",
")",
";",
"if",
"(",
"providerClass",
"==",
"null",
")",
"{",
"throw",
... | Get a {@link StorageBuilder} by its name
@param providerName The provider name
@return The builder used to configure a {@link StorageProvider} | [
"Get",
"a",
"{",
"@link",
"StorageBuilder",
"}",
"by",
"its",
"name"
] | train | https://github.com/netheosgithub/pcs_api/blob/20691e52e144014f99ca75cb7dedc7ba0c18586c/java/src/main/java/net/netheos/pcsapi/storage/StorageFacade.java#L78-L87 |
cdk/cdk | legacy/src/main/java/org/openscience/cdk/smsd/algorithm/rgraph/CDKRGraph.java | CDKRGraph.parseRec | private void parseRec(BitSet traversed, BitSet extension, BitSet forbidden) throws CDKException {
"""
Parsing of the CDKRGraph. This is the recursive method
to perform a query. The method will recursively
parse the CDKRGraph thru connected nodes and visiting the
CDKRGraph using allowed adjacency relationship.
... | java | private void parseRec(BitSet traversed, BitSet extension, BitSet forbidden) throws CDKException {
BitSet newTraversed = null;
BitSet newExtension = null;
BitSet newForbidden = null;
BitSet potentialNode = null;
checkTimeOut();
// if there is no more extension possible w... | [
"private",
"void",
"parseRec",
"(",
"BitSet",
"traversed",
",",
"BitSet",
"extension",
",",
"BitSet",
"forbidden",
")",
"throws",
"CDKException",
"{",
"BitSet",
"newTraversed",
"=",
"null",
";",
"BitSet",
"newExtension",
"=",
"null",
";",
"BitSet",
"newForbidden... | Parsing of the CDKRGraph. This is the recursive method
to perform a query. The method will recursively
parse the CDKRGraph thru connected nodes and visiting the
CDKRGraph using allowed adjacency relationship.
@param traversed node already parsed
@param extension possible extension node (allowed neighbors)
@param ... | [
"Parsing",
"of",
"the",
"CDKRGraph",
".",
"This",
"is",
"the",
"recursive",
"method",
"to",
"perform",
"a",
"query",
".",
"The",
"method",
"will",
"recursively",
"parse",
"the",
"CDKRGraph",
"thru",
"connected",
"nodes",
"and",
"visiting",
"the",
"CDKRGraph",
... | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/legacy/src/main/java/org/openscience/cdk/smsd/algorithm/rgraph/CDKRGraph.java#L255-L320 |
matthewhorridge/owlapi-gwt | owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLDataComplementOfImpl_CustomFieldSerializer.java | OWLDataComplementOfImpl_CustomFieldSerializer.deserializeInstance | @Override
public void deserializeInstance(SerializationStreamReader streamReader, OWLDataComplementOfImpl instance) throws SerializationException {
"""
Deserializes the content of the object from the
{@link com.google.gwt.user.client.rpc.SerializationStreamReader}.
@param streamReader the {@link com.google... | java | @Override
public void deserializeInstance(SerializationStreamReader streamReader, OWLDataComplementOfImpl instance) throws SerializationException {
deserialize(streamReader, instance);
} | [
"@",
"Override",
"public",
"void",
"deserializeInstance",
"(",
"SerializationStreamReader",
"streamReader",
",",
"OWLDataComplementOfImpl",
"instance",
")",
"throws",
"SerializationException",
"{",
"deserialize",
"(",
"streamReader",
",",
"instance",
")",
";",
"}"
] | Deserializes the content of the object from the
{@link com.google.gwt.user.client.rpc.SerializationStreamReader}.
@param streamReader the {@link com.google.gwt.user.client.rpc.SerializationStreamReader} to read the
object's content from
@param instance the object instance to deserialize
@throws com.google.gwt.user... | [
"Deserializes",
"the",
"content",
"of",
"the",
"object",
"from",
"the",
"{",
"@link",
"com",
".",
"google",
".",
"gwt",
".",
"user",
".",
"client",
".",
"rpc",
".",
"SerializationStreamReader",
"}",
"."
] | train | https://github.com/matthewhorridge/owlapi-gwt/blob/7ab975fb6cef3c8947099983551672a3b5d4e2fd/owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLDataComplementOfImpl_CustomFieldSerializer.java#L89-L92 |
andkulikov/Transitions-Everywhere | library(1.x)/src/main/java/com/transitionseverywhere/TransitionUtils.java | TransitionUtils.copyViewImage | @NonNull
public static View copyViewImage(@NonNull ViewGroup sceneRoot, @NonNull View view, @NonNull View parent) {
"""
Creates a View using the bitmap copy of <code>view</code>. If <code>view</code> is large,
the copy will use a scaled bitmap of the given view.
@param sceneRoot The ViewGroup in which the ... | java | @NonNull
public static View copyViewImage(@NonNull ViewGroup sceneRoot, @NonNull View view, @NonNull View parent) {
Matrix matrix = new Matrix();
matrix.setTranslate(-parent.getScrollX(), -parent.getScrollY());
ViewUtils.transformMatrixToGlobal(view, matrix);
ViewUtils.transformMatri... | [
"@",
"NonNull",
"public",
"static",
"View",
"copyViewImage",
"(",
"@",
"NonNull",
"ViewGroup",
"sceneRoot",
",",
"@",
"NonNull",
"View",
"view",
",",
"@",
"NonNull",
"View",
"parent",
")",
"{",
"Matrix",
"matrix",
"=",
"new",
"Matrix",
"(",
")",
";",
"ma... | Creates a View using the bitmap copy of <code>view</code>. If <code>view</code> is large,
the copy will use a scaled bitmap of the given view.
@param sceneRoot The ViewGroup in which the view copy will be displayed.
@param view The view to create a copy of.
@param parent The parent of view | [
"Creates",
"a",
"View",
"using",
"the",
"bitmap",
"copy",
"of",
"<code",
">",
"view<",
"/",
"code",
">",
".",
"If",
"<code",
">",
"view<",
"/",
"code",
">",
"is",
"large",
"the",
"copy",
"will",
"use",
"a",
"scaled",
"bitmap",
"of",
"the",
"given",
... | train | https://github.com/andkulikov/Transitions-Everywhere/blob/828efe5f152a2f05e2bfeee6254b74ad2269d4f1/library(1.x)/src/main/java/com/transitionseverywhere/TransitionUtils.java#L94-L118 |
grails/gorm-hibernate5 | grails-datastore-gorm-hibernate5/src/main/groovy/org/grails/orm/hibernate/query/AbstractHibernateCriteriaBuilder.java | AbstractHibernateCriteriaBuilder.distinct | public org.grails.datastore.mapping.query.api.ProjectionList distinct(String propertyName, String alias) {
"""
A projection that selects a distince property name
@param propertyName The property name
@param alias The alias to use
"""
final Projection proj = Projections.distinct(Projections.property(c... | java | public org.grails.datastore.mapping.query.api.ProjectionList distinct(String propertyName, String alias) {
final Projection proj = Projections.distinct(Projections.property(calculatePropertyName(propertyName)));
addProjectionToList(proj,alias);
return this;
} | [
"public",
"org",
".",
"grails",
".",
"datastore",
".",
"mapping",
".",
"query",
".",
"api",
".",
"ProjectionList",
"distinct",
"(",
"String",
"propertyName",
",",
"String",
"alias",
")",
"{",
"final",
"Projection",
"proj",
"=",
"Projections",
".",
"distinct"... | A projection that selects a distince property name
@param propertyName The property name
@param alias The alias to use | [
"A",
"projection",
"that",
"selects",
"a",
"distince",
"property",
"name"
] | train | https://github.com/grails/gorm-hibernate5/blob/0ebb80cd769ef2bea955723d4543828a3e9542ef/grails-datastore-gorm-hibernate5/src/main/groovy/org/grails/orm/hibernate/query/AbstractHibernateCriteriaBuilder.java#L204-L208 |
pgjdbc/pgjdbc | pgjdbc/src/main/java/org/postgresql/jdbc/EscapedFunctions2.java | EscapedFunctions2.sqlucase | public static void sqlucase(StringBuilder buf, List<? extends CharSequence> parsedArgs) throws SQLException {
"""
ucase to upper translation
@param buf The buffer to append into
@param parsedArgs arguments
@throws SQLException if something wrong happens
"""
singleArgumentFunctionCall(buf, "upper(", "u... | java | public static void sqlucase(StringBuilder buf, List<? extends CharSequence> parsedArgs) throws SQLException {
singleArgumentFunctionCall(buf, "upper(", "ucase", parsedArgs);
} | [
"public",
"static",
"void",
"sqlucase",
"(",
"StringBuilder",
"buf",
",",
"List",
"<",
"?",
"extends",
"CharSequence",
">",
"parsedArgs",
")",
"throws",
"SQLException",
"{",
"singleArgumentFunctionCall",
"(",
"buf",
",",
"\"upper(\"",
",",
"\"ucase\"",
",",
"par... | ucase to upper translation
@param buf The buffer to append into
@param parsedArgs arguments
@throws SQLException if something wrong happens | [
"ucase",
"to",
"upper",
"translation"
] | train | https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/jdbc/EscapedFunctions2.java#L320-L322 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/Hierarchy.java | Hierarchy.findMethod | public static @CheckForNull
XMethod findMethod(ClassDescriptor classDesc, String methodName, String methodSig, boolean isStatic) {
"""
Find a method in given class.
@param classDesc
the class descriptor
@param methodName
the name of the method
@param methodSig
the signature of the method
@param isStat... | java | public static @CheckForNull
XMethod findMethod(ClassDescriptor classDesc, String methodName, String methodSig, boolean isStatic) {
if (DEBUG_METHOD_LOOKUP) {
System.out.println("Check " + classDesc.getClassName());
}
try {
XClass xClass = Global.getAnalysisCache().ge... | [
"public",
"static",
"@",
"CheckForNull",
"XMethod",
"findMethod",
"(",
"ClassDescriptor",
"classDesc",
",",
"String",
"methodName",
",",
"String",
"methodSig",
",",
"boolean",
"isStatic",
")",
"{",
"if",
"(",
"DEBUG_METHOD_LOOKUP",
")",
"{",
"System",
".",
"out"... | Find a method in given class.
@param classDesc
the class descriptor
@param methodName
the name of the method
@param methodSig
the signature of the method
@param isStatic
are we looking for a static method?
@return the JavaClassAndMethod, or null if no such method exists in the
class | [
"Find",
"a",
"method",
"in",
"given",
"class",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/Hierarchy.java#L469-L483 |
beihaifeiwu/dolphin | dolphin-common/src/main/java/com/freetmp/common/util/PropertyPlaceholderHelper.java | PropertyPlaceholderHelper.replacePlaceholders | public String replacePlaceholders(String value, final Properties properties) {
"""
Replaces all placeholders of format {@code ${name}} with the corresponding
property from the supplied {@link Properties}.
@param value the value containing the placeholders to be replaced
@param properties the {@code Properties} ... | java | public String replacePlaceholders(String value, final Properties properties) {
Assert.notNull(properties, "'properties' must not be null");
return replacePlaceholders(value, new PlaceholderResolver() {
@Override
public String resolvePlaceholder(String placeholderName) {
return properties.getProperty(place... | [
"public",
"String",
"replacePlaceholders",
"(",
"String",
"value",
",",
"final",
"Properties",
"properties",
")",
"{",
"Assert",
".",
"notNull",
"(",
"properties",
",",
"\"'properties' must not be null\"",
")",
";",
"return",
"replacePlaceholders",
"(",
"value",
","... | Replaces all placeholders of format {@code ${name}} with the corresponding
property from the supplied {@link Properties}.
@param value the value containing the placeholders to be replaced
@param properties the {@code Properties} to use for replacement
@return the supplied value with placeholders replaced inline | [
"Replaces",
"all",
"placeholders",
"of",
"format",
"{"
] | train | https://github.com/beihaifeiwu/dolphin/blob/b100579cc6986dce5eba5593ebb5fbae7bad9d1a/dolphin-common/src/main/java/com/freetmp/common/util/PropertyPlaceholderHelper.java#L107-L115 |
OpenLiberty/open-liberty | dev/wlp-generateRepositoryContent/src/com/ibm/ws/wlp/repository/XmlGenerator.java | XmlGenerator.createSchema | private Schema createSchema(JAXBContext context) throws IOException, SAXException {
"""
This method will create a {@link Schema} from a {@link JAXBContext}.
@param context The context to create the schema for
@return The {@link Schema} for this context
@throws IOException
@throws SAXException
"""
... | java | private Schema createSchema(JAXBContext context) throws IOException, SAXException {
// This is surprisingly faffy for something that has a generateSchema method! This will only produce
// a Result object, of which a schema result is not possible but you can produce dom results that
// can be con... | [
"private",
"Schema",
"createSchema",
"(",
"JAXBContext",
"context",
")",
"throws",
"IOException",
",",
"SAXException",
"{",
"// This is surprisingly faffy for something that has a generateSchema method! This will only produce",
"// a Result object, of which a schema result is not possible ... | This method will create a {@link Schema} from a {@link JAXBContext}.
@param context The context to create the schema for
@return The {@link Schema} for this context
@throws IOException
@throws SAXException | [
"This",
"method",
"will",
"create",
"a",
"{",
"@link",
"Schema",
"}",
"from",
"a",
"{",
"@link",
"JAXBContext",
"}",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/wlp-generateRepositoryContent/src/com/ibm/ws/wlp/repository/XmlGenerator.java#L197-L227 |
SonarSource/sonarqube | sonar-plugin-api/src/main/java/org/sonar/api/utils/ParsingUtils.java | ParsingUtils.parseNumber | public static double parseNumber(String number, Locale locale) throws ParseException {
"""
Parses a string with a locale and returns the corresponding number
@throws ParseException if number cannot be parsed
"""
if ("".equals(number)) {
return Double.NaN;
}
return NumberFormat.getNumberIns... | java | public static double parseNumber(String number, Locale locale) throws ParseException {
if ("".equals(number)) {
return Double.NaN;
}
return NumberFormat.getNumberInstance(locale).parse(number).doubleValue();
} | [
"public",
"static",
"double",
"parseNumber",
"(",
"String",
"number",
",",
"Locale",
"locale",
")",
"throws",
"ParseException",
"{",
"if",
"(",
"\"\"",
".",
"equals",
"(",
"number",
")",
")",
"{",
"return",
"Double",
".",
"NaN",
";",
"}",
"return",
"Numb... | Parses a string with a locale and returns the corresponding number
@throws ParseException if number cannot be parsed | [
"Parses",
"a",
"string",
"with",
"a",
"locale",
"and",
"returns",
"the",
"corresponding",
"number"
] | train | https://github.com/SonarSource/sonarqube/blob/2fffa4c2f79ae3714844d7742796e82822b6a98a/sonar-plugin-api/src/main/java/org/sonar/api/utils/ParsingUtils.java#L43-L48 |
apache/spark | launcher/src/main/java/org/apache/spark/launcher/AbstractLauncher.java | AbstractLauncher.setConf | public T setConf(String key, String value) {
"""
Set a single configuration value for the application.
@param key Configuration key.
@param value The value to use.
@return This launcher.
"""
checkNotNull(key, "key");
checkNotNull(value, "value");
checkArgument(key.startsWith("spark."), "'key' ... | java | public T setConf(String key, String value) {
checkNotNull(key, "key");
checkNotNull(value, "value");
checkArgument(key.startsWith("spark."), "'key' must start with 'spark.'");
builder.conf.put(key, value);
return self();
} | [
"public",
"T",
"setConf",
"(",
"String",
"key",
",",
"String",
"value",
")",
"{",
"checkNotNull",
"(",
"key",
",",
"\"key\"",
")",
";",
"checkNotNull",
"(",
"value",
",",
"\"value\"",
")",
";",
"checkArgument",
"(",
"key",
".",
"startsWith",
"(",
"\"spar... | Set a single configuration value for the application.
@param key Configuration key.
@param value The value to use.
@return This launcher. | [
"Set",
"a",
"single",
"configuration",
"value",
"for",
"the",
"application",
"."
] | train | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/launcher/src/main/java/org/apache/spark/launcher/AbstractLauncher.java#L58-L64 |
apiman/apiman | manager/api/es/src/main/java/io/apiman/manager/api/es/EsMarshalling.java | EsMarshalling.unmarshallPolicies | @SuppressWarnings("unchecked")
public static PoliciesBean unmarshallPolicies(Map<String, Object> source) {
"""
Unmarshals the given map source into a bean.
@param source the source
@return the policy beans
"""
if (source == null) {
return null;
}
PoliciesBean bean = ne... | java | @SuppressWarnings("unchecked")
public static PoliciesBean unmarshallPolicies(Map<String, Object> source) {
if (source == null) {
return null;
}
PoliciesBean bean = new PoliciesBean();
bean.setOrganizationId(asString(source.get("organizationId")));
bean.setEntityId... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"PoliciesBean",
"unmarshallPolicies",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"source",
")",
"{",
"if",
"(",
"source",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"Polic... | Unmarshals the given map source into a bean.
@param source the source
@return the policy beans | [
"Unmarshals",
"the",
"given",
"map",
"source",
"into",
"a",
"bean",
"."
] | train | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/es/src/main/java/io/apiman/manager/api/es/EsMarshalling.java#L659-L694 |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/ui/input/CmsMultiSelectCell.java | CmsMultiSelectCell.getGridLayout | private Grid getGridLayout(int count) {
"""
Helper function to generate the grid layout.<p>
@param count
@return the new grid
"""
Grid grid = new Grid();
int x, y, z, modolo = 0;
x = count % 3;
y = count % 5;
z = count % 7;
if ((z <= y) && (z <= x)) {... | java | private Grid getGridLayout(int count) {
Grid grid = new Grid();
int x, y, z, modolo = 0;
x = count % 3;
y = count % 5;
z = count % 7;
if ((z <= y) && (z <= x)) {
modolo = 7;
} else if ((y <= z) && (y <= x)) {
modolo = 5;
... | [
"private",
"Grid",
"getGridLayout",
"(",
"int",
"count",
")",
"{",
"Grid",
"grid",
"=",
"new",
"Grid",
"(",
")",
";",
"int",
"x",
",",
"y",
",",
"z",
",",
"modolo",
"=",
"0",
";",
"x",
"=",
"count",
"%",
"3",
";",
"y",
"=",
"count",
"%",
"5",... | Helper function to generate the grid layout.<p>
@param count
@return the new grid | [
"Helper",
"function",
"to",
"generate",
"the",
"grid",
"layout",
".",
"<p",
">",
"@param",
"count"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/ui/input/CmsMultiSelectCell.java#L174-L197 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/batch/BatchClient.java | BatchClient.createJob | public CreateJobResponse createJob(CreateJobRequest request) {
"""
Create a Batch-Compute job with the specified options.
@param request The request containing all options for creating a Batch-Compute job.
@return The response containing the ID of the newly created job.
"""
checkNotNull(request, "r... | java | public CreateJobResponse createJob(CreateJobRequest request) {
checkNotNull(request, "request should not be null.");
checkStringNotEmpty(request.getName(), "The name should not be null or empty string.");
checkStringNotEmpty(request.getVmType(), "The vmType should not be null or empty string.");... | [
"public",
"CreateJobResponse",
"createJob",
"(",
"CreateJobRequest",
"request",
")",
"{",
"checkNotNull",
"(",
"request",
",",
"\"request should not be null.\"",
")",
";",
"checkStringNotEmpty",
"(",
"request",
".",
"getName",
"(",
")",
",",
"\"The name should not be nu... | Create a Batch-Compute job with the specified options.
@param request The request containing all options for creating a Batch-Compute job.
@return The response containing the ID of the newly created job. | [
"Create",
"a",
"Batch",
"-",
"Compute",
"job",
"with",
"the",
"specified",
"options",
"."
] | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/batch/BatchClient.java#L177-L222 |
mozilla/rhino | src/org/mozilla/javascript/Context.java | Context.reportRuntimeError | public static EvaluatorException reportRuntimeError(String message,
String sourceName,
int lineno,
String lineSource,
... | java | public static EvaluatorException reportRuntimeError(String message,
String sourceName,
int lineno,
String lineSource,
... | [
"public",
"static",
"EvaluatorException",
"reportRuntimeError",
"(",
"String",
"message",
",",
"String",
"sourceName",
",",
"int",
"lineno",
",",
"String",
"lineSource",
",",
"int",
"lineOffset",
")",
"{",
"Context",
"cx",
"=",
"getCurrentContext",
"(",
")",
";"... | Report a runtime error using the error reporter for the current thread.
@param message the error message to report
@param sourceName a string describing the source, such as a filename
@param lineno the starting line number
@param lineSource the text of the line (may be null)
@param lineOffset the offset into lineSourc... | [
"Report",
"a",
"runtime",
"error",
"using",
"the",
"error",
"reporter",
"for",
"the",
"current",
"thread",
"."
] | train | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/Context.java#L997-L1010 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/Utility.java | Utility.parseNumber | public static int parseNumber(String text, int[] pos, int radix) {
"""
Parse an unsigned 31-bit integer at the given offset. Use
UCharacter.digit() to parse individual characters into digits.
@param text the text to be parsed
@param pos INPUT-OUTPUT parameter. On entry, pos[0] is the
offset within text at wh... | java | public static int parseNumber(String text, int[] pos, int radix) {
// assert(pos[0] >= 0);
// assert(radix >= 2);
// assert(radix <= 36);
int n = 0;
int p = pos[0];
while (p < text.length()) {
int ch = Character.codePointAt(text, p);
int d = UChara... | [
"public",
"static",
"int",
"parseNumber",
"(",
"String",
"text",
",",
"int",
"[",
"]",
"pos",
",",
"int",
"radix",
")",
"{",
"// assert(pos[0] >= 0);",
"// assert(radix >= 2);",
"// assert(radix <= 36);",
"int",
"n",
"=",
"0",
";",
"int",
"p",
"=",
"pos",
"[... | Parse an unsigned 31-bit integer at the given offset. Use
UCharacter.digit() to parse individual characters into digits.
@param text the text to be parsed
@param pos INPUT-OUTPUT parameter. On entry, pos[0] is the
offset within text at which to start parsing; it should point
to a valid digit. On exit, pos[0] is the ... | [
"Parse",
"an",
"unsigned",
"31",
"-",
"bit",
"integer",
"at",
"the",
"given",
"offset",
".",
"Use",
"UCharacter",
".",
"digit",
"()",
"to",
"parse",
"individual",
"characters",
"into",
"digits",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/Utility.java#L1445-L1470 |
camunda/camunda-bpm-platform | engine/src/main/java/org/camunda/bpm/engine/impl/util/ScriptUtil.java | ScriptUtil.getScript | public static ExecutableScript getScript(String language, String source, String resource, ExpressionManager expressionManager) {
"""
Creates a new {@link ExecutableScript} from a source or resource. It excepts static and
dynamic sources and resources. Dynamic means that the source or resource is an expression
wh... | java | public static ExecutableScript getScript(String language, String source, String resource, ExpressionManager expressionManager) {
return getScript(language, source, resource, expressionManager, getScriptFactory());
} | [
"public",
"static",
"ExecutableScript",
"getScript",
"(",
"String",
"language",
",",
"String",
"source",
",",
"String",
"resource",
",",
"ExpressionManager",
"expressionManager",
")",
"{",
"return",
"getScript",
"(",
"language",
",",
"source",
",",
"resource",
","... | Creates a new {@link ExecutableScript} from a source or resource. It excepts static and
dynamic sources and resources. Dynamic means that the source or resource is an expression
which will be evaluated during execution.
@param language the language of the script
@param source the source code of the script or an expres... | [
"Creates",
"a",
"new",
"{",
"@link",
"ExecutableScript",
"}",
"from",
"a",
"source",
"or",
"resource",
".",
"It",
"excepts",
"static",
"and",
"dynamic",
"sources",
"and",
"resources",
".",
"Dynamic",
"means",
"that",
"the",
"source",
"or",
"resource",
"is",
... | train | https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/util/ScriptUtil.java#L49-L51 |
jbundle/jbundle | base/screen/model/src/main/java/org/jbundle/base/screen/model/ScreenField.java | ScreenField.printScreenFieldData | public void printScreenFieldData(ScreenField sField, PrintWriter out, int iPrintOptions) {
"""
Output this screen using HTML.
@exception DBException File exception.
"""
this.getScreenFieldView().printScreenFieldData(sField, out, iPrintOptions);
} | java | public void printScreenFieldData(ScreenField sField, PrintWriter out, int iPrintOptions)
{
this.getScreenFieldView().printScreenFieldData(sField, out, iPrintOptions);
} | [
"public",
"void",
"printScreenFieldData",
"(",
"ScreenField",
"sField",
",",
"PrintWriter",
"out",
",",
"int",
"iPrintOptions",
")",
"{",
"this",
".",
"getScreenFieldView",
"(",
")",
".",
"printScreenFieldData",
"(",
"sField",
",",
"out",
",",
"iPrintOptions",
"... | Output this screen using HTML.
@exception DBException File exception. | [
"Output",
"this",
"screen",
"using",
"HTML",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/screen/model/src/main/java/org/jbundle/base/screen/model/ScreenField.java#L883-L886 |
jetty-project/jetty-npn | npn-boot/src/main/java/sun/security/ssl/ClientHandshaker.java | ClientHandshaker.getSubjectAltName | private static Object getSubjectAltName(X509Certificate cert, int type) {
"""
/*
Returns the subject alternative name of the specified type in the
subjectAltNames extension of a certificate.
"""
Collection<List<?>> subjectAltNames;
try {
subjectAltNames = cert.getSubjectAlternati... | java | private static Object getSubjectAltName(X509Certificate cert, int type) {
Collection<List<?>> subjectAltNames;
try {
subjectAltNames = cert.getSubjectAlternativeNames();
} catch (CertificateParsingException cpe) {
if (debug != null && Debug.isOn("handshake")) {
... | [
"private",
"static",
"Object",
"getSubjectAltName",
"(",
"X509Certificate",
"cert",
",",
"int",
"type",
")",
"{",
"Collection",
"<",
"List",
"<",
"?",
">",
">",
"subjectAltNames",
";",
"try",
"{",
"subjectAltNames",
"=",
"cert",
".",
"getSubjectAlternativeNames"... | /*
Returns the subject alternative name of the specified type in the
subjectAltNames extension of a certificate. | [
"/",
"*",
"Returns",
"the",
"subject",
"alternative",
"name",
"of",
"the",
"specified",
"type",
"in",
"the",
"subjectAltNames",
"extension",
"of",
"a",
"certificate",
"."
] | train | https://github.com/jetty-project/jetty-npn/blob/a26a7a5eabeeb57a63c6ee08fcf9b8cec1fa6c0d/npn-boot/src/main/java/sun/security/ssl/ClientHandshaker.java#L1569-L1592 |
powermock/powermock | powermock-api/powermock-api-easymock/src/main/java/org/powermock/api/easymock/PowerMock.java | PowerMock.createStrictMock | public static synchronized <T> T createStrictMock(Class<T> type, Method... methods) {
"""
Creates a strict mock object that supports mocking of final and native
methods.
@param <T> the type of the mock object
@param type the type of the mock object
@param methods optionally what methods to mock
@retu... | java | public static synchronized <T> T createStrictMock(Class<T> type, Method... methods) {
return doMock(type, false, new StrictMockStrategy(), null, methods);
} | [
"public",
"static",
"synchronized",
"<",
"T",
">",
"T",
"createStrictMock",
"(",
"Class",
"<",
"T",
">",
"type",
",",
"Method",
"...",
"methods",
")",
"{",
"return",
"doMock",
"(",
"type",
",",
"false",
",",
"new",
"StrictMockStrategy",
"(",
")",
",",
... | Creates a strict mock object that supports mocking of final and native
methods.
@param <T> the type of the mock object
@param type the type of the mock object
@param methods optionally what methods to mock
@return the mock object. | [
"Creates",
"a",
"strict",
"mock",
"object",
"that",
"supports",
"mocking",
"of",
"final",
"and",
"native",
"methods",
"."
] | train | https://github.com/powermock/powermock/blob/e8cd68026c284c6a7efe66959809eeebd8d1f9ad/powermock-api/powermock-api-easymock/src/main/java/org/powermock/api/easymock/PowerMock.java#L138-L140 |
OpenLiberty/open-liberty | dev/com.ibm.ws.monitor/src/com/ibm/wsspi/pmi/factory/StatsFactory.java | StatsFactory.createStatsInstance | public static StatsInstance createStatsInstance(String instanceName, String statsTemplate, ObjectName mBean, StatisticActions listener)
throws StatsFactoryException {
"""
Create a StatsInstance using the Stats template and add to the PMI tree at the root level.
This method will associate the M... | java | public static StatsInstance createStatsInstance(String instanceName, String statsTemplate, ObjectName mBean, StatisticActions listener)
throws StatsFactoryException {
if (tc.isEntryEnabled())
Tr.entry(tc, new StringBuffer("createStatsInstance:name=").append(instanceName).append("... | [
"public",
"static",
"StatsInstance",
"createStatsInstance",
"(",
"String",
"instanceName",
",",
"String",
"statsTemplate",
",",
"ObjectName",
"mBean",
",",
"StatisticActions",
"listener",
")",
"throws",
"StatsFactoryException",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabl... | Create a StatsInstance using the Stats template and add to the PMI tree at the root level.
This method will associate the MBean provided by the caller to the Stats instance.
@param instanceName name of the instance
@param statsTemplate location of the Stats template XML file
@param mBean MBean that needs to be associa... | [
"Create",
"a",
"StatsInstance",
"using",
"the",
"Stats",
"template",
"and",
"add",
"to",
"the",
"PMI",
"tree",
"at",
"the",
"root",
"level",
".",
"This",
"method",
"will",
"associate",
"the",
"MBean",
"provided",
"by",
"the",
"caller",
"to",
"the",
"Stats"... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.monitor/src/com/ibm/wsspi/pmi/factory/StatsFactory.java#L256-L281 |
xhsun/gw2wrapper | src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java | AsynchronousRequest.getSkillInfo | public void getSkillInfo(int[] ids, Callback<List<Skill>> callback) throws GuildWars2Exception, NullPointerException {
"""
For more info on Skills API go <a href="https://wiki.guildwars2.com/wiki/API:2/skills">here</a><br/>
Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#on... | java | public void getSkillInfo(int[] ids, Callback<List<Skill>> callback) throws GuildWars2Exception, NullPointerException {
isParamValid(new ParamChecker(ids));
gw2API.getSkillInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback);
} | [
"public",
"void",
"getSkillInfo",
"(",
"int",
"[",
"]",
"ids",
",",
"Callback",
"<",
"List",
"<",
"Skill",
">",
">",
"callback",
")",
"throws",
"GuildWars2Exception",
",",
"NullPointerException",
"{",
"isParamValid",
"(",
"new",
"ParamChecker",
"(",
"ids",
"... | For more info on Skills API go <a href="https://wiki.guildwars2.com/wiki/API:2/skills">here</a><br/>
Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions
@param ids list of skill id
@param callback callback that is goin... | [
"For",
"more",
"info",
"on",
"Skills",
"API",
"go",
"<a",
"href",
"=",
"https",
":",
"//",
"wiki",
".",
"guildwars2",
".",
"com",
"/",
"wiki",
"/",
"API",
":",
"2",
"/",
"skills",
">",
"here<",
"/",
"a",
">",
"<br",
"/",
">",
"Give",
"user",
"t... | train | https://github.com/xhsun/gw2wrapper/blob/c8a43b51f363b032074fb152ee6efe657e33e525/src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java#L2350-L2353 |
Cornutum/tcases | tcases-io/src/main/java/org/cornutum/tcases/io/SystemInputJson.java | SystemInputJson.toJson | private static JsonStructure toJson( FunctionInputDef functionInput, String varType) {
"""
Returns the JSON object that represents the function variables of the given type.
"""
JsonObjectBuilder builder = Json.createObjectBuilder();
toStream( functionInput.getVarDefs())
.filter( varDef -> varDef.... | java | private static JsonStructure toJson( FunctionInputDef functionInput, String varType)
{
JsonObjectBuilder builder = Json.createObjectBuilder();
toStream( functionInput.getVarDefs())
.filter( varDef -> varDef.getType().equals( varType))
.sorted()
.forEach( varDef -> builder.add( varDef.getNa... | [
"private",
"static",
"JsonStructure",
"toJson",
"(",
"FunctionInputDef",
"functionInput",
",",
"String",
"varType",
")",
"{",
"JsonObjectBuilder",
"builder",
"=",
"Json",
".",
"createObjectBuilder",
"(",
")",
";",
"toStream",
"(",
"functionInput",
".",
"getVarDefs",... | Returns the JSON object that represents the function variables of the given type. | [
"Returns",
"the",
"JSON",
"object",
"that",
"represents",
"the",
"function",
"variables",
"of",
"the",
"given",
"type",
"."
] | train | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-io/src/main/java/org/cornutum/tcases/io/SystemInputJson.java#L76-L85 |
gallandarakhneorg/afc | advanced/mathfx/src/main/java/org/arakhne/afc/math/geometry/d1/dfx/Tuple1dfx.java | Tuple1dfx.set | void set(ObjectProperty<WeakReference<Segment1D<?, ?>>> segment, DoubleProperty x, DoubleProperty y) {
"""
Change the x and y properties.
@param segment the new segment property.
@param x the new x property.
@param y the new y property.
"""
this.segment = segment;
this.x = x;
this.y = y;
} | java | void set(ObjectProperty<WeakReference<Segment1D<?, ?>>> segment, DoubleProperty x, DoubleProperty y) {
this.segment = segment;
this.x = x;
this.y = y;
} | [
"void",
"set",
"(",
"ObjectProperty",
"<",
"WeakReference",
"<",
"Segment1D",
"<",
"?",
",",
"?",
">",
">",
">",
"segment",
",",
"DoubleProperty",
"x",
",",
"DoubleProperty",
"y",
")",
"{",
"this",
".",
"segment",
"=",
"segment",
";",
"this",
".",
"x",... | Change the x and y properties.
@param segment the new segment property.
@param x the new x property.
@param y the new y property. | [
"Change",
"the",
"x",
"and",
"y",
"properties",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/mathfx/src/main/java/org/arakhne/afc/math/geometry/d1/dfx/Tuple1dfx.java#L256-L260 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/vpn/vpnclientlessaccesspolicy.java | vpnclientlessaccesspolicy.get | public static vpnclientlessaccesspolicy get(nitro_service service, String name) throws Exception {
"""
Use this API to fetch vpnclientlessaccesspolicy resource of given name .
"""
vpnclientlessaccesspolicy obj = new vpnclientlessaccesspolicy();
obj.set_name(name);
vpnclientlessaccesspolicy response = (vp... | java | public static vpnclientlessaccesspolicy get(nitro_service service, String name) throws Exception{
vpnclientlessaccesspolicy obj = new vpnclientlessaccesspolicy();
obj.set_name(name);
vpnclientlessaccesspolicy response = (vpnclientlessaccesspolicy) obj.get_resource(service);
return response;
} | [
"public",
"static",
"vpnclientlessaccesspolicy",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"name",
")",
"throws",
"Exception",
"{",
"vpnclientlessaccesspolicy",
"obj",
"=",
"new",
"vpnclientlessaccesspolicy",
"(",
")",
";",
"obj",
".",
"set_name",
"(",
... | Use this API to fetch vpnclientlessaccesspolicy resource of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"vpnclientlessaccesspolicy",
"resource",
"of",
"given",
"name",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/vpn/vpnclientlessaccesspolicy.java#L320-L325 |
DDTH/ddth-dao | ddth-dao-core/src/main/java/com/github/ddth/dao/nosql/lucene/BaseLuceneStorage.java | BaseLuceneStorage.doDelete | protected void doDelete(String spaceId, String key) throws IOException {
"""
Delete a document, identified by {@code spaceId:key}, from index.
@param spaceId
@param key
@throws IOException
"""
Term termDelete = buildIdTerm(spaceId, key);
IndexWriter indexWriter = getIndexWriter();
... | java | protected void doDelete(String spaceId, String key) throws IOException {
Term termDelete = buildIdTerm(spaceId, key);
IndexWriter indexWriter = getIndexWriter();
indexWriter.deleteDocuments(termDelete);
if (!isAsyncWrite()) {
indexWriter.commit();
} else if (getIndexM... | [
"protected",
"void",
"doDelete",
"(",
"String",
"spaceId",
",",
"String",
"key",
")",
"throws",
"IOException",
"{",
"Term",
"termDelete",
"=",
"buildIdTerm",
"(",
"spaceId",
",",
"key",
")",
";",
"IndexWriter",
"indexWriter",
"=",
"getIndexWriter",
"(",
")",
... | Delete a document, identified by {@code spaceId:key}, from index.
@param spaceId
@param key
@throws IOException | [
"Delete",
"a",
"document",
"identified",
"by",
"{",
"@code",
"spaceId",
":",
"key",
"}",
"from",
"index",
"."
] | train | https://github.com/DDTH/ddth-dao/blob/8d059ddf641a1629aa53851f9d1b41abf175a180/ddth-dao-core/src/main/java/com/github/ddth/dao/nosql/lucene/BaseLuceneStorage.java#L277-L286 |
GwtMaterialDesign/gwt-material-addins | src/main/java/gwt/material/design/addins/client/window/MaterialWindow.java | MaterialWindow.setDndArea | public void setDndArea(Object dndArea) {
"""
Set the area for the drag and drop, can be an {@link Element}
or a {@link String} selector.
"""
if(dndArea instanceof UIObject) {
dndArea = ((UIObject) dndArea).getElement();
}
if(dnd != null) {
dnd.draggable(JsDragOp... | java | public void setDndArea(Object dndArea) {
if(dndArea instanceof UIObject) {
dndArea = ((UIObject) dndArea).getElement();
}
if(dnd != null) {
dnd.draggable(JsDragOptions.create(new Restriction(dndArea, true, 0, 0, 1.2, 1)));
}
} | [
"public",
"void",
"setDndArea",
"(",
"Object",
"dndArea",
")",
"{",
"if",
"(",
"dndArea",
"instanceof",
"UIObject",
")",
"{",
"dndArea",
"=",
"(",
"(",
"UIObject",
")",
"dndArea",
")",
".",
"getElement",
"(",
")",
";",
"}",
"if",
"(",
"dnd",
"!=",
"n... | Set the area for the drag and drop, can be an {@link Element}
or a {@link String} selector. | [
"Set",
"the",
"area",
"for",
"the",
"drag",
"and",
"drop",
"can",
"be",
"an",
"{"
] | train | https://github.com/GwtMaterialDesign/gwt-material-addins/blob/11aec9d92918225f70f936285d0ae94f2178c36e/src/main/java/gwt/material/design/addins/client/window/MaterialWindow.java#L447-L454 |
rhuss/jolokia | agent/jvm/src/main/java/org/jolokia/jvmagent/client/command/CommandDispatcher.java | CommandDispatcher.dispatchCommand | public int dispatchCommand(Object pVm,VirtualMachineHandler pHandler) throws InvocationTargetException, NoSuchMethodException, IllegalAccessException {
"""
Dispatch the command
@param pVm the virtual machine to attach to (typeless in order avoid direct references to the sun classes)
@param pHandler handler fo... | java | public int dispatchCommand(Object pVm,VirtualMachineHandler pHandler) throws InvocationTargetException, NoSuchMethodException, IllegalAccessException {
String commandName = options.getCommand();
AbstractBaseCommand command = COMMANDS.get(commandName);
if (command == null) {
throw new... | [
"public",
"int",
"dispatchCommand",
"(",
"Object",
"pVm",
",",
"VirtualMachineHandler",
"pHandler",
")",
"throws",
"InvocationTargetException",
",",
"NoSuchMethodException",
",",
"IllegalAccessException",
"{",
"String",
"commandName",
"=",
"options",
".",
"getCommand",
... | Dispatch the command
@param pVm the virtual machine to attach to (typeless in order avoid direct references to the sun classes)
@param pHandler handler for listing processes
@return the return code (0 or 1) | [
"Dispatch",
"the",
"command"
] | train | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/jvm/src/main/java/org/jolokia/jvmagent/client/command/CommandDispatcher.java#L72-L79 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.