repository_name
stringlengths
7
54
func_path_in_repository
stringlengths
18
218
func_name
stringlengths
5
140
whole_func_string
stringlengths
79
3.99k
language
stringclasses
1 value
func_code_string
stringlengths
79
3.99k
func_code_tokens
listlengths
20
624
func_documentation_string
stringlengths
61
1.96k
func_documentation_tokens
listlengths
1
478
split_name
stringclasses
1 value
func_code_url
stringlengths
107
339
Azure/azure-sdk-for-java
network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/SecurityRulesInner.java
SecurityRulesInner.beginCreateOrUpdate
public SecurityRuleInner beginCreateOrUpdate(String resourceGroupName, String networkSecurityGroupName, String securityRuleName, SecurityRuleInner securityRuleParameters) { return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters).t...
java
public SecurityRuleInner beginCreateOrUpdate(String resourceGroupName, String networkSecurityGroupName, String securityRuleName, SecurityRuleInner securityRuleParameters) { return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters).t...
[ "public", "SecurityRuleInner", "beginCreateOrUpdate", "(", "String", "resourceGroupName", ",", "String", "networkSecurityGroupName", ",", "String", "securityRuleName", ",", "SecurityRuleInner", "securityRuleParameters", ")", "{", "return", "beginCreateOrUpdateWithServiceResponseA...
Creates or updates a security rule in the specified network security group. @param resourceGroupName The name of the resource group. @param networkSecurityGroupName The name of the network security group. @param securityRuleName The name of the security rule. @param securityRuleParameters Parameters supplied to the cr...
[ "Creates", "or", "updates", "a", "security", "rule", "in", "the", "specified", "network", "security", "group", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/SecurityRulesInner.java#L444-L446
passwordmaker/java-passwordmaker-lib
src/main/java/org/daveware/passwordmaker/Database.java
Database.removeAccount
private void removeAccount(Account parent, Account child) { parent.getChildren().remove(child); sendAccountRemoved(parent, child); }
java
private void removeAccount(Account parent, Account child) { parent.getChildren().remove(child); sendAccountRemoved(parent, child); }
[ "private", "void", "removeAccount", "(", "Account", "parent", ",", "Account", "child", ")", "{", "parent", ".", "getChildren", "(", ")", ".", "remove", "(", "child", ")", ";", "sendAccountRemoved", "(", "parent", ",", "child", ")", ";", "}" ]
Internal routine to remove a child from a parent. Notifies the listeners of the removal @param parent - The parent to remove the child from @param child - The child to remove from parent
[ "Internal", "routine", "to", "remove", "a", "child", "from", "a", "parent", ".", "Notifies", "the", "listeners", "of", "the", "removal" ]
train
https://github.com/passwordmaker/java-passwordmaker-lib/blob/18c22fca7dd9a47f08161425b85a5bd257afbb2b/src/main/java/org/daveware/passwordmaker/Database.java#L152-L155
liferay/com-liferay-commerce
commerce-payment-api/src/main/java/com/liferay/commerce/payment/model/CommercePaymentMethodGroupRelWrapper.java
CommercePaymentMethodGroupRelWrapper.getDescription
@Override public String getDescription(String languageId, boolean useDefault) { return _commercePaymentMethodGroupRel.getDescription(languageId, useDefault); }
java
@Override public String getDescription(String languageId, boolean useDefault) { return _commercePaymentMethodGroupRel.getDescription(languageId, useDefault); }
[ "@", "Override", "public", "String", "getDescription", "(", "String", "languageId", ",", "boolean", "useDefault", ")", "{", "return", "_commercePaymentMethodGroupRel", ".", "getDescription", "(", "languageId", ",", "useDefault", ")", ";", "}" ]
Returns the localized description of this commerce payment method group rel in the language, optionally using the default language if no localization exists for the requested language. @param languageId the ID of the language @param useDefault whether to use the default language if no localization exists for the reque...
[ "Returns", "the", "localized", "description", "of", "this", "commerce", "payment", "method", "group", "rel", "in", "the", "language", "optionally", "using", "the", "default", "language", "if", "no", "localization", "exists", "for", "the", "requested", "language", ...
train
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-payment-api/src/main/java/com/liferay/commerce/payment/model/CommercePaymentMethodGroupRelWrapper.java#L275-L279
ngageoint/geopackage-core-java
src/main/java/mil/nga/geopackage/style/ColorUtils.java
ColorUtils.toColorWithAlpha
public static int toColorWithAlpha(int red, int green, int blue, int alpha) { validateRGB(red); validateRGB(green); validateRGB(blue); int color = (red & 0xff) << 16 | (green & 0xff) << 8 | (blue & 0xff); if (alpha != -1) { validateRGB(alpha); color = (alpha & 0xff) << 24 | color; } return color; }
java
public static int toColorWithAlpha(int red, int green, int blue, int alpha) { validateRGB(red); validateRGB(green); validateRGB(blue); int color = (red & 0xff) << 16 | (green & 0xff) << 8 | (blue & 0xff); if (alpha != -1) { validateRGB(alpha); color = (alpha & 0xff) << 24 | color; } return color; }
[ "public", "static", "int", "toColorWithAlpha", "(", "int", "red", ",", "int", "green", ",", "int", "blue", ",", "int", "alpha", ")", "{", "validateRGB", "(", "red", ")", ";", "validateRGB", "(", "green", ")", ";", "validateRGB", "(", "blue", ")", ";", ...
Convert the RBGA values to a color integer @param red red integer color inclusively between 0 and 255 @param green green integer color inclusively between 0 and 255 @param blue blue integer color inclusively between 0 and 255 @param alpha alpha integer color inclusively between 0 and 255, -1 to not include alpha @ret...
[ "Convert", "the", "RBGA", "values", "to", "a", "color", "integer" ]
train
https://github.com/ngageoint/geopackage-core-java/blob/6431c3b041a45b7f3802904ea4156b4082a72daa/src/main/java/mil/nga/geopackage/style/ColorUtils.java#L196-L206
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/spillover/spilloveraction.java
spilloveraction.get
public static spilloveraction get(nitro_service service, String name) throws Exception{ spilloveraction obj = new spilloveraction(); obj.set_name(name); spilloveraction response = (spilloveraction) obj.get_resource(service); return response; }
java
public static spilloveraction get(nitro_service service, String name) throws Exception{ spilloveraction obj = new spilloveraction(); obj.set_name(name); spilloveraction response = (spilloveraction) obj.get_resource(service); return response; }
[ "public", "static", "spilloveraction", "get", "(", "nitro_service", "service", ",", "String", "name", ")", "throws", "Exception", "{", "spilloveraction", "obj", "=", "new", "spilloveraction", "(", ")", ";", "obj", ".", "set_name", "(", "name", ")", ";", "spi...
Use this API to fetch spilloveraction resource of given name .
[ "Use", "this", "API", "to", "fetch", "spilloveraction", "resource", "of", "given", "name", "." ]
train
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/spillover/spilloveraction.java#L265-L270
deeplearning4j/deeplearning4j
deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/preprocessing/text/KerasTokenizer.java
KerasTokenizer.fromJson
public static KerasTokenizer fromJson(String jsonFileName) throws IOException, InvalidKerasConfigurationException { String json = new String(Files.readAllBytes(Paths.get(jsonFileName))); Map<String, Object> tokenizerBaseConfig = parseJsonString(json); Map<String, Object> tokenizerConfig; ...
java
public static KerasTokenizer fromJson(String jsonFileName) throws IOException, InvalidKerasConfigurationException { String json = new String(Files.readAllBytes(Paths.get(jsonFileName))); Map<String, Object> tokenizerBaseConfig = parseJsonString(json); Map<String, Object> tokenizerConfig; ...
[ "public", "static", "KerasTokenizer", "fromJson", "(", "String", "jsonFileName", ")", "throws", "IOException", ",", "InvalidKerasConfigurationException", "{", "String", "json", "=", "new", "String", "(", "Files", ".", "readAllBytes", "(", "Paths", ".", "get", "(",...
Import Keras Tokenizer from JSON file created with `tokenizer.to_json()` in Python. @param jsonFileName Full path of the JSON file to load @return Keras Tokenizer instance loaded from JSON @throws IOException I/O exception @throws InvalidKerasConfigurationException Invalid Keras configuration
[ "Import", "Keras", "Tokenizer", "from", "JSON", "file", "created", "with", "tokenizer", ".", "to_json", "()", "in", "Python", "." ]
train
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/preprocessing/text/KerasTokenizer.java#L107-L145
igniterealtime/jbosh
src/main/java/org/igniterealtime/jbosh/ApacheHTTPResponse.java
ApacheHTTPResponse.awaitResponse
private synchronized void awaitResponse() throws BOSHException { HttpEntity entity = null; try { HttpResponse httpResp = client.execute(post, context); entity = httpResp.getEntity(); byte[] data = EntityUtils.toByteArray(entity); String encoding = entity.g...
java
private synchronized void awaitResponse() throws BOSHException { HttpEntity entity = null; try { HttpResponse httpResp = client.execute(post, context); entity = httpResp.getEntity(); byte[] data = EntityUtils.toByteArray(entity); String encoding = entity.g...
[ "private", "synchronized", "void", "awaitResponse", "(", ")", "throws", "BOSHException", "{", "HttpEntity", "entity", "=", "null", ";", "try", "{", "HttpResponse", "httpResp", "=", "client", ".", "execute", "(", "post", ",", "context", ")", ";", "entity", "=...
Await the response, storing the result in the instance variables of this class when they arrive. @throws InterruptedException if interrupted while awaiting the response @throws BOSHException on communication failure
[ "Await", "the", "response", "storing", "the", "result", "in", "the", "instance", "variables", "of", "this", "class", "when", "they", "arrive", "." ]
train
https://github.com/igniterealtime/jbosh/blob/b43378f27e19b753b552b1e9666abc0476cdceff/src/main/java/org/igniterealtime/jbosh/ApacheHTTPResponse.java#L232-L257
deeplearning4j/deeplearning4j
nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/flow/FlowPath.java
FlowPath.setRewindPositionOnce
public void setRewindPositionOnce(@NonNull String frameName, int position) { if (getRewindPosition(frameName) >= 0) return; frames.get(frameName).setRewindPosition(position); }
java
public void setRewindPositionOnce(@NonNull String frameName, int position) { if (getRewindPosition(frameName) >= 0) return; frames.get(frameName).setRewindPosition(position); }
[ "public", "void", "setRewindPositionOnce", "(", "@", "NonNull", "String", "frameName", ",", "int", "position", ")", "{", "if", "(", "getRewindPosition", "(", "frameName", ")", ">=", "0", ")", "return", ";", "frames", ".", "get", "(", "frameName", ")", ".",...
This method allows to set position for next rewind within graph. PLEASE NOTE: This methods check, if rewind position wasn't set yet. If it was already set for this frame - it'll be no-op method @param frameName @param position
[ "This", "method", "allows", "to", "set", "position", "for", "next", "rewind", "within", "graph", ".", "PLEASE", "NOTE", ":", "This", "methods", "check", "if", "rewind", "position", "wasn", "t", "set", "yet", ".", "If", "it", "was", "already", "set", "for...
train
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/flow/FlowPath.java#L208-L213
kotcrab/vis-ui
ui/src/main/java/com/kotcrab/vis/ui/FocusManager.java
FocusManager.resetFocus
public static void resetFocus (Stage stage, Actor caller) { if (focusedWidget != null) focusedWidget.focusLost(); if (stage != null && stage.getKeyboardFocus() == caller) stage.setKeyboardFocus(null); focusedWidget = null; }
java
public static void resetFocus (Stage stage, Actor caller) { if (focusedWidget != null) focusedWidget.focusLost(); if (stage != null && stage.getKeyboardFocus() == caller) stage.setKeyboardFocus(null); focusedWidget = null; }
[ "public", "static", "void", "resetFocus", "(", "Stage", "stage", ",", "Actor", "caller", ")", "{", "if", "(", "focusedWidget", "!=", "null", ")", "focusedWidget", ".", "focusLost", "(", ")", ";", "if", "(", "stage", "!=", "null", "&&", "stage", ".", "g...
Takes focus from current focused widget (if any), and sets current focused widget to null @param stage if passed stage is not null then stage keyboard focus will be set to null only if current focus owner is passed actor
[ "Takes", "focus", "from", "current", "focused", "widget", "(", "if", "any", ")", "and", "sets", "current", "focused", "widget", "to", "null" ]
train
https://github.com/kotcrab/vis-ui/blob/3b68f82d94ae32bffa2a3399c63f432e0f4908e0/ui/src/main/java/com/kotcrab/vis/ui/FocusManager.java#L61-L65
codelibs/minhash
src/main/java/org/codelibs/minhash/MinHash.java
MinHash.newData
public static Data newData(final Analyzer analyzer, final String text, final int numOfBits) { return new Data(analyzer, text, numOfBits); }
java
public static Data newData(final Analyzer analyzer, final String text, final int numOfBits) { return new Data(analyzer, text, numOfBits); }
[ "public", "static", "Data", "newData", "(", "final", "Analyzer", "analyzer", ",", "final", "String", "text", ",", "final", "int", "numOfBits", ")", "{", "return", "new", "Data", "(", "analyzer", ",", "text", ",", "numOfBits", ")", ";", "}" ]
Create a target data which has analyzer, text and the number of bits. @param analyzer @param text @param numOfBits @return
[ "Create", "a", "target", "data", "which", "has", "analyzer", "text", "and", "the", "number", "of", "bits", "." ]
train
https://github.com/codelibs/minhash/blob/2aaa16e3096461c0f550d0eb462ae9e69d1b7749/src/main/java/org/codelibs/minhash/MinHash.java#L273-L276
Azure/azure-sdk-for-java
appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/AppServiceCertificateOrdersInner.java
AppServiceCertificateOrdersInner.createOrUpdateAsync
public Observable<AppServiceCertificateOrderInner> createOrUpdateAsync(String resourceGroupName, String certificateOrderName, AppServiceCertificateOrderInner certificateDistinguishedName) { return createOrUpdateWithServiceResponseAsync(resourceGroupName, certificateOrderName, certificateDistinguishedName).map(n...
java
public Observable<AppServiceCertificateOrderInner> createOrUpdateAsync(String resourceGroupName, String certificateOrderName, AppServiceCertificateOrderInner certificateDistinguishedName) { return createOrUpdateWithServiceResponseAsync(resourceGroupName, certificateOrderName, certificateDistinguishedName).map(n...
[ "public", "Observable", "<", "AppServiceCertificateOrderInner", ">", "createOrUpdateAsync", "(", "String", "resourceGroupName", ",", "String", "certificateOrderName", ",", "AppServiceCertificateOrderInner", "certificateDistinguishedName", ")", "{", "return", "createOrUpdateWithSe...
Create or update a certificate purchase order. Create or update a certificate purchase order. @param resourceGroupName Name of the resource group to which the resource belongs. @param certificateOrderName Name of the certificate order. @param certificateDistinguishedName Distinguished name to to use for the certificat...
[ "Create", "or", "update", "a", "certificate", "purchase", "order", ".", "Create", "or", "update", "a", "certificate", "purchase", "order", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/AppServiceCertificateOrdersInner.java#L623-L630
ujmp/universal-java-matrix-package
ujmp-core/src/main/java/org/ujmp/core/util/EuclidianDistance.java
EuclidianDistance.getDistance
public double getDistance(double[] sample1, double[] sample2) throws IllegalArgumentException { int n = sample1.length; if (n != sample2.length || n < 1) throw new IllegalArgumentException("Input arrays must have the same length."); double sumOfSquares = 0; for (int i = 0; i < n; i++) { if (Double.isNaN...
java
public double getDistance(double[] sample1, double[] sample2) throws IllegalArgumentException { int n = sample1.length; if (n != sample2.length || n < 1) throw new IllegalArgumentException("Input arrays must have the same length."); double sumOfSquares = 0; for (int i = 0; i < n; i++) { if (Double.isNaN...
[ "public", "double", "getDistance", "(", "double", "[", "]", "sample1", ",", "double", "[", "]", "sample2", ")", "throws", "IllegalArgumentException", "{", "int", "n", "=", "sample1", ".", "length", ";", "if", "(", "n", "!=", "sample2", ".", "length", "||...
Get the distance between two data samples. @param sample1 the first sample of <code>double</code> values @param sample2 the second sample of <code>double</code> values @return the distance between <code>sample1</code> and <code>sample2</code> @throws IllegalArgumentException if the two samples contain different amount...
[ "Get", "the", "distance", "between", "two", "data", "samples", "." ]
train
https://github.com/ujmp/universal-java-matrix-package/blob/b7e1d293adeadaf35d208ffe8884028d6c06b63b/ujmp-core/src/main/java/org/ujmp/core/util/EuclidianDistance.java#L44-L59
grpc/grpc-java
api/src/main/java/io/grpc/ClientInterceptors.java
ClientInterceptors.wrapClientInterceptor
static <WReqT, WRespT> ClientInterceptor wrapClientInterceptor( final ClientInterceptor interceptor, final Marshaller<WReqT> reqMarshaller, final Marshaller<WRespT> respMarshaller) { return new ClientInterceptor() { @Override public <ReqT, RespT> ClientCall<ReqT, RespT> interceptCall( ...
java
static <WReqT, WRespT> ClientInterceptor wrapClientInterceptor( final ClientInterceptor interceptor, final Marshaller<WReqT> reqMarshaller, final Marshaller<WRespT> respMarshaller) { return new ClientInterceptor() { @Override public <ReqT, RespT> ClientCall<ReqT, RespT> interceptCall( ...
[ "static", "<", "WReqT", ",", "WRespT", ">", "ClientInterceptor", "wrapClientInterceptor", "(", "final", "ClientInterceptor", "interceptor", ",", "final", "Marshaller", "<", "WReqT", ">", "reqMarshaller", ",", "final", "Marshaller", "<", "WRespT", ">", "respMarshalle...
Creates a new ClientInterceptor that transforms requests into {@code WReqT} and responses into {@code WRespT} before passing them into the {@code interceptor}.
[ "Creates", "a", "new", "ClientInterceptor", "that", "transforms", "requests", "into", "{" ]
train
https://github.com/grpc/grpc-java/blob/973885457f9609de232d2553b82c67f6c3ff57bf/api/src/main/java/io/grpc/ClientInterceptors.java#L98-L142
EdwardRaff/JSAT
JSAT/src/jsat/io/CSV.java
CSV.readR
public static RegressionDataSet readR(int numeric_target_column, Reader reader, char delimiter, int lines_to_skip, char comment, Set<Integer> cat_cols) throws IOException { return (RegressionDataSet) readCSV(reader, lines_to_skip, delimiter, comment, cat_cols, numeric_target_column, -1); }
java
public static RegressionDataSet readR(int numeric_target_column, Reader reader, char delimiter, int lines_to_skip, char comment, Set<Integer> cat_cols) throws IOException { return (RegressionDataSet) readCSV(reader, lines_to_skip, delimiter, comment, cat_cols, numeric_target_column, -1); }
[ "public", "static", "RegressionDataSet", "readR", "(", "int", "numeric_target_column", ",", "Reader", "reader", ",", "char", "delimiter", ",", "int", "lines_to_skip", ",", "char", "comment", ",", "Set", "<", "Integer", ">", "cat_cols", ")", "throws", "IOExceptio...
Reads in a CSV dataset as a regression dataset. @param numeric_target_column the column index (starting from zero) of the feature that will be the target regression value @param reader the reader for the CSV content @param delimiter the delimiter to separate columns, usually a comma @param lines_to_skip the number of ...
[ "Reads", "in", "a", "CSV", "dataset", "as", "a", "regression", "dataset", "." ]
train
https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/io/CSV.java#L136-L139
javagl/ND
nd-tuples/src/main/java/de/javagl/nd/tuples/Utils.java
Utils.checkForValidIndex
public static void checkForValidIndex(int index, int size) { if (index < 0) { throw new IndexOutOfBoundsException( "Index "+index+" is negative"); } if (index >= size) { throw new IndexOutOfBoundsException( "In...
java
public static void checkForValidIndex(int index, int size) { if (index < 0) { throw new IndexOutOfBoundsException( "Index "+index+" is negative"); } if (index >= size) { throw new IndexOutOfBoundsException( "In...
[ "public", "static", "void", "checkForValidIndex", "(", "int", "index", ",", "int", "size", ")", "{", "if", "(", "index", "<", "0", ")", "{", "throw", "new", "IndexOutOfBoundsException", "(", "\"Index \"", "+", "index", "+", "\" is negative\"", ")", ";", "}...
Checks whether the given index is valid for accessing a tuple with the given size, and throws an <code>IndexOutOfBoundsException</code> if not. @param index The index @param size The size @throws IndexOutOfBoundsException If the given index is negative or not smaller than then given size
[ "Checks", "whether", "the", "given", "index", "is", "valid", "for", "accessing", "a", "tuple", "with", "the", "given", "size", "and", "throws", "an", "<code", ">", "IndexOutOfBoundsException<", "/", "code", ">", "if", "not", "." ]
train
https://github.com/javagl/ND/blob/bcb655aaf5fc88af6194f73a27cca079186ff559/nd-tuples/src/main/java/de/javagl/nd/tuples/Utils.java#L100-L112
UrielCh/ovh-java-sdk
ovh-java-sdk-xdsl/src/main/java/net/minidev/ovh/api/ApiOvhXdsl.java
ApiOvhXdsl.serviceName_modem_connectedDevices_macAddress_GET
public OvhConnectedDevice serviceName_modem_connectedDevices_macAddress_GET(String serviceName, String macAddress) throws IOException { String qPath = "/xdsl/{serviceName}/modem/connectedDevices/{macAddress}"; StringBuilder sb = path(qPath, serviceName, macAddress); String resp = exec(qPath, "GET", sb.toString(),...
java
public OvhConnectedDevice serviceName_modem_connectedDevices_macAddress_GET(String serviceName, String macAddress) throws IOException { String qPath = "/xdsl/{serviceName}/modem/connectedDevices/{macAddress}"; StringBuilder sb = path(qPath, serviceName, macAddress); String resp = exec(qPath, "GET", sb.toString(),...
[ "public", "OvhConnectedDevice", "serviceName_modem_connectedDevices_macAddress_GET", "(", "String", "serviceName", ",", "String", "macAddress", ")", "throws", "IOException", "{", "String", "qPath", "=", "\"/xdsl/{serviceName}/modem/connectedDevices/{macAddress}\"", ";", "StringBu...
Get this object properties REST: GET /xdsl/{serviceName}/modem/connectedDevices/{macAddress} @param serviceName [required] The internal name of your XDSL offer @param macAddress [required] MAC address of the device
[ "Get", "this", "object", "properties" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-xdsl/src/main/java/net/minidev/ovh/api/ApiOvhXdsl.java#L1371-L1376
oaqa/uima-ecd
src/main/java/edu/cmu/lti/oaqa/ecd/driver/SimplePipelineRev803.java
SimplePipelineRev803.runPipeline
public static void runPipeline(final CAS aCas, final AnalysisEngineDescription... aDescs) throws UIMAException, IOException { // Create aggregate AE final AnalysisEngineDescription aaeDesc = createAggregateDescription(aDescs); // Instantiate final AnalysisEngine aae = createAggregate(aaeDesc); ...
java
public static void runPipeline(final CAS aCas, final AnalysisEngineDescription... aDescs) throws UIMAException, IOException { // Create aggregate AE final AnalysisEngineDescription aaeDesc = createAggregateDescription(aDescs); // Instantiate final AnalysisEngine aae = createAggregate(aaeDesc); ...
[ "public", "static", "void", "runPipeline", "(", "final", "CAS", "aCas", ",", "final", "AnalysisEngineDescription", "...", "aDescs", ")", "throws", "UIMAException", ",", "IOException", "{", "// Create aggregate AE", "final", "AnalysisEngineDescription", "aaeDesc", "=", ...
Run a sequence of {@link AnalysisEngine analysis engines} over a {@link JCas}. The result of the analysis can be read from the JCas. @param aCas the CAS to process @param aDescs a sequence of analysis engines to run on the jCas @throws UIMAException @throws IOException
[ "Run", "a", "sequence", "of", "{", "@link", "AnalysisEngine", "analysis", "engines", "}", "over", "a", "{", "@link", "JCas", "}", ".", "The", "result", "of", "the", "analysis", "can", "be", "read", "from", "the", "JCas", "." ]
train
https://github.com/oaqa/uima-ecd/blob/09a0ae26647490b43affc36ab3a01100702b989f/src/main/java/edu/cmu/lti/oaqa/ecd/driver/SimplePipelineRev803.java#L177-L195
wcm-io/wcm-io-handler
richtext/src/main/java/io/wcm/handler/richtext/DefaultRewriteContentHandler.java
DefaultRewriteContentHandler.getAnchorLegacyMetadataFromSingleData
private boolean getAnchorLegacyMetadataFromSingleData(ValueMap resourceProps, Element element) { boolean foundAny = false; JSONObject metadata = null; Attribute dataAttribute = element.getAttribute("data"); if (dataAttribute != null) { String metadataString = dataAttribute.getValue(); if (S...
java
private boolean getAnchorLegacyMetadataFromSingleData(ValueMap resourceProps, Element element) { boolean foundAny = false; JSONObject metadata = null; Attribute dataAttribute = element.getAttribute("data"); if (dataAttribute != null) { String metadataString = dataAttribute.getValue(); if (S...
[ "private", "boolean", "getAnchorLegacyMetadataFromSingleData", "(", "ValueMap", "resourceProps", ",", "Element", "element", ")", "{", "boolean", "foundAny", "=", "false", ";", "JSONObject", "metadata", "=", "null", ";", "Attribute", "dataAttribute", "=", "element", ...
Support legacy data structures where link metadata is stored as JSON fragment in single HTML5 data attribute. @param resourceProps ValueMap to write link metadata to @param element Link element
[ "Support", "legacy", "data", "structures", "where", "link", "metadata", "is", "stored", "as", "JSON", "fragment", "in", "single", "HTML5", "data", "attribute", "." ]
train
https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/richtext/src/main/java/io/wcm/handler/richtext/DefaultRewriteContentHandler.java#L257-L283
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/rules/constraint/Constraints.java
Constraints.ifTrue
public PropertyConstraint ifTrue(PropertyConstraint ifConstraint, PropertyConstraint thenConstraint, String type) { return new ConditionalPropertyConstraint(ifConstraint, thenConstraint, type); }
java
public PropertyConstraint ifTrue(PropertyConstraint ifConstraint, PropertyConstraint thenConstraint, String type) { return new ConditionalPropertyConstraint(ifConstraint, thenConstraint, type); }
[ "public", "PropertyConstraint", "ifTrue", "(", "PropertyConstraint", "ifConstraint", ",", "PropertyConstraint", "thenConstraint", ",", "String", "type", ")", "{", "return", "new", "ConditionalPropertyConstraint", "(", "ifConstraint", ",", "thenConstraint", ",", "type", ...
Returns a ConditionalPropertyConstraint: one property will trigger the validation of another. @see ConditionalPropertyConstraint
[ "Returns", "a", "ConditionalPropertyConstraint", ":", "one", "property", "will", "trigger", "the", "validation", "of", "another", "." ]
train
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/rules/constraint/Constraints.java#L318-L320
playn/playn
scene/src/playn/scene/Layer.java
Layer.setOrigin
public Layer setOrigin (float x, float y) { this.originX = x; this.originY = y; this.origin = Origin.FIXED; setFlag(Flag.ODIRTY, false); return this; }
java
public Layer setOrigin (float x, float y) { this.originX = x; this.originY = y; this.origin = Origin.FIXED; setFlag(Flag.ODIRTY, false); return this; }
[ "public", "Layer", "setOrigin", "(", "float", "x", ",", "float", "y", ")", "{", "this", ".", "originX", "=", "x", ";", "this", ".", "originY", "=", "y", ";", "this", ".", "origin", "=", "Origin", ".", "FIXED", ";", "setFlag", "(", "Flag", ".", "O...
Sets the origin of the layer to a fixed position. This automatically sets the layer's logical origin to {@link Origin#FIXED}. @param x origin on x axis in display units. @param y origin on y axis in display units. @return a reference to this layer for call chaining.
[ "Sets", "the", "origin", "of", "the", "layer", "to", "a", "fixed", "position", ".", "This", "automatically", "sets", "the", "layer", "s", "logical", "origin", "to", "{", "@link", "Origin#FIXED", "}", "." ]
train
https://github.com/playn/playn/blob/7e7a9d048ba6afe550dc0cdeaca3e1d5b0d01c66/scene/src/playn/scene/Layer.java#L387-L393
SonarSource/sonarqube
sonar-duplications/src/main/java/org/sonar/duplications/detector/original/Filter.java
Filter.add
public void add(CloneGroup current) { Iterator<CloneGroup> i = filtered.iterator(); while (i.hasNext()) { CloneGroup earlier = i.next(); // Note that following two conditions cannot be true together - proof by contradiction: // let C be the current clone and A and B were found earlier //...
java
public void add(CloneGroup current) { Iterator<CloneGroup> i = filtered.iterator(); while (i.hasNext()) { CloneGroup earlier = i.next(); // Note that following two conditions cannot be true together - proof by contradiction: // let C be the current clone and A and B were found earlier //...
[ "public", "void", "add", "(", "CloneGroup", "current", ")", "{", "Iterator", "<", "CloneGroup", ">", "i", "=", "filtered", ".", "iterator", "(", ")", ";", "while", "(", "i", ".", "hasNext", "(", ")", ")", "{", "CloneGroup", "earlier", "=", "i", ".", ...
Running time - O(N*2*C), where N - number of clones, which was found earlier and C - time of {@link #containsIn(CloneGroup, CloneGroup)}.
[ "Running", "time", "-", "O", "(", "N", "*", "2", "*", "C", ")", "where", "N", "-", "number", "of", "clones", "which", "was", "found", "earlier", "and", "C", "-", "time", "of", "{" ]
train
https://github.com/SonarSource/sonarqube/blob/2fffa4c2f79ae3714844d7742796e82822b6a98a/sonar-duplications/src/main/java/org/sonar/duplications/detector/original/Filter.java#L61-L79
geomajas/geomajas-project-client-gwt2
impl/src/main/java/org/geomajas/gwt2/client/controller/TouchNavigationController.java
TouchNavigationController.calculatePosition
protected Coordinate calculatePosition(double scale, Coordinate rescalePoint) { ViewPort viewPort = mapPresenter.getViewPort(); Coordinate position = viewPort.getPosition(); double dX = (rescalePoint.getX() - position.getX()) * (1 - 1 / scale); double dY = (rescalePoint.getY() - position.getY()) * (1 - 1 / scal...
java
protected Coordinate calculatePosition(double scale, Coordinate rescalePoint) { ViewPort viewPort = mapPresenter.getViewPort(); Coordinate position = viewPort.getPosition(); double dX = (rescalePoint.getX() - position.getX()) * (1 - 1 / scale); double dY = (rescalePoint.getY() - position.getY()) * (1 - 1 / scal...
[ "protected", "Coordinate", "calculatePosition", "(", "double", "scale", ",", "Coordinate", "rescalePoint", ")", "{", "ViewPort", "viewPort", "=", "mapPresenter", ".", "getViewPort", "(", ")", ";", "Coordinate", "position", "=", "viewPort", ".", "getPosition", "(",...
Calculate the target position should there be a rescale point. The idea is that after zooming in or out, the mouse cursor would still lie at the same position in world space.
[ "Calculate", "the", "target", "position", "should", "there", "be", "a", "rescale", "point", ".", "The", "idea", "is", "that", "after", "zooming", "in", "or", "out", "the", "mouse", "cursor", "would", "still", "lie", "at", "the", "same", "position", "in", ...
train
https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/impl/src/main/java/org/geomajas/gwt2/client/controller/TouchNavigationController.java#L108-L114
aws/aws-sdk-java
aws-java-sdk-lambda/src/main/java/com/amazonaws/services/lambda/model/Environment.java
Environment.withVariables
public Environment withVariables(java.util.Map<String, String> variables) { setVariables(variables); return this; }
java
public Environment withVariables(java.util.Map<String, String> variables) { setVariables(variables); return this; }
[ "public", "Environment", "withVariables", "(", "java", ".", "util", ".", "Map", "<", "String", ",", "String", ">", "variables", ")", "{", "setVariables", "(", "variables", ")", ";", "return", "this", ";", "}" ]
<p> Environment variable key-value pairs. </p> @param variables Environment variable key-value pairs. @return Returns a reference to this object so that method calls can be chained together.
[ "<p", ">", "Environment", "variable", "key", "-", "value", "pairs", ".", "<", "/", "p", ">" ]
train
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-lambda/src/main/java/com/amazonaws/services/lambda/model/Environment.java#L76-L79
maxirosson/jdroid-android
jdroid-android-sqlite/src/main/java/com/jdroid/android/sqlite/repository/SQLiteRepository.java
SQLiteRepository.replaceChildren
public static <T extends Entity> void replaceChildren(List<T> list, String parentId, Class<T> clazz) { SQLiteRepository<T> repository = (SQLiteRepository<T>)AbstractApplication.get().getRepositoryInstance(clazz); repository.replaceChildren(list, parentId); }
java
public static <T extends Entity> void replaceChildren(List<T> list, String parentId, Class<T> clazz) { SQLiteRepository<T> repository = (SQLiteRepository<T>)AbstractApplication.get().getRepositoryInstance(clazz); repository.replaceChildren(list, parentId); }
[ "public", "static", "<", "T", "extends", "Entity", ">", "void", "replaceChildren", "(", "List", "<", "T", ">", "list", ",", "String", "parentId", ",", "Class", "<", "T", ">", "clazz", ")", "{", "SQLiteRepository", "<", "T", ">", "repository", "=", "(",...
This method allows to replace all entity children of a given parent, it will remove any children which are not in the list, add the new ones and update which are in the list.. @param list of children to replace. @param parentId id of parent entity. @param clazz entity class.
[ "This", "method", "allows", "to", "replace", "all", "entity", "children", "of", "a", "given", "parent", "it", "will", "remove", "any", "children", "which", "are", "not", "in", "the", "list", "add", "the", "new", "ones", "and", "update", "which", "are", "...
train
https://github.com/maxirosson/jdroid-android/blob/1ba9cae56a16fa36bdb2c9c04379853f0300707f/jdroid-android-sqlite/src/main/java/com/jdroid/android/sqlite/repository/SQLiteRepository.java#L443-L446
threerings/nenya
tools/src/main/java/com/threerings/media/tile/tools/xml/XMLTileSetParser.java
XMLTileSetParser.loadTileSets
public void loadTileSets (InputStream source, Map<String, TileSet> tilesets) throws IOException { // stick an array list on the top of the stack for collecting // parsed tilesets List<TileSet> setlist = Lists.newArrayList(); _digester.push(setlist); // now fire up th...
java
public void loadTileSets (InputStream source, Map<String, TileSet> tilesets) throws IOException { // stick an array list on the top of the stack for collecting // parsed tilesets List<TileSet> setlist = Lists.newArrayList(); _digester.push(setlist); // now fire up th...
[ "public", "void", "loadTileSets", "(", "InputStream", "source", ",", "Map", "<", "String", ",", "TileSet", ">", "tilesets", ")", "throws", "IOException", "{", "// stick an array list on the top of the stack for collecting", "// parsed tilesets", "List", "<", "TileSet", ...
Loads all of the tilesets specified in the supplied XML tileset description file and places them into the supplied map indexed by tileset name. This method is not reentrant, so don't go calling it from multiple threads. @param source an input stream from which the tileset definition file can be read. @param tilesets t...
[ "Loads", "all", "of", "the", "tilesets", "specified", "in", "the", "supplied", "XML", "tileset", "description", "file", "and", "places", "them", "into", "the", "supplied", "map", "indexed", "by", "tileset", "name", ".", "This", "method", "is", "not", "reentr...
train
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/tools/src/main/java/com/threerings/media/tile/tools/xml/XMLTileSetParser.java#L141-L169
JodaOrg/joda-time
src/main/java/org/joda/time/tz/ZoneInfoProvider.java
ZoneInfoProvider.openResource
@SuppressWarnings("resource") private InputStream openResource(String name) throws IOException { InputStream in; if (iFileDir != null) { in = new FileInputStream(new File(iFileDir, name)); } else { final String path = iResourcePath.concat(name); in = Acces...
java
@SuppressWarnings("resource") private InputStream openResource(String name) throws IOException { InputStream in; if (iFileDir != null) { in = new FileInputStream(new File(iFileDir, name)); } else { final String path = iResourcePath.concat(name); in = Acces...
[ "@", "SuppressWarnings", "(", "\"resource\"", ")", "private", "InputStream", "openResource", "(", "String", "name", ")", "throws", "IOException", "{", "InputStream", "in", ";", "if", "(", "iFileDir", "!=", "null", ")", "{", "in", "=", "new", "FileInputStream",...
Opens a resource from file or classpath. @param name the name to open @return the input stream @throws IOException if an error occurs
[ "Opens", "a", "resource", "from", "file", "or", "classpath", "." ]
train
https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/tz/ZoneInfoProvider.java#L203-L229
sporniket/core
sporniket-core-lang/src/main/java/com/sporniket/libre/lang/functor/FunctorFactory.java
FunctorFactory.instanciateFunctorWithParameterAsAnInstanceMethodWrapper
public static FunctorWithParameter instanciateFunctorWithParameterAsAnInstanceMethodWrapper(final Object instance, String methodName) throws Exception { if (null == instance) { throw new NullPointerException("Instance is null"); } Method _method = instance.getClass().getMethod(methodName, (Class<?...
java
public static FunctorWithParameter instanciateFunctorWithParameterAsAnInstanceMethodWrapper(final Object instance, String methodName) throws Exception { if (null == instance) { throw new NullPointerException("Instance is null"); } Method _method = instance.getClass().getMethod(methodName, (Class<?...
[ "public", "static", "FunctorWithParameter", "instanciateFunctorWithParameterAsAnInstanceMethodWrapper", "(", "final", "Object", "instance", ",", "String", "methodName", ")", "throws", "Exception", "{", "if", "(", "null", "==", "instance", ")", "{", "throw", "new", "Nu...
Create a functor with parameter, wrapping a call to another method. @param instance instance to call the method upon. Should not be null. @param methodName Name of the method, it must exist. @return a Functor with parameter that call the specified method on the specified instance. @throws Exception if there is a probl...
[ "Create", "a", "functor", "with", "parameter", "wrapping", "a", "call", "to", "another", "method", "." ]
train
https://github.com/sporniket/core/blob/3480ebd72a07422fcc09971be2607ee25efb2c26/sporniket-core-lang/src/main/java/com/sporniket/libre/lang/functor/FunctorFactory.java#L175-L184
carewebframework/carewebframework-vista
org.carewebframework.vista.mbroker/src/main/java/org/carewebframework/vista/mbroker/RPCParameter.java
RPCParameter.put
public void put(Object[] subscript, Object value) { put(BrokerUtil.buildSubscript(subscript), value); }
java
public void put(Object[] subscript, Object value) { put(BrokerUtil.buildSubscript(subscript), value); }
[ "public", "void", "put", "(", "Object", "[", "]", "subscript", ",", "Object", "value", ")", "{", "put", "(", "BrokerUtil", ".", "buildSubscript", "(", "subscript", ")", ",", "value", ")", ";", "}" ]
Adds a vector value at the specified subscript. @param subscript Array of subscript values. @param value Value.
[ "Adds", "a", "vector", "value", "at", "the", "specified", "subscript", "." ]
train
https://github.com/carewebframework/carewebframework-vista/blob/883b2cbe395d9e8a21cd19db820f0876bda6b1c6/org.carewebframework.vista.mbroker/src/main/java/org/carewebframework/vista/mbroker/RPCParameter.java#L186-L188
reapzor/FiloFirmata
src/main/java/com/bortbort/arduino/FiloFirmata/Firmata.java
Firmata.sendMessageSynchronous
public <T extends Message> T sendMessageSynchronous(Class<T> responseType, TransmittableMessage message) { T responseMessage = null; SynchronousMessageListener<T> messageListener = new SynchronousMessageListener<>(responseType); addMessageListener(messageListener); if (sendMessage(mess...
java
public <T extends Message> T sendMessageSynchronous(Class<T> responseType, TransmittableMessage message) { T responseMessage = null; SynchronousMessageListener<T> messageListener = new SynchronousMessageListener<>(responseType); addMessageListener(messageListener); if (sendMessage(mess...
[ "public", "<", "T", "extends", "Message", ">", "T", "sendMessageSynchronous", "(", "Class", "<", "T", ">", "responseType", ",", "TransmittableMessage", "message", ")", "{", "T", "responseMessage", "=", "null", ";", "SynchronousMessageListener", "<", "T", ">", ...
Send a Message over the serial port and block/wait for the message response. In cases where you do not need ASync behavior, or just want to send a single message and handle a single response, where the async design may be a bit too verbose, use this instead. By sending a message and dictacting the type of response, you...
[ "Send", "a", "Message", "over", "the", "serial", "port", "and", "block", "/", "wait", "for", "the", "message", "response", ".", "In", "cases", "where", "you", "do", "not", "need", "ASync", "behavior", "or", "just", "want", "to", "send", "a", "single", ...
train
https://github.com/reapzor/FiloFirmata/blob/39c26c1a577b8fff8690245e105cb62e02284f16/src/main/java/com/bortbort/arduino/FiloFirmata/Firmata.java#L346-L361
paymill/paymill-java
src/main/java/com/paymill/services/TransactionService.java
TransactionService.createWithToken
public Transaction createWithToken( String token, Integer amount, String currency, String description ) { return this.createWithTokenAndFee( token, amount, currency, description, null ); }
java
public Transaction createWithToken( String token, Integer amount, String currency, String description ) { return this.createWithTokenAndFee( token, amount, currency, description, null ); }
[ "public", "Transaction", "createWithToken", "(", "String", "token", ",", "Integer", "amount", ",", "String", "currency", ",", "String", "description", ")", "{", "return", "this", ".", "createWithTokenAndFee", "(", "token", ",", "amount", ",", "currency", ",", ...
Executes a {@link Transaction} with token for the given amount in the given currency. @param token Token generated by PAYMILL Bridge, which represents a credit card or direct debit. @param amount Amount (in cents) which will be charged. @param currency ISO 4217 formatted currency code. @param description A short descri...
[ "Executes", "a", "{" ]
train
https://github.com/paymill/paymill-java/blob/17281a0d4376c76f1711af9f09bfc138c90ba65a/src/main/java/com/paymill/services/TransactionService.java#L127-L129
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/compiler/Compiler.java
Compiler.compileExtension
private Expression compileExtension(int opPos) throws TransformerException { int endExtFunc = opPos + getOp(opPos + 1) - 1; opPos = getFirstChildPos(opPos); java.lang.String ns = (java.lang.String) getTokenQueue().elementAt(getOp(opPos)); opPos++; java.lang.String funcName = (...
java
private Expression compileExtension(int opPos) throws TransformerException { int endExtFunc = opPos + getOp(opPos + 1) - 1; opPos = getFirstChildPos(opPos); java.lang.String ns = (java.lang.String) getTokenQueue().elementAt(getOp(opPos)); opPos++; java.lang.String funcName = (...
[ "private", "Expression", "compileExtension", "(", "int", "opPos", ")", "throws", "TransformerException", "{", "int", "endExtFunc", "=", "opPos", "+", "getOp", "(", "opPos", "+", "1", ")", "-", "1", ";", "opPos", "=", "getFirstChildPos", "(", "opPos", ")", ...
Compile an extension function. @param opPos The current position in the m_opMap array. @return reference to {@link org.apache.xpath.functions.FuncExtFunction} instance. @throws TransformerException if a error occurs creating the Expression.
[ "Compile", "an", "extension", "function", "." ]
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/compiler/Compiler.java#L1100-L1144
threerings/nenya
core/src/main/java/com/threerings/media/sprite/SpriteManager.java
SpriteManager.getHighestHitSprite
public Sprite getHighestHitSprite (int x, int y) { // since they're stored in lowest -> highest order.. for (int ii = _sprites.size() - 1; ii >= 0; ii--) { Sprite sprite = _sprites.get(ii); if (sprite.hitTest(x, y)) { return sprite; } } ...
java
public Sprite getHighestHitSprite (int x, int y) { // since they're stored in lowest -> highest order.. for (int ii = _sprites.size() - 1; ii >= 0; ii--) { Sprite sprite = _sprites.get(ii); if (sprite.hitTest(x, y)) { return sprite; } } ...
[ "public", "Sprite", "getHighestHitSprite", "(", "int", "x", ",", "int", "y", ")", "{", "// since they're stored in lowest -> highest order..", "for", "(", "int", "ii", "=", "_sprites", ".", "size", "(", ")", "-", "1", ";", "ii", ">=", "0", ";", "ii", "--",...
Finds the sprite with the highest render order that hits the specified pixel. @param x the x (screen) coordinate to be checked @param y the y (screen) coordinate to be checked @return the highest sprite hit
[ "Finds", "the", "sprite", "with", "the", "highest", "render", "order", "that", "hits", "the", "specified", "pixel", "." ]
train
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/sprite/SpriteManager.java#L89-L99
kaazing/gateway
management/src/main/java/org/kaazing/gateway/management/gateway/GatewayManagementBeanImpl.java
GatewayManagementBeanImpl.doExceptionCaughtListeners
@Override public void doExceptionCaughtListeners(final long sessionId, final Throwable cause) { runManagementTask(new Runnable() { @Override public void run() { try { // The particular management listeners change on strategy, so get them here. ...
java
@Override public void doExceptionCaughtListeners(final long sessionId, final Throwable cause) { runManagementTask(new Runnable() { @Override public void run() { try { // The particular management listeners change on strategy, so get them here. ...
[ "@", "Override", "public", "void", "doExceptionCaughtListeners", "(", "final", "long", "sessionId", ",", "final", "Throwable", "cause", ")", "{", "runManagementTask", "(", "new", "Runnable", "(", ")", "{", "@", "Override", "public", "void", "run", "(", ")", ...
Notify the management listeners on a filterWrite. <p/> NOTE: this starts on the IO thread, but runs a task OFF the thread.
[ "Notify", "the", "management", "listeners", "on", "a", "filterWrite", ".", "<p", "/", ">", "NOTE", ":", "this", "starts", "on", "the", "IO", "thread", "but", "runs", "a", "task", "OFF", "the", "thread", "." ]
train
https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/management/src/main/java/org/kaazing/gateway/management/gateway/GatewayManagementBeanImpl.java#L560-L577
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WTreeRenderer.java
WTreeRenderer.doRender
@Override public void doRender(final WComponent component, final WebXmlRenderContext renderContext) { WTree tree = (WTree) component; XmlStringBuilder xml = renderContext.getWriter(); // Check if rendering an open item request String openId = tree.getOpenRequestItemId(); if (openId != null) { handleOpen...
java
@Override public void doRender(final WComponent component, final WebXmlRenderContext renderContext) { WTree tree = (WTree) component; XmlStringBuilder xml = renderContext.getWriter(); // Check if rendering an open item request String openId = tree.getOpenRequestItemId(); if (openId != null) { handleOpen...
[ "@", "Override", "public", "void", "doRender", "(", "final", "WComponent", "component", ",", "final", "WebXmlRenderContext", "renderContext", ")", "{", "WTree", "tree", "=", "(", "WTree", ")", "component", ";", "XmlStringBuilder", "xml", "=", "renderContext", "....
Paints the given WTree. @param component the WTree to paint. @param renderContext the RenderContext to paint to.
[ "Paints", "the", "given", "WTree", "." ]
train
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WTreeRenderer.java#L36-L95
HtmlUnit/htmlunit-cssparser
src/main/java/com/gargoylesoftware/css/parser/CSSOMParser.java
CSSOMParser.parseStyleDeclaration
public void parseStyleDeclaration(final CSSStyleDeclarationImpl sd, final String styleDecl) throws IOException { try (InputSource source = new InputSource(new StringReader(styleDecl))) { final Stack<Object> nodeStack = new Stack<>(); nodeStack.push(sd); final CSSOMHandler han...
java
public void parseStyleDeclaration(final CSSStyleDeclarationImpl sd, final String styleDecl) throws IOException { try (InputSource source = new InputSource(new StringReader(styleDecl))) { final Stack<Object> nodeStack = new Stack<>(); nodeStack.push(sd); final CSSOMHandler han...
[ "public", "void", "parseStyleDeclaration", "(", "final", "CSSStyleDeclarationImpl", "sd", ",", "final", "String", "styleDecl", ")", "throws", "IOException", "{", "try", "(", "InputSource", "source", "=", "new", "InputSource", "(", "new", "StringReader", "(", "styl...
Parses a input string into a CSSOM style declaration. @param styleDecl the input string @param sd the CSSOM style declaration @throws IOException if the underlying SAC parser throws an IOException
[ "Parses", "a", "input", "string", "into", "a", "CSSOM", "style", "declaration", "." ]
train
https://github.com/HtmlUnit/htmlunit-cssparser/blob/384e4170737169b5b4c87c5766495d9b8a6d3866/src/main/java/com/gargoylesoftware/css/parser/CSSOMParser.java#L111-L119
h2oai/h2o-3
h2o-parsers/h2o-orc-parser/src/main/java/water/parser/orc/OrcParser.java
OrcParser.check_Min_Value
private void check_Min_Value(long l, int cIdx, int rowNumber, ParseWriter dout) { if (l <= Long.MIN_VALUE) { String warning = "Orc Parser: Long.MIN_VALUE: " + l + " is found in column "+cIdx+" row "+rowNumber + " of stripe "+_cidx +". This value is used for sentinel and will not be parsed correctly...
java
private void check_Min_Value(long l, int cIdx, int rowNumber, ParseWriter dout) { if (l <= Long.MIN_VALUE) { String warning = "Orc Parser: Long.MIN_VALUE: " + l + " is found in column "+cIdx+" row "+rowNumber + " of stripe "+_cidx +". This value is used for sentinel and will not be parsed correctly...
[ "private", "void", "check_Min_Value", "(", "long", "l", ",", "int", "cIdx", ",", "int", "rowNumber", ",", "ParseWriter", "dout", ")", "{", "if", "(", "l", "<=", "Long", ".", "MIN_VALUE", ")", "{", "String", "warning", "=", "\"Orc Parser: Long.MIN_VALUE: \"",...
This method is written to check and make sure any value written to a column of type long is more than Long.MIN_VALUE. If this is not true, a warning will be passed to the user. @param l @param cIdx @param rowNumber @param dout
[ "This", "method", "is", "written", "to", "check", "and", "make", "sure", "any", "value", "written", "to", "a", "column", "of", "type", "long", "is", "more", "than", "Long", ".", "MIN_VALUE", ".", "If", "this", "is", "not", "true", "a", "warning", "will...
train
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-parsers/h2o-orc-parser/src/main/java/water/parser/orc/OrcParser.java#L467-L473
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/query/NodeSequence.java
NodeSequence.withNodeKeys
public static NodeSequence withNodeKeys( final Iterator<NodeKey> keys, final long keyCount, final float score, final String workspaceName, f...
java
public static NodeSequence withNodeKeys( final Iterator<NodeKey> keys, final long keyCount, final float score, final String workspaceName, f...
[ "public", "static", "NodeSequence", "withNodeKeys", "(", "final", "Iterator", "<", "NodeKey", ">", "keys", ",", "final", "long", "keyCount", ",", "final", "float", "score", ",", "final", "String", "workspaceName", ",", "final", "RepositoryCache", "repository", "...
Create a sequence of nodes that iterates over the supplied node keys. Note that the supplied iterator is accessed lazily as the resulting sequence's {@link #nextBatch() first batch} is {@link Batch#nextRow() used}. @param keys the iterator over the keys of the node keys to be returned; if null, an {@link #emptySequenc...
[ "Create", "a", "sequence", "of", "nodes", "that", "iterates", "over", "the", "supplied", "node", "keys", ".", "Note", "that", "the", "supplied", "iterator", "is", "accessed", "lazily", "as", "the", "resulting", "sequence", "s", "{", "@link", "#nextBatch", "(...
train
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/query/NodeSequence.java#L578-L586
aoindustries/aocode-public
src/main/java/com/aoindustries/util/StringUtility.java
StringUtility.compareToDDMMYYYY
public static int compareToDDMMYYYY(String date1, String date2) { if(date1.length()!=8 || date2.length()!=8) return 0; return compareToDDMMYYYY0(date1)-compareToDDMMYYYY0(date2); }
java
public static int compareToDDMMYYYY(String date1, String date2) { if(date1.length()!=8 || date2.length()!=8) return 0; return compareToDDMMYYYY0(date1)-compareToDDMMYYYY0(date2); }
[ "public", "static", "int", "compareToDDMMYYYY", "(", "String", "date1", ",", "String", "date2", ")", "{", "if", "(", "date1", ".", "length", "(", ")", "!=", "8", "||", "date2", ".", "length", "(", ")", "!=", "8", ")", "return", "0", ";", "return", ...
Compare one date to another, must be in the DDMMYYYY format. @return <0 if the first date is before the second<br> 0 if the dates are the same or the format is invalid<br> >0 if the first date is after the second
[ "Compare", "one", "date", "to", "another", "must", "be", "in", "the", "DDMMYYYY", "format", "." ]
train
https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/util/StringUtility.java#L230-L233
citrusframework/citrus
modules/citrus-cucumber/src/main/java/cucumber/runtime/java/CitrusBackend.java
CitrusBackend.getObjectFactory
private ObjectFactory getObjectFactory() throws IllegalAccessException { if (Env.INSTANCE.get(ObjectFactory.class.getName()).equals(CitrusObjectFactory.class.getName())) { return CitrusObjectFactory.instance(); } else if (Env.INSTANCE.get(ObjectFactory.class.getName()).equals(CitrusSpringObj...
java
private ObjectFactory getObjectFactory() throws IllegalAccessException { if (Env.INSTANCE.get(ObjectFactory.class.getName()).equals(CitrusObjectFactory.class.getName())) { return CitrusObjectFactory.instance(); } else if (Env.INSTANCE.get(ObjectFactory.class.getName()).equals(CitrusSpringObj...
[ "private", "ObjectFactory", "getObjectFactory", "(", ")", "throws", "IllegalAccessException", "{", "if", "(", "Env", ".", "INSTANCE", ".", "get", "(", "ObjectFactory", ".", "class", ".", "getName", "(", ")", ")", ".", "equals", "(", "CitrusObjectFactory", ".",...
Gets the object factory instance that is configured in environment. @return
[ "Gets", "the", "object", "factory", "instance", "that", "is", "configured", "in", "environment", "." ]
train
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-cucumber/src/main/java/cucumber/runtime/java/CitrusBackend.java#L111-L120
Metatavu/edelphi
edelphi/src/main/java/fi/metatavu/edelphi/utils/QueryDataUtils.java
QueryDataUtils.writeCsv
private static byte[] writeCsv(String[] columnHeaders, String[][] rows) throws IOException { try (ByteArrayOutputStream csvStream = new ByteArrayOutputStream(); OutputStreamWriter streamWriter = new OutputStreamWriter(csvStream, Charset.forName("UTF-8"))) { CSVWriter csvWriter = new CSVWriter(streamWriter, ',...
java
private static byte[] writeCsv(String[] columnHeaders, String[][] rows) throws IOException { try (ByteArrayOutputStream csvStream = new ByteArrayOutputStream(); OutputStreamWriter streamWriter = new OutputStreamWriter(csvStream, Charset.forName("UTF-8"))) { CSVWriter csvWriter = new CSVWriter(streamWriter, ',...
[ "private", "static", "byte", "[", "]", "writeCsv", "(", "String", "[", "]", "columnHeaders", ",", "String", "[", "]", "[", "]", "rows", ")", "throws", "IOException", "{", "try", "(", "ByteArrayOutputStream", "csvStream", "=", "new", "ByteArrayOutputStream", ...
Writes a CSV file @param columnHeaders headers @param rows rows @return CSV file @throws IOException throws IOException when CSV writing fails
[ "Writes", "a", "CSV", "file" ]
train
https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/edelphi/src/main/java/fi/metatavu/edelphi/utils/QueryDataUtils.java#L256-L270
igniterealtime/Smack
smack-extensions/src/main/java/org/jivesoftware/smackx/commands/AdHocCommandManager.java
AdHocCommandManager.respondError
private static IQ respondError(AdHocCommandData response, StanzaError.Condition condition, AdHocCommand.SpecificErrorCondition specificCondition) { StanzaError.Builder error = StanzaError.getBuilder(condition).addExtension(new AdHocCommandData.SpecificError(specificCondition)); return respon...
java
private static IQ respondError(AdHocCommandData response, StanzaError.Condition condition, AdHocCommand.SpecificErrorCondition specificCondition) { StanzaError.Builder error = StanzaError.getBuilder(condition).addExtension(new AdHocCommandData.SpecificError(specificCondition)); return respon...
[ "private", "static", "IQ", "respondError", "(", "AdHocCommandData", "response", ",", "StanzaError", ".", "Condition", "condition", ",", "AdHocCommand", ".", "SpecificErrorCondition", "specificCondition", ")", "{", "StanzaError", ".", "Builder", "error", "=", "StanzaEr...
Responds an error with an specific condition. @param response the response to send. @param condition the condition of the error. @param specificCondition the adhoc command error condition. @throws NotConnectedException
[ "Responds", "an", "error", "with", "an", "specific", "condition", "." ]
train
https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-extensions/src/main/java/org/jivesoftware/smackx/commands/AdHocCommandManager.java#L581-L585
google/closure-compiler
src/com/google/javascript/jscomp/Es6RewriteBlockScopedDeclaration.java
Es6RewriteBlockScopedDeclaration.createCommaNode
private Node createCommaNode(Node expr1, Node expr2) { Node commaNode = IR.comma(expr1, expr2); if (shouldAddTypesOnNewAstNodes) { commaNode.setJSType(expr2.getJSType()); } return commaNode; }
java
private Node createCommaNode(Node expr1, Node expr2) { Node commaNode = IR.comma(expr1, expr2); if (shouldAddTypesOnNewAstNodes) { commaNode.setJSType(expr2.getJSType()); } return commaNode; }
[ "private", "Node", "createCommaNode", "(", "Node", "expr1", ",", "Node", "expr2", ")", "{", "Node", "commaNode", "=", "IR", ".", "comma", "(", "expr1", ",", "expr2", ")", ";", "if", "(", "shouldAddTypesOnNewAstNodes", ")", "{", "commaNode", ".", "setJSType...
Creates a COMMA node with type information matching its second argument.
[ "Creates", "a", "COMMA", "node", "with", "type", "information", "matching", "its", "second", "argument", "." ]
train
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/Es6RewriteBlockScopedDeclaration.java#L718-L724
spring-projects/spring-hateoas
src/main/java/org/springframework/hateoas/client/Rels.java
Rels.getRelFor
public static Rel getRelFor(String rel, LinkDiscoverers discoverers) { Assert.hasText(rel, "Relation name must not be null!"); Assert.notNull(discoverers, "LinkDiscoverers must not be null!"); if (rel.startsWith("$")) { return new JsonPathRel(rel); } return new LinkDiscovererRel(rel, discoverers); }
java
public static Rel getRelFor(String rel, LinkDiscoverers discoverers) { Assert.hasText(rel, "Relation name must not be null!"); Assert.notNull(discoverers, "LinkDiscoverers must not be null!"); if (rel.startsWith("$")) { return new JsonPathRel(rel); } return new LinkDiscovererRel(rel, discoverers); }
[ "public", "static", "Rel", "getRelFor", "(", "String", "rel", ",", "LinkDiscoverers", "discoverers", ")", "{", "Assert", ".", "hasText", "(", "rel", ",", "\"Relation name must not be null!\"", ")", ";", "Assert", ".", "notNull", "(", "discoverers", ",", "\"LinkD...
Creates a new {@link Rel} for the given relation name and {@link LinkDiscoverers}. @param rel must not be {@literal null} or empty. @param discoverers must not be {@literal null}. @return
[ "Creates", "a", "new", "{", "@link", "Rel", "}", "for", "the", "given", "relation", "name", "and", "{", "@link", "LinkDiscoverers", "}", "." ]
train
https://github.com/spring-projects/spring-hateoas/blob/70ebff9309f086cd8d6a97daf67e0dc215c87d9c/src/main/java/org/springframework/hateoas/client/Rels.java#L43-L53
icon-Systemhaus-GmbH/javassist-maven-plugin
src/main/java/de/icongmbh/oss/maven/plugin/javassist/ClassnameExtractor.java
ClassnameExtractor.extractClassNameFromFile
public static String extractClassNameFromFile(final File parentDirectory, final File classFile) throws IOException { if (null == classFile) { return null; } final String qualifiedFileName = parentDirectory != null ? classFile.getCanonicalPath...
java
public static String extractClassNameFromFile(final File parentDirectory, final File classFile) throws IOException { if (null == classFile) { return null; } final String qualifiedFileName = parentDirectory != null ? classFile.getCanonicalPath...
[ "public", "static", "String", "extractClassNameFromFile", "(", "final", "File", "parentDirectory", ",", "final", "File", "classFile", ")", "throws", "IOException", "{", "if", "(", "null", "==", "classFile", ")", "{", "return", "null", ";", "}", "final", "Strin...
Remove parent directory from file name and replace directory separator with dots. <ul> <li>parentDirectory: {@code /tmp/my/parent/src/}</li> <li>classFile: {@code /tmp/my/parent/src/foo/bar/MyApp.class}</li> </ul> returns: {@code foo.bar.MyApp} @param parentDirectory to remove from {@code classFile} and maybe {@code ...
[ "Remove", "parent", "directory", "from", "file", "name", "and", "replace", "directory", "separator", "with", "dots", "." ]
train
https://github.com/icon-Systemhaus-GmbH/javassist-maven-plugin/blob/798368f79a0bd641648bebd8546388daf013a50e/src/main/java/de/icongmbh/oss/maven/plugin/javassist/ClassnameExtractor.java#L54-L64
gildur/jshint4j
src/main/java/pl/gildur/jshint4j/JsHint.java
JsHint.lint
public List<Error> lint(String source, String options) { if (source == null) { throw new NullPointerException("Source must not be null."); } Context cx = Context.enter(); try { Scriptable scope = cx.initStandardObjects(); evaluateJSHint(cx, sc...
java
public List<Error> lint(String source, String options) { if (source == null) { throw new NullPointerException("Source must not be null."); } Context cx = Context.enter(); try { Scriptable scope = cx.initStandardObjects(); evaluateJSHint(cx, sc...
[ "public", "List", "<", "Error", ">", "lint", "(", "String", "source", ",", "String", "options", ")", "{", "if", "(", "source", "==", "null", ")", "{", "throw", "new", "NullPointerException", "(", "\"Source must not be null.\"", ")", ";", "}", "Context", "c...
Runs JSHint on given JavaScript source code. @param source JavaScript source code @param options JSHint options @return JSHint errors
[ "Runs", "JSHint", "on", "given", "JavaScript", "source", "code", "." ]
train
https://github.com/gildur/jshint4j/blob/b6f9e2fb00e248a4194f38a2df07eb34d55177f7/src/main/java/pl/gildur/jshint4j/JsHint.java#L26-L39
BranchMetrics/android-branch-deep-linking
Branch-SDK/src/io/branch/referral/Branch.java
Branch.initSession
public boolean initSession(boolean isReferrable, @NonNull Activity activity) { return initSession((BranchReferralInitListener) null, isReferrable, activity); }
java
public boolean initSession(boolean isReferrable, @NonNull Activity activity) { return initSession((BranchReferralInitListener) null, isReferrable, activity); }
[ "public", "boolean", "initSession", "(", "boolean", "isReferrable", ",", "@", "NonNull", "Activity", "activity", ")", "{", "return", "initSession", "(", "(", "BranchReferralInitListener", ")", "null", ",", "isReferrable", ",", "activity", ")", ";", "}" ]
<p>Initialises a session with the Branch API, specifying whether the initialisation can count as a referrable action, and supplying the calling {@link Activity} for context.</p> @param isReferrable A {@link Boolean} value indicating whether this initialisation session should be considered as potentially referrable or ...
[ "<p", ">", "Initialises", "a", "session", "with", "the", "Branch", "API", "specifying", "whether", "the", "initialisation", "can", "count", "as", "a", "referrable", "action", "and", "supplying", "the", "calling", "{", "@link", "Activity", "}", "for", "context"...
train
https://github.com/BranchMetrics/android-branch-deep-linking/blob/e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848/Branch-SDK/src/io/branch/referral/Branch.java#L1186-L1188
zeroturnaround/zt-zip
src/main/java/org/zeroturnaround/zip/Zips.java
Zips.iterate
public void iterate(ZipEntryCallback zipEntryCallback) { ZipEntryOrInfoAdapter zipEntryAdapter = new ZipEntryOrInfoAdapter(zipEntryCallback, null); processAllEntries(zipEntryAdapter); }
java
public void iterate(ZipEntryCallback zipEntryCallback) { ZipEntryOrInfoAdapter zipEntryAdapter = new ZipEntryOrInfoAdapter(zipEntryCallback, null); processAllEntries(zipEntryAdapter); }
[ "public", "void", "iterate", "(", "ZipEntryCallback", "zipEntryCallback", ")", "{", "ZipEntryOrInfoAdapter", "zipEntryAdapter", "=", "new", "ZipEntryOrInfoAdapter", "(", "zipEntryCallback", ",", "null", ")", ";", "processAllEntries", "(", "zipEntryAdapter", ")", ";", ...
Reads the source ZIP file and executes the given callback for each entry. <p> For each entry the corresponding input stream is also passed to the callback. If you want to stop the loop then throw a ZipBreakException. This method is charset aware and uses Zips.charset. @param zipEntryCallback callback to be called for...
[ "Reads", "the", "source", "ZIP", "file", "and", "executes", "the", "given", "callback", "for", "each", "entry", ".", "<p", ">", "For", "each", "entry", "the", "corresponding", "input", "stream", "is", "also", "passed", "to", "the", "callback", ".", "If", ...
train
https://github.com/zeroturnaround/zt-zip/blob/abb4dc43583e4d19339c0c021035019798970a13/src/main/java/org/zeroturnaround/zip/Zips.java#L435-L438
dbracewell/mango
src/main/java/com/davidbracewell/json/JsonReader.java
JsonReader.nextCollection
public <T extends Collection<Val>> T nextCollection(@NonNull Supplier<T> supplier) throws IOException { return nextCollection(supplier, StringUtils.EMPTY); }
java
public <T extends Collection<Val>> T nextCollection(@NonNull Supplier<T> supplier) throws IOException { return nextCollection(supplier, StringUtils.EMPTY); }
[ "public", "<", "T", "extends", "Collection", "<", "Val", ">", ">", "T", "nextCollection", "(", "@", "NonNull", "Supplier", "<", "T", ">", "supplier", ")", "throws", "IOException", "{", "return", "nextCollection", "(", "supplier", ",", "StringUtils", ".", "...
Reads the next array as a collection. @param <T> the collection type @param supplier the supplier to create a new collection @return the collection containing the items in the next array @throws IOException Something went wrong reading
[ "Reads", "the", "next", "array", "as", "a", "collection", "." ]
train
https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/json/JsonReader.java#L394-L396
rundeck/rundeck
core/src/main/java/com/dtolabs/rundeck/core/execution/workflow/BaseWorkflowExecutor.java
BaseWorkflowExecutor.createPrintableDataContext
protected Map<String, Map<String, String>> createPrintableDataContext(Map<String, Map<String, String>> dataContext) { return createPrintableDataContext(OPTION_KEY, SECURE_OPTION_KEY, SECURE_OPTION_VALUE, dataContext); }
java
protected Map<String, Map<String, String>> createPrintableDataContext(Map<String, Map<String, String>> dataContext) { return createPrintableDataContext(OPTION_KEY, SECURE_OPTION_KEY, SECURE_OPTION_VALUE, dataContext); }
[ "protected", "Map", "<", "String", ",", "Map", "<", "String", ",", "String", ">", ">", "createPrintableDataContext", "(", "Map", "<", "String", ",", "Map", "<", "String", ",", "String", ">", ">", "dataContext", ")", "{", "return", "createPrintableDataContext...
Creates a copy of the given data context with the secure option values obfuscated. This does not modify the original data context. "secureOption" map values will always be obfuscated. "option" entries that are also in "secureOption" will have their values obfuscated. All other maps within the data context will be adde...
[ "Creates", "a", "copy", "of", "the", "given", "data", "context", "with", "the", "secure", "option", "values", "obfuscated", ".", "This", "does", "not", "modify", "the", "original", "data", "context", "." ]
train
https://github.com/rundeck/rundeck/blob/8070f774f55bffaa1118ff0c03aea319d40a9668/core/src/main/java/com/dtolabs/rundeck/core/execution/workflow/BaseWorkflowExecutor.java#L571-L574
google/error-prone-javac
src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/DocEnv.java
DocEnv.printError
public void printError(SourcePosition pos, String msg) { if (silent) return; messager.printError(pos, msg); }
java
public void printError(SourcePosition pos, String msg) { if (silent) return; messager.printError(pos, msg); }
[ "public", "void", "printError", "(", "SourcePosition", "pos", ",", "String", "msg", ")", "{", "if", "(", "silent", ")", "return", ";", "messager", ".", "printError", "(", "pos", ",", "msg", ")", ";", "}" ]
Print error message, increment error count. @param msg message to print.
[ "Print", "error", "message", "increment", "error", "count", "." ]
train
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/DocEnv.java#L347-L351
Javacord/Javacord
javacord-core/src/main/java/org/javacord/core/DiscordApiImpl.java
DiscordApiImpl.getOrCreateKnownCustomEmoji
public KnownCustomEmoji getOrCreateKnownCustomEmoji(Server server, JsonNode data) { long id = Long.parseLong(data.get("id").asText()); return customEmojis.computeIfAbsent(id, key -> new KnownCustomEmojiImpl(this, server, data)); }
java
public KnownCustomEmoji getOrCreateKnownCustomEmoji(Server server, JsonNode data) { long id = Long.parseLong(data.get("id").asText()); return customEmojis.computeIfAbsent(id, key -> new KnownCustomEmojiImpl(this, server, data)); }
[ "public", "KnownCustomEmoji", "getOrCreateKnownCustomEmoji", "(", "Server", "server", ",", "JsonNode", "data", ")", "{", "long", "id", "=", "Long", ".", "parseLong", "(", "data", ".", "get", "(", "\"id\"", ")", ".", "asText", "(", ")", ")", ";", "return", ...
Gets or creates a new known custom emoji object. @param server The server of the emoji. @param data The data of the emoji. @return The emoji for the given json object.
[ "Gets", "or", "creates", "a", "new", "known", "custom", "emoji", "object", "." ]
train
https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-core/src/main/java/org/javacord/core/DiscordApiImpl.java#L813-L816
phax/ph-commons
ph-commons/src/main/java/com/helger/commons/mock/CommonsMock.java
MockSupplier.createNoParams
@Nonnull public static <T> MockSupplier createNoParams (@Nonnull final Class <T> aDstClass, @Nonnull final Supplier <T> aSupplier) { ValueEnforcer.notNull (aDstClass, "DstClass"); ValueEnforcer.notNull (aSupplier, "Supplier"); return new MockS...
java
@Nonnull public static <T> MockSupplier createNoParams (@Nonnull final Class <T> aDstClass, @Nonnull final Supplier <T> aSupplier) { ValueEnforcer.notNull (aDstClass, "DstClass"); ValueEnforcer.notNull (aSupplier, "Supplier"); return new MockS...
[ "@", "Nonnull", "public", "static", "<", "T", ">", "MockSupplier", "createNoParams", "(", "@", "Nonnull", "final", "Class", "<", "T", ">", "aDstClass", ",", "@", "Nonnull", "final", "Supplier", "<", "T", ">", "aSupplier", ")", "{", "ValueEnforcer", ".", ...
Create a mock supplier for a factory without parameters. @param aDstClass The destination class to be mocked. May not be <code>null</code>. @param aSupplier The supplier/factory without parameters to be used. May not be <code>null</code>. @return Never <code>null</code>. @param <T> The type to be mocked
[ "Create", "a", "mock", "supplier", "for", "a", "factory", "without", "parameters", "." ]
train
https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/mock/CommonsMock.java#L231-L238
real-logic/simple-binary-encoding
sbe-tool/src/main/java/uk/co/real_logic/sbe/otf/Types.java
Types.getLong
public static long getLong(final DirectBuffer buffer, final int index, final Encoding encoding) { switch (encoding.primitiveType()) { case CHAR: return buffer.getByte(index); case INT8: return buffer.getByte(index); case INT16: ...
java
public static long getLong(final DirectBuffer buffer, final int index, final Encoding encoding) { switch (encoding.primitiveType()) { case CHAR: return buffer.getByte(index); case INT8: return buffer.getByte(index); case INT16: ...
[ "public", "static", "long", "getLong", "(", "final", "DirectBuffer", "buffer", ",", "final", "int", "index", ",", "final", "Encoding", "encoding", ")", "{", "switch", "(", "encoding", ".", "primitiveType", "(", ")", ")", "{", "case", "CHAR", ":", "return",...
Get a long value from a buffer at a given index for a given {@link Encoding}. @param buffer from which to read. @param index at which he integer should be read. @param encoding of the value. @return the value of the encoded long.
[ "Get", "a", "long", "value", "from", "a", "buffer", "at", "a", "given", "index", "for", "a", "given", "{", "@link", "Encoding", "}", "." ]
train
https://github.com/real-logic/simple-binary-encoding/blob/9a7be490c86d98f0e430e4189bc6c8c4fbef658b/sbe-tool/src/main/java/uk/co/real_logic/sbe/otf/Types.java#L80-L114
evernote/evernote-sdk-android
library/src/main/java/com/evernote/client/android/EvernoteUtil.java
EvernoteUtil.getEvernoteInstallStatus
public static EvernoteInstallStatus getEvernoteInstallStatus(Context context, String action) { PackageManager packageManager = context.getPackageManager(); Intent intent = new Intent(action).setPackage(PACKAGE_NAME); List<ResolveInfo> resolveInfos = packageManager.queryIntentActivities(intent, ...
java
public static EvernoteInstallStatus getEvernoteInstallStatus(Context context, String action) { PackageManager packageManager = context.getPackageManager(); Intent intent = new Intent(action).setPackage(PACKAGE_NAME); List<ResolveInfo> resolveInfos = packageManager.queryIntentActivities(intent, ...
[ "public", "static", "EvernoteInstallStatus", "getEvernoteInstallStatus", "(", "Context", "context", ",", "String", "action", ")", "{", "PackageManager", "packageManager", "=", "context", ".", "getPackageManager", "(", ")", ";", "Intent", "intent", "=", "new", "Inten...
Checks if Evernote is installed and if the app can resolve this action.
[ "Checks", "if", "Evernote", "is", "installed", "and", "if", "the", "app", "can", "resolve", "this", "action", "." ]
train
https://github.com/evernote/evernote-sdk-android/blob/fc59be643e85c4f59d562d1bfe76563997aa73cf/library/src/main/java/com/evernote/client/android/EvernoteUtil.java#L256-L273
http-builder-ng/http-builder-ng
http-builder-ng-core/src/main/java/groovyx/net/http/HttpBuilder.java
HttpBuilder.headAsync
public CompletableFuture<Object> headAsync(final Consumer<HttpConfig> configuration) { return CompletableFuture.supplyAsync(() -> head(configuration), getExecutor()); }
java
public CompletableFuture<Object> headAsync(final Consumer<HttpConfig> configuration) { return CompletableFuture.supplyAsync(() -> head(configuration), getExecutor()); }
[ "public", "CompletableFuture", "<", "Object", ">", "headAsync", "(", "final", "Consumer", "<", "HttpConfig", ">", "configuration", ")", "{", "return", "CompletableFuture", ".", "supplyAsync", "(", "(", ")", "->", "head", "(", "configuration", ")", ",", "getExe...
Executes an asynchronous HEAD request on the configured URI (asynchronous alias to `head(Consumer)`), with additional configuration provided by the configuration function. This method is generally used for Java-specific configuration. [source,java] ---- HttpBuilder http = HttpBuilder.configure(config -> { config.getR...
[ "Executes", "an", "asynchronous", "HEAD", "request", "on", "the", "configured", "URI", "(", "asynchronous", "alias", "to", "head", "(", "Consumer", ")", ")", "with", "additional", "configuration", "provided", "by", "the", "configuration", "function", "." ]
train
https://github.com/http-builder-ng/http-builder-ng/blob/865f37732c102c748d3db8b905199dac9222a525/http-builder-ng-core/src/main/java/groovyx/net/http/HttpBuilder.java#L631-L633
artikcloud/artikcloud-java
src/main/java/cloud/artik/api/UsersApi.java
UsersApi.getUserDeviceTypes
public DeviceTypesEnvelope getUserDeviceTypes(String userId, Integer offset, Integer count, Boolean includeShared) throws ApiException { ApiResponse<DeviceTypesEnvelope> resp = getUserDeviceTypesWithHttpInfo(userId, offset, count, includeShared); return resp.getData(); }
java
public DeviceTypesEnvelope getUserDeviceTypes(String userId, Integer offset, Integer count, Boolean includeShared) throws ApiException { ApiResponse<DeviceTypesEnvelope> resp = getUserDeviceTypesWithHttpInfo(userId, offset, count, includeShared); return resp.getData(); }
[ "public", "DeviceTypesEnvelope", "getUserDeviceTypes", "(", "String", "userId", ",", "Integer", "offset", ",", "Integer", "count", ",", "Boolean", "includeShared", ")", "throws", "ApiException", "{", "ApiResponse", "<", "DeviceTypesEnvelope", ">", "resp", "=", "getU...
Get User Device Types Retrieve User&#39;s Device Types @param userId User ID. (required) @param offset Offset for pagination. (optional) @param count Desired count of items in the result set (optional) @param includeShared Optional. Boolean (true/false) - If false, only return the user&#39;s device types. If true, also...
[ "Get", "User", "Device", "Types", "Retrieve", "User&#39", ";", "s", "Device", "Types" ]
train
https://github.com/artikcloud/artikcloud-java/blob/412f447573e7796ab4f685c0bdd5eb76185a365c/src/main/java/cloud/artik/api/UsersApi.java#L505-L508
alkacon/opencms-core
src/org/opencms/db/CmsSecurityManager.java
CmsSecurityManager.lookupPrincipal
public I_CmsPrincipal lookupPrincipal(CmsRequestContext context, String principalName) { CmsDbContext dbc = m_dbContextFactory.getDbContext(context); I_CmsPrincipal result = null; try { result = m_driverManager.lookupPrincipal(dbc, CmsOrganizationalUnit.removeLeadingSeparator(princi...
java
public I_CmsPrincipal lookupPrincipal(CmsRequestContext context, String principalName) { CmsDbContext dbc = m_dbContextFactory.getDbContext(context); I_CmsPrincipal result = null; try { result = m_driverManager.lookupPrincipal(dbc, CmsOrganizationalUnit.removeLeadingSeparator(princi...
[ "public", "I_CmsPrincipal", "lookupPrincipal", "(", "CmsRequestContext", "context", ",", "String", "principalName", ")", "{", "CmsDbContext", "dbc", "=", "m_dbContextFactory", ".", "getDbContext", "(", "context", ")", ";", "I_CmsPrincipal", "result", "=", "null", ";...
Lookup and read the user or group with the given name.<p> @param context the current request context @param principalName the name of the principal to lookup @return the principal (group or user) if found, otherwise <code>null</code>
[ "Lookup", "and", "read", "the", "user", "or", "group", "with", "the", "given", "name", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsSecurityManager.java#L3642-L3652
alipay/sofa-hessian
src/main/java/com/caucho/hessian/io/Hessian2Output.java
Hessian2Output.writeFault
public void writeFault(String code, String message, Object detail) throws IOException { flushIfFull(); writeVersion(); _buffer[_offset++] = (byte) 'F'; _buffer[_offset++] = (byte) 'H'; addRef(new Object(), _refCount++, false); writeString("code"); ...
java
public void writeFault(String code, String message, Object detail) throws IOException { flushIfFull(); writeVersion(); _buffer[_offset++] = (byte) 'F'; _buffer[_offset++] = (byte) 'H'; addRef(new Object(), _refCount++, false); writeString("code"); ...
[ "public", "void", "writeFault", "(", "String", "code", ",", "String", "message", ",", "Object", "detail", ")", "throws", "IOException", "{", "flushIfFull", "(", ")", ";", "writeVersion", "(", ")", ";", "_buffer", "[", "_offset", "++", "]", "=", "(", "byt...
Writes a fault. The fault will be written as a descriptive string followed by an object: <code><pre> F map </pre></code> <code><pre> F H \x04code \x10the fault code \x07message \x11the fault message \x06detail M\xnnjavax.ejb.FinderException ... Z Z </pre></code> @param code the fault code, a three digit
[ "Writes", "a", "fault", ".", "The", "fault", "will", "be", "written", "as", "a", "descriptive", "string", "followed", "by", "an", "object", ":" ]
train
https://github.com/alipay/sofa-hessian/blob/89e4f5af28602101dab7b498995018871616357b/src/main/java/com/caucho/hessian/io/Hessian2Output.java#L421-L446
jbundle/jbundle
thin/base/message/src/main/java/org/jbundle/thin/base/message/TreeMessage.java
TreeMessage.putNative
public void putNative(String key, Object value) { String strValue = null; if (value != null) strValue = value.toString(); CreateMode createMode = CreateMode.DONT_CREATE; if (value != null) { createMode = CreateMode.CREATE_IF_NOT_FOUND; if (...
java
public void putNative(String key, Object value) { String strValue = null; if (value != null) strValue = value.toString(); CreateMode createMode = CreateMode.DONT_CREATE; if (value != null) { createMode = CreateMode.CREATE_IF_NOT_FOUND; if (...
[ "public", "void", "putNative", "(", "String", "key", ",", "Object", "value", ")", "{", "String", "strValue", "=", "null", ";", "if", "(", "value", "!=", "null", ")", "strValue", "=", "value", ".", "toString", "(", ")", ";", "CreateMode", "createMode", ...
Put the raw value for this param in the (xpath) map. @param strParam The xpath key. @param objValue The raw data to set this location in the message.
[ "Put", "the", "raw", "value", "for", "this", "param", "in", "the", "(", "xpath", ")", "map", "." ]
train
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/message/src/main/java/org/jbundle/thin/base/message/TreeMessage.java#L114-L134
twitter/cloudhopper-commons
ch-sxmp/src/main/java/com/cloudhopper/sxmp/OptionalParamMap.java
OptionalParamMap.getLong
public Long getLong(String key, Long defaultValue) { Object o = get(key); if (o != null) { if (o instanceof Long) { return (Long) o; } else if (o instanceof Integer) { return new Long((Integer)o); } } return defaultValue...
java
public Long getLong(String key, Long defaultValue) { Object o = get(key); if (o != null) { if (o instanceof Long) { return (Long) o; } else if (o instanceof Integer) { return new Long((Integer)o); } } return defaultValue...
[ "public", "Long", "getLong", "(", "String", "key", ",", "Long", "defaultValue", ")", "{", "Object", "o", "=", "get", "(", "key", ")", ";", "if", "(", "o", "!=", "null", ")", "{", "if", "(", "o", "instanceof", "Long", ")", "{", "return", "(", "Lon...
/* getLong will successfully return for both Long values and Integer values it will convert the Integer to a Long
[ "/", "*", "getLong", "will", "successfully", "return", "for", "both", "Long", "values", "and", "Integer", "values", "it", "will", "convert", "the", "Integer", "to", "a", "Long" ]
train
https://github.com/twitter/cloudhopper-commons/blob/b5bc397dbec4537e8149e7ec0733c1d7ed477499/ch-sxmp/src/main/java/com/cloudhopper/sxmp/OptionalParamMap.java#L110-L120
alkacon/opencms-core
src/org/opencms/jsp/CmsJspTagInfo.java
CmsJspTagInfo.infoTagAction
public static String infoTagAction(String property, HttpServletRequest req) { if (property == null) { CmsMessageContainer errMsgContainer = Messages.get().container(Messages.GUI_ERR_INVALID_INFO_PROP_0); return Messages.getLocalizedMessage(errMsgContainer, req); } CmsFle...
java
public static String infoTagAction(String property, HttpServletRequest req) { if (property == null) { CmsMessageContainer errMsgContainer = Messages.get().container(Messages.GUI_ERR_INVALID_INFO_PROP_0); return Messages.getLocalizedMessage(errMsgContainer, req); } CmsFle...
[ "public", "static", "String", "infoTagAction", "(", "String", "property", ",", "HttpServletRequest", "req", ")", "{", "if", "(", "property", "==", "null", ")", "{", "CmsMessageContainer", "errMsgContainer", "=", "Messages", ".", "get", "(", ")", ".", "containe...
Returns the selected info property value based on the provided parameters.<p> @param property the info property to look up @param req the currents request @return the looked up property value
[ "Returns", "the", "selected", "info", "property", "value", "based", "on", "the", "provided", "parameters", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/CmsJspTagInfo.java#L264-L324
elki-project/elki
elki-core-distance/src/main/java/de/lmu/ifi/dbs/elki/distance/distancefunction/timeseries/AbstractEditDistanceFunction.java
AbstractEditDistanceFunction.effectiveBandSize
protected int effectiveBandSize(final int dim1, final int dim2) { if(bandSize == Double.POSITIVE_INFINITY) { return (dim1 > dim2) ? dim1 : dim2; } if(bandSize >= 1.) { return (int) bandSize; } // Max * bandSize: return (int) Math.ceil((dim1 >= dim2 ? dim1 : dim2) * bandSize); }
java
protected int effectiveBandSize(final int dim1, final int dim2) { if(bandSize == Double.POSITIVE_INFINITY) { return (dim1 > dim2) ? dim1 : dim2; } if(bandSize >= 1.) { return (int) bandSize; } // Max * bandSize: return (int) Math.ceil((dim1 >= dim2 ? dim1 : dim2) * bandSize); }
[ "protected", "int", "effectiveBandSize", "(", "final", "int", "dim1", ",", "final", "int", "dim2", ")", "{", "if", "(", "bandSize", "==", "Double", ".", "POSITIVE_INFINITY", ")", "{", "return", "(", "dim1", ">", "dim2", ")", "?", "dim1", ":", "dim2", "...
Compute the effective band size. @param dim1 First dimensionality @param dim2 Second dimensionality @return Effective bandsize
[ "Compute", "the", "effective", "band", "size", "." ]
train
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-distance/src/main/java/de/lmu/ifi/dbs/elki/distance/distancefunction/timeseries/AbstractEditDistanceFunction.java#L61-L70
OpenLiberty/open-liberty
dev/com.ibm.ws.channelfw/src/com/ibm/wsspi/connmgmt/ConnectionHandle.java
ConnectionHandle.setConnectionHandle
public static void setConnectionHandle(VirtualConnection vc, ConnectionHandle handle) { if (vc == null || handle == null) { return; } Map<Object, Object> map = vc.getStateMap(); // set connection handle into VC Object vcLock = vc.getLockObject(); synchronized...
java
public static void setConnectionHandle(VirtualConnection vc, ConnectionHandle handle) { if (vc == null || handle == null) { return; } Map<Object, Object> map = vc.getStateMap(); // set connection handle into VC Object vcLock = vc.getLockObject(); synchronized...
[ "public", "static", "void", "setConnectionHandle", "(", "VirtualConnection", "vc", ",", "ConnectionHandle", "handle", ")", "{", "if", "(", "vc", "==", "null", "||", "handle", "==", "null", ")", "{", "return", ";", "}", "Map", "<", "Object", ",", "Object", ...
Set the connection handle on the virtual connection. @param vc VirtualConnection containing simple state for this connection @param handle ConnectionHandle for the VirtualConnection
[ "Set", "the", "connection", "handle", "on", "the", "virtual", "connection", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.channelfw/src/com/ibm/wsspi/connmgmt/ConnectionHandle.java#L107-L126
Harium/keel
src/main/java/com/harium/keel/catalano/math/Tools.java
Tools.Angle
public static float Angle(float x, float y) { if (y >= 0) { if (x >= 0) return (float) Math.atan(y / x); return (float) (Math.PI - Math.atan(-y / x)); } else { if (x >= 0) return (float) (2 * Math.PI - Math.atan(-y / x)); ...
java
public static float Angle(float x, float y) { if (y >= 0) { if (x >= 0) return (float) Math.atan(y / x); return (float) (Math.PI - Math.atan(-y / x)); } else { if (x >= 0) return (float) (2 * Math.PI - Math.atan(-y / x)); ...
[ "public", "static", "float", "Angle", "(", "float", "x", ",", "float", "y", ")", "{", "if", "(", "y", ">=", "0", ")", "{", "if", "(", "x", ">=", "0", ")", "return", "(", "float", ")", "Math", ".", "atan", "(", "y", "/", "x", ")", ";", "retu...
Gets the angle formed by the vector [x,y]. @param x X axis coordinate. @param y Y axis coordinate. @return Angle formed by the vector.
[ "Gets", "the", "angle", "formed", "by", "the", "vector", "[", "x", "y", "]", "." ]
train
https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/Tools.java#L85-L95
FaritorKang/unmz-common-util
src/main/java/net/unmz/java/util/http/Img2Base64Utils.java
Img2Base64Utils.generateImage
public static boolean generateImage(String imgStr, String imgFilePath) { if (imgStr == null) //图像数据为空 return false; try { //Base64解码 byte[] b = Base64.decodeBase64(imgStr); for (int i = 0; i < b.length; ++i) { if (b[i] < 0) {//调整异常数据 ...
java
public static boolean generateImage(String imgStr, String imgFilePath) { if (imgStr == null) //图像数据为空 return false; try { //Base64解码 byte[] b = Base64.decodeBase64(imgStr); for (int i = 0; i < b.length; ++i) { if (b[i] < 0) {//调整异常数据 ...
[ "public", "static", "boolean", "generateImage", "(", "String", "imgStr", ",", "String", "imgFilePath", ")", "{", "if", "(", "imgStr", "==", "null", ")", "//图像数据为空", "return", "false", ";", "try", "{", "//Base64解码", "byte", "[", "]", "b", "=", "Base64", "...
对字节数组字符串进行Base64解码并生成图片 @param imgStr 图片数据 @param imgFilePath 保存图片全路径地址 @return
[ "对字节数组字符串进行Base64解码并生成图片" ]
train
https://github.com/FaritorKang/unmz-common-util/blob/2912b8889b85ed910d536f85b24b6fa68035814a/src/main/java/net/unmz/java/util/http/Img2Base64Utils.java#L62-L83
ops4j/org.ops4j.pax.exam2
core/pax-exam-spi/src/main/java/org/ops4j/pax/exam/spi/war/ZipBuilder.java
ZipBuilder.addDirectory
private void addDirectory(File root, File directory, String targetPath, ZipOutputStream zos) throws IOException { String prefix = targetPath; if (!prefix.isEmpty() && !prefix.endsWith("/")) { prefix += "/"; } // directory entries are required, or else bundle classpath may be ...
java
private void addDirectory(File root, File directory, String targetPath, ZipOutputStream zos) throws IOException { String prefix = targetPath; if (!prefix.isEmpty() && !prefix.endsWith("/")) { prefix += "/"; } // directory entries are required, or else bundle classpath may be ...
[ "private", "void", "addDirectory", "(", "File", "root", ",", "File", "directory", ",", "String", "targetPath", ",", "ZipOutputStream", "zos", ")", "throws", "IOException", "{", "String", "prefix", "=", "targetPath", ";", "if", "(", "!", "prefix", ".", "isEmp...
Recursively adds the contents of the given directory and all subdirectories to the given ZIP output stream. @param root an ancestor of {@code directory}, used to determine the relative path within the archive @param directory current directory to be added @param zos ZIP output stream @throws IOException
[ "Recursively", "adds", "the", "contents", "of", "the", "given", "directory", "and", "all", "subdirectories", "to", "the", "given", "ZIP", "output", "stream", "." ]
train
https://github.com/ops4j/org.ops4j.pax.exam2/blob/7f83796cbbb857123d8fc7fe817a7637218d5d77/core/pax-exam-spi/src/main/java/org/ops4j/pax/exam/spi/war/ZipBuilder.java#L141-L163
marcos-garcia/smartsantanderdataanalysis
ssjsonformatterinterceptor/src/main/java/com/marcosgarciacasado/ssjsonformatterinterceptor/MeasureExtractor.java
MeasureExtractor.fillMeasures
public void fillMeasures(String measure, JSONObject jsonContent, Pattern pattern, HashMap<String,Double> i){ String tem = (String)jsonContent.get(measure); if(tem != null){ Matcher tM = pattern.matcher(tem); if(tM.find() && !tM.group(1).isEmpty()){ try{ i.put(measure, Double.valueOf(tM.group(1))); ...
java
public void fillMeasures(String measure, JSONObject jsonContent, Pattern pattern, HashMap<String,Double> i){ String tem = (String)jsonContent.get(measure); if(tem != null){ Matcher tM = pattern.matcher(tem); if(tM.find() && !tM.group(1).isEmpty()){ try{ i.put(measure, Double.valueOf(tM.group(1))); ...
[ "public", "void", "fillMeasures", "(", "String", "measure", ",", "JSONObject", "jsonContent", ",", "Pattern", "pattern", ",", "HashMap", "<", "String", ",", "Double", ">", "i", ")", "{", "String", "tem", "=", "(", "String", ")", "jsonContent", ".", "get", ...
Extracts a pattern from a measure value located in a JSONObject and stores it in a HashMap whether finds it. @author Marcos García Casado
[ "Extracts", "a", "pattern", "from", "a", "measure", "value", "located", "in", "a", "JSONObject", "and", "stores", "it", "in", "a", "HashMap", "whether", "finds", "it", "." ]
train
https://github.com/marcos-garcia/smartsantanderdataanalysis/blob/dc259618887886e294c839a905b18994171d21ef/ssjsonformatterinterceptor/src/main/java/com/marcosgarciacasado/ssjsonformatterinterceptor/MeasureExtractor.java#L72-L84
threerings/narya
core/src/main/java/com/threerings/crowd/server/PlaceRegistry.java
PlaceRegistry.createPlace
public PlaceManager createPlace (PlaceConfig config) throws InstantiationException, InvocationException { return createPlace(config, null, null); }
java
public PlaceManager createPlace (PlaceConfig config) throws InstantiationException, InvocationException { return createPlace(config, null, null); }
[ "public", "PlaceManager", "createPlace", "(", "PlaceConfig", "config", ")", "throws", "InstantiationException", ",", "InvocationException", "{", "return", "createPlace", "(", "config", ",", "null", ",", "null", ")", ";", "}" ]
Creates and registers a new place manager with no delegates. @see #createPlace(PlaceConfig,List)
[ "Creates", "and", "registers", "a", "new", "place", "manager", "with", "no", "delegates", "." ]
train
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/server/PlaceRegistry.java#L82-L86
tvbarthel/Cheerleader
library/src/main/java/fr/tvbarthel/cheerleader/library/helpers/SoundCloudArtworkHelper.java
SoundCloudArtworkHelper.getArtworkUrl
public static String getArtworkUrl(SoundCloudTrack track, String size) { String defaultUrl = track.getArtworkUrl(); if (defaultUrl == null) { return null; } switch (size) { case MINI: case TINY: case SMALL: case BADGE: ...
java
public static String getArtworkUrl(SoundCloudTrack track, String size) { String defaultUrl = track.getArtworkUrl(); if (defaultUrl == null) { return null; } switch (size) { case MINI: case TINY: case SMALL: case BADGE: ...
[ "public", "static", "String", "getArtworkUrl", "(", "SoundCloudTrack", "track", ",", "String", "size", ")", "{", "String", "defaultUrl", "=", "track", ".", "getArtworkUrl", "(", ")", ";", "if", "(", "defaultUrl", "==", "null", ")", "{", "return", "null", "...
Retrieve the artwork url of a track pointing to the requested size. <p/> By default, {@link fr.tvbarthel.cheerleader.library.client.SoundCloudTrack#getArtworkUrl()} points to the {@link fr.tvbarthel.cheerleader.library.helpers.SoundCloudArtworkHelper#LARGE} <p/> Available size are : {@link fr.tvbarthel.cheerleader.libr...
[ "Retrieve", "the", "artwork", "url", "of", "a", "track", "pointing", "to", "the", "requested", "size", ".", "<p", "/", ">", "By", "default", "{", "@link", "fr", ".", "tvbarthel", ".", "cheerleader", ".", "library", ".", "client", ".", "SoundCloudTrack#getA...
train
https://github.com/tvbarthel/Cheerleader/blob/f61527e4cc44fcd0ed2e1e98aca285f8c236f24e/library/src/main/java/fr/tvbarthel/cheerleader/library/helpers/SoundCloudArtworkHelper.java#L78-L96
SeaCloudsEU/SeaCloudsPlatform
dashboard/src/main/java/eu/seaclouds/platform/dashboard/proxy/DeployerProxy.java
DeployerProxy.getEntitySensorsValue
public String getEntitySensorsValue(String brooklynId, String brooklynEntityId, String sensorId) throws IOException { Invocation invocation = getJerseyClient().target( getEndpoint() + "/v1/applications/" + brooklynId + "/entities/" + brooklynEntityId + "/sensors/" + sensorId + "?raw=true") ...
java
public String getEntitySensorsValue(String brooklynId, String brooklynEntityId, String sensorId) throws IOException { Invocation invocation = getJerseyClient().target( getEndpoint() + "/v1/applications/" + brooklynId + "/entities/" + brooklynEntityId + "/sensors/" + sensorId + "?raw=true") ...
[ "public", "String", "getEntitySensorsValue", "(", "String", "brooklynId", ",", "String", "brooklynEntityId", ",", "String", "sensorId", ")", "throws", "IOException", "{", "Invocation", "invocation", "=", "getJerseyClient", "(", ")", ".", "target", "(", "getEndpoint"...
Creates a proxied HTTP GET request to Apache Brooklyn to retrieve Sensors from a particular Entity @param brooklynId of the desired application to fetch. This ID may differ from SeaClouds Application ID @param brooklynEntityId of the desired entity. This Entity ID should be children of brooklynId @param sensorId of th...
[ "Creates", "a", "proxied", "HTTP", "GET", "request", "to", "Apache", "Brooklyn", "to", "retrieve", "Sensors", "from", "a", "particular", "Entity" ]
train
https://github.com/SeaCloudsEU/SeaCloudsPlatform/blob/b199fe6de2c63b808cb248d3aca947d802375df8/dashboard/src/main/java/eu/seaclouds/platform/dashboard/proxy/DeployerProxy.java#L122-L128
hawtio/hawtio
hawtio-util/src/main/java/io/hawt/util/Zips.java
Zips.createZipFile
public static void createZipFile(Logger log, File sourceDir, File outputZipFile) throws IOException { FileFilter filter = null; createZipFile(log, sourceDir, outputZipFile, filter); }
java
public static void createZipFile(Logger log, File sourceDir, File outputZipFile) throws IOException { FileFilter filter = null; createZipFile(log, sourceDir, outputZipFile, filter); }
[ "public", "static", "void", "createZipFile", "(", "Logger", "log", ",", "File", "sourceDir", ",", "File", "outputZipFile", ")", "throws", "IOException", "{", "FileFilter", "filter", "=", "null", ";", "createZipFile", "(", "log", ",", "sourceDir", ",", "outputZ...
Creates a zip fie from the given source directory and output zip file name
[ "Creates", "a", "zip", "fie", "from", "the", "given", "source", "directory", "and", "output", "zip", "file", "name" ]
train
https://github.com/hawtio/hawtio/blob/d8b1c8f246307c0313ba297a494106d0859f3ffd/hawtio-util/src/main/java/io/hawt/util/Zips.java#L43-L46
Azure/azure-sdk-for-java
appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServiceEnvironmentsInner.java
AppServiceEnvironmentsInner.listMultiRolePoolSkusWithServiceResponseAsync
public Observable<ServiceResponse<Page<SkuInfoInner>>> listMultiRolePoolSkusWithServiceResponseAsync(final String resourceGroupName, final String name) { return listMultiRolePoolSkusSinglePageAsync(resourceGroupName, name) .concatMap(new Func1<ServiceResponse<Page<SkuInfoInner>>, Observable<ServiceR...
java
public Observable<ServiceResponse<Page<SkuInfoInner>>> listMultiRolePoolSkusWithServiceResponseAsync(final String resourceGroupName, final String name) { return listMultiRolePoolSkusSinglePageAsync(resourceGroupName, name) .concatMap(new Func1<ServiceResponse<Page<SkuInfoInner>>, Observable<ServiceR...
[ "public", "Observable", "<", "ServiceResponse", "<", "Page", "<", "SkuInfoInner", ">", ">", ">", "listMultiRolePoolSkusWithServiceResponseAsync", "(", "final", "String", "resourceGroupName", ",", "final", "String", "name", ")", "{", "return", "listMultiRolePoolSkusSingl...
Get available SKUs for scaling a multi-role pool. Get available SKUs for scaling a multi-role pool. @param resourceGroupName Name of the resource group to which the resource belongs. @param name Name of the App Service Environment. @throws IllegalArgumentException thrown if parameters fail the validation @return the o...
[ "Get", "available", "SKUs", "for", "scaling", "a", "multi", "-", "role", "pool", ".", "Get", "available", "SKUs", "for", "scaling", "a", "multi", "-", "role", "pool", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServiceEnvironmentsInner.java#L3431-L3443
Impetus/Kundera
src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/CassandraClientBase.java
CassandraClientBase.setBatchSize
private void setBatchSize(String persistenceUnit, Map<String, Object> puProperties) { String batch_Size = null; PersistenceUnitMetadata puMetadata = KunderaMetadataManager.getPersistenceUnitMetadata(kunderaMetadata, persistenceUnit); String externalBatchSize = puPropert...
java
private void setBatchSize(String persistenceUnit, Map<String, Object> puProperties) { String batch_Size = null; PersistenceUnitMetadata puMetadata = KunderaMetadataManager.getPersistenceUnitMetadata(kunderaMetadata, persistenceUnit); String externalBatchSize = puPropert...
[ "private", "void", "setBatchSize", "(", "String", "persistenceUnit", ",", "Map", "<", "String", ",", "Object", ">", "puProperties", ")", "{", "String", "batch_Size", "=", "null", ";", "PersistenceUnitMetadata", "puMetadata", "=", "KunderaMetadataManager", ".", "ge...
Sets the batch size. @param persistenceUnit the persistence unit @param puProperties the pu properties
[ "Sets", "the", "batch", "size", "." ]
train
https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/CassandraClientBase.java#L1880-L1897
jhunters/jprotobuf
v3/src/main/java/com/baidu/bjf/remoting/protobuf/code/CodedConstant.java
CodedConstant.computeElementSizeNoTag
public static int computeElementSizeNoTag(final WireFormat.FieldType type, final Object value) { switch (type) { // Note: Minor violation of 80-char limit rule here because this would // actually be harder to read if we wrapped the lines. case DOUBLE: ret...
java
public static int computeElementSizeNoTag(final WireFormat.FieldType type, final Object value) { switch (type) { // Note: Minor violation of 80-char limit rule here because this would // actually be harder to read if we wrapped the lines. case DOUBLE: ret...
[ "public", "static", "int", "computeElementSizeNoTag", "(", "final", "WireFormat", ".", "FieldType", "type", ",", "final", "Object", "value", ")", "{", "switch", "(", "type", ")", "{", "// Note: Minor violation of 80-char limit rule here because this would\r", "// actually...
Compute the number of bytes that would be needed to encode a particular value of arbitrary type, excluding tag. @param type The field's type. @param value Object representing the field's value. Must be of the exact type which would be returned by {@link Message#getField(Descriptors.FieldDescriptor)} for this field. @r...
[ "Compute", "the", "number", "of", "bytes", "that", "would", "be", "needed", "to", "encode", "a", "particular", "value", "of", "arbitrary", "type", "excluding", "tag", "." ]
train
https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/v3/src/main/java/com/baidu/bjf/remoting/protobuf/code/CodedConstant.java#L1296-L1359
Stratio/stratio-cassandra
src/java/org/apache/cassandra/db/CollationController.java
CollationController.reduceNameFilter
private void reduceNameFilter(QueryFilter filter, ColumnFamily container, long sstableTimestamp) { if (container == null) return; for (Iterator<CellName> iterator = ((NamesQueryFilter) filter.filter).columns.iterator(); iterator.hasNext(); ) { CellName filterColumn =...
java
private void reduceNameFilter(QueryFilter filter, ColumnFamily container, long sstableTimestamp) { if (container == null) return; for (Iterator<CellName> iterator = ((NamesQueryFilter) filter.filter).columns.iterator(); iterator.hasNext(); ) { CellName filterColumn =...
[ "private", "void", "reduceNameFilter", "(", "QueryFilter", "filter", ",", "ColumnFamily", "container", ",", "long", "sstableTimestamp", ")", "{", "if", "(", "container", "==", "null", ")", "return", ";", "for", "(", "Iterator", "<", "CellName", ">", "iterator"...
remove columns from @param filter where we already have data in @param container newer than @param sstableTimestamp
[ "remove", "columns", "from" ]
train
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/CollationController.java#L184-L196
ThreeTen/threetenbp
src/main/java/org/threeten/bp/format/DateTimeFormatterBuilder.java
DateTimeFormatterBuilder.appendFraction
public DateTimeFormatterBuilder appendFraction( TemporalField field, int minWidth, int maxWidth, boolean decimalPoint) { appendInternal(new FractionPrinterParser(field, minWidth, maxWidth, decimalPoint)); return this; }
java
public DateTimeFormatterBuilder appendFraction( TemporalField field, int minWidth, int maxWidth, boolean decimalPoint) { appendInternal(new FractionPrinterParser(field, minWidth, maxWidth, decimalPoint)); return this; }
[ "public", "DateTimeFormatterBuilder", "appendFraction", "(", "TemporalField", "field", ",", "int", "minWidth", ",", "int", "maxWidth", ",", "boolean", "decimalPoint", ")", "{", "appendInternal", "(", "new", "FractionPrinterParser", "(", "field", ",", "minWidth", ","...
Appends the fractional value of a date-time field to the formatter. <p> The fractional value of the field will be output including the preceding decimal point. The preceding value is not output. For example, the second-of-minute value of 15 would be output as {@code .25}. <p> The width of the printed fraction can be co...
[ "Appends", "the", "fractional", "value", "of", "a", "date", "-", "time", "field", "to", "the", "formatter", ".", "<p", ">", "The", "fractional", "value", "of", "the", "field", "will", "be", "output", "including", "the", "preceding", "decimal", "point", "."...
train
https://github.com/ThreeTen/threetenbp/blob/5f05b649f89f205aabd96b2f83c36796ec616fe6/src/main/java/org/threeten/bp/format/DateTimeFormatterBuilder.java#L639-L643
bignerdranch/expandable-recycler-view
expandablerecyclerview/src/main/java/com/bignerdranch/expandablerecyclerview/ExpandableRecyclerAdapter.java
ExpandableRecyclerAdapter.notifyChildRemoved
@UiThread public void notifyChildRemoved(int parentPosition, int childPosition) { int flatParentPosition = getFlatParentPosition(parentPosition); ExpandableWrapper<P, C> parentWrapper = mFlatItemList.get(flatParentPosition); parentWrapper.setParent(mParentList.get(parentPosition)); ...
java
@UiThread public void notifyChildRemoved(int parentPosition, int childPosition) { int flatParentPosition = getFlatParentPosition(parentPosition); ExpandableWrapper<P, C> parentWrapper = mFlatItemList.get(flatParentPosition); parentWrapper.setParent(mParentList.get(parentPosition)); ...
[ "@", "UiThread", "public", "void", "notifyChildRemoved", "(", "int", "parentPosition", ",", "int", "childPosition", ")", "{", "int", "flatParentPosition", "=", "getFlatParentPosition", "(", "parentPosition", ")", ";", "ExpandableWrapper", "<", "P", ",", "C", ">", ...
Notify any registered observers that the parent located at {@code parentPosition} has a child that has been removed from the data set, previously located at {@code childPosition}. The child list item previously located at and after {@code childPosition} may now be found at {@code childPosition - 1}. <p> This is a struc...
[ "Notify", "any", "registered", "observers", "that", "the", "parent", "located", "at", "{", "@code", "parentPosition", "}", "has", "a", "child", "that", "has", "been", "removed", "from", "the", "data", "set", "previously", "located", "at", "{", "@code", "chil...
train
https://github.com/bignerdranch/expandable-recycler-view/blob/930912510620894c531d236856fa79d646e2f1ed/expandablerecyclerview/src/main/java/com/bignerdranch/expandablerecyclerview/ExpandableRecyclerAdapter.java#L1188-L1198
google/error-prone-javac
src/jdk.jshell/share/classes/jdk/internal/jshell/tool/JShellTool.java
JShellTool.prefixError
String prefixError(String s) { return prefix(s, feedback.getErrorPre(), feedback.getErrorPost()); }
java
String prefixError(String s) { return prefix(s, feedback.getErrorPre(), feedback.getErrorPost()); }
[ "String", "prefixError", "(", "String", "s", ")", "{", "return", "prefix", "(", "s", ",", "feedback", ".", "getErrorPre", "(", ")", ",", "feedback", ".", "getErrorPost", "(", ")", ")", ";", "}" ]
Add error prefixing/postfixing to embedded newlines in a string, bracketing with error prefix/postfix @param s the string to prefix @return the pre/post-fixed and bracketed string
[ "Add", "error", "prefixing", "/", "postfixing", "to", "embedded", "newlines", "in", "a", "string", "bracketing", "with", "error", "prefix", "/", "postfix" ]
train
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/JShellTool.java#L746-L748
alipay/sofa-rpc
core/common/src/main/java/com/alipay/sofa/rpc/common/utils/ClassUtils.java
ClassUtils.forName
public static Class forName(String className, ClassLoader cl) { try { return Class.forName(className, true, cl); } catch (Exception e) { throw new SofaRpcRuntimeException(e); } }
java
public static Class forName(String className, ClassLoader cl) { try { return Class.forName(className, true, cl); } catch (Exception e) { throw new SofaRpcRuntimeException(e); } }
[ "public", "static", "Class", "forName", "(", "String", "className", ",", "ClassLoader", "cl", ")", "{", "try", "{", "return", "Class", ".", "forName", "(", "className", ",", "true", ",", "cl", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", ...
根据类名加载Class @param className 类名 @param cl Classloader @return Class
[ "根据类名加载Class" ]
train
https://github.com/alipay/sofa-rpc/blob/a31406410291e56696185a29c3ba4bd1f54488fd/core/common/src/main/java/com/alipay/sofa/rpc/common/utils/ClassUtils.java#L70-L76
dbracewell/mango
src/main/java/com/davidbracewell/scripting/ScriptEnvironment.java
ScriptEnvironment.invokeMethod
public Object invokeMethod(Object o, String name, Object... args) throws ScriptException, NoSuchMethodException { Invocable inv = (Invocable) engine; return inv.invokeMethod(o, name, args); }
java
public Object invokeMethod(Object o, String name, Object... args) throws ScriptException, NoSuchMethodException { Invocable inv = (Invocable) engine; return inv.invokeMethod(o, name, args); }
[ "public", "Object", "invokeMethod", "(", "Object", "o", ",", "String", "name", ",", "Object", "...", "args", ")", "throws", "ScriptException", ",", "NoSuchMethodException", "{", "Invocable", "inv", "=", "(", "Invocable", ")", "engine", ";", "return", "inv", ...
<p> Calls a method on a script object compiled during a previous script execution, which is retained in the state of the ScriptEngine. </p> @param o If the procedure is a member of a class defined in the script and o is an instance of that class returned by a previous execution or invocation, the named method is ca...
[ "<p", ">", "Calls", "a", "method", "on", "a", "script", "object", "compiled", "during", "a", "previous", "script", "execution", "which", "is", "retained", "in", "the", "state", "of", "the", "ScriptEngine", ".", "<", "/", "p", ">" ]
train
https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/scripting/ScriptEnvironment.java#L145-L149
undertow-io/undertow
core/src/main/java/io/undertow/server/handlers/ChannelUpgradeHandler.java
ChannelUpgradeHandler.removeProtocol
public synchronized void removeProtocol(String productString, ChannelListener<? super StreamConnection> openListener) { List<Holder> holders = handlers.get(productString); if (holders == null) { return; } Iterator<Holder> it = holders.iterator(); while (it.hasNext()) ...
java
public synchronized void removeProtocol(String productString, ChannelListener<? super StreamConnection> openListener) { List<Holder> holders = handlers.get(productString); if (holders == null) { return; } Iterator<Holder> it = holders.iterator(); while (it.hasNext()) ...
[ "public", "synchronized", "void", "removeProtocol", "(", "String", "productString", ",", "ChannelListener", "<", "?", "super", "StreamConnection", ">", "openListener", ")", "{", "List", "<", "Holder", ">", "holders", "=", "handlers", ".", "get", "(", "productStr...
Remove a protocol from this handler. @param productString the product string to match @param openListener The open listener
[ "Remove", "a", "protocol", "from", "this", "handler", "." ]
train
https://github.com/undertow-io/undertow/blob/87de0b856a7a4ba8faf5b659537b9af07b763263/core/src/main/java/io/undertow/server/handlers/ChannelUpgradeHandler.java#L126-L142
jamesagnew/hapi-fhir
hapi-fhir-utilities/src/main/java/org/hl7/fhir/utilities/CSVReader.java
CSVReader.parseLine
public String[] parseLine() throws IOException, FHIRException { List<String> res = new ArrayList<String>(); StringBuilder b = new StringBuilder(); boolean inQuote = false; while (inQuote || (peek() != '\r' && peek() != '\n')) { char c = peek(); next(); if (c == '"') inQuote = !inQuote; ...
java
public String[] parseLine() throws IOException, FHIRException { List<String> res = new ArrayList<String>(); StringBuilder b = new StringBuilder(); boolean inQuote = false; while (inQuote || (peek() != '\r' && peek() != '\n')) { char c = peek(); next(); if (c == '"') inQuote = !inQuote; ...
[ "public", "String", "[", "]", "parseLine", "(", ")", "throws", "IOException", ",", "FHIRException", "{", "List", "<", "String", ">", "res", "=", "new", "ArrayList", "<", "String", ">", "(", ")", ";", "StringBuilder", "b", "=", "new", "StringBuilder", "("...
Split one line in a CSV file into its rows. Comma's appearing in double quoted strings will not be seen as a separator. @return @throws IOException @throws FHIRException @
[ "Split", "one", "line", "in", "a", "CSV", "file", "into", "its", "rows", ".", "Comma", "s", "appearing", "in", "double", "quoted", "strings", "will", "not", "be", "seen", "as", "a", "separator", "." ]
train
https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-utilities/src/main/java/org/hl7/fhir/utilities/CSVReader.java#L119-L145
apache/groovy
subprojects/groovy-dateutil/src/main/java/org/apache/groovy/dateutil/extensions/DateUtilExtensions.java
DateUtilExtensions.putAt
public static void putAt(Date self, int field, int value) { Calendar cal = Calendar.getInstance(); cal.setTime(self); putAt(cal, field, value); self.setTime(cal.getTimeInMillis()); }
java
public static void putAt(Date self, int field, int value) { Calendar cal = Calendar.getInstance(); cal.setTime(self); putAt(cal, field, value); self.setTime(cal.getTimeInMillis()); }
[ "public", "static", "void", "putAt", "(", "Date", "self", ",", "int", "field", ",", "int", "value", ")", "{", "Calendar", "cal", "=", "Calendar", ".", "getInstance", "(", ")", ";", "cal", ".", "setTime", "(", "self", ")", ";", "putAt", "(", "cal", ...
Support the subscript operator for mutating a Date. @param self A Date @param field A Calendar field, e.g. MONTH @param value The value for the given field, e.g. FEBRUARY @see #putAt(java.util.Calendar, int, int) @see java.util.Calendar#set(int, int) @since 1.7.3
[ "Support", "the", "subscript", "operator", "for", "mutating", "a", "Date", "." ]
train
https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-dateutil/src/main/java/org/apache/groovy/dateutil/extensions/DateUtilExtensions.java#L111-L116
fcrepo3/fcrepo
fcrepo-server/src/main/java/org/fcrepo/server/validation/DOValidatorImpl.java
DOValidatorImpl.validateXMLSchema
private void validateXMLSchema(InputStream objectAsStream, DOValidatorXMLSchema xsv) throws ObjectValidityException, GeneralException { try { xsv.validate(objectAsStream); } catch (ObjectValidityException e) { logger.error("VALIDATE: ERROR - failed XML Schema validat...
java
private void validateXMLSchema(InputStream objectAsStream, DOValidatorXMLSchema xsv) throws ObjectValidityException, GeneralException { try { xsv.validate(objectAsStream); } catch (ObjectValidityException e) { logger.error("VALIDATE: ERROR - failed XML Schema validat...
[ "private", "void", "validateXMLSchema", "(", "InputStream", "objectAsStream", ",", "DOValidatorXMLSchema", "xsv", ")", "throws", "ObjectValidityException", ",", "GeneralException", "{", "try", "{", "xsv", ".", "validate", "(", "objectAsStream", ")", ";", "}", "catch...
Do XML Schema validation on the Fedora object. @param objectAsFile The digital object provided as a file. @throws ObjectValidityException If validation fails for any reason. @throws GeneralException If validation fails for any reason.
[ "Do", "XML", "Schema", "validation", "on", "the", "Fedora", "object", "." ]
train
https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-server/src/main/java/org/fcrepo/server/validation/DOValidatorImpl.java#L357-L371
pugwoo/nimble-orm
src/main/java/com/pugwoo/dbhelper/sql/SQLUtils.java
SQLUtils.getSelectSQL
public static String getSelectSQL(Class<?> clazz, boolean selectOnlyKey, boolean withSQL_CALC_FOUND_ROWS) { StringBuilder sql = new StringBuilder(); sql.append("SELECT "); if(withSQL_CALC_FOUND_ROWS) { sql.append("SQL_CALC_FOUND_ROWS "); } // 处理join方式clazz JoinTable joinTable = DOInfoReader.getJoinTab...
java
public static String getSelectSQL(Class<?> clazz, boolean selectOnlyKey, boolean withSQL_CALC_FOUND_ROWS) { StringBuilder sql = new StringBuilder(); sql.append("SELECT "); if(withSQL_CALC_FOUND_ROWS) { sql.append("SQL_CALC_FOUND_ROWS "); } // 处理join方式clazz JoinTable joinTable = DOInfoReader.getJoinTab...
[ "public", "static", "String", "getSelectSQL", "(", "Class", "<", "?", ">", "clazz", ",", "boolean", "selectOnlyKey", ",", "boolean", "withSQL_CALC_FOUND_ROWS", ")", "{", "StringBuilder", "sql", "=", "new", "StringBuilder", "(", ")", ";", "sql", ".", "append", ...
select 字段 from t_table, 不包含where子句及以后的语句 @param clazz @param selectOnlyKey 是否只查询key @param withSQL_CALC_FOUND_ROWS 查询是否带上SQL_CALC_FOUND_ROWS,当配合select FOUND_ROWS();时需要为true @return
[ "select", "字段", "from", "t_table", "不包含where子句及以后的语句" ]
train
https://github.com/pugwoo/nimble-orm/blob/dd496f3e57029e4f22f9a2f00d18a6513ef94d08/src/main/java/com/pugwoo/dbhelper/sql/SQLUtils.java#L62-L105
square/protoparser
src/main/java/com/squareup/protoparser/ProtoParser.java
ProtoParser.readList
private List<Object> readList() { if (readChar() != '[') throw new AssertionError(); List<Object> result = new ArrayList<>(); while (true) { if (peekChar() == ']') { // If we see the close brace, finish immediately. This handles [] and ,] cases. pos++; return result; } ...
java
private List<Object> readList() { if (readChar() != '[') throw new AssertionError(); List<Object> result = new ArrayList<>(); while (true) { if (peekChar() == ']') { // If we see the close brace, finish immediately. This handles [] and ,] cases. pos++; return result; } ...
[ "private", "List", "<", "Object", ">", "readList", "(", ")", "{", "if", "(", "readChar", "(", ")", "!=", "'", "'", ")", "throw", "new", "AssertionError", "(", ")", ";", "List", "<", "Object", ">", "result", "=", "new", "ArrayList", "<>", "(", ")", ...
Returns a list of values. This is similar to JSON with '[' and ']' surrounding the list and ',' separating values.
[ "Returns", "a", "list", "of", "values", ".", "This", "is", "similar", "to", "JSON", "with", "[", "and", "]", "surrounding", "the", "list", "and", "separating", "values", "." ]
train
https://github.com/square/protoparser/blob/8be66bb8fe6658b04741df0358daabca501f2524/src/main/java/com/squareup/protoparser/ProtoParser.java#L516-L535
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/ToTextStream.java
ToTextStream.charactersRaw
public void charactersRaw(char ch[], int start, int length) throws org.xml.sax.SAXException { try { writeNormalizedChars(ch, start, length, m_lineSepUse); } catch(IOException ioe) { throw new SAXException(ioe); } }
java
public void charactersRaw(char ch[], int start, int length) throws org.xml.sax.SAXException { try { writeNormalizedChars(ch, start, length, m_lineSepUse); } catch(IOException ioe) { throw new SAXException(ioe); } }
[ "public", "void", "charactersRaw", "(", "char", "ch", "[", "]", ",", "int", "start", ",", "int", "length", ")", "throws", "org", ".", "xml", ".", "sax", ".", "SAXException", "{", "try", "{", "writeNormalizedChars", "(", "ch", ",", "start", ",", "length...
If available, when the disable-output-escaping attribute is used, output raw text without escaping. @param ch The characters from the XML document. @param start The start position in the array. @param length The number of characters to read from the array. @throws org.xml.sax.SAXException Any SAX exception, possibly ...
[ "If", "available", "when", "the", "disable", "-", "output", "-", "escaping", "attribute", "is", "used", "output", "raw", "text", "without", "escaping", "." ]
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/ToTextStream.java#L242-L254
mgormley/pacaya
src/main/java/edu/jhu/pacaya/parse/dep/EdgeScores.java
EdgeScores.tensorToEdgeScores
public static EdgeScores tensorToEdgeScores(Tensor t) { if (t.getDims().length != 2) { throw new IllegalArgumentException("Tensor must be an nxn matrix."); } int n = t.getDims()[1]; EdgeScores es = new EdgeScores(n, 0); for (int p = -1; p < n; p++) { ...
java
public static EdgeScores tensorToEdgeScores(Tensor t) { if (t.getDims().length != 2) { throw new IllegalArgumentException("Tensor must be an nxn matrix."); } int n = t.getDims()[1]; EdgeScores es = new EdgeScores(n, 0); for (int p = -1; p < n; p++) { ...
[ "public", "static", "EdgeScores", "tensorToEdgeScores", "(", "Tensor", "t", ")", "{", "if", "(", "t", ".", "getDims", "(", ")", ".", "length", "!=", "2", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Tensor must be an nxn matrix.\"", ")", ";", ...
Convert a Tensor object to an EdgeScores, where the wall node is indexed as position n+1 in the Tensor.
[ "Convert", "a", "Tensor", "object", "to", "an", "EdgeScores", "where", "the", "wall", "node", "is", "indexed", "as", "position", "n", "+", "1", "in", "the", "Tensor", "." ]
train
https://github.com/mgormley/pacaya/blob/786294cbac7cc65dbc32210c10acc32ed0c69233/src/main/java/edu/jhu/pacaya/parse/dep/EdgeScores.java#L99-L113
zaproxy/zaproxy
src/org/parosproxy/paros/common/AbstractParam.java
AbstractParam.getInt
protected int getInt(String key, int defaultValue) { try { return getConfig().getInt(key, defaultValue); } catch (ConversionException e) { logConversionException(key, e); } return defaultValue; }
java
protected int getInt(String key, int defaultValue) { try { return getConfig().getInt(key, defaultValue); } catch (ConversionException e) { logConversionException(key, e); } return defaultValue; }
[ "protected", "int", "getInt", "(", "String", "key", ",", "int", "defaultValue", ")", "{", "try", "{", "return", "getConfig", "(", ")", ".", "getInt", "(", "key", ",", "defaultValue", ")", ";", "}", "catch", "(", "ConversionException", "e", ")", "{", "l...
Gets the {@code int} with the given configuration key. <p> The default value is returned if the key doesn't exist or it's not a {@code int}. @param key the configuration key. @param defaultValue the default value, if the key doesn't exist or it's not an {@code int}. @return the value of the configuration, or default v...
[ "Gets", "the", "{", "@code", "int", "}", "with", "the", "given", "configuration", "key", ".", "<p", ">", "The", "default", "value", "is", "returned", "if", "the", "key", "doesn", "t", "exist", "or", "it", "s", "not", "a", "{", "@code", "int", "}", ...
train
https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/parosproxy/paros/common/AbstractParam.java#L193-L200
zaproxy/zaproxy
src/org/parosproxy/paros/common/AbstractParam.java
AbstractParam.getString
protected String getString(String key, String defaultValue) { try { return getConfig().getString(key, defaultValue); } catch (ConversionException e) { logConversionException(key, e); } return defaultValue; }
java
protected String getString(String key, String defaultValue) { try { return getConfig().getString(key, defaultValue); } catch (ConversionException e) { logConversionException(key, e); } return defaultValue; }
[ "protected", "String", "getString", "(", "String", "key", ",", "String", "defaultValue", ")", "{", "try", "{", "return", "getConfig", "(", ")", ".", "getString", "(", "key", ",", "defaultValue", ")", ";", "}", "catch", "(", "ConversionException", "e", ")",...
Gets the {@code String} with the given configuration key. <p> The default value is returned if the key doesn't exist or it's not a {@code String}. @param key the configuration key. @param defaultValue the default value, if the key doesn't exist or it's not a {@code String}. @return the value of the configuration, or d...
[ "Gets", "the", "{", "@code", "String", "}", "with", "the", "given", "configuration", "key", ".", "<p", ">", "The", "default", "value", "is", "returned", "if", "the", "key", "doesn", "t", "exist", "or", "it", "s", "not", "a", "{", "@code", "String", "...
train
https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/parosproxy/paros/common/AbstractParam.java#L144-L151
eurekaclinical/javautil
src/main/java/org/arp/javautil/io/IOUtil.java
IOUtil.getResourceAsStream
public static InputStream getResourceAsStream(String name, Class<?> cls) throws IOException { if (cls == null) { cls = IOUtil.class; } if (name == null) { throw new IllegalArgumentException("resource cannot be null"); } InputStream result = cls...
java
public static InputStream getResourceAsStream(String name, Class<?> cls) throws IOException { if (cls == null) { cls = IOUtil.class; } if (name == null) { throw new IllegalArgumentException("resource cannot be null"); } InputStream result = cls...
[ "public", "static", "InputStream", "getResourceAsStream", "(", "String", "name", ",", "Class", "<", "?", ">", "cls", ")", "throws", "IOException", "{", "if", "(", "cls", "==", "null", ")", "{", "cls", "=", "IOUtil", ".", "class", ";", "}", "if", "(", ...
Finds a resource with a given name using the class loader of the specified class. Functions identically to {@link Class#getResourceAsStream(java.lang.String)}, except it throws an {@link IllegalArgumentException} if the specified resource name is <code>null</code>, and it throws an {@link IOException} if no resource wi...
[ "Finds", "a", "resource", "with", "a", "given", "name", "using", "the", "class", "loader", "of", "the", "specified", "class", ".", "Functions", "identically", "to", "{", "@link", "Class#getResourceAsStream", "(", "java", ".", "lang", ".", "String", ")", "}",...
train
https://github.com/eurekaclinical/javautil/blob/779bbc5bf096c75f8eed4f99ca45b99c1d44df43/src/main/java/org/arp/javautil/io/IOUtil.java#L223-L237
samskivert/samskivert
src/main/java/com/samskivert/servlet/MessageManager.java
MessageManager.getMessage
public String getMessage (HttpServletRequest req, String path) { return getMessage(req, path, true); }
java
public String getMessage (HttpServletRequest req, String path) { return getMessage(req, path, true); }
[ "public", "String", "getMessage", "(", "HttpServletRequest", "req", ",", "String", "path", ")", "{", "return", "getMessage", "(", "req", ",", "path", ",", "true", ")", ";", "}" ]
Looks up the message with the specified path in the resource bundle most appropriate for the locales described as preferred by the request. Always reports missing paths.
[ "Looks", "up", "the", "message", "with", "the", "specified", "path", "in", "the", "resource", "bundle", "most", "appropriate", "for", "the", "locales", "described", "as", "preferred", "by", "the", "request", ".", "Always", "reports", "missing", "paths", "." ]
train
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/servlet/MessageManager.java#L72-L75
Comcast/jrugged
jrugged-spring/src/main/java/org/fishwife/jrugged/spring/AnnotatedMethodScanner.java
AnnotatedMethodScanner.findAnnotatedMethods
public Set<Method> findAnnotatedMethods(String scanBase, Class<? extends Annotation> annotationClass) { Set<BeanDefinition> filteredComponents = findCandidateBeans(scanBase, annotationClass); return extractAnnotatedMethods(filteredComponents, annotationClass); }
java
public Set<Method> findAnnotatedMethods(String scanBase, Class<? extends Annotation> annotationClass) { Set<BeanDefinition> filteredComponents = findCandidateBeans(scanBase, annotationClass); return extractAnnotatedMethods(filteredComponents, annotationClass); }
[ "public", "Set", "<", "Method", ">", "findAnnotatedMethods", "(", "String", "scanBase", ",", "Class", "<", "?", "extends", "Annotation", ">", "annotationClass", ")", "{", "Set", "<", "BeanDefinition", ">", "filteredComponents", "=", "findCandidateBeans", "(", "s...
Find all methods on classes under scanBase that are annotated with annotationClass. @param scanBase Package to scan recursively, in dot notation (ie: org.jrugged...) @param annotationClass Class of the annotation to search for @return Set&lt;Method&gt; The set of all @{java.lang.reflect.Method}s having the annotation
[ "Find", "all", "methods", "on", "classes", "under", "scanBase", "that", "are", "annotated", "with", "annotationClass", "." ]
train
https://github.com/Comcast/jrugged/blob/b6a5147c68ee733faf5616d49800abcbba67afe9/jrugged-spring/src/main/java/org/fishwife/jrugged/spring/AnnotatedMethodScanner.java#L48-L51
hawkular/hawkular-commons
hawkular-command-gateway/hawkular-command-gateway-war/src/main/java/org/hawkular/cmdgw/command/ws/server/AbstractGatewayWebSocket.java
AbstractGatewayWebSocket.onBinaryMessage
@OnMessage public void onBinaryMessage(InputStream binaryDataStream, Session session) { String requestClassName = "?"; try { // parse the JSON and get its message POJO, including any additional binary data being streamed BasicMessageWithExtraData<BasicMessage> reqWithData = n...
java
@OnMessage public void onBinaryMessage(InputStream binaryDataStream, Session session) { String requestClassName = "?"; try { // parse the JSON and get its message POJO, including any additional binary data being streamed BasicMessageWithExtraData<BasicMessage> reqWithData = n...
[ "@", "OnMessage", "public", "void", "onBinaryMessage", "(", "InputStream", "binaryDataStream", ",", "Session", "session", ")", "{", "String", "requestClassName", "=", "\"?\"", ";", "try", "{", "// parse the JSON and get its message POJO, including any additional binary data b...
When a binary message is received from a WebSocket client, this method will lookup the {@link WsCommand} for the given request class and execute it. @param binaryDataStream contains the JSON request and additional binary data @param session the client session making the request
[ "When", "a", "binary", "message", "is", "received", "from", "a", "WebSocket", "client", "this", "method", "will", "lookup", "the", "{", "@link", "WsCommand", "}", "for", "the", "given", "request", "class", "and", "execute", "it", "." ]
train
https://github.com/hawkular/hawkular-commons/blob/e4a832862b3446d7f4d629bb05790f2df578e035/hawkular-command-gateway/hawkular-command-gateway-war/src/main/java/org/hawkular/cmdgw/command/ws/server/AbstractGatewayWebSocket.java#L114-L131
openbase/jul
visual/javafx/src/main/java/org/openbase/jul/visual/javafx/geometry/svg/SVGIcon.java
SVGIcon.setForegroundIconColor
public void setForegroundIconColor(final Color color, final Color outline, final double width) { setForegroundIconColor(color); foregroundIcon.setStroke(outline); foregroundIcon.setStrokeWidth(width); }
java
public void setForegroundIconColor(final Color color, final Color outline, final double width) { setForegroundIconColor(color); foregroundIcon.setStroke(outline); foregroundIcon.setStrokeWidth(width); }
[ "public", "void", "setForegroundIconColor", "(", "final", "Color", "color", ",", "final", "Color", "outline", ",", "final", "double", "width", ")", "{", "setForegroundIconColor", "(", "color", ")", ";", "foregroundIcon", ".", "setStroke", "(", "outline", ")", ...
Method sets the icon color and a stroke with a given color and width. @param color color for the foreground icon to be set @param outline color for the stroke @param width width of the stroke
[ "Method", "sets", "the", "icon", "color", "and", "a", "stroke", "with", "a", "given", "color", "and", "width", "." ]
train
https://github.com/openbase/jul/blob/662e98c3a853085e475be54c3be3deb72193c72d/visual/javafx/src/main/java/org/openbase/jul/visual/javafx/geometry/svg/SVGIcon.java#L466-L470
ops4j/org.ops4j.pax.exam2
containers/pax-exam-container-karaf/src/main/java/org/ops4j/pax/exam/karaf/options/KarafDistributionOption.java
KarafDistributionOption.karafDistributionConfiguration
public static KarafDistributionBaseConfigurationOption karafDistributionConfiguration( String frameworkURL, String name, String karafVersion) { return new KarafDistributionConfigurationOption(frameworkURL, name, karafVersion); }
java
public static KarafDistributionBaseConfigurationOption karafDistributionConfiguration( String frameworkURL, String name, String karafVersion) { return new KarafDistributionConfigurationOption(frameworkURL, name, karafVersion); }
[ "public", "static", "KarafDistributionBaseConfigurationOption", "karafDistributionConfiguration", "(", "String", "frameworkURL", ",", "String", "name", ",", "String", "karafVersion", ")", "{", "return", "new", "KarafDistributionConfigurationOption", "(", "frameworkURL", ",", ...
Configures which distribution options to use. Relevant are the frameworkURL, the frameworkName and the Karaf version since all of those params are relevant to decide which wrapper configurations to use. @param frameworkURL frameworkURL @param name framework name @param karafVersion Karaf version @return option
[ "Configures", "which", "distribution", "options", "to", "use", ".", "Relevant", "are", "the", "frameworkURL", "the", "frameworkName", "and", "the", "Karaf", "version", "since", "all", "of", "those", "params", "are", "relevant", "to", "decide", "which", "wrapper"...
train
https://github.com/ops4j/org.ops4j.pax.exam2/blob/7f83796cbbb857123d8fc7fe817a7637218d5d77/containers/pax-exam-container-karaf/src/main/java/org/ops4j/pax/exam/karaf/options/KarafDistributionOption.java#L126-L129
super-csv/super-csv
super-csv/src/main/java/org/supercsv/cellprocessor/ParseBool.java
ParseBool.checkPreconditions
private static void checkPreconditions(final String[] trueValues, final String[] falseValues) { if( trueValues == null ) { throw new NullPointerException("trueValues should not be null"); } else if( trueValues.length == 0 ) { throw new IllegalArgumentException("trueValues should not be empty"); } if...
java
private static void checkPreconditions(final String[] trueValues, final String[] falseValues) { if( trueValues == null ) { throw new NullPointerException("trueValues should not be null"); } else if( trueValues.length == 0 ) { throw new IllegalArgumentException("trueValues should not be empty"); } if...
[ "private", "static", "void", "checkPreconditions", "(", "final", "String", "[", "]", "trueValues", ",", "final", "String", "[", "]", "falseValues", ")", "{", "if", "(", "trueValues", "==", "null", ")", "{", "throw", "new", "NullPointerException", "(", "\"tru...
Checks the preconditions for constructing a new ParseBool processor. @param trueValues the array of Strings which represent true @param falseValues the array of Strings which represent false @throws IllegalArgumentException if trueValues or falseValues is empty @throws NullPointerException if trueValues or falseValues...
[ "Checks", "the", "preconditions", "for", "constructing", "a", "new", "ParseBool", "processor", "." ]
train
https://github.com/super-csv/super-csv/blob/f18db724674dc1c4116e25142c1b5403ebf43e96/super-csv/src/main/java/org/supercsv/cellprocessor/ParseBool.java#L304-L318
alkacon/opencms-core
src/org/opencms/db/CmsSecurityManager.java
CmsSecurityManager.getPermissions
public CmsPermissionSetCustom getPermissions(CmsRequestContext context, CmsResource resource, CmsUser user) throws CmsException { CmsDbContext dbc = m_dbContextFactory.getDbContext(context); CmsPermissionSetCustom result = null; try { result = m_driverManager.getPermissions(dbc,...
java
public CmsPermissionSetCustom getPermissions(CmsRequestContext context, CmsResource resource, CmsUser user) throws CmsException { CmsDbContext dbc = m_dbContextFactory.getDbContext(context); CmsPermissionSetCustom result = null; try { result = m_driverManager.getPermissions(dbc,...
[ "public", "CmsPermissionSetCustom", "getPermissions", "(", "CmsRequestContext", "context", ",", "CmsResource", "resource", ",", "CmsUser", "user", ")", "throws", "CmsException", "{", "CmsDbContext", "dbc", "=", "m_dbContextFactory", ".", "getDbContext", "(", "context", ...
Returns the set of permissions of the current user for a given resource.<p> @param context the current request context @param resource the resource @param user the user @return bit set with allowed permissions @throws CmsException if something goes wrong
[ "Returns", "the", "set", "of", "permissions", "of", "the", "current", "user", "for", "a", "given", "resource", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsSecurityManager.java#L2519-L2535
google/auto
value/src/main/java/com/google/auto/value/processor/BuilderMethodClassifier.java
BuilderMethodClassifier.checkSetterParameter
private boolean checkSetterParameter(ExecutableElement valueGetter, ExecutableElement setter) { TypeMirror targetType = getterToPropertyType.get(valueGetter); ExecutableType finalSetter = MoreTypes.asExecutable( typeUtils.asMemberOf(MoreTypes.asDeclared(builderType.asType()), setter)); T...
java
private boolean checkSetterParameter(ExecutableElement valueGetter, ExecutableElement setter) { TypeMirror targetType = getterToPropertyType.get(valueGetter); ExecutableType finalSetter = MoreTypes.asExecutable( typeUtils.asMemberOf(MoreTypes.asDeclared(builderType.asType()), setter)); T...
[ "private", "boolean", "checkSetterParameter", "(", "ExecutableElement", "valueGetter", ",", "ExecutableElement", "setter", ")", "{", "TypeMirror", "targetType", "=", "getterToPropertyType", ".", "get", "(", "valueGetter", ")", ";", "ExecutableType", "finalSetter", "=", ...
Checks that the given setter method has a parameter type that is compatible with the return type of the given getter. Compatible means either that it is the same, or that it is a type that can be copied using a method like {@code ImmutableList.copyOf} or {@code Optional.of}. @return true if the types correspond, false...
[ "Checks", "that", "the", "given", "setter", "method", "has", "a", "parameter", "type", "that", "is", "compatible", "with", "the", "return", "type", "of", "the", "given", "getter", ".", "Compatible", "means", "either", "that", "it", "is", "the", "same", "or...
train
https://github.com/google/auto/blob/4158a5fa71f1ef763e683b627f4d29bc04cfde9d/value/src/main/java/com/google/auto/value/processor/BuilderMethodClassifier.java#L417-L438
DataSketches/sketches-core
src/main/java/com/yahoo/sketches/sampling/VarOptItemsSketch.java
VarOptItemsSketch.updateHeavyGeneral
private void updateHeavyGeneral(final T item, final double weight, final boolean mark) { assert m_ == 0; assert r_ >= 2; assert (r_ + h_) == k_; // put into H, although may come back out momentarily push(item, weight, mark); growCandidateSet(totalWtR_, r_); }
java
private void updateHeavyGeneral(final T item, final double weight, final boolean mark) { assert m_ == 0; assert r_ >= 2; assert (r_ + h_) == k_; // put into H, although may come back out momentarily push(item, weight, mark); growCandidateSet(totalWtR_, r_); }
[ "private", "void", "updateHeavyGeneral", "(", "final", "T", "item", ",", "final", "double", "weight", ",", "final", "boolean", "mark", ")", "{", "assert", "m_", "==", "0", ";", "assert", "r_", ">=", "2", ";", "assert", "(", "r_", "+", "h_", ")", "=="...
/* In the "heavy" case the new item has weight > old_tau, so would appear to the left of items in R in a hypothetical reverse-sorted list and might or might not be light enough be part of this round's downsampling. [After first splitting off the R=1 case] we greatly simplify the code by putting the new item into the H ...
[ "/", "*", "In", "the", "heavy", "case", "the", "new", "item", "has", "weight", ">", "old_tau", "so", "would", "appear", "to", "the", "left", "of", "items", "in", "R", "in", "a", "hypothetical", "reverse", "-", "sorted", "list", "and", "might", "or", ...
train
https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/sampling/VarOptItemsSketch.java#L923-L932