repository_name
stringlengths
7
58
func_path_in_repository
stringlengths
11
218
func_name
stringlengths
4
140
whole_func_string
stringlengths
153
5.32k
language
stringclasses
1 value
func_code_string
stringlengths
72
4k
func_code_tokens
listlengths
20
832
func_documentation_string
stringlengths
61
2k
func_documentation_tokens
listlengths
1
647
split_name
stringclasses
1 value
func_code_url
stringlengths
102
339
JodaOrg/joda-time
src/main/java/org/joda/time/Period.java
Period.withYears
public Period withYears(int years) { """ Returns a new period with the specified number of years. <p> This period instance is immutable and unaffected by this method call. @param years the amount of years to add, may be negative @return the new period with the increased years @throws UnsupportedOperationEx...
java
public Period withYears(int years) { int[] values = getValues(); // cloned getPeriodType().setIndexedField(this, PeriodType.YEAR_INDEX, values, years); return new Period(values, getPeriodType()); }
[ "public", "Period", "withYears", "(", "int", "years", ")", "{", "int", "[", "]", "values", "=", "getValues", "(", ")", ";", "// cloned", "getPeriodType", "(", ")", ".", "setIndexedField", "(", "this", ",", "PeriodType", ".", "YEAR_INDEX", ",", "values", ...
Returns a new period with the specified number of years. <p> This period instance is immutable and unaffected by this method call. @param years the amount of years to add, may be negative @return the new period with the increased years @throws UnsupportedOperationException if the field is not supported
[ "Returns", "a", "new", "period", "with", "the", "specified", "number", "of", "years", ".", "<p", ">", "This", "period", "instance", "is", "immutable", "and", "unaffected", "by", "this", "method", "call", "." ]
train
https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/Period.java#L914-L918
TNG/property-loader
src/main/java/com/tngtech/propertyloader/Obfuscator.java
Obfuscator.encryptInternal
private byte[] encryptInternal(SecretKeySpec key, String toEncrypt) { """ Internal Encryption method. @param key - the SecretKeySpec used to encrypt @param toEncrypt - the String to encrypt @return the encrypted String (as byte[]) """ try { Cipher cipher = Cipher.getInstance(ENCR...
java
private byte[] encryptInternal(SecretKeySpec key, String toEncrypt) { try { Cipher cipher = Cipher.getInstance(ENCRYPTION_ALGORITHM + ENCRYPTION_ALGORITHM_MODIFIER); cipher.init(Cipher.ENCRYPT_MODE, key); return cipher.doFinal(toEncrypt.getBytes(ENCODING)); } catch (G...
[ "private", "byte", "[", "]", "encryptInternal", "(", "SecretKeySpec", "key", ",", "String", "toEncrypt", ")", "{", "try", "{", "Cipher", "cipher", "=", "Cipher", ".", "getInstance", "(", "ENCRYPTION_ALGORITHM", "+", "ENCRYPTION_ALGORITHM_MODIFIER", ")", ";", "ci...
Internal Encryption method. @param key - the SecretKeySpec used to encrypt @param toEncrypt - the String to encrypt @return the encrypted String (as byte[])
[ "Internal", "Encryption", "method", "." ]
train
https://github.com/TNG/property-loader/blob/0fbc8a091795aaf2bdaf7c0d494a32772bff0e1f/src/main/java/com/tngtech/propertyloader/Obfuscator.java#L53-L63
looly/hutool
hutool-core/src/main/java/cn/hutool/core/map/MapUtil.java
MapUtil.reverse
public static <T> Map<T, T> reverse(Map<T, T> map) { """ Map的键和值互换 @param <T> 键和值类型 @param map Map对象,键值类型必须一致 @return 互换后的Map @since 3.2.2 """ return filter(map, new Editor<Map.Entry<T, T>>() { @Override public Entry<T, T> edit(final Entry<T, T> t) { return new Entry<T, T>() { @Ov...
java
public static <T> Map<T, T> reverse(Map<T, T> map) { return filter(map, new Editor<Map.Entry<T, T>>() { @Override public Entry<T, T> edit(final Entry<T, T> t) { return new Entry<T, T>() { @Override public T getKey() { return t.getValue(); } @Override public T get...
[ "public", "static", "<", "T", ">", "Map", "<", "T", ",", "T", ">", "reverse", "(", "Map", "<", "T", ",", "T", ">", "map", ")", "{", "return", "filter", "(", "map", ",", "new", "Editor", "<", "Map", ".", "Entry", "<", "T", ",", "T", ">", ">"...
Map的键和值互换 @param <T> 键和值类型 @param map Map对象,键值类型必须一致 @return 互换后的Map @since 3.2.2
[ "Map的键和值互换" ]
train
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/map/MapUtil.java#L579-L602
jhunters/jprotobuf
android/src/main/java/com/baidu/bjf/remoting/protobuf/ProtobufIDLGenerator.java
ProtobufIDLGenerator.getIDL
public static String getIDL(final Class<?> cls, final Set<Class<?>> cachedTypes, final Set<Class<?>> cachedEnumTypes) { """ get IDL content from class. @param cls target class to parse for IDL message. @param cachedTypes if type already in set will not generate IDL. if a new type found will add to...
java
public static String getIDL(final Class<?> cls, final Set<Class<?>> cachedTypes, final Set<Class<?>> cachedEnumTypes) { return getIDL(cls, cachedTypes, cachedEnumTypes, false); }
[ "public", "static", "String", "getIDL", "(", "final", "Class", "<", "?", ">", "cls", ",", "final", "Set", "<", "Class", "<", "?", ">", ">", "cachedTypes", ",", "final", "Set", "<", "Class", "<", "?", ">", ">", "cachedEnumTypes", ")", "{", "return", ...
get IDL content from class. @param cls target class to parse for IDL message. @param cachedTypes if type already in set will not generate IDL. if a new type found will add to set @param cachedEnumTypes if enum already in set will not generate IDL. if a new enum found will add to set @return protobuf IDL content in str...
[ "get", "IDL", "content", "from", "class", "." ]
train
https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/android/src/main/java/com/baidu/bjf/remoting/protobuf/ProtobufIDLGenerator.java#L91-L96
lagom/lagom
service/javadsl/server/src/main/java/com/lightbend/lagom/javadsl/server/status/Latency.java
Latency.withPercentile99th
public final Latency withPercentile99th(double value) { """ Copy the current immutable object by setting a value for the {@link AbstractLatency#getPercentile99th() percentile99th} attribute. @param value A new value for percentile99th @return A modified copy of the {@code this} object """ double newValue...
java
public final Latency withPercentile99th(double value) { double newValue = value; return new Latency(this.median, this.percentile98th, newValue, this.percentile999th, this.mean, this.min, this.max); }
[ "public", "final", "Latency", "withPercentile99th", "(", "double", "value", ")", "{", "double", "newValue", "=", "value", ";", "return", "new", "Latency", "(", "this", ".", "median", ",", "this", ".", "percentile98th", ",", "newValue", ",", "this", ".", "p...
Copy the current immutable object by setting a value for the {@link AbstractLatency#getPercentile99th() percentile99th} attribute. @param value A new value for percentile99th @return A modified copy of the {@code this} object
[ "Copy", "the", "current", "immutable", "object", "by", "setting", "a", "value", "for", "the", "{" ]
train
https://github.com/lagom/lagom/blob/3763055a9d1aace793a5d970f4e688aea61b1a5a/service/javadsl/server/src/main/java/com/lightbend/lagom/javadsl/server/status/Latency.java#L147-L150
rterp/GMapsFX
GMapsFX/src/main/java/com/lynden/gmapsfx/javascript/JavascriptObject.java
JavascriptObject.invokeJavascriptReturnValue
protected <T> T invokeJavascriptReturnValue(String function, Class<T> returnType) { """ Invokes a JavaScript function that takes no arguments. @param <T> @param function The function to invoke @param returnType The type of object to return @return The result of the function. """ Object returnObje...
java
protected <T> T invokeJavascriptReturnValue(String function, Class<T> returnType) { Object returnObject = invokeJavascript(function); if (returnObject instanceof JSObject) { try { Constructor<T> constructor = returnType.getConstructor(JSObject.class); return c...
[ "protected", "<", "T", ">", "T", "invokeJavascriptReturnValue", "(", "String", "function", ",", "Class", "<", "T", ">", "returnType", ")", "{", "Object", "returnObject", "=", "invokeJavascript", "(", "function", ")", ";", "if", "(", "returnObject", "instanceof...
Invokes a JavaScript function that takes no arguments. @param <T> @param function The function to invoke @param returnType The type of object to return @return The result of the function.
[ "Invokes", "a", "JavaScript", "function", "that", "takes", "no", "arguments", "." ]
train
https://github.com/rterp/GMapsFX/blob/4623d3f768e8ad78fc50ee32dd204d236e01059f/GMapsFX/src/main/java/com/lynden/gmapsfx/javascript/JavascriptObject.java#L241-L253
google/error-prone-javac
src/jdk.compiler/share/classes/com/sun/source/util/SimpleDocTreeVisitor.java
SimpleDocTreeVisitor.visitProvides
@Override public R visitProvides(ProvidesTree node, P p) { """ {@inheritDoc} This implementation calls {@code defaultAction}. @param node {@inheritDoc} @param p {@inheritDoc} @return the result of {@code defaultAction} """ return defaultAction(node, p); }
java
@Override public R visitProvides(ProvidesTree node, P p) { return defaultAction(node, p); }
[ "@", "Override", "public", "R", "visitProvides", "(", "ProvidesTree", "node", ",", "P", "p", ")", "{", "return", "defaultAction", "(", "node", ",", "p", ")", ";", "}" ]
{@inheritDoc} This implementation calls {@code defaultAction}. @param node {@inheritDoc} @param p {@inheritDoc} @return the result of {@code defaultAction}
[ "{", "@inheritDoc", "}", "This", "implementation", "calls", "{", "@code", "defaultAction", "}", "." ]
train
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/source/util/SimpleDocTreeVisitor.java#L297-L300
DDTH/ddth-commons
ddth-commons-core/src/main/java/com/github/ddth/commons/utils/SerializationUtils.java
SerializationUtils.readJson
public static JsonNode readJson(Reader source, ClassLoader classLoader) { """ Read a JSON string and parse to {@link JsonNode} instance, with a custom class loader. @param source @param classLoader @return @since 0.6.2 """ ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader(...
java
public static JsonNode readJson(Reader source, ClassLoader classLoader) { ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader(); if (classLoader != null) { Thread.currentThread().setContextClassLoader(classLoader); } try { if (source == null)...
[ "public", "static", "JsonNode", "readJson", "(", "Reader", "source", ",", "ClassLoader", "classLoader", ")", "{", "ClassLoader", "oldClassLoader", "=", "Thread", ".", "currentThread", "(", ")", ".", "getContextClassLoader", "(", ")", ";", "if", "(", "classLoader...
Read a JSON string and parse to {@link JsonNode} instance, with a custom class loader. @param source @param classLoader @return @since 0.6.2
[ "Read", "a", "JSON", "string", "and", "parse", "to", "{", "@link", "JsonNode", "}", "instance", "with", "a", "custom", "class", "loader", "." ]
train
https://github.com/DDTH/ddth-commons/blob/734f0e77321d41eeca78a557be9884df9874e46e/ddth-commons-core/src/main/java/com/github/ddth/commons/utils/SerializationUtils.java#L592-L616
jMotif/SAX
src/main/java/net/seninp/util/HeatChart.java
HeatChart.setXValues
public void setXValues(double xOffset, double xInterval) { """ Sets the x-values which are plotted along the x-axis. The x-values are calculated based upon the indexes of the z-values array: <pre> {@code <pre> x-value = x-offset + (column-index * x-interval) </pre> } * </pre> <p> The x-inte...
java
public void setXValues(double xOffset, double xInterval) { // Update the x-values according to the offset and interval. xValues = new Object[zValues[0].length]; for (int i = 0; i < zValues[0].length; i++) { xValues[i] = xOffset + (i * xInterval); } }
[ "public", "void", "setXValues", "(", "double", "xOffset", ",", "double", "xInterval", ")", "{", "// Update the x-values according to the offset and interval.", "xValues", "=", "new", "Object", "[", "zValues", "[", "0", "]", ".", "length", "]", ";", "for", "(", "...
Sets the x-values which are plotted along the x-axis. The x-values are calculated based upon the indexes of the z-values array: <pre> {@code <pre> x-value = x-offset + (column-index * x-interval) </pre> } * </pre> <p> The x-interval defines the gap between each x-value and the x-offset is applied to each value t...
[ "Sets", "the", "x", "-", "values", "which", "are", "plotted", "along", "the", "x", "-", "axis", ".", "The", "x", "-", "values", "are", "calculated", "based", "upon", "the", "indexes", "of", "the", "z", "-", "values", "array", ":" ]
train
https://github.com/jMotif/SAX/blob/39ee07a69facaa330def5130b8790aeda85f1061/src/main/java/net/seninp/util/HeatChart.java#L375-L381
jbundle/jbundle
main/calendar/src/main/java/org/jbundle/main/calendar/screen/CalendarEntryCalendarScreen.java
CalendarEntryCalendarScreen.doCommand
public boolean doCommand(String strCommand, ScreenField sourceSField, int iCommandOptions) { """ Process the command. <br />Step 1 - Process the command if possible and return true if processed. <br />Step 2 - If I can't process, pass to all children (with me as the source). <br />Step 3 - If children didn't pr...
java
public boolean doCommand(String strCommand, ScreenField sourceSField, int iCommandOptions) { Record recordMain = null; int iDocMode = ScreenConstants.MAINT_MODE; boolean bReadCurrentRecord = false; Map<String,Object> properties = null; if (CalendarEntryTypeField.APPOINTMENT.e...
[ "public", "boolean", "doCommand", "(", "String", "strCommand", ",", "ScreenField", "sourceSField", ",", "int", "iCommandOptions", ")", "{", "Record", "recordMain", "=", "null", ";", "int", "iDocMode", "=", "ScreenConstants", ".", "MAINT_MODE", ";", "boolean", "b...
Process the command. <br />Step 1 - Process the command if possible and return true if processed. <br />Step 2 - If I can't process, pass to all children (with me as the source). <br />Step 3 - If children didn't process, pass to parent (with me as the source). <br />Note: Never pass to a parent or child that matches t...
[ "Process", "the", "command", ".", "<br", "/", ">", "Step", "1", "-", "Process", "the", "command", "if", "possible", "and", "return", "true", "if", "processed", ".", "<br", "/", ">", "Step", "2", "-", "If", "I", "can", "t", "process", "pass", "to", ...
train
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/main/calendar/src/main/java/org/jbundle/main/calendar/screen/CalendarEntryCalendarScreen.java#L130-L149
google/error-prone-javac
src/jdk.compiler/share/classes/com/sun/source/util/TreeScanner.java
TreeScanner.visitCompilationUnit
@Override public R visitCompilationUnit(CompilationUnitTree node, P p) { """ {@inheritDoc} This implementation scans the children in left to right order. @param node {@inheritDoc} @param p {@inheritDoc} @return the result of scanning """ R r = scan(node.getPackage(), p); r = scanAndR...
java
@Override public R visitCompilationUnit(CompilationUnitTree node, P p) { R r = scan(node.getPackage(), p); r = scanAndReduce(node.getImports(), p, r); r = scanAndReduce(node.getTypeDecls(), p, r); return r; }
[ "@", "Override", "public", "R", "visitCompilationUnit", "(", "CompilationUnitTree", "node", ",", "P", "p", ")", "{", "R", "r", "=", "scan", "(", "node", ".", "getPackage", "(", ")", ",", "p", ")", ";", "r", "=", "scanAndReduce", "(", "node", ".", "ge...
{@inheritDoc} This implementation scans the children in left to right order. @param node {@inheritDoc} @param p {@inheritDoc} @return the result of scanning
[ "{", "@inheritDoc", "}", "This", "implementation", "scans", "the", "children", "in", "left", "to", "right", "order", "." ]
train
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/source/util/TreeScanner.java#L140-L146
hal/core
gui/src/main/java/org/jboss/as/console/client/v3/dmr/AddressTemplate.java
AddressTemplate.subTemplate
public AddressTemplate subTemplate(int fromIndex, int toIndex) { """ Works like {@link List#subList(int, int)} over the tokens of this template and throws the same exceptions. @param fromIndex low endpoint (inclusive) of the sub template @param toIndex high endpoint (exclusive) of the sub template @return a...
java
public AddressTemplate subTemplate(int fromIndex, int toIndex) { LinkedList<Token> subTokens = new LinkedList<>(); subTokens.addAll(this.tokens.subList(fromIndex, toIndex)); return AddressTemplate.of(join(this.optional, subTokens)); }
[ "public", "AddressTemplate", "subTemplate", "(", "int", "fromIndex", ",", "int", "toIndex", ")", "{", "LinkedList", "<", "Token", ">", "subTokens", "=", "new", "LinkedList", "<>", "(", ")", ";", "subTokens", ".", "addAll", "(", "this", ".", "tokens", ".", ...
Works like {@link List#subList(int, int)} over the tokens of this template and throws the same exceptions. @param fromIndex low endpoint (inclusive) of the sub template @param toIndex high endpoint (exclusive) of the sub template @return a new address template containing the specified tokens. @throws IndexOutOfBound...
[ "Works", "like", "{", "@link", "List#subList", "(", "int", "int", ")", "}", "over", "the", "tokens", "of", "this", "template", "and", "throws", "the", "same", "exceptions", "." ]
train
https://github.com/hal/core/blob/d6d03f0bb128dc0470f5dc75fdb1ea1014400602/gui/src/main/java/org/jboss/as/console/client/v3/dmr/AddressTemplate.java#L162-L166
deeplearning4j/deeplearning4j
deeplearning4j/deeplearning4j-graph/src/main/java/org/deeplearning4j/graph/data/GraphLoader.java
GraphLoader.loadWeightedEdgeListFile
public static Graph<String, Double> loadWeightedEdgeListFile(String path, int numVertices, String delim, boolean directed, boolean allowMultipleEdges, String... ignoreLinesStartingWith) throws IOException { """ Method for loading a weighted graph from an edge list file, wher...
java
public static Graph<String, Double> loadWeightedEdgeListFile(String path, int numVertices, String delim, boolean directed, boolean allowMultipleEdges, String... ignoreLinesStartingWith) throws IOException { Graph<String, Double> graph = new Graph<>(numVertices, allowMulti...
[ "public", "static", "Graph", "<", "String", ",", "Double", ">", "loadWeightedEdgeListFile", "(", "String", "path", ",", "int", "numVertices", ",", "String", "delim", ",", "boolean", "directed", ",", "boolean", "allowMultipleEdges", ",", "String", "...", "ignoreL...
Method for loading a weighted graph from an edge list file, where each edge (inc. weight) is represented by a single line. Graph may be directed or undirected<br> This method assumes that edges are of the format: {@code fromIndex<delim>toIndex<delim>edgeWeight} where {@code <delim>} is the delimiter. @param path Path t...
[ "Method", "for", "loading", "a", "weighted", "graph", "from", "an", "edge", "list", "file", "where", "each", "edge", "(", "inc", ".", "weight", ")", "is", "represented", "by", "a", "single", "line", ".", "Graph", "may", "be", "directed", "or", "undirecte...
train
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-graph/src/main/java/org/deeplearning4j/graph/data/GraphLoader.java#L117-L134
apache/groovy
subprojects/groovy-ant/src/main/java/groovy/util/AntBuilder.java
AntBuilder.doInvokeMethod
protected Object doInvokeMethod(String methodName, Object name, Object args) { """ We don't want to return the node as created in {@link #createNode(Object, Map, Object)} but the one made ready by {@link #nodeCompleted(Object, Object)} @see groovy.util.BuilderSupport#doInvokeMethod(java.lang.String, java.lang....
java
protected Object doInvokeMethod(String methodName, Object name, Object args) { super.doInvokeMethod(methodName, name, args); // return the completed node return lastCompletedNode; }
[ "protected", "Object", "doInvokeMethod", "(", "String", "methodName", ",", "Object", "name", ",", "Object", "args", ")", "{", "super", ".", "doInvokeMethod", "(", "methodName", ",", "name", ",", "args", ")", ";", "// return the completed node", "return", "lastCo...
We don't want to return the node as created in {@link #createNode(Object, Map, Object)} but the one made ready by {@link #nodeCompleted(Object, Object)} @see groovy.util.BuilderSupport#doInvokeMethod(java.lang.String, java.lang.Object, java.lang.Object)
[ "We", "don", "t", "want", "to", "return", "the", "node", "as", "created", "in", "{", "@link", "#createNode", "(", "Object", "Map", "Object", ")", "}", "but", "the", "one", "made", "ready", "by", "{", "@link", "#nodeCompleted", "(", "Object", "Object", ...
train
https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-ant/src/main/java/groovy/util/AntBuilder.java#L212-L218
kiswanij/jk-util
src/main/java/com/jk/util/JKDateTimeUtil.java
JKDateTimeUtil.getHoursDifference
public static long getHoursDifference(Date startDate, Date endDate) { """ Gets the hours difference. @param startDate the start date @param endDate the end date @return the hours difference """ long startTime = startDate.getTime(); long endTime = endDate.getTime(); long diffTime = endTime - sta...
java
public static long getHoursDifference(Date startDate, Date endDate) { long startTime = startDate.getTime(); long endTime = endDate.getTime(); long diffTime = endTime - startTime; long diffInHours = TimeUnit.MILLISECONDS.toHours(diffTime); return diffInHours; }
[ "public", "static", "long", "getHoursDifference", "(", "Date", "startDate", ",", "Date", "endDate", ")", "{", "long", "startTime", "=", "startDate", ".", "getTime", "(", ")", ";", "long", "endTime", "=", "endDate", ".", "getTime", "(", ")", ";", "long", ...
Gets the hours difference. @param startDate the start date @param endDate the end date @return the hours difference
[ "Gets", "the", "hours", "difference", "." ]
train
https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/JKDateTimeUtil.java#L457-L463
alkacon/opencms-core
src-gwt/org/opencms/gwt/client/ui/input/form/CmsForm.java
CmsForm.defaultHandleKeyPress
protected void defaultHandleKeyPress(I_CmsFormField field, int keyCode) { """ The default keypress event handling function for form fields.<p> @param field the form field for which the event has been fired @param keyCode the key code """ I_CmsFormWidget widget = field.getWidget(); if (ke...
java
protected void defaultHandleKeyPress(I_CmsFormField field, int keyCode) { I_CmsFormWidget widget = field.getWidget(); if (keyCode == KeyCodes.KEY_ENTER) { m_pressedEnter = true; if (widget instanceof I_CmsHasBlur) { // force a blur because not all browsers send a...
[ "protected", "void", "defaultHandleKeyPress", "(", "I_CmsFormField", "field", ",", "int", "keyCode", ")", "{", "I_CmsFormWidget", "widget", "=", "field", ".", "getWidget", "(", ")", ";", "if", "(", "keyCode", "==", "KeyCodes", ".", "KEY_ENTER", ")", "{", "m_...
The default keypress event handling function for form fields.<p> @param field the form field for which the event has been fired @param keyCode the key code
[ "The", "default", "keypress", "event", "handling", "function", "for", "form", "fields", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/ui/input/form/CmsForm.java#L430-L451
square/android-times-square
library/src/main/java/com/squareup/timessquare/CalendarPickerView.java
CalendarPickerView.selectDate
public boolean selectDate(Date date, boolean smoothScroll) { """ Select a new date. Respects the {@link SelectionMode} this CalendarPickerView is configured with: if you are in {@link SelectionMode#SINGLE}, the previously selected date will be un-selected. In {@link SelectionMode#MULTIPLE}, the new date will b...
java
public boolean selectDate(Date date, boolean smoothScroll) { validateDate(date); MonthCellWithMonthIndex monthCellWithMonthIndex = getMonthCellWithIndexByDate(date); if (monthCellWithMonthIndex == null || !isDateSelectable(date)) { return false; } boolean wasSelected = doSelectDate(date, mont...
[ "public", "boolean", "selectDate", "(", "Date", "date", ",", "boolean", "smoothScroll", ")", "{", "validateDate", "(", "date", ")", ";", "MonthCellWithMonthIndex", "monthCellWithMonthIndex", "=", "getMonthCellWithIndexByDate", "(", "date", ")", ";", "if", "(", "mo...
Select a new date. Respects the {@link SelectionMode} this CalendarPickerView is configured with: if you are in {@link SelectionMode#SINGLE}, the previously selected date will be un-selected. In {@link SelectionMode#MULTIPLE}, the new date will be added to the list of selected dates. <p> If the selection was made (se...
[ "Select", "a", "new", "date", ".", "Respects", "the", "{", "@link", "SelectionMode", "}", "this", "CalendarPickerView", "is", "configured", "with", ":", "if", "you", "are", "in", "{", "@link", "SelectionMode#SINGLE", "}", "the", "previously", "selected", "date...
train
https://github.com/square/android-times-square/blob/83b08e7cc220d587845054cd1471a604d17721f6/library/src/main/java/com/squareup/timessquare/CalendarPickerView.java#L618-L630
rhuss/jolokia
agent/core/src/main/java/org/jolokia/handler/JsonRequestHandler.java
JsonRequestHandler.handleRequest
public Object handleRequest(MBeanServerConnection pServer, R pRequest) throws InstanceNotFoundException, AttributeNotFoundException, ReflectionException, MBeanException, IOException, NotChangedException { """ Handle a request for a single server and throw an {@link javax.management.InstanceNotFoundExc...
java
public Object handleRequest(MBeanServerConnection pServer, R pRequest) throws InstanceNotFoundException, AttributeNotFoundException, ReflectionException, MBeanException, IOException, NotChangedException { checkForRestriction(pRequest); checkHttpMethod(pRequest); return doHandleReques...
[ "public", "Object", "handleRequest", "(", "MBeanServerConnection", "pServer", ",", "R", "pRequest", ")", "throws", "InstanceNotFoundException", ",", "AttributeNotFoundException", ",", "ReflectionException", ",", "MBeanException", ",", "IOException", ",", "NotChangedExceptio...
Handle a request for a single server and throw an {@link javax.management.InstanceNotFoundException} if the request cannot be handle by the provided server. Does a check for restrictions as well @param pServer server to try @param pRequest request to process @return the object result from the request @throws Instanc...
[ "Handle", "a", "request", "for", "a", "single", "server", "and", "throw", "an", "{", "@link", "javax", ".", "management", ".", "InstanceNotFoundException", "}", "if", "the", "request", "cannot", "be", "handle", "by", "the", "provided", "server", ".", "Does",...
train
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/handler/JsonRequestHandler.java#L85-L90
aws/aws-sdk-java
aws-java-sdk-elasticbeanstalk/src/main/java/com/amazonaws/services/elasticbeanstalk/model/SystemStatus.java
SystemStatus.getLoadAverage
public java.util.List<Double> getLoadAverage() { """ <p> Load average in the last 1-minute, 5-minute, and 15-minute periods. For more information, see <a href= "https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/health-enhanced-metrics.html#health-enhanced-metrics-os" >Operating System Metrics</a>. </p> ...
java
public java.util.List<Double> getLoadAverage() { if (loadAverage == null) { loadAverage = new com.amazonaws.internal.SdkInternalList<Double>(); } return loadAverage; }
[ "public", "java", ".", "util", ".", "List", "<", "Double", ">", "getLoadAverage", "(", ")", "{", "if", "(", "loadAverage", "==", "null", ")", "{", "loadAverage", "=", "new", "com", ".", "amazonaws", ".", "internal", ".", "SdkInternalList", "<", "Double",...
<p> Load average in the last 1-minute, 5-minute, and 15-minute periods. For more information, see <a href= "https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/health-enhanced-metrics.html#health-enhanced-metrics-os" >Operating System Metrics</a>. </p> @return Load average in the last 1-minute, 5-minute, and 15-min...
[ "<p", ">", "Load", "average", "in", "the", "last", "1", "-", "minute", "5", "-", "minute", "and", "15", "-", "minute", "periods", ".", "For", "more", "information", "see", "<a", "href", "=", "https", ":", "//", "docs", ".", "aws", ".", "amazon", "....
train
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-elasticbeanstalk/src/main/java/com/amazonaws/services/elasticbeanstalk/model/SystemStatus.java#L96-L101
square/okhttp
okhttp/src/main/java/okhttp3/internal/Util.java
Util.delimiterOffset
public static int delimiterOffset(String input, int pos, int limit, String delimiters) { """ Returns the index of the first character in {@code input} that contains a character in {@code delimiters}. Returns limit if there is no such character. """ for (int i = pos; i < limit; i++) { if (delimiters....
java
public static int delimiterOffset(String input, int pos, int limit, String delimiters) { for (int i = pos; i < limit; i++) { if (delimiters.indexOf(input.charAt(i)) != -1) return i; } return limit; }
[ "public", "static", "int", "delimiterOffset", "(", "String", "input", ",", "int", "pos", ",", "int", "limit", ",", "String", "delimiters", ")", "{", "for", "(", "int", "i", "=", "pos", ";", "i", "<", "limit", ";", "i", "++", ")", "{", "if", "(", ...
Returns the index of the first character in {@code input} that contains a character in {@code delimiters}. Returns limit if there is no such character.
[ "Returns", "the", "index", "of", "the", "first", "character", "in", "{" ]
train
https://github.com/square/okhttp/blob/a8c65a822dd6cadd2de7d115bf94adf312e67868/okhttp/src/main/java/okhttp3/internal/Util.java#L343-L348
lets-blade/blade-jdbc
blade-jdbc-core/src/main/java/com/blade/jdbc/core/SqlBuilder.java
SqlBuilder.parseFieldsSql
private static String parseFieldsSql(String tableName, Supplier<ConditionEnum>[] conditions) { """ 解析Model字段 @param tableName 表名 @param conditions 条件 @return 返回sql语句 """ final String[] sql = {"SELECT * FROM " + tableName}; if (null == conditions) { return sql[0]; } ...
java
private static String parseFieldsSql(String tableName, Supplier<ConditionEnum>[] conditions) { final String[] sql = {"SELECT * FROM " + tableName}; if (null == conditions) { return sql[0]; } Stream.of(conditions) .filter(conditionEnumSupplier -> conditionEnumS...
[ "private", "static", "String", "parseFieldsSql", "(", "String", "tableName", ",", "Supplier", "<", "ConditionEnum", ">", "[", "]", "conditions", ")", "{", "final", "String", "[", "]", "sql", "=", "{", "\"SELECT * FROM \"", "+", "tableName", "}", ";", "if", ...
解析Model字段 @param tableName 表名 @param conditions 条件 @return 返回sql语句
[ "解析Model字段" ]
train
https://github.com/lets-blade/blade-jdbc/blob/f9348b6da2eaae5d953bc3cdb49f8fea1cc8b75c/blade-jdbc-core/src/main/java/com/blade/jdbc/core/SqlBuilder.java#L329-L343
samskivert/pythagoras
src/main/java/pythagoras/d/Transforms.java
Transforms.createTransformedShape
public static IShape createTransformedShape (Transform t, IShape src) { """ Creates and returns a new shape that is the supplied shape transformed by this transform's matrix. """ if (src == null) { return null; } if (src instanceof Path) { return ((Path)src).cre...
java
public static IShape createTransformedShape (Transform t, IShape src) { if (src == null) { return null; } if (src instanceof Path) { return ((Path)src).createTransformedShape(t); } PathIterator path = src.pathIterator(t); Path dst = new Path(path.w...
[ "public", "static", "IShape", "createTransformedShape", "(", "Transform", "t", ",", "IShape", "src", ")", "{", "if", "(", "src", "==", "null", ")", "{", "return", "null", ";", "}", "if", "(", "src", "instanceof", "Path", ")", "{", "return", "(", "(", ...
Creates and returns a new shape that is the supplied shape transformed by this transform's matrix.
[ "Creates", "and", "returns", "a", "new", "shape", "that", "is", "the", "supplied", "shape", "transformed", "by", "this", "transform", "s", "matrix", "." ]
train
https://github.com/samskivert/pythagoras/blob/b8fea743ee8a7d742ad9c06ee4f11f50571fbd32/src/main/java/pythagoras/d/Transforms.java#L16-L27
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WProgressBarRenderer.java
WProgressBarRenderer.doRender
@Override public void doRender(final WComponent component, final WebXmlRenderContext renderContext) { """ Paints the given WProgressBar. @param component the WProgressBar to paint. @param renderContext the RenderContext to paint to. """ WProgressBar progressBar = (WProgressBar) component; XmlStringBui...
java
@Override public void doRender(final WComponent component, final WebXmlRenderContext renderContext) { WProgressBar progressBar = (WProgressBar) component; XmlStringBuilder xml = renderContext.getWriter(); xml.appendTagOpen("html:progress"); xml.appendAttribute("id", component.getId()); xml.appendAttribute("...
[ "@", "Override", "public", "void", "doRender", "(", "final", "WComponent", "component", ",", "final", "WebXmlRenderContext", "renderContext", ")", "{", "WProgressBar", "progressBar", "=", "(", "WProgressBar", ")", "component", ";", "XmlStringBuilder", "xml", "=", ...
Paints the given WProgressBar. @param component the WProgressBar to paint. @param renderContext the RenderContext to paint to.
[ "Paints", "the", "given", "WProgressBar", "." ]
train
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WProgressBarRenderer.java#L23-L38
ManfredTremmel/gwt-commons-lang3
src/main/java/org/apache/commons/lang3/StringUtils.java
StringUtils.lastIndexOfIgnoreCase
public static int lastIndexOfIgnoreCase(final CharSequence str, final CharSequence searchStr) { """ <p>Case in-sensitive find of the last index within a CharSequence.</p> <p>A {@code null} CharSequence will return {@code -1}. A negative start position returns {@code -1}. An empty ("") search CharSequence alwa...
java
public static int lastIndexOfIgnoreCase(final CharSequence str, final CharSequence searchStr) { if (str == null || searchStr == null) { return INDEX_NOT_FOUND; } return lastIndexOfIgnoreCase(str, searchStr, str.length()); }
[ "public", "static", "int", "lastIndexOfIgnoreCase", "(", "final", "CharSequence", "str", ",", "final", "CharSequence", "searchStr", ")", "{", "if", "(", "str", "==", "null", "||", "searchStr", "==", "null", ")", "{", "return", "INDEX_NOT_FOUND", ";", "}", "r...
<p>Case in-sensitive find of the last index within a CharSequence.</p> <p>A {@code null} CharSequence will return {@code -1}. A negative start position returns {@code -1}. An empty ("") search CharSequence always matches unless the start position is negative. A start position greater than the string length searches th...
[ "<p", ">", "Case", "in", "-", "sensitive", "find", "of", "the", "last", "index", "within", "a", "CharSequence", ".", "<", "/", "p", ">" ]
train
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/StringUtils.java#L1867-L1872
lettuce-io/lettuce-core
src/main/java/io/lettuce/core/RedisClient.java
RedisClient.connectAsync
public <K, V> ConnectionFuture<StatefulRedisConnection<K, V>> connectAsync(RedisCodec<K, V> codec, RedisURI redisURI) { """ Open asynchronously a new connection to a Redis server using the supplied {@link RedisURI} and the supplied {@link RedisCodec codec} to encode/decode keys. @param codec Use this codec to ...
java
public <K, V> ConnectionFuture<StatefulRedisConnection<K, V>> connectAsync(RedisCodec<K, V> codec, RedisURI redisURI) { assertNotNull(redisURI); return transformAsyncConnectionException(connectStandaloneAsync(codec, redisURI, redisURI.getTimeout())); }
[ "public", "<", "K", ",", "V", ">", "ConnectionFuture", "<", "StatefulRedisConnection", "<", "K", ",", "V", ">", ">", "connectAsync", "(", "RedisCodec", "<", "K", ",", "V", ">", "codec", ",", "RedisURI", "redisURI", ")", "{", "assertNotNull", "(", "redisU...
Open asynchronously a new connection to a Redis server using the supplied {@link RedisURI} and the supplied {@link RedisCodec codec} to encode/decode keys. @param codec Use this codec to encode/decode keys and values, must not be {@literal null} @param redisURI the Redis server to connect to, must not be {@literal nul...
[ "Open", "asynchronously", "a", "new", "connection", "to", "a", "Redis", "server", "using", "the", "supplied", "{", "@link", "RedisURI", "}", "and", "the", "supplied", "{", "@link", "RedisCodec", "codec", "}", "to", "encode", "/", "decode", "keys", "." ]
train
https://github.com/lettuce-io/lettuce-core/blob/b6de74e384dea112e3656684ca3f50cdfd6c8e0d/src/main/java/io/lettuce/core/RedisClient.java#L250-L255
mapbox/mapbox-java
services-turf/src/main/java/com/mapbox/turf/TurfAssertions.java
TurfAssertions.featureOf
public static void featureOf(Feature feature, String type, String name) { """ Enforce expectations about types of {@link Feature} inputs for Turf. Internally this uses {@link Feature#type()} to judge geometry types. @param feature with an expected geometry type @param type type expected GeoJson type @para...
java
public static void featureOf(Feature feature, String type, String name) { if (name == null || name.length() == 0) { throw new TurfException(".featureOf() requires a name"); } if (feature == null || !feature.type().equals("Feature") || feature.geometry() == null) { throw new TurfException(String....
[ "public", "static", "void", "featureOf", "(", "Feature", "feature", ",", "String", "type", ",", "String", "name", ")", "{", "if", "(", "name", "==", "null", "||", "name", ".", "length", "(", ")", "==", "0", ")", "{", "throw", "new", "TurfException", ...
Enforce expectations about types of {@link Feature} inputs for Turf. Internally this uses {@link Feature#type()} to judge geometry types. @param feature with an expected geometry type @param type type expected GeoJson type @param name name of calling function @see <a href="http://turfjs.org/docs/#featureof">Turf...
[ "Enforce", "expectations", "about", "types", "of", "{", "@link", "Feature", "}", "inputs", "for", "Turf", ".", "Internally", "this", "uses", "{", "@link", "Feature#type", "()", "}", "to", "judge", "geometry", "types", "." ]
train
https://github.com/mapbox/mapbox-java/blob/c0be138f462f91441388584c668f3760ba0e18e2/services-turf/src/main/java/com/mapbox/turf/TurfAssertions.java#L64-L76
camunda/camunda-xml-model
src/main/java/org/camunda/bpm/model/xml/impl/util/IoUtil.java
IoUtil.getStringFromInputStream
private static String getStringFromInputStream(InputStream inputStream, boolean trim) throws IOException { """ Convert an {@link InputStream} to a {@link String} @param inputStream the {@link InputStream} to convert @param trim trigger if whitespaces are trimmed in the output @return the resulting {@link Stri...
java
private static String getStringFromInputStream(InputStream inputStream, boolean trim) throws IOException { BufferedReader bufferedReader = null; StringBuilder stringBuilder = new StringBuilder(); try { bufferedReader = new BufferedReader(new InputStreamReader(inputStream)); String line; wh...
[ "private", "static", "String", "getStringFromInputStream", "(", "InputStream", "inputStream", ",", "boolean", "trim", ")", "throws", "IOException", "{", "BufferedReader", "bufferedReader", "=", "null", ";", "StringBuilder", "stringBuilder", "=", "new", "StringBuilder", ...
Convert an {@link InputStream} to a {@link String} @param inputStream the {@link InputStream} to convert @param trim trigger if whitespaces are trimmed in the output @return the resulting {@link String} @throws IOException
[ "Convert", "an", "{", "@link", "InputStream", "}", "to", "a", "{", "@link", "String", "}" ]
train
https://github.com/camunda/camunda-xml-model/blob/85b3f879e26d063f71c94cfd21ac17d9ff6baf4d/src/main/java/org/camunda/bpm/model/xml/impl/util/IoUtil.java#L61-L81
lessthanoptimal/ejml
main/ejml-core/src/org/ejml/data/DMatrixSparseCSC.java
DMatrixSparseCSC.growMaxLength
public void growMaxLength( int arrayLength , boolean preserveValue ) { """ Increases the maximum size of the data array so that it can store sparse data up to 'length'. The class parameter nz_length is not modified by this function call. @param arrayLength Desired maximum length of sparse data @param preserv...
java
public void growMaxLength( int arrayLength , boolean preserveValue ) { if( arrayLength < 0 ) throw new IllegalArgumentException("Negative array length. Overflow?"); // see if multiplying numRows*numCols will cause an overflow. If it won't then pick the smaller of the two if( numRows ...
[ "public", "void", "growMaxLength", "(", "int", "arrayLength", ",", "boolean", "preserveValue", ")", "{", "if", "(", "arrayLength", "<", "0", ")", "throw", "new", "IllegalArgumentException", "(", "\"Negative array length. Overflow?\"", ")", ";", "// see if multiplying ...
Increases the maximum size of the data array so that it can store sparse data up to 'length'. The class parameter nz_length is not modified by this function call. @param arrayLength Desired maximum length of sparse data @param preserveValue If true the old values will be copied into the new arrays. If false that ste...
[ "Increases", "the", "maximum", "size", "of", "the", "data", "array", "so", "that", "it", "can", "store", "sparse", "data", "up", "to", "length", ".", "The", "class", "parameter", "nz_length", "is", "not", "modified", "by", "this", "function", "call", "." ]
train
https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-core/src/org/ejml/data/DMatrixSparseCSC.java#L332-L354
apache/incubator-druid
extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/FixedBucketsHistogram.java
FixedBucketsHistogram.writeByteBufferSparse
public void writeByteBufferSparse(ByteBuffer buf, int nonEmptyBuckets) { """ Helper method for toBytesSparse @param buf Destination buffer @param nonEmptyBuckets Number of non-empty buckets in the histogram """ writeByteBufferSerdeHeader(buf, SPARSE_ENCODING_MODE); writeByteBufferCommonFields(buf);...
java
public void writeByteBufferSparse(ByteBuffer buf, int nonEmptyBuckets) { writeByteBufferSerdeHeader(buf, SPARSE_ENCODING_MODE); writeByteBufferCommonFields(buf); buf.putInt(nonEmptyBuckets); int bucketsWritten = 0; for (int i = 0; i < numBuckets; i++) { if (histogram[i] > 0) { buf.p...
[ "public", "void", "writeByteBufferSparse", "(", "ByteBuffer", "buf", ",", "int", "nonEmptyBuckets", ")", "{", "writeByteBufferSerdeHeader", "(", "buf", ",", "SPARSE_ENCODING_MODE", ")", ";", "writeByteBufferCommonFields", "(", "buf", ")", ";", "buf", ".", "putInt", ...
Helper method for toBytesSparse @param buf Destination buffer @param nonEmptyBuckets Number of non-empty buckets in the histogram
[ "Helper", "method", "for", "toBytesSparse" ]
train
https://github.com/apache/incubator-druid/blob/f776b9408962b9006cfcfe4d6c1794751972cc8e/extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/FixedBucketsHistogram.java#L876-L893
gallandarakhneorg/afc
advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/coordinate/GISCoordinates.java
GISCoordinates.L4_EL2
@Pure public static Point2d L4_EL2(double x, double y) { """ This function convert France Lambert IV coordinate to extended France Lambert II coordinate. @param x is the coordinate in France Lambert IV @param y is the coordinate in France Lambert IV @return the extended France Lambert II coordinate. """...
java
@Pure public static Point2d L4_EL2(double x, double y) { final Point2d ntfLambdaPhi = NTFLambert_NTFLambdaPhi(x, y, LAMBERT_4_N, LAMBERT_4_C, LAMBERT_4_XS, LAMBERT_4_YS); return NTFLambdaPhi_NTFLambert( ntfLambdaPhi.getX(), ntfLambdaPhi.getY(), LAMBERT_2E_N, LAMBERT_2E_C, LAMBERT_2E...
[ "@", "Pure", "public", "static", "Point2d", "L4_EL2", "(", "double", "x", ",", "double", "y", ")", "{", "final", "Point2d", "ntfLambdaPhi", "=", "NTFLambert_NTFLambdaPhi", "(", "x", ",", "y", ",", "LAMBERT_4_N", ",", "LAMBERT_4_C", ",", "LAMBERT_4_XS", ",", ...
This function convert France Lambert IV coordinate to extended France Lambert II coordinate. @param x is the coordinate in France Lambert IV @param y is the coordinate in France Lambert IV @return the extended France Lambert II coordinate.
[ "This", "function", "convert", "France", "Lambert", "IV", "coordinate", "to", "extended", "France", "Lambert", "II", "coordinate", "." ]
train
https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/coordinate/GISCoordinates.java#L691-L704
line/armeria
core/src/main/java/com/linecorp/armeria/client/ClientOptions.java
ClientOptions.of
public static ClientOptions of(ClientOptions baseOptions, Iterable<ClientOptionValue<?>> options) { """ Merges the specified {@link ClientOptions} and {@link ClientOptionValue}s. @return the merged {@link ClientOptions} """ // TODO(trustin): Reduce the cost of creating a derived ClientOptions. ...
java
public static ClientOptions of(ClientOptions baseOptions, Iterable<ClientOptionValue<?>> options) { // TODO(trustin): Reduce the cost of creating a derived ClientOptions. requireNonNull(baseOptions, "baseOptions"); requireNonNull(options, "options"); return new ClientOptions(baseOptions,...
[ "public", "static", "ClientOptions", "of", "(", "ClientOptions", "baseOptions", ",", "Iterable", "<", "ClientOptionValue", "<", "?", ">", ">", "options", ")", "{", "// TODO(trustin): Reduce the cost of creating a derived ClientOptions.", "requireNonNull", "(", "baseOptions"...
Merges the specified {@link ClientOptions} and {@link ClientOptionValue}s. @return the merged {@link ClientOptions}
[ "Merges", "the", "specified", "{", "@link", "ClientOptions", "}", "and", "{", "@link", "ClientOptionValue", "}", "s", "." ]
train
https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/client/ClientOptions.java#L125-L130
Netflix/conductor
client/src/main/java/com/netflix/conductor/client/http/WorkflowClient.java
WorkflowClient.deleteWorkflow
public void deleteWorkflow(String workflowId, boolean archiveWorkflow) { """ Removes a workflow from the system @param workflowId the id of the workflow to be deleted @param archiveWorkflow flag to indicate if the workflow should be archived before deletion """ Preconditions.checkArgument(Stri...
java
public void deleteWorkflow(String workflowId, boolean archiveWorkflow) { Preconditions.checkArgument(StringUtils.isNotBlank(workflowId), "Workflow id cannot be blank"); Object[] params = new Object[]{"archiveWorkflow", archiveWorkflow}; delete(params, "workflow/{workflowId}/remove", workflowId)...
[ "public", "void", "deleteWorkflow", "(", "String", "workflowId", ",", "boolean", "archiveWorkflow", ")", "{", "Preconditions", ".", "checkArgument", "(", "StringUtils", ".", "isNotBlank", "(", "workflowId", ")", ",", "\"Workflow id cannot be blank\"", ")", ";", "Obj...
Removes a workflow from the system @param workflowId the id of the workflow to be deleted @param archiveWorkflow flag to indicate if the workflow should be archived before deletion
[ "Removes", "a", "workflow", "from", "the", "system" ]
train
https://github.com/Netflix/conductor/blob/78fae0ed9ddea22891f9eebb96a2ec0b2783dca0/client/src/main/java/com/netflix/conductor/client/http/WorkflowClient.java#L189-L194
b3dgs/lionengine
lionengine-game/src/main/java/com/b3dgs/lionengine/game/AnimationConfig.java
AnimationConfig.exports
public static void exports(Xml root, Animation animation) { """ Create an XML node from an animation. @param root The node root (must not be <code>null</code>). @param animation The animation reference (must not be <code>null</code>). @throws LionEngineException If error on writing. """ Check.not...
java
public static void exports(Xml root, Animation animation) { Check.notNull(root); Check.notNull(animation); final Xml node = root.createChild(ANIMATION); node.writeString(ANIMATION_NAME, animation.getName()); node.writeInteger(ANIMATION_START, animation.getFirst()); ...
[ "public", "static", "void", "exports", "(", "Xml", "root", ",", "Animation", "animation", ")", "{", "Check", ".", "notNull", "(", "root", ")", ";", "Check", ".", "notNull", "(", "animation", ")", ";", "final", "Xml", "node", "=", "root", ".", "createCh...
Create an XML node from an animation. @param root The node root (must not be <code>null</code>). @param animation The animation reference (must not be <code>null</code>). @throws LionEngineException If error on writing.
[ "Create", "an", "XML", "node", "from", "an", "animation", "." ]
train
https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/AnimationConfig.java#L124-L136
datastax/java-driver
core/src/main/java/com/datastax/oss/driver/internal/core/channel/InFlightHandler.java
InFlightHandler.exceptionCaught
@Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable exception) throws Exception { """ Called if an exception was thrown while processing an inbound event (i.e. a response). """ if (exception instanceof FrameDecodingException) { int streamId = ((FrameDecodingException) excepti...
java
@Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable exception) throws Exception { if (exception instanceof FrameDecodingException) { int streamId = ((FrameDecodingException) exception).streamId; LOG.debug("[{}] Error while decoding response on stream id {}", logPrefix, streamId)...
[ "@", "Override", "public", "void", "exceptionCaught", "(", "ChannelHandlerContext", "ctx", ",", "Throwable", "exception", ")", "throws", "Exception", "{", "if", "(", "exception", "instanceof", "FrameDecodingException", ")", "{", "int", "streamId", "=", "(", "(", ...
Called if an exception was thrown while processing an inbound event (i.e. a response).
[ "Called", "if", "an", "exception", "was", "thrown", "while", "processing", "an", "inbound", "event", "(", "i", ".", "e", ".", "a", "response", ")", "." ]
train
https://github.com/datastax/java-driver/blob/612a63f2525618e2020e86c9ad75ab37adba6132/core/src/main/java/com/datastax/oss/driver/internal/core/channel/InFlightHandler.java#L270-L302
BorderTech/wcomponents
wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/datatable/SelectableDataTableExample.java
SelectableDataTableExample.createTable
private WDataTable createTable() { """ Creates and configures the table to be used by the example. The table is configured with global rather than user data. Although this is not a realistic scenario, it will suffice for this example. @return a new configured table. """ WDataTable table = new WDataTable(...
java
private WDataTable createTable() { WDataTable table = new WDataTable(); table.addColumn(new WTableColumn("First name", new WText())); table.addColumn(new WTableColumn("Last name", new WText())); table.addColumn(new WTableColumn("DOB", new WText())); String[][] data = new String[][]{ new String[]{"Joe", "B...
[ "private", "WDataTable", "createTable", "(", ")", "{", "WDataTable", "table", "=", "new", "WDataTable", "(", ")", ";", "table", ".", "addColumn", "(", "new", "WTableColumn", "(", "\"First name\"", ",", "new", "WText", "(", ")", ")", ")", ";", "table", "....
Creates and configures the table to be used by the example. The table is configured with global rather than user data. Although this is not a realistic scenario, it will suffice for this example. @return a new configured table.
[ "Creates", "and", "configures", "the", "table", "to", "be", "used", "by", "the", "example", ".", "The", "table", "is", "configured", "with", "global", "rather", "than", "user", "data", ".", "Although", "this", "is", "not", "a", "realistic", "scenario", "it...
train
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/datatable/SelectableDataTableExample.java#L76-L91
h2oai/h2o-2
src/main/java/water/api/Models.java
Models.serveOneOrAll
private Response serveOneOrAll(Map<String, Model> modelsMap) { """ Fetch all the Models from the KV store, sumamrize and enhance them, and return a map of them. """ // returns empty sets if !this.find_compatible_frames Pair<Map<String, Frame>, Map<String, Set<String>>> frames_info = fetchFrames(); ...
java
private Response serveOneOrAll(Map<String, Model> modelsMap) { // returns empty sets if !this.find_compatible_frames Pair<Map<String, Frame>, Map<String, Set<String>>> frames_info = fetchFrames(); Map<String, Frame> all_frames = frames_info.getFirst(); Map<String, Set<String>> all_frames_cols = frames_i...
[ "private", "Response", "serveOneOrAll", "(", "Map", "<", "String", ",", "Model", ">", "modelsMap", ")", "{", "// returns empty sets if !this.find_compatible_frames", "Pair", "<", "Map", "<", "String", ",", "Frame", ">", ",", "Map", "<", "String", ",", "Set", "...
Fetch all the Models from the KV store, sumamrize and enhance them, and return a map of them.
[ "Fetch", "all", "the", "Models", "from", "the", "KV", "store", "sumamrize", "and", "enhance", "them", "and", "return", "a", "map", "of", "them", "." ]
train
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/api/Models.java#L386-L415
iipc/openwayback-access-control
oracle/src/main/java/org/archive/accesscontrol/oracle/RulesController.java
RulesController.putRule
public ModelAndView putRule(long id, HttpServletRequest request, HttpServletResponse response) throws IOException { """ PUT /rules/:id Updates the rule with the given id, noting the change in the change log. Optional extra headers: Comment - A comment that will appear in the change log. User - E...
java
public ModelAndView putRule(long id, HttpServletRequest request, HttpServletResponse response) throws IOException { Rule oldRule = ruleDao.getRule(id); if (oldRule == null) { return new ModelAndView( view, "object", new ...
[ "public", "ModelAndView", "putRule", "(", "long", "id", ",", "HttpServletRequest", "request", ",", "HttpServletResponse", "response", ")", "throws", "IOException", "{", "Rule", "oldRule", "=", "ruleDao", ".", "getRule", "(", "id", ")", ";", "if", "(", "oldRule...
PUT /rules/:id Updates the rule with the given id, noting the change in the change log. Optional extra headers: Comment - A comment that will appear in the change log. User - End-user who requested the change. @param id @param request @param response @return @throws IOException
[ "PUT", "/", "rules", "/", ":", "id" ]
train
https://github.com/iipc/openwayback-access-control/blob/4a0f70f200fd8d7b6e313624b7628656d834bf31/oracle/src/main/java/org/archive/accesscontrol/oracle/RulesController.java#L71-L106
micronaut-projects/micronaut-core
core/src/main/java/io/micronaut/core/beans/AbstractBeanIntrospection.java
AbstractBeanIntrospection.indexProperty
@SuppressWarnings("unused") @Internal @UsedByGeneratedCode protected final void indexProperty(@Nonnull Class<? extends Annotation> annotationType, @Nonnull String propertyName) { """ Used to produce an index for particular annotation type. Method referenced by generated byte code and not for public co...
java
@SuppressWarnings("unused") @Internal @UsedByGeneratedCode protected final void indexProperty(@Nonnull Class<? extends Annotation> annotationType, @Nonnull String propertyName) { ArgumentUtils.requireNonNull("annotationType", annotationType); if (StringUtils.isNotEmpty(propertyName)) { ...
[ "@", "SuppressWarnings", "(", "\"unused\"", ")", "@", "Internal", "@", "UsedByGeneratedCode", "protected", "final", "void", "indexProperty", "(", "@", "Nonnull", "Class", "<", "?", "extends", "Annotation", ">", "annotationType", ",", "@", "Nonnull", "String", "p...
Used to produce an index for particular annotation type. Method referenced by generated byte code and not for public consumption. Should be called after {@link #addProperty(BeanProperty)} if required. @param annotationType The annotation type @param propertyName The property name
[ "Used", "to", "produce", "an", "index", "for", "particular", "annotation", "type", ".", "Method", "referenced", "by", "generated", "byte", "code", "and", "not", "for", "public", "consumption", ".", "Should", "be", "called", "after", "{", "@link", "#addProperty...
train
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/core/src/main/java/io/micronaut/core/beans/AbstractBeanIntrospection.java#L177-L194
apache/incubator-gobblin
gobblin-utility/src/main/java/org/apache/gobblin/util/DatasetFilterUtils.java
DatasetFilterUtils.stringInPatterns
public static boolean stringInPatterns(String s, List<Pattern> patterns) { """ Determines whether a string matches one of the regex patterns. """ for (Pattern pattern : patterns) { if (pattern.matcher(s).matches()) { return true; } } return false; }
java
public static boolean stringInPatterns(String s, List<Pattern> patterns) { for (Pattern pattern : patterns) { if (pattern.matcher(s).matches()) { return true; } } return false; }
[ "public", "static", "boolean", "stringInPatterns", "(", "String", "s", ",", "List", "<", "Pattern", ">", "patterns", ")", "{", "for", "(", "Pattern", "pattern", ":", "patterns", ")", "{", "if", "(", "pattern", ".", "matcher", "(", "s", ")", ".", "match...
Determines whether a string matches one of the regex patterns.
[ "Determines", "whether", "a", "string", "matches", "one", "of", "the", "regex", "patterns", "." ]
train
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/DatasetFilterUtils.java#L92-L99
primefaces/primefaces
src/main/java/org/primefaces/expression/SearchExpressionFacade.java
SearchExpressionFacade.resolveComponents
public static List<UIComponent> resolveComponents(FacesContext context, UIComponent source, String expressions) { """ Resolves a list of {@link UIComponent}s for the given expression or expressions. @param context The {@link FacesContext}. @param source The source component. E.g. a button. @param expressions ...
java
public static List<UIComponent> resolveComponents(FacesContext context, UIComponent source, String expressions) { return resolveComponents(context, source, expressions, SearchExpressionHint.NONE); }
[ "public", "static", "List", "<", "UIComponent", ">", "resolveComponents", "(", "FacesContext", "context", ",", "UIComponent", "source", ",", "String", "expressions", ")", "{", "return", "resolveComponents", "(", "context", ",", "source", ",", "expressions", ",", ...
Resolves a list of {@link UIComponent}s for the given expression or expressions. @param context The {@link FacesContext}. @param source The source component. E.g. a button. @param expressions The search expressions. @return A {@link List} with resolved {@link UIComponent}s.
[ "Resolves", "a", "list", "of", "{", "@link", "UIComponent", "}", "s", "for", "the", "given", "expression", "or", "expressions", "." ]
train
https://github.com/primefaces/primefaces/blob/b8cdd5ed395d09826e40e3302d6b14901d3ef4e7/src/main/java/org/primefaces/expression/SearchExpressionFacade.java#L65-L67
eFaps/eFaps-Kernel
src/main/java/org/efaps/db/wrapper/SQLSelect.java
SQLSelect.addColumnPart
public SQLSelect addColumnPart(final Integer _tableIndex, final String _columnName) { """ Add a column as part. @param _tableIndex index of the table @param _columnName name of the column @return this """ parts.add(new Column(tablePrefix, _tableIndex, _columnName))...
java
public SQLSelect addColumnPart(final Integer _tableIndex, final String _columnName) { parts.add(new Column(tablePrefix, _tableIndex, _columnName)); return this; }
[ "public", "SQLSelect", "addColumnPart", "(", "final", "Integer", "_tableIndex", ",", "final", "String", "_columnName", ")", "{", "parts", ".", "add", "(", "new", "Column", "(", "tablePrefix", ",", "_tableIndex", ",", "_columnName", ")", ")", ";", "return", "...
Add a column as part. @param _tableIndex index of the table @param _columnName name of the column @return this
[ "Add", "a", "column", "as", "part", "." ]
train
https://github.com/eFaps/eFaps-Kernel/blob/04b96548f518c2386a93f5ec2b9349f9b9063859/src/main/java/org/efaps/db/wrapper/SQLSelect.java#L392-L397
exoplatform/jcr
exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/JcrQueryParser.java
JcrQueryParser.getSynonymQuery
protected Query getSynonymQuery(String field, String termStr, boolean quoted) throws ParseException { """ Factory method for generating a synonym query. Called when parser parses an input term token that has the synonym prefix (~term) prepended. @param field Name of the field query will use. @param termStr T...
java
protected Query getSynonymQuery(String field, String termStr, boolean quoted) throws ParseException { List<BooleanClause> synonyms = new ArrayList<BooleanClause>(); synonyms.add(new BooleanClause(getFieldQuery(field, termStr, quoted), BooleanClause.Occur.SHOULD)); if (synonymProvider != null) ...
[ "protected", "Query", "getSynonymQuery", "(", "String", "field", ",", "String", "termStr", ",", "boolean", "quoted", ")", "throws", "ParseException", "{", "List", "<", "BooleanClause", ">", "synonyms", "=", "new", "ArrayList", "<", "BooleanClause", ">", "(", "...
Factory method for generating a synonym query. Called when parser parses an input term token that has the synonym prefix (~term) prepended. @param field Name of the field query will use. @param termStr Term token to use for building term for the query @return Resulting {@link Query} built for the term @exception Pars...
[ "Factory", "method", "for", "generating", "a", "synonym", "query", ".", "Called", "when", "parser", "parses", "an", "input", "term", "token", "that", "has", "the", "synonym", "prefix", "(", "~term", ")", "prepended", "." ]
train
https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/JcrQueryParser.java#L124-L144
alkacon/opencms-core
src-gwt/org/opencms/acacia/client/widgets/CmsDependentSelectWidget.java
CmsDependentSelectWidget.replaceOptions
private void replaceOptions(LinkedHashMap<String, String> options) { """ Replaces the select options with the given options.<p> @param options the map of select options (keys are option values, values are option descriptions) """ String oldValue = m_selectBox.getFormValueAsString(); for (St...
java
private void replaceOptions(LinkedHashMap<String, String> options) { String oldValue = m_selectBox.getFormValueAsString(); for (String additionalValue : new String[] {oldValue, m_externalValue}) { if (!options.containsKey(additionalValue)) { options.put(additionalValue, addi...
[ "private", "void", "replaceOptions", "(", "LinkedHashMap", "<", "String", ",", "String", ">", "options", ")", "{", "String", "oldValue", "=", "m_selectBox", ".", "getFormValueAsString", "(", ")", ";", "for", "(", "String", "additionalValue", ":", "new", "Strin...
Replaces the select options with the given options.<p> @param options the map of select options (keys are option values, values are option descriptions)
[ "Replaces", "the", "select", "options", "with", "the", "given", "options", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/acacia/client/widgets/CmsDependentSelectWidget.java#L289-L305
google/closure-compiler
src/com/google/javascript/rhino/jstype/TemplateTypeMap.java
TemplateTypeMap.checkEquivalenceHelper
public boolean checkEquivalenceHelper( TemplateTypeMap that, EquivalenceMethod eqMethod, SubtypingMode subtypingMode) { """ Determines if this map and the specified map have equivalent template types. """ return checkEquivalenceHelper(that, eqMethod, EqCache.create(), subtypingMode); }
java
public boolean checkEquivalenceHelper( TemplateTypeMap that, EquivalenceMethod eqMethod, SubtypingMode subtypingMode) { return checkEquivalenceHelper(that, eqMethod, EqCache.create(), subtypingMode); }
[ "public", "boolean", "checkEquivalenceHelper", "(", "TemplateTypeMap", "that", ",", "EquivalenceMethod", "eqMethod", ",", "SubtypingMode", "subtypingMode", ")", "{", "return", "checkEquivalenceHelper", "(", "that", ",", "eqMethod", ",", "EqCache", ".", "create", "(", ...
Determines if this map and the specified map have equivalent template types.
[ "Determines", "if", "this", "map", "and", "the", "specified", "map", "have", "equivalent", "template", "types", "." ]
train
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/rhino/jstype/TemplateTypeMap.java#L220-L223
UrielCh/ovh-java-sdk
ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java
ApiOvhTelephony.billingAccount_service_serviceName_previousVoiceConsumption_consumptionId_GET
public OvhPreviousVoiceConsumption billingAccount_service_serviceName_previousVoiceConsumption_consumptionId_GET(String billingAccount, String serviceName, Long consumptionId) throws IOException { """ Get this object properties REST: GET /telephony/{billingAccount}/service/{serviceName}/previousVoiceConsumption...
java
public OvhPreviousVoiceConsumption billingAccount_service_serviceName_previousVoiceConsumption_consumptionId_GET(String billingAccount, String serviceName, Long consumptionId) throws IOException { String qPath = "/telephony/{billingAccount}/service/{serviceName}/previousVoiceConsumption/{consumptionId}"; StringBuil...
[ "public", "OvhPreviousVoiceConsumption", "billingAccount_service_serviceName_previousVoiceConsumption_consumptionId_GET", "(", "String", "billingAccount", ",", "String", "serviceName", ",", "Long", "consumptionId", ")", "throws", "IOException", "{", "String", "qPath", "=", "\"/...
Get this object properties REST: GET /telephony/{billingAccount}/service/{serviceName}/previousVoiceConsumption/{consumptionId} @param billingAccount [required] The name of your billingAccount @param serviceName [required] @param consumptionId [required]
[ "Get", "this", "object", "properties" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L3844-L3849
twilio/twilio-java
src/main/java/com/twilio/example/ValidationExample.java
ValidationExample.main
public static void main(String[] args) throws Exception { """ Example Twilio usage. @param args command line args @throws TwiMLException if unable to generate TwiML """ // Generate public/private key pair KeyPairGenerator keyGen = KeyPairGenerator.getInstance("RSA"); keyGen.initial...
java
public static void main(String[] args) throws Exception { // Generate public/private key pair KeyPairGenerator keyGen = KeyPairGenerator.getInstance("RSA"); keyGen.initialize(2048); KeyPair pair = keyGen.generateKeyPair(); java.security.PublicKey pk = pair.getPublic(); ...
[ "public", "static", "void", "main", "(", "String", "[", "]", "args", ")", "throws", "Exception", "{", "// Generate public/private key pair", "KeyPairGenerator", "keyGen", "=", "KeyPairGenerator", ".", "getInstance", "(", "\"RSA\"", ")", ";", "keyGen", ".", "initia...
Example Twilio usage. @param args command line args @throws TwiMLException if unable to generate TwiML
[ "Example", "Twilio", "usage", "." ]
train
https://github.com/twilio/twilio-java/blob/0318974c0a6a152994af167d430255684d5e9b9f/src/main/java/com/twilio/example/ValidationExample.java#L27-L65
codeprimate-software/cp-elements
src/main/java/org/cp/elements/lang/Assert.java
Assert.isNotAssignableTo
@NullSafe private static boolean isNotAssignableTo(Class<?> from, Class<?> to) { """ Determines whether the {@link Class 'from' class type} is assignable to the {@link Class 'to' class type}. @param from {@link Class class type} being evaluated for assignment compatibility with the {@link Class 'to' class ty...
java
@NullSafe private static boolean isNotAssignableTo(Class<?> from, Class<?> to) { return to == null || (from != null && !to.isAssignableFrom(from)); }
[ "@", "NullSafe", "private", "static", "boolean", "isNotAssignableTo", "(", "Class", "<", "?", ">", "from", ",", "Class", "<", "?", ">", "to", ")", "{", "return", "to", "==", "null", "||", "(", "from", "!=", "null", "&&", "!", "to", ".", "isAssignable...
Determines whether the {@link Class 'from' class type} is assignable to the {@link Class 'to' class type}. @param from {@link Class class type} being evaluated for assignment compatibility with the {@link Class 'to' class type}. @param to {@link Class class type} used to determine if the {@link Class 'from' class type...
[ "Determines", "whether", "the", "{", "@link", "Class", "from", "class", "type", "}", "is", "assignable", "to", "the", "{", "@link", "Class", "to", "class", "type", "}", "." ]
train
https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/lang/Assert.java#L601-L604
moparisthebest/beehive
beehive-netui-compiler/src/main/java/org/apache/beehive/netui/compiler/model/XmlElementSupport.java
XmlElementSupport.getElementAttribute
protected String getElementAttribute(Element element, String attrName) { """ Gets the attribute value, or <code>null</code> (unlike <code>Element.getAttribute</code>). """ Attr attr = element.getAttributeNode(attrName); return attr != null ? attr.getValue() : null; }
java
protected String getElementAttribute(Element element, String attrName) { Attr attr = element.getAttributeNode(attrName); return attr != null ? attr.getValue() : null; }
[ "protected", "String", "getElementAttribute", "(", "Element", "element", ",", "String", "attrName", ")", "{", "Attr", "attr", "=", "element", ".", "getAttributeNode", "(", "attrName", ")", ";", "return", "attr", "!=", "null", "?", "attr", ".", "getValue", "(...
Gets the attribute value, or <code>null</code> (unlike <code>Element.getAttribute</code>).
[ "Gets", "the", "attribute", "value", "or", "<code", ">", "null<", "/", "code", ">", "(", "unlike", "<code", ">", "Element", ".", "getAttribute<", "/", "code", ">", ")", "." ]
train
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-compiler/src/main/java/org/apache/beehive/netui/compiler/model/XmlElementSupport.java#L80-L84
Carbonado/Carbonado
src/main/java/com/amazon/carbonado/raw/DataDecoder.java
DataDecoder.decodeIntegerObj
public static Integer decodeIntegerObj(byte[] src, int srcOffset) throws CorruptEncodingException { """ Decodes a signed Integer object from exactly 1 or 5 bytes. If null is returned, then 1 byte was read. @param src source of encoded bytes @param srcOffset offset into source array @return signed In...
java
public static Integer decodeIntegerObj(byte[] src, int srcOffset) throws CorruptEncodingException { try { int b = src[srcOffset]; if (b == NULL_BYTE_HIGH || b == NULL_BYTE_LOW) { return null; } return decodeInt(src, srcOffset + ...
[ "public", "static", "Integer", "decodeIntegerObj", "(", "byte", "[", "]", "src", ",", "int", "srcOffset", ")", "throws", "CorruptEncodingException", "{", "try", "{", "int", "b", "=", "src", "[", "srcOffset", "]", ";", "if", "(", "b", "==", "NULL_BYTE_HIGH"...
Decodes a signed Integer object from exactly 1 or 5 bytes. If null is returned, then 1 byte was read. @param src source of encoded bytes @param srcOffset offset into source array @return signed Integer object or null
[ "Decodes", "a", "signed", "Integer", "object", "from", "exactly", "1", "or", "5", "bytes", ".", "If", "null", "is", "returned", "then", "1", "byte", "was", "read", "." ]
train
https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/raw/DataDecoder.java#L67-L79
facebookarchive/hadoop-20
src/contrib/highavailability/src/java/org/apache/hadoop/hdfs/AvatarShell.java
AvatarShell.isServiceSpecified
public static boolean isServiceSpecified(String command, Configuration conf, String[] argv) { """ Checks if the service argument is specified in the command arguments. """ if (conf.get(FSConstants.DFS_FEDERATION_NAMESERVICES) != null) { for (int i = 0; i < argv.length; i++) { if (argv[i...
java
public static boolean isServiceSpecified(String command, Configuration conf, String[] argv) { if (conf.get(FSConstants.DFS_FEDERATION_NAMESERVICES) != null) { for (int i = 0; i < argv.length; i++) { if (argv[i].equals("-service")) { // found service specs return true; ...
[ "public", "static", "boolean", "isServiceSpecified", "(", "String", "command", ",", "Configuration", "conf", ",", "String", "[", "]", "argv", ")", "{", "if", "(", "conf", ".", "get", "(", "FSConstants", ".", "DFS_FEDERATION_NAMESERVICES", ")", "!=", "null", ...
Checks if the service argument is specified in the command arguments.
[ "Checks", "if", "the", "service", "argument", "is", "specified", "in", "the", "command", "arguments", "." ]
train
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/highavailability/src/java/org/apache/hadoop/hdfs/AvatarShell.java#L712-L726
sporniket/core
sporniket-core-ml/src/main/java/com/sporniket/libre/lang/xml/XmlStringTools.java
XmlStringTools.getClosingTag
public static String getClosingTag(String tag) { """ Create a string containing a closing tag. @param tag the closing tag to generate. @return the closing tag. """ StringBuffer _result = new StringBuffer(); return doAppendClosingTag(_result, tag).toString(); }
java
public static String getClosingTag(String tag) { StringBuffer _result = new StringBuffer(); return doAppendClosingTag(_result, tag).toString(); }
[ "public", "static", "String", "getClosingTag", "(", "String", "tag", ")", "{", "StringBuffer", "_result", "=", "new", "StringBuffer", "(", ")", ";", "return", "doAppendClosingTag", "(", "_result", ",", "tag", ")", ".", "toString", "(", ")", ";", "}" ]
Create a string containing a closing tag. @param tag the closing tag to generate. @return the closing tag.
[ "Create", "a", "string", "containing", "a", "closing", "tag", "." ]
train
https://github.com/sporniket/core/blob/3480ebd72a07422fcc09971be2607ee25efb2c26/sporniket-core-ml/src/main/java/com/sporniket/libre/lang/xml/XmlStringTools.java#L553-L557
JOML-CI/JOML
src/org/joml/Matrix4f.java
Matrix4f.billboardCylindrical
public Matrix4f billboardCylindrical(Vector3fc objPos, Vector3fc targetPos, Vector3fc up) { """ Set this matrix to a cylindrical billboard transformation that rotates the local +Z axis of a given object with position <code>objPos</code> towards a target position at <code>targetPos</code> while constraining a cyli...
java
public Matrix4f billboardCylindrical(Vector3fc objPos, Vector3fc targetPos, Vector3fc up) { float dirX = targetPos.x() - objPos.x(); float dirY = targetPos.y() - objPos.y(); float dirZ = targetPos.z() - objPos.z(); // left = up x dir float leftX = up.y() * dirZ - up.z() * dirY; ...
[ "public", "Matrix4f", "billboardCylindrical", "(", "Vector3fc", "objPos", ",", "Vector3fc", "targetPos", ",", "Vector3fc", "up", ")", "{", "float", "dirX", "=", "targetPos", ".", "x", "(", ")", "-", "objPos", ".", "x", "(", ")", ";", "float", "dirY", "="...
Set this matrix to a cylindrical billboard transformation that rotates the local +Z axis of a given object with position <code>objPos</code> towards a target position at <code>targetPos</code> while constraining a cylindrical rotation around the given <code>up</code> vector. <p> This method can be used to create the co...
[ "Set", "this", "matrix", "to", "a", "cylindrical", "billboard", "transformation", "that", "rotates", "the", "local", "+", "Z", "axis", "of", "a", "given", "object", "with", "position", "<code", ">", "objPos<", "/", "code", ">", "towards", "a", "target", "p...
train
https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4f.java#L13277-L13319
kiswanij/jk-util
src/main/java/com/jk/util/JKHttpUtil.java
JKHttpUtil.readUrlAsObject
public static <T> T readUrlAsObject(String url, Class<T> type) { """ Read the given url contents, and try to create an object from the given type. @param <T> the generic type @param url the url @param type the type @return the t """ String contents = getUrlContents(url); ObjectMapper mapper = n...
java
public static <T> T readUrlAsObject(String url, Class<T> type) { String contents = getUrlContents(url); ObjectMapper mapper = new ObjectMapper(); mapper.enableDefaultTyping(); try { return mapper.readValue(contents, type); } catch (IOException e) { JK.throww(e); return null; } }
[ "public", "static", "<", "T", ">", "T", "readUrlAsObject", "(", "String", "url", ",", "Class", "<", "T", ">", "type", ")", "{", "String", "contents", "=", "getUrlContents", "(", "url", ")", ";", "ObjectMapper", "mapper", "=", "new", "ObjectMapper", "(", ...
Read the given url contents, and try to create an object from the given type. @param <T> the generic type @param url the url @param type the type @return the t
[ "Read", "the", "given", "url", "contents", "and", "try", "to", "create", "an", "object", "from", "the", "given", "type", "." ]
train
https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/JKHttpUtil.java#L221-L232
prestodb/presto-hive-apache
src/main/java/org/apache/hive/hcatalog/data/JsonSerDe.java
JsonSerDe.serialize
@Override public Writable serialize(Object obj, ObjectInspector objInspector) throws SerDeException { """ Given an object and object inspector pair, traverse the object and generate a Text representation of the object. """ StringBuilder sb = new StringBuilder(); try { StructObjectInspecto...
java
@Override public Writable serialize(Object obj, ObjectInspector objInspector) throws SerDeException { StringBuilder sb = new StringBuilder(); try { StructObjectInspector soi = (StructObjectInspector) objInspector; List<? extends StructField> structFields = soi.getAllStructFieldRefs(); a...
[ "@", "Override", "public", "Writable", "serialize", "(", "Object", "obj", ",", "ObjectInspector", "objInspector", ")", "throws", "SerDeException", "{", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", ")", ";", "try", "{", "StructObjectInspector", "soi", ...
Given an object and object inspector pair, traverse the object and generate a Text representation of the object.
[ "Given", "an", "object", "and", "object", "inspector", "pair", "traverse", "the", "object", "and", "generate", "a", "Text", "representation", "of", "the", "object", "." ]
train
https://github.com/prestodb/presto-hive-apache/blob/000f51d04c520f2096faffbc6733e51e19a4ddcc/src/main/java/org/apache/hive/hcatalog/data/JsonSerDe.java#L423-L453
beders/Resty
src/main/java/us/monoid/web/Resty.java
Resty.ignoreAllCerts
public static void ignoreAllCerts() { """ Defines the HttpsURLConnection's default SSLSocketFactory and HostnameVerifier so that all subsequence HttpsURLConnection instances will trusts all certificates and accept all certificate hostnames. <p/> WARNING: Using this is dangerous as it bypasses most of what ssl c...
java
public static void ignoreAllCerts() { try { HttpsURLConnection.setDefaultSSLSocketFactory(TrustAllX509SocketFactory.getSSLSocketFactory()); HttpsURLConnection.setDefaultHostnameVerifier(AllowAllHostnameVerifier.ALLOW_ALL_HOSTNAMES); } catch (Exception e) { throw new R...
[ "public", "static", "void", "ignoreAllCerts", "(", ")", "{", "try", "{", "HttpsURLConnection", ".", "setDefaultSSLSocketFactory", "(", "TrustAllX509SocketFactory", ".", "getSSLSocketFactory", "(", ")", ")", ";", "HttpsURLConnection", ".", "setDefaultHostnameVerifier", "...
Defines the HttpsURLConnection's default SSLSocketFactory and HostnameVerifier so that all subsequence HttpsURLConnection instances will trusts all certificates and accept all certificate hostnames. <p/> WARNING: Using this is dangerous as it bypasses most of what ssl certificates are made for. However, self-signed cer...
[ "Defines", "the", "HttpsURLConnection", "s", "default", "SSLSocketFactory", "and", "HostnameVerifier", "so", "that", "all", "subsequence", "HttpsURLConnection", "instances", "will", "trusts", "all", "certificates", "and", "accept", "all", "certificate", "hostnames", "."...
train
https://github.com/beders/Resty/blob/4493603e9689c942cc3e53b9c5018010e414a364/src/main/java/us/monoid/web/Resty.java#L662-L669
Impetus/Kundera
src/jpa-engine/core/src/main/java/com/impetus/kundera/metadata/processor/relation/RelationMetadataProcessorFactory.java
RelationMetadataProcessorFactory.getRelationMetadataProcessor
public static RelationMetadataProcessor getRelationMetadataProcessor(Field relationField, KunderaMetadata kunderaMetadata) { """ Gets the relation metadata processor. @param relationField the relation field @return the relation metadata processor """ RelationMetadataProcessor relProcessor = null; ...
java
public static RelationMetadataProcessor getRelationMetadataProcessor(Field relationField, KunderaMetadata kunderaMetadata) { RelationMetadataProcessor relProcessor = null; // OneToOne if (relationField.isAnnotationPresent(OneToOne.class)) { relProcessor = new OneToOneRel...
[ "public", "static", "RelationMetadataProcessor", "getRelationMetadataProcessor", "(", "Field", "relationField", ",", "KunderaMetadata", "kunderaMetadata", ")", "{", "RelationMetadataProcessor", "relProcessor", "=", "null", ";", "// OneToOne", "if", "(", "relationField", "."...
Gets the relation metadata processor. @param relationField the relation field @return the relation metadata processor
[ "Gets", "the", "relation", "metadata", "processor", "." ]
train
https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/jpa-engine/core/src/main/java/com/impetus/kundera/metadata/processor/relation/RelationMetadataProcessorFactory.java#L42-L75
evernote/android-state
library/src/main/java/com/evernote/android/state/StateSaver.java
StateSaver.restoreInstanceState
public static <T> void restoreInstanceState(@NonNull T target, @Nullable Bundle state) { """ Restore the given {@code target} from the passed in {@link Bundle}. @param target The object containing fields annotated with {@link State}. @param state The object is being restored from this bundle. Nothing is resto...
java
public static <T> void restoreInstanceState(@NonNull T target, @Nullable Bundle state) { IMPL.restoreInstanceState(target, state); }
[ "public", "static", "<", "T", ">", "void", "restoreInstanceState", "(", "@", "NonNull", "T", "target", ",", "@", "Nullable", "Bundle", "state", ")", "{", "IMPL", ".", "restoreInstanceState", "(", "target", ",", "state", ")", ";", "}" ]
Restore the given {@code target} from the passed in {@link Bundle}. @param target The object containing fields annotated with {@link State}. @param state The object is being restored from this bundle. Nothing is restored if the argument is {@code null}.
[ "Restore", "the", "given", "{", "@code", "target", "}", "from", "the", "passed", "in", "{", "@link", "Bundle", "}", "." ]
train
https://github.com/evernote/android-state/blob/6d56c0c5709f330324ec23d39c3f70c9d59bf6d3/library/src/main/java/com/evernote/android/state/StateSaver.java#L51-L53
codeprimate-software/cp-elements
src/main/java/org/cp/elements/lang/Assert.java
Assert.areNotComparable
@NullSafe private static <T extends Comparable<T>> boolean areNotComparable(T obj1, T obj2) { """ Evaluates the given {@link Comparable Comparable objects} to determine whether they are equal by comparison. @param <T> {@link Comparable Comparable class type} of the given {@link Object objects}. @param obj1 {...
java
@NullSafe private static <T extends Comparable<T>> boolean areNotComparable(T obj1, T obj2) { return obj1 == null || obj2 == null || obj1.compareTo(obj2) != 0; }
[ "@", "NullSafe", "private", "static", "<", "T", "extends", "Comparable", "<", "T", ">", ">", "boolean", "areNotComparable", "(", "T", "obj1", ",", "T", "obj2", ")", "{", "return", "obj1", "==", "null", "||", "obj2", "==", "null", "||", "obj1", ".", "...
Evaluates the given {@link Comparable Comparable objects} to determine whether they are equal by comparison. @param <T> {@link Comparable Comparable class type} of the given {@link Object objects}. @param obj1 {@link Object} to compare for equality with {@link Object object 2}. @param obj2 {@link Object} to compare fo...
[ "Evaluates", "the", "given", "{", "@link", "Comparable", "Comparable", "objects", "}", "to", "determine", "whether", "they", "are", "equal", "by", "comparison", "." ]
train
https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/lang/Assert.java#L240-L243
goldmansachs/gs-collections
collections/src/main/java/com/gs/collections/impl/utility/StringIterate.java
StringIterate.detectChar
public static Character detectChar(String string, CharPredicate predicate) { """ Find the first element that returns true for the specified {@code predicate}. @since 7.0 """ int size = string.length(); for (int i = 0; i < size; i++) { char character = string.charAt(i); ...
java
public static Character detectChar(String string, CharPredicate predicate) { int size = string.length(); for (int i = 0; i < size; i++) { char character = string.charAt(i); if (predicate.accept(character)) { return character; } ...
[ "public", "static", "Character", "detectChar", "(", "String", "string", ",", "CharPredicate", "predicate", ")", "{", "int", "size", "=", "string", ".", "length", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "size", ";", "i", "++", ...
Find the first element that returns true for the specified {@code predicate}. @since 7.0
[ "Find", "the", "first", "element", "that", "returns", "true", "for", "the", "specified", "{", "@code", "predicate", "}", "." ]
train
https://github.com/goldmansachs/gs-collections/blob/fa8bf3e103689efa18bca2ab70203e71cde34b52/collections/src/main/java/com/gs/collections/impl/utility/StringIterate.java#L662-L674
jmeetsma/Iglu-Util
src/main/java/org/ijsberg/iglu/util/io/FileSupport.java
FileSupport.deleteContentsInDirectoryTree
public static void deleteContentsInDirectoryTree(File root, String includeMask) { """ Deletes from a directory all files and subdirectories targeted by a given mask. The method will recurse into subdirectories. @param root @param includeMask """ Collection<File> files = getContentsInDirectoryTree(root, ...
java
public static void deleteContentsInDirectoryTree(File root, String includeMask) { Collection<File> files = getContentsInDirectoryTree(root, includeMask, true, true); for(File file : files) { if (file.exists()) {//file may meanwhile have been deleted if (file.isDirectory()) { //empty directory empty...
[ "public", "static", "void", "deleteContentsInDirectoryTree", "(", "File", "root", ",", "String", "includeMask", ")", "{", "Collection", "<", "File", ">", "files", "=", "getContentsInDirectoryTree", "(", "root", ",", "includeMask", ",", "true", ",", "true", ")", ...
Deletes from a directory all files and subdirectories targeted by a given mask. The method will recurse into subdirectories. @param root @param includeMask
[ "Deletes", "from", "a", "directory", "all", "files", "and", "subdirectories", "targeted", "by", "a", "given", "mask", ".", "The", "method", "will", "recurse", "into", "subdirectories", "." ]
train
https://github.com/jmeetsma/Iglu-Util/blob/971eb022115247b1e34dc26dd02e7e621e29e910/src/main/java/org/ijsberg/iglu/util/io/FileSupport.java#L649-L660
LGoodDatePicker/LGoodDatePicker
Project/src/main/java/com/github/lgooddatepicker/demo/TableEditorsDemo.java
TableEditorsDemo.createAndShowTableDemoFrame
public static void createAndShowTableDemoFrame() { """ createAndShowTableDemoFrame, This creates and displays a frame with the table demo. """ // Create and set up the frame and the table demo panel. JFrame frame = new JFrame("LGoodDatePicker Table Editors Demo " + InternalUtili...
java
public static void createAndShowTableDemoFrame() { // Create and set up the frame and the table demo panel. JFrame frame = new JFrame("LGoodDatePicker Table Editors Demo " + InternalUtilities.getProjectVersionString()); frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); ...
[ "public", "static", "void", "createAndShowTableDemoFrame", "(", ")", "{", "// Create and set up the frame and the table demo panel.", "JFrame", "frame", "=", "new", "JFrame", "(", "\"LGoodDatePicker Table Editors Demo \"", "+", "InternalUtilities", ".", "getProjectVersionString",...
createAndShowTableDemoFrame, This creates and displays a frame with the table demo.
[ "createAndShowTableDemoFrame", "This", "creates", "and", "displays", "a", "frame", "with", "the", "table", "demo", "." ]
train
https://github.com/LGoodDatePicker/LGoodDatePicker/blob/c7df05a5fe382e1e08a6237e9391d8dc5fd48692/Project/src/main/java/com/github/lgooddatepicker/demo/TableEditorsDemo.java#L104-L118
google/error-prone-javac
src/jdk.jdeps/share/classes/com/sun/tools/jdeps/Module.java
Module.toNormalModule
public Module toNormalModule(Map<String, Boolean> requires) { """ Converts this module to a normal module with the given dependences @throws IllegalArgumentException if this module is not an automatic module """ if (!isAutomatic()) { throw new IllegalArgumentException(name() + " not an a...
java
public Module toNormalModule(Map<String, Boolean> requires) { if (!isAutomatic()) { throw new IllegalArgumentException(name() + " not an automatic module"); } return new NormalModule(this, requires); }
[ "public", "Module", "toNormalModule", "(", "Map", "<", "String", ",", "Boolean", ">", "requires", ")", "{", "if", "(", "!", "isAutomatic", "(", ")", ")", "{", "throw", "new", "IllegalArgumentException", "(", "name", "(", ")", "+", "\" not an automatic module...
Converts this module to a normal module with the given dependences @throws IllegalArgumentException if this module is not an automatic module
[ "Converts", "this", "module", "to", "a", "normal", "module", "with", "the", "given", "dependences" ]
train
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/Module.java#L138-L143
VoltDB/voltdb
src/hsqldb19b3/org/hsqldb_voltpatches/SchemaManager.java
SchemaManager.getSchemaHsqlNameNoThrow
public HsqlName getSchemaHsqlNameNoThrow(String name, HsqlName defaultName) { """ If schemaName is null, return the default schema name, else return the HsqlName object for the schema. If schemaName does not exist, return the defaultName provided. Not throwing the usual exception saves some throw-then-catch non...
java
public HsqlName getSchemaHsqlNameNoThrow(String name, HsqlName defaultName) { if (name == null) { return defaultSchemaHsqlName; } if (SqlInvariants.INFORMATION_SCHEMA.equals(name)) { return SqlInvariants.INFORMATION_SCHEMA_HSQLNAME; } Schema schema = ((...
[ "public", "HsqlName", "getSchemaHsqlNameNoThrow", "(", "String", "name", ",", "HsqlName", "defaultName", ")", "{", "if", "(", "name", "==", "null", ")", "{", "return", "defaultSchemaHsqlName", ";", "}", "if", "(", "SqlInvariants", ".", "INFORMATION_SCHEMA", ".",...
If schemaName is null, return the default schema name, else return the HsqlName object for the schema. If schemaName does not exist, return the defaultName provided. Not throwing the usual exception saves some throw-then-catch nonsense in the usual session setup.
[ "If", "schemaName", "is", "null", "return", "the", "default", "schema", "name", "else", "return", "the", "HsqlName", "object", "for", "the", "schema", ".", "If", "schemaName", "does", "not", "exist", "return", "the", "defaultName", "provided", ".", "Not", "t...
train
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/SchemaManager.java#L1638-L1654
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/tools/offlineEditsViewer/EditsVisitorFactory.java
EditsVisitorFactory.getEditsVisitor
static public EditsVisitor getEditsVisitor(String filename, String processor, Tokenizer tokenizer, boolean printToScreen) throws IOException { """ Factory function that creates an EditsVisitor object @param filename output filename @param tokenizer input tokenizer @return EditsVisitor for appropri...
java
static public EditsVisitor getEditsVisitor(String filename, String processor, Tokenizer tokenizer, boolean printToScreen) throws IOException { if(processor.toLowerCase().equals("xml")) { return new XmlEditsVisitor(filename, tokenizer, printToScreen); } else if(processor.toLowerCase().equals("...
[ "static", "public", "EditsVisitor", "getEditsVisitor", "(", "String", "filename", ",", "String", "processor", ",", "Tokenizer", "tokenizer", ",", "boolean", "printToScreen", ")", "throws", "IOException", "{", "if", "(", "processor", ".", "toLowerCase", "(", ")", ...
Factory function that creates an EditsVisitor object @param filename output filename @param tokenizer input tokenizer @return EditsVisitor for appropriate output format (binary, XML etc.)
[ "Factory", "function", "that", "creates", "an", "EditsVisitor", "object" ]
train
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/tools/offlineEditsViewer/EditsVisitorFactory.java#L36-L51
landawn/AbacusUtil
src/com/landawn/abacus/util/Sheet.java
Sheet.moveRow
public void moveRow(Object rowKey, int newRowIndex) { """ Move the specified row to the new position. @param rowKey @param newRowIndex """ checkFrozen(); this.checkRowIndex(newRowIndex); final int rowIndex = this.getRowIndex(rowKey); final List<R> tmp = new ArrayList...
java
public void moveRow(Object rowKey, int newRowIndex) { checkFrozen(); this.checkRowIndex(newRowIndex); final int rowIndex = this.getRowIndex(rowKey); final List<R> tmp = new ArrayList<>(rowLength()); tmp.addAll(_rowKeySet); tmp.add(newRowIndex, tmp.remove(rowInde...
[ "public", "void", "moveRow", "(", "Object", "rowKey", ",", "int", "newRowIndex", ")", "{", "checkFrozen", "(", ")", ";", "this", ".", "checkRowIndex", "(", "newRowIndex", ")", ";", "final", "int", "rowIndex", "=", "this", ".", "getRowIndex", "(", "rowKey",...
Move the specified row to the new position. @param rowKey @param newRowIndex
[ "Move", "the", "specified", "row", "to", "the", "new", "position", "." ]
train
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/Sheet.java#L554-L574
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/ULocale.java
ULocale.getDisplayScriptInContext
@Deprecated public static String getDisplayScriptInContext(String localeID, String displayLocaleID) { """ <strong>[icu]</strong> Returns a locale's script localized for display in the provided locale. This is a cover for the ICU4C API. @param localeID the id of the locale whose script will be displayed @par...
java
@Deprecated public static String getDisplayScriptInContext(String localeID, String displayLocaleID) { return getDisplayScriptInContextInternal(new ULocale(localeID), new ULocale(displayLocaleID)); }
[ "@", "Deprecated", "public", "static", "String", "getDisplayScriptInContext", "(", "String", "localeID", ",", "String", "displayLocaleID", ")", "{", "return", "getDisplayScriptInContextInternal", "(", "new", "ULocale", "(", "localeID", ")", ",", "new", "ULocale", "(...
<strong>[icu]</strong> Returns a locale's script localized for display in the provided locale. This is a cover for the ICU4C API. @param localeID the id of the locale whose script will be displayed @param displayLocaleID the id of the locale in which to display the name. @return the localized script name. @deprecated T...
[ "<strong", ">", "[", "icu", "]", "<", "/", "strong", ">", "Returns", "a", "locale", "s", "script", "localized", "for", "display", "in", "the", "provided", "locale", ".", "This", "is", "a", "cover", "for", "the", "ICU4C", "API", "." ]
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/ULocale.java#L1523-L1526
Kurento/kurento-module-creator
src/main/java/com/github/zafarkhaja/semver/expr/ExpressionParser.java
ExpressionParser.parseBooleanExpression
private Expression parseBooleanExpression(Expression expr) { """ Parses the {@literal <boolean-expr>} non-terminal. <pre> {@literal <boolean-expr> ::= <boolean-op> <semver-expr> | <epsilon> } </pre> @param expr the left-hand expression of the logical operators @return the expression AST """ if...
java
private Expression parseBooleanExpression(Expression expr) { if (tokens.positiveLookahead(AND)) { tokens.consume(); expr = new And(expr, parseSemVerExpression()); } else if (tokens.positiveLookahead(OR)) { tokens.consume(); expr = new Or(expr, parseSemVerExpression()); } return e...
[ "private", "Expression", "parseBooleanExpression", "(", "Expression", "expr", ")", "{", "if", "(", "tokens", ".", "positiveLookahead", "(", "AND", ")", ")", "{", "tokens", ".", "consume", "(", ")", ";", "expr", "=", "new", "And", "(", "expr", ",", "parse...
Parses the {@literal <boolean-expr>} non-terminal. <pre> {@literal <boolean-expr> ::= <boolean-op> <semver-expr> | <epsilon> } </pre> @param expr the left-hand expression of the logical operators @return the expression AST
[ "Parses", "the", "{", "@literal", "<boolean", "-", "expr", ">", "}", "non", "-", "terminal", "." ]
train
https://github.com/Kurento/kurento-module-creator/blob/c371516c665b902b5476433496a5aefcbca86d64/src/main/java/com/github/zafarkhaja/semver/expr/ExpressionParser.java#L154-L163
ziccardi/jnrpe
jnrpe-lib/src/main/java/it/jnrpe/plugins/MetricBuilder.java
MetricBuilder.withMessage
public MetricBuilder withMessage(String messagePattern, Object ...params) { """ Sets the message to be associated with this metric. @param messagePattern the message pattern to be associated with this metric @param params the parameter to pass to {@link MessageFormat} to create the complete message @return t...
java
public MetricBuilder withMessage(String messagePattern, Object ...params) { this.metricMessage = MessageFormat.format(messagePattern, params); return this; }
[ "public", "MetricBuilder", "withMessage", "(", "String", "messagePattern", ",", "Object", "...", "params", ")", "{", "this", ".", "metricMessage", "=", "MessageFormat", ".", "format", "(", "messagePattern", ",", "params", ")", ";", "return", "this", ";", "}" ]
Sets the message to be associated with this metric. @param messagePattern the message pattern to be associated with this metric @param params the parameter to pass to {@link MessageFormat} to create the complete message @return this
[ "Sets", "the", "message", "to", "be", "associated", "with", "this", "metric", "." ]
train
https://github.com/ziccardi/jnrpe/blob/ac9046355851136994388442b01ba4063305f9c4/jnrpe-lib/src/main/java/it/jnrpe/plugins/MetricBuilder.java#L162-L165
powermock/powermock
powermock-reflect/src/main/java/org/powermock/reflect/internal/WhiteboxImpl.java
WhiteboxImpl.setInternalState
public static void setInternalState(Object object, Class<?> fieldType, Object value, Class<?> where) { """ Set the value of a field using reflection at a specific location ( <tt>where</tt>) in the class hierarchy. The <tt>value</tt> will then be assigned to this field. @param object the object to modify @...
java
public static void setInternalState(Object object, Class<?> fieldType, Object value, Class<?> where) { if (fieldType == null || where == null) { throw new IllegalArgumentException("fieldType and where cannot be null"); } setField(object, value, findFieldOrThrowException(fieldType, w...
[ "public", "static", "void", "setInternalState", "(", "Object", "object", ",", "Class", "<", "?", ">", "fieldType", ",", "Object", "value", ",", "Class", "<", "?", ">", "where", ")", "{", "if", "(", "fieldType", "==", "null", "||", "where", "==", "null"...
Set the value of a field using reflection at a specific location ( <tt>where</tt>) in the class hierarchy. The <tt>value</tt> will then be assigned to this field. @param object the object to modify @param fieldType the type of the field the should be set. @param value the new value of the field @param where ...
[ "Set", "the", "value", "of", "a", "field", "using", "reflection", "at", "a", "specific", "location", "(", "<tt", ">", "where<", "/", "tt", ">", ")", "in", "the", "class", "hierarchy", ".", "The", "<tt", ">", "value<", "/", "tt", ">", "will", "then", ...
train
https://github.com/powermock/powermock/blob/e8cd68026c284c6a7efe66959809eeebd8d1f9ad/powermock-reflect/src/main/java/org/powermock/reflect/internal/WhiteboxImpl.java#L380-L386
antlrjavaparser/antlr-java-parser
src/main/java/com/github/antlrjavaparser/ASTHelper.java
ASTHelper.createVariableDeclarationExpr
public static VariableDeclarationExpr createVariableDeclarationExpr(Type type, String name) { """ Creates a {@link VariableDeclarationExpr}. @param type type @param name name @return instance of {@link VariableDeclarationExpr} """ List<VariableDeclarator> vars = new ArrayList<VariableDeclarator>...
java
public static VariableDeclarationExpr createVariableDeclarationExpr(Type type, String name) { List<VariableDeclarator> vars = new ArrayList<VariableDeclarator>(); vars.add(new VariableDeclarator(new VariableDeclaratorId(name))); return new VariableDeclarationExpr(type, vars); }
[ "public", "static", "VariableDeclarationExpr", "createVariableDeclarationExpr", "(", "Type", "type", ",", "String", "name", ")", "{", "List", "<", "VariableDeclarator", ">", "vars", "=", "new", "ArrayList", "<", "VariableDeclarator", ">", "(", ")", ";", "vars", ...
Creates a {@link VariableDeclarationExpr}. @param type type @param name name @return instance of {@link VariableDeclarationExpr}
[ "Creates", "a", "{", "@link", "VariableDeclarationExpr", "}", "." ]
train
https://github.com/antlrjavaparser/antlr-java-parser/blob/077160deb44d952c40c442800abd91af7e6fe006/src/main/java/com/github/antlrjavaparser/ASTHelper.java#L151-L155
UrielCh/ovh-java-sdk
ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java
ApiOvhCloud.project_serviceName_migration_migrationId_PUT
public OvhMigration project_serviceName_migration_migrationId_PUT(String serviceName, String migrationId, Date date) throws IOException { """ Update planned migration REST: PUT /cloud/project/{serviceName}/migration/{migrationId} @param date [required] Migration date (RFC3339) @param migrationId [required] Mi...
java
public OvhMigration project_serviceName_migration_migrationId_PUT(String serviceName, String migrationId, Date date) throws IOException { String qPath = "/cloud/project/{serviceName}/migration/{migrationId}"; StringBuilder sb = path(qPath, serviceName, migrationId); HashMap<String, Object>o = new HashMap<String, ...
[ "public", "OvhMigration", "project_serviceName_migration_migrationId_PUT", "(", "String", "serviceName", ",", "String", "migrationId", ",", "Date", "date", ")", "throws", "IOException", "{", "String", "qPath", "=", "\"/cloud/project/{serviceName}/migration/{migrationId}\"", "...
Update planned migration REST: PUT /cloud/project/{serviceName}/migration/{migrationId} @param date [required] Migration date (RFC3339) @param migrationId [required] Migration id @param serviceName [required] Service name API beta
[ "Update", "planned", "migration" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java#L1057-L1064
undertow-io/undertow
core/src/main/java/io/undertow/websockets/core/WebSockets.java
WebSockets.sendPingBlocking
public static void sendPingBlocking(final ByteBuffer data, final WebSocketChannel wsChannel) throws IOException { """ Sends a complete ping message using blocking IO @param data The data to send @param wsChannel The web socket channel """ sendBlockingInternal(data, WebSocketFrameType.PING, wsChanne...
java
public static void sendPingBlocking(final ByteBuffer data, final WebSocketChannel wsChannel) throws IOException { sendBlockingInternal(data, WebSocketFrameType.PING, wsChannel); }
[ "public", "static", "void", "sendPingBlocking", "(", "final", "ByteBuffer", "data", ",", "final", "WebSocketChannel", "wsChannel", ")", "throws", "IOException", "{", "sendBlockingInternal", "(", "data", ",", "WebSocketFrameType", ".", "PING", ",", "wsChannel", ")", ...
Sends a complete ping message using blocking IO @param data The data to send @param wsChannel The web socket channel
[ "Sends", "a", "complete", "ping", "message", "using", "blocking", "IO" ]
train
https://github.com/undertow-io/undertow/blob/87de0b856a7a4ba8faf5b659537b9af07b763263/core/src/main/java/io/undertow/websockets/core/WebSockets.java#L378-L380
fuinorg/units4j
src/main/java/org/fuin/units4j/Units4JUtils.java
Units4JUtils.setPrivateField
public static void setPrivateField(final Object obj, final String name, final Object value) { """ Sets a private field in an object by using reflection. @param obj Object with the attribute to set. @param name Name of the attribute to set. @param value Value to set for the attribute. """ try { ...
java
public static void setPrivateField(final Object obj, final String name, final Object value) { try { final Field field = obj.getClass().getDeclaredField(name); field.setAccessible(true); field.set(obj, value); } catch (final Exception ex) { throw new Runtim...
[ "public", "static", "void", "setPrivateField", "(", "final", "Object", "obj", ",", "final", "String", "name", ",", "final", "Object", "value", ")", "{", "try", "{", "final", "Field", "field", "=", "obj", ".", "getClass", "(", ")", ".", "getDeclaredField", ...
Sets a private field in an object by using reflection. @param obj Object with the attribute to set. @param name Name of the attribute to set. @param value Value to set for the attribute.
[ "Sets", "a", "private", "field", "in", "an", "object", "by", "using", "reflection", "." ]
train
https://github.com/fuinorg/units4j/blob/29383e30b0f9c246b309e734df9cc63dc5d5499e/src/main/java/org/fuin/units4j/Units4JUtils.java#L255-L263
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java
FSDirectory.removeChild
private INode removeChild(INode[] pathComponents, int endPos) { """ Remove an inode at index pos from the namespace. Its ancestors are stored at [0, pos-1]. Count of each ancestor with quota is also updated. Return the removed node; null if the removal fails. """ INode removedNode = pathComponents[endPo...
java
private INode removeChild(INode[] pathComponents, int endPos) { INode removedNode = pathComponents[endPos]; int startPos = removedNode.getStartPosForQuoteUpdate(); removedNode = ((INodeDirectory)pathComponents[endPos-1]).removeChild(pathComponents[endPos]); if (removedNode != null) { INode.D...
[ "private", "INode", "removeChild", "(", "INode", "[", "]", "pathComponents", ",", "int", "endPos", ")", "{", "INode", "removedNode", "=", "pathComponents", "[", "endPos", "]", ";", "int", "startPos", "=", "removedNode", ".", "getStartPosForQuoteUpdate", "(", "...
Remove an inode at index pos from the namespace. Its ancestors are stored at [0, pos-1]. Count of each ancestor with quota is also updated. Return the removed node; null if the removal fails.
[ "Remove", "an", "inode", "at", "index", "pos", "from", "the", "namespace", ".", "Its", "ancestors", "are", "stored", "at", "[", "0", "pos", "-", "1", "]", ".", "Count", "of", "each", "ancestor", "with", "quota", "is", "also", "updated", ".", "Return", ...
train
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java#L2593-L2605
wisdom-framework/wisdom
core/wisdom-vertx-engine/src/main/java/org/wisdom/framework/vertx/RequestFromVertx.java
RequestFromVertx.mediaTypes
@Override public Collection<MediaType> mediaTypes() { """ Get the content media type that is acceptable for the client. E.g. Accept: text/*;q=0.3, text/html;q=0.7, text/html;level=1,text/html;level=2;q=0.4 <p/> The Accept request-header field can be used to specify certain media types which are acceptable ...
java
@Override public Collection<MediaType> mediaTypes() { String contentType = request.headers().get(HeaderNames.ACCEPT); if (contentType == null) { // Any text by default. return ImmutableList.of(MediaType.ANY_TEXT_TYPE); } TreeSet<MediaType> set = new TreeSet<...
[ "@", "Override", "public", "Collection", "<", "MediaType", ">", "mediaTypes", "(", ")", "{", "String", "contentType", "=", "request", ".", "headers", "(", ")", ".", "get", "(", "HeaderNames", ".", "ACCEPT", ")", ";", "if", "(", "contentType", "==", "null...
Get the content media type that is acceptable for the client. E.g. Accept: text/*;q=0.3, text/html;q=0.7, text/html;level=1,text/html;level=2;q=0.4 <p/> The Accept request-header field can be used to specify certain media types which are acceptable for the response. Accept headers can be used to indicate that the reque...
[ "Get", "the", "content", "media", "type", "that", "is", "acceptable", "for", "the", "client", ".", "E", ".", "g", ".", "Accept", ":", "text", "/", "*", ";", "q", "=", "0", ".", "3", "text", "/", "html", ";", "q", "=", "0", ".", "7", "text", "...
train
https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-vertx-engine/src/main/java/org/wisdom/framework/vertx/RequestFromVertx.java#L247-L283
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-collection/src/main/java/org/xwiki/collection/SoftCache.java
SoftCache.put
public void put(K key, V value) { """ Associate passed key to passed value. @param key the entry key @param value the entry value """ this.lock.writeLock().lock(); try { this.map.put(key, new SoftReference<>(value)); } finally { this.lock.writeLock().unlock(...
java
public void put(K key, V value) { this.lock.writeLock().lock(); try { this.map.put(key, new SoftReference<>(value)); } finally { this.lock.writeLock().unlock(); } }
[ "public", "void", "put", "(", "K", "key", ",", "V", "value", ")", "{", "this", ".", "lock", ".", "writeLock", "(", ")", ".", "lock", "(", ")", ";", "try", "{", "this", ".", "map", ".", "put", "(", "key", ",", "new", "SoftReference", "<>", "(", ...
Associate passed key to passed value. @param key the entry key @param value the entry value
[ "Associate", "passed", "key", "to", "passed", "value", "." ]
train
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-collection/src/main/java/org/xwiki/collection/SoftCache.java#L91-L100
jeremylong/DependencyCheck
core/src/main/java/org/owasp/dependencycheck/utils/ExtractionUtil.java
ExtractionUtil.extractArchive
private static void extractArchive(ArchiveInputStream input, File destination, FilenameFilter filter) throws ArchiveExtractionException { """ Extracts files from an archive. @param input the archive to extract files from @param destination the location to write the files too @param fil...
java
private static void extractArchive(ArchiveInputStream input, File destination, FilenameFilter filter) throws ArchiveExtractionException { ArchiveEntry entry; try { final String destPath = destination.getCanonicalPath(); while ((entry = input.getNextEntry(...
[ "private", "static", "void", "extractArchive", "(", "ArchiveInputStream", "input", ",", "File", "destination", ",", "FilenameFilter", "filter", ")", "throws", "ArchiveExtractionException", "{", "ArchiveEntry", "entry", ";", "try", "{", "final", "String", "destPath", ...
Extracts files from an archive. @param input the archive to extract files from @param destination the location to write the files too @param filter determines which files get extracted @throws ArchiveExtractionException thrown if there is an exception extracting files from the archive
[ "Extracts", "files", "from", "an", "archive", "." ]
train
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/utils/ExtractionUtil.java#L235-L266
OpenLiberty/open-liberty
dev/com.ibm.ws.security.wim.adapter.ldap/src/com/ibm/ws/security/wim/adapter/ldap/context/ContextManager.java
ContextManager.createDirContext
private TimedDirContext createDirContext(Hashtable<String, Object> env, long createTimestamp) throws NamingException { """ Create a directory context. @param env The JNDI environment to create the context with. @param createTimestamp The timestamp to use as the creation timestamp for the {@link TimedDirContext...
java
private TimedDirContext createDirContext(Hashtable<String, Object> env, long createTimestamp) throws NamingException { /* * Check if the credential is a protected string. It will be unprotected if this is an anonymous bind */ Object o = env.get(Context.SECURITY_CREDENTIALS); i...
[ "private", "TimedDirContext", "createDirContext", "(", "Hashtable", "<", "String", ",", "Object", ">", "env", ",", "long", "createTimestamp", ")", "throws", "NamingException", "{", "/*\n * Check if the credential is a protected string. It will be unprotected if this is an...
Create a directory context. @param env The JNDI environment to create the context with. @param createTimestamp The timestamp to use as the creation timestamp for the {@link TimedDirContext}. @return The {@link TimedDirContext}. @throws NamingException If there was an issue binding to the LDAP server.
[ "Create", "a", "directory", "context", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.wim.adapter.ldap/src/com/ibm/ws/security/wim/adapter/ldap/context/ContextManager.java#L391-L437
riversun/d6
src/main/java/org/riversun/d6/core/D6Crud.java
D6Crud.execSelectCount
public int execSelectCount(Class<? extends D6Model> modelClazz, WhereCondition whereCondition) { """ Returns the total number of the lines of rows corresponding to the specified model class @param modelClazz @param whereCondition @return """ final D6CrudSelectHelper d6CrudSelectHelper = new D6CrudSe...
java
public int execSelectCount(Class<? extends D6Model> modelClazz, WhereCondition whereCondition) { final D6CrudSelectHelper d6CrudSelectHelper = new D6CrudSelectHelper(modelClazz); final String sqlForSelectCount = d6CrudSelectHelper.getSQLForSelectCount(); String sql = sqlForSelectCount + " " + whereConditi...
[ "public", "int", "execSelectCount", "(", "Class", "<", "?", "extends", "D6Model", ">", "modelClazz", ",", "WhereCondition", "whereCondition", ")", "{", "final", "D6CrudSelectHelper", "d6CrudSelectHelper", "=", "new", "D6CrudSelectHelper", "(", "modelClazz", ")", ";"...
Returns the total number of the lines of rows corresponding to the specified model class @param modelClazz @param whereCondition @return
[ "Returns", "the", "total", "number", "of", "the", "lines", "of", "rows", "corresponding", "to", "the", "specified", "model", "class" ]
train
https://github.com/riversun/d6/blob/2798bd876b9380dbfea8182d11ad306cb1b0e114/src/main/java/org/riversun/d6/core/D6Crud.java#L626-L634
hageldave/ImagingKit
ImagingKit_Filter/src/main/java/hageldave/imagingkit/filter/implementations/GenericColorChannelTransformation.java
GenericColorChannelTransformation.fromFunction
public static GenericColorChannelTransformation fromFunction(Function<Double, Double> fn) { """ <p> Try this function for contrast stretching:<br> {@code v->(1+Math.cos(v*Math.PI+Math.PI))/2} @param fn @return """ Objects.requireNonNull(fn); return fromFunctions(fn, fn, fn, fn); }
java
public static GenericColorChannelTransformation fromFunction(Function<Double, Double> fn){ Objects.requireNonNull(fn); return fromFunctions(fn, fn, fn, fn); }
[ "public", "static", "GenericColorChannelTransformation", "fromFunction", "(", "Function", "<", "Double", ",", "Double", ">", "fn", ")", "{", "Objects", ".", "requireNonNull", "(", "fn", ")", ";", "return", "fromFunctions", "(", "fn", ",", "fn", ",", "fn", ",...
<p> Try this function for contrast stretching:<br> {@code v->(1+Math.cos(v*Math.PI+Math.PI))/2} @param fn @return
[ "<p", ">", "Try", "this", "function", "for", "contrast", "stretching", ":", "<br", ">", "{", "@code", "v", "-", ">", "(", "1", "+", "Math", ".", "cos", "(", "v", "*", "Math", ".", "PI", "+", "Math", ".", "PI", "))", "/", "2", "}" ]
train
https://github.com/hageldave/ImagingKit/blob/3837c7d550a12cf4dc5718b644ced94b97f52668/ImagingKit_Filter/src/main/java/hageldave/imagingkit/filter/implementations/GenericColorChannelTransformation.java#L136-L139
PeterisP/LVTagger
src/main/java/edu/stanford/nlp/classify/LinearClassifier.java
LinearClassifier.printHistCounts
private static void printHistCounts(int ind, String title, PrintWriter pw, double[][] hist, Object[][] histEg) { """ Print histogram counts from hist and examples over a certain range """ pw.println(title); for (int i = 0; i < 200; i++) { int intpart, fracpart; if (i < 100) { i...
java
private static void printHistCounts(int ind, String title, PrintWriter pw, double[][] hist, Object[][] histEg) { pw.println(title); for (int i = 0; i < 200; i++) { int intpart, fracpart; if (i < 100) { intpart = 10 - ((i + 9) / 10); fracpart = (10 - (i % 10)) % 10; } els...
[ "private", "static", "void", "printHistCounts", "(", "int", "ind", ",", "String", "title", ",", "PrintWriter", "pw", ",", "double", "[", "]", "[", "]", "hist", ",", "Object", "[", "]", "[", "]", "histEg", ")", "{", "pw", ".", "println", "(", "title",...
Print histogram counts from hist and examples over a certain range
[ "Print", "histogram", "counts", "from", "hist", "and", "examples", "over", "a", "certain", "range" ]
train
https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/classify/LinearClassifier.java#L826-L843
hyperledger/fabric-sdk-java
src/main/java/org/hyperledger/fabric/sdk/security/CryptoPrimitives.java
CryptoPrimitives.ecdsaSignToBytes
private byte[] ecdsaSignToBytes(ECPrivateKey privateKey, byte[] data) throws CryptoException { """ Sign data with the specified elliptic curve private key. @param privateKey elliptic curve private key. @param data data to sign @return the signed data. @throws CryptoException """ if (data ==...
java
private byte[] ecdsaSignToBytes(ECPrivateKey privateKey, byte[] data) throws CryptoException { if (data == null) { throw new CryptoException("Data that to be signed is null."); } if (data.length == 0) { throw new CryptoException("Data to be signed was empty."); } ...
[ "private", "byte", "[", "]", "ecdsaSignToBytes", "(", "ECPrivateKey", "privateKey", ",", "byte", "[", "]", "data", ")", "throws", "CryptoException", "{", "if", "(", "data", "==", "null", ")", "{", "throw", "new", "CryptoException", "(", "\"Data that to be sign...
Sign data with the specified elliptic curve private key. @param privateKey elliptic curve private key. @param data data to sign @return the signed data. @throws CryptoException
[ "Sign", "data", "with", "the", "specified", "elliptic", "curve", "private", "key", "." ]
train
https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric/sdk/security/CryptoPrimitives.java#L715-L750
blacklocus/metrics-cloudwatch
src/main/java/com/blacklocus/metrics/MetricNameBuilder.java
MetricNameBuilder.addDimension
public MetricNameBuilder addDimension(Dimension dimension, boolean permute) throws MetricsNameSyntaxException { """ Passes into {@link #addDimension(String, String, boolean)} @return this for chaining @throws MetricsNameSyntaxException on validation failure """ return addDimension(dimension.getName...
java
public MetricNameBuilder addDimension(Dimension dimension, boolean permute) throws MetricsNameSyntaxException { return addDimension(dimension.getName(), dimension.getValue(), false); }
[ "public", "MetricNameBuilder", "addDimension", "(", "Dimension", "dimension", ",", "boolean", "permute", ")", "throws", "MetricsNameSyntaxException", "{", "return", "addDimension", "(", "dimension", ".", "getName", "(", ")", ",", "dimension", ".", "getValue", "(", ...
Passes into {@link #addDimension(String, String, boolean)} @return this for chaining @throws MetricsNameSyntaxException on validation failure
[ "Passes", "into", "{", "@link", "#addDimension", "(", "String", "String", "boolean", ")", "}" ]
train
https://github.com/blacklocus/metrics-cloudwatch/blob/0554929b5729621c3d3ffd925284af174ab1dd32/src/main/java/com/blacklocus/metrics/MetricNameBuilder.java#L124-L126
joniles/mpxj
src/main/java/net/sf/mpxj/phoenix/PhoenixReader.java
PhoenixReader.getUUID
private UUID getUUID(UUID uuid, String name) { """ Utility method. In some cases older compressed PPX files only have a name (or other string attribute) but no UUID. This method ensures that we either use the UUID supplied, or if it is missing, we generate a UUID from the name. @param uuid uuid from object @...
java
private UUID getUUID(UUID uuid, String name) { return uuid == null ? UUID.nameUUIDFromBytes(name.getBytes()) : uuid; }
[ "private", "UUID", "getUUID", "(", "UUID", "uuid", ",", "String", "name", ")", "{", "return", "uuid", "==", "null", "?", "UUID", ".", "nameUUIDFromBytes", "(", "name", ".", "getBytes", "(", ")", ")", ":", "uuid", ";", "}" ]
Utility method. In some cases older compressed PPX files only have a name (or other string attribute) but no UUID. This method ensures that we either use the UUID supplied, or if it is missing, we generate a UUID from the name. @param uuid uuid from object @param name name from object @return UUID instance
[ "Utility", "method", ".", "In", "some", "cases", "older", "compressed", "PPX", "files", "only", "have", "a", "name", "(", "or", "other", "string", "attribute", ")", "but", "no", "UUID", ".", "This", "method", "ensures", "that", "we", "either", "use", "th...
train
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/phoenix/PhoenixReader.java#L735-L738
geomajas/geomajas-project-client-gwt
client/src/main/java/org/geomajas/gwt/client/map/feature/Feature.java
Feature.setLongAttribute
public void setLongAttribute(String name, Long value) { """ Set attribute value of given type. @param name attribute name @param value attribute value """ Attribute attribute = getAttributes().get(name); if (!(attribute instanceof LongAttribute)) { throw new IllegalStateException("Cannot set boolean...
java
public void setLongAttribute(String name, Long value) { Attribute attribute = getAttributes().get(name); if (!(attribute instanceof LongAttribute)) { throw new IllegalStateException("Cannot set boolean value on attribute with different type, " + attribute.getClass().getName() + " setting value " + value); ...
[ "public", "void", "setLongAttribute", "(", "String", "name", ",", "Long", "value", ")", "{", "Attribute", "attribute", "=", "getAttributes", "(", ")", ".", "get", "(", "name", ")", ";", "if", "(", "!", "(", "attribute", "instanceof", "LongAttribute", ")", ...
Set attribute value of given type. @param name attribute name @param value attribute value
[ "Set", "attribute", "value", "of", "given", "type", "." ]
train
https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/map/feature/Feature.java#L320-L327
lucee/Lucee
core/src/main/java/lucee/runtime/osgi/OSGiUtil.java
OSGiUtil._loadBundle
private static Bundle _loadBundle(BundleContext context, String path, InputStream is, boolean closeStream) throws BundleException { """ does not check if the bundle already exists! @param context @param path @param is @param closeStream @return @throws BundleException """ log(Log.LEVEL_INFO, "add bund...
java
private static Bundle _loadBundle(BundleContext context, String path, InputStream is, boolean closeStream) throws BundleException { log(Log.LEVEL_INFO, "add bundle:" + path); try { // we make this very simply so an old loader that is calling this still works return context.installBundle(path, is); } fina...
[ "private", "static", "Bundle", "_loadBundle", "(", "BundleContext", "context", ",", "String", "path", ",", "InputStream", "is", ",", "boolean", "closeStream", ")", "throws", "BundleException", "{", "log", "(", "Log", ".", "LEVEL_INFO", ",", "\"add bundle:\"", "+...
does not check if the bundle already exists! @param context @param path @param is @param closeStream @return @throws BundleException
[ "does", "not", "check", "if", "the", "bundle", "already", "exists!" ]
train
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/osgi/OSGiUtil.java#L125-L143
JOML-CI/JOML
src/org/joml/Matrix4d.java
Matrix4d.rotationAround
public Matrix4d rotationAround(Quaterniondc quat, double ox, double oy, double oz) { """ Set this matrix to a transformation composed of a rotation of the specified {@link Quaterniondc} while using <code>(ox, oy, oz)</code> as the rotation origin. <p> When used with a right-handed coordinate system, the produced...
java
public Matrix4d rotationAround(Quaterniondc quat, double ox, double oy, double oz) { double w2 = quat.w() * quat.w(), x2 = quat.x() * quat.x(); double y2 = quat.y() * quat.y(), z2 = quat.z() * quat.z(); double zw = quat.z() * quat.w(), dzw = zw + zw, xy = quat.x() * quat.y(), dxy = xy + xy; ...
[ "public", "Matrix4d", "rotationAround", "(", "Quaterniondc", "quat", ",", "double", "ox", ",", "double", "oy", ",", "double", "oz", ")", "{", "double", "w2", "=", "quat", ".", "w", "(", ")", "*", "quat", ".", "w", "(", ")", ",", "x2", "=", "quat", ...
Set this matrix to a transformation composed of a rotation of the specified {@link Quaterniondc} while using <code>(ox, oy, oz)</code> as the rotation origin. <p> When used with a right-handed coordinate system, the produced rotation will rotate a vector counter-clockwise around the rotation axis, when viewing along th...
[ "Set", "this", "matrix", "to", "a", "transformation", "composed", "of", "a", "rotation", "of", "the", "specified", "{", "@link", "Quaterniondc", "}", "while", "using", "<code", ">", "(", "ox", "oy", "oz", ")", "<", "/", "code", ">", "as", "the", "rotat...
train
https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4d.java#L5133-L5157
anotheria/moskito
moskito-core/src/main/java/net/anotheria/moskito/core/errorhandling/BuiltInErrorProducer.java
BuiltInErrorProducer.createAccumulatorDefinition
private AccumulatorDefinition createAccumulatorDefinition(String name, String valueName, String statName) { """ Helper method to create a accumulator definiton. @param name name of the accumulator. @param valueName name of the value (initial or total). @param statName name of the stat (exception name or 'cumula...
java
private AccumulatorDefinition createAccumulatorDefinition(String name, String valueName, String statName){ AccumulatorDefinition definition = new AccumulatorDefinition(); definition.setName(name); definition.setProducerName(getProducerId()); definition.setStatName(statName); definition.setValueName(valueName)...
[ "private", "AccumulatorDefinition", "createAccumulatorDefinition", "(", "String", "name", ",", "String", "valueName", ",", "String", "statName", ")", "{", "AccumulatorDefinition", "definition", "=", "new", "AccumulatorDefinition", "(", ")", ";", "definition", ".", "se...
Helper method to create a accumulator definiton. @param name name of the accumulator. @param valueName name of the value (initial or total). @param statName name of the stat (exception name or 'cumulated'). @return
[ "Helper", "method", "to", "create", "a", "accumulator", "definiton", "." ]
train
https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-core/src/main/java/net/anotheria/moskito/core/errorhandling/BuiltInErrorProducer.java#L128-L136
ow2-chameleon/fuchsia
importers/zwave/src/main/java/org/ow2/chameleon/fuchsia/importer/zwave/internal/protocol/ZWaveController.java
ZWaveController.handleSendDataRequest
private void handleSendDataRequest(SerialMessage incomingMessage) { """ Handles incoming Send Data Request. Send Data request are used to acknowledge or cancel failed messages. @param incomingMessage the request message to process. """ logger.trace("Handle Message Send Data Request"); int callbackId =...
java
private void handleSendDataRequest(SerialMessage incomingMessage) { logger.trace("Handle Message Send Data Request"); int callbackId = incomingMessage.getMessagePayloadByte(0); TransmissionState status = TransmissionState.getTransmissionState(incomingMessage.getMessagePayloadByte(1)); SerialMessage originalM...
[ "private", "void", "handleSendDataRequest", "(", "SerialMessage", "incomingMessage", ")", "{", "logger", ".", "trace", "(", "\"Handle Message Send Data Request\"", ")", ";", "int", "callbackId", "=", "incomingMessage", ".", "getMessagePayloadByte", "(", "0", ")", ";",...
Handles incoming Send Data Request. Send Data request are used to acknowledge or cancel failed messages. @param incomingMessage the request message to process.
[ "Handles", "incoming", "Send", "Data", "Request", ".", "Send", "Data", "request", "are", "used", "to", "acknowledge", "or", "cancel", "failed", "messages", "." ]
train
https://github.com/ow2-chameleon/fuchsia/blob/4e9318eadbdeb945e529789f573b45386e619bed/importers/zwave/src/main/java/org/ow2/chameleon/fuchsia/importer/zwave/internal/protocol/ZWaveController.java#L273-L320
xcesco/kripton
kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/AnnotationUtility.java
AnnotationUtility.extractAsBoolean
public static boolean extractAsBoolean(Element item, Class<? extends Annotation> annotationClass, AnnotationAttributeType attribute) { """ Extract as boolean. @param item the item @param annotationClass the annotation class @param attribute the attribute @return true, if successful """ final Elements e...
java
public static boolean extractAsBoolean(Element item, Class<? extends Annotation> annotationClass, AnnotationAttributeType attribute) { final Elements elementUtils=BaseProcessor.elementUtils; final One<Boolean> result = new One<Boolean>(false); extractString(elementUtils, item, annotationClass, attribute, new OnA...
[ "public", "static", "boolean", "extractAsBoolean", "(", "Element", "item", ",", "Class", "<", "?", "extends", "Annotation", ">", "annotationClass", ",", "AnnotationAttributeType", "attribute", ")", "{", "final", "Elements", "elementUtils", "=", "BaseProcessor", ".",...
Extract as boolean. @param item the item @param annotationClass the annotation class @param attribute the attribute @return true, if successful
[ "Extract", "as", "boolean", "." ]
train
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/AnnotationUtility.java#L556-L569
jlinn/quartz-redis-jobstore
src/main/java/net/joelinn/quartz/jobstore/AbstractRedisStorage.java
AbstractRedisStorage.removeTrigger
public boolean removeTrigger(TriggerKey triggerKey, T jedis) throws JobPersistenceException, ClassNotFoundException { """ Remove (delete) the <code>{@link org.quartz.Trigger}</code> with the given key. If the associated job is non-durable and has no triggers after the given trigger is removed, the job will be re...
java
public boolean removeTrigger(TriggerKey triggerKey, T jedis) throws JobPersistenceException, ClassNotFoundException { return removeTrigger(triggerKey, true, jedis); }
[ "public", "boolean", "removeTrigger", "(", "TriggerKey", "triggerKey", ",", "T", "jedis", ")", "throws", "JobPersistenceException", ",", "ClassNotFoundException", "{", "return", "removeTrigger", "(", "triggerKey", ",", "true", ",", "jedis", ")", ";", "}" ]
Remove (delete) the <code>{@link org.quartz.Trigger}</code> with the given key. If the associated job is non-durable and has no triggers after the given trigger is removed, the job will be removed, as well. @param triggerKey the key of the trigger to be removed @param jedis a thread-safe Redis connection @return true i...
[ "Remove", "(", "delete", ")", "the", "<code", ">", "{" ]
train
https://github.com/jlinn/quartz-redis-jobstore/blob/be9a52ee776d8a09866fe99fd9718bc13a0cb992/src/main/java/net/joelinn/quartz/jobstore/AbstractRedisStorage.java#L235-L237
google/error-prone-javac
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/Resources.java
Resources.getText
public String getText(String key, Object... args) throws MissingResourceException { """ Gets the string for the given key from one of the doclet's resource bundles, substituting additional arguments into into the resulting string with {@link MessageFormat#format}. The more specific bundle is checked first; i...
java
public String getText(String key, Object... args) throws MissingResourceException { return MessageFormat.format(getText(key), args); }
[ "public", "String", "getText", "(", "String", "key", ",", "Object", "...", "args", ")", "throws", "MissingResourceException", "{", "return", "MessageFormat", ".", "format", "(", "getText", "(", "key", ")", ",", "args", ")", ";", "}" ]
Gets the string for the given key from one of the doclet's resource bundles, substituting additional arguments into into the resulting string with {@link MessageFormat#format}. The more specific bundle is checked first; if it is not there, the common bundle is then checked. @param key the key for the desired string @...
[ "Gets", "the", "string", "for", "the", "given", "key", "from", "one", "of", "the", "doclet", "s", "resource", "bundles", "substituting", "additional", "arguments", "into", "into", "the", "resulting", "string", "with", "{", "@link", "MessageFormat#format", "}", ...
train
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/Resources.java#L101-L103
tvesalainen/util
util/src/main/java/org/vesalainen/nio/file/attribute/PosixHelp.java
PosixHelp.setOwner
public static final void setOwner(String name, Path... files) throws IOException { """ Change user of given files. Works only in linux. @param name @param files @throws IOException @see java.nio.file.Files#setOwner(java.nio.file.Path, java.nio.file.attribute.UserPrincipal) """ if (supports("posix"...
java
public static final void setOwner(String name, Path... files) throws IOException { if (supports("posix")) { for (Path file : files) { FileSystem fs = file.getFileSystem(); UserPrincipalLookupService upls = fs.getUserPrincipalLookupServic...
[ "public", "static", "final", "void", "setOwner", "(", "String", "name", ",", "Path", "...", "files", ")", "throws", "IOException", "{", "if", "(", "supports", "(", "\"posix\"", ")", ")", "{", "for", "(", "Path", "file", ":", "files", ")", "{", "FileSys...
Change user of given files. Works only in linux. @param name @param files @throws IOException @see java.nio.file.Files#setOwner(java.nio.file.Path, java.nio.file.attribute.UserPrincipal)
[ "Change", "user", "of", "given", "files", ".", "Works", "only", "in", "linux", "." ]
train
https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/nio/file/attribute/PosixHelp.java#L200-L216
mebigfatguy/fb-contrib
src/main/java/com/mebigfatguy/fbcontrib/detect/IncorrectInternalClassUse.java
IncorrectInternalClassUse.visitClassContext
@Override public void visitClassContext(ClassContext context) { """ implements the visitor to look for classes that reference com.sun.xxx, or org.apache.xerces.xxx classes by looking for class Const in the constant pool @param context the context object of the currently parsed class """ JavaCla...
java
@Override public void visitClassContext(ClassContext context) { JavaClass cls = context.getJavaClass(); if (!isInternal(cls.getClassName())) { ConstantPool pool = cls.getConstantPool(); int numItems = pool.getLength(); for (int i = 0; i < numItems; i++) { ...
[ "@", "Override", "public", "void", "visitClassContext", "(", "ClassContext", "context", ")", "{", "JavaClass", "cls", "=", "context", ".", "getJavaClass", "(", ")", ";", "if", "(", "!", "isInternal", "(", "cls", ".", "getClassName", "(", ")", ")", ")", "...
implements the visitor to look for classes that reference com.sun.xxx, or org.apache.xerces.xxx classes by looking for class Const in the constant pool @param context the context object of the currently parsed class
[ "implements", "the", "visitor", "to", "look", "for", "classes", "that", "reference", "com", ".", "sun", ".", "xxx", "or", "org", ".", "apache", ".", "xerces", ".", "xxx", "classes", "by", "looking", "for", "class", "Const", "in", "the", "constant", "pool...
train
https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/detect/IncorrectInternalClassUse.java#L97-L114
exoplatform/jcr
exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/AbstractIndex.java
AbstractIndex.getIndexReader
protected synchronized CommittableIndexReader getIndexReader() throws IOException { """ Returns an <code>IndexReader</code> on this index. This index reader may be used to delete documents. @return an <code>IndexReader</code> on this index. @throws IOException if the reader cannot be obtained. """ i...
java
protected synchronized CommittableIndexReader getIndexReader() throws IOException { if (indexWriter != null) { indexWriter.close(); log.debug("closing IndexWriter."); indexWriter = null; } if (indexReader == null || !indexReader.isCurrent()) { IndexR...
[ "protected", "synchronized", "CommittableIndexReader", "getIndexReader", "(", ")", "throws", "IOException", "{", "if", "(", "indexWriter", "!=", "null", ")", "{", "indexWriter", ".", "close", "(", ")", ";", "log", ".", "debug", "(", "\"closing IndexWriter.\"", "...
Returns an <code>IndexReader</code> on this index. This index reader may be used to delete documents. @return an <code>IndexReader</code> on this index. @throws IOException if the reader cannot be obtained.
[ "Returns", "an", "<code", ">", "IndexReader<", "/", "code", ">", "on", "this", "index", ".", "This", "index", "reader", "may", "be", "used", "to", "delete", "documents", "." ]
train
https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/AbstractIndex.java#L239-L261
haraldk/TwelveMonkeys
common/common-lang/src/main/java/com/twelvemonkeys/util/LRUHashMap.java
LRUHashMap.removeEldestEntry
protected boolean removeEldestEntry(Map.Entry<K, V> pEldest) { """ always returns {@code false}, and instead invokes {@code removeLRU()} if {@code size >= maxSize}. """ // NOTE: As removeLRU() may remove more than one entry, this is better // than simply removing the eldest entry. if (...
java
protected boolean removeEldestEntry(Map.Entry<K, V> pEldest) { // NOTE: As removeLRU() may remove more than one entry, this is better // than simply removing the eldest entry. if (size() >= maxSize) { removeLRU(); } return false; }
[ "protected", "boolean", "removeEldestEntry", "(", "Map", ".", "Entry", "<", "K", ",", "V", ">", "pEldest", ")", "{", "// NOTE: As removeLRU() may remove more than one entry, this is better", "// than simply removing the eldest entry.", "if", "(", "size", "(", ")", ">=", ...
always returns {@code false}, and instead invokes {@code removeLRU()} if {@code size >= maxSize}.
[ "always", "returns", "{" ]
train
https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/common/common-lang/src/main/java/com/twelvemonkeys/util/LRUHashMap.java#L180-L187
helun/Ektorp
org.ektorp/src/main/java/org/ektorp/util/ReflectionUtils.java
ReflectionUtils.findMethod
public static Method findMethod(Class<?> clazz, String name) { """ Ignores case when comparing method names @param clazz @param name @return """ for (Method me : clazz.getDeclaredMethods()) { if (me.getName().equalsIgnoreCase(name)) { return me; } } if (clazz.getSuperclass() != null) { ...
java
public static Method findMethod(Class<?> clazz, String name) { for (Method me : clazz.getDeclaredMethods()) { if (me.getName().equalsIgnoreCase(name)) { return me; } } if (clazz.getSuperclass() != null) { return findMethod(clazz.getSuperclass(), name); } return null; }
[ "public", "static", "Method", "findMethod", "(", "Class", "<", "?", ">", "clazz", ",", "String", "name", ")", "{", "for", "(", "Method", "me", ":", "clazz", ".", "getDeclaredMethods", "(", ")", ")", "{", "if", "(", "me", ".", "getName", "(", ")", "...
Ignores case when comparing method names @param clazz @param name @return
[ "Ignores", "case", "when", "comparing", "method", "names" ]
train
https://github.com/helun/Ektorp/blob/b822c0d656aefb90a5e0cb5ec2de3daa969e3eaa/org.ektorp/src/main/java/org/ektorp/util/ReflectionUtils.java#L77-L87
dihedron/dihedron-commons
src/main/java/org/dihedron/patterns/activities/TypedVector.java
TypedVector.setElementAt
@Override public void setElementAt(E obj, int index) { """ Sets the component at the specified index of this vector to be the specified object. @param index the index at which the element will be placed; it can be a positive number, or a negative number that is smaller than the size of the vector; see {@li...
java
@Override public void setElementAt(E obj, int index) { int idx = getRealIndex(index); super.setElementAt(obj, idx); }
[ "@", "Override", "public", "void", "setElementAt", "(", "E", "obj", ",", "int", "index", ")", "{", "int", "idx", "=", "getRealIndex", "(", "index", ")", ";", "super", ".", "setElementAt", "(", "obj", ",", "idx", ")", ";", "}" ]
Sets the component at the specified index of this vector to be the specified object. @param index the index at which the element will be placed; it can be a positive number, or a negative number that is smaller than the size of the vector; see {@link #getRealIndex(int)}. @param element the new value to store at the sp...
[ "Sets", "the", "component", "at", "the", "specified", "index", "of", "this", "vector", "to", "be", "the", "specified", "object", "." ]
train
https://github.com/dihedron/dihedron-commons/blob/a5194cdaa0d6417ef4aade6ea407a1cad6e8458e/src/main/java/org/dihedron/patterns/activities/TypedVector.java#L288-L292
Abnaxos/markdown-doclet
doclet/jdk8/src/main/java/ch/raffael/mddoclet/Options.java
Options.toExtensions
public static int toExtensions(String extensions) { """ Convert a comma separated list of extension names to an int. Each name is converted to upper case, any '-' is replaced by '_'. The result is expected to be a flag from {@link Extensions}. @param extensions A comma separated list of PegDown extensions....
java
public static int toExtensions(String extensions) { int result = 0; for ( String ext : Splitter.on(',').trimResults().omitEmptyStrings().split(extensions) ) { try { Field f = Extensions.class.getField(ext.replace('-', '_').toUpperCase()); result |= (int)f.get(...
[ "public", "static", "int", "toExtensions", "(", "String", "extensions", ")", "{", "int", "result", "=", "0", ";", "for", "(", "String", "ext", ":", "Splitter", ".", "on", "(", "'", "'", ")", ".", "trimResults", "(", ")", ".", "omitEmptyStrings", "(", ...
Convert a comma separated list of extension names to an int. Each name is converted to upper case, any '-' is replaced by '_'. The result is expected to be a flag from {@link Extensions}. @param extensions A comma separated list of PegDown extensions. @return An `int` representing the enabled Pegdown extensions.
[ "Convert", "a", "comma", "separated", "list", "of", "extension", "names", "to", "an", "int", ".", "Each", "name", "is", "converted", "to", "upper", "case", "any", "-", "is", "replaced", "by", "_", ".", "The", "result", "is", "expected", "to", "be", "a"...
train
https://github.com/Abnaxos/markdown-doclet/blob/e98a9630206fc9c8d813cf2349ff594be8630054/doclet/jdk8/src/main/java/ch/raffael/mddoclet/Options.java#L596-L611
alkacon/opencms-core
src-gwt/org/opencms/ade/contenteditor/client/CmsContentEditor.java
CmsContentEditor.getAttributeHandler
private CmsAttributeHandler getAttributeHandler(String attributeName, List<String> parentPathElements) { """ Returns the attribute handler for the given attribute.<p> @param attributeName the attribute name @param parentPathElements the parent path elements @return the attribute handler """ L...
java
private CmsAttributeHandler getAttributeHandler(String attributeName, List<String> parentPathElements) { List<String> childPathElements = new ArrayList<String>(parentPathElements); childPathElements.add(attributeName); CmsAttributeHandler handler = getRootAttributeHandler().getHandlerByPath...
[ "private", "CmsAttributeHandler", "getAttributeHandler", "(", "String", "attributeName", ",", "List", "<", "String", ">", "parentPathElements", ")", "{", "List", "<", "String", ">", "childPathElements", "=", "new", "ArrayList", "<", "String", ">", "(", "parentPath...
Returns the attribute handler for the given attribute.<p> @param attributeName the attribute name @param parentPathElements the parent path elements @return the attribute handler
[ "Returns", "the", "attribute", "handler", "for", "the", "given", "attribute", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/contenteditor/client/CmsContentEditor.java#L2201-L2208