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
RestComm/sip-servlets
sip-servlets-spec/src/main/java/javax/servlet/sip/SipServlet.java
SipServlet.service
public void service(javax.servlet.ServletRequest req, javax.servlet.ServletResponse resp) throws javax.servlet.ServletException, java.io.IOException { """ Invoked to handle incoming SIP messages: requests or responses. Exactly one of the arguments is null: if the event is a request the response argument is null, a...
java
public void service(javax.servlet.ServletRequest req, javax.servlet.ServletResponse resp) throws javax.servlet.ServletException, java.io.IOException{ if (req != null) { doRequest((SipServletRequest) req); } else { SipServletResponse response = (SipServletResponse)resp; if(response.isBranchResponse()) { ...
[ "public", "void", "service", "(", "javax", ".", "servlet", ".", "ServletRequest", "req", ",", "javax", ".", "servlet", ".", "ServletResponse", "resp", ")", "throws", "javax", ".", "servlet", ".", "ServletException", ",", "java", ".", "io", ".", "IOException"...
Invoked to handle incoming SIP messages: requests or responses. Exactly one of the arguments is null: if the event is a request the response argument is null, and vice versa, if the event is a response the request argument is null. This method dispatched to doRequest() or doResponse() as appropriate. Servlets will not ...
[ "Invoked", "to", "handle", "incoming", "SIP", "messages", ":", "requests", "or", "responses", ".", "Exactly", "one", "of", "the", "arguments", "is", "null", ":", "if", "the", "event", "is", "a", "request", "the", "response", "argument", "is", "null", "and"...
train
https://github.com/RestComm/sip-servlets/blob/fd7011d2803ab1d205b140768a760c8c69e0c997/sip-servlets-spec/src/main/java/javax/servlet/sip/SipServlet.java#L326-L337
tvesalainen/lpg
src/main/java/org/vesalainen/regex/Regex.java
Regex.createNFA
public static NFA<Integer> createNFA(Scope<NFAState<Integer>> scope, String expression) { """ Creates an NFA from regular expression @param scope @param expression @return """ return createNFA(scope, expression, 1); }
java
public static NFA<Integer> createNFA(Scope<NFAState<Integer>> scope, String expression) { return createNFA(scope, expression, 1); }
[ "public", "static", "NFA", "<", "Integer", ">", "createNFA", "(", "Scope", "<", "NFAState", "<", "Integer", ">", ">", "scope", ",", "String", "expression", ")", "{", "return", "createNFA", "(", "scope", ",", "expression", ",", "1", ")", ";", "}" ]
Creates an NFA from regular expression @param scope @param expression @return
[ "Creates", "an", "NFA", "from", "regular", "expression" ]
train
https://github.com/tvesalainen/lpg/blob/0917b8d295e9772b9f8a0affc258a08530cd567a/src/main/java/org/vesalainen/regex/Regex.java#L1093-L1096
groovy/groovy-core
src/main/groovy/lang/Script.java
Script.invokeMethod
public Object invokeMethod(String name, Object args) { """ Invoke a method (or closure in the binding) defined. @param name method to call @param args arguments to pass to the method @return value """ try { return super.invokeMethod(name, args); } // if the method was n...
java
public Object invokeMethod(String name, Object args) { try { return super.invokeMethod(name, args); } // if the method was not found in the current scope (the script's methods) // let's try to see if there's a method closure with the same name in the binding catch (Mi...
[ "public", "Object", "invokeMethod", "(", "String", "name", ",", "Object", "args", ")", "{", "try", "{", "return", "super", ".", "invokeMethod", "(", "name", ",", "args", ")", ";", "}", "// if the method was not found in the current scope (the script's methods)", "//...
Invoke a method (or closure in the binding) defined. @param name method to call @param args arguments to pass to the method @return value
[ "Invoke", "a", "method", "(", "or", "closure", "in", "the", "binding", ")", "defined", "." ]
train
https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/groovy/lang/Script.java#L79-L101
cloudfoundry/uaa
server/src/main/java/org/cloudfoundry/identity/uaa/provider/saml/idp/IdpMetadataGenerator.java
IdpMetadataGenerator.getDiscoveryResponseURL
protected String getDiscoveryResponseURL(String entityBaseURL, String entityAlias) { """ Provides set discovery response url or generates a default when none was provided. Primarily value set on extenedMetadata property idpDiscoveryResponseURL is used, when empty local property customDiscoveryResponseURL is used...
java
protected String getDiscoveryResponseURL(String entityBaseURL, String entityAlias) { if (extendedMetadata != null && extendedMetadata.getIdpDiscoveryResponseURL() != null && extendedMetadata.getIdpDiscoveryResponseURL().length() > 0) { return extendedMetadata.getIdpDiscoveryResponseU...
[ "protected", "String", "getDiscoveryResponseURL", "(", "String", "entityBaseURL", ",", "String", "entityAlias", ")", "{", "if", "(", "extendedMetadata", "!=", "null", "&&", "extendedMetadata", ".", "getIdpDiscoveryResponseURL", "(", ")", "!=", "null", "&&", "extende...
Provides set discovery response url or generates a default when none was provided. Primarily value set on extenedMetadata property idpDiscoveryResponseURL is used, when empty local property customDiscoveryResponseURL is used, when empty URL is automatically generated. @param entityBaseURL base URL for generation of en...
[ "Provides", "set", "discovery", "response", "url", "or", "generates", "a", "default", "when", "none", "was", "provided", ".", "Primarily", "value", "set", "on", "extenedMetadata", "property", "idpDiscoveryResponseURL", "is", "used", "when", "empty", "local", "prop...
train
https://github.com/cloudfoundry/uaa/blob/e8df3d7060580c92d33461106399f9e4f36e3cd2/server/src/main/java/org/cloudfoundry/identity/uaa/provider/saml/idp/IdpMetadataGenerator.java#L795-L804
stephanenicolas/robospice
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/notifier/SpiceServiceListenerNotifier.java
SpiceServiceListenerNotifier.notifyObserversOfRequestNotFound
public void notifyObserversOfRequestNotFound(CachedSpiceRequest<?> request) { """ Inform the observers of a request. The observers can optionally observe the new request if required. @param request the request that couldn't be aggregated to another request. """ RequestProcessingContext requestProcess...
java
public void notifyObserversOfRequestNotFound(CachedSpiceRequest<?> request) { RequestProcessingContext requestProcessingContext = new RequestProcessingContext(); requestProcessingContext.setExecutionThread(Thread.currentThread()); post(new RequestNotFoundNotifier(request, spiceServiceListenerLis...
[ "public", "void", "notifyObserversOfRequestNotFound", "(", "CachedSpiceRequest", "<", "?", ">", "request", ")", "{", "RequestProcessingContext", "requestProcessingContext", "=", "new", "RequestProcessingContext", "(", ")", ";", "requestProcessingContext", ".", "setExecution...
Inform the observers of a request. The observers can optionally observe the new request if required. @param request the request that couldn't be aggregated to another request.
[ "Inform", "the", "observers", "of", "a", "request", ".", "The", "observers", "can", "optionally", "observe", "the", "new", "request", "if", "required", "." ]
train
https://github.com/stephanenicolas/robospice/blob/8bffde88b3534a961a13cab72a8f07a755f0a0fe/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/notifier/SpiceServiceListenerNotifier.java#L56-L60
ManfredTremmel/gwt-commons-lang3
src/main/java/org/apache/commons/lang3/time/DateUtils.java
DateUtils.getFragmentInDays
@GwtIncompatible("incompatible method") public static long getFragmentInDays(final Date date, final int fragment) { """ <p>Returns the number of days within the fragment. All datefields greater than the fragment will be ignored.</p> <p>Asking the days of any date will only return the number of days of the...
java
@GwtIncompatible("incompatible method") public static long getFragmentInDays(final Date date, final int fragment) { return getFragment(date, fragment, TimeUnit.DAYS); }
[ "@", "GwtIncompatible", "(", "\"incompatible method\"", ")", "public", "static", "long", "getFragmentInDays", "(", "final", "Date", "date", ",", "final", "int", "fragment", ")", "{", "return", "getFragment", "(", "date", ",", "fragment", ",", "TimeUnit", ".", ...
<p>Returns the number of days within the fragment. All datefields greater than the fragment will be ignored.</p> <p>Asking the days of any date will only return the number of days of the current month (resulting in a number between 1 and 31). This method will retrieve the number of days for any fragment. For example, ...
[ "<p", ">", "Returns", "the", "number", "of", "days", "within", "the", "fragment", ".", "All", "datefields", "greater", "than", "the", "fragment", "will", "be", "ignored", ".", "<", "/", "p", ">" ]
train
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/time/DateUtils.java#L1452-L1455
mikepenz/FastAdapter
library-core/src/main/java/com/mikepenz/fastadapter/FastAdapter.java
FastAdapter.getItemById
@SuppressWarnings("unchecked") public Pair<Item, Integer> getItemById(final long identifier) { """ gets the IItem given an identifier, from all registered adapters @param identifier the identifier of the searched item @return the found Pair&lt;IItem, Integer&gt; (the found item, and it's global position if...
java
@SuppressWarnings("unchecked") public Pair<Item, Integer> getItemById(final long identifier) { if (identifier == -1) { return null; } Triple result = recursive(new AdapterPredicate() { @Override public boolean apply(@NonNull IAdapter lastParentAdapter, int...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "Pair", "<", "Item", ",", "Integer", ">", "getItemById", "(", "final", "long", "identifier", ")", "{", "if", "(", "identifier", "==", "-", "1", ")", "{", "return", "null", ";", "}", "Triple", ...
gets the IItem given an identifier, from all registered adapters @param identifier the identifier of the searched item @return the found Pair&lt;IItem, Integer&gt; (the found item, and it's global position if it is currently displayed) or null
[ "gets", "the", "IItem", "given", "an", "identifier", "from", "all", "registered", "adapters" ]
train
https://github.com/mikepenz/FastAdapter/blob/3b2412abe001ba58422e0125846b704d4dba4ae9/library-core/src/main/java/com/mikepenz/fastadapter/FastAdapter.java#L867-L883
structurizr/java
structurizr-core/src/com/structurizr/view/ViewSet.java
ViewSet.createDynamicView
public DynamicView createDynamicView(SoftwareSystem softwareSystem, String key, String description) { """ Creates a dynamic view, where the scope is the specified software system. The following elements can be added to the resulting view: <ul> <li>People</li> <li>Software systems</li> <li>Containers that re...
java
public DynamicView createDynamicView(SoftwareSystem softwareSystem, String key, String description) { assertThatTheSoftwareSystemIsNotNull(softwareSystem); assertThatTheViewKeyIsSpecifiedAndUnique(key); DynamicView view = new DynamicView(softwareSystem, key, description); view.setViewSe...
[ "public", "DynamicView", "createDynamicView", "(", "SoftwareSystem", "softwareSystem", ",", "String", "key", ",", "String", "description", ")", "{", "assertThatTheSoftwareSystemIsNotNull", "(", "softwareSystem", ")", ";", "assertThatTheViewKeyIsSpecifiedAndUnique", "(", "ke...
Creates a dynamic view, where the scope is the specified software system. The following elements can be added to the resulting view: <ul> <li>People</li> <li>Software systems</li> <li>Containers that reside inside the specified software system</li> </ul> @param softwareSystem the SoftwareSystem object representing...
[ "Creates", "a", "dynamic", "view", "where", "the", "scope", "is", "the", "specified", "software", "system", ".", "The", "following", "elements", "can", "be", "added", "to", "the", "resulting", "view", ":" ]
train
https://github.com/structurizr/java/blob/4b204f077877a24bcac363f5ecf0e129a0f9f4c5/structurizr-core/src/com/structurizr/view/ViewSet.java#L152-L160
matthewhorridge/owlapi-gwt
owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLEquivalentClassesAxiomImpl_CustomFieldSerializer.java
OWLEquivalentClassesAxiomImpl_CustomFieldSerializer.serializeInstance
@Override public void serializeInstance(SerializationStreamWriter streamWriter, OWLEquivalentClassesAxiomImpl instance) throws SerializationException { """ Serializes the content of the object into the {@link com.google.gwt.user.client.rpc.SerializationStreamWriter}. @param streamWriter the {@link com.goog...
java
@Override public void serializeInstance(SerializationStreamWriter streamWriter, OWLEquivalentClassesAxiomImpl instance) throws SerializationException { serialize(streamWriter, instance); }
[ "@", "Override", "public", "void", "serializeInstance", "(", "SerializationStreamWriter", "streamWriter", ",", "OWLEquivalentClassesAxiomImpl", "instance", ")", "throws", "SerializationException", "{", "serialize", "(", "streamWriter", ",", "instance", ")", ";", "}" ]
Serializes the content of the object into the {@link com.google.gwt.user.client.rpc.SerializationStreamWriter}. @param streamWriter the {@link com.google.gwt.user.client.rpc.SerializationStreamWriter} to write the object's content to @param instance the object instance to serialize @throws com.google.gwt.user.clie...
[ "Serializes", "the", "content", "of", "the", "object", "into", "the", "{", "@link", "com", ".", "google", ".", "gwt", ".", "user", ".", "client", ".", "rpc", ".", "SerializationStreamWriter", "}", "." ]
train
https://github.com/matthewhorridge/owlapi-gwt/blob/7ab975fb6cef3c8947099983551672a3b5d4e2fd/owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLEquivalentClassesAxiomImpl_CustomFieldSerializer.java#L74-L77
marklogic/java-client-api
marklogic-client-api/src/main/java/com/marklogic/client/example/cookbook/datamovement/JobInformationRecorder.java
JobInformationRecorder.withProperty
public JobInformationRecorder withProperty(Map<String, String> properties) { """ Sets the map of key value pairs to the job information. This would be persisted along with the other job information like start time, end time etc. This would clear any key value property set before and initialize the properties wit...
java
public JobInformationRecorder withProperty(Map<String, String> properties) { if(sourceBatcher.isStarted()) throw new IllegalStateException("Configuration cannot be changed after startJob has been called"); this.properties.clear(); this.properties.putAll(properties); return this; }
[ "public", "JobInformationRecorder", "withProperty", "(", "Map", "<", "String", ",", "String", ">", "properties", ")", "{", "if", "(", "sourceBatcher", ".", "isStarted", "(", ")", ")", "throw", "new", "IllegalStateException", "(", "\"Configuration cannot be changed a...
Sets the map of key value pairs to the job information. This would be persisted along with the other job information like start time, end time etc. This would clear any key value property set before and initialize the properties with this map. @param properties map of Key value pairs @return
[ "Sets", "the", "map", "of", "key", "value", "pairs", "to", "the", "job", "information", ".", "This", "would", "be", "persisted", "along", "with", "the", "other", "job", "information", "like", "start", "time", "end", "time", "etc", ".", "This", "would", "...
train
https://github.com/marklogic/java-client-api/blob/acf60229a928abd4a8cc4b21b641d56957467da7/marklogic-client-api/src/main/java/com/marklogic/client/example/cookbook/datamovement/JobInformationRecorder.java#L215-L220
finmath/finmath-lib
src/main/java/net/finmath/montecarlo/interestrate/products/SwaptionWithComponents.java
SwaptionWithComponents.getValue
@Override public RandomVariable getValue(double evaluationTime, LIBORModelMonteCarloSimulationModel model) throws CalculationException { """ This method returns the value random variable of the product within the specified model, evaluated at a given evalutationTime. Note: For a lattice this is often the value c...
java
@Override public RandomVariable getValue(double evaluationTime, LIBORModelMonteCarloSimulationModel model) throws CalculationException { RandomVariable values = option.getValue(evaluationTime, model); return values; }
[ "@", "Override", "public", "RandomVariable", "getValue", "(", "double", "evaluationTime", ",", "LIBORModelMonteCarloSimulationModel", "model", ")", "throws", "CalculationException", "{", "RandomVariable", "values", "=", "option", ".", "getValue", "(", "evaluationTime", ...
This method returns the value random variable of the product within the specified model, evaluated at a given evalutationTime. Note: For a lattice this is often the value conditional to evalutationTime, for a Monte-Carlo simulation this is the (sum of) value discounted to evaluation time. Cashflows prior evaluationTime...
[ "This", "method", "returns", "the", "value", "random", "variable", "of", "the", "product", "within", "the", "specified", "model", "evaluated", "at", "a", "given", "evalutationTime", ".", "Note", ":", "For", "a", "lattice", "this", "is", "often", "the", "valu...
train
https://github.com/finmath/finmath-lib/blob/a3c067d52dd33feb97d851df6cab130e4116759f/src/main/java/net/finmath/montecarlo/interestrate/products/SwaptionWithComponents.java#L93-L98
jenkinsci/artifactory-plugin
src/main/java/org/jfrog/hudson/util/converters/DeployerResolverOverriderConverter.java
DeployerResolverOverriderConverter.overrideDeploymentProperties
private void overrideDeploymentProperties(T overrider, Class overriderClass) { """ Convert the String matrixParams parameter to String deploymentProperties This convertion comes after a name change (matrixParams -> deploymentProperties) """ if (!overriderClass.getSimpleName().equals(ArtifactoryMaven3N...
java
private void overrideDeploymentProperties(T overrider, Class overriderClass) { if (!overriderClass.getSimpleName().equals(ArtifactoryMaven3NativeConfigurator.class.getSimpleName())) { try { Field deploymentPropertiesField = overriderClass.getDeclaredField("deploymentProperties"); ...
[ "private", "void", "overrideDeploymentProperties", "(", "T", "overrider", ",", "Class", "overriderClass", ")", "{", "if", "(", "!", "overriderClass", ".", "getSimpleName", "(", ")", ".", "equals", "(", "ArtifactoryMaven3NativeConfigurator", ".", "class", ".", "get...
Convert the String matrixParams parameter to String deploymentProperties This convertion comes after a name change (matrixParams -> deploymentProperties)
[ "Convert", "the", "String", "matrixParams", "parameter", "to", "String", "deploymentProperties", "This", "convertion", "comes", "after", "a", "name", "change", "(", "matrixParams", "-", ">", "deploymentProperties", ")" ]
train
https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/util/converters/DeployerResolverOverriderConverter.java#L206-L225
OpenLiberty/open-liberty
dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/shared/util/WebConfigParamUtils.java
WebConfigParamUtils.getStringInitParameter
public static String getStringInitParameter(ExternalContext context, String[] names) { """ Gets the String init parameter value from the specified context. If the parameter is an empty String or a String containing only white space, this method returns <code>null</code> @param context the application's exter...
java
public static String getStringInitParameter(ExternalContext context, String[] names) { return getStringInitParameter(context, names, null); }
[ "public", "static", "String", "getStringInitParameter", "(", "ExternalContext", "context", ",", "String", "[", "]", "names", ")", "{", "return", "getStringInitParameter", "(", "context", ",", "names", ",", "null", ")", ";", "}" ]
Gets the String init parameter value from the specified context. If the parameter is an empty String or a String containing only white space, this method returns <code>null</code> @param context the application's external context @param names the init parameter's names, the first one is scanned first. Usually used whe...
[ "Gets", "the", "String", "init", "parameter", "value", "from", "the", "specified", "context", ".", "If", "the", "parameter", "is", "an", "empty", "String", "or", "a", "String", "containing", "only", "white", "space", "this", "method", "returns", "<code", ">"...
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/shared/util/WebConfigParamUtils.java#L108-L111
RobotiumTech/robotium
robotium-solo/src/main/java/com/robotium/solo/Waiter.java
Waiter.waitForLogMessage
public boolean waitForLogMessage(String logMessage, int timeout) { """ Waits for a log message to appear. Requires read logs permission (android.permission.READ_LOGS) in AndroidManifest.xml of the application under test. @param logMessage the log message to wait for @param timeout the amount of time in millis...
java
public boolean waitForLogMessage(String logMessage, int timeout){ StringBuilder stringBuilder = new StringBuilder(); long endTime = SystemClock.uptimeMillis() + timeout; while (SystemClock.uptimeMillis() <= endTime) { if(getLog(stringBuilder).lastIndexOf(logMessage) != -1){ return true; } sleeper.s...
[ "public", "boolean", "waitForLogMessage", "(", "String", "logMessage", ",", "int", "timeout", ")", "{", "StringBuilder", "stringBuilder", "=", "new", "StringBuilder", "(", ")", ";", "long", "endTime", "=", "SystemClock", ".", "uptimeMillis", "(", ")", "+", "ti...
Waits for a log message to appear. Requires read logs permission (android.permission.READ_LOGS) in AndroidManifest.xml of the application under test. @param logMessage the log message to wait for @param timeout the amount of time in milliseconds to wait @return true if log message appears and false if it does not appe...
[ "Waits", "for", "a", "log", "message", "to", "appear", ".", "Requires", "read", "logs", "permission", "(", "android", ".", "permission", ".", "READ_LOGS", ")", "in", "AndroidManifest", ".", "xml", "of", "the", "application", "under", "test", "." ]
train
https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Waiter.java#L730-L742
sebastiangraf/perfidix
src/main/java/org/perfidix/element/BenchmarkExecutor.java
BenchmarkExecutor.executeBench
public void executeBench(final Object objToExecute, final Object... args) { """ Execution of bench method. All data is stored corresponding to the meters. @param objToExecute the instance of the benchclass where the method should be executed with. @param args arguments for the method to execure """...
java
public void executeBench(final Object objToExecute, final Object... args) { final double[] meterResults = new double[METERS_TO_BENCH.size()]; final Method meth = element.getMethodToBench(); int meterIndex1 = 0; int meterIndex2 = 0; for (final AbstractMeter meter : METERS_TO_BE...
[ "public", "void", "executeBench", "(", "final", "Object", "objToExecute", ",", "final", "Object", "...", "args", ")", "{", "final", "double", "[", "]", "meterResults", "=", "new", "double", "[", "METERS_TO_BENCH", ".", "size", "(", ")", "]", ";", "final", ...
Execution of bench method. All data is stored corresponding to the meters. @param objToExecute the instance of the benchclass where the method should be executed with. @param args arguments for the method to execure
[ "Execution", "of", "bench", "method", ".", "All", "data", "is", "stored", "corresponding", "to", "the", "meters", "." ]
train
https://github.com/sebastiangraf/perfidix/blob/f13aa793b6a3055215ed4edbb946c1bb5d564886/src/main/java/org/perfidix/element/BenchmarkExecutor.java#L226-L256
facebookarchive/hadoop-20
src/contrib/corona/src/java/org/apache/hadoop/mapred/CoronaJobTracker.java
CoronaJobTracker.updateTaskStatus
private void updateTaskStatus(TaskTrackerInfo info, TaskStatus report) { """ Updates job and tasks state according to TaskStatus from given TaskTracker. This function only updates internal job state, it shall NOT issue any actions directly. @param info TaskTrackerInfo object @param report TaskStatus report ...
java
private void updateTaskStatus(TaskTrackerInfo info, TaskStatus report) { TaskAttemptID taskId = report.getTaskID(); // Here we want strict job id comparison. if (!this.jobId.equals(taskId.getJobID())) { LOG.warn("Task " + taskId + " belongs to unknown job " + taskId.getJobID()); retur...
[ "private", "void", "updateTaskStatus", "(", "TaskTrackerInfo", "info", ",", "TaskStatus", "report", ")", "{", "TaskAttemptID", "taskId", "=", "report", ".", "getTaskID", "(", ")", ";", "// Here we want strict job id comparison.", "if", "(", "!", "this", ".", "jobI...
Updates job and tasks state according to TaskStatus from given TaskTracker. This function only updates internal job state, it shall NOT issue any actions directly. @param info TaskTrackerInfo object @param report TaskStatus report
[ "Updates", "job", "and", "tasks", "state", "according", "to", "TaskStatus", "from", "given", "TaskTracker", ".", "This", "function", "only", "updates", "internal", "job", "state", "it", "shall", "NOT", "issue", "any", "actions", "directly", "." ]
train
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/mapred/CoronaJobTracker.java#L1953-L1987
hankcs/HanLP
src/main/java/com/hankcs/hanlp/model/perceptron/PerceptronClassifier.java
PerceptronClassifier.train
public BinaryClassificationFMeasure train(String corpus, int maxIteration, boolean averagePerceptron) { """ 训练 @param corpus 语料库 @param maxIteration 最大迭代次数 @param averagePerceptron 是否使用平均感知机算法 @return 模型在训练集上的准确率 """ FeatureMap featureMap = new LockableFeatureMap(new TagSet(TaskTy...
java
public BinaryClassificationFMeasure train(String corpus, int maxIteration, boolean averagePerceptron) { FeatureMap featureMap = new LockableFeatureMap(new TagSet(TaskType.CLASSIFICATION)); featureMap.mutable = true; // 训练时特征映射可拓充 Instance[] instanceList = readInstance(corpus, featureMap); ...
[ "public", "BinaryClassificationFMeasure", "train", "(", "String", "corpus", ",", "int", "maxIteration", ",", "boolean", "averagePerceptron", ")", "{", "FeatureMap", "featureMap", "=", "new", "LockableFeatureMap", "(", "new", "TagSet", "(", "TaskType", ".", "CLASSIFI...
训练 @param corpus 语料库 @param maxIteration 最大迭代次数 @param averagePerceptron 是否使用平均感知机算法 @return 模型在训练集上的准确率
[ "训练" ]
train
https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/model/perceptron/PerceptronClassifier.java#L122-L131
xcesco/kripton
kripton/src/main/java/com/abubusoft/kripton/xml/XMLSerializer.java
XMLSerializer.writeBooleanAttribute
public void writeBooleanAttribute(String prefix, String namespaceURI, String localName, boolean value) throws Exception { """ Write boolean attribute. @param prefix the prefix @param namespaceURI the namespace URI @param localName the local name @param value the value @throws Exception the exception """...
java
public void writeBooleanAttribute(String prefix, String namespaceURI, String localName, boolean value) throws Exception { this.attribute(namespaceURI, localName, Boolean.toString(value)); }
[ "public", "void", "writeBooleanAttribute", "(", "String", "prefix", ",", "String", "namespaceURI", ",", "String", "localName", ",", "boolean", "value", ")", "throws", "Exception", "{", "this", ".", "attribute", "(", "namespaceURI", ",", "localName", ",", "Boolea...
Write boolean attribute. @param prefix the prefix @param namespaceURI the namespace URI @param localName the local name @param value the value @throws Exception the exception
[ "Write", "boolean", "attribute", "." ]
train
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton/src/main/java/com/abubusoft/kripton/xml/XMLSerializer.java#L1707-L1710
ReactiveX/RxJavaAsyncUtil
src/main/java/rx/util/async/Async.java
Async.runAsync
public static <T> StoppableObservable<T> runAsync(Scheduler scheduler, final Action2<? super Observer<? super T>, ? super Subscription> action) { """ Runs the provided action on the given scheduler and allows propagation of multiple events to the observers of the returned StoppableObservable. The act...
java
public static <T> StoppableObservable<T> runAsync(Scheduler scheduler, final Action2<? super Observer<? super T>, ? super Subscription> action) { return runAsync(scheduler, PublishSubject.<T>create(), action); }
[ "public", "static", "<", "T", ">", "StoppableObservable", "<", "T", ">", "runAsync", "(", "Scheduler", "scheduler", ",", "final", "Action2", "<", "?", "super", "Observer", "<", "?", "super", "T", ">", ",", "?", "super", "Subscription", ">", "action", ")"...
Runs the provided action on the given scheduler and allows propagation of multiple events to the observers of the returned StoppableObservable. The action is immediately executed and unobserved values will be lost. @param <T> the output value type @param scheduler the Scheduler where the action is executed @param acti...
[ "Runs", "the", "provided", "action", "on", "the", "given", "scheduler", "and", "allows", "propagation", "of", "multiple", "events", "to", "the", "observers", "of", "the", "returned", "StoppableObservable", ".", "The", "action", "is", "immediately", "executed", "...
train
https://github.com/ReactiveX/RxJavaAsyncUtil/blob/6294e1da30e639df79f76399906229314c14e74d/src/main/java/rx/util/async/Async.java#L2093-L2096
stapler/stapler
core/src/main/java/org/kohsuke/stapler/Function.java
Function.bindAndInvoke
Object bindAndInvoke(Object o, StaplerRequest req, StaplerResponse rsp, Object... headArgs) throws IllegalAccessException, InvocationTargetException, ServletException { """ Use the given arguments as the first N arguments, then figure out the rest of the arguments by looking at parameter annotations, then finall...
java
Object bindAndInvoke(Object o, StaplerRequest req, StaplerResponse rsp, Object... headArgs) throws IllegalAccessException, InvocationTargetException, ServletException { Class[] types = getParameterTypes(); Annotation[][] annotations = getParameterAnnotations(); String[] parameterNames = getParam...
[ "Object", "bindAndInvoke", "(", "Object", "o", ",", "StaplerRequest", "req", ",", "StaplerResponse", "rsp", ",", "Object", "...", "headArgs", ")", "throws", "IllegalAccessException", ",", "InvocationTargetException", ",", "ServletException", "{", "Class", "[", "]", ...
Use the given arguments as the first N arguments, then figure out the rest of the arguments by looking at parameter annotations, then finally call {@link #invoke}.
[ "Use", "the", "given", "arguments", "as", "the", "first", "N", "arguments", "then", "figure", "out", "the", "rest", "of", "the", "arguments", "by", "looking", "at", "parameter", "annotations", "then", "finally", "call", "{" ]
train
https://github.com/stapler/stapler/blob/11ad5af185e062fb46e01bf9fbed66f3ebf2a8f7/core/src/main/java/org/kohsuke/stapler/Function.java#L174-L213
contentful/contentful-management.java
src/main/java/com/contentful/java/cma/AbsModule.java
AbsModule.defer
<R> CMACallback<R> defer(DefFunc<R> func, CMACallback<R> callback) { """ Creates an Observable with the given {@code func} function and subscribes to it with a set of pre-defined actions. The provided {@code callback} will be passed to these actions in order to populate the events. """ assertNotNull(call...
java
<R> CMACallback<R> defer(DefFunc<R> func, CMACallback<R> callback) { assertNotNull(callback, "callback"); Observable.defer(func) .subscribeOn(Schedulers.io()) .subscribe( new ActionSuccess<R>(callbackExecutor, callback), new ActionError(callbackExecutor, callback)); r...
[ "<", "R", ">", "CMACallback", "<", "R", ">", "defer", "(", "DefFunc", "<", "R", ">", "func", ",", "CMACallback", "<", "R", ">", "callback", ")", "{", "assertNotNull", "(", "callback", ",", "\"callback\"", ")", ";", "Observable", ".", "defer", "(", "f...
Creates an Observable with the given {@code func} function and subscribes to it with a set of pre-defined actions. The provided {@code callback} will be passed to these actions in order to populate the events.
[ "Creates", "an", "Observable", "with", "the", "given", "{" ]
train
https://github.com/contentful/contentful-management.java/blob/ca310fb9ea9577fcff0ca57949ab7c2315fa2534/src/main/java/com/contentful/java/cma/AbsModule.java#L112-L120
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/common/logging/messages/consumer/ConsumerLogMessages.java
ConsumerLogMessages.logError
public static void logError(final Logger logger, final Error e) { """ Logs an error. @param logger reference to the logger @param e reference to the error """ logger.logError(Level.ERROR, "Unexpected Error", e); }
java
public static void logError(final Logger logger, final Error e) { logger.logError(Level.ERROR, "Unexpected Error", e); }
[ "public", "static", "void", "logError", "(", "final", "Logger", "logger", ",", "final", "Error", "e", ")", "{", "logger", ".", "logError", "(", "Level", ".", "ERROR", ",", "\"Unexpected Error\"", ",", "e", ")", ";", "}" ]
Logs an error. @param logger reference to the logger @param e reference to the error
[ "Logs", "an", "error", "." ]
train
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/common/logging/messages/consumer/ConsumerLogMessages.java#L54-L57
belaban/JGroups
src/org/jgroups/Message.java
Message.setBuffer
public Message setBuffer(byte[] b, int offset, int length) { """ Sets the internal buffer to point to a subset of a given buffer.<p/> <em> Note that the byte[] buffer passed as argument must not be modified. Reason: if we retransmit the message, it would still have a ref to the original byte[] buffer passed in ...
java
public Message setBuffer(byte[] b, int offset, int length) { buf=b; if(buf != null) { if(offset < 0 || offset > buf.length) throw new ArrayIndexOutOfBoundsException(offset); if((offset + length) > buf.length) throw new ArrayIndexOutOfBoundsExceptio...
[ "public", "Message", "setBuffer", "(", "byte", "[", "]", "b", ",", "int", "offset", ",", "int", "length", ")", "{", "buf", "=", "b", ";", "if", "(", "buf", "!=", "null", ")", "{", "if", "(", "offset", "<", "0", "||", "offset", ">", "buf", ".", ...
Sets the internal buffer to point to a subset of a given buffer.<p/> <em> Note that the byte[] buffer passed as argument must not be modified. Reason: if we retransmit the message, it would still have a ref to the original byte[] buffer passed in as argument, and so we would retransmit a changed byte[] buffer ! </em> ...
[ "Sets", "the", "internal", "buffer", "to", "point", "to", "a", "subset", "of", "a", "given", "buffer", ".", "<p", "/", ">", "<em", ">", "Note", "that", "the", "byte", "[]", "buffer", "passed", "as", "argument", "must", "not", "be", "modified", ".", "...
train
https://github.com/belaban/JGroups/blob/bd3ca786aa57fed41dfbc10a94b1281e388be03b/src/org/jgroups/Message.java#L245-L258
biojava/biojava
biojava-survival/src/main/java/org/biojava/nbio/survival/data/WorkSheet.java
WorkSheet.readCSV
static public WorkSheet readCSV(String fileName, char delimiter) throws Exception { """ Read a CSV/Tab delimitted file where you pass in the delimiter @param fileName @param delimiter @return @throws Exception """ return readCSV(new File(fileName), delimiter); }
java
static public WorkSheet readCSV(String fileName, char delimiter) throws Exception { return readCSV(new File(fileName), delimiter); }
[ "static", "public", "WorkSheet", "readCSV", "(", "String", "fileName", ",", "char", "delimiter", ")", "throws", "Exception", "{", "return", "readCSV", "(", "new", "File", "(", "fileName", ")", ",", "delimiter", ")", ";", "}" ]
Read a CSV/Tab delimitted file where you pass in the delimiter @param fileName @param delimiter @return @throws Exception
[ "Read", "a", "CSV", "/", "Tab", "delimitted", "file", "where", "you", "pass", "in", "the", "delimiter" ]
train
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-survival/src/main/java/org/biojava/nbio/survival/data/WorkSheet.java#L1452-L1456
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/xtal/CrystalTransform.java
CrystalTransform.getTranslScrewComponent
public static Vector3d getTranslScrewComponent(Matrix4d m) { """ Given a transformation matrix containing a rotation and translation returns the screw component of the rotation. See http://www.crystallography.fr/mathcryst/pdf/Gargnano/Aroyo_Gargnano_1.pdf @param m @return """ int foldType = SpaceGroup.g...
java
public static Vector3d getTranslScrewComponent(Matrix4d m) { int foldType = SpaceGroup.getRotAxisType(m); // For reference see: // http://www.crystallography.fr/mathcryst/pdf/Gargnano/Aroyo_Gargnano_1.pdf Vector3d transl = null; Matrix3d W = new Matrix3d(m.m00,m.m01,m.m02, m.m10,m.m11,m.m12, ...
[ "public", "static", "Vector3d", "getTranslScrewComponent", "(", "Matrix4d", "m", ")", "{", "int", "foldType", "=", "SpaceGroup", ".", "getRotAxisType", "(", "m", ")", ";", "// For reference see:", "// http://www.crystallography.fr/mathcryst/pdf/Gargnano/Aroyo_Gargnano_1.pdf",...
Given a transformation matrix containing a rotation and translation returns the screw component of the rotation. See http://www.crystallography.fr/mathcryst/pdf/Gargnano/Aroyo_Gargnano_1.pdf @param m @return
[ "Given", "a", "transformation", "matrix", "containing", "a", "rotation", "and", "translation", "returns", "the", "screw", "component", "of", "the", "rotation", ".", "See", "http", ":", "//", "www", ".", "crystallography", ".", "fr", "/", "mathcryst", "/", "p...
train
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/xtal/CrystalTransform.java#L464-L509
jOOQ/jOOL
jOOL-java-8/src/main/java/org/jooq/lambda/Unchecked.java
Unchecked.doubleToIntFunction
public static DoubleToIntFunction doubleToIntFunction(CheckedDoubleToIntFunction function, Consumer<Throwable> handler) { """ Wrap a {@link CheckedDoubleToIntFunction} in a {@link DoubleToIntFunction} with a custom handler for checked exceptions. <p> Example: <code><pre> DoubleStream.of(1.0, 2.0, 3.0).mapToInt...
java
public static DoubleToIntFunction doubleToIntFunction(CheckedDoubleToIntFunction function, Consumer<Throwable> handler) { return t -> { try { return function.applyAsInt(t); } catch (Throwable e) { handler.accept(e); throw new I...
[ "public", "static", "DoubleToIntFunction", "doubleToIntFunction", "(", "CheckedDoubleToIntFunction", "function", ",", "Consumer", "<", "Throwable", ">", "handler", ")", "{", "return", "t", "->", "{", "try", "{", "return", "function", ".", "applyAsInt", "(", "t", ...
Wrap a {@link CheckedDoubleToIntFunction} in a {@link DoubleToIntFunction} with a custom handler for checked exceptions. <p> Example: <code><pre> DoubleStream.of(1.0, 2.0, 3.0).mapToInt(Unchecked.doubleToIntFunction( d -> { if (d &lt; 0.0) throw new Exception("Only positive numbers allowed"); return (int) d; }, e -> {...
[ "Wrap", "a", "{", "@link", "CheckedDoubleToIntFunction", "}", "in", "a", "{", "@link", "DoubleToIntFunction", "}", "with", "a", "custom", "handler", "for", "checked", "exceptions", ".", "<p", ">", "Example", ":", "<code", ">", "<pre", ">", "DoubleStream", "....
train
https://github.com/jOOQ/jOOL/blob/889d87c85ca57bafd4eddd78e0f7ae2804d2ee86/jOOL-java-8/src/main/java/org/jooq/lambda/Unchecked.java#L1403-L1414
yidongnan/grpc-spring-boot-starter
grpc-server-spring-boot-autoconfigure/src/main/java/net/devh/boot/grpc/server/security/interceptors/ExceptionTranslatingServerInterceptor.java
ExceptionTranslatingServerInterceptor.closeCallAccessDenied
protected void closeCallAccessDenied(final ServerCall<?, ?> call, final AccessDeniedException aex) { """ Close the call with {@link Status#PERMISSION_DENIED}. @param call The call to close. @param aex The exception that was the cause. """ call.close(Status.PERMISSION_DENIED.withCause(aex).withDescr...
java
protected void closeCallAccessDenied(final ServerCall<?, ?> call, final AccessDeniedException aex) { call.close(Status.PERMISSION_DENIED.withCause(aex).withDescription(ACCESS_DENIED_DESCRIPTION), new Metadata()); }
[ "protected", "void", "closeCallAccessDenied", "(", "final", "ServerCall", "<", "?", ",", "?", ">", "call", ",", "final", "AccessDeniedException", "aex", ")", "{", "call", ".", "close", "(", "Status", ".", "PERMISSION_DENIED", ".", "withCause", "(", "aex", ")...
Close the call with {@link Status#PERMISSION_DENIED}. @param call The call to close. @param aex The exception that was the cause.
[ "Close", "the", "call", "with", "{", "@link", "Status#PERMISSION_DENIED", "}", "." ]
train
https://github.com/yidongnan/grpc-spring-boot-starter/blob/07f8853cfafc9707584f2371aff012e590217b85/grpc-server-spring-boot-autoconfigure/src/main/java/net/devh/boot/grpc/server/security/interceptors/ExceptionTranslatingServerInterceptor.java#L87-L89
wkgcass/Style
src/main/java/net/cassite/style/IfBlock.java
IfBlock.ElseIf
public IfBlock<T, INIT> ElseIf(RFunc0<INIT> init, T val) { """ define an ElseIf block.<br> @param init lambda expression returns an object or boolean value, init==null || init.equals(false) will be considered <b>false</b> in traditional if expression. in other cases, considered true @param val return val i...
java
public IfBlock<T, INIT> ElseIf(RFunc0<INIT> init, T val) { return ElseIf(init, () -> val); }
[ "public", "IfBlock", "<", "T", ",", "INIT", ">", "ElseIf", "(", "RFunc0", "<", "INIT", ">", "init", ",", "T", "val", ")", "{", "return", "ElseIf", "(", "init", ",", "(", ")", "->", "val", ")", ";", "}" ]
define an ElseIf block.<br> @param init lambda expression returns an object or boolean value, init==null || init.equals(false) will be considered <b>false</b> in traditional if expression. in other cases, considered true @param val return val if init is considered true @return if body
[ "define", "an", "ElseIf", "block", ".", "<br", ">" ]
train
https://github.com/wkgcass/Style/blob/db3ea64337251f46f734279480e365293bececbd/src/main/java/net/cassite/style/IfBlock.java#L177-L179
wildfly/wildfly-core
controller/src/main/java/org/jboss/as/controller/AttributeDefinition.java
AttributeDefinition.getAttributeTextDescription
public String getAttributeTextDescription(final ResourceBundle bundle, final String prefix) { """ Gets localized text from the given {@link java.util.ResourceBundle} for the attribute. @param bundle the resource bundle. Cannot be {@code null} @param prefix a prefix to dot-prepend to the attribute name to form ...
java
public String getAttributeTextDescription(final ResourceBundle bundle, final String prefix) { final String bundleKey = prefix == null ? name : (prefix + "." + name); return bundle.getString(bundleKey); }
[ "public", "String", "getAttributeTextDescription", "(", "final", "ResourceBundle", "bundle", ",", "final", "String", "prefix", ")", "{", "final", "String", "bundleKey", "=", "prefix", "==", "null", "?", "name", ":", "(", "prefix", "+", "\".\"", "+", "name", ...
Gets localized text from the given {@link java.util.ResourceBundle} for the attribute. @param bundle the resource bundle. Cannot be {@code null} @param prefix a prefix to dot-prepend to the attribute name to form a key to resolve in the bundle @return the resolved text
[ "Gets", "localized", "text", "from", "the", "given", "{", "@link", "java", ".", "util", ".", "ResourceBundle", "}", "for", "the", "attribute", "." ]
train
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/AttributeDefinition.java#L912-L915
akquinet/androlog
androlog/src/main/java/de/akquinet/android/androlog/Log.java
Log.isLoggable
public static boolean isLoggable(String tag, int level) { """ Checks to see whether or not a log for the specified tag is loggable at the specified level. The default level of any tag is set as specified in {@link #setDefaultLogLevel(int)}. This means that any level above and including that level will be log...
java
public static boolean isLoggable(String tag, int level) { if (! activated && level != Constants.ASSERT) { return false; } Integer logLevel = getLogLevel(tag); if (logLevel == null) { logLevel = defaultLogLevel; } return level >= logLevel; }
[ "public", "static", "boolean", "isLoggable", "(", "String", "tag", ",", "int", "level", ")", "{", "if", "(", "!", "activated", "&&", "level", "!=", "Constants", ".", "ASSERT", ")", "{", "return", "false", ";", "}", "Integer", "logLevel", "=", "getLogLeve...
Checks to see whether or not a log for the specified tag is loggable at the specified level. The default level of any tag is set as specified in {@link #setDefaultLogLevel(int)}. This means that any level above and including that level will be logged. Use {@link #configure(Properties)} to define different log levels ...
[ "Checks", "to", "see", "whether", "or", "not", "a", "log", "for", "the", "specified", "tag", "is", "loggable", "at", "the", "specified", "level", "." ]
train
https://github.com/akquinet/androlog/blob/82fa81354c01c9b1d1928062b634ba21f14be560/androlog/src/main/java/de/akquinet/android/androlog/Log.java#L1126-L1135
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/api/RevisionApi.java
RevisionApi.getUserContributionMap
public Map<String, Timestamp> getUserContributionMap(final int articleID, String[] groupfilter) throws WikiApiException { """ Returns a map of usernames mapped to the timestamps of their contributions. Users of certain user groups (e.g. bots) can be filtered by providing the unwanted groups in the {@co...
java
public Map<String, Timestamp> getUserContributionMap(final int articleID, String[] groupfilter) throws WikiApiException { return getUserContributionMap(articleID, groupfilter, false); }
[ "public", "Map", "<", "String", ",", "Timestamp", ">", "getUserContributionMap", "(", "final", "int", "articleID", ",", "String", "[", "]", "groupfilter", ")", "throws", "WikiApiException", "{", "return", "getUserContributionMap", "(", "articleID", ",", "groupfilt...
Returns a map of usernames mapped to the timestamps of their contributions. Users of certain user groups (e.g. bots) can be filtered by providing the unwanted groups in the {@code groupFilter}. Nothing is filtered if the {@code groupFilter} is {@code null} or empty.<br> <br> Filtered results also include unregistered ...
[ "Returns", "a", "map", "of", "usernames", "mapped", "to", "the", "timestamps", "of", "their", "contributions", "." ]
train
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/api/RevisionApi.java#L740-L744
johncarl81/transfuse
transfuse-support/src/main/java/org/androidtransfuse/adapter/classes/ASTClassFactory.java
ASTClassFactory.getConstructor
public ASTConstructor getConstructor(Constructor constructor, boolean isEnum, boolean isInnerClass) { """ Build an AST Constructor from the given constructor @param constructor @return AST Constructor """ ASTAccessModifier modifier = ASTAccessModifier.getModifier(constructor.getModifiers()); ...
java
public ASTConstructor getConstructor(Constructor constructor, boolean isEnum, boolean isInnerClass) { ASTAccessModifier modifier = ASTAccessModifier.getModifier(constructor.getModifiers()); Annotation[][] parameterAnnotations = constructor.getParameterAnnotations(); if(constructor.getDeclaring...
[ "public", "ASTConstructor", "getConstructor", "(", "Constructor", "constructor", ",", "boolean", "isEnum", ",", "boolean", "isInnerClass", ")", "{", "ASTAccessModifier", "modifier", "=", "ASTAccessModifier", ".", "getModifier", "(", "constructor", ".", "getModifiers", ...
Build an AST Constructor from the given constructor @param constructor @return AST Constructor
[ "Build", "an", "AST", "Constructor", "from", "the", "given", "constructor" ]
train
https://github.com/johncarl81/transfuse/blob/a5f837504797a6c4f8628f7e1dde09b8e6368c8b/transfuse-support/src/main/java/org/androidtransfuse/adapter/classes/ASTClassFactory.java#L248-L273
khuxtable/seaglass
src/main/java/com/seaglasslookandfeel/SeaGlassSynthPainterImpl.java
SeaGlassSynthPainterImpl.paintSeparatorForeground
public void paintSeparatorForeground(SynthContext context, Graphics g, int x, int y, int w, int h, int orientation) { """ Paints the foreground of a separator. @param context SynthContext identifying the <code>JComponent</code> and <code>Region</code> to paint to @param g <code>Graphics</code> t...
java
public void paintSeparatorForeground(SynthContext context, Graphics g, int x, int y, int w, int h, int orientation) { paintForeground(context, g, x, y, w, h, orientation); }
[ "public", "void", "paintSeparatorForeground", "(", "SynthContext", "context", ",", "Graphics", "g", ",", "int", "x", ",", "int", "y", ",", "int", "w", ",", "int", "h", ",", "int", "orientation", ")", "{", "paintForeground", "(", "context", ",", "g", ",",...
Paints the foreground of a separator. @param context SynthContext identifying the <code>JComponent</code> and <code>Region</code> to paint to @param g <code>Graphics</code> to paint to @param x X coordinate of the area to paint to @param y Y coordinate of the area to paint to @param w...
[ "Paints", "the", "foreground", "of", "a", "separator", "." ]
train
https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/SeaGlassSynthPainterImpl.java#L1598-L1600
looly/hutool
hutool-db/src/main/java/cn/hutool/db/SqlConnRunner.java
SqlConnRunner.findBy
public List<Entity> findBy(Connection conn, String tableName, String field, Object value) throws SQLException { """ 根据某个字段名条件查询数据列表,返回所有字段 @param conn 数据库连接对象 @param tableName 表名 @param field 字段名 @param value 字段值 @return 数据对象列表 @throws SQLException SQL执行异常 """ return findAll(conn, Entity.create(tabl...
java
public List<Entity> findBy(Connection conn, String tableName, String field, Object value) throws SQLException{ return findAll(conn, Entity.create(tableName).set(field, value)); }
[ "public", "List", "<", "Entity", ">", "findBy", "(", "Connection", "conn", ",", "String", "tableName", ",", "String", "field", ",", "Object", "value", ")", "throws", "SQLException", "{", "return", "findAll", "(", "conn", ",", "Entity", ".", "create", "(", ...
根据某个字段名条件查询数据列表,返回所有字段 @param conn 数据库连接对象 @param tableName 表名 @param field 字段名 @param value 字段值 @return 数据对象列表 @throws SQLException SQL执行异常
[ "根据某个字段名条件查询数据列表,返回所有字段" ]
train
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-db/src/main/java/cn/hutool/db/SqlConnRunner.java#L399-L401
BlueBrain/bluima
modules/bluima_opennlp/src/main/java/ch/epfl/bbp/shaded/opennlp/maxent/AbstractDataIndexer.java
AbstractDataIndexer.toIndexedStringArray
protected static String[] toIndexedStringArray(TObjectIntHashMap labelToIndexMap) { """ Utility method for creating a String[] array from a map whose keys are labels (Strings) to be stored in the array and whose values are the indices (Integers) at which the corresponding labels should be inserted. @param la...
java
protected static String[] toIndexedStringArray(TObjectIntHashMap labelToIndexMap) { final String[] array = new String[labelToIndexMap.size()]; labelToIndexMap.forEachEntry(new TObjectIntProcedure() { public boolean execute(Object str, int index) { array[index] = (String)str; ...
[ "protected", "static", "String", "[", "]", "toIndexedStringArray", "(", "TObjectIntHashMap", "labelToIndexMap", ")", "{", "final", "String", "[", "]", "array", "=", "new", "String", "[", "labelToIndexMap", ".", "size", "(", ")", "]", ";", "labelToIndexMap", "....
Utility method for creating a String[] array from a map whose keys are labels (Strings) to be stored in the array and whose values are the indices (Integers) at which the corresponding labels should be inserted. @param labelToIndexMap a <code>TObjectIntHashMap</code> value @return a <code>String[]</code> value @since ...
[ "Utility", "method", "for", "creating", "a", "String", "[]", "array", "from", "a", "map", "whose", "keys", "are", "labels", "(", "Strings", ")", "to", "be", "stored", "in", "the", "array", "and", "whose", "values", "are", "the", "indices", "(", "Integers...
train
https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_opennlp/src/main/java/ch/epfl/bbp/shaded/opennlp/maxent/AbstractDataIndexer.java#L124-L133
joniles/mpxj
src/main/java/net/sf/mpxj/mpp/MPP14Reader.java
MPP14Reader.readBitFields
private void readBitFields(MppBitFlag[] flags, FieldContainer container, byte[] data) { """ Iterate through a set of bit field flags and set the value for each one in the supplied container. @param flags bit field flags @param container field container @param data source data """ for (MppBitFlag fl...
java
private void readBitFields(MppBitFlag[] flags, FieldContainer container, byte[] data) { for (MppBitFlag flag : flags) { flag.setValue(container, data); } }
[ "private", "void", "readBitFields", "(", "MppBitFlag", "[", "]", "flags", ",", "FieldContainer", "container", ",", "byte", "[", "]", "data", ")", "{", "for", "(", "MppBitFlag", "flag", ":", "flags", ")", "{", "flag", ".", "setValue", "(", "container", ",...
Iterate through a set of bit field flags and set the value for each one in the supplied container. @param flags bit field flags @param container field container @param data source data
[ "Iterate", "through", "a", "set", "of", "bit", "field", "flags", "and", "set", "the", "value", "for", "each", "one", "in", "the", "supplied", "container", "." ]
train
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/MPP14Reader.java#L2039-L2045
wildfly/wildfly-core
controller/src/main/java/org/jboss/as/controller/PathAddress.java
PathAddress.subAddress
public PathAddress subAddress(int start) { """ Get a portion of this address using segments starting at {@code start} (inclusive). @param start the start index @return the partial address """ final List<PathElement> list = pathAddressList; return new PathAddress(list.subList(start, list.siz...
java
public PathAddress subAddress(int start) { final List<PathElement> list = pathAddressList; return new PathAddress(list.subList(start, list.size())); }
[ "public", "PathAddress", "subAddress", "(", "int", "start", ")", "{", "final", "List", "<", "PathElement", ">", "list", "=", "pathAddressList", ";", "return", "new", "PathAddress", "(", "list", ".", "subList", "(", "start", ",", "list", ".", "size", "(", ...
Get a portion of this address using segments starting at {@code start} (inclusive). @param start the start index @return the partial address
[ "Get", "a", "portion", "of", "this", "address", "using", "segments", "starting", "at", "{", "@code", "start", "}", "(", "inclusive", ")", "." ]
train
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/PathAddress.java#L253-L256
xiancloud/xian
xian-core/src/main/java/info/xiancloud/core/support/cache/api/CacheObjectUtil.java
CacheObjectUtil.incrementByValue
public static Single<Long> incrementByValue(String cacheKey, long value) { """ increase with specified increment @param cacheKey the key @param value the increment @return the result value after increment, or error. """ return incrementByValue(CacheService.CACHE_CONFIG_BEAN, cacheKey, value); ...
java
public static Single<Long> incrementByValue(String cacheKey, long value) { return incrementByValue(CacheService.CACHE_CONFIG_BEAN, cacheKey, value); }
[ "public", "static", "Single", "<", "Long", ">", "incrementByValue", "(", "String", "cacheKey", ",", "long", "value", ")", "{", "return", "incrementByValue", "(", "CacheService", ".", "CACHE_CONFIG_BEAN", ",", "cacheKey", ",", "value", ")", ";", "}" ]
increase with specified increment @param cacheKey the key @param value the increment @return the result value after increment, or error.
[ "increase", "with", "specified", "increment" ]
train
https://github.com/xiancloud/xian/blob/1948e088545553d2745b2c86d8b5a64988bb850e/xian-core/src/main/java/info/xiancloud/core/support/cache/api/CacheObjectUtil.java#L309-L311
Omertron/api-themoviedb
src/main/java/com/omertron/themoviedbapi/TheMovieDbApi.java
TheMovieDbApi.getEpisodeExternalID
public ExternalID getEpisodeExternalID(int tvID, int seasonNumber, int episodeNumber, String language) throws MovieDbException { """ Get the external ids for a TV episode by comabination of a season and episode number. @param tvID tvID @param seasonNumber seasonNumber @param episodeNumber episodeNumber @par...
java
public ExternalID getEpisodeExternalID(int tvID, int seasonNumber, int episodeNumber, String language) throws MovieDbException { return tmdbEpisodes.getEpisodeExternalID(tvID, seasonNumber, episodeNumber, language); }
[ "public", "ExternalID", "getEpisodeExternalID", "(", "int", "tvID", ",", "int", "seasonNumber", ",", "int", "episodeNumber", ",", "String", "language", ")", "throws", "MovieDbException", "{", "return", "tmdbEpisodes", ".", "getEpisodeExternalID", "(", "tvID", ",", ...
Get the external ids for a TV episode by comabination of a season and episode number. @param tvID tvID @param seasonNumber seasonNumber @param episodeNumber episodeNumber @param language language @return @throws MovieDbException exception
[ "Get", "the", "external", "ids", "for", "a", "TV", "episode", "by", "comabination", "of", "a", "season", "and", "episode", "number", "." ]
train
https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/TheMovieDbApi.java#L1830-L1832
OpenLiberty/open-liberty
dev/com.ibm.ws.jdbc/src/com/ibm/ws/rsadapter/impl/WSConnectionRequestInfoImpl.java
WSConnectionRequestInfoImpl.matchReadOnly
private final boolean matchReadOnly(WSConnectionRequestInfoImpl cri) { """ Determine if the read-only property matches. It is considered to match if - Both read-only values are unspecified. - Both read-only values are the same value. - One of the read-only values is unspecified and the other CRI requested the d...
java
private final boolean matchReadOnly(WSConnectionRequestInfoImpl cri) { // At least one of the CRIs should know the default value. Boolean defaultValue = defaultReadOnly == null ? cri.defaultReadOnly : defaultReadOnly; return match(ivReadOnly, cri.ivReadOnly) || ivReadOnly == null...
[ "private", "final", "boolean", "matchReadOnly", "(", "WSConnectionRequestInfoImpl", "cri", ")", "{", "// At least one of the CRIs should know the default value.", "Boolean", "defaultValue", "=", "defaultReadOnly", "==", "null", "?", "cri", ".", "defaultReadOnly", ":", "defa...
Determine if the read-only property matches. It is considered to match if - Both read-only values are unspecified. - Both read-only values are the same value. - One of the read-only values is unspecified and the other CRI requested the default value. @return true if the read-only values match, otherwise false.
[ "Determine", "if", "the", "read", "-", "only", "property", "matches", ".", "It", "is", "considered", "to", "match", "if", "-", "Both", "read", "-", "only", "values", "are", "unspecified", ".", "-", "Both", "read", "-", "only", "values", "are", "the", "...
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jdbc/src/com/ibm/ws/rsadapter/impl/WSConnectionRequestInfoImpl.java#L642-L649
google/error-prone-javac
src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/AbstractMemberWriter.java
AbstractMemberWriter.getMemberTree
public Content getMemberTree(Content memberTree, boolean isLastContent) { """ Get the member tree to be documented. @param memberTree the content tree of member to be documented @param isLastContent true if the content to be added is the last content @return a content tree that will be added to the class docu...
java
public Content getMemberTree(Content memberTree, boolean isLastContent) { if (isLastContent) return HtmlTree.UL(HtmlStyle.blockListLast, memberTree); else return HtmlTree.UL(HtmlStyle.blockList, memberTree); }
[ "public", "Content", "getMemberTree", "(", "Content", "memberTree", ",", "boolean", "isLastContent", ")", "{", "if", "(", "isLastContent", ")", "return", "HtmlTree", ".", "UL", "(", "HtmlStyle", ".", "blockListLast", ",", "memberTree", ")", ";", "else", "retur...
Get the member tree to be documented. @param memberTree the content tree of member to be documented @param isLastContent true if the content to be added is the last content @return a content tree that will be added to the class documentation
[ "Get", "the", "member", "tree", "to", "be", "documented", "." ]
train
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/AbstractMemberWriter.java#L693-L698
jbossws/jbossws-common
src/main/java/org/jboss/ws/common/injection/finders/ReflectionUtils.java
ReflectionUtils.assertNotPrimitiveType
public static void assertNotPrimitiveType(final Field field, Class<? extends Annotation> annotation) { """ Asserts field is not of primitive type. @param method to validate @param annotation annotation to propagate in exception message """ if (field.getType().isPrimitive()) { throw ann...
java
public static void assertNotPrimitiveType(final Field field, Class<? extends Annotation> annotation) { if (field.getType().isPrimitive()) { throw annotation == null ? MESSAGES.fieldCannotBeOfPrimitiveOrVoidType(field) : MESSAGES.fieldCannotBeOfPrimitiveOrVoidType2(field, annotation); } ...
[ "public", "static", "void", "assertNotPrimitiveType", "(", "final", "Field", "field", ",", "Class", "<", "?", "extends", "Annotation", ">", "annotation", ")", "{", "if", "(", "field", ".", "getType", "(", ")", ".", "isPrimitive", "(", ")", ")", "{", "thr...
Asserts field is not of primitive type. @param method to validate @param annotation annotation to propagate in exception message
[ "Asserts", "field", "is", "not", "of", "primitive", "type", "." ]
train
https://github.com/jbossws/jbossws-common/blob/fcff8a3ef9bfe046d6fa8c855a3fe4f62841add7/src/main/java/org/jboss/ws/common/injection/finders/ReflectionUtils.java#L80-L86
alkacon/opencms-core
src/org/opencms/gwt/CmsVfsService.java
CmsVfsService.getNoPreviewReason
public static String getNoPreviewReason(CmsObject cms, CmsResource resource) { """ Returns the no preview reason if there is any.<p> @param cms the current cms context @param resource the resource to check @return the no preview reason if there is any """ Locale locale = OpenCms.getWorkplaceMan...
java
public static String getNoPreviewReason(CmsObject cms, CmsResource resource) { Locale locale = OpenCms.getWorkplaceManager().getWorkplaceLocale(cms); String noPreviewReason = null; if (resource.getState().isDeleted() && !(resource instanceof I_CmsHistoryResource)) { noPreviewReason ...
[ "public", "static", "String", "getNoPreviewReason", "(", "CmsObject", "cms", ",", "CmsResource", "resource", ")", "{", "Locale", "locale", "=", "OpenCms", ".", "getWorkplaceManager", "(", ")", ".", "getWorkplaceLocale", "(", "cms", ")", ";", "String", "noPreview...
Returns the no preview reason if there is any.<p> @param cms the current cms context @param resource the resource to check @return the no preview reason if there is any
[ "Returns", "the", "no", "preview", "reason", "if", "there", "is", "any", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/gwt/CmsVfsService.java#L234-L255
Axway/Grapes
utils/src/main/java/org/axway/grapes/utils/client/GrapesClient.java
GrapesClient.getModuleOrganization
public Organization getModuleOrganization(final String moduleName, final String moduleVersion) throws GrapesCommunicationException { """ Returns the organization of a given module @return Organization """ final Client client = getClient(); final WebResource resource = client.resource(serverU...
java
public Organization getModuleOrganization(final String moduleName, final String moduleVersion) throws GrapesCommunicationException { final Client client = getClient(); final WebResource resource = client.resource(serverURL).path(RequestUtils.getModuleOrganizationPath(moduleName, moduleVersion)); ...
[ "public", "Organization", "getModuleOrganization", "(", "final", "String", "moduleName", ",", "final", "String", "moduleVersion", ")", "throws", "GrapesCommunicationException", "{", "final", "Client", "client", "=", "getClient", "(", ")", ";", "final", "WebResource", ...
Returns the organization of a given module @return Organization
[ "Returns", "the", "organization", "of", "a", "given", "module" ]
train
https://github.com/Axway/Grapes/blob/ce9cc73d85f83eaa5fbc991abb593915a8c8374e/utils/src/main/java/org/axway/grapes/utils/client/GrapesClient.java#L822-L839
Impetus/Kundera
src/kundera-kudu/src/main/java/com/impetus/client/kudu/KuduDBClient.java
KuduDBClient.addPrimaryKeyToRow
private void addPrimaryKeyToRow(PartialRow row, EmbeddableType embeddable, Field[] fields, MetamodelImpl metaModel, Object key) { """ Adds the primary key to row. @param row the row @param embeddable the embeddable @param fields the fields @param metaModel the meta model @param key the key ...
java
private void addPrimaryKeyToRow(PartialRow row, EmbeddableType embeddable, Field[] fields, MetamodelImpl metaModel, Object key) { for (Field f : fields) { if (!ReflectUtils.isTransientOrStatic(f)) { Object value = PropertyAccessorHelper.getObject(k...
[ "private", "void", "addPrimaryKeyToRow", "(", "PartialRow", "row", ",", "EmbeddableType", "embeddable", ",", "Field", "[", "]", "fields", ",", "MetamodelImpl", "metaModel", ",", "Object", "key", ")", "{", "for", "(", "Field", "f", ":", "fields", ")", "{", ...
Adds the primary key to row. @param row the row @param embeddable the embeddable @param fields the fields @param metaModel the meta model @param key the key
[ "Adds", "the", "primary", "key", "to", "row", "." ]
train
https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-kudu/src/main/java/com/impetus/client/kudu/KuduDBClient.java#L822-L846
Azure/azure-sdk-for-java
cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ListManagementImagesImpl.java
ListManagementImagesImpl.addImageUrlInputWithServiceResponseAsync
public Observable<ServiceResponse<Image>> addImageUrlInputWithServiceResponseAsync(String listId, String contentType, BodyModelModel imageUrl, AddImageUrlInputOptionalParameter addImageUrlInputOptionalParameter) { """ Add an image to the list with list Id equal to list Id passed. @param listId List Id of the im...
java
public Observable<ServiceResponse<Image>> addImageUrlInputWithServiceResponseAsync(String listId, String contentType, BodyModelModel imageUrl, AddImageUrlInputOptionalParameter addImageUrlInputOptionalParameter) { if (this.client.baseUrl() == null) { throw new IllegalArgumentException("Parameter thi...
[ "public", "Observable", "<", "ServiceResponse", "<", "Image", ">", ">", "addImageUrlInputWithServiceResponseAsync", "(", "String", "listId", ",", "String", "contentType", ",", "BodyModelModel", "imageUrl", ",", "AddImageUrlInputOptionalParameter", "addImageUrlInputOptionalPar...
Add an image to the list with list Id equal to list Id passed. @param listId List Id of the image list. @param contentType The content type. @param imageUrl The image url. @param addImageUrlInputOptionalParameter the object representing the optional parameters to be set before calling this API @throws IllegalArgumentE...
[ "Add", "an", "image", "to", "the", "list", "with", "list", "Id", "equal", "to", "list", "Id", "passed", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ListManagementImagesImpl.java#L553-L571
bitcoinj/bitcoinj
core/src/main/java/org/bitcoinj/protocols/channels/PaymentChannelClient.java
PaymentChannelClient.setIncreasePaymentFutureIfNeeded
private void setIncreasePaymentFutureIfNeeded(PaymentChannelCloseException.CloseReason reason, String message) { """ /* If this is an ongoing payment channel increase we need to call setException() on its future. @param reason is the reason for aborting @param message is the detailed message """ i...
java
private void setIncreasePaymentFutureIfNeeded(PaymentChannelCloseException.CloseReason reason, String message) { if (increasePaymentFuture != null && !increasePaymentFuture.isDone()) { increasePaymentFuture.setException(new PaymentChannelCloseException(message, reason)); } }
[ "private", "void", "setIncreasePaymentFutureIfNeeded", "(", "PaymentChannelCloseException", ".", "CloseReason", "reason", ",", "String", "message", ")", "{", "if", "(", "increasePaymentFuture", "!=", "null", "&&", "!", "increasePaymentFuture", ".", "isDone", "(", ")",...
/* If this is an ongoing payment channel increase we need to call setException() on its future. @param reason is the reason for aborting @param message is the detailed message
[ "/", "*", "If", "this", "is", "an", "ongoing", "payment", "channel", "increase", "we", "need", "to", "call", "setException", "()", "on", "its", "future", "." ]
train
https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/protocols/channels/PaymentChannelClient.java#L503-L507
github/maven-plugins
github-core/src/main/java/com/github/maven/plugins/core/GitHubProjectMojo.java
GitHubProjectMojo.getServer
protected Server getServer(final Settings settings, final String serverId) { """ Get server with given id @param settings @param serverId must be non-null and non-empty @return server or null if none matching """ if (settings == null) return null; List<Server> servers = settings.getServers(); if...
java
protected Server getServer(final Settings settings, final String serverId) { if (settings == null) return null; List<Server> servers = settings.getServers(); if (servers == null || servers.isEmpty()) return null; for (Server server : servers) if (serverId.equals(server.getId())) return server; r...
[ "protected", "Server", "getServer", "(", "final", "Settings", "settings", ",", "final", "String", "serverId", ")", "{", "if", "(", "settings", "==", "null", ")", "return", "null", ";", "List", "<", "Server", ">", "servers", "=", "settings", ".", "getServer...
Get server with given id @param settings @param serverId must be non-null and non-empty @return server or null if none matching
[ "Get", "server", "with", "given", "id" ]
train
https://github.com/github/maven-plugins/blob/8d6d49393d1453be709ecc4cfe87f41f2081f5c5/github-core/src/main/java/com/github/maven/plugins/core/GitHubProjectMojo.java#L395-L406
QSFT/Doradus
doradus-common/src/main/java/com/dell/doradus/common/UNode.java
UNode.toCompressedJSON
public byte[] toCompressedJSON() throws IOException { """ Convert the DOM tree rooted at this UNode into a JSON document compressed with GZIP. @return JSON document for the DOM tree rooted at this UNode compressed with GZIP. @throws IOException If an error occurs writing to the GZIP stream. """ /...
java
public byte[] toCompressedJSON() throws IOException { // Wrap a GZIPOuputStream around a ByteArrayOuputStream. ByteArrayOutputStream bytesOut = new ByteArrayOutputStream(); GZIPOutputStream gzipOut = new GZIPOutputStream(bytesOut); // Wrap the GZIPOutputStream with an Outpu...
[ "public", "byte", "[", "]", "toCompressedJSON", "(", ")", "throws", "IOException", "{", "// Wrap a GZIPOuputStream around a ByteArrayOuputStream.\r", "ByteArrayOutputStream", "bytesOut", "=", "new", "ByteArrayOutputStream", "(", ")", ";", "GZIPOutputStream", "gzipOut", "=",...
Convert the DOM tree rooted at this UNode into a JSON document compressed with GZIP. @return JSON document for the DOM tree rooted at this UNode compressed with GZIP. @throws IOException If an error occurs writing to the GZIP stream.
[ "Convert", "the", "DOM", "tree", "rooted", "at", "this", "UNode", "into", "a", "JSON", "document", "compressed", "with", "GZIP", "." ]
train
https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-common/src/main/java/com/dell/doradus/common/UNode.java#L637-L658
alkacon/opencms-core
src-gwt/org/opencms/acacia/client/CmsEditorBase.java
CmsEditorBase.saveEntity
public void saveEntity(CmsEntity entity, final boolean clearOnSuccess, final Command callback) { """ Saves the given entity.<p> @param entity the entity @param clearOnSuccess <code>true</code> to clear all entities from entity back-end on success @param callback the callback executed on success """ ...
java
public void saveEntity(CmsEntity entity, final boolean clearOnSuccess, final Command callback) { AsyncCallback<CmsValidationResult> asyncCallback = new AsyncCallback<CmsValidationResult>() { public void onFailure(Throwable caught) { onRpcError(caught); } ...
[ "public", "void", "saveEntity", "(", "CmsEntity", "entity", ",", "final", "boolean", "clearOnSuccess", ",", "final", "Command", "callback", ")", "{", "AsyncCallback", "<", "CmsValidationResult", ">", "asyncCallback", "=", "new", "AsyncCallback", "<", "CmsValidationR...
Saves the given entity.<p> @param entity the entity @param clearOnSuccess <code>true</code> to clear all entities from entity back-end on success @param callback the callback executed on success
[ "Saves", "the", "given", "entity", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/acacia/client/CmsEditorBase.java#L556-L574
jbake-org/jbake
jbake-core/src/main/java/org/jbake/app/configuration/JBakeConfigurationFactory.java
JBakeConfigurationFactory.createDefaultJbakeConfiguration
public DefaultJBakeConfiguration createDefaultJbakeConfiguration(File sourceFolder, File destination, CompositeConfiguration compositeConfiguration, boolean isClearCache) { """ Creates a {@link DefaultJBakeConfiguration} This is a compatibility factory method @param sourceFolder The source folder of the proj...
java
public DefaultJBakeConfiguration createDefaultJbakeConfiguration(File sourceFolder, File destination, CompositeConfiguration compositeConfiguration, boolean isClearCache) { DefaultJBakeConfiguration configuration = new DefaultJBakeConfiguration(sourceFolder, compositeConfiguration); configuration.setDes...
[ "public", "DefaultJBakeConfiguration", "createDefaultJbakeConfiguration", "(", "File", "sourceFolder", ",", "File", "destination", ",", "CompositeConfiguration", "compositeConfiguration", ",", "boolean", "isClearCache", ")", "{", "DefaultJBakeConfiguration", "configuration", "=...
Creates a {@link DefaultJBakeConfiguration} This is a compatibility factory method @param sourceFolder The source folder of the project @param destination The destination folder to render and copy files to @param compositeConfiguration A given {@link CompositeConfiguration} @param isClearCache Whether to clear databa...
[ "Creates", "a", "{", "@link", "DefaultJBakeConfiguration", "}" ]
train
https://github.com/jbake-org/jbake/blob/beb9042a54bf0eb168821d524c88b9ea0bee88dc/jbake-core/src/main/java/org/jbake/app/configuration/JBakeConfigurationFactory.java#L47-L52
elki-project/elki
elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/AGNES.java
AGNES.shrinkActiveSet
protected static int shrinkActiveSet(DBIDArrayIter ix, PointerHierarchyRepresentationBuilder builder, int end, int x) { """ Shrink the active set: if the last x objects are all merged, we can reduce the working size accordingly. @param ix Object iterator @param builder Builder to detect merged status @param ...
java
protected static int shrinkActiveSet(DBIDArrayIter ix, PointerHierarchyRepresentationBuilder builder, int end, int x) { if(x == end - 1) { // Can truncate active set. while(builder.isLinked(ix.seek(--end - 1))) { // Everything happens in while condition already. } } return end; }
[ "protected", "static", "int", "shrinkActiveSet", "(", "DBIDArrayIter", "ix", ",", "PointerHierarchyRepresentationBuilder", "builder", ",", "int", "end", ",", "int", "x", ")", "{", "if", "(", "x", "==", "end", "-", "1", ")", "{", "// Can truncate active set.", ...
Shrink the active set: if the last x objects are all merged, we can reduce the working size accordingly. @param ix Object iterator @param builder Builder to detect merged status @param end Current active set size @param x Last merged object @return New active set size
[ "Shrink", "the", "active", "set", ":", "if", "the", "last", "x", "objects", "are", "all", "merged", "we", "can", "reduce", "the", "working", "size", "accordingly", "." ]
train
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/AGNES.java#L177-L184
orbisgis/h2gis
postgis-jts/src/main/java/org/h2gis/postgis_jts/JtsBinaryParser.java
JtsBinaryParser.parseMultiLineString
private MultiLineString parseMultiLineString(ValueGetter data, int srid) { """ Parse the given {@link org.postgis.binary.ValueGetter} into a JTS {@link org.locationtech.jts.geom.MultiLineString}. @param data {@link org.postgis.binary.ValueGetter} to parse. @param srid SRID of the parsed geometries. @return...
java
private MultiLineString parseMultiLineString(ValueGetter data, int srid) { int count = data.getInt(); LineString[] strings = new LineString[count]; this.parseGeometryArray(data, strings, srid); return JtsGeometry.geofac.createMultiLineString(strings); }
[ "private", "MultiLineString", "parseMultiLineString", "(", "ValueGetter", "data", ",", "int", "srid", ")", "{", "int", "count", "=", "data", ".", "getInt", "(", ")", ";", "LineString", "[", "]", "strings", "=", "new", "LineString", "[", "count", "]", ";", ...
Parse the given {@link org.postgis.binary.ValueGetter} into a JTS {@link org.locationtech.jts.geom.MultiLineString}. @param data {@link org.postgis.binary.ValueGetter} to parse. @param srid SRID of the parsed geometries. @return The parsed {@link org.locationtech.jts.geom.MultiLineString}.
[ "Parse", "the", "given", "{", "@link", "org", ".", "postgis", ".", "binary", ".", "ValueGetter", "}", "into", "a", "JTS", "{", "@link", "org", ".", "locationtech", ".", "jts", ".", "geom", ".", "MultiLineString", "}", "." ]
train
https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/postgis-jts/src/main/java/org/h2gis/postgis_jts/JtsBinaryParser.java#L305-L310
qiujuer/Genius-Android
caprice/ui/src/main/java/net/qiujuer/genius/ui/Ui.java
Ui.changeColorAlpha
public static int changeColorAlpha(int color, int alpha) { """ Change the color to new alpha @param color Color @param alpha New alpha @return New alpha color """ int r = (color >> 16) & 0xFF; int g = (color >> 8) & 0xFF; int b = color & 0xFF; return alpha << 24 | r << 16 |...
java
public static int changeColorAlpha(int color, int alpha) { int r = (color >> 16) & 0xFF; int g = (color >> 8) & 0xFF; int b = color & 0xFF; return alpha << 24 | r << 16 | g << 8 | b; }
[ "public", "static", "int", "changeColorAlpha", "(", "int", "color", ",", "int", "alpha", ")", "{", "int", "r", "=", "(", "color", ">>", "16", ")", "&", "0xFF", ";", "int", "g", "=", "(", "color", ">>", "8", ")", "&", "0xFF", ";", "int", "b", "=...
Change the color to new alpha @param color Color @param alpha New alpha @return New alpha color
[ "Change", "the", "color", "to", "new", "alpha" ]
train
https://github.com/qiujuer/Genius-Android/blob/babefaf1321f5883a21cada582b6fa5104adc648/caprice/ui/src/main/java/net/qiujuer/genius/ui/Ui.java#L124-L129
pravega/pravega
segmentstore/server/src/main/java/io/pravega/segmentstore/server/tables/IndexWriter.java
IndexWriter.groupByBucket
CompletableFuture<Collection<BucketUpdate.Builder>> groupByBucket(DirectSegmentAccess segment, Collection<BucketUpdate.KeyUpdate> keyUpdates, TimeoutTimer timer) { """ Groups the given {@link BucketUpdate.KeyUpdate} instances by their associated buckets...
java
CompletableFuture<Collection<BucketUpdate.Builder>> groupByBucket(DirectSegmentAccess segment, Collection<BucketUpdate.KeyUpdate> keyUpdates, TimeoutTimer timer) { val updatesByHash = keyUpdates.stream() .collect...
[ "CompletableFuture", "<", "Collection", "<", "BucketUpdate", ".", "Builder", ">", ">", "groupByBucket", "(", "DirectSegmentAccess", "segment", ",", "Collection", "<", "BucketUpdate", ".", "KeyUpdate", ">", "keyUpdates", ",", "TimeoutTimer", "timer", ")", "{", "val...
Groups the given {@link BucketUpdate.KeyUpdate} instances by their associated buckets. @param segment The Segment to read from. @param keyUpdates A Collection of {@link BucketUpdate.KeyUpdate} instances to index. @param timer Timer for the operation. @return A CompletableFuture that, when completed, will conta...
[ "Groups", "the", "given", "{", "@link", "BucketUpdate", ".", "KeyUpdate", "}", "instances", "by", "their", "associated", "buckets", "." ]
train
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/tables/IndexWriter.java#L73-L88
nguillaumin/slick2d-maven
slick2d-core/src/main/java/org/newdawn/slick/tiled/TiledMap.java
TiledMap.getObjectY
public int getObjectY(int groupID, int objectID) { """ Returns the y-coordinate of a specific object from a specific group. @param groupID Index of a group @param objectID Index of an object @return The y-coordinate of an object, or -1, when error occurred """ if (groupID >= 0 && groupID < objectGrou...
java
public int getObjectY(int groupID, int objectID) { if (groupID >= 0 && groupID < objectGroups.size()) { ObjectGroup grp = (ObjectGroup) objectGroups.get(groupID); if (objectID >= 0 && objectID < grp.objects.size()) { GroupObject object = (GroupObject) grp.objects.get(objectID); return object.y; ...
[ "public", "int", "getObjectY", "(", "int", "groupID", ",", "int", "objectID", ")", "{", "if", "(", "groupID", ">=", "0", "&&", "groupID", "<", "objectGroups", ".", "size", "(", ")", ")", "{", "ObjectGroup", "grp", "=", "(", "ObjectGroup", ")", "objectG...
Returns the y-coordinate of a specific object from a specific group. @param groupID Index of a group @param objectID Index of an object @return The y-coordinate of an object, or -1, when error occurred
[ "Returns", "the", "y", "-", "coordinate", "of", "a", "specific", "object", "from", "a", "specific", "group", "." ]
train
https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/tiled/TiledMap.java#L866-L875
drinkjava2/jBeanBox
jbeanbox/src/main/java/com/github/drinkjava2/asm5_0_3/util/Printer.java
Printer.printList
static void printList(final PrintWriter pw, final List<?> l) { """ Prints the given string tree. @param pw the writer to be used to print the tree. @param l a string tree, i.e., a string list that can contain other string lists, and so on recursively. """ for (int i = 0; i < l.size(); ++i) { ...
java
static void printList(final PrintWriter pw, final List<?> l) { for (int i = 0; i < l.size(); ++i) { Object o = l.get(i); if (o instanceof List) { printList(pw, (List<?>) o); } else { pw.print(o.toString()); } } }
[ "static", "void", "printList", "(", "final", "PrintWriter", "pw", ",", "final", "List", "<", "?", ">", "l", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "l", ".", "size", "(", ")", ";", "++", "i", ")", "{", "Object", "o", "=", ...
Prints the given string tree. @param pw the writer to be used to print the tree. @param l a string tree, i.e., a string list that can contain other string lists, and so on recursively.
[ "Prints", "the", "given", "string", "tree", "." ]
train
https://github.com/drinkjava2/jBeanBox/blob/01c216599ffa2e5f2d9c01df2adaad0f45567c04/jbeanbox/src/main/java/com/github/drinkjava2/asm5_0_3/util/Printer.java#L579-L588
stevespringett/CPE-Parser
src/main/java/us/springett/parsers/cpe/util/Validate.java
Validate.countCharacter
private static long countCharacter(String value, char c) { """ Counts the number of times the char c is contained in the value. @param value the string to search @param c the character to count @return the number of times the char c is contained in the value """ return value.chars().filter(s -> s ...
java
private static long countCharacter(String value, char c) { return value.chars().filter(s -> s == c).count(); }
[ "private", "static", "long", "countCharacter", "(", "String", "value", ",", "char", "c", ")", "{", "return", "value", ".", "chars", "(", ")", ".", "filter", "(", "s", "->", "s", "==", "c", ")", ".", "count", "(", ")", ";", "}" ]
Counts the number of times the char c is contained in the value. @param value the string to search @param c the character to count @return the number of times the char c is contained in the value
[ "Counts", "the", "number", "of", "times", "the", "char", "c", "is", "contained", "in", "the", "value", "." ]
train
https://github.com/stevespringett/CPE-Parser/blob/e6324ca020dc0790097d3d62bb98aabf60e56843/src/main/java/us/springett/parsers/cpe/util/Validate.java#L358-L360
eskatos/java-toolbox
src/main/java/org/codeartisans/java/toolbox/exceptions/NullArgumentException.java
NullArgumentException.ensureNotEmptyContent
public static void ensureNotEmptyContent( String name, boolean trim, String[] value ) { """ Ensures that the string array instance is not null and that it has entries that are not null or empty. """ ensureNotEmpty( name, value ); for ( int i = 0; i < value.length; i++ ) { ensureNotE...
java
public static void ensureNotEmptyContent( String name, boolean trim, String[] value ) { ensureNotEmpty( name, value ); for ( int i = 0; i < value.length; i++ ) { ensureNotEmpty( value[i] + "[" + i + "]", value[i] ); if ( trim ) { ensureNotEmpty( value[i] + "["...
[ "public", "static", "void", "ensureNotEmptyContent", "(", "String", "name", ",", "boolean", "trim", ",", "String", "[", "]", "value", ")", "{", "ensureNotEmpty", "(", "name", ",", "value", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "v...
Ensures that the string array instance is not null and that it has entries that are not null or empty.
[ "Ensures", "that", "the", "string", "array", "instance", "is", "not", "null", "and", "that", "it", "has", "entries", "that", "are", "not", "null", "or", "empty", "." ]
train
https://github.com/eskatos/java-toolbox/blob/8b1a187c370ae941c8ea77a68d92e36d3f33305b/src/main/java/org/codeartisans/java/toolbox/exceptions/NullArgumentException.java#L115-L124
cdk/cdk
storage/ctab/src/main/java/org/openscience/cdk/io/MDLV3000Reader.java
MDLV3000Reader.applyMDLValenceModel
private void applyMDLValenceModel(IAtom atom, int explicitValence, int unpaired) { """ Applies the MDL valence model to atoms using the explicit valence (bond order sum) and charge to determine the correct number of implicit hydrogens. The model is not applied if the explicit valence is less than 0 - this is th...
java
private void applyMDLValenceModel(IAtom atom, int explicitValence, int unpaired) { if (atom.getValency() != null) { if (atom.getValency() >= explicitValence) atom.setImplicitHydrogenCount(atom.getValency() - (explicitValence - unpaired)); else atom.setImp...
[ "private", "void", "applyMDLValenceModel", "(", "IAtom", "atom", ",", "int", "explicitValence", ",", "int", "unpaired", ")", "{", "if", "(", "atom", ".", "getValency", "(", ")", "!=", "null", ")", "{", "if", "(", "atom", ".", "getValency", "(", ")", ">...
Applies the MDL valence model to atoms using the explicit valence (bond order sum) and charge to determine the correct number of implicit hydrogens. The model is not applied if the explicit valence is less than 0 - this is the case when a query bond was read for an atom. @param atom the atom to apply the mo...
[ "Applies", "the", "MDL", "valence", "model", "to", "atoms", "using", "the", "explicit", "valence", "(", "bond", "order", "sum", ")", "and", "charge", "to", "determine", "the", "correct", "number", "of", "implicit", "hydrogens", ".", "The", "model", "is", "...
train
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/storage/ctab/src/main/java/org/openscience/cdk/io/MDLV3000Reader.java#L696-L719
UrielCh/ovh-java-sdk
ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java
ApiOvhCloud.project_serviceName_operation_GET
public ArrayList<OvhOperation> project_serviceName_operation_GET(String serviceName) throws IOException { """ List your operations REST: GET /cloud/project/{serviceName}/operation @param serviceName [required] Public Cloud project API beta """ String qPath = "/cloud/project/{serviceName}/operation"; ...
java
public ArrayList<OvhOperation> project_serviceName_operation_GET(String serviceName) throws IOException { String qPath = "/cloud/project/{serviceName}/operation"; StringBuilder sb = path(qPath, serviceName); String resp = exec(qPath, "GET", sb.toString(), null); return convertTo(resp, t8); }
[ "public", "ArrayList", "<", "OvhOperation", ">", "project_serviceName_operation_GET", "(", "String", "serviceName", ")", "throws", "IOException", "{", "String", "qPath", "=", "\"/cloud/project/{serviceName}/operation\"", ";", "StringBuilder", "sb", "=", "path", "(", "qP...
List your operations REST: GET /cloud/project/{serviceName}/operation @param serviceName [required] Public Cloud project API beta
[ "List", "your", "operations" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java#L892-L897
wildfly/wildfly-core
host-controller/src/main/java/org/jboss/as/host/controller/ManagedServerBootCmdFactory.java
ManagedServerBootCmdFactory.resolveDirectoryGrouping
private static DirectoryGrouping resolveDirectoryGrouping(final ModelNode model, final ExpressionResolver expressionResolver) { """ Returns the value of found in the model. @param model the model that contains the key and value. @param expressionResolver the expression resolver to use to resolve expressions ...
java
private static DirectoryGrouping resolveDirectoryGrouping(final ModelNode model, final ExpressionResolver expressionResolver) { try { return DirectoryGrouping.forName(HostResourceDefinition.DIRECTORY_GROUPING.resolveModelAttribute(expressionResolver, model).asString()); } catch (OperationFai...
[ "private", "static", "DirectoryGrouping", "resolveDirectoryGrouping", "(", "final", "ModelNode", "model", ",", "final", "ExpressionResolver", "expressionResolver", ")", "{", "try", "{", "return", "DirectoryGrouping", ".", "forName", "(", "HostResourceDefinition", ".", "...
Returns the value of found in the model. @param model the model that contains the key and value. @param expressionResolver the expression resolver to use to resolve expressions @return the directory grouping found in the model. @throws IllegalArgumentException if the {@link org.jboss.as.controller.descriptions.Model...
[ "Returns", "the", "value", "of", "found", "in", "the", "model", "." ]
train
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/host-controller/src/main/java/org/jboss/as/host/controller/ManagedServerBootCmdFactory.java#L238-L244
nakamura5akihito/six-util
src/main/java/jp/go/aist/six/util/core/web/spring/SpringHttpClientImpl.java
SpringHttpClientImpl.postByRead
public String postByRead( final String url, final Reader input, final String media_type ) { """ HTTP POST: Reads the contents from the specified reader and sends them to the URL. @return the location, as an URI, where the resource ...
java
public String postByRead( final String url, final Reader input, final String media_type ) { String location = _execute( url, HttpMethod.POST, new ReaderRequestCallback( input, MediaType.parseMediaType( m...
[ "public", "String", "postByRead", "(", "final", "String", "url", ",", "final", "Reader", "input", ",", "final", "String", "media_type", ")", "{", "String", "location", "=", "_execute", "(", "url", ",", "HttpMethod", ".", "POST", ",", "new", "ReaderRequestCal...
HTTP POST: Reads the contents from the specified reader and sends them to the URL. @return the location, as an URI, where the resource is created. @throws HttpException when an exceptional condition occurred during the HTTP method execution.
[ "HTTP", "POST", ":", "Reads", "the", "contents", "from", "the", "specified", "reader", "and", "sends", "them", "to", "the", "URL", "." ]
train
https://github.com/nakamura5akihito/six-util/blob/a6db388a345e220cea2b1fa6324d15c80c6278b6/src/main/java/jp/go/aist/six/util/core/web/spring/SpringHttpClientImpl.java#L404-L415
mozilla/rhino
src/org/mozilla/javascript/ScriptRuntime.java
ScriptRuntime.throwError
public static JavaScriptException throwError(Context cx, Scriptable scope, String message) { """ Equivalent to executing "new Error(message, sourceFileName, sourceLineNo)" from JavaScript. @param cx the current context @param scope the current scope @param message the message @return a JavaScriptEx...
java
public static JavaScriptException throwError(Context cx, Scriptable scope, String message) { int[] linep = { 0 }; String filename = Context.getSourcePositionFromStack(linep); final Scriptable error = newBuiltinObject(cx, scope, TopLevel.Builtins.Error, new Object[] { mess...
[ "public", "static", "JavaScriptException", "throwError", "(", "Context", "cx", ",", "Scriptable", "scope", ",", "String", "message", ")", "{", "int", "[", "]", "linep", "=", "{", "0", "}", ";", "String", "filename", "=", "Context", ".", "getSourcePositionFro...
Equivalent to executing "new Error(message, sourceFileName, sourceLineNo)" from JavaScript. @param cx the current context @param scope the current scope @param message the message @return a JavaScriptException you should throw
[ "Equivalent", "to", "executing", "new", "Error", "(", "message", "sourceFileName", "sourceLineNo", ")", "from", "JavaScript", "." ]
train
https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ScriptRuntime.java#L4558-L4565
cdk/cdk
base/isomorphism/src/main/java/org/openscience/cdk/isomorphism/matchers/QueryAtomContainerCreator.java
QueryAtomContainerCreator.createAnyAtomAnyBondContainer
public static QueryAtomContainer createAnyAtomAnyBondContainer(IAtomContainer container, boolean aromaticity) { """ Creates a QueryAtomContainer with the following settings: <pre> // aromaticity = true QueryAtomContainer.create(container, Expr.Type.IS_AROMATIC); // aromaticity = false QueryAtomContainer.cr...
java
public static QueryAtomContainer createAnyAtomAnyBondContainer(IAtomContainer container, boolean aromaticity) { if (aromaticity) return QueryAtomContainer.create(container, Expr.Type.IS_AROMATIC); else return QueryAtomContainer.create(container); }
[ "public", "static", "QueryAtomContainer", "createAnyAtomAnyBondContainer", "(", "IAtomContainer", "container", ",", "boolean", "aromaticity", ")", "{", "if", "(", "aromaticity", ")", "return", "QueryAtomContainer", ".", "create", "(", "container", ",", "Expr", ".", ...
Creates a QueryAtomContainer with the following settings: <pre> // aromaticity = true QueryAtomContainer.create(container, Expr.Type.IS_AROMATIC); // aromaticity = false QueryAtomContainer.create(container); </pre> @param container The AtomContainer that stands as model @param aromaticity option flag @return The ne...
[ "Creates", "a", "QueryAtomContainer", "with", "the", "following", "settings", ":" ]
train
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/isomorphism/src/main/java/org/openscience/cdk/isomorphism/matchers/QueryAtomContainerCreator.java#L176-L181
radkovo/CSSBox
src/main/java/org/fit/cssbox/layout/TextBox.java
TextBox.stringWidth
private int stringWidth(FontMetrics fm, String text) { """ Computes the final width of a string while considering word-spacing @param fm the font metrics used for calculation @param text the string to be measured @return the resulting width in pixels """ int w = fm.stringWidth(text); if (wor...
java
private int stringWidth(FontMetrics fm, String text) { int w = fm.stringWidth(text); if (wordSpacing != null) { //count spaces and add float add = 0.0f; for (int i = 0; i < text.length(); i++) { if (text.charAt(i) == ' ') ...
[ "private", "int", "stringWidth", "(", "FontMetrics", "fm", ",", "String", "text", ")", "{", "int", "w", "=", "fm", ".", "stringWidth", "(", "text", ")", ";", "if", "(", "wordSpacing", "!=", "null", ")", "{", "//count spaces and add", "float", "add", "=",...
Computes the final width of a string while considering word-spacing @param fm the font metrics used for calculation @param text the string to be measured @return the resulting width in pixels
[ "Computes", "the", "final", "width", "of", "a", "string", "while", "considering", "word", "-", "spacing" ]
train
https://github.com/radkovo/CSSBox/blob/38aaf8f22d233d7b4dbc12a56cdbc72b447bc559/src/main/java/org/fit/cssbox/layout/TextBox.java#L1020-L1035
DV8FromTheWorld/JDA
src/main/java/net/dv8tion/jda/core/requests/restaction/ChannelAction.java
ChannelAction.addPermissionOverride
@CheckReturnValue public ChannelAction addPermissionOverride(IPermissionHolder target, long allow, long deny) { """ Adds a new Role or Member {@link net.dv8tion.jda.core.entities.PermissionOverride PermissionOverride} for the new Channel. <p>Example: <pre>{@code Role role = guild.getPublicRole(); long a...
java
@CheckReturnValue public ChannelAction addPermissionOverride(IPermissionHolder target, long allow, long deny) { Checks.notNull(target, "Override Role"); Checks.notNegative(allow, "Granted permissions value"); Checks.notNegative(deny, "Denied permissions value"); Checks.check(allo...
[ "@", "CheckReturnValue", "public", "ChannelAction", "addPermissionOverride", "(", "IPermissionHolder", "target", ",", "long", "allow", ",", "long", "deny", ")", "{", "Checks", ".", "notNull", "(", "target", ",", "\"Override Role\"", ")", ";", "Checks", ".", "not...
Adds a new Role or Member {@link net.dv8tion.jda.core.entities.PermissionOverride PermissionOverride} for the new Channel. <p>Example: <pre>{@code Role role = guild.getPublicRole(); long allow = Permission.MESSAGE_READ.getRawValue(); long deny = Permission.MESSAGE_WRITE.getRawValue() | Permission.MESSAGE_ADD_REACTION....
[ "Adds", "a", "new", "Role", "or", "Member", "{", "@link", "net", ".", "dv8tion", ".", "jda", ".", "core", ".", "entities", ".", "PermissionOverride", "PermissionOverride", "}", "for", "the", "new", "Channel", "." ]
train
https://github.com/DV8FromTheWorld/JDA/blob/8ecbbe354d03f6bf448411bba573d0d4c268b560/src/main/java/net/dv8tion/jda/core/requests/restaction/ChannelAction.java#L300-L323
Sefford/fraggle
fraggle/src/main/java/com/sefford/fraggle/FraggleManager.java
FraggleManager.processAddToBackstackFlag
protected void processAddToBackstackFlag(String title, int flags, FragmentTransaction ft) { """ Processes Add to Backstack flag. <p/> Will not add the Fragment to the backstack if the {@link #DO_NOT_ADD_TO_BACKSTACK DO_NOT_ADD_TO_BACKSTACK} flag is found. @param title Title of the fragment @param flags Adde...
java
protected void processAddToBackstackFlag(String title, int flags, FragmentTransaction ft) { if ((flags & DO_NOT_ADD_TO_BACKSTACK) != DO_NOT_ADD_TO_BACKSTACK) { ft.addToBackStack(title); } }
[ "protected", "void", "processAddToBackstackFlag", "(", "String", "title", ",", "int", "flags", ",", "FragmentTransaction", "ft", ")", "{", "if", "(", "(", "flags", "&", "DO_NOT_ADD_TO_BACKSTACK", ")", "!=", "DO_NOT_ADD_TO_BACKSTACK", ")", "{", "ft", ".", "addToB...
Processes Add to Backstack flag. <p/> Will not add the Fragment to the backstack if the {@link #DO_NOT_ADD_TO_BACKSTACK DO_NOT_ADD_TO_BACKSTACK} flag is found. @param title Title of the fragment @param flags Added flags to the Fragment configuration @param ft Transaction to add to backstack from
[ "Processes", "Add", "to", "Backstack", "flag", ".", "<p", "/", ">", "Will", "not", "add", "the", "Fragment", "to", "the", "backstack", "if", "the", "{", "@link", "#DO_NOT_ADD_TO_BACKSTACK", "DO_NOT_ADD_TO_BACKSTACK", "}", "flag", "is", "found", "." ]
train
https://github.com/Sefford/fraggle/blob/d1b65a99ecc3c3faeef8f288ca6225bbf475c3a3/fraggle/src/main/java/com/sefford/fraggle/FraggleManager.java#L217-L221
jenkinsci/jenkins
core/src/main/java/hudson/util/spring/BeanBuilder.java
BeanBuilder.setProperty
@Override public void setProperty(String name, Object value) { """ This method overrides property setting in the scope of the BeanBuilder to set properties on the current BeanConfiguration """ if(currentBeanConfig != null) { if(value instanceof GString)value = value.toString(); if(addToDeferred(curre...
java
@Override public void setProperty(String name, Object value) { if(currentBeanConfig != null) { if(value instanceof GString)value = value.toString(); if(addToDeferred(currentBeanConfig, name, value)) { return; } else if(value instanceof Closure) { BeanConfiguration current = currentBeanConfig; ...
[ "@", "Override", "public", "void", "setProperty", "(", "String", "name", ",", "Object", "value", ")", "{", "if", "(", "currentBeanConfig", "!=", "null", ")", "{", "if", "(", "value", "instanceof", "GString", ")", "value", "=", "value", ".", "toString", "...
This method overrides property setting in the scope of the BeanBuilder to set properties on the current BeanConfiguration
[ "This", "method", "overrides", "property", "setting", "in", "the", "scope", "of", "the", "BeanBuilder", "to", "set", "properties", "on", "the", "current", "BeanConfiguration" ]
train
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/util/spring/BeanBuilder.java#L523-L555
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/BackupService.java
BackupService.backupRepository
public org.modeshape.jcr.api.Problems backupRepository( File backupDirectory, BackupOptions options ) throws RepositoryException { """ Start backing up the repository. @param backupDirectory the directory on the file system into which the backup should be placed; this directory should typically not exist @par...
java
public org.modeshape.jcr.api.Problems backupRepository( File backupDirectory, BackupOptions options ) throws RepositoryException { // Create the activity ... final BackupActivity backupActivity = createBackupActivity(backupDirectory, options); //suspend any existing transactions try { ...
[ "public", "org", ".", "modeshape", ".", "jcr", ".", "api", ".", "Problems", "backupRepository", "(", "File", "backupDirectory", ",", "BackupOptions", "options", ")", "throws", "RepositoryException", "{", "// Create the activity ...", "final", "BackupActivity", "backup...
Start backing up the repository. @param backupDirectory the directory on the file system into which the backup should be placed; this directory should typically not exist @param options a {@link org.modeshape.jcr.api.BackupOptions} instance controlling the behavior of the backup; may not be {@code null} @return the pr...
[ "Start", "backing", "up", "the", "repository", "." ]
train
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/BackupService.java#L118-L136
maven-nar/nar-maven-plugin
src/main/java/com/github/maven_nar/cpptasks/apple/PropertyListSerialization.java
PropertyListSerialization.serializeObject
private static void serializeObject(final Object obj, final ContentHandler handler) throws SAXException { """ Serialize an object using the best available element. @param obj object to serialize. @param handler destination of serialization events. @throws SAXException if exception during serialization. ...
java
private static void serializeObject(final Object obj, final ContentHandler handler) throws SAXException { if (obj instanceof Map) { serializeMap((Map) obj, handler); } else if (obj instanceof List) { serializeList((List) obj, handler); } else if (obj instanceof Number) { if (obj instanceof...
[ "private", "static", "void", "serializeObject", "(", "final", "Object", "obj", ",", "final", "ContentHandler", "handler", ")", "throws", "SAXException", "{", "if", "(", "obj", "instanceof", "Map", ")", "{", "serializeMap", "(", "(", "Map", ")", "obj", ",", ...
Serialize an object using the best available element. @param obj object to serialize. @param handler destination of serialization events. @throws SAXException if exception during serialization.
[ "Serialize", "an", "object", "using", "the", "best", "available", "element", "." ]
train
https://github.com/maven-nar/nar-maven-plugin/blob/3c622e2024296b4203431bbae3bde290a01dac00/src/main/java/com/github/maven_nar/cpptasks/apple/PropertyListSerialization.java#L196-L212
alibaba/java-dns-cache-manipulator
library/src/main/java/com/alibaba/dcm/DnsCacheManipulator.java
DnsCacheManipulator.setDnsNegativeCachePolicy
public static void setDnsNegativeCachePolicy(int negativeCacheSeconds) { """ Set JVM DNS negative cache policy @param negativeCacheSeconds set default dns cache time. Special input case: <ul> <li> {@code -1} means never expired.(In effect, all negative value)</li> <li> {@code 0} never cached.</li> </ul> @t...
java
public static void setDnsNegativeCachePolicy(int negativeCacheSeconds) { try { InetAddressCacheUtil.setDnsNegativeCachePolicy(negativeCacheSeconds); } catch (Exception e) { throw new DnsCacheManipulatorException("Fail to setDnsNegativeCachePolicy, cause: " + e.toString(), e); ...
[ "public", "static", "void", "setDnsNegativeCachePolicy", "(", "int", "negativeCacheSeconds", ")", "{", "try", "{", "InetAddressCacheUtil", ".", "setDnsNegativeCachePolicy", "(", "negativeCacheSeconds", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "throw"...
Set JVM DNS negative cache policy @param negativeCacheSeconds set default dns cache time. Special input case: <ul> <li> {@code -1} means never expired.(In effect, all negative value)</li> <li> {@code 0} never cached.</li> </ul> @throws DnsCacheManipulatorException Operation fail @since 1.3.0
[ "Set", "JVM", "DNS", "negative", "cache", "policy" ]
train
https://github.com/alibaba/java-dns-cache-manipulator/blob/eab50ee5c27671f9159b55458301f9429b2fcc47/library/src/main/java/com/alibaba/dcm/DnsCacheManipulator.java#L286-L292
spotify/docker-client
src/main/java/com/spotify/docker/client/DefaultDockerClient.java
DefaultDockerClient.urlEncodeFilters
private String urlEncodeFilters(final Map<String, List<String>> filters) throws DockerException { """ Takes a map of filters and URL-encodes them. If the map is empty or an exception occurs, return null. @param filters A map of filters. @return String @throws DockerException if there's an IOException """...
java
private String urlEncodeFilters(final Map<String, List<String>> filters) throws DockerException { try { final String unencodedFilters = objectMapper().writeValueAsString(filters); if (!unencodedFilters.isEmpty()) { return urlEncode(unencodedFilters); } } catch (IOException e) { t...
[ "private", "String", "urlEncodeFilters", "(", "final", "Map", "<", "String", ",", "List", "<", "String", ">", ">", "filters", ")", "throws", "DockerException", "{", "try", "{", "final", "String", "unencodedFilters", "=", "objectMapper", "(", ")", ".", "write...
Takes a map of filters and URL-encodes them. If the map is empty or an exception occurs, return null. @param filters A map of filters. @return String @throws DockerException if there's an IOException
[ "Takes", "a", "map", "of", "filters", "and", "URL", "-", "encodes", "them", ".", "If", "the", "map", "is", "empty", "or", "an", "exception", "occurs", "return", "null", "." ]
train
https://github.com/spotify/docker-client/blob/f297361891f3bb6a2980b08057eede628d681791/src/main/java/com/spotify/docker/client/DefaultDockerClient.java#L698-L708
eclipse/xtext-core
org.eclipse.xtext/src/org/eclipse/xtext/validation/CancelableDiagnostician.java
CancelableDiagnostician.isCanceled
@Deprecated protected boolean isCanceled(Map<Object, Object> context) { """ <p> Use {@link #checkCanceled} instead to throw a platform specific cancellation exception. </p> """ CancelIndicator indicator = getCancelIndicator(context); return indicator != null && indicator.isCanceled(); }
java
@Deprecated protected boolean isCanceled(Map<Object, Object> context) { CancelIndicator indicator = getCancelIndicator(context); return indicator != null && indicator.isCanceled(); }
[ "@", "Deprecated", "protected", "boolean", "isCanceled", "(", "Map", "<", "Object", ",", "Object", ">", "context", ")", "{", "CancelIndicator", "indicator", "=", "getCancelIndicator", "(", "context", ")", ";", "return", "indicator", "!=", "null", "&&", "indica...
<p> Use {@link #checkCanceled} instead to throw a platform specific cancellation exception. </p>
[ "<p", ">", "Use", "{" ]
train
https://github.com/eclipse/xtext-core/blob/bac941cb75cb24706519845ec174cfef874d7557/org.eclipse.xtext/src/org/eclipse/xtext/validation/CancelableDiagnostician.java#L55-L59
vanilladb/vanillacore
src/main/java/org/vanilladb/core/storage/file/Page.java
Page.setVal
public synchronized void setVal(int offset, Constant val) { """ Writes a constant value to the specified offset on the page. @param offset the byte offset within the page @param val the constant value to be written to the page """ byte[] byteval = val.asBytes(); // Append the size of value if i...
java
public synchronized void setVal(int offset, Constant val) { byte[] byteval = val.asBytes(); // Append the size of value if it is not fixed size if (!val.getType().isFixedSize()) { // check the field capacity and value size if (offset + ByteHelper.INT_SIZE + byteval.length > BLOCK_SIZE) throw new...
[ "public", "synchronized", "void", "setVal", "(", "int", "offset", ",", "Constant", "val", ")", "{", "byte", "[", "]", "byteval", "=", "val", ".", "asBytes", "(", ")", ";", "// Append the size of value if it is not fixed size\r", "if", "(", "!", "val", ".", "...
Writes a constant value to the specified offset on the page. @param offset the byte offset within the page @param val the constant value to be written to the page
[ "Writes", "a", "constant", "value", "to", "the", "specified", "offset", "on", "the", "page", "." ]
train
https://github.com/vanilladb/vanillacore/blob/d9a34e876b1b83226036d1fa982a614bbef59bd1/src/main/java/org/vanilladb/core/storage/file/Page.java#L179-L195
headius/invokebinder
src/main/java/com/headius/invokebinder/Binder.java
Binder.invokeStaticQuiet
public MethodHandle invokeStaticQuiet(MethodHandles.Lookup lookup, Class<?> target, String name) { """ Apply the chain of transforms and bind them to a static method specified using the end signature plus the given class and name. The method will be retrieved using the given Lookup and must match the end signatu...
java
public MethodHandle invokeStaticQuiet(MethodHandles.Lookup lookup, Class<?> target, String name) { try { return invokeStatic(lookup, target, name); } catch (IllegalAccessException | NoSuchMethodException e) { throw new InvalidTransformException(e); } }
[ "public", "MethodHandle", "invokeStaticQuiet", "(", "MethodHandles", ".", "Lookup", "lookup", ",", "Class", "<", "?", ">", "target", ",", "String", "name", ")", "{", "try", "{", "return", "invokeStatic", "(", "lookup", ",", "target", ",", "name", ")", ";",...
Apply the chain of transforms and bind them to a static method specified using the end signature plus the given class and name. The method will be retrieved using the given Lookup and must match the end signature exactly. If the final handle's type does not exactly match the initial type for this Binder, an additional...
[ "Apply", "the", "chain", "of", "transforms", "and", "bind", "them", "to", "a", "static", "method", "specified", "using", "the", "end", "signature", "plus", "the", "given", "class", "and", "name", ".", "The", "method", "will", "be", "retrieved", "using", "t...
train
https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/Binder.java#L1231-L1237
lessthanoptimal/BoofCV
main/boofcv-geo/src/main/java/boofcv/abst/geo/bundle/SceneStructureCommon.java
SceneStructureCommon.connectPointToView
public void connectPointToView( int pointIndex , int viewIndex ) { """ Specifies that the point was observed in this view. @param pointIndex index of point @param viewIndex index of view """ SceneStructureMetric.Point p = points[pointIndex]; for (int i = 0; i < p.views.size; i++) { if( p.views.data[i...
java
public void connectPointToView( int pointIndex , int viewIndex ) { SceneStructureMetric.Point p = points[pointIndex]; for (int i = 0; i < p.views.size; i++) { if( p.views.data[i] == viewIndex ) throw new IllegalArgumentException("Tried to add the same view twice. viewIndex="+viewIndex); } p.views.add(vi...
[ "public", "void", "connectPointToView", "(", "int", "pointIndex", ",", "int", "viewIndex", ")", "{", "SceneStructureMetric", ".", "Point", "p", "=", "points", "[", "pointIndex", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "p", ".", "view...
Specifies that the point was observed in this view. @param pointIndex index of point @param viewIndex index of view
[ "Specifies", "that", "the", "point", "was", "observed", "in", "this", "view", "." ]
train
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/abst/geo/bundle/SceneStructureCommon.java#L73-L81
opentok/Opentok-Java-SDK
src/main/java/com/opentok/OpenTok.java
OpenTok.setBroadcastLayout
public void setBroadcastLayout(String broadcastId, BroadcastProperties properties) throws OpenTokException { """ Sets the layout type for the broadcast. For a description of layout types, see <a href="hhttps://tokbox.com/developer/guides/broadcast/live-streaming/#configuring-video-layout-for-opentok-live-streamin...
java
public void setBroadcastLayout(String broadcastId, BroadcastProperties properties) throws OpenTokException { if (StringUtils.isEmpty(broadcastId) || properties == null) { throw new InvalidArgumentException("BroadcastId is not valid or properties are null"); } this.client.setBroadcast...
[ "public", "void", "setBroadcastLayout", "(", "String", "broadcastId", ",", "BroadcastProperties", "properties", ")", "throws", "OpenTokException", "{", "if", "(", "StringUtils", ".", "isEmpty", "(", "broadcastId", ")", "||", "properties", "==", "null", ")", "{", ...
Sets the layout type for the broadcast. For a description of layout types, see <a href="hhttps://tokbox.com/developer/guides/broadcast/live-streaming/#configuring-video-layout-for-opentok-live-streaming-broadcasts">Configuring video layout for OpenTok live streaming broadcasts</a>. @param broadcastId {String} The broa...
[ "Sets", "the", "layout", "type", "for", "the", "broadcast", ".", "For", "a", "description", "of", "layout", "types", "see", "<a", "href", "=", "hhttps", ":", "//", "tokbox", ".", "com", "/", "developer", "/", "guides", "/", "broadcast", "/", "live", "-...
train
https://github.com/opentok/Opentok-Java-SDK/blob/d71b7999facc3131c415aebea874ea55776d477f/src/main/java/com/opentok/OpenTok.java#L595-L600
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/SynchronousQueue.java
SynchronousQueue.poll
public E poll(long timeout, TimeUnit unit) throws InterruptedException { """ Retrieves and removes the head of this queue, waiting if necessary up to the specified wait time, for another thread to insert it. @return the head of this queue, or {@code null} if the specified waiting time elapses before an eleme...
java
public E poll(long timeout, TimeUnit unit) throws InterruptedException { E e = transferer.transfer(null, true, unit.toNanos(timeout)); if (e != null || !Thread.interrupted()) return e; throw new InterruptedException(); }
[ "public", "E", "poll", "(", "long", "timeout", ",", "TimeUnit", "unit", ")", "throws", "InterruptedException", "{", "E", "e", "=", "transferer", ".", "transfer", "(", "null", ",", "true", ",", "unit", ".", "toNanos", "(", "timeout", ")", ")", ";", "if"...
Retrieves and removes the head of this queue, waiting if necessary up to the specified wait time, for another thread to insert it. @return the head of this queue, or {@code null} if the specified waiting time elapses before an element is present @throws InterruptedException {@inheritDoc}
[ "Retrieves", "and", "removes", "the", "head", "of", "this", "queue", "waiting", "if", "necessary", "up", "to", "the", "specified", "wait", "time", "for", "another", "thread", "to", "insert", "it", "." ]
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/SynchronousQueue.java#L943-L948
banq/jdonframework
src/main/java/com/jdon/aop/AopClient.java
AopClient.invoke
public Object invoke(TargetMetaRequest targetMetaRequest, Method method, Object[] args) throws Throwable { """ dynamic proxy active this method when client call userService.xxxmethod @param targetMetaRequest @param method @param args @return @throws Throwable """ targetMetaRequestsHolder.setTargetMet...
java
public Object invoke(TargetMetaRequest targetMetaRequest, Method method, Object[] args) throws Throwable { targetMetaRequestsHolder.setTargetMetaRequest(targetMetaRequest); Debug.logVerbose( "[JdonFramework] enter AOP invoker2 for:" + targetMetaRequest.getTargetMetaDef().getClassName() + " method:" + method....
[ "public", "Object", "invoke", "(", "TargetMetaRequest", "targetMetaRequest", ",", "Method", "method", ",", "Object", "[", "]", "args", ")", "throws", "Throwable", "{", "targetMetaRequestsHolder", ".", "setTargetMetaRequest", "(", "targetMetaRequest", ")", ";", "Debu...
dynamic proxy active this method when client call userService.xxxmethod @param targetMetaRequest @param method @param args @return @throws Throwable
[ "dynamic", "proxy", "active", "this", "method", "when", "client", "call", "userService", ".", "xxxmethod" ]
train
https://github.com/banq/jdonframework/blob/72b451caac04f775e57f52aaed3d8775044ead53/src/main/java/com/jdon/aop/AopClient.java#L101-L124
Kickflip/kickflip-android-sdk
sdk/src/main/java/io/kickflip/sdk/location/DeviceLocation.java
DeviceLocation.getLastKnownLocation
public static void getLastKnownLocation(Context context, boolean waitForGpsFix, final LocationResult cb) { """ Get the last known location. If one is not available, fetch a fresh location @param context @param waitForGpsFix @param cb """ DeviceLocation deviceLocation = new DeviceLocation(); ...
java
public static void getLastKnownLocation(Context context, boolean waitForGpsFix, final LocationResult cb) { DeviceLocation deviceLocation = new DeviceLocation(); LocationManager lm = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE); Location last_loc; last_loc = lm.ge...
[ "public", "static", "void", "getLastKnownLocation", "(", "Context", "context", ",", "boolean", "waitForGpsFix", ",", "final", "LocationResult", "cb", ")", "{", "DeviceLocation", "deviceLocation", "=", "new", "DeviceLocation", "(", ")", ";", "LocationManager", "lm", ...
Get the last known location. If one is not available, fetch a fresh location @param context @param waitForGpsFix @param cb
[ "Get", "the", "last", "known", "location", ".", "If", "one", "is", "not", "available", "fetch", "a", "fresh", "location" ]
train
https://github.com/Kickflip/kickflip-android-sdk/blob/af3aae5f1128d7376e67aefe11a3a1a3844be734/sdk/src/main/java/io/kickflip/sdk/location/DeviceLocation.java#L41-L55
elki-project/elki
addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGUtil.java
SVGUtil.svgLine
public static Element svgLine(Document document, double x1, double y1, double x2, double y2) { """ Create a SVG line element. Do not confuse this with path elements. @param document document to create in (factory) @param x1 first point x @param y1 first point y @param x2 second point x @param y2 second poin...
java
public static Element svgLine(Document document, double x1, double y1, double x2, double y2) { Element line = SVGUtil.svgElement(document, SVGConstants.SVG_LINE_TAG); SVGUtil.setAtt(line, SVGConstants.SVG_X1_ATTRIBUTE, x1); SVGUtil.setAtt(line, SVGConstants.SVG_Y1_ATTRIBUTE, y1); SVGUtil.setAtt(line, SV...
[ "public", "static", "Element", "svgLine", "(", "Document", "document", ",", "double", "x1", ",", "double", "y1", ",", "double", "x2", ",", "double", "y2", ")", "{", "Element", "line", "=", "SVGUtil", ".", "svgElement", "(", "document", ",", "SVGConstants",...
Create a SVG line element. Do not confuse this with path elements. @param document document to create in (factory) @param x1 first point x @param y1 first point y @param x2 second point x @param y2 second point y @return new element
[ "Create", "a", "SVG", "line", "element", ".", "Do", "not", "confuse", "this", "with", "path", "elements", "." ]
train
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGUtil.java#L464-L471
joniles/mpxj
src/main/java/net/sf/mpxj/ResourceAssignment.java
ResourceAssignment.setDuration
public void setDuration(int index, Duration value) { """ Set a duration value. @param index duration index (1-10) @param value duration value """ set(selectField(AssignmentFieldLists.CUSTOM_DURATION, index), value); }
java
public void setDuration(int index, Duration value) { set(selectField(AssignmentFieldLists.CUSTOM_DURATION, index), value); }
[ "public", "void", "setDuration", "(", "int", "index", ",", "Duration", "value", ")", "{", "set", "(", "selectField", "(", "AssignmentFieldLists", ".", "CUSTOM_DURATION", ",", "index", ")", ",", "value", ")", ";", "}" ]
Set a duration value. @param index duration index (1-10) @param value duration value
[ "Set", "a", "duration", "value", "." ]
train
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/ResourceAssignment.java#L1628-L1631
micronaut-projects/micronaut-core
core/src/main/java/io/micronaut/core/reflect/ReflectionUtils.java
ReflectionUtils.setFieldIfPossible
public static void setFieldIfPossible(Class type, String name, Object value) { """ Finds a field in the type or super type. @param type The type @param name The field name @param value The value """ Optional<Field> declaredField = findDeclaredField(type, name); if (declaredField.isPresen...
java
public static void setFieldIfPossible(Class type, String name, Object value) { Optional<Field> declaredField = findDeclaredField(type, name); if (declaredField.isPresent()) { Field field = declaredField.get(); Optional<?> converted = ConversionService.SHARED.convert(value, field....
[ "public", "static", "void", "setFieldIfPossible", "(", "Class", "type", ",", "String", "name", ",", "Object", "value", ")", "{", "Optional", "<", "Field", ">", "declaredField", "=", "findDeclaredField", "(", "type", ",", "name", ")", ";", "if", "(", "decla...
Finds a field in the type or super type. @param type The type @param name The field name @param value The value
[ "Finds", "a", "field", "in", "the", "type", "or", "super", "type", "." ]
train
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/core/src/main/java/io/micronaut/core/reflect/ReflectionUtils.java#L325-L346
apache/flink
flink-clients/src/main/java/org/apache/flink/client/program/ClusterClient.java
ClusterClient.getAccumulators
public Map<String, OptionalFailure<Object>> getAccumulators(JobID jobID) throws Exception { """ Requests and returns the accumulators for the given job identifier. Accumulators can be requested while a is running or after it has finished. The default class loader is used to deserialize the incoming accumulator r...
java
public Map<String, OptionalFailure<Object>> getAccumulators(JobID jobID) throws Exception { return getAccumulators(jobID, ClassLoader.getSystemClassLoader()); }
[ "public", "Map", "<", "String", ",", "OptionalFailure", "<", "Object", ">", ">", "getAccumulators", "(", "JobID", "jobID", ")", "throws", "Exception", "{", "return", "getAccumulators", "(", "jobID", ",", "ClassLoader", ".", "getSystemClassLoader", "(", ")", ")...
Requests and returns the accumulators for the given job identifier. Accumulators can be requested while a is running or after it has finished. The default class loader is used to deserialize the incoming accumulator results. @param jobID The job identifier of a job. @return A Map containing the accumulator's name and i...
[ "Requests", "and", "returns", "the", "accumulators", "for", "the", "given", "job", "identifier", ".", "Accumulators", "can", "be", "requested", "while", "a", "is", "running", "or", "after", "it", "has", "finished", ".", "The", "default", "class", "loader", "...
train
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-clients/src/main/java/org/apache/flink/client/program/ClusterClient.java#L397-L399
structr/structr
structr-ui/src/main/java/org/structr/web/common/FileHelper.java
FileHelper.setFileData
public static void setFileData(final File file, final byte[] fileData, final String contentType) throws FrameworkException, IOException { """ Write image data from the given byte[] to the given file node and set checksum and size. @param file @param fileData @param contentType if null, try to auto-detect cont...
java
public static void setFileData(final File file, final byte[] fileData, final String contentType) throws FrameworkException, IOException { FileHelper.setFileData(file, fileData, contentType, true); }
[ "public", "static", "void", "setFileData", "(", "final", "File", "file", ",", "final", "byte", "[", "]", "fileData", ",", "final", "String", "contentType", ")", "throws", "FrameworkException", ",", "IOException", "{", "FileHelper", ".", "setFileData", "(", "fi...
Write image data from the given byte[] to the given file node and set checksum and size. @param file @param fileData @param contentType if null, try to auto-detect content type @param updateMetadata @throws FrameworkException @throws IOException
[ "Write", "image", "data", "from", "the", "given", "byte", "[]", "to", "the", "given", "file", "node", "and", "set", "checksum", "and", "size", "." ]
train
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-ui/src/main/java/org/structr/web/common/FileHelper.java#L271-L273
eFaps/eFaps-Kernel
src/main/java/org/efaps/db/AbstractPrintQuery.java
AbstractPrintQuery.addPhrase
public AbstractPrintQuery addPhrase(final String _key, final String _phraseStmt) throws EFapsException { """ Add a Phrase to this PrintQuery. A Phrase is something like: <code>"$&lt;attribute[LastName]&gt; - $&lt;attribute[FirstName]&gt;"</code> This would return "...
java
public AbstractPrintQuery addPhrase(final String _key, final String _phraseStmt) throws EFapsException { ValueList list = null; final ValueParser parser = new ValueParser(new StringReader(_phraseStmt)); try { list = parser.Expressi...
[ "public", "AbstractPrintQuery", "addPhrase", "(", "final", "String", "_key", ",", "final", "String", "_phraseStmt", ")", "throws", "EFapsException", "{", "ValueList", "list", "=", "null", ";", "final", "ValueParser", "parser", "=", "new", "ValueParser", "(", "ne...
Add a Phrase to this PrintQuery. A Phrase is something like: <code>"$&lt;attribute[LastName]&gt; - $&lt;attribute[FirstName]&gt;"</code> This would return " John - Doe". One Phrase can contain various selects as defined for {@link #addSelect(String...)} and string to connect them. @param _key key the phrase can be acc...
[ "Add", "a", "Phrase", "to", "this", "PrintQuery", ".", "A", "Phrase", "is", "something", "like", ":", "<code", ">", "$&lt", ";", "attribute", "[", "LastName", "]", "&gt", ";", "-", "$&lt", ";", "attribute", "[", "FirstName", "]", "&gt", ";", "<", "/"...
train
https://github.com/eFaps/eFaps-Kernel/blob/04b96548f518c2386a93f5ec2b9349f9b9063859/src/main/java/org/efaps/db/AbstractPrintQuery.java#L400-L422
lionsoul2014/jcseg
jcseg-core/src/main/java/org/lionsoul/jcseg/tokenizer/ASegment.java
ASegment.nextCNNumeric
protected String nextCNNumeric( char[] chars, int index ) throws IOException { """ find the Chinese number from the current position count until the char in the specified position is not a other number or whitespace @param chars char array of CJK items @param index @return String[] """ //StringBu...
java
protected String nextCNNumeric( char[] chars, int index ) throws IOException { //StringBuilder isb = new StringBuilder(); isb.clear(); isb.append( chars[ index ]); ctrlMask &= ~ISegment.CHECK_CF_MASK; //reset the fraction check mask. for ( int j = index + 1; ...
[ "protected", "String", "nextCNNumeric", "(", "char", "[", "]", "chars", ",", "int", "index", ")", "throws", "IOException", "{", "//StringBuilder isb = new StringBuilder();", "isb", ".", "clear", "(", ")", ";", "isb", ".", "append", "(", "chars", "[", "index", ...
find the Chinese number from the current position count until the char in the specified position is not a other number or whitespace @param chars char array of CJK items @param index @return String[]
[ "find", "the", "Chinese", "number", "from", "the", "current", "position", "count", "until", "the", "char", "in", "the", "specified", "position", "is", "not", "a", "other", "number", "or", "whitespace" ]
train
https://github.com/lionsoul2014/jcseg/blob/7c8a912e3bbcaf4f8de701180b9c24e2e444a94b/jcseg-core/src/main/java/org/lionsoul/jcseg/tokenizer/ASegment.java#L1559-L1598
gallandarakhneorg/afc
core/inputoutput/src/main/java/org/arakhne/afc/inputoutput/xml/XMLUtil.java
XMLUtil.getAttributeFloat
@Pure public static float getAttributeFloat(Node document, String... path) { """ Replies the float value that corresponds to the specified attribute's path. <p>The path is an ordered list of tag's names and ended by the name of the attribute. Be careful about the fact that the names are case sensitives. @...
java
@Pure public static float getAttributeFloat(Node document, String... path) { assert document != null : AssertMessages.notNullParameter(0); return getAttributeFloatWithDefault(document, true, 0f, path); }
[ "@", "Pure", "public", "static", "float", "getAttributeFloat", "(", "Node", "document", ",", "String", "...", "path", ")", "{", "assert", "document", "!=", "null", ":", "AssertMessages", ".", "notNullParameter", "(", "0", ")", ";", "return", "getAttributeFloat...
Replies the float value that corresponds to the specified attribute's path. <p>The path is an ordered list of tag's names and ended by the name of the attribute. Be careful about the fact that the names are case sensitives. @param document is the XML document to explore. @param path is the list of and ended by the at...
[ "Replies", "the", "float", "value", "that", "corresponds", "to", "the", "specified", "attribute", "s", "path", "." ]
train
https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/inputoutput/src/main/java/org/arakhne/afc/inputoutput/xml/XMLUtil.java#L751-L755
OpenLiberty/open-liberty
dev/com.ibm.ws.logging.hpel/src/com/ibm/websphere/logging/hpel/reader/RepositoryReaderImpl.java
RepositoryReaderImpl.getLogLists
public Iterable<ServerInstanceLogRecordList> getLogLists(int minLevel, int maxLevel) { """ returns log records from the binary repository that are within the level range as specified by the parameters. @param minLevel integer value of the minimum {@link Level} that the returned records need to match @param max...
java
public Iterable<ServerInstanceLogRecordList> getLogLists(int minLevel, int maxLevel) { return getLogLists((Date) null, (Date) null, new LevelFilter(minLevel, maxLevel)); }
[ "public", "Iterable", "<", "ServerInstanceLogRecordList", ">", "getLogLists", "(", "int", "minLevel", ",", "int", "maxLevel", ")", "{", "return", "getLogLists", "(", "(", "Date", ")", "null", ",", "(", "Date", ")", "null", ",", "new", "LevelFilter", "(", "...
returns log records from the binary repository that are within the level range as specified by the parameters. @param minLevel integer value of the minimum {@link Level} that the returned records need to match @param maxLevel integer value of the maximum {@link Level} that the returned records need to match @return th...
[ "returns", "log", "records", "from", "the", "binary", "repository", "that", "are", "within", "the", "level", "range", "as", "specified", "by", "the", "parameters", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging.hpel/src/com/ibm/websphere/logging/hpel/reader/RepositoryReaderImpl.java#L705-L707
Netflix/Hystrix
hystrix-core/src/main/java/com/netflix/hystrix/AbstractCommand.java
AbstractCommand.initThreadPoolKey
private static HystrixThreadPoolKey initThreadPoolKey(HystrixThreadPoolKey threadPoolKey, HystrixCommandGroupKey groupKey, String threadPoolKeyOverride) { """ /* ThreadPoolKey This defines which thread-pool this command should run on. It uses the HystrixThreadPoolKey if provided, then defaults to use Hystri...
java
private static HystrixThreadPoolKey initThreadPoolKey(HystrixThreadPoolKey threadPoolKey, HystrixCommandGroupKey groupKey, String threadPoolKeyOverride) { if (threadPoolKeyOverride == null) { // we don't have a property overriding the value so use either HystrixThreadPoolKey or HystrixCommandGroup ...
[ "private", "static", "HystrixThreadPoolKey", "initThreadPoolKey", "(", "HystrixThreadPoolKey", "threadPoolKey", ",", "HystrixCommandGroupKey", "groupKey", ",", "String", "threadPoolKeyOverride", ")", "{", "if", "(", "threadPoolKeyOverride", "==", "null", ")", "{", "// we ...
/* ThreadPoolKey This defines which thread-pool this command should run on. It uses the HystrixThreadPoolKey if provided, then defaults to use HystrixCommandGroup. It can then be overridden by a property if defined so it can be changed at runtime.
[ "/", "*", "ThreadPoolKey" ]
train
https://github.com/Netflix/Hystrix/blob/3cb21589895e9f8f87cfcdbc9d96d9f63d48b848/hystrix-core/src/main/java/com/netflix/hystrix/AbstractCommand.java#L221-L234
gallandarakhneorg/afc
core/maths/mathgeom/tobeincluded/src/d3/continuous/AbstractTriangle3F.java
AbstractTriangle3F.getGroundHeight
public double getGroundHeight(Point2D point, CoordinateSystem3D system) { """ Replies the height of the projection on the triangle that is representing a ground. <p> Assuming that the triangle is representing a face of a terrain/ground, this function compute the height of the ground just below the given positio...
java
public double getGroundHeight(Point2D point, CoordinateSystem3D system) { return getGroundHeight(point.getX(), point.getY(), system); }
[ "public", "double", "getGroundHeight", "(", "Point2D", "point", ",", "CoordinateSystem3D", "system", ")", "{", "return", "getGroundHeight", "(", "point", ".", "getX", "(", ")", ",", "point", ".", "getY", "(", ")", ",", "system", ")", ";", "}" ]
Replies the height of the projection on the triangle that is representing a ground. <p> Assuming that the triangle is representing a face of a terrain/ground, this function compute the height of the ground just below the given position. The input of this function is the coordinate of a point on the horizontal plane. @...
[ "Replies", "the", "height", "of", "the", "projection", "on", "the", "triangle", "that", "is", "representing", "a", "ground", ".", "<p", ">", "Assuming", "that", "the", "triangle", "is", "representing", "a", "face", "of", "a", "terrain", "/", "ground", "thi...
train
https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathgeom/tobeincluded/src/d3/continuous/AbstractTriangle3F.java#L2187-L2189
apereo/cas
core/cas-server-core-authentication-api/src/main/java/org/apereo/cas/authentication/PolicyBasedAuthenticationManager.java
PolicyBasedAuthenticationManager.handleAuthenticationException
protected void handleAuthenticationException(final Throwable ex, final String name, final AuthenticationBuilder builder) { """ Handle authentication exception. @param ex the exception @param name the name @param builder the builder """ var e = ex; if (ex instanceof UndeclaredThrowa...
java
protected void handleAuthenticationException(final Throwable ex, final String name, final AuthenticationBuilder builder) { var e = ex; if (ex instanceof UndeclaredThrowableException) { e = ((UndeclaredThrowableException) ex).getUndeclaredThrowable(); } LOGGER.trace(e.getMess...
[ "protected", "void", "handleAuthenticationException", "(", "final", "Throwable", "ex", ",", "final", "String", "name", ",", "final", "AuthenticationBuilder", "builder", ")", "{", "var", "e", "=", "ex", ";", "if", "(", "ex", "instanceof", "UndeclaredThrowableExcept...
Handle authentication exception. @param ex the exception @param name the name @param builder the builder
[ "Handle", "authentication", "exception", "." ]
train
https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/core/cas-server-core-authentication-api/src/main/java/org/apereo/cas/authentication/PolicyBasedAuthenticationManager.java#L406-L425
EdwardRaff/JSAT
JSAT/src/jsat/math/optimization/oned/GoldenSearch.java
GoldenSearch.findMin
public static double findMin(double min, double max, Function1D f, double eps, int maxSteps) { """ Attempts to numerically find the value {@code x} that minimizes the one dimensional function {@code f(x)} in the range {@code [min, max]}. @param min the minimum of the search range @param max the maximum of the...
java
public static double findMin(double min, double max, Function1D f, double eps, int maxSteps) { double a = min, b = max; double fa = f.f(a), fb = f.f(b); double c = b - goldenRatio * (b - a); double d = a + goldenRatio * (b - a); double fc = f.f(c); double fd ...
[ "public", "static", "double", "findMin", "(", "double", "min", ",", "double", "max", ",", "Function1D", "f", ",", "double", "eps", ",", "int", "maxSteps", ")", "{", "double", "a", "=", "min", ",", "b", "=", "max", ";", "double", "fa", "=", "f", "."...
Attempts to numerically find the value {@code x} that minimizes the one dimensional function {@code f(x)} in the range {@code [min, max]}. @param min the minimum of the search range @param max the maximum of the search range @param f the one dimensional function to minimize @param eps the desired accuracy of the retur...
[ "Attempts", "to", "numerically", "find", "the", "value", "{", "@code", "x", "}", "that", "minimizes", "the", "one", "dimensional", "function", "{", "@code", "f", "(", "x", ")", "}", "in", "the", "range", "{", "@code", "[", "min", "max", "]", "}", "."...
train
https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/math/optimization/oned/GoldenSearch.java#L42-L81
Mozu/mozu-java
mozu-java-core/src/main/java/com/mozu/api/urls/commerce/catalog/admin/pricelists/PriceListEntryUrl.java
PriceListEntryUrl.deletePriceListEntryUrl
public static MozuUrl deletePriceListEntryUrl(String currencyCode, String priceListCode, String productCode, DateTime startDate) { """ Get Resource Url for DeletePriceListEntry @param currencyCode The three character ISO currency code, such as USD for US Dollars. @param priceListCode The code of the specified ...
java
public static MozuUrl deletePriceListEntryUrl(String currencyCode, String priceListCode, String productCode, DateTime startDate) { UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/pricelists/{priceListCode}/entries/{productCode}/{currencyCode}?startDate={startDate}"); formatter.formatUrl("...
[ "public", "static", "MozuUrl", "deletePriceListEntryUrl", "(", "String", "currencyCode", ",", "String", "priceListCode", ",", "String", "productCode", ",", "DateTime", "startDate", ")", "{", "UrlFormatter", "formatter", "=", "new", "UrlFormatter", "(", "\"/api/commerc...
Get Resource Url for DeletePriceListEntry @param currencyCode The three character ISO currency code, such as USD for US Dollars. @param priceListCode The code of the specified price list associated with the price list entry. @param productCode The unique, user-defined product code of a product, used throughout to re...
[ "Get", "Resource", "Url", "for", "DeletePriceListEntry" ]
train
https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-java-core/src/main/java/com/mozu/api/urls/commerce/catalog/admin/pricelists/PriceListEntryUrl.java#L100-L108
aNNiMON/Lightweight-Stream-API
stream/src/main/java/com/annimon/stream/Stream.java
Stream.flatMapToLong
@NotNull public LongStream flatMapToLong(@NotNull final Function<? super T, ? extends LongStream> mapper) { """ Returns a stream consisting of the results of replacing each element of this stream with the contents of a mapped stream produced by applying the provided mapping function to each element. <p>Th...
java
@NotNull public LongStream flatMapToLong(@NotNull final Function<? super T, ? extends LongStream> mapper) { return new LongStream(params, new ObjFlatMapToLong<T>(iterator, mapper)); }
[ "@", "NotNull", "public", "LongStream", "flatMapToLong", "(", "@", "NotNull", "final", "Function", "<", "?", "super", "T", ",", "?", "extends", "LongStream", ">", "mapper", ")", "{", "return", "new", "LongStream", "(", "params", ",", "new", "ObjFlatMapToLong...
Returns a stream consisting of the results of replacing each element of this stream with the contents of a mapped stream produced by applying the provided mapping function to each element. <p>This is an intermediate operation. @param mapper the mapper function used to apply to each element @return the new {@code Lon...
[ "Returns", "a", "stream", "consisting", "of", "the", "results", "of", "replacing", "each", "element", "of", "this", "stream", "with", "the", "contents", "of", "a", "mapped", "stream", "produced", "by", "applying", "the", "provided", "mapping", "function", "to"...
train
https://github.com/aNNiMON/Lightweight-Stream-API/blob/f29fd57208c20252a4549b084d55ed082c3e58f0/stream/src/main/java/com/annimon/stream/Stream.java#L896-L899
CloudSlang/cs-actions
cs-database/src/main/java/io/cloudslang/content/database/services/dbconnection/PooledDataSourceProvider.java
PooledDataSourceProvider.getPropStringValue
protected String getPropStringValue(String aPropName, String aDefaultValue) { """ get string value based on the property name from property file the property file is databasePooling.properties @param aPropName a property name @param aDefaultValue a default value for that property, if the property is not t...
java
protected String getPropStringValue(String aPropName, String aDefaultValue) { return dbPoolingProperties.getProperty(aPropName, aDefaultValue); }
[ "protected", "String", "getPropStringValue", "(", "String", "aPropName", ",", "String", "aDefaultValue", ")", "{", "return", "dbPoolingProperties", ".", "getProperty", "(", "aPropName", ",", "aDefaultValue", ")", ";", "}" ]
get string value based on the property name from property file the property file is databasePooling.properties @param aPropName a property name @param aDefaultValue a default value for that property, if the property is not there. @return string value of that property
[ "get", "string", "value", "based", "on", "the", "property", "name", "from", "property", "file", "the", "property", "file", "is", "databasePooling", ".", "properties" ]
train
https://github.com/CloudSlang/cs-actions/blob/9a1be1e99ad88286a6c153d5f2275df6ae1a57a1/cs-database/src/main/java/io/cloudslang/content/database/services/dbconnection/PooledDataSourceProvider.java#L171-L174
jayantk/jklol
src/com/jayantkrish/jklol/ccg/lambda2/Expression2.java
Expression2.substitute
public Expression2 substitute(Expression2 value, Expression2 replacement) { """ Replaces all occurrences of {@code value} in this expression with {@code replacement}. @param value @param replacement @return """ if (this.equals(value)) { return replacement; } else if (this.isConstant()) { ...
java
public Expression2 substitute(Expression2 value, Expression2 replacement) { if (this.equals(value)) { return replacement; } else if (this.isConstant()) { return this; } else { List<Expression2> newSubexpressions = Lists.newArrayList(); for (Expression2 sub : subexpressions) { ...
[ "public", "Expression2", "substitute", "(", "Expression2", "value", ",", "Expression2", "replacement", ")", "{", "if", "(", "this", ".", "equals", "(", "value", ")", ")", "{", "return", "replacement", ";", "}", "else", "if", "(", "this", ".", "isConstant",...
Replaces all occurrences of {@code value} in this expression with {@code replacement}. @param value @param replacement @return
[ "Replaces", "all", "occurrences", "of", "{", "@code", "value", "}", "in", "this", "expression", "with", "{", "@code", "replacement", "}", "." ]
train
https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/ccg/lambda2/Expression2.java#L275-L287
jeremylong/DependencyCheck
utils/src/main/java/org/owasp/dependencycheck/utils/Settings.java
Settings.setStringIfNotNull
public void setStringIfNotNull(@NotNull final String key, @Nullable final String value) { """ Sets a property value only if the value is not null. @param key the key for the property @param value the value for the property """ if (null != value) { setString(key, value); } }
java
public void setStringIfNotNull(@NotNull final String key, @Nullable final String value) { if (null != value) { setString(key, value); } }
[ "public", "void", "setStringIfNotNull", "(", "@", "NotNull", "final", "String", "key", ",", "@", "Nullable", "final", "String", "value", ")", "{", "if", "(", "null", "!=", "value", ")", "{", "setString", "(", "key", ",", "value", ")", ";", "}", "}" ]
Sets a property value only if the value is not null. @param key the key for the property @param value the value for the property
[ "Sets", "a", "property", "value", "only", "if", "the", "value", "is", "not", "null", "." ]
train
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/utils/src/main/java/org/owasp/dependencycheck/utils/Settings.java#L676-L680
alkacon/opencms-core
src/org/opencms/publish/CmsPublishListVerifier.java
CmsPublishListVerifier.addForbiddenParentFolder
public CmsUUID addForbiddenParentFolder(String parentFolder, String reason) { """ Adds a forbidden parent folder.<p> @param parentFolder the forbidden parent folder @param reason the reason why publishing is not allowed @return an ID which can be used later to remove the forbidden parent folder """ ...
java
public CmsUUID addForbiddenParentFolder(String parentFolder, String reason) { CmsUUID id = new CmsUUID(); m_forbiddenParentFolders.put(id, new ForbiddenFolderEntry(parentFolder, reason)); return id; }
[ "public", "CmsUUID", "addForbiddenParentFolder", "(", "String", "parentFolder", ",", "String", "reason", ")", "{", "CmsUUID", "id", "=", "new", "CmsUUID", "(", ")", ";", "m_forbiddenParentFolders", ".", "put", "(", "id", ",", "new", "ForbiddenFolderEntry", "(", ...
Adds a forbidden parent folder.<p> @param parentFolder the forbidden parent folder @param reason the reason why publishing is not allowed @return an ID which can be used later to remove the forbidden parent folder
[ "Adds", "a", "forbidden", "parent", "folder", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/publish/CmsPublishListVerifier.java#L105-L110