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
alkacon/opencms-core
src/org/opencms/ui/apps/sessions/CmsSessionsApp.java
CmsSessionsApp.showSendBroadcastDialog
protected static void showSendBroadcastDialog(Set<String> ids, String caption, final CmsSessionsTable table) { final Window window = CmsBasicDialog.prepareWindow(); window.setCaption(caption); CmsBasicDialog dialog = new CmsSendBroadcastDialog(ids, CmsSessionsTable.getCloseRunnable(window, table)); window.setContent(dialog); dialog.setWindowMinFullHeight(500); A_CmsUI.get().addWindow(window); }
java
protected static void showSendBroadcastDialog(Set<String> ids, String caption, final CmsSessionsTable table) { final Window window = CmsBasicDialog.prepareWindow(); window.setCaption(caption); CmsBasicDialog dialog = new CmsSendBroadcastDialog(ids, CmsSessionsTable.getCloseRunnable(window, table)); window.setContent(dialog); dialog.setWindowMinFullHeight(500); A_CmsUI.get().addWindow(window); }
[ "protected", "static", "void", "showSendBroadcastDialog", "(", "Set", "<", "String", ">", "ids", ",", "String", "caption", ",", "final", "CmsSessionsTable", "table", ")", "{", "final", "Window", "window", "=", "CmsBasicDialog", ".", "prepareWindow", "(", ")", ...
Shows dialog to send broadcast.<p> @param ids of sessions to send broadcast to @param caption of window @param table instance of table to be refreshed after sending broadcast
[ "Shows", "dialog", "to", "send", "broadcast", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/apps/sessions/CmsSessionsApp.java#L180-L190
jfinal/jfinal
src/main/java/com/jfinal/i18n/I18nInterceptor.java
I18nInterceptor.switchView
public void switchView(String locale, Controller c) { Render render = c.getRender(); if (render != null) { String view = render.getView(); if (view != null) { if (view.startsWith("/")) { view = "/" + locale + view; } else { view = locale + "/" + view; } render.setView(view); } } }
java
public void switchView(String locale, Controller c) { Render render = c.getRender(); if (render != null) { String view = render.getView(); if (view != null) { if (view.startsWith("/")) { view = "/" + locale + view; } else { view = locale + "/" + view; } render.setView(view); } } }
[ "public", "void", "switchView", "(", "String", "locale", ",", "Controller", "c", ")", "{", "Render", "render", "=", "c", ".", "getRender", "(", ")", ";", "if", "(", "render", "!=", "null", ")", "{", "String", "view", "=", "render", ".", "getView", "(...
在有些 web 系统中,页面需要国际化的文本过多,并且 css 以及 html 也因为际化而大不相同, 对于这种应用场景先直接制做多套同名称的国际化视图,并将这些视图以 locale 为子目录分类存放, 最后使用本拦截器根据 locale 动态切换视图,而不必对视图中的文本逐个进行国际化切换,省时省力。
[ "在有些", "web", "系统中,页面需要国际化的文本过多,并且", "css", "以及", "html", "也因为际化而大不相同,", "对于这种应用场景先直接制做多套同名称的国际化视图,并将这些视图以", "locale", "为子目录分类存放,", "最后使用本拦截器根据", "locale", "动态切换视图,而不必对视图中的文本逐个进行国际化切换,省时省力。" ]
train
https://github.com/jfinal/jfinal/blob/fc07f0f5d56e85ccd3cfcdd587b56b8dd9c663e9/src/main/java/com/jfinal/i18n/I18nInterceptor.java#L120-L134
Netflix/conductor
core/src/main/java/com/netflix/conductor/service/TaskServiceImpl.java
TaskServiceImpl.getExternalStorageLocation
public ExternalStorageLocation getExternalStorageLocation(String path, String operation, String type) { try { ExternalPayloadStorage.Operation payloadOperation = ExternalPayloadStorage.Operation.valueOf(StringUtils.upperCase(operation)); ExternalPayloadStorage.PayloadType payloadType = ExternalPayloadStorage.PayloadType.valueOf(StringUtils.upperCase(type)); return executionService.getExternalStorageLocation(payloadOperation, payloadType, path); } catch (Exception e) { // FIXME: for backwards compatibility LOGGER.error("Invalid input - Operation: {}, PayloadType: {}, defaulting to WRITE/TASK_OUTPUT", operation, type); return executionService.getExternalStorageLocation(ExternalPayloadStorage.Operation.WRITE, ExternalPayloadStorage.PayloadType.TASK_OUTPUT, path); } }
java
public ExternalStorageLocation getExternalStorageLocation(String path, String operation, String type) { try { ExternalPayloadStorage.Operation payloadOperation = ExternalPayloadStorage.Operation.valueOf(StringUtils.upperCase(operation)); ExternalPayloadStorage.PayloadType payloadType = ExternalPayloadStorage.PayloadType.valueOf(StringUtils.upperCase(type)); return executionService.getExternalStorageLocation(payloadOperation, payloadType, path); } catch (Exception e) { // FIXME: for backwards compatibility LOGGER.error("Invalid input - Operation: {}, PayloadType: {}, defaulting to WRITE/TASK_OUTPUT", operation, type); return executionService.getExternalStorageLocation(ExternalPayloadStorage.Operation.WRITE, ExternalPayloadStorage.PayloadType.TASK_OUTPUT, path); } }
[ "public", "ExternalStorageLocation", "getExternalStorageLocation", "(", "String", "path", ",", "String", "operation", ",", "String", "type", ")", "{", "try", "{", "ExternalPayloadStorage", ".", "Operation", "payloadOperation", "=", "ExternalPayloadStorage", ".", "Operat...
Get the external storage location where the task output payload is stored/to be stored @param path the path for which the external storage location is to be populated @param operation the operation to be performed (read or write) @param type the type of payload (input or output) @return {@link ExternalStorageLocation} containing the uri and the path to the payload is stored in external storage
[ "Get", "the", "external", "storage", "location", "where", "the", "task", "output", "payload", "is", "stored", "/", "to", "be", "stored" ]
train
https://github.com/Netflix/conductor/blob/78fae0ed9ddea22891f9eebb96a2ec0b2783dca0/core/src/main/java/com/netflix/conductor/service/TaskServiceImpl.java#L323-L333
op4j/op4j
src/main/java/org/op4j/functions/FnNumber.java
FnNumber.toFloat
public static final Function<Number,Float> toFloat(final int scale, final RoundingMode roundingMode) { return new ToFloat(scale, roundingMode); }
java
public static final Function<Number,Float> toFloat(final int scale, final RoundingMode roundingMode) { return new ToFloat(scale, roundingMode); }
[ "public", "static", "final", "Function", "<", "Number", ",", "Float", ">", "toFloat", "(", "final", "int", "scale", ",", "final", "RoundingMode", "roundingMode", ")", "{", "return", "new", "ToFloat", "(", "scale", ",", "roundingMode", ")", ";", "}" ]
<p> It converts the target object into a {@link Float} using the given scale and {@link RoundingMode} </p> @param scale the scale to be used @param roundingMode the {@link RoundingMode} to round the input with @return the {@link Float}
[ "<p", ">", "It", "converts", "the", "target", "object", "into", "a", "{", "@link", "Float", "}", "using", "the", "given", "scale", "and", "{", "@link", "RoundingMode", "}", "<", "/", "p", ">" ]
train
https://github.com/op4j/op4j/blob/b577596dfe462089d3dd169666defc6de7ad289a/src/main/java/org/op4j/functions/FnNumber.java#L157-L159
TheHortonMachine/hortonmachine
gears/src/main/java/org/hortonmachine/gears/modules/r/tmsgenerator/GlobalMercator.java
GlobalMercator.TileLatLonBounds
public Envelope TileLatLonBounds( int tx, int ty, int zoom ) { double[] wsenBounds = TileBounds(tx, ty, zoom); double[] sw = MetersToLatLon(wsenBounds[0], wsenBounds[1]); double[] ne = MetersToLatLon(wsenBounds[2], wsenBounds[3]); return new Envelope(sw[1], ne[1], sw[0], ne[0]); }
java
public Envelope TileLatLonBounds( int tx, int ty, int zoom ) { double[] wsenBounds = TileBounds(tx, ty, zoom); double[] sw = MetersToLatLon(wsenBounds[0], wsenBounds[1]); double[] ne = MetersToLatLon(wsenBounds[2], wsenBounds[3]); return new Envelope(sw[1], ne[1], sw[0], ne[0]); }
[ "public", "Envelope", "TileLatLonBounds", "(", "int", "tx", ",", "int", "ty", ",", "int", "zoom", ")", "{", "double", "[", "]", "wsenBounds", "=", "TileBounds", "(", "tx", ",", "ty", ",", "zoom", ")", ";", "double", "[", "]", "sw", "=", "MetersToLatL...
Returns bounds of the given tile in latitude/longitude using WGS84 datum return the array of [w, s, e, n]
[ "Returns", "bounds", "of", "the", "given", "tile", "in", "latitude", "/", "longitude", "using", "WGS84", "datum" ]
train
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/modules/r/tmsgenerator/GlobalMercator.java#L277-L282
TheCoder4eu/BootsFaces-OSP
src/main/java/net/bootsfaces/render/R.java
R.addClass2Component
protected static void addClass2Component(UIComponent c, String aclass) { Map<String, Object> a = c.getAttributes(); if (a.containsKey("styleClass")) { a.put("styleClass", a.get("styleClass") + " " + aclass); } else { a.put("styleClass", aclass); } }
java
protected static void addClass2Component(UIComponent c, String aclass) { Map<String, Object> a = c.getAttributes(); if (a.containsKey("styleClass")) { a.put("styleClass", a.get("styleClass") + " " + aclass); } else { a.put("styleClass", aclass); } }
[ "protected", "static", "void", "addClass2Component", "(", "UIComponent", "c", ",", "String", "aclass", ")", "{", "Map", "<", "String", ",", "Object", ">", "a", "=", "c", ".", "getAttributes", "(", ")", ";", "if", "(", "a", ".", "containsKey", "(", "\"s...
Adds a CSS class to a component in the view tree. The class is appended to the styleClass value. @param c the component @param aclass the CSS class to be added
[ "Adds", "a", "CSS", "class", "to", "a", "component", "in", "the", "view", "tree", ".", "The", "class", "is", "appended", "to", "the", "styleClass", "value", "." ]
train
https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/render/R.java#L196-L203
jbundle/jbundle
base/screen/view/html/src/main/java/org/jbundle/base/screen/view/html/HBasePanel.java
HBasePanel.printScreenFieldData
public void printScreenFieldData(ScreenComponent sField, PrintWriter out, int iPrintOptions) { ((ScreenField)sField).printData(out, iPrintOptions); }
java
public void printScreenFieldData(ScreenComponent sField, PrintWriter out, int iPrintOptions) { ((ScreenField)sField).printData(out, iPrintOptions); }
[ "public", "void", "printScreenFieldData", "(", "ScreenComponent", "sField", ",", "PrintWriter", "out", ",", "int", "iPrintOptions", ")", "{", "(", "(", "ScreenField", ")", "sField", ")", ".", "printData", "(", "out", ",", "iPrintOptions", ")", ";", "}" ]
Output this screen using HTML. @exception DBException File exception.
[ "Output", "this", "screen", "using", "HTML", "." ]
train
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/screen/view/html/src/main/java/org/jbundle/base/screen/view/html/HBasePanel.java#L515-L518
spotify/crtauth-java
src/main/java/com/spotify/crtauth/CrtAuthServer.java
CrtAuthServer.createChallenge
public String createChallenge(String request) throws IllegalArgumentException, ProtocolVersionException { String userName; userName = CrtAuthCodec.deserializeRequest(request); Fingerprint fingerprint; try { fingerprint = new Fingerprint(getKeyForUser(userName)); } catch (KeyNotFoundException e) { log.info("No public key found for user {}, creating fake fingerprint", userName); fingerprint = createFakeFingerprint(userName); } byte[] uniqueData = new byte[Challenge.UNIQUE_DATA_LENGTH]; UnsignedInteger timeNow = timeSupplier.getTime(); random.nextBytes(uniqueData); Challenge challenge = Challenge.newBuilder() .setFingerprint(fingerprint) .setUniqueData(uniqueData) .setValidFromTimestamp(timeNow.minus(CLOCK_FUDGE)) .setValidToTimestamp(timeNow.plus(RESPONSE_TIMEOUT)) .setServerName(serverName) .setUserName(userName) .build(); return encode(CrtAuthCodec.serialize(challenge, secret)); }
java
public String createChallenge(String request) throws IllegalArgumentException, ProtocolVersionException { String userName; userName = CrtAuthCodec.deserializeRequest(request); Fingerprint fingerprint; try { fingerprint = new Fingerprint(getKeyForUser(userName)); } catch (KeyNotFoundException e) { log.info("No public key found for user {}, creating fake fingerprint", userName); fingerprint = createFakeFingerprint(userName); } byte[] uniqueData = new byte[Challenge.UNIQUE_DATA_LENGTH]; UnsignedInteger timeNow = timeSupplier.getTime(); random.nextBytes(uniqueData); Challenge challenge = Challenge.newBuilder() .setFingerprint(fingerprint) .setUniqueData(uniqueData) .setValidFromTimestamp(timeNow.minus(CLOCK_FUDGE)) .setValidToTimestamp(timeNow.plus(RESPONSE_TIMEOUT)) .setServerName(serverName) .setUserName(userName) .build(); return encode(CrtAuthCodec.serialize(challenge, secret)); }
[ "public", "String", "createChallenge", "(", "String", "request", ")", "throws", "IllegalArgumentException", ",", "ProtocolVersionException", "{", "String", "userName", ";", "userName", "=", "CrtAuthCodec", ".", "deserializeRequest", "(", "request", ")", ";", "Fingerpr...
Create a challenge to authenticate a given user. The userName needs to be provided at this stage to encode a fingerprint of the public key stored in the server encoded in the challenge. This is required because a client can hold more than one private key and would need this information to pick the right key to sign the response. If the keyProvider fails to retrieve the public key, a fake Fingerprint is generated so that the presence of a challenge doesn't reveal whether a user key is present on the server or not. @param request The request message which contains an encoded username @return A challenge message. @throws IllegalArgumentException if the request format is invalid
[ "Create", "a", "challenge", "to", "authenticate", "a", "given", "user", ".", "The", "userName", "needs", "to", "be", "provided", "at", "this", "stage", "to", "encode", "a", "fingerprint", "of", "the", "public", "key", "stored", "in", "the", "server", "enco...
train
https://github.com/spotify/crtauth-java/blob/90f3b40323848740c915b195ad1b547fbeb41700/src/main/java/com/spotify/crtauth/CrtAuthServer.java#L187-L214
Tourenathan-G5organisation/SiliCompressor
silicompressor/src/main/java/com/iceteck/silicompressorr/FileUtils.java
FileUtils.getThumbnail
public static Bitmap getThumbnail(Context context, File file) { return getThumbnail(context, getUri(context, file), getMimeType(file)); }
java
public static Bitmap getThumbnail(Context context, File file) { return getThumbnail(context, getUri(context, file), getMimeType(file)); }
[ "public", "static", "Bitmap", "getThumbnail", "(", "Context", "context", ",", "File", "file", ")", "{", "return", "getThumbnail", "(", "context", ",", "getUri", "(", "context", ",", "file", ")", ",", "getMimeType", "(", "file", ")", ")", ";", "}" ]
Attempt to retrieve the thumbnail of given File from the MediaStore. This should not be called on the UI thread. @param context @param file @return @author paulburke
[ "Attempt", "to", "retrieve", "the", "thumbnail", "of", "given", "File", "from", "the", "MediaStore", ".", "This", "should", "not", "be", "called", "on", "the", "UI", "thread", "." ]
train
https://github.com/Tourenathan-G5organisation/SiliCompressor/blob/546f6cd7b2a7a783e1122df46c1e237f8938fe72/silicompressor/src/main/java/com/iceteck/silicompressorr/FileUtils.java#L392-L394
GerdHolz/TOVAL
src/de/invation/code/toval/graphic/diagrams/panels/TickInfo.java
TickInfo.setTickSpacing
public void setTickSpacing(double minorTickSpacing, int multiplicator) { if(Double.isInfinite(minorTickSpacing) || Double.isNaN(minorTickSpacing)) throw new NumberFormatException("Infinite or NaN"); if(multiplicator <= 0) throw new IllegalArgumentException("Multiplicator negative or 0"); this.minorTickSpacing = minorTickSpacing; this.tickMultiplicator = multiplicator; setFormat(); setTicks(); }
java
public void setTickSpacing(double minorTickSpacing, int multiplicator) { if(Double.isInfinite(minorTickSpacing) || Double.isNaN(minorTickSpacing)) throw new NumberFormatException("Infinite or NaN"); if(multiplicator <= 0) throw new IllegalArgumentException("Multiplicator negative or 0"); this.minorTickSpacing = minorTickSpacing; this.tickMultiplicator = multiplicator; setFormat(); setTicks(); }
[ "public", "void", "setTickSpacing", "(", "double", "minorTickSpacing", ",", "int", "multiplicator", ")", "{", "if", "(", "Double", ".", "isInfinite", "(", "minorTickSpacing", ")", "||", "Double", ".", "isNaN", "(", "minorTickSpacing", ")", ")", "throw", "new",...
Sets the tick spacing.<br> <code>minorTickSpacing</code> sets the minor tick spacing, major tick spacing is a multiple of minor tick spacing and determined with the help of <code>multiplicator</code> @param minorTickSpacing Minor tick spacing @param multiplicator Multiplicator for detrermining the major tick spacing.
[ "Sets", "the", "tick", "spacing", ".", "<br", ">", "<code", ">", "minorTickSpacing<", "/", "code", ">", "sets", "the", "minor", "tick", "spacing", "major", "tick", "spacing", "is", "a", "multiple", "of", "minor", "tick", "spacing", "and", "determined", "wi...
train
https://github.com/GerdHolz/TOVAL/blob/036922cdfd710fa53b18e5dbe1e07f226f731fde/src/de/invation/code/toval/graphic/diagrams/panels/TickInfo.java#L219-L228
couchbase/couchbase-lite-java-core
src/main/java/com/couchbase/lite/Document.java
Document.putProperties
@InterfaceAudience.Public public SavedRevision putProperties(Map<String, Object> properties) throws CouchbaseLiteException { String prevID = (String) properties.get("_rev"); boolean allowConflict = false; return putProperties(properties, prevID, allowConflict); }
java
@InterfaceAudience.Public public SavedRevision putProperties(Map<String, Object> properties) throws CouchbaseLiteException { String prevID = (String) properties.get("_rev"); boolean allowConflict = false; return putProperties(properties, prevID, allowConflict); }
[ "@", "InterfaceAudience", ".", "Public", "public", "SavedRevision", "putProperties", "(", "Map", "<", "String", ",", "Object", ">", "properties", ")", "throws", "CouchbaseLiteException", "{", "String", "prevID", "=", "(", "String", ")", "properties", ".", "get",...
Saves a new revision. The properties dictionary must have a "_rev" property whose ID matches the current revision's (as it will if it's a modified copy of this document's .properties property.) @param properties the contents to be saved in the new revision @return a new SavedRevision
[ "Saves", "a", "new", "revision", ".", "The", "properties", "dictionary", "must", "have", "a", "_rev", "property", "whose", "ID", "matches", "the", "current", "revision", "s", "(", "as", "it", "will", "if", "it", "s", "a", "modified", "copy", "of", "this"...
train
https://github.com/couchbase/couchbase-lite-java-core/blob/3b275642e2d2f231fd155ad9def9c5e9eff3118e/src/main/java/com/couchbase/lite/Document.java#L346-L352
kaazing/gateway
util/src/main/java/org/kaazing/gateway/util/der/DerUtils.java
DerUtils.sizeOf
public static int sizeOf(int tagNumber, int contentLength) { if (tagNumber < 0 || contentLength < 0) { throw new IllegalArgumentException("Invalid tagNumber/contentLength: " + tagNumber + ", " + contentLength); } int len = 0; // ID octets if (tagNumber <= 30) { len++; // single octet } else { len = len + 1 + (int) Math.ceil((1 + Integer.numberOfTrailingZeros(Integer.highestOneBit(tagNumber))) / 7.0d); } // Length octets (TODO: indefinite form) if (contentLength <= 0x7f) { len++; // definite form, single octet } else { len = len + 1 + (int) Math.ceil((1 + Integer.numberOfTrailingZeros(Integer.highestOneBit(contentLength))) / 8.0d); } // Content octets len += contentLength; return len; }
java
public static int sizeOf(int tagNumber, int contentLength) { if (tagNumber < 0 || contentLength < 0) { throw new IllegalArgumentException("Invalid tagNumber/contentLength: " + tagNumber + ", " + contentLength); } int len = 0; // ID octets if (tagNumber <= 30) { len++; // single octet } else { len = len + 1 + (int) Math.ceil((1 + Integer.numberOfTrailingZeros(Integer.highestOneBit(tagNumber))) / 7.0d); } // Length octets (TODO: indefinite form) if (contentLength <= 0x7f) { len++; // definite form, single octet } else { len = len + 1 + (int) Math.ceil((1 + Integer.numberOfTrailingZeros(Integer.highestOneBit(contentLength))) / 8.0d); } // Content octets len += contentLength; return len; }
[ "public", "static", "int", "sizeOf", "(", "int", "tagNumber", ",", "int", "contentLength", ")", "{", "if", "(", "tagNumber", "<", "0", "||", "contentLength", "<", "0", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Invalid tagNumber/contentLength:...
Computes the DER-encoded size of content with a specified tag number. @param tagNumber the DER tag number in the identifier @param contentLength the length of the content in bytes @return
[ "Computes", "the", "DER", "-", "encoded", "size", "of", "content", "with", "a", "specified", "tag", "number", "." ]
train
https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/util/src/main/java/org/kaazing/gateway/util/der/DerUtils.java#L181-L206
Impetus/Kundera
src/jpa-engine/core/src/main/java/com/impetus/kundera/metadata/processor/TableProcessor.java
TableProcessor.addRelationIntoMetadata
private void addRelationIntoMetadata(Class<?> entityClass, Field relationField, EntityMetadata metadata) { RelationMetadataProcessor relProcessor = null; try { relProcessor = RelationMetadataProcessorFactory .getRelationMetadataProcessor(relationField, kunderaMetadata); this.factory.validate(relationField, new RelationAttributeRule()); relProcessor = RelationMetadataProcessorFactory .getRelationMetadataProcessor(relationField, kunderaMetadata); if (relProcessor != null) { relProcessor.addRelationIntoMetadata(relationField, metadata); } } catch (PersistenceException pe) { throw new MetamodelLoaderException("Error with relationship in @Entity(" + entityClass + "." + relationField.getName() + "), reason: " + pe); } }
java
private void addRelationIntoMetadata(Class<?> entityClass, Field relationField, EntityMetadata metadata) { RelationMetadataProcessor relProcessor = null; try { relProcessor = RelationMetadataProcessorFactory .getRelationMetadataProcessor(relationField, kunderaMetadata); this.factory.validate(relationField, new RelationAttributeRule()); relProcessor = RelationMetadataProcessorFactory .getRelationMetadataProcessor(relationField, kunderaMetadata); if (relProcessor != null) { relProcessor.addRelationIntoMetadata(relationField, metadata); } } catch (PersistenceException pe) { throw new MetamodelLoaderException("Error with relationship in @Entity(" + entityClass + "." + relationField.getName() + "), reason: " + pe); } }
[ "private", "void", "addRelationIntoMetadata", "(", "Class", "<", "?", ">", "entityClass", ",", "Field", "relationField", ",", "EntityMetadata", "metadata", ")", "{", "RelationMetadataProcessor", "relProcessor", "=", "null", ";", "try", "{", "relProcessor", "=", "R...
Adds relationship info into metadata for a given field <code>relationField</code>. @param entityClass the entity class @param relationField the relation field @param metadata the metadata
[ "Adds", "relationship", "info", "into", "metadata", "for", "a", "given", "field", "<code", ">", "relationField<", "/", "code", ">", "." ]
train
https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/jpa-engine/core/src/main/java/com/impetus/kundera/metadata/processor/TableProcessor.java#L226-L251
stratosphere/stratosphere
stratosphere-runtime/src/main/java/eu/stratosphere/nephele/managementgraph/ManagementGraph.java
ManagementGraph.getOutputGroupVertex
public ManagementGroupVertex getOutputGroupVertex(final int stage, final int index) { if (stage >= this.stages.size()) { return null; } return this.stages.get(stage).getOutputGroupVertex(index); }
java
public ManagementGroupVertex getOutputGroupVertex(final int stage, final int index) { if (stage >= this.stages.size()) { return null; } return this.stages.get(stage).getOutputGroupVertex(index); }
[ "public", "ManagementGroupVertex", "getOutputGroupVertex", "(", "final", "int", "stage", ",", "final", "int", "index", ")", "{", "if", "(", "stage", ">=", "this", ".", "stages", ".", "size", "(", ")", ")", "{", "return", "null", ";", "}", "return", "this...
Returns the output group vertex at the given index in the given stage. @param stage the index to the management stage @param index the index to the output group vertex @return the output group vertex at the given index in the given stage or <code>null</code> if either the stage does not exists or the given index is invalid in this stage
[ "Returns", "the", "output", "group", "vertex", "at", "the", "given", "index", "in", "the", "given", "stage", "." ]
train
https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-runtime/src/main/java/eu/stratosphere/nephele/managementgraph/ManagementGraph.java#L239-L246
gallandarakhneorg/afc
core/maths/mathtree/src/main/java/org/arakhne/afc/math/tree/node/QuadTreeNode.java
QuadTreeNode.setChildAt
public boolean setChildAt(QuadTreeZone zone, N newChild) { switch (zone) { case NORTH_WEST: return setFirstChild(newChild); case NORTH_EAST: return setSecondChild(newChild); case SOUTH_WEST: return setThirdChild(newChild); case SOUTH_EAST: return setFourthChild(newChild); default: } return false; }
java
public boolean setChildAt(QuadTreeZone zone, N newChild) { switch (zone) { case NORTH_WEST: return setFirstChild(newChild); case NORTH_EAST: return setSecondChild(newChild); case SOUTH_WEST: return setThirdChild(newChild); case SOUTH_EAST: return setFourthChild(newChild); default: } return false; }
[ "public", "boolean", "setChildAt", "(", "QuadTreeZone", "zone", ",", "N", "newChild", ")", "{", "switch", "(", "zone", ")", "{", "case", "NORTH_WEST", ":", "return", "setFirstChild", "(", "newChild", ")", ";", "case", "NORTH_EAST", ":", "return", "setSecondC...
Set the child at the specified zone. @param zone is the zone to set @param newChild is the new node for the given zone @return <code>true</code> on success, <code>false</code> otherwise
[ "Set", "the", "child", "at", "the", "specified", "zone", "." ]
train
https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathtree/src/main/java/org/arakhne/afc/math/tree/node/QuadTreeNode.java#L457-L470
threerings/nenya
core/src/main/java/com/threerings/geom/GeomUtil.java
GeomUtil.shiftToContain
public static void shiftToContain (Rectangle tainer, Rectangle tained) { if (tained.x < tainer.x) { tainer.x = tained.x; } if (tained.y < tainer.y) { tainer.y = tained.y; } if (tained.x + tained.width > tainer.x + tainer.width) { tainer.x = tained.x - (tainer.width - tained.width); } if (tained.y + tained.height > tainer.y + tainer.height) { tainer.y = tained.y - (tainer.height - tained.height); } }
java
public static void shiftToContain (Rectangle tainer, Rectangle tained) { if (tained.x < tainer.x) { tainer.x = tained.x; } if (tained.y < tainer.y) { tainer.y = tained.y; } if (tained.x + tained.width > tainer.x + tainer.width) { tainer.x = tained.x - (tainer.width - tained.width); } if (tained.y + tained.height > tainer.y + tainer.height) { tainer.y = tained.y - (tainer.height - tained.height); } }
[ "public", "static", "void", "shiftToContain", "(", "Rectangle", "tainer", ",", "Rectangle", "tained", ")", "{", "if", "(", "tained", ".", "x", "<", "tainer", ".", "x", ")", "{", "tainer", ".", "x", "=", "tained", ".", "x", ";", "}", "if", "(", "tai...
Shifts the position of the <code>tainer</code> rectangle to ensure that it contains the <code>tained</code> rectangle. The <code>tainer</code> rectangle must be larger than or equal to the size of the <code>tained</code> rectangle.
[ "Shifts", "the", "position", "of", "the", "<code", ">", "tainer<", "/", "code", ">", "rectangle", "to", "ensure", "that", "it", "contains", "the", "<code", ">", "tained<", "/", "code", ">", "rectangle", ".", "The", "<code", ">", "tainer<", "/", "code", ...
train
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/geom/GeomUtil.java#L178-L192
b3dgs/lionengine
lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/FeaturableConfig.java
FeaturableConfig.imports
public static FeaturableConfig imports(Xml root) { Check.notNull(root); final String clazz; if (root.hasChild(ATT_CLASS)) { clazz = root.getChild(ATT_CLASS).getText(); } else { clazz = DEFAULT_CLASS_NAME; } final String setup; if (root.hasChild(ATT_SETUP)) { setup = root.getChild(ATT_SETUP).getText(); } else { setup = Constant.EMPTY_STRING; } return new FeaturableConfig(clazz, setup); }
java
public static FeaturableConfig imports(Xml root) { Check.notNull(root); final String clazz; if (root.hasChild(ATT_CLASS)) { clazz = root.getChild(ATT_CLASS).getText(); } else { clazz = DEFAULT_CLASS_NAME; } final String setup; if (root.hasChild(ATT_SETUP)) { setup = root.getChild(ATT_SETUP).getText(); } else { setup = Constant.EMPTY_STRING; } return new FeaturableConfig(clazz, setup); }
[ "public", "static", "FeaturableConfig", "imports", "(", "Xml", "root", ")", "{", "Check", ".", "notNull", "(", "root", ")", ";", "final", "String", "clazz", ";", "if", "(", "root", ".", "hasChild", "(", "ATT_CLASS", ")", ")", "{", "clazz", "=", "root",...
Import the featurable data from node. @param root The root node reference (must not be <code>null</code>). @return The featurable data. @throws LionEngineException If unable to read node.
[ "Import", "the", "featurable", "data", "from", "node", "." ]
train
https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/FeaturableConfig.java#L92-L117
apache/flink
flink-core/src/main/java/org/apache/flink/types/Record.java
Record.getFieldsInto
public boolean getFieldsInto(int[] positions, Value[] targets) { for (int i = 0; i < positions.length; i++) { if (!getFieldInto(positions[i], targets[i])) { return false; } } return true; }
java
public boolean getFieldsInto(int[] positions, Value[] targets) { for (int i = 0; i < positions.length; i++) { if (!getFieldInto(positions[i], targets[i])) { return false; } } return true; }
[ "public", "boolean", "getFieldsInto", "(", "int", "[", "]", "positions", ",", "Value", "[", "]", "targets", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "positions", ".", "length", ";", "i", "++", ")", "{", "if", "(", "!", "getField...
Gets the fields at the given positions into an array. If at any position a field is null, then this method returns false. All fields that have been successfully read until the failing read are correctly contained in the record. All other fields are not set. @param positions The positions of the fields to get. @param targets The values into which the content of the fields is put. @return True if all fields were successfully read, false if some read failed.
[ "Gets", "the", "fields", "at", "the", "given", "positions", "into", "an", "array", ".", "If", "at", "any", "position", "a", "field", "is", "null", "then", "this", "method", "returns", "false", ".", "All", "fields", "that", "have", "been", "successfully", ...
train
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/types/Record.java#L337-L344
OpenBEL/openbel-framework
org.openbel.framework.core/src/main/java/org/openbel/framework/core/compiler/expansion/ExpansionServiceImpl.java
ExpansionServiceImpl.expandTerm
private void expandTerm(Term term, List<Statement> allExpansions) { for (final ExpansionRule<Term> rule : termExpansionRules) { if (rule.match(term)) { List<Statement> termExpansions = rule.expand(term); allExpansions.addAll(termExpansions); } final List<Term> innerTerms = term.getTerms(); for (final Term innerTerm : innerTerms) { expandTerm(innerTerm, allExpansions); } } }
java
private void expandTerm(Term term, List<Statement> allExpansions) { for (final ExpansionRule<Term> rule : termExpansionRules) { if (rule.match(term)) { List<Statement> termExpansions = rule.expand(term); allExpansions.addAll(termExpansions); } final List<Term> innerTerms = term.getTerms(); for (final Term innerTerm : innerTerms) { expandTerm(innerTerm, allExpansions); } } }
[ "private", "void", "expandTerm", "(", "Term", "term", ",", "List", "<", "Statement", ">", "allExpansions", ")", "{", "for", "(", "final", "ExpansionRule", "<", "Term", ">", "rule", ":", "termExpansionRules", ")", "{", "if", "(", "rule", ".", "match", "("...
Apply all matching {@link TermExpansionRule term expansion rules} defined in <tt>termExpansionRules</tt> to the {@link Term outer term} and all the {@link Term inner terms}. <p> This method is called recursively to evaluate the {@link Term inner terms}. </p> @param term {@link Term}, the current term to process for expansion @param allExpansions {@link List} of {@link Statement}, all statements currently collected through term expansion @throws TermExpansionException Thrown if a {@link TermExpansionRule} encounters an error with the {@link Term term} being expanded.
[ "Apply", "all", "matching", "{", "@link", "TermExpansionRule", "term", "expansion", "rules", "}", "defined", "in", "<tt", ">", "termExpansionRules<", "/", "tt", ">", "to", "the", "{", "@link", "Term", "outer", "term", "}", "and", "all", "the", "{", "@link"...
train
https://github.com/OpenBEL/openbel-framework/blob/149f80b1d6eabb15ab15815b6f745b0afa9fd2d3/org.openbel.framework.core/src/main/java/org/openbel/framework/core/compiler/expansion/ExpansionServiceImpl.java#L194-L206
aws/aws-sdk-java
aws-java-sdk-core/src/main/java/com/amazonaws/internal/ResettableInputStream.java
ResettableInputStream.newResettableInputStream
public static ResettableInputStream newResettableInputStream(File file, String errmsg) { try { return new ResettableInputStream(file); } catch (IOException e) { throw errmsg == null ? new SdkClientException(e) : new SdkClientException(errmsg, e); } }
java
public static ResettableInputStream newResettableInputStream(File file, String errmsg) { try { return new ResettableInputStream(file); } catch (IOException e) { throw errmsg == null ? new SdkClientException(e) : new SdkClientException(errmsg, e); } }
[ "public", "static", "ResettableInputStream", "newResettableInputStream", "(", "File", "file", ",", "String", "errmsg", ")", "{", "try", "{", "return", "new", "ResettableInputStream", "(", "file", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "thro...
Convenient factory method to construct a new resettable input stream for the given file, converting any IOException into SdkClientException with the given error message. <p> Note the creation of a {@link ResettableInputStream} would entail physically opening a file. If the opened file is meant to be closed only (in a finally block) by the very same code block that created it, then it is necessary that the release method must not be called while the execution is made in other stack frames. In such case, as other stack frames may inadvertently or indirectly call the close method of the stream, the creator of the stream would need to explicitly disable the accidental closing via {@link ResettableInputStream#disableClose()}, so that the release method becomes the only way to truly close the opened file.
[ "Convenient", "factory", "method", "to", "construct", "a", "new", "resettable", "input", "stream", "for", "the", "given", "file", "converting", "any", "IOException", "into", "SdkClientException", "with", "the", "given", "error", "message", ".", "<p", ">", "Note"...
train
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/internal/ResettableInputStream.java#L247-L256
fcrepo3/fcrepo
fcrepo-server/src/main/java/org/fcrepo/server/utilities/ServerUtility.java
ServerUtility.getArgBoolean
private static boolean getArgBoolean(String[] args, int position, boolean defaultValue) { if (args.length > position) { String lowerArg = args[position].toLowerCase(); if (lowerArg.equals("true") || lowerArg.equals("yes")) { return true; } else if (lowerArg.equals("false") || lowerArg.equals("no")) { return false; } else { throw new IllegalArgumentException(args[position] + " not a valid value. Specify true or false"); } } else { return defaultValue; } }
java
private static boolean getArgBoolean(String[] args, int position, boolean defaultValue) { if (args.length > position) { String lowerArg = args[position].toLowerCase(); if (lowerArg.equals("true") || lowerArg.equals("yes")) { return true; } else if (lowerArg.equals("false") || lowerArg.equals("no")) { return false; } else { throw new IllegalArgumentException(args[position] + " not a valid value. Specify true or false"); } } else { return defaultValue; } }
[ "private", "static", "boolean", "getArgBoolean", "(", "String", "[", "]", "args", ",", "int", "position", ",", "boolean", "defaultValue", ")", "{", "if", "(", "args", ".", "length", ">", "position", ")", "{", "String", "lowerArg", "=", "args", "[", "posi...
Get boolean argument from list of arguments at position; use defaultValue if not present @param args @param position @param defaultValue @return
[ "Get", "boolean", "argument", "from", "list", "of", "arguments", "at", "position", ";", "use", "defaultValue", "if", "not", "present" ]
train
https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-server/src/main/java/org/fcrepo/server/utilities/ServerUtility.java#L355-L368
aws/aws-sdk-java
aws-java-sdk-cloudfront/src/main/java/com/amazonaws/services/cloudfront/util/SignerUtils.java
SignerUtils.buildCannedPolicy
public static String buildCannedPolicy(String resourceUrlOrPath, Date dateLessThan) { return "{\"Statement\":[{\"Resource\":\"" + resourceUrlOrPath + "\",\"Condition\":{\"DateLessThan\":{\"AWS:EpochTime\":" + MILLISECONDS.toSeconds(dateLessThan.getTime()) + "}}}]}"; }
java
public static String buildCannedPolicy(String resourceUrlOrPath, Date dateLessThan) { return "{\"Statement\":[{\"Resource\":\"" + resourceUrlOrPath + "\",\"Condition\":{\"DateLessThan\":{\"AWS:EpochTime\":" + MILLISECONDS.toSeconds(dateLessThan.getTime()) + "}}}]}"; }
[ "public", "static", "String", "buildCannedPolicy", "(", "String", "resourceUrlOrPath", ",", "Date", "dateLessThan", ")", "{", "return", "\"{\\\"Statement\\\":[{\\\"Resource\\\":\\\"\"", "+", "resourceUrlOrPath", "+", "\"\\\",\\\"Condition\\\":{\\\"DateLessThan\\\":{\\\"AWS:EpochTim...
Returns a "canned" policy for the given parameters. For more information, see <a href= "http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/private-content-signed-urls-overview.html" >Overview of Signed URLs</a>.
[ "Returns", "a", "canned", "policy", "for", "the", "given", "parameters", ".", "For", "more", "information", "see", "<a", "href", "=", "http", ":", "//", "docs", ".", "aws", ".", "amazon", ".", "com", "/", "AmazonCloudFront", "/", "latest", "/", "Develope...
train
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-cloudfront/src/main/java/com/amazonaws/services/cloudfront/util/SignerUtils.java#L59-L66
m-m-m/util
datatype/src/main/java/net/sf/mmm/util/datatype/api/color/GenericColor.java
GenericColor.calculateSaturationHsl
private static double calculateSaturationHsl(double chroma, double lightness) { double d = 1 - Math.abs(2 * lightness - 1); if (d == 0) { return 0; } return chroma / d; }
java
private static double calculateSaturationHsl(double chroma, double lightness) { double d = 1 - Math.abs(2 * lightness - 1); if (d == 0) { return 0; } return chroma / d; }
[ "private", "static", "double", "calculateSaturationHsl", "(", "double", "chroma", ",", "double", "lightness", ")", "{", "double", "d", "=", "1", "-", "Math", ".", "abs", "(", "2", "*", "lightness", "-", "1", ")", ";", "if", "(", "d", "==", "0", ")", ...
Calculate the {@link Saturation} for {@link ColorModel#HSL}. @param chroma is the {@link Chroma} value. @param lightness is the {@link Lightness} value. @return the {@link Saturation}.
[ "Calculate", "the", "{", "@link", "Saturation", "}", "for", "{", "@link", "ColorModel#HSL", "}", "." ]
train
https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/datatype/src/main/java/net/sf/mmm/util/datatype/api/color/GenericColor.java#L215-L222
AKSW/RDFUnit
rdfunit-commons/src/main/java/org/aksw/rdfunit/services/PrefixNSService.java
PrefixNSService.getLocalName
public static String getLocalName(final String uri, final String prefix) { String ns = getNSFromPrefix(prefix); if (ns != null) { return uri.replace(ns, ""); } throw new IllegalArgumentException("Undefined prefix (" + prefix + ") in URI: " + uri); }
java
public static String getLocalName(final String uri, final String prefix) { String ns = getNSFromPrefix(prefix); if (ns != null) { return uri.replace(ns, ""); } throw new IllegalArgumentException("Undefined prefix (" + prefix + ") in URI: " + uri); }
[ "public", "static", "String", "getLocalName", "(", "final", "String", "uri", ",", "final", "String", "prefix", ")", "{", "String", "ns", "=", "getNSFromPrefix", "(", "prefix", ")", ";", "if", "(", "ns", "!=", "null", ")", "{", "return", "uri", ".", "re...
Returns the local name of a URI by removing the prefix namespace @param uri the uri @param prefix the prefix we want to remove @return the local name (uri without prefix namespace)
[ "Returns", "the", "local", "name", "of", "a", "URI", "by", "removing", "the", "prefix", "namespace" ]
train
https://github.com/AKSW/RDFUnit/blob/083f18ebda4ad790b1fbb4cfe1c9dd1762d51384/rdfunit-commons/src/main/java/org/aksw/rdfunit/services/PrefixNSService.java#L117-L123
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/classfile/impl/AnalysisCache.java
AnalysisCache.reuseClassAnalysis
public <E> void reuseClassAnalysis(Class<E> analysisClass, Map<ClassDescriptor, Object> map) { Map<ClassDescriptor, Object> myMap = classAnalysisMap.get(analysisClass); if (myMap != null) { myMap.putAll(map); } else { myMap = createMap(classAnalysisEngineMap, analysisClass); myMap.putAll(map); classAnalysisMap.put(analysisClass, myMap); } }
java
public <E> void reuseClassAnalysis(Class<E> analysisClass, Map<ClassDescriptor, Object> map) { Map<ClassDescriptor, Object> myMap = classAnalysisMap.get(analysisClass); if (myMap != null) { myMap.putAll(map); } else { myMap = createMap(classAnalysisEngineMap, analysisClass); myMap.putAll(map); classAnalysisMap.put(analysisClass, myMap); } }
[ "public", "<", "E", ">", "void", "reuseClassAnalysis", "(", "Class", "<", "E", ">", "analysisClass", ",", "Map", "<", "ClassDescriptor", ",", "Object", ">", "map", ")", "{", "Map", "<", "ClassDescriptor", ",", "Object", ">", "myMap", "=", "classAnalysisMap...
Adds the data for given analysis type from given map to the cache @param analysisClass non null analysis type @param map non null, pre-filled map with analysis data for given type
[ "Adds", "the", "data", "for", "given", "analysis", "type", "from", "given", "map", "to", "the", "cache" ]
train
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/classfile/impl/AnalysisCache.java#L227-L236
jamesagnew/hapi-fhir
hapi-fhir-structures-r4/src/main/java/org/hl7/fhir/r4/conformance/ShExGenerator.java
ShExGenerator.genChoiceTypes
private String genChoiceTypes(StructureDefinition sd, ElementDefinition ed, String id) { List<String> choiceEntries = new ArrayList<String>(); String base = id.replace("[x]", ""); for(ElementDefinition.TypeRefComponent typ : ed.getType()) choiceEntries.add(genChoiceEntry(sd, ed, id, base, typ)); return StringUtils.join(choiceEntries, " |\n"); }
java
private String genChoiceTypes(StructureDefinition sd, ElementDefinition ed, String id) { List<String> choiceEntries = new ArrayList<String>(); String base = id.replace("[x]", ""); for(ElementDefinition.TypeRefComponent typ : ed.getType()) choiceEntries.add(genChoiceEntry(sd, ed, id, base, typ)); return StringUtils.join(choiceEntries, " |\n"); }
[ "private", "String", "genChoiceTypes", "(", "StructureDefinition", "sd", ",", "ElementDefinition", "ed", ",", "String", "id", ")", "{", "List", "<", "String", ">", "choiceEntries", "=", "new", "ArrayList", "<", "String", ">", "(", ")", ";", "String", "base",...
Generate a list of type choices for a "name[x]" style id @param sd Structure containing ed @param ed element definition @param id choice identifier @return ShEx fragment for the set of choices
[ "Generate", "a", "list", "of", "type", "choices", "for", "a", "name", "[", "x", "]", "style", "id" ]
train
https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-structures-r4/src/main/java/org/hl7/fhir/r4/conformance/ShExGenerator.java#L652-L660
lettuce-io/lettuce-core
src/main/java/io/lettuce/core/resource/Delay.java
Delay.decorrelatedJitter
public static Supplier<Delay> decorrelatedJitter(Duration lower, Duration upper, long base, TimeUnit targetTimeUnit) { LettuceAssert.notNull(lower, "Lower boundary must not be null"); LettuceAssert.isTrue(lower.toNanos() >= 0, "Lower boundary must be greater or equal to 0"); LettuceAssert.notNull(upper, "Upper boundary must not be null"); LettuceAssert.isTrue(upper.toNanos() > lower.toNanos(), "Upper boundary must be greater than the lower boundary"); LettuceAssert.isTrue(base >= 0, "Base must be greater or equal to 1"); LettuceAssert.notNull(targetTimeUnit, "Target TimeUnit must not be null"); // Create new Delay because it has state. return () -> new DecorrelatedJitterDelay(lower, upper, base, targetTimeUnit); }
java
public static Supplier<Delay> decorrelatedJitter(Duration lower, Duration upper, long base, TimeUnit targetTimeUnit) { LettuceAssert.notNull(lower, "Lower boundary must not be null"); LettuceAssert.isTrue(lower.toNanos() >= 0, "Lower boundary must be greater or equal to 0"); LettuceAssert.notNull(upper, "Upper boundary must not be null"); LettuceAssert.isTrue(upper.toNanos() > lower.toNanos(), "Upper boundary must be greater than the lower boundary"); LettuceAssert.isTrue(base >= 0, "Base must be greater or equal to 1"); LettuceAssert.notNull(targetTimeUnit, "Target TimeUnit must not be null"); // Create new Delay because it has state. return () -> new DecorrelatedJitterDelay(lower, upper, base, targetTimeUnit); }
[ "public", "static", "Supplier", "<", "Delay", ">", "decorrelatedJitter", "(", "Duration", "lower", ",", "Duration", "upper", ",", "long", "base", ",", "TimeUnit", "targetTimeUnit", ")", "{", "LettuceAssert", ".", "notNull", "(", "lower", ",", "\"Lower boundary m...
Creates a {@link Supplier} that constructs new {@link DecorrelatedJitterDelay} instances. @param lower the lower boundary, must be non-negative @param upper the upper boundary, must be greater than the lower boundary @param base the base, must be greater or equal to 0 @param targetTimeUnit the unit of the delay. @return a new {@link Supplier} of {@link DecorrelatedJitterDelay}. @since 5.0
[ "Creates", "a", "{", "@link", "Supplier", "}", "that", "constructs", "new", "{", "@link", "DecorrelatedJitterDelay", "}", "instances", "." ]
train
https://github.com/lettuce-io/lettuce-core/blob/b6de74e384dea112e3656684ca3f50cdfd6c8e0d/src/main/java/io/lettuce/core/resource/Delay.java#L282-L293
astrapi69/jaulp-wicket
jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/i18n/list/LinkListPanel.java
LinkListPanel.newAbstractLink
protected AbstractLink newAbstractLink(final String id, final LinkItem model) { AttributeModifier target = null; AbstractLink link = null; if ((model.getTarget() != null) && !model.getTarget().isEmpty()) { target = new AttributeModifier("target", Model.of(model.getTarget())); } if (model.getUrl() != null) { link = new ExternalLink(id, Model.of(model.getUrl())); } if (link == null) { link = new BookmarkablePageLink<String>(id, model.getPageClass()); } // if target not null then set it... if (target != null) { link.add(target); } link.setOutputMarkupId(true); return link; }
java
protected AbstractLink newAbstractLink(final String id, final LinkItem model) { AttributeModifier target = null; AbstractLink link = null; if ((model.getTarget() != null) && !model.getTarget().isEmpty()) { target = new AttributeModifier("target", Model.of(model.getTarget())); } if (model.getUrl() != null) { link = new ExternalLink(id, Model.of(model.getUrl())); } if (link == null) { link = new BookmarkablePageLink<String>(id, model.getPageClass()); } // if target not null then set it... if (target != null) { link.add(target); } link.setOutputMarkupId(true); return link; }
[ "protected", "AbstractLink", "newAbstractLink", "(", "final", "String", "id", ",", "final", "LinkItem", "model", ")", "{", "AttributeModifier", "target", "=", "null", ";", "AbstractLink", "link", "=", "null", ";", "if", "(", "(", "model", ".", "getTarget", "...
Factory method for creating the new item {@link AbstractLink} in the list. This method is invoked in the constructor from the derived classes and can be overridden so users can provide their own version of a new item {@link AbstractLink} in the list. @param id the id @param model the model @return the new item {@link AbstractLink} in the list.
[ "Factory", "method", "for", "creating", "the", "new", "item", "{", "@link", "AbstractLink", "}", "in", "the", "list", ".", "This", "method", "is", "invoked", "in", "the", "constructor", "from", "the", "derived", "classes", "and", "can", "be", "overridden", ...
train
https://github.com/astrapi69/jaulp-wicket/blob/85d74368d00abd9bb97659b5794e38c0f8a013d4/jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/i18n/list/LinkListPanel.java#L96-L119
jeremybrooks/jinx
src/main/java/net/jeremybrooks/jinx/api/PhotosGeoApi.java
PhotosGeoApi.photosForLocation
public Photos photosForLocation(Float lat, Float lon, Integer accuracy, EnumSet<JinxConstants.PhotoExtras> extras, int perPage, int page) throws JinxException { JinxUtils.validateParams(lat, lon); Map<String, String> params = new TreeMap<>(); params.put("method", "flickr.photos.geo.photosForLocation"); params.put("lat", lat.toString()); params.put("lon", lon.toString()); if (accuracy != null) { params.put("accuracy", accuracy.toString()); } if (!JinxUtils.isNullOrEmpty(extras)) { params.put("extras", JinxUtils.buildCommaDelimitedList(extras)); } if (perPage > 0) { params.put("per_page", Integer.toString(perPage)); } if (page > 0) { params.put("page", Integer.toString(page)); } return jinx.flickrGet(params, Photos.class); }
java
public Photos photosForLocation(Float lat, Float lon, Integer accuracy, EnumSet<JinxConstants.PhotoExtras> extras, int perPage, int page) throws JinxException { JinxUtils.validateParams(lat, lon); Map<String, String> params = new TreeMap<>(); params.put("method", "flickr.photos.geo.photosForLocation"); params.put("lat", lat.toString()); params.put("lon", lon.toString()); if (accuracy != null) { params.put("accuracy", accuracy.toString()); } if (!JinxUtils.isNullOrEmpty(extras)) { params.put("extras", JinxUtils.buildCommaDelimitedList(extras)); } if (perPage > 0) { params.put("per_page", Integer.toString(perPage)); } if (page > 0) { params.put("page", Integer.toString(page)); } return jinx.flickrGet(params, Photos.class); }
[ "public", "Photos", "photosForLocation", "(", "Float", "lat", ",", "Float", "lon", ",", "Integer", "accuracy", ",", "EnumSet", "<", "JinxConstants", ".", "PhotoExtras", ">", "extras", ",", "int", "perPage", ",", "int", "page", ")", "throws", "JinxException", ...
Return a list of photos for the calling user at a specific latitude, longitude and accuracy <br> This method requires authentication with 'read' permission. @param lat (Required) The latitude whose valid range is -90 to 90. Anything more than 6 decimal places will be truncated. @param lon (Required) The longitude whose valid range is -180 to 180. Anything more than 6 decimal places will be truncated. @param accuracy (Optional) Recorded accuracy level of the location information. World level is 1, Country is ~3, Region ~6, City ~11, Street ~16. Current range is 1-16. Defaults to 16 if not specified. @param extras (Optional) extra information to fetch for each returned photo. @param perPage Number of photos to return per page. If this argument is less than 1, it defaults to 100. The maximum allowed value is 500. @param page The page of results to return. If this argument is less than 1, it defaults to 1. @return photos object with photos in the requested range. @throws JinxException if required parameters are missing, or if there are any errors. @see <a href="https://www.flickr.com/services/api/flickr.photos.geo.photosForLocation.html">flickr.photos.geo.photosForLocation</a>
[ "Return", "a", "list", "of", "photos", "for", "the", "calling", "user", "at", "a", "specific", "latitude", "longitude", "and", "accuracy", "<br", ">", "This", "method", "requires", "authentication", "with", "read", "permission", "." ]
train
https://github.com/jeremybrooks/jinx/blob/ab7a4b7462d08bcbfd9b98bd3f5029771c20f6c6/src/main/java/net/jeremybrooks/jinx/api/PhotosGeoApi.java#L168-L187
aws/aws-sdk-java
aws-java-sdk-core/src/main/java/com/amazonaws/auth/profile/ProfilesConfigFileWriter.java
ProfilesConfigFileWriter.modifyOneProfile
public static void modifyOneProfile(File destination, String profileName, Profile newProfile) { final Map<String, Profile> modifications = Collections.singletonMap(profileName, newProfile); modifyProfiles(destination, modifications); }
java
public static void modifyOneProfile(File destination, String profileName, Profile newProfile) { final Map<String, Profile> modifications = Collections.singletonMap(profileName, newProfile); modifyProfiles(destination, modifications); }
[ "public", "static", "void", "modifyOneProfile", "(", "File", "destination", ",", "String", "profileName", ",", "Profile", "newProfile", ")", "{", "final", "Map", "<", "String", ",", "Profile", ">", "modifications", "=", "Collections", ".", "singletonMap", "(", ...
Modify one profile in the existing credentials file by in-place modification. This method will rename the existing profile if the specified Profile has a different name. @param destination The destination file to modify @param profileName The name of the existing profile to be modified @param newProfile The new Profile object.
[ "Modify", "one", "profile", "in", "the", "existing", "credentials", "file", "by", "in", "-", "place", "modification", ".", "This", "method", "will", "rename", "the", "existing", "profile", "if", "the", "specified", "Profile", "has", "a", "different", "name", ...
train
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/auth/profile/ProfilesConfigFileWriter.java#L126-L130
vladmihalcea/flexy-pool
flexy-pool-core/src/main/java/com/vladmihalcea/flexypool/util/ReflectionUtils.java
ReflectionUtils.setFieldValue
public static void setFieldValue(Object target, String fieldName, Object value) { try { Field field = target.getClass().getDeclaredField(fieldName); field.setAccessible(true); field.set(target, value); } catch (NoSuchFieldException e) { throw handleException(fieldName, e); } catch (IllegalAccessException e) { throw handleException(fieldName, e); } }
java
public static void setFieldValue(Object target, String fieldName, Object value) { try { Field field = target.getClass().getDeclaredField(fieldName); field.setAccessible(true); field.set(target, value); } catch (NoSuchFieldException e) { throw handleException(fieldName, e); } catch (IllegalAccessException e) { throw handleException(fieldName, e); } }
[ "public", "static", "void", "setFieldValue", "(", "Object", "target", ",", "String", "fieldName", ",", "Object", "value", ")", "{", "try", "{", "Field", "field", "=", "target", ".", "getClass", "(", ")", ".", "getDeclaredField", "(", "fieldName", ")", ";",...
Set target object field value @param target target object @param fieldName field name @param value field value
[ "Set", "target", "object", "field", "value" ]
train
https://github.com/vladmihalcea/flexy-pool/blob/d763d359e68299c2b4e28e4b67770581ae083431/flexy-pool-core/src/main/java/com/vladmihalcea/flexypool/util/ReflectionUtils.java#L56-L66
ozimov/cirneco
hamcrest/hamcrest-matchers/src/main/java/it/ozimov/cirneco/hamcrest/HamcrestMatchers.java
HamcrestMatchers.containsInAnyOrder
public static <T> Matcher<Iterable<? extends T>> containsInAnyOrder(final Iterable<T> items) { return IsIterableContainingInAnyOrder.containsInAnyOrder(items); }
java
public static <T> Matcher<Iterable<? extends T>> containsInAnyOrder(final Iterable<T> items) { return IsIterableContainingInAnyOrder.containsInAnyOrder(items); }
[ "public", "static", "<", "T", ">", "Matcher", "<", "Iterable", "<", "?", "extends", "T", ">", ">", "containsInAnyOrder", "(", "final", "Iterable", "<", "T", ">", "items", ")", "{", "return", "IsIterableContainingInAnyOrder", ".", "containsInAnyOrder", "(", "...
<p>Creates an order agnostic matcher for {@linkplain Iterable}s that matches when a single pass over the examined {@linkplain Iterable} yields a series of items, each logically equal to one item anywhere in the specified items. For a positive match, the examined iterable must be of the same length as the number of specified items.</p> <p> <p>N.B. each of the specified items will only be used once during a given examination, so be careful when specifying items that may be equal to more than one entry in an examined iterable. For example:</p> <br /> <p> <pre> //Arrange Iterable<String> actual = Arrays.asList("foo", "bar"); Iterable<String> expected = Arrays.asList("bar", "foo"); //Assert assertThat(actual, containsInAnyOrder(expected)); </pre> @param items the items that must equal the items provided by an examined {@linkplain Iterable} in any order
[ "<p", ">", "Creates", "an", "order", "agnostic", "matcher", "for", "{", "@linkplain", "Iterable", "}", "s", "that", "matches", "when", "a", "single", "pass", "over", "the", "examined", "{", "@linkplain", "Iterable", "}", "yields", "a", "series", "of", "ite...
train
https://github.com/ozimov/cirneco/blob/78ad782da0a2256634cfbebb2f97ed78c993b999/hamcrest/hamcrest-matchers/src/main/java/it/ozimov/cirneco/hamcrest/HamcrestMatchers.java#L515-L517
jmapper-framework/jmapper-core
JMapper Framework/src/main/java/com/googlecode/jmapper/xml/XML.java
XML.addGlobal
public XML addGlobal(Class<?> aClass,Global global){ checksGlobalAbsence(aClass); findXmlClass(aClass).global = Converter.toXmlGlobal(global); return this; }
java
public XML addGlobal(Class<?> aClass,Global global){ checksGlobalAbsence(aClass); findXmlClass(aClass).global = Converter.toXmlGlobal(global); return this; }
[ "public", "XML", "addGlobal", "(", "Class", "<", "?", ">", "aClass", ",", "Global", "global", ")", "{", "checksGlobalAbsence", "(", "aClass", ")", ";", "findXmlClass", "(", "aClass", ")", ".", "global", "=", "Converter", ".", "toXmlGlobal", "(", "global", ...
This method adds the global to an existing Class. @param aClass class to edit @param global global to add @return this instance of XML
[ "This", "method", "adds", "the", "global", "to", "an", "existing", "Class", "." ]
train
https://github.com/jmapper-framework/jmapper-core/blob/b48fd3527f35055b8b4a30f53a51136f183acc90/JMapper Framework/src/main/java/com/googlecode/jmapper/xml/XML.java#L307-L311
firebase/geofire-java
common/src/main/java/com/firebase/geofire/GeoFire.java
GeoFire.removeLocation
public void removeLocation(final String key, final CompletionListener completionListener) { if (key == null) { throw new NullPointerException(); } DatabaseReference keyRef = this.getDatabaseRefForKey(key); if (completionListener != null) { keyRef.setValue(null, new DatabaseReference.CompletionListener() { @Override public void onComplete(DatabaseError databaseError, DatabaseReference databaseReference) { completionListener.onComplete(key, databaseError); } }); } else { keyRef.setValue(null); } }
java
public void removeLocation(final String key, final CompletionListener completionListener) { if (key == null) { throw new NullPointerException(); } DatabaseReference keyRef = this.getDatabaseRefForKey(key); if (completionListener != null) { keyRef.setValue(null, new DatabaseReference.CompletionListener() { @Override public void onComplete(DatabaseError databaseError, DatabaseReference databaseReference) { completionListener.onComplete(key, databaseError); } }); } else { keyRef.setValue(null); } }
[ "public", "void", "removeLocation", "(", "final", "String", "key", ",", "final", "CompletionListener", "completionListener", ")", "{", "if", "(", "key", "==", "null", ")", "{", "throw", "new", "NullPointerException", "(", ")", ";", "}", "DatabaseReference", "k...
Removes the location for a key from this GeoFire. @param key The key to remove from this GeoFire @param completionListener A completion listener that is called once the location is successfully removed from the server or an error occurred
[ "Removes", "the", "location", "for", "a", "key", "from", "this", "GeoFire", "." ]
train
https://github.com/firebase/geofire-java/blob/c46ff339060d150741a8d0d40c8e73b78edca6c3/common/src/main/java/com/firebase/geofire/GeoFire.java#L202-L217
Blazebit/blaze-utils
blaze-common-utils/src/main/java/com/blazebit/comparator/BaseComparator.java
BaseComparator.compareNullObjects
protected Integer compareNullObjects(Object object1, Object object2) { if ((object1 == null) && (object2 == null)) { return 0; } if (object1 == null) { return 1; } if (object2 == null) { return -1; } return null; }
java
protected Integer compareNullObjects(Object object1, Object object2) { if ((object1 == null) && (object2 == null)) { return 0; } if (object1 == null) { return 1; } if (object2 == null) { return -1; } return null; }
[ "protected", "Integer", "compareNullObjects", "(", "Object", "object1", ",", "Object", "object2", ")", "{", "if", "(", "(", "object1", "==", "null", ")", "&&", "(", "object2", "==", "null", ")", ")", "{", "return", "0", ";", "}", "if", "(", "object1", ...
Checks for null objects and returns the proper result depedning on which object is null @param object1 @param object2 @return <ol> <li>0 = field null or both objects null</li> <li>1 = object1 is null</li> <li>-1 = object2 is null</li> <li>null = both objects are not null</li> </ol>
[ "Checks", "for", "null", "objects", "and", "returns", "the", "proper", "result", "depedning", "on", "which", "object", "is", "null" ]
train
https://github.com/Blazebit/blaze-utils/blob/3e35a694a8f71d515aad066196acd523994d6aaa/blaze-common-utils/src/main/java/com/blazebit/comparator/BaseComparator.java#L38-L49
qos-ch/slf4j
slf4j-ext/src/main/java/org/slf4j/ext/XLogger.java
XLogger.catching
public void catching(Level level, Throwable throwable) { if (instanceofLAL) { ((LocationAwareLogger) logger).log(CATCHING_MARKER, FQCN, level.level, "catching", null, throwable); } }
java
public void catching(Level level, Throwable throwable) { if (instanceofLAL) { ((LocationAwareLogger) logger).log(CATCHING_MARKER, FQCN, level.level, "catching", null, throwable); } }
[ "public", "void", "catching", "(", "Level", "level", ",", "Throwable", "throwable", ")", "{", "if", "(", "instanceofLAL", ")", "{", "(", "(", "LocationAwareLogger", ")", "logger", ")", ".", "log", "(", "CATCHING_MARKER", ",", "FQCN", ",", "level", ".", "...
Log an exception being caught allowing the log level to be specified. @param level the logging level to use. @param throwable the exception being caught.
[ "Log", "an", "exception", "being", "caught", "allowing", "the", "log", "level", "to", "be", "specified", "." ]
train
https://github.com/qos-ch/slf4j/blob/905443f39fadd88a8dd2c467e44affd8cb072a4d/slf4j-ext/src/main/java/org/slf4j/ext/XLogger.java#L199-L203
looly/hutool
hutool-core/src/main/java/cn/hutool/core/img/ImgUtil.java
ImgUtil.pressText
public static void pressText(Image srcImage, OutputStream to, String pressText, Color color, Font font, int x, int y, float alpha) throws IORuntimeException { pressText(srcImage, getImageOutputStream(to), pressText, color, font, x, y, alpha); }
java
public static void pressText(Image srcImage, OutputStream to, String pressText, Color color, Font font, int x, int y, float alpha) throws IORuntimeException { pressText(srcImage, getImageOutputStream(to), pressText, color, font, x, y, alpha); }
[ "public", "static", "void", "pressText", "(", "Image", "srcImage", ",", "OutputStream", "to", ",", "String", "pressText", ",", "Color", "color", ",", "Font", "font", ",", "int", "x", ",", "int", "y", ",", "float", "alpha", ")", "throws", "IORuntimeExceptio...
给图片添加文字水印<br> 此方法并不关闭流 @param srcImage 源图像 @param to 目标流 @param pressText 水印文字 @param color 水印的字体颜色 @param font {@link Font} 字体相关信息,如果默认则为{@code null} @param x 修正值。 默认在中间,偏移量相对于中间偏移 @param y 修正值。 默认在中间,偏移量相对于中间偏移 @param alpha 透明度:alpha 必须是范围 [0.0, 1.0] 之内(包含边界值)的一个浮点数字 @throws IORuntimeException IO异常 @since 3.2.2
[ "给图片添加文字水印<br", ">", "此方法并不关闭流" ]
train
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/img/ImgUtil.java#L826-L828
italiangrid/voms-api-java
src/main/java/org/italiangrid/voms/util/CredentialsUtils.java
CredentialsUtils.savePrivateKeyPKCS1
private static void savePrivateKeyPKCS1(OutputStream os, PrivateKey key) throws IllegalArgumentException, IOException { CertificateUtils.savePrivateKey(os, key, Encoding.PEM, null, new char[0], true); }
java
private static void savePrivateKeyPKCS1(OutputStream os, PrivateKey key) throws IllegalArgumentException, IOException { CertificateUtils.savePrivateKey(os, key, Encoding.PEM, null, new char[0], true); }
[ "private", "static", "void", "savePrivateKeyPKCS1", "(", "OutputStream", "os", ",", "PrivateKey", "key", ")", "throws", "IllegalArgumentException", ",", "IOException", "{", "CertificateUtils", ".", "savePrivateKey", "(", "os", ",", "key", ",", "Encoding", ".", "PE...
Serializes a private key to an output stream following the pkcs1 encoding. This method just delegates to canl, but provides a much more understandable signature. @param os @param key @throws IllegalArgumentException @throws IOException
[ "Serializes", "a", "private", "key", "to", "an", "output", "stream", "following", "the", "pkcs1", "encoding", "." ]
train
https://github.com/italiangrid/voms-api-java/blob/b33d6cf98ca9449bed87b1cc307d411514589deb/src/main/java/org/italiangrid/voms/util/CredentialsUtils.java#L117-L123
elki-project/elki
elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/GeneralizedLogisticDistribution.java
GeneralizedLogisticDistribution.logpdf
public static double logpdf(double val, double loc, double scale, double shape) { val = (val - loc) / scale; double e = FastMath.exp(-val); return -(val + (shape + 1.0) * FastMath.log1p(e)) + FastMath.log(shape); }
java
public static double logpdf(double val, double loc, double scale, double shape) { val = (val - loc) / scale; double e = FastMath.exp(-val); return -(val + (shape + 1.0) * FastMath.log1p(e)) + FastMath.log(shape); }
[ "public", "static", "double", "logpdf", "(", "double", "val", ",", "double", "loc", ",", "double", "scale", ",", "double", "shape", ")", "{", "val", "=", "(", "val", "-", "loc", ")", "/", "scale", ";", "double", "e", "=", "FastMath", ".", "exp", "(...
log Probability density function. @param val Value @param loc Location @param scale Scale @param shape Shape @return log PDF
[ "log", "Probability", "density", "function", "." ]
train
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/GeneralizedLogisticDistribution.java#L134-L138
symphonyoss/messageml-utils
src/main/java/org/symphonyoss/symphony/messageml/util/XmlPrintStream.java
XmlPrintStream.openElement
public void openElement(String name, Map<String, String> attributes) { elementStack.push(name); print("<" + name); for (Entry<String, String> entry : attributes.entrySet()) { print(" " + entry.getKey() + "=\"" + escape(entry.getValue()) + "\""); } if (this.isNoNl()) { print(">"); } else { println(">"); } indent(); }
java
public void openElement(String name, Map<String, String> attributes) { elementStack.push(name); print("<" + name); for (Entry<String, String> entry : attributes.entrySet()) { print(" " + entry.getKey() + "=\"" + escape(entry.getValue()) + "\""); } if (this.isNoNl()) { print(">"); } else { println(">"); } indent(); }
[ "public", "void", "openElement", "(", "String", "name", ",", "Map", "<", "String", ",", "String", ">", "attributes", ")", "{", "elementStack", ".", "push", "(", "name", ")", ";", "print", "(", "\"<\"", "+", "name", ")", ";", "for", "(", "Entry", "<",...
Open an XML element with the given name, and attributes. A call to closeElement() will output the appropriate XML closing tag. This class remembers the tag names. @param name Name of the XML element to open. @param attributes A map of name value pairs which will be used to add attributes to the element.
[ "Open", "an", "XML", "element", "with", "the", "given", "name", "and", "attributes", ".", "A", "call", "to", "closeElement", "()", "will", "output", "the", "appropriate", "XML", "closing", "tag", ".", "This", "class", "remembers", "the", "tag", "names", "....
train
https://github.com/symphonyoss/messageml-utils/blob/68daed66267062d144a05b3ee9a9bf4b715e3f95/src/main/java/org/symphonyoss/symphony/messageml/util/XmlPrintStream.java#L61-L74
Azure/azure-sdk-for-java
cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ImageModerationsImpl.java
ImageModerationsImpl.matchUrlInput
public MatchResponse matchUrlInput(String contentType, BodyModelModel imageUrl, MatchUrlInputOptionalParameter matchUrlInputOptionalParameter) { return matchUrlInputWithServiceResponseAsync(contentType, imageUrl, matchUrlInputOptionalParameter).toBlocking().single().body(); }
java
public MatchResponse matchUrlInput(String contentType, BodyModelModel imageUrl, MatchUrlInputOptionalParameter matchUrlInputOptionalParameter) { return matchUrlInputWithServiceResponseAsync(contentType, imageUrl, matchUrlInputOptionalParameter).toBlocking().single().body(); }
[ "public", "MatchResponse", "matchUrlInput", "(", "String", "contentType", ",", "BodyModelModel", "imageUrl", ",", "MatchUrlInputOptionalParameter", "matchUrlInputOptionalParameter", ")", "{", "return", "matchUrlInputWithServiceResponseAsync", "(", "contentType", ",", "imageUrl"...
Fuzzily match an image against one of your custom Image Lists. You can create and manage your custom image lists using &lt;a href="/docs/services/578ff44d2703741568569ab9/operations/578ff7b12703741568569abe"&gt;this&lt;/a&gt; API. Returns ID and tags of matching image.&lt;br/&gt; &lt;br/&gt; Note: Refresh Index must be run on the corresponding Image List before additions and removals are reflected in the response. @param contentType The content type. @param imageUrl The image url. @param matchUrlInputOptionalParameter the object representing the optional parameters to be set before calling this API @throws IllegalArgumentException thrown if parameters fail the validation @throws APIErrorException thrown if the request is rejected by server @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent @return the MatchResponse object if successful.
[ "Fuzzily", "match", "an", "image", "against", "one", "of", "your", "custom", "Image", "Lists", ".", "You", "can", "create", "and", "manage", "your", "custom", "image", "lists", "using", "&lt", ";", "a", "href", "=", "/", "docs", "/", "services", "/", "...
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ImageModerationsImpl.java#L1753-L1755
jbundle/jbundle
base/db/client/src/main/java/org/jbundle/base/db/client/ClientTable.java
ClientTable.setProperty
public void setProperty(String strProperty, String strValue) { try { synchronized (this.getSyncObject()) { // In case this is called from another task m_tableRemote.setRemoteProperty(strProperty, strValue); } } catch (Exception ex) { ex.printStackTrace(); } super.setProperty(strProperty, strValue); }
java
public void setProperty(String strProperty, String strValue) { try { synchronized (this.getSyncObject()) { // In case this is called from another task m_tableRemote.setRemoteProperty(strProperty, strValue); } } catch (Exception ex) { ex.printStackTrace(); } super.setProperty(strProperty, strValue); }
[ "public", "void", "setProperty", "(", "String", "strProperty", ",", "String", "strValue", ")", "{", "try", "{", "synchronized", "(", "this", ".", "getSyncObject", "(", ")", ")", "{", "// In case this is called from another task", "m_tableRemote", ".", "setRemoteProp...
Set a property for this table. Usually used to Enable/Disable autosequence for this table. <p />Sets the remote properties and also sets the local properties. @param strProperty The key to set. @param strValue The value to set.
[ "Set", "a", "property", "for", "this", "table", ".", "Usually", "used", "to", "Enable", "/", "Disable", "autosequence", "for", "this", "table", ".", "<p", "/", ">", "Sets", "the", "remote", "properties", "and", "also", "sets", "the", "local", "properties",...
train
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/db/client/src/main/java/org/jbundle/base/db/client/ClientTable.java#L619-L630
xmlunit/xmlunit
xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XMLAssert.java
XMLAssert.assertXMLNotEqual
public static void assertXMLNotEqual(String control, String test) throws SAXException, IOException { assertXMLNotEqual(null, control, test); }
java
public static void assertXMLNotEqual(String control, String test) throws SAXException, IOException { assertXMLNotEqual(null, control, test); }
[ "public", "static", "void", "assertXMLNotEqual", "(", "String", "control", ",", "String", "test", ")", "throws", "SAXException", ",", "IOException", "{", "assertXMLNotEqual", "(", "null", ",", "control", ",", "test", ")", ";", "}" ]
Assert that two XML documents are NOT similar @param control XML to be compared against @param test XML to be tested @throws SAXException @throws IOException
[ "Assert", "that", "two", "XML", "documents", "are", "NOT", "similar" ]
train
https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XMLAssert.java#L281-L284
versionone/VersionOne.SDK.Java.ObjectModel
src/main/java/com/versionone/om/Project.java
Project.createTheme
public Theme createTheme(String name, Map<String, Object> attributes) { return getInstance().create().theme(name, this, attributes); }
java
public Theme createTheme(String name, Map<String, Object> attributes) { return getInstance().create().theme(name, this, attributes); }
[ "public", "Theme", "createTheme", "(", "String", "name", ",", "Map", "<", "String", ",", "Object", ">", "attributes", ")", "{", "return", "getInstance", "(", ")", ".", "create", "(", ")", ".", "theme", "(", "name", ",", "this", ",", "attributes", ")", ...
Create a new Theme in this Project. @param name The initial name of the Theme. @param attributes additional attributes for Theme. @return A new Theme.
[ "Create", "a", "new", "Theme", "in", "this", "Project", "." ]
train
https://github.com/versionone/VersionOne.SDK.Java.ObjectModel/blob/59d35b67c849299631bca45ee94143237eb2ae1a/src/main/java/com/versionone/om/Project.java#L251-L253
sgroschupf/zkclient
src/main/java/org/I0Itec/zkclient/ZkClient.java
ZkClient.getAcl
public Map.Entry<List<ACL>, Stat> getAcl(final String path) throws ZkException { if (path == null) { throw new NullPointerException("Missing value for path"); } if (!exists(path)) { throw new RuntimeException("trying to get acls on non existing node " + path); } return retryUntilConnected(new Callable<Map.Entry<List<ACL>, Stat>>() { @Override public Map.Entry<List<ACL>, Stat> call() throws Exception { return _connection.getAcl(path); } }); }
java
public Map.Entry<List<ACL>, Stat> getAcl(final String path) throws ZkException { if (path == null) { throw new NullPointerException("Missing value for path"); } if (!exists(path)) { throw new RuntimeException("trying to get acls on non existing node " + path); } return retryUntilConnected(new Callable<Map.Entry<List<ACL>, Stat>>() { @Override public Map.Entry<List<ACL>, Stat> call() throws Exception { return _connection.getAcl(path); } }); }
[ "public", "Map", ".", "Entry", "<", "List", "<", "ACL", ">", ",", "Stat", ">", "getAcl", "(", "final", "String", "path", ")", "throws", "ZkException", "{", "if", "(", "path", "==", "null", ")", "{", "throw", "new", "NullPointerException", "(", "\"Missi...
Gets the acl on path @param path @return an entry instance with key = list of acls on node and value = stats. @throws ZkException if any ZooKeeper exception occurred @throws RuntimeException if any other exception occurs
[ "Gets", "the", "acl", "on", "path" ]
train
https://github.com/sgroschupf/zkclient/blob/03ccf12c70aca2f771bfcd94d44dc7c4d4a1495e/src/main/java/org/I0Itec/zkclient/ZkClient.java#L354-L369
networknt/light-4j
dump/src/main/java/com/networknt/dump/DumpHelper.java
DumpHelper.getTabBasedOnLevel
private static String getTabBasedOnLevel(int level, int indentSize) { StringBuilder sb = new StringBuilder(); for(int i = 0; i < level; i ++) { for(int j = 0; j < indentSize; j++) { sb.append(" "); } } return sb.toString(); }
java
private static String getTabBasedOnLevel(int level, int indentSize) { StringBuilder sb = new StringBuilder(); for(int i = 0; i < level; i ++) { for(int j = 0; j < indentSize; j++) { sb.append(" "); } } return sb.toString(); }
[ "private", "static", "String", "getTabBasedOnLevel", "(", "int", "level", ",", "int", "indentSize", ")", "{", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "level", ";", "i", "++", ...
calculate indent for formatting @return " " string of empty spaces
[ "calculate", "indent", "for", "formatting" ]
train
https://github.com/networknt/light-4j/blob/2a60257c60663684c8f6dc8b5ea3cf184e534db6/dump/src/main/java/com/networknt/dump/DumpHelper.java#L101-L109
liferay/com-liferay-commerce
commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceOrderItemPersistenceImpl.java
CommerceOrderItemPersistenceImpl.removeByC_I
@Override public void removeByC_I(long commerceOrderId, long CPInstanceId) { for (CommerceOrderItem commerceOrderItem : findByC_I(commerceOrderId, CPInstanceId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) { remove(commerceOrderItem); } }
java
@Override public void removeByC_I(long commerceOrderId, long CPInstanceId) { for (CommerceOrderItem commerceOrderItem : findByC_I(commerceOrderId, CPInstanceId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) { remove(commerceOrderItem); } }
[ "@", "Override", "public", "void", "removeByC_I", "(", "long", "commerceOrderId", ",", "long", "CPInstanceId", ")", "{", "for", "(", "CommerceOrderItem", "commerceOrderItem", ":", "findByC_I", "(", "commerceOrderId", ",", "CPInstanceId", ",", "QueryUtil", ".", "AL...
Removes all the commerce order items where commerceOrderId = &#63; and CPInstanceId = &#63; from the database. @param commerceOrderId the commerce order ID @param CPInstanceId the cp instance ID
[ "Removes", "all", "the", "commerce", "order", "items", "where", "commerceOrderId", "=", "&#63", ";", "and", "CPInstanceId", "=", "&#63", ";", "from", "the", "database", "." ]
train
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceOrderItemPersistenceImpl.java#L2129-L2135
sporniket/core
sporniket-core-ml/src/main/java/com/sporniket/libre/lang/xml/XmlStringTools.java
XmlStringTools.doAppendCdataSection
private static StringBuffer doAppendCdataSection(StringBuffer buffer, String cdataContent) { buffer.append(SEQUENCE__CDATA__OPEN).append(cdataContent).append(SEQUENCE__CDATA__CLOSE); return buffer; }
java
private static StringBuffer doAppendCdataSection(StringBuffer buffer, String cdataContent) { buffer.append(SEQUENCE__CDATA__OPEN).append(cdataContent).append(SEQUENCE__CDATA__CLOSE); return buffer; }
[ "private", "static", "StringBuffer", "doAppendCdataSection", "(", "StringBuffer", "buffer", ",", "String", "cdataContent", ")", "{", "buffer", ".", "append", "(", "SEQUENCE__CDATA__OPEN", ")", ".", "append", "(", "cdataContent", ")", ".", "append", "(", "SEQUENCE_...
Add a cdata section to a StringBuffer. If the buffer is null, a new one is created. @param buffer StringBuffer to fill @param cdataContent the cdata content @return the buffer
[ "Add", "a", "cdata", "section", "to", "a", "StringBuffer", "." ]
train
https://github.com/sporniket/core/blob/3480ebd72a07422fcc09971be2607ee25efb2c26/sporniket-core-ml/src/main/java/com/sporniket/libre/lang/xml/XmlStringTools.java#L436-L440
j-a-w-r/jawr-main-repo
jawr-tools/jawr-bundle-processor/src/main/java/net/jawr/web/bundle/processor/BundleProcessor.java
BundleProcessor.createLinkToBundle
protected List<RenderedLink> createLinkToBundle( ResourceBundlesHandler handler, String path, String resourceType, Map<String, String> variantMap) throws IOException { ArrayList<RenderedLink> linksToBundle = new ArrayList<RenderedLink>(); BasicBundleRenderer bundleRenderer = new BasicBundleRenderer(handler, resourceType); StringWriter sw = new StringWriter(); // The gzip compression will be made by the CDN server // So we force it to false. boolean useGzip = false; // The generation of bundle is the same in SSL and non SSL mode boolean isSslRequest = false; // First deals with the production mode handler.getConfig().setDebugModeOn(false); handler.getConfig().setGzipResourcesModeOn(useGzip); BundleRendererContext ctx = new BundleRendererContext("", variantMap, useGzip, isSslRequest); bundleRenderer.renderBundleLinks(path, ctx, sw); // Then take in account the debug mode handler.getConfig().setDebugModeOn(true); ctx = new BundleRendererContext("", variantMap, useGzip, isSslRequest); bundleRenderer.renderBundleLinks(path, ctx, sw); List<RenderedLink> renderedLinks = bundleRenderer.getRenderedLinks(); // Remove context override path if it's defined. String contextPathOverride = handler.getConfig() .getContextPathOverride(); for (Iterator<RenderedLink> iterator = renderedLinks.iterator(); iterator .hasNext();) { RenderedLink renderedLink = iterator.next(); String renderedLinkPath = renderedLink.getLink(); // Remove the context path override if (StringUtils.isNotEmpty(contextPathOverride) && renderedLinkPath.startsWith(contextPathOverride)) { renderedLinkPath = renderedLinkPath .substring(contextPathOverride.length()); } renderedLink.setLink(PathNormalizer.asPath(renderedLinkPath)); linksToBundle.add(renderedLink); } return linksToBundle; }
java
protected List<RenderedLink> createLinkToBundle( ResourceBundlesHandler handler, String path, String resourceType, Map<String, String> variantMap) throws IOException { ArrayList<RenderedLink> linksToBundle = new ArrayList<RenderedLink>(); BasicBundleRenderer bundleRenderer = new BasicBundleRenderer(handler, resourceType); StringWriter sw = new StringWriter(); // The gzip compression will be made by the CDN server // So we force it to false. boolean useGzip = false; // The generation of bundle is the same in SSL and non SSL mode boolean isSslRequest = false; // First deals with the production mode handler.getConfig().setDebugModeOn(false); handler.getConfig().setGzipResourcesModeOn(useGzip); BundleRendererContext ctx = new BundleRendererContext("", variantMap, useGzip, isSslRequest); bundleRenderer.renderBundleLinks(path, ctx, sw); // Then take in account the debug mode handler.getConfig().setDebugModeOn(true); ctx = new BundleRendererContext("", variantMap, useGzip, isSslRequest); bundleRenderer.renderBundleLinks(path, ctx, sw); List<RenderedLink> renderedLinks = bundleRenderer.getRenderedLinks(); // Remove context override path if it's defined. String contextPathOverride = handler.getConfig() .getContextPathOverride(); for (Iterator<RenderedLink> iterator = renderedLinks.iterator(); iterator .hasNext();) { RenderedLink renderedLink = iterator.next(); String renderedLinkPath = renderedLink.getLink(); // Remove the context path override if (StringUtils.isNotEmpty(contextPathOverride) && renderedLinkPath.startsWith(contextPathOverride)) { renderedLinkPath = renderedLinkPath .substring(contextPathOverride.length()); } renderedLink.setLink(PathNormalizer.asPath(renderedLinkPath)); linksToBundle.add(renderedLink); } return linksToBundle; }
[ "protected", "List", "<", "RenderedLink", ">", "createLinkToBundle", "(", "ResourceBundlesHandler", "handler", ",", "String", "path", ",", "String", "resourceType", ",", "Map", "<", "String", ",", "String", ">", "variantMap", ")", "throws", "IOException", "{", "...
Returns the link to the bundle @param handler the resource bundles handler @param path the path @param variantKey the local variant key @return the link to the bundle @throws IOException if an IO exception occurs
[ "Returns", "the", "link", "to", "the", "bundle" ]
train
https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr-tools/jawr-bundle-processor/src/main/java/net/jawr/web/bundle/processor/BundleProcessor.java#L1130-L1179
phax/ph-commons
ph-commons/src/main/java/com/helger/commons/typeconvert/TypeConverter.java
TypeConverter.convertToDouble
public static double convertToDouble (@Nonnull final Object aSrcValue) { if (aSrcValue == null) throw new TypeConverterException (double.class, EReason.NULL_SOURCE_NOT_ALLOWED); final Double aValue = convert (aSrcValue, Double.class); return aValue.doubleValue (); }
java
public static double convertToDouble (@Nonnull final Object aSrcValue) { if (aSrcValue == null) throw new TypeConverterException (double.class, EReason.NULL_SOURCE_NOT_ALLOWED); final Double aValue = convert (aSrcValue, Double.class); return aValue.doubleValue (); }
[ "public", "static", "double", "convertToDouble", "(", "@", "Nonnull", "final", "Object", "aSrcValue", ")", "{", "if", "(", "aSrcValue", "==", "null", ")", "throw", "new", "TypeConverterException", "(", "double", ".", "class", ",", "EReason", ".", "NULL_SOURCE_...
Convert the passed source value to double @param aSrcValue The source value. May not be <code>null</code>. @return The converted value. @throws TypeConverterException if the source value is <code>null</code> or if no converter was found or if the converter returned a <code>null</code> object. @throws RuntimeException If the converter itself throws an exception @see TypeConverterProviderBestMatch
[ "Convert", "the", "passed", "source", "value", "to", "double" ]
train
https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/typeconvert/TypeConverter.java#L234-L240
OpenCompare/OpenCompare
org.opencompare/pcmdata-importers/src/main/java/misc/PCMUtil.java
PCMUtil.loadCSV
public static List<PCMContainer> loadCSV(File file) throws IOException { return loadCSV(file, PCMDirection.PRODUCTS_AS_LINES); }
java
public static List<PCMContainer> loadCSV(File file) throws IOException { return loadCSV(file, PCMDirection.PRODUCTS_AS_LINES); }
[ "public", "static", "List", "<", "PCMContainer", ">", "loadCSV", "(", "File", "file", ")", "throws", "IOException", "{", "return", "loadCSV", "(", "file", ",", "PCMDirection", ".", "PRODUCTS_AS_LINES", ")", ";", "}" ]
A helper method to get a PCMContainer from a CSV file (limited in a sense we only retrieve the 1st element of containers) @param file @return @throws IOException
[ "A", "helper", "method", "to", "get", "a", "PCMContainer", "from", "a", "CSV", "file", "(", "limited", "in", "a", "sense", "we", "only", "retrieve", "the", "1st", "element", "of", "containers", ")" ]
train
https://github.com/OpenCompare/OpenCompare/blob/6cd776466b375cb8ecca08fcd94e573d65e20b14/org.opencompare/pcmdata-importers/src/main/java/misc/PCMUtil.java#L147-L150
hal/elemento
core/src/main/java/org/jboss/gwt/elemento/core/BodyObserver.java
BodyObserver.addDetachObserver
static void addDetachObserver(HTMLElement element, ObserverCallback callback) { if (!ready) { startObserving(); } detachObservers.add(createObserver(element, callback, DETACH_UID_KEY)); }
java
static void addDetachObserver(HTMLElement element, ObserverCallback callback) { if (!ready) { startObserving(); } detachObservers.add(createObserver(element, callback, DETACH_UID_KEY)); }
[ "static", "void", "addDetachObserver", "(", "HTMLElement", "element", ",", "ObserverCallback", "callback", ")", "{", "if", "(", "!", "ready", ")", "{", "startObserving", "(", ")", ";", "}", "detachObservers", ".", "add", "(", "createObserver", "(", "element", ...
Check if the observer is already started, if not it will start it, then register and callback for when the element is removed from the dom.
[ "Check", "if", "the", "observer", "is", "already", "started", "if", "not", "it", "will", "start", "it", "then", "register", "and", "callback", "for", "when", "the", "element", "is", "removed", "from", "the", "dom", "." ]
train
https://github.com/hal/elemento/blob/26da2d5a1fe2ec55b779737dbaeda25a942eee61/core/src/main/java/org/jboss/gwt/elemento/core/BodyObserver.java#L111-L116
liferay/com-liferay-commerce
commerce-price-list-service/src/main/java/com/liferay/commerce/price/list/service/persistence/impl/CommercePriceEntryPersistenceImpl.java
CommercePriceEntryPersistenceImpl.findByUUID_G
@Override public CommercePriceEntry findByUUID_G(String uuid, long groupId) throws NoSuchPriceEntryException { CommercePriceEntry commercePriceEntry = fetchByUUID_G(uuid, groupId); if (commercePriceEntry == null) { StringBundler msg = new StringBundler(6); msg.append(_NO_SUCH_ENTITY_WITH_KEY); msg.append("uuid="); msg.append(uuid); msg.append(", groupId="); msg.append(groupId); msg.append("}"); if (_log.isDebugEnabled()) { _log.debug(msg.toString()); } throw new NoSuchPriceEntryException(msg.toString()); } return commercePriceEntry; }
java
@Override public CommercePriceEntry findByUUID_G(String uuid, long groupId) throws NoSuchPriceEntryException { CommercePriceEntry commercePriceEntry = fetchByUUID_G(uuid, groupId); if (commercePriceEntry == null) { StringBundler msg = new StringBundler(6); msg.append(_NO_SUCH_ENTITY_WITH_KEY); msg.append("uuid="); msg.append(uuid); msg.append(", groupId="); msg.append(groupId); msg.append("}"); if (_log.isDebugEnabled()) { _log.debug(msg.toString()); } throw new NoSuchPriceEntryException(msg.toString()); } return commercePriceEntry; }
[ "@", "Override", "public", "CommercePriceEntry", "findByUUID_G", "(", "String", "uuid", ",", "long", "groupId", ")", "throws", "NoSuchPriceEntryException", "{", "CommercePriceEntry", "commercePriceEntry", "=", "fetchByUUID_G", "(", "uuid", ",", "groupId", ")", ";", ...
Returns the commerce price entry where uuid = &#63; and groupId = &#63; or throws a {@link NoSuchPriceEntryException} if it could not be found. @param uuid the uuid @param groupId the group ID @return the matching commerce price entry @throws NoSuchPriceEntryException if a matching commerce price entry could not be found
[ "Returns", "the", "commerce", "price", "entry", "where", "uuid", "=", "&#63", ";", "and", "groupId", "=", "&#63", ";", "or", "throws", "a", "{", "@link", "NoSuchPriceEntryException", "}", "if", "it", "could", "not", "be", "found", "." ]
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/CommercePriceEntryPersistenceImpl.java#L669-L695
spring-projects/spring-loaded
springloaded/src/main/java/org/springsource/loaded/TypeRegistry.java
TypeRegistry.associateReloadableType
@UsedByGeneratedCode public static void associateReloadableType(ReloadableType child, Class<?> parent) { // TODO performance - can we make this cheaper? ClassLoader parentClassLoader = parent.getClassLoader(); if (parentClassLoader == null) { return; } TypeRegistry parentTypeRegistry = TypeRegistry.getTypeRegistryFor(parent.getClassLoader()); ReloadableType parentReloadableType = parentTypeRegistry.getReloadableType(parent); if (parentReloadableType != null) { parentReloadableType.recordSubtype(child); } }
java
@UsedByGeneratedCode public static void associateReloadableType(ReloadableType child, Class<?> parent) { // TODO performance - can we make this cheaper? ClassLoader parentClassLoader = parent.getClassLoader(); if (parentClassLoader == null) { return; } TypeRegistry parentTypeRegistry = TypeRegistry.getTypeRegistryFor(parent.getClassLoader()); ReloadableType parentReloadableType = parentTypeRegistry.getReloadableType(parent); if (parentReloadableType != null) { parentReloadableType.recordSubtype(child); } }
[ "@", "UsedByGeneratedCode", "public", "static", "void", "associateReloadableType", "(", "ReloadableType", "child", ",", "Class", "<", "?", ">", "parent", ")", "{", "// TODO performance - can we make this cheaper?", "ClassLoader", "parentClassLoader", "=", "parent", ".", ...
Called from the static initializer of a reloadabletype, allowing it to connect itself to the parent type, such that when reloading occurs we can mark all relevant types in the hierarchy as being impacted by the reload. @param child the ReloadableType actively being initialized @param parent the superclass of the reloadable type (may or may not be reloadable!)
[ "Called", "from", "the", "static", "initializer", "of", "a", "reloadabletype", "allowing", "it", "to", "connect", "itself", "to", "the", "parent", "type", "such", "that", "when", "reloading", "occurs", "we", "can", "mark", "all", "relevant", "types", "in", "...
train
https://github.com/spring-projects/spring-loaded/blob/59b32f957a05c6d9f149148158053605e2a6205a/springloaded/src/main/java/org/springsource/loaded/TypeRegistry.java#L2302-L2314
Azure/azure-sdk-for-java
logic/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/logic/v2016_06_01/implementation/WorkflowsInner.java
WorkflowsInner.enableAsync
public Observable<Void> enableAsync(String resourceGroupName, String workflowName) { return enableWithServiceResponseAsync(resourceGroupName, workflowName).map(new Func1<ServiceResponse<Void>, Void>() { @Override public Void call(ServiceResponse<Void> response) { return response.body(); } }); }
java
public Observable<Void> enableAsync(String resourceGroupName, String workflowName) { return enableWithServiceResponseAsync(resourceGroupName, workflowName).map(new Func1<ServiceResponse<Void>, Void>() { @Override public Void call(ServiceResponse<Void> response) { return response.body(); } }); }
[ "public", "Observable", "<", "Void", ">", "enableAsync", "(", "String", "resourceGroupName", ",", "String", "workflowName", ")", "{", "return", "enableWithServiceResponseAsync", "(", "resourceGroupName", ",", "workflowName", ")", ".", "map", "(", "new", "Func1", "...
Enables a workflow. @param resourceGroupName The resource group name. @param workflowName The workflow name. @throws IllegalArgumentException thrown if parameters fail the validation @return the {@link ServiceResponse} object if successful.
[ "Enables", "a", "workflow", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/logic/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/logic/v2016_06_01/implementation/WorkflowsInner.java#L1077-L1084
joniles/mpxj
src/main/java/net/sf/mpxj/mpp/MPP12Reader.java
MPP12Reader.processAssignmentData
private void processAssignmentData() throws IOException { FieldMap fieldMap = new FieldMap12(m_file.getProjectProperties(), m_file.getCustomFields()); fieldMap.createAssignmentFieldMap(m_projectProps); FieldMap enterpriseCustomFieldMap = new FieldMap12(m_file.getProjectProperties(), m_file.getCustomFields()); enterpriseCustomFieldMap.createEnterpriseCustomFieldMap(m_projectProps, AssignmentField.class); DirectoryEntry assnDir = (DirectoryEntry) m_projectDir.getEntry("TBkndAssn"); VarMeta assnVarMeta = new VarMeta12(new DocumentInputStream(((DocumentEntry) assnDir.getEntry("VarMeta")))); Var2Data assnVarData = new Var2Data(assnVarMeta, new DocumentInputStream(((DocumentEntry) assnDir.getEntry("Var2Data")))); FixedMeta assnFixedMeta = new FixedMeta(new DocumentInputStream(((DocumentEntry) assnDir.getEntry("FixedMeta"))), 34); // MSP 20007 seems to write 142 byte blocks, MSP 2010 writes 110 byte blocks // We need to identify any cases where the meta data count does not correctly identify the block size FixedData assnFixedData = new FixedData(assnFixedMeta, m_inputStreamFactory.getInstance(assnDir, "FixedData")); FixedData assnFixedData2 = new FixedData(48, m_inputStreamFactory.getInstance(assnDir, "Fixed2Data")); ResourceAssignmentFactory factory = new ResourceAssignmentFactory(); factory.process(m_file, fieldMap, enterpriseCustomFieldMap, m_reader.getUseRawTimephasedData(), m_reader.getPreserveNoteFormatting(), assnVarMeta, assnVarData, assnFixedMeta, assnFixedData, assnFixedData2, assnFixedMeta.getAdjustedItemCount()); }
java
private void processAssignmentData() throws IOException { FieldMap fieldMap = new FieldMap12(m_file.getProjectProperties(), m_file.getCustomFields()); fieldMap.createAssignmentFieldMap(m_projectProps); FieldMap enterpriseCustomFieldMap = new FieldMap12(m_file.getProjectProperties(), m_file.getCustomFields()); enterpriseCustomFieldMap.createEnterpriseCustomFieldMap(m_projectProps, AssignmentField.class); DirectoryEntry assnDir = (DirectoryEntry) m_projectDir.getEntry("TBkndAssn"); VarMeta assnVarMeta = new VarMeta12(new DocumentInputStream(((DocumentEntry) assnDir.getEntry("VarMeta")))); Var2Data assnVarData = new Var2Data(assnVarMeta, new DocumentInputStream(((DocumentEntry) assnDir.getEntry("Var2Data")))); FixedMeta assnFixedMeta = new FixedMeta(new DocumentInputStream(((DocumentEntry) assnDir.getEntry("FixedMeta"))), 34); // MSP 20007 seems to write 142 byte blocks, MSP 2010 writes 110 byte blocks // We need to identify any cases where the meta data count does not correctly identify the block size FixedData assnFixedData = new FixedData(assnFixedMeta, m_inputStreamFactory.getInstance(assnDir, "FixedData")); FixedData assnFixedData2 = new FixedData(48, m_inputStreamFactory.getInstance(assnDir, "Fixed2Data")); ResourceAssignmentFactory factory = new ResourceAssignmentFactory(); factory.process(m_file, fieldMap, enterpriseCustomFieldMap, m_reader.getUseRawTimephasedData(), m_reader.getPreserveNoteFormatting(), assnVarMeta, assnVarData, assnFixedMeta, assnFixedData, assnFixedData2, assnFixedMeta.getAdjustedItemCount()); }
[ "private", "void", "processAssignmentData", "(", ")", "throws", "IOException", "{", "FieldMap", "fieldMap", "=", "new", "FieldMap12", "(", "m_file", ".", "getProjectProperties", "(", ")", ",", "m_file", ".", "getCustomFields", "(", ")", ")", ";", "fieldMap", "...
This method extracts and collates resource assignment data. @throws IOException
[ "This", "method", "extracts", "and", "collates", "resource", "assignment", "data", "." ]
train
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/MPP12Reader.java#L1862-L1880
fhoeben/hsac-fitnesse-fixtures
src/main/java/nl/hsac/fitnesse/fixture/util/selenium/SeleniumHelper.java
SeleniumHelper.getElementToCheckVisibility
public T getElementToCheckVisibility(String place) { return findByTechnicalSelectorOr(place, () -> { T result = findElement(TextBy.partial(place)); if (!IsDisplayedFilter.mayPass(result)) { result = findElement(ToClickBy.heuristic(place)); } return result; }); }
java
public T getElementToCheckVisibility(String place) { return findByTechnicalSelectorOr(place, () -> { T result = findElement(TextBy.partial(place)); if (!IsDisplayedFilter.mayPass(result)) { result = findElement(ToClickBy.heuristic(place)); } return result; }); }
[ "public", "T", "getElementToCheckVisibility", "(", "String", "place", ")", "{", "return", "findByTechnicalSelectorOr", "(", "place", ",", "(", ")", "->", "{", "T", "result", "=", "findElement", "(", "TextBy", ".", "partial", "(", "place", ")", ")", ";", "i...
Finds element to determine whether it is on screen, by searching in multiple locations. @param place identifier for element. @return first interactable element found, first element found if no interactable element could be found, null if none could be found.
[ "Finds", "element", "to", "determine", "whether", "it", "is", "on", "screen", "by", "searching", "in", "multiple", "locations", "." ]
train
https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/util/selenium/SeleniumHelper.java#L175-L183
mgledi/DRUMS
src/main/java/com/unister/semweb/drums/storable/GeneralStorable.java
GeneralStorable.setValue
public void setValue(int index, int value) throws IOException { if (index >= structure.valueSizes.size()) { throw new IOException("Index " + index + " is out of range."); } Bytes.putInt(this.value, structure.valueByteOffsets.get(index), value); }
java
public void setValue(int index, int value) throws IOException { if (index >= structure.valueSizes.size()) { throw new IOException("Index " + index + " is out of range."); } Bytes.putInt(this.value, structure.valueByteOffsets.get(index), value); }
[ "public", "void", "setValue", "(", "int", "index", ",", "int", "value", ")", "throws", "IOException", "{", "if", "(", "index", ">=", "structure", ".", "valueSizes", ".", "size", "(", ")", ")", "{", "throw", "new", "IOException", "(", "\"Index \"", "+", ...
Sets the value belonging to the given field. @param index the index of the requested field @param value @throws IOException
[ "Sets", "the", "value", "belonging", "to", "the", "given", "field", "." ]
train
https://github.com/mgledi/DRUMS/blob/a670f17a2186c9a15725f26617d77ce8e444e072/src/main/java/com/unister/semweb/drums/storable/GeneralStorable.java#L170-L175
Mozu/mozu-java
mozu-javaasync-core/src/main/java/com/mozu/api/urls/commerce/catalog/storefront/ShippingUrl.java
ShippingUrl.getRatesUrl
public static MozuUrl getRatesUrl(Boolean includeRawResponse, String responseFields) { UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/storefront/shipping/request-rates?responseFields={responseFields}"); formatter.formatUrl("includeRawResponse", includeRawResponse); formatter.formatUrl("responseFields", responseFields); return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ; }
java
public static MozuUrl getRatesUrl(Boolean includeRawResponse, String responseFields) { UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/storefront/shipping/request-rates?responseFields={responseFields}"); formatter.formatUrl("includeRawResponse", includeRawResponse); formatter.formatUrl("responseFields", responseFields); return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ; }
[ "public", "static", "MozuUrl", "getRatesUrl", "(", "Boolean", "includeRawResponse", ",", "String", "responseFields", ")", "{", "UrlFormatter", "formatter", "=", "new", "UrlFormatter", "(", "\"/api/commerce/catalog/storefront/shipping/request-rates?responseFields={responseFields}\...
Get Resource Url for GetRates @param includeRawResponse Set this parameter to to retrieve the full raw JSON response from a shipping carrier (instead of just the shipping rate). @param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this parameter may cause data loss. @return String Resource Url
[ "Get", "Resource", "Url", "for", "GetRates" ]
train
https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-javaasync-core/src/main/java/com/mozu/api/urls/commerce/catalog/storefront/ShippingUrl.java#L34-L40
Waikato/moa
moa/src/main/java/moa/core/Utils.java
Utils.removeSubstring
public static String removeSubstring(String inString, String substring) { StringBuffer result = new StringBuffer(); int oldLoc = 0, loc = 0; while ((loc = inString.indexOf(substring, oldLoc))!= -1) { result.append(inString.substring(oldLoc, loc)); oldLoc = loc + substring.length(); } result.append(inString.substring(oldLoc)); return result.toString(); }
java
public static String removeSubstring(String inString, String substring) { StringBuffer result = new StringBuffer(); int oldLoc = 0, loc = 0; while ((loc = inString.indexOf(substring, oldLoc))!= -1) { result.append(inString.substring(oldLoc, loc)); oldLoc = loc + substring.length(); } result.append(inString.substring(oldLoc)); return result.toString(); }
[ "public", "static", "String", "removeSubstring", "(", "String", "inString", ",", "String", "substring", ")", "{", "StringBuffer", "result", "=", "new", "StringBuffer", "(", ")", ";", "int", "oldLoc", "=", "0", ",", "loc", "=", "0", ";", "while", "(", "("...
Removes all occurrences of a string from another string. @param inString the string to remove substrings from. @param substring the substring to remove. @return the input string with occurrences of substring removed.
[ "Removes", "all", "occurrences", "of", "a", "string", "from", "another", "string", "." ]
train
https://github.com/Waikato/moa/blob/395982e5100bfe75a3a4d26115462ce2cc74cbb0/moa/src/main/java/moa/core/Utils.java#L132-L142
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/gd/StreamSet.java
StreamSet.getStream
public Stream getStream(int priority, Reliability reliability) throws SIResourceException { return getSubset(reliability).getStream(priority); }
java
public Stream getStream(int priority, Reliability reliability) throws SIResourceException { return getSubset(reliability).getStream(priority); }
[ "public", "Stream", "getStream", "(", "int", "priority", ",", "Reliability", "reliability", ")", "throws", "SIResourceException", "{", "return", "getSubset", "(", "reliability", ")", ".", "getStream", "(", "priority", ")", ";", "}" ]
Get a specific stream based on priority and reliability @param priority @param reliability @throws SIResourceException
[ "Get", "a", "specific", "stream", "based", "on", "priority", "and", "reliability" ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/gd/StreamSet.java#L465-L468
jingwei/krati
krati-main/src/main/java/krati/core/StoreConfig.java
StoreConfig.getBoolean
public boolean getBoolean(String pName, boolean defaultValue) { String pValue = _properties.getProperty(pName); return parseBoolean(pName, pValue, defaultValue); }
java
public boolean getBoolean(String pName, boolean defaultValue) { String pValue = _properties.getProperty(pName); return parseBoolean(pName, pValue, defaultValue); }
[ "public", "boolean", "getBoolean", "(", "String", "pName", ",", "boolean", "defaultValue", ")", "{", "String", "pValue", "=", "_properties", ".", "getProperty", "(", "pName", ")", ";", "return", "parseBoolean", "(", "pName", ",", "pValue", ",", "defaultValue",...
Gets a boolean property via a string property name. @param pName - the property name @param defaultValue - the default property value @return a boolean property
[ "Gets", "a", "boolean", "property", "via", "a", "string", "property", "name", "." ]
train
https://github.com/jingwei/krati/blob/1ca0f994a7b0c8215b827eac9aaf95789ec08d21/krati-main/src/main/java/krati/core/StoreConfig.java#L459-L462
Gagravarr/VorbisJava
core/src/main/java/org/gagravarr/ogg/audio/OggAudioStreamHeaders.java
OggAudioStreamHeaders.create
public static OggAudioStreamHeaders create(OggPacket firstPacket) { if (firstPacket.isBeginningOfStream() && firstPacket.getData() != null && firstPacket.getData().length > 10) { int sid = firstPacket.getSid(); if (VorbisPacketFactory.isVorbisStream(firstPacket)) { return new OggAudioStreamHeaders(sid, OggStreamIdentifier.OGG_VORBIS, (VorbisInfo)VorbisPacketFactory.create(firstPacket)); } if (SpeexPacketFactory.isSpeexStream(firstPacket)) { return new OggAudioStreamHeaders(sid, OggStreamIdentifier.SPEEX_AUDIO, (SpeexInfo)SpeexPacketFactory.create(firstPacket)); } if (OpusPacketFactory.isOpusStream(firstPacket)) { return new OggAudioStreamHeaders(sid, OggStreamIdentifier.OPUS_AUDIO, (OpusInfo)OpusPacketFactory.create(firstPacket)); } if (FlacFirstOggPacket.isFlacStream(firstPacket)) { FlacFirstOggPacket flac = new FlacFirstOggPacket(firstPacket); return new OggAudioStreamHeaders(sid, OggStreamIdentifier.OGG_FLAC, flac.getInfo()); } throw new IllegalArgumentException("Unsupported stream of type " + OggStreamIdentifier.identifyType(firstPacket)); } else { throw new IllegalArgumentException("May only be called for the first packet in a stream, with data"); } }
java
public static OggAudioStreamHeaders create(OggPacket firstPacket) { if (firstPacket.isBeginningOfStream() && firstPacket.getData() != null && firstPacket.getData().length > 10) { int sid = firstPacket.getSid(); if (VorbisPacketFactory.isVorbisStream(firstPacket)) { return new OggAudioStreamHeaders(sid, OggStreamIdentifier.OGG_VORBIS, (VorbisInfo)VorbisPacketFactory.create(firstPacket)); } if (SpeexPacketFactory.isSpeexStream(firstPacket)) { return new OggAudioStreamHeaders(sid, OggStreamIdentifier.SPEEX_AUDIO, (SpeexInfo)SpeexPacketFactory.create(firstPacket)); } if (OpusPacketFactory.isOpusStream(firstPacket)) { return new OggAudioStreamHeaders(sid, OggStreamIdentifier.OPUS_AUDIO, (OpusInfo)OpusPacketFactory.create(firstPacket)); } if (FlacFirstOggPacket.isFlacStream(firstPacket)) { FlacFirstOggPacket flac = new FlacFirstOggPacket(firstPacket); return new OggAudioStreamHeaders(sid, OggStreamIdentifier.OGG_FLAC, flac.getInfo()); } throw new IllegalArgumentException("Unsupported stream of type " + OggStreamIdentifier.identifyType(firstPacket)); } else { throw new IllegalArgumentException("May only be called for the first packet in a stream, with data"); } }
[ "public", "static", "OggAudioStreamHeaders", "create", "(", "OggPacket", "firstPacket", ")", "{", "if", "(", "firstPacket", ".", "isBeginningOfStream", "(", ")", "&&", "firstPacket", ".", "getData", "(", ")", "!=", "null", "&&", "firstPacket", ".", "getData", ...
Identifies the type, and returns a partially filled {@link OggAudioHeaders} for the new stream
[ "Identifies", "the", "type", "and", "returns", "a", "partially", "filled", "{" ]
train
https://github.com/Gagravarr/VorbisJava/blob/22b4d645b00386d59d17a336a2bc9d54db08df16/core/src/main/java/org/gagravarr/ogg/audio/OggAudioStreamHeaders.java#L53-L83
voldemort/voldemort
src/java/voldemort/tools/admin/command/AdminCommandScheduled.java
AdminCommandScheduled.executeHelp
public static void executeHelp(String[] args, PrintStream stream) throws IOException { String subCmd = (args.length > 0) ? args[0] : ""; if(subCmd.equals("list")) { SubCommandScheduledList.printHelp(stream); } else if(subCmd.equals("stop")) { SubCommandScheduledStop.printHelp(stream); } else if(subCmd.equals("enable")) { SubCommandScheduledEnable.printHelp(stream); } else { printHelp(stream); } }
java
public static void executeHelp(String[] args, PrintStream stream) throws IOException { String subCmd = (args.length > 0) ? args[0] : ""; if(subCmd.equals("list")) { SubCommandScheduledList.printHelp(stream); } else if(subCmd.equals("stop")) { SubCommandScheduledStop.printHelp(stream); } else if(subCmd.equals("enable")) { SubCommandScheduledEnable.printHelp(stream); } else { printHelp(stream); } }
[ "public", "static", "void", "executeHelp", "(", "String", "[", "]", "args", ",", "PrintStream", "stream", ")", "throws", "IOException", "{", "String", "subCmd", "=", "(", "args", ".", "length", ">", "0", ")", "?", "args", "[", "0", "]", ":", "\"\"", ...
Parses command-line input and prints help menu. @throws IOException
[ "Parses", "command", "-", "line", "input", "and", "prints", "help", "menu", "." ]
train
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/tools/admin/command/AdminCommandScheduled.java#L78-L89
aNNiMON/Lightweight-Stream-API
stream/src/main/java/com/annimon/stream/IntStream.java
IntStream.iterate
@NotNull public static IntStream iterate( final int seed, @NotNull final IntPredicate predicate, @NotNull final IntUnaryOperator op) { Objects.requireNonNull(predicate); return iterate(seed, op).takeWhile(predicate); }
java
@NotNull public static IntStream iterate( final int seed, @NotNull final IntPredicate predicate, @NotNull final IntUnaryOperator op) { Objects.requireNonNull(predicate); return iterate(seed, op).takeWhile(predicate); }
[ "@", "NotNull", "public", "static", "IntStream", "iterate", "(", "final", "int", "seed", ",", "@", "NotNull", "final", "IntPredicate", "predicate", ",", "@", "NotNull", "final", "IntUnaryOperator", "op", ")", "{", "Objects", ".", "requireNonNull", "(", "predic...
Creates an {@code IntStream} by iterative application {@code IntUnaryOperator} function to an initial element {@code seed}, conditioned on satisfying the supplied predicate. <p>Example: <pre> seed: 0 predicate: (a) -&gt; a &lt; 20 f: (a) -&gt; a + 5 result: [0, 5, 10, 15] </pre> @param seed the initial value @param predicate a predicate to determine when the stream must terminate @param op operator to produce new element by previous one @return the new stream @throws NullPointerException if {@code op} is null @since 1.1.5
[ "Creates", "an", "{", "@code", "IntStream", "}", "by", "iterative", "application", "{", "@code", "IntUnaryOperator", "}", "function", "to", "an", "initial", "element", "{", "@code", "seed", "}", "conditioned", "on", "satisfying", "the", "supplied", "predicate", ...
train
https://github.com/aNNiMON/Lightweight-Stream-API/blob/f29fd57208c20252a4549b084d55ed082c3e58f0/stream/src/main/java/com/annimon/stream/IntStream.java#L208-L215
facebook/fresco
imagepipeline/src/main/java/com/facebook/imagepipeline/core/ProducerSequenceFactory.java
ProducerSequenceFactory.newBitmapCacheGetToLocalTransformSequence
private Producer<CloseableReference<CloseableImage>> newBitmapCacheGetToLocalTransformSequence( Producer<EncodedImage> inputProducer) { ThumbnailProducer<EncodedImage>[] defaultThumbnailProducers = new ThumbnailProducer[1]; defaultThumbnailProducers[0] = mProducerFactory.newLocalExifThumbnailProducer(); return newBitmapCacheGetToLocalTransformSequence(inputProducer, defaultThumbnailProducers); }
java
private Producer<CloseableReference<CloseableImage>> newBitmapCacheGetToLocalTransformSequence( Producer<EncodedImage> inputProducer) { ThumbnailProducer<EncodedImage>[] defaultThumbnailProducers = new ThumbnailProducer[1]; defaultThumbnailProducers[0] = mProducerFactory.newLocalExifThumbnailProducer(); return newBitmapCacheGetToLocalTransformSequence(inputProducer, defaultThumbnailProducers); }
[ "private", "Producer", "<", "CloseableReference", "<", "CloseableImage", ">", ">", "newBitmapCacheGetToLocalTransformSequence", "(", "Producer", "<", "EncodedImage", ">", "inputProducer", ")", "{", "ThumbnailProducer", "<", "EncodedImage", ">", "[", "]", "defaultThumbna...
Creates a new fetch sequence that just needs the source producer. @param inputProducer the source producer @return the new sequence
[ "Creates", "a", "new", "fetch", "sequence", "that", "just", "needs", "the", "source", "producer", "." ]
train
https://github.com/facebook/fresco/blob/0b85879d51c5036d5e46e627a6651afefc0b971a/imagepipeline/src/main/java/com/facebook/imagepipeline/core/ProducerSequenceFactory.java#L654-L659
redkale/redkale
src/org/redkale/util/Utility.java
Utility.binToHexString
public static String binToHexString(byte[] bytes, int offset, int len) { return new String(binToHex(bytes, offset, len)); }
java
public static String binToHexString(byte[] bytes, int offset, int len) { return new String(binToHex(bytes, offset, len)); }
[ "public", "static", "String", "binToHexString", "(", "byte", "[", "]", "bytes", ",", "int", "offset", ",", "int", "len", ")", "{", "return", "new", "String", "(", "binToHex", "(", "bytes", ",", "offset", ",", "len", ")", ")", ";", "}" ]
将字节数组转换为16进制字符串 @param bytes 字节数组 @param offset 偏移量 @param len 长度 @return 16进制字符串
[ "将字节数组转换为16进制字符串" ]
train
https://github.com/redkale/redkale/blob/ea5169b5c5ea7412fd762331c0c497165832e901/src/org/redkale/util/Utility.java#L1342-L1344
igniterealtime/Smack
smack-core/src/main/java/org/jivesoftware/smack/util/dns/DNSResolver.java
DNSResolver.lookupHostAddress0
protected List<InetAddress> lookupHostAddress0(DnsName name, List<HostAddress> failedAddresses, DnssecMode dnssecMode) { // Default implementation of a DNS name lookup for A/AAAA records. It is assumed that this method does never // support DNSSEC. Subclasses are free to override this method. if (dnssecMode != DnssecMode.disabled) { throw new UnsupportedOperationException("This resolver does not support DNSSEC"); } InetAddress[] inetAddressArray; try { inetAddressArray = InetAddress.getAllByName(name.toString()); } catch (UnknownHostException e) { failedAddresses.add(new HostAddress(name, e)); return null; } return Arrays.asList(inetAddressArray); }
java
protected List<InetAddress> lookupHostAddress0(DnsName name, List<HostAddress> failedAddresses, DnssecMode dnssecMode) { // Default implementation of a DNS name lookup for A/AAAA records. It is assumed that this method does never // support DNSSEC. Subclasses are free to override this method. if (dnssecMode != DnssecMode.disabled) { throw new UnsupportedOperationException("This resolver does not support DNSSEC"); } InetAddress[] inetAddressArray; try { inetAddressArray = InetAddress.getAllByName(name.toString()); } catch (UnknownHostException e) { failedAddresses.add(new HostAddress(name, e)); return null; } return Arrays.asList(inetAddressArray); }
[ "protected", "List", "<", "InetAddress", ">", "lookupHostAddress0", "(", "DnsName", "name", ",", "List", "<", "HostAddress", ">", "failedAddresses", ",", "DnssecMode", "dnssecMode", ")", "{", "// Default implementation of a DNS name lookup for A/AAAA records. It is assumed th...
Lookup the IP addresses of a given host name. Returns <code>null</code> if there was an error, in which the error reason will be added in form of a <code>HostAddress</code> to <code>failedAddresses</code>. Returns a empty list in case the DNS name exists but has no associated A or AAAA resource records. Otherwise, if the resolution was successful <em>and</em> there is at least one A or AAAA resource record, then a non-empty list will be returned. <p> Concrete DNS resolver implementations are free to overwrite this, but have to stick to the interface contract. </p> @param name the DNS name to lookup @param failedAddresses a list with the failed addresses @param dnssecMode the selected DNSSEC mode @return A list, either empty or non-empty, or <code>null</code>
[ "Lookup", "the", "IP", "addresses", "of", "a", "given", "host", "name", ".", "Returns", "<code", ">", "null<", "/", "code", ">", "if", "there", "was", "an", "error", "in", "which", "the", "error", "reason", "will", "be", "added", "in", "form", "of", ...
train
https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-core/src/main/java/org/jivesoftware/smack/util/dns/DNSResolver.java#L81-L97
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/map/impl/MapContainer.java
MapContainer.hasPublisherWithMerkleTreeSync
private boolean hasPublisherWithMerkleTreeSync(Config config, String wanReplicationRefName) { WanReplicationConfig replicationConfig = config.getWanReplicationConfig(wanReplicationRefName); if (replicationConfig != null) { for (WanPublisherConfig publisherConfig : replicationConfig.getWanPublisherConfigs()) { if (publisherConfig.getWanSyncConfig() != null && ConsistencyCheckStrategy.MERKLE_TREES.equals(publisherConfig.getWanSyncConfig() .getConsistencyCheckStrategy())) { return true; } } } return false; }
java
private boolean hasPublisherWithMerkleTreeSync(Config config, String wanReplicationRefName) { WanReplicationConfig replicationConfig = config.getWanReplicationConfig(wanReplicationRefName); if (replicationConfig != null) { for (WanPublisherConfig publisherConfig : replicationConfig.getWanPublisherConfigs()) { if (publisherConfig.getWanSyncConfig() != null && ConsistencyCheckStrategy.MERKLE_TREES.equals(publisherConfig.getWanSyncConfig() .getConsistencyCheckStrategy())) { return true; } } } return false; }
[ "private", "boolean", "hasPublisherWithMerkleTreeSync", "(", "Config", "config", ",", "String", "wanReplicationRefName", ")", "{", "WanReplicationConfig", "replicationConfig", "=", "config", ".", "getWanReplicationConfig", "(", "wanReplicationRefName", ")", ";", "if", "("...
Returns {@code true} if at least one of the WAN publishers has Merkle tree consistency check configured for the given WAN replication configuration @param config configuration @param wanReplicationRefName The name of the WAN replication @return {@code true} if there is at least one publisher has Merkle tree configured
[ "Returns", "{", "@code", "true", "}", "if", "at", "least", "one", "of", "the", "WAN", "publishers", "has", "Merkle", "tree", "consistency", "check", "configured", "for", "the", "given", "WAN", "replication", "configuration" ]
train
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/map/impl/MapContainer.java#L283-L295
aws/aws-sdk-java
aws-java-sdk-core/src/main/java/com/amazonaws/auth/policy/internal/JsonPolicyWriter.java
JsonPolicyWriter.writeJsonKeyValue
private void writeJsonKeyValue(String fieldName, String value) throws JsonGenerationException, IOException { generator.writeStringField(fieldName, value); }
java
private void writeJsonKeyValue(String fieldName, String value) throws JsonGenerationException, IOException { generator.writeStringField(fieldName, value); }
[ "private", "void", "writeJsonKeyValue", "(", "String", "fieldName", ",", "String", "value", ")", "throws", "JsonGenerationException", ",", "IOException", "{", "generator", ".", "writeStringField", "(", "fieldName", ",", "value", ")", ";", "}" ]
Writes the given field and the value to the JsonGenerator @param fieldName the JSON field name @param value value for the field
[ "Writes", "the", "given", "field", "and", "the", "value", "to", "the", "JsonGenerator" ]
train
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/auth/policy/internal/JsonPolicyWriter.java#L407-L410
jingwei/krati
krati-main/src/main/java/krati/io/IOFactory.java
IOFactory.createDataWriter
public final static DataWriter createDataWriter(File file, IOType type) { if(type == IOType.MAPPED) { if(file.length() <= Integer.MAX_VALUE) { return new MappedWriter(file); } else { return new MultiMappedWriter(file); } } else { return new ChannelWriter(file); } }
java
public final static DataWriter createDataWriter(File file, IOType type) { if(type == IOType.MAPPED) { if(file.length() <= Integer.MAX_VALUE) { return new MappedWriter(file); } else { return new MultiMappedWriter(file); } } else { return new ChannelWriter(file); } }
[ "public", "final", "static", "DataWriter", "createDataWriter", "(", "File", "file", ",", "IOType", "type", ")", "{", "if", "(", "type", "==", "IOType", ".", "MAPPED", ")", "{", "if", "(", "file", ".", "length", "(", ")", "<=", "Integer", ".", "MAX_VALU...
Creates a new DataWriter to write to a file. @param file - file to write. @param type - I/O type. @return a new DataWriter instance of type {@link BasicIO}.
[ "Creates", "a", "new", "DataWriter", "to", "write", "to", "a", "file", "." ]
train
https://github.com/jingwei/krati/blob/1ca0f994a7b0c8215b827eac9aaf95789ec08d21/krati-main/src/main/java/krati/io/IOFactory.java#L56-L66
Azure/azure-sdk-for-java
mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/ContentKeyPoliciesInner.java
ContentKeyPoliciesInner.updateAsync
public Observable<ContentKeyPolicyInner> updateAsync(String resourceGroupName, String accountName, String contentKeyPolicyName, ContentKeyPolicyInner parameters) { return updateWithServiceResponseAsync(resourceGroupName, accountName, contentKeyPolicyName, parameters).map(new Func1<ServiceResponse<ContentKeyPolicyInner>, ContentKeyPolicyInner>() { @Override public ContentKeyPolicyInner call(ServiceResponse<ContentKeyPolicyInner> response) { return response.body(); } }); }
java
public Observable<ContentKeyPolicyInner> updateAsync(String resourceGroupName, String accountName, String contentKeyPolicyName, ContentKeyPolicyInner parameters) { return updateWithServiceResponseAsync(resourceGroupName, accountName, contentKeyPolicyName, parameters).map(new Func1<ServiceResponse<ContentKeyPolicyInner>, ContentKeyPolicyInner>() { @Override public ContentKeyPolicyInner call(ServiceResponse<ContentKeyPolicyInner> response) { return response.body(); } }); }
[ "public", "Observable", "<", "ContentKeyPolicyInner", ">", "updateAsync", "(", "String", "resourceGroupName", ",", "String", "accountName", ",", "String", "contentKeyPolicyName", ",", "ContentKeyPolicyInner", "parameters", ")", "{", "return", "updateWithServiceResponseAsync...
Update a Content Key Policy. Updates an existing Content Key Policy in the Media Services account. @param resourceGroupName The name of the resource group within the Azure subscription. @param accountName The Media Services account name. @param contentKeyPolicyName The Content Key Policy name. @param parameters The request parameters @throws IllegalArgumentException thrown if parameters fail the validation @return the observable to the ContentKeyPolicyInner object
[ "Update", "a", "Content", "Key", "Policy", ".", "Updates", "an", "existing", "Content", "Key", "Policy", "in", "the", "Media", "Services", "account", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/ContentKeyPoliciesInner.java#L708-L715
cvut/JCOP
src/main/java/cz/cvut/felk/cig/jcop/result/render/JFreeChartRender.java
JFreeChartRender.setStyle
public JFreeChartRender setStyle(int style) { switch (style) { case JFreeChartRender.STYLE_THESIS: return this.setBaseShapesVisible(true). setBaseShapesFilled(false). setBaseLinesVisible(false). setLegendItemFont(new Font("Dialog", Font.PLAIN, 9)). setBackgroundPaint(Color.white). setGridPaint(Color.gray). setInsertLast(false). removeLegend(); case JFreeChartRender.STYLE_THESIS_LEGEND: return this.setBaseShapesVisible(true). setBaseShapesFilled(false). setBaseLinesVisible(false). setLegendItemFont(new Font("Dialog", Font.PLAIN, 9)). setBackgroundPaint(Color.white). setGridPaint(Color.gray). setInsertLast(false); default: return this; } }
java
public JFreeChartRender setStyle(int style) { switch (style) { case JFreeChartRender.STYLE_THESIS: return this.setBaseShapesVisible(true). setBaseShapesFilled(false). setBaseLinesVisible(false). setLegendItemFont(new Font("Dialog", Font.PLAIN, 9)). setBackgroundPaint(Color.white). setGridPaint(Color.gray). setInsertLast(false). removeLegend(); case JFreeChartRender.STYLE_THESIS_LEGEND: return this.setBaseShapesVisible(true). setBaseShapesFilled(false). setBaseLinesVisible(false). setLegendItemFont(new Font("Dialog", Font.PLAIN, 9)). setBackgroundPaint(Color.white). setGridPaint(Color.gray). setInsertLast(false); default: return this; } }
[ "public", "JFreeChartRender", "setStyle", "(", "int", "style", ")", "{", "switch", "(", "style", ")", "{", "case", "JFreeChartRender", ".", "STYLE_THESIS", ":", "return", "this", ".", "setBaseShapesVisible", "(", "true", ")", ".", "setBaseShapesFilled", "(", "...
Applies prepared style to a chart. Recognizes {@link JFreeChartRender#STYLE_THESIS} and {@link JFreeChartRender#STYLE_THESIS_LEGEND}. @param style code of style @return updated chart
[ "Applies", "prepared", "style", "to", "a", "chart", "." ]
train
https://github.com/cvut/JCOP/blob/2ec18315a9a452e5f4e3d07cccfde0310adc465a/src/main/java/cz/cvut/felk/cig/jcop/result/render/JFreeChartRender.java#L288-L310
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/jdbc/EscapedFunctions2.java
EscapedFunctions2.sqlcurdate
public static void sqlcurdate(StringBuilder buf, List<? extends CharSequence> parsedArgs) throws SQLException { zeroArgumentFunctionCall(buf, "current_date", "curdate", parsedArgs); }
java
public static void sqlcurdate(StringBuilder buf, List<? extends CharSequence> parsedArgs) throws SQLException { zeroArgumentFunctionCall(buf, "current_date", "curdate", parsedArgs); }
[ "public", "static", "void", "sqlcurdate", "(", "StringBuilder", "buf", ",", "List", "<", "?", "extends", "CharSequence", ">", "parsedArgs", ")", "throws", "SQLException", "{", "zeroArgumentFunctionCall", "(", "buf", ",", "\"current_date\"", ",", "\"curdate\"", ","...
curdate to current_date translation @param buf The buffer to append into @param parsedArgs arguments @throws SQLException if something wrong happens
[ "curdate", "to", "current_date", "translation" ]
train
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/jdbc/EscapedFunctions2.java#L331-L333
janus-project/guava.janusproject.io
guava/src/com/google/common/collect/Ordering.java
Ordering.binarySearch
public int binarySearch(List<? extends T> sortedList, @Nullable T key) { return Collections.binarySearch(sortedList, key, this); }
java
public int binarySearch(List<? extends T> sortedList, @Nullable T key) { return Collections.binarySearch(sortedList, key, this); }
[ "public", "int", "binarySearch", "(", "List", "<", "?", "extends", "T", ">", "sortedList", ",", "@", "Nullable", "T", "key", ")", "{", "return", "Collections", ".", "binarySearch", "(", "sortedList", ",", "key", ",", "this", ")", ";", "}" ]
{@link Collections#binarySearch(List, Object, Comparator) Searches} {@code sortedList} for {@code key} using the binary search algorithm. The list must be sorted using this ordering. @param sortedList the list to be searched @param key the key to be searched for
[ "{", "@link", "Collections#binarySearch", "(", "List", "Object", "Comparator", ")", "Searches", "}", "{", "@code", "sortedList", "}", "for", "{", "@code", "key", "}", "using", "the", "binary", "search", "algorithm", ".", "The", "list", "must", "be", "sorted"...
train
https://github.com/janus-project/guava.janusproject.io/blob/1c48fb672c9fdfddf276970570f703fa1115f588/guava/src/com/google/common/collect/Ordering.java#L900-L902
jenkinsci/email-ext-plugin
src/main/java/hudson/plugins/emailext/plugins/trigger/AbstractScriptTrigger.java
AbstractScriptTrigger.readResolve
private Object readResolve() throws ObjectStreamException { if (triggerScript != null && secureTriggerScript == null) { this.secureTriggerScript = new SecureGroovyScript(triggerScript, false, null); this.secureTriggerScript.configuring(ApprovalContext.create()); triggerScript = null; } return this; }
java
private Object readResolve() throws ObjectStreamException { if (triggerScript != null && secureTriggerScript == null) { this.secureTriggerScript = new SecureGroovyScript(triggerScript, false, null); this.secureTriggerScript.configuring(ApprovalContext.create()); triggerScript = null; } return this; }
[ "private", "Object", "readResolve", "(", ")", "throws", "ObjectStreamException", "{", "if", "(", "triggerScript", "!=", "null", "&&", "secureTriggerScript", "==", "null", ")", "{", "this", ".", "secureTriggerScript", "=", "new", "SecureGroovyScript", "(", "trigger...
Called when object has been deserialized from a stream. @return {@code this}, or a replacement for {@code this}. @throws ObjectStreamException if the object cannot be restored. @see <a href="http://download.oracle.com/javase/1.3/docs/guide/serialization/spec/input.doc6.html">The Java Object Serialization Specification</a>
[ "Called", "when", "object", "has", "been", "deserialized", "from", "a", "stream", "." ]
train
https://github.com/jenkinsci/email-ext-plugin/blob/21fbd402665848a18205b26751424149e51e86e4/src/main/java/hudson/plugins/emailext/plugins/trigger/AbstractScriptTrigger.java#L176-L183
ironjacamar/ironjacamar
web/src/main/java/org/ironjacamar/web/console/HtmlAdaptorServlet.java
HtmlAdaptorServlet.invokeOpByName
private void invokeOpByName(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String name = request.getParameter("name"); if (trace) log.trace("invokeOpByName, name=" + name); String[] argTypes = request.getParameterValues("argType"); String[] args = getArgs(request); String methodName = request.getParameter("methodName"); if (methodName == null) throw new ServletException("No methodName given in invokeOpByName form"); try { OpResultInfo opResult = invokeOpByName(name, methodName, argTypes, args); request.setAttribute("opResultInfo", opResult); RequestDispatcher rd = this.getServletContext().getRequestDispatcher("/displayopresult.jsp"); rd.forward(request, response); } catch (Exception e) { throw new ServletException("Failed to invoke operation", e); } }
java
private void invokeOpByName(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String name = request.getParameter("name"); if (trace) log.trace("invokeOpByName, name=" + name); String[] argTypes = request.getParameterValues("argType"); String[] args = getArgs(request); String methodName = request.getParameter("methodName"); if (methodName == null) throw new ServletException("No methodName given in invokeOpByName form"); try { OpResultInfo opResult = invokeOpByName(name, methodName, argTypes, args); request.setAttribute("opResultInfo", opResult); RequestDispatcher rd = this.getServletContext().getRequestDispatcher("/displayopresult.jsp"); rd.forward(request, response); } catch (Exception e) { throw new ServletException("Failed to invoke operation", e); } }
[ "private", "void", "invokeOpByName", "(", "HttpServletRequest", "request", ",", "HttpServletResponse", "response", ")", "throws", "ServletException", ",", "IOException", "{", "String", "name", "=", "request", ".", "getParameter", "(", "\"name\"", ")", ";", "if", "...
Invoke a MBean operation given the method name and its signature. @param request The HTTP request @param response The HTTP response @exception ServletException Thrown if an error occurs @exception IOException Thrown if an I/O error occurs
[ "Invoke", "a", "MBean", "operation", "given", "the", "method", "name", "and", "its", "signature", "." ]
train
https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/web/src/main/java/org/ironjacamar/web/console/HtmlAdaptorServlet.java#L294-L321
jMotif/GI
src/main/java/net/seninp/gi/clusterrule/DistanceComputation.java
DistanceComputation.eculideanDistNorm
protected double eculideanDistNorm(double[] ts1, double[] ts2) { double dist = 0; double tsLen = ts1.length; for (int i = 0; i < ts1.length; i++) { double diff = ts1[i] - ts2[i]; dist += Math.pow(diff, 2); } return Math.sqrt(dist) / tsLen; }
java
protected double eculideanDistNorm(double[] ts1, double[] ts2) { double dist = 0; double tsLen = ts1.length; for (int i = 0; i < ts1.length; i++) { double diff = ts1[i] - ts2[i]; dist += Math.pow(diff, 2); } return Math.sqrt(dist) / tsLen; }
[ "protected", "double", "eculideanDistNorm", "(", "double", "[", "]", "ts1", ",", "double", "[", "]", "ts2", ")", "{", "double", "dist", "=", "0", ";", "double", "tsLen", "=", "ts1", ".", "length", ";", "for", "(", "int", "i", "=", "0", ";", "i", ...
Normalized Euclidean distance. @param ts1 the first series. @param ts2 the second series. @return the distance value.
[ "Normalized", "Euclidean", "distance", "." ]
train
https://github.com/jMotif/GI/blob/381212dd4f193246a6df82bd46f0d2bcd04a68d6/src/main/java/net/seninp/gi/clusterrule/DistanceComputation.java#L76-L86
treelogic-swe/aws-mock
example/java/full/client-usage/TerminateInstancesExample.java
TerminateInstancesExample.terminateInstances
public static List<InstanceStateChange> terminateInstances(final List<String> instanceIDs) { // pass any credentials as aws-mock does not authenticate them at all AWSCredentials credentials = new BasicAWSCredentials("foo", "bar"); AmazonEC2Client amazonEC2Client = new AmazonEC2Client(credentials); // the mock endpoint for ec2 which runs on your computer String ec2Endpoint = "http://localhost:8000/aws-mock/ec2-endpoint/"; amazonEC2Client.setEndpoint(ec2Endpoint); // send the terminate request with args as instance IDs TerminateInstancesRequest request = new TerminateInstancesRequest(); request.withInstanceIds(instanceIDs); TerminateInstancesResult result = amazonEC2Client.terminateInstances(request); return result.getTerminatingInstances(); }
java
public static List<InstanceStateChange> terminateInstances(final List<String> instanceIDs) { // pass any credentials as aws-mock does not authenticate them at all AWSCredentials credentials = new BasicAWSCredentials("foo", "bar"); AmazonEC2Client amazonEC2Client = new AmazonEC2Client(credentials); // the mock endpoint for ec2 which runs on your computer String ec2Endpoint = "http://localhost:8000/aws-mock/ec2-endpoint/"; amazonEC2Client.setEndpoint(ec2Endpoint); // send the terminate request with args as instance IDs TerminateInstancesRequest request = new TerminateInstancesRequest(); request.withInstanceIds(instanceIDs); TerminateInstancesResult result = amazonEC2Client.terminateInstances(request); return result.getTerminatingInstances(); }
[ "public", "static", "List", "<", "InstanceStateChange", ">", "terminateInstances", "(", "final", "List", "<", "String", ">", "instanceIDs", ")", "{", "// pass any credentials as aws-mock does not authenticate them at all", "AWSCredentials", "credentials", "=", "new", "Basic...
Terminate specified instances (power-on the instances). @param instanceIDs IDs of the instances to terminate @return a list of state changes for the instances
[ "Terminate", "specified", "instances", "(", "power", "-", "on", "the", "instances", ")", "." ]
train
https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/example/java/full/client-usage/TerminateInstancesExample.java#L34-L49
JOML-CI/JOML
src/org/joml/Matrix4f.java
Matrix4f.setPerspectiveRect
public Matrix4f setPerspectiveRect(float width, float height, float zNear, float zFar) { return setPerspectiveRect(width, height, zNear, zFar, false); }
java
public Matrix4f setPerspectiveRect(float width, float height, float zNear, float zFar) { return setPerspectiveRect(width, height, zNear, zFar, false); }
[ "public", "Matrix4f", "setPerspectiveRect", "(", "float", "width", ",", "float", "height", ",", "float", "zNear", ",", "float", "zFar", ")", "{", "return", "setPerspectiveRect", "(", "width", ",", "height", ",", "zNear", ",", "zFar", ",", "false", ")", ";"...
Set this matrix to be a symmetric perspective projection frustum transformation for a right-handed coordinate system using OpenGL's NDC z range of <code>[-1..+1]</code>. <p> In order to apply the perspective projection transformation to an existing transformation, use {@link #perspectiveRect(float, float, float, float) perspectiveRect()}. @see #perspectiveRect(float, float, float, float) @param width the width of the near frustum plane @param height the height of the near frustum plane @param zNear near clipping plane distance. If the special value {@link Float#POSITIVE_INFINITY} is used, the near clipping plane will be at positive infinity. In that case, <code>zFar</code> may not also be {@link Float#POSITIVE_INFINITY}. @param zFar far clipping plane distance. If the special value {@link Float#POSITIVE_INFINITY} is used, the far clipping plane will be at positive infinity. In that case, <code>zNear</code> may not also be {@link Float#POSITIVE_INFINITY}. @return this
[ "Set", "this", "matrix", "to", "be", "a", "symmetric", "perspective", "projection", "frustum", "transformation", "for", "a", "right", "-", "handed", "coordinate", "system", "using", "OpenGL", "s", "NDC", "z", "range", "of", "<code", ">", "[", "-", "1", ".....
train
https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4f.java#L9932-L9934
bazaarvoice/emodb
mapreduce/sor-hive/src/main/java/com/bazaarvoice/emodb/hive/EmoSerDe.java
EmoSerDe.getRawValue
private Object getRawValue(String columnName, Row row) { try { return getRawValue(columnName, row.getMap()); } catch (ColumnNotFoundException e) { // Check if there is an implicit column override then return it try { ImplicitColumn implicitColumn = ImplicitColumn.valueOf(columnName.toLowerCase()); return getImplicitValue(implicitColumn, row); } catch (IllegalArgumentException notImplicit) { // Object not found and column is not implicit. Return null. return null; } } }
java
private Object getRawValue(String columnName, Row row) { try { return getRawValue(columnName, row.getMap()); } catch (ColumnNotFoundException e) { // Check if there is an implicit column override then return it try { ImplicitColumn implicitColumn = ImplicitColumn.valueOf(columnName.toLowerCase()); return getImplicitValue(implicitColumn, row); } catch (IllegalArgumentException notImplicit) { // Object not found and column is not implicit. Return null. return null; } } }
[ "private", "Object", "getRawValue", "(", "String", "columnName", ",", "Row", "row", ")", "{", "try", "{", "return", "getRawValue", "(", "columnName", ",", "row", ".", "getMap", "(", ")", ")", ";", "}", "catch", "(", "ColumnNotFoundException", "e", ")", "...
Returns the value for a given row. Hierarchical elements can be reached using paths like keys. For example: <code>getRawValue("about/~id")</code> is roughly equivalent to returning: <code>row.getMap().get("about").get("~id")</code> with additional null and type checking along the path. Additionally, most intrinsics can be referenced without the leading tilde, and "json" will return the row as the original JSON string. Note that preference is always given to an explicit value. For example, if the row contains a field called "id" then calling this method with column name "id" will return that value, even if it is set to null. If there is no field called "id" then calling this method with column name "id" will return the intrinsic value for "~id".
[ "Returns", "the", "value", "for", "a", "given", "row", ".", "Hierarchical", "elements", "can", "be", "reached", "using", "paths", "like", "keys", ".", "For", "example", ":" ]
train
https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/mapreduce/sor-hive/src/main/java/com/bazaarvoice/emodb/hive/EmoSerDe.java#L187-L200
mapbox/mapbox-events-android
libcore/src/main/java/com/mapbox/android/core/crashreporter/CrashReport.java
CrashReport.put
public synchronized void put(@NonNull String key, @Nullable String value) { if (value == null) { putNull(key); return; } try { this.content.put(key, value); } catch (JSONException je) { Log.e(TAG, "Failed json encode value: " + String.valueOf(value)); } }
java
public synchronized void put(@NonNull String key, @Nullable String value) { if (value == null) { putNull(key); return; } try { this.content.put(key, value); } catch (JSONException je) { Log.e(TAG, "Failed json encode value: " + String.valueOf(value)); } }
[ "public", "synchronized", "void", "put", "(", "@", "NonNull", "String", "key", ",", "@", "Nullable", "String", "value", ")", "{", "if", "(", "value", "==", "null", ")", "{", "putNull", "(", "key", ")", ";", "return", ";", "}", "try", "{", "this", "...
Add key value pair to report @param key valid non-empty key @param value valid string value or null
[ "Add", "key", "value", "pair", "to", "report" ]
train
https://github.com/mapbox/mapbox-events-android/blob/5b5ca7e04cb8fab31a8dc040b6e7521f930a58a4/libcore/src/main/java/com/mapbox/android/core/crashreporter/CrashReport.java#L39-L50
alkacon/opencms-core
src/org/opencms/site/CmsSiteMatcher.java
CmsSiteMatcher.forDifferentScheme
public CmsSiteMatcher forDifferentScheme(String scheme) { try { URI uri = new URI(getUrl()); URI changedUri = new URI(scheme, uri.getAuthority(), uri.getPath(), uri.getQuery(), uri.getFragment()); CmsSiteMatcher res = new CmsSiteMatcher(changedUri.toString(), m_timeOffset); res.setRedirect(m_redirect); return res; } catch (Exception e) { LOG.error(e.getLocalizedMessage(), e); return null; } }
java
public CmsSiteMatcher forDifferentScheme(String scheme) { try { URI uri = new URI(getUrl()); URI changedUri = new URI(scheme, uri.getAuthority(), uri.getPath(), uri.getQuery(), uri.getFragment()); CmsSiteMatcher res = new CmsSiteMatcher(changedUri.toString(), m_timeOffset); res.setRedirect(m_redirect); return res; } catch (Exception e) { LOG.error(e.getLocalizedMessage(), e); return null; } }
[ "public", "CmsSiteMatcher", "forDifferentScheme", "(", "String", "scheme", ")", "{", "try", "{", "URI", "uri", "=", "new", "URI", "(", "getUrl", "(", ")", ")", ";", "URI", "changedUri", "=", "new", "URI", "(", "scheme", ",", "uri", ".", "getAuthority", ...
Generates a site matcher equivalent to this one but with a different scheme.<p> @param scheme the new scheme @return the new site matcher
[ "Generates", "a", "site", "matcher", "equivalent", "to", "this", "one", "but", "with", "a", "different", "scheme", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/site/CmsSiteMatcher.java#L242-L254
markzhai/AndroidPerformanceMonitor
blockcanary-android/src/main/java/com/github/moduth/blockcanary/ui/BlockCanaryUi.java
BlockCanaryUi.dpToPixel
static float dpToPixel(float dp, Resources resources) { DisplayMetrics metrics = resources.getDisplayMetrics(); return metrics.density * dp; }
java
static float dpToPixel(float dp, Resources resources) { DisplayMetrics metrics = resources.getDisplayMetrics(); return metrics.density * dp; }
[ "static", "float", "dpToPixel", "(", "float", "dp", ",", "Resources", "resources", ")", "{", "DisplayMetrics", "metrics", "=", "resources", ".", "getDisplayMetrics", "(", ")", ";", "return", "metrics", ".", "density", "*", "dp", ";", "}" ]
Converts from device independent pixels (dp or dip) to device dependent pixels. This method returns the input multiplied by the display's density. The result is not rounded nor clamped. The value returned by this method is well suited for drawing with the Canvas API but should not be used to set layout dimensions. @param dp The value in dp to convert to pixels @param resources An instances of Resources
[ "Converts", "from", "device", "independent", "pixels", "(", "dp", "or", "dip", ")", "to", "device", "dependent", "pixels", ".", "This", "method", "returns", "the", "input", "multiplied", "by", "the", "display", "s", "density", ".", "The", "result", "is", "...
train
https://github.com/markzhai/AndroidPerformanceMonitor/blob/ed688391cdf95742892ce61494736667cf5baf08/blockcanary-android/src/main/java/com/github/moduth/blockcanary/ui/BlockCanaryUi.java#L47-L50
OpenLiberty/open-liberty
dev/com.ibm.ws.security.registry/src/com/ibm/ws/security/registry/internal/UserRegistryProxy.java
UserRegistryProxy.mergeSearchResults
private SearchResult mergeSearchResults(SearchResult inDest, SearchResult source) { List<String> list = inDest.getList(); list.addAll(source.getList()); boolean hasMore = inDest.hasMore() || source.hasMore(); return new SearchResult(list, hasMore); }
java
private SearchResult mergeSearchResults(SearchResult inDest, SearchResult source) { List<String> list = inDest.getList(); list.addAll(source.getList()); boolean hasMore = inDest.hasMore() || source.hasMore(); return new SearchResult(list, hasMore); }
[ "private", "SearchResult", "mergeSearchResults", "(", "SearchResult", "inDest", ",", "SearchResult", "source", ")", "{", "List", "<", "String", ">", "list", "=", "inDest", ".", "getList", "(", ")", ";", "list", ".", "addAll", "(", "source", ".", "getList", ...
Merges the <code>source</code> SearchResult into the <code>dest</code> SearchResult. The merge of the List is a union of both lists. The merge of hasMore is via logical OR. @param inDest SearchResult object @param source SearchResult object @return a merged SearchResult.
[ "Merges", "the", "<code", ">", "source<", "/", "code", ">", "SearchResult", "into", "the", "<code", ">", "dest<", "/", "code", ">", "SearchResult", ".", "The", "merge", "of", "the", "List", "is", "a", "union", "of", "both", "lists", ".", "The", "merge"...
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.registry/src/com/ibm/ws/security/registry/internal/UserRegistryProxy.java#L347-L352
awslabs/jsii
packages/jsii-java-runtime/project/src/main/java/software/amazon/jsii/JsiiEngine.java
JsiiEngine.invokeCallbackMethod
private JsonNode invokeCallbackMethod(final InvokeRequest req, final String cookie) { Object obj = this.getObject(req.getObjref()); Method method = this.findCallbackMethod(obj.getClass(), cookie); final Class<?>[] argTypes = method.getParameterTypes(); final Object[] args = new Object[argTypes.length]; for (int i = 0; i < argTypes.length; i++) { args[i] = JsiiObjectMapper.treeToValue(req.getArgs().get(i), argTypes[i]); } return JsiiObjectMapper.valueToTree(invokeMethod(obj, method, args)); }
java
private JsonNode invokeCallbackMethod(final InvokeRequest req, final String cookie) { Object obj = this.getObject(req.getObjref()); Method method = this.findCallbackMethod(obj.getClass(), cookie); final Class<?>[] argTypes = method.getParameterTypes(); final Object[] args = new Object[argTypes.length]; for (int i = 0; i < argTypes.length; i++) { args[i] = JsiiObjectMapper.treeToValue(req.getArgs().get(i), argTypes[i]); } return JsiiObjectMapper.valueToTree(invokeMethod(obj, method, args)); }
[ "private", "JsonNode", "invokeCallbackMethod", "(", "final", "InvokeRequest", "req", ",", "final", "String", "cookie", ")", "{", "Object", "obj", "=", "this", ".", "getObject", "(", "req", ".", "getObjref", "(", ")", ")", ";", "Method", "method", "=", "thi...
Invokes an override for a method. @param req The request @param cookie The cookie @return The method's return value
[ "Invokes", "an", "override", "for", "a", "method", "." ]
train
https://github.com/awslabs/jsii/blob/6bbf743f5f65e98e5199ad31c93961533ffc40e5/packages/jsii-java-runtime/project/src/main/java/software/amazon/jsii/JsiiEngine.java#L361-L372
openengsb/openengsb
api/ekb/src/main/java/org/openengsb/core/ekb/api/transformation/TransformationDescription.java
TransformationDescription.padField
public void padField(String sourceField, String targetField, String length, String character, String direction) { TransformationStep step = new TransformationStep(); step.setSourceFields(sourceField); step.setTargetField(targetField); step.setOperationParameter(TransformationConstants.PAD_LENGTH_PARAM, length); step.setOperationParameter(TransformationConstants.PAD_CHARACTER_PARAM, character); step.setOperationParameter(TransformationConstants.PAD_DIRECTION_PARAM, direction); step.setOperationName("pad"); steps.add(step); }
java
public void padField(String sourceField, String targetField, String length, String character, String direction) { TransformationStep step = new TransformationStep(); step.setSourceFields(sourceField); step.setTargetField(targetField); step.setOperationParameter(TransformationConstants.PAD_LENGTH_PARAM, length); step.setOperationParameter(TransformationConstants.PAD_CHARACTER_PARAM, character); step.setOperationParameter(TransformationConstants.PAD_DIRECTION_PARAM, direction); step.setOperationName("pad"); steps.add(step); }
[ "public", "void", "padField", "(", "String", "sourceField", ",", "String", "targetField", ",", "String", "length", ",", "String", "character", ",", "String", "direction", ")", "{", "TransformationStep", "step", "=", "new", "TransformationStep", "(", ")", ";", ...
Adds a pad step to the transformation description. The source and the target field need to be of String type. Performs padding operation on the string of the source field and writes the result to the target field. The length describes to which size the padding should be done, the pad character describes which character to use for the padding. The direction describes if the padding should be done at the start or at the end. The standard value for the direction is at the beginning. Values for direction could be "Start" or "End".
[ "Adds", "a", "pad", "step", "to", "the", "transformation", "description", ".", "The", "source", "and", "the", "target", "field", "need", "to", "be", "of", "String", "type", ".", "Performs", "padding", "operation", "on", "the", "string", "of", "the", "sourc...
train
https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/api/ekb/src/main/java/org/openengsb/core/ekb/api/transformation/TransformationDescription.java#L244-L253
jayantk/jklol
src/com/jayantkrish/jklol/cfg/CfgParser.java
CfgParser.parseMarginal
public CfgParseChart parseMarginal(List<?> terminals, Object root, boolean useSumProduct) { CfgParseChart chart = createParseChart(terminals, useSumProduct); Factor rootFactor = TableFactor.pointDistribution(parentVar, parentVar.outcomeArrayToAssignment(root)); return marginal(chart, terminals, rootFactor); }
java
public CfgParseChart parseMarginal(List<?> terminals, Object root, boolean useSumProduct) { CfgParseChart chart = createParseChart(terminals, useSumProduct); Factor rootFactor = TableFactor.pointDistribution(parentVar, parentVar.outcomeArrayToAssignment(root)); return marginal(chart, terminals, rootFactor); }
[ "public", "CfgParseChart", "parseMarginal", "(", "List", "<", "?", ">", "terminals", ",", "Object", "root", ",", "boolean", "useSumProduct", ")", "{", "CfgParseChart", "chart", "=", "createParseChart", "(", "terminals", ",", "useSumProduct", ")", ";", "Factor", ...
Compute the marginal distribution over all grammar entries conditioned on the given sequence of terminals.
[ "Compute", "the", "marginal", "distribution", "over", "all", "grammar", "entries", "conditioned", "on", "the", "given", "sequence", "of", "terminals", "." ]
train
https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/cfg/CfgParser.java#L133-L138
carewebframework/carewebframework-core
org.carewebframework.help-parent/org.carewebframework.help.lucene/src/main/java/org/carewebframework/help/lucene/HelpSearchService.java
HelpSearchService.indexDocument
private void indexDocument(HelpModule helpModule, Resource resource) throws Exception { String title = getTitle(resource); try (InputStream is = resource.getInputStream()) { Document document = new Document(); document.add(new TextField("module", helpModule.getLocalizedId(), Store.YES)); document.add(new TextField("source", helpModule.getTitle(), Store.YES)); document.add(new TextField("title", title, Store.YES)); document.add(new TextField("url", resource.getURL().toString(), Store.YES)); document.add(new TextField("content", tika.parseToString(is), Store.NO)); writer.addDocument(document); } }
java
private void indexDocument(HelpModule helpModule, Resource resource) throws Exception { String title = getTitle(resource); try (InputStream is = resource.getInputStream()) { Document document = new Document(); document.add(new TextField("module", helpModule.getLocalizedId(), Store.YES)); document.add(new TextField("source", helpModule.getTitle(), Store.YES)); document.add(new TextField("title", title, Store.YES)); document.add(new TextField("url", resource.getURL().toString(), Store.YES)); document.add(new TextField("content", tika.parseToString(is), Store.NO)); writer.addDocument(document); } }
[ "private", "void", "indexDocument", "(", "HelpModule", "helpModule", ",", "Resource", "resource", ")", "throws", "Exception", "{", "String", "title", "=", "getTitle", "(", "resource", ")", ";", "try", "(", "InputStream", "is", "=", "resource", ".", "getInputSt...
Index an HTML text file resource. @param helpModule The help module owning the resource. @param resource The HTML text file resource. @throws Exception Unspecified exception.
[ "Index", "an", "HTML", "text", "file", "resource", "." ]
train
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.help-parent/org.carewebframework.help.lucene/src/main/java/org/carewebframework/help/lucene/HelpSearchService.java#L305-L317
aws/aws-sdk-java
aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/MessageMD5ChecksumHandler.java
MessageMD5ChecksumHandler.updateLengthAndBytes
private static void updateLengthAndBytes(MessageDigest digest, ByteBuffer binaryValue) { ByteBuffer readOnlyBuffer = binaryValue.asReadOnlyBuffer(); int size = readOnlyBuffer.remaining(); ByteBuffer lengthBytes = ByteBuffer.allocate(INTEGER_SIZE_IN_BYTES).putInt(size); digest.update(lengthBytes.array()); digest.update(readOnlyBuffer); }
java
private static void updateLengthAndBytes(MessageDigest digest, ByteBuffer binaryValue) { ByteBuffer readOnlyBuffer = binaryValue.asReadOnlyBuffer(); int size = readOnlyBuffer.remaining(); ByteBuffer lengthBytes = ByteBuffer.allocate(INTEGER_SIZE_IN_BYTES).putInt(size); digest.update(lengthBytes.array()); digest.update(readOnlyBuffer); }
[ "private", "static", "void", "updateLengthAndBytes", "(", "MessageDigest", "digest", ",", "ByteBuffer", "binaryValue", ")", "{", "ByteBuffer", "readOnlyBuffer", "=", "binaryValue", ".", "asReadOnlyBuffer", "(", ")", ";", "int", "size", "=", "readOnlyBuffer", ".", ...
Update the digest using a sequence of bytes that consists of the length (in 4 bytes) of the input ByteBuffer and all the bytes it contains.
[ "Update", "the", "digest", "using", "a", "sequence", "of", "bytes", "that", "consists", "of", "the", "length", "(", "in", "4", "bytes", ")", "of", "the", "input", "ByteBuffer", "and", "all", "the", "bytes", "it", "contains", "." ]
train
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/MessageMD5ChecksumHandler.java#L280-L286
CODAIT/stocator
src/main/java/com/ibm/stocator/fs/cos/COSUtils.java
COSUtils.extractException
public static IOException extractException(String operation, String path, ExecutionException ee) { IOException ioe; Throwable cause = ee.getCause(); if (cause instanceof AmazonClientException) { ioe = translateException(operation, path, (AmazonClientException) cause); } else if (cause instanceof IOException) { ioe = (IOException) cause; } else { ioe = new IOException(operation + " failed: " + cause, cause); } return ioe; }
java
public static IOException extractException(String operation, String path, ExecutionException ee) { IOException ioe; Throwable cause = ee.getCause(); if (cause instanceof AmazonClientException) { ioe = translateException(operation, path, (AmazonClientException) cause); } else if (cause instanceof IOException) { ioe = (IOException) cause; } else { ioe = new IOException(operation + " failed: " + cause, cause); } return ioe; }
[ "public", "static", "IOException", "extractException", "(", "String", "operation", ",", "String", "path", ",", "ExecutionException", "ee", ")", "{", "IOException", "ioe", ";", "Throwable", "cause", "=", "ee", ".", "getCause", "(", ")", ";", "if", "(", "cause...
Extract an exception from a failed future, and convert to an IOE. @param operation operation which failed @param path path operated on (may be null) @param ee execution exception @return an IOE which can be thrown
[ "Extract", "an", "exception", "from", "a", "failed", "future", "and", "convert", "to", "an", "IOE", "." ]
train
https://github.com/CODAIT/stocator/blob/35969cadd2e8faa6fdac45e8bec1799fdd3d8299/src/main/java/com/ibm/stocator/fs/cos/COSUtils.java#L164-L176
powermock/powermock
powermock-api/powermock-api-easymock/src/main/java/org/powermock/api/easymock/PowerMock.java
PowerMock.createStrictPartialMock
public static synchronized <T> T createStrictPartialMock(Class<T> type, String... methodNames) { return createStrictMock(type, Whitebox.getMethods(type, methodNames)); }
java
public static synchronized <T> T createStrictPartialMock(Class<T> type, String... methodNames) { return createStrictMock(type, Whitebox.getMethods(type, methodNames)); }
[ "public", "static", "synchronized", "<", "T", ">", "T", "createStrictPartialMock", "(", "Class", "<", "T", ">", "type", ",", "String", "...", "methodNames", ")", "{", "return", "createStrictMock", "(", "type", ",", "Whitebox", ".", "getMethods", "(", "type",...
A utility method that may be used to strictly mock several methods in an easy way (by just passing in the method names of the method you wish to mock). Note that you cannot uniquely specify a method to mock using this method if there are several methods with the same name in {@code type}. This method will mock ALL methods that match the supplied name regardless of parameter types and signature. If this is the case you should fall-back on using the {@link #createMock(Class, Method...)} method instead. @param <T> The type of the mock. @param type The type that'll be used to create a mock instance. @param methodNames The names of the methods that should be mocked. If {@code null}, then this method will have the same effect as just calling {@link #createMock(Class, Method...)} with the second parameter as {@code new Method[0]} (i.e. all methods in that class will be mocked). @return A mock object of type <T>.
[ "A", "utility", "method", "that", "may", "be", "used", "to", "strictly", "mock", "several", "methods", "in", "an", "easy", "way", "(", "by", "just", "passing", "in", "the", "method", "names", "of", "the", "method", "you", "wish", "to", "mock", ")", "."...
train
https://github.com/powermock/powermock/blob/e8cd68026c284c6a7efe66959809eeebd8d1f9ad/powermock-api/powermock-api-easymock/src/main/java/org/powermock/api/easymock/PowerMock.java#L725-L727
jbundle/jbundle
base/base/src/main/java/org/jbundle/base/db/BaseDatabase.java
BaseDatabase.makeResourceTable
public BaseTable makeResourceTable(Record record, BaseTable table, BaseDatabase databaseBase, boolean bHierarchicalTable) { // Create a mirrored record in the locale database Record record2 = (Record)ClassServiceUtility.getClassService().makeObjectFromClassName(record.getClass().getName()); if (record2 != null) { BaseTable table2 = databaseBase.makeTable(record2); record2.setTable(table2); RecordOwner recordOwner = Record.findRecordOwner(record); record2.init(recordOwner); recordOwner.removeRecord(record2); // This is okay as ResourceTable will remove this table on close. record.setTable(table); // This is necessary to link-up ResourceTable if (!bHierarchicalTable) table = new org.jbundle.base.db.util.ResourceTable(null, record); else table = new org.jbundle.base.db.util.HierarchicalTable(null, record); table.addTable(table2); } return table; }
java
public BaseTable makeResourceTable(Record record, BaseTable table, BaseDatabase databaseBase, boolean bHierarchicalTable) { // Create a mirrored record in the locale database Record record2 = (Record)ClassServiceUtility.getClassService().makeObjectFromClassName(record.getClass().getName()); if (record2 != null) { BaseTable table2 = databaseBase.makeTable(record2); record2.setTable(table2); RecordOwner recordOwner = Record.findRecordOwner(record); record2.init(recordOwner); recordOwner.removeRecord(record2); // This is okay as ResourceTable will remove this table on close. record.setTable(table); // This is necessary to link-up ResourceTable if (!bHierarchicalTable) table = new org.jbundle.base.db.util.ResourceTable(null, record); else table = new org.jbundle.base.db.util.HierarchicalTable(null, record); table.addTable(table2); } return table; }
[ "public", "BaseTable", "makeResourceTable", "(", "Record", "record", ",", "BaseTable", "table", ",", "BaseDatabase", "databaseBase", ",", "boolean", "bHierarchicalTable", ")", "{", "// Create a mirrored record in the locale database", "Record", "record2", "=", "(", "Recor...
If one exists, set up the Local version of this record. Do this by opening a local version of this database and attaching a ResourceTable to the record. @param record The record to set up. @param table The table for the record. @return The new locale-sensitive table that has been setup for this record.
[ "If", "one", "exists", "set", "up", "the", "Local", "version", "of", "this", "record", ".", "Do", "this", "by", "opening", "a", "local", "version", "of", "this", "database", "and", "attaching", "a", "ResourceTable", "to", "the", "record", "." ]
train
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/BaseDatabase.java#L439-L459
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/BugInstance.java
BugInstance.addClassAndMethod
@Nonnull public BugInstance addClassAndMethod(MethodGen methodGen, String sourceFile) { addClass(methodGen.getClassName()); addMethod(methodGen, sourceFile); if (!MemberUtils.isUserGenerated(methodGen)) { foundInAutogeneratedMethod(); } return this; }
java
@Nonnull public BugInstance addClassAndMethod(MethodGen methodGen, String sourceFile) { addClass(methodGen.getClassName()); addMethod(methodGen, sourceFile); if (!MemberUtils.isUserGenerated(methodGen)) { foundInAutogeneratedMethod(); } return this; }
[ "@", "Nonnull", "public", "BugInstance", "addClassAndMethod", "(", "MethodGen", "methodGen", ",", "String", "sourceFile", ")", "{", "addClass", "(", "methodGen", ".", "getClassName", "(", ")", ")", ";", "addMethod", "(", "methodGen", ",", "sourceFile", ")", ";...
Add class and method annotations for given method. @param methodGen the method @param sourceFile source file the method is defined in @return this object
[ "Add", "class", "and", "method", "annotations", "for", "given", "method", "." ]
train
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/BugInstance.java#L884-L892
apache/flink
flink-core/src/main/java/org/apache/flink/types/parser/FloatParser.java
FloatParser.parseField
public static final float parseField(byte[] bytes, int startPos, int length, char delimiter) { final int limitedLen = nextStringLength(bytes, startPos, length, delimiter); if (limitedLen > 0 && (Character.isWhitespace(bytes[startPos]) || Character.isWhitespace(bytes[startPos + limitedLen - 1]))) { throw new NumberFormatException("There is leading or trailing whitespace in the numeric field."); } final String str = new String(bytes, startPos, limitedLen, ConfigConstants.DEFAULT_CHARSET); return Float.parseFloat(str); }
java
public static final float parseField(byte[] bytes, int startPos, int length, char delimiter) { final int limitedLen = nextStringLength(bytes, startPos, length, delimiter); if (limitedLen > 0 && (Character.isWhitespace(bytes[startPos]) || Character.isWhitespace(bytes[startPos + limitedLen - 1]))) { throw new NumberFormatException("There is leading or trailing whitespace in the numeric field."); } final String str = new String(bytes, startPos, limitedLen, ConfigConstants.DEFAULT_CHARSET); return Float.parseFloat(str); }
[ "public", "static", "final", "float", "parseField", "(", "byte", "[", "]", "bytes", ",", "int", "startPos", ",", "int", "length", ",", "char", "delimiter", ")", "{", "final", "int", "limitedLen", "=", "nextStringLength", "(", "bytes", ",", "startPos", ",",...
Static utility to parse a field of type float from a byte sequence that represents text characters (such as when read from a file stream). @param bytes The bytes containing the text data that should be parsed. @param startPos The offset to start the parsing. @param length The length of the byte sequence (counting from the offset). @param delimiter The delimiter that terminates the field. @return The parsed value. @throws IllegalArgumentException Thrown when the value cannot be parsed because the text represents not a correct number.
[ "Static", "utility", "to", "parse", "a", "field", "of", "type", "float", "from", "a", "byte", "sequence", "that", "represents", "text", "characters", "(", "such", "as", "when", "read", "from", "a", "file", "stream", ")", "." ]
train
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/types/parser/FloatParser.java#L95-L105
Azure/azure-sdk-for-java
batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/PoolsImpl.java
PoolsImpl.stopResize
public void stopResize(String poolId, PoolStopResizeOptions poolStopResizeOptions) { stopResizeWithServiceResponseAsync(poolId, poolStopResizeOptions).toBlocking().single().body(); }
java
public void stopResize(String poolId, PoolStopResizeOptions poolStopResizeOptions) { stopResizeWithServiceResponseAsync(poolId, poolStopResizeOptions).toBlocking().single().body(); }
[ "public", "void", "stopResize", "(", "String", "poolId", ",", "PoolStopResizeOptions", "poolStopResizeOptions", ")", "{", "stopResizeWithServiceResponseAsync", "(", "poolId", ",", "poolStopResizeOptions", ")", ".", "toBlocking", "(", ")", ".", "single", "(", ")", "....
Stops an ongoing resize operation on the pool. This does not restore the pool to its previous state before the resize operation: it only stops any further changes being made, and the pool maintains its current state. After stopping, the pool stabilizes at the number of nodes it was at when the stop operation was done. During the stop operation, the pool allocation state changes first to stopping and then to steady. A resize operation need not be an explicit resize pool request; this API can also be used to halt the initial sizing of the pool when it is created. @param poolId The ID of the pool whose resizing you want to stop. @param poolStopResizeOptions Additional parameters for the operation @throws IllegalArgumentException thrown if parameters fail the validation @throws BatchErrorException thrown if the request is rejected by server @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
[ "Stops", "an", "ongoing", "resize", "operation", "on", "the", "pool", ".", "This", "does", "not", "restore", "the", "pool", "to", "its", "previous", "state", "before", "the", "resize", "operation", ":", "it", "only", "stops", "any", "further", "changes", "...
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/PoolsImpl.java#L3063-L3065
authorjapps/zerocode
core/src/main/java/org/jsmart/zerocode/core/httpclient/BasicHttpClient.java
BasicHttpClient.handleUrlAndQueryParams
public String handleUrlAndQueryParams(String httpUrl, Map<String, Object> queryParams) throws IOException { if ((queryParams != null) && (!queryParams.isEmpty())) { httpUrl = setQueryParams(httpUrl, queryParams); } return httpUrl; }
java
public String handleUrlAndQueryParams(String httpUrl, Map<String, Object> queryParams) throws IOException { if ((queryParams != null) && (!queryParams.isEmpty())) { httpUrl = setQueryParams(httpUrl, queryParams); } return httpUrl; }
[ "public", "String", "handleUrlAndQueryParams", "(", "String", "httpUrl", ",", "Map", "<", "String", ",", "Object", ">", "queryParams", ")", "throws", "IOException", "{", "if", "(", "(", "queryParams", "!=", "null", ")", "&&", "(", "!", "queryParams", ".", ...
If(optionally) query parameters was sent as a JSON in the request below, this gets available to this method for processing them with the url. <pre>{@code e.g. "url": "/api/v1/search/people" "request": { "queryParams": { "city":"Lon", "lang":"Awesome" } } }</pre> will resolve to effective url "/api/v1/search/people?city=Lon{@literal &}lang=Awesome". In case you need to handle it differently you can override this method to change this behaviour to roll your own feature. @param httpUrl - Url of the target service @param queryParams - Query parameters to pass @return : Effective url @author santhoshkumar santhoshTpixler (Fixed empty queryParams map handling)
[ "If", "(", "optionally", ")", "query", "parameters", "was", "sent", "as", "a", "JSON", "in", "the", "request", "below", "this", "gets", "available", "to", "this", "method", "for", "processing", "them", "with", "the", "url", ".", "<pre", ">", "{", "@code"...
train
https://github.com/authorjapps/zerocode/blob/d66a3e8778d2eb5e4f0006bfcccfc0922ceb7cef/core/src/main/java/org/jsmart/zerocode/core/httpclient/BasicHttpClient.java#L220-L225
trellis-ldp/trellis
core/http/src/main/java/org/trellisldp/http/TrellisHttpResource.java
TrellisHttpResource.setResource
@PUT @Timed public void setResource(@Suspended final AsyncResponse response, @Context final Request request, @Context final UriInfo uriInfo, @Context final HttpHeaders headers, @Context final SecurityContext secContext, final InputStream body) { final TrellisRequest req = new TrellisRequest(request, uriInfo, headers, secContext); final String urlBase = getBaseUrl(req); final IRI identifier = rdf.createIRI(TRELLIS_DATA_PREFIX + req.getPath()); final PutHandler putHandler = new PutHandler(req, body, trellis, preconditionRequired, createUncontained, urlBase); getParent(identifier).thenCombine(trellis.getResourceService().get(identifier), putHandler::initialize) .thenCompose(putHandler::setResource).thenCompose(putHandler::updateMemento) .thenApply(ResponseBuilder::build).exceptionally(this::handleException).thenApply(response::resume); }
java
@PUT @Timed public void setResource(@Suspended final AsyncResponse response, @Context final Request request, @Context final UriInfo uriInfo, @Context final HttpHeaders headers, @Context final SecurityContext secContext, final InputStream body) { final TrellisRequest req = new TrellisRequest(request, uriInfo, headers, secContext); final String urlBase = getBaseUrl(req); final IRI identifier = rdf.createIRI(TRELLIS_DATA_PREFIX + req.getPath()); final PutHandler putHandler = new PutHandler(req, body, trellis, preconditionRequired, createUncontained, urlBase); getParent(identifier).thenCombine(trellis.getResourceService().get(identifier), putHandler::initialize) .thenCompose(putHandler::setResource).thenCompose(putHandler::updateMemento) .thenApply(ResponseBuilder::build).exceptionally(this::handleException).thenApply(response::resume); }
[ "@", "PUT", "@", "Timed", "public", "void", "setResource", "(", "@", "Suspended", "final", "AsyncResponse", "response", ",", "@", "Context", "final", "Request", "request", ",", "@", "Context", "final", "UriInfo", "uriInfo", ",", "@", "Context", "final", "Htt...
Perform a PUT operation on a LDP Resource. @param response the async response @param uriInfo the URI info @param secContext the security context @param headers the HTTP headers @param request the request @param body the body
[ "Perform", "a", "PUT", "operation", "on", "a", "LDP", "Resource", "." ]
train
https://github.com/trellis-ldp/trellis/blob/789fd7a3df86cab7ebba63e72bf4e58397e5f42d/core/http/src/main/java/org/trellisldp/http/TrellisHttpResource.java#L341-L355
TheCoder4eu/BootsFaces-OSP
src/main/java/net/bootsfaces/component/tree/model/TreeModelUtils.java
TreeModelUtils.searchNodeById
public static Node searchNodeById(Node rootNode, int nodeId) { if (rootNode.getNodeId() == nodeId) { return rootNode; } Node foundNode = null; for (Node n : rootNode.getChilds()) { foundNode = searchNodeById(n, nodeId); if (foundNode != null) { break; } } return foundNode; }
java
public static Node searchNodeById(Node rootNode, int nodeId) { if (rootNode.getNodeId() == nodeId) { return rootNode; } Node foundNode = null; for (Node n : rootNode.getChilds()) { foundNode = searchNodeById(n, nodeId); if (foundNode != null) { break; } } return foundNode; }
[ "public", "static", "Node", "searchNodeById", "(", "Node", "rootNode", ",", "int", "nodeId", ")", "{", "if", "(", "rootNode", ".", "getNodeId", "(", ")", "==", "nodeId", ")", "{", "return", "rootNode", ";", "}", "Node", "foundNode", "=", "null", ";", "...
Basic implementation of recursive node search by id It works only on a DefaultNodeImpl @param rootNode @param nodeId @return Node instance or null if there is no node with specific id
[ "Basic", "implementation", "of", "recursive", "node", "search", "by", "id", "It", "works", "only", "on", "a", "DefaultNodeImpl" ]
train
https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/component/tree/model/TreeModelUtils.java#L57-L69
osiegmar/logback-gelf
src/main/java/de/siegmar/logbackgelf/SimpleJsonEncoder.java
SimpleJsonEncoder.appendToJSONUnquoted
SimpleJsonEncoder appendToJSONUnquoted(final String key, final Object value) { if (closed) { throw new IllegalStateException("Encoder already closed"); } if (value != null) { appendKey(key); sb.append(value); } return this; }
java
SimpleJsonEncoder appendToJSONUnquoted(final String key, final Object value) { if (closed) { throw new IllegalStateException("Encoder already closed"); } if (value != null) { appendKey(key); sb.append(value); } return this; }
[ "SimpleJsonEncoder", "appendToJSONUnquoted", "(", "final", "String", "key", ",", "final", "Object", "value", ")", "{", "if", "(", "closed", ")", "{", "throw", "new", "IllegalStateException", "(", "\"Encoder already closed\"", ")", ";", "}", "if", "(", "value", ...
Append field with quotes and escape characters added in the key, if required. The value is added without quotes and any escape characters. @return this
[ "Append", "field", "with", "quotes", "and", "escape", "characters", "added", "in", "the", "key", "if", "required", ".", "The", "value", "is", "added", "without", "quotes", "and", "any", "escape", "characters", "." ]
train
https://github.com/osiegmar/logback-gelf/blob/35c41eda363db803c8c4570f31d518451e9a879b/src/main/java/de/siegmar/logbackgelf/SimpleJsonEncoder.java#L74-L83