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
Azure/azure-sdk-for-java
servicebus/data-plane/azure-servicebus/src/main/java/com/microsoft/azure/servicebus/ClientFactory.java
ClientFactory.acceptSessionFromConnectionString
public static IMessageSession acceptSessionFromConnectionString(String amqpConnectionString, String sessionId, ReceiveMode receiveMode) throws InterruptedException, ServiceBusException { """ Accept a {@link IMessageSession} from service bus connection string with specified session id. Session Id can be null, if nu...
java
public static IMessageSession acceptSessionFromConnectionString(String amqpConnectionString, String sessionId, ReceiveMode receiveMode) throws InterruptedException, ServiceBusException { return Utils.completeFuture(acceptSessionFromConnectionStringAsync(amqpConnectionString, sessionId, receiveMode)); }
[ "public", "static", "IMessageSession", "acceptSessionFromConnectionString", "(", "String", "amqpConnectionString", ",", "String", "sessionId", ",", "ReceiveMode", "receiveMode", ")", "throws", "InterruptedException", ",", "ServiceBusException", "{", "return", "Utils", ".", ...
Accept a {@link IMessageSession} from service bus connection string with specified session id. Session Id can be null, if null, service will return the first available session. @param amqpConnectionString connection string @param sessionId session id, if null, service will return the first available session...
[ "Accept", "a", "{", "@link", "IMessageSession", "}", "from", "service", "bus", "connection", "string", "with", "specified", "session", "id", ".", "Session", "Id", "can", "be", "null", "if", "null", "service", "will", "return", "the", "first", "available", "s...
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/servicebus/data-plane/azure-servicebus/src/main/java/com/microsoft/azure/servicebus/ClientFactory.java#L499-L501
eclipse/xtext-extras
org.eclipse.xtext.common.types/src/org/eclipse/xtext/common/types/access/binary/asm/SignatureUtil.java
SignatureUtil.scanTypeBoundSignature
private static int scanTypeBoundSignature(String string, int start) { """ Scans the given string for a type bound signature starting at the given index and returns the index of the last character. <pre> TypeBoundSignature: <b>[-+]</b> TypeSignature <b>;</b> <b>*</b></b> </pre> @param string the signature ...
java
private static int scanTypeBoundSignature(String string, int start) { // need a minimum 1 char for wildcard if (start >= string.length()) { throw new IllegalArgumentException(); } char c = string.charAt(start); switch (c) { case C_STAR : return start; case C_SUPER : case C_EXTENDS : // nee...
[ "private", "static", "int", "scanTypeBoundSignature", "(", "String", "string", ",", "int", "start", ")", "{", "// need a minimum 1 char for wildcard", "if", "(", "start", ">=", "string", ".", "length", "(", ")", ")", "{", "throw", "new", "IllegalArgumentException"...
Scans the given string for a type bound signature starting at the given index and returns the index of the last character. <pre> TypeBoundSignature: <b>[-+]</b> TypeSignature <b>;</b> <b>*</b></b> </pre> @param string the signature string @param start the 0-based character index of the first character @return the 0-ba...
[ "Scans", "the", "given", "string", "for", "a", "type", "bound", "signature", "starting", "at", "the", "given", "index", "and", "returns", "the", "index", "of", "the", "last", "character", ".", "<pre", ">", "TypeBoundSignature", ":", "<b", ">", "[", "-", ...
train
https://github.com/eclipse/xtext-extras/blob/451359541295323a29f5855e633f770cec02069a/org.eclipse.xtext.common.types/src/org/eclipse/xtext/common/types/access/binary/asm/SignatureUtil.java#L416-L456
krummas/DrizzleJDBC
src/main/java/org/drizzle/jdbc/CommonDatabaseMetaData.java
CommonDatabaseMetaData.getSuperTables
public ResultSet getSuperTables(final String catalog, final String schemaPattern, final String tableNamePattern) throws SQLException { """ Retrieves a description of the table hierarchies defined in a particular schema in this database. <p/> <P>Only supertable information for tables matching the catalog, schema ...
java
public ResultSet getSuperTables(final String catalog, final String schemaPattern, final String tableNamePattern) throws SQLException { log.info("getting empty result set, get super tables"); return getEmptyResultSet(); }
[ "public", "ResultSet", "getSuperTables", "(", "final", "String", "catalog", ",", "final", "String", "schemaPattern", ",", "final", "String", "tableNamePattern", ")", "throws", "SQLException", "{", "log", ".", "info", "(", "\"getting empty result set, get super tables\""...
Retrieves a description of the table hierarchies defined in a particular schema in this database. <p/> <P>Only supertable information for tables matching the catalog, schema and table name are returned. The table name parameter may be a fully- qualified name, in which case, the catalog and schemaPattern parameters are ...
[ "Retrieves", "a", "description", "of", "the", "table", "hierarchies", "defined", "in", "a", "particular", "schema", "in", "this", "database", ".", "<p", "/", ">", "<P", ">", "Only", "supertable", "information", "for", "tables", "matching", "the", "catalog", ...
train
https://github.com/krummas/DrizzleJDBC/blob/716f31fd71f3cc289edf69844d8117deb86d98d6/src/main/java/org/drizzle/jdbc/CommonDatabaseMetaData.java#L2329-L2332
google/error-prone-javac
src/jdk.compiler/share/classes/com/sun/source/util/SimpleDocTreeVisitor.java
SimpleDocTreeVisitor.visitAuthor
@Override public R visitAuthor(AuthorTree node, P p) { """ {@inheritDoc} This implementation calls {@code defaultAction}. @param node {@inheritDoc} @param p {@inheritDoc} @return the result of {@code defaultAction} """ return defaultAction(node, p); }
java
@Override public R visitAuthor(AuthorTree node, P p) { return defaultAction(node, p); }
[ "@", "Override", "public", "R", "visitAuthor", "(", "AuthorTree", "node", ",", "P", "p", ")", "{", "return", "defaultAction", "(", "node", ",", "p", ")", ";", "}" ]
{@inheritDoc} This implementation calls {@code defaultAction}. @param node {@inheritDoc} @param p {@inheritDoc} @return the result of {@code defaultAction}
[ "{", "@inheritDoc", "}", "This", "implementation", "calls", "{", "@code", "defaultAction", "}", "." ]
train
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/source/util/SimpleDocTreeVisitor.java#L117-L120
jbundle/jbundle
base/screen/model/src/main/java/org/jbundle/base/screen/model/ScreenField.java
ScreenField.setSFieldValue
public int setSFieldValue(String strParamValue, boolean bDisplayOption, int iMoveMode) { """ Set this control's converter to this HTML param. @param strParamValue The value to set the field to. @return The error code. """ if (this.getConverter() != null) return this.getConverter().setStri...
java
public int setSFieldValue(String strParamValue, boolean bDisplayOption, int iMoveMode) { if (this.getConverter() != null) return this.getConverter().setString(strParamValue, bDisplayOption, iMoveMode); else return Constant.NORMAL_RETURN; }
[ "public", "int", "setSFieldValue", "(", "String", "strParamValue", ",", "boolean", "bDisplayOption", ",", "int", "iMoveMode", ")", "{", "if", "(", "this", ".", "getConverter", "(", ")", "!=", "null", ")", "return", "this", ".", "getConverter", "(", ")", "....
Set this control's converter to this HTML param. @param strParamValue The value to set the field to. @return The error code.
[ "Set", "this", "control", "s", "converter", "to", "this", "HTML", "param", "." ]
train
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/screen/model/src/main/java/org/jbundle/base/screen/model/ScreenField.java#L595-L601
OpenLiberty/open-liberty
dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/metadata/ejb/EJBMDOrchestrator.java
EJBMDOrchestrator.getWrapperProxyClassLoader
private ClassLoader getWrapperProxyClassLoader(BeanMetaData bmd, Class<?> intf) // F58064 throws EJBConfigurationException { """ Returns a class loader that can be used to define a proxy for the specified interface. @param bmd the bean metadata @param intf the interface to proxy @return t...
java
private ClassLoader getWrapperProxyClassLoader(BeanMetaData bmd, Class<?> intf) // F58064 throws EJBConfigurationException { // Wrapper proxies are intended to support application restart scenarios. // In order to allow GC of the target EJB class loader when the // applicatio...
[ "private", "ClassLoader", "getWrapperProxyClassLoader", "(", "BeanMetaData", "bmd", ",", "Class", "<", "?", ">", "intf", ")", "// F58064", "throws", "EJBConfigurationException", "{", "// Wrapper proxies are intended to support application restart scenarios.", "// In order to allo...
Returns a class loader that can be used to define a proxy for the specified interface. @param bmd the bean metadata @param intf the interface to proxy @return the loader @throws EJBConfigurationException
[ "Returns", "a", "class", "loader", "that", "can", "be", "used", "to", "define", "a", "proxy", "for", "the", "specified", "interface", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/metadata/ejb/EJBMDOrchestrator.java#L4453-L4495
Azure/azure-sdk-for-java
automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/WebhooksInner.java
WebhooksInner.listByAutomationAccountAsync
public Observable<Page<WebhookInner>> listByAutomationAccountAsync(final String resourceGroupName, final String automationAccountName, final String filter) { """ Retrieve a list of webhooks. @param resourceGroupName Name of an Azure Resource group. @param automationAccountName The name of the automation accoun...
java
public Observable<Page<WebhookInner>> listByAutomationAccountAsync(final String resourceGroupName, final String automationAccountName, final String filter) { return listByAutomationAccountWithServiceResponseAsync(resourceGroupName, automationAccountName, filter) .map(new Func1<ServiceResponse<Page<W...
[ "public", "Observable", "<", "Page", "<", "WebhookInner", ">", ">", "listByAutomationAccountAsync", "(", "final", "String", "resourceGroupName", ",", "final", "String", "automationAccountName", ",", "final", "String", "filter", ")", "{", "return", "listByAutomationAcc...
Retrieve a list of webhooks. @param resourceGroupName Name of an Azure Resource group. @param automationAccountName The name of the automation account. @param filter The filter to apply on the operation. @throws IllegalArgumentException thrown if parameters fail the validation @return the observable to the PagedList&l...
[ "Retrieve", "a", "list", "of", "webhooks", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/WebhooksInner.java#L729-L737
DataSketches/sketches-core
src/main/java/com/yahoo/sketches/quantiles/ItemsPmfCdfImpl.java
ItemsPmfCdfImpl.internalBuildHistogram
@SuppressWarnings("unchecked") private static <T> double[] internalBuildHistogram(final T[] splitPoints, final ItemsSketch<T> sketch) { """ Shared algorithm for both PMF and CDF functions. The splitPoints must be unique, monotonically increasing values. @param <T> the data type @param splitPoints an array of ...
java
@SuppressWarnings("unchecked") private static <T> double[] internalBuildHistogram(final T[] splitPoints, final ItemsSketch<T> sketch) { final Object[] samples = sketch.getCombinedBuffer(); final int bbCount = sketch.getBaseBufferCount(); ItemsUtil.validateValues(splitPoints, sketch.getComparator()); ...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "private", "static", "<", "T", ">", "double", "[", "]", "internalBuildHistogram", "(", "final", "T", "[", "]", "splitPoints", ",", "final", "ItemsSketch", "<", "T", ">", "sketch", ")", "{", "final", "Obje...
Shared algorithm for both PMF and CDF functions. The splitPoints must be unique, monotonically increasing values. @param <T> the data type @param splitPoints an array of <i>m</i> unique, monotonically increasing values that divide the ordered domain into <i>m+1</i> consecutive disjoint intervals. @param sketch the give...
[ "Shared", "algorithm", "for", "both", "PMF", "and", "CDF", "functions", ".", "The", "splitPoints", "must", "be", "unique", "monotonically", "increasing", "values", "." ]
train
https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/quantiles/ItemsPmfCdfImpl.java#L39-L74
phax/ph-schedule
ph-mini-quartz/src/main/java/com/helger/quartz/impl/DirectSchedulerFactory.java
DirectSchedulerFactory.createScheduler
public void createScheduler (final IThreadPool threadPool, final IJobStore jobStore) throws SchedulerException { """ Creates a scheduler using the specified thread pool and job store. This scheduler can be retrieved via {@link DirectSchedulerFactory#getScheduler()} @param threadPool The thread pool for execu...
java
public void createScheduler (final IThreadPool threadPool, final IJobStore jobStore) throws SchedulerException { createScheduler (DEFAULT_SCHEDULER_NAME, DEFAULT_INSTANCE_ID, threadPool, jobStore); }
[ "public", "void", "createScheduler", "(", "final", "IThreadPool", "threadPool", ",", "final", "IJobStore", "jobStore", ")", "throws", "SchedulerException", "{", "createScheduler", "(", "DEFAULT_SCHEDULER_NAME", ",", "DEFAULT_INSTANCE_ID", ",", "threadPool", ",", "jobSto...
Creates a scheduler using the specified thread pool and job store. This scheduler can be retrieved via {@link DirectSchedulerFactory#getScheduler()} @param threadPool The thread pool for executing jobs @param jobStore The type of job store @throws SchedulerException if initialization failed
[ "Creates", "a", "scheduler", "using", "the", "specified", "thread", "pool", "and", "job", "store", ".", "This", "scheduler", "can", "be", "retrieved", "via", "{", "@link", "DirectSchedulerFactory#getScheduler", "()", "}" ]
train
https://github.com/phax/ph-schedule/blob/b000790b46a9f8d23ad44cc20591f753d07c0229/ph-mini-quartz/src/main/java/com/helger/quartz/impl/DirectSchedulerFactory.java#L160-L163
JM-Lab/utils-java9
src/main/java/kr/jm/utils/HttpRequester.java
HttpRequester.getResponseAsString
public static String getResponseAsString(String uri, String charsetName) { """ Gets response as string. @param uri the uri @param charsetName the charset name @return the response as string """ return request(new HttpGet(uri), charsetName); }
java
public static String getResponseAsString(String uri, String charsetName) { return request(new HttpGet(uri), charsetName); }
[ "public", "static", "String", "getResponseAsString", "(", "String", "uri", ",", "String", "charsetName", ")", "{", "return", "request", "(", "new", "HttpGet", "(", "uri", ")", ",", "charsetName", ")", ";", "}" ]
Gets response as string. @param uri the uri @param charsetName the charset name @return the response as string
[ "Gets", "response", "as", "string", "." ]
train
https://github.com/JM-Lab/utils-java9/blob/ee80235b2760396a616cf7563cbdc98d4affe8e1/src/main/java/kr/jm/utils/HttpRequester.java#L76-L78
JRebirth/JRebirth
org.jrebirth.af/component/src/main/java/org/jrebirth/af/component/ui/stack/StackModel.java
StackModel.doShowPageEnum
public void doShowPageEnum(final PageEnum pageEnum, final Wave wave) { """ Show page. Called when model received a SHOW_PAGE wave type. @param pageEnum the page enum for the model to show @param wave the wave """ LOGGER.info("Show Page Enum: " + pageEnum.toString()); if (getPageEnumClas...
java
public void doShowPageEnum(final PageEnum pageEnum, final Wave wave) { LOGGER.info("Show Page Enum: " + pageEnum.toString()); if (getPageEnumClass() != null && getPageEnumClass().equals(pageEnum.getClass())) { showPage(pageEnum.getModelKey(), wave); } }
[ "public", "void", "doShowPageEnum", "(", "final", "PageEnum", "pageEnum", ",", "final", "Wave", "wave", ")", "{", "LOGGER", ".", "info", "(", "\"Show Page Enum: \"", "+", "pageEnum", ".", "toString", "(", ")", ")", ";", "if", "(", "getPageEnumClass", "(", ...
Show page. Called when model received a SHOW_PAGE wave type. @param pageEnum the page enum for the model to show @param wave the wave
[ "Show", "page", "." ]
train
https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/component/src/main/java/org/jrebirth/af/component/ui/stack/StackModel.java#L89-L95
samskivert/samskivert
src/main/java/com/samskivert/swing/util/SwingUtil.java
SwingUtil.createPointComparator
public static <P extends Point2D> Comparator<P> createPointComparator (final P origin) { """ Create a comparator that compares against the distance from the specified point. Note: The comparator will continue to sort by distance from the origin point, even if the origin point's coordinates are modified after t...
java
public static <P extends Point2D> Comparator<P> createPointComparator (final P origin) { return new Comparator<P>() { public int compare (P p1, P p2) { double dist1 = origin.distance(p1); double dist2 = origin.distance(p2); return (dist...
[ "public", "static", "<", "P", "extends", "Point2D", ">", "Comparator", "<", "P", ">", "createPointComparator", "(", "final", "P", "origin", ")", "{", "return", "new", "Comparator", "<", "P", ">", "(", ")", "{", "public", "int", "compare", "(", "P", "p1...
Create a comparator that compares against the distance from the specified point. Note: The comparator will continue to sort by distance from the origin point, even if the origin point's coordinates are modified after the comparator is created. Used by positionRect().
[ "Create", "a", "comparator", "that", "compares", "against", "the", "distance", "from", "the", "specified", "point", "." ]
train
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/swing/util/SwingUtil.java#L232-L242
alkacon/opencms-core
src-setup/org/opencms/setup/db/update6to7/CmsUpdateDBUpdateOU.java
CmsUpdateDBUpdateOU.findOUColumn
protected boolean findOUColumn(CmsSetupDb dbCon, String table, String ouColumn) { """ Checks if the column USER_OU is found in the resultset.<p> @param dbCon the db connection interface @param table the table to check @param ouColumn the type of OU to find (e.g. USER_OU or GROUP_OU) @return true if the col...
java
protected boolean findOUColumn(CmsSetupDb dbCon, String table, String ouColumn) { System.out.println(new Exception().getStackTrace()[0].toString()); return dbCon.hasTableOrColumn(table, ouColumn); }
[ "protected", "boolean", "findOUColumn", "(", "CmsSetupDb", "dbCon", ",", "String", "table", ",", "String", "ouColumn", ")", "{", "System", ".", "out", ".", "println", "(", "new", "Exception", "(", ")", ".", "getStackTrace", "(", ")", "[", "0", "]", ".", ...
Checks if the column USER_OU is found in the resultset.<p> @param dbCon the db connection interface @param table the table to check @param ouColumn the type of OU to find (e.g. USER_OU or GROUP_OU) @return true if the column is in the result set, false if not
[ "Checks", "if", "the", "column", "USER_OU", "is", "found", "in", "the", "resultset", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-setup/org/opencms/setup/db/update6to7/CmsUpdateDBUpdateOU.java#L109-L113
baidubce/bce-sdk-java
src/main/java/com/baidubce/services/media/MediaClient.java
MediaClient.getJob
@Deprecated public GetJobResponse getJob(GetJobRequest request) { """ Retrieve the status of a job. @param request The request object containing all options for retrieving job status. @return The status of a job. @deprecated As of release 0.8.5, replaced by {@link #getTranscodingJob(GetTranscodingJobReq...
java
@Deprecated public GetJobResponse getJob(GetJobRequest request) { checkNotNull(request, "The parameter request should NOT be null."); checkStringNotEmpty(request.getJobId(), "The parameter jobId should NOT be null or empty string."); InternalRequest internalRequest = createRequest(HttpMethod...
[ "@", "Deprecated", "public", "GetJobResponse", "getJob", "(", "GetJobRequest", "request", ")", "{", "checkNotNull", "(", "request", ",", "\"The parameter request should NOT be null.\"", ")", ";", "checkStringNotEmpty", "(", "request", ".", "getJobId", "(", ")", ",", ...
Retrieve the status of a job. @param request The request object containing all options for retrieving job status. @return The status of a job. @deprecated As of release 0.8.5, replaced by {@link #getTranscodingJob(GetTranscodingJobRequest)}
[ "Retrieve", "the", "status", "of", "a", "job", "." ]
train
https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/media/MediaClient.java#L281-L288
apache/spark
sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/UnsafeRow.java
UnsafeRow.writeToStream
public void writeToStream(OutputStream out, byte[] writeBuffer) throws IOException { """ Write this UnsafeRow's underlying bytes to the given OutputStream. @param out the stream to write to. @param writeBuffer a byte array for buffering chunks of off-heap data while writing to the output stream. If this row i...
java
public void writeToStream(OutputStream out, byte[] writeBuffer) throws IOException { if (baseObject instanceof byte[]) { int offsetInByteArray = (int) (baseOffset - Platform.BYTE_ARRAY_OFFSET); out.write((byte[]) baseObject, offsetInByteArray, sizeInBytes); }
[ "public", "void", "writeToStream", "(", "OutputStream", "out", ",", "byte", "[", "]", "writeBuffer", ")", "throws", "IOException", "{", "if", "(", "baseObject", "instanceof", "byte", "[", "]", ")", "{", "int", "offsetInByteArray", "=", "(", "int", ")", "("...
Write this UnsafeRow's underlying bytes to the given OutputStream. @param out the stream to write to. @param writeBuffer a byte array for buffering chunks of off-heap data while writing to the output stream. If this row is backed by an on-heap byte array, then this buffer will not be used and may be null.
[ "Write", "this", "UnsafeRow", "s", "underlying", "bytes", "to", "the", "given", "OutputStream", "." ]
train
https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/UnsafeRow.java#L506-L510
lodborg/interval-tree
src/main/java/com/lodborg/intervaltree/Interval.java
Interval.isLeftOf
public boolean isLeftOf(T point, boolean inclusive) { """ This method checks, if this current interval is entirely to the left of a point. More formally, the method will return {@code true}, if for every point {@code x} from the current interval the inequality {@code x} &lt; {@code point} holds. If the parameter...
java
public boolean isLeftOf(T point, boolean inclusive){ if (point == null || end == null) return false; int compare = point.compareTo(end); if (compare != 0) return compare > 0; return !isEndInclusive() || !inclusive; }
[ "public", "boolean", "isLeftOf", "(", "T", "point", ",", "boolean", "inclusive", ")", "{", "if", "(", "point", "==", "null", "||", "end", "==", "null", ")", "return", "false", ";", "int", "compare", "=", "point", ".", "compareTo", "(", "end", ")", ";...
This method checks, if this current interval is entirely to the left of a point. More formally, the method will return {@code true}, if for every point {@code x} from the current interval the inequality {@code x} &lt; {@code point} holds. If the parameter {@code inclusive} is set to {@code false}, this method will retu...
[ "This", "method", "checks", "if", "this", "current", "interval", "is", "entirely", "to", "the", "left", "of", "a", "point", ".", "More", "formally", "the", "method", "will", "return", "{", "@code", "true", "}", "if", "for", "every", "point", "{", "@code"...
train
https://github.com/lodborg/interval-tree/blob/716b18fb0a5a53c9add9926176bc263f14c9bf90/src/main/java/com/lodborg/intervaltree/Interval.java#L434-L441
dihedron/dihedron-commons
src/main/java/org/dihedron/core/reflection/Types.java
Types.isOfSuperClassOf
public static boolean isOfSuperClassOf(Object object, Class<?> clazz) { """ Returns whether the given object is an instance of a superclass of the given class, that is if it can be cast to the given class. @param object the object being tested. @param clazz the class to check. @return whether the object u...
java
public static boolean isOfSuperClassOf(Object object, Class<?> clazz) { if(object == null || clazz == null) { return false; } return object.getClass().isAssignableFrom(clazz); }
[ "public", "static", "boolean", "isOfSuperClassOf", "(", "Object", "object", ",", "Class", "<", "?", ">", "clazz", ")", "{", "if", "(", "object", "==", "null", "||", "clazz", "==", "null", ")", "{", "return", "false", ";", "}", "return", "object", ".", ...
Returns whether the given object is an instance of a superclass of the given class, that is if it can be cast to the given class. @param object the object being tested. @param clazz the class to check. @return whether the object under inspection can be cast to the given class.
[ "Returns", "whether", "the", "given", "object", "is", "an", "instance", "of", "a", "superclass", "of", "the", "given", "class", "that", "is", "if", "it", "can", "be", "cast", "to", "the", "given", "class", "." ]
train
https://github.com/dihedron/dihedron-commons/blob/a5194cdaa0d6417ef4aade6ea407a1cad6e8458e/src/main/java/org/dihedron/core/reflection/Types.java#L244-L249
alkacon/opencms-core
src/org/opencms/ade/galleries/CmsGalleryService.java
CmsGalleryService.hasNavigationProperty
private boolean hasNavigationProperty(CmsObject cms, CmsResource resource) throws CmsException { """ Checks whether a resource has a navigation property.<p> @param cms the current CMS context @param resource the resource to use @return true if the resource has a navigation property @throws CmsException i...
java
private boolean hasNavigationProperty(CmsObject cms, CmsResource resource) throws CmsException { List<CmsProperty> props = cms.readPropertyObjects(resource, false); Map<String, String> propMap = CmsProperty.toMap(props); return propMap.containsKey(CmsPropertyDefinition.PROPERTY_NAVPOS) ...
[ "private", "boolean", "hasNavigationProperty", "(", "CmsObject", "cms", ",", "CmsResource", "resource", ")", "throws", "CmsException", "{", "List", "<", "CmsProperty", ">", "props", "=", "cms", ".", "readPropertyObjects", "(", "resource", ",", "false", ")", ";",...
Checks whether a resource has a navigation property.<p> @param cms the current CMS context @param resource the resource to use @return true if the resource has a navigation property @throws CmsException if something goes wrong
[ "Checks", "whether", "a", "resource", "has", "a", "navigation", "property", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ade/galleries/CmsGalleryService.java#L2654-L2660
fhoeben/hsac-fitnesse-fixtures
src/main/java/nl/hsac/fitnesse/junit/HsacFitNesseRunner.java
HsacFitNesseRunner.configureSeleniumIfNeeded
protected boolean configureSeleniumIfNeeded() { """ Determines whether system properties should override Selenium configuration in wiki. If so Selenium will be configured according to property values, and locked so that wiki pages no longer control Selenium setup. @return true if Selenium was configured. ""...
java
protected boolean configureSeleniumIfNeeded() { setSeleniumDefaultTimeOut(); try { DriverFactory factory = null; SeleniumDriverFactoryFactory factoryFactory = getSeleniumDriverFactoryFactory(); if (factoryFactory != null) { factory = factoryFactory.get...
[ "protected", "boolean", "configureSeleniumIfNeeded", "(", ")", "{", "setSeleniumDefaultTimeOut", "(", ")", ";", "try", "{", "DriverFactory", "factory", "=", "null", ";", "SeleniumDriverFactoryFactory", "factoryFactory", "=", "getSeleniumDriverFactoryFactory", "(", ")", ...
Determines whether system properties should override Selenium configuration in wiki. If so Selenium will be configured according to property values, and locked so that wiki pages no longer control Selenium setup. @return true if Selenium was configured.
[ "Determines", "whether", "system", "properties", "should", "override", "Selenium", "configuration", "in", "wiki", ".", "If", "so", "Selenium", "will", "be", "configured", "according", "to", "property", "values", "and", "locked", "so", "that", "wiki", "pages", "n...
train
https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/junit/HsacFitNesseRunner.java#L304-L322
kaazing/gateway
util/src/main/java/org/kaazing/gateway/util/aws/AwsUtils.java
AwsUtils.getSecurityGroupName
public static String getSecurityGroupName() throws IOException { """ Returns the name of the security group from the list that is obtained from the resource vendor. An instance may belong to multiple security groups. And, the list of security groups obtained from the vendor may not be ordered. If the vendor sup...
java
public static String getSecurityGroupName() throws IOException { // For AWS, we are returning the first security group from the list // that is obtained by querying the meta-data. String url = getMetadataUrl() + "/security-groups"; String groups = invokeUrl(url); if ((groups ==...
[ "public", "static", "String", "getSecurityGroupName", "(", ")", "throws", "IOException", "{", "// For AWS, we are returning the first security group from the list", "// that is obtained by querying the meta-data.", "String", "url", "=", "getMetadataUrl", "(", ")", "+", "\"/securi...
Returns the name of the security group from the list that is obtained from the resource vendor. An instance may belong to multiple security groups. And, the list of security groups obtained from the vendor may not be ordered. If the vendor supports the notion of a default security group, then that should be returned. O...
[ "Returns", "the", "name", "of", "the", "security", "group", "from", "the", "list", "that", "is", "obtained", "from", "the", "resource", "vendor", ".", "An", "instance", "may", "belong", "to", "multiple", "security", "groups", ".", "And", "the", "list", "of...
train
https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/util/src/main/java/org/kaazing/gateway/util/aws/AwsUtils.java#L125-L139
jronrun/benayn
benayn-ustyle/src/main/java/com/benayn/ustyle/thirdparty/Uris.java
Uris.newUri
public static URI newUri(final String url, final boolean strict) throws URISyntaxException { """ Returns a normalized java.net.URI based off the given string url. You should use this function instead of "new URI(String)" - because this one handles escaping and normalization correctly. @param url the string to...
java
public static URI newUri(final String url, final boolean strict) throws URISyntaxException { /* * Java's parsing thinks that the host is the scheme if there isn't a scheme. Add the default if there is * no scheme yet */ checkNotNull(Strings.emptyToNull(url), "Cannot create U...
[ "public", "static", "URI", "newUri", "(", "final", "String", "url", ",", "final", "boolean", "strict", ")", "throws", "URISyntaxException", "{", "/* \n * Java's parsing thinks that the host is the scheme if there isn't a scheme. Add the default if there is\n * no sch...
Returns a normalized java.net.URI based off the given string url. You should use this function instead of "new URI(String)" - because this one handles escaping and normalization correctly. @param url the string to parse @param strict whether or not to perform strict escaping. (defaults to false) @return the parsed, n...
[ "Returns", "a", "normalized", "java", ".", "net", ".", "URI", "based", "off", "the", "given", "string", "url", ".", "You", "should", "use", "this", "function", "instead", "of", "new", "URI", "(", "String", ")", "-", "because", "this", "one", "handles", ...
train
https://github.com/jronrun/benayn/blob/7585152e10e4cac07b4274c65f1c72ad7061ae69/benayn-ustyle/src/main/java/com/benayn/ustyle/thirdparty/Uris.java#L490-L502
twitter/hraven
hraven-etl/src/main/java/com/twitter/hraven/etl/JobFileProcessor.java
JobFileProcessor.runJobs
private boolean runJobs(int threadCount, List<JobRunner> jobRunners) throws InterruptedException, ExecutionException { """ Run the jobs and wait for all of them to complete. @param threadCount up to how many jobs to run in parallel @param jobRunners the list of jobs to run. @return whether all jobs comp...
java
private boolean runJobs(int threadCount, List<JobRunner> jobRunners) throws InterruptedException, ExecutionException { ExecutorService execSvc = Executors.newFixedThreadPool(threadCount); if ((jobRunners == null) || (jobRunners.size() == 0)) { return true; } boolean success = true; try...
[ "private", "boolean", "runJobs", "(", "int", "threadCount", ",", "List", "<", "JobRunner", ">", "jobRunners", ")", "throws", "InterruptedException", ",", "ExecutionException", "{", "ExecutorService", "execSvc", "=", "Executors", ".", "newFixedThreadPool", "(", "thre...
Run the jobs and wait for all of them to complete. @param threadCount up to how many jobs to run in parallel @param jobRunners the list of jobs to run. @return whether all jobs completed successfully or not. @throws InterruptedException when interrupted while running jobs. @throws ExecutionException when at least one ...
[ "Run", "the", "jobs", "and", "wait", "for", "all", "of", "them", "to", "complete", "." ]
train
https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-etl/src/main/java/com/twitter/hraven/etl/JobFileProcessor.java#L450-L486
jeremylong/DependencyCheck
core/src/main/java/org/owasp/dependencycheck/analyzer/DependencyBundlingAnalyzer.java
DependencyBundlingAnalyzer.fileNameMatch
private boolean fileNameMatch(Dependency dependency1, Dependency dependency2) { """ Returns true if the file names (and version if it exists) of the two dependencies are sufficiently similar. @param dependency1 a dependency2 to compare @param dependency2 a dependency2 to compare @return true if the identifie...
java
private boolean fileNameMatch(Dependency dependency1, Dependency dependency2) { if (dependency1 == null || dependency1.getFileName() == null || dependency2 == null || dependency2.getFileName() == null) { return false; } final String fileName1 = dependency1.getActualFi...
[ "private", "boolean", "fileNameMatch", "(", "Dependency", "dependency1", ",", "Dependency", "dependency2", ")", "{", "if", "(", "dependency1", "==", "null", "||", "dependency1", ".", "getFileName", "(", ")", "==", "null", "||", "dependency2", "==", "null", "||...
Returns true if the file names (and version if it exists) of the two dependencies are sufficiently similar. @param dependency1 a dependency2 to compare @param dependency2 a dependency2 to compare @return true if the identifiers in the two supplied dependencies are equal
[ "Returns", "true", "if", "the", "file", "names", "(", "and", "version", "if", "it", "exists", ")", "of", "the", "two", "dependencies", "are", "sufficiently", "similar", "." ]
train
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/analyzer/DependencyBundlingAnalyzer.java#L224-L247
elki-project/elki
elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/correlation/HiCO.java
HiCO.correlationDistance
public int correlationDistance(PCAFilteredResult pca1, PCAFilteredResult pca2, int dimensionality) { """ Computes the correlation distance between the two subspaces defined by the specified PCAs. @param pca1 first PCA @param pca2 second PCA @param dimensionality the dimensionality of the data space @return ...
java
public int correlationDistance(PCAFilteredResult pca1, PCAFilteredResult pca2, int dimensionality) { // TODO: Can we delay copying the matrixes? // pca of rv1 double[][] v1t = copy(pca1.getEigenvectors()); double[][] v1t_strong = pca1.getStrongEigenvectors(); int lambda1 = pca1.getCorrelationDimensi...
[ "public", "int", "correlationDistance", "(", "PCAFilteredResult", "pca1", ",", "PCAFilteredResult", "pca2", ",", "int", "dimensionality", ")", "{", "// TODO: Can we delay copying the matrixes?", "// pca of rv1", "double", "[", "]", "[", "]", "v1t", "=", "copy", "(", ...
Computes the correlation distance between the two subspaces defined by the specified PCAs. @param pca1 first PCA @param pca2 second PCA @param dimensionality the dimensionality of the data space @return the correlation distance between the two subspaces defined by the specified PCAs
[ "Computes", "the", "correlation", "distance", "between", "the", "two", "subspaces", "defined", "by", "the", "specified", "PCAs", "." ]
train
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/correlation/HiCO.java#L302-L352
maddingo/sojo
src/main/java/net/sf/sojo/core/filter/ClassPropertyFilterHelper.java
ClassPropertyFilterHelper.isPropertyToFiltering
public static boolean isPropertyToFiltering (ClassPropertyFilterHandler pvClassPropertyFilterHandler, Class<?> pvClassForFindFilter, Object pvKey) { """ Check a property from a class by a handler. @param pvClassPropertyFilterHandler The handler implementation. @param pvClassForFindFilter The class for the filt...
java
public static boolean isPropertyToFiltering (ClassPropertyFilterHandler pvClassPropertyFilterHandler, Class<?> pvClassForFindFilter, Object pvKey) { boolean lvAddProperty = false; if (pvClassPropertyFilterHandler != null) { ClassPropertyFilter lvClassPropertyFilter = pvClassPropertyFilterHandler.getClassPrope...
[ "public", "static", "boolean", "isPropertyToFiltering", "(", "ClassPropertyFilterHandler", "pvClassPropertyFilterHandler", ",", "Class", "<", "?", ">", "pvClassForFindFilter", ",", "Object", "pvKey", ")", "{", "boolean", "lvAddProperty", "=", "false", ";", "if", "(", ...
Check a property from a class by a handler. @param pvClassPropertyFilterHandler The handler implementation. @param pvClassForFindFilter The class for the filter. @param pvKey The to filtering property. @return <code>true</code>, if the property from the class is known by the handler, else <code>false</code>.
[ "Check", "a", "property", "from", "a", "class", "by", "a", "handler", "." ]
train
https://github.com/maddingo/sojo/blob/99e9e0a146b502deb7f507fe0623227402ed675b/src/main/java/net/sf/sojo/core/filter/ClassPropertyFilterHelper.java#L37-L47
google/closure-templates
java/src/com/google/template/soy/jssrc/internal/JsRuntime.java
JsRuntime.extensionField
public static Expression extensionField(FieldDescriptor desc) { """ Returns the field containing the extension object for the given field descriptor. """ String jsExtensionImport = ProtoUtils.getJsExtensionImport(desc); String jsExtensionName = ProtoUtils.getJsExtensionName(desc); return symbolWith...
java
public static Expression extensionField(FieldDescriptor desc) { String jsExtensionImport = ProtoUtils.getJsExtensionImport(desc); String jsExtensionName = ProtoUtils.getJsExtensionName(desc); return symbolWithNamespace(jsExtensionImport, jsExtensionName); }
[ "public", "static", "Expression", "extensionField", "(", "FieldDescriptor", "desc", ")", "{", "String", "jsExtensionImport", "=", "ProtoUtils", ".", "getJsExtensionImport", "(", "desc", ")", ";", "String", "jsExtensionName", "=", "ProtoUtils", ".", "getJsExtensionName...
Returns the field containing the extension object for the given field descriptor.
[ "Returns", "the", "field", "containing", "the", "extension", "object", "for", "the", "given", "field", "descriptor", "." ]
train
https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/jssrc/internal/JsRuntime.java#L179-L183
google/truth
core/src/main/java/com/google/common/truth/MultimapSubject.java
MultimapSubject.containsAtLeast
@CanIgnoreReturnValue public Ordered containsAtLeast(@NullableDecl Object k0, @NullableDecl Object v0, Object... rest) { """ Fails if the multimap does not contain at least the given key/value pairs. <p><b>Warning:</b> the use of varargs means that we cannot guarantee an equal number of key/value pairs at co...
java
@CanIgnoreReturnValue public Ordered containsAtLeast(@NullableDecl Object k0, @NullableDecl Object v0, Object... rest) { return containsAtLeastEntriesIn(accumulateMultimap(k0, v0, rest)); }
[ "@", "CanIgnoreReturnValue", "public", "Ordered", "containsAtLeast", "(", "@", "NullableDecl", "Object", "k0", ",", "@", "NullableDecl", "Object", "v0", ",", "Object", "...", "rest", ")", "{", "return", "containsAtLeastEntriesIn", "(", "accumulateMultimap", "(", "...
Fails if the multimap does not contain at least the given key/value pairs. <p><b>Warning:</b> the use of varargs means that we cannot guarantee an equal number of key/value pairs at compile time. Please make sure you provide varargs in key/value pairs!
[ "Fails", "if", "the", "multimap", "does", "not", "contain", "at", "least", "the", "given", "key", "/", "value", "pairs", "." ]
train
https://github.com/google/truth/blob/60eceffd2e8c3297655d33ed87d965cf5af51108/core/src/main/java/com/google/common/truth/MultimapSubject.java#L307-L310
google/closure-compiler
src/com/google/javascript/jscomp/OptimizeParameters.java
OptimizeParameters.eliminateCallTargetArgAt
private void eliminateCallTargetArgAt(Node ref, int argIndex) { """ Eliminates the parameter from a function call. @param definitionFinder The definition and use sites index. @param p @param call The function call node @param argIndex The index of the argument to remove. """ Node callArgNode = Referenc...
java
private void eliminateCallTargetArgAt(Node ref, int argIndex) { Node callArgNode = ReferenceMap.getArgumentForCallOrNewOrDotCall(ref, argIndex); if (callArgNode != null) { NodeUtil.deleteNode(callArgNode, compiler); } }
[ "private", "void", "eliminateCallTargetArgAt", "(", "Node", "ref", ",", "int", "argIndex", ")", "{", "Node", "callArgNode", "=", "ReferenceMap", ".", "getArgumentForCallOrNewOrDotCall", "(", "ref", ",", "argIndex", ")", ";", "if", "(", "callArgNode", "!=", "null...
Eliminates the parameter from a function call. @param definitionFinder The definition and use sites index. @param p @param call The function call node @param argIndex The index of the argument to remove.
[ "Eliminates", "the", "parameter", "from", "a", "function", "call", "." ]
train
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/OptimizeParameters.java#L975-L980
nohana/Amalgam
amalgam/src/main/java/com/amalgam/graphics/BitmapUtils.java
BitmapUtils.storeAsFile
public static boolean storeAsFile(Bitmap bitmap, File file, Bitmap.CompressFormat format, int quality) { """ Store the bitmap as a file. @param bitmap to store. @param format bitmap format. @param quality the quality of the compressed bitmap. @return the compressed bitmap file. """ OutputStream out...
java
public static boolean storeAsFile(Bitmap bitmap, File file, Bitmap.CompressFormat format, int quality) { OutputStream out = null; try { out = new BufferedOutputStream(new FileOutputStream(file)); return bitmap.compress(format, quality, out); } catch (FileNotFoundException...
[ "public", "static", "boolean", "storeAsFile", "(", "Bitmap", "bitmap", ",", "File", "file", ",", "Bitmap", ".", "CompressFormat", "format", ",", "int", "quality", ")", "{", "OutputStream", "out", "=", "null", ";", "try", "{", "out", "=", "new", "BufferedOu...
Store the bitmap as a file. @param bitmap to store. @param format bitmap format. @param quality the quality of the compressed bitmap. @return the compressed bitmap file.
[ "Store", "the", "bitmap", "as", "a", "file", "." ]
train
https://github.com/nohana/Amalgam/blob/57809ddbfe7897e979cf507982ce0b3aa5e0ed8a/amalgam/src/main/java/com/amalgam/graphics/BitmapUtils.java#L289-L300
OpenLiberty/open-liberty
dev/com.ibm.ws.config/src/com/ibm/ws/config/xml/internal/ConfigValidator.java
ConfigValidator.getAttributeDefinition
private ExtendedAttributeDefinition getAttributeDefinition(RegistryEntry registryEntry, String attributeName) { """ Answer the definition of an attribute. Answer null if a definition is not available. @param registryEntry The registry entry from which to retrieve the attribute definition. @param attributeName...
java
private ExtendedAttributeDefinition getAttributeDefinition(RegistryEntry registryEntry, String attributeName) { if (registryEntry == null) { return null; } ExtendedObjectClassDefinition definition = registryEntry.getObjectClassDefinition(); if (definition == null) { ...
[ "private", "ExtendedAttributeDefinition", "getAttributeDefinition", "(", "RegistryEntry", "registryEntry", ",", "String", "attributeName", ")", "{", "if", "(", "registryEntry", "==", "null", ")", "{", "return", "null", ";", "}", "ExtendedObjectClassDefinition", "definit...
Answer the definition of an attribute. Answer null if a definition is not available. @param registryEntry The registry entry from which to retrieve the attribute definition. @param attributeName The name of the attribute to locate. @return The definition of the attribute. Null if no definition is available for the at...
[ "Answer", "the", "definition", "of", "an", "attribute", ".", "Answer", "null", "if", "a", "definition", "is", "not", "available", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.config/src/com/ibm/ws/config/xml/internal/ConfigValidator.java#L96-L109
albfernandez/itext2
src/main/java/com/lowagie/text/Chunk.java
Chunk.setTextRenderMode
public Chunk setTextRenderMode(int mode, float strokeWidth, Color strokeColor) { """ Sets the text rendering mode. It can outline text, simulate bold and make text invisible. @param mode the text rendering mode. It can be <CODE> PdfContentByte.TEXT_RENDER_MODE_FILL</CODE>,<CODE> PdfContentByte.TEXT_RENDE...
java
public Chunk setTextRenderMode(int mode, float strokeWidth, Color strokeColor) { return setAttribute(TEXTRENDERMODE, new Object[] { Integer.valueOf(mode), new Float(strokeWidth), strokeColor }); }
[ "public", "Chunk", "setTextRenderMode", "(", "int", "mode", ",", "float", "strokeWidth", ",", "Color", "strokeColor", ")", "{", "return", "setAttribute", "(", "TEXTRENDERMODE", ",", "new", "Object", "[", "]", "{", "Integer", ".", "valueOf", "(", "mode", ")",...
Sets the text rendering mode. It can outline text, simulate bold and make text invisible. @param mode the text rendering mode. It can be <CODE> PdfContentByte.TEXT_RENDER_MODE_FILL</CODE>,<CODE> PdfContentByte.TEXT_RENDER_MODE_STROKE</CODE>,<CODE> PdfContentByte.TEXT_RENDER_MODE_FILL_STROKE</CODE> and <CODE> PdfConten...
[ "Sets", "the", "text", "rendering", "mode", ".", "It", "can", "outline", "text", "simulate", "bold", "and", "make", "text", "invisible", "." ]
train
https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/Chunk.java#L644-L648
defei/codelogger-utils
src/main/java/org/codelogger/utils/StringUtils.java
StringUtils.containsWord
public static boolean containsWord(final String text, final String word) { """ Returns true if given text contains given word; false otherwise. @param text string text to be tested. @param word string word to be tested. @return true if given text contains given word; false otherwise. """ if (text == ...
java
public static boolean containsWord(final String text, final String word) { if (text == null || word == null) { return false; } if (text.contains(word)) { Matcher matcher = matchText(text); for (; matcher.find();) { String matchedWord = matcher.group(0); if (matchedWord.equ...
[ "public", "static", "boolean", "containsWord", "(", "final", "String", "text", ",", "final", "String", "word", ")", "{", "if", "(", "text", "==", "null", "||", "word", "==", "null", ")", "{", "return", "false", ";", "}", "if", "(", "text", ".", "cont...
Returns true if given text contains given word; false otherwise. @param text string text to be tested. @param word string word to be tested. @return true if given text contains given word; false otherwise.
[ "Returns", "true", "if", "given", "text", "contains", "given", "word", ";", "false", "otherwise", "." ]
train
https://github.com/defei/codelogger-utils/blob/d906f5d217b783c7ae3e53442cd6fb87b20ecc0a/src/main/java/org/codelogger/utils/StringUtils.java#L254-L269
google/error-prone-javac
src/jdk.compiler/share/classes/com/sun/source/util/DocTreeScanner.java
DocTreeScanner.visitDeprecated
@Override public R visitDeprecated(DeprecatedTree node, P p) { """ {@inheritDoc} This implementation scans the children in left to right order. @param node {@inheritDoc} @param p {@inheritDoc} @return the result of scanning """ return scan(node.getBody(), p); }
java
@Override public R visitDeprecated(DeprecatedTree node, P p) { return scan(node.getBody(), p); }
[ "@", "Override", "public", "R", "visitDeprecated", "(", "DeprecatedTree", "node", ",", "P", "p", ")", "{", "return", "scan", "(", "node", ".", "getBody", "(", ")", ",", "p", ")", ";", "}" ]
{@inheritDoc} This implementation scans the children in left to right order. @param node {@inheritDoc} @param p {@inheritDoc} @return the result of scanning
[ "{", "@inheritDoc", "}", "This", "implementation", "scans", "the", "children", "in", "left", "to", "right", "order", "." ]
train
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/source/util/DocTreeScanner.java#L169-L172
yavijava/yavijava
src/main/java/com/vmware/vim25/mo/util/MorUtil.java
MorUtil.createExactManagedEntity
public static ManagedEntity createExactManagedEntity(ServerConnection sc, ManagedObjectReference mor) { """ Given a ServerConnection and a MOR return the ME @param sc @param mor @return """ return (ManagedEntity) createExactManagedObject(sc, mor); }
java
public static ManagedEntity createExactManagedEntity(ServerConnection sc, ManagedObjectReference mor) { return (ManagedEntity) createExactManagedObject(sc, mor); }
[ "public", "static", "ManagedEntity", "createExactManagedEntity", "(", "ServerConnection", "sc", ",", "ManagedObjectReference", "mor", ")", "{", "return", "(", "ManagedEntity", ")", "createExactManagedObject", "(", "sc", ",", "mor", ")", ";", "}" ]
Given a ServerConnection and a MOR return the ME @param sc @param mor @return
[ "Given", "a", "ServerConnection", "and", "a", "MOR", "return", "the", "ME" ]
train
https://github.com/yavijava/yavijava/blob/27fd2c5826115782d5eeb934f86e3e39240179cd/src/main/java/com/vmware/vim25/mo/util/MorUtil.java#L116-L118
cdk/cdk
base/standard/src/main/java/org/openscience/cdk/group/DisjointSetForest.java
DisjointSetForest.makeUnion
public void makeUnion(int elementX, int elementY) { """ Union these two elements - in other words, put them in the same set. @param elementX an element @param elementY an element """ int xRoot = getRoot(elementX); int yRoot = getRoot(elementY); if (xRoot == yRoot) { ret...
java
public void makeUnion(int elementX, int elementY) { int xRoot = getRoot(elementX); int yRoot = getRoot(elementY); if (xRoot == yRoot) { return; } if (forest[xRoot] < forest[yRoot]) { forest[yRoot] = forest[yRoot] + forest[xRoot]; forest[xRoot...
[ "public", "void", "makeUnion", "(", "int", "elementX", ",", "int", "elementY", ")", "{", "int", "xRoot", "=", "getRoot", "(", "elementX", ")", ";", "int", "yRoot", "=", "getRoot", "(", "elementY", ")", ";", "if", "(", "xRoot", "==", "yRoot", ")", "{"...
Union these two elements - in other words, put them in the same set. @param elementX an element @param elementY an element
[ "Union", "these", "two", "elements", "-", "in", "other", "words", "put", "them", "in", "the", "same", "set", "." ]
train
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/group/DisjointSetForest.java#L90-L105
Azure/azure-sdk-for-java
compute/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/compute/v2017_12_01/implementation/VirtualMachinesInner.java
VirtualMachinesInner.beginUpdate
public VirtualMachineInner beginUpdate(String resourceGroupName, String vmName, VirtualMachineUpdate parameters) { """ The operation to update a virtual machine. @param resourceGroupName The name of the resource group. @param vmName The name of the virtual machine. @param parameters Parameters supplied to the...
java
public VirtualMachineInner beginUpdate(String resourceGroupName, String vmName, VirtualMachineUpdate parameters) { return beginUpdateWithServiceResponseAsync(resourceGroupName, vmName, parameters).toBlocking().single().body(); }
[ "public", "VirtualMachineInner", "beginUpdate", "(", "String", "resourceGroupName", ",", "String", "vmName", ",", "VirtualMachineUpdate", "parameters", ")", "{", "return", "beginUpdateWithServiceResponseAsync", "(", "resourceGroupName", ",", "vmName", ",", "parameters", "...
The operation to update a virtual machine. @param resourceGroupName The name of the resource group. @param vmName The name of the virtual machine. @param parameters Parameters supplied to the Update Virtual Machine operation. @throws IllegalArgumentException thrown if parameters fail the validation @throws CloudExcept...
[ "The", "operation", "to", "update", "a", "virtual", "machine", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/compute/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/compute/v2017_12_01/implementation/VirtualMachinesInner.java#L809-L811
cqframework/clinical_quality_language
Src/java/elm/src/main/java/org/cqframework/cql/elm/visiting/ElmBaseClinicalVisitor.java
ElmBaseClinicalVisitor.visitBinaryExpression
@Override public T visitBinaryExpression(BinaryExpression elm, C context) { """ Visit a BinaryExpression. This method will be called for every node in the tree that is a BinaryExpression. @param elm the ELM tree @param context the context passed to the visitor @return the visitor result """ ...
java
@Override public T visitBinaryExpression(BinaryExpression elm, C context) { if (elm instanceof CalculateAgeAt) return visitCalculateAgeAt((CalculateAgeAt)elm, context); else return super.visitBinaryExpression(elm, context); }
[ "@", "Override", "public", "T", "visitBinaryExpression", "(", "BinaryExpression", "elm", ",", "C", "context", ")", "{", "if", "(", "elm", "instanceof", "CalculateAgeAt", ")", "return", "visitCalculateAgeAt", "(", "(", "CalculateAgeAt", ")", "elm", ",", "context"...
Visit a BinaryExpression. This method will be called for every node in the tree that is a BinaryExpression. @param elm the ELM tree @param context the context passed to the visitor @return the visitor result
[ "Visit", "a", "BinaryExpression", ".", "This", "method", "will", "be", "called", "for", "every", "node", "in", "the", "tree", "that", "is", "a", "BinaryExpression", "." ]
train
https://github.com/cqframework/clinical_quality_language/blob/67459d1ef453e49db8d7c5c86e87278377ed0a0b/Src/java/elm/src/main/java/org/cqframework/cql/elm/visiting/ElmBaseClinicalVisitor.java#L57-L61
nohana/Amalgam
amalgam/src/main/java/com/amalgam/os/BundleUtils.java
BundleUtils.optInt
public static int optInt(@Nullable Bundle bundle, @Nullable String key, int fallback) { """ Returns a optional int value. In other words, returns the value mapped by key if it exists and is a int. The bundle argument is allowed to be {@code null}. If the bundle is null, this method returns a fallback value. @par...
java
public static int optInt(@Nullable Bundle bundle, @Nullable String key, int fallback) { if (bundle == null) { return fallback; } return bundle.getInt(key, fallback); }
[ "public", "static", "int", "optInt", "(", "@", "Nullable", "Bundle", "bundle", ",", "@", "Nullable", "String", "key", ",", "int", "fallback", ")", "{", "if", "(", "bundle", "==", "null", ")", "{", "return", "fallback", ";", "}", "return", "bundle", "."...
Returns a optional int value. In other words, returns the value mapped by key if it exists and is a int. The bundle argument is allowed to be {@code null}. If the bundle is null, this method returns a fallback value. @param bundle a bundle. If the bundle is null, this method will return a fallback value. @param key a k...
[ "Returns", "a", "optional", "int", "value", ".", "In", "other", "words", "returns", "the", "value", "mapped", "by", "key", "if", "it", "exists", "and", "is", "a", "int", ".", "The", "bundle", "argument", "is", "allowed", "to", "be", "{" ]
train
https://github.com/nohana/Amalgam/blob/57809ddbfe7897e979cf507982ce0b3aa5e0ed8a/amalgam/src/main/java/com/amalgam/os/BundleUtils.java#L554-L559
Impetus/Kundera
src/kundera-ethereum/src/main/java/com/impetus/kundera/blockchain/ethereum/KunderaWeb3jClient.java
KunderaWeb3jClient.saveBlocks
public void saveBlocks(BigInteger startBlockNumber, BigInteger endBlockNumber) { """ Gets the blocks. @param startBlockNumber the start block number @param endBlockNumber the end block number @return the blocks """ if (endBlockNumber.compareTo(startBlockNumber) < 1) { LOGGER...
java
public void saveBlocks(BigInteger startBlockNumber, BigInteger endBlockNumber) { if (endBlockNumber.compareTo(startBlockNumber) < 1) { LOGGER.error("startBlockNumber must be smaller than endBlockNumer"); throw new KunderaException("startBlockNumber must be smaller than endBl...
[ "public", "void", "saveBlocks", "(", "BigInteger", "startBlockNumber", ",", "BigInteger", "endBlockNumber", ")", "{", "if", "(", "endBlockNumber", ".", "compareTo", "(", "startBlockNumber", ")", "<", "1", ")", "{", "LOGGER", ".", "error", "(", "\"startBlockNumbe...
Gets the blocks. @param startBlockNumber the start block number @param endBlockNumber the end block number @return the blocks
[ "Gets", "the", "blocks", "." ]
train
https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-ethereum/src/main/java/com/impetus/kundera/blockchain/ethereum/KunderaWeb3jClient.java#L250-L290
xcesco/kripton
kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/TypeUtility.java
TypeUtility.isEquals
public static boolean isEquals(TypeName value, TypeName kindOfParameter) { """ Check if class that is rapresented by value has same typeName of entity parameter. @param value the value @param kindOfParameter the kind of parameter @return true if value is equals to className. """ return value.toString(...
java
public static boolean isEquals(TypeName value, TypeName kindOfParameter) { return value.toString().equals(kindOfParameter.toString()); }
[ "public", "static", "boolean", "isEquals", "(", "TypeName", "value", ",", "TypeName", "kindOfParameter", ")", "{", "return", "value", ".", "toString", "(", ")", ".", "equals", "(", "kindOfParameter", ".", "toString", "(", ")", ")", ";", "}" ]
Check if class that is rapresented by value has same typeName of entity parameter. @param value the value @param kindOfParameter the kind of parameter @return true if value is equals to className.
[ "Check", "if", "class", "that", "is", "rapresented", "by", "value", "has", "same", "typeName", "of", "entity", "parameter", "." ]
train
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/TypeUtility.java#L179-L181
strator-dev/greenpepper
greenpepper/core/src/main/java/com/greenpepper/annotation/WrongAnnotation.java
WrongAnnotation.giveDetails
public void giveDetails( Expectation expected, Object actual ) { """ <p>giveDetails.</p> @param expected a {@link com.greenpepper.expectation.Expectation} object. @param actual a {@link java.lang.Object} object. """ this.expected = expected; this.actual = actual; this.detailed = tru...
java
public void giveDetails( Expectation expected, Object actual ) { this.expected = expected; this.actual = actual; this.detailed = true; }
[ "public", "void", "giveDetails", "(", "Expectation", "expected", ",", "Object", "actual", ")", "{", "this", ".", "expected", "=", "expected", ";", "this", ".", "actual", "=", "actual", ";", "this", ".", "detailed", "=", "true", ";", "}" ]
<p>giveDetails.</p> @param expected a {@link com.greenpepper.expectation.Expectation} object. @param actual a {@link java.lang.Object} object.
[ "<p", ">", "giveDetails", ".", "<", "/", "p", ">" ]
train
https://github.com/strator-dev/greenpepper/blob/2a61e6c179b74085babcc559d677490b0cad2d30/greenpepper/core/src/main/java/com/greenpepper/annotation/WrongAnnotation.java#L43-L48
wellner/jcarafe
jcarafe-core/src/main/java/cern/colt/map/OpenLongObjectHashMap.java
OpenLongObjectHashMap.pairsMatching
public void pairsMatching(final LongObjectProcedure condition, final LongArrayList keyList, final ObjectArrayList valueList) { """ Fills all pairs satisfying a given condition into the specified lists. Fills into the lists, starting at index 0. After this call returns the specified lists both have a new size, th...
java
public void pairsMatching(final LongObjectProcedure condition, final LongArrayList keyList, final ObjectArrayList valueList) { keyList.clear(); valueList.clear(); for (int i = table.length ; i-- > 0 ;) { if (state[i]==FULL && condition.apply(table[i],values[i])) { keyList.add(table[i]); valueList.ad...
[ "public", "void", "pairsMatching", "(", "final", "LongObjectProcedure", "condition", ",", "final", "LongArrayList", "keyList", ",", "final", "ObjectArrayList", "valueList", ")", "{", "keyList", ".", "clear", "(", ")", ";", "valueList", ".", "clear", "(", ")", ...
Fills all pairs satisfying a given condition into the specified lists. Fills into the lists, starting at index 0. After this call returns the specified lists both have a new size, the number of pairs satisfying the condition. Iteration order is guaranteed to be <i>identical</i> to the order used by method {@link #forEa...
[ "Fills", "all", "pairs", "satisfying", "a", "given", "condition", "into", "the", "specified", "lists", ".", "Fills", "into", "the", "lists", "starting", "at", "index", "0", ".", "After", "this", "call", "returns", "the", "specified", "lists", "both", "have",...
train
https://github.com/wellner/jcarafe/blob/ab8b0a83dbf600fe80c27711815c90bd3055b217/jcarafe-core/src/main/java/cern/colt/map/OpenLongObjectHashMap.java#L326-L336
intellimate/Izou
src/main/java/org/intellimate/izou/system/file/FileManager.java
FileManager.registerFileDir
public void registerFileDir(Path dir, String fileType, ReloadableFile reloadableFile) throws IOException { """ Use this method to register a file with the watcherService @param dir directory of file @param fileType the name/extension of the file IMPORTANT: Please try to always enter the full name with extensi...
java
public void registerFileDir(Path dir, String fileType, ReloadableFile reloadableFile) throws IOException { WatchKey key = dir.register(watcher, ENTRY_MODIFY); List<FileInfo> fileInfos = addOnMap.get(key); if(fileInfos != null) { fileInfos.add(new FileInfo(dir, fileType, reloadableFi...
[ "public", "void", "registerFileDir", "(", "Path", "dir", ",", "String", "fileType", ",", "ReloadableFile", "reloadableFile", ")", "throws", "IOException", "{", "WatchKey", "key", "=", "dir", ".", "register", "(", "watcher", ",", "ENTRY_MODIFY", ")", ";", "List...
Use this method to register a file with the watcherService @param dir directory of file @param fileType the name/extension of the file IMPORTANT: Please try to always enter the full name with extension of the file (Ex: "test.txt"), it would be best if the fileType is the full file name, and that the file name is clear...
[ "Use", "this", "method", "to", "register", "a", "file", "with", "the", "watcherService" ]
train
https://github.com/intellimate/Izou/blob/40a808b97998e17655c4a78e30ce7326148aed27/src/main/java/org/intellimate/izou/system/file/FileManager.java#L60-L71
PeterisP/LVTagger
src/main/java/edu/stanford/nlp/classify/LinearClassifier.java
LinearClassifier.dumpSorted
public void dumpSorted() { """ Print all features in the classifier and the weight that they assign to each class. The feature names are printed in sorted order. """ Datum<L, F> allFeatures = new BasicDatum<L, F>(features(), (L)null); justificationOf(allFeatures, new PrintWriter(System.err, true), t...
java
public void dumpSorted() { Datum<L, F> allFeatures = new BasicDatum<L, F>(features(), (L)null); justificationOf(allFeatures, new PrintWriter(System.err, true), true); }
[ "public", "void", "dumpSorted", "(", ")", "{", "Datum", "<", "L", ",", "F", ">", "allFeatures", "=", "new", "BasicDatum", "<", "L", ",", "F", ">", "(", "features", "(", ")", ",", "(", "L", ")", "null", ")", ";", "justificationOf", "(", "allFeatures...
Print all features in the classifier and the weight that they assign to each class. The feature names are printed in sorted order.
[ "Print", "all", "features", "in", "the", "classifier", "and", "the", "weight", "that", "they", "assign", "to", "each", "class", ".", "The", "feature", "names", "are", "printed", "in", "sorted", "order", "." ]
train
https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/classify/LinearClassifier.java#L1204-L1207
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/bcp/PatternMatcher.java
PatternMatcher.attemptMatch
private void attemptMatch(BasicBlock basicBlock, BasicBlock.InstructionIterator instructionIterator) throws DataflowAnalysisException { """ Attempt to begin a match. @param basicBlock the basic block @param instructionIterator the instruction iterator positioned just before the first instruction...
java
private void attemptMatch(BasicBlock basicBlock, BasicBlock.InstructionIterator instructionIterator) throws DataflowAnalysisException { work(new State(basicBlock, instructionIterator, pattern.getFirst())); }
[ "private", "void", "attemptMatch", "(", "BasicBlock", "basicBlock", ",", "BasicBlock", ".", "InstructionIterator", "instructionIterator", ")", "throws", "DataflowAnalysisException", "{", "work", "(", "new", "State", "(", "basicBlock", ",", "instructionIterator", ",", ...
Attempt to begin a match. @param basicBlock the basic block @param instructionIterator the instruction iterator positioned just before the first instruction to be matched
[ "Attempt", "to", "begin", "a", "match", "." ]
train
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/bcp/PatternMatcher.java#L159-L162
Azure/azure-sdk-for-java
recoveryservices/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/v2016_06_01/implementation/VaultCertificatesInner.java
VaultCertificatesInner.createAsync
public Observable<VaultCertificateResponseInner> createAsync(String resourceGroupName, String vaultName, String certificateName) { """ Uploads a certificate for a resource. @param resourceGroupName The name of the resource group where the recovery services vault is present. @param vaultName The name of the rec...
java
public Observable<VaultCertificateResponseInner> createAsync(String resourceGroupName, String vaultName, String certificateName) { return createWithServiceResponseAsync(resourceGroupName, vaultName, certificateName).map(new Func1<ServiceResponse<VaultCertificateResponseInner>, VaultCertificateResponseInner>() {...
[ "public", "Observable", "<", "VaultCertificateResponseInner", ">", "createAsync", "(", "String", "resourceGroupName", ",", "String", "vaultName", ",", "String", "certificateName", ")", "{", "return", "createWithServiceResponseAsync", "(", "resourceGroupName", ",", "vaultN...
Uploads a certificate for a resource. @param resourceGroupName The name of the resource group where the recovery services vault is present. @param vaultName The name of the recovery services vault. @param certificateName Certificate friendly name. @throws IllegalArgumentException thrown if parameters fail the validati...
[ "Uploads", "a", "certificate", "for", "a", "resource", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/recoveryservices/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/v2016_06_01/implementation/VaultCertificatesInner.java#L102-L109
ngageoint/geopackage-android-map
geopackage-map/src/main/java/mil/nga/geopackage/map/tiles/overlay/GeoPackageOverlayFactory.java
GeoPackageOverlayFactory.getBoundedOverlay
public static BoundedOverlay getBoundedOverlay(TileDao tileDao, float density) { """ Get a Bounded Overlay Tile Provider for the Tile DAO with the display density @param tileDao tile dao @param density display density: {@link android.util.DisplayMetrics#density} @return bounded overlay @since 3.2.0 """ ...
java
public static BoundedOverlay getBoundedOverlay(TileDao tileDao, float density) { BoundedOverlay overlay = null; if (tileDao.isGoogleTiles()) { overlay = new GoogleAPIGeoPackageOverlay(tileDao); } else { overlay = new GeoPackageOverlay(tileDao, density); } ...
[ "public", "static", "BoundedOverlay", "getBoundedOverlay", "(", "TileDao", "tileDao", ",", "float", "density", ")", "{", "BoundedOverlay", "overlay", "=", "null", ";", "if", "(", "tileDao", ".", "isGoogleTiles", "(", ")", ")", "{", "overlay", "=", "new", "Go...
Get a Bounded Overlay Tile Provider for the Tile DAO with the display density @param tileDao tile dao @param density display density: {@link android.util.DisplayMetrics#density} @return bounded overlay @since 3.2.0
[ "Get", "a", "Bounded", "Overlay", "Tile", "Provider", "for", "the", "Tile", "DAO", "with", "the", "display", "density" ]
train
https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/tiles/overlay/GeoPackageOverlayFactory.java#L73-L84
lucee/Lucee
core/src/main/java/lucee/runtime/type/util/ListUtil.java
ListUtil.arrayToList
public static String arrayToList(Array array, String delimiter) throws PageException { """ convert Array Object to string list @param array array to convert @param delimiter delimiter for the new list @return list generated from string array @throws PageException """ if (array.size() == 0) return ""; S...
java
public static String arrayToList(Array array, String delimiter) throws PageException { if (array.size() == 0) return ""; StringBuilder sb = new StringBuilder(Caster.toString(array.get(1, ""))); int len = array.size(); for (int i = 2; i <= len; i++) { sb.append(delimiter); sb.append(Caster.toString(array....
[ "public", "static", "String", "arrayToList", "(", "Array", "array", ",", "String", "delimiter", ")", "throws", "PageException", "{", "if", "(", "array", ".", "size", "(", ")", "==", "0", ")", "return", "\"\"", ";", "StringBuilder", "sb", "=", "new", "Str...
convert Array Object to string list @param array array to convert @param delimiter delimiter for the new list @return list generated from string array @throws PageException
[ "convert", "Array", "Object", "to", "string", "list" ]
train
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/type/util/ListUtil.java#L951-L961
elki-project/elki
addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/batikutil/DragableArea.java
DragableArea.startDrag
protected boolean startDrag(SVGPoint startPoint, Event evt) { """ Action to do on drag start. @param startPoint Point where the drag was started. @param evt The event object @return {@code true} to start the drag operation """ if (listener != null) { return listener.startDrag(startPoint, evt); ...
java
protected boolean startDrag(SVGPoint startPoint, Event evt) { if (listener != null) { return listener.startDrag(startPoint, evt); } return true; }
[ "protected", "boolean", "startDrag", "(", "SVGPoint", "startPoint", ",", "Event", "evt", ")", "{", "if", "(", "listener", "!=", "null", ")", "{", "return", "listener", ".", "startDrag", "(", "startPoint", ",", "evt", ")", ";", "}", "return", "true", ";",...
Action to do on drag start. @param startPoint Point where the drag was started. @param evt The event object @return {@code true} to start the drag operation
[ "Action", "to", "do", "on", "drag", "start", "." ]
train
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/batikutil/DragableArea.java#L267-L272
alkacon/opencms-core
src/org/opencms/ui/CmsVaadinUtils.java
CmsVaadinUtils.getAvailableSitesContainer
public static IndexedContainer getAvailableSitesContainer(CmsObject cms, String captionPropertyName) { """ Builds an IndexedContainer containing the sites selectable by the current user.<p> @param cms the CMS context @param captionPropertyName the name of the property used to store captions @return the cont...
java
public static IndexedContainer getAvailableSitesContainer(CmsObject cms, String captionPropertyName) { CmsSiteSelectorOptionBuilder optBuilder = new CmsSiteSelectorOptionBuilder(cms); optBuilder.addNormalSites(true, (new CmsUserSettings(cms)).getStartFolder()); optBuilder.addSharedSite(); ...
[ "public", "static", "IndexedContainer", "getAvailableSitesContainer", "(", "CmsObject", "cms", ",", "String", "captionPropertyName", ")", "{", "CmsSiteSelectorOptionBuilder", "optBuilder", "=", "new", "CmsSiteSelectorOptionBuilder", "(", "cms", ")", ";", "optBuilder", "."...
Builds an IndexedContainer containing the sites selectable by the current user.<p> @param cms the CMS context @param captionPropertyName the name of the property used to store captions @return the container with the available sites
[ "Builds", "an", "IndexedContainer", "containing", "the", "sites", "selectable", "by", "the", "current", "user", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/CmsVaadinUtils.java#L470-L486
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/util/ExceptionUtil.java
ExceptionUtil.fixAsyncStackTrace
public static void fixAsyncStackTrace(Throwable asyncCause, StackTraceElement[] localSideStackTrace) { """ This method changes the given async cause, and it adds the also given local stacktrace.<br/> If the remoteCause is an {@link java.util.concurrent.ExecutionException} and it has a non-null inner cause, this ...
java
public static void fixAsyncStackTrace(Throwable asyncCause, StackTraceElement[] localSideStackTrace) { Throwable throwable = asyncCause; if (asyncCause instanceof ExecutionException && throwable.getCause() != null) { throwable = throwable.getCause(); } StackTraceElement[] re...
[ "public", "static", "void", "fixAsyncStackTrace", "(", "Throwable", "asyncCause", ",", "StackTraceElement", "[", "]", "localSideStackTrace", ")", "{", "Throwable", "throwable", "=", "asyncCause", ";", "if", "(", "asyncCause", "instanceof", "ExecutionException", "&&", ...
This method changes the given async cause, and it adds the also given local stacktrace.<br/> If the remoteCause is an {@link java.util.concurrent.ExecutionException} and it has a non-null inner cause, this inner cause is unwrapped and the local stacktrace and exception message are added to the that instead of the given...
[ "This", "method", "changes", "the", "given", "async", "cause", "and", "it", "adds", "the", "also", "given", "local", "stacktrace", ".", "<br", "/", ">", "If", "the", "remoteCause", "is", "an", "{", "@link", "java", ".", "util", ".", "concurrent", ".", ...
train
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/util/ExceptionUtil.java#L188-L200
togglz/togglz
benchmarks/src/main/java/org/togglz/benchmark/TogglzOverheadBenchmark.java
TogglzOverheadBenchmark.toggleEnabledState
@Setup(Level.Iteration) public void toggleEnabledState() { """ toggle the state between iterations to keep the compiler honest """ enabled = !enabled; manager.setFeatureState(new FeatureState(OverheadFeature.FEATURE, enabled)); }
java
@Setup(Level.Iteration) public void toggleEnabledState() { enabled = !enabled; manager.setFeatureState(new FeatureState(OverheadFeature.FEATURE, enabled)); }
[ "@", "Setup", "(", "Level", ".", "Iteration", ")", "public", "void", "toggleEnabledState", "(", ")", "{", "enabled", "=", "!", "enabled", ";", "manager", ".", "setFeatureState", "(", "new", "FeatureState", "(", "OverheadFeature", ".", "FEATURE", ",", "enable...
toggle the state between iterations to keep the compiler honest
[ "toggle", "the", "state", "between", "iterations", "to", "keep", "the", "compiler", "honest" ]
train
https://github.com/togglz/togglz/blob/76d3ffbc8e3fac5a6cb566cc4afbd8dd5f06c4e5/benchmarks/src/main/java/org/togglz/benchmark/TogglzOverheadBenchmark.java#L63-L67
Azure/azure-sdk-for-java
appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/DiagnosticsInner.java
DiagnosticsInner.executeSiteAnalysisSlot
public DiagnosticAnalysisInner executeSiteAnalysisSlot(String resourceGroupName, String siteName, String diagnosticCategory, String analysisName, String slot) { """ Execute Analysis. Execute Analysis. @param resourceGroupName Name of the resource group to which the resource belongs. @param siteName Site Name ...
java
public DiagnosticAnalysisInner executeSiteAnalysisSlot(String resourceGroupName, String siteName, String diagnosticCategory, String analysisName, String slot) { return executeSiteAnalysisSlotWithServiceResponseAsync(resourceGroupName, siteName, diagnosticCategory, analysisName, slot).toBlocking().single().body(...
[ "public", "DiagnosticAnalysisInner", "executeSiteAnalysisSlot", "(", "String", "resourceGroupName", ",", "String", "siteName", ",", "String", "diagnosticCategory", ",", "String", "analysisName", ",", "String", "slot", ")", "{", "return", "executeSiteAnalysisSlotWithServiceR...
Execute Analysis. Execute Analysis. @param resourceGroupName Name of the resource group to which the resource belongs. @param siteName Site Name @param diagnosticCategory Category Name @param analysisName Analysis Resource Name @param slot Slot Name @throws IllegalArgumentException thrown if parameters fail the valida...
[ "Execute", "Analysis", ".", "Execute", "Analysis", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/DiagnosticsInner.java#L1846-L1848
alkacon/opencms-core
src-gwt/org/opencms/acacia/client/ui/CmsInlineEditOverlay.java
CmsInlineEditOverlay.getAvailablePosition
private int getAvailablePosition(CmsInlineEntityWidget widget, int absoluteTop) { """ Returns the available absolute top position for the given button.<p> @param widget the button widget @param absoluteTop the proposed position @return the available position """ m_buttons.remove(widget); ...
java
private int getAvailablePosition(CmsInlineEntityWidget widget, int absoluteTop) { m_buttons.remove(widget); boolean positionBlocked = true; while (positionBlocked) { positionBlocked = false; for (int pos : m_buttons.values()) { if (((pos - 24) < ab...
[ "private", "int", "getAvailablePosition", "(", "CmsInlineEntityWidget", "widget", ",", "int", "absoluteTop", ")", "{", "m_buttons", ".", "remove", "(", "widget", ")", ";", "boolean", "positionBlocked", "=", "true", ";", "while", "(", "positionBlocked", ")", "{",...
Returns the available absolute top position for the given button.<p> @param widget the button widget @param absoluteTop the proposed position @return the available position
[ "Returns", "the", "available", "absolute", "top", "position", "for", "the", "given", "button", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/acacia/client/ui/CmsInlineEditOverlay.java#L371-L387
marklogic/java-client-api
marklogic-client-api/src/main/java/com/marklogic/client/example/cookbook/datamovement/JobInformationRecorder.java
JobInformationRecorder.withWriteBatcher
public JobInformationRecorder withWriteBatcher(DataMovementManager dataMovementManager, WriteBatcher writeBatcher) { """ Sets the WriteBatcher object which should be used for writing the job information. This overrides the internal WriteBatcher object created by default. @param writeBatcher The WriteBatcher ob...
java
public JobInformationRecorder withWriteBatcher(DataMovementManager dataMovementManager, WriteBatcher writeBatcher) { if(sourceBatcher.isStarted()) throw new IllegalStateException("Configuration cannot be changed after startJob has been called"); this.writeBatcher = writeBatcher; this.dataMovementManager = d...
[ "public", "JobInformationRecorder", "withWriteBatcher", "(", "DataMovementManager", "dataMovementManager", ",", "WriteBatcher", "writeBatcher", ")", "{", "if", "(", "sourceBatcher", ".", "isStarted", "(", ")", ")", "throw", "new", "IllegalStateException", "(", "\"Config...
Sets the WriteBatcher object which should be used for writing the job information. This overrides the internal WriteBatcher object created by default. @param writeBatcher The WriteBatcher object with which we should write the job information. @return this object for chaining
[ "Sets", "the", "WriteBatcher", "object", "which", "should", "be", "used", "for", "writing", "the", "job", "information", ".", "This", "overrides", "the", "internal", "WriteBatcher", "object", "created", "by", "default", "." ]
train
https://github.com/marklogic/java-client-api/blob/acf60229a928abd4a8cc4b21b641d56957467da7/marklogic-client-api/src/main/java/com/marklogic/client/example/cookbook/datamovement/JobInformationRecorder.java#L122-L129
Azure/azure-sdk-for-java
network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ServiceEndpointPoliciesInner.java
ServiceEndpointPoliciesInner.beginCreateOrUpdateAsync
public Observable<ServiceEndpointPolicyInner> beginCreateOrUpdateAsync(String resourceGroupName, String serviceEndpointPolicyName, ServiceEndpointPolicyInner parameters) { """ Creates or updates a service Endpoint Policies. @param resourceGroupName The name of the resource group. @param serviceEndpointPolicyNa...
java
public Observable<ServiceEndpointPolicyInner> beginCreateOrUpdateAsync(String resourceGroupName, String serviceEndpointPolicyName, ServiceEndpointPolicyInner parameters) { return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, parameters).map(new Func1<ServiceResponse<S...
[ "public", "Observable", "<", "ServiceEndpointPolicyInner", ">", "beginCreateOrUpdateAsync", "(", "String", "resourceGroupName", ",", "String", "serviceEndpointPolicyName", ",", "ServiceEndpointPolicyInner", "parameters", ")", "{", "return", "beginCreateOrUpdateWithServiceResponse...
Creates or updates a service Endpoint Policies. @param resourceGroupName The name of the resource group. @param serviceEndpointPolicyName The name of the service endpoint policy. @param parameters Parameters supplied to the create or update service endpoint policy operation. @throws IllegalArgumentException thrown if ...
[ "Creates", "or", "updates", "a", "service", "Endpoint", "Policies", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ServiceEndpointPoliciesInner.java#L546-L553
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-component/xwiki-commons-component-default/src/main/java/org/xwiki/component/internal/StackingComponentEventManager.java
StackingComponentEventManager.notifyComponentEvent
private void notifyComponentEvent(Event event, ComponentDescriptor<?> descriptor, ComponentManager componentManager) { """ Send or stack the provided event dependening on the configuration. @param event the event send by the component manager @param descriptor the event related component descriptor. @...
java
private void notifyComponentEvent(Event event, ComponentDescriptor<?> descriptor, ComponentManager componentManager) { if (this.shouldStack) { synchronized (this) { this.events.push(new ComponentEventEntry(event, descriptor, componentManager)); } } els...
[ "private", "void", "notifyComponentEvent", "(", "Event", "event", ",", "ComponentDescriptor", "<", "?", ">", "descriptor", ",", "ComponentManager", "componentManager", ")", "{", "if", "(", "this", ".", "shouldStack", ")", "{", "synchronized", "(", "this", ")", ...
Send or stack the provided event dependening on the configuration. @param event the event send by the component manager @param descriptor the event related component descriptor. @param componentManager the event related component manager instance. @see #shouldStack(boolean)
[ "Send", "or", "stack", "the", "provided", "event", "dependening", "on", "the", "configuration", "." ]
train
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-component/xwiki-commons-component-default/src/main/java/org/xwiki/component/internal/StackingComponentEventManager.java#L120-L130
petergeneric/stdlib
stdlib/src/main/java/com/peterphi/std/util/HexHelper.java
HexHelper.fromHex
public static final byte[] fromHex(final char separator, final String value) { """ Decodes a hexidecimal string (optionally with <code>separator</code> characters separating each two-digit pair)<br /> Multiple runs of the separator will be ignored (eg. AA::BB will result in <code>[0xAA,0xBB]</code>, not <code>[0...
java
public static final byte[] fromHex(final char separator, final String value) { if (value.length() == 0) return new byte[0]; final String sepString = new String(new char[]{separator}); final StringTokenizer t = new StringTokenizer(value, sepString, false); final byte[] buffer = new byte[t.countTokens()]; ...
[ "public", "static", "final", "byte", "[", "]", "fromHex", "(", "final", "char", "separator", ",", "final", "String", "value", ")", "{", "if", "(", "value", ".", "length", "(", ")", "==", "0", ")", "return", "new", "byte", "[", "0", "]", ";", "final...
Decodes a hexidecimal string (optionally with <code>separator</code> characters separating each two-digit pair)<br /> Multiple runs of the separator will be ignored (eg. AA::BB will result in <code>[0xAA,0xBB]</code>, not <code>[0xAA,0x00,0xBB]</code>)<br /> @param separator the separator character @param value @retu...
[ "Decodes", "a", "hexidecimal", "string", "(", "optionally", "with", "<code", ">", "separator<", "/", "code", ">", "characters", "separating", "each", "two", "-", "digit", "pair", ")", "<br", "/", ">", "Multiple", "runs", "of", "the", "separator", "will", "...
train
https://github.com/petergeneric/stdlib/blob/d4025d2f881bc0542b1e004c5f65a1ccaf895836/stdlib/src/main/java/com/peterphi/std/util/HexHelper.java#L57-L85
wuman/orientdb-android
core/src/main/java/com/orientechnologies/orient/core/storage/fs/OMMapManagerNew.java
OMMapManagerNew.acquireLocksOnEntries
private void acquireLocksOnEntries(final OMMapBufferEntry[] entries, OPERATION_TYPE operationType) { """ Locks all entries. @param entries that will be locked. @param operationType determine read or write lock will be performed. """ if (operationType == OPERATION_TYPE.WRITE) for (OMMapBufferE...
java
private void acquireLocksOnEntries(final OMMapBufferEntry[] entries, OPERATION_TYPE operationType) { if (operationType == OPERATION_TYPE.WRITE) for (OMMapBufferEntry entry : entries) { entry.acquireWriteLock(); entry.setDirty(); } else for (OMMapBufferEntry entry : entri...
[ "private", "void", "acquireLocksOnEntries", "(", "final", "OMMapBufferEntry", "[", "]", "entries", ",", "OPERATION_TYPE", "operationType", ")", "{", "if", "(", "operationType", "==", "OPERATION_TYPE", ".", "WRITE", ")", "for", "(", "OMMapBufferEntry", "entry", ":"...
Locks all entries. @param entries that will be locked. @param operationType determine read or write lock will be performed.
[ "Locks", "all", "entries", "." ]
train
https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/core/src/main/java/com/orientechnologies/orient/core/storage/fs/OMMapManagerNew.java#L348-L357
hypercube1024/firefly
firefly-common/src/main/java/com/firefly/utils/codec/HexUtils.java
HexUtils.hexToBytes
public static final void hexToBytes(String s, byte[] out, int off) throws NumberFormatException, IndexOutOfBoundsException { """ Converts a String of hex characters into an array of bytes. @param s A string of hex characters (upper case or lower) of even length. @param out A byte array of length...
java
public static final void hexToBytes(String s, byte[] out, int off) throws NumberFormatException, IndexOutOfBoundsException { int slen = s.length(); if ((slen % 2) != 0) { s = '0' + s; } if (out.length < off + slen / 2) { throw new IndexOutOfBoundsExc...
[ "public", "static", "final", "void", "hexToBytes", "(", "String", "s", ",", "byte", "[", "]", "out", ",", "int", "off", ")", "throws", "NumberFormatException", ",", "IndexOutOfBoundsException", "{", "int", "slen", "=", "s", ".", "length", "(", ")", ";", ...
Converts a String of hex characters into an array of bytes. @param s A string of hex characters (upper case or lower) of even length. @param out A byte array of length at least s.length()/2 + off @param off The first byte to write of the array
[ "Converts", "a", "String", "of", "hex", "characters", "into", "an", "array", "of", "bytes", "." ]
train
https://github.com/hypercube1024/firefly/blob/ed3fc75b7c54a65b1e7d8141d01b49144bb423a3/firefly-common/src/main/java/com/firefly/utils/codec/HexUtils.java#L60-L84
MTDdk/jawn
jawn-core-new/src/main/java/net/javapla/jawn/core/internal/FrameworkBootstrap.java
FrameworkBootstrap.readRegisteredPlugins
private ModuleBootstrap[] readRegisteredPlugins(ApplicationConfig config, String pluginsPackage) { """ /*private void initRouter(Router router, Injector localInjector) { router.compileRoutes(localInjector.getInstance(ActionInvoker.class)); RouterImpl router = (RouterImpl)localInjector.getInstance(Router.class); ...
java
private ModuleBootstrap[] readRegisteredPlugins(ApplicationConfig config, String pluginsPackage) { try { ClassLocator locator = new ClassLocator(pluginsPackage); return locateAll(locator, ModuleBootstrap.class, impl -> impl.bootstrap(config)); } catch (IllegalArgumentException e...
[ "private", "ModuleBootstrap", "[", "]", "readRegisteredPlugins", "(", "ApplicationConfig", "config", ",", "String", "pluginsPackage", ")", "{", "try", "{", "ClassLocator", "locator", "=", "new", "ClassLocator", "(", "pluginsPackage", ")", ";", "return", "locateAll",...
/*private void initRouter(Router router, Injector localInjector) { router.compileRoutes(localInjector.getInstance(ActionInvoker.class)); RouterImpl router = (RouterImpl)localInjector.getInstance(Router.class); ActionInvoker invoker = localInjector.getInstance(ActionInvoker.class); ((RouterImpl)router).compileRoutes(inv...
[ "/", "*", "private", "void", "initRouter", "(", "Router", "router", "Injector", "localInjector", ")", "{", "router", ".", "compileRoutes", "(", "localInjector", ".", "getInstance", "(", "ActionInvoker", ".", "class", "))", ";", "RouterImpl", "router", "=", "("...
train
https://github.com/MTDdk/jawn/blob/4ec2d09b97d413efdead7487e6075e5bfd13b925/jawn-core-new/src/main/java/net/javapla/jawn/core/internal/FrameworkBootstrap.java#L211-L219
JoeKerouac/utils
src/main/java/com/joe/utils/serialize/json/JsonParser.java
JsonParser.readAsObject
@SuppressWarnings("unchecked") public <T> T readAsObject(byte[] content, Class<T> type) { """ 解析json @param content json字符串 @param type json解析后对应的实体类型 @param <T> 实体类型的实际类型 @return 解析失败将返回null """ try { if (content == null || content.length == 0 || type == null) { ...
java
@SuppressWarnings("unchecked") public <T> T readAsObject(byte[] content, Class<T> type) { try { if (content == null || content.length == 0 || type == null) { log.debug("content为{},type为:{}", content, type); return null; } else if (type.equals(String.cl...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "<", "T", ">", "T", "readAsObject", "(", "byte", "[", "]", "content", ",", "Class", "<", "T", ">", "type", ")", "{", "try", "{", "if", "(", "content", "==", "null", "||", "content", ".", ...
解析json @param content json字符串 @param type json解析后对应的实体类型 @param <T> 实体类型的实际类型 @return 解析失败将返回null
[ "解析json" ]
train
https://github.com/JoeKerouac/utils/blob/45e1b2dc4d736956674fc4dcbe6cf84eaee69278/src/main/java/com/joe/utils/serialize/json/JsonParser.java#L139-L153
anotheria/moskito
moskito-integration/moskito-cdi/src/main/java/net/anotheria/moskito/integration/cdi/AbstractInterceptor.java
AbstractInterceptor.createAccumulator
private void createAccumulator(String producerId, Accumulate annotation, String accName, String statsName) { """ Create accumulator and register it. @param producerId id of the producer @param annotation Accumulate annotation @param accName Accumulator name @param statsName Statistics name """ if...
java
private void createAccumulator(String producerId, Accumulate annotation, String accName, String statsName) { if (annotation != null && producerId != null && !producerId.isEmpty() && accName!=null && !accName.isEmpty() && statsName != null && !statsName.isEmpty()){ AccumulatorDefinit...
[ "private", "void", "createAccumulator", "(", "String", "producerId", ",", "Accumulate", "annotation", ",", "String", "accName", ",", "String", "statsName", ")", "{", "if", "(", "annotation", "!=", "null", "&&", "producerId", "!=", "null", "&&", "!", "producerI...
Create accumulator and register it. @param producerId id of the producer @param annotation Accumulate annotation @param accName Accumulator name @param statsName Statistics name
[ "Create", "accumulator", "and", "register", "it", "." ]
train
https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-integration/moskito-cdi/src/main/java/net/anotheria/moskito/integration/cdi/AbstractInterceptor.java#L226-L243
wildfly/wildfly-core
host-controller/src/main/java/org/jboss/as/domain/controller/plan/ConcurrentGroupServerUpdatePolicy.java
ConcurrentGroupServerUpdatePolicy.recordServerGroupResult
public void recordServerGroupResult(final String serverGroup, final boolean failed) { """ Records the result of updating a server group. @param serverGroup the server group's name. Cannot be <code>null</code> @param failed <code>true</code> if the server group update failed; <code>false</code> if it succeeded...
java
public void recordServerGroupResult(final String serverGroup, final boolean failed) { synchronized (this) { if (groups.contains(serverGroup)) { responseCount++; if (failed) { this.failed = true; } DomainControllerLo...
[ "public", "void", "recordServerGroupResult", "(", "final", "String", "serverGroup", ",", "final", "boolean", "failed", ")", "{", "synchronized", "(", "this", ")", "{", "if", "(", "groups", ".", "contains", "(", "serverGroup", ")", ")", "{", "responseCount", ...
Records the result of updating a server group. @param serverGroup the server group's name. Cannot be <code>null</code> @param failed <code>true</code> if the server group update failed; <code>false</code> if it succeeded
[ "Records", "the", "result", "of", "updating", "a", "server", "group", "." ]
train
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/host-controller/src/main/java/org/jboss/as/domain/controller/plan/ConcurrentGroupServerUpdatePolicy.java#L100-L116
looly/hutool
hutool-core/src/main/java/cn/hutool/core/io/IoUtil.java
IoUtil.readLines
public static <T extends Collection<String>> T readLines(Reader reader, final T collection) throws IORuntimeException { """ 从Reader中读取内容 @param <T> 集合类型 @param reader {@link Reader} @param collection 返回集合 @return 内容 @throws IORuntimeException IO异常 """ readLines(reader, new LineHandler() { @Overri...
java
public static <T extends Collection<String>> T readLines(Reader reader, final T collection) throws IORuntimeException { readLines(reader, new LineHandler() { @Override public void handle(String line) { collection.add(line); } }); return collection; }
[ "public", "static", "<", "T", "extends", "Collection", "<", "String", ">", ">", "T", "readLines", "(", "Reader", "reader", ",", "final", "T", "collection", ")", "throws", "IORuntimeException", "{", "readLines", "(", "reader", ",", "new", "LineHandler", "(", ...
从Reader中读取内容 @param <T> 集合类型 @param reader {@link Reader} @param collection 返回集合 @return 内容 @throws IORuntimeException IO异常
[ "从Reader中读取内容" ]
train
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/IoUtil.java#L671-L679
OpenLiberty/open-liberty
dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/FixDependencyChecker.java
FixDependencyChecker.isToBeUninstalled
public boolean isToBeUninstalled(String name, List<UninstallAsset> list) { """ Verify the name is on the uninstall list @param name symbolic name of the fix @param list list of the uninstalling fix @return true if the feature is going to be uninstalled, otherwise, return false. """ for (UninstallA...
java
public boolean isToBeUninstalled(String name, List<UninstallAsset> list) { for (UninstallAsset asset : list) { String fixName = asset.getIFixInfo().getId(); if (fixName != null && fixName.equals(name)) { return true; } } return false; }
[ "public", "boolean", "isToBeUninstalled", "(", "String", "name", ",", "List", "<", "UninstallAsset", ">", "list", ")", "{", "for", "(", "UninstallAsset", "asset", ":", "list", ")", "{", "String", "fixName", "=", "asset", ".", "getIFixInfo", "(", ")", ".", ...
Verify the name is on the uninstall list @param name symbolic name of the fix @param list list of the uninstalling fix @return true if the feature is going to be uninstalled, otherwise, return false.
[ "Verify", "the", "name", "is", "on", "the", "uninstall", "list" ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/FixDependencyChecker.java#L99-L107
deeplearning4j/deeplearning4j
nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDBaseOps.java
SDBaseOps.matchConditionCount
public SDVariable matchConditionCount(SDVariable in, Condition condition) { """ Returns a count of the number of elements that satisfy the condition @param in Input @param condition Condition @return Number of elements that the condition is satisfied for """ return matchConditionCount(null,...
java
public SDVariable matchConditionCount(SDVariable in, Condition condition) { return matchConditionCount(null, in, condition); }
[ "public", "SDVariable", "matchConditionCount", "(", "SDVariable", "in", ",", "Condition", "condition", ")", "{", "return", "matchConditionCount", "(", "null", ",", "in", ",", "condition", ")", ";", "}" ]
Returns a count of the number of elements that satisfy the condition @param in Input @param condition Condition @return Number of elements that the condition is satisfied for
[ "Returns", "a", "count", "of", "the", "number", "of", "elements", "that", "satisfy", "the", "condition" ]
train
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDBaseOps.java#L997-L999
alkacon/opencms-core
src-setup/org/opencms/setup/CmsSetupBean.java
CmsSetupBean.getHtmlPart
public String getHtmlPart(String part, String replaceString) { """ Returns the specified HTML part of the HTML property file to create the output.<p> @param part the name of the desired part @param replaceString String which is inserted in the found HTML part at the location of "$replace$" @return the HTML pa...
java
public String getHtmlPart(String part, String replaceString) { String value = m_htmlProps.getProperty(part); if (value == null) { return ""; } else { return CmsStringUtil.substitute(value, "$replace$", replaceString); } }
[ "public", "String", "getHtmlPart", "(", "String", "part", ",", "String", "replaceString", ")", "{", "String", "value", "=", "m_htmlProps", ".", "getProperty", "(", "part", ")", ";", "if", "(", "value", "==", "null", ")", "{", "return", "\"\"", ";", "}", ...
Returns the specified HTML part of the HTML property file to create the output.<p> @param part the name of the desired part @param replaceString String which is inserted in the found HTML part at the location of "$replace$" @return the HTML part or an empty String, if the part was not found
[ "Returns", "the", "specified", "HTML", "part", "of", "the", "HTML", "property", "file", "to", "create", "the", "output", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-setup/org/opencms/setup/CmsSetupBean.java#L935-L943
elki-project/elki
addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/projections/AffineProjection.java
AffineProjection.axisProjection
public static AffineTransformation axisProjection(int dim, int ax1, int ax2) { """ Compute an transformation matrix to show only axis ax1 and ax2. @param dim Dimensionality @param ax1 First axis @param ax2 Second axis @return transformation matrix """ // setup a projection to get the data into the in...
java
public static AffineTransformation axisProjection(int dim, int ax1, int ax2) { // setup a projection to get the data into the interval -1:+1 in each // dimension with the intended-to-see dimensions first. AffineTransformation proj = AffineTransformation.reorderAxesTransformation(dim, ax1, ax2); // Assum...
[ "public", "static", "AffineTransformation", "axisProjection", "(", "int", "dim", ",", "int", "ax1", ",", "int", "ax2", ")", "{", "// setup a projection to get the data into the interval -1:+1 in each", "// dimension with the intended-to-see dimensions first.", "AffineTransformation...
Compute an transformation matrix to show only axis ax1 and ax2. @param dim Dimensionality @param ax1 First axis @param ax2 Second axis @return transformation matrix
[ "Compute", "an", "transformation", "matrix", "to", "show", "only", "axis", "ax1", "and", "ax2", "." ]
train
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/projections/AffineProjection.java#L147-L164
ironjacamar/ironjacamar
common/src/main/java/org/ironjacamar/common/annotations/Annotations.java
Annotations.hasNotNull
private boolean hasNotNull(AnnotationRepository annotationRepository, Annotation annotation) { """ Has a NotNull annotation attached @param annotationRepository The annotation repository @param annotation The annotation being checked @return True of the method/field contains the NotNull annotation; otherwise fa...
java
private boolean hasNotNull(AnnotationRepository annotationRepository, Annotation annotation) { Collection<Annotation> values = annotationRepository.getAnnotation(javax.validation.constraints.NotNull.class); if (values == null || values.isEmpty()) return false; for (Annotation notNullAnno...
[ "private", "boolean", "hasNotNull", "(", "AnnotationRepository", "annotationRepository", ",", "Annotation", "annotation", ")", "{", "Collection", "<", "Annotation", ">", "values", "=", "annotationRepository", ".", "getAnnotation", "(", "javax", ".", "validation", ".",...
Has a NotNull annotation attached @param annotationRepository The annotation repository @param annotation The annotation being checked @return True of the method/field contains the NotNull annotation; otherwise false
[ "Has", "a", "NotNull", "annotation", "attached" ]
train
https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/common/src/main/java/org/ironjacamar/common/annotations/Annotations.java#L1312-L1327
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/matching/ConsumerMonitorRegistrar.java
ConsumerMonitorRegistrar.removeConsumerFromRegisteredMonitors
public void removeConsumerFromRegisteredMonitors( MonitoredConsumer mc, ArrayList exactMonitorList, ArrayList wildcardMonitorList) { """ Method removeConsumerFromRegisteredMonitors Removes a specified MonitoredConsumer from the appropriate places in the maps. @param mc @param exactMonitorList @...
java
public void removeConsumerFromRegisteredMonitors( MonitoredConsumer mc, ArrayList exactMonitorList, ArrayList wildcardMonitorList) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry( tc, "removeConsumerFromRegisteredMonitors", new Objec...
[ "public", "void", "removeConsumerFromRegisteredMonitors", "(", "MonitoredConsumer", "mc", ",", "ArrayList", "exactMonitorList", ",", "ArrayList", "wildcardMonitorList", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEn...
Method removeConsumerFromRegisteredMonitors Removes a specified MonitoredConsumer from the appropriate places in the maps. @param mc @param exactMonitorList @param wildcardMonitorList
[ "Method", "removeConsumerFromRegisteredMonitors" ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/matching/ConsumerMonitorRegistrar.java#L975-L996
seancfoley/IPAddress
IPAddress/src/inet.ipaddr/inet/ipaddr/format/standard/AddressDivisionGrouping.java
AddressDivisionGrouping.increment
protected static <R extends AddressSection, S extends AddressSegment> R increment( R section, long increment, AddressCreator<?, R, ?, S> addrCreator, long count, long lowerValue, long upperValue, Supplier<R> lowerProducer, Supplier<R> upperProducer, Integer prefixLength) { """ this does...
java
protected static <R extends AddressSection, S extends AddressSegment> R increment( R section, long increment, AddressCreator<?, R, ?, S> addrCreator, long count, long lowerValue, long upperValue, Supplier<R> lowerProducer, Supplier<R> upperProducer, Integer prefixLength) { if(!section.isMu...
[ "protected", "static", "<", "R", "extends", "AddressSection", ",", "S", "extends", "AddressSegment", ">", "R", "increment", "(", "R", "section", ",", "long", "increment", ",", "AddressCreator", "<", "?", ",", "R", ",", "?", ",", "S", ">", "addrCreator", ...
this does not handle overflow, overflow should be checked before calling this
[ "this", "does", "not", "handle", "overflow", "overflow", "should", "be", "checked", "before", "calling", "this" ]
train
https://github.com/seancfoley/IPAddress/blob/90493d0673511d673100c36d020dd93dd870111a/IPAddress/src/inet.ipaddr/inet/ipaddr/format/standard/AddressDivisionGrouping.java#L1132-L1160
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/namenode/INodeDirectoryWithQuota.java
INodeDirectoryWithQuota.verifyQuota
void verifyQuota(long nsDelta, long dsDelta) throws QuotaExceededException { """ Verify if the namespace count disk space satisfies the quota restriction @throws QuotaExceededException if the given quota is less than the count """ long newCount = nsCount + nsDelta; long newDiskspace = diskspace + dsDe...
java
void verifyQuota(long nsDelta, long dsDelta) throws QuotaExceededException { long newCount = nsCount + nsDelta; long newDiskspace = diskspace + dsDelta; if (nsDelta>0 || dsDelta>0) { if (nsQuota >= 0 && nsQuota < newCount) { throw new NSQuotaExceededException(nsQuota, newCount); } ...
[ "void", "verifyQuota", "(", "long", "nsDelta", ",", "long", "dsDelta", ")", "throws", "QuotaExceededException", "{", "long", "newCount", "=", "nsCount", "+", "nsDelta", ";", "long", "newDiskspace", "=", "diskspace", "+", "dsDelta", ";", "if", "(", "nsDelta", ...
Verify if the namespace count disk space satisfies the quota restriction @throws QuotaExceededException if the given quota is less than the count
[ "Verify", "if", "the", "namespace", "count", "disk", "space", "satisfies", "the", "quota", "restriction" ]
train
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/INodeDirectoryWithQuota.java#L141-L152
RestComm/sipunit
src/main/java/org/cafesip/sipunit/SipStack.java
SipStack.createSipPhone
public SipPhone createSipPhone(String proxyHost, String proxyProto, int proxyPort, String me) throws InvalidArgumentException, ParseException { """ This method is used to create a SipPhone object. The SipPhone class simulates a SIP User Agent. The SipPhone object is used to communicate with other SIP agents...
java
public SipPhone createSipPhone(String proxyHost, String proxyProto, int proxyPort, String me) throws InvalidArgumentException, ParseException { return new SipPhone(this, proxyHost, proxyProto, proxyPort, me); }
[ "public", "SipPhone", "createSipPhone", "(", "String", "proxyHost", ",", "String", "proxyProto", ",", "int", "proxyPort", ",", "String", "me", ")", "throws", "InvalidArgumentException", ",", "ParseException", "{", "return", "new", "SipPhone", "(", "this", ",", "...
This method is used to create a SipPhone object. The SipPhone class simulates a SIP User Agent. The SipPhone object is used to communicate with other SIP agents. Using a SipPhone object, the test program can make one (or more, in future) outgoing calls or (and, in future) receive one (or more, in future) incoming calls...
[ "This", "method", "is", "used", "to", "create", "a", "SipPhone", "object", ".", "The", "SipPhone", "class", "simulates", "a", "SIP", "User", "Agent", ".", "The", "SipPhone", "object", "is", "used", "to", "communicate", "with", "other", "SIP", "agents", "."...
train
https://github.com/RestComm/sipunit/blob/18a6be2e29be3fbdc14226e8c41b25e2d57378b1/src/main/java/org/cafesip/sipunit/SipStack.java#L249-L252
stratosphere/stratosphere
stratosphere-core/src/main/java/eu/stratosphere/api/common/io/FormatUtil.java
FormatUtil.openInput
public static <T, F extends FileInputFormat<T>> F openInput( Class<F> inputFormatClass, String path, Configuration configuration) throws IOException { """ Creates an {@link InputFormat} from a given class for the specified file. The optional {@link Configuration} initializes the format. @param <T> the cl...
java
public static <T, F extends FileInputFormat<T>> F openInput( Class<F> inputFormatClass, String path, Configuration configuration) throws IOException { configuration = configuration == null ? new Configuration() : configuration; Path normalizedPath = normalizePath(new Path(path)); final F inputFormat = Refl...
[ "public", "static", "<", "T", ",", "F", "extends", "FileInputFormat", "<", "T", ">", ">", "F", "openInput", "(", "Class", "<", "F", ">", "inputFormatClass", ",", "String", "path", ",", "Configuration", "configuration", ")", "throws", "IOException", "{", "c...
Creates an {@link InputFormat} from a given class for the specified file. The optional {@link Configuration} initializes the format. @param <T> the class of the InputFormat @param inputFormatClass the class of the InputFormat @param path the path of the file @param configuration optional configuration of the InputForm...
[ "Creates", "an", "{", "@link", "InputFormat", "}", "from", "a", "given", "class", "for", "the", "specified", "file", ".", "The", "optional", "{", "@link", "Configuration", "}", "initializes", "the", "format", "." ]
train
https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-core/src/main/java/eu/stratosphere/api/common/io/FormatUtil.java#L55-L74
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/binding/form/support/UserMetadata.java
UserMetadata.isFieldProtected
public static boolean isFieldProtected(FormModel formModel, String fieldName) { """ tests if the usermetadata of the field has a boolean value true for the key {@value #PROTECTED_FIELD} @param fieldName the fieldname @return true if the field is protected, otherwise false """ FieldMetadata metaDat...
java
public static boolean isFieldProtected(FormModel formModel, String fieldName) { FieldMetadata metaData = formModel.getFieldMetadata(fieldName); return Boolean.TRUE.equals(metaData.getUserMetadata(UserMetadata.PROTECTED_FIELD)); }
[ "public", "static", "boolean", "isFieldProtected", "(", "FormModel", "formModel", ",", "String", "fieldName", ")", "{", "FieldMetadata", "metaData", "=", "formModel", ".", "getFieldMetadata", "(", "fieldName", ")", ";", "return", "Boolean", ".", "TRUE", ".", "eq...
tests if the usermetadata of the field has a boolean value true for the key {@value #PROTECTED_FIELD} @param fieldName the fieldname @return true if the field is protected, otherwise false
[ "tests", "if", "the", "usermetadata", "of", "the", "field", "has", "a", "boolean", "value", "true", "for", "the", "key", "{", "@value", "#PROTECTED_FIELD", "}" ]
train
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/binding/form/support/UserMetadata.java#L44-L47
ontop/ontop
client/protege/src/main/java/it/unibz/inf/ontop/protege/gui/treemodels/IncrementalResultSetTableModel.java
IncrementalResultSetTableModel.getValueAt
@Override public Object getValueAt(int row, int column) { """ This is the key method of TableModel: it returns the value at each cell of the table. We use strings in this case. If anything goes wrong, we return the exception as a string, so it will be displayed in the table. Note that SQL row and column number...
java
@Override public Object getValueAt(int row, int column) { try { if(row + 2 >= numrows && !isAfterLast){ fetchMoreResults(); } } catch (Exception e) { e.printStackTrace(); } Vector<String> aux = results.get(row); return aux.get(column); }
[ "@", "Override", "public", "Object", "getValueAt", "(", "int", "row", ",", "int", "column", ")", "{", "try", "{", "if", "(", "row", "+", "2", ">=", "numrows", "&&", "!", "isAfterLast", ")", "{", "fetchMoreResults", "(", ")", ";", "}", "}", "catch", ...
This is the key method of TableModel: it returns the value at each cell of the table. We use strings in this case. If anything goes wrong, we return the exception as a string, so it will be displayed in the table. Note that SQL row and column numbers start at 1, but TableModel column numbers start at 0.
[ "This", "is", "the", "key", "method", "of", "TableModel", ":", "it", "returns", "the", "value", "at", "each", "cell", "of", "the", "table", ".", "We", "use", "strings", "in", "this", "case", ".", "If", "anything", "goes", "wrong", "we", "return", "the"...
train
https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/client/protege/src/main/java/it/unibz/inf/ontop/protege/gui/treemodels/IncrementalResultSetTableModel.java#L145-L158
ksclarke/freelib-utils
src/main/java/info/freelibrary/util/BufferedFileReader.java
BufferedFileReader.getReader
private static Reader getReader(final File aFile) throws FileNotFoundException { """ Gets a {@link Reader} for the supplied file using the UTF-8 encoding. @param aFile The file for which to get a {#link Reader} @return A {#link Reader} that will read using the UTF-8 charset @throws FileNotFoundException If th...
java
private static Reader getReader(final File aFile) throws FileNotFoundException { try { return new InputStreamReader(new FileInputStream(aFile), StandardCharsets.UTF_8.name()); } catch (final java.io.UnsupportedEncodingException details) { throw new UnsupportedEncodingException(de...
[ "private", "static", "Reader", "getReader", "(", "final", "File", "aFile", ")", "throws", "FileNotFoundException", "{", "try", "{", "return", "new", "InputStreamReader", "(", "new", "FileInputStream", "(", "aFile", ")", ",", "StandardCharsets", ".", "UTF_8", "."...
Gets a {@link Reader} for the supplied file using the UTF-8 encoding. @param aFile The file for which to get a {#link Reader} @return A {#link Reader} that will read using the UTF-8 charset @throws FileNotFoundException If the supplied file couldn't be found @throws UnsupportedEncodingException If the supplied encodin...
[ "Gets", "a", "{", "@link", "Reader", "}", "for", "the", "supplied", "file", "using", "the", "UTF", "-", "8", "encoding", "." ]
train
https://github.com/ksclarke/freelib-utils/blob/54e822ae4c11b3d74793fd82a1a535ffafffaf45/src/main/java/info/freelibrary/util/BufferedFileReader.java#L48-L54
Swagger2Markup/swagger2markup
src/main/java/io/github/swagger2markup/Swagger2MarkupProperties.java
Swagger2MarkupProperties.getRequiredInt
public int getRequiredInt(String key) { """ Return the int property value associated with the given key (never {@code null}). @return The int property @throws IllegalStateException if the key cannot be """ Optional<Integer> value = getInteger(key); if (value.isPresent()) { retur...
java
public int getRequiredInt(String key) { Optional<Integer> value = getInteger(key); if (value.isPresent()) { return value.get(); } throw new IllegalStateException(String.format("required key [%s] not found", key)); }
[ "public", "int", "getRequiredInt", "(", "String", "key", ")", "{", "Optional", "<", "Integer", ">", "value", "=", "getInteger", "(", "key", ")", ";", "if", "(", "value", ".", "isPresent", "(", ")", ")", "{", "return", "value", ".", "get", "(", ")", ...
Return the int property value associated with the given key (never {@code null}). @return The int property @throws IllegalStateException if the key cannot be
[ "Return", "the", "int", "property", "value", "associated", "with", "the", "given", "key", "(", "never", "{", "@code", "null", "}", ")", "." ]
train
https://github.com/Swagger2Markup/swagger2markup/blob/da83465f19a2f8a0f1fba873b5762bca8587896b/src/main/java/io/github/swagger2markup/Swagger2MarkupProperties.java#L143-L149
wellner/jcarafe
jcarafe-core/src/main/java/cern/colt/map/AbstractMap.java
AbstractMap.chooseMeanCapacity
protected int chooseMeanCapacity(int size, double minLoad, double maxLoad) { """ Chooses a new prime table capacity neither favoring shrinking nor growing, that (approximately) satisfies the invariant <tt>c * minLoadFactor <= size <= c * maxLoadFactor</tt> and has at least one FREE slot for the given size. ...
java
protected int chooseMeanCapacity(int size, double minLoad, double maxLoad) { return nextPrime(Math.max(size+1, (int) ((2*size / (minLoad+maxLoad))))); }
[ "protected", "int", "chooseMeanCapacity", "(", "int", "size", ",", "double", "minLoad", ",", "double", "maxLoad", ")", "{", "return", "nextPrime", "(", "Math", ".", "max", "(", "size", "+", "1", ",", "(", "int", ")", "(", "(", "2", "*", "size", "/", ...
Chooses a new prime table capacity neither favoring shrinking nor growing, that (approximately) satisfies the invariant <tt>c * minLoadFactor <= size <= c * maxLoadFactor</tt> and has at least one FREE slot for the given size.
[ "Chooses", "a", "new", "prime", "table", "capacity", "neither", "favoring", "shrinking", "nor", "growing", "that", "(", "approximately", ")", "satisfies", "the", "invariant", "<tt", ">", "c", "*", "minLoadFactor", "<", "=", "size", "<", "=", "c", "*", "max...
train
https://github.com/wellner/jcarafe/blob/ab8b0a83dbf600fe80c27711815c90bd3055b217/jcarafe-core/src/main/java/cern/colt/map/AbstractMap.java#L84-L86
find-sec-bugs/find-sec-bugs
findsecbugs-plugin/src/main/java/com/h3xstream/findsecbugs/injection/BasicInjectionDetector.java
BasicInjectionDetector.loadCustomSinks
protected void loadCustomSinks(String fileName, String bugType) { """ Loads taint sinks configuration file from file system. If the file doesn't exist on file system, loads the file from classpath. @param fileName name of the configuration file @param bugType type of an injection bug """ InputStrea...
java
protected void loadCustomSinks(String fileName, String bugType) { InputStream stream = null; try { File file = new File(fileName); if (file.exists()) { stream = new FileInputStream(file); loadConfiguredSinks(stream, bugType); } else { ...
[ "protected", "void", "loadCustomSinks", "(", "String", "fileName", ",", "String", "bugType", ")", "{", "InputStream", "stream", "=", "null", ";", "try", "{", "File", "file", "=", "new", "File", "(", "fileName", ")", ";", "if", "(", "file", ".", "exists",...
Loads taint sinks configuration file from file system. If the file doesn't exist on file system, loads the file from classpath. @param fileName name of the configuration file @param bugType type of an injection bug
[ "Loads", "taint", "sinks", "configuration", "file", "from", "file", "system", ".", "If", "the", "file", "doesn", "t", "exist", "on", "file", "system", "loads", "the", "file", "from", "classpath", "." ]
train
https://github.com/find-sec-bugs/find-sec-bugs/blob/362da013cef4925e6a1506dd3511fe5bdcc5fba3/findsecbugs-plugin/src/main/java/com/h3xstream/findsecbugs/injection/BasicInjectionDetector.java#L152-L168
strator-dev/greenpepper
greenpepper-open/confluence/greenpepper-confluence-code/src/main/java/com/greenpepper/confluence/velocity/ConfluenceGreenPepper.java
ConfluenceGreenPepper.saveExecuteChildren
public void saveExecuteChildren(Page page, Boolean doExecuteChildren) { """ <p>saveExecuteChildren.</p> @param page a {@link com.atlassian.confluence.pages.Page} object. @param doExecuteChildren a {@link java.lang.Boolean} object. """ ContentEntityObject entityObject = getContentEntityManager().get...
java
public void saveExecuteChildren(Page page, Boolean doExecuteChildren) { ContentEntityObject entityObject = getContentEntityManager().getById(page.getId()); getContentPropertyManager().setStringProperty(entityObject, ConfluenceGreenPepper.EXECUTE_CHILDREN, doExecuteChildren != null ? String.valueOf(doExe...
[ "public", "void", "saveExecuteChildren", "(", "Page", "page", ",", "Boolean", "doExecuteChildren", ")", "{", "ContentEntityObject", "entityObject", "=", "getContentEntityManager", "(", ")", ".", "getById", "(", "page", ".", "getId", "(", ")", ")", ";", "getConte...
<p>saveExecuteChildren.</p> @param page a {@link com.atlassian.confluence.pages.Page} object. @param doExecuteChildren a {@link java.lang.Boolean} object.
[ "<p", ">", "saveExecuteChildren", ".", "<", "/", "p", ">" ]
train
https://github.com/strator-dev/greenpepper/blob/2a61e6c179b74085babcc559d677490b0cad2d30/greenpepper-open/confluence/greenpepper-confluence-code/src/main/java/com/greenpepper/confluence/velocity/ConfluenceGreenPepper.java#L676-L679
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/internal/cluster/impl/ClusterJoinManager.java
ClusterJoinManager.answerWhoisMasterQuestion
public void answerWhoisMasterQuestion(JoinMessage joinMessage, Connection connection) { """ Respond to a {@link WhoisMasterOp}. @param joinMessage the {@code JoinMessage} from the request. @param connection the connection to operation caller, to which response will be sent. @see WhoisMasterOp """ ...
java
public void answerWhoisMasterQuestion(JoinMessage joinMessage, Connection connection) { if (!ensureValidConfiguration(joinMessage)) { return; } if (clusterService.isJoined()) { if (!checkIfJoinRequestFromAnExistingMember(joinMessage, connection)) { sendMa...
[ "public", "void", "answerWhoisMasterQuestion", "(", "JoinMessage", "joinMessage", ",", "Connection", "connection", ")", "{", "if", "(", "!", "ensureValidConfiguration", "(", "joinMessage", ")", ")", "{", "return", ";", "}", "if", "(", "clusterService", ".", "isJ...
Respond to a {@link WhoisMasterOp}. @param joinMessage the {@code JoinMessage} from the request. @param connection the connection to operation caller, to which response will be sent. @see WhoisMasterOp
[ "Respond", "to", "a", "{", "@link", "WhoisMasterOp", "}", "." ]
train
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/internal/cluster/impl/ClusterJoinManager.java#L571-L586
UrielCh/ovh-java-sdk
ovh-java-sdk-dedicatednasha/src/main/java/net/minidev/ovh/api/ApiOvhDedicatednasha.java
ApiOvhDedicatednasha.serviceName_partition_partitionName_customSnapshot_name_GET
public OvhCustomSnap serviceName_partition_partitionName_customSnapshot_name_GET(String serviceName, String partitionName, String name) throws IOException { """ Get this object properties REST: GET /dedicated/nasha/{serviceName}/partition/{partitionName}/customSnapshot/{name} @param serviceName [required] The ...
java
public OvhCustomSnap serviceName_partition_partitionName_customSnapshot_name_GET(String serviceName, String partitionName, String name) throws IOException { String qPath = "/dedicated/nasha/{serviceName}/partition/{partitionName}/customSnapshot/{name}"; StringBuilder sb = path(qPath, serviceName, partitionName, nam...
[ "public", "OvhCustomSnap", "serviceName_partition_partitionName_customSnapshot_name_GET", "(", "String", "serviceName", ",", "String", "partitionName", ",", "String", "name", ")", "throws", "IOException", "{", "String", "qPath", "=", "\"/dedicated/nasha/{serviceName}/partition/...
Get this object properties REST: GET /dedicated/nasha/{serviceName}/partition/{partitionName}/customSnapshot/{name} @param serviceName [required] The internal name of your storage @param partitionName [required] the given name of partition @param name [required] name of the snapshot API beta
[ "Get", "this", "object", "properties" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dedicatednasha/src/main/java/net/minidev/ovh/api/ApiOvhDedicatednasha.java#L149-L154
davidcarboni/cryptolite-java
src/main/java/com/github/davidcarboni/cryptolite/KeyExchange.java
KeyExchange.decryptKey
public SecretKey decryptKey(String encryptedKey, PrivateKey privateKey) { """ This method decrypts the given encrypted {@link SecretKey} using our {@link PrivateKey}. @param encryptedKey The encrypted key as a base64-encoded string, as returned by {@link #encryptKey(SecretKey, PublicKey)}. @param privateKey ...
java
public SecretKey decryptKey(String encryptedKey, PrivateKey privateKey) { // Basic null check if (encryptedKey == null) { return null; } // Convert the encryptedKey key String back to a byte array: byte[] bytes = ByteArray.fromBase64(encryptedKey); ...
[ "public", "SecretKey", "decryptKey", "(", "String", "encryptedKey", ",", "PrivateKey", "privateKey", ")", "{", "// Basic null check\r", "if", "(", "encryptedKey", "==", "null", ")", "{", "return", "null", ";", "}", "// Convert the encryptedKey key String back to a byte ...
This method decrypts the given encrypted {@link SecretKey} using our {@link PrivateKey}. @param encryptedKey The encrypted key as a base64-encoded string, as returned by {@link #encryptKey(SecretKey, PublicKey)}. @param privateKey The {@link PrivateKey} to be used to decrypt the encrypted key. This can be obtained v...
[ "This", "method", "decrypts", "the", "given", "encrypted", "{", "@link", "SecretKey", "}", "using", "our", "{", "@link", "PrivateKey", "}", "." ]
train
https://github.com/davidcarboni/cryptolite-java/blob/e67954181a04ffc9beb1d9abca1421195fcf9764/src/main/java/com/github/davidcarboni/cryptolite/KeyExchange.java#L127-L150
ZuInnoTe/hadoopcryptoledger
inputformat/src/main/java/org/zuinnote/hadoop/namecoin/format/common/NamecoinUtil.java
NamecoinUtil.extractNamecoinField
public static String[] extractNamecoinField(byte[] scriptPubKey) { """ Extracts a Namecoin field name (String) and value field (a JSON object) from a script. Please note that not all Namecoin transactions do contain Namecoin fields, some are coinbase (ie mining) transactions and others are regular transactions to ...
java
public static String[] extractNamecoinField(byte[] scriptPubKey) { // check if valid script if ((scriptPubKey==null) || (scriptPubKey.length<2)) { return null; } // only firstupdate and update work if (!((scriptPubKey[0]==NamecoinUtil.OP_NAME_UDPATE)|| (scriptPubKey[0]==NamecoinUtil.OP_NAME_FIRSTUPDATE...
[ "public", "static", "String", "[", "]", "extractNamecoinField", "(", "byte", "[", "]", "scriptPubKey", ")", "{", "// check if valid script", "if", "(", "(", "scriptPubKey", "==", "null", ")", "||", "(", "scriptPubKey", ".", "length", "<", "2", ")", ")", "{...
Extracts a Namecoin field name (String) and value field (a JSON object) from a script. Please note that not all Namecoin transactions do contain Namecoin fields, some are coinbase (ie mining) transactions and others are regular transactions to transfer Namecoins (comparable to Bitcoin transactions= Additionally, you ca...
[ "Extracts", "a", "Namecoin", "field", "name", "(", "String", ")", "and", "value", "field", "(", "a", "JSON", "object", ")", "from", "a", "script", ".", "Please", "note", "that", "not", "all", "Namecoin", "transactions", "do", "contain", "Namecoin", "fields...
train
https://github.com/ZuInnoTe/hadoopcryptoledger/blob/5c9bfb61dd1a82374cd0de8413a7c66391ee4414/inputformat/src/main/java/org/zuinnote/hadoop/namecoin/format/common/NamecoinUtil.java#L53-L88
jenkinsci/artifactory-plugin
src/main/java/org/jfrog/hudson/util/ExtractorUtils.java
ExtractorUtils.getVcsRevision
public static String getVcsRevision(Map<String, String> env) { """ Get the VCS revision from the Jenkins build environment. The search will one of "SVN_REVISION", "GIT_COMMIT", "P4_CHANGELIST" in the environment. @param env Th Jenkins build environment. @return The vcs revision for supported VCS """ ...
java
public static String getVcsRevision(Map<String, String> env) { String revision = env.get("SVN_REVISION"); if (StringUtils.isBlank(revision)) { revision = env.get(GIT_COMMIT); } if (StringUtils.isBlank(revision)) { revision = env.get("P4_CHANGELIST"); } ...
[ "public", "static", "String", "getVcsRevision", "(", "Map", "<", "String", ",", "String", ">", "env", ")", "{", "String", "revision", "=", "env", ".", "get", "(", "\"SVN_REVISION\"", ")", ";", "if", "(", "StringUtils", ".", "isBlank", "(", "revision", ")...
Get the VCS revision from the Jenkins build environment. The search will one of "SVN_REVISION", "GIT_COMMIT", "P4_CHANGELIST" in the environment. @param env Th Jenkins build environment. @return The vcs revision for supported VCS
[ "Get", "the", "VCS", "revision", "from", "the", "Jenkins", "build", "environment", ".", "The", "search", "will", "one", "of", "SVN_REVISION", "GIT_COMMIT", "P4_CHANGELIST", "in", "the", "environment", "." ]
train
https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/util/ExtractorUtils.java#L81-L90
line/armeria
grpc-protocol/src/main/java/com/linecorp/armeria/common/grpc/protocol/GrpcTrailersUtil.java
GrpcTrailersUtil.statusToTrailers
public static HttpHeaders statusToTrailers(int code, @Nullable String message, boolean headersSent) { """ Converts the given gRPC status code, and optionally an error message, to headers. The headers will be either trailers-only or normal trailers based on {@code headersSent}, whether leading headers have alread...
java
public static HttpHeaders statusToTrailers(int code, @Nullable String message, boolean headersSent) { final HttpHeaders trailers; if (headersSent) { // Normal trailers. trailers = new DefaultHttpHeaders(); } else { // Trailers only response trailer...
[ "public", "static", "HttpHeaders", "statusToTrailers", "(", "int", "code", ",", "@", "Nullable", "String", "message", ",", "boolean", "headersSent", ")", "{", "final", "HttpHeaders", "trailers", ";", "if", "(", "headersSent", ")", "{", "// Normal trailers.", "tr...
Converts the given gRPC status code, and optionally an error message, to headers. The headers will be either trailers-only or normal trailers based on {@code headersSent}, whether leading headers have already been sent to the client.
[ "Converts", "the", "given", "gRPC", "status", "code", "and", "optionally", "an", "error", "message", "to", "headers", ".", "The", "headers", "will", "be", "either", "trailers", "-", "only", "or", "normal", "trailers", "based", "on", "{" ]
train
https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/grpc-protocol/src/main/java/com/linecorp/armeria/common/grpc/protocol/GrpcTrailersUtil.java#L36-L54
UrielCh/ovh-java-sdk
ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java
ApiOvhTelephony.billingAccount_service_serviceName_repaymentConsumption_GET
public ArrayList<Long> billingAccount_service_serviceName_repaymentConsumption_GET(String billingAccount, String serviceName, Date creationDatetime_from, Date creationDatetime_to) throws IOException { """ Call which could be repayable REST: GET /telephony/{billingAccount}/service/{serviceName}/repaymentConsumpt...
java
public ArrayList<Long> billingAccount_service_serviceName_repaymentConsumption_GET(String billingAccount, String serviceName, Date creationDatetime_from, Date creationDatetime_to) throws IOException { String qPath = "/telephony/{billingAccount}/service/{serviceName}/repaymentConsumption"; StringBuilder sb = path(qP...
[ "public", "ArrayList", "<", "Long", ">", "billingAccount_service_serviceName_repaymentConsumption_GET", "(", "String", "billingAccount", ",", "String", "serviceName", ",", "Date", "creationDatetime_from", ",", "Date", "creationDatetime_to", ")", "throws", "IOException", "{"...
Call which could be repayable REST: GET /telephony/{billingAccount}/service/{serviceName}/repaymentConsumption @param creationDatetime_to [required] Filter the value of creationDatetime property (<=) @param creationDatetime_from [required] Filter the value of creationDatetime property (>=) @param billingAccount [requi...
[ "Call", "which", "could", "be", "repayable" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L4104-L4111
intendia-oss/rxjava-gwt
src/main/modified/io/reactivex/super/io/reactivex/Completable.java
Completable.toSingleDefault
@CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) public final <T> Single<T> toSingleDefault(final T completionValue) { """ Converts this Completable into a Single which when this Completable completes normally, emits the given value through onSuccess. <p> <img width="640" height="583" src="htt...
java
@CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) public final <T> Single<T> toSingleDefault(final T completionValue) { ObjectHelper.requireNonNull(completionValue, "completionValue is null"); return RxJavaPlugins.onAssembly(new CompletableToSingle<T>(this, null, completionValue)); ...
[ "@", "CheckReturnValue", "@", "SchedulerSupport", "(", "SchedulerSupport", ".", "NONE", ")", "public", "final", "<", "T", ">", "Single", "<", "T", ">", "toSingleDefault", "(", "final", "T", "completionValue", ")", "{", "ObjectHelper", ".", "requireNonNull", "(...
Converts this Completable into a Single which when this Completable completes normally, emits the given value through onSuccess. <p> <img width="640" height="583" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/Completable.toSingleDefault.png" alt=""> <dl> <dt><b>Scheduler:</b></dt> <dd>{@code toS...
[ "Converts", "this", "Completable", "into", "a", "Single", "which", "when", "this", "Completable", "completes", "normally", "emits", "the", "given", "value", "through", "onSuccess", ".", "<p", ">", "<img", "width", "=", "640", "height", "=", "583", "src", "="...
train
https://github.com/intendia-oss/rxjava-gwt/blob/8d5635b12ce40da99e76b59dc6bfe6fc2fffc1fa/src/main/modified/io/reactivex/super/io/reactivex/Completable.java#L2578-L2583
jbundle/jbundle
main/msg/src/main/java/org/jbundle/main/msg/screen/MessageScreen.java
MessageScreen.createReplyMessage
public BaseMessage createReplyMessage(BaseMessage messageIn) { """ Given this message in, create the reply message. @param messageIn The incomming message @return the (empty) reply message. """ //ProductRequest productRequest = (ProductRequest)messageIn.getMessageDataDesc(null); BaseMessage r...
java
public BaseMessage createReplyMessage(BaseMessage messageIn) { //ProductRequest productRequest = (ProductRequest)messageIn.getMessageDataDesc(null); BaseMessage replyMessage = (BaseMessage)this.getMessageProcessInfo().createReplyMessage(messageIn); //BaseProductResponse responseMess...
[ "public", "BaseMessage", "createReplyMessage", "(", "BaseMessage", "messageIn", ")", "{", "//ProductRequest productRequest = (ProductRequest)messageIn.getMessageDataDesc(null);", "BaseMessage", "replyMessage", "=", "(", "BaseMessage", ")", "this", ".", "getMessageProcessInfo", "(...
Given this message in, create the reply message. @param messageIn The incomming message @return the (empty) reply message.
[ "Given", "this", "message", "in", "create", "the", "reply", "message", "." ]
train
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/main/msg/src/main/java/org/jbundle/main/msg/screen/MessageScreen.java#L157-L169
UrielCh/ovh-java-sdk
ovh-java-sdk-emailpro/src/main/java/net/minidev/ovh/api/ApiOvhEmailpro.java
ApiOvhEmailpro.service_account_email_alias_alias_GET
public OvhAccountAlias service_account_email_alias_alias_GET(String service, String email, String alias) throws IOException { """ Get this object properties REST: GET /email/pro/{service}/account/{email}/alias/{alias} @param service [required] The internal name of your pro organization @param email [required]...
java
public OvhAccountAlias service_account_email_alias_alias_GET(String service, String email, String alias) throws IOException { String qPath = "/email/pro/{service}/account/{email}/alias/{alias}"; StringBuilder sb = path(qPath, service, email, alias); String resp = exec(qPath, "GET", sb.toString(), null); return ...
[ "public", "OvhAccountAlias", "service_account_email_alias_alias_GET", "(", "String", "service", ",", "String", "email", ",", "String", "alias", ")", "throws", "IOException", "{", "String", "qPath", "=", "\"/email/pro/{service}/account/{email}/alias/{alias}\"", ";", "StringB...
Get this object properties REST: GET /email/pro/{service}/account/{email}/alias/{alias} @param service [required] The internal name of your pro organization @param email [required] Default email for this mailbox @param alias [required] Alias API beta
[ "Get", "this", "object", "properties" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-emailpro/src/main/java/net/minidev/ovh/api/ApiOvhEmailpro.java#L487-L492
unbescape/unbescape
src/main/java/org/unbescape/uri/UriEscape.java
UriEscape.unescapeUriFragmentId
public static String unescapeUriFragmentId(final String text, final String encoding) { """ <p> Perform am URI fragment identifier <strong>unescape</strong> operation on a <tt>String</tt> input. </p> <p> This method will unescape every percent-encoded (<tt>%HH</tt>) sequences present in input, even for those ...
java
public static String unescapeUriFragmentId(final String text, final String encoding) { if (encoding == null) { throw new IllegalArgumentException("Argument 'encoding' cannot be null"); } return UriEscapeUtil.unescape(text, UriEscapeUtil.UriEscapeType.FRAGMENT_ID, encoding); }
[ "public", "static", "String", "unescapeUriFragmentId", "(", "final", "String", "text", ",", "final", "String", "encoding", ")", "{", "if", "(", "encoding", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Argument 'encoding' cannot be null...
<p> Perform am URI fragment identifier <strong>unescape</strong> operation on a <tt>String</tt> input. </p> <p> This method will unescape every percent-encoded (<tt>%HH</tt>) sequences present in input, even for those characters that do not need to be percent-encoded in this context (unreserved characters can be percen...
[ "<p", ">", "Perform", "am", "URI", "fragment", "identifier", "<strong", ">", "unescape<", "/", "strong", ">", "operation", "on", "a", "<tt", ">", "String<", "/", "tt", ">", "input", ".", "<", "/", "p", ">", "<p", ">", "This", "method", "will", "unesc...
train
https://github.com/unbescape/unbescape/blob/ec5435fb3508c2eed25d8165dc27ded2602cae13/src/main/java/org/unbescape/uri/UriEscape.java#L1763-L1768
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParse.java
BpmnParse.parseProperty
public void parseProperty(Element propertyElement, ActivityImpl activity) { """ Parses one property definition. @param propertyElement The 'property' element that defines how a property looks like and is handled. """ String id = propertyElement.attribute("id"); String name = propertyElement.attrib...
java
public void parseProperty(Element propertyElement, ActivityImpl activity) { String id = propertyElement.attribute("id"); String name = propertyElement.attribute("name"); // If name isn't given, use the id as name if (name == null) { if (id == null) { addError("Invalid property usage on li...
[ "public", "void", "parseProperty", "(", "Element", "propertyElement", ",", "ActivityImpl", "activity", ")", "{", "String", "id", "=", "propertyElement", ".", "attribute", "(", "\"id\"", ")", ";", "String", "name", "=", "propertyElement", ".", "attribute", "(", ...
Parses one property definition. @param propertyElement The 'property' element that defines how a property looks like and is handled.
[ "Parses", "one", "property", "definition", "." ]
train
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParse.java#L3895-L3910
padrig64/ValidationFramework
validationframework-swing/src/main/java/com/google/code/validationframework/swing/decoration/anchor/AnchorLink.java
AnchorLink.getRelativeSlaveLocation
public Point getRelativeSlaveLocation(final Component masterComponent, final Component slaveComponent) { """ Computes the location of the specified component that is slaved to the specified master component using this anchor link. @param masterComponent Master component to which the other component is slaved. ...
java
public Point getRelativeSlaveLocation(final Component masterComponent, final Component slaveComponent) { return getRelativeSlaveLocation(masterComponent.getWidth(), masterComponent.getHeight(), slaveComponent.getWidth(), slaveComponent.getHeight()); }
[ "public", "Point", "getRelativeSlaveLocation", "(", "final", "Component", "masterComponent", ",", "final", "Component", "slaveComponent", ")", "{", "return", "getRelativeSlaveLocation", "(", "masterComponent", ".", "getWidth", "(", ")", ",", "masterComponent", ".", "g...
Computes the location of the specified component that is slaved to the specified master component using this anchor link. @param masterComponent Master component to which the other component is slaved. @param slaveComponent Slave component that is slaved to the master component. @return Location where the slave comp...
[ "Computes", "the", "location", "of", "the", "specified", "component", "that", "is", "slaved", "to", "the", "specified", "master", "component", "using", "this", "anchor", "link", "." ]
train
https://github.com/padrig64/ValidationFramework/blob/2dd3c7b3403993db366d24a927645f467ccd1dda/validationframework-swing/src/main/java/com/google/code/validationframework/swing/decoration/anchor/AnchorLink.java#L113-L116
zerodhatech/javakiteconnect
kiteconnect/src/com/zerodhatech/kiteconnect/kitehttp/KiteRequestHandler.java
KiteRequestHandler.createGetRequest
public Request createGetRequest(String url, String apiKey, String accessToken) { """ Creates a GET request. @param url is the endpoint to which request has to be done. @param apiKey is the api key of the Kite Connect app. @param accessToken is the access token obtained after successful login process. """ ...
java
public Request createGetRequest(String url, String apiKey, String accessToken) { HttpUrl.Builder httpBuilder = HttpUrl.parse(url).newBuilder(); return new Request.Builder().url(httpBuilder.build()).header("User-Agent", USER_AGENT).header("X-Kite-Version", "3").header("Authorization", "token "+apiKey+":"...
[ "public", "Request", "createGetRequest", "(", "String", "url", ",", "String", "apiKey", ",", "String", "accessToken", ")", "{", "HttpUrl", ".", "Builder", "httpBuilder", "=", "HttpUrl", ".", "parse", "(", "url", ")", ".", "newBuilder", "(", ")", ";", "retu...
Creates a GET request. @param url is the endpoint to which request has to be done. @param apiKey is the api key of the Kite Connect app. @param accessToken is the access token obtained after successful login process.
[ "Creates", "a", "GET", "request", "." ]
train
https://github.com/zerodhatech/javakiteconnect/blob/4a3f15ff2c8a1b3b6ec61799f8bb047e4dfeb92d/kiteconnect/src/com/zerodhatech/kiteconnect/kitehttp/KiteRequestHandler.java#L158-L161
openwms/org.openwms
org.openwms.core.util/src/main/java/org/openwms/core/http/AbstractWebController.java
AbstractWebController.buildNOKResponseWithKey
protected <T extends AbstractBase> ResponseEntity<Response<T>> buildNOKResponseWithKey(HttpStatus code, String msg, String msgKey, T... params) { """ Build a response object that signals a not-okay response with a given status {@code code}. @param <T> Some type extending the AbstractBase entity @param code The...
java
protected <T extends AbstractBase> ResponseEntity<Response<T>> buildNOKResponseWithKey(HttpStatus code, String msg, String msgKey, T... params) { return buildResponse(code, msg, msgKey, params); }
[ "protected", "<", "T", "extends", "AbstractBase", ">", "ResponseEntity", "<", "Response", "<", "T", ">", ">", "buildNOKResponseWithKey", "(", "HttpStatus", "code", ",", "String", "msg", ",", "String", "msgKey", ",", "T", "...", "params", ")", "{", "return", ...
Build a response object that signals a not-okay response with a given status {@code code}. @param <T> Some type extending the AbstractBase entity @param code The status code to set as response code @param msg The error message passed to the caller @param msgKey The error message key passed to the caller @param params ...
[ "Build", "a", "response", "object", "that", "signals", "a", "not", "-", "okay", "response", "with", "a", "given", "status", "{", "@code", "code", "}", "." ]
train
https://github.com/openwms/org.openwms/blob/b24a95c5d09a7ec3c723d7e107d1cb0039d06a7e/org.openwms.core.util/src/main/java/org/openwms/core/http/AbstractWebController.java#L187-L189
orbisgis/h2gis
h2gis-functions/src/main/java/org/h2gis/functions/spatial/distance/ST_ClosestPoint.java
ST_ClosestPoint.closestPoint
public static Point closestPoint(Geometry geomA, Geometry geomB) { """ Returns the 2D point on geometry A that is closest to geometry B. @param geomA Geometry A @param geomB Geometry B @return The 2D point on geometry A that is closest to geometry B """ if (geomA == null || geomB == null) { ...
java
public static Point closestPoint(Geometry geomA, Geometry geomB) { if (geomA == null || geomB == null) { return null; } // Return the closest point on geomA. (We would have used index // 1 to return the closest point on geomB.) return geomA.getFactory().createPoint(Di...
[ "public", "static", "Point", "closestPoint", "(", "Geometry", "geomA", ",", "Geometry", "geomB", ")", "{", "if", "(", "geomA", "==", "null", "||", "geomB", "==", "null", ")", "{", "return", "null", ";", "}", "// Return the closest point on geomA. (We would have ...
Returns the 2D point on geometry A that is closest to geometry B. @param geomA Geometry A @param geomB Geometry B @return The 2D point on geometry A that is closest to geometry B
[ "Returns", "the", "2D", "point", "on", "geometry", "A", "that", "is", "closest", "to", "geometry", "B", "." ]
train
https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/distance/ST_ClosestPoint.java#L55-L62
Jasig/uPortal
uPortal-portlets/src/main/java/org/apereo/portal/portlets/search/SearchPortletController.java
SearchPortletController.calculateSearchLaunchUrl
private String calculateSearchLaunchUrl(RenderRequest request, RenderResponse response) { """ Create an actionUrl for the indicated portlet The resource URL is for the ajax typing search results response. @param request render request @param response render response """ final HttpServletRequest ht...
java
private String calculateSearchLaunchUrl(RenderRequest request, RenderResponse response) { final HttpServletRequest httpRequest = this.portalRequestUtils.getPortletHttpRequest(request); final IPortalUrlBuilder portalUrlBuilder = this.portalUrlProvider.getPortalUrlBuilderBy...
[ "private", "String", "calculateSearchLaunchUrl", "(", "RenderRequest", "request", ",", "RenderResponse", "response", ")", "{", "final", "HttpServletRequest", "httpRequest", "=", "this", ".", "portalRequestUtils", ".", "getPortletHttpRequest", "(", "request", ")", ";", ...
Create an actionUrl for the indicated portlet The resource URL is for the ajax typing search results response. @param request render request @param response render response
[ "Create", "an", "actionUrl", "for", "the", "indicated", "portlet", "The", "resource", "URL", "is", "for", "the", "ajax", "typing", "search", "results", "response", "." ]
train
https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-portlets/src/main/java/org/apereo/portal/portlets/search/SearchPortletController.java#L572-L579
xerial/snappy-java
src/main/java/org/xerial/snappy/SnappyOutputStream.java
SnappyOutputStream.rawWrite
public void rawWrite(Object array, int byteOffset, int byteLength) throws IOException { """ Compress the raw byte array data. @param array array data of any type (e.g., byte[], float[], long[], ...) @param byteOffset @param byteLength @throws IOException """ if (closed) { ...
java
public void rawWrite(Object array, int byteOffset, int byteLength) throws IOException { if (closed) { throw new IOException("Stream is closed"); } int cursor = 0; while (cursor < byteLength) { int readLen = Math.min(byteLength - cursor, blockSize -...
[ "public", "void", "rawWrite", "(", "Object", "array", ",", "int", "byteOffset", ",", "int", "byteLength", ")", "throws", "IOException", "{", "if", "(", "closed", ")", "{", "throw", "new", "IOException", "(", "\"Stream is closed\"", ")", ";", "}", "int", "c...
Compress the raw byte array data. @param array array data of any type (e.g., byte[], float[], long[], ...) @param byteOffset @param byteLength @throws IOException
[ "Compress", "the", "raw", "byte", "array", "data", "." ]
train
https://github.com/xerial/snappy-java/blob/9df6ed7bbce88186c82f2e7cdcb7b974421b3340/src/main/java/org/xerial/snappy/SnappyOutputStream.java#L279-L300