repository_name
stringlengths
7
58
func_path_in_repository
stringlengths
18
201
func_name
stringlengths
4
126
whole_func_string
stringlengths
75
3.57k
language
stringclasses
1 value
func_code_string
stringlengths
75
3.57k
func_code_tokens
listlengths
21
599
func_documentation_string
stringlengths
61
1.95k
func_documentation_tokens
listlengths
1
478
split_name
stringclasses
1 value
func_code_url
stringlengths
111
308
percolate/caffeine
caffeine/src/main/java/com/percolate/caffeine/ViewUtils.java
ViewUtils.showView
public static void showView(View parentView, int id) { if (parentView != null) { View view = parentView.findViewById(id); if (view != null) { view.setVisibility(View.VISIBLE); } else { Log.e("Caffeine", "View does not exist. Could not show it."); } } }
java
public static void showView(View parentView, int id) { if (parentView != null) { View view = parentView.findViewById(id); if (view != null) { view.setVisibility(View.VISIBLE); } else { Log.e("Caffeine", "View does not exist. Could not show it."); } } }
[ "public", "static", "void", "showView", "(", "View", "parentView", ",", "int", "id", ")", "{", "if", "(", "parentView", "!=", "null", ")", "{", "View", "view", "=", "parentView", ".", "findViewById", "(", "id", ")", ";", "if", "(", "view", "!=", "nul...
Sets visibility of the given view to <code>View.VISIBLE</code>. @param parentView The View used to call findViewId() on. @param id R.id.xxxx value for the view to show.
[ "Sets", "visibility", "of", "the", "given", "view", "to", "<code", ">", "View", ".", "VISIBLE<", "/", "code", ">", "." ]
train
https://github.com/percolate/caffeine/blob/e2265cab474a6397f4d75b1ed928c356a7b9672e/caffeine/src/main/java/com/percolate/caffeine/ViewUtils.java#L283-L292
vanilladb/vanillacore
src/main/java/org/vanilladb/core/query/algebra/ProductPlan.java
ProductPlan.productHistogram
public static Histogram productHistogram(Histogram hist1, Histogram hist2) { Set<String> prodFlds = new HashSet<String>(hist1.fields()); prodFlds.addAll(hist2.fields()); Histogram prodHist = new Histogram(prodFlds); double numRec1 = hist1.recordsOutput(); double numRec2 = hist2.recordsOutput(); if (Double.compare(numRec1, 1.0) < 0 || Double.compare(numRec2, 1.0) < 0) return prodHist; for (String fld : hist1.fields()) for (Bucket bkt : hist1.buckets(fld)) prodHist.addBucket(fld, new Bucket(bkt.valueRange(), bkt.frequency() * numRec2, bkt.distinctValues(), bkt.valuePercentiles())); for (String fld : hist2.fields()) for (Bucket bkt : hist2.buckets(fld)) prodHist.addBucket(fld, new Bucket(bkt.valueRange(), bkt.frequency() * numRec1, bkt.distinctValues(), bkt.valuePercentiles())); return prodHist; }
java
public static Histogram productHistogram(Histogram hist1, Histogram hist2) { Set<String> prodFlds = new HashSet<String>(hist1.fields()); prodFlds.addAll(hist2.fields()); Histogram prodHist = new Histogram(prodFlds); double numRec1 = hist1.recordsOutput(); double numRec2 = hist2.recordsOutput(); if (Double.compare(numRec1, 1.0) < 0 || Double.compare(numRec2, 1.0) < 0) return prodHist; for (String fld : hist1.fields()) for (Bucket bkt : hist1.buckets(fld)) prodHist.addBucket(fld, new Bucket(bkt.valueRange(), bkt.frequency() * numRec2, bkt.distinctValues(), bkt.valuePercentiles())); for (String fld : hist2.fields()) for (Bucket bkt : hist2.buckets(fld)) prodHist.addBucket(fld, new Bucket(bkt.valueRange(), bkt.frequency() * numRec1, bkt.distinctValues(), bkt.valuePercentiles())); return prodHist; }
[ "public", "static", "Histogram", "productHistogram", "(", "Histogram", "hist1", ",", "Histogram", "hist2", ")", "{", "Set", "<", "String", ">", "prodFlds", "=", "new", "HashSet", "<", "String", ">", "(", "hist1", ".", "fields", "(", ")", ")", ";", "prodF...
Returns a histogram that, for each field, approximates the value distribution of products from the specified histograms. @param hist1 the left-hand-side histogram @param hist2 the right-hand-side histogram @return a histogram that, for each field, approximates the value distribution of the products
[ "Returns", "a", "histogram", "that", "for", "each", "field", "approximates", "the", "value", "distribution", "of", "products", "from", "the", "specified", "histograms", "." ]
train
https://github.com/vanilladb/vanillacore/blob/d9a34e876b1b83226036d1fa982a614bbef59bd1/src/main/java/org/vanilladb/core/query/algebra/ProductPlan.java#L41-L61
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/ConnectionListenerImpl.java
ConnectionListenerImpl.commsFailure
public void commsFailure(SICoreConnection conn, SIConnectionLostException exception) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "commsFailure", new Object[]{conn, exception}); JMSException jmse = (JMSException)JmsErrorUtils.newThrowable(JMSException.class, "COMMS_FAILURE_CWSIA0343", new Object[] { exception }, exception, "ConnectionListenerImpl.commsFailure#1", this, tc); connection.reportException(jmse); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "commsFailure"); }
java
public void commsFailure(SICoreConnection conn, SIConnectionLostException exception) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "commsFailure", new Object[]{conn, exception}); JMSException jmse = (JMSException)JmsErrorUtils.newThrowable(JMSException.class, "COMMS_FAILURE_CWSIA0343", new Object[] { exception }, exception, "ConnectionListenerImpl.commsFailure#1", this, tc); connection.reportException(jmse); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "commsFailure"); }
[ "public", "void", "commsFailure", "(", "SICoreConnection", "conn", ",", "SIConnectionLostException", "exception", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry"...
This method is called when a connection is closed due to a communications failure. Examine the SICommsException to determine the nature of the failure. <p>The conn parameter is ignored. The JMS API uses a 1 to 1 mapping of ConnectionListenerImpl to JMS Connection instances, so we should only ever receive calls for our own connection. @see com.ibm.wsspi.sib.core.SICoreConnectionListener#commsFailure(com.ibm.wsspi.sib.core.SICoreConnection, com.ibm.wsspi.sib.core.SICommsException)
[ "This", "method", "is", "called", "when", "a", "connection", "is", "closed", "due", "to", "a", "communications", "failure", ".", "Examine", "the", "SICommsException", "to", "determine", "the", "nature", "of", "the", "failure", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/ConnectionListenerImpl.java#L99-L111
jbundle/jbundle
base/base/src/main/java/org/jbundle/base/field/IntegerField.java
IntegerField.setValue
public int setValue(double value, boolean bDisplayOption, int moveMode) { // Set this field's value Integer tempLong = new Integer((int)value); int iErrorCode = this.setData(tempLong, bDisplayOption, moveMode); return iErrorCode; }
java
public int setValue(double value, boolean bDisplayOption, int moveMode) { // Set this field's value Integer tempLong = new Integer((int)value); int iErrorCode = this.setData(tempLong, bDisplayOption, moveMode); return iErrorCode; }
[ "public", "int", "setValue", "(", "double", "value", ",", "boolean", "bDisplayOption", ",", "int", "moveMode", ")", "{", "// Set this field's value", "Integer", "tempLong", "=", "new", "Integer", "(", "(", "int", ")", "value", ")", ";", "int", "iErrorCode", ...
/* Set the Value of this field as a double. @param value The value of this field. @param iDisplayOption If true, display the new field. @param iMoveMove The move mode. @return An error code (NORMAL_RETURN for success).
[ "/", "*", "Set", "the", "Value", "of", "this", "field", "as", "a", "double", "." ]
train
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/IntegerField.java#L191-L196
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/jsr305/TypeQualifierApplications.java
TypeQualifierApplications.getDirectTypeQualifierAnnotation
public static @CheckForNull @CheckReturnValue TypeQualifierAnnotation getDirectTypeQualifierAnnotation(XMethod xmethod, int parameter, TypeQualifierValue<?> typeQualifierValue) { XMethod bridge = xmethod.bridgeTo(); if (bridge != null) { xmethod = bridge; } Set<TypeQualifierAnnotation> applications = new HashSet<>(); getDirectApplications(applications, xmethod, parameter); if (DEBUG_METHOD != null && DEBUG_METHOD.equals(xmethod.getName())) { System.out.println(" Direct applications are: " + applications); } return findMatchingTypeQualifierAnnotation(applications, typeQualifierValue); }
java
public static @CheckForNull @CheckReturnValue TypeQualifierAnnotation getDirectTypeQualifierAnnotation(XMethod xmethod, int parameter, TypeQualifierValue<?> typeQualifierValue) { XMethod bridge = xmethod.bridgeTo(); if (bridge != null) { xmethod = bridge; } Set<TypeQualifierAnnotation> applications = new HashSet<>(); getDirectApplications(applications, xmethod, parameter); if (DEBUG_METHOD != null && DEBUG_METHOD.equals(xmethod.getName())) { System.out.println(" Direct applications are: " + applications); } return findMatchingTypeQualifierAnnotation(applications, typeQualifierValue); }
[ "public", "static", "@", "CheckForNull", "@", "CheckReturnValue", "TypeQualifierAnnotation", "getDirectTypeQualifierAnnotation", "(", "XMethod", "xmethod", ",", "int", "parameter", ",", "TypeQualifierValue", "<", "?", ">", "typeQualifierValue", ")", "{", "XMethod", "bri...
Get the TypeQualifierAnnotation directly applied to given method parameter. @param xmethod a method @param parameter a parameter (0 == first parameter) @param typeQualifierValue the kind of TypeQualifierValue we are looking for @return TypeQualifierAnnotation directly applied to the parameter, or null if there is no directly applied TypeQualifierAnnotation
[ "Get", "the", "TypeQualifierAnnotation", "directly", "applied", "to", "given", "method", "parameter", "." ]
train
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/jsr305/TypeQualifierApplications.java#L924-L937
Azure/azure-sdk-for-java
cognitiveservices/data-plane/vision/faceapi/src/main/java/com/microsoft/azure/cognitiveservices/vision/faceapi/FaceAPIManager.java
FaceAPIManager.authenticate
public static FaceAPI authenticate(AzureRegions region, String subscriptionKey) { return authenticate("https://{AzureRegion}.api.cognitive.microsoft.com/face/v1.0/", subscriptionKey) .withAzureRegion(region); }
java
public static FaceAPI authenticate(AzureRegions region, String subscriptionKey) { return authenticate("https://{AzureRegion}.api.cognitive.microsoft.com/face/v1.0/", subscriptionKey) .withAzureRegion(region); }
[ "public", "static", "FaceAPI", "authenticate", "(", "AzureRegions", "region", ",", "String", "subscriptionKey", ")", "{", "return", "authenticate", "(", "\"https://{AzureRegion}.api.cognitive.microsoft.com/face/v1.0/\"", ",", "subscriptionKey", ")", ".", "withAzureRegion", ...
Initializes an instance of Face API client. @param region Supported Azure regions for Cognitive Services endpoints. @param subscriptionKey the Face API key @return the Face API client
[ "Initializes", "an", "instance", "of", "Face", "API", "client", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/faceapi/src/main/java/com/microsoft/azure/cognitiveservices/vision/faceapi/FaceAPIManager.java#L31-L34
imsweb/naaccr-xml
src/main/java/com/imsweb/naaccrxml/runtime/NaaccrStreamConfiguration.java
NaaccrStreamConfiguration.registerImplicitCollection
public void registerImplicitCollection(Class<?> clazz, String fieldName, Class<?> fieldClass) { _xstream.addImplicitCollection(clazz, fieldName, fieldClass); }
java
public void registerImplicitCollection(Class<?> clazz, String fieldName, Class<?> fieldClass) { _xstream.addImplicitCollection(clazz, fieldName, fieldClass); }
[ "public", "void", "registerImplicitCollection", "(", "Class", "<", "?", ">", "clazz", ",", "String", "fieldName", ",", "Class", "<", "?", ">", "fieldClass", ")", "{", "_xstream", ".", "addImplicitCollection", "(", "clazz", ",", "fieldName", ",", "fieldClass", ...
Register an implicit collection (a collection that shouldn't appear as a tag in the XML). @param clazz class containing the field (the collection in this case), required @param fieldName field name, required @param fieldClass field type, required
[ "Register", "an", "implicit", "collection", "(", "a", "collection", "that", "shouldn", "t", "appear", "as", "a", "tag", "in", "the", "XML", ")", "." ]
train
https://github.com/imsweb/naaccr-xml/blob/a3a501faa2a0c3411dd5248b2c1379f279131696/src/main/java/com/imsweb/naaccrxml/runtime/NaaccrStreamConfiguration.java#L301-L303
qmx/jitescript
src/main/java/me/qmx/jitescript/JiteClass.java
JiteClass.defineField
public FieldDefinition defineField(String fieldName, int modifiers, String signature, Object value) { FieldDefinition field = new FieldDefinition(fieldName, modifiers, signature, value); this.fields.add(field); return field; }
java
public FieldDefinition defineField(String fieldName, int modifiers, String signature, Object value) { FieldDefinition field = new FieldDefinition(fieldName, modifiers, signature, value); this.fields.add(field); return field; }
[ "public", "FieldDefinition", "defineField", "(", "String", "fieldName", ",", "int", "modifiers", ",", "String", "signature", ",", "Object", "value", ")", "{", "FieldDefinition", "field", "=", "new", "FieldDefinition", "(", "fieldName", ",", "modifiers", ",", "si...
Defines a new field on the target class @param fieldName the field name @param modifiers the modifier bitmask, made by OR'ing constants from ASM's {@link Opcodes} interface @param signature the field signature, on standard JVM notation @param value the default value (null for JVM default) @return the new field definition for further modification
[ "Defines", "a", "new", "field", "on", "the", "target", "class" ]
train
https://github.com/qmx/jitescript/blob/bda6d02f37a8083248d9a0c80ea76bb5a63151ae/src/main/java/me/qmx/jitescript/JiteClass.java#L155-L159
roboconf/roboconf-platform
miscellaneous/roboconf-dm-rest-client/src/main/java/net/roboconf/dm/rest/client/delegates/ApplicationWsDelegate.java
ApplicationWsDelegate.setDescription
public void setDescription( String applicationName, String newDesc ) throws ApplicationWsException { this.logger.finer( "Updating the description of application " + applicationName + "." ); WebResource path = this.resource.path( UrlConstants.APP ).path( applicationName ).path( "description" ); ClientResponse response = this.wsClient.createBuilder( path ) .accept( MediaType.TEXT_PLAIN ) .post( ClientResponse.class, newDesc ); handleResponse( response ); this.logger.finer( String.valueOf( response.getStatusInfo())); }
java
public void setDescription( String applicationName, String newDesc ) throws ApplicationWsException { this.logger.finer( "Updating the description of application " + applicationName + "." ); WebResource path = this.resource.path( UrlConstants.APP ).path( applicationName ).path( "description" ); ClientResponse response = this.wsClient.createBuilder( path ) .accept( MediaType.TEXT_PLAIN ) .post( ClientResponse.class, newDesc ); handleResponse( response ); this.logger.finer( String.valueOf( response.getStatusInfo())); }
[ "public", "void", "setDescription", "(", "String", "applicationName", ",", "String", "newDesc", ")", "throws", "ApplicationWsException", "{", "this", ".", "logger", ".", "finer", "(", "\"Updating the description of application \"", "+", "applicationName", "+", "\".\"", ...
Changes the description of an application. @param applicationName the application name @param newDesc the new description to set @throws ApplicationWsException if something went wrong
[ "Changes", "the", "description", "of", "an", "application", "." ]
train
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/miscellaneous/roboconf-dm-rest-client/src/main/java/net/roboconf/dm/rest/client/delegates/ApplicationWsDelegate.java#L108-L120
geomajas/geomajas-project-client-gwt
client/src/main/java/org/geomajas/gwt/client/map/layer/AbstractLayer.java
AbstractLayer.updateShowing
protected void updateShowing(boolean fireEvents) { double scale = mapModel.getMapView().getCurrentScale(); if (visible) { boolean oldShowing = showing; showing = scale >= layerInfo.getMinimumScale().getPixelPerUnit() && scale <= layerInfo.getMaximumScale().getPixelPerUnit(); if (oldShowing != showing && fireEvents) { handlerManager.fireEvent(new LayerShownEvent(this, true)); } } else { showing = false; } }
java
protected void updateShowing(boolean fireEvents) { double scale = mapModel.getMapView().getCurrentScale(); if (visible) { boolean oldShowing = showing; showing = scale >= layerInfo.getMinimumScale().getPixelPerUnit() && scale <= layerInfo.getMaximumScale().getPixelPerUnit(); if (oldShowing != showing && fireEvents) { handlerManager.fireEvent(new LayerShownEvent(this, true)); } } else { showing = false; } }
[ "protected", "void", "updateShowing", "(", "boolean", "fireEvents", ")", "{", "double", "scale", "=", "mapModel", ".", "getMapView", "(", ")", ".", "getCurrentScale", "(", ")", ";", "if", "(", "visible", ")", "{", "boolean", "oldShowing", "=", "showing", "...
Update showing state. @param fireEvents Should events be fired if state changes?
[ "Update", "showing", "state", "." ]
train
https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/map/layer/AbstractLayer.java#L130-L142
alkacon/opencms-core
src-gwt/org/opencms/ade/galleries/client/CmsGalleryControllerHandler.java
CmsGalleryControllerHandler.onUpdateCategoriesList
public void onUpdateCategoriesList(List<CmsCategoryBean> categoriesList, List<String> selectedCategories) { m_galleryDialog.getCategoriesTab().updateContentList(categoriesList, selectedCategories); }
java
public void onUpdateCategoriesList(List<CmsCategoryBean> categoriesList, List<String> selectedCategories) { m_galleryDialog.getCategoriesTab().updateContentList(categoriesList, selectedCategories); }
[ "public", "void", "onUpdateCategoriesList", "(", "List", "<", "CmsCategoryBean", ">", "categoriesList", ",", "List", "<", "String", ">", "selectedCategories", ")", "{", "m_galleryDialog", ".", "getCategoriesTab", "(", ")", ".", "updateContentList", "(", "categoriesL...
Will be triggered when categories list is sorted.<p> @param categoriesList the updated categories list @param selectedCategories the selected categories
[ "Will", "be", "triggered", "when", "categories", "list", "is", "sorted", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/galleries/client/CmsGalleryControllerHandler.java#L363-L366
Azure/azure-sdk-for-java
sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/FailoverGroupsInner.java
FailoverGroupsInner.failoverAsync
public Observable<FailoverGroupInner> failoverAsync(String resourceGroupName, String serverName, String failoverGroupName) { return failoverWithServiceResponseAsync(resourceGroupName, serverName, failoverGroupName).map(new Func1<ServiceResponse<FailoverGroupInner>, FailoverGroupInner>() { @Override public FailoverGroupInner call(ServiceResponse<FailoverGroupInner> response) { return response.body(); } }); }
java
public Observable<FailoverGroupInner> failoverAsync(String resourceGroupName, String serverName, String failoverGroupName) { return failoverWithServiceResponseAsync(resourceGroupName, serverName, failoverGroupName).map(new Func1<ServiceResponse<FailoverGroupInner>, FailoverGroupInner>() { @Override public FailoverGroupInner call(ServiceResponse<FailoverGroupInner> response) { return response.body(); } }); }
[ "public", "Observable", "<", "FailoverGroupInner", ">", "failoverAsync", "(", "String", "resourceGroupName", ",", "String", "serverName", ",", "String", "failoverGroupName", ")", "{", "return", "failoverWithServiceResponseAsync", "(", "resourceGroupName", ",", "serverName...
Fails over from the current primary server to this server. @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. @param serverName The name of the server containing the failover group. @param failoverGroupName The name of the failover group. @throws IllegalArgumentException thrown if parameters fail the validation @return the observable for the request
[ "Fails", "over", "from", "the", "current", "primary", "server", "to", "this", "server", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/FailoverGroupsInner.java#L917-L924
DV8FromTheWorld/JDA
src/main/java/net/dv8tion/jda/core/entities/Game.java
Game.playing
public static Game playing(String name) { Checks.notBlank(name, "Name"); return new Game(name, null, GameType.DEFAULT); }
java
public static Game playing(String name) { Checks.notBlank(name, "Name"); return new Game(name, null, GameType.DEFAULT); }
[ "public", "static", "Game", "playing", "(", "String", "name", ")", "{", "Checks", ".", "notBlank", "(", "name", ",", "\"Name\"", ")", ";", "return", "new", "Game", "(", "name", ",", "null", ",", "GameType", ".", "DEFAULT", ")", ";", "}" ]
Creates a new Game instance with the specified name. <br>In order to appear as "streaming" in the official client you must provide a valid (see documentation of method) streaming URL in {@link #streaming(String, String) Game.streaming(String, String)}. @param name The not-null name of the newly created game @throws IllegalArgumentException if the specified name is null, empty or blank @return A valid Game instance with the provided name with {@link GameType#DEFAULT}
[ "Creates", "a", "new", "Game", "instance", "with", "the", "specified", "name", ".", "<br", ">", "In", "order", "to", "appear", "as", "streaming", "in", "the", "official", "client", "you", "must", "provide", "a", "valid", "(", "see", "documentation", "of", ...
train
https://github.com/DV8FromTheWorld/JDA/blob/8ecbbe354d03f6bf448411bba573d0d4c268b560/src/main/java/net/dv8tion/jda/core/entities/Game.java#L168-L172
igniterealtime/Smack
smack-omemo/src/main/java/org/jivesoftware/smackx/omemo/OmemoManager.java
OmemoManager.isDecidedOmemoIdentity
public boolean isDecidedOmemoIdentity(OmemoDevice device, OmemoFingerprint fingerprint) { if (trustCallback == null) { throw new IllegalStateException("No TrustCallback set."); } return trustCallback.getTrust(device, fingerprint) != TrustState.undecided; }
java
public boolean isDecidedOmemoIdentity(OmemoDevice device, OmemoFingerprint fingerprint) { if (trustCallback == null) { throw new IllegalStateException("No TrustCallback set."); } return trustCallback.getTrust(device, fingerprint) != TrustState.undecided; }
[ "public", "boolean", "isDecidedOmemoIdentity", "(", "OmemoDevice", "device", ",", "OmemoFingerprint", "fingerprint", ")", "{", "if", "(", "trustCallback", "==", "null", ")", "{", "throw", "new", "IllegalStateException", "(", "\"No TrustCallback set.\"", ")", ";", "}...
Returns true, if the fingerprint/OmemoDevice tuple is decided by the user. The fingerprint must be the lowercase, hexadecimal fingerprint of the identityKey of the device and must be of length 64. @param device device @param fingerprint fingerprint @return
[ "Returns", "true", "if", "the", "fingerprint", "/", "OmemoDevice", "tuple", "is", "decided", "by", "the", "user", ".", "The", "fingerprint", "must", "be", "the", "lowercase", "hexadecimal", "fingerprint", "of", "the", "identityKey", "of", "the", "device", "and...
train
https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-omemo/src/main/java/org/jivesoftware/smackx/omemo/OmemoManager.java#L467-L473
Azure/azure-sdk-for-java
recoveryservices.backup/resource-manager/v2016_12_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_12_01/implementation/ProtectedItemsInner.java
ProtectedItemsInner.createOrUpdate
public void createOrUpdate(String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName, ProtectedItemResourceInner parameters) { createOrUpdateWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, parameters).toBlocking().single().body(); }
java
public void createOrUpdate(String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName, ProtectedItemResourceInner parameters) { createOrUpdateWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, parameters).toBlocking().single().body(); }
[ "public", "void", "createOrUpdate", "(", "String", "vaultName", ",", "String", "resourceGroupName", ",", "String", "fabricName", ",", "String", "containerName", ",", "String", "protectedItemName", ",", "ProtectedItemResourceInner", "parameters", ")", "{", "createOrUpdat...
Enables backup of an item or to modifies the backup policy information of an already backed up item. This is an asynchronous operation. To know the status of the operation, call the GetItemOperationResult API. @param vaultName The name of the recovery services vault. @param resourceGroupName The name of the resource group where the recovery services vault is present. @param fabricName Fabric name associated with the backup item. @param containerName Container name associated with the backup item. @param protectedItemName Item name to be backed up. @param parameters resource backed up item @throws IllegalArgumentException thrown if parameters fail the validation @throws CloudException thrown if the request is rejected by server @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
[ "Enables", "backup", "of", "an", "item", "or", "to", "modifies", "the", "backup", "policy", "information", "of", "an", "already", "backed", "up", "item", ".", "This", "is", "an", "asynchronous", "operation", ".", "To", "know", "the", "status", "of", "the",...
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/recoveryservices.backup/resource-manager/v2016_12_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_12_01/implementation/ProtectedItemsInner.java#L297-L299
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiBookmark.java
BoxApiBookmark.getAddToCollectionRequest
public BoxRequestsBookmark.AddBookmarkToCollection getAddToCollectionRequest(String bookmarkId, String collectionId) { BoxRequestsBookmark.AddBookmarkToCollection request = new BoxRequestsBookmark.AddBookmarkToCollection(bookmarkId, collectionId, getBookmarkInfoUrl(bookmarkId), mSession); return request; }
java
public BoxRequestsBookmark.AddBookmarkToCollection getAddToCollectionRequest(String bookmarkId, String collectionId) { BoxRequestsBookmark.AddBookmarkToCollection request = new BoxRequestsBookmark.AddBookmarkToCollection(bookmarkId, collectionId, getBookmarkInfoUrl(bookmarkId), mSession); return request; }
[ "public", "BoxRequestsBookmark", ".", "AddBookmarkToCollection", "getAddToCollectionRequest", "(", "String", "bookmarkId", ",", "String", "collectionId", ")", "{", "BoxRequestsBookmark", ".", "AddBookmarkToCollection", "request", "=", "new", "BoxRequestsBookmark", ".", "Add...
Gets a request that adds a bookmark to a collection @param bookmarkId id of bookmark to add to collection @param collectionId id of collection to add the bookmark to @return request to add a bookmark to a collection
[ "Gets", "a", "request", "that", "adds", "a", "bookmark", "to", "a", "collection" ]
train
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiBookmark.java#L237-L240
Jasig/spring-portlet-contrib
spring-security-portlet-contrib/src/main/java/org/jasig/springframework/security/portlet/authentication/PortletAuthenticationProcessingFilter.java
PortletAuthenticationProcessingFilter.successfulAuthentication
protected void successfulAuthentication(PortletRequest request, PortletResponse response, Authentication authResult) { if (logger.isDebugEnabled()) { logger.debug("Authentication success: " + authResult); } SecurityContextHolder.getContext().setAuthentication(authResult); // Fire event if (this.eventPublisher != null) { eventPublisher.publishEvent(new InteractiveAuthenticationSuccessEvent(authResult, this.getClass())); } }
java
protected void successfulAuthentication(PortletRequest request, PortletResponse response, Authentication authResult) { if (logger.isDebugEnabled()) { logger.debug("Authentication success: " + authResult); } SecurityContextHolder.getContext().setAuthentication(authResult); // Fire event if (this.eventPublisher != null) { eventPublisher.publishEvent(new InteractiveAuthenticationSuccessEvent(authResult, this.getClass())); } }
[ "protected", "void", "successfulAuthentication", "(", "PortletRequest", "request", ",", "PortletResponse", "response", ",", "Authentication", "authResult", ")", "{", "if", "(", "logger", ".", "isDebugEnabled", "(", ")", ")", "{", "logger", ".", "debug", "(", "\"...
Puts the Authentication instance returned by the authentication manager into the secure context. @param request a {@link javax.portlet.PortletRequest} object. @param response a {@link javax.portlet.PortletResponse} object. @param authResult a {@link org.springframework.security.core.Authentication} object.
[ "Puts", "the", "Authentication", "instance", "returned", "by", "the", "authentication", "manager", "into", "the", "secure", "context", "." ]
train
https://github.com/Jasig/spring-portlet-contrib/blob/719240fa268ddc69900ce9775d9cad3b9c543c6b/spring-security-portlet-contrib/src/main/java/org/jasig/springframework/security/portlet/authentication/PortletAuthenticationProcessingFilter.java#L214-L224
OmarAflak/Fingerprint
fingerprint/src/main/java/me/aflak/libraries/dialog/FingerprintDialog.java
FingerprintDialog.tryLimit
public FingerprintDialog tryLimit(int limit, final FailAuthCounterDialogCallback counterCallback){ this.fingerprint.tryLimit(limit, new FailAuthCounterCallback() { @Override public void onTryLimitReached(Fingerprint fingerprint) { counterCallback.onTryLimitReached(FingerprintDialog.this); } }); return this; }
java
public FingerprintDialog tryLimit(int limit, final FailAuthCounterDialogCallback counterCallback){ this.fingerprint.tryLimit(limit, new FailAuthCounterCallback() { @Override public void onTryLimitReached(Fingerprint fingerprint) { counterCallback.onTryLimitReached(FingerprintDialog.this); } }); return this; }
[ "public", "FingerprintDialog", "tryLimit", "(", "int", "limit", ",", "final", "FailAuthCounterDialogCallback", "counterCallback", ")", "{", "this", ".", "fingerprint", ".", "tryLimit", "(", "limit", ",", "new", "FailAuthCounterCallback", "(", ")", "{", "@", "Overr...
Set a fail limit. Android blocks automatically when 5 attempts failed. @param limit number of tries @param counterCallback callback to be triggered when limit is reached @return FingerprintDialog object
[ "Set", "a", "fail", "limit", ".", "Android", "blocks", "automatically", "when", "5", "attempts", "failed", "." ]
train
https://github.com/OmarAflak/Fingerprint/blob/4a4cd4a8f092a126f4204eea087d845360342a62/fingerprint/src/main/java/me/aflak/libraries/dialog/FingerprintDialog.java#L236-L244
threerings/nenya
core/src/main/java/com/threerings/media/tile/TrimmedObjectTileSet.java
TrimmedObjectTileSet.hasConstraint
public boolean hasConstraint (int tileIdx, String constraint) { return (_bits == null || _bits[tileIdx].constraints == null) ? false : ListUtil.contains(_bits[tileIdx].constraints, constraint); }
java
public boolean hasConstraint (int tileIdx, String constraint) { return (_bits == null || _bits[tileIdx].constraints == null) ? false : ListUtil.contains(_bits[tileIdx].constraints, constraint); }
[ "public", "boolean", "hasConstraint", "(", "int", "tileIdx", ",", "String", "constraint", ")", "{", "return", "(", "_bits", "==", "null", "||", "_bits", "[", "tileIdx", "]", ".", "constraints", "==", "null", ")", "?", "false", ":", "ListUtil", ".", "cont...
Checks whether the tile at the specified index has the given constraint.
[ "Checks", "whether", "the", "tile", "at", "the", "specified", "index", "has", "the", "given", "constraint", "." ]
train
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/tile/TrimmedObjectTileSet.java#L96-L100
js-lib-com/template.xhtml
src/main/java/js/template/xhtml/XhtmlTemplate.java
XhtmlTemplate._serialize
private void _serialize(Writer writer, Object model) throws IOException { if(model == null) { document.serialize(writer); return; } Serializer serializer = new Serializer(); if(serializeOperators) { serializer.enableOperatorsSerialization(); } Content content = model instanceof Content ? (Content)model : new Content(model); serializer.setContent(content); serializer.setWriter(writer); if(serializeProlog) { if(document.isXML()) { serializer.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n"); } else { // if is not XML document should be HTML5 serializer.write("<!DOCTYPE HTML>\r\n"); } } if(document.getRoot() != null) { serializer.write(document.getRoot(), content.getModel()); } serializer.flush(); }
java
private void _serialize(Writer writer, Object model) throws IOException { if(model == null) { document.serialize(writer); return; } Serializer serializer = new Serializer(); if(serializeOperators) { serializer.enableOperatorsSerialization(); } Content content = model instanceof Content ? (Content)model : new Content(model); serializer.setContent(content); serializer.setWriter(writer); if(serializeProlog) { if(document.isXML()) { serializer.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n"); } else { // if is not XML document should be HTML5 serializer.write("<!DOCTYPE HTML>\r\n"); } } if(document.getRoot() != null) { serializer.write(document.getRoot(), content.getModel()); } serializer.flush(); }
[ "private", "void", "_serialize", "(", "Writer", "writer", ",", "Object", "model", ")", "throws", "IOException", "{", "if", "(", "model", "==", "null", ")", "{", "document", ".", "serialize", "(", "writer", ")", ";", "return", ";", "}", "Serializer", "ser...
Serialize template with given domain model to a writer. Walk through template document from its root and serialize every node; if node contains operators execute them. Operators extract values from given domain model and process them, result going to the same writer. <p> Writer parameter does not need to be {@link BufferedWriter}, but is acceptable. This interface implementation takes care to initialize the writer accordingly. Given domain model can be an instance of {@link Content} or any POJO containing values needed by template operators. <p> If any argument is null or writer is already closed this method behavior is not defined. <p> This method creates and instance of {@link Serializer} then delegates {@link Serializer#write(js.dom.Element, Object)} for actual work. @param model domain model object to inject into template, @param writer writer to serialize template to.
[ "Serialize", "template", "with", "given", "domain", "model", "to", "a", "writer", ".", "Walk", "through", "template", "document", "from", "its", "root", "and", "serialize", "every", "node", ";", "if", "node", "contains", "operators", "execute", "them", ".", ...
train
https://github.com/js-lib-com/template.xhtml/blob/d50cec08aca9ab9680baebe2a26a341c096564fb/src/main/java/js/template/xhtml/XhtmlTemplate.java#L138-L167
apache/incubator-gobblin
gobblin-data-management/src/main/java/org/apache/gobblin/data/management/trash/TrashFactory.java
TrashFactory.createTrash
public static Trash createTrash(FileSystem fs, Properties props, String user) throws IOException { if(props.containsKey(TRASH_TEST) && Boolean.parseBoolean(props.getProperty(TRASH_TEST))) { LOG.info("Creating a test trash. Nothing will actually be deleted."); return new TestTrash(fs, props, user); } if(props.containsKey(SIMULATE) && Boolean.parseBoolean(props.getProperty(SIMULATE))) { LOG.info("Creating a simulate trash. Nothing will actually be deleted."); return new MockTrash(fs, props, user); } if(props.containsKey(SKIP_TRASH) && Boolean.parseBoolean(props.getProperty(SKIP_TRASH))) { LOG.info("Creating an immediate deletion trash. Files will be deleted immediately instead of moved to trash."); return new ImmediateDeletionTrash(fs, props, user); } return new Trash(fs, props, user); }
java
public static Trash createTrash(FileSystem fs, Properties props, String user) throws IOException { if(props.containsKey(TRASH_TEST) && Boolean.parseBoolean(props.getProperty(TRASH_TEST))) { LOG.info("Creating a test trash. Nothing will actually be deleted."); return new TestTrash(fs, props, user); } if(props.containsKey(SIMULATE) && Boolean.parseBoolean(props.getProperty(SIMULATE))) { LOG.info("Creating a simulate trash. Nothing will actually be deleted."); return new MockTrash(fs, props, user); } if(props.containsKey(SKIP_TRASH) && Boolean.parseBoolean(props.getProperty(SKIP_TRASH))) { LOG.info("Creating an immediate deletion trash. Files will be deleted immediately instead of moved to trash."); return new ImmediateDeletionTrash(fs, props, user); } return new Trash(fs, props, user); }
[ "public", "static", "Trash", "createTrash", "(", "FileSystem", "fs", ",", "Properties", "props", ",", "String", "user", ")", "throws", "IOException", "{", "if", "(", "props", ".", "containsKey", "(", "TRASH_TEST", ")", "&&", "Boolean", ".", "parseBoolean", "...
Creates a {@link org.apache.gobblin.data.management.trash.Trash} instance. @param fs {@link org.apache.hadoop.fs.FileSystem} where trash is located. @param props {@link java.util.Properties} used to generate trash. @param user $USER tokens in the trash path will be replaced by this string. @return instance of {@link org.apache.gobblin.data.management.trash.Trash}. @throws IOException
[ "Creates", "a", "{" ]
train
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-data-management/src/main/java/org/apache/gobblin/data/management/trash/TrashFactory.java#L60-L75
NordicSemiconductor/Android-DFU-Library
dfu/src/main/java/no/nordicsemi/android/dfu/DfuBaseService.java
DfuBaseService.report
private void report(final int error) { sendErrorBroadcast(error); if (mDisableNotification) return; // create or update notification: final String deviceAddress = mDeviceAddress; final String deviceName = mDeviceName != null ? mDeviceName : getString(R.string.dfu_unknown_name); final NotificationCompat.Builder builder = new NotificationCompat.Builder(this, NOTIFICATION_CHANNEL_DFU) .setSmallIcon(android.R.drawable.stat_sys_upload) .setOnlyAlertOnce(true) .setColor(Color.RED) .setOngoing(false) .setContentTitle(getString(R.string.dfu_status_error)) .setSmallIcon(android.R.drawable.stat_sys_upload_done) .setContentText(getString(R.string.dfu_status_error_msg)) .setAutoCancel(true); // update the notification final Intent intent = new Intent(this, getNotificationTarget()); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); intent.putExtra(EXTRA_DEVICE_ADDRESS, deviceAddress); intent.putExtra(EXTRA_DEVICE_NAME, deviceName); intent.putExtra(EXTRA_PROGRESS, error); // this may contains ERROR_CONNECTION_MASK bit! final PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT); builder.setContentIntent(pendingIntent); // Any additional configuration? updateErrorNotification(builder); final NotificationManager manager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); manager.notify(NOTIFICATION_ID, builder.build()); }
java
private void report(final int error) { sendErrorBroadcast(error); if (mDisableNotification) return; // create or update notification: final String deviceAddress = mDeviceAddress; final String deviceName = mDeviceName != null ? mDeviceName : getString(R.string.dfu_unknown_name); final NotificationCompat.Builder builder = new NotificationCompat.Builder(this, NOTIFICATION_CHANNEL_DFU) .setSmallIcon(android.R.drawable.stat_sys_upload) .setOnlyAlertOnce(true) .setColor(Color.RED) .setOngoing(false) .setContentTitle(getString(R.string.dfu_status_error)) .setSmallIcon(android.R.drawable.stat_sys_upload_done) .setContentText(getString(R.string.dfu_status_error_msg)) .setAutoCancel(true); // update the notification final Intent intent = new Intent(this, getNotificationTarget()); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); intent.putExtra(EXTRA_DEVICE_ADDRESS, deviceAddress); intent.putExtra(EXTRA_DEVICE_NAME, deviceName); intent.putExtra(EXTRA_PROGRESS, error); // this may contains ERROR_CONNECTION_MASK bit! final PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT); builder.setContentIntent(pendingIntent); // Any additional configuration? updateErrorNotification(builder); final NotificationManager manager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); manager.notify(NOTIFICATION_ID, builder.build()); }
[ "private", "void", "report", "(", "final", "int", "error", ")", "{", "sendErrorBroadcast", "(", "error", ")", ";", "if", "(", "mDisableNotification", ")", "return", ";", "// create or update notification:", "final", "String", "deviceAddress", "=", "mDeviceAddress", ...
Creates or updates the notification in the Notification Manager. Sends broadcast with given error number to the activity. @param error the error number.
[ "Creates", "or", "updates", "the", "notification", "in", "the", "Notification", "Manager", ".", "Sends", "broadcast", "with", "given", "error", "number", "to", "the", "activity", "." ]
train
https://github.com/NordicSemiconductor/Android-DFU-Library/blob/ec14c8c522bebe801a9a4c3dfbbeb1f53262c03f/dfu/src/main/java/no/nordicsemi/android/dfu/DfuBaseService.java#L1741-L1775
VoltDB/voltdb
src/frontend/org/voltdb/jdbc/JDBC4PreparedStatement.java
JDBC4PreparedStatement.setRowId
@Override public void setRowId(int parameterIndex, RowId x) throws SQLException { checkParameterBounds(parameterIndex); throw SQLError.noSupport(); }
java
@Override public void setRowId(int parameterIndex, RowId x) throws SQLException { checkParameterBounds(parameterIndex); throw SQLError.noSupport(); }
[ "@", "Override", "public", "void", "setRowId", "(", "int", "parameterIndex", ",", "RowId", "x", ")", "throws", "SQLException", "{", "checkParameterBounds", "(", "parameterIndex", ")", ";", "throw", "SQLError", ".", "noSupport", "(", ")", ";", "}" ]
Sets the designated parameter to the given java.sql.RowId object.
[ "Sets", "the", "designated", "parameter", "to", "the", "given", "java", ".", "sql", ".", "RowId", "object", "." ]
train
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/jdbc/JDBC4PreparedStatement.java#L526-L531
sailthru/sailthru-java-client
src/main/com/sailthru/client/params/Content.java
Content.setImages
public Content setImages(Map<String, Map<String, String>> images) { this.images = images; return this; }
java
public Content setImages(Map<String, Map<String, String>> images) { this.images = images; return this; }
[ "public", "Content", "setImages", "(", "Map", "<", "String", ",", "Map", "<", "String", ",", "String", ">", ">", "images", ")", "{", "this", ".", "images", "=", "images", ";", "return", "this", ";", "}" ]
/* A map of image names to { “url” : <url> } image maps. Use the name “full” to denote the full-sized image, and “thumb” to denote the thumbnail-sized image. Other image names are not reserved. Or use setFullImage and setThumbImage to set them separately.
[ "/", "*", "A", "map", "of", "image", "names", "to", "{", "“url”", ":", "<url", ">", "}", "image", "maps", ".", "Use", "the", "name", "“full”", "to", "denote", "the", "full", "-", "sized", "image", "and", "“thumb”", "to", "denote", "the", "thumbnail",...
train
https://github.com/sailthru/sailthru-java-client/blob/62b491f6a39b41b836bfc021779200d29b6d2069/src/main/com/sailthru/client/params/Content.java#L109-L112
aws/aws-sdk-java
aws-java-sdk-api-gateway/src/main/java/com/amazonaws/services/apigateway/model/Stage.java
Stage.withMethodSettings
public Stage withMethodSettings(java.util.Map<String, MethodSetting> methodSettings) { setMethodSettings(methodSettings); return this; }
java
public Stage withMethodSettings(java.util.Map<String, MethodSetting> methodSettings) { setMethodSettings(methodSettings); return this; }
[ "public", "Stage", "withMethodSettings", "(", "java", ".", "util", ".", "Map", "<", "String", ",", "MethodSetting", ">", "methodSettings", ")", "{", "setMethodSettings", "(", "methodSettings", ")", ";", "return", "this", ";", "}" ]
<p> A map that defines the method settings for a <a>Stage</a> resource. Keys (designated as <code>/{method_setting_key</code> below) are method paths defined as <code>{resource_path}/{http_method}</code> for an individual method override, or <code>/\*&#47;\*</code> for overriding all methods in the stage. </p> @param methodSettings A map that defines the method settings for a <a>Stage</a> resource. Keys (designated as <code>/{method_setting_key</code> below) are method paths defined as <code>{resource_path}/{http_method}</code> for an individual method override, or <code>/\*&#47;\*</code> for overriding all methods in the stage. @return Returns a reference to this object so that method calls can be chained together.
[ "<p", ">", "A", "map", "that", "defines", "the", "method", "settings", "for", "a", "<a", ">", "Stage<", "/", "a", ">", "resource", ".", "Keys", "(", "designated", "as", "<code", ">", "/", "{", "method_setting_key<", "/", "code", ">", "below", ")", "a...
train
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-api-gateway/src/main/java/com/amazonaws/services/apigateway/model/Stage.java#L518-L521
sai-pullabhotla/catatumbo
src/main/java/com/jmethods/catatumbo/impl/Marshaller.java
Marshaller.isValidId
private static boolean isValidId(Object idValue, DataType identifierType) { boolean validId = false; if (idValue != null) { switch (identifierType) { case LONG: case LONG_OBJECT: validId = (long) idValue != 0; break; case STRING: validId = ((String) idValue).trim().length() > 0; break; default: // we should never get here break; } } return validId; }
java
private static boolean isValidId(Object idValue, DataType identifierType) { boolean validId = false; if (idValue != null) { switch (identifierType) { case LONG: case LONG_OBJECT: validId = (long) idValue != 0; break; case STRING: validId = ((String) idValue).trim().length() > 0; break; default: // we should never get here break; } } return validId; }
[ "private", "static", "boolean", "isValidId", "(", "Object", "idValue", ",", "DataType", "identifierType", ")", "{", "boolean", "validId", "=", "false", ";", "if", "(", "idValue", "!=", "null", ")", "{", "switch", "(", "identifierType", ")", "{", "case", "L...
Checks to see if the given value is a valid identifier for the given ID type. @param idValue the ID value @param identifierType the identifier type @return <code>true</code>, if the given value is a valid identifier; <code>false</code>, otherwise. For STRING type, the ID is valid if it it contains at least one printable character. In other words, if ((String) idValue).trim().length() > 0. For numeric types, the ID is valid if it is not <code>null</code> or zero.
[ "Checks", "to", "see", "if", "the", "given", "value", "is", "a", "valid", "identifier", "for", "the", "given", "ID", "type", "." ]
train
https://github.com/sai-pullabhotla/catatumbo/blob/96d4c6dce3a5009624f7112a398406914dd19165/src/main/java/com/jmethods/catatumbo/impl/Marshaller.java#L322-L339
jferard/fastods
fastods/src/main/java/com/github/jferard/fastods/ParagraphBuilder.java
ParagraphBuilder.styledLink
public ParagraphBuilder styledLink(final String text, final TextStyle ts, final URL url) { final ParagraphElement paragraphElement = Link.create(text, ts, url); this.paragraphElements.add(paragraphElement); return this; }
java
public ParagraphBuilder styledLink(final String text, final TextStyle ts, final URL url) { final ParagraphElement paragraphElement = Link.create(text, ts, url); this.paragraphElements.add(paragraphElement); return this; }
[ "public", "ParagraphBuilder", "styledLink", "(", "final", "String", "text", ",", "final", "TextStyle", "ts", ",", "final", "URL", "url", ")", "{", "final", "ParagraphElement", "paragraphElement", "=", "Link", ".", "create", "(", "text", ",", "ts", ",", "url"...
Create a styled link in the current paragraph. @param text the text @param ts the style @param url the destination @return this for fluent style
[ "Create", "a", "styled", "link", "in", "the", "current", "paragraph", "." ]
train
https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/ParagraphBuilder.java#L161-L165
fuinorg/utils4j
src/main/java/org/fuin/utils4j/PropertiesUtils.java
PropertiesUtils.loadProperties
public static Properties loadProperties(final URL baseUrl, final String filename) { return loadProperties(createUrl(baseUrl, "", filename)); }
java
public static Properties loadProperties(final URL baseUrl, final String filename) { return loadProperties(createUrl(baseUrl, "", filename)); }
[ "public", "static", "Properties", "loadProperties", "(", "final", "URL", "baseUrl", ",", "final", "String", "filename", ")", "{", "return", "loadProperties", "(", "createUrl", "(", "baseUrl", ",", "\"\"", ",", "filename", ")", ")", ";", "}" ]
Load a file from an directory. @param baseUrl Directory URL - Cannot be <code>null</code>. @param filename Filename without path - Cannot be <code>null</code>. @return Properties.
[ "Load", "a", "file", "from", "an", "directory", "." ]
train
https://github.com/fuinorg/utils4j/blob/71cf88e0a8d8ed67bbac513bf3cab165cd7e3280/src/main/java/org/fuin/utils4j/PropertiesUtils.java#L147-L149
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/transformer/TransformerImpl.java
TransformerImpl.replaceOrPushUserParam
private void replaceOrPushUserParam(QName qname, XObject xval) { int n = m_userParams.size(); for (int i = n - 1; i >= 0; i--) { Arg arg = (Arg) m_userParams.elementAt(i); if (arg.getQName().equals(qname)) { m_userParams.setElementAt(new Arg(qname, xval, true), i); return; } } m_userParams.addElement(new Arg(qname, xval, true)); }
java
private void replaceOrPushUserParam(QName qname, XObject xval) { int n = m_userParams.size(); for (int i = n - 1; i >= 0; i--) { Arg arg = (Arg) m_userParams.elementAt(i); if (arg.getQName().equals(qname)) { m_userParams.setElementAt(new Arg(qname, xval, true), i); return; } } m_userParams.addElement(new Arg(qname, xval, true)); }
[ "private", "void", "replaceOrPushUserParam", "(", "QName", "qname", ",", "XObject", "xval", ")", "{", "int", "n", "=", "m_userParams", ".", "size", "(", ")", ";", "for", "(", "int", "i", "=", "n", "-", "1", ";", "i", ">=", "0", ";", "i", "--", ")...
NEEDSDOC Method replaceOrPushUserParam NEEDSDOC @param qname NEEDSDOC @param xval
[ "NEEDSDOC", "Method", "replaceOrPushUserParam" ]
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/transformer/TransformerImpl.java#L1461-L1479
ehcache/ehcache3
impl/src/main/java/org/ehcache/config/builders/CacheConfigurationBuilder.java
CacheConfigurationBuilder.withDiskStoreThreadPool
public CacheConfigurationBuilder<K, V> withDiskStoreThreadPool(String threadPoolAlias, int concurrency) { return addOrReplaceConfiguration(new OffHeapDiskStoreConfiguration(threadPoolAlias, concurrency)); }
java
public CacheConfigurationBuilder<K, V> withDiskStoreThreadPool(String threadPoolAlias, int concurrency) { return addOrReplaceConfiguration(new OffHeapDiskStoreConfiguration(threadPoolAlias, concurrency)); }
[ "public", "CacheConfigurationBuilder", "<", "K", ",", "V", ">", "withDiskStoreThreadPool", "(", "String", "threadPoolAlias", ",", "int", "concurrency", ")", "{", "return", "addOrReplaceConfiguration", "(", "new", "OffHeapDiskStoreConfiguration", "(", "threadPoolAlias", ...
Adds a {@link ServiceConfiguration} for the {@link org.ehcache.impl.internal.store.disk.OffHeapDiskStore.Provider} indicating thread pool alias and write concurrency. @param threadPoolAlias the thread pool alias @param concurrency the write concurrency @return a new builder with the added configuration
[ "Adds", "a", "{", "@link", "ServiceConfiguration", "}", "for", "the", "{", "@link", "org", ".", "ehcache", ".", "impl", ".", "internal", ".", "store", ".", "disk", ".", "OffHeapDiskStore", ".", "Provider", "}", "indicating", "thread", "pool", "alias", "and...
train
https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/impl/src/main/java/org/ehcache/config/builders/CacheConfigurationBuilder.java#L526-L528
svenkubiak/mangooio
mangooio-core/src/main/java/io/mangoo/routing/bindings/Validator.java
Validator.expectEmail
public void expectEmail(String name, String message) { String value = Optional.ofNullable(get(name)).orElse(""); if (!EmailValidator.getInstance().isValid(value)) { addError(name, Optional.ofNullable(message).orElse(messages.get(Validation.EMAIL_KEY.name(), name))); } }
java
public void expectEmail(String name, String message) { String value = Optional.ofNullable(get(name)).orElse(""); if (!EmailValidator.getInstance().isValid(value)) { addError(name, Optional.ofNullable(message).orElse(messages.get(Validation.EMAIL_KEY.name(), name))); } }
[ "public", "void", "expectEmail", "(", "String", "name", ",", "String", "message", ")", "{", "String", "value", "=", "Optional", ".", "ofNullable", "(", "get", "(", "name", ")", ")", ".", "orElse", "(", "\"\"", ")", ";", "if", "(", "!", "EmailValidator"...
Validates a field to be a valid email address @param name The field to check @param message A custom error message instead of the default one
[ "Validates", "a", "field", "to", "be", "a", "valid", "email", "address" ]
train
https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/routing/bindings/Validator.java#L257-L263
stackify/stackify-api-java
src/main/java/com/stackify/api/common/log/direct/Logger.java
Logger.queueMessage
public static void queueMessage(final String level, final String message) { try { LogAppender<LogEvent> appender = LogManager.getAppender(); if (appender != null) { LogEvent.Builder builder = LogEvent.newBuilder(); builder.level(level); builder.message(message); if ((level != null) && ("ERROR".equals(level.toUpperCase()))) { StackTraceElement[] stackTrace = new Throwable().getStackTrace(); if ((stackTrace != null) && (1 < stackTrace.length)) { StackTraceElement caller = stackTrace[1]; builder.className(caller.getClassName()); builder.methodName(caller.getMethodName()); builder.lineNumber(caller.getLineNumber()); } } appender.append(builder.build()); } } catch (Throwable t) { LOGGER.info("Unable to queue message to Stackify Log API service: {} {}", level, message, t); } }
java
public static void queueMessage(final String level, final String message) { try { LogAppender<LogEvent> appender = LogManager.getAppender(); if (appender != null) { LogEvent.Builder builder = LogEvent.newBuilder(); builder.level(level); builder.message(message); if ((level != null) && ("ERROR".equals(level.toUpperCase()))) { StackTraceElement[] stackTrace = new Throwable().getStackTrace(); if ((stackTrace != null) && (1 < stackTrace.length)) { StackTraceElement caller = stackTrace[1]; builder.className(caller.getClassName()); builder.methodName(caller.getMethodName()); builder.lineNumber(caller.getLineNumber()); } } appender.append(builder.build()); } } catch (Throwable t) { LOGGER.info("Unable to queue message to Stackify Log API service: {} {}", level, message, t); } }
[ "public", "static", "void", "queueMessage", "(", "final", "String", "level", ",", "final", "String", "message", ")", "{", "try", "{", "LogAppender", "<", "LogEvent", ">", "appender", "=", "LogManager", ".", "getAppender", "(", ")", ";", "if", "(", "appende...
Queues a log message to be sent to Stackify @param level The log level @param message The log message
[ "Queues", "a", "log", "message", "to", "be", "sent", "to", "Stackify" ]
train
https://github.com/stackify/stackify-api-java/blob/d3000b7c87ed53a88b302939b0c88405d63d7b67/src/main/java/com/stackify/api/common/log/direct/Logger.java#L38-L63
apache/flink
flink-connectors/flink-hbase/src/main/java/org/apache/flink/addons/hbase/TableInputFormat.java
TableInputFormat.createTable
private HTable createTable() { LOG.info("Initializing HBaseConfiguration"); //use files found in the classpath org.apache.hadoop.conf.Configuration hConf = HBaseConfiguration.create(); try { return new HTable(hConf, getTableName()); } catch (Exception e) { LOG.error("Error instantiating a new HTable instance", e); } return null; }
java
private HTable createTable() { LOG.info("Initializing HBaseConfiguration"); //use files found in the classpath org.apache.hadoop.conf.Configuration hConf = HBaseConfiguration.create(); try { return new HTable(hConf, getTableName()); } catch (Exception e) { LOG.error("Error instantiating a new HTable instance", e); } return null; }
[ "private", "HTable", "createTable", "(", ")", "{", "LOG", ".", "info", "(", "\"Initializing HBaseConfiguration\"", ")", ";", "//use files found in the classpath", "org", ".", "apache", ".", "hadoop", ".", "conf", ".", "Configuration", "hConf", "=", "HBaseConfigurati...
Create an {@link HTable} instance and set it into this format.
[ "Create", "an", "{" ]
train
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-hbase/src/main/java/org/apache/flink/addons/hbase/TableInputFormat.java#L78-L89
astrapi69/mystic-crypt
crypt-data/src/main/java/de/alpharogroup/crypto/factories/SecretKeyFactoryExtensions.java
SecretKeyFactoryExtensions.newSecretKey
public static SecretKey newSecretKey(final char[] password, final String algorithm) throws NoSuchAlgorithmException, InvalidKeySpecException { final PBEKeySpec pbeKeySpec = new PBEKeySpec(password); final SecretKeyFactory secretKeyFactory = SecretKeyFactory.getInstance(algorithm); final SecretKey secretKey = secretKeyFactory.generateSecret(pbeKeySpec); return secretKey; }
java
public static SecretKey newSecretKey(final char[] password, final String algorithm) throws NoSuchAlgorithmException, InvalidKeySpecException { final PBEKeySpec pbeKeySpec = new PBEKeySpec(password); final SecretKeyFactory secretKeyFactory = SecretKeyFactory.getInstance(algorithm); final SecretKey secretKey = secretKeyFactory.generateSecret(pbeKeySpec); return secretKey; }
[ "public", "static", "SecretKey", "newSecretKey", "(", "final", "char", "[", "]", "password", ",", "final", "String", "algorithm", ")", "throws", "NoSuchAlgorithmException", ",", "InvalidKeySpecException", "{", "final", "PBEKeySpec", "pbeKeySpec", "=", "new", "PBEKey...
Factory method for creating a new {@link SecretKey} from the given password and algorithm. @param password the password @param algorithm the algorithm @return the new {@link SecretKey} from the given password and algorithm. @throws NoSuchAlgorithmException is thrown if instantiation of the SecretKeyFactory object fails. @throws InvalidKeySpecException is thrown if generation of the SecretKey object fails.
[ "Factory", "method", "for", "creating", "a", "new", "{", "@link", "SecretKey", "}", "from", "the", "given", "password", "and", "algorithm", "." ]
train
https://github.com/astrapi69/mystic-crypt/blob/7f51ef5e4457e24de7ff391f10bfc5609e6f1a34/crypt-data/src/main/java/de/alpharogroup/crypto/factories/SecretKeyFactoryExtensions.java#L116-L123
whitesource/agents
wss-agent-hash-calculator/src/main/java/org/whitesource/agent/parser/JavaScriptParser.java
JavaScriptParser.removeHeaderComments
private String removeHeaderComments(String fileContent, SortedSet<Comment> comments) { String headerlessFileContent = fileContent; for (Comment comment : comments) { String commentValue = comment.getValue(); if (headerlessFileContent.startsWith(commentValue)) { headerlessFileContent = headerlessFileContent.replace(commentValue, EMPTY_STRING); // remove all leading white spaces and new line characters while (StringUtils.isNotBlank(headerlessFileContent) && Character.isWhitespace(headerlessFileContent.charAt(0))) { headerlessFileContent = headerlessFileContent.substring(1); } } else { // finished removing all header comments break; } } return headerlessFileContent; }
java
private String removeHeaderComments(String fileContent, SortedSet<Comment> comments) { String headerlessFileContent = fileContent; for (Comment comment : comments) { String commentValue = comment.getValue(); if (headerlessFileContent.startsWith(commentValue)) { headerlessFileContent = headerlessFileContent.replace(commentValue, EMPTY_STRING); // remove all leading white spaces and new line characters while (StringUtils.isNotBlank(headerlessFileContent) && Character.isWhitespace(headerlessFileContent.charAt(0))) { headerlessFileContent = headerlessFileContent.substring(1); } } else { // finished removing all header comments break; } } return headerlessFileContent; }
[ "private", "String", "removeHeaderComments", "(", "String", "fileContent", ",", "SortedSet", "<", "Comment", ">", "comments", ")", "{", "String", "headerlessFileContent", "=", "fileContent", ";", "for", "(", "Comment", "comment", ":", "comments", ")", "{", "Stri...
Go over each comment and remove from content until reaching the beginning of the actual code.
[ "Go", "over", "each", "comment", "and", "remove", "from", "content", "until", "reaching", "the", "beginning", "of", "the", "actual", "code", "." ]
train
https://github.com/whitesource/agents/blob/8a947a3dbad257aff70f23f79fb3a55ca90b765f/wss-agent-hash-calculator/src/main/java/org/whitesource/agent/parser/JavaScriptParser.java#L73-L89
snowflakedb/snowflake-jdbc
src/main/java/net/snowflake/client/core/SessionUtil.java
SessionUtil.federatedFlowStep3
private static String federatedFlowStep3(LoginInput loginInput, String tokenUrl) throws SnowflakeSQLException { String oneTimeToken = ""; try { URL url = new URL(tokenUrl); URI tokenUri = url.toURI(); final HttpPost postRequest = new HttpPost(tokenUri); StringEntity params = new StringEntity("{\"username\":\"" + loginInput.getUserName() + "\",\"password\":\"" + loginInput.getPassword() + "\"}"); postRequest.setEntity(params); HeaderGroup headers = new HeaderGroup(); headers.addHeader(new BasicHeader(HttpHeaders.ACCEPT, "application/json")); headers.addHeader(new BasicHeader(HttpHeaders.CONTENT_TYPE, "application/json")); postRequest.setHeaders(headers.getAllHeaders()); final String idpResponse = HttpUtil.executeRequestWithoutCookies(postRequest, loginInput.getLoginTimeout(), 0, null); logger.debug("user is authenticated against {}.", loginInput.getAuthenticator()); // session token is in the data field of the returned json response final JsonNode jsonNode = mapper.readTree(idpResponse); oneTimeToken = jsonNode.get("cookieToken").asText(); } catch (IOException | URISyntaxException ex) { handleFederatedFlowError(loginInput, ex); } return oneTimeToken; }
java
private static String federatedFlowStep3(LoginInput loginInput, String tokenUrl) throws SnowflakeSQLException { String oneTimeToken = ""; try { URL url = new URL(tokenUrl); URI tokenUri = url.toURI(); final HttpPost postRequest = new HttpPost(tokenUri); StringEntity params = new StringEntity("{\"username\":\"" + loginInput.getUserName() + "\",\"password\":\"" + loginInput.getPassword() + "\"}"); postRequest.setEntity(params); HeaderGroup headers = new HeaderGroup(); headers.addHeader(new BasicHeader(HttpHeaders.ACCEPT, "application/json")); headers.addHeader(new BasicHeader(HttpHeaders.CONTENT_TYPE, "application/json")); postRequest.setHeaders(headers.getAllHeaders()); final String idpResponse = HttpUtil.executeRequestWithoutCookies(postRequest, loginInput.getLoginTimeout(), 0, null); logger.debug("user is authenticated against {}.", loginInput.getAuthenticator()); // session token is in the data field of the returned json response final JsonNode jsonNode = mapper.readTree(idpResponse); oneTimeToken = jsonNode.get("cookieToken").asText(); } catch (IOException | URISyntaxException ex) { handleFederatedFlowError(loginInput, ex); } return oneTimeToken; }
[ "private", "static", "String", "federatedFlowStep3", "(", "LoginInput", "loginInput", ",", "String", "tokenUrl", ")", "throws", "SnowflakeSQLException", "{", "String", "oneTimeToken", "=", "\"\"", ";", "try", "{", "URL", "url", "=", "new", "URL", "(", "tokenUrl"...
Query IDP token url to authenticate and retrieve access token @param loginInput @param tokenUrl @return @throws SnowflakeSQLException
[ "Query", "IDP", "token", "url", "to", "authenticate", "and", "retrieve", "access", "token" ]
train
https://github.com/snowflakedb/snowflake-jdbc/blob/98567b5a57753f29d51446809640b969a099658f/src/main/java/net/snowflake/client/core/SessionUtil.java#L1206-L1242
alkacon/opencms-core
src-gwt/org/opencms/ade/containerpage/client/CmsContainerpageHandler.java
CmsContainerpageHandler.openModelResourceSelect
public void openModelResourceSelect( final CmsContainerPageElementPanel element, List<CmsModelResourceInfo> modelResources) { I_CmsModelSelectHandler handler = new I_CmsModelSelectHandler() { public void onModelSelect(CmsUUID modelStructureId) { m_controller.createAndEditNewElement(element, modelStructureId); } }; String title = org.opencms.gwt.client.Messages.get().key( org.opencms.gwt.client.Messages.GUI_MODEL_SELECT_TITLE_0); String message = org.opencms.gwt.client.Messages.get().key( org.opencms.gwt.client.Messages.GUI_MODEL_SELECT_MESSAGE_0); CmsModelSelectDialog dialog = new CmsModelSelectDialog(handler, modelResources, title, message); dialog.center(); }
java
public void openModelResourceSelect( final CmsContainerPageElementPanel element, List<CmsModelResourceInfo> modelResources) { I_CmsModelSelectHandler handler = new I_CmsModelSelectHandler() { public void onModelSelect(CmsUUID modelStructureId) { m_controller.createAndEditNewElement(element, modelStructureId); } }; String title = org.opencms.gwt.client.Messages.get().key( org.opencms.gwt.client.Messages.GUI_MODEL_SELECT_TITLE_0); String message = org.opencms.gwt.client.Messages.get().key( org.opencms.gwt.client.Messages.GUI_MODEL_SELECT_MESSAGE_0); CmsModelSelectDialog dialog = new CmsModelSelectDialog(handler, modelResources, title, message); dialog.center(); }
[ "public", "void", "openModelResourceSelect", "(", "final", "CmsContainerPageElementPanel", "element", ",", "List", "<", "CmsModelResourceInfo", ">", "modelResources", ")", "{", "I_CmsModelSelectHandler", "handler", "=", "new", "I_CmsModelSelectHandler", "(", ")", "{", "...
Opens the model select dialog for the given new element.<p> @param element the element widget @param modelResources the available resource models
[ "Opens", "the", "model", "select", "dialog", "for", "the", "given", "new", "element", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/containerpage/client/CmsContainerpageHandler.java#L833-L850
liferay/com-liferay-commerce
commerce-price-list-service/src/main/java/com/liferay/commerce/price/list/service/persistence/impl/CommerceTierPriceEntryPersistenceImpl.java
CommerceTierPriceEntryPersistenceImpl.fetchByC_ERC
@Override public CommerceTierPriceEntry fetchByC_ERC(long companyId, String externalReferenceCode) { return fetchByC_ERC(companyId, externalReferenceCode, true); }
java
@Override public CommerceTierPriceEntry fetchByC_ERC(long companyId, String externalReferenceCode) { return fetchByC_ERC(companyId, externalReferenceCode, true); }
[ "@", "Override", "public", "CommerceTierPriceEntry", "fetchByC_ERC", "(", "long", "companyId", ",", "String", "externalReferenceCode", ")", "{", "return", "fetchByC_ERC", "(", "companyId", ",", "externalReferenceCode", ",", "true", ")", ";", "}" ]
Returns the commerce tier price entry where companyId = &#63; and externalReferenceCode = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache. @param companyId the company ID @param externalReferenceCode the external reference code @return the matching commerce tier price entry, or <code>null</code> if a matching commerce tier price entry could not be found
[ "Returns", "the", "commerce", "tier", "price", "entry", "where", "companyId", "=", "&#63", ";", "and", "externalReferenceCode", "=", "&#63", ";", "or", "returns", "<code", ">", "null<", "/", "code", ">", "if", "it", "could", "not", "be", "found", ".", "U...
train
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-price-list-service/src/main/java/com/liferay/commerce/price/list/service/persistence/impl/CommerceTierPriceEntryPersistenceImpl.java#L3867-L3871
jbundle/jbundle
base/screen/model/src/main/java/org/jbundle/base/screen/model/BaseScreen.java
BaseScreen.checkContactSecurity
public int checkContactSecurity(String strContactType, String strContactID) { int iErrorCode = DBConstants.NORMAL_RETURN; if (Utility.isNumeric(strContactType)) { ContactTypeModel recContactType = (ContactTypeModel)Record.makeRecordFromClassName(ContactTypeModel.THICK_CLASS, this); strContactType = recContactType.getContactTypeFromID(strContactType); recContactType.free(); } String strUserContactType = this.getProperty(TrxMessageHeader.CONTACT_TYPE); String strUserContactID = this.getProperty(TrxMessageHeader.CONTACT_ID); if ((strUserContactType == null) || (strUserContactType.length() == 0) || (strUserContactType.equalsIgnoreCase(strContactType))) iErrorCode = DBConstants.NORMAL_RETURN; // No contact or different contact, okay else if ((strUserContactID != null) && (strUserContactID.equalsIgnoreCase(strContactID))) iErrorCode = DBConstants.NORMAL_RETURN; // Matching contact, okay else iErrorCode = DBConstants.ACCESS_DENIED; // Non-matching contact, NO return iErrorCode; }
java
public int checkContactSecurity(String strContactType, String strContactID) { int iErrorCode = DBConstants.NORMAL_RETURN; if (Utility.isNumeric(strContactType)) { ContactTypeModel recContactType = (ContactTypeModel)Record.makeRecordFromClassName(ContactTypeModel.THICK_CLASS, this); strContactType = recContactType.getContactTypeFromID(strContactType); recContactType.free(); } String strUserContactType = this.getProperty(TrxMessageHeader.CONTACT_TYPE); String strUserContactID = this.getProperty(TrxMessageHeader.CONTACT_ID); if ((strUserContactType == null) || (strUserContactType.length() == 0) || (strUserContactType.equalsIgnoreCase(strContactType))) iErrorCode = DBConstants.NORMAL_RETURN; // No contact or different contact, okay else if ((strUserContactID != null) && (strUserContactID.equalsIgnoreCase(strContactID))) iErrorCode = DBConstants.NORMAL_RETURN; // Matching contact, okay else iErrorCode = DBConstants.ACCESS_DENIED; // Non-matching contact, NO return iErrorCode; }
[ "public", "int", "checkContactSecurity", "(", "String", "strContactType", ",", "String", "strContactID", ")", "{", "int", "iErrorCode", "=", "DBConstants", ".", "NORMAL_RETURN", ";", "if", "(", "Utility", ".", "isNumeric", "(", "strContactType", ")", ")", "{", ...
Special security check for screens that only allow access to users that are contacts (such as vendors, profiles, employees). If this contact type and ID match the user contact and ID, allow access, otherwise deny access. NOTE: Special case if this user is not a contact or is a different type of contact (such as an administrator), allow access. @param strContactType @param strContactID @return
[ "Special", "security", "check", "for", "screens", "that", "only", "allow", "access", "to", "users", "that", "are", "contacts", "(", "such", "as", "vendors", "profiles", "employees", ")", ".", "If", "this", "contact", "type", "and", "ID", "match", "the", "u...
train
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/screen/model/src/main/java/org/jbundle/base/screen/model/BaseScreen.java#L284-L306
googleapis/google-cloud-java
google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionDiskClient.java
RegionDiskClient.createSnapshotRegionDisk
@BetaApi public final Operation createSnapshotRegionDisk(String disk, Snapshot snapshotResource) { CreateSnapshotRegionDiskHttpRequest request = CreateSnapshotRegionDiskHttpRequest.newBuilder() .setDisk(disk) .setSnapshotResource(snapshotResource) .build(); return createSnapshotRegionDisk(request); }
java
@BetaApi public final Operation createSnapshotRegionDisk(String disk, Snapshot snapshotResource) { CreateSnapshotRegionDiskHttpRequest request = CreateSnapshotRegionDiskHttpRequest.newBuilder() .setDisk(disk) .setSnapshotResource(snapshotResource) .build(); return createSnapshotRegionDisk(request); }
[ "@", "BetaApi", "public", "final", "Operation", "createSnapshotRegionDisk", "(", "String", "disk", ",", "Snapshot", "snapshotResource", ")", "{", "CreateSnapshotRegionDiskHttpRequest", "request", "=", "CreateSnapshotRegionDiskHttpRequest", ".", "newBuilder", "(", ")", "."...
Creates a snapshot of this regional disk. <p>Sample code: <pre><code> try (RegionDiskClient regionDiskClient = RegionDiskClient.create()) { ProjectRegionDiskName disk = ProjectRegionDiskName.of("[PROJECT]", "[REGION]", "[DISK]"); Snapshot snapshotResource = Snapshot.newBuilder().build(); Operation response = regionDiskClient.createSnapshotRegionDisk(disk.toString(), snapshotResource); } </code></pre> @param disk Name of the regional persistent disk to snapshot. @param snapshotResource A persistent disk snapshot resource. (== resource_for beta.snapshots ==) (== resource_for v1.snapshots ==) @throws com.google.api.gax.rpc.ApiException if the remote call fails
[ "Creates", "a", "snapshot", "of", "this", "regional", "disk", "." ]
train
https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionDiskClient.java#L205-L214
aws/aws-sdk-java
aws-java-sdk-stepfunctions/src/main/java/com/amazonaws/services/stepfunctions/builder/internal/validation/ValidationContext.java
ValidationContext.assertIsPositiveIfPresent
public void assertIsPositiveIfPresent(Integer integer, String propertyName) { if (integer != null && integer <= 0) { problemReporter.report(new Problem(this, String.format("%s must be positive", propertyName))); } }
java
public void assertIsPositiveIfPresent(Integer integer, String propertyName) { if (integer != null && integer <= 0) { problemReporter.report(new Problem(this, String.format("%s must be positive", propertyName))); } }
[ "public", "void", "assertIsPositiveIfPresent", "(", "Integer", "integer", ",", "String", "propertyName", ")", "{", "if", "(", "integer", "!=", "null", "&&", "integer", "<=", "0", ")", "{", "problemReporter", ".", "report", "(", "new", "Problem", "(", "this",...
Asserts the integer is either null or positive, reporting to {@link ProblemReporter} with this context if it is. @param integer Value to assert on. @param propertyName Name of property.
[ "Asserts", "the", "integer", "is", "either", "null", "or", "positive", "reporting", "to", "{", "@link", "ProblemReporter", "}", "with", "this", "context", "if", "it", "is", "." ]
train
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-stepfunctions/src/main/java/com/amazonaws/services/stepfunctions/builder/internal/validation/ValidationContext.java#L114-L118
liyiorg/weixin-popular
src/main/java/com/qq/weixin/mp/aes/XMLParse.java
XMLParse.generate
public static String generate(String encrypt, String signature, String timestamp, String nonce) { String format = "<xml>\n" + "<Encrypt><![CDATA[%1$s]]></Encrypt>\n" + "<MsgSignature><![CDATA[%2$s]]></MsgSignature>\n" + "<TimeStamp>%3$s</TimeStamp>\n" + "<Nonce><![CDATA[%4$s]]></Nonce>\n" + "</xml>"; return String.format(format, encrypt, signature, timestamp, nonce); }
java
public static String generate(String encrypt, String signature, String timestamp, String nonce) { String format = "<xml>\n" + "<Encrypt><![CDATA[%1$s]]></Encrypt>\n" + "<MsgSignature><![CDATA[%2$s]]></MsgSignature>\n" + "<TimeStamp>%3$s</TimeStamp>\n" + "<Nonce><![CDATA[%4$s]]></Nonce>\n" + "</xml>"; return String.format(format, encrypt, signature, timestamp, nonce); }
[ "public", "static", "String", "generate", "(", "String", "encrypt", ",", "String", "signature", ",", "String", "timestamp", ",", "String", "nonce", ")", "{", "String", "format", "=", "\"<xml>\\n\"", "+", "\"<Encrypt><![CDATA[%1$s]]></Encrypt>\\n\"", "+", "\"<MsgSign...
生成xml消息 @param encrypt 加密后的消息密文 @param signature 安全签名 @param timestamp 时间戳 @param nonce 随机字符串 @return 生成的xml字符串
[ "生成xml消息" ]
train
https://github.com/liyiorg/weixin-popular/blob/c64255292d41463bdb671938feaabf42a335d82c/src/main/java/com/qq/weixin/mp/aes/XMLParse.java#L82-L89
graknlabs/grakn
server/src/server/exception/TransactionException.java
TransactionException.invalidAttributeValue
public static TransactionException invalidAttributeValue(Object object, AttributeType.DataType dataType) { return create(ErrorMessage.INVALID_DATATYPE.getMessage(object, object.getClass().getSimpleName(), dataType.name())); }
java
public static TransactionException invalidAttributeValue(Object object, AttributeType.DataType dataType) { return create(ErrorMessage.INVALID_DATATYPE.getMessage(object, object.getClass().getSimpleName(), dataType.name())); }
[ "public", "static", "TransactionException", "invalidAttributeValue", "(", "Object", "object", ",", "AttributeType", ".", "DataType", "dataType", ")", "{", "return", "create", "(", "ErrorMessage", ".", "INVALID_DATATYPE", ".", "getMessage", "(", "object", ",", "objec...
Thrown when creating an Attribute whose value Object does not match attribute data type
[ "Thrown", "when", "creating", "an", "Attribute", "whose", "value", "Object", "does", "not", "match", "attribute", "data", "type" ]
train
https://github.com/graknlabs/grakn/blob/6aaee75ea846202474d591f8809d62028262fac5/server/src/server/exception/TransactionException.java#L150-L152
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/DownloadChemCompProvider.java
DownloadChemCompProvider.getLocalFileName
public static String getLocalFileName(String recordName){ if ( protectedIDs.contains(recordName)){ recordName = "_" + recordName; } File f = new File(getPath(), CHEM_COMP_CACHE_DIRECTORY); if (! f.exists()){ logger.info("Creating directory " + f); boolean success = f.mkdir(); // we've checked in initPath that path is writable, so there's no need to check if it succeeds // in the unlikely case that in the meantime it isn't writable at least we log an error if (!success) logger.error("Directory {} could not be created",f); } File theFile = new File(f,recordName + ".cif.gz"); return theFile.toString(); }
java
public static String getLocalFileName(String recordName){ if ( protectedIDs.contains(recordName)){ recordName = "_" + recordName; } File f = new File(getPath(), CHEM_COMP_CACHE_DIRECTORY); if (! f.exists()){ logger.info("Creating directory " + f); boolean success = f.mkdir(); // we've checked in initPath that path is writable, so there's no need to check if it succeeds // in the unlikely case that in the meantime it isn't writable at least we log an error if (!success) logger.error("Directory {} could not be created",f); } File theFile = new File(f,recordName + ".cif.gz"); return theFile.toString(); }
[ "public", "static", "String", "getLocalFileName", "(", "String", "recordName", ")", "{", "if", "(", "protectedIDs", ".", "contains", "(", "recordName", ")", ")", "{", "recordName", "=", "\"_\"", "+", "recordName", ";", "}", "File", "f", "=", "new", "File",...
Returns the file name that contains the definition for this {@link ChemComp} @param recordName the ID of the {@link ChemComp} @return full path to the file
[ "Returns", "the", "file", "name", "that", "contains", "the", "definition", "for", "this", "{", "@link", "ChemComp", "}" ]
train
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/DownloadChemCompProvider.java#L332-L353
jmrozanec/cron-utils
src/main/java/com/cronutils/descriptor/DescriptionStrategyFactory.java
DescriptionStrategyFactory.plainInstance
public static DescriptionStrategy plainInstance(final ResourceBundle bundle, final FieldExpression expression) { return new NominalDescriptionStrategy(bundle, null, expression); }
java
public static DescriptionStrategy plainInstance(final ResourceBundle bundle, final FieldExpression expression) { return new NominalDescriptionStrategy(bundle, null, expression); }
[ "public", "static", "DescriptionStrategy", "plainInstance", "(", "final", "ResourceBundle", "bundle", ",", "final", "FieldExpression", "expression", ")", "{", "return", "new", "NominalDescriptionStrategy", "(", "bundle", ",", "null", ",", "expression", ")", ";", "}"...
Creates nominal description strategy. @param bundle - locale @param expression - CronFieldExpression @return - DescriptionStrategy instance, never null
[ "Creates", "nominal", "description", "strategy", "." ]
train
https://github.com/jmrozanec/cron-utils/blob/adac5ec8fd9160b082f9762a6eedea0715731170/src/main/java/com/cronutils/descriptor/DescriptionStrategyFactory.java#L115-L117
lamarios/sherdog-parser
src/main/java/com/ftpix/sherdogparser/parsers/ParserUtils.java
ParserUtils.getDateFromStringToZoneId
static ZonedDateTime getDateFromStringToZoneId(String date, ZoneId zoneId, DateTimeFormatter formatter) throws DateTimeParseException { try { //noticed that date not parsed with non-US locale. For me this fix is helpful LocalDate localDate = LocalDate.parse(date, formatter); ZonedDateTime usDate = localDate.atStartOfDay(zoneId); return usDate.withZoneSameInstant(zoneId); } catch (Exception e) { //In case the parsing fail, we try without time try { ZonedDateTime usDate = LocalDate.parse(date, formatter).atStartOfDay(ZoneId.of(Constants.SHERDOG_TIME_ZONE)); return usDate.withZoneSameInstant(zoneId); } catch (DateTimeParseException e2) { return null; } } }
java
static ZonedDateTime getDateFromStringToZoneId(String date, ZoneId zoneId, DateTimeFormatter formatter) throws DateTimeParseException { try { //noticed that date not parsed with non-US locale. For me this fix is helpful LocalDate localDate = LocalDate.parse(date, formatter); ZonedDateTime usDate = localDate.atStartOfDay(zoneId); return usDate.withZoneSameInstant(zoneId); } catch (Exception e) { //In case the parsing fail, we try without time try { ZonedDateTime usDate = LocalDate.parse(date, formatter).atStartOfDay(ZoneId.of(Constants.SHERDOG_TIME_ZONE)); return usDate.withZoneSameInstant(zoneId); } catch (DateTimeParseException e2) { return null; } } }
[ "static", "ZonedDateTime", "getDateFromStringToZoneId", "(", "String", "date", ",", "ZoneId", "zoneId", ",", "DateTimeFormatter", "formatter", ")", "throws", "DateTimeParseException", "{", "try", "{", "//noticed that date not parsed with non-US locale. For me this fix is helpful"...
Converts a String to the given timezone. @param date Date to format @param zoneId Zone id to convert from sherdog's time @param formatter Formatter for exotic date format @return the converted zonedatetime
[ "Converts", "a", "String", "to", "the", "given", "timezone", "." ]
train
https://github.com/lamarios/sherdog-parser/blob/7cdb36280317caeaaa54db77c04dc4b4e1db053e/src/main/java/com/ftpix/sherdogparser/parsers/ParserUtils.java#L91-L106
vznet/mongo-jackson-mapper
src/main/java/net/vz/mongodb/jackson/JacksonDBCollection.java
JacksonDBCollection.findOneById
public T findOneById(K id, T fields) throws MongoException { return findOneById(id, convertToBasicDbObject(fields)); }
java
public T findOneById(K id, T fields) throws MongoException { return findOneById(id, convertToBasicDbObject(fields)); }
[ "public", "T", "findOneById", "(", "K", "id", ",", "T", "fields", ")", "throws", "MongoException", "{", "return", "findOneById", "(", "id", ",", "convertToBasicDbObject", "(", "fields", ")", ")", ";", "}" ]
Find an object by the given id @param id The id @return The object @throws MongoException If an error occurred
[ "Find", "an", "object", "by", "the", "given", "id" ]
train
https://github.com/vznet/mongo-jackson-mapper/blob/ecd189aefa89636cddf70fb383f5d676be347976/src/main/java/net/vz/mongodb/jackson/JacksonDBCollection.java#L869-L871
pedrovgs/Lynx
lynx/src/main/java/com/github/pedrovgs/lynx/LynxView.java
LynxView.showTraces
@Override public void showTraces(List<Trace> traces, int removedTraces) { if (lastScrollPosition == 0) { lastScrollPosition = lv_traces.getFirstVisiblePosition(); } adapter.clear(); adapter.addAll(traces); adapter.notifyDataSetChanged(); updateScrollPosition(removedTraces); }
java
@Override public void showTraces(List<Trace> traces, int removedTraces) { if (lastScrollPosition == 0) { lastScrollPosition = lv_traces.getFirstVisiblePosition(); } adapter.clear(); adapter.addAll(traces); adapter.notifyDataSetChanged(); updateScrollPosition(removedTraces); }
[ "@", "Override", "public", "void", "showTraces", "(", "List", "<", "Trace", ">", "traces", ",", "int", "removedTraces", ")", "{", "if", "(", "lastScrollPosition", "==", "0", ")", "{", "lastScrollPosition", "=", "lv_traces", ".", "getFirstVisiblePosition", "(",...
Given a {@code List<Trace>} updates the ListView adapter with this information and keeps the scroll position if needed.
[ "Given", "a", "{" ]
train
https://github.com/pedrovgs/Lynx/blob/6097ab18b76c1ebdd0819c10e5d09ec19ea5bf4d/lynx/src/main/java/com/github/pedrovgs/lynx/LynxView.java#L166-L174
cdk/cdk
base/isomorphism/src/main/java/org/openscience/cdk/isomorphism/matchers/RGroupQuery.java
RGroupQuery.getBondPosition
private int getBondPosition(IBond bond, IAtomContainer container) { for (int i = 0; i < container.getBondCount(); i++) { if (bond.equals(container.getBond(i))) { return i; } } return -1; }
java
private int getBondPosition(IBond bond, IAtomContainer container) { for (int i = 0; i < container.getBondCount(); i++) { if (bond.equals(container.getBond(i))) { return i; } } return -1; }
[ "private", "int", "getBondPosition", "(", "IBond", "bond", ",", "IAtomContainer", "container", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "container", ".", "getBondCount", "(", ")", ";", "i", "++", ")", "{", "if", "(", "bond", ".", ...
Helper method, used to help construct a configuration. @param bond @param container @return the array position of the bond in the container
[ "Helper", "method", "used", "to", "help", "construct", "a", "configuration", "." ]
train
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/isomorphism/src/main/java/org/openscience/cdk/isomorphism/matchers/RGroupQuery.java#L509-L516
LearnLib/automatalib
visualization/dot-visualizer/src/main/java/net/automatalib/visualization/dot/ImageComponent.java
ImageComponent.setImage
public void setImage(BufferedImage img) { this.img = img; Dimension dim; if (img != null) { dim = new Dimension(img.getWidth(), img.getHeight()); } else { dim = new Dimension(DEFAULT_WIDTH, DEFAULT_HEIGHT); } setSize(dim); setPreferredSize(dim); repaint(); }
java
public void setImage(BufferedImage img) { this.img = img; Dimension dim; if (img != null) { dim = new Dimension(img.getWidth(), img.getHeight()); } else { dim = new Dimension(DEFAULT_WIDTH, DEFAULT_HEIGHT); } setSize(dim); setPreferredSize(dim); repaint(); }
[ "public", "void", "setImage", "(", "BufferedImage", "img", ")", "{", "this", ".", "img", "=", "img", ";", "Dimension", "dim", ";", "if", "(", "img", "!=", "null", ")", "{", "dim", "=", "new", "Dimension", "(", "img", ".", "getWidth", "(", ")", ",",...
Sets the image to be displayed. @param img the image to be displayed
[ "Sets", "the", "image", "to", "be", "displayed", "." ]
train
https://github.com/LearnLib/automatalib/blob/8a462ec52f6eaab9f8996e344f2163a72cb8aa6e/visualization/dot-visualizer/src/main/java/net/automatalib/visualization/dot/ImageComponent.java#L110-L122
alkacon/opencms-core
src-gwt/org/opencms/ade/contenteditor/client/CmsEntityObserver.java
CmsEntityObserver.addEntityChangeListener
public void addEntityChangeListener(I_CmsEntityChangeListener changeListener, String changeScope) { if (m_observerdEntity == null) { throw new RuntimeException("The Observer has been cleared, no listener registration possible."); } if (!m_changeListeners.containsKey(changeScope)) { m_changeListeners.put(changeScope, new ArrayList<I_CmsEntityChangeListener>()); // if changeScope==null, it is a global change listener, and we don't need a scope value if (changeScope != null) { // save the current change scope value m_scopeValues.put(changeScope, CmsContentDefinition.getValueForPath(m_observerdEntity, changeScope)); } } m_changeListeners.get(changeScope).add(changeListener); }
java
public void addEntityChangeListener(I_CmsEntityChangeListener changeListener, String changeScope) { if (m_observerdEntity == null) { throw new RuntimeException("The Observer has been cleared, no listener registration possible."); } if (!m_changeListeners.containsKey(changeScope)) { m_changeListeners.put(changeScope, new ArrayList<I_CmsEntityChangeListener>()); // if changeScope==null, it is a global change listener, and we don't need a scope value if (changeScope != null) { // save the current change scope value m_scopeValues.put(changeScope, CmsContentDefinition.getValueForPath(m_observerdEntity, changeScope)); } } m_changeListeners.get(changeScope).add(changeListener); }
[ "public", "void", "addEntityChangeListener", "(", "I_CmsEntityChangeListener", "changeListener", ",", "String", "changeScope", ")", "{", "if", "(", "m_observerdEntity", "==", "null", ")", "{", "throw", "new", "RuntimeException", "(", "\"The Observer has been cleared, no l...
Adds an entity change listener for the given scope.<p> @param changeListener the change listener @param changeScope the change scope
[ "Adds", "an", "entity", "change", "listener", "for", "the", "given", "scope", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/contenteditor/client/CmsEntityObserver.java#L80-L94
avianey/facebook-api-android-maven
facebook/src/main/java/com/facebook/widget/ProfilePictureView.java
ProfilePictureView.onLayout
@Override protected void onLayout(boolean changed, int left, int top, int right, int bottom) { super.onLayout(changed, left, top, right, bottom); // See if the image needs redrawing refreshImage(false); }
java
@Override protected void onLayout(boolean changed, int left, int top, int right, int bottom) { super.onLayout(changed, left, top, right, bottom); // See if the image needs redrawing refreshImage(false); }
[ "@", "Override", "protected", "void", "onLayout", "(", "boolean", "changed", ",", "int", "left", ",", "int", "top", ",", "int", "right", ",", "int", "bottom", ")", "{", "super", ".", "onLayout", "(", "changed", ",", "left", ",", "top", ",", "right", ...
In addition to calling super.Layout(), we also attempt to get a new image that is properly size for the layout dimensions
[ "In", "addition", "to", "calling", "super", ".", "Layout", "()", "we", "also", "attempt", "to", "get", "a", "new", "image", "that", "is", "properly", "size", "for", "the", "layout", "dimensions" ]
train
https://github.com/avianey/facebook-api-android-maven/blob/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/src/main/java/com/facebook/widget/ProfilePictureView.java#L302-L308
glyptodon/guacamole-client
guacamole/src/main/java/org/apache/guacamole/extension/DirectoryClassLoader.java
DirectoryClassLoader.getJarURLs
private static URL[] getJarURLs(File dir) throws GuacamoleException { // Validate directory is indeed a directory if (!dir.isDirectory()) throw new GuacamoleException(dir + " is not a directory."); // Get list of URLs for all .jar's in the lib directory Collection<URL> jarURLs = new ArrayList<URL>(); File[] files = dir.listFiles(new FilenameFilter() { @Override public boolean accept(File dir, String name) { // If it ends with .jar, accept the file return name.endsWith(".jar"); } }); // Verify directory was successfully read if (files == null) throw new GuacamoleException("Unable to read contents of directory " + dir); // Add the URL for each .jar to the jar URL list for (File file : files) { try { jarURLs.add(file.toURI().toURL()); } catch (MalformedURLException e) { throw new GuacamoleException(e); } } // Set delegate classloader to new URLClassLoader which loads from the .jars found above. URL[] urls = new URL[jarURLs.size()]; return jarURLs.toArray(urls); }
java
private static URL[] getJarURLs(File dir) throws GuacamoleException { // Validate directory is indeed a directory if (!dir.isDirectory()) throw new GuacamoleException(dir + " is not a directory."); // Get list of URLs for all .jar's in the lib directory Collection<URL> jarURLs = new ArrayList<URL>(); File[] files = dir.listFiles(new FilenameFilter() { @Override public boolean accept(File dir, String name) { // If it ends with .jar, accept the file return name.endsWith(".jar"); } }); // Verify directory was successfully read if (files == null) throw new GuacamoleException("Unable to read contents of directory " + dir); // Add the URL for each .jar to the jar URL list for (File file : files) { try { jarURLs.add(file.toURI().toURL()); } catch (MalformedURLException e) { throw new GuacamoleException(e); } } // Set delegate classloader to new URLClassLoader which loads from the .jars found above. URL[] urls = new URL[jarURLs.size()]; return jarURLs.toArray(urls); }
[ "private", "static", "URL", "[", "]", "getJarURLs", "(", "File", "dir", ")", "throws", "GuacamoleException", "{", "// Validate directory is indeed a directory", "if", "(", "!", "dir", ".", "isDirectory", "(", ")", ")", "throw", "new", "GuacamoleException", "(", ...
Returns all .jar files within the given directory as an array of URLs. @param dir The directory to retrieve all .jar files from. @return An array of the URLs of all .jar files within the given directory. @throws GuacamoleException If the given file is not a directory, or the contents of the given directory cannot be read.
[ "Returns", "all", ".", "jar", "files", "within", "the", "given", "directory", "as", "an", "array", "of", "URLs", "." ]
train
https://github.com/glyptodon/guacamole-client/blob/ea1b10e9d1e3f1fa640dff2ca64d61b44bf1ace9/guacamole/src/main/java/org/apache/guacamole/extension/DirectoryClassLoader.java#L91-L131
netscaler/sdx_nitro
src/main/java/com/citrix/sdx/nitro/resource/config/xen/xen_health_sr.java
xen_health_sr.get_nitro_bulk_response
protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception { xen_health_sr_responses result = (xen_health_sr_responses) service.get_payload_formatter().string_to_resource(xen_health_sr_responses.class, response); if(result.errorcode != 0) { if (result.errorcode == SESSION_NOT_EXISTS) service.clear_session(); throw new nitro_exception(result.message, result.errorcode, (base_response [])result.xen_health_sr_response_array); } xen_health_sr[] result_xen_health_sr = new xen_health_sr[result.xen_health_sr_response_array.length]; for(int i = 0; i < result.xen_health_sr_response_array.length; i++) { result_xen_health_sr[i] = result.xen_health_sr_response_array[i].xen_health_sr[0]; } return result_xen_health_sr; }
java
protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception { xen_health_sr_responses result = (xen_health_sr_responses) service.get_payload_formatter().string_to_resource(xen_health_sr_responses.class, response); if(result.errorcode != 0) { if (result.errorcode == SESSION_NOT_EXISTS) service.clear_session(); throw new nitro_exception(result.message, result.errorcode, (base_response [])result.xen_health_sr_response_array); } xen_health_sr[] result_xen_health_sr = new xen_health_sr[result.xen_health_sr_response_array.length]; for(int i = 0; i < result.xen_health_sr_response_array.length; i++) { result_xen_health_sr[i] = result.xen_health_sr_response_array[i].xen_health_sr[0]; } return result_xen_health_sr; }
[ "protected", "base_resource", "[", "]", "get_nitro_bulk_response", "(", "nitro_service", "service", ",", "String", "response", ")", "throws", "Exception", "{", "xen_health_sr_responses", "result", "=", "(", "xen_health_sr_responses", ")", "service", ".", "get_payload_fo...
<pre> Converts API response of bulk operation into object and returns the object array in case of get request. </pre>
[ "<pre", ">", "Converts", "API", "response", "of", "bulk", "operation", "into", "object", "and", "returns", "the", "object", "array", "in", "case", "of", "get", "request", ".", "<", "/", "pre", ">" ]
train
https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/xen/xen_health_sr.java#L325-L342
Nexmo/nexmo-java
src/main/java/com/nexmo/client/verify/VerifyClient.java
VerifyClient.cancelVerification
public ControlResponse cancelVerification(String requestId) throws IOException, NexmoClientException { return this.control.execute(new ControlRequest(requestId, VerifyControlCommand.CANCEL)); }
java
public ControlResponse cancelVerification(String requestId) throws IOException, NexmoClientException { return this.control.execute(new ControlRequest(requestId, VerifyControlCommand.CANCEL)); }
[ "public", "ControlResponse", "cancelVerification", "(", "String", "requestId", ")", "throws", "IOException", ",", "NexmoClientException", "{", "return", "this", ".", "control", ".", "execute", "(", "new", "ControlRequest", "(", "requestId", ",", "VerifyControlCommand"...
Cancel a current verification request. @param requestId The requestId of the ongoing verification request. @return A {@link ControlResponse} representing the response from the API. @throws IOException If an IO error occurred while making the request. @throws NexmoClientException If the request failed for some reason.
[ "Cancel", "a", "current", "verification", "request", "." ]
train
https://github.com/Nexmo/nexmo-java/blob/7427eff6d6baa5a5bd9197fa096bcf2564191cf5/src/main/java/com/nexmo/client/verify/VerifyClient.java#L231-L233
bwkimmel/java-util
src/main/java/ca/eandb/util/classloader/MapClassLoaderStrategy.java
MapClassLoaderStrategy.setClassDefinition
public void setClassDefinition(String name, byte[] def) { classDefs.put(name, ByteBuffer.wrap(def)); }
java
public void setClassDefinition(String name, byte[] def) { classDefs.put(name, ByteBuffer.wrap(def)); }
[ "public", "void", "setClassDefinition", "(", "String", "name", ",", "byte", "[", "]", "def", ")", "{", "classDefs", ".", "put", "(", "name", ",", "ByteBuffer", ".", "wrap", "(", "def", ")", ")", ";", "}" ]
Sets the definition of a class. @param name The name of the class to define. @param def The definition of the class.
[ "Sets", "the", "definition", "of", "a", "class", "." ]
train
https://github.com/bwkimmel/java-util/blob/0c03664d42f0e6b111f64447f222aa73c2819e5c/src/main/java/ca/eandb/util/classloader/MapClassLoaderStrategy.java#L70-L72
square/wire
wire-schema/src/main/java/com/squareup/wire/schema/Options.java
Options.optionMatches
public boolean optionMatches(String namePattern, String valuePattern) { Matcher nameMatcher = Pattern.compile(namePattern).matcher(""); Matcher valueMatcher = Pattern.compile(valuePattern).matcher(""); for (Map.Entry<ProtoMember, Object> entry : map.entrySet()) { if (nameMatcher.reset(entry.getKey().member()).matches() && valueMatcher.reset(String.valueOf(entry.getValue())).matches()) { return true; } } return false; }
java
public boolean optionMatches(String namePattern, String valuePattern) { Matcher nameMatcher = Pattern.compile(namePattern).matcher(""); Matcher valueMatcher = Pattern.compile(valuePattern).matcher(""); for (Map.Entry<ProtoMember, Object> entry : map.entrySet()) { if (nameMatcher.reset(entry.getKey().member()).matches() && valueMatcher.reset(String.valueOf(entry.getValue())).matches()) { return true; } } return false; }
[ "public", "boolean", "optionMatches", "(", "String", "namePattern", ",", "String", "valuePattern", ")", "{", "Matcher", "nameMatcher", "=", "Pattern", ".", "compile", "(", "namePattern", ")", ".", "matcher", "(", "\"\"", ")", ";", "Matcher", "valueMatcher", "=...
Returns true if any of the options in {@code options} matches both of the regular expressions provided: its name matches the option's name and its value matches the option's value.
[ "Returns", "true", "if", "any", "of", "the", "options", "in", "{" ]
train
https://github.com/square/wire/blob/4a9a00dfadfc14d6a0780b85810418f9cbc78a49/wire-schema/src/main/java/com/squareup/wire/schema/Options.java#L78-L88
mangstadt/biweekly
src/main/java/biweekly/util/Google2445Utils.java
Google2445Utils.createRecurrenceIterator
public static RecurrenceIterator createRecurrenceIterator(Recurrence recurrence, ICalDate start, TimeZone timezone) { DateValue startValue = convert(start, timezone); return RecurrenceIteratorFactory.createRecurrenceIterator(recurrence, startValue, timezone); }
java
public static RecurrenceIterator createRecurrenceIterator(Recurrence recurrence, ICalDate start, TimeZone timezone) { DateValue startValue = convert(start, timezone); return RecurrenceIteratorFactory.createRecurrenceIterator(recurrence, startValue, timezone); }
[ "public", "static", "RecurrenceIterator", "createRecurrenceIterator", "(", "Recurrence", "recurrence", ",", "ICalDate", "start", ",", "TimeZone", "timezone", ")", "{", "DateValue", "startValue", "=", "convert", "(", "start", ",", "timezone", ")", ";", "return", "R...
Creates a recurrence iterator based on the given recurrence rule. @param recurrence the recurrence rule @param start the start date @param timezone the timezone to iterate in. This is needed in order to account for when the iterator passes over a daylight savings boundary. @return the recurrence iterator
[ "Creates", "a", "recurrence", "iterator", "based", "on", "the", "given", "recurrence", "rule", "." ]
train
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/util/Google2445Utils.java#L196-L199
lessthanoptimal/ejml
main/ejml-ddense/src/org/ejml/dense/row/CommonOps_DDRM.java
CommonOps_DDRM.multAdd
public static void multAdd(DMatrix1Row a , DMatrix1Row b , DMatrix1Row c ) { if( b.numCols == 1 ) { MatrixVectorMult_DDRM.multAdd(a, b, c); } else { if( b.numCols >= EjmlParameters.MULT_COLUMN_SWITCH ) { MatrixMatrixMult_DDRM.multAdd_reorder(a,b,c); } else { MatrixMatrixMult_DDRM.multAdd_small(a,b,c); } } }
java
public static void multAdd(DMatrix1Row a , DMatrix1Row b , DMatrix1Row c ) { if( b.numCols == 1 ) { MatrixVectorMult_DDRM.multAdd(a, b, c); } else { if( b.numCols >= EjmlParameters.MULT_COLUMN_SWITCH ) { MatrixMatrixMult_DDRM.multAdd_reorder(a,b,c); } else { MatrixMatrixMult_DDRM.multAdd_small(a,b,c); } } }
[ "public", "static", "void", "multAdd", "(", "DMatrix1Row", "a", ",", "DMatrix1Row", "b", ",", "DMatrix1Row", "c", ")", "{", "if", "(", "b", ".", "numCols", "==", "1", ")", "{", "MatrixVectorMult_DDRM", ".", "multAdd", "(", "a", ",", "b", ",", "c", ")...
<p> Performs the following operation:<br> <br> c = c + a * b<br> c<sub>ij</sub> = c<sub>ij</sub> + &sum;<sub>k=1:n</sub> { a<sub>ik</sub> * b<sub>kj</sub>} </p> @param a The left matrix in the multiplication operation. Not modified. @param b The right matrix in the multiplication operation. Not modified. @param c Where the results of the operation are stored. Modified.
[ "<p", ">", "Performs", "the", "following", "operation", ":", "<br", ">", "<br", ">", "c", "=", "c", "+", "a", "*", "b<br", ">", "c<sub", ">", "ij<", "/", "sub", ">", "=", "c<sub", ">", "ij<", "/", "sub", ">", "+", "&sum", ";", "<sub", ">", "k...
train
https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/row/CommonOps_DDRM.java#L333-L344
kiegroup/drools
drools-templates/src/main/java/org/drools/template/DataProviderCompiler.java
DataProviderCompiler.compile
public String compile(final DataProvider dataProvider, final InputStream templateStream) { return compile(dataProvider,templateStream, true ); }
java
public String compile(final DataProvider dataProvider, final InputStream templateStream) { return compile(dataProvider,templateStream, true ); }
[ "public", "String", "compile", "(", "final", "DataProvider", "dataProvider", ",", "final", "InputStream", "templateStream", ")", "{", "return", "compile", "(", "dataProvider", ",", "templateStream", ",", "true", ")", ";", "}" ]
Generates DRL from a data provider for the spreadsheet data and templates. @param dataProvider the data provider for the spreadsheet data @param templateStream the InputStream for reading the templates @return the generated DRL text as a String
[ "Generates", "DRL", "from", "a", "data", "provider", "for", "the", "spreadsheet", "data", "and", "templates", "." ]
train
https://github.com/kiegroup/drools/blob/22b0275d6dbe93070b8090948502cf46eda543c4/drools-templates/src/main/java/org/drools/template/DataProviderCompiler.java#L55-L58
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/ICUResourceBundle.java
ICUResourceBundle.getResPathKeys
private void getResPathKeys(String[] keys, int depth) { ICUResourceBundle b = this; while (depth > 0) { keys[--depth] = b.key; b = b.container; assert (depth == 0) == (b.container == null); } }
java
private void getResPathKeys(String[] keys, int depth) { ICUResourceBundle b = this; while (depth > 0) { keys[--depth] = b.key; b = b.container; assert (depth == 0) == (b.container == null); } }
[ "private", "void", "getResPathKeys", "(", "String", "[", "]", "keys", ",", "int", "depth", ")", "{", "ICUResourceBundle", "b", "=", "this", ";", "while", "(", "depth", ">", "0", ")", "{", "keys", "[", "--", "depth", "]", "=", "b", ".", "key", ";", ...
Fills some of the keys array with the keys on the path to this resource object. Writes the top-level key into index 0 and increments from there. @param keys @param depth must be {@link #getResDepth()}
[ "Fills", "some", "of", "the", "keys", "array", "with", "the", "keys", "on", "the", "path", "to", "this", "resource", "object", ".", "Writes", "the", "top", "-", "level", "key", "into", "index", "0", "and", "increments", "from", "there", "." ]
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/ICUResourceBundle.java#L976-L983
querydsl/querydsl
querydsl-lucene5/src/main/java/com/querydsl/lucene5/LuceneSerializer.java
LuceneSerializer.createBooleanClause
private BooleanClause createBooleanClause(Query query, Occur occur) { if (query instanceof BooleanQuery) { BooleanClause[] clauses = ((BooleanQuery) query).getClauses(); if (clauses.length == 1 && clauses[0].getOccur().equals(Occur.MUST_NOT)) { return clauses[0]; } } return new BooleanClause(query, occur); }
java
private BooleanClause createBooleanClause(Query query, Occur occur) { if (query instanceof BooleanQuery) { BooleanClause[] clauses = ((BooleanQuery) query).getClauses(); if (clauses.length == 1 && clauses[0].getOccur().equals(Occur.MUST_NOT)) { return clauses[0]; } } return new BooleanClause(query, occur); }
[ "private", "BooleanClause", "createBooleanClause", "(", "Query", "query", ",", "Occur", "occur", ")", "{", "if", "(", "query", "instanceof", "BooleanQuery", ")", "{", "BooleanClause", "[", "]", "clauses", "=", "(", "(", "BooleanQuery", ")", "query", ")", "."...
If the query is a BooleanQuery and it contains a single Occur.MUST_NOT clause it will be returned as is. Otherwise it will be wrapped in a BooleanClause with the given Occur.
[ "If", "the", "query", "is", "a", "BooleanQuery", "and", "it", "contains", "a", "single", "Occur", ".", "MUST_NOT", "clause", "it", "will", "be", "returned", "as", "is", ".", "Otherwise", "it", "will", "be", "wrapped", "in", "a", "BooleanClause", "with", ...
train
https://github.com/querydsl/querydsl/blob/2bf234caf78549813a1e0f44d9c30ecc5ef734e3/querydsl-lucene5/src/main/java/com/querydsl/lucene5/LuceneSerializer.java#L179-L188
derari/cthul
matchers/src/main/java/org/cthul/matchers/diagnose/nested/Nested.java
Nested.describeTo
public static void describeTo(PrecedencedSelfDescribing self, SelfDescribing nested, Description d) { boolean paren = useParen(self, nested); describeTo(paren, nested, d); }
java
public static void describeTo(PrecedencedSelfDescribing self, SelfDescribing nested, Description d) { boolean paren = useParen(self, nested); describeTo(paren, nested, d); }
[ "public", "static", "void", "describeTo", "(", "PrecedencedSelfDescribing", "self", ",", "SelfDescribing", "nested", ",", "Description", "d", ")", "{", "boolean", "paren", "=", "useParen", "(", "self", ",", "nested", ")", ";", "describeTo", "(", "paren", ",", ...
Appends description of {@code s} to {@code d}, enclosed in parentheses if necessary. @param self @param d @param nested
[ "Appends", "description", "of", "{" ]
train
https://github.com/derari/cthul/blob/74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc/matchers/src/main/java/org/cthul/matchers/diagnose/nested/Nested.java#L58-L61
spring-projects/spring-boot
spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/MainClassFinder.java
MainClassFinder.findSingleMainClass
public static String findSingleMainClass(JarFile jarFile, String classesLocation) throws IOException { return findSingleMainClass(jarFile, classesLocation, null); }
java
public static String findSingleMainClass(JarFile jarFile, String classesLocation) throws IOException { return findSingleMainClass(jarFile, classesLocation, null); }
[ "public", "static", "String", "findSingleMainClass", "(", "JarFile", "jarFile", ",", "String", "classesLocation", ")", "throws", "IOException", "{", "return", "findSingleMainClass", "(", "jarFile", ",", "classesLocation", ",", "null", ")", ";", "}" ]
Find a single main class in a given jar file. @param jarFile the jar file to search @param classesLocation the location within the jar containing classes @return the main class or {@code null} @throws IOException if the jar file cannot be read
[ "Find", "a", "single", "main", "class", "in", "a", "given", "jar", "file", "." ]
train
https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/MainClassFinder.java#L185-L188
micronaut-projects/micronaut-core
tracing/src/main/java/io/micronaut/tracing/instrument/http/AbstractOpenTracingFilter.java
AbstractOpenTracingFilter.newSpan
protected Tracer.SpanBuilder newSpan(HttpRequest<?> request, SpanContext spanContext) { String spanName = resolveSpanName(request); Tracer.SpanBuilder spanBuilder = tracer.buildSpan( spanName ).asChildOf(spanContext); spanBuilder.withTag(TAG_METHOD, request.getMethod().name()); String path = request.getPath(); spanBuilder.withTag(TAG_PATH, path); return spanBuilder; }
java
protected Tracer.SpanBuilder newSpan(HttpRequest<?> request, SpanContext spanContext) { String spanName = resolveSpanName(request); Tracer.SpanBuilder spanBuilder = tracer.buildSpan( spanName ).asChildOf(spanContext); spanBuilder.withTag(TAG_METHOD, request.getMethod().name()); String path = request.getPath(); spanBuilder.withTag(TAG_PATH, path); return spanBuilder; }
[ "protected", "Tracer", ".", "SpanBuilder", "newSpan", "(", "HttpRequest", "<", "?", ">", "request", ",", "SpanContext", "spanContext", ")", "{", "String", "spanName", "=", "resolveSpanName", "(", "request", ")", ";", "Tracer", ".", "SpanBuilder", "spanBuilder", ...
Creates a new span for the given request and span context. @param request The request @param spanContext The span context @return The span builder
[ "Creates", "a", "new", "span", "for", "the", "given", "request", "and", "span", "context", "." ]
train
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/tracing/src/main/java/io/micronaut/tracing/instrument/http/AbstractOpenTracingFilter.java#L108-L118
jaxio/celerio
celerio-engine/src/main/java/com/jaxio/celerio/template/PreviousEngine.java
PreviousEngine.convertFileNameToBaseClassName
private String convertFileNameToBaseClassName(String filename) { if (filename.endsWith("_.java")) { return substringBeforeLast(filename, "_.java") + BASE_SUFFIX_; } else { return substringBeforeLast(filename, ".java") + BASE_SUFFIX; } }
java
private String convertFileNameToBaseClassName(String filename) { if (filename.endsWith("_.java")) { return substringBeforeLast(filename, "_.java") + BASE_SUFFIX_; } else { return substringBeforeLast(filename, ".java") + BASE_SUFFIX; } }
[ "private", "String", "convertFileNameToBaseClassName", "(", "String", "filename", ")", "{", "if", "(", "filename", ".", "endsWith", "(", "\"_.java\"", ")", ")", "{", "return", "substringBeforeLast", "(", "filename", ",", "\"_.java\"", ")", "+", "BASE_SUFFIX_", "...
add Base to a given java filename it is used for transparently subclassing generated classes
[ "add", "Base", "to", "a", "given", "java", "filename", "it", "is", "used", "for", "transparently", "subclassing", "generated", "classes" ]
train
https://github.com/jaxio/celerio/blob/fbfacb639e286f9f3f3a18986f74ea275bebd887/celerio-engine/src/main/java/com/jaxio/celerio/template/PreviousEngine.java#L303-L309
rey5137/material
material/src/main/java/com/rey/material/widget/TimePicker.java
TimePicker.setMode
public void setMode(int mode, boolean animation){ if(mMode != mode){ mMode = mode; if(mOnTimeChangedListener != null) mOnTimeChangedListener.onModeChanged(mMode); if(animation) startAnimation(); else invalidate(); } }
java
public void setMode(int mode, boolean animation){ if(mMode != mode){ mMode = mode; if(mOnTimeChangedListener != null) mOnTimeChangedListener.onModeChanged(mMode); if(animation) startAnimation(); else invalidate(); } }
[ "public", "void", "setMode", "(", "int", "mode", ",", "boolean", "animation", ")", "{", "if", "(", "mMode", "!=", "mode", ")", "{", "mMode", "=", "mode", ";", "if", "(", "mOnTimeChangedListener", "!=", "null", ")", "mOnTimeChangedListener", ".", "onModeCha...
Set the select mode of this TimePicker. @param mode The select mode. Can be {@link #MODE_HOUR} or {@link #MODE_MINUTE}. @param animation Indicate that should show animation when switch select mode or not.
[ "Set", "the", "select", "mode", "of", "this", "TimePicker", "." ]
train
https://github.com/rey5137/material/blob/1bbcac2686a0023ef7720d3fe455bb116d115af8/material/src/main/java/com/rey/material/widget/TimePicker.java#L326-L338
couchbase/couchbase-jvm-core
src/main/java/com/couchbase/client/core/utils/yasjl/ByteBufJsonParser.java
ByteBufJsonParser.pushLevel
private void pushLevel(final Mode mode) { JsonLevel newJsonLevel = null; if (mode == Mode.BOM) { newJsonLevel = new JsonLevel(mode, new JsonPointer()); //not a valid nesting level } else if (mode == Mode.JSON_OBJECT) { if (levelStack.size() > 0) { JsonLevel current = levelStack.peek(); newJsonLevel = new JsonLevel(mode, new JsonPointer(current.jsonPointer().tokens())); } else { newJsonLevel = new JsonLevel(mode, new JsonPointer()); } } else if (mode == Mode.JSON_ARRAY) { if (levelStack.size() > 0) { JsonLevel current = levelStack.peek(); newJsonLevel = new JsonLevel(mode, new JsonPointer(current.jsonPointer().tokens())); } else { newJsonLevel = new JsonLevel(mode, new JsonPointer()); } newJsonLevel.isArray(true); newJsonLevel.setArrayIndexOnJsonPointer(); } levelStack.push(newJsonLevel); }
java
private void pushLevel(final Mode mode) { JsonLevel newJsonLevel = null; if (mode == Mode.BOM) { newJsonLevel = new JsonLevel(mode, new JsonPointer()); //not a valid nesting level } else if (mode == Mode.JSON_OBJECT) { if (levelStack.size() > 0) { JsonLevel current = levelStack.peek(); newJsonLevel = new JsonLevel(mode, new JsonPointer(current.jsonPointer().tokens())); } else { newJsonLevel = new JsonLevel(mode, new JsonPointer()); } } else if (mode == Mode.JSON_ARRAY) { if (levelStack.size() > 0) { JsonLevel current = levelStack.peek(); newJsonLevel = new JsonLevel(mode, new JsonPointer(current.jsonPointer().tokens())); } else { newJsonLevel = new JsonLevel(mode, new JsonPointer()); } newJsonLevel.isArray(true); newJsonLevel.setArrayIndexOnJsonPointer(); } levelStack.push(newJsonLevel); }
[ "private", "void", "pushLevel", "(", "final", "Mode", "mode", ")", "{", "JsonLevel", "newJsonLevel", "=", "null", ";", "if", "(", "mode", "==", "Mode", ".", "BOM", ")", "{", "newJsonLevel", "=", "new", "JsonLevel", "(", "mode", ",", "new", "JsonPointer",...
Pushes a new {@link JsonLevel} onto the level stack. @param mode the mode for this level.
[ "Pushes", "a", "new", "{", "@link", "JsonLevel", "}", "onto", "the", "level", "stack", "." ]
train
https://github.com/couchbase/couchbase-jvm-core/blob/97f0427112c2168fee1d6499904f5fa0e24c6797/src/main/java/com/couchbase/client/core/utils/yasjl/ByteBufJsonParser.java#L163-L187
UrielCh/ovh-java-sdk
ovh-java-sdk-licenseoffice/src/main/java/net/minidev/ovh/api/ApiOvhLicenseoffice.java
ApiOvhLicenseoffice.serviceName_domain_domainName_GET
public OvhOfficeDomain serviceName_domain_domainName_GET(String serviceName, String domainName) throws IOException { String qPath = "/license/office/{serviceName}/domain/{domainName}"; StringBuilder sb = path(qPath, serviceName, domainName); String resp = exec(qPath, "GET", sb.toString(), null); return convertTo(resp, OvhOfficeDomain.class); }
java
public OvhOfficeDomain serviceName_domain_domainName_GET(String serviceName, String domainName) throws IOException { String qPath = "/license/office/{serviceName}/domain/{domainName}"; StringBuilder sb = path(qPath, serviceName, domainName); String resp = exec(qPath, "GET", sb.toString(), null); return convertTo(resp, OvhOfficeDomain.class); }
[ "public", "OvhOfficeDomain", "serviceName_domain_domainName_GET", "(", "String", "serviceName", ",", "String", "domainName", ")", "throws", "IOException", "{", "String", "qPath", "=", "\"/license/office/{serviceName}/domain/{domainName}\"", ";", "StringBuilder", "sb", "=", ...
Get this object properties REST: GET /license/office/{serviceName}/domain/{domainName} @param serviceName [required] The unique identifier of your Office service @param domainName [required] Domain name
[ "Get", "this", "object", "properties" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-licenseoffice/src/main/java/net/minidev/ovh/api/ApiOvhLicenseoffice.java#L48-L53
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.beginResumeWithServiceResponseAsync
public Observable<ServiceResponse<Page<SiteInner>>> beginResumeWithServiceResponseAsync(final String resourceGroupName, final String name) { return beginResumeSinglePageAsync(resourceGroupName, name) .concatMap(new Func1<ServiceResponse<Page<SiteInner>>, Observable<ServiceResponse<Page<SiteInner>>>>() { @Override public Observable<ServiceResponse<Page<SiteInner>>> call(ServiceResponse<Page<SiteInner>> page) { String nextPageLink = page.body().nextPageLink(); if (nextPageLink == null) { return Observable.just(page); } return Observable.just(page).concatWith(beginResumeNextWithServiceResponseAsync(nextPageLink)); } }); }
java
public Observable<ServiceResponse<Page<SiteInner>>> beginResumeWithServiceResponseAsync(final String resourceGroupName, final String name) { return beginResumeSinglePageAsync(resourceGroupName, name) .concatMap(new Func1<ServiceResponse<Page<SiteInner>>, Observable<ServiceResponse<Page<SiteInner>>>>() { @Override public Observable<ServiceResponse<Page<SiteInner>>> call(ServiceResponse<Page<SiteInner>> page) { String nextPageLink = page.body().nextPageLink(); if (nextPageLink == null) { return Observable.just(page); } return Observable.just(page).concatWith(beginResumeNextWithServiceResponseAsync(nextPageLink)); } }); }
[ "public", "Observable", "<", "ServiceResponse", "<", "Page", "<", "SiteInner", ">", ">", ">", "beginResumeWithServiceResponseAsync", "(", "final", "String", "resourceGroupName", ",", "final", "String", "name", ")", "{", "return", "beginResumeSinglePageAsync", "(", "...
Resume an App Service Environment. Resume an App Service Environment. @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 observable to the PagedList&lt;SiteInner&gt; object
[ "Resume", "an", "App", "Service", "Environment", ".", "Resume", "an", "App", "Service", "Environment", "." ]
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#L3998-L4010
VoltDB/voltdb
src/frontend/org/voltdb/compiler/VoltCompiler.java
VoltCompiler.getKeyPrefix
String getKeyPrefix(StatementPartitioning partitioning, DeterminismMode detMode, String joinOrder) { // no caching for inferred yet if (partitioning.isInferred()) { return null; } String joinOrderPrefix = "#"; if (joinOrder != null) { joinOrderPrefix += joinOrder; } boolean partitioned = partitioning.wasSpecifiedAsSingle(); return joinOrderPrefix + String.valueOf(detMode.toChar()) + (partitioned ? "P#" : "R#"); }
java
String getKeyPrefix(StatementPartitioning partitioning, DeterminismMode detMode, String joinOrder) { // no caching for inferred yet if (partitioning.isInferred()) { return null; } String joinOrderPrefix = "#"; if (joinOrder != null) { joinOrderPrefix += joinOrder; } boolean partitioned = partitioning.wasSpecifiedAsSingle(); return joinOrderPrefix + String.valueOf(detMode.toChar()) + (partitioned ? "P#" : "R#"); }
[ "String", "getKeyPrefix", "(", "StatementPartitioning", "partitioning", ",", "DeterminismMode", "detMode", ",", "String", "joinOrder", ")", "{", "// no caching for inferred yet", "if", "(", "partitioning", ".", "isInferred", "(", ")", ")", "{", "return", "null", ";"...
Key prefix includes attributes that make a cached statement usable if they match For example, if the SQL is the same, but the partitioning isn't, then the statements aren't actually interchangeable.
[ "Key", "prefix", "includes", "attributes", "that", "make", "a", "cached", "statement", "usable", "if", "they", "match" ]
train
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/compiler/VoltCompiler.java#L2266-L2280
looly/hutool
hutool-core/src/main/java/cn/hutool/core/img/ImgUtil.java
ImgUtil.cut
public static void cut(ImageInputStream srcStream, ImageOutputStream destStream, Rectangle rectangle) { cut(read(srcStream), destStream, rectangle); }
java
public static void cut(ImageInputStream srcStream, ImageOutputStream destStream, Rectangle rectangle) { cut(read(srcStream), destStream, rectangle); }
[ "public", "static", "void", "cut", "(", "ImageInputStream", "srcStream", ",", "ImageOutputStream", "destStream", ",", "Rectangle", "rectangle", ")", "{", "cut", "(", "read", "(", "srcStream", ")", ",", "destStream", ",", "rectangle", ")", ";", "}" ]
图像切割(按指定起点坐标和宽高切割),此方法并不关闭流 @param srcStream 源图像流 @param destStream 切片后的图像输出流 @param rectangle 矩形对象,表示矩形区域的x,y,width,height @since 3.1.0
[ "图像切割", "(", "按指定起点坐标和宽高切割", ")", ",此方法并不关闭流" ]
train
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/img/ImgUtil.java#L280-L282
Azure/azure-sdk-for-java
automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/DscNodesInner.java
DscNodesInner.get
public DscNodeInner get(String resourceGroupName, String automationAccountName, String nodeId) { return getWithServiceResponseAsync(resourceGroupName, automationAccountName, nodeId).toBlocking().single().body(); }
java
public DscNodeInner get(String resourceGroupName, String automationAccountName, String nodeId) { return getWithServiceResponseAsync(resourceGroupName, automationAccountName, nodeId).toBlocking().single().body(); }
[ "public", "DscNodeInner", "get", "(", "String", "resourceGroupName", ",", "String", "automationAccountName", ",", "String", "nodeId", ")", "{", "return", "getWithServiceResponseAsync", "(", "resourceGroupName", ",", "automationAccountName", ",", "nodeId", ")", ".", "t...
Retrieve the dsc node identified by node id. @param resourceGroupName Name of an Azure Resource group. @param automationAccountName The name of the automation account. @param nodeId The node id. @throws IllegalArgumentException thrown if parameters fail the validation @throws ErrorResponseException thrown if the request is rejected by server @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent @return the DscNodeInner object if successful.
[ "Retrieve", "the", "dsc", "node", "identified", "by", "node", "id", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/DscNodesInner.java#L189-L191
joniles/mpxj
src/main/java/net/sf/mpxj/mpx/MPXReader.java
MPXReader.populateCalendarHours
private void populateCalendarHours(Record record, ProjectCalendarHours hours) throws MPXJException { hours.setDay(Day.getInstance(NumberHelper.getInt(record.getInteger(0)))); addDateRange(hours, record.getTime(1), record.getTime(2)); addDateRange(hours, record.getTime(3), record.getTime(4)); addDateRange(hours, record.getTime(5), record.getTime(6)); }
java
private void populateCalendarHours(Record record, ProjectCalendarHours hours) throws MPXJException { hours.setDay(Day.getInstance(NumberHelper.getInt(record.getInteger(0)))); addDateRange(hours, record.getTime(1), record.getTime(2)); addDateRange(hours, record.getTime(3), record.getTime(4)); addDateRange(hours, record.getTime(5), record.getTime(6)); }
[ "private", "void", "populateCalendarHours", "(", "Record", "record", ",", "ProjectCalendarHours", "hours", ")", "throws", "MPXJException", "{", "hours", ".", "setDay", "(", "Day", ".", "getInstance", "(", "NumberHelper", ".", "getInt", "(", "record", ".", "getIn...
Populates a calendar hours instance. @param record MPX record @param hours calendar hours instance @throws MPXJException
[ "Populates", "a", "calendar", "hours", "instance", "." ]
train
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpx/MPXReader.java#L632-L638
apache/predictionio-sdk-java
client/src/main/java/org/apache/predictionio/sdk/java/EventClient.java
EventClient.deleteUser
public String deleteUser(String uid) throws ExecutionException, InterruptedException, IOException { return deleteUser(uid, new DateTime()); }
java
public String deleteUser(String uid) throws ExecutionException, InterruptedException, IOException { return deleteUser(uid, new DateTime()); }
[ "public", "String", "deleteUser", "(", "String", "uid", ")", "throws", "ExecutionException", ",", "InterruptedException", ",", "IOException", "{", "return", "deleteUser", "(", "uid", ",", "new", "DateTime", "(", ")", ")", ";", "}" ]
Deletes a user. Event time is recorded as the time when the function is called. @param uid ID of the user @return ID of this event
[ "Deletes", "a", "user", ".", "Event", "time", "is", "recorded", "as", "the", "time", "when", "the", "function", "is", "called", "." ]
train
https://github.com/apache/predictionio-sdk-java/blob/16052c96b136340c175c3f9c2692e720850df219/client/src/main/java/org/apache/predictionio/sdk/java/EventClient.java#L439-L442
headius/invokebinder
src/main/java/com/headius/invokebinder/SmartBinder.java
SmartBinder.castVirtual
public SmartBinder castVirtual(Class<?> returnType, Class<?> firstArg, Class<?>... restArgs) { return new SmartBinder(this, new Signature(returnType, firstArg, restArgs, signature().argNames()), binder.castVirtual(returnType, firstArg, restArgs)); }
java
public SmartBinder castVirtual(Class<?> returnType, Class<?> firstArg, Class<?>... restArgs) { return new SmartBinder(this, new Signature(returnType, firstArg, restArgs, signature().argNames()), binder.castVirtual(returnType, firstArg, restArgs)); }
[ "public", "SmartBinder", "castVirtual", "(", "Class", "<", "?", ">", "returnType", ",", "Class", "<", "?", ">", "firstArg", ",", "Class", "<", "?", ">", "...", "restArgs", ")", "{", "return", "new", "SmartBinder", "(", "this", ",", "new", "Signature", ...
Cast the incoming arguments to the return, first argument type, and remaining argument types. Provide for convenience when dealing with virtual method argument lists, which frequently omit the target object. @param returnType the return type for the casted signature @param firstArg the type of the first argument for the casted signature @param restArgs the types of the remaining arguments for the casted signature @return a new SmartBinder with the cast applied.
[ "Cast", "the", "incoming", "arguments", "to", "the", "return", "first", "argument", "type", "and", "remaining", "argument", "types", ".", "Provide", "for", "convenience", "when", "dealing", "with", "virtual", "method", "argument", "lists", "which", "frequently", ...
train
https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/SmartBinder.java#L895-L897
b3log/latke
latke-core/src/main/java/org/b3log/latke/event/AbstractEventListener.java
AbstractEventListener.performAction
final void performAction(final AbstractEventQueue eventQueue, final Event<?> event) { final Event<T> eventObject = (Event<T>) event; try { action(eventObject); } catch (final Exception e) { LOGGER.log(Level.WARN, "Event perform failed", e); } finally { // remove event from event queue if (eventQueue instanceof SynchronizedEventQueue) { final SynchronizedEventQueue synchronizedEventQueue = (SynchronizedEventQueue) eventQueue; synchronizedEventQueue.removeEvent(eventObject); } } }
java
final void performAction(final AbstractEventQueue eventQueue, final Event<?> event) { final Event<T> eventObject = (Event<T>) event; try { action(eventObject); } catch (final Exception e) { LOGGER.log(Level.WARN, "Event perform failed", e); } finally { // remove event from event queue if (eventQueue instanceof SynchronizedEventQueue) { final SynchronizedEventQueue synchronizedEventQueue = (SynchronizedEventQueue) eventQueue; synchronizedEventQueue.removeEvent(eventObject); } } }
[ "final", "void", "performAction", "(", "final", "AbstractEventQueue", "eventQueue", ",", "final", "Event", "<", "?", ">", "event", ")", "{", "final", "Event", "<", "T", ">", "eventObject", "=", "(", "Event", "<", "T", ">", ")", "event", ";", "try", "{"...
Performs the listener {@code action} method with the specified event queue and event. @param eventQueue the specified event @param event the specified event @see #action(org.b3log.latke.event.Event)
[ "Performs", "the", "listener", "{", "@code", "action", "}", "method", "with", "the", "specified", "event", "queue", "and", "event", "." ]
train
https://github.com/b3log/latke/blob/f7e08a47eeecea5f7c94006382c24f353585de33/latke-core/src/main/java/org/b3log/latke/event/AbstractEventListener.java#L50-L64
lessthanoptimal/ejml
examples/src/org/ejml/example/PolynomialRootFinder.java
PolynomialRootFinder.findRoots
public static Complex_F64[] findRoots(double... coefficients) { int N = coefficients.length-1; // Construct the companion matrix DMatrixRMaj c = new DMatrixRMaj(N,N); double a = coefficients[N]; for( int i = 0; i < N; i++ ) { c.set(i,N-1,-coefficients[i]/a); } for( int i = 1; i < N; i++ ) { c.set(i,i-1,1); } // use generalized eigenvalue decomposition to find the roots EigenDecomposition_F64<DMatrixRMaj> evd = DecompositionFactory_DDRM.eig(N,false); evd.decompose(c); Complex_F64[] roots = new Complex_F64[N]; for( int i = 0; i < N; i++ ) { roots[i] = evd.getEigenvalue(i); } return roots; }
java
public static Complex_F64[] findRoots(double... coefficients) { int N = coefficients.length-1; // Construct the companion matrix DMatrixRMaj c = new DMatrixRMaj(N,N); double a = coefficients[N]; for( int i = 0; i < N; i++ ) { c.set(i,N-1,-coefficients[i]/a); } for( int i = 1; i < N; i++ ) { c.set(i,i-1,1); } // use generalized eigenvalue decomposition to find the roots EigenDecomposition_F64<DMatrixRMaj> evd = DecompositionFactory_DDRM.eig(N,false); evd.decompose(c); Complex_F64[] roots = new Complex_F64[N]; for( int i = 0; i < N; i++ ) { roots[i] = evd.getEigenvalue(i); } return roots; }
[ "public", "static", "Complex_F64", "[", "]", "findRoots", "(", "double", "...", "coefficients", ")", "{", "int", "N", "=", "coefficients", ".", "length", "-", "1", ";", "// Construct the companion matrix", "DMatrixRMaj", "c", "=", "new", "DMatrixRMaj", "(", "N...
<p> Given a set of polynomial coefficients, compute the roots of the polynomial. Depending on the polynomial being considered the roots may contain complex number. When complex numbers are present they will come in pairs of complex conjugates. </p> <p> Coefficients are ordered from least to most significant, e.g: y = c[0] + x*c[1] + x*x*c[2]. </p> @param coefficients Coefficients of the polynomial. @return The roots of the polynomial
[ "<p", ">", "Given", "a", "set", "of", "polynomial", "coefficients", "compute", "the", "roots", "of", "the", "polynomial", ".", "Depending", "on", "the", "polynomial", "being", "considered", "the", "roots", "may", "contain", "complex", "number", ".", "When", ...
train
https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/examples/src/org/ejml/example/PolynomialRootFinder.java#L62-L88
cycorp/api-suite
core-api/src/main/java/com/cyc/session/ServerAddress.java
ServerAddress.fromString
public static ServerAddress fromString(String string) { String tokens[] = string.split(":"); if (tokens.length == 1) { return new ServerAddress(tokens[0], null); } return new ServerAddress(tokens[0], Integer.valueOf(tokens[1])); }
java
public static ServerAddress fromString(String string) { String tokens[] = string.split(":"); if (tokens.length == 1) { return new ServerAddress(tokens[0], null); } return new ServerAddress(tokens[0], Integer.valueOf(tokens[1])); }
[ "public", "static", "ServerAddress", "fromString", "(", "String", "string", ")", "{", "String", "tokens", "[", "]", "=", "string", ".", "split", "(", "\":\"", ")", ";", "if", "(", "tokens", ".", "length", "==", "1", ")", "{", "return", "new", "ServerAd...
Creates a new ServerAddress instance from a string matching the format <code>host:port</code>. @param string a string matching the format <code>host:port</code>. @return A new ServerAddress instance based on the string representation.
[ "Creates", "a", "new", "ServerAddress", "instance", "from", "a", "string", "matching", "the", "format", "<code", ">", "host", ":", "port<", "/", "code", ">", "." ]
train
https://github.com/cycorp/api-suite/blob/1d52affabc4635e3715a059e38741712cbdbf2d5/core-api/src/main/java/com/cyc/session/ServerAddress.java#L118-L124
legsem/legstar-core2
legstar-cob2xsd/src/main/java/com/legstar/cob2xsd/Cob2Xsd.java
Cob2Xsd.emitXsd
public XmlSchema emitXsd(final List < CobolDataItem > cobolDataItems, final String targetNamespace) { if (_log.isDebugEnabled()) { _log.debug("5. Emitting XML Schema from model: {}", cobolDataItems.toString()); } XmlSchema xsd = createXmlSchema(getConfig().getXsdEncoding(), targetNamespace); List < String > nonUniqueCobolNames = getNonUniqueCobolNames(cobolDataItems); XsdEmitter emitter = new XsdEmitter(xsd, getConfig()); for (CobolDataItem cobolDataItem : cobolDataItems) { if (getConfig().ignoreOrphanPrimitiveElements() && cobolDataItem.getChildren().size() == 0) { continue; } XsdDataItem xsdDataItem = new XsdDataItem(cobolDataItem, getConfig(), null, 0, nonUniqueCobolNames, _errorHandler); // Create and add a root element xsd.getItems().add(emitter.createXmlSchemaElement(xsdDataItem)); } return xsd; }
java
public XmlSchema emitXsd(final List < CobolDataItem > cobolDataItems, final String targetNamespace) { if (_log.isDebugEnabled()) { _log.debug("5. Emitting XML Schema from model: {}", cobolDataItems.toString()); } XmlSchema xsd = createXmlSchema(getConfig().getXsdEncoding(), targetNamespace); List < String > nonUniqueCobolNames = getNonUniqueCobolNames(cobolDataItems); XsdEmitter emitter = new XsdEmitter(xsd, getConfig()); for (CobolDataItem cobolDataItem : cobolDataItems) { if (getConfig().ignoreOrphanPrimitiveElements() && cobolDataItem.getChildren().size() == 0) { continue; } XsdDataItem xsdDataItem = new XsdDataItem(cobolDataItem, getConfig(), null, 0, nonUniqueCobolNames, _errorHandler); // Create and add a root element xsd.getItems().add(emitter.createXmlSchemaElement(xsdDataItem)); } return xsd; }
[ "public", "XmlSchema", "emitXsd", "(", "final", "List", "<", "CobolDataItem", ">", "cobolDataItems", ",", "final", "String", "targetNamespace", ")", "{", "if", "(", "_log", ".", "isDebugEnabled", "(", ")", ")", "{", "_log", ".", "debug", "(", "\"5. Emitting ...
Generate an XML Schema using a model of COBOL data items. The model is a list of root level items. From these, we only process group items (structures) with children. @param cobolDataItems a list of COBOL data items @param targetNamespace the target namespace to use (null for no namespace) @return the XML schema
[ "Generate", "an", "XML", "Schema", "using", "a", "model", "of", "COBOL", "data", "items", ".", "The", "model", "is", "a", "list", "of", "root", "level", "items", ".", "From", "these", "we", "only", "process", "group", "items", "(", "structures", ")", "...
train
https://github.com/legsem/legstar-core2/blob/f74d25d5b2b21a2ebaaaf2162b3fb7138dca40c6/legstar-cob2xsd/src/main/java/com/legstar/cob2xsd/Cob2Xsd.java#L264-L283
JOML-CI/JOML
src/org/joml/Matrix4f.java
Matrix4f.rotateAffineXYZ
public Matrix4f rotateAffineXYZ(float angleX, float angleY, float angleZ) { return rotateAffineXYZ(angleX, angleY, angleZ, thisOrNew()); }
java
public Matrix4f rotateAffineXYZ(float angleX, float angleY, float angleZ) { return rotateAffineXYZ(angleX, angleY, angleZ, thisOrNew()); }
[ "public", "Matrix4f", "rotateAffineXYZ", "(", "float", "angleX", ",", "float", "angleY", ",", "float", "angleZ", ")", "{", "return", "rotateAffineXYZ", "(", "angleX", ",", "angleY", ",", "angleZ", ",", "thisOrNew", "(", ")", ")", ";", "}" ]
Apply rotation of <code>angleX</code> radians about the X axis, followed by a rotation of <code>angleY</code> radians about the Y axis and followed by a rotation of <code>angleZ</code> radians about the Z axis. <p> When used with a right-handed coordinate system, the produced rotation will rotate a vector counter-clockwise around the rotation axis, when viewing along the negative axis direction towards the origin. When used with a left-handed coordinate system, the rotation is clockwise. <p> This method assumes that <code>this</code> matrix represents an {@link #isAffine() affine} transformation (i.e. its last row is equal to <code>(0, 0, 0, 1)</code>) and can be used to speed up matrix multiplication if the matrix only represents affine transformations, such as translation, rotation, scaling and shearing (in any combination). <p> If <code>M</code> is <code>this</code> matrix and <code>R</code> the rotation matrix, then the new matrix will be <code>M * R</code>. So when transforming a vector <code>v</code> with the new matrix by using <code>M * R * v</code>, the rotation will be applied first! <p> This method is equivalent to calling: <code>rotateX(angleX).rotateY(angleY).rotateZ(angleZ)</code> @param angleX the angle to rotate about X @param angleY the angle to rotate about Y @param angleZ the angle to rotate about Z @return a matrix holding the result
[ "Apply", "rotation", "of", "<code", ">", "angleX<", "/", "code", ">", "radians", "about", "the", "X", "axis", "followed", "by", "a", "rotation", "of", "<code", ">", "angleY<", "/", "code", ">", "radians", "about", "the", "Y", "axis", "and", "followed", ...
train
https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4f.java#L5399-L5401
Stratio/stratio-cassandra
src/java/org/apache/cassandra/tools/SSTableExport.java
SSTableExport.serializeRow
private static void serializeRow(SSTableIdentityIterator row, DecoratedKey key, PrintStream out) { serializeRow(row.getColumnFamily().deletionInfo(), row, row.getColumnFamily().metadata(), key, out); }
java
private static void serializeRow(SSTableIdentityIterator row, DecoratedKey key, PrintStream out) { serializeRow(row.getColumnFamily().deletionInfo(), row, row.getColumnFamily().metadata(), key, out); }
[ "private", "static", "void", "serializeRow", "(", "SSTableIdentityIterator", "row", ",", "DecoratedKey", "key", ",", "PrintStream", "out", ")", "{", "serializeRow", "(", "row", ".", "getColumnFamily", "(", ")", ".", "deletionInfo", "(", ")", ",", "row", ",", ...
Get portion of the columns and serialize in loop while not more columns left in the row @param row SSTableIdentityIterator row representation with Column Family @param key Decorated Key for the required row @param out output stream
[ "Get", "portion", "of", "the", "columns", "and", "serialize", "in", "loop", "while", "not", "more", "columns", "left", "in", "the", "row" ]
train
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/tools/SSTableExport.java#L179-L182
datastax/java-driver
query-builder/src/main/java/com/datastax/oss/driver/api/querybuilder/SchemaBuilder.java
SchemaBuilder.createTable
@NonNull public static CreateTableStart createTable( @Nullable CqlIdentifier keyspace, @NonNull CqlIdentifier tableName) { return new DefaultCreateTable(keyspace, tableName); }
java
@NonNull public static CreateTableStart createTable( @Nullable CqlIdentifier keyspace, @NonNull CqlIdentifier tableName) { return new DefaultCreateTable(keyspace, tableName); }
[ "@", "NonNull", "public", "static", "CreateTableStart", "createTable", "(", "@", "Nullable", "CqlIdentifier", "keyspace", ",", "@", "NonNull", "CqlIdentifier", "tableName", ")", "{", "return", "new", "DefaultCreateTable", "(", "keyspace", ",", "tableName", ")", ";...
Starts a CREATE TABLE query with the given table name for the given keyspace name.
[ "Starts", "a", "CREATE", "TABLE", "query", "with", "the", "given", "table", "name", "for", "the", "given", "keyspace", "name", "." ]
train
https://github.com/datastax/java-driver/blob/612a63f2525618e2020e86c9ad75ab37adba6132/query-builder/src/main/java/com/datastax/oss/driver/api/querybuilder/SchemaBuilder.java#L118-L122
UrielCh/ovh-java-sdk
ovh-java-sdk-domain/src/main/java/net/minidev/ovh/api/ApiOvhDomain.java
ApiOvhDomain.data_afnicAssociationInformation_POST
public OvhAssociationContact data_afnicAssociationInformation_POST(Long contactId, Date declarationDate, Date publicationDate, String publicationNumber, String publicationPageNumber) throws IOException { String qPath = "/domain/data/afnicAssociationInformation"; StringBuilder sb = path(qPath); HashMap<String, Object>o = new HashMap<String, Object>(); addBody(o, "contactId", contactId); addBody(o, "declarationDate", declarationDate); addBody(o, "publicationDate", publicationDate); addBody(o, "publicationNumber", publicationNumber); addBody(o, "publicationPageNumber", publicationPageNumber); String resp = exec(qPath, "POST", sb.toString(), o); return convertTo(resp, OvhAssociationContact.class); }
java
public OvhAssociationContact data_afnicAssociationInformation_POST(Long contactId, Date declarationDate, Date publicationDate, String publicationNumber, String publicationPageNumber) throws IOException { String qPath = "/domain/data/afnicAssociationInformation"; StringBuilder sb = path(qPath); HashMap<String, Object>o = new HashMap<String, Object>(); addBody(o, "contactId", contactId); addBody(o, "declarationDate", declarationDate); addBody(o, "publicationDate", publicationDate); addBody(o, "publicationNumber", publicationNumber); addBody(o, "publicationPageNumber", publicationPageNumber); String resp = exec(qPath, "POST", sb.toString(), o); return convertTo(resp, OvhAssociationContact.class); }
[ "public", "OvhAssociationContact", "data_afnicAssociationInformation_POST", "(", "Long", "contactId", ",", "Date", "declarationDate", ",", "Date", "publicationDate", ",", "String", "publicationNumber", ",", "String", "publicationPageNumber", ")", "throws", "IOException", "{...
Post a new association information according to Afnic REST: POST /domain/data/afnicAssociationInformation @param declarationDate [required] Date of the declaration of the association @param publicationDate [required] Date of the publication of the declaration of the association @param publicationNumber [required] Number of the publication of the declaration of the association @param publicationPageNumber [required] Page number of the publication of the declaration of the association @param contactId [required] Contact ID related to the association contact information
[ "Post", "a", "new", "association", "information", "according", "to", "Afnic" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-domain/src/main/java/net/minidev/ovh/api/ApiOvhDomain.java#L198-L209
fuinorg/utils4j
src/main/java/org/fuin/utils4j/WaitHelper.java
WaitHelper.waitUntilNoMoreException
public void waitUntilNoMoreException(final Runnable runnable, final List<Class<? extends Exception>> expectedExceptions) { final List<RuntimeException> actualExceptions = new ArrayList<>(); int tries = 0; while (tries < maxTries) { try { runnable.run(); return; } catch (final RuntimeException ex) { if (!Utils4J.expectedException(ex, expectedExceptions) && !Utils4J.expectedCause(ex, expectedExceptions)) { throw ex; } actualExceptions.add(ex); tries++; Utils4J.sleep(sleepMillis); } } throw new IllegalStateException("Waited too long for execution without exception. Expected exceptions: " + expectedExceptions + ", Actual exceptions: " + actualExceptions); }
java
public void waitUntilNoMoreException(final Runnable runnable, final List<Class<? extends Exception>> expectedExceptions) { final List<RuntimeException> actualExceptions = new ArrayList<>(); int tries = 0; while (tries < maxTries) { try { runnable.run(); return; } catch (final RuntimeException ex) { if (!Utils4J.expectedException(ex, expectedExceptions) && !Utils4J.expectedCause(ex, expectedExceptions)) { throw ex; } actualExceptions.add(ex); tries++; Utils4J.sleep(sleepMillis); } } throw new IllegalStateException("Waited too long for execution without exception. Expected exceptions: " + expectedExceptions + ", Actual exceptions: " + actualExceptions); }
[ "public", "void", "waitUntilNoMoreException", "(", "final", "Runnable", "runnable", ",", "final", "List", "<", "Class", "<", "?", "extends", "Exception", ">", ">", "expectedExceptions", ")", "{", "final", "List", "<", "RuntimeException", ">", "actualExceptions", ...
Wait until no more expected exception is thrown or the number of wait cycles has been exceeded. @param runnable Code to run. @param expectedExceptions List of expected exceptions.
[ "Wait", "until", "no", "more", "expected", "exception", "is", "thrown", "or", "the", "number", "of", "wait", "cycles", "has", "been", "exceeded", "." ]
train
https://github.com/fuinorg/utils4j/blob/71cf88e0a8d8ed67bbac513bf3cab165cd7e3280/src/main/java/org/fuin/utils4j/WaitHelper.java#L55-L75
alkacon/opencms-core
src/org/opencms/db/CmsSecurityManager.java
CmsSecurityManager.initializeOrgUnit
public void initializeOrgUnit(CmsRequestContext context, CmsOrganizationalUnit ou) { CmsDbContext dbc = m_dbContextFactory.getDbContext(context); m_driverManager.initOrgUnit(dbc, ou); }
java
public void initializeOrgUnit(CmsRequestContext context, CmsOrganizationalUnit ou) { CmsDbContext dbc = m_dbContextFactory.getDbContext(context); m_driverManager.initOrgUnit(dbc, ou); }
[ "public", "void", "initializeOrgUnit", "(", "CmsRequestContext", "context", ",", "CmsOrganizationalUnit", "ou", ")", "{", "CmsDbContext", "dbc", "=", "m_dbContextFactory", ".", "getDbContext", "(", "context", ")", ";", "m_driverManager", ".", "initOrgUnit", "(", "db...
Initializes the default groups for an organizational unit.<p> @param context the request context @param ou the organizational unit
[ "Initializes", "the", "default", "groups", "for", "an", "organizational", "unit", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsSecurityManager.java#L3477-L3482
skjolber/3d-bin-container-packing
src/main/java/com/github/skjolberg/packing/LargestAreaFitFirstPackager.java
LargestAreaFitFirstPackager.isBetter3D
protected int isBetter3D(Box a, Box b, Space space) { int compare = Long.compare(a.getVolume(), b.getVolume()); if(compare != 0) { return compare; } // determine lowest fit a.fitRotate3DSmallestFootprint(space); b.fitRotate3DSmallestFootprint(space); return Long.compare(b.getFootprint(), a.getFootprint()); // i.e. smaller i better }
java
protected int isBetter3D(Box a, Box b, Space space) { int compare = Long.compare(a.getVolume(), b.getVolume()); if(compare != 0) { return compare; } // determine lowest fit a.fitRotate3DSmallestFootprint(space); b.fitRotate3DSmallestFootprint(space); return Long.compare(b.getFootprint(), a.getFootprint()); // i.e. smaller i better }
[ "protected", "int", "isBetter3D", "(", "Box", "a", ",", "Box", "b", ",", "Space", "space", ")", "{", "int", "compare", "=", "Long", ".", "compare", "(", "a", ".", "getVolume", "(", ")", ",", "b", ".", "getVolume", "(", ")", ")", ";", "if", "(", ...
Is box b strictly better than a? @param a box @param b box @param space free space @return -1 if b is better, 0 if equal, 1 if b is better
[ "Is", "box", "b", "strictly", "better", "than", "a?" ]
train
https://github.com/skjolber/3d-bin-container-packing/blob/9609bc7515322b2de2cad0dfb3d2f72607e71aae/src/main/java/com/github/skjolberg/packing/LargestAreaFitFirstPackager.java#L450-L460
moparisthebest/beehive
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/javascript/ScriptRequestState.java
ScriptRequestState.mapLegacyTagId
public String mapLegacyTagId(IScriptReporter scriptReporter, String tagId, String value) { if (scriptReporter != null) { scriptReporter.addLegacyTagIdMappings(tagId, value); return null; } // without a scripRepoter we need to create the actual JavaScript that will be written out InternalStringBuilder sb = new InternalStringBuilder(64); StringBuilderRenderAppender writer = new StringBuilderRenderAppender(sb); getTagIdMapping(tagId, value, writer); return sb.toString(); }
java
public String mapLegacyTagId(IScriptReporter scriptReporter, String tagId, String value) { if (scriptReporter != null) { scriptReporter.addLegacyTagIdMappings(tagId, value); return null; } // without a scripRepoter we need to create the actual JavaScript that will be written out InternalStringBuilder sb = new InternalStringBuilder(64); StringBuilderRenderAppender writer = new StringBuilderRenderAppender(sb); getTagIdMapping(tagId, value, writer); return sb.toString(); }
[ "public", "String", "mapLegacyTagId", "(", "IScriptReporter", "scriptReporter", ",", "String", "tagId", ",", "String", "value", ")", "{", "if", "(", "scriptReporter", "!=", "null", ")", "{", "scriptReporter", ".", "addLegacyTagIdMappings", "(", "tagId", ",", "va...
This method will add a tagId and value to the ScriptRepoter TagId map. The a ScriptContainer tag will create a JavaScript table that allows the container, such as a portal, to rewrite the id so it's unique. The real name may be looked up based upon the tagId. If the no ScriptReporter is found, a script string will be returned to the caller so they can output the script block. @param tagId @param value @return String
[ "This", "method", "will", "add", "a", "tagId", "and", "value", "to", "the", "ScriptRepoter", "TagId", "map", ".", "The", "a", "ScriptContainer", "tag", "will", "create", "a", "JavaScript", "table", "that", "allows", "the", "container", "such", "as", "a", "...
train
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/javascript/ScriptRequestState.java#L192-L204
hibernate/hibernate-ogm
core/src/main/java/org/hibernate/ogm/boot/impl/OgmServiceRegistryInitializer.java
OgmServiceRegistryInitializer.isOgmImplicitEnabled
private boolean isOgmImplicitEnabled(Map<?, ?> settings) { String jdbcUrl = new ConfigurationPropertyReader( settings ) .property( Environment.URL, String.class ) .getValue(); String jndiDatasource = new ConfigurationPropertyReader( settings ) .property( Environment.DATASOURCE, String.class ) .getValue(); String dialect = new ConfigurationPropertyReader( settings ) .property( Environment.DIALECT, String.class ) .getValue(); return jdbcUrl == null && jndiDatasource == null && dialect == null; }
java
private boolean isOgmImplicitEnabled(Map<?, ?> settings) { String jdbcUrl = new ConfigurationPropertyReader( settings ) .property( Environment.URL, String.class ) .getValue(); String jndiDatasource = new ConfigurationPropertyReader( settings ) .property( Environment.DATASOURCE, String.class ) .getValue(); String dialect = new ConfigurationPropertyReader( settings ) .property( Environment.DIALECT, String.class ) .getValue(); return jdbcUrl == null && jndiDatasource == null && dialect == null; }
[ "private", "boolean", "isOgmImplicitEnabled", "(", "Map", "<", "?", ",", "?", ">", "settings", ")", "{", "String", "jdbcUrl", "=", "new", "ConfigurationPropertyReader", "(", "settings", ")", ".", "property", "(", "Environment", ".", "URL", ",", "String", "."...
Decides if we need to start OGM when {@link OgmProperties#ENABLED} is not set. At the moment, if a dialect class is not declared, Hibernate ORM requires a datasource or a JDBC connector when a dialect is not declared. If none of those properties are declared, we assume the user wants to start Hibernate OGM. @param settings @return {@code true} if we have to start OGM, {@code false} otherwise
[ "Decides", "if", "we", "need", "to", "start", "OGM", "when", "{", "@link", "OgmProperties#ENABLED", "}", "is", "not", "set", ".", "At", "the", "moment", "if", "a", "dialect", "class", "is", "not", "declared", "Hibernate", "ORM", "requires", "a", "datasourc...
train
https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/boot/impl/OgmServiceRegistryInitializer.java#L108-L122
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/AnycastOutputHandler.java
AnycastOutputHandler.writeStartedFlush
public final Item writeStartedFlush(TransactionCommon t, AOStream stream) throws Exception { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "writeStartedFlush"); String key = SIMPUtils.getRemoteGetKey(stream.getRemoteMEUuid(), stream.getGatheringTargetDestUuid()); StreamInfo sinfo = streamTable.get(key); if ((sinfo != null) && sinfo.streamId.equals(stream.streamId)) { AOStartedFlushItem item = new AOStartedFlushItem(key, stream.streamId); Transaction msTran = mp.resolveAndEnlistMsgStoreTransaction(t); this.containerItemStream.addItem(item, msTran); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "writeStartedFlush", item); return item; } // this should not occur // log error and throw exception SIErrorException e = new SIErrorException( nls.getFormattedMessage( "INTERNAL_MESSAGING_ERROR_CWSIP0001", new Object[] { "com.ibm.ws.sib.processor.impl.AnycastOutputHandler", "1:2810:1.89.4.1" }, null)); // FFDC FFDCFilter.processException( e, "com.ibm.ws.sib.processor.impl.AnycastOutputHandler.writeStartedFlush", "1:2817:1.89.4.1", this); SibTr.exception(tc, e); SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0001", new Object[] { "com.ibm.ws.sib.processor.impl.AnycastOutputHandler", "1:2822:1.89.4.1" }); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "writeStartedFlush", e); throw e; }
java
public final Item writeStartedFlush(TransactionCommon t, AOStream stream) throws Exception { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "writeStartedFlush"); String key = SIMPUtils.getRemoteGetKey(stream.getRemoteMEUuid(), stream.getGatheringTargetDestUuid()); StreamInfo sinfo = streamTable.get(key); if ((sinfo != null) && sinfo.streamId.equals(stream.streamId)) { AOStartedFlushItem item = new AOStartedFlushItem(key, stream.streamId); Transaction msTran = mp.resolveAndEnlistMsgStoreTransaction(t); this.containerItemStream.addItem(item, msTran); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "writeStartedFlush", item); return item; } // this should not occur // log error and throw exception SIErrorException e = new SIErrorException( nls.getFormattedMessage( "INTERNAL_MESSAGING_ERROR_CWSIP0001", new Object[] { "com.ibm.ws.sib.processor.impl.AnycastOutputHandler", "1:2810:1.89.4.1" }, null)); // FFDC FFDCFilter.processException( e, "com.ibm.ws.sib.processor.impl.AnycastOutputHandler.writeStartedFlush", "1:2817:1.89.4.1", this); SibTr.exception(tc, e); SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0001", new Object[] { "com.ibm.ws.sib.processor.impl.AnycastOutputHandler", "1:2822:1.89.4.1" }); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "writeStartedFlush", e); throw e; }
[ "public", "final", "Item", "writeStartedFlush", "(", "TransactionCommon", "t", ",", "AOStream", "stream", ")", "throws", "Exception", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "Sib...
Helper method used by AOStream to persistently record that flush has been started @param t the transaction @param stream the stream making this call @return the Item written @throws Exception
[ "Helper", "method", "used", "by", "AOStream", "to", "persistently", "record", "that", "flush", "has", "been", "started" ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/AnycastOutputHandler.java#L2740-L2782
elki-project/elki
addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGPlot.java
SVGPlot.svgRect
public Element svgRect(double x, double y, double w, double h) { return SVGUtil.svgRect(document, x, y, w, h); }
java
public Element svgRect(double x, double y, double w, double h) { return SVGUtil.svgRect(document, x, y, w, h); }
[ "public", "Element", "svgRect", "(", "double", "x", ",", "double", "y", ",", "double", "w", ",", "double", "h", ")", "{", "return", "SVGUtil", ".", "svgRect", "(", "document", ",", "x", ",", "y", ",", "w", ",", "h", ")", ";", "}" ]
Create a SVG rectangle @param x X coordinate @param y Y coordinate @param w Width @param h Height @return new element
[ "Create", "a", "SVG", "rectangle" ]
train
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGPlot.java#L254-L256
h2oai/h2o-2
src/main/java/water/exec/Env.java
Env.subRef
public Futures subRef( Vec vec, Futures fs ) { assert fs != null : "Future should not be null!"; if ( vec.masterVec() != null ) subRef(vec.masterVec(), fs); int cnt = _refcnt.get(vec)._val-1; if ( cnt > 0 ) { _refcnt.put(vec,new IcedInt(cnt)); } else { UKV.remove(vec._key,fs); _refcnt.remove(vec); } return fs; }
java
public Futures subRef( Vec vec, Futures fs ) { assert fs != null : "Future should not be null!"; if ( vec.masterVec() != null ) subRef(vec.masterVec(), fs); int cnt = _refcnt.get(vec)._val-1; if ( cnt > 0 ) { _refcnt.put(vec,new IcedInt(cnt)); } else { UKV.remove(vec._key,fs); _refcnt.remove(vec); } return fs; }
[ "public", "Futures", "subRef", "(", "Vec", "vec", ",", "Futures", "fs", ")", "{", "assert", "fs", "!=", "null", ":", "\"Future should not be null!\"", ";", "if", "(", "vec", ".", "masterVec", "(", ")", "!=", "null", ")", "subRef", "(", "vec", ".", "mas...
Subtract reference count. @param vec vector to handle @param fs future, cannot be null @return returns given Future
[ "Subtract", "reference", "count", "." ]
train
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/exec/Env.java#L279-L290
biojava/biojava
biojava-protein-disorder/src/main/java/org/biojava/nbio/ronn/Jronn.java
Jronn.scoresToRanges
public static Range[] scoresToRanges(float[] scores, float probability) { assert scores!=null && scores.length>0; assert probability>0 && probability<1; int count=0; int regionLen=0; List<Range> ranges = new ArrayList<Range>(); for(float score: scores) { count++; // Round to 2 decimal points before comparison score = (float) (Math.round(score*100.0)/100.0); if(score>probability) { regionLen++; } else { if(regionLen>0) { ranges.add(new Range(count-regionLen, count-1,score)); } regionLen=0; } } // In case of the range to boundary runs to the very end of the sequence if(regionLen>1) { ranges.add(new Range(count-regionLen+1, count,scores[scores.length-1])); } return ranges.toArray(new Range[ranges.size()]); }
java
public static Range[] scoresToRanges(float[] scores, float probability) { assert scores!=null && scores.length>0; assert probability>0 && probability<1; int count=0; int regionLen=0; List<Range> ranges = new ArrayList<Range>(); for(float score: scores) { count++; // Round to 2 decimal points before comparison score = (float) (Math.round(score*100.0)/100.0); if(score>probability) { regionLen++; } else { if(regionLen>0) { ranges.add(new Range(count-regionLen, count-1,score)); } regionLen=0; } } // In case of the range to boundary runs to the very end of the sequence if(regionLen>1) { ranges.add(new Range(count-regionLen+1, count,scores[scores.length-1])); } return ranges.toArray(new Range[ranges.size()]); }
[ "public", "static", "Range", "[", "]", "scoresToRanges", "(", "float", "[", "]", "scores", ",", "float", "probability", ")", "{", "assert", "scores", "!=", "null", "&&", "scores", ".", "length", ">", "0", ";", "assert", "probability", ">", "0", "&&", "...
Convert raw scores to ranges. Gives ranges for given probability of disorder value @param scores the raw probability of disorder scores for each residue in the sequence. @param probability the cut off threshold. Include all residues with the probability of disorder greater then this value @return the array of ranges if there are any residues predicted to have the probability of disorder greater then {@code probability}, null otherwise.
[ "Convert", "raw", "scores", "to", "ranges", ".", "Gives", "ranges", "for", "given", "probability", "of", "disorder", "value" ]
train
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-protein-disorder/src/main/java/org/biojava/nbio/ronn/Jronn.java#L212-L238
zxing/zxing
javase/src/main/java/com/google/zxing/client/j2se/MatrixToImageWriter.java
MatrixToImageWriter.writeToStream
public static void writeToStream(BitMatrix matrix, String format, OutputStream stream) throws IOException { writeToStream(matrix, format, stream, DEFAULT_CONFIG); }
java
public static void writeToStream(BitMatrix matrix, String format, OutputStream stream) throws IOException { writeToStream(matrix, format, stream, DEFAULT_CONFIG); }
[ "public", "static", "void", "writeToStream", "(", "BitMatrix", "matrix", ",", "String", "format", ",", "OutputStream", "stream", ")", "throws", "IOException", "{", "writeToStream", "(", "matrix", ",", "format", ",", "stream", ",", "DEFAULT_CONFIG", ")", ";", "...
Writes a {@link BitMatrix} to a stream with default configuration. @param matrix {@link BitMatrix} to write @param format image format @param stream {@link OutputStream} to write image to @throws IOException if writes to the stream fail @see #toBufferedImage(BitMatrix)
[ "Writes", "a", "{", "@link", "BitMatrix", "}", "to", "a", "stream", "with", "default", "configuration", "." ]
train
https://github.com/zxing/zxing/blob/653ac2a3beb11481eff82e7d5f2bab8a745f7fac/javase/src/main/java/com/google/zxing/client/j2se/MatrixToImageWriter.java#L143-L145
operasoftware/operaprestodriver
src/com/opera/core/systems/OperaDesktopDriver.java
OperaDesktopDriver.keyPress
public void keyPress(String key, List<ModifierPressed> modifiers) { systemInputManager.keyPress(key, modifiers); }
java
public void keyPress(String key, List<ModifierPressed> modifiers) { systemInputManager.keyPress(key, modifiers); }
[ "public", "void", "keyPress", "(", "String", "key", ",", "List", "<", "ModifierPressed", ">", "modifiers", ")", "{", "systemInputManager", ".", "keyPress", "(", "key", ",", "modifiers", ")", ";", "}" ]
Press Key with modifiers held down. @param key key to press @param modifiers modifiers held
[ "Press", "Key", "with", "modifiers", "held", "down", "." ]
train
https://github.com/operasoftware/operaprestodriver/blob/1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01/src/com/opera/core/systems/OperaDesktopDriver.java#L600-L602
lightblueseas/file-worker
src/main/java/de/alpharogroup/file/read/ReadFileExtensions.java
ReadFileExtensions.readLinesInList
public static List<String> readLinesInList(final InputStream input, final Charset encoding, final boolean trim) throws IOException { // The List where the lines from the File to save. final List<String> output = new ArrayList<>(); try ( InputStreamReader isr = encoding == null ? new InputStreamReader(input) : new InputStreamReader(input, encoding); BufferedReader reader = new BufferedReader(isr);) { // the line. String line = null; // read all lines from the file do { line = reader.readLine(); // if null break the loop if (line == null) { break; } if (trim) { line.trim(); } // add the line to the list output.add(line); } while (true); } // return the list with all lines from the file. return output; }
java
public static List<String> readLinesInList(final InputStream input, final Charset encoding, final boolean trim) throws IOException { // The List where the lines from the File to save. final List<String> output = new ArrayList<>(); try ( InputStreamReader isr = encoding == null ? new InputStreamReader(input) : new InputStreamReader(input, encoding); BufferedReader reader = new BufferedReader(isr);) { // the line. String line = null; // read all lines from the file do { line = reader.readLine(); // if null break the loop if (line == null) { break; } if (trim) { line.trim(); } // add the line to the list output.add(line); } while (true); } // return the list with all lines from the file. return output; }
[ "public", "static", "List", "<", "String", ">", "readLinesInList", "(", "final", "InputStream", "input", ",", "final", "Charset", "encoding", ",", "final", "boolean", "trim", ")", "throws", "IOException", "{", "// The List where the lines from the File to save.", "fin...
Reads every line from the given InputStream and puts them to the List. @param input The InputStream from where the input comes. @param encoding the charset for read @param trim the flag trim if the lines shell be trimed. @return The List with all lines from the file. @throws IOException When a io-problem occurs.
[ "Reads", "every", "line", "from", "the", "given", "InputStream", "and", "puts", "them", "to", "the", "List", "." ]
train
https://github.com/lightblueseas/file-worker/blob/2c81de10fb5d68de64c1abc3ed64ca681ce76da8/src/main/java/de/alpharogroup/file/read/ReadFileExtensions.java#L332-L365
Tristan971/EasyFXML
easyfxml/src/main/java/moe/tristan/easyfxml/util/Stages.java
Stages.setStylesheet
public static CompletionStage<Stage> setStylesheet(final Stage stage, final FxmlStylesheet stylesheet) { return setStylesheet(stage, stylesheet.getExternalForm()); }
java
public static CompletionStage<Stage> setStylesheet(final Stage stage, final FxmlStylesheet stylesheet) { return setStylesheet(stage, stylesheet.getExternalForm()); }
[ "public", "static", "CompletionStage", "<", "Stage", ">", "setStylesheet", "(", "final", "Stage", "stage", ",", "final", "FxmlStylesheet", "stylesheet", ")", "{", "return", "setStylesheet", "(", "stage", ",", "stylesheet", ".", "getExternalForm", "(", ")", ")", ...
See {@link #setStylesheet(Stage, String)} @param stage The stage to apply the style to @param stylesheet The {@link FxmlStylesheet} pointing to the stylesheet to apply @return A {@link CompletionStage} to have monitoring over the state of the asynchronous operation
[ "See", "{", "@link", "#setStylesheet", "(", "Stage", "String", ")", "}" ]
train
https://github.com/Tristan971/EasyFXML/blob/f82cad1d54e62903ca5e4a250279ad315b028aef/easyfxml/src/main/java/moe/tristan/easyfxml/util/Stages.java#L133-L135
ineunetOS/knife-commons
knife-commons-utils/src/main/java/com/ineunet/knife/util/StringUtils.java
StringUtils.startsWithAny
public static boolean startsWithAny(String string, String[] searchStrings) { if (isEmpty(string) || ArrayUtils.isEmpty(searchStrings)) { return false; } for (int i = 0; i < searchStrings.length; i++) { String searchString = searchStrings[i]; if (StringUtils.startsWith(string, searchString)) { return true; } } return false; }
java
public static boolean startsWithAny(String string, String[] searchStrings) { if (isEmpty(string) || ArrayUtils.isEmpty(searchStrings)) { return false; } for (int i = 0; i < searchStrings.length; i++) { String searchString = searchStrings[i]; if (StringUtils.startsWith(string, searchString)) { return true; } } return false; }
[ "public", "static", "boolean", "startsWithAny", "(", "String", "string", ",", "String", "[", "]", "searchStrings", ")", "{", "if", "(", "isEmpty", "(", "string", ")", "||", "ArrayUtils", ".", "isEmpty", "(", "searchStrings", ")", ")", "{", "return", "false...
<p>Check if a String starts with any of an array of specified strings.</p> <pre> StringUtils.startsWithAny(null, null) = false StringUtils.startsWithAny(null, new String[] {"abc"}) = false StringUtils.startsWithAny("abcxyz", null) = false StringUtils.startsWithAny("abcxyz", new String[] {""}) = false StringUtils.startsWithAny("abcxyz", new String[] {"abc"}) = true StringUtils.startsWithAny("abcxyz", new String[] {null, "xyz", "abc"}) = true </pre> @see #startsWith(String, String) @param string the String to check, may be null @param searchStrings the Strings to find, may be null or empty @return <code>true</code> if the String starts with any of the the prefixes, case insensitive, or both <code>null</code> @since 2.5
[ "<p", ">", "Check", "if", "a", "String", "starts", "with", "any", "of", "an", "array", "of", "specified", "strings", ".", "<", "/", "p", ">" ]
train
https://github.com/ineunetOS/knife-commons/blob/eae9e59afa020a00ae8977c10d43ac8ae46ae236/knife-commons-utils/src/main/java/com/ineunet/knife/util/StringUtils.java#L6285-L6296
icode/ameba
src/main/java/ameba/db/ebean/EbeanUtils.java
EbeanUtils.forceUpdateAllProperties
@SuppressWarnings("unchecked") public static <T> void forceUpdateAllProperties(SpiEbeanServer server, T model) { forceUpdateAllProperties(server.getBeanDescriptor((Class<T>) model.getClass()), model); }
java
@SuppressWarnings("unchecked") public static <T> void forceUpdateAllProperties(SpiEbeanServer server, T model) { forceUpdateAllProperties(server.getBeanDescriptor((Class<T>) model.getClass()), model); }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "static", "<", "T", ">", "void", "forceUpdateAllProperties", "(", "SpiEbeanServer", "server", ",", "T", "model", ")", "{", "forceUpdateAllProperties", "(", "server", ".", "getBeanDescriptor", "(", "(", ...
<p>forceUpdateAllProperties.</p> @param server a {@link io.ebeaninternal.api.SpiEbeanServer} object. @param model a T object. @param <T> a T object.
[ "<p", ">", "forceUpdateAllProperties", ".", "<", "/", "p", ">" ]
train
https://github.com/icode/ameba/blob/9d4956e935898e41331b2745e400ef869cd265e0/src/main/java/ameba/db/ebean/EbeanUtils.java#L57-L60
Azure/azure-sdk-for-java
keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java
KeyVaultClientBaseImpl.purgeDeletedStorageAccountAsync
public ServiceFuture<Void> purgeDeletedStorageAccountAsync(String vaultBaseUrl, String storageAccountName, final ServiceCallback<Void> serviceCallback) { return ServiceFuture.fromResponse(purgeDeletedStorageAccountWithServiceResponseAsync(vaultBaseUrl, storageAccountName), serviceCallback); }
java
public ServiceFuture<Void> purgeDeletedStorageAccountAsync(String vaultBaseUrl, String storageAccountName, final ServiceCallback<Void> serviceCallback) { return ServiceFuture.fromResponse(purgeDeletedStorageAccountWithServiceResponseAsync(vaultBaseUrl, storageAccountName), serviceCallback); }
[ "public", "ServiceFuture", "<", "Void", ">", "purgeDeletedStorageAccountAsync", "(", "String", "vaultBaseUrl", ",", "String", "storageAccountName", ",", "final", "ServiceCallback", "<", "Void", ">", "serviceCallback", ")", "{", "return", "ServiceFuture", ".", "fromRes...
Permanently deletes the specified storage account. The purge deleted storage account operation removes the secret permanently, without the possibility of recovery. This operation can only be performed on a soft-delete enabled vault. This operation requires the storage/purge permission. @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. @param storageAccountName The name of the storage account. @param serviceCallback the async ServiceCallback to handle successful and failed responses. @throws IllegalArgumentException thrown if parameters fail the validation @return the {@link ServiceFuture} object
[ "Permanently", "deletes", "the", "specified", "storage", "account", ".", "The", "purge", "deleted", "storage", "account", "operation", "removes", "the", "secret", "permanently", "without", "the", "possibility", "of", "recovery", ".", "This", "operation", "can", "o...
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java#L9358-L9360