id
int32
0
165k
repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
150,000
vikingbrain/thedavidbox-client4j
src/main/java/com/vikingbrain/nmt/controller/impl/RemoteHttpServiceImpl.java
RemoteHttpServiceImpl.buildEncodedParameters
private StringBuffer buildEncodedParameters(LinkedHashMap<String, String> params) { StringBuffer parametersUrlGet = new StringBuffer(""); if (null != params) { for (String key : params.keySet()) { String value = params.get(key); String encodedParameter = encodeHttpParameter(value); // It builds something like // "&param1=file%20name%26blues for entry "param1","file name&blues" parametersUrlGet.append("&").append(key).append("=").append(encodedParameter); } } return parametersUrlGet; }
java
private StringBuffer buildEncodedParameters(LinkedHashMap<String, String> params) { StringBuffer parametersUrlGet = new StringBuffer(""); if (null != params) { for (String key : params.keySet()) { String value = params.get(key); String encodedParameter = encodeHttpParameter(value); // It builds something like // "&param1=file%20name%26blues for entry "param1","file name&blues" parametersUrlGet.append("&").append(key).append("=").append(encodedParameter); } } return parametersUrlGet; }
[ "private", "StringBuffer", "buildEncodedParameters", "(", "LinkedHashMap", "<", "String", ",", "String", ">", "params", ")", "{", "StringBuffer", "parametersUrlGet", "=", "new", "StringBuffer", "(", "\"\"", ")", ";", "if", "(", "null", "!=", "params", ")", "{", "for", "(", "String", "key", ":", "params", ".", "keySet", "(", ")", ")", "{", "String", "value", "=", "params", ".", "get", "(", "key", ")", ";", "String", "encodedParameter", "=", "encodeHttpParameter", "(", "value", ")", ";", "// It builds something like", "// \"&param1=file%20name%26blues for entry \"param1\",\"file name&blues\"", "parametersUrlGet", ".", "append", "(", "\"&\"", ")", ".", "append", "(", "key", ")", ".", "append", "(", "\"=\"", ")", ".", "append", "(", "encodedParameter", ")", ";", "}", "}", "return", "parametersUrlGet", ";", "}" ]
It uses the parameters to build the http arguments with name and value. @param params all the parameters with name and value @return the stringbuffer with the http arguments ready to be added to a http request
[ "It", "uses", "the", "parameters", "to", "build", "the", "http", "arguments", "with", "name", "and", "value", "." ]
b2375a59b30fc3bd5dae34316bda68e01d006535
https://github.com/vikingbrain/thedavidbox-client4j/blob/b2375a59b30fc3bd5dae34316bda68e01d006535/src/main/java/com/vikingbrain/nmt/controller/impl/RemoteHttpServiceImpl.java#L87-L102
150,001
icoloma/simpleds
src/main/java/org/simpleds/CursorList.java
CursorList.loadRelatedEntities
public Map<Key, Object> loadRelatedEntities(String... propertyName) { EntityManager entityManager = EntityManagerFactory.getEntityManager(); Class<J> persistentClass = (Class<J>) query.getClassMetadata().getPersistentClass(); Set<Key> keys = Sets.newHashSet(); for (String p : propertyName) { keys.addAll(Collections2.transform(data, new EntityToPropertyFunction(persistentClass, p))); } return entityManager.get(keys); }
java
public Map<Key, Object> loadRelatedEntities(String... propertyName) { EntityManager entityManager = EntityManagerFactory.getEntityManager(); Class<J> persistentClass = (Class<J>) query.getClassMetadata().getPersistentClass(); Set<Key> keys = Sets.newHashSet(); for (String p : propertyName) { keys.addAll(Collections2.transform(data, new EntityToPropertyFunction(persistentClass, p))); } return entityManager.get(keys); }
[ "public", "Map", "<", "Key", ",", "Object", ">", "loadRelatedEntities", "(", "String", "...", "propertyName", ")", "{", "EntityManager", "entityManager", "=", "EntityManagerFactory", ".", "getEntityManager", "(", ")", ";", "Class", "<", "J", ">", "persistentClass", "=", "(", "Class", "<", "J", ">", ")", "query", ".", "getClassMetadata", "(", ")", ".", "getPersistentClass", "(", ")", ";", "Set", "<", "Key", ">", "keys", "=", "Sets", ".", "newHashSet", "(", ")", ";", "for", "(", "String", "p", ":", "propertyName", ")", "{", "keys", ".", "addAll", "(", "Collections2", ".", "transform", "(", "data", ",", "new", "EntityToPropertyFunction", "(", "persistentClass", ",", "p", ")", ")", ")", ";", "}", "return", "entityManager", ".", "get", "(", "keys", ")", ";", "}" ]
Load the list of related entities. @param propertyName the name of the properties to be used as Key @return the list of retrieved entities
[ "Load", "the", "list", "of", "related", "entities", "." ]
b07763df98b9375b764e625f617a6c78df4b068d
https://github.com/icoloma/simpleds/blob/b07763df98b9375b764e625f617a6c78df4b068d/src/main/java/org/simpleds/CursorList.java#L51-L59
150,002
icoloma/simpleds
src/main/java/org/simpleds/CursorList.java
CursorList.filterNullValues
public CursorList<J> filterNullValues() { for (Iterator<J> it = data.iterator(); it.hasNext(); ) { if (it.next() == null) { it.remove(); } } return this; }
java
public CursorList<J> filterNullValues() { for (Iterator<J> it = data.iterator(); it.hasNext(); ) { if (it.next() == null) { it.remove(); } } return this; }
[ "public", "CursorList", "<", "J", ">", "filterNullValues", "(", ")", "{", "for", "(", "Iterator", "<", "J", ">", "it", "=", "data", ".", "iterator", "(", ")", ";", "it", ".", "hasNext", "(", ")", ";", ")", "{", "if", "(", "it", ".", "next", "(", ")", "==", "null", ")", "{", "it", ".", "remove", "(", ")", ";", "}", "}", "return", "this", ";", "}" ]
Remove null values from this collection Be aware that this may result in smaller page size
[ "Remove", "null", "values", "from", "this", "collection", "Be", "aware", "that", "this", "may", "result", "in", "smaller", "page", "size" ]
b07763df98b9375b764e625f617a6c78df4b068d
https://github.com/icoloma/simpleds/blob/b07763df98b9375b764e625f617a6c78df4b068d/src/main/java/org/simpleds/CursorList.java#L162-L169
150,003
mlhartme/mork
src/main/java/net/oneandone/mork/reflect/Composition.java
Composition.getParameterTypes
@Override public Class[] getParameterTypes() { Class[] a, b, result; a = base.getParameterTypes(); b = para.getParameterTypes(); result = new Class[a.length - 1 + b.length]; System.arraycopy(a, 0, result, 0, idx); System.arraycopy(b, 0, result, idx, b.length); System.arraycopy(a, idx + 1, result, idx + b.length, a.length - (idx + 1)); return result; }
java
@Override public Class[] getParameterTypes() { Class[] a, b, result; a = base.getParameterTypes(); b = para.getParameterTypes(); result = new Class[a.length - 1 + b.length]; System.arraycopy(a, 0, result, 0, idx); System.arraycopy(b, 0, result, idx, b.length); System.arraycopy(a, idx + 1, result, idx + b.length, a.length - (idx + 1)); return result; }
[ "@", "Override", "public", "Class", "[", "]", "getParameterTypes", "(", ")", "{", "Class", "[", "]", "a", ",", "b", ",", "result", ";", "a", "=", "base", ".", "getParameterTypes", "(", ")", ";", "b", "=", "para", ".", "getParameterTypes", "(", ")", ";", "result", "=", "new", "Class", "[", "a", ".", "length", "-", "1", "+", "b", ".", "length", "]", ";", "System", ".", "arraycopy", "(", "a", ",", "0", ",", "result", ",", "0", ",", "idx", ")", ";", "System", ".", "arraycopy", "(", "b", ",", "0", ",", "result", ",", "idx", ",", "b", ".", "length", ")", ";", "System", ".", "arraycopy", "(", "a", ",", "idx", "+", "1", ",", "result", ",", "idx", "+", "b", ".", "length", ",", "a", ".", "length", "-", "(", "idx", "+", "1", ")", ")", ";", "return", "result", ";", "}" ]
Gets the argument count. The parameter function takes away 1 argument from the base function, but it adds its own arguments. @return the argument count
[ "Gets", "the", "argument", "count", ".", "The", "parameter", "function", "takes", "away", "1", "argument", "from", "the", "base", "function", "but", "it", "adds", "its", "own", "arguments", "." ]
a069b087750c4133bfeebaf1f599c3bc96762113
https://github.com/mlhartme/mork/blob/a069b087750c4133bfeebaf1f599c3bc96762113/src/main/java/net/oneandone/mork/reflect/Composition.java#L97-L109
150,004
mlhartme/mork
src/main/java/net/oneandone/mork/reflect/Composition.java
Composition.invoke
@Override public Object invoke(Object[] allVals) throws InvocationTargetException { Object[] vals; Object tmp; vals = new Object[paraParaCount]; System.arraycopy(allVals, idx, vals, 0, vals.length); tmp = para.invoke(vals); vals = new Object[baseParaCount]; System.arraycopy(allVals, 0, vals, 0, idx); vals[idx] = tmp; System.arraycopy(allVals, idx + paraParaCount, vals, idx + 1, vals.length - (idx + 1)); return base.invoke(vals); }
java
@Override public Object invoke(Object[] allVals) throws InvocationTargetException { Object[] vals; Object tmp; vals = new Object[paraParaCount]; System.arraycopy(allVals, idx, vals, 0, vals.length); tmp = para.invoke(vals); vals = new Object[baseParaCount]; System.arraycopy(allVals, 0, vals, 0, idx); vals[idx] = tmp; System.arraycopy(allVals, idx + paraParaCount, vals, idx + 1, vals.length - (idx + 1)); return base.invoke(vals); }
[ "@", "Override", "public", "Object", "invoke", "(", "Object", "[", "]", "allVals", ")", "throws", "InvocationTargetException", "{", "Object", "[", "]", "vals", ";", "Object", "tmp", ";", "vals", "=", "new", "Object", "[", "paraParaCount", "]", ";", "System", ".", "arraycopy", "(", "allVals", ",", "idx", ",", "vals", ",", "0", ",", "vals", ".", "length", ")", ";", "tmp", "=", "para", ".", "invoke", "(", "vals", ")", ";", "vals", "=", "new", "Object", "[", "baseParaCount", "]", ";", "System", ".", "arraycopy", "(", "allVals", ",", "0", ",", "vals", ",", "0", ",", "idx", ")", ";", "vals", "[", "idx", "]", "=", "tmp", ";", "System", ".", "arraycopy", "(", "allVals", ",", "idx", "+", "paraParaCount", ",", "vals", ",", "idx", "+", "1", ",", "vals", ".", "length", "-", "(", "idx", "+", "1", ")", ")", ";", "return", "base", ".", "invoke", "(", "vals", ")", ";", "}" ]
Invokes the composed Functions. The computed argument is computed by a call to the parameter Function. @return the result returned by the base Function.
[ "Invokes", "the", "composed", "Functions", ".", "The", "computed", "argument", "is", "computed", "by", "a", "call", "to", "the", "parameter", "Function", "." ]
a069b087750c4133bfeebaf1f599c3bc96762113
https://github.com/mlhartme/mork/blob/a069b087750c4133bfeebaf1f599c3bc96762113/src/main/java/net/oneandone/mork/reflect/Composition.java#L123-L138
150,005
alexholmes/htuple
examples/src/main/java/org/htuple/examples/SecondarySort.java
SecondarySort.run
public int run(final String[] args) throws Exception { String input = args[0]; String output = args[1]; Configuration conf = super.getConf(); writeInput(conf, new Path(input)); setupSecondarySort(conf); Job job = new Job(conf); job.setJarByClass(SecondarySort.class); job.setMapperClass(Map.class); job.setReducerClass(Reduce.class); job.setMapOutputKeyClass(Tuple.class); job.setMapOutputValueClass(Text.class); Path outputPath = new Path(output); FileInputFormat.setInputPaths(job, input); FileOutputFormat.setOutputPath(job, outputPath); if (job.waitForCompletion(true)) { return 0; } return 1; }
java
public int run(final String[] args) throws Exception { String input = args[0]; String output = args[1]; Configuration conf = super.getConf(); writeInput(conf, new Path(input)); setupSecondarySort(conf); Job job = new Job(conf); job.setJarByClass(SecondarySort.class); job.setMapperClass(Map.class); job.setReducerClass(Reduce.class); job.setMapOutputKeyClass(Tuple.class); job.setMapOutputValueClass(Text.class); Path outputPath = new Path(output); FileInputFormat.setInputPaths(job, input); FileOutputFormat.setOutputPath(job, outputPath); if (job.waitForCompletion(true)) { return 0; } return 1; }
[ "public", "int", "run", "(", "final", "String", "[", "]", "args", ")", "throws", "Exception", "{", "String", "input", "=", "args", "[", "0", "]", ";", "String", "output", "=", "args", "[", "1", "]", ";", "Configuration", "conf", "=", "super", ".", "getConf", "(", ")", ";", "writeInput", "(", "conf", ",", "new", "Path", "(", "input", ")", ")", ";", "setupSecondarySort", "(", "conf", ")", ";", "Job", "job", "=", "new", "Job", "(", "conf", ")", ";", "job", ".", "setJarByClass", "(", "SecondarySort", ".", "class", ")", ";", "job", ".", "setMapperClass", "(", "Map", ".", "class", ")", ";", "job", ".", "setReducerClass", "(", "Reduce", ".", "class", ")", ";", "job", ".", "setMapOutputKeyClass", "(", "Tuple", ".", "class", ")", ";", "job", ".", "setMapOutputValueClass", "(", "Text", ".", "class", ")", ";", "Path", "outputPath", "=", "new", "Path", "(", "output", ")", ";", "FileInputFormat", ".", "setInputPaths", "(", "job", ",", "input", ")", ";", "FileOutputFormat", ".", "setOutputPath", "(", "job", ",", "outputPath", ")", ";", "if", "(", "job", ".", "waitForCompletion", "(", "true", ")", ")", "{", "return", "0", ";", "}", "return", "1", ";", "}" ]
The MapReduce driver - setup and launch the job. @param args the command-line arguments @return the process exit code @throws Exception if something goes wrong
[ "The", "MapReduce", "driver", "-", "setup", "and", "launch", "the", "job", "." ]
5aba63f78a4a9bb505ad3de0a5b0b392724644c4
https://github.com/alexholmes/htuple/blob/5aba63f78a4a9bb505ad3de0a5b0b392724644c4/examples/src/main/java/org/htuple/examples/SecondarySort.java#L99-L127
150,006
alexholmes/htuple
examples/src/main/java/org/htuple/examples/SecondarySort.java
SecondarySort.setupSecondarySort
public static void setupSecondarySort(Configuration conf) { ShuffleUtils.configBuilder() .useNewApi() .setPartitionerIndices(TupleFields.LAST_NAME) .setSortIndices(TupleFields.values()) .setGroupIndices(TupleFields.LAST_NAME) .configure(conf); }
java
public static void setupSecondarySort(Configuration conf) { ShuffleUtils.configBuilder() .useNewApi() .setPartitionerIndices(TupleFields.LAST_NAME) .setSortIndices(TupleFields.values()) .setGroupIndices(TupleFields.LAST_NAME) .configure(conf); }
[ "public", "static", "void", "setupSecondarySort", "(", "Configuration", "conf", ")", "{", "ShuffleUtils", ".", "configBuilder", "(", ")", ".", "useNewApi", "(", ")", ".", "setPartitionerIndices", "(", "TupleFields", ".", "LAST_NAME", ")", ".", "setSortIndices", "(", "TupleFields", ".", "values", "(", ")", ")", ".", "setGroupIndices", "(", "TupleFields", ".", "LAST_NAME", ")", ".", "configure", "(", "conf", ")", ";", "}" ]
Partition and group on just the last name; sort on both last and first name. @param conf the Hadoop config
[ "Partition", "and", "group", "on", "just", "the", "last", "name", ";", "sort", "on", "both", "last", "and", "first", "name", "." ]
5aba63f78a4a9bb505ad3de0a5b0b392724644c4
https://github.com/alexholmes/htuple/blob/5aba63f78a4a9bb505ad3de0a5b0b392724644c4/examples/src/main/java/org/htuple/examples/SecondarySort.java#L134-L141
150,007
likethecolor/Alchemy-API
src/main/java/com/likethecolor/alchemy/api/parser/json/TaxonomiesParser.java
TaxonomiesParser.getTaxonomy
private JSONObject getTaxonomy(final JSONArray taxonomies, final int index) { JSONObject object = new JSONObject(); try { object = (JSONObject) taxonomies.get(index); } catch(JSONException e) { e.printStackTrace(); } return object; }
java
private JSONObject getTaxonomy(final JSONArray taxonomies, final int index) { JSONObject object = new JSONObject(); try { object = (JSONObject) taxonomies.get(index); } catch(JSONException e) { e.printStackTrace(); } return object; }
[ "private", "JSONObject", "getTaxonomy", "(", "final", "JSONArray", "taxonomies", ",", "final", "int", "index", ")", "{", "JSONObject", "object", "=", "new", "JSONObject", "(", ")", ";", "try", "{", "object", "=", "(", "JSONObject", ")", "taxonomies", ".", "get", "(", "index", ")", ";", "}", "catch", "(", "JSONException", "e", ")", "{", "e", ".", "printStackTrace", "(", ")", ";", "}", "return", "object", ";", "}" ]
Return a json object from the provided array. Return an empty object if there is any problems fetching the taxonomy data. @param taxonomies array of taxonomy data @param index of the object to fetch @return json object from the provided array
[ "Return", "a", "json", "object", "from", "the", "provided", "array", ".", "Return", "an", "empty", "object", "if", "there", "is", "any", "problems", "fetching", "the", "taxonomy", "data", "." ]
5208cfc92a878ceeaff052787af29da92d98db7e
https://github.com/likethecolor/Alchemy-API/blob/5208cfc92a878ceeaff052787af29da92d98db7e/src/main/java/com/likethecolor/alchemy/api/parser/json/TaxonomiesParser.java#L61-L70
150,008
io7m/jcanephora
com.io7m.jcanephora.renderstate/src/main/java/com/io7m/jcanephora/renderstate/JCGLRenderStates.java
JCGLRenderStates.activate
public static void activate( final JCGLInterfaceGL33Type g, final JCGLRenderStateType r) { NullCheck.notNull(g, "GL interface"); NullCheck.notNull(r, "Render state"); configureBlending(g, r); configureCulling(g, r); configureColorBufferMasking(g, r); configureDepth(g, r); configurePolygonMode(g, r); configureScissor(g, r); configureStencil(g, r); }
java
public static void activate( final JCGLInterfaceGL33Type g, final JCGLRenderStateType r) { NullCheck.notNull(g, "GL interface"); NullCheck.notNull(r, "Render state"); configureBlending(g, r); configureCulling(g, r); configureColorBufferMasking(g, r); configureDepth(g, r); configurePolygonMode(g, r); configureScissor(g, r); configureStencil(g, r); }
[ "public", "static", "void", "activate", "(", "final", "JCGLInterfaceGL33Type", "g", ",", "final", "JCGLRenderStateType", "r", ")", "{", "NullCheck", ".", "notNull", "(", "g", ",", "\"GL interface\"", ")", ";", "NullCheck", ".", "notNull", "(", "r", ",", "\"Render state\"", ")", ";", "configureBlending", "(", "g", ",", "r", ")", ";", "configureCulling", "(", "g", ",", "r", ")", ";", "configureColorBufferMasking", "(", "g", ",", "r", ")", ";", "configureDepth", "(", "g", ",", "r", ")", ";", "configurePolygonMode", "(", "g", ",", "r", ")", ";", "configureScissor", "(", "g", ",", "r", ")", ";", "configureStencil", "(", "g", ",", "r", ")", ";", "}" ]
Activate the given render state. @param g An OpenGL interface @param r A render state
[ "Activate", "the", "given", "render", "state", "." ]
0004c1744b7f0969841d04cd4fa693f402b10980
https://github.com/io7m/jcanephora/blob/0004c1744b7f0969841d04cd4fa693f402b10980/com.io7m.jcanephora.renderstate/src/main/java/com/io7m/jcanephora/renderstate/JCGLRenderStates.java#L52-L66
150,009
mlhartme/mork
src/main/java/net/oneandone/mork/semantics/AgBuffer.java
AgBuffer.merge
public Attribute merge(List<AgBuffer> copyBuffers, int symbol, Type mergedType) { Map<Attribute, Merger> mapping; // map old attribute to merger objects. null: don't merge. List<Merger> mergers; Merger merger; int i; int max; mapping = new HashMap<Attribute, Merger>(); mergers = new ArrayList<Merger>(); max = copyBuffers.size(); for (i = 0; i < max; i++) { copyBuffers.get(i).createMergers(mergers, mapping, mergedType); } runMergers(mergers, mapping); merger = Merger.forSymbol(mergers, symbol); if (merger == null) { throw new IllegalStateException(); } return merger.dest; }
java
public Attribute merge(List<AgBuffer> copyBuffers, int symbol, Type mergedType) { Map<Attribute, Merger> mapping; // map old attribute to merger objects. null: don't merge. List<Merger> mergers; Merger merger; int i; int max; mapping = new HashMap<Attribute, Merger>(); mergers = new ArrayList<Merger>(); max = copyBuffers.size(); for (i = 0; i < max; i++) { copyBuffers.get(i).createMergers(mergers, mapping, mergedType); } runMergers(mergers, mapping); merger = Merger.forSymbol(mergers, symbol); if (merger == null) { throw new IllegalStateException(); } return merger.dest; }
[ "public", "Attribute", "merge", "(", "List", "<", "AgBuffer", ">", "copyBuffers", ",", "int", "symbol", ",", "Type", "mergedType", ")", "{", "Map", "<", "Attribute", ",", "Merger", ">", "mapping", ";", "// map old attribute to merger objects. null: don't merge.", "List", "<", "Merger", ">", "mergers", ";", "Merger", "merger", ";", "int", "i", ";", "int", "max", ";", "mapping", "=", "new", "HashMap", "<", "Attribute", ",", "Merger", ">", "(", ")", ";", "mergers", "=", "new", "ArrayList", "<", "Merger", ">", "(", ")", ";", "max", "=", "copyBuffers", ".", "size", "(", ")", ";", "for", "(", "i", "=", "0", ";", "i", "<", "max", ";", "i", "++", ")", "{", "copyBuffers", ".", "get", "(", "i", ")", ".", "createMergers", "(", "mergers", ",", "mapping", ",", "mergedType", ")", ";", "}", "runMergers", "(", "mergers", ",", "mapping", ")", ";", "merger", "=", "Merger", ".", "forSymbol", "(", "mergers", ",", "symbol", ")", ";", "if", "(", "merger", "==", "null", ")", "{", "throw", "new", "IllegalStateException", "(", ")", ";", "}", "return", "merger", ".", "dest", ";", "}" ]
Merge all attributes with &gt;0 attributions buffers. Return the merged attribute of the specified symbol.
[ "Merge", "all", "attributes", "with", "&gt", ";", "0", "attributions", "buffers", ".", "Return", "the", "merged", "attribute", "of", "the", "specified", "symbol", "." ]
a069b087750c4133bfeebaf1f599c3bc96762113
https://github.com/mlhartme/mork/blob/a069b087750c4133bfeebaf1f599c3bc96762113/src/main/java/net/oneandone/mork/semantics/AgBuffer.java#L155-L174
150,010
mlhartme/mork
src/main/java/net/oneandone/mork/semantics/AgBuffer.java
AgBuffer.localCompare
private int localCompare( Attribute left, Attribute right, AgBuffer rightSemantics, List<Attribute> nextLefts, List<Attribute> nextRights) { State leftState; State rightState; if (left.symbol != right.symbol) { throw new IllegalStateException(); } leftState = lookup(left); rightState = rightSemantics.lookup(right); if (leftState == null && rightState == null) { return EQ; } if (leftState == null || rightState == null) { throw new IllegalStateException("different number of productions"); } return leftState.compare(rightState, nextLefts, nextRights); }
java
private int localCompare( Attribute left, Attribute right, AgBuffer rightSemantics, List<Attribute> nextLefts, List<Attribute> nextRights) { State leftState; State rightState; if (left.symbol != right.symbol) { throw new IllegalStateException(); } leftState = lookup(left); rightState = rightSemantics.lookup(right); if (leftState == null && rightState == null) { return EQ; } if (leftState == null || rightState == null) { throw new IllegalStateException("different number of productions"); } return leftState.compare(rightState, nextLefts, nextRights); }
[ "private", "int", "localCompare", "(", "Attribute", "left", ",", "Attribute", "right", ",", "AgBuffer", "rightSemantics", ",", "List", "<", "Attribute", ">", "nextLefts", ",", "List", "<", "Attribute", ">", "nextRights", ")", "{", "State", "leftState", ";", "State", "rightState", ";", "if", "(", "left", ".", "symbol", "!=", "right", ".", "symbol", ")", "{", "throw", "new", "IllegalStateException", "(", ")", ";", "}", "leftState", "=", "lookup", "(", "left", ")", ";", "rightState", "=", "rightSemantics", ".", "lookup", "(", "right", ")", ";", "if", "(", "leftState", "==", "null", "&&", "rightState", "==", "null", ")", "{", "return", "EQ", ";", "}", "if", "(", "leftState", "==", "null", "||", "rightState", "==", "null", ")", "{", "throw", "new", "IllegalStateException", "(", "\"different number of productions\"", ")", ";", "}", "return", "leftState", ".", "compare", "(", "rightState", ",", "nextLefts", ",", "nextRights", ")", ";", "}" ]
Adds only states to left and right that are reached by eq states Never returns ALT.
[ "Adds", "only", "states", "to", "left", "and", "right", "that", "are", "reached", "by", "eq", "states", "Never", "returns", "ALT", "." ]
a069b087750c4133bfeebaf1f599c3bc96762113
https://github.com/mlhartme/mork/blob/a069b087750c4133bfeebaf1f599c3bc96762113/src/main/java/net/oneandone/mork/semantics/AgBuffer.java#L267-L285
150,011
mlhartme/mork
src/main/java/net/oneandone/mork/semantics/AgBuffer.java
AgBuffer.cloneAttributes
public Attribute cloneAttributes(AgBuffer orig, Type type, Attribute seed) { Map<Attribute, Attribute> map; // old attributes to new attributes Attribute attr; State newState; map = new HashMap<Attribute, Attribute>(); for (State state : orig.states) { attr = state.getAttribute(); map.put(attr, new Attribute(attr.symbol, null, type)); } for (State state : orig.states) { newState = state.cloneAttributeTransport(map); states.add(newState); } attr = map.get(seed); if (attr == null) { throw new IllegalArgumentException(); } return attr; }
java
public Attribute cloneAttributes(AgBuffer orig, Type type, Attribute seed) { Map<Attribute, Attribute> map; // old attributes to new attributes Attribute attr; State newState; map = new HashMap<Attribute, Attribute>(); for (State state : orig.states) { attr = state.getAttribute(); map.put(attr, new Attribute(attr.symbol, null, type)); } for (State state : orig.states) { newState = state.cloneAttributeTransport(map); states.add(newState); } attr = map.get(seed); if (attr == null) { throw new IllegalArgumentException(); } return attr; }
[ "public", "Attribute", "cloneAttributes", "(", "AgBuffer", "orig", ",", "Type", "type", ",", "Attribute", "seed", ")", "{", "Map", "<", "Attribute", ",", "Attribute", ">", "map", ";", "// old attributes to new attributes", "Attribute", "attr", ";", "State", "newState", ";", "map", "=", "new", "HashMap", "<", "Attribute", ",", "Attribute", ">", "(", ")", ";", "for", "(", "State", "state", ":", "orig", ".", "states", ")", "{", "attr", "=", "state", ".", "getAttribute", "(", ")", ";", "map", ".", "put", "(", "attr", ",", "new", "Attribute", "(", "attr", ".", "symbol", ",", "null", ",", "type", ")", ")", ";", "}", "for", "(", "State", "state", ":", "orig", ".", "states", ")", "{", "newState", "=", "state", ".", "cloneAttributeTransport", "(", "map", ")", ";", "states", ".", "add", "(", "newState", ")", ";", "}", "attr", "=", "map", ".", "get", "(", "seed", ")", ";", "if", "(", "attr", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", ")", ";", "}", "return", "attr", ";", "}" ]
Clones this buffer but replaces all transport attributes with new attributes of the specified type. @param type for new attributes @return cloned seed
[ "Clones", "this", "buffer", "but", "replaces", "all", "transport", "attributes", "with", "new", "attributes", "of", "the", "specified", "type", "." ]
a069b087750c4133bfeebaf1f599c3bc96762113
https://github.com/mlhartme/mork/blob/a069b087750c4133bfeebaf1f599c3bc96762113/src/main/java/net/oneandone/mork/semantics/AgBuffer.java#L315-L334
150,012
dhemery/hartley
src/main/java/com/dhemery/configuring/LoadProperties.java
LoadProperties.into
public void into(Map<String, String> map) { for (String name : properties.stringPropertyNames()) { map.put(name, properties.getProperty(name)); } }
java
public void into(Map<String, String> map) { for (String name : properties.stringPropertyNames()) { map.put(name, properties.getProperty(name)); } }
[ "public", "void", "into", "(", "Map", "<", "String", ",", "String", ">", "map", ")", "{", "for", "(", "String", "name", ":", "properties", ".", "stringPropertyNames", "(", ")", ")", "{", "map", ".", "put", "(", "name", ",", "properties", ".", "getProperty", "(", "name", ")", ")", ";", "}", "}" ]
Copy the loaded properties into a map.
[ "Copy", "the", "loaded", "properties", "into", "a", "map", "." ]
7754bd6bc12695f2249601b8890da530a61fcf33
https://github.com/dhemery/hartley/blob/7754bd6bc12695f2249601b8890da530a61fcf33/src/main/java/com/dhemery/configuring/LoadProperties.java#L46-L50
150,013
dhemery/hartley
src/main/java/com/dhemery/configuring/LoadProperties.java
LoadProperties.into
public void into(Properties properties) { for (String name : this.properties.stringPropertyNames()) { properties.setProperty(name, this.properties.getProperty(name)); } }
java
public void into(Properties properties) { for (String name : this.properties.stringPropertyNames()) { properties.setProperty(name, this.properties.getProperty(name)); } }
[ "public", "void", "into", "(", "Properties", "properties", ")", "{", "for", "(", "String", "name", ":", "this", ".", "properties", ".", "stringPropertyNames", "(", ")", ")", "{", "properties", ".", "setProperty", "(", "name", ",", "this", ".", "properties", ".", "getProperty", "(", "name", ")", ")", ";", "}", "}" ]
Copy the loaded properties into a properties list.
[ "Copy", "the", "loaded", "properties", "into", "a", "properties", "list", "." ]
7754bd6bc12695f2249601b8890da530a61fcf33
https://github.com/dhemery/hartley/blob/7754bd6bc12695f2249601b8890da530a61fcf33/src/main/java/com/dhemery/configuring/LoadProperties.java#L55-L59
150,014
gondor/kbop
src/main/java/org/pacesys/kbop/internal/PoolableObjects.java
PoolableObjects.free
public void free(IPooledObject<V> borrowedObject, boolean reusable) { if (borrowedObject == null) return; if (borrowed.remove(borrowedObject)) { ((PoolableObject<V>)borrowedObject).releaseOwner(); if (reusable) available.addFirst((PoolableObject<V>)borrowedObject); } }
java
public void free(IPooledObject<V> borrowedObject, boolean reusable) { if (borrowedObject == null) return; if (borrowed.remove(borrowedObject)) { ((PoolableObject<V>)borrowedObject).releaseOwner(); if (reusable) available.addFirst((PoolableObject<V>)borrowedObject); } }
[ "public", "void", "free", "(", "IPooledObject", "<", "V", ">", "borrowedObject", ",", "boolean", "reusable", ")", "{", "if", "(", "borrowedObject", "==", "null", ")", "return", ";", "if", "(", "borrowed", ".", "remove", "(", "borrowedObject", ")", ")", "{", "(", "(", "PoolableObject", "<", "V", ">", ")", "borrowedObject", ")", ".", "releaseOwner", "(", ")", ";", "if", "(", "reusable", ")", "available", ".", "addFirst", "(", "(", "PoolableObject", "<", "V", ">", ")", "borrowedObject", ")", ";", "}", "}" ]
Frees the borrowed object from the internal Pool @param borrowedObject the borrowed object to free @param reusable true if the object can be recycled and used for future allocations
[ "Frees", "the", "borrowed", "object", "from", "the", "internal", "Pool" ]
a176fd845f1e146610f03a1cb3cb0d661ebf4faa
https://github.com/gondor/kbop/blob/a176fd845f1e146610f03a1cb3cb0d661ebf4faa/src/main/java/org/pacesys/kbop/internal/PoolableObjects.java#L37-L46
150,015
gondor/kbop
src/main/java/org/pacesys/kbop/internal/PoolableObjects.java
PoolableObjects.getFree
public PoolableObject<V> getFree() { if (!borrowed.isEmpty()) { for (PoolableObject<V> bo : borrowed) { if (bo.isCurrentOwner()) return bo; } } if (!available.isEmpty()) { PoolableObject<V> obj = available.remove(); borrowed.add(obj); return obj; } return null; }
java
public PoolableObject<V> getFree() { if (!borrowed.isEmpty()) { for (PoolableObject<V> bo : borrowed) { if (bo.isCurrentOwner()) return bo; } } if (!available.isEmpty()) { PoolableObject<V> obj = available.remove(); borrowed.add(obj); return obj; } return null; }
[ "public", "PoolableObject", "<", "V", ">", "getFree", "(", ")", "{", "if", "(", "!", "borrowed", ".", "isEmpty", "(", ")", ")", "{", "for", "(", "PoolableObject", "<", "V", ">", "bo", ":", "borrowed", ")", "{", "if", "(", "bo", ".", "isCurrentOwner", "(", ")", ")", "return", "bo", ";", "}", "}", "if", "(", "!", "available", ".", "isEmpty", "(", ")", ")", "{", "PoolableObject", "<", "V", ">", "obj", "=", "available", ".", "remove", "(", ")", ";", "borrowed", ".", "add", "(", "obj", ")", ";", "return", "obj", ";", "}", "return", "null", ";", "}" ]
Finds an available Poolable Object to borrow @return Poolable Object or null if we couldn't allocate
[ "Finds", "an", "available", "Poolable", "Object", "to", "borrow" ]
a176fd845f1e146610f03a1cb3cb0d661ebf4faa
https://github.com/gondor/kbop/blob/a176fd845f1e146610f03a1cb3cb0d661ebf4faa/src/main/java/org/pacesys/kbop/internal/PoolableObjects.java#L53-L66
150,016
gondor/kbop
src/main/java/org/pacesys/kbop/internal/PoolableObjects.java
PoolableObjects.add
public PoolableObject<V> add(final PoolableObject<V> entry) { borrowed.add(entry); return entry; }
java
public PoolableObject<V> add(final PoolableObject<V> entry) { borrowed.add(entry); return entry; }
[ "public", "PoolableObject", "<", "V", ">", "add", "(", "final", "PoolableObject", "<", "V", ">", "entry", ")", "{", "borrowed", ".", "add", "(", "entry", ")", ";", "return", "entry", ";", "}" ]
Adds the Poolable Object to the borrowed list @param entry the entry @return the poolable object
[ "Adds", "the", "Poolable", "Object", "to", "the", "borrowed", "list" ]
a176fd845f1e146610f03a1cb3cb0d661ebf4faa
https://github.com/gondor/kbop/blob/a176fd845f1e146610f03a1cb3cb0d661ebf4faa/src/main/java/org/pacesys/kbop/internal/PoolableObjects.java#L74-L77
150,017
vikingbrain/thedavidbox-client4j
src/main/java/com/vikingbrain/nmt/responses/downloadmanager/ResponseGetDownloadAgentStatus.java
ResponseGetDownloadAgentStatus.getDownloadAgentStatus
public final TypeDownloadAgentStatus getDownloadAgentStatus(){ //Initialization with default status to unknown TypeDownloadAgentStatus typeStatus = TypeDownloadAgentStatus.UNKNOWN; //Find the type by the error id TypeDownloadAgentStatus typeStatusFoundByCode = TypeDownloadAgentStatus.findById(status); if (null != typeStatusFoundByCode){ typeStatus = typeStatusFoundByCode; } return typeStatus; }
java
public final TypeDownloadAgentStatus getDownloadAgentStatus(){ //Initialization with default status to unknown TypeDownloadAgentStatus typeStatus = TypeDownloadAgentStatus.UNKNOWN; //Find the type by the error id TypeDownloadAgentStatus typeStatusFoundByCode = TypeDownloadAgentStatus.findById(status); if (null != typeStatusFoundByCode){ typeStatus = typeStatusFoundByCode; } return typeStatus; }
[ "public", "final", "TypeDownloadAgentStatus", "getDownloadAgentStatus", "(", ")", "{", "//Initialization with default status to unknown\r", "TypeDownloadAgentStatus", "typeStatus", "=", "TypeDownloadAgentStatus", ".", "UNKNOWN", ";", "//Find the type by the error id\r", "TypeDownloadAgentStatus", "typeStatusFoundByCode", "=", "TypeDownloadAgentStatus", ".", "findById", "(", "status", ")", ";", "if", "(", "null", "!=", "typeStatusFoundByCode", ")", "{", "typeStatus", "=", "typeStatusFoundByCode", ";", "}", "return", "typeStatus", ";", "}" ]
Get the status for the download agent. @return type for the download agent status
[ "Get", "the", "status", "for", "the", "download", "agent", "." ]
b2375a59b30fc3bd5dae34316bda68e01d006535
https://github.com/vikingbrain/thedavidbox-client4j/blob/b2375a59b30fc3bd5dae34316bda68e01d006535/src/main/java/com/vikingbrain/nmt/responses/downloadmanager/ResponseGetDownloadAgentStatus.java#L47-L56
150,018
mlhartme/mork
src/main/java/net/oneandone/mork/semantics/Layout.java
Layout.locate
public int locate(Attribute attr) { List lst; int i; int max; if (attr.symbol < attrs.size()) { lst = (List) attrs.get(attr.symbol); max = lst.size(); for (i = 0; i < max; i++) { if (attr == lst.get(i)) { return i; } } } return -1; }
java
public int locate(Attribute attr) { List lst; int i; int max; if (attr.symbol < attrs.size()) { lst = (List) attrs.get(attr.symbol); max = lst.size(); for (i = 0; i < max; i++) { if (attr == lst.get(i)) { return i; } } } return -1; }
[ "public", "int", "locate", "(", "Attribute", "attr", ")", "{", "List", "lst", ";", "int", "i", ";", "int", "max", ";", "if", "(", "attr", ".", "symbol", "<", "attrs", ".", "size", "(", ")", ")", "{", "lst", "=", "(", "List", ")", "attrs", ".", "get", "(", "attr", ".", "symbol", ")", ";", "max", "=", "lst", ".", "size", "(", ")", ";", "for", "(", "i", "=", "0", ";", "i", "<", "max", ";", "i", "++", ")", "{", "if", "(", "attr", "==", "lst", ".", "get", "(", "i", ")", ")", "{", "return", "i", ";", "}", "}", "}", "return", "-", "1", ";", "}" ]
returns location or -1
[ "returns", "location", "or", "-", "1" ]
a069b087750c4133bfeebaf1f599c3bc96762113
https://github.com/mlhartme/mork/blob/a069b087750c4133bfeebaf1f599c3bc96762113/src/main/java/net/oneandone/mork/semantics/Layout.java#L36-L51
150,019
mlhartme/mork
src/main/java/net/oneandone/mork/semantics/Layout.java
Layout.add
public void add(Attribute attr) { int symbol; List<Attribute> lst; if (locate(attr) == -1) { symbol = attr.symbol; while (attrs.size() <= symbol) { attrs.add(new ArrayList<Attribute>()); } lst = attrs.get(symbol); lst.add(attr); } }
java
public void add(Attribute attr) { int symbol; List<Attribute> lst; if (locate(attr) == -1) { symbol = attr.symbol; while (attrs.size() <= symbol) { attrs.add(new ArrayList<Attribute>()); } lst = attrs.get(symbol); lst.add(attr); } }
[ "public", "void", "add", "(", "Attribute", "attr", ")", "{", "int", "symbol", ";", "List", "<", "Attribute", ">", "lst", ";", "if", "(", "locate", "(", "attr", ")", "==", "-", "1", ")", "{", "symbol", "=", "attr", ".", "symbol", ";", "while", "(", "attrs", ".", "size", "(", ")", "<=", "symbol", ")", "{", "attrs", ".", "add", "(", "new", "ArrayList", "<", "Attribute", ">", "(", ")", ")", ";", "}", "lst", "=", "attrs", ".", "get", "(", "symbol", ")", ";", "lst", ".", "add", "(", "attr", ")", ";", "}", "}" ]
adds if new ...
[ "adds", "if", "new", "..." ]
a069b087750c4133bfeebaf1f599c3bc96762113
https://github.com/mlhartme/mork/blob/a069b087750c4133bfeebaf1f599c3bc96762113/src/main/java/net/oneandone/mork/semantics/Layout.java#L88-L100
150,020
mlhartme/mork
src/main/java/net/oneandone/mork/reflect/Field.java
Field.forName
public static Field forName(Class cl, String name) { java.lang.reflect.Field result; try { result = cl.getDeclaredField(name); } catch (NoSuchFieldException e) { return null; } return create(result); }
java
public static Field forName(Class cl, String name) { java.lang.reflect.Field result; try { result = cl.getDeclaredField(name); } catch (NoSuchFieldException e) { return null; } return create(result); }
[ "public", "static", "Field", "forName", "(", "Class", "cl", ",", "String", "name", ")", "{", "java", ".", "lang", ".", "reflect", ".", "Field", "result", ";", "try", "{", "result", "=", "cl", ".", "getDeclaredField", "(", "name", ")", ";", "}", "catch", "(", "NoSuchFieldException", "e", ")", "{", "return", "null", ";", "}", "return", "create", "(", "result", ")", ";", "}" ]
Creates a Field if it the Java Field has valid modifiers. @param cl Class containing the Java field @param name of the field @return Field or null
[ "Creates", "a", "Field", "if", "it", "the", "Java", "Field", "has", "valid", "modifiers", "." ]
a069b087750c4133bfeebaf1f599c3bc96762113
https://github.com/mlhartme/mork/blob/a069b087750c4133bfeebaf1f599c3bc96762113/src/main/java/net/oneandone/mork/reflect/Field.java#L61-L71
150,021
mlhartme/mork
src/main/java/net/oneandone/mork/reflect/Field.java
Field.invoke
@Override public Object invoke(Object[] vals) { try { if (isStatic()) { return field.get(null); } else { return field.get(vals[0]); } } catch (IllegalArgumentException e) { throw e; } catch (IllegalAccessException e) { // constructor should prevent this throw new RuntimeException("can't access field"); } }
java
@Override public Object invoke(Object[] vals) { try { if (isStatic()) { return field.get(null); } else { return field.get(vals[0]); } } catch (IllegalArgumentException e) { throw e; } catch (IllegalAccessException e) { // constructor should prevent this throw new RuntimeException("can't access field"); } }
[ "@", "Override", "public", "Object", "invoke", "(", "Object", "[", "]", "vals", ")", "{", "try", "{", "if", "(", "isStatic", "(", ")", ")", "{", "return", "field", ".", "get", "(", "null", ")", ";", "}", "else", "{", "return", "field", ".", "get", "(", "vals", "[", "0", "]", ")", ";", "}", "}", "catch", "(", "IllegalArgumentException", "e", ")", "{", "throw", "e", ";", "}", "catch", "(", "IllegalAccessException", "e", ")", "{", "// constructor should prevent this", "throw", "new", "RuntimeException", "(", "\"can't access field\"", ")", ";", "}", "}" ]
Reads this Field. @param vals an array of length null, or an array with the Object containing this Java Field @return the Object stored in the Java Field
[ "Reads", "this", "Field", "." ]
a069b087750c4133bfeebaf1f599c3bc96762113
https://github.com/mlhartme/mork/blob/a069b087750c4133bfeebaf1f599c3bc96762113/src/main/java/net/oneandone/mork/reflect/Field.java#L145-L159
150,022
mlhartme/mork
src/main/java/net/oneandone/mork/reflect/Field.java
Field.write
public static void write(ObjectOutput out, java.lang.reflect.Field field) throws IOException { if (field == null) { ClassRef.write(out, null); } else { ClassRef.write(out, field.getDeclaringClass()); out.writeUTF(field.getName()); } }
java
public static void write(ObjectOutput out, java.lang.reflect.Field field) throws IOException { if (field == null) { ClassRef.write(out, null); } else { ClassRef.write(out, field.getDeclaringClass()); out.writeUTF(field.getName()); } }
[ "public", "static", "void", "write", "(", "ObjectOutput", "out", ",", "java", ".", "lang", ".", "reflect", ".", "Field", "field", ")", "throws", "IOException", "{", "if", "(", "field", "==", "null", ")", "{", "ClassRef", ".", "write", "(", "out", ",", "null", ")", ";", "}", "else", "{", "ClassRef", ".", "write", "(", "out", ",", "field", ".", "getDeclaringClass", "(", ")", ")", ";", "out", ".", "writeUTF", "(", "field", ".", "getName", "(", ")", ")", ";", "}", "}" ]
Writes a Java Field. @param out target to write to @param field Java Field to be written
[ "Writes", "a", "Java", "Field", "." ]
a069b087750c4133bfeebaf1f599c3bc96762113
https://github.com/mlhartme/mork/blob/a069b087750c4133bfeebaf1f599c3bc96762113/src/main/java/net/oneandone/mork/reflect/Field.java#L190-L197
150,023
mlhartme/mork
src/main/java/net/oneandone/mork/reflect/Field.java
Field.read
public static java.lang.reflect.Field read(ObjectInput in) throws ClassNotFoundException, NoSuchFieldException, IOException { Class cl; String name; cl = ClassRef.read(in); if (cl == null) { return null; } else { name = in.readUTF(); return cl.getDeclaredField(name); } }
java
public static java.lang.reflect.Field read(ObjectInput in) throws ClassNotFoundException, NoSuchFieldException, IOException { Class cl; String name; cl = ClassRef.read(in); if (cl == null) { return null; } else { name = in.readUTF(); return cl.getDeclaredField(name); } }
[ "public", "static", "java", ".", "lang", ".", "reflect", ".", "Field", "read", "(", "ObjectInput", "in", ")", "throws", "ClassNotFoundException", ",", "NoSuchFieldException", ",", "IOException", "{", "Class", "cl", ";", "String", "name", ";", "cl", "=", "ClassRef", ".", "read", "(", "in", ")", ";", "if", "(", "cl", "==", "null", ")", "{", "return", "null", ";", "}", "else", "{", "name", "=", "in", ".", "readUTF", "(", ")", ";", "return", "cl", ".", "getDeclaredField", "(", "name", ")", ";", "}", "}" ]
Reads a Java Field. @param in source to read from @return the Java Field read
[ "Reads", "a", "Java", "Field", "." ]
a069b087750c4133bfeebaf1f599c3bc96762113
https://github.com/mlhartme/mork/blob/a069b087750c4133bfeebaf1f599c3bc96762113/src/main/java/net/oneandone/mork/reflect/Field.java#L204-L216
150,024
BellaDati/belladati-sdk-api
src/main/java/com/belladati/sdk/dataset/data/DataTable.java
DataTable.createRow
public DataTable createRow(String... values) throws TooManyColumnsException { rows.add(new DataRow(columns).setAll(values)); return this; }
java
public DataTable createRow(String... values) throws TooManyColumnsException { rows.add(new DataRow(columns).setAll(values)); return this; }
[ "public", "DataTable", "createRow", "(", "String", "...", "values", ")", "throws", "TooManyColumnsException", "{", "rows", ".", "add", "(", "new", "DataRow", "(", "columns", ")", ".", "setAll", "(", "values", ")", ")", ";", "return", "this", ";", "}" ]
Creates a new row in the table containing the given values. @param values the column values to set @return this table, to allow chaining @throws TooManyColumnsException if more values are given than columns are available
[ "Creates", "a", "new", "row", "in", "the", "table", "containing", "the", "given", "values", "." ]
ec45a42048d8255838ad0200aa6784a8e8a121c1
https://github.com/BellaDati/belladati-sdk-api/blob/ec45a42048d8255838ad0200aa6784a8e8a121c1/src/main/java/com/belladati/sdk/dataset/data/DataTable.java#L113-L116
150,025
BellaDati/belladati-sdk-api
src/main/java/com/belladati/sdk/dataset/data/DataTable.java
DataTable.createRow
public DataRow createRow() { DataRow row = new DataRow(columns); rows.add(row); return row; }
java
public DataRow createRow() { DataRow row = new DataRow(columns); rows.add(row); return row; }
[ "public", "DataRow", "createRow", "(", ")", "{", "DataRow", "row", "=", "new", "DataRow", "(", "columns", ")", ";", "rows", ".", "add", "(", "row", ")", ";", "return", "row", ";", "}" ]
Creates a new, empty row in the table. @return the newly created row
[ "Creates", "a", "new", "empty", "row", "in", "the", "table", "." ]
ec45a42048d8255838ad0200aa6784a8e8a121c1
https://github.com/BellaDati/belladati-sdk-api/blob/ec45a42048d8255838ad0200aa6784a8e8a121c1/src/main/java/com/belladati/sdk/dataset/data/DataTable.java#L123-L127
150,026
BellaDati/belladati-sdk-api
src/main/java/com/belladati/sdk/dataset/data/DataTable.java
DataTable.assertAttributeExists
private void assertAttributeExists(String attribute) throws UnknownColumnException { for (DataColumn column : columns) { if (column.getCode().equals(attribute)) { return; } } throw new UnknownColumnException(attribute); }
java
private void assertAttributeExists(String attribute) throws UnknownColumnException { for (DataColumn column : columns) { if (column.getCode().equals(attribute)) { return; } } throw new UnknownColumnException(attribute); }
[ "private", "void", "assertAttributeExists", "(", "String", "attribute", ")", "throws", "UnknownColumnException", "{", "for", "(", "DataColumn", "column", ":", "columns", ")", "{", "if", "(", "column", ".", "getCode", "(", ")", ".", "equals", "(", "attribute", ")", ")", "{", "return", ";", "}", "}", "throw", "new", "UnknownColumnException", "(", "attribute", ")", ";", "}" ]
Asserts that the given attribute exists as a column in this table. @param attribute the attribute to find @throws UnknownColumnException if the attribute doesn't exist
[ "Asserts", "that", "the", "given", "attribute", "exists", "as", "a", "column", "in", "this", "table", "." ]
ec45a42048d8255838ad0200aa6784a8e8a121c1
https://github.com/BellaDati/belladati-sdk-api/blob/ec45a42048d8255838ad0200aa6784a8e8a121c1/src/main/java/com/belladati/sdk/dataset/data/DataTable.java#L192-L199
150,027
BellaDati/belladati-sdk-api
src/main/java/com/belladati/sdk/dataset/data/DataTable.java
DataTable.toJson
public JsonNode toJson() { ObjectMapper mapper = new ObjectMapper(); ObjectNode node = mapper.createObjectNode(); ArrayNode columnsNode = mapper.createArrayNode(); for (DataColumn column : columns) { columnsNode.add(column.toJson()); } ArrayNode dataNode = mapper.createArrayNode(); for (DataRow row : rows) { dataNode.add(row.toJson()); } node.put("columns", columnsNode); node.put("data", dataNode); node.put("overwrite", overwritePolicy.toJson()); if (templateId != null) { node.put("templateId", templateId); } if (splitByColumn != null) { node.put("splitByColumn", splitByColumn); } return node; }
java
public JsonNode toJson() { ObjectMapper mapper = new ObjectMapper(); ObjectNode node = mapper.createObjectNode(); ArrayNode columnsNode = mapper.createArrayNode(); for (DataColumn column : columns) { columnsNode.add(column.toJson()); } ArrayNode dataNode = mapper.createArrayNode(); for (DataRow row : rows) { dataNode.add(row.toJson()); } node.put("columns", columnsNode); node.put("data", dataNode); node.put("overwrite", overwritePolicy.toJson()); if (templateId != null) { node.put("templateId", templateId); } if (splitByColumn != null) { node.put("splitByColumn", splitByColumn); } return node; }
[ "public", "JsonNode", "toJson", "(", ")", "{", "ObjectMapper", "mapper", "=", "new", "ObjectMapper", "(", ")", ";", "ObjectNode", "node", "=", "mapper", ".", "createObjectNode", "(", ")", ";", "ArrayNode", "columnsNode", "=", "mapper", ".", "createArrayNode", "(", ")", ";", "for", "(", "DataColumn", "column", ":", "columns", ")", "{", "columnsNode", ".", "add", "(", "column", ".", "toJson", "(", ")", ")", ";", "}", "ArrayNode", "dataNode", "=", "mapper", ".", "createArrayNode", "(", ")", ";", "for", "(", "DataRow", "row", ":", "rows", ")", "{", "dataNode", ".", "add", "(", "row", ".", "toJson", "(", ")", ")", ";", "}", "node", ".", "put", "(", "\"columns\"", ",", "columnsNode", ")", ";", "node", ".", "put", "(", "\"data\"", ",", "dataNode", ")", ";", "node", ".", "put", "(", "\"overwrite\"", ",", "overwritePolicy", ".", "toJson", "(", ")", ")", ";", "if", "(", "templateId", "!=", "null", ")", "{", "node", ".", "put", "(", "\"templateId\"", ",", "templateId", ")", ";", "}", "if", "(", "splitByColumn", "!=", "null", ")", "{", "node", ".", "put", "(", "\"splitByColumn\"", ",", "splitByColumn", ")", ";", "}", "return", "node", ";", "}" ]
Returns this table in JSON representation. @return this table in JSON representation
[ "Returns", "this", "table", "in", "JSON", "representation", "." ]
ec45a42048d8255838ad0200aa6784a8e8a121c1
https://github.com/BellaDati/belladati-sdk-api/blob/ec45a42048d8255838ad0200aa6784a8e8a121c1/src/main/java/com/belladati/sdk/dataset/data/DataTable.java#L215-L238
150,028
leadware/jpersistence-tools
jpersistence-tools-core/src/main/java/net/leadware/persistence/tools/core/dao/utils/DAOValidatorMethodExpressionExecutor.java
DAOValidatorMethodExpressionExecutor.ctxClassName
public String ctxClassName(Object object) { // Si le nom est null if(object == null) return Object.class.getName(); // On retourne le nom de la classe return object.getClass().getName(); }
java
public String ctxClassName(Object object) { // Si le nom est null if(object == null) return Object.class.getName(); // On retourne le nom de la classe return object.getClass().getName(); }
[ "public", "String", "ctxClassName", "(", "Object", "object", ")", "{", "// Si le nom est null\r", "if", "(", "object", "==", "null", ")", "return", "Object", ".", "class", ".", "getName", "(", ")", ";", "// On retourne le nom de la classe\r", "return", "object", ".", "getClass", "(", ")", ".", "getName", "(", ")", ";", "}" ]
Methode d'obtention du nom de la classe d'un Object @param object Objet dont on recherche le nom de classe @return Nom de la classe de l'Objet
[ "Methode", "d", "obtention", "du", "nom", "de", "la", "classe", "d", "un", "Object" ]
4c15372993584579d7dbb9b23dd4c0c0fdc9e789
https://github.com/leadware/jpersistence-tools/blob/4c15372993584579d7dbb9b23dd4c0c0fdc9e789/jpersistence-tools-core/src/main/java/net/leadware/persistence/tools/core/dao/utils/DAOValidatorMethodExpressionExecutor.java#L91-L98
150,029
leadware/jpersistence-tools
jpersistence-tools-core/src/main/java/net/leadware/persistence/tools/core/dao/utils/DAOValidatorMethodExpressionExecutor.java
DAOValidatorMethodExpressionExecutor.invoke
public Object invoke(String methodName, Object...parameters) { // Si le nom de la methode est vide if(methodName == null || methodName.trim().length() == 0) return null; // Obtention de la methode Method method = methods.get(methodName.trim()); // Si la methode n'existe pas if(method == null) return null; try { // Apel Object result = method.invoke(this, parameters); // On retourne le resultat return result; } catch (Exception e) { // On retourne null return null; } }
java
public Object invoke(String methodName, Object...parameters) { // Si le nom de la methode est vide if(methodName == null || methodName.trim().length() == 0) return null; // Obtention de la methode Method method = methods.get(methodName.trim()); // Si la methode n'existe pas if(method == null) return null; try { // Apel Object result = method.invoke(this, parameters); // On retourne le resultat return result; } catch (Exception e) { // On retourne null return null; } }
[ "public", "Object", "invoke", "(", "String", "methodName", ",", "Object", "...", "parameters", ")", "{", "// Si le nom de la methode est vide\r", "if", "(", "methodName", "==", "null", "||", "methodName", ".", "trim", "(", ")", ".", "length", "(", ")", "==", "0", ")", "return", "null", ";", "// Obtention de la methode\r", "Method", "method", "=", "methods", ".", "get", "(", "methodName", ".", "trim", "(", ")", ")", ";", "// Si la methode n'existe pas\r", "if", "(", "method", "==", "null", ")", "return", "null", ";", "try", "{", "// Apel\r", "Object", "result", "=", "method", ".", "invoke", "(", "this", ",", "parameters", ")", ";", "// On retourne le resultat\r", "return", "result", ";", "}", "catch", "(", "Exception", "e", ")", "{", "// On retourne null\r", "return", "null", ";", "}", "}" ]
Methode d'execution de la methode @param methodName Nom de la methode a executer @param parameters Parametres de la methode @return Valeur de retour
[ "Methode", "d", "execution", "de", "la", "methode" ]
4c15372993584579d7dbb9b23dd4c0c0fdc9e789
https://github.com/leadware/jpersistence-tools/blob/4c15372993584579d7dbb9b23dd4c0c0fdc9e789/jpersistence-tools-core/src/main/java/net/leadware/persistence/tools/core/dao/utils/DAOValidatorMethodExpressionExecutor.java#L117-L141
150,030
jcgay/snp4j
src/main/java/fr/jcgay/snp4j/Icon.java
Icon.base64
@NonNull public static Icon base64(byte[] bytes) { return new Icon(sanitize(DatatypeConverter.printBase64Binary(bytes)), true); }
java
@NonNull public static Icon base64(byte[] bytes) { return new Icon(sanitize(DatatypeConverter.printBase64Binary(bytes)), true); }
[ "@", "NonNull", "public", "static", "Icon", "base64", "(", "byte", "[", "]", "bytes", ")", "{", "return", "new", "Icon", "(", "sanitize", "(", "DatatypeConverter", ".", "printBase64Binary", "(", "bytes", ")", ")", ",", "true", ")", ";", "}" ]
Create an icon based on a binary representation. @param bytes the icon. @return an icon as {@link fr.jcgay.snp4j.Icon}.
[ "Create", "an", "icon", "based", "on", "a", "binary", "representation", "." ]
eea99c4f470d4c9be6e4ecc63809ab163c502582
https://github.com/jcgay/snp4j/blob/eea99c4f470d4c9be6e4ecc63809ab163c502582/src/main/java/fr/jcgay/snp4j/Icon.java#L66-L69
150,031
mlhartme/mork
src/main/java/net/oneandone/mork/scanner/Position.java
Position.update
public void update(char[] data, int start, int end) { int i; for (i = start; i < end; i++) { if (data[i] == '\n') { col = 1; line++; } else { col++; } } ofs += (end - start); }
java
public void update(char[] data, int start, int end) { int i; for (i = start; i < end; i++) { if (data[i] == '\n') { col = 1; line++; } else { col++; } } ofs += (end - start); }
[ "public", "void", "update", "(", "char", "[", "]", "data", ",", "int", "start", ",", "int", "end", ")", "{", "int", "i", ";", "for", "(", "i", "=", "start", ";", "i", "<", "end", ";", "i", "++", ")", "{", "if", "(", "data", "[", "i", "]", "==", "'", "'", ")", "{", "col", "=", "1", ";", "line", "++", ";", "}", "else", "{", "col", "++", ";", "}", "}", "ofs", "+=", "(", "end", "-", "start", ")", ";", "}" ]
the indicated range has been passed by the scanner.
[ "the", "indicated", "range", "has", "been", "passed", "by", "the", "scanner", "." ]
a069b087750c4133bfeebaf1f599c3bc96762113
https://github.com/mlhartme/mork/blob/a069b087750c4133bfeebaf1f599c3bc96762113/src/main/java/net/oneandone/mork/scanner/Position.java#L55-L67
150,032
bwkimmel/jdcp
jdcp-core/src/main/java/ca/eandb/jdcp/job/ParallelizableJobRunner.java
ParallelizableJobRunner.submitResults
private void submitResults(Object task, Object results) throws JobExecutionException { synchronized (monitor) { this.job.submitTaskResults(task, results, monitor); } }
java
private void submitResults(Object task, Object results) throws JobExecutionException { synchronized (monitor) { this.job.submitTaskResults(task, results, monitor); } }
[ "private", "void", "submitResults", "(", "Object", "task", ",", "Object", "results", ")", "throws", "JobExecutionException", "{", "synchronized", "(", "monitor", ")", "{", "this", ".", "job", ".", "submitTaskResults", "(", "task", ",", "results", ",", "monitor", ")", ";", "}", "}" ]
Submits results for a task. @param task An <code>Object</code> describing the task for which results are being submitted. @param results An <code>Object</code> describing the results. @throws JobExecutionException
[ "Submits", "results", "for", "a", "task", "." ]
630c5150c245054e2556ff370f4bad2ec793dfb7
https://github.com/bwkimmel/jdcp/blob/630c5150c245054e2556ff370f4bad2ec793dfb7/jdcp-core/src/main/java/ca/eandb/jdcp/job/ParallelizableJobRunner.java#L367-L371
150,033
bwkimmel/jdcp
jdcp-core/src/main/java/ca/eandb/jdcp/job/ParallelizableJobRunner.java
ParallelizableJobRunner.getWorkingDirectory
private synchronized File getWorkingDirectory() { if (workingDirectory == null) { try { workingDirectory = Files.createTempDirectory(TEMP_DIRECTORY_PREFIX).toFile(); } catch (IOException e) { throw new UnexpectedException(e); } } return workingDirectory; }
java
private synchronized File getWorkingDirectory() { if (workingDirectory == null) { try { workingDirectory = Files.createTempDirectory(TEMP_DIRECTORY_PREFIX).toFile(); } catch (IOException e) { throw new UnexpectedException(e); } } return workingDirectory; }
[ "private", "synchronized", "File", "getWorkingDirectory", "(", ")", "{", "if", "(", "workingDirectory", "==", "null", ")", "{", "try", "{", "workingDirectory", "=", "Files", ".", "createTempDirectory", "(", "TEMP_DIRECTORY_PREFIX", ")", ".", "toFile", "(", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "throw", "new", "UnexpectedException", "(", "e", ")", ";", "}", "}", "return", "workingDirectory", ";", "}" ]
Gets the working directory, creating a temporary one if one was not specified during construction. @return The working directory.
[ "Gets", "the", "working", "directory", "creating", "a", "temporary", "one", "if", "one", "was", "not", "specified", "during", "construction", "." ]
630c5150c245054e2556ff370f4bad2ec793dfb7
https://github.com/bwkimmel/jdcp/blob/630c5150c245054e2556ff370f4bad2ec793dfb7/jdcp-core/src/main/java/ca/eandb/jdcp/job/ParallelizableJobRunner.java#L430-L440
150,034
BellaDati/belladati-sdk-api
src/main/java/com/belladati/sdk/filter/FilterOperation.java
FilterOperation.createFilter
public F createFilter(BellaDatiService service, String dataSetId, String attributeCode) { return createFilter(new FilterAttribute(service, dataSetId, attributeCode)); }
java
public F createFilter(BellaDatiService service, String dataSetId, String attributeCode) { return createFilter(new FilterAttribute(service, dataSetId, attributeCode)); }
[ "public", "F", "createFilter", "(", "BellaDatiService", "service", ",", "String", "dataSetId", ",", "String", "attributeCode", ")", "{", "return", "createFilter", "(", "new", "FilterAttribute", "(", "service", ",", "dataSetId", ",", "attributeCode", ")", ")", ";", "}" ]
Creates a filter using just an attribute code. Can be used if the code is already known to avoid having to make an extra API call loading report attributes. @param service service instance to connect to the server (to allow retrieving the attribute's values) @param dataSetId ID of the data set the attribute is defined in @param attributeCode code of the attribute @return a filter for the given attribute with this operation
[ "Creates", "a", "filter", "using", "just", "an", "attribute", "code", ".", "Can", "be", "used", "if", "the", "code", "is", "already", "known", "to", "avoid", "having", "to", "make", "an", "extra", "API", "call", "loading", "report", "attributes", "." ]
ec45a42048d8255838ad0200aa6784a8e8a121c1
https://github.com/BellaDati/belladati-sdk-api/blob/ec45a42048d8255838ad0200aa6784a8e8a121c1/src/main/java/com/belladati/sdk/filter/FilterOperation.java#L71-L73
150,035
chaschev/chutils
src/main/java/chaschev/util/DomUtils.java
DomUtils.childrenText
public static List<String> childrenText(Element parentElement, String tagname) { final Iterable<Element> children = children(parentElement, tagname); List<String> result = new ArrayList<String>(); for (Element element : children) { result.add(elementText(element)); } return result; }
java
public static List<String> childrenText(Element parentElement, String tagname) { final Iterable<Element> children = children(parentElement, tagname); List<String> result = new ArrayList<String>(); for (Element element : children) { result.add(elementText(element)); } return result; }
[ "public", "static", "List", "<", "String", ">", "childrenText", "(", "Element", "parentElement", ",", "String", "tagname", ")", "{", "final", "Iterable", "<", "Element", ">", "children", "=", "children", "(", "parentElement", ",", "tagname", ")", ";", "List", "<", "String", ">", "result", "=", "new", "ArrayList", "<", "String", ">", "(", ")", ";", "for", "(", "Element", "element", ":", "children", ")", "{", "result", ".", "add", "(", "elementText", "(", "element", ")", ")", ";", "}", "return", "result", ";", "}" ]
Gets all descendant elements of the given parentElement with the given namespace and tagname and returns their text child as a list of String.
[ "Gets", "all", "descendant", "elements", "of", "the", "given", "parentElement", "with", "the", "given", "namespace", "and", "tagname", "and", "returns", "their", "text", "child", "as", "a", "list", "of", "String", "." ]
ed2854678019fb46396ce2d380b24a255914f7c4
https://github.com/chaschev/chutils/blob/ed2854678019fb46396ce2d380b24a255914f7c4/src/main/java/chaschev/util/DomUtils.java#L131-L141
150,036
chaschev/chutils
src/main/java/chaschev/util/DomUtils.java
DomUtils.getChild
public static Node getChild(Node parent, int type) { Node n = parent.getFirstChild(); while (n != null && type != n.getNodeType()) { n = n.getNextSibling(); } if (n == null) return null; return n; }
java
public static Node getChild(Node parent, int type) { Node n = parent.getFirstChild(); while (n != null && type != n.getNodeType()) { n = n.getNextSibling(); } if (n == null) return null; return n; }
[ "public", "static", "Node", "getChild", "(", "Node", "parent", ",", "int", "type", ")", "{", "Node", "n", "=", "parent", ".", "getFirstChild", "(", ")", ";", "while", "(", "n", "!=", "null", "&&", "type", "!=", "n", ".", "getNodeType", "(", ")", ")", "{", "n", "=", "n", ".", "getNextSibling", "(", ")", ";", "}", "if", "(", "n", "==", "null", ")", "return", "null", ";", "return", "n", ";", "}" ]
Get the first direct child with a given type
[ "Get", "the", "first", "direct", "child", "with", "a", "given", "type" ]
ed2854678019fb46396ce2d380b24a255914f7c4
https://github.com/chaschev/chutils/blob/ed2854678019fb46396ce2d380b24a255914f7c4/src/main/java/chaschev/util/DomUtils.java#L259-L266
150,037
trustathsh/ifmapj
src/main/java/de/hshannover/f4/trust/ifmapj/metadata/IfmapMetadataFactory.java
IfmapMetadataFactory.createSingleElementDocument
protected Document createSingleElementDocument(String namespaceUri, String namespacePrefix, String name, Cardinality cardinality) { Document doc = mDocumentBuilder.newDocument(); String qualifiedName = namespacePrefix + ":" + name; Element e = doc.createElementNS(namespaceUri, qualifiedName); e.setAttributeNS(null, "ifmap-cardinality", cardinality.toString()); doc.appendChild(e); return doc; }
java
protected Document createSingleElementDocument(String namespaceUri, String namespacePrefix, String name, Cardinality cardinality) { Document doc = mDocumentBuilder.newDocument(); String qualifiedName = namespacePrefix + ":" + name; Element e = doc.createElementNS(namespaceUri, qualifiedName); e.setAttributeNS(null, "ifmap-cardinality", cardinality.toString()); doc.appendChild(e); return doc; }
[ "protected", "Document", "createSingleElementDocument", "(", "String", "namespaceUri", ",", "String", "namespacePrefix", ",", "String", "name", ",", "Cardinality", "cardinality", ")", "{", "Document", "doc", "=", "mDocumentBuilder", ".", "newDocument", "(", ")", ";", "String", "qualifiedName", "=", "namespacePrefix", "+", "\":\"", "+", "name", ";", "Element", "e", "=", "doc", ".", "createElementNS", "(", "namespaceUri", ",", "qualifiedName", ")", ";", "e", ".", "setAttributeNS", "(", "null", ",", "\"ifmap-cardinality\"", ",", "cardinality", ".", "toString", "(", ")", ")", ";", "doc", ".", "appendChild", "(", "e", ")", ";", "return", "doc", ";", "}" ]
Creates a metadata document with a single element and given namespace information. @param namespaceUri URI of the namespace of the metadata document @param namespacePrefix prefix of the namespace of the metadata document @param name value of the root element of the metadata document @param cardinality the cardinality of the metadata document @return a {@link Document} instance representing the metadata object
[ "Creates", "a", "metadata", "document", "with", "a", "single", "element", "and", "given", "namespace", "information", "." ]
44ece9e95a3d2a1b7019573ba6178598a6cbdaa3
https://github.com/trustathsh/ifmapj/blob/44ece9e95a3d2a1b7019573ba6178598a6cbdaa3/src/main/java/de/hshannover/f4/trust/ifmapj/metadata/IfmapMetadataFactory.java#L86-L95
150,038
datoin/http-requests
src/main/java/org/datoin/net/http/Response.java
Response.updateResponse
public void updateResponse() { // TODO: update logging setStatus(httpResp.getStatusLine().getStatusCode()); setStatusLine(httpResp.getStatusLine().toString()); setHeaders(httpResp.getAllHeaders()); final HttpEntity entity = httpResp.getEntity(); if (entity != null) { try { contentBytes = EntityUtils.toByteArray(entity); } catch (IOException e) { contentBytes = new byte[0]; // empty byte array e.printStackTrace(); } ContentType contentType = ContentType.getOrDefault(entity); setContentType(contentType); setContentLength(entity.getContentLength()); } if(debug) System.err.println(this); }
java
public void updateResponse() { // TODO: update logging setStatus(httpResp.getStatusLine().getStatusCode()); setStatusLine(httpResp.getStatusLine().toString()); setHeaders(httpResp.getAllHeaders()); final HttpEntity entity = httpResp.getEntity(); if (entity != null) { try { contentBytes = EntityUtils.toByteArray(entity); } catch (IOException e) { contentBytes = new byte[0]; // empty byte array e.printStackTrace(); } ContentType contentType = ContentType.getOrDefault(entity); setContentType(contentType); setContentLength(entity.getContentLength()); } if(debug) System.err.println(this); }
[ "public", "void", "updateResponse", "(", ")", "{", "// TODO: update logging", "setStatus", "(", "httpResp", ".", "getStatusLine", "(", ")", ".", "getStatusCode", "(", ")", ")", ";", "setStatusLine", "(", "httpResp", ".", "getStatusLine", "(", ")", ".", "toString", "(", ")", ")", ";", "setHeaders", "(", "httpResp", ".", "getAllHeaders", "(", ")", ")", ";", "final", "HttpEntity", "entity", "=", "httpResp", ".", "getEntity", "(", ")", ";", "if", "(", "entity", "!=", "null", ")", "{", "try", "{", "contentBytes", "=", "EntityUtils", ".", "toByteArray", "(", "entity", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "contentBytes", "=", "new", "byte", "[", "0", "]", ";", "// empty byte array", "e", ".", "printStackTrace", "(", ")", ";", "}", "ContentType", "contentType", "=", "ContentType", ".", "getOrDefault", "(", "entity", ")", ";", "setContentType", "(", "contentType", ")", ";", "setContentLength", "(", "entity", ".", "getContentLength", "(", ")", ")", ";", "}", "if", "(", "debug", ")", "System", ".", "err", ".", "println", "(", "this", ")", ";", "}" ]
update Response object from given http response
[ "update", "Response", "object", "from", "given", "http", "response" ]
660a4bc516c594f321019df94451fead4dea19b6
https://github.com/datoin/http-requests/blob/660a4bc516c594f321019df94451fead4dea19b6/src/main/java/org/datoin/net/http/Response.java#L99-L119
150,039
io7m/jcanephora
com.io7m.jcanephora.core/src/main/java/com/io7m/jcanephora/core/JCGLTextureFormats.java
JCGLTextureFormats.checkColorRenderableTexture2D
public static void checkColorRenderableTexture2D( final JCGLTextureFormat t) throws JCGLExceptionFormatError { if (!isColorRenderable2D(t)) { final String m = String.format( "Format %s is not color-renderable for 2D textures", t); assert m != null; throw new JCGLExceptionFormatError(m); } }
java
public static void checkColorRenderableTexture2D( final JCGLTextureFormat t) throws JCGLExceptionFormatError { if (!isColorRenderable2D(t)) { final String m = String.format( "Format %s is not color-renderable for 2D textures", t); assert m != null; throw new JCGLExceptionFormatError(m); } }
[ "public", "static", "void", "checkColorRenderableTexture2D", "(", "final", "JCGLTextureFormat", "t", ")", "throws", "JCGLExceptionFormatError", "{", "if", "(", "!", "isColorRenderable2D", "(", "t", ")", ")", "{", "final", "String", "m", "=", "String", ".", "format", "(", "\"Format %s is not color-renderable for 2D textures\"", ",", "t", ")", ";", "assert", "m", "!=", "null", ";", "throw", "new", "JCGLExceptionFormatError", "(", "m", ")", ";", "}", "}" ]
Check that the texture format is a color-renderable format. @param t The texture format @throws JCGLExceptionFormatError If the texture is not of the correct format
[ "Check", "that", "the", "texture", "format", "is", "a", "color", "-", "renderable", "format", "." ]
0004c1744b7f0969841d04cd4fa693f402b10980
https://github.com/io7m/jcanephora/blob/0004c1744b7f0969841d04cd4fa693f402b10980/com.io7m.jcanephora.core/src/main/java/com/io7m/jcanephora/core/JCGLTextureFormats.java#L41-L51
150,040
io7m/jcanephora
com.io7m.jcanephora.core/src/main/java/com/io7m/jcanephora/core/JCGLTextureFormats.java
JCGLTextureFormats.checkDepthRenderableTexture2D
public static void checkDepthRenderableTexture2D( final JCGLTextureFormat t) throws JCGLExceptionFormatError { if (!isDepthRenderable(t)) { final String m = String.format( "Format %s is not depth-renderable for 2D textures", t); assert m != null; throw new JCGLExceptionFormatError(m); } }
java
public static void checkDepthRenderableTexture2D( final JCGLTextureFormat t) throws JCGLExceptionFormatError { if (!isDepthRenderable(t)) { final String m = String.format( "Format %s is not depth-renderable for 2D textures", t); assert m != null; throw new JCGLExceptionFormatError(m); } }
[ "public", "static", "void", "checkDepthRenderableTexture2D", "(", "final", "JCGLTextureFormat", "t", ")", "throws", "JCGLExceptionFormatError", "{", "if", "(", "!", "isDepthRenderable", "(", "t", ")", ")", "{", "final", "String", "m", "=", "String", ".", "format", "(", "\"Format %s is not depth-renderable for 2D textures\"", ",", "t", ")", ";", "assert", "m", "!=", "null", ";", "throw", "new", "JCGLExceptionFormatError", "(", "m", ")", ";", "}", "}" ]
Check that the texture format is a depth-renderable format. @param t The texture format @throws JCGLExceptionFormatError If the texture is not of the correct format
[ "Check", "that", "the", "texture", "format", "is", "a", "depth", "-", "renderable", "format", "." ]
0004c1744b7f0969841d04cd4fa693f402b10980
https://github.com/io7m/jcanephora/blob/0004c1744b7f0969841d04cd4fa693f402b10980/com.io7m.jcanephora.core/src/main/java/com/io7m/jcanephora/core/JCGLTextureFormats.java#L62-L72
150,041
io7m/jcanephora
com.io7m.jcanephora.core/src/main/java/com/io7m/jcanephora/core/JCGLTextureFormats.java
JCGLTextureFormats.checkDepthStencilRenderableTexture2D
public static void checkDepthStencilRenderableTexture2D( final JCGLTextureFormat t) throws JCGLExceptionFormatError { if (isDepthRenderable(t) && isStencilRenderable(t)) { return; } final String m = String.format("Format %s is not depth+stencil-renderable", t); assert m != null; throw new JCGLExceptionFormatError(m); }
java
public static void checkDepthStencilRenderableTexture2D( final JCGLTextureFormat t) throws JCGLExceptionFormatError { if (isDepthRenderable(t) && isStencilRenderable(t)) { return; } final String m = String.format("Format %s is not depth+stencil-renderable", t); assert m != null; throw new JCGLExceptionFormatError(m); }
[ "public", "static", "void", "checkDepthStencilRenderableTexture2D", "(", "final", "JCGLTextureFormat", "t", ")", "throws", "JCGLExceptionFormatError", "{", "if", "(", "isDepthRenderable", "(", "t", ")", "&&", "isStencilRenderable", "(", "t", ")", ")", "{", "return", ";", "}", "final", "String", "m", "=", "String", ".", "format", "(", "\"Format %s is not depth+stencil-renderable\"", ",", "t", ")", ";", "assert", "m", "!=", "null", ";", "throw", "new", "JCGLExceptionFormatError", "(", "m", ")", ";", "}" ]
Check that the texture is of a depth+stencil-renderable format. @param t The texture @throws JCGLExceptionFormatError If the texture is not of the correct format
[ "Check", "that", "the", "texture", "is", "of", "a", "depth", "+", "stencil", "-", "renderable", "format", "." ]
0004c1744b7f0969841d04cd4fa693f402b10980
https://github.com/io7m/jcanephora/blob/0004c1744b7f0969841d04cd4fa693f402b10980/com.io7m.jcanephora.core/src/main/java/com/io7m/jcanephora/core/JCGLTextureFormats.java#L113-L126
150,042
almondtools/picklock
src/main/java/com/almondtools/picklock/ClassAccess.java
ClassAccess.features
@SuppressWarnings("unchecked") public <T> T features(Class<T> interfaceClass) { try { for (Method method : interfaceClass.getDeclaredMethods()) { methods.put(method, findInvocationHandler(method)); } return (T) Proxy.newProxyInstance(interfaceClass.getClassLoader(), new Class[] { interfaceClass }, this); } catch (NoSuchMethodException e) { throw new PicklockException("cannot resolve method/property " + e.getMessage() + " on " + getType()); } }
java
@SuppressWarnings("unchecked") public <T> T features(Class<T> interfaceClass) { try { for (Method method : interfaceClass.getDeclaredMethods()) { methods.put(method, findInvocationHandler(method)); } return (T) Proxy.newProxyInstance(interfaceClass.getClassLoader(), new Class[] { interfaceClass }, this); } catch (NoSuchMethodException e) { throw new PicklockException("cannot resolve method/property " + e.getMessage() + " on " + getType()); } }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "<", "T", ">", "T", "features", "(", "Class", "<", "T", ">", "interfaceClass", ")", "{", "try", "{", "for", "(", "Method", "method", ":", "interfaceClass", ".", "getDeclaredMethods", "(", ")", ")", "{", "methods", ".", "put", "(", "method", ",", "findInvocationHandler", "(", "method", ")", ")", ";", "}", "return", "(", "T", ")", "Proxy", ".", "newProxyInstance", "(", "interfaceClass", ".", "getClassLoader", "(", ")", ",", "new", "Class", "[", "]", "{", "interfaceClass", "}", ",", "this", ")", ";", "}", "catch", "(", "NoSuchMethodException", "e", ")", "{", "throw", "new", "PicklockException", "(", "\"cannot resolve method/property \"", "+", "e", ".", "getMessage", "(", ")", "+", "\" on \"", "+", "getType", "(", ")", ")", ";", "}", "}" ]
maps the given interface to the wrapped class @param interfaceClass the given interface class (defining the type of the result) @return an object of the type of interfaceClass (mapped to the members of the wrapped object) @throws NoSuchMethodException if a method of the interface class could not be mapped according to the upper rules
[ "maps", "the", "given", "interface", "to", "the", "wrapped", "class" ]
8ec05d58bcd1a893d8d5fe67d2f170183c80012f
https://github.com/almondtools/picklock/blob/8ec05d58bcd1a893d8d5fe67d2f170183c80012f/src/main/java/com/almondtools/picklock/ClassAccess.java#L112-L122
150,043
bwkimmel/jdcp
jdcp-console/src/main/java/ca/eandb/jdcp/console/ServerState.java
ServerState.clean
@CommandArgument public void clean() { for (int i = 0; i < jobProgressStates.size();) { ProgressState state = jobProgressStates.get(i); if (state.isCancelled() || state.isComplete()) { jobProgressStates.remove(i); } else { i++; } } }
java
@CommandArgument public void clean() { for (int i = 0; i < jobProgressStates.size();) { ProgressState state = jobProgressStates.get(i); if (state.isCancelled() || state.isComplete()) { jobProgressStates.remove(i); } else { i++; } } }
[ "@", "CommandArgument", "public", "void", "clean", "(", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "jobProgressStates", ".", "size", "(", ")", ";", ")", "{", "ProgressState", "state", "=", "jobProgressStates", ".", "get", "(", "i", ")", ";", "if", "(", "state", ".", "isCancelled", "(", ")", "||", "state", ".", "isComplete", "(", ")", ")", "{", "jobProgressStates", ".", "remove", "(", "i", ")", ";", "}", "else", "{", "i", "++", ";", "}", "}", "}" ]
Removes completed and cancelled jobs from the stat list.
[ "Removes", "completed", "and", "cancelled", "jobs", "from", "the", "stat", "list", "." ]
630c5150c245054e2556ff370f4bad2ec793dfb7
https://github.com/bwkimmel/jdcp/blob/630c5150c245054e2556ff370f4bad2ec793dfb7/jdcp-console/src/main/java/ca/eandb/jdcp/console/ServerState.java#L89-L99
150,044
bwkimmel/jdcp
jdcp-worker/src/main/java/ca/eandb/jdcp/worker/CachingJobServiceClassLoaderStrategy.java
CachingJobServiceClassLoaderStrategy.getClassDigest
public final byte[] getClassDigest(String name) { byte[] digest = digestLookup.get(name); if (digest == null) { try { if (beginLookup(pendingDigest, name)) { try { digest = service.getClassDigest(name, jobId); digestLookup.put(name, digest); } finally { endLookup(pendingDigest, name); } } else { digest = digestLookup.get(name); } } catch (SecurityException e) { logger.error("Could not get class digest", e); } catch (RemoteException e) { logger.error("Could not get class digest", e); } } return digest; }
java
public final byte[] getClassDigest(String name) { byte[] digest = digestLookup.get(name); if (digest == null) { try { if (beginLookup(pendingDigest, name)) { try { digest = service.getClassDigest(name, jobId); digestLookup.put(name, digest); } finally { endLookup(pendingDigest, name); } } else { digest = digestLookup.get(name); } } catch (SecurityException e) { logger.error("Could not get class digest", e); } catch (RemoteException e) { logger.error("Could not get class digest", e); } } return digest; }
[ "public", "final", "byte", "[", "]", "getClassDigest", "(", "String", "name", ")", "{", "byte", "[", "]", "digest", "=", "digestLookup", ".", "get", "(", "name", ")", ";", "if", "(", "digest", "==", "null", ")", "{", "try", "{", "if", "(", "beginLookup", "(", "pendingDigest", ",", "name", ")", ")", "{", "try", "{", "digest", "=", "service", ".", "getClassDigest", "(", "name", ",", "jobId", ")", ";", "digestLookup", ".", "put", "(", "name", ",", "digest", ")", ";", "}", "finally", "{", "endLookup", "(", "pendingDigest", ",", "name", ")", ";", "}", "}", "else", "{", "digest", "=", "digestLookup", ".", "get", "(", "name", ")", ";", "}", "}", "catch", "(", "SecurityException", "e", ")", "{", "logger", ".", "error", "(", "\"Could not get class digest\"", ",", "e", ")", ";", "}", "catch", "(", "RemoteException", "e", ")", "{", "logger", ".", "error", "(", "\"Could not get class digest\"", ",", "e", ")", ";", "}", "}", "return", "digest", ";", "}" ]
Gets the digest associated with a given class. @param name The name of the class. @return The class digest.
[ "Gets", "the", "digest", "associated", "with", "a", "given", "class", "." ]
630c5150c245054e2556ff370f4bad2ec793dfb7
https://github.com/bwkimmel/jdcp/blob/630c5150c245054e2556ff370f4bad2ec793dfb7/jdcp-worker/src/main/java/ca/eandb/jdcp/worker/CachingJobServiceClassLoaderStrategy.java#L96-L117
150,045
bwkimmel/jdcp
jdcp-worker/src/main/java/ca/eandb/jdcp/worker/CachingJobServiceClassLoaderStrategy.java
CachingJobServiceClassLoaderStrategy.beginLookup
private synchronized boolean beginLookup(Map<String, String> pending, String name) { String canonical = pending.get(name); if (canonical != null) { do { try { canonical.wait(); } catch (InterruptedException e) {} } while (pending.containsKey(name)); } return (canonical == null); }
java
private synchronized boolean beginLookup(Map<String, String> pending, String name) { String canonical = pending.get(name); if (canonical != null) { do { try { canonical.wait(); } catch (InterruptedException e) {} } while (pending.containsKey(name)); } return (canonical == null); }
[ "private", "synchronized", "boolean", "beginLookup", "(", "Map", "<", "String", ",", "String", ">", "pending", ",", "String", "name", ")", "{", "String", "canonical", "=", "pending", ".", "get", "(", "name", ")", ";", "if", "(", "canonical", "!=", "null", ")", "{", "do", "{", "try", "{", "canonical", ".", "wait", "(", ")", ";", "}", "catch", "(", "InterruptedException", "e", ")", "{", "}", "}", "while", "(", "pending", ".", "containsKey", "(", "name", ")", ")", ";", "}", "return", "(", "canonical", "==", "null", ")", ";", "}" ]
Ensures that only one thread is calling the service to obtain the class digest or definition for a particular class name. @param pending The <code>Map</code> in which to store pending lookups. @param name The name of the class to be looked up. @return A value indicating whether the current thread is designated to perform the lookup.
[ "Ensures", "that", "only", "one", "thread", "is", "calling", "the", "service", "to", "obtain", "the", "class", "digest", "or", "definition", "for", "a", "particular", "class", "name", "." ]
630c5150c245054e2556ff370f4bad2ec793dfb7
https://github.com/bwkimmel/jdcp/blob/630c5150c245054e2556ff370f4bad2ec793dfb7/jdcp-worker/src/main/java/ca/eandb/jdcp/worker/CachingJobServiceClassLoaderStrategy.java#L127-L137
150,046
bwkimmel/jdcp
jdcp-worker/src/main/java/ca/eandb/jdcp/worker/CachingJobServiceClassLoaderStrategy.java
CachingJobServiceClassLoaderStrategy.endLookup
private synchronized void endLookup(Map<String, String> pending, String name) { String canonical = pending.remove(name); if (canonical != null) { canonical.notifyAll(); } }
java
private synchronized void endLookup(Map<String, String> pending, String name) { String canonical = pending.remove(name); if (canonical != null) { canonical.notifyAll(); } }
[ "private", "synchronized", "void", "endLookup", "(", "Map", "<", "String", ",", "String", ">", "pending", ",", "String", "name", ")", "{", "String", "canonical", "=", "pending", ".", "remove", "(", "name", ")", ";", "if", "(", "canonical", "!=", "null", ")", "{", "canonical", ".", "notifyAll", "(", ")", ";", "}", "}" ]
Signals that the current thread is done looking up a class digest or definition. @param pending The <code>Map</code> in which to store pending lookups. @param name The name of the class that was looked up.
[ "Signals", "that", "the", "current", "thread", "is", "done", "looking", "up", "a", "class", "digest", "or", "definition", "." ]
630c5150c245054e2556ff370f4bad2ec793dfb7
https://github.com/bwkimmel/jdcp/blob/630c5150c245054e2556ff370f4bad2ec793dfb7/jdcp-worker/src/main/java/ca/eandb/jdcp/worker/CachingJobServiceClassLoaderStrategy.java#L145-L150
150,047
mlhartme/mork
src/main/java/net/oneandone/mork/compiler/Stubs.java
Stubs.range
public static Range range(char first, Character second) { if (second == null) { return new Range(first); } else { return new Range(first, ((Character) second).charValue()); } }
java
public static Range range(char first, Character second) { if (second == null) { return new Range(first); } else { return new Range(first, ((Character) second).charValue()); } }
[ "public", "static", "Range", "range", "(", "char", "first", ",", "Character", "second", ")", "{", "if", "(", "second", "==", "null", ")", "{", "return", "new", "Range", "(", "first", ")", ";", "}", "else", "{", "return", "new", "Range", "(", "first", ",", "(", "(", "Character", ")", "second", ")", ".", "charValue", "(", ")", ")", ";", "}", "}" ]
second is a Character to detect optional values
[ "second", "is", "a", "Character", "to", "detect", "optional", "values" ]
a069b087750c4133bfeebaf1f599c3bc96762113
https://github.com/mlhartme/mork/blob/a069b087750c4133bfeebaf1f599c3bc96762113/src/main/java/net/oneandone/mork/compiler/Stubs.java#L242-L248
150,048
fusepoolP3/p3-transformer-library
src/main/java/eu/fusepool/p3/transformer/server/handler/AbstractTransformingServlet.java
AbstractTransformingServlet.getServiceNode
static GraphNode getServiceNode(HttpServletRequest request) { final IRI serviceUri = new IRI(getFullRequestUrl(request)); final Graph resultGraph = new SimpleGraph(); return new GraphNode(serviceUri, resultGraph); }
java
static GraphNode getServiceNode(HttpServletRequest request) { final IRI serviceUri = new IRI(getFullRequestUrl(request)); final Graph resultGraph = new SimpleGraph(); return new GraphNode(serviceUri, resultGraph); }
[ "static", "GraphNode", "getServiceNode", "(", "HttpServletRequest", "request", ")", "{", "final", "IRI", "serviceUri", "=", "new", "IRI", "(", "getFullRequestUrl", "(", "request", ")", ")", ";", "final", "Graph", "resultGraph", "=", "new", "SimpleGraph", "(", ")", ";", "return", "new", "GraphNode", "(", "serviceUri", ",", "resultGraph", ")", ";", "}" ]
Returns a GraphNode representing the requested resources in an empty Graph @param request @return a GraphNode representing the resource
[ "Returns", "a", "GraphNode", "representing", "the", "requested", "resources", "in", "an", "empty", "Graph" ]
7f2f0ff7594dc4db021f2edcea17960ba337e02b
https://github.com/fusepoolP3/p3-transformer-library/blob/7f2f0ff7594dc4db021f2edcea17960ba337e02b/src/main/java/eu/fusepool/p3/transformer/server/handler/AbstractTransformingServlet.java#L95-L99
150,049
generators-io-projects/generators
generators-core/src/main/java/io/generators/core/UniqueGenerator.java
UniqueGenerator.next
@Override public T next() { int retryCount = 0; do { T next = delegate.next(); if (!alreadyGenerated.contains(next)) { alreadyGenerated.add(next); return next; } retryCount++; } while (retryCount <= numberOfRetries); throw new IllegalStateException(on(" ").join("Exhausted", numberOfRetries, "retries trying to generate unique value")); }
java
@Override public T next() { int retryCount = 0; do { T next = delegate.next(); if (!alreadyGenerated.contains(next)) { alreadyGenerated.add(next); return next; } retryCount++; } while (retryCount <= numberOfRetries); throw new IllegalStateException(on(" ").join("Exhausted", numberOfRetries, "retries trying to generate unique value")); }
[ "@", "Override", "public", "T", "next", "(", ")", "{", "int", "retryCount", "=", "0", ";", "do", "{", "T", "next", "=", "delegate", ".", "next", "(", ")", ";", "if", "(", "!", "alreadyGenerated", ".", "contains", "(", "next", ")", ")", "{", "alreadyGenerated", ".", "add", "(", "next", ")", ";", "return", "next", ";", "}", "retryCount", "++", ";", "}", "while", "(", "retryCount", "<=", "numberOfRetries", ")", ";", "throw", "new", "IllegalStateException", "(", "on", "(", "\" \"", ")", ".", "join", "(", "\"Exhausted\"", ",", "numberOfRetries", ",", "\"retries trying to generate unique value\"", ")", ")", ";", "}" ]
Returns unique &lt;T&gt; generated by delegate Generator&lt;T&gt; @return generated unique &lt;T&gt; @throws IllegalStateException when number of retries is exhausted
[ "Returns", "unique", "&lt", ";", "T&gt", ";", "generated", "by", "delegate", "Generator&lt", ";", "T&gt", ";" ]
bee273970e638b4ed144337c442b795c816d6d61
https://github.com/generators-io-projects/generators/blob/bee273970e638b4ed144337c442b795c816d6d61/generators-core/src/main/java/io/generators/core/UniqueGenerator.java#L56-L70
150,050
gondor/kbop
src/main/java/org/pacesys/kbop/Pools.java
Pools.createPool
public static <K, T> IKeyedObjectPool.Single<K, T> createPool(IPoolObjectFactory<K, T> factory) { return new KeyedSingleObjectPool<K, T>(factory); }
java
public static <K, T> IKeyedObjectPool.Single<K, T> createPool(IPoolObjectFactory<K, T> factory) { return new KeyedSingleObjectPool<K, T>(factory); }
[ "public", "static", "<", "K", ",", "T", ">", "IKeyedObjectPool", ".", "Single", "<", "K", ",", "T", ">", "createPool", "(", "IPoolObjectFactory", "<", "K", ",", "T", ">", "factory", ")", "{", "return", "new", "KeyedSingleObjectPool", "<", "K", ",", "T", ">", "(", "factory", ")", ";", "}" ]
Creates a new Single Key to Object Pool @param factory the factory which creates new Objects (T) when needed @return IKeyedObjectPool
[ "Creates", "a", "new", "Single", "Key", "to", "Object", "Pool" ]
a176fd845f1e146610f03a1cb3cb0d661ebf4faa
https://github.com/gondor/kbop/blob/a176fd845f1e146610f03a1cb3cb0d661ebf4faa/src/main/java/org/pacesys/kbop/Pools.java#L18-L20
150,051
eurekaclinical/javautil
src/main/java/org/arp/javautil/version/MajorMinorVersion.java
MajorMinorVersion.compare
public int compare(MajorMinorVersion otherVersion) { int result = this.major - otherVersion.major; if (result == 0) { result = this.minor - otherVersion.minor; } return result; }
java
public int compare(MajorMinorVersion otherVersion) { int result = this.major - otherVersion.major; if (result == 0) { result = this.minor - otherVersion.minor; } return result; }
[ "public", "int", "compare", "(", "MajorMinorVersion", "otherVersion", ")", "{", "int", "result", "=", "this", ".", "major", "-", "otherVersion", ".", "major", ";", "if", "(", "result", "==", "0", ")", "{", "result", "=", "this", ".", "minor", "-", "otherVersion", ".", "minor", ";", "}", "return", "result", ";", "}" ]
Compares two versions by major then minor number. @param otherVersion another {@link MajorMinorVersion}. @return <code>-1</code> if this version is lower than <code>otherVersion</code>, <code>0</code> if they are the same version, and <code>1</code> if this version is higher than <code>otherVersion</code>.
[ "Compares", "two", "versions", "by", "major", "then", "minor", "number", "." ]
779bbc5bf096c75f8eed4f99ca45b99c1d44df43
https://github.com/eurekaclinical/javautil/blob/779bbc5bf096c75f8eed4f99ca45b99c1d44df43/src/main/java/org/arp/javautil/version/MajorMinorVersion.java#L90-L96
150,052
nhurion/vaadin-for-heroku
src/main/java/eu/hurion/vaadin/heroku/MemcachedManagerBuilder.java
MemcachedManagerBuilder.memcacheAddOn
public static MemcachedManagerBuilder memcacheAddOn() { final String memcacheServers = System.getenv("MEMCACHE_SERVERS"); return memcachedConfig() .username(System.getenv("MEMCACHE_USERNAME")) .password(System.getenv("MEMCACHE_PASSWORD")) .url(memcacheServers == null ? DEFAULT_URL : memcacheServers); }
java
public static MemcachedManagerBuilder memcacheAddOn() { final String memcacheServers = System.getenv("MEMCACHE_SERVERS"); return memcachedConfig() .username(System.getenv("MEMCACHE_USERNAME")) .password(System.getenv("MEMCACHE_PASSWORD")) .url(memcacheServers == null ? DEFAULT_URL : memcacheServers); }
[ "public", "static", "MemcachedManagerBuilder", "memcacheAddOn", "(", ")", "{", "final", "String", "memcacheServers", "=", "System", ".", "getenv", "(", "\"MEMCACHE_SERVERS\"", ")", ";", "return", "memcachedConfig", "(", ")", ".", "username", "(", "System", ".", "getenv", "(", "\"MEMCACHE_USERNAME\"", ")", ")", ".", "password", "(", "System", ".", "getenv", "(", "\"MEMCACHE_PASSWORD\"", ")", ")", ".", "url", "(", "memcacheServers", "==", "null", "?", "DEFAULT_URL", ":", "memcacheServers", ")", ";", "}" ]
Configuration based on system properties set by the memcacheAddOn
[ "Configuration", "based", "on", "system", "properties", "set", "by", "the", "memcacheAddOn" ]
51b1c22827934eb6105b0cfb0254cc15df23e991
https://github.com/nhurion/vaadin-for-heroku/blob/51b1c22827934eb6105b0cfb0254cc15df23e991/src/main/java/eu/hurion/vaadin/heroku/MemcachedManagerBuilder.java#L84-L90
150,053
nhurion/vaadin-for-heroku
src/main/java/eu/hurion/vaadin/heroku/MemcachedManagerBuilder.java
MemcachedManagerBuilder.memcachierAddOn
public static MemcachedManagerBuilder memcachierAddOn() { final String memcachierServers = System.getenv("MEMCACHIER_SERVERS"); return memcachedConfig() .username(System.getenv("MEMCACHIER_USERNAME")) .password(System.getenv("MEMCACHIER_PASSWORD")) .url(memcachierServers == null ? DEFAULT_URL : memcachierServers); }
java
public static MemcachedManagerBuilder memcachierAddOn() { final String memcachierServers = System.getenv("MEMCACHIER_SERVERS"); return memcachedConfig() .username(System.getenv("MEMCACHIER_USERNAME")) .password(System.getenv("MEMCACHIER_PASSWORD")) .url(memcachierServers == null ? DEFAULT_URL : memcachierServers); }
[ "public", "static", "MemcachedManagerBuilder", "memcachierAddOn", "(", ")", "{", "final", "String", "memcachierServers", "=", "System", ".", "getenv", "(", "\"MEMCACHIER_SERVERS\"", ")", ";", "return", "memcachedConfig", "(", ")", ".", "username", "(", "System", ".", "getenv", "(", "\"MEMCACHIER_USERNAME\"", ")", ")", ".", "password", "(", "System", ".", "getenv", "(", "\"MEMCACHIER_PASSWORD\"", ")", ")", ".", "url", "(", "memcachierServers", "==", "null", "?", "DEFAULT_URL", ":", "memcachierServers", ")", ";", "}" ]
Configuration based on system properties set by the memcachierAddOn
[ "Configuration", "based", "on", "system", "properties", "set", "by", "the", "memcachierAddOn" ]
51b1c22827934eb6105b0cfb0254cc15df23e991
https://github.com/nhurion/vaadin-for-heroku/blob/51b1c22827934eb6105b0cfb0254cc15df23e991/src/main/java/eu/hurion/vaadin/heroku/MemcachedManagerBuilder.java#L95-L101
150,054
likethecolor/Alchemy-API
src/main/java/com/likethecolor/alchemy/api/entity/LanguageAlchemyEntity.java
LanguageAlchemyEntity.setWikipedia
public void setWikipedia(String wikipedia) { if(wikipedia != null) { wikipedia = wikipedia.trim(); } this.wikipedia = wikipedia; }
java
public void setWikipedia(String wikipedia) { if(wikipedia != null) { wikipedia = wikipedia.trim(); } this.wikipedia = wikipedia; }
[ "public", "void", "setWikipedia", "(", "String", "wikipedia", ")", "{", "if", "(", "wikipedia", "!=", "null", ")", "{", "wikipedia", "=", "wikipedia", ".", "trim", "(", ")", ";", "}", "this", ".", "wikipedia", "=", "wikipedia", ";", "}" ]
Set link to the Wikipedia page for the detected language. @param wikipedia link to the Wikipedia page for the detected language
[ "Set", "link", "to", "the", "Wikipedia", "page", "for", "the", "detected", "language", "." ]
5208cfc92a878ceeaff052787af29da92d98db7e
https://github.com/likethecolor/Alchemy-API/blob/5208cfc92a878ceeaff052787af29da92d98db7e/src/main/java/com/likethecolor/alchemy/api/entity/LanguageAlchemyEntity.java#L252-L257
150,055
Metrink/croquet
croquet-core/src/main/java/com/metrink/croquet/CroquetWicketBuilder.java
CroquetWicketBuilder.addHealthCheck
public CroquetWicketBuilder<T> addHealthCheck(final String path, final Class<? extends IResource> resource) { settings.addResourceMount(path, resource); return this; }
java
public CroquetWicketBuilder<T> addHealthCheck(final String path, final Class<? extends IResource> resource) { settings.addResourceMount(path, resource); return this; }
[ "public", "CroquetWicketBuilder", "<", "T", ">", "addHealthCheck", "(", "final", "String", "path", ",", "final", "Class", "<", "?", "extends", "IResource", ">", "resource", ")", "{", "settings", ".", "addResourceMount", "(", "path", ",", "resource", ")", ";", "return", "this", ";", "}" ]
Adds a health check resource to a particular mount. @param path the path @param resource the resource to mount @return the {@link CroquetWicketBuilder}.
[ "Adds", "a", "health", "check", "resource", "to", "a", "particular", "mount", "." ]
1b0ed1327a104cf1f809ce4c3c5bf30a3d95384b
https://github.com/Metrink/croquet/blob/1b0ed1327a104cf1f809ce4c3c5bf30a3d95384b/croquet-core/src/main/java/com/metrink/croquet/CroquetWicketBuilder.java#L225-L228
150,056
bwkimmel/jdcp
jdcp-console/src/main/java/ca/eandb/jdcp/console/HubState.java
HubState.start
@CommandArgument public void start() { System.out.println("Starting hub"); try { Class.forName("org.apache.derby.jdbc.EmbeddedDriver"); EmbeddedDataSource ds = new EmbeddedDataSource(); ds.setConnectionAttributes("create=true"); ds.setDatabaseName("classes"); JobHub.prepareDataSource(ds); logger.info("Initializing service"); jobHub = new JobHub(ds); AuthenticationServer authServer = new AuthenticationServer(jobHub, JdcpUtil.DEFAULT_PORT); logger.info("Binding service"); Registry registry = getRegistry(); registry.bind("AuthenticationService", authServer); logger.info("Hub ready"); System.out.println("Hub started"); } catch (Exception e) { System.err.println("Failed to start hub"); logger.error("Failed to start hub", e); } }
java
@CommandArgument public void start() { System.out.println("Starting hub"); try { Class.forName("org.apache.derby.jdbc.EmbeddedDriver"); EmbeddedDataSource ds = new EmbeddedDataSource(); ds.setConnectionAttributes("create=true"); ds.setDatabaseName("classes"); JobHub.prepareDataSource(ds); logger.info("Initializing service"); jobHub = new JobHub(ds); AuthenticationServer authServer = new AuthenticationServer(jobHub, JdcpUtil.DEFAULT_PORT); logger.info("Binding service"); Registry registry = getRegistry(); registry.bind("AuthenticationService", authServer); logger.info("Hub ready"); System.out.println("Hub started"); } catch (Exception e) { System.err.println("Failed to start hub"); logger.error("Failed to start hub", e); } }
[ "@", "CommandArgument", "public", "void", "start", "(", ")", "{", "System", ".", "out", ".", "println", "(", "\"Starting hub\"", ")", ";", "try", "{", "Class", ".", "forName", "(", "\"org.apache.derby.jdbc.EmbeddedDriver\"", ")", ";", "EmbeddedDataSource", "ds", "=", "new", "EmbeddedDataSource", "(", ")", ";", "ds", ".", "setConnectionAttributes", "(", "\"create=true\"", ")", ";", "ds", ".", "setDatabaseName", "(", "\"classes\"", ")", ";", "JobHub", ".", "prepareDataSource", "(", "ds", ")", ";", "logger", ".", "info", "(", "\"Initializing service\"", ")", ";", "jobHub", "=", "new", "JobHub", "(", "ds", ")", ";", "AuthenticationServer", "authServer", "=", "new", "AuthenticationServer", "(", "jobHub", ",", "JdcpUtil", ".", "DEFAULT_PORT", ")", ";", "logger", ".", "info", "(", "\"Binding service\"", ")", ";", "Registry", "registry", "=", "getRegistry", "(", ")", ";", "registry", ".", "bind", "(", "\"AuthenticationService\"", ",", "authServer", ")", ";", "logger", ".", "info", "(", "\"Hub ready\"", ")", ";", "System", ".", "out", ".", "println", "(", "\"Hub started\"", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "System", ".", "err", ".", "println", "(", "\"Failed to start hub\"", ")", ";", "logger", ".", "error", "(", "\"Failed to start hub\"", ",", "e", ")", ";", "}", "}" ]
Starts the hub.
[ "Starts", "the", "hub", "." ]
630c5150c245054e2556ff370f4bad2ec793dfb7
https://github.com/bwkimmel/jdcp/blob/630c5150c245054e2556ff370f4bad2ec793dfb7/jdcp-console/src/main/java/ca/eandb/jdcp/console/HubState.java#L72-L99
150,057
bwkimmel/jdcp
jdcp-console/src/main/java/ca/eandb/jdcp/console/HubState.java
HubState.stop
@CommandArgument public void stop() { try { jobHub.shutdown(); jobHub = null; Registry registry = getRegistry(); registry.unbind("AuthenticationService"); System.out.println("Hub stopped"); } catch (Exception e) { logger.error("An error occurred while stopping the hub", e); System.err.println("Hub did not shut down cleanly, see log for details."); } }
java
@CommandArgument public void stop() { try { jobHub.shutdown(); jobHub = null; Registry registry = getRegistry(); registry.unbind("AuthenticationService"); System.out.println("Hub stopped"); } catch (Exception e) { logger.error("An error occurred while stopping the hub", e); System.err.println("Hub did not shut down cleanly, see log for details."); } }
[ "@", "CommandArgument", "public", "void", "stop", "(", ")", "{", "try", "{", "jobHub", ".", "shutdown", "(", ")", ";", "jobHub", "=", "null", ";", "Registry", "registry", "=", "getRegistry", "(", ")", ";", "registry", ".", "unbind", "(", "\"AuthenticationService\"", ")", ";", "System", ".", "out", ".", "println", "(", "\"Hub stopped\"", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "logger", ".", "error", "(", "\"An error occurred while stopping the hub\"", ",", "e", ")", ";", "System", ".", "err", ".", "println", "(", "\"Hub did not shut down cleanly, see log for details.\"", ")", ";", "}", "}" ]
Stops the hub.
[ "Stops", "the", "hub", "." ]
630c5150c245054e2556ff370f4bad2ec793dfb7
https://github.com/bwkimmel/jdcp/blob/630c5150c245054e2556ff370f4bad2ec793dfb7/jdcp-console/src/main/java/ca/eandb/jdcp/console/HubState.java#L104-L116
150,058
bwkimmel/jdcp
jdcp-console/src/main/java/ca/eandb/jdcp/console/HubState.java
HubState.stat
@CommandArgument public void stat() { if (this.jobHub == null) { System.err.println("Hub not running"); return; } System.out.println("Hub running"); }
java
@CommandArgument public void stat() { if (this.jobHub == null) { System.err.println("Hub not running"); return; } System.out.println("Hub running"); }
[ "@", "CommandArgument", "public", "void", "stat", "(", ")", "{", "if", "(", "this", ".", "jobHub", "==", "null", ")", "{", "System", ".", "err", ".", "println", "(", "\"Hub not running\"", ")", ";", "return", ";", "}", "System", ".", "out", ".", "println", "(", "\"Hub running\"", ")", ";", "}" ]
Prints the status of the hub.
[ "Prints", "the", "status", "of", "the", "hub", "." ]
630c5150c245054e2556ff370f4bad2ec793dfb7
https://github.com/bwkimmel/jdcp/blob/630c5150c245054e2556ff370f4bad2ec793dfb7/jdcp-console/src/main/java/ca/eandb/jdcp/console/HubState.java#L156-L163
150,059
bi-geek/flink-connector-ethereum
src/main/java/com/bigeek/flink/utils/EthereumWrapper.java
EthereumWrapper.configureInstance
public static Web3j configureInstance(String address, Long timeout) { web3jInstance = EthereumUtils.generateClient(address, timeout); return web3jInstance; }
java
public static Web3j configureInstance(String address, Long timeout) { web3jInstance = EthereumUtils.generateClient(address, timeout); return web3jInstance; }
[ "public", "static", "Web3j", "configureInstance", "(", "String", "address", ",", "Long", "timeout", ")", "{", "web3jInstance", "=", "EthereumUtils", ".", "generateClient", "(", "address", ",", "timeout", ")", ";", "return", "web3jInstance", ";", "}" ]
Get instance with parameters. @param address @param timeout @return web3j client
[ "Get", "instance", "with", "parameters", "." ]
9ecedbf999fc410e50225c3f69b5041df4c61a33
https://github.com/bi-geek/flink-connector-ethereum/blob/9ecedbf999fc410e50225c3f69b5041df4c61a33/src/main/java/com/bigeek/flink/utils/EthereumWrapper.java#L19-L22
150,060
likethecolor/Alchemy-API
src/main/java/com/likethecolor/alchemy/api/parser/json/KeywordParser.java
KeywordParser.getKeyword
private JSONObject getKeyword(final JSONArray keywords, final int index) { JSONObject object = new JSONObject(); try { object = (JSONObject) keywords.get(index); } catch(JSONException e) { e.printStackTrace(); } return object; }
java
private JSONObject getKeyword(final JSONArray keywords, final int index) { JSONObject object = new JSONObject(); try { object = (JSONObject) keywords.get(index); } catch(JSONException e) { e.printStackTrace(); } return object; }
[ "private", "JSONObject", "getKeyword", "(", "final", "JSONArray", "keywords", ",", "final", "int", "index", ")", "{", "JSONObject", "object", "=", "new", "JSONObject", "(", ")", ";", "try", "{", "object", "=", "(", "JSONObject", ")", "keywords", ".", "get", "(", "index", ")", ";", "}", "catch", "(", "JSONException", "e", ")", "{", "e", ".", "printStackTrace", "(", ")", ";", "}", "return", "object", ";", "}" ]
Return a json object from the provided array. Return an empty object if there is any problems fetching the keyword data. @param keywords array of keyword data @param index of the object to fetch @return json object from the provided array
[ "Return", "a", "json", "object", "from", "the", "provided", "array", ".", "Return", "an", "empty", "object", "if", "there", "is", "any", "problems", "fetching", "the", "keyword", "data", "." ]
5208cfc92a878ceeaff052787af29da92d98db7e
https://github.com/likethecolor/Alchemy-API/blob/5208cfc92a878ceeaff052787af29da92d98db7e/src/main/java/com/likethecolor/alchemy/api/parser/json/KeywordParser.java#L61-L70
150,061
likethecolor/Alchemy-API
src/main/java/com/likethecolor/alchemy/api/parser/json/KeywordParser.java
KeywordParser.getSentiment
private SentimentAlchemyEntity getSentiment(final JSONObject jsonKeyword) { SentimentAlchemyEntity sentiment = null; final JSONObject sentimentObject = getJSONObject(JSONConstants.SENTIMENT_KEY, jsonKeyword); if(sentimentObject == null) { return sentiment; } final String type = getString(JSONConstants.SENTIMENT_TYPE_KEY, sentimentObject); final Double score = getDouble(JSONConstants.SENTIMENT_SCORE_KEY, sentimentObject); final Integer mixed = getInteger(JSONConstants.SENTIMENT_MIXED_KEY, sentimentObject); if(isValidSentiment(type, score, mixed)) { sentiment = new SentimentAlchemyEntity(); if(!StringUtils.isBlank(type)) { sentiment.setType(type); } if(score != null) { sentiment.setScore(score); } if(mixed != null) { sentiment.setIsMixed(mixed); } } return sentiment; }
java
private SentimentAlchemyEntity getSentiment(final JSONObject jsonKeyword) { SentimentAlchemyEntity sentiment = null; final JSONObject sentimentObject = getJSONObject(JSONConstants.SENTIMENT_KEY, jsonKeyword); if(sentimentObject == null) { return sentiment; } final String type = getString(JSONConstants.SENTIMENT_TYPE_KEY, sentimentObject); final Double score = getDouble(JSONConstants.SENTIMENT_SCORE_KEY, sentimentObject); final Integer mixed = getInteger(JSONConstants.SENTIMENT_MIXED_KEY, sentimentObject); if(isValidSentiment(type, score, mixed)) { sentiment = new SentimentAlchemyEntity(); if(!StringUtils.isBlank(type)) { sentiment.setType(type); } if(score != null) { sentiment.setScore(score); } if(mixed != null) { sentiment.setIsMixed(mixed); } } return sentiment; }
[ "private", "SentimentAlchemyEntity", "getSentiment", "(", "final", "JSONObject", "jsonKeyword", ")", "{", "SentimentAlchemyEntity", "sentiment", "=", "null", ";", "final", "JSONObject", "sentimentObject", "=", "getJSONObject", "(", "JSONConstants", ".", "SENTIMENT_KEY", ",", "jsonKeyword", ")", ";", "if", "(", "sentimentObject", "==", "null", ")", "{", "return", "sentiment", ";", "}", "final", "String", "type", "=", "getString", "(", "JSONConstants", ".", "SENTIMENT_TYPE_KEY", ",", "sentimentObject", ")", ";", "final", "Double", "score", "=", "getDouble", "(", "JSONConstants", ".", "SENTIMENT_SCORE_KEY", ",", "sentimentObject", ")", ";", "final", "Integer", "mixed", "=", "getInteger", "(", "JSONConstants", ".", "SENTIMENT_MIXED_KEY", ",", "sentimentObject", ")", ";", "if", "(", "isValidSentiment", "(", "type", ",", "score", ",", "mixed", ")", ")", "{", "sentiment", "=", "new", "SentimentAlchemyEntity", "(", ")", ";", "if", "(", "!", "StringUtils", ".", "isBlank", "(", "type", ")", ")", "{", "sentiment", ".", "setType", "(", "type", ")", ";", "}", "if", "(", "score", "!=", "null", ")", "{", "sentiment", ".", "setScore", "(", "score", ")", ";", "}", "if", "(", "mixed", "!=", "null", ")", "{", "sentiment", ".", "setIsMixed", "(", "mixed", ")", ";", "}", "}", "return", "sentiment", ";", "}" ]
Return a sentiment object populated by the values in the json object. Return null if there are no sentiment data. @param jsonKeyword object containing the keyword values @return sentiment object populated by the values in the json object
[ "Return", "a", "sentiment", "object", "populated", "by", "the", "values", "in", "the", "json", "object", ".", "Return", "null", "if", "there", "are", "no", "sentiment", "data", "." ]
5208cfc92a878ceeaff052787af29da92d98db7e
https://github.com/likethecolor/Alchemy-API/blob/5208cfc92a878ceeaff052787af29da92d98db7e/src/main/java/com/likethecolor/alchemy/api/parser/json/KeywordParser.java#L80-L104
150,062
eurekaclinical/datastore
src/main/java/org/eurekaclinical/datastore/bdb/BdbPersistentStoreFactory.java
BdbPersistentStoreFactory.createClassCatalog
@Override protected StoredClassCatalog createClassCatalog(Environment env) throws IllegalArgumentException, DatabaseException { DatabaseConfig dbConfig = new DatabaseConfig(); dbConfig.setTemporary(false); dbConfig.setAllowCreate(true); Database catalogDb = env.openDatabase(null, CLASS_CATALOG, dbConfig); return new StoredClassCatalog(catalogDb); }
java
@Override protected StoredClassCatalog createClassCatalog(Environment env) throws IllegalArgumentException, DatabaseException { DatabaseConfig dbConfig = new DatabaseConfig(); dbConfig.setTemporary(false); dbConfig.setAllowCreate(true); Database catalogDb = env.openDatabase(null, CLASS_CATALOG, dbConfig); return new StoredClassCatalog(catalogDb); }
[ "@", "Override", "protected", "StoredClassCatalog", "createClassCatalog", "(", "Environment", "env", ")", "throws", "IllegalArgumentException", ",", "DatabaseException", "{", "DatabaseConfig", "dbConfig", "=", "new", "DatabaseConfig", "(", ")", ";", "dbConfig", ".", "setTemporary", "(", "false", ")", ";", "dbConfig", ".", "setAllowCreate", "(", "true", ")", ";", "Database", "catalogDb", "=", "env", ".", "openDatabase", "(", "null", ",", "CLASS_CATALOG", ",", "dbConfig", ")", ";", "return", "new", "StoredClassCatalog", "(", "catalogDb", ")", ";", "}" ]
Creates a persistent class catalog. @param env the environment to use. @return the class catalog. @throws OperationFailureException if one of the Read Operation Failures occurs, or one of the Write Operation Failures occurs. @throws EnvironmentFailureException - if an unexpected, internal or environment-wide failure occurs. @throws java.lang.IllegalStateException if the provided environment has been closed. @throws java.lang.IllegalStateException if there are other open handles for this database.
[ "Creates", "a", "persistent", "class", "catalog", "." ]
a03a70819bb562ba45eac66ca49f778035ee45e0
https://github.com/eurekaclinical/datastore/blob/a03a70819bb562ba45eac66ca49f778035ee45e0/src/main/java/org/eurekaclinical/datastore/bdb/BdbPersistentStoreFactory.java#L71-L79
150,063
eurekaclinical/datastore
src/main/java/org/eurekaclinical/datastore/bdb/BdbPersistentStoreFactory.java
BdbPersistentStoreFactory.createEnvConfig
@Override protected EnvironmentConfig createEnvConfig() { EnvironmentConfig envConf = new EnvironmentConfig(); envConf.setAllowCreate(true); envConf.setTransactional(true); LOGGER.log(Level.FINE, "Calculating cache size"); MemoryMXBean memoryMXBean = ManagementFactory.getMemoryMXBean(); MemoryUsage memoryUsage = memoryMXBean.getHeapMemoryUsage(); long max = memoryUsage.getMax(); long used = memoryUsage.getUsed(); long available = max - used; long cacheSize = Math.round(available / 6.0); envConf.setCacheSize(cacheSize); LOGGER.log(Level.FINE, "Cache size set to {0}", cacheSize); return envConf; }
java
@Override protected EnvironmentConfig createEnvConfig() { EnvironmentConfig envConf = new EnvironmentConfig(); envConf.setAllowCreate(true); envConf.setTransactional(true); LOGGER.log(Level.FINE, "Calculating cache size"); MemoryMXBean memoryMXBean = ManagementFactory.getMemoryMXBean(); MemoryUsage memoryUsage = memoryMXBean.getHeapMemoryUsage(); long max = memoryUsage.getMax(); long used = memoryUsage.getUsed(); long available = max - used; long cacheSize = Math.round(available / 6.0); envConf.setCacheSize(cacheSize); LOGGER.log(Level.FINE, "Cache size set to {0}", cacheSize); return envConf; }
[ "@", "Override", "protected", "EnvironmentConfig", "createEnvConfig", "(", ")", "{", "EnvironmentConfig", "envConf", "=", "new", "EnvironmentConfig", "(", ")", ";", "envConf", ".", "setAllowCreate", "(", "true", ")", ";", "envConf", ".", "setTransactional", "(", "true", ")", ";", "LOGGER", ".", "log", "(", "Level", ".", "FINE", ",", "\"Calculating cache size\"", ")", ";", "MemoryMXBean", "memoryMXBean", "=", "ManagementFactory", ".", "getMemoryMXBean", "(", ")", ";", "MemoryUsage", "memoryUsage", "=", "memoryMXBean", ".", "getHeapMemoryUsage", "(", ")", ";", "long", "max", "=", "memoryUsage", ".", "getMax", "(", ")", ";", "long", "used", "=", "memoryUsage", ".", "getUsed", "(", ")", ";", "long", "available", "=", "max", "-", "used", ";", "long", "cacheSize", "=", "Math", ".", "round", "(", "available", "/", "6.0", ")", ";", "envConf", ".", "setCacheSize", "(", "cacheSize", ")", ";", "LOGGER", ".", "log", "(", "Level", ".", "FINE", ",", "\"Cache size set to {0}\"", ",", "cacheSize", ")", ";", "return", "envConf", ";", "}" ]
Creates an environment config that allows object creation and supports transactions. In addition, it automatically calculates a cache size based on available memory. @return a newly created environment config instance.
[ "Creates", "an", "environment", "config", "that", "allows", "object", "creation", "and", "supports", "transactions", ".", "In", "addition", "it", "automatically", "calculates", "a", "cache", "size", "based", "on", "available", "memory", "." ]
a03a70819bb562ba45eac66ca49f778035ee45e0
https://github.com/eurekaclinical/datastore/blob/a03a70819bb562ba45eac66ca49f778035ee45e0/src/main/java/org/eurekaclinical/datastore/bdb/BdbPersistentStoreFactory.java#L88-L104
150,064
eurekaclinical/datastore
src/main/java/org/eurekaclinical/datastore/bdb/BdbPersistentStoreFactory.java
BdbPersistentStoreFactory.createDatabaseConfig
@Override protected DatabaseConfig createDatabaseConfig() { DatabaseConfig dbConfig = new DatabaseConfig(); dbConfig.setAllowCreate(true); dbConfig.setTemporary(false); return dbConfig; }
java
@Override protected DatabaseConfig createDatabaseConfig() { DatabaseConfig dbConfig = new DatabaseConfig(); dbConfig.setAllowCreate(true); dbConfig.setTemporary(false); return dbConfig; }
[ "@", "Override", "protected", "DatabaseConfig", "createDatabaseConfig", "(", ")", "{", "DatabaseConfig", "dbConfig", "=", "new", "DatabaseConfig", "(", ")", ";", "dbConfig", ".", "setAllowCreate", "(", "true", ")", ";", "dbConfig", ".", "setTemporary", "(", "false", ")", ";", "return", "dbConfig", ";", "}" ]
Creates a database config for creating persistent databases. @return a newly created database config instance.
[ "Creates", "a", "database", "config", "for", "creating", "persistent", "databases", "." ]
a03a70819bb562ba45eac66ca49f778035ee45e0
https://github.com/eurekaclinical/datastore/blob/a03a70819bb562ba45eac66ca49f778035ee45e0/src/main/java/org/eurekaclinical/datastore/bdb/BdbPersistentStoreFactory.java#L111-L117
150,065
mlhartme/mork
src/main/java/net/oneandone/mork/reflect/Method.java
Method.forName
public static Selection forName(Class cl, String name) { java.lang.reflect.Method[] all; int i; List<Function> lst; Function fn; all = cl.getDeclaredMethods(); lst = new ArrayList<Function>(); for (i = 0; i < all.length; i++) { if (name.equals(all[i].getName())) { fn = create(all[i]); if (fn != null) { lst.add(fn); } } } return new Selection(lst); }
java
public static Selection forName(Class cl, String name) { java.lang.reflect.Method[] all; int i; List<Function> lst; Function fn; all = cl.getDeclaredMethods(); lst = new ArrayList<Function>(); for (i = 0; i < all.length; i++) { if (name.equals(all[i].getName())) { fn = create(all[i]); if (fn != null) { lst.add(fn); } } } return new Selection(lst); }
[ "public", "static", "Selection", "forName", "(", "Class", "cl", ",", "String", "name", ")", "{", "java", ".", "lang", ".", "reflect", ".", "Method", "[", "]", "all", ";", "int", "i", ";", "List", "<", "Function", ">", "lst", ";", "Function", "fn", ";", "all", "=", "cl", ".", "getDeclaredMethods", "(", ")", ";", "lst", "=", "new", "ArrayList", "<", "Function", ">", "(", ")", ";", "for", "(", "i", "=", "0", ";", "i", "<", "all", ".", "length", ";", "i", "++", ")", "{", "if", "(", "name", ".", "equals", "(", "all", "[", "i", "]", ".", "getName", "(", ")", ")", ")", "{", "fn", "=", "create", "(", "all", "[", "i", "]", ")", ";", "if", "(", "fn", "!=", "null", ")", "{", "lst", ".", "add", "(", "fn", ")", ";", "}", "}", "}", "return", "new", "Selection", "(", "lst", ")", ";", "}" ]
Gets all valid Methods from the specified class with the specified name. @param cl Class to look at @param name the Function name to look for @return retrieves all Methods found
[ "Gets", "all", "valid", "Methods", "from", "the", "specified", "class", "with", "the", "specified", "name", "." ]
a069b087750c4133bfeebaf1f599c3bc96762113
https://github.com/mlhartme/mork/blob/a069b087750c4133bfeebaf1f599c3bc96762113/src/main/java/net/oneandone/mork/reflect/Method.java#L67-L84
150,066
mlhartme/mork
src/main/java/net/oneandone/mork/reflect/Method.java
Method.invoke
@Override public Object invoke(Object[] vals) throws InvocationTargetException { Object[] tmp; int i; try { if (isStatic()) { return meth.invoke(null, vals); } else { if (vals.length == 0) { throw new IllegalArgumentException("invalid arguments"); } tmp = new Object[vals.length - 1]; for (i = 1; i < vals.length; i++) { tmp[i-1] = vals[i]; } return meth.invoke(vals[0], tmp); } } catch (InvocationTargetException | IllegalArgumentException e) { throw e; } catch (IllegalAccessException e) { // isValid should prevent this throw new RuntimeException("can't access method"); } }
java
@Override public Object invoke(Object[] vals) throws InvocationTargetException { Object[] tmp; int i; try { if (isStatic()) { return meth.invoke(null, vals); } else { if (vals.length == 0) { throw new IllegalArgumentException("invalid arguments"); } tmp = new Object[vals.length - 1]; for (i = 1; i < vals.length; i++) { tmp[i-1] = vals[i]; } return meth.invoke(vals[0], tmp); } } catch (InvocationTargetException | IllegalArgumentException e) { throw e; } catch (IllegalAccessException e) { // isValid should prevent this throw new RuntimeException("can't access method"); } }
[ "@", "Override", "public", "Object", "invoke", "(", "Object", "[", "]", "vals", ")", "throws", "InvocationTargetException", "{", "Object", "[", "]", "tmp", ";", "int", "i", ";", "try", "{", "if", "(", "isStatic", "(", ")", ")", "{", "return", "meth", ".", "invoke", "(", "null", ",", "vals", ")", ";", "}", "else", "{", "if", "(", "vals", ".", "length", "==", "0", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"invalid arguments\"", ")", ";", "}", "tmp", "=", "new", "Object", "[", "vals", ".", "length", "-", "1", "]", ";", "for", "(", "i", "=", "1", ";", "i", "<", "vals", ".", "length", ";", "i", "++", ")", "{", "tmp", "[", "i", "-", "1", "]", "=", "vals", "[", "i", "]", ";", "}", "return", "meth", ".", "invoke", "(", "vals", "[", "0", "]", ",", "tmp", ")", ";", "}", "}", "catch", "(", "InvocationTargetException", "|", "IllegalArgumentException", "e", ")", "{", "throw", "e", ";", "}", "catch", "(", "IllegalAccessException", "e", ")", "{", "// isValid should prevent this", "throw", "new", "RuntimeException", "(", "\"can't access method\"", ")", ";", "}", "}" ]
Invokes the wrapped Java Method. Throws Exceptions raised in the Java Method. @param vals arguments to the Java Method @return Object returned be the Java Method or the Object the method is invoked on.
[ "Invokes", "the", "wrapped", "Java", "Method", ".", "Throws", "Exceptions", "raised", "in", "the", "Java", "Method", "." ]
a069b087750c4133bfeebaf1f599c3bc96762113
https://github.com/mlhartme/mork/blob/a069b087750c4133bfeebaf1f599c3bc96762113/src/main/java/net/oneandone/mork/reflect/Method.java#L174-L200
150,067
mlhartme/mork
src/main/java/net/oneandone/mork/reflect/Method.java
Method.write
public static void write(ObjectOutput out, java.lang.reflect.Method meth) throws IOException { Class cl; if (meth == null) { ClassRef.write(out, null); } else { cl = meth.getDeclaringClass(); ClassRef.write(out, cl); out.writeUTF(meth.getName()); ClassRef.writeClasses(out, meth.getParameterTypes()); } }
java
public static void write(ObjectOutput out, java.lang.reflect.Method meth) throws IOException { Class cl; if (meth == null) { ClassRef.write(out, null); } else { cl = meth.getDeclaringClass(); ClassRef.write(out, cl); out.writeUTF(meth.getName()); ClassRef.writeClasses(out, meth.getParameterTypes()); } }
[ "public", "static", "void", "write", "(", "ObjectOutput", "out", ",", "java", ".", "lang", ".", "reflect", ".", "Method", "meth", ")", "throws", "IOException", "{", "Class", "cl", ";", "if", "(", "meth", "==", "null", ")", "{", "ClassRef", ".", "write", "(", "out", ",", "null", ")", ";", "}", "else", "{", "cl", "=", "meth", ".", "getDeclaringClass", "(", ")", ";", "ClassRef", ".", "write", "(", "out", ",", "cl", ")", ";", "out", ".", "writeUTF", "(", "meth", ".", "getName", "(", ")", ")", ";", "ClassRef", ".", "writeClasses", "(", "out", ",", "meth", ".", "getParameterTypes", "(", ")", ")", ";", "}", "}" ]
Writes a Java Method object. @param out target to write to @param meth object to be written
[ "Writes", "a", "Java", "Method", "object", "." ]
a069b087750c4133bfeebaf1f599c3bc96762113
https://github.com/mlhartme/mork/blob/a069b087750c4133bfeebaf1f599c3bc96762113/src/main/java/net/oneandone/mork/reflect/Method.java#L232-L244
150,068
mlhartme/mork
src/main/java/net/oneandone/mork/reflect/Method.java
Method.read
public static java.lang.reflect.Method read(ObjectInput in) throws ClassNotFoundException, NoSuchMethodException, IOException { Class cl; Class[] types; String name; cl = ClassRef.read(in); if (cl == null) { return null; } else { name = (String) in.readUTF(); types = ClassRef.readClasses(in); return cl.getMethod(name, types); } }
java
public static java.lang.reflect.Method read(ObjectInput in) throws ClassNotFoundException, NoSuchMethodException, IOException { Class cl; Class[] types; String name; cl = ClassRef.read(in); if (cl == null) { return null; } else { name = (String) in.readUTF(); types = ClassRef.readClasses(in); return cl.getMethod(name, types); } }
[ "public", "static", "java", ".", "lang", ".", "reflect", ".", "Method", "read", "(", "ObjectInput", "in", ")", "throws", "ClassNotFoundException", ",", "NoSuchMethodException", ",", "IOException", "{", "Class", "cl", ";", "Class", "[", "]", "types", ";", "String", "name", ";", "cl", "=", "ClassRef", ".", "read", "(", "in", ")", ";", "if", "(", "cl", "==", "null", ")", "{", "return", "null", ";", "}", "else", "{", "name", "=", "(", "String", ")", "in", ".", "readUTF", "(", ")", ";", "types", "=", "ClassRef", ".", "readClasses", "(", "in", ")", ";", "return", "cl", ".", "getMethod", "(", "name", ",", "types", ")", ";", "}", "}" ]
Reads a Java Method object. @param in source to read from @return Java Method read
[ "Reads", "a", "Java", "Method", "object", "." ]
a069b087750c4133bfeebaf1f599c3bc96762113
https://github.com/mlhartme/mork/blob/a069b087750c4133bfeebaf1f599c3bc96762113/src/main/java/net/oneandone/mork/reflect/Method.java#L251-L265
150,069
icoloma/simpleds
src/main/java/org/simpleds/util/GenericTypeResolver.java
GenericTypeResolver.getTargetType
public static Type getTargetType(MethodParameter methodParam) { Preconditions.checkNotNull(methodParam, "MethodParameter must not be null"); if (methodParam.getConstructor() != null) { return methodParam.getConstructor().getGenericParameterTypes()[methodParam.getParameterIndex()]; } else { if (methodParam.getParameterIndex() >= 0) { return methodParam.getMethod().getGenericParameterTypes()[methodParam.getParameterIndex()]; } else { return methodParam.getMethod().getGenericReturnType(); } } }
java
public static Type getTargetType(MethodParameter methodParam) { Preconditions.checkNotNull(methodParam, "MethodParameter must not be null"); if (methodParam.getConstructor() != null) { return methodParam.getConstructor().getGenericParameterTypes()[methodParam.getParameterIndex()]; } else { if (methodParam.getParameterIndex() >= 0) { return methodParam.getMethod().getGenericParameterTypes()[methodParam.getParameterIndex()]; } else { return methodParam.getMethod().getGenericReturnType(); } } }
[ "public", "static", "Type", "getTargetType", "(", "MethodParameter", "methodParam", ")", "{", "Preconditions", ".", "checkNotNull", "(", "methodParam", ",", "\"MethodParameter must not be null\"", ")", ";", "if", "(", "methodParam", ".", "getConstructor", "(", ")", "!=", "null", ")", "{", "return", "methodParam", ".", "getConstructor", "(", ")", ".", "getGenericParameterTypes", "(", ")", "[", "methodParam", ".", "getParameterIndex", "(", ")", "]", ";", "}", "else", "{", "if", "(", "methodParam", ".", "getParameterIndex", "(", ")", ">=", "0", ")", "{", "return", "methodParam", ".", "getMethod", "(", ")", ".", "getGenericParameterTypes", "(", ")", "[", "methodParam", ".", "getParameterIndex", "(", ")", "]", ";", "}", "else", "{", "return", "methodParam", ".", "getMethod", "(", ")", ".", "getGenericReturnType", "(", ")", ";", "}", "}", "}" ]
Determine the target type for the given parameter specification. @param methodParam the method parameter specification @return the corresponding generic parameter type
[ "Determine", "the", "target", "type", "for", "the", "given", "parameter", "specification", "." ]
b07763df98b9375b764e625f617a6c78df4b068d
https://github.com/icoloma/simpleds/blob/b07763df98b9375b764e625f617a6c78df4b068d/src/main/java/org/simpleds/util/GenericTypeResolver.java#L38-L51
150,070
icoloma/simpleds
src/main/java/org/simpleds/util/GenericTypeResolver.java
GenericTypeResolver.resolveParameterType
public static Class<?> resolveParameterType(MethodParameter methodParam, Class clazz) { Type genericType = getTargetType(methodParam); Preconditions.checkNotNull(clazz, "Class must not be null"); Map<TypeVariable, Type> typeVariableMap = getTypeVariableMap(clazz); Type rawType = getRawType(genericType, typeVariableMap); Class result = (rawType instanceof Class ? (Class) rawType : methodParam.getParameterType()); methodParam.setParameterType(result); methodParam.typeVariableMap = typeVariableMap; return result; }
java
public static Class<?> resolveParameterType(MethodParameter methodParam, Class clazz) { Type genericType = getTargetType(methodParam); Preconditions.checkNotNull(clazz, "Class must not be null"); Map<TypeVariable, Type> typeVariableMap = getTypeVariableMap(clazz); Type rawType = getRawType(genericType, typeVariableMap); Class result = (rawType instanceof Class ? (Class) rawType : methodParam.getParameterType()); methodParam.setParameterType(result); methodParam.typeVariableMap = typeVariableMap; return result; }
[ "public", "static", "Class", "<", "?", ">", "resolveParameterType", "(", "MethodParameter", "methodParam", ",", "Class", "clazz", ")", "{", "Type", "genericType", "=", "getTargetType", "(", "methodParam", ")", ";", "Preconditions", ".", "checkNotNull", "(", "clazz", ",", "\"Class must not be null\"", ")", ";", "Map", "<", "TypeVariable", ",", "Type", ">", "typeVariableMap", "=", "getTypeVariableMap", "(", "clazz", ")", ";", "Type", "rawType", "=", "getRawType", "(", "genericType", ",", "typeVariableMap", ")", ";", "Class", "result", "=", "(", "rawType", "instanceof", "Class", "?", "(", "Class", ")", "rawType", ":", "methodParam", ".", "getParameterType", "(", ")", ")", ";", "methodParam", ".", "setParameterType", "(", "result", ")", ";", "methodParam", ".", "typeVariableMap", "=", "typeVariableMap", ";", "return", "result", ";", "}" ]
Determine the target type for the given generic parameter type. @param methodParam the method parameter specification @param clazz the class to resolve type variables against @return the corresponding generic parameter or return type
[ "Determine", "the", "target", "type", "for", "the", "given", "generic", "parameter", "type", "." ]
b07763df98b9375b764e625f617a6c78df4b068d
https://github.com/icoloma/simpleds/blob/b07763df98b9375b764e625f617a6c78df4b068d/src/main/java/org/simpleds/util/GenericTypeResolver.java#L59-L68
150,071
icoloma/simpleds
src/main/java/org/simpleds/util/GenericTypeResolver.java
GenericTypeResolver.resolveReturnType
public static Class<?> resolveReturnType(Method method, Class clazz) { Preconditions.checkNotNull(method, "Method must not be null"); Type genericType = method.getGenericReturnType(); Preconditions.checkNotNull(clazz, "Class must not be null"); Map<TypeVariable, Type> typeVariableMap = getTypeVariableMap(clazz); Type rawType = getRawType(genericType, typeVariableMap); return (rawType instanceof Class ? (Class) rawType : method.getReturnType()); }
java
public static Class<?> resolveReturnType(Method method, Class clazz) { Preconditions.checkNotNull(method, "Method must not be null"); Type genericType = method.getGenericReturnType(); Preconditions.checkNotNull(clazz, "Class must not be null"); Map<TypeVariable, Type> typeVariableMap = getTypeVariableMap(clazz); Type rawType = getRawType(genericType, typeVariableMap); return (rawType instanceof Class ? (Class) rawType : method.getReturnType()); }
[ "public", "static", "Class", "<", "?", ">", "resolveReturnType", "(", "Method", "method", ",", "Class", "clazz", ")", "{", "Preconditions", ".", "checkNotNull", "(", "method", ",", "\"Method must not be null\"", ")", ";", "Type", "genericType", "=", "method", ".", "getGenericReturnType", "(", ")", ";", "Preconditions", ".", "checkNotNull", "(", "clazz", ",", "\"Class must not be null\"", ")", ";", "Map", "<", "TypeVariable", ",", "Type", ">", "typeVariableMap", "=", "getTypeVariableMap", "(", "clazz", ")", ";", "Type", "rawType", "=", "getRawType", "(", "genericType", ",", "typeVariableMap", ")", ";", "return", "(", "rawType", "instanceof", "Class", "?", "(", "Class", ")", "rawType", ":", "method", ".", "getReturnType", "(", ")", ")", ";", "}" ]
Determine the target type for the generic return type of the given method. @param method the method to introspect @param clazz the class to resolve type variables against @return the corresponding generic parameter or return type
[ "Determine", "the", "target", "type", "for", "the", "generic", "return", "type", "of", "the", "given", "method", "." ]
b07763df98b9375b764e625f617a6c78df4b068d
https://github.com/icoloma/simpleds/blob/b07763df98b9375b764e625f617a6c78df4b068d/src/main/java/org/simpleds/util/GenericTypeResolver.java#L76-L83
150,072
mlhartme/mork
src/main/java/net/oneandone/mork/parser/ParserTable.java
ParserTable.addShift
public void addShift(int state, int sym, int nextState) { int idx; idx = state * symbolCount + sym; if (values[idx] != NOT_SET) { throw new IllegalStateException(); } values[idx] = createValue(Parser.SHIFT, nextState); }
java
public void addShift(int state, int sym, int nextState) { int idx; idx = state * symbolCount + sym; if (values[idx] != NOT_SET) { throw new IllegalStateException(); } values[idx] = createValue(Parser.SHIFT, nextState); }
[ "public", "void", "addShift", "(", "int", "state", ",", "int", "sym", ",", "int", "nextState", ")", "{", "int", "idx", ";", "idx", "=", "state", "*", "symbolCount", "+", "sym", ";", "if", "(", "values", "[", "idx", "]", "!=", "NOT_SET", ")", "{", "throw", "new", "IllegalStateException", "(", ")", ";", "}", "values", "[", "idx", "]", "=", "createValue", "(", "Parser", ".", "SHIFT", ",", "nextState", ")", ";", "}" ]
Cannot have conflicts. @param sym may be a nonterminal
[ "Cannot", "have", "conflicts", "." ]
a069b087750c4133bfeebaf1f599c3bc96762113
https://github.com/mlhartme/mork/blob/a069b087750c4133bfeebaf1f599c3bc96762113/src/main/java/net/oneandone/mork/parser/ParserTable.java#L134-L142
150,073
mlhartme/mork
src/main/java/net/oneandone/mork/parser/ParserTable.java
ParserTable.packValue
public String[] packValue(StringBuilder difs, StringBuilder vals) { List<String> lst; String[] array; if (difs.length() != vals.length()) { throw new IllegalArgumentException(); } lst = new ArrayList<String>(); split(difs, MAX_UTF8_LENGTH, lst); split(vals, MAX_UTF8_LENGTH, lst); array = new String[lst.size()]; lst.toArray(array); return array; }
java
public String[] packValue(StringBuilder difs, StringBuilder vals) { List<String> lst; String[] array; if (difs.length() != vals.length()) { throw new IllegalArgumentException(); } lst = new ArrayList<String>(); split(difs, MAX_UTF8_LENGTH, lst); split(vals, MAX_UTF8_LENGTH, lst); array = new String[lst.size()]; lst.toArray(array); return array; }
[ "public", "String", "[", "]", "packValue", "(", "StringBuilder", "difs", ",", "StringBuilder", "vals", ")", "{", "List", "<", "String", ">", "lst", ";", "String", "[", "]", "array", ";", "if", "(", "difs", ".", "length", "(", ")", "!=", "vals", ".", "length", "(", ")", ")", "{", "throw", "new", "IllegalArgumentException", "(", ")", ";", "}", "lst", "=", "new", "ArrayList", "<", "String", ">", "(", ")", ";", "split", "(", "difs", ",", "MAX_UTF8_LENGTH", ",", "lst", ")", ";", "split", "(", "vals", ",", "MAX_UTF8_LENGTH", ",", "lst", ")", ";", "array", "=", "new", "String", "[", "lst", ".", "size", "(", ")", "]", ";", "lst", ".", "toArray", "(", "array", ")", ";", "return", "array", ";", "}" ]
3 max size of utf8 encoded char
[ "3", "max", "size", "of", "utf8", "encoded", "char" ]
a069b087750c4133bfeebaf1f599c3bc96762113
https://github.com/mlhartme/mork/blob/a069b087750c4133bfeebaf1f599c3bc96762113/src/main/java/net/oneandone/mork/parser/ParserTable.java#L233-L246
150,074
mlhartme/mork
src/main/java/net/oneandone/mork/classfile/InstructionEncoding.java
InstructionEncoding.read
public Instruction read(int opcode, Input src, int ofs) throws IOException { switch (opcode) { case WIDE: return readWide(src, ofs); case TABLESWITCH: return readTableSwitch(src, ofs); case LOOKUPSWITCH: return readLookupSwitch(src, ofs); default: return readNormal(src, ofs); } }
java
public Instruction read(int opcode, Input src, int ofs) throws IOException { switch (opcode) { case WIDE: return readWide(src, ofs); case TABLESWITCH: return readTableSwitch(src, ofs); case LOOKUPSWITCH: return readLookupSwitch(src, ofs); default: return readNormal(src, ofs); } }
[ "public", "Instruction", "read", "(", "int", "opcode", ",", "Input", "src", ",", "int", "ofs", ")", "throws", "IOException", "{", "switch", "(", "opcode", ")", "{", "case", "WIDE", ":", "return", "readWide", "(", "src", ",", "ofs", ")", ";", "case", "TABLESWITCH", ":", "return", "readTableSwitch", "(", "src", ",", "ofs", ")", ";", "case", "LOOKUPSWITCH", ":", "return", "readLookupSwitch", "(", "src", ",", "ofs", ")", ";", "default", ":", "return", "readNormal", "(", "src", ",", "ofs", ")", ";", "}", "}" ]
all opcodes except for tableswitch, lookupswitch and wide are considered "normal"
[ "all", "opcodes", "except", "for", "tableswitch", "lookupswitch", "and", "wide", "are", "considered", "normal" ]
a069b087750c4133bfeebaf1f599c3bc96762113
https://github.com/mlhartme/mork/blob/a069b087750c4133bfeebaf1f599c3bc96762113/src/main/java/net/oneandone/mork/classfile/InstructionEncoding.java#L43-L54
150,075
vikingbrain/thedavidbox-client4j
src/main/java/com/vikingbrain/nmt/controller/impl/DavidBoxParserImpl.java
DavidBoxParserImpl.prepareXmlForParsing
private String prepareXmlForParsing(String xml) throws TheDavidBoxClientException{ //Escape all & symbols in the response so it can parse it later xml = xml.replaceAll("&", "&amp;"); String xmlReady; try { //It repairs the encoding to allow all utf-8 symbols xmlReady = new String(xml.getBytes(), CHARSET_ENCODING); } catch (UnsupportedEncodingException e) { throw new TheDavidBoxClientException(e); } return xmlReady; }
java
private String prepareXmlForParsing(String xml) throws TheDavidBoxClientException{ //Escape all & symbols in the response so it can parse it later xml = xml.replaceAll("&", "&amp;"); String xmlReady; try { //It repairs the encoding to allow all utf-8 symbols xmlReady = new String(xml.getBytes(), CHARSET_ENCODING); } catch (UnsupportedEncodingException e) { throw new TheDavidBoxClientException(e); } return xmlReady; }
[ "private", "String", "prepareXmlForParsing", "(", "String", "xml", ")", "throws", "TheDavidBoxClientException", "{", "//Escape all & symbols in the response so it can parse it later\r", "xml", "=", "xml", ".", "replaceAll", "(", "\"&\"", ",", "\"&amp;\"", ")", ";", "String", "xmlReady", ";", "try", "{", "//It repairs the encoding to allow all utf-8 symbols\r", "xmlReady", "=", "new", "String", "(", "xml", ".", "getBytes", "(", ")", ",", "CHARSET_ENCODING", ")", ";", "}", "catch", "(", "UnsupportedEncodingException", "e", ")", "{", "throw", "new", "TheDavidBoxClientException", "(", "e", ")", ";", "}", "return", "xmlReady", ";", "}" ]
It prepares the xml string for parsing. @param xml the xml response @return the xml prepared @throws TheDavidBoxClientException exception in the client
[ "It", "prepares", "the", "xml", "string", "for", "parsing", "." ]
b2375a59b30fc3bd5dae34316bda68e01d006535
https://github.com/vikingbrain/thedavidbox-client4j/blob/b2375a59b30fc3bd5dae34316bda68e01d006535/src/main/java/com/vikingbrain/nmt/controller/impl/DavidBoxParserImpl.java#L46-L58
150,076
likethecolor/Alchemy-API
src/main/java/com/likethecolor/alchemy/api/entity/AlchemyAction.java
AlchemyAction.setLematized
public void setLematized(String lematized) { if(lematized != null) { lematized = lematized.trim(); } this.lematized = lematized; }
java
public void setLematized(String lematized) { if(lematized != null) { lematized = lematized.trim(); } this.lematized = lematized; }
[ "public", "void", "setLematized", "(", "String", "lematized", ")", "{", "if", "(", "lematized", "!=", "null", ")", "{", "lematized", "=", "lematized", ".", "trim", "(", ")", ";", "}", "this", ".", "lematized", "=", "lematized", ";", "}" ]
Set the lemmatized base form of the detected action. @param lematized lemmatized base form of the detected action
[ "Set", "the", "lemmatized", "base", "form", "of", "the", "detected", "action", "." ]
5208cfc92a878ceeaff052787af29da92d98db7e
https://github.com/likethecolor/Alchemy-API/blob/5208cfc92a878ceeaff052787af29da92d98db7e/src/main/java/com/likethecolor/alchemy/api/entity/AlchemyAction.java#L42-L47
150,077
leadware/jpersistence-tools
jpersistence-tools-api/src/main/java/net/leadware/persistence/tools/api/validator/jsr303ext/engine/JSR303ValidatorEngine.java
JSR303ValidatorEngine.validate
public <T> void validate(T entity) { // Obtention de l'ensemble des violations Set<ConstraintViolation<T>> constraintViolations = validator.validate(entity); // Si l'ensemble est vide if(constraintViolations == null || constraintViolations.size() == 0) return; // Obtention de la première violation ConstraintViolation<T> first = constraintViolations.iterator().next(); // Obtention du descripteur de la contrainte ConstraintDescriptor<?> constraintDescriptor = first.getConstraintDescriptor(); // Nom du bean en echec String entityName = first.getRootBeanClass().getSimpleName(); // Nom de la propriété en echec String propertyName = first.getPropertyPath().toString(); // Message de violation String message = first.getMessage(); // Obtention de l'annotation en cours String[] parameters = buildAnnotationConstraintParameters(constraintDescriptor.getAnnotation()); // On leve une Exception throw new InvalidEntityInstanceStateException(entityName, propertyName, message, parameters); }
java
public <T> void validate(T entity) { // Obtention de l'ensemble des violations Set<ConstraintViolation<T>> constraintViolations = validator.validate(entity); // Si l'ensemble est vide if(constraintViolations == null || constraintViolations.size() == 0) return; // Obtention de la première violation ConstraintViolation<T> first = constraintViolations.iterator().next(); // Obtention du descripteur de la contrainte ConstraintDescriptor<?> constraintDescriptor = first.getConstraintDescriptor(); // Nom du bean en echec String entityName = first.getRootBeanClass().getSimpleName(); // Nom de la propriété en echec String propertyName = first.getPropertyPath().toString(); // Message de violation String message = first.getMessage(); // Obtention de l'annotation en cours String[] parameters = buildAnnotationConstraintParameters(constraintDescriptor.getAnnotation()); // On leve une Exception throw new InvalidEntityInstanceStateException(entityName, propertyName, message, parameters); }
[ "public", "<", "T", ">", "void", "validate", "(", "T", "entity", ")", "{", "// Obtention de l'ensemble des violations\r", "Set", "<", "ConstraintViolation", "<", "T", ">>", "constraintViolations", "=", "validator", ".", "validate", "(", "entity", ")", ";", "// Si l'ensemble est vide\r", "if", "(", "constraintViolations", "==", "null", "||", "constraintViolations", ".", "size", "(", ")", "==", "0", ")", "return", ";", "// Obtention de la première violation\r", "ConstraintViolation", "<", "T", ">", "first", "=", "constraintViolations", ".", "iterator", "(", ")", ".", "next", "(", ")", ";", "// Obtention du descripteur de la contrainte\r", "ConstraintDescriptor", "<", "?", ">", "constraintDescriptor", "=", "first", ".", "getConstraintDescriptor", "(", ")", ";", "// Nom du bean en echec\r", "String", "entityName", "=", "first", ".", "getRootBeanClass", "(", ")", ".", "getSimpleName", "(", ")", ";", "// Nom de la propriété en echec\r", "String", "propertyName", "=", "first", ".", "getPropertyPath", "(", ")", ".", "toString", "(", ")", ";", "// Message de violation\r", "String", "message", "=", "first", ".", "getMessage", "(", ")", ";", "// Obtention de l'annotation en cours\r", "String", "[", "]", "parameters", "=", "buildAnnotationConstraintParameters", "(", "constraintDescriptor", ".", "getAnnotation", "(", ")", ")", ";", "// On leve une Exception\r", "throw", "new", "InvalidEntityInstanceStateException", "(", "entityName", ",", "propertyName", ",", "message", ",", "parameters", ")", ";", "}" ]
Methode permettant de valider un onjet @param entity Entité valider @param <T> Type de l'entite
[ "Methode", "permettant", "de", "valider", "un", "onjet" ]
4c15372993584579d7dbb9b23dd4c0c0fdc9e789
https://github.com/leadware/jpersistence-tools/blob/4c15372993584579d7dbb9b23dd4c0c0fdc9e789/jpersistence-tools-api/src/main/java/net/leadware/persistence/tools/api/validator/jsr303ext/engine/JSR303ValidatorEngine.java#L115-L143
150,078
leadware/jpersistence-tools
jpersistence-tools-api/src/main/java/net/leadware/persistence/tools/api/validator/jsr303ext/engine/JSR303ValidatorEngine.java
JSR303ValidatorEngine.buildAnnotationConstraintParameters
protected String[] buildAnnotationConstraintParameters(Annotation annotation) { // Si l'annotation est nulle if(annotation == null) return null; // Si l'annotation est de type @AuthorizedValues if(annotation instanceof AuthorizedValues) return new String[] { Arrays.toString(((AuthorizedValues) annotation).values()) }; // Si l'annotation est de type @Interval if(annotation instanceof Interval) return new String[] { Double.toString(((Interval) annotation).min()), Double.toString(((Interval) annotation).max()) }; // Si l'annotation est de type @Length if(annotation instanceof Length) return new String[] { Integer.toString(((Length) annotation).min()), Integer.toString(((Length) annotation).max()) }; // valeur par defaut return null; }
java
protected String[] buildAnnotationConstraintParameters(Annotation annotation) { // Si l'annotation est nulle if(annotation == null) return null; // Si l'annotation est de type @AuthorizedValues if(annotation instanceof AuthorizedValues) return new String[] { Arrays.toString(((AuthorizedValues) annotation).values()) }; // Si l'annotation est de type @Interval if(annotation instanceof Interval) return new String[] { Double.toString(((Interval) annotation).min()), Double.toString(((Interval) annotation).max()) }; // Si l'annotation est de type @Length if(annotation instanceof Length) return new String[] { Integer.toString(((Length) annotation).min()), Integer.toString(((Length) annotation).max()) }; // valeur par defaut return null; }
[ "protected", "String", "[", "]", "buildAnnotationConstraintParameters", "(", "Annotation", "annotation", ")", "{", "// Si l'annotation est nulle\r", "if", "(", "annotation", "==", "null", ")", "return", "null", ";", "// Si l'annotation est de type @AuthorizedValues\r", "if", "(", "annotation", "instanceof", "AuthorizedValues", ")", "return", "new", "String", "[", "]", "{", "Arrays", ".", "toString", "(", "(", "(", "AuthorizedValues", ")", "annotation", ")", ".", "values", "(", ")", ")", "}", ";", "// Si l'annotation est de type @Interval\r", "if", "(", "annotation", "instanceof", "Interval", ")", "return", "new", "String", "[", "]", "{", "Double", ".", "toString", "(", "(", "(", "Interval", ")", "annotation", ")", ".", "min", "(", ")", ")", ",", "Double", ".", "toString", "(", "(", "(", "Interval", ")", "annotation", ")", ".", "max", "(", ")", ")", "}", ";", "// Si l'annotation est de type @Length\r", "if", "(", "annotation", "instanceof", "Length", ")", "return", "new", "String", "[", "]", "{", "Integer", ".", "toString", "(", "(", "(", "Length", ")", "annotation", ")", ".", "min", "(", ")", ")", ",", "Integer", ".", "toString", "(", "(", "(", "Length", ")", "annotation", ")", ".", "max", "(", ")", ")", "}", ";", "// valeur par defaut\r", "return", "null", ";", "}" ]
Methode permettant d'obtenir la liste des parametres d'une annotation de validation de contraintes @param annotation Annotation courante @return Tableau des parametres
[ "Methode", "permettant", "d", "obtenir", "la", "liste", "des", "parametres", "d", "une", "annotation", "de", "validation", "de", "contraintes" ]
4c15372993584579d7dbb9b23dd4c0c0fdc9e789
https://github.com/leadware/jpersistence-tools/blob/4c15372993584579d7dbb9b23dd4c0c0fdc9e789/jpersistence-tools-api/src/main/java/net/leadware/persistence/tools/api/validator/jsr303ext/engine/JSR303ValidatorEngine.java#L150-L166
150,079
xfcjscn/spring-social-base
src/main/java/net/gplatform/spring/social/base/SimpleConnectionSignUp.java
SimpleConnectionSignUp.execute
@Override public String execute(Connection<?> connection) { String localUserId = UUID.randomUUID().toString(); logger.debug("Local User ID is: {}", localUserId); return localUserId; }
java
@Override public String execute(Connection<?> connection) { String localUserId = UUID.randomUUID().toString(); logger.debug("Local User ID is: {}", localUserId); return localUserId; }
[ "@", "Override", "public", "String", "execute", "(", "Connection", "<", "?", ">", "connection", ")", "{", "String", "localUserId", "=", "UUID", ".", "randomUUID", "(", ")", ".", "toString", "(", ")", ";", "logger", ".", "debug", "(", "\"Local User ID is: {}\"", ",", "localUserId", ")", ";", "return", "localUserId", ";", "}" ]
here use random generated id to act as localUserId, localUserId will be the key to save connection & sign
[ "here", "use", "random", "generated", "id", "to", "act", "as", "localUserId", "localUserId", "will", "be", "the", "key", "to", "save", "connection", "&", "sign" ]
ec15b2f8e104a0f126242d64c4ecf35bc7ad07b2
https://github.com/xfcjscn/spring-social-base/blob/ec15b2f8e104a0f126242d64c4ecf35bc7ad07b2/src/main/java/net/gplatform/spring/social/base/SimpleConnectionSignUp.java#L38-L43
150,080
eurekaclinical/javautil
src/main/java/org/arp/javautil/string/StringUtil.java
StringUtil.escapeDelimitedColumn
public static String escapeDelimitedColumn(String str, char delimiter) { if (str == null || (containsNone(str, SEARCH_CHARS) && str.indexOf(delimiter) < 0)) { return str; } else { StringBuilder writer = new StringBuilder(); writer.append(QUOTE); for (int j = 0, n = str.length(); j < n; j++) { char c = str.charAt(j); if (c == QUOTE) { writer.append(QUOTE); } writer.append(c); } writer.append(QUOTE); return writer.toString(); } }
java
public static String escapeDelimitedColumn(String str, char delimiter) { if (str == null || (containsNone(str, SEARCH_CHARS) && str.indexOf(delimiter) < 0)) { return str; } else { StringBuilder writer = new StringBuilder(); writer.append(QUOTE); for (int j = 0, n = str.length(); j < n; j++) { char c = str.charAt(j); if (c == QUOTE) { writer.append(QUOTE); } writer.append(c); } writer.append(QUOTE); return writer.toString(); } }
[ "public", "static", "String", "escapeDelimitedColumn", "(", "String", "str", ",", "char", "delimiter", ")", "{", "if", "(", "str", "==", "null", "||", "(", "containsNone", "(", "str", ",", "SEARCH_CHARS", ")", "&&", "str", ".", "indexOf", "(", "delimiter", ")", "<", "0", ")", ")", "{", "return", "str", ";", "}", "else", "{", "StringBuilder", "writer", "=", "new", "StringBuilder", "(", ")", ";", "writer", ".", "append", "(", "QUOTE", ")", ";", "for", "(", "int", "j", "=", "0", ",", "n", "=", "str", ".", "length", "(", ")", ";", "j", "<", "n", ";", "j", "++", ")", "{", "char", "c", "=", "str", ".", "charAt", "(", "j", ")", ";", "if", "(", "c", "==", "QUOTE", ")", "{", "writer", ".", "append", "(", "QUOTE", ")", ";", "}", "writer", ".", "append", "(", "c", ")", ";", "}", "writer", ".", "append", "(", "QUOTE", ")", ";", "return", "writer", ".", "toString", "(", ")", ";", "}", "}" ]
Escapes a column in a delimited file. @param str a column {@link String}. @param delimiter the file's delimiter character. @return the escaped column {@link String}.
[ "Escapes", "a", "column", "in", "a", "delimited", "file", "." ]
779bbc5bf096c75f8eed4f99ca45b99c1d44df43
https://github.com/eurekaclinical/javautil/blob/779bbc5bf096c75f8eed4f99ca45b99c1d44df43/src/main/java/org/arp/javautil/string/StringUtil.java#L276-L292
150,081
mlhartme/mork
src/main/java/net/oneandone/mork/misc/StringArrayList.java
StringArrayList.add
public void add(String str) { String[] tmp; if (size == data.length) { tmp = new String[data.length + GROW]; System.arraycopy(data, 0, tmp, 0, data.length); data = tmp; } data[size] = str; size++; }
java
public void add(String str) { String[] tmp; if (size == data.length) { tmp = new String[data.length + GROW]; System.arraycopy(data, 0, tmp, 0, data.length); data = tmp; } data[size] = str; size++; }
[ "public", "void", "add", "(", "String", "str", ")", "{", "String", "[", "]", "tmp", ";", "if", "(", "size", "==", "data", ".", "length", ")", "{", "tmp", "=", "new", "String", "[", "data", ".", "length", "+", "GROW", "]", ";", "System", ".", "arraycopy", "(", "data", ",", "0", ",", "tmp", ",", "0", ",", "data", ".", "length", ")", ";", "data", "=", "tmp", ";", "}", "data", "[", "size", "]", "=", "str", ";", "size", "++", ";", "}" ]
Adds a new element to the end of the List. @param str new element
[ "Adds", "a", "new", "element", "to", "the", "end", "of", "the", "List", "." ]
a069b087750c4133bfeebaf1f599c3bc96762113
https://github.com/mlhartme/mork/blob/a069b087750c4133bfeebaf1f599c3bc96762113/src/main/java/net/oneandone/mork/misc/StringArrayList.java#L80-L90
150,082
mlhartme/mork
src/main/java/net/oneandone/mork/misc/StringArrayList.java
StringArrayList.addAll
public void addAll(StringArrayList vec) { int i; int max; max = vec.size(); for (i = 0; i < max; i++) { add(vec.get(i)); } }
java
public void addAll(StringArrayList vec) { int i; int max; max = vec.size(); for (i = 0; i < max; i++) { add(vec.get(i)); } }
[ "public", "void", "addAll", "(", "StringArrayList", "vec", ")", "{", "int", "i", ";", "int", "max", ";", "max", "=", "vec", ".", "size", "(", ")", ";", "for", "(", "i", "=", "0", ";", "i", "<", "max", ";", "i", "++", ")", "{", "add", "(", "vec", ".", "get", "(", "i", ")", ")", ";", "}", "}" ]
Adds a whole List of elements. @param vec List of elements to add
[ "Adds", "a", "whole", "List", "of", "elements", "." ]
a069b087750c4133bfeebaf1f599c3bc96762113
https://github.com/mlhartme/mork/blob/a069b087750c4133bfeebaf1f599c3bc96762113/src/main/java/net/oneandone/mork/misc/StringArrayList.java#L96-L104
150,083
mlhartme/mork
src/main/java/net/oneandone/mork/misc/StringArrayList.java
StringArrayList.indexOf
public int indexOf(String str) { int i; for (i = 0; i < size; i++) { if (data[i].equals(str)) { return i; } } return -1; }
java
public int indexOf(String str) { int i; for (i = 0; i < size; i++) { if (data[i].equals(str)) { return i; } } return -1; }
[ "public", "int", "indexOf", "(", "String", "str", ")", "{", "int", "i", ";", "for", "(", "i", "=", "0", ";", "i", "<", "size", ";", "i", "++", ")", "{", "if", "(", "data", "[", "i", "]", ".", "equals", "(", "str", ")", ")", "{", "return", "i", ";", "}", "}", "return", "-", "1", ";", "}" ]
Lookup an element. @param str element to find @return index of the first element found; -1 if nothing was found
[ "Lookup", "an", "element", "." ]
a069b087750c4133bfeebaf1f599c3bc96762113
https://github.com/mlhartme/mork/blob/a069b087750c4133bfeebaf1f599c3bc96762113/src/main/java/net/oneandone/mork/misc/StringArrayList.java#L111-L120
150,084
mlhartme/mork
src/main/java/net/oneandone/mork/scanner/Label.java
Label.combineLabel
private static Label combineLabel(FA fa, IntBitSet states) { int si; Label tmp; Label result; result = null; for (si = states.first(); si != -1; si = states.next(si)) { tmp = (Label) fa.get(si).getLabel(); if (tmp != null) { if (result == null) { result = new Label(); } result.symbols.addAll(tmp.symbols); } } return result; }
java
private static Label combineLabel(FA fa, IntBitSet states) { int si; Label tmp; Label result; result = null; for (si = states.first(); si != -1; si = states.next(si)) { tmp = (Label) fa.get(si).getLabel(); if (tmp != null) { if (result == null) { result = new Label(); } result.symbols.addAll(tmp.symbols); } } return result; }
[ "private", "static", "Label", "combineLabel", "(", "FA", "fa", ",", "IntBitSet", "states", ")", "{", "int", "si", ";", "Label", "tmp", ";", "Label", "result", ";", "result", "=", "null", ";", "for", "(", "si", "=", "states", ".", "first", "(", ")", ";", "si", "!=", "-", "1", ";", "si", "=", "states", ".", "next", "(", "si", ")", ")", "{", "tmp", "=", "(", "Label", ")", "fa", ".", "get", "(", "si", ")", ".", "getLabel", "(", ")", ";", "if", "(", "tmp", "!=", "null", ")", "{", "if", "(", "result", "==", "null", ")", "{", "result", "=", "new", "Label", "(", ")", ";", "}", "result", ".", "symbols", ".", "addAll", "(", "tmp", ".", "symbols", ")", ";", "}", "}", "return", "result", ";", "}" ]
might return null
[ "might", "return", "null" ]
a069b087750c4133bfeebaf1f599c3bc96762113
https://github.com/mlhartme/mork/blob/a069b087750c4133bfeebaf1f599c3bc96762113/src/main/java/net/oneandone/mork/scanner/Label.java#L118-L135
150,085
BellaDati/belladati-sdk-api
src/main/java/com/belladati/sdk/intervals/Interval.java
Interval.toJson
public ObjectNode toJson() { ObjectMapper mapper = new ObjectMapper(); ObjectNode node = mapper.createObjectNode(); ObjectNode unitIntervalNode = mapper.createObjectNode(); node.put(intervalUnit.getUnitNodeName(), unitIntervalNode); unitIntervalNode.put("interval", buildIntervalNode()); unitIntervalNode.put("aggregationType", intervalUnit.name()); return node; }
java
public ObjectNode toJson() { ObjectMapper mapper = new ObjectMapper(); ObjectNode node = mapper.createObjectNode(); ObjectNode unitIntervalNode = mapper.createObjectNode(); node.put(intervalUnit.getUnitNodeName(), unitIntervalNode); unitIntervalNode.put("interval", buildIntervalNode()); unitIntervalNode.put("aggregationType", intervalUnit.name()); return node; }
[ "public", "ObjectNode", "toJson", "(", ")", "{", "ObjectMapper", "mapper", "=", "new", "ObjectMapper", "(", ")", ";", "ObjectNode", "node", "=", "mapper", ".", "createObjectNode", "(", ")", ";", "ObjectNode", "unitIntervalNode", "=", "mapper", ".", "createObjectNode", "(", ")", ";", "node", ".", "put", "(", "intervalUnit", ".", "getUnitNodeName", "(", ")", ",", "unitIntervalNode", ")", ";", "unitIntervalNode", ".", "put", "(", "\"interval\"", ",", "buildIntervalNode", "(", ")", ")", ";", "unitIntervalNode", ".", "put", "(", "\"aggregationType\"", ",", "intervalUnit", ".", "name", "(", ")", ")", ";", "return", "node", ";", "}" ]
Returns a JSON representation of this interval to send to the server. Used by the SDK internally. @return a JSON representation of this interval
[ "Returns", "a", "JSON", "representation", "of", "this", "interval", "to", "send", "to", "the", "server", ".", "Used", "by", "the", "SDK", "internally", "." ]
ec45a42048d8255838ad0200aa6784a8e8a121c1
https://github.com/BellaDati/belladati-sdk-api/blob/ec45a42048d8255838ad0200aa6784a8e8a121c1/src/main/java/com/belladati/sdk/intervals/Interval.java#L44-L54
150,086
BellaDati/belladati-sdk-api
src/main/java/com/belladati/sdk/intervals/Interval.java
Interval.readInt
static int readInt(JsonNode node, String field) throws NumberFormatException { String stringValue = node.get(field).asText(); return (int) Float.parseFloat(stringValue); }
java
static int readInt(JsonNode node, String field) throws NumberFormatException { String stringValue = node.get(field).asText(); return (int) Float.parseFloat(stringValue); }
[ "static", "int", "readInt", "(", "JsonNode", "node", ",", "String", "field", ")", "throws", "NumberFormatException", "{", "String", "stringValue", "=", "node", ".", "get", "(", "field", ")", ".", "asText", "(", ")", ";", "return", "(", "int", ")", "Float", ".", "parseFloat", "(", "stringValue", ")", ";", "}" ]
Reads a whole number from the given field of the node. Accepts numbers, numerical strings and fractions. @param node node from which to read @param field name of the field to read @return the field's int value @throws NumberFormatException if the content cannot be parsed to a number
[ "Reads", "a", "whole", "number", "from", "the", "given", "field", "of", "the", "node", ".", "Accepts", "numbers", "numerical", "strings", "and", "fractions", "." ]
ec45a42048d8255838ad0200aa6784a8e8a121c1
https://github.com/BellaDati/belladati-sdk-api/blob/ec45a42048d8255838ad0200aa6784a8e8a121c1/src/main/java/com/belladati/sdk/intervals/Interval.java#L91-L94
150,087
Metrink/croquet
croquet-core/src/main/java/com/metrink/croquet/WicketSettings.java
WicketSettings.getCssResourceReferences
public CssResourceReference[] getCssResourceReferences() { final List<CssResourceReference> resources = new ArrayList<CssResourceReference>(); for (final String resource : cssResources) { // Don't provide resources with FQL URLs if (!resource.startsWith("//") && resource.startsWith("http")) { resources.add(new CssResourceReference(getResourcesRootClass(), resource)); } } return resources.toArray(new CssResourceReference[resources.size()]); }
java
public CssResourceReference[] getCssResourceReferences() { final List<CssResourceReference> resources = new ArrayList<CssResourceReference>(); for (final String resource : cssResources) { // Don't provide resources with FQL URLs if (!resource.startsWith("//") && resource.startsWith("http")) { resources.add(new CssResourceReference(getResourcesRootClass(), resource)); } } return resources.toArray(new CssResourceReference[resources.size()]); }
[ "public", "CssResourceReference", "[", "]", "getCssResourceReferences", "(", ")", "{", "final", "List", "<", "CssResourceReference", ">", "resources", "=", "new", "ArrayList", "<", "CssResourceReference", ">", "(", ")", ";", "for", "(", "final", "String", "resource", ":", "cssResources", ")", "{", "// Don't provide resources with FQL URLs", "if", "(", "!", "resource", ".", "startsWith", "(", "\"//\"", ")", "&&", "resource", ".", "startsWith", "(", "\"http\"", ")", ")", "{", "resources", ".", "add", "(", "new", "CssResourceReference", "(", "getResourcesRootClass", "(", ")", ",", "resource", ")", ")", ";", "}", "}", "return", "resources", ".", "toArray", "(", "new", "CssResourceReference", "[", "resources", ".", "size", "(", ")", "]", ")", ";", "}" ]
Get a list of CSS resources to include on the default page. @return the list of CSS resources
[ "Get", "a", "list", "of", "CSS", "resources", "to", "include", "on", "the", "default", "page", "." ]
1b0ed1327a104cf1f809ce4c3c5bf30a3d95384b
https://github.com/Metrink/croquet/blob/1b0ed1327a104cf1f809ce4c3c5bf30a3d95384b/croquet-core/src/main/java/com/metrink/croquet/WicketSettings.java#L179-L189
150,088
Metrink/croquet
croquet-core/src/main/java/com/metrink/croquet/WicketSettings.java
WicketSettings.getJavaScriptResourceReferences
public JavaScriptResourceReference[] getJavaScriptResourceReferences() { final List<JavaScriptResourceReference> resources = new ArrayList<JavaScriptResourceReference>(); for (final String resource : jsResources) { if (!resource.startsWith("//") && resource.startsWith("http")) { resources.add(new JavaScriptResourceReference(getResourcesRootClass(), resource)); } } return resources.toArray(new JavaScriptResourceReference[resources.size()]); }
java
public JavaScriptResourceReference[] getJavaScriptResourceReferences() { final List<JavaScriptResourceReference> resources = new ArrayList<JavaScriptResourceReference>(); for (final String resource : jsResources) { if (!resource.startsWith("//") && resource.startsWith("http")) { resources.add(new JavaScriptResourceReference(getResourcesRootClass(), resource)); } } return resources.toArray(new JavaScriptResourceReference[resources.size()]); }
[ "public", "JavaScriptResourceReference", "[", "]", "getJavaScriptResourceReferences", "(", ")", "{", "final", "List", "<", "JavaScriptResourceReference", ">", "resources", "=", "new", "ArrayList", "<", "JavaScriptResourceReference", ">", "(", ")", ";", "for", "(", "final", "String", "resource", ":", "jsResources", ")", "{", "if", "(", "!", "resource", ".", "startsWith", "(", "\"//\"", ")", "&&", "resource", ".", "startsWith", "(", "\"http\"", ")", ")", "{", "resources", ".", "add", "(", "new", "JavaScriptResourceReference", "(", "getResourcesRootClass", "(", ")", ",", "resource", ")", ")", ";", "}", "}", "return", "resources", ".", "toArray", "(", "new", "JavaScriptResourceReference", "[", "resources", ".", "size", "(", ")", "]", ")", ";", "}" ]
Get a list of JavaScript resources to include on the default page. @return the list of JavaScript resources
[ "Get", "a", "list", "of", "JavaScript", "resources", "to", "include", "on", "the", "default", "page", "." ]
1b0ed1327a104cf1f809ce4c3c5bf30a3d95384b
https://github.com/Metrink/croquet/blob/1b0ed1327a104cf1f809ce4c3c5bf30a3d95384b/croquet-core/src/main/java/com/metrink/croquet/WicketSettings.java#L211-L220
150,089
Metrink/croquet
croquet-core/src/main/java/com/metrink/croquet/WicketSettings.java
WicketSettings.getMinifyResources
public Boolean getMinifyResources() { if(getDevelopment()) { return minifyResources != null ? minifyResources : false; } else { return minifyResources != null ? minifyResources : true; } }
java
public Boolean getMinifyResources() { if(getDevelopment()) { return minifyResources != null ? minifyResources : false; } else { return minifyResources != null ? minifyResources : true; } }
[ "public", "Boolean", "getMinifyResources", "(", ")", "{", "if", "(", "getDevelopment", "(", ")", ")", "{", "return", "minifyResources", "!=", "null", "?", "minifyResources", ":", "false", ";", "}", "else", "{", "return", "minifyResources", "!=", "null", "?", "minifyResources", ":", "true", ";", "}", "}" ]
Should Croquet minify CSS and JavaScript resources? Defaults to follow dev vs deploy. @return true if resources should be minified
[ "Should", "Croquet", "minify", "CSS", "and", "JavaScript", "resources?", "Defaults", "to", "follow", "dev", "vs", "deploy", "." ]
1b0ed1327a104cf1f809ce4c3c5bf30a3d95384b
https://github.com/Metrink/croquet/blob/1b0ed1327a104cf1f809ce4c3c5bf30a3d95384b/croquet-core/src/main/java/com/metrink/croquet/WicketSettings.java#L242-L248
150,090
Metrink/croquet
croquet-core/src/main/java/com/metrink/croquet/WicketSettings.java
WicketSettings.getStripWicketTags
public boolean getStripWicketTags() { if(getDevelopment()) { return stripWicketTags != null ? stripWicketTags : false; } else { return stripWicketTags != null ? stripWicketTags : true; } }
java
public boolean getStripWicketTags() { if(getDevelopment()) { return stripWicketTags != null ? stripWicketTags : false; } else { return stripWicketTags != null ? stripWicketTags : true; } }
[ "public", "boolean", "getStripWicketTags", "(", ")", "{", "if", "(", "getDevelopment", "(", ")", ")", "{", "return", "stripWicketTags", "!=", "null", "?", "stripWicketTags", ":", "false", ";", "}", "else", "{", "return", "stripWicketTags", "!=", "null", "?", "stripWicketTags", ":", "true", ";", "}", "}" ]
Determine if tags should be removed from the final markup. Defaults to follow dev vs deploy. @return true if the tags sholud be stripped
[ "Determine", "if", "tags", "should", "be", "removed", "from", "the", "final", "markup", ".", "Defaults", "to", "follow", "dev", "vs", "deploy", "." ]
1b0ed1327a104cf1f809ce4c3c5bf30a3d95384b
https://github.com/Metrink/croquet/blob/1b0ed1327a104cf1f809ce4c3c5bf30a3d95384b/croquet-core/src/main/java/com/metrink/croquet/WicketSettings.java#L254-L260
150,091
Metrink/croquet
croquet-core/src/main/java/com/metrink/croquet/WicketSettings.java
WicketSettings.getStatelessChecker
public Boolean getStatelessChecker() { if(getDevelopment()) { return statelessChecker != null ? statelessChecker : true; } else { return statelessChecker != null ? statelessChecker : false; } }
java
public Boolean getStatelessChecker() { if(getDevelopment()) { return statelessChecker != null ? statelessChecker : true; } else { return statelessChecker != null ? statelessChecker : false; } }
[ "public", "Boolean", "getStatelessChecker", "(", ")", "{", "if", "(", "getDevelopment", "(", ")", ")", "{", "return", "statelessChecker", "!=", "null", "?", "statelessChecker", ":", "true", ";", "}", "else", "{", "return", "statelessChecker", "!=", "null", "?", "statelessChecker", ":", "false", ";", "}", "}" ]
Should Croquet enable the stateless checker? Defaults to follow dev vs deploy. @return true if the stateless checker should be enabled
[ "Should", "Croquet", "enable", "the", "stateless", "checker?", "Defaults", "to", "follow", "dev", "vs", "deploy", "." ]
1b0ed1327a104cf1f809ce4c3c5bf30a3d95384b
https://github.com/Metrink/croquet/blob/1b0ed1327a104cf1f809ce4c3c5bf30a3d95384b/croquet-core/src/main/java/com/metrink/croquet/WicketSettings.java#L266-L272
150,092
Metrink/croquet
croquet-core/src/main/java/com/metrink/croquet/WicketSettings.java
WicketSettings.getWicketDebugToolbar
public Boolean getWicketDebugToolbar() { if(getDevelopment()) { return wicketDebugToolbar != null ? wicketDebugToolbar : true; } else { return wicketDebugToolbar != null ? wicketDebugToolbar : false; } }
java
public Boolean getWicketDebugToolbar() { if(getDevelopment()) { return wicketDebugToolbar != null ? wicketDebugToolbar : true; } else { return wicketDebugToolbar != null ? wicketDebugToolbar : false; } }
[ "public", "Boolean", "getWicketDebugToolbar", "(", ")", "{", "if", "(", "getDevelopment", "(", ")", ")", "{", "return", "wicketDebugToolbar", "!=", "null", "?", "wicketDebugToolbar", ":", "true", ";", "}", "else", "{", "return", "wicketDebugToolbar", "!=", "null", "?", "wicketDebugToolbar", ":", "false", ";", "}", "}" ]
Should Croquet enable the wicket debug toolbar? Defaults to follow dev vs deploy. All of your pages MUST extend CroquetPage for the toolbar to appear. @return true if the wicket debug toolbar should be enabled
[ "Should", "Croquet", "enable", "the", "wicket", "debug", "toolbar?", "Defaults", "to", "follow", "dev", "vs", "deploy", "." ]
1b0ed1327a104cf1f809ce4c3c5bf30a3d95384b
https://github.com/Metrink/croquet/blob/1b0ed1327a104cf1f809ce4c3c5bf30a3d95384b/croquet-core/src/main/java/com/metrink/croquet/WicketSettings.java#L281-L287
150,093
eurekaclinical/javautil
src/main/java/org/arp/javautil/stat/UpdatingCovarCalc.java
UpdatingCovarCalc.addPoint
public void addPoint(double x, double y) { numItems++; double xMinusMeanX = x - meanx; double yMinusMeanY = y - meany; sumsq += xMinusMeanX * yMinusMeanY * (numItems - 1) / numItems; meanx += xMinusMeanX / numItems; meany += yMinusMeanY / numItems; }
java
public void addPoint(double x, double y) { numItems++; double xMinusMeanX = x - meanx; double yMinusMeanY = y - meany; sumsq += xMinusMeanX * yMinusMeanY * (numItems - 1) / numItems; meanx += xMinusMeanX / numItems; meany += yMinusMeanY / numItems; }
[ "public", "void", "addPoint", "(", "double", "x", ",", "double", "y", ")", "{", "numItems", "++", ";", "double", "xMinusMeanX", "=", "x", "-", "meanx", ";", "double", "yMinusMeanY", "=", "y", "-", "meany", ";", "sumsq", "+=", "xMinusMeanX", "*", "yMinusMeanY", "*", "(", "numItems", "-", "1", ")", "/", "numItems", ";", "meanx", "+=", "xMinusMeanX", "/", "numItems", ";", "meany", "+=", "yMinusMeanY", "/", "numItems", ";", "}" ]
Update the covariance with another point. @param x x value @param y y value
[ "Update", "the", "covariance", "with", "another", "point", "." ]
779bbc5bf096c75f8eed4f99ca45b99c1d44df43
https://github.com/eurekaclinical/javautil/blob/779bbc5bf096c75f8eed4f99ca45b99c1d44df43/src/main/java/org/arp/javautil/stat/UpdatingCovarCalc.java#L59-L66
150,094
mlhartme/mork
src/main/java/net/oneandone/mork/classfile/IO.java
IO.write
public static void write(OutputStream dest, byte[] data, int ofs, int len) throws IOException { dest.write(data, ofs, len); }
java
public static void write(OutputStream dest, byte[] data, int ofs, int len) throws IOException { dest.write(data, ofs, len); }
[ "public", "static", "void", "write", "(", "OutputStream", "dest", ",", "byte", "[", "]", "data", ",", "int", "ofs", ",", "int", "len", ")", "throws", "IOException", "{", "dest", ".", "write", "(", "data", ",", "ofs", ",", "len", ")", ";", "}" ]
no added functionality, just for symmetry reasons
[ "no", "added", "functionality", "just", "for", "symmetry", "reasons" ]
a069b087750c4133bfeebaf1f599c3bc96762113
https://github.com/mlhartme/mork/blob/a069b087750c4133bfeebaf1f599c3bc96762113/src/main/java/net/oneandone/mork/classfile/IO.java#L109-L111
150,095
SourcePond/fileobserver
fileobserver-impl/src/main/java/ch/sourcepond/io/fileobserver/impl/VirtualRoot.java
VirtualRoot.doAddRoot
private synchronized void doAddRoot(final WatchedDirectory pWatchedDirectory) { final Object key = requireNonNull(pWatchedDirectory.getKey(), KEY_IS_NULL); final Path directory = requireNonNull(pWatchedDirectory.getDirectory(), DIRECTORY_IS_NULL); if (!isDirectory(directory)) { throw new IllegalArgumentException(format("[%s]: %s is not a directory!", key, directory)); } // Insure that the directory-key is unique if (watchedDirectories.containsKey(key)) { throw new IllegalArgumentException(format("Key %s already used by %s", key, watchedDirectories.get(key))); } watchedDirectories.put(key, pWatchedDirectory); try { children.computeIfAbsent(directory.getFileSystem(), this::newDedicatedFileSystem).registerRootDirectory(pWatchedDirectory); pWatchedDirectory.addObserver(this); LOG.info("Added [{}:{}]", key, directory); } catch (final IOException | UncheckedIOException e) { LOG.warn(e.getMessage(), e); } }
java
private synchronized void doAddRoot(final WatchedDirectory pWatchedDirectory) { final Object key = requireNonNull(pWatchedDirectory.getKey(), KEY_IS_NULL); final Path directory = requireNonNull(pWatchedDirectory.getDirectory(), DIRECTORY_IS_NULL); if (!isDirectory(directory)) { throw new IllegalArgumentException(format("[%s]: %s is not a directory!", key, directory)); } // Insure that the directory-key is unique if (watchedDirectories.containsKey(key)) { throw new IllegalArgumentException(format("Key %s already used by %s", key, watchedDirectories.get(key))); } watchedDirectories.put(key, pWatchedDirectory); try { children.computeIfAbsent(directory.getFileSystem(), this::newDedicatedFileSystem).registerRootDirectory(pWatchedDirectory); pWatchedDirectory.addObserver(this); LOG.info("Added [{}:{}]", key, directory); } catch (final IOException | UncheckedIOException e) { LOG.warn(e.getMessage(), e); } }
[ "private", "synchronized", "void", "doAddRoot", "(", "final", "WatchedDirectory", "pWatchedDirectory", ")", "{", "final", "Object", "key", "=", "requireNonNull", "(", "pWatchedDirectory", ".", "getKey", "(", ")", ",", "KEY_IS_NULL", ")", ";", "final", "Path", "directory", "=", "requireNonNull", "(", "pWatchedDirectory", ".", "getDirectory", "(", ")", ",", "DIRECTORY_IS_NULL", ")", ";", "if", "(", "!", "isDirectory", "(", "directory", ")", ")", "{", "throw", "new", "IllegalArgumentException", "(", "format", "(", "\"[%s]: %s is not a directory!\"", ",", "key", ",", "directory", ")", ")", ";", "}", "// Insure that the directory-key is unique", "if", "(", "watchedDirectories", ".", "containsKey", "(", "key", ")", ")", "{", "throw", "new", "IllegalArgumentException", "(", "format", "(", "\"Key %s already used by %s\"", ",", "key", ",", "watchedDirectories", ".", "get", "(", "key", ")", ")", ")", ";", "}", "watchedDirectories", ".", "put", "(", "key", ",", "pWatchedDirectory", ")", ";", "try", "{", "children", ".", "computeIfAbsent", "(", "directory", ".", "getFileSystem", "(", ")", ",", "this", "::", "newDedicatedFileSystem", ")", ".", "registerRootDirectory", "(", "pWatchedDirectory", ")", ";", "pWatchedDirectory", ".", "addObserver", "(", "this", ")", ";", "LOG", ".", "info", "(", "\"Added [{}:{}]\"", ",", "key", ",", "directory", ")", ";", "}", "catch", "(", "final", "IOException", "|", "UncheckedIOException", "e", ")", "{", "LOG", ".", "warn", "(", "e", ".", "getMessage", "(", ")", ",", "e", ")", ";", "}", "}" ]
registered before another WatchedDirectory is being registered.
[ "registered", "before", "another", "WatchedDirectory", "is", "being", "registered", "." ]
dfb3055ed35759a47f52f6cfdea49879c415fd6b
https://github.com/SourcePond/fileobserver/blob/dfb3055ed35759a47f52f6cfdea49879c415fd6b/fileobserver-impl/src/main/java/ch/sourcepond/io/fileobserver/impl/VirtualRoot.java#L188-L210
150,096
SourcePond/fileobserver
fileobserver-impl/src/main/java/ch/sourcepond/io/fileobserver/impl/VirtualRoot.java
VirtualRoot.removeRoot
public synchronized void removeRoot(final WatchedDirectory pWatchedDirectory) { requireNonNull(pWatchedDirectory, WATCHED_DIRECTORY_IS_NULL); final Object key = requireNonNull(pWatchedDirectory.getKey(), KEY_IS_NULL); final Path directory = requireNonNull(pWatchedDirectory.getDirectory(), DIRECTORY_IS_NULL); // It's already checked that nothing is null final DedicatedFileSystem fs = children.get(directory.getFileSystem()); if (fs == null) { LOG.warn(format("No dedicated file system registered! Path: %s", directory)); } else { fs.unregisterRootDirectory(pWatchedDirectory.getDirectory(), pWatchedDirectory); // IMPORTANT: remove watched-directory with key specified. watchedDirectories.remove(key); pWatchedDirectory.removeObserver(this); LOG.info("Removed [{}:{}]", key, directory); } }
java
public synchronized void removeRoot(final WatchedDirectory pWatchedDirectory) { requireNonNull(pWatchedDirectory, WATCHED_DIRECTORY_IS_NULL); final Object key = requireNonNull(pWatchedDirectory.getKey(), KEY_IS_NULL); final Path directory = requireNonNull(pWatchedDirectory.getDirectory(), DIRECTORY_IS_NULL); // It's already checked that nothing is null final DedicatedFileSystem fs = children.get(directory.getFileSystem()); if (fs == null) { LOG.warn(format("No dedicated file system registered! Path: %s", directory)); } else { fs.unregisterRootDirectory(pWatchedDirectory.getDirectory(), pWatchedDirectory); // IMPORTANT: remove watched-directory with key specified. watchedDirectories.remove(key); pWatchedDirectory.removeObserver(this); LOG.info("Removed [{}:{}]", key, directory); } }
[ "public", "synchronized", "void", "removeRoot", "(", "final", "WatchedDirectory", "pWatchedDirectory", ")", "{", "requireNonNull", "(", "pWatchedDirectory", ",", "WATCHED_DIRECTORY_IS_NULL", ")", ";", "final", "Object", "key", "=", "requireNonNull", "(", "pWatchedDirectory", ".", "getKey", "(", ")", ",", "KEY_IS_NULL", ")", ";", "final", "Path", "directory", "=", "requireNonNull", "(", "pWatchedDirectory", ".", "getDirectory", "(", ")", ",", "DIRECTORY_IS_NULL", ")", ";", "// It's already checked that nothing is null", "final", "DedicatedFileSystem", "fs", "=", "children", ".", "get", "(", "directory", ".", "getFileSystem", "(", ")", ")", ";", "if", "(", "fs", "==", "null", ")", "{", "LOG", ".", "warn", "(", "format", "(", "\"No dedicated file system registered! Path: %s\"", ",", "directory", ")", ")", ";", "}", "else", "{", "fs", ".", "unregisterRootDirectory", "(", "pWatchedDirectory", ".", "getDirectory", "(", ")", ",", "pWatchedDirectory", ")", ";", "// IMPORTANT: remove watched-directory with key specified.", "watchedDirectories", ".", "remove", "(", "key", ")", ";", "pWatchedDirectory", ".", "removeObserver", "(", "this", ")", ";", "LOG", ".", "info", "(", "\"Removed [{}:{}]\"", ",", "key", ",", "directory", ")", ";", "}", "}" ]
discarded before another WatchedDirectory is being unregistered.
[ "discarded", "before", "another", "WatchedDirectory", "is", "being", "unregistered", "." ]
dfb3055ed35759a47f52f6cfdea49879c415fd6b
https://github.com/SourcePond/fileobserver/blob/dfb3055ed35759a47f52f6cfdea49879c415fd6b/fileobserver-impl/src/main/java/ch/sourcepond/io/fileobserver/impl/VirtualRoot.java#L232-L250
150,097
mlhartme/mork
src/main/java/net/oneandone/mork/semantics/Ag.java
Ag.createSemantics
public Oag createSemantics(List<Attribute> firstAttrs) throws GenericException { Layout layout; int[][] internalAttrs; Visits[] visits; layout = createLayout(firstAttrs); internalAttrs = createInternalAttributes(layout); visits = OagBuilder.run(this, layout, null); return new Oag(visits, internalAttrs); }
java
public Oag createSemantics(List<Attribute> firstAttrs) throws GenericException { Layout layout; int[][] internalAttrs; Visits[] visits; layout = createLayout(firstAttrs); internalAttrs = createInternalAttributes(layout); visits = OagBuilder.run(this, layout, null); return new Oag(visits, internalAttrs); }
[ "public", "Oag", "createSemantics", "(", "List", "<", "Attribute", ">", "firstAttrs", ")", "throws", "GenericException", "{", "Layout", "layout", ";", "int", "[", "]", "[", "]", "internalAttrs", ";", "Visits", "[", "]", "visits", ";", "layout", "=", "createLayout", "(", "firstAttrs", ")", ";", "internalAttrs", "=", "createInternalAttributes", "(", "layout", ")", ";", "visits", "=", "OagBuilder", ".", "run", "(", "this", ",", "layout", ",", "null", ")", ";", "return", "new", "Oag", "(", "visits", ",", "internalAttrs", ")", ";", "}" ]
them in a certain order
[ "them", "in", "a", "certain", "order" ]
a069b087750c4133bfeebaf1f599c3bc96762113
https://github.com/mlhartme/mork/blob/a069b087750c4133bfeebaf1f599c3bc96762113/src/main/java/net/oneandone/mork/semantics/Ag.java#L64-L73
150,098
mlhartme/mork
src/main/java/net/oneandone/mork/semantics/Ag.java
Ag.getAttributes
public void getAttributes(int symbol, Set<Attribute> internal, Set<Attribute> synthesized, Set<Attribute> inherited) { int i; int max; Attribute a; for (AttributionBuffer ab : attributions) { a = ab.result.attr; if (a.symbol == symbol) { if (ab.result.ofs == -1) { synthesized.add(a); } else { inherited.add(a); } } } max = internals.size(); for (i = 0; i < max; i += 2) { a = (Attribute) internals.get(i); if (a.symbol == symbol) { internal.add(a); } } }
java
public void getAttributes(int symbol, Set<Attribute> internal, Set<Attribute> synthesized, Set<Attribute> inherited) { int i; int max; Attribute a; for (AttributionBuffer ab : attributions) { a = ab.result.attr; if (a.symbol == symbol) { if (ab.result.ofs == -1) { synthesized.add(a); } else { inherited.add(a); } } } max = internals.size(); for (i = 0; i < max; i += 2) { a = (Attribute) internals.get(i); if (a.symbol == symbol) { internal.add(a); } } }
[ "public", "void", "getAttributes", "(", "int", "symbol", ",", "Set", "<", "Attribute", ">", "internal", ",", "Set", "<", "Attribute", ">", "synthesized", ",", "Set", "<", "Attribute", ">", "inherited", ")", "{", "int", "i", ";", "int", "max", ";", "Attribute", "a", ";", "for", "(", "AttributionBuffer", "ab", ":", "attributions", ")", "{", "a", "=", "ab", ".", "result", ".", "attr", ";", "if", "(", "a", ".", "symbol", "==", "symbol", ")", "{", "if", "(", "ab", ".", "result", ".", "ofs", "==", "-", "1", ")", "{", "synthesized", ".", "add", "(", "a", ")", ";", "}", "else", "{", "inherited", ".", "add", "(", "a", ")", ";", "}", "}", "}", "max", "=", "internals", ".", "size", "(", ")", ";", "for", "(", "i", "=", "0", ";", "i", "<", "max", ";", "i", "+=", "2", ")", "{", "a", "=", "(", "Attribute", ")", "internals", ".", "get", "(", "i", ")", ";", "if", "(", "a", ".", "symbol", "==", "symbol", ")", "{", "internal", ".", "add", "(", "a", ")", ";", "}", "}", "}" ]
Besides the classic synthesized and inherited attributes, I have internal attributes. Internal attributes are computed when creating the node, a better name might be 'initial'.
[ "Besides", "the", "classic", "synthesized", "and", "inherited", "attributes", "I", "have", "internal", "attributes", ".", "Internal", "attributes", "are", "computed", "when", "creating", "the", "node", "a", "better", "name", "might", "be", "initial", "." ]
a069b087750c4133bfeebaf1f599c3bc96762113
https://github.com/mlhartme/mork/blob/a069b087750c4133bfeebaf1f599c3bc96762113/src/main/java/net/oneandone/mork/semantics/Ag.java#L196-L218
150,099
eurekaclinical/datastore
src/main/java/org/eurekaclinical/datastore/bdb/BdbStoreFactory.java
BdbStoreFactory.closeAndRemoveDatabaseHandle
final void closeAndRemoveDatabaseHandle(Database databaseHandle) { try { databaseHandle.close(); } catch (EnvironmentFailureException | IllegalStateException ex) { try { LOGGER.log(Level.SEVERE, "Error closing database {0}", databaseHandle.getDatabaseName()); } catch (EnvironmentFailureException | IllegalStateException ex2) { ex.addSuppressed(ex2); } throw ex; } finally { this.databaseHandles.remove(databaseHandle); } }
java
final void closeAndRemoveDatabaseHandle(Database databaseHandle) { try { databaseHandle.close(); } catch (EnvironmentFailureException | IllegalStateException ex) { try { LOGGER.log(Level.SEVERE, "Error closing database {0}", databaseHandle.getDatabaseName()); } catch (EnvironmentFailureException | IllegalStateException ex2) { ex.addSuppressed(ex2); } throw ex; } finally { this.databaseHandles.remove(databaseHandle); } }
[ "final", "void", "closeAndRemoveDatabaseHandle", "(", "Database", "databaseHandle", ")", "{", "try", "{", "databaseHandle", ".", "close", "(", ")", ";", "}", "catch", "(", "EnvironmentFailureException", "|", "IllegalStateException", "ex", ")", "{", "try", "{", "LOGGER", ".", "log", "(", "Level", ".", "SEVERE", ",", "\"Error closing database {0}\"", ",", "databaseHandle", ".", "getDatabaseName", "(", ")", ")", ";", "}", "catch", "(", "EnvironmentFailureException", "|", "IllegalStateException", "ex2", ")", "{", "ex", ".", "addSuppressed", "(", "ex2", ")", ";", "}", "throw", "ex", ";", "}", "finally", "{", "this", ".", "databaseHandles", ".", "remove", "(", "databaseHandle", ")", ";", "}", "}" ]
Closes a database that was previously created by this factory instance. @param databaseHandle the database to close. @throws EnvironmentFailureException if an unexpected, internal or environment-wide failure occurs. @throws IllegalStateException if the database has been closed.
[ "Closes", "a", "database", "that", "was", "previously", "created", "by", "this", "factory", "instance", "." ]
a03a70819bb562ba45eac66ca49f778035ee45e0
https://github.com/eurekaclinical/datastore/blob/a03a70819bb562ba45eac66ca49f778035ee45e0/src/main/java/org/eurekaclinical/datastore/bdb/BdbStoreFactory.java#L174-L188