repository_name stringlengths 7 58 | func_path_in_repository stringlengths 11 204 | func_name stringlengths 5 103 | whole_func_string stringlengths 87 3.44k | language stringclasses 1
value | func_code_string stringlengths 87 3.44k | func_code_tokens listlengths 21 714 | func_documentation_string stringlengths 61 1.95k | func_documentation_tokens listlengths 1 482 | split_name stringclasses 1
value | func_code_url stringlengths 102 309 |
|---|---|---|---|---|---|---|---|---|---|---|
landawn/AbacusUtil | src/com/landawn/abacus/util/Matth.java | Matth.saturatedSubtract | public static long saturatedSubtract(long a, long b) {
long naiveDifference = a - b;
if ((a ^ b) >= 0 | (a ^ naiveDifference) >= 0) {
// If a and b have the same signs or a has the same sign as the result then there was no
// overflow, return.
return naiveDiffere... | java | public static long saturatedSubtract(long a, long b) {
long naiveDifference = a - b;
if ((a ^ b) >= 0 | (a ^ naiveDifference) >= 0) {
// If a and b have the same signs or a has the same sign as the result then there was no
// overflow, return.
return naiveDiffere... | [
"public",
"static",
"long",
"saturatedSubtract",
"(",
"long",
"a",
",",
"long",
"b",
")",
"{",
"long",
"naiveDifference",
"=",
"a",
"-",
"b",
";",
"if",
"(",
"(",
"a",
"^",
"b",
")",
">=",
"0",
"|",
"(",
"a",
"^",
"naiveDifference",
")",
">=",
"0... | Returns the difference of {@code a} and {@code b} unless it would overflow or underflow in
which case {@code Long.MAX_VALUE} or {@code Long.MIN_VALUE} is returned, respectively.
@since 20.0 | [
"Returns",
"the",
"difference",
"of",
"{",
"@code",
"a",
"}",
"and",
"{",
"@code",
"b",
"}",
"unless",
"it",
"would",
"overflow",
"or",
"underflow",
"in",
"which",
"case",
"{",
"@code",
"Long",
".",
"MAX_VALUE",
"}",
"or",
"{",
"@code",
"Long",
".",
... | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/Matth.java#L1601-L1610 |
albfernandez/itext2 | src/main/java/com/lowagie/text/pdf/Type3Font.java | Type3Font.defineGlyph | public PdfContentByte defineGlyph(char c, float wx, float llx, float lly, float urx, float ury) {
if (c == 0 || c > 255)
throw new IllegalArgumentException("The char " + (int)c + " doesn't belong in this Type3 font");
usedSlot[c] = true;
Integer ck = Integer.valueOf(c);
Type3... | java | public PdfContentByte defineGlyph(char c, float wx, float llx, float lly, float urx, float ury) {
if (c == 0 || c > 255)
throw new IllegalArgumentException("The char " + (int)c + " doesn't belong in this Type3 font");
usedSlot[c] = true;
Integer ck = Integer.valueOf(c);
Type3... | [
"public",
"PdfContentByte",
"defineGlyph",
"(",
"char",
"c",
",",
"float",
"wx",
",",
"float",
"llx",
",",
"float",
"lly",
",",
"float",
"urx",
",",
"float",
"ury",
")",
"{",
"if",
"(",
"c",
"==",
"0",
"||",
"c",
">",
"255",
")",
"throw",
"new",
... | Defines a glyph. If the character was already defined it will return the same content
@param c the character to match this glyph.
@param wx the advance this character will have
@param llx the X lower left corner of the glyph bounding box. If the <CODE>colorize</CODE> option is
<CODE>true</CODE> the value is ignored
@pa... | [
"Defines",
"a",
"glyph",
".",
"If",
"the",
"character",
"was",
"already",
"defined",
"it",
"will",
"return",
"the",
"same",
"content"
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/Type3Font.java#L126-L152 |
Stratio/bdt | src/main/java/com/stratio/qa/specs/DcosSpec.java | DcosSpec.setGoSecSSOCookie | @Given("^I( do not)? set sso token using host '(.+?)' with user '(.+?)' and password '(.+?)'( and tenant '(.+?)')?$")
public void setGoSecSSOCookie(String set, String ssoHost, String userName, String passWord, String foo, String tenant) throws Exception {
if (set == null) {
HashMap<String, Strin... | java | @Given("^I( do not)? set sso token using host '(.+?)' with user '(.+?)' and password '(.+?)'( and tenant '(.+?)')?$")
public void setGoSecSSOCookie(String set, String ssoHost, String userName, String passWord, String foo, String tenant) throws Exception {
if (set == null) {
HashMap<String, Strin... | [
"@",
"Given",
"(",
"\"^I( do not)? set sso token using host '(.+?)' with user '(.+?)' and password '(.+?)'( and tenant '(.+?)')?$\"",
")",
"public",
"void",
"setGoSecSSOCookie",
"(",
"String",
"set",
",",
"String",
"ssoHost",
",",
"String",
"userName",
",",
"String",
"passWord"... | Generate token to authenticate in gosec SSO
@param ssoHost current sso host
@param userName username
@param passWord password
@throws Exception exception | [
"Generate",
"token",
"to",
"authenticate",
"in",
"gosec",
"SSO"
] | train | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/DcosSpec.java#L96-L105 |
Harium/keel | src/main/java/com/harium/keel/catalano/math/Tools.java | Tools.Clamp | public static int Clamp(int x, IntRange range) {
return Clamp(x, range.getMin(), range.getMax());
} | java | public static int Clamp(int x, IntRange range) {
return Clamp(x, range.getMin(), range.getMax());
} | [
"public",
"static",
"int",
"Clamp",
"(",
"int",
"x",
",",
"IntRange",
"range",
")",
"{",
"return",
"Clamp",
"(",
"x",
",",
"range",
".",
"getMin",
"(",
")",
",",
"range",
".",
"getMax",
"(",
")",
")",
";",
"}"
] | Clamp values.
@param x Value.
@param range Range.
@return Value. | [
"Clamp",
"values",
"."
] | train | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/Tools.java#L134-L136 |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/spatialite/SpatialDbsImportUtils.java | SpatialDbsImportUtils.importShapefile | public static boolean importShapefile( ASpatialDb db, File shapeFile, String tableName, int limit, IHMProgressMonitor pm )
throws Exception {
FileDataStore store = FileDataStoreFinder.getDataStore(shapeFile);
SimpleFeatureSource featureSource = store.getFeatureSource();
SimpleFeature... | java | public static boolean importShapefile( ASpatialDb db, File shapeFile, String tableName, int limit, IHMProgressMonitor pm )
throws Exception {
FileDataStore store = FileDataStoreFinder.getDataStore(shapeFile);
SimpleFeatureSource featureSource = store.getFeatureSource();
SimpleFeature... | [
"public",
"static",
"boolean",
"importShapefile",
"(",
"ASpatialDb",
"db",
",",
"File",
"shapeFile",
",",
"String",
"tableName",
",",
"int",
"limit",
",",
"IHMProgressMonitor",
"pm",
")",
"throws",
"Exception",
"{",
"FileDataStore",
"store",
"=",
"FileDataStoreFin... | Import a shapefile into a table.
@param db the database to use.
@param shapeFile the shapefile to import.
@param tableName the name of the table to import to.
@param limit if > 0, a limit to the imported features is applied.
@param pm the progress monitor.
@return <code>false</code>, is an error occurred.
@throws Exce... | [
"Import",
"a",
"shapefile",
"into",
"a",
"table",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/spatialite/SpatialDbsImportUtils.java#L199-L207 |
LearnLib/automatalib | commons/util/src/main/java/net/automatalib/commons/util/process/ProcessUtil.java | ProcessUtil.invokeProcess | public static int invokeProcess(String[] commandLine, Reader input) throws IOException, InterruptedException {
return invokeProcess(commandLine, input, new NOPConsumer());
} | java | public static int invokeProcess(String[] commandLine, Reader input) throws IOException, InterruptedException {
return invokeProcess(commandLine, input, new NOPConsumer());
} | [
"public",
"static",
"int",
"invokeProcess",
"(",
"String",
"[",
"]",
"commandLine",
",",
"Reader",
"input",
")",
"throws",
"IOException",
",",
"InterruptedException",
"{",
"return",
"invokeProcess",
"(",
"commandLine",
",",
"input",
",",
"new",
"NOPConsumer",
"(... | Runs the given set of command line arguments as a system process and returns the exit value of the spawned
process. Additionally allows to supply an input stream to the invoked program. Discards any output of the
process.
@param commandLine
the list of command line arguments to run
@param input
the input passed to the... | [
"Runs",
"the",
"given",
"set",
"of",
"command",
"line",
"arguments",
"as",
"a",
"system",
"process",
"and",
"returns",
"the",
"exit",
"value",
"of",
"the",
"spawned",
"process",
".",
"Additionally",
"allows",
"to",
"supply",
"an",
"input",
"stream",
"to",
... | train | https://github.com/LearnLib/automatalib/blob/8a462ec52f6eaab9f8996e344f2163a72cb8aa6e/commons/util/src/main/java/net/automatalib/commons/util/process/ProcessUtil.java#L78-L80 |
infinispan/infinispan | lucene/lucene-directory/src/main/java/org/infinispan/lucene/cacheloader/LuceneCacheLoader.java | LuceneCacheLoader.getDirectory | private DirectoryLoaderAdaptor getDirectory(final String indexName) {
DirectoryLoaderAdaptor adapter = openDirectories.get(indexName);
if (adapter == null) {
synchronized (openDirectories) {
adapter = openDirectories.get(indexName);
if (adapter == null) {
fina... | java | private DirectoryLoaderAdaptor getDirectory(final String indexName) {
DirectoryLoaderAdaptor adapter = openDirectories.get(indexName);
if (adapter == null) {
synchronized (openDirectories) {
adapter = openDirectories.get(indexName);
if (adapter == null) {
fina... | [
"private",
"DirectoryLoaderAdaptor",
"getDirectory",
"(",
"final",
"String",
"indexName",
")",
"{",
"DirectoryLoaderAdaptor",
"adapter",
"=",
"openDirectories",
".",
"get",
"(",
"indexName",
")",
";",
"if",
"(",
"adapter",
"==",
"null",
")",
"{",
"synchronized",
... | Looks up the Directory adapter if it's already known, or attempts to initialize indexes. | [
"Looks",
"up",
"the",
"Directory",
"adapter",
"if",
"it",
"s",
"already",
"known",
"or",
"attempts",
"to",
"initialize",
"indexes",
"."
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/lucene/lucene-directory/src/main/java/org/infinispan/lucene/cacheloader/LuceneCacheLoader.java#L172-L186 |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/jdbc/JDBCResultSet.java | JDBCResultSet.updateFloat | public void updateFloat(int columnIndex, float x) throws SQLException {
Double value = new Double(x);
startUpdate(columnIndex);
preparedStatement.setParameter(columnIndex, value);
} | java | public void updateFloat(int columnIndex, float x) throws SQLException {
Double value = new Double(x);
startUpdate(columnIndex);
preparedStatement.setParameter(columnIndex, value);
} | [
"public",
"void",
"updateFloat",
"(",
"int",
"columnIndex",
",",
"float",
"x",
")",
"throws",
"SQLException",
"{",
"Double",
"value",
"=",
"new",
"Double",
"(",
"x",
")",
";",
"startUpdate",
"(",
"columnIndex",
")",
";",
"preparedStatement",
".",
"setParamet... | <!-- start generic documentation -->
Updates the designated column with a <code>float</code> value.
The updater methods are used to update column values in the
current row or the insert row. The updater methods do not
update the underlying database; instead the <code>updateRow</code> or
<code>insertRow</code> methods ... | [
"<!",
"--",
"start",
"generic",
"documentation",
"--",
">",
"Updates",
"the",
"designated",
"column",
"with",
"a",
"<code",
">",
"float<",
"/",
"code",
">",
"value",
".",
"The",
"updater",
"methods",
"are",
"used",
"to",
"update",
"column",
"values",
"in",... | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/jdbc/JDBCResultSet.java#L2813-L2819 |
lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/binding/value/support/AbstractValueModel.java | AbstractValueModel.fireValueChange | protected final void fireValueChange(boolean oldValue, boolean newValue) {
fireValueChange(Boolean.valueOf(oldValue), Boolean.valueOf(newValue));
} | java | protected final void fireValueChange(boolean oldValue, boolean newValue) {
fireValueChange(Boolean.valueOf(oldValue), Boolean.valueOf(newValue));
} | [
"protected",
"final",
"void",
"fireValueChange",
"(",
"boolean",
"oldValue",
",",
"boolean",
"newValue",
")",
"{",
"fireValueChange",
"(",
"Boolean",
".",
"valueOf",
"(",
"oldValue",
")",
",",
"Boolean",
".",
"valueOf",
"(",
"newValue",
")",
")",
";",
"}"
] | Notifies all listeners that have registered interest for
notification on this event type. The event instance
is lazily created using the parameters passed into
the fire method.
@param oldValue the boolean value before the change
@param newValue the boolean value after the change | [
"Notifies",
"all",
"listeners",
"that",
"have",
"registered",
"interest",
"for",
"notification",
"on",
"this",
"event",
"type",
".",
"The",
"event",
"instance",
"is",
"lazily",
"created",
"using",
"the",
"parameters",
"passed",
"into",
"the",
"fire",
"method",
... | train | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/binding/value/support/AbstractValueModel.java#L91-L93 |
milaboratory/milib | src/main/java/com/milaboratory/core/Range.java | Range.without | @SuppressWarnings("unchecked")
public List<Range> without(Range range) {
if (!intersectsWith(range))
return Collections.singletonList(this);
if (upper <= range.upper)
return range.lower <= lower ? Collections.EMPTY_LIST : Collections.singletonList(new Range(lower, range.lowe... | java | @SuppressWarnings("unchecked")
public List<Range> without(Range range) {
if (!intersectsWith(range))
return Collections.singletonList(this);
if (upper <= range.upper)
return range.lower <= lower ? Collections.EMPTY_LIST : Collections.singletonList(new Range(lower, range.lowe... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"List",
"<",
"Range",
">",
"without",
"(",
"Range",
"range",
")",
"{",
"if",
"(",
"!",
"intersectsWith",
"(",
"range",
")",
")",
"return",
"Collections",
".",
"singletonList",
"(",
"this",
")",
... | Subtract provided range and return list of ranges contained in current range and not intersecting with other
range.
@param range range to subtract
@return list of ranges contained in current range and not intersecting with other range | [
"Subtract",
"provided",
"range",
"and",
"return",
"list",
"of",
"ranges",
"contained",
"in",
"current",
"range",
"and",
"not",
"intersecting",
"with",
"other",
"range",
"."
] | train | https://github.com/milaboratory/milib/blob/2349b3dccdd3c7948643760e570238d6e30d5a34/src/main/java/com/milaboratory/core/Range.java#L317-L329 |
aequologica/geppaequo | geppaequo-core/src/main/java/net/aequologica/neo/geppaequo/auth/MethodUtils.java | MethodUtils.getAccessibleMethodFromSuperclass | private static Method getAccessibleMethodFromSuperclass
(Class<?> clazz, String methodName, Class<?>[] parameterTypes) {
Class<?> parentClazz = clazz.getSuperclass();
while (parentClazz != null) {
if (Modifier.isPublic(parentClazz.getModifiers())) {
try {
... | java | private static Method getAccessibleMethodFromSuperclass
(Class<?> clazz, String methodName, Class<?>[] parameterTypes) {
Class<?> parentClazz = clazz.getSuperclass();
while (parentClazz != null) {
if (Modifier.isPublic(parentClazz.getModifiers())) {
try {
... | [
"private",
"static",
"Method",
"getAccessibleMethodFromSuperclass",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"String",
"methodName",
",",
"Class",
"<",
"?",
">",
"[",
"]",
"parameterTypes",
")",
"{",
"Class",
"<",
"?",
">",
"parentClazz",
"=",
"clazz",
"... | <p>Return an accessible method (that is, one that can be invoked via
reflection) by scanning through the superclasses. If no such method
can be found, return <code>null</code>.</p>
@param clazz Class to be checked
@param methodName Method name of the method we wish to call
@param parameterTypes The parameter type sign... | [
"<p",
">",
"Return",
"an",
"accessible",
"method",
"(",
"that",
"is",
"one",
"that",
"can",
"be",
"invoked",
"via",
"reflection",
")",
"by",
"scanning",
"through",
"the",
"superclasses",
".",
"If",
"no",
"such",
"method",
"can",
"be",
"found",
"return",
... | train | https://github.com/aequologica/geppaequo/blob/b72e5f6356535fd045a931f8c544d4a8ea6e35a2/geppaequo-core/src/main/java/net/aequologica/neo/geppaequo/auth/MethodUtils.java#L841-L856 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/optimize/solvers/accumulation/IndexedTail.java | IndexedTail.put | public void put(@NonNull INDArray update) {
try {
lock.writeLock().lock();
//if we're already in collapsed mode - we just insta-decompress
if (collapsedMode.get()) {
val lastUpdateIndex = collapsedIndex.get();
val lastUpdate = updates.get(last... | java | public void put(@NonNull INDArray update) {
try {
lock.writeLock().lock();
//if we're already in collapsed mode - we just insta-decompress
if (collapsedMode.get()) {
val lastUpdateIndex = collapsedIndex.get();
val lastUpdate = updates.get(last... | [
"public",
"void",
"put",
"(",
"@",
"NonNull",
"INDArray",
"update",
")",
"{",
"try",
"{",
"lock",
".",
"writeLock",
"(",
")",
".",
"lock",
"(",
")",
";",
"//if we're already in collapsed mode - we just insta-decompress",
"if",
"(",
"collapsedMode",
".",
"get",
... | This mehtod adds update, with optional collapse
@param update | [
"This",
"mehtod",
"adds",
"update",
"with",
"optional",
"collapse"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/optimize/solvers/accumulation/IndexedTail.java#L91-L149 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/transition/circuit/MapCircuitExtractor.java | MapCircuitExtractor.getCircuit | public Circuit getCircuit(Tile tile)
{
final Collection<String> neighborGroups = getNeighborGroups(tile);
final Collection<String> groups = new HashSet<>(neighborGroups);
final String group = mapGroup.getGroup(tile);
final Circuit circuit;
if (groups.size() == 1)
... | java | public Circuit getCircuit(Tile tile)
{
final Collection<String> neighborGroups = getNeighborGroups(tile);
final Collection<String> groups = new HashSet<>(neighborGroups);
final String group = mapGroup.getGroup(tile);
final Circuit circuit;
if (groups.size() == 1)
... | [
"public",
"Circuit",
"getCircuit",
"(",
"Tile",
"tile",
")",
"{",
"final",
"Collection",
"<",
"String",
">",
"neighborGroups",
"=",
"getNeighborGroups",
"(",
"tile",
")",
";",
"final",
"Collection",
"<",
"String",
">",
"groups",
"=",
"new",
"HashSet",
"<>",
... | Get the tile circuit.
@param tile The current tile.
@return The tile circuit, <code>null</code> if none. | [
"Get",
"the",
"tile",
"circuit",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/transition/circuit/MapCircuitExtractor.java#L111-L135 |
stapler/stapler | jruby/src/main/java/org/kohsuke/stapler/jelly/jruby/AbstractRubyTearOff.java | AbstractRubyTearOff.createDispatcher | public RequestDispatcher createDispatcher(Object it, String viewName) throws IOException {
Script script = findScript(viewName+getDefaultScriptExtension());
if(script!=null)
return new JellyRequestDispatcher(it,script);
return null;
} | java | public RequestDispatcher createDispatcher(Object it, String viewName) throws IOException {
Script script = findScript(viewName+getDefaultScriptExtension());
if(script!=null)
return new JellyRequestDispatcher(it,script);
return null;
} | [
"public",
"RequestDispatcher",
"createDispatcher",
"(",
"Object",
"it",
",",
"String",
"viewName",
")",
"throws",
"IOException",
"{",
"Script",
"script",
"=",
"findScript",
"(",
"viewName",
"+",
"getDefaultScriptExtension",
"(",
")",
")",
";",
"if",
"(",
"script... | Creates a {@link RequestDispatcher} that forwards to the jelly view, if available. | [
"Creates",
"a",
"{"
] | train | https://github.com/stapler/stapler/blob/11ad5af185e062fb46e01bf9fbed66f3ebf2a8f7/jruby/src/main/java/org/kohsuke/stapler/jelly/jruby/AbstractRubyTearOff.java#L36-L41 |
matthewhorridge/owlapi-gwt | owlapi-gwt-serialization/src/main/java/org/semanticweb/owlapi/model/EntityType_CustomFieldSerializer.java | EntityType_CustomFieldSerializer.serializeInstance | @Override
public void serializeInstance(SerializationStreamWriter streamWriter, EntityType instance) throws SerializationException {
serialize(streamWriter, instance);
} | java | @Override
public void serializeInstance(SerializationStreamWriter streamWriter, EntityType instance) throws SerializationException {
serialize(streamWriter, instance);
} | [
"@",
"Override",
"public",
"void",
"serializeInstance",
"(",
"SerializationStreamWriter",
"streamWriter",
",",
"EntityType",
"instance",
")",
"throws",
"SerializationException",
"{",
"serialize",
"(",
"streamWriter",
",",
"instance",
")",
";",
"}"
] | Serializes the content of the object into the
{@link com.google.gwt.user.client.rpc.SerializationStreamWriter}.
@param streamWriter the {@link com.google.gwt.user.client.rpc.SerializationStreamWriter} to write the
object's content to
@param instance the object instance to serialize
@throws com.google.gwt.user.client.rp... | [
"Serializes",
"the",
"content",
"of",
"the",
"object",
"into",
"the",
"{"
] | train | https://github.com/matthewhorridge/owlapi-gwt/blob/7ab975fb6cef3c8947099983551672a3b5d4e2fd/owlapi-gwt-serialization/src/main/java/org/semanticweb/owlapi/model/EntityType_CustomFieldSerializer.java#L95-L98 |
JOML-CI/JOML | src/org/joml/Matrix4f.java | Matrix4f.transformProject | public Vector4f transformProject(float x, float y, float z, float w, Vector4f dest) {
dest.x = x;
dest.y = y;
dest.z = z;
dest.w = w;
return dest.mulProject(this);
} | java | public Vector4f transformProject(float x, float y, float z, float w, Vector4f dest) {
dest.x = x;
dest.y = y;
dest.z = z;
dest.w = w;
return dest.mulProject(this);
} | [
"public",
"Vector4f",
"transformProject",
"(",
"float",
"x",
",",
"float",
"y",
",",
"float",
"z",
",",
"float",
"w",
",",
"Vector4f",
"dest",
")",
"{",
"dest",
".",
"x",
"=",
"x",
";",
"dest",
".",
"y",
"=",
"y",
";",
"dest",
".",
"z",
"=",
"z... | /* (non-Javadoc)
@see org.joml.Matrix4fc#transformProject(float, float, float, float, org.joml.Vector4f) | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4f.java#L4553-L4559 |
ehcache/ehcache3 | impl/src/main/java/org/ehcache/impl/internal/util/Pacer.java | Pacer.pacedCall | public void pacedCall(Runnable call, Runnable orElse) {
long now = timeSource.getTimeMillis();
long end = nextLogTime.get();
if(now >= end && nextLogTime.compareAndSet(end, now + delay)) {
call.run();
} else {
orElse.run();
}
} | java | public void pacedCall(Runnable call, Runnable orElse) {
long now = timeSource.getTimeMillis();
long end = nextLogTime.get();
if(now >= end && nextLogTime.compareAndSet(end, now + delay)) {
call.run();
} else {
orElse.run();
}
} | [
"public",
"void",
"pacedCall",
"(",
"Runnable",
"call",
",",
"Runnable",
"orElse",
")",
"{",
"long",
"now",
"=",
"timeSource",
".",
"getTimeMillis",
"(",
")",
";",
"long",
"end",
"=",
"nextLogTime",
".",
"get",
"(",
")",
";",
"if",
"(",
"now",
">=",
... | Execute the call at the request page or call the alternative the rest of the time. An example would be to log
a repetitive error once every 30 seconds or always if in debug.
<p>
<pre>{@code
Pacer pacer = new Pacer(30_000);
String errorMessage = "my error";
pacer.pacedCall(() -> log.error(errorMessage), () -> log.debug(... | [
"Execute",
"the",
"call",
"at",
"the",
"request",
"page",
"or",
"call",
"the",
"alternative",
"the",
"rest",
"of",
"the",
"time",
".",
"An",
"example",
"would",
"be",
"to",
"log",
"a",
"repetitive",
"error",
"once",
"every",
"30",
"seconds",
"or",
"alway... | train | https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/impl/src/main/java/org/ehcache/impl/internal/util/Pacer.java#L56-L64 |
Azure/azure-sdk-for-java | sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/ManagedDatabasesInner.java | ManagedDatabasesInner.listByInstanceAsync | public Observable<Page<ManagedDatabaseInner>> listByInstanceAsync(final String resourceGroupName, final String managedInstanceName) {
return listByInstanceWithServiceResponseAsync(resourceGroupName, managedInstanceName)
.map(new Func1<ServiceResponse<Page<ManagedDatabaseInner>>, Page<ManagedDatabase... | java | public Observable<Page<ManagedDatabaseInner>> listByInstanceAsync(final String resourceGroupName, final String managedInstanceName) {
return listByInstanceWithServiceResponseAsync(resourceGroupName, managedInstanceName)
.map(new Func1<ServiceResponse<Page<ManagedDatabaseInner>>, Page<ManagedDatabase... | [
"public",
"Observable",
"<",
"Page",
"<",
"ManagedDatabaseInner",
">",
">",
"listByInstanceAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"managedInstanceName",
")",
"{",
"return",
"listByInstanceWithServiceResponseAsync",
"(",
"resourceGroup... | Gets a list of managed databases.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param managedInstanceName The name of the managed instance.
@throws IllegalArgumentException thrown if parameters fail the ... | [
"Gets",
"a",
"list",
"of",
"managed",
"databases",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/ManagedDatabasesInner.java#L336-L344 |
lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/row/MatrixFeatures_DDRM.java | MatrixFeatures_DDRM.isSkewSymmetric | public static boolean isSkewSymmetric(DMatrixRMaj A , double tol ){
if( A.numCols != A.numRows )
return false;
for( int i = 0; i < A.numRows; i++ ) {
for( int j = 0; j < i; j++ ) {
double a = A.get(i,j);
double b = A.get(j,i);
dou... | java | public static boolean isSkewSymmetric(DMatrixRMaj A , double tol ){
if( A.numCols != A.numRows )
return false;
for( int i = 0; i < A.numRows; i++ ) {
for( int j = 0; j < i; j++ ) {
double a = A.get(i,j);
double b = A.get(j,i);
dou... | [
"public",
"static",
"boolean",
"isSkewSymmetric",
"(",
"DMatrixRMaj",
"A",
",",
"double",
"tol",
")",
"{",
"if",
"(",
"A",
".",
"numCols",
"!=",
"A",
".",
"numRows",
")",
"return",
"false",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"A",... | <p>
Checks to see if a matrix is skew symmetric with in tolerance:<br>
<br>
-A = A<sup>T</sup><br>
or<br>
|a<sub>ij</sub> + a<sub>ji</sub>| ≤ tol
</p>
@param A The matrix being tested.
@param tol Tolerance for being skew symmetric.
@return True if it is skew symmetric and false if it is not. | [
"<p",
">",
"Checks",
"to",
"see",
"if",
"a",
"matrix",
"is",
"skew",
"symmetric",
"with",
"in",
"tolerance",
":",
"<br",
">",
"<br",
">",
"-",
"A",
"=",
"A<sup",
">",
"T<",
"/",
"sup",
">",
"<br",
">",
"or<br",
">",
"|a<sub",
">",
"ij<",
"/",
"... | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/row/MatrixFeatures_DDRM.java#L240-L257 |
hibernate/hibernate-ogm | neo4j/src/main/java/org/hibernate/ogm/datastore/neo4j/dialect/impl/BaseNeo4jAssociationQueries.java | BaseNeo4jAssociationQueries.getEntityKey | private EntityKey getEntityKey(AssociationKey associationKey, RowKey rowKey) {
String[] associationKeyColumns = associationKey.getMetadata().getAssociatedEntityKeyMetadata().getAssociationKeyColumns();
Object[] columnValues = new Object[associationKeyColumns.length];
int i = 0;
for ( String associationKeyColum... | java | private EntityKey getEntityKey(AssociationKey associationKey, RowKey rowKey) {
String[] associationKeyColumns = associationKey.getMetadata().getAssociatedEntityKeyMetadata().getAssociationKeyColumns();
Object[] columnValues = new Object[associationKeyColumns.length];
int i = 0;
for ( String associationKeyColum... | [
"private",
"EntityKey",
"getEntityKey",
"(",
"AssociationKey",
"associationKey",
",",
"RowKey",
"rowKey",
")",
"{",
"String",
"[",
"]",
"associationKeyColumns",
"=",
"associationKey",
".",
"getMetadata",
"(",
")",
".",
"getAssociatedEntityKeyMetadata",
"(",
")",
"."... | Returns the entity key on the other side of association row represented by the given row key.
<p>
<b>Note:</b> May only be invoked if the row key actually contains all the columns making up that entity key.
Specifically, it may <b>not</b> be invoked if the association has index columns (maps, ordered collections), as
t... | [
"Returns",
"the",
"entity",
"key",
"on",
"the",
"other",
"side",
"of",
"association",
"row",
"represented",
"by",
"the",
"given",
"row",
"key",
".",
"<p",
">",
"<b",
">",
"Note",
":",
"<",
"/",
"b",
">",
"May",
"only",
"be",
"invoked",
"if",
"the",
... | train | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/neo4j/src/main/java/org/hibernate/ogm/datastore/neo4j/dialect/impl/BaseNeo4jAssociationQueries.java#L288-L300 |
linroid/FilterMenu | library/src/main/java/com/linroid/filtermenu/library/FilterMenuLayout.java | FilterMenuLayout.arcAngle | private static double arcAngle(Point center, Point a, Point b, Rect area, int radius) {
double angle = threePointsAngle(center, a, b);
Point innerPoint = findMidnormalPoint(center, a, b, area, radius);
Point midInsectPoint = new Point((a.x + b.x) / 2, (a.y + b.y) / 2);
double distance = ... | java | private static double arcAngle(Point center, Point a, Point b, Rect area, int radius) {
double angle = threePointsAngle(center, a, b);
Point innerPoint = findMidnormalPoint(center, a, b, area, radius);
Point midInsectPoint = new Point((a.x + b.x) / 2, (a.y + b.y) / 2);
double distance = ... | [
"private",
"static",
"double",
"arcAngle",
"(",
"Point",
"center",
",",
"Point",
"a",
",",
"Point",
"b",
",",
"Rect",
"area",
",",
"int",
"radius",
")",
"{",
"double",
"angle",
"=",
"threePointsAngle",
"(",
"center",
",",
"a",
",",
"b",
")",
";",
"Po... | calculate arc angle between point a and point b
@param center
@param a
@param b
@param area
@param radius
@return | [
"calculate",
"arc",
"angle",
"between",
"point",
"a",
"and",
"point",
"b"
] | train | https://github.com/linroid/FilterMenu/blob/5a6e5472631c2304b71a51034683f38271962ef5/library/src/main/java/com/linroid/filtermenu/library/FilterMenuLayout.java#L143-L152 |
lightblue-platform/lightblue-migrator | facade/src/main/java/com/redhat/lightblue/migrator/facade/TimeoutConfiguration.java | TimeoutConfiguration.getTimeoutMS | public long getTimeoutMS(String methodName, FacadeOperation op) {
return getMS(methodName, op, Type.timeout);
} | java | public long getTimeoutMS(String methodName, FacadeOperation op) {
return getMS(methodName, op, Type.timeout);
} | [
"public",
"long",
"getTimeoutMS",
"(",
"String",
"methodName",
",",
"FacadeOperation",
"op",
")",
"{",
"return",
"getMS",
"(",
"methodName",
",",
"op",
",",
"Type",
".",
"timeout",
")",
";",
"}"
] | See ${link
{@link TimeoutConfiguration#getMS(String, FacadeOperation, Type)}
@param methodName
@param op
@return | [
"See",
"$",
"{",
"link",
"{",
"@link",
"TimeoutConfiguration#getMS",
"(",
"String",
"FacadeOperation",
"Type",
")",
"}"
] | train | https://github.com/lightblue-platform/lightblue-migrator/blob/ec20748557b40d1f7851e1816d1b76dae48d2027/facade/src/main/java/com/redhat/lightblue/migrator/facade/TimeoutConfiguration.java#L169-L171 |
cdk/cdk | legacy/src/main/java/org/openscience/cdk/smiles/FixBondOrdersTool.java | FixBondOrdersTool.setAllRingBondsSingleOrder | private Boolean setAllRingBondsSingleOrder(List<Integer> ringGroup, IRingSet ringSet) {
for (Integer i : ringGroup) {
for (IBond bond : ringSet.getAtomContainer(i).bonds()) {
bond.setOrder(IBond.Order.SINGLE);
}
}
return true;
} | java | private Boolean setAllRingBondsSingleOrder(List<Integer> ringGroup, IRingSet ringSet) {
for (Integer i : ringGroup) {
for (IBond bond : ringSet.getAtomContainer(i).bonds()) {
bond.setOrder(IBond.Order.SINGLE);
}
}
return true;
} | [
"private",
"Boolean",
"setAllRingBondsSingleOrder",
"(",
"List",
"<",
"Integer",
">",
"ringGroup",
",",
"IRingSet",
"ringSet",
")",
"{",
"for",
"(",
"Integer",
"i",
":",
"ringGroup",
")",
"{",
"for",
"(",
"IBond",
"bond",
":",
"ringSet",
".",
"getAtomContain... | Sets all bonds in an {@link IRingSet} to single order.
@param ringGroup
@param ringSet
@return True for success | [
"Sets",
"all",
"bonds",
"in",
"an",
"{"
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/legacy/src/main/java/org/openscience/cdk/smiles/FixBondOrdersTool.java#L361-L368 |
UrielCh/ovh-java-sdk | ovh-java-sdk-ipLoadbalancing/src/main/java/net/minidev/ovh/api/ApiOvhIpLoadbalancing.java | ApiOvhIpLoadbalancing.serviceName_vrack_network_GET | public ArrayList<Long> serviceName_vrack_network_GET(String serviceName, String subnet, Long vlan) throws IOException {
String qPath = "/ipLoadbalancing/{serviceName}/vrack/network";
StringBuilder sb = path(qPath, serviceName);
query(sb, "subnet", subnet);
query(sb, "vlan", vlan);
String resp = exec(qPath, "G... | java | public ArrayList<Long> serviceName_vrack_network_GET(String serviceName, String subnet, Long vlan) throws IOException {
String qPath = "/ipLoadbalancing/{serviceName}/vrack/network";
StringBuilder sb = path(qPath, serviceName);
query(sb, "subnet", subnet);
query(sb, "vlan", vlan);
String resp = exec(qPath, "G... | [
"public",
"ArrayList",
"<",
"Long",
">",
"serviceName_vrack_network_GET",
"(",
"String",
"serviceName",
",",
"String",
"subnet",
",",
"Long",
"vlan",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/ipLoadbalancing/{serviceName}/vrack/network\"",
";",
"S... | Descriptions of private networks in the vRack attached to this Load Balancer
REST: GET /ipLoadbalancing/{serviceName}/vrack/network
@param vlan [required] Filter the value of vlan property (=)
@param subnet [required] Filter the value of subnet property (=)
@param serviceName [required] The internal name of your IP lo... | [
"Descriptions",
"of",
"private",
"networks",
"in",
"the",
"vRack",
"attached",
"to",
"this",
"Load",
"Balancer"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-ipLoadbalancing/src/main/java/net/minidev/ovh/api/ApiOvhIpLoadbalancing.java#L1157-L1164 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/implementation/ComputerVisionImpl.java | ComputerVisionImpl.recognizePrintedTextInStreamAsync | public Observable<OcrResult> recognizePrintedTextInStreamAsync(boolean detectOrientation, byte[] image, RecognizePrintedTextInStreamOptionalParameter recognizePrintedTextInStreamOptionalParameter) {
return recognizePrintedTextInStreamWithServiceResponseAsync(detectOrientation, image, recognizePrintedTextInStrea... | java | public Observable<OcrResult> recognizePrintedTextInStreamAsync(boolean detectOrientation, byte[] image, RecognizePrintedTextInStreamOptionalParameter recognizePrintedTextInStreamOptionalParameter) {
return recognizePrintedTextInStreamWithServiceResponseAsync(detectOrientation, image, recognizePrintedTextInStrea... | [
"public",
"Observable",
"<",
"OcrResult",
">",
"recognizePrintedTextInStreamAsync",
"(",
"boolean",
"detectOrientation",
",",
"byte",
"[",
"]",
"image",
",",
"RecognizePrintedTextInStreamOptionalParameter",
"recognizePrintedTextInStreamOptionalParameter",
")",
"{",
"return",
... | Optical Character Recognition (OCR) detects printed text in an image and extracts the recognized characters into a machine-usable character stream. Upon success, the OCR results will be returned. Upon failure, the error code together with an error message will be returned. The error code can be one of InvalidImageUrl... | [
"Optical",
"Character",
"Recognition",
"(",
"OCR",
")",
"detects",
"printed",
"text",
"in",
"an",
"image",
"and",
"extracts",
"the",
"recognized",
"characters",
"into",
"a",
"machine",
"-",
"usable",
"character",
"stream",
".",
"Upon",
"success",
"the",
"OCR",... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/implementation/ComputerVisionImpl.java#L767-L774 |
openbaton/openbaton-client | sdk/src/main/java/org/openbaton/sdk/api/rest/NetworkServiceRecordAgent.java | NetworkServiceRecordAgent.executeScript | @Help(
help =
"Executes a script at runtime for a VNFR of a defined VNFD in a running NSR with specific id"
)
public void executeScript(final String idNsr, final String idVnfr, String script)
throws SDKException {
String url = idNsr + "/vnfrecords" + "/" + idVnfr + "/execute-script";
reque... | java | @Help(
help =
"Executes a script at runtime for a VNFR of a defined VNFD in a running NSR with specific id"
)
public void executeScript(final String idNsr, final String idVnfr, String script)
throws SDKException {
String url = idNsr + "/vnfrecords" + "/" + idVnfr + "/execute-script";
reque... | [
"@",
"Help",
"(",
"help",
"=",
"\"Executes a script at runtime for a VNFR of a defined VNFD in a running NSR with specific id\"",
")",
"public",
"void",
"executeScript",
"(",
"final",
"String",
"idNsr",
",",
"final",
"String",
"idVnfr",
",",
"String",
"script",
")",
"thro... | Executes a script at runtime for a VNFR of a defined VNFD in a running NSR.
@param idNsr the ID of the NetworkServiceRecord
@param idVnfr the ID of the VNFR to be upgraded
@param script the script to execute
@throws SDKException if the request fails | [
"Executes",
"a",
"script",
"at",
"runtime",
"for",
"a",
"VNFR",
"of",
"a",
"defined",
"VNFD",
"in",
"a",
"running",
"NSR",
"."
] | train | https://github.com/openbaton/openbaton-client/blob/6ca6dd6b62a23940d312213d6fa489d5b636061a/sdk/src/main/java/org/openbaton/sdk/api/rest/NetworkServiceRecordAgent.java#L721-L729 |
bazaarvoice/emodb | common/client/src/main/java/com/bazaarvoice/emodb/client/uri/EmoUriComponent.java | EmoUriComponent.decodePercentEncodedOctets | private static ByteBuffer decodePercentEncodedOctets(String s, int i, ByteBuffer bb) {
if (bb == null) {
bb = ByteBuffer.allocate(1);
} else {
bb.clear();
}
while (true) {
// Decode the hex digits
bb.put((byte) (decodeHex(s, i++) << 4 | de... | java | private static ByteBuffer decodePercentEncodedOctets(String s, int i, ByteBuffer bb) {
if (bb == null) {
bb = ByteBuffer.allocate(1);
} else {
bb.clear();
}
while (true) {
// Decode the hex digits
bb.put((byte) (decodeHex(s, i++) << 4 | de... | [
"private",
"static",
"ByteBuffer",
"decodePercentEncodedOctets",
"(",
"String",
"s",
",",
"int",
"i",
",",
"ByteBuffer",
"bb",
")",
"{",
"if",
"(",
"bb",
"==",
"null",
")",
"{",
"bb",
"=",
"ByteBuffer",
".",
"allocate",
"(",
"1",
")",
";",
"}",
"else",... | Decode a continuous sequence of percent encoded octets.
<p>
Assumes the index, i, starts that the first hex digit of the first
percent-encoded octet. | [
"Decode",
"a",
"continuous",
"sequence",
"of",
"percent",
"encoded",
"octets",
".",
"<p",
">",
"Assumes",
"the",
"index",
"i",
"starts",
"that",
"the",
"first",
"hex",
"digit",
"of",
"the",
"first",
"percent",
"-",
"encoded",
"octet",
"."
] | train | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/common/client/src/main/java/com/bazaarvoice/emodb/client/uri/EmoUriComponent.java#L780-L814 |
rzwitserloot/lombok | src/core/lombok/javac/apt/LombokProcessor.java | LombokProcessor.getJavacFiler | public JavacFiler getJavacFiler(Object filer) {
if (filer instanceof JavacFiler) return (JavacFiler) filer;
// try to find a "delegate" field in the object, and use this to check for a JavacFiler
for (Class<?> filerClass = filer.getClass(); filerClass != null; filerClass = filerClass.getSuperclass()) {
try ... | java | public JavacFiler getJavacFiler(Object filer) {
if (filer instanceof JavacFiler) return (JavacFiler) filer;
// try to find a "delegate" field in the object, and use this to check for a JavacFiler
for (Class<?> filerClass = filer.getClass(); filerClass != null; filerClass = filerClass.getSuperclass()) {
try ... | [
"public",
"JavacFiler",
"getJavacFiler",
"(",
"Object",
"filer",
")",
"{",
"if",
"(",
"filer",
"instanceof",
"JavacFiler",
")",
"return",
"(",
"JavacFiler",
")",
"filer",
";",
"// try to find a \"delegate\" field in the object, and use this to check for a JavacFiler",
"for"... | This class returns the given filer as a JavacFiler. In case the filer is no
JavacFiler (e.g. the Gradle IncrementalFiler), its "delegate" field is used to get the JavacFiler
(directly or through a delegate field again) | [
"This",
"class",
"returns",
"the",
"given",
"filer",
"as",
"a",
"JavacFiler",
".",
"In",
"case",
"the",
"filer",
"is",
"no",
"JavacFiler",
"(",
"e",
".",
"g",
".",
"the",
"Gradle",
"IncrementalFiler",
")",
"its",
"delegate",
"field",
"is",
"used",
"to",
... | train | https://github.com/rzwitserloot/lombok/blob/75601240760bd81ff95fcde7a1b8185769ce64e8/src/core/lombok/javac/apt/LombokProcessor.java#L431-L446 |
JadiraOrg/jadira | bindings/src/main/java/org/jadira/bindings/core/binder/BasicBinder.java | BasicBinder.registerBinding | public final <S, T> void registerBinding(Class<S> source, Class<T> target, Binding<S, T> converter) {
Class<? extends Annotation> scope = matchImplementationToScope(converter.getClass());
registerBinding(new ConverterKey<S,T>(source, target, scope == null ? DefaultBinding.class : scope), converter);
... | java | public final <S, T> void registerBinding(Class<S> source, Class<T> target, Binding<S, T> converter) {
Class<? extends Annotation> scope = matchImplementationToScope(converter.getClass());
registerBinding(new ConverterKey<S,T>(source, target, scope == null ? DefaultBinding.class : scope), converter);
... | [
"public",
"final",
"<",
"S",
",",
"T",
">",
"void",
"registerBinding",
"(",
"Class",
"<",
"S",
">",
"source",
",",
"Class",
"<",
"T",
">",
"target",
",",
"Binding",
"<",
"S",
",",
"T",
">",
"converter",
")",
"{",
"Class",
"<",
"?",
"extends",
"An... | Register a Binding with the given source and target class.
A binding unifies a marshaller and an unmarshaller and both must be available to resolve a binding.
The source class is considered the owning class of the binding. The source can be marshalled
into the target class. Similarly, the target can be unmarshalled to... | [
"Register",
"a",
"Binding",
"with",
"the",
"given",
"source",
"and",
"target",
"class",
".",
"A",
"binding",
"unifies",
"a",
"marshaller",
"and",
"an",
"unmarshaller",
"and",
"both",
"must",
"be",
"available",
"to",
"resolve",
"a",
"binding",
"."
] | train | https://github.com/JadiraOrg/jadira/blob/d55d0238395f0cb900531f1f08b4b2d87fa9a4f6/bindings/src/main/java/org/jadira/bindings/core/binder/BasicBinder.java#L544-L547 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/blas/impl/BaseLevel2.java | BaseLevel2.ger | @Override
public void ger(char order, double alpha, INDArray X, INDArray Y, INDArray A) {
if (Nd4j.getExecutioner().getProfilingMode() == OpExecutioner.ProfilingMode.ALL)
OpProfiler.getInstance().processBlasCall(false, A, X, Y);
// FIXME: int cast
if (X.data().dataType() == Dat... | java | @Override
public void ger(char order, double alpha, INDArray X, INDArray Y, INDArray A) {
if (Nd4j.getExecutioner().getProfilingMode() == OpExecutioner.ProfilingMode.ALL)
OpProfiler.getInstance().processBlasCall(false, A, X, Y);
// FIXME: int cast
if (X.data().dataType() == Dat... | [
"@",
"Override",
"public",
"void",
"ger",
"(",
"char",
"order",
",",
"double",
"alpha",
",",
"INDArray",
"X",
",",
"INDArray",
"Y",
",",
"INDArray",
"A",
")",
"{",
"if",
"(",
"Nd4j",
".",
"getExecutioner",
"(",
")",
".",
"getProfilingMode",
"(",
")",
... | performs a rank-1 update of a general m-by-n matrix a:
a := alpha*x*y' + a.
@param order
@param alpha
@param X
@param Y
@param A | [
"performs",
"a",
"rank",
"-",
"1",
"update",
"of",
"a",
"general",
"m",
"-",
"by",
"-",
"n",
"matrix",
"a",
":",
"a",
":",
"=",
"alpha",
"*",
"x",
"*",
"y",
"+",
"a",
"."
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/blas/impl/BaseLevel2.java#L145-L161 |
Kickflip/kickflip-android-sdk | sdk/src/main/java/io/kickflip/sdk/av/EglCore.java | EglCore.makeCurrent | public void makeCurrent(EGLSurface drawSurface, EGLSurface readSurface) {
if (mEGLDisplay == EGL14.EGL_NO_DISPLAY) {
// called makeCurrent() before create?
Log.d(TAG, "NOTE: makeCurrent w/o display");
}
if (!EGL14.eglMakeCurrent(mEGLDisplay, drawSurface, readSurface, mEGL... | java | public void makeCurrent(EGLSurface drawSurface, EGLSurface readSurface) {
if (mEGLDisplay == EGL14.EGL_NO_DISPLAY) {
// called makeCurrent() before create?
Log.d(TAG, "NOTE: makeCurrent w/o display");
}
if (!EGL14.eglMakeCurrent(mEGLDisplay, drawSurface, readSurface, mEGL... | [
"public",
"void",
"makeCurrent",
"(",
"EGLSurface",
"drawSurface",
",",
"EGLSurface",
"readSurface",
")",
"{",
"if",
"(",
"mEGLDisplay",
"==",
"EGL14",
".",
"EGL_NO_DISPLAY",
")",
"{",
"// called makeCurrent() before create?",
"Log",
".",
"d",
"(",
"TAG",
",",
"... | Makes our EGL context current, using the supplied "draw" and "read" surfaces. | [
"Makes",
"our",
"EGL",
"context",
"current",
"using",
"the",
"supplied",
"draw",
"and",
"read",
"surfaces",
"."
] | train | https://github.com/Kickflip/kickflip-android-sdk/blob/af3aae5f1128d7376e67aefe11a3a1a3844be734/sdk/src/main/java/io/kickflip/sdk/av/EglCore.java#L276-L284 |
Axway/Grapes | server/src/main/java/org/axway/grapes/server/webapp/resources/LicenseResource.java | LicenseResource.postLicense | @POST
public Response postLicense(@Auth final DbCredential credential, final License license){
if(!credential.getRoles().contains(AvailableRoles.DATA_UPDATER)){
throw new WebApplicationException(Response.status(Response.Status.UNAUTHORIZED).build());
}
LOG.info("Got a post license reques... | java | @POST
public Response postLicense(@Auth final DbCredential credential, final License license){
if(!credential.getRoles().contains(AvailableRoles.DATA_UPDATER)){
throw new WebApplicationException(Response.status(Response.Status.UNAUTHORIZED).build());
}
LOG.info("Got a post license reques... | [
"@",
"POST",
"public",
"Response",
"postLicense",
"(",
"@",
"Auth",
"final",
"DbCredential",
"credential",
",",
"final",
"License",
"license",
")",
"{",
"if",
"(",
"!",
"credential",
".",
"getRoles",
"(",
")",
".",
"contains",
"(",
"AvailableRoles",
".",
"... | Handle license posts when the server got a request POST <dm_url>/license & MIME that contains the license.
@param license The license to add to Grapes database
@return Response An acknowledgment:<br/>- 400 if the artifact is MIME is malformed<br/>- 500 if internal error<br/>- 201 if ok | [
"Handle",
"license",
"posts",
"when",
"the",
"server",
"got",
"a",
"request",
"POST",
"<dm_url",
">",
"/",
"license",
"&",
"MIME",
"that",
"contains",
"the",
"license",
"."
] | train | https://github.com/Axway/Grapes/blob/ce9cc73d85f83eaa5fbc991abb593915a8c8374e/server/src/main/java/org/axway/grapes/server/webapp/resources/LicenseResource.java#L54-L79 |
Jasig/uPortal | uPortal-api/uPortal-api-rest/src/main/java/org/apereo/portal/rest/permissions/PermissionsRESTController.java | PermissionsRESTController.getActivities | @PreAuthorize(
"hasPermission('ALL', 'java.lang.String', new org.apereo.portal.spring.security.evaluator.AuthorizableActivity('UP_PERMISSIONS', 'VIEW_PERMISSIONS'))")
@RequestMapping(value = "/permissions/activities.json", method = RequestMethod.GET)
public ModelAndView getActivities(@RequestParam(v... | java | @PreAuthorize(
"hasPermission('ALL', 'java.lang.String', new org.apereo.portal.spring.security.evaluator.AuthorizableActivity('UP_PERMISSIONS', 'VIEW_PERMISSIONS'))")
@RequestMapping(value = "/permissions/activities.json", method = RequestMethod.GET)
public ModelAndView getActivities(@RequestParam(v... | [
"@",
"PreAuthorize",
"(",
"\"hasPermission('ALL', 'java.lang.String', new org.apereo.portal.spring.security.evaluator.AuthorizableActivity('UP_PERMISSIONS', 'VIEW_PERMISSIONS'))\"",
")",
"@",
"RequestMapping",
"(",
"value",
"=",
"\"/permissions/activities.json\"",
",",
"method",
"=",
"Re... | Provide a list of all registered IPermissionActivities. If an optional search string is
provided, the returned list will be restricted to activities matching the query. | [
"Provide",
"a",
"list",
"of",
"all",
"registered",
"IPermissionActivities",
".",
"If",
"an",
"optional",
"search",
"string",
"is",
"provided",
"the",
"returned",
"list",
"will",
"be",
"restricted",
"to",
"activities",
"matching",
"the",
"query",
"."
] | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-api/uPortal-api-rest/src/main/java/org/apereo/portal/rest/permissions/PermissionsRESTController.java#L149-L176 |
actframework/actframework | src/main/java/act/internal/util/AppDescriptor.java | AppDescriptor.of | public static AppDescriptor of(String appName, Class<?> entryClass) {
System.setProperty("osgl.version.suppress-var-found-warning", "true");
return of(appName, entryClass, Version.of(entryClass));
} | java | public static AppDescriptor of(String appName, Class<?> entryClass) {
System.setProperty("osgl.version.suppress-var-found-warning", "true");
return of(appName, entryClass, Version.of(entryClass));
} | [
"public",
"static",
"AppDescriptor",
"of",
"(",
"String",
"appName",
",",
"Class",
"<",
"?",
">",
"entryClass",
")",
"{",
"System",
".",
"setProperty",
"(",
"\"osgl.version.suppress-var-found-warning\"",
",",
"\"true\"",
")",
";",
"return",
"of",
"(",
"appName",... | Create an `AppDescriptor` with appName and entry class specified.
If `appName` is `null` or blank, it will try the following
approach to get app name:
1. check the {@link Version#getArtifactId() artifact id} and use it unless
2. if artifact id is null or empty, then infer app name using {@link AppNameInferer}
@param... | [
"Create",
"an",
"AppDescriptor",
"with",
"appName",
"and",
"entry",
"class",
"specified",
"."
] | train | https://github.com/actframework/actframework/blob/55a8f8b45e71159a79ec6e157c02f71700f8cd54/src/main/java/act/internal/util/AppDescriptor.java#L196-L199 |
kuali/ojb-1.0.4 | src/xdoclet/java/src/xdoclet/modules/ojb/constraints/ClassDescriptorConstraints.java | ClassDescriptorConstraints.ensureNoTableInfoIfNoRepositoryInfo | private void ensureNoTableInfoIfNoRepositoryInfo(ClassDescriptorDef classDef, String checkLevel)
{
if (!classDef.getBooleanProperty(PropertyHelper.OJB_PROPERTY_GENERATE_REPOSITORY_INFO, true))
{
classDef.setProperty(PropertyHelper.OJB_PROPERTY_GENERATE_TABLE_INFO, "false");
... | java | private void ensureNoTableInfoIfNoRepositoryInfo(ClassDescriptorDef classDef, String checkLevel)
{
if (!classDef.getBooleanProperty(PropertyHelper.OJB_PROPERTY_GENERATE_REPOSITORY_INFO, true))
{
classDef.setProperty(PropertyHelper.OJB_PROPERTY_GENERATE_TABLE_INFO, "false");
... | [
"private",
"void",
"ensureNoTableInfoIfNoRepositoryInfo",
"(",
"ClassDescriptorDef",
"classDef",
",",
"String",
"checkLevel",
")",
"{",
"if",
"(",
"!",
"classDef",
".",
"getBooleanProperty",
"(",
"PropertyHelper",
".",
"OJB_PROPERTY_GENERATE_REPOSITORY_INFO",
",",
"true",... | Ensures that generate-table-info is set to false if generate-repository-info is set to false.
@param classDef The class descriptor
@param checkLevel The current check level (this constraint is checked in all levels) | [
"Ensures",
"that",
"generate",
"-",
"table",
"-",
"info",
"is",
"set",
"to",
"false",
"if",
"generate",
"-",
"repository",
"-",
"info",
"is",
"set",
"to",
"false",
"."
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/xdoclet/java/src/xdoclet/modules/ojb/constraints/ClassDescriptorConstraints.java#L66-L72 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/PoolsImpl.java | PoolsImpl.removeNodesAsync | public Observable<Void> removeNodesAsync(String poolId, NodeRemoveParameter nodeRemoveParameter, PoolRemoveNodesOptions poolRemoveNodesOptions) {
return removeNodesWithServiceResponseAsync(poolId, nodeRemoveParameter, poolRemoveNodesOptions).map(new Func1<ServiceResponseWithHeaders<Void, PoolRemoveNodesHeaders>... | java | public Observable<Void> removeNodesAsync(String poolId, NodeRemoveParameter nodeRemoveParameter, PoolRemoveNodesOptions poolRemoveNodesOptions) {
return removeNodesWithServiceResponseAsync(poolId, nodeRemoveParameter, poolRemoveNodesOptions).map(new Func1<ServiceResponseWithHeaders<Void, PoolRemoveNodesHeaders>... | [
"public",
"Observable",
"<",
"Void",
">",
"removeNodesAsync",
"(",
"String",
"poolId",
",",
"NodeRemoveParameter",
"nodeRemoveParameter",
",",
"PoolRemoveNodesOptions",
"poolRemoveNodesOptions",
")",
"{",
"return",
"removeNodesWithServiceResponseAsync",
"(",
"poolId",
",",
... | Removes compute nodes from the specified pool.
This operation can only run when the allocation state of the pool is steady. When this operation runs, the allocation state changes from steady to resizing.
@param poolId The ID of the pool from which you want to remove nodes.
@param nodeRemoveParameter The parameters for... | [
"Removes",
"compute",
"nodes",
"from",
"the",
"specified",
"pool",
".",
"This",
"operation",
"can",
"only",
"run",
"when",
"the",
"allocation",
"state",
"of",
"the",
"pool",
"is",
"steady",
".",
"When",
"this",
"operation",
"runs",
"the",
"allocation",
"stat... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/PoolsImpl.java#L3539-L3546 |
OpenLiberty/open-liberty | dev/com.ibm.websphere.javaee.el.3.0/src/javax/el/ELResolver.java | ELResolver.convertToType | public Object convertToType(ELContext context, Object obj, Class<?> type) {
context.setPropertyResolved(false);
return null;
} | java | public Object convertToType(ELContext context, Object obj, Class<?> type) {
context.setPropertyResolved(false);
return null;
} | [
"public",
"Object",
"convertToType",
"(",
"ELContext",
"context",
",",
"Object",
"obj",
",",
"Class",
"<",
"?",
">",
"type",
")",
"{",
"context",
".",
"setPropertyResolved",
"(",
"false",
")",
";",
"return",
"null",
";",
"}"
] | Converts the given object to the given type. This default implementation
always returns <code>null</code>.
@param context The EL context for this evaluation
@param obj The object to convert
@param type The type to which the object should be converted
@return Always <code>null</code>
@since EL 3.0 | [
"Converts",
"the",
"given",
"object",
"to",
"the",
"given",
"type",
".",
"This",
"default",
"implementation",
"always",
"returns",
"<code",
">",
"null<",
"/",
"code",
">",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.websphere.javaee.el.3.0/src/javax/el/ELResolver.java#L138-L141 |
apereo/person-directory | person-directory-impl/src/main/java/org/apereo/services/persondir/support/web/RequestAttributeSourceFilter.java | RequestAttributeSourceFilter.addRequestHeaders | protected void addRequestHeaders(final HttpServletRequest httpServletRequest, final Map<String, List<Object>> attributes) {
for (final Map.Entry<String, Set<String>> headerAttributeEntry : this.headerAttributeMapping.entrySet()) {
final String headerName = headerAttributeEntry.getKey();
... | java | protected void addRequestHeaders(final HttpServletRequest httpServletRequest, final Map<String, List<Object>> attributes) {
for (final Map.Entry<String, Set<String>> headerAttributeEntry : this.headerAttributeMapping.entrySet()) {
final String headerName = headerAttributeEntry.getKey();
... | [
"protected",
"void",
"addRequestHeaders",
"(",
"final",
"HttpServletRequest",
"httpServletRequest",
",",
"final",
"Map",
"<",
"String",
",",
"List",
"<",
"Object",
">",
">",
"attributes",
")",
"{",
"for",
"(",
"final",
"Map",
".",
"Entry",
"<",
"String",
","... | Add request headers to the attributes map
@param httpServletRequest Http Servlet Request
@param attributes Map of attributes to add additional attributes to from the Http Request | [
"Add",
"request",
"headers",
"to",
"the",
"attributes",
"map"
] | train | https://github.com/apereo/person-directory/blob/331200c0878aec202b8aff12a732402d6ba7681f/person-directory-impl/src/main/java/org/apereo/services/persondir/support/web/RequestAttributeSourceFilter.java#L458-L472 |
overturetool/overture | core/pog/src/main/java/org/overture/pog/obligation/ProofObligation.java | ProofObligation.makeRelContext | protected AForAllExp makeRelContext(ATypeDefinition node, AVariableExp... exps){
AForAllExp forall_exp = new AForAllExp();
forall_exp.setType(new ABooleanBasicType());
ATypeMultipleBind tmb = new ATypeMultipleBind();
List<PPattern> pats = new LinkedList<>();
for (AVariableExp exp : exps)
{
pats.add(Ast... | java | protected AForAllExp makeRelContext(ATypeDefinition node, AVariableExp... exps){
AForAllExp forall_exp = new AForAllExp();
forall_exp.setType(new ABooleanBasicType());
ATypeMultipleBind tmb = new ATypeMultipleBind();
List<PPattern> pats = new LinkedList<>();
for (AVariableExp exp : exps)
{
pats.add(Ast... | [
"protected",
"AForAllExp",
"makeRelContext",
"(",
"ATypeDefinition",
"node",
",",
"AVariableExp",
"...",
"exps",
")",
"{",
"AForAllExp",
"forall_exp",
"=",
"new",
"AForAllExp",
"(",
")",
";",
"forall_exp",
".",
"setType",
"(",
"new",
"ABooleanBasicType",
"(",
")... | Create the context (forall x,y,z...) for a Proof Obligation for
eq and ord relations. | [
"Create",
"the",
"context",
"(",
"forall",
"x",
"y",
"z",
"...",
")",
"for",
"a",
"Proof",
"Obligation",
"for",
"eq",
"and",
"ord",
"relations",
"."
] | train | https://github.com/overturetool/overture/blob/83175dc6c24fa171cde4fcf61ecb648eba3bdbc1/core/pog/src/main/java/org/overture/pog/obligation/ProofObligation.java#L237-L254 |
opsmatters/newrelic-api | src/main/java/com/opsmatters/newrelic/api/services/MonitorService.java | MonitorService.deleteLabel | public MonitorService deleteLabel(String monitorId, Label label)
{
HTTP.DELETE(String.format("/v1/monitors/%s/labels/%s", monitorId, label.getKey()));
return this;
} | java | public MonitorService deleteLabel(String monitorId, Label label)
{
HTTP.DELETE(String.format("/v1/monitors/%s/labels/%s", monitorId, label.getKey()));
return this;
} | [
"public",
"MonitorService",
"deleteLabel",
"(",
"String",
"monitorId",
",",
"Label",
"label",
")",
"{",
"HTTP",
".",
"DELETE",
"(",
"String",
".",
"format",
"(",
"\"/v1/monitors/%s/labels/%s\"",
",",
"monitorId",
",",
"label",
".",
"getKey",
"(",
")",
")",
"... | Deletes the given label from the monitor with the given id.
@param monitorId The id of the monitor with the label
@param label The label to delete
@return This object | [
"Deletes",
"the",
"given",
"label",
"from",
"the",
"monitor",
"with",
"the",
"given",
"id",
"."
] | train | https://github.com/opsmatters/newrelic-api/blob/5bc2ea62ec368db891e4fd5fe3dcdf529d086b5e/src/main/java/com/opsmatters/newrelic/api/services/MonitorService.java#L220-L224 |
googleads/googleads-java-lib | modules/ads_lib/src/main/java/com/google/api/ads/common/lib/auth/AuthorizationHeaderProvider.java | AuthorizationHeaderProvider.getAuthorizationHeader | public String getAuthorizationHeader(AdsSession adsSession, @Nullable String endpointUrl)
throws AuthenticationException {
if (adsSession instanceof OAuth2Compatible
&& ((OAuth2Compatible) adsSession).getOAuth2Credential() != null) {
return getOAuth2Header((OAuth2Compatible) adsSession);
} e... | java | public String getAuthorizationHeader(AdsSession adsSession, @Nullable String endpointUrl)
throws AuthenticationException {
if (adsSession instanceof OAuth2Compatible
&& ((OAuth2Compatible) adsSession).getOAuth2Credential() != null) {
return getOAuth2Header((OAuth2Compatible) adsSession);
} e... | [
"public",
"String",
"getAuthorizationHeader",
"(",
"AdsSession",
"adsSession",
",",
"@",
"Nullable",
"String",
"endpointUrl",
")",
"throws",
"AuthenticationException",
"{",
"if",
"(",
"adsSession",
"instanceof",
"OAuth2Compatible",
"&&",
"(",
"(",
"OAuth2Compatible",
... | Gets a header value that can be set to the {@code Authorization} HTTP
header. The endpoint URL can be {@code null} if it's not needed for the
authentication mechanism (i.e. OAuth2).
@param adsSession the session to pull authentication information from
@param endpointUrl the endpoint URL used for authentication mechani... | [
"Gets",
"a",
"header",
"value",
"that",
"can",
"be",
"set",
"to",
"the",
"{",
"@code",
"Authorization",
"}",
"HTTP",
"header",
".",
"The",
"endpoint",
"URL",
"can",
"be",
"{",
"@code",
"null",
"}",
"if",
"it",
"s",
"not",
"needed",
"for",
"the",
"aut... | train | https://github.com/googleads/googleads-java-lib/blob/967957cc4f6076514e3a7926fe653e4f1f7cc9c9/modules/ads_lib/src/main/java/com/google/api/ads/common/lib/auth/AuthorizationHeaderProvider.java#L70-L79 |
Whiley/WhileyCompiler | src/main/java/wyil/check/FlowTypeCheck.java | FlowTypeCheck.checkLogicalConjunction | private Environment checkLogicalConjunction(Expr.LogicalAnd expr, boolean sign, Environment environment) {
Tuple<Expr> operands = expr.getOperands();
if (sign) {
for (int i = 0; i != operands.size(); ++i) {
environment = checkCondition(operands.get(i), sign, environment);
}
return environment;
} else... | java | private Environment checkLogicalConjunction(Expr.LogicalAnd expr, boolean sign, Environment environment) {
Tuple<Expr> operands = expr.getOperands();
if (sign) {
for (int i = 0; i != operands.size(); ++i) {
environment = checkCondition(operands.get(i), sign, environment);
}
return environment;
} else... | [
"private",
"Environment",
"checkLogicalConjunction",
"(",
"Expr",
".",
"LogicalAnd",
"expr",
",",
"boolean",
"sign",
",",
"Environment",
"environment",
")",
"{",
"Tuple",
"<",
"Expr",
">",
"operands",
"=",
"expr",
".",
"getOperands",
"(",
")",
";",
"if",
"("... | In this case, we are threading each environment as is through to the next
statement. For example, consider this example:
<pre>
function f(int|null x) -> (bool r):
return (x is int) && (x >= 0)
</pre>
The environment going into <code>x is int</code> will be
<code>{x->(int|null)}</code>. The environment coming out of t... | [
"In",
"this",
"case",
"we",
"are",
"threading",
"each",
"environment",
"as",
"is",
"through",
"to",
"the",
"next",
"statement",
".",
"For",
"example",
"consider",
"this",
"example",
":"
] | train | https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyil/check/FlowTypeCheck.java#L997-L1014 |
LAW-Unimi/BUbiNG | src/it/unimi/di/law/bubing/util/Util.java | Util.writeByteArray | public final static void writeByteArray(final byte[] a, final ObjectOutputStream s) throws IOException {
writeVByte(a.length, s);
s.write(a);
} | java | public final static void writeByteArray(final byte[] a, final ObjectOutputStream s) throws IOException {
writeVByte(a.length, s);
s.write(a);
} | [
"public",
"final",
"static",
"void",
"writeByteArray",
"(",
"final",
"byte",
"[",
"]",
"a",
",",
"final",
"ObjectOutputStream",
"s",
")",
"throws",
"IOException",
"{",
"writeVByte",
"(",
"a",
".",
"length",
",",
"s",
")",
";",
"s",
".",
"write",
"(",
"... | Writes a byte array prefixed by its length encoded using vByte.
@param a the array to be written.
@param s the stream where the array should be written. | [
"Writes",
"a",
"byte",
"array",
"prefixed",
"by",
"its",
"length",
"encoded",
"using",
"vByte",
"."
] | train | https://github.com/LAW-Unimi/BUbiNG/blob/e148acc90031a4f3967422705a9fb07ddaf155e4/src/it/unimi/di/law/bubing/util/Util.java#L167-L170 |
moparisthebest/beehive | beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/FlowController.java | FlowController.resolveAction | public String resolveAction( String actionName, Object form, HttpServletRequest request,
HttpServletResponse response )
throws Exception
{
ActionMapping mapping = ( ActionMapping ) getModuleConfig().findActionConfig( '/' + actionName );
if ( mapping == null ... | java | public String resolveAction( String actionName, Object form, HttpServletRequest request,
HttpServletResponse response )
throws Exception
{
ActionMapping mapping = ( ActionMapping ) getModuleConfig().findActionConfig( '/' + actionName );
if ( mapping == null ... | [
"public",
"String",
"resolveAction",
"(",
"String",
"actionName",
",",
"Object",
"form",
",",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
")",
"throws",
"Exception",
"{",
"ActionMapping",
"mapping",
"=",
"(",
"ActionMapping",
")",
"getMo... | Call an action and return the result URI.
@param actionName the name of the action to run.
@param form the form bean instance to pass to the action, or <code>null</code> if none should be passed.
@return the result webapp-relative URI, as a String.
@throws ActionNotFoundException when the given action does not exist i... | [
"Call",
"an",
"action",
"and",
"return",
"the",
"result",
"URI",
"."
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/FlowController.java#L1095-L1122 |
ngageoint/geopackage-core-java | src/main/java/mil/nga/geopackage/extension/RTreeIndexCoreExtension.java | RTreeIndexCoreExtension.getRTreeTableName | private String getRTreeTableName(String tableName, String geometryColumnName) {
String sqlName = GeoPackageProperties.getProperty(SQL_PROPERTY,
TABLE_PROPERTY);
String rTreeTableName = substituteSqlArguments(sqlName, tableName,
geometryColumnName, null, null);
return rTreeTableName;
} | java | private String getRTreeTableName(String tableName, String geometryColumnName) {
String sqlName = GeoPackageProperties.getProperty(SQL_PROPERTY,
TABLE_PROPERTY);
String rTreeTableName = substituteSqlArguments(sqlName, tableName,
geometryColumnName, null, null);
return rTreeTableName;
} | [
"private",
"String",
"getRTreeTableName",
"(",
"String",
"tableName",
",",
"String",
"geometryColumnName",
")",
"{",
"String",
"sqlName",
"=",
"GeoPackageProperties",
".",
"getProperty",
"(",
"SQL_PROPERTY",
",",
"TABLE_PROPERTY",
")",
";",
"String",
"rTreeTableName",... | Get the RTree Table name for the feature table and geometry column
@param tableName
feature table name
@param geometryColumnName
geometry column name
@return RTree table name | [
"Get",
"the",
"RTree",
"Table",
"name",
"for",
"the",
"feature",
"table",
"and",
"geometry",
"column"
] | train | https://github.com/ngageoint/geopackage-core-java/blob/6431c3b041a45b7f3802904ea4156b4082a72daa/src/main/java/mil/nga/geopackage/extension/RTreeIndexCoreExtension.java#L1115-L1121 |
strator-dev/greenpepper | greenpepper/greenpepper-client/src/main/java/com/greenpepper/server/domain/Specification.java | Specification.removeReference | public void removeReference(Reference reference) throws GreenPepperServerException
{
if(!references.contains(reference))
{
throw new GreenPepperServerException( GreenPepperServerErrorKey.REFERENCE_NOT_FOUND, "Reference not found");
}
references.remove(reference);
... | java | public void removeReference(Reference reference) throws GreenPepperServerException
{
if(!references.contains(reference))
{
throw new GreenPepperServerException( GreenPepperServerErrorKey.REFERENCE_NOT_FOUND, "Reference not found");
}
references.remove(reference);
... | [
"public",
"void",
"removeReference",
"(",
"Reference",
"reference",
")",
"throws",
"GreenPepperServerException",
"{",
"if",
"(",
"!",
"references",
".",
"contains",
"(",
"reference",
")",
")",
"{",
"throw",
"new",
"GreenPepperServerException",
"(",
"GreenPepperServe... | <p>removeReference.</p>
@param reference a {@link com.greenpepper.server.domain.Reference} object.
@throws com.greenpepper.server.GreenPepperServerException if any. | [
"<p",
">",
"removeReference",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/strator-dev/greenpepper/blob/2a61e6c179b74085babcc559d677490b0cad2d30/greenpepper/greenpepper-client/src/main/java/com/greenpepper/server/domain/Specification.java#L167-L176 |
banq/jdonframework | JdonAccessory/jdon-remote/src/main/java/com/jdon/bussinessproxy/remote/HessianToJdonServlet.java | HessianToJdonServlet.service | @Override
public void service(final ServletRequest req, final ServletResponse resp) throws ServletException, IOException {
HttpServletRequest request = (HttpServletRequest) req;
HttpServletResponse response = (HttpServletResponse) resp;
final String beanName = request.getPathInfo().sub... | java | @Override
public void service(final ServletRequest req, final ServletResponse resp) throws ServletException, IOException {
HttpServletRequest request = (HttpServletRequest) req;
HttpServletResponse response = (HttpServletResponse) resp;
final String beanName = request.getPathInfo().sub... | [
"@",
"Override",
"public",
"void",
"service",
"(",
"final",
"ServletRequest",
"req",
",",
"final",
"ServletResponse",
"resp",
")",
"throws",
"ServletException",
",",
"IOException",
"{",
"HttpServletRequest",
"request",
"=",
"(",
"HttpServletRequest",
")",
"req",
"... | Servlet to handle incoming Hessian requests and invoke HessianToJdonRequestProcessor.
@param req ServletRequest
@param resp ServletResponse
@throws javax.servlet.ServletException If errors occur
@throws java.io.IOException If IO errors occur | [
"Servlet",
"to",
"handle",
"incoming",
"Hessian",
"requests",
"and",
"invoke",
"HessianToJdonRequestProcessor",
"."
] | train | https://github.com/banq/jdonframework/blob/72b451caac04f775e57f52aaed3d8775044ead53/JdonAccessory/jdon-remote/src/main/java/com/jdon/bussinessproxy/remote/HessianToJdonServlet.java#L56-L63 |
aspectran/aspectran | core/src/main/java/com/aspectran/core/util/MethodUtils.java | MethodUtils.invokeStaticMethod | public static Object invokeStaticMethod(Class<?> objectClass, String methodName, Object[] args)
throws NoSuchMethodException, IllegalAccessException, InvocationTargetException {
if (args == null) {
args = EMPTY_OBJECT_ARRAY;
}
int arguments = args.length;
Class<?>... | java | public static Object invokeStaticMethod(Class<?> objectClass, String methodName, Object[] args)
throws NoSuchMethodException, IllegalAccessException, InvocationTargetException {
if (args == null) {
args = EMPTY_OBJECT_ARRAY;
}
int arguments = args.length;
Class<?>... | [
"public",
"static",
"Object",
"invokeStaticMethod",
"(",
"Class",
"<",
"?",
">",
"objectClass",
",",
"String",
"methodName",
",",
"Object",
"[",
"]",
"args",
")",
"throws",
"NoSuchMethodException",
",",
"IllegalAccessException",
",",
"InvocationTargetException",
"{"... | <p>Invoke a named static method whose parameter type matches the object type.</p>
<p>The behaviour of this method is less deterministic
than {@link #invokeExactMethod(Object object,String methodName,Object[] args)}.
It loops through all methods with names that match
and then executes the first it finds with compatible... | [
"<p",
">",
"Invoke",
"a",
"named",
"static",
"method",
"whose",
"parameter",
"type",
"matches",
"the",
"object",
"type",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/core/src/main/java/com/aspectran/core/util/MethodUtils.java#L459-L470 |
matthewhorridge/owlapi-gwt | owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLIrreflexiveObjectPropertyAxiomImpl_CustomFieldSerializer.java | OWLIrreflexiveObjectPropertyAxiomImpl_CustomFieldSerializer.serializeInstance | @Override
public void serializeInstance(SerializationStreamWriter streamWriter, OWLIrreflexiveObjectPropertyAxiomImpl instance) throws SerializationException {
serialize(streamWriter, instance);
} | java | @Override
public void serializeInstance(SerializationStreamWriter streamWriter, OWLIrreflexiveObjectPropertyAxiomImpl instance) throws SerializationException {
serialize(streamWriter, instance);
} | [
"@",
"Override",
"public",
"void",
"serializeInstance",
"(",
"SerializationStreamWriter",
"streamWriter",
",",
"OWLIrreflexiveObjectPropertyAxiomImpl",
"instance",
")",
"throws",
"SerializationException",
"{",
"serialize",
"(",
"streamWriter",
",",
"instance",
")",
";",
"... | Serializes the content of the object into the
{@link com.google.gwt.user.client.rpc.SerializationStreamWriter}.
@param streamWriter the {@link com.google.gwt.user.client.rpc.SerializationStreamWriter} to write the
object's content to
@param instance the object instance to serialize
@throws com.google.gwt.user.clie... | [
"Serializes",
"the",
"content",
"of",
"the",
"object",
"into",
"the",
"{",
"@link",
"com",
".",
"google",
".",
"gwt",
".",
"user",
".",
"client",
".",
"rpc",
".",
"SerializationStreamWriter",
"}",
"."
] | train | https://github.com/matthewhorridge/owlapi-gwt/blob/7ab975fb6cef3c8947099983551672a3b5d4e2fd/owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLIrreflexiveObjectPropertyAxiomImpl_CustomFieldSerializer.java#L74-L77 |
ngageoint/geopackage-core-java | src/main/java/mil/nga/geopackage/extension/coverage/CoverageDataCore.java | CoverageDataCore.getSourceMinAndMax | private CoverageDataSourcePixel getSourceMinAndMax(float source,
int sourceFloor, float valueLocation) {
int min = sourceFloor;
int max = sourceFloor;
float offset;
if (source < valueLocation) {
min--;
offset = 1.0f - (valueLocation - source);
} else {
max++;
offset = source - valueLocation;
... | java | private CoverageDataSourcePixel getSourceMinAndMax(float source,
int sourceFloor, float valueLocation) {
int min = sourceFloor;
int max = sourceFloor;
float offset;
if (source < valueLocation) {
min--;
offset = 1.0f - (valueLocation - source);
} else {
max++;
offset = source - valueLocation;
... | [
"private",
"CoverageDataSourcePixel",
"getSourceMinAndMax",
"(",
"float",
"source",
",",
"int",
"sourceFloor",
",",
"float",
"valueLocation",
")",
"{",
"int",
"min",
"=",
"sourceFloor",
";",
"int",
"max",
"=",
"sourceFloor",
";",
"float",
"offset",
";",
"if",
... | Get the min, max, and offset of the source pixel
@param source
source pixel
@param sourceFloor
source floor value
@param valueLocation
value location
@return source pixel information | [
"Get",
"the",
"min",
"max",
"and",
"offset",
"of",
"the",
"source",
"pixel"
] | train | https://github.com/ngageoint/geopackage-core-java/blob/6431c3b041a45b7f3802904ea4156b4082a72daa/src/main/java/mil/nga/geopackage/extension/coverage/CoverageDataCore.java#L1038-L1053 |
Coveros/selenified | src/main/java/com/coveros/selenified/services/HTTP.java | HTTP.writeJsonDataRequest | private void writeJsonDataRequest(HttpURLConnection connection, Request request) {
try (OutputStreamWriter wr = new OutputStreamWriter(connection.getOutputStream())) {
wr.write(request.getJsonPayload().toString());
wr.flush();
} catch (IOException e) {
log.error(e);
... | java | private void writeJsonDataRequest(HttpURLConnection connection, Request request) {
try (OutputStreamWriter wr = new OutputStreamWriter(connection.getOutputStream())) {
wr.write(request.getJsonPayload().toString());
wr.flush();
} catch (IOException e) {
log.error(e);
... | [
"private",
"void",
"writeJsonDataRequest",
"(",
"HttpURLConnection",
"connection",
",",
"Request",
"request",
")",
"{",
"try",
"(",
"OutputStreamWriter",
"wr",
"=",
"new",
"OutputStreamWriter",
"(",
"connection",
".",
"getOutputStream",
"(",
")",
")",
")",
"{",
... | Pushes request data to the open http connection
@param connection - the open connection of the http call
@param request - the parameters to be passed to the endpoint for the service
call | [
"Pushes",
"request",
"data",
"to",
"the",
"open",
"http",
"connection"
] | train | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/services/HTTP.java#L343-L350 |
igniterealtime/Smack | smack-core/src/main/java/org/jivesoftware/smack/util/PacketParserUtils.java | PacketParserUtils.parseStanza | public static Stanza parseStanza(XmlPullParser parser, XmlEnvironment outerXmlEnvironment) throws Exception {
ParserUtils.assertAtStartTag(parser);
final String name = parser.getName();
switch (name) {
case Message.ELEMENT:
return parseMessage(parser, outerXmlEnvironment);
... | java | public static Stanza parseStanza(XmlPullParser parser, XmlEnvironment outerXmlEnvironment) throws Exception {
ParserUtils.assertAtStartTag(parser);
final String name = parser.getName();
switch (name) {
case Message.ELEMENT:
return parseMessage(parser, outerXmlEnvironment);
... | [
"public",
"static",
"Stanza",
"parseStanza",
"(",
"XmlPullParser",
"parser",
",",
"XmlEnvironment",
"outerXmlEnvironment",
")",
"throws",
"Exception",
"{",
"ParserUtils",
".",
"assertAtStartTag",
"(",
"parser",
")",
";",
"final",
"String",
"name",
"=",
"parser",
"... | Tries to parse and return either a Message, IQ or Presence stanza.
connection is optional and is used to return feature-not-implemented errors for unknown IQ stanzas.
@param parser
@param outerXmlEnvironment the outer XML environment (optional).
@return a stanza which is either a Message, IQ or Presence.
@throws Exce... | [
"Tries",
"to",
"parse",
"and",
"return",
"either",
"a",
"Message",
"IQ",
"or",
"Presence",
"stanza",
"."
] | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-core/src/main/java/org/jivesoftware/smack/util/PacketParserUtils.java#L154-L167 |
jxnet/Jxnet | jxnet-spring-boot-autoconfigure/src/main/java/com/ardikars/jxnet/spring/boot/autoconfigure/HandlerConfigurer.java | HandlerConfigurer.decodeRawBuffer | public Packet decodeRawBuffer(long address, int length) {
return processPacket(Memories.wrap(address, length, memoryProperties.getCheckBounds()));
} | java | public Packet decodeRawBuffer(long address, int length) {
return processPacket(Memories.wrap(address, length, memoryProperties.getCheckBounds()));
} | [
"public",
"Packet",
"decodeRawBuffer",
"(",
"long",
"address",
",",
"int",
"length",
")",
"{",
"return",
"processPacket",
"(",
"Memories",
".",
"wrap",
"(",
"address",
",",
"length",
",",
"memoryProperties",
".",
"getCheckBounds",
"(",
")",
")",
")",
";",
... | Decode buffer.
@param address memory address.
@param length length.
@return returns {@link Packet}. | [
"Decode",
"buffer",
"."
] | train | https://github.com/jxnet/Jxnet/blob/3ef28eb83c149ff134df1841d12bcbea3d8fe163/jxnet-spring-boot-autoconfigure/src/main/java/com/ardikars/jxnet/spring/boot/autoconfigure/HandlerConfigurer.java#L77-L79 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPSpecificationOptionPersistenceImpl.java | CPSpecificationOptionPersistenceImpl.findByUUID_G | @Override
public CPSpecificationOption findByUUID_G(String uuid, long groupId)
throws NoSuchCPSpecificationOptionException {
CPSpecificationOption cpSpecificationOption = fetchByUUID_G(uuid,
groupId);
if (cpSpecificationOption == null) {
StringBundler msg = new StringBundler(6);
msg.append(_NO_SUCH_E... | java | @Override
public CPSpecificationOption findByUUID_G(String uuid, long groupId)
throws NoSuchCPSpecificationOptionException {
CPSpecificationOption cpSpecificationOption = fetchByUUID_G(uuid,
groupId);
if (cpSpecificationOption == null) {
StringBundler msg = new StringBundler(6);
msg.append(_NO_SUCH_E... | [
"@",
"Override",
"public",
"CPSpecificationOption",
"findByUUID_G",
"(",
"String",
"uuid",
",",
"long",
"groupId",
")",
"throws",
"NoSuchCPSpecificationOptionException",
"{",
"CPSpecificationOption",
"cpSpecificationOption",
"=",
"fetchByUUID_G",
"(",
"uuid",
",",
"groupI... | Returns the cp specification option where uuid = ? and groupId = ? or throws a {@link NoSuchCPSpecificationOptionException} if it could not be found.
@param uuid the uuid
@param groupId the group ID
@return the matching cp specification option
@throws NoSuchCPSpecificationOptionException if a matching cp speci... | [
"Returns",
"the",
"cp",
"specification",
"option",
"where",
"uuid",
"=",
"?",
";",
"and",
"groupId",
"=",
"?",
";",
"or",
"throws",
"a",
"{",
"@link",
"NoSuchCPSpecificationOptionException",
"}",
"if",
"it",
"could",
"not",
"be",
"found",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPSpecificationOptionPersistenceImpl.java#L670-L697 |
Azure/azure-sdk-for-java | notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/NotificationHubsInner.java | NotificationHubsInner.createOrUpdateAuthorizationRule | public SharedAccessAuthorizationRuleResourceInner createOrUpdateAuthorizationRule(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName, SharedAccessAuthorizationRuleProperties properties) {
return createOrUpdateAuthorizationRuleWithServiceResponseAsync(resourc... | java | public SharedAccessAuthorizationRuleResourceInner createOrUpdateAuthorizationRule(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName, SharedAccessAuthorizationRuleProperties properties) {
return createOrUpdateAuthorizationRuleWithServiceResponseAsync(resourc... | [
"public",
"SharedAccessAuthorizationRuleResourceInner",
"createOrUpdateAuthorizationRule",
"(",
"String",
"resourceGroupName",
",",
"String",
"namespaceName",
",",
"String",
"notificationHubName",
",",
"String",
"authorizationRuleName",
",",
"SharedAccessAuthorizationRuleProperties",... | Creates/Updates an authorization rule for a NotificationHub.
@param resourceGroupName The name of the resource group.
@param namespaceName The namespace name.
@param notificationHubName The notification hub name.
@param authorizationRuleName Authorization Rule Name.
@param properties Properties of the Namespace Author... | [
"Creates",
"/",
"Updates",
"an",
"authorization",
"rule",
"for",
"a",
"NotificationHub",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/NotificationHubsInner.java#L901-L903 |
bazaarvoice/emodb | common/client/src/main/java/com/bazaarvoice/emodb/client/uri/EmoUriComponent.java | EmoUriComponent.decodePathSegment | public static void decodePathSegment(List<PathSegment> segments, String segment, boolean decode) {
int colon = segment.indexOf(';');
if (colon != -1) {
segments.add(new PathSegmentImpl(
(colon == 0) ? "" : segment.substring(0, colon),
decode,
... | java | public static void decodePathSegment(List<PathSegment> segments, String segment, boolean decode) {
int colon = segment.indexOf(';');
if (colon != -1) {
segments.add(new PathSegmentImpl(
(colon == 0) ? "" : segment.substring(0, colon),
decode,
... | [
"public",
"static",
"void",
"decodePathSegment",
"(",
"List",
"<",
"PathSegment",
">",
"segments",
",",
"String",
"segment",
",",
"boolean",
"decode",
")",
"{",
"int",
"colon",
"=",
"segment",
".",
"indexOf",
"(",
"'",
"'",
")",
";",
"if",
"(",
"colon",
... | Decode the path segment and add it to the list of path segments.
@param segments mutable list of path segments.
@param segment path segment to be decoded.
@param decode {@code true} if the path segment should be in a decoded form. | [
"Decode",
"the",
"path",
"segment",
"and",
"add",
"it",
"to",
"the",
"list",
"of",
"path",
"segments",
"."
] | train | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/common/client/src/main/java/com/bazaarvoice/emodb/client/uri/EmoUriComponent.java#L648-L660 |
threerings/nenya | core/src/main/java/com/threerings/media/image/TransformedMirage.java | TransformedMirage.computeTransformedBounds | protected void computeTransformedBounds ()
{
int w = _base.getWidth();
int h = _base.getHeight();
Point[] points = new Point[] {
new Point(0, 0), new Point(w, 0), new Point(0, h), new Point(w, h) };
_transform.transform(points, 0, points, 0, 4);
int minX, minY, ma... | java | protected void computeTransformedBounds ()
{
int w = _base.getWidth();
int h = _base.getHeight();
Point[] points = new Point[] {
new Point(0, 0), new Point(w, 0), new Point(0, h), new Point(w, h) };
_transform.transform(points, 0, points, 0, 4);
int minX, minY, ma... | [
"protected",
"void",
"computeTransformedBounds",
"(",
")",
"{",
"int",
"w",
"=",
"_base",
".",
"getWidth",
"(",
")",
";",
"int",
"h",
"=",
"_base",
".",
"getHeight",
"(",
")",
";",
"Point",
"[",
"]",
"points",
"=",
"new",
"Point",
"[",
"]",
"{",
"n... | Compute the bounds of the base Mirage after it has been transformed. | [
"Compute",
"the",
"bounds",
"of",
"the",
"base",
"Mirage",
"after",
"it",
"has",
"been",
"transformed",
"."
] | train | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/image/TransformedMirage.java#L122-L140 |
kaazing/gateway | resource.address/spi/src/main/java/org/kaazing/gateway/resource/address/uri/URIUtils.java | URIUtils.buildURIAsString | public static String buildURIAsString(String scheme, String userInfo,
String host, int port, String path, String query, String fragment) throws URISyntaxException {
URI helperURI;
try {
helperURI = new URI(scheme, userInfo, host, port, path, query, fragment);
} catch (URI... | java | public static String buildURIAsString(String scheme, String userInfo,
String host, int port, String path, String query, String fragment) throws URISyntaxException {
URI helperURI;
try {
helperURI = new URI(scheme, userInfo, host, port, path, query, fragment);
} catch (URI... | [
"public",
"static",
"String",
"buildURIAsString",
"(",
"String",
"scheme",
",",
"String",
"userInfo",
",",
"String",
"host",
",",
"int",
"port",
",",
"String",
"path",
",",
"String",
"query",
",",
"String",
"fragment",
")",
"throws",
"URISyntaxException",
"{",... | Helper method for building URI as String
@param scheme
@param userInfo
@param host
@param port
@param path
@param query
@param fragment
@return
@throws URISyntaxException | [
"Helper",
"method",
"for",
"building",
"URI",
"as",
"String"
] | train | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/resource.address/spi/src/main/java/org/kaazing/gateway/resource/address/uri/URIUtils.java#L245-L254 |
FXMisc/WellBehavedFX | src/main/java/org/fxmisc/wellbehaved/event/template/InputMapTemplate.java | InputMapTemplate.installOverride | public static <S, N extends Node, E extends Event> void installOverride(InputMapTemplate<S, E> imt, S target, Function<? super S, ? extends N> getNode) {
Nodes.addInputMap(getNode.apply(target), imt.instantiate(target));
} | java | public static <S, N extends Node, E extends Event> void installOverride(InputMapTemplate<S, E> imt, S target, Function<? super S, ? extends N> getNode) {
Nodes.addInputMap(getNode.apply(target), imt.instantiate(target));
} | [
"public",
"static",
"<",
"S",
",",
"N",
"extends",
"Node",
",",
"E",
"extends",
"Event",
">",
"void",
"installOverride",
"(",
"InputMapTemplate",
"<",
"S",
",",
"E",
">",
"imt",
",",
"S",
"target",
",",
"Function",
"<",
"?",
"super",
"S",
",",
"?",
... | Instantiates the input map and installs it into the node via {@link Nodes#addInputMap(Node, InputMap)} | [
"Instantiates",
"the",
"input",
"map",
"and",
"installs",
"it",
"into",
"the",
"node",
"via",
"{"
] | train | https://github.com/FXMisc/WellBehavedFX/blob/ca889734481f5439655ca8deb6f742964b5654b0/src/main/java/org/fxmisc/wellbehaved/event/template/InputMapTemplate.java#L378-L380 |
pac4j/pac4j | pac4j-config/src/main/java/org/pac4j/config/ldaptive/LdaptiveAuthenticatorBuilder.java | LdaptiveAuthenticatorBuilder.newBlockingConnectionPool | public static ConnectionPool newBlockingConnectionPool(final AbstractLdapProperties l) {
final DefaultConnectionFactory bindCf = newConnectionFactory(l);
final PoolConfig pc = newPoolConfig(l);
final BlockingConnectionPool cp = new BlockingConnectionPool(pc, bindCf);
cp.setBlockWaitTime... | java | public static ConnectionPool newBlockingConnectionPool(final AbstractLdapProperties l) {
final DefaultConnectionFactory bindCf = newConnectionFactory(l);
final PoolConfig pc = newPoolConfig(l);
final BlockingConnectionPool cp = new BlockingConnectionPool(pc, bindCf);
cp.setBlockWaitTime... | [
"public",
"static",
"ConnectionPool",
"newBlockingConnectionPool",
"(",
"final",
"AbstractLdapProperties",
"l",
")",
"{",
"final",
"DefaultConnectionFactory",
"bindCf",
"=",
"newConnectionFactory",
"(",
"l",
")",
";",
"final",
"PoolConfig",
"pc",
"=",
"newPoolConfig",
... | New blocking connection pool connection pool.
@param l the l
@return the connection pool | [
"New",
"blocking",
"connection",
"pool",
"connection",
"pool",
"."
] | train | https://github.com/pac4j/pac4j/blob/d9cd029f8783792b31dd48bf1e32f80628f2c4a3/pac4j-config/src/main/java/org/pac4j/config/ldaptive/LdaptiveAuthenticatorBuilder.java#L281-L319 |
synchronoss/cpo-api | cpo-cassandra/src/main/java/org/synchronoss/cpo/cassandra/CassandraCpoAdapter.java | CassandraCpoAdapter.executeObject | @Override
public <T> T executeObject(String name, T object) throws CpoException {
throw new UnsupportedOperationException("Execute Functions not supported in Cassandra");
} | java | @Override
public <T> T executeObject(String name, T object) throws CpoException {
throw new UnsupportedOperationException("Execute Functions not supported in Cassandra");
} | [
"@",
"Override",
"public",
"<",
"T",
">",
"T",
"executeObject",
"(",
"String",
"name",
",",
"T",
"object",
")",
"throws",
"CpoException",
"{",
"throw",
"new",
"UnsupportedOperationException",
"(",
"\"Execute Functions not supported in Cassandra\"",
")",
";",
"}"
] | Executes an Object whose metadata will call an executable within the datasource. It is assumed that the executable
object exists in the metadatasource. If the executable does not exist, an exception will be thrown.
<p/>
<pre>Example:
<code>
<p/>
class SomeObject so = new SomeObject();
class CpoAdapter cpo = null;
<p/>
... | [
"Executes",
"an",
"Object",
"whose",
"metadata",
"will",
"call",
"an",
"executable",
"within",
"the",
"datasource",
".",
"It",
"is",
"assumed",
"that",
"the",
"executable",
"object",
"exists",
"in",
"the",
"metadatasource",
".",
"If",
"the",
"executable",
"doe... | train | https://github.com/synchronoss/cpo-api/blob/dc745aca3b3206abf80b85d9689b0132f5baa694/cpo-cassandra/src/main/java/org/synchronoss/cpo/cassandra/CassandraCpoAdapter.java#L765-L768 |
apiman/apiman | gateway/engine/core/src/main/java/io/apiman/gateway/engine/impl/AbstractEngineFactory.java | AbstractEngineFactory.createEngine | @Override
public final IEngine createEngine() {
IPluginRegistry pluginRegistry = createPluginRegistry();
IDataEncrypter encrypter = createDataEncrypter(pluginRegistry);
CurrentDataEncrypter.instance = encrypter;
IRegistry registry = createRegistry(pluginRegistry, encrypter);
... | java | @Override
public final IEngine createEngine() {
IPluginRegistry pluginRegistry = createPluginRegistry();
IDataEncrypter encrypter = createDataEncrypter(pluginRegistry);
CurrentDataEncrypter.instance = encrypter;
IRegistry registry = createRegistry(pluginRegistry, encrypter);
... | [
"@",
"Override",
"public",
"final",
"IEngine",
"createEngine",
"(",
")",
"{",
"IPluginRegistry",
"pluginRegistry",
"=",
"createPluginRegistry",
"(",
")",
";",
"IDataEncrypter",
"encrypter",
"=",
"createDataEncrypter",
"(",
"pluginRegistry",
")",
";",
"CurrentDataEncry... | Call this to create a new engine. This method uses the engine
config singleton to create the engine. | [
"Call",
"this",
"to",
"create",
"a",
"new",
"engine",
".",
"This",
"method",
"uses",
"the",
"engine",
"config",
"singleton",
"to",
"create",
"the",
"engine",
"."
] | train | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/engine/core/src/main/java/io/apiman/gateway/engine/impl/AbstractEngineFactory.java#L51-L71 |
khuxtable/seaglass | src/main/java/com/seaglasslookandfeel/painter/CheckBoxMenuItemPainter.java | CheckBoxMenuItemPainter.paintCheckIconEnabledAndSelected | private void paintCheckIconEnabledAndSelected(Graphics2D g, int width, int height) {
Shape s = shapeGenerator.createCheckMark(0, 0, width, height);
g.setPaint(iconEnabledSelected);
g.fill(s);
} | java | private void paintCheckIconEnabledAndSelected(Graphics2D g, int width, int height) {
Shape s = shapeGenerator.createCheckMark(0, 0, width, height);
g.setPaint(iconEnabledSelected);
g.fill(s);
} | [
"private",
"void",
"paintCheckIconEnabledAndSelected",
"(",
"Graphics2D",
"g",
",",
"int",
"width",
",",
"int",
"height",
")",
"{",
"Shape",
"s",
"=",
"shapeGenerator",
".",
"createCheckMark",
"(",
"0",
",",
"0",
",",
"width",
",",
"height",
")",
";",
"g",... | Paint the check mark in enabled state.
@param g the Graphics2D context to paint with.
@param width the width.
@param height the height. | [
"Paint",
"the",
"check",
"mark",
"in",
"enabled",
"state",
"."
] | train | https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/painter/CheckBoxMenuItemPainter.java#L147-L151 |
DataSketches/sketches-core | src/main/java/com/yahoo/sketches/cpc/CpcSketch.java | CpcSketch.updateHIP | private static void updateHIP(final CpcSketch sketch, final int rowCol) {
final int k = 1 << sketch.lgK;
final int col = rowCol & 63;
final double oneOverP = k / sketch.kxp;
sketch.hipEstAccum += oneOverP;
sketch.kxp -= invPow2(col + 1); // notice the "+1"
} | java | private static void updateHIP(final CpcSketch sketch, final int rowCol) {
final int k = 1 << sketch.lgK;
final int col = rowCol & 63;
final double oneOverP = k / sketch.kxp;
sketch.hipEstAccum += oneOverP;
sketch.kxp -= invPow2(col + 1); // notice the "+1"
} | [
"private",
"static",
"void",
"updateHIP",
"(",
"final",
"CpcSketch",
"sketch",
",",
"final",
"int",
"rowCol",
")",
"{",
"final",
"int",
"k",
"=",
"1",
"<<",
"sketch",
".",
"lgK",
";",
"final",
"int",
"col",
"=",
"rowCol",
"&",
"63",
";",
"final",
"do... | Call this whenever a new coupon has been collected.
@param sketch the given sketch
@param rowCol the given row / column | [
"Call",
"this",
"whenever",
"a",
"new",
"coupon",
"has",
"been",
"collected",
"."
] | train | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/cpc/CpcSketch.java#L559-L565 |
j256/ormlite-core | src/main/java/com/j256/ormlite/support/BaseConnectionSource.java | BaseConnectionSource.clearSpecial | protected boolean clearSpecial(DatabaseConnection connection, Logger logger) {
NestedConnection currentSaved = specialConnection.get();
boolean cleared = false;
if (connection == null) {
// ignored
} else if (currentSaved == null) {
logger.error("no connection has been saved when clear() called");
} els... | java | protected boolean clearSpecial(DatabaseConnection connection, Logger logger) {
NestedConnection currentSaved = specialConnection.get();
boolean cleared = false;
if (connection == null) {
// ignored
} else if (currentSaved == null) {
logger.error("no connection has been saved when clear() called");
} els... | [
"protected",
"boolean",
"clearSpecial",
"(",
"DatabaseConnection",
"connection",
",",
"Logger",
"logger",
")",
"{",
"NestedConnection",
"currentSaved",
"=",
"specialConnection",
".",
"get",
"(",
")",
";",
"boolean",
"cleared",
"=",
"false",
";",
"if",
"(",
"conn... | Clear the connection that was previously saved.
@return True if the connection argument had been saved. | [
"Clear",
"the",
"connection",
"that",
"was",
"previously",
"saved",
"."
] | train | https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/support/BaseConnectionSource.java#L80-L98 |
google/truth | extensions/proto/src/main/java/com/google/common/truth/extensions/proto/MapWithProtoValuesSubject.java | MapWithProtoValuesSubject.containsExactly | @CanIgnoreReturnValue
public Ordered containsExactly(@NullableDecl Object k0, @NullableDecl Object v0, Object... rest) {
return delegate().containsExactly(k0, v0, rest);
} | java | @CanIgnoreReturnValue
public Ordered containsExactly(@NullableDecl Object k0, @NullableDecl Object v0, Object... rest) {
return delegate().containsExactly(k0, v0, rest);
} | [
"@",
"CanIgnoreReturnValue",
"public",
"Ordered",
"containsExactly",
"(",
"@",
"NullableDecl",
"Object",
"k0",
",",
"@",
"NullableDecl",
"Object",
"v0",
",",
"Object",
"...",
"rest",
")",
"{",
"return",
"delegate",
"(",
")",
".",
"containsExactly",
"(",
"k0",
... | Fails if the map does not contain exactly the given set of key/value pairs.
<p><b>Warning:</b> the use of varargs means that we cannot guarantee an equal number of
key/value pairs at compile time. Please make sure you provide varargs in key/value pairs! | [
"Fails",
"if",
"the",
"map",
"does",
"not",
"contain",
"exactly",
"the",
"given",
"set",
"of",
"key",
"/",
"value",
"pairs",
"."
] | train | https://github.com/google/truth/blob/60eceffd2e8c3297655d33ed87d965cf5af51108/extensions/proto/src/main/java/com/google/common/truth/extensions/proto/MapWithProtoValuesSubject.java#L163-L166 |
kejunxia/AndroidMvc | extension/service-mediastore/src/main/java/com/shipdream/lib/android/mvc/service/internal/MediaStoreServiceImpl.java | MediaStoreServiceImpl.extractOneVideoFromCursor | protected VideoDTO extractOneVideoFromCursor(Cursor cursor) {
if(videoIdCol == -1) {
videoIdCol = cursor.getColumnIndexOrThrow(MediaStore.Video.Media._ID);
videoTitleCol = cursor.getColumnIndexOrThrow(MediaStore.Video.Media.TITLE);
videoDisplayNameCol = cursor.getColumnIndexO... | java | protected VideoDTO extractOneVideoFromCursor(Cursor cursor) {
if(videoIdCol == -1) {
videoIdCol = cursor.getColumnIndexOrThrow(MediaStore.Video.Media._ID);
videoTitleCol = cursor.getColumnIndexOrThrow(MediaStore.Video.Media.TITLE);
videoDisplayNameCol = cursor.getColumnIndexO... | [
"protected",
"VideoDTO",
"extractOneVideoFromCursor",
"(",
"Cursor",
"cursor",
")",
"{",
"if",
"(",
"videoIdCol",
"==",
"-",
"1",
")",
"{",
"videoIdCol",
"=",
"cursor",
".",
"getColumnIndexOrThrow",
"(",
"MediaStore",
".",
"Video",
".",
"Media",
".",
"_ID",
... | Extract one videoDTO from the given cursor from its current position
@param cursor
@return | [
"Extract",
"one",
"videoDTO",
"from",
"the",
"given",
"cursor",
"from",
"its",
"current",
"position"
] | train | https://github.com/kejunxia/AndroidMvc/blob/c7893f0a13119d64297b9eb2988f7323b7da5bbc/extension/service-mediastore/src/main/java/com/shipdream/lib/android/mvc/service/internal/MediaStoreServiceImpl.java#L464-L517 |
line/armeria | core/src/main/java/com/linecorp/armeria/client/endpoint/healthcheck/HttpHealthCheckedEndpointGroup.java | HttpHealthCheckedEndpointGroup.of | @Deprecated
public static HttpHealthCheckedEndpointGroup of(EndpointGroup delegate,
String healthCheckPath,
Duration healthCheckRetryInterval) {
return of(ClientFactory.DEFAULT, delegate, healthCheckPath,... | java | @Deprecated
public static HttpHealthCheckedEndpointGroup of(EndpointGroup delegate,
String healthCheckPath,
Duration healthCheckRetryInterval) {
return of(ClientFactory.DEFAULT, delegate, healthCheckPath,... | [
"@",
"Deprecated",
"public",
"static",
"HttpHealthCheckedEndpointGroup",
"of",
"(",
"EndpointGroup",
"delegate",
",",
"String",
"healthCheckPath",
",",
"Duration",
"healthCheckRetryInterval",
")",
"{",
"return",
"of",
"(",
"ClientFactory",
".",
"DEFAULT",
",",
"delega... | Creates a new {@link HttpHealthCheckedEndpointGroup} instance.
@deprecated Use {@link HttpHealthCheckedEndpointGroupBuilder}. | [
"Creates",
"a",
"new",
"{",
"@link",
"HttpHealthCheckedEndpointGroup",
"}",
"instance",
"."
] | train | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/client/endpoint/healthcheck/HttpHealthCheckedEndpointGroup.java#L53-L58 |
Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/BeatFinder.java | BeatFinder.deliverMasterYieldResponse | private void deliverMasterYieldResponse(int fromPlayer, boolean yielded) {
for (final MasterHandoffListener listener : getMasterHandoffListeners()) {
try {
listener.yieldResponse(fromPlayer, yielded);
} catch (Throwable t) {
logger.warn("Problem delivering... | java | private void deliverMasterYieldResponse(int fromPlayer, boolean yielded) {
for (final MasterHandoffListener listener : getMasterHandoffListeners()) {
try {
listener.yieldResponse(fromPlayer, yielded);
} catch (Throwable t) {
logger.warn("Problem delivering... | [
"private",
"void",
"deliverMasterYieldResponse",
"(",
"int",
"fromPlayer",
",",
"boolean",
"yielded",
")",
"{",
"for",
"(",
"final",
"MasterHandoffListener",
"listener",
":",
"getMasterHandoffListeners",
"(",
")",
")",
"{",
"try",
"{",
"listener",
".",
"yieldRespo... | Send a master handoff yield response to all registered listeners.
@param fromPlayer the device number that is responding to our request that it yield the tempo master role to us
@param yielded will be {@code true} if we should now be the tempo master | [
"Send",
"a",
"master",
"handoff",
"yield",
"response",
"to",
"all",
"registered",
"listeners",
"."
] | train | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/BeatFinder.java#L439-L447 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/util/JsonUtil.java | JsonUtil.getFloat | public static float getFloat(JsonObject object, String field) {
final JsonValue value = object.get(field);
throwExceptionIfNull(value, field);
return value.asFloat();
} | java | public static float getFloat(JsonObject object, String field) {
final JsonValue value = object.get(field);
throwExceptionIfNull(value, field);
return value.asFloat();
} | [
"public",
"static",
"float",
"getFloat",
"(",
"JsonObject",
"object",
",",
"String",
"field",
")",
"{",
"final",
"JsonValue",
"value",
"=",
"object",
".",
"get",
"(",
"field",
")",
";",
"throwExceptionIfNull",
"(",
"value",
",",
"field",
")",
";",
"return"... | Returns a field in a Json object as a float.
Throws IllegalArgumentException if the field value is null.
@param object the Json Object
@param field the field in the Json object to return
@return the Json field value as a float | [
"Returns",
"a",
"field",
"in",
"a",
"Json",
"object",
"as",
"a",
"float",
".",
"Throws",
"IllegalArgumentException",
"if",
"the",
"field",
"value",
"is",
"null",
"."
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/util/JsonUtil.java#L137-L141 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/JsApiMessageImpl.java | JsApiMessageImpl.getJmsUserPropertyMap | final JsMsgMap getJmsUserPropertyMap() {
if (jmsUserPropertyMap == null) {
List<String> keys = (List<String>) getApi().getField(JsApiAccess.JMSPROPERTY_NAME);
List<Object> values = (List<Object>) getApi().getField(JsApiAccess.JMSPROPERTY_VALUE);
jmsUserPropertyMap = new JsMsg... | java | final JsMsgMap getJmsUserPropertyMap() {
if (jmsUserPropertyMap == null) {
List<String> keys = (List<String>) getApi().getField(JsApiAccess.JMSPROPERTY_NAME);
List<Object> values = (List<Object>) getApi().getField(JsApiAccess.JMSPROPERTY_VALUE);
jmsUserPropertyMap = new JsMsg... | [
"final",
"JsMsgMap",
"getJmsUserPropertyMap",
"(",
")",
"{",
"if",
"(",
"jmsUserPropertyMap",
"==",
"null",
")",
"{",
"List",
"<",
"String",
">",
"keys",
"=",
"(",
"List",
"<",
"String",
">",
")",
"getApi",
"(",
")",
".",
"getField",
"(",
"JsApiAccess",
... | Helper method used by the main Message Property methods to obtain the
JMS-valid Property items in the form of a map.
<p>
The method has package level visibility as it is used by JsJmsMessageImpl
and JsSdoMessageimpl.
@return A JsMsgMap containing the Message Property name-value pairs. | [
"Helper",
"method",
"used",
"by",
"the",
"main",
"Message",
"Property",
"methods",
"to",
"obtain",
"the",
"JMS",
"-",
"valid",
"Property",
"items",
"in",
"the",
"form",
"of",
"a",
"map",
".",
"<p",
">",
"The",
"method",
"has",
"package",
"level",
"visibi... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/JsApiMessageImpl.java#L815-L822 |
dvasilen/Hive-XML-SerDe | src/main/java/com/ibm/spss/hive/serde2/xml/processor/java/JavaXmlProcessor.java | JavaXmlProcessor.populateMap | @SuppressWarnings({"unchecked", "rawtypes"})
private void populateMap(Map map, Node node) {
Map.Entry entry = getMapEntry(node);
if (entry != null) {
map.put(entry.getKey(), entry.getValue());
}
} | java | @SuppressWarnings({"unchecked", "rawtypes"})
private void populateMap(Map map, Node node) {
Map.Entry entry = getMapEntry(node);
if (entry != null) {
map.put(entry.getKey(), entry.getValue());
}
} | [
"@",
"SuppressWarnings",
"(",
"{",
"\"unchecked\"",
",",
"\"rawtypes\"",
"}",
")",
"private",
"void",
"populateMap",
"(",
"Map",
"map",
",",
"Node",
"node",
")",
"{",
"Map",
".",
"Entry",
"entry",
"=",
"getMapEntry",
"(",
"node",
")",
";",
"if",
"(",
"... | Given the node populates the map
@param map
the map
@param node
the node | [
"Given",
"the",
"node",
"populates",
"the",
"map"
] | train | https://github.com/dvasilen/Hive-XML-SerDe/blob/2a7a184b2cfaeb63008529a9851cd72edb8025d9/src/main/java/com/ibm/spss/hive/serde2/xml/processor/java/JavaXmlProcessor.java#L385-L391 |
Wadpam/guja | guja-core/src/main/java/com/wadpam/guja/oauth2/dao/GeneratedDUserDaoImpl.java | GeneratedDUserDaoImpl.queryByState | public Iterable<DUser> queryByState(java.lang.Integer state) {
return queryByField(null, DUserMapper.Field.STATE.getFieldName(), state);
} | java | public Iterable<DUser> queryByState(java.lang.Integer state) {
return queryByField(null, DUserMapper.Field.STATE.getFieldName(), state);
} | [
"public",
"Iterable",
"<",
"DUser",
">",
"queryByState",
"(",
"java",
".",
"lang",
".",
"Integer",
"state",
")",
"{",
"return",
"queryByField",
"(",
"null",
",",
"DUserMapper",
".",
"Field",
".",
"STATE",
".",
"getFieldName",
"(",
")",
",",
"state",
")",... | query-by method for field state
@param state the specified attribute
@return an Iterable of DUsers for the specified state | [
"query",
"-",
"by",
"method",
"for",
"field",
"state"
] | train | https://github.com/Wadpam/guja/blob/eb8ba8e6794a96ea0dd9744cada4f9ad9618f114/guja-core/src/main/java/com/wadpam/guja/oauth2/dao/GeneratedDUserDaoImpl.java#L232-L234 |
tango-controls/JTango | client/src/main/java/fr/soleil/tango/clientapi/util/TypeConversionUtil.java | TypeConversionUtil.castToArray | public static <T> Object castToArray(final Class<T> type, final Object val) throws DevFailed {
Object result = null;
final Object array1D = val;
if (val == null || type.isAssignableFrom(val.getClass())) {
result = val;
} else {
LOGGER.debug("converting {} to {}", val.getClass().getCanonicalName(), type.ge... | java | public static <T> Object castToArray(final Class<T> type, final Object val) throws DevFailed {
Object result = null;
final Object array1D = val;
if (val == null || type.isAssignableFrom(val.getClass())) {
result = val;
} else {
LOGGER.debug("converting {} to {}", val.getClass().getCanonicalName(), type.ge... | [
"public",
"static",
"<",
"T",
">",
"Object",
"castToArray",
"(",
"final",
"Class",
"<",
"T",
">",
"type",
",",
"final",
"Object",
"val",
")",
"throws",
"DevFailed",
"{",
"Object",
"result",
"=",
"null",
";",
"final",
"Object",
"array1D",
"=",
"val",
";... | Convert an array of primitives or Objects like double[][] or Double[] into the requested type. 2D array will be
converted to a 1D array
@param <T>
@param type
the componant type
@param val
@return
@throws DevFailed | [
"Convert",
"an",
"array",
"of",
"primitives",
"or",
"Objects",
"like",
"double",
"[]",
"[]",
"or",
"Double",
"[]",
"into",
"the",
"requested",
"type",
".",
"2D",
"array",
"will",
"be",
"converted",
"to",
"a",
"1D",
"array"
] | train | https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/client/src/main/java/fr/soleil/tango/clientapi/util/TypeConversionUtil.java#L65-L82 |
GeoLatte/geolatte-common | src/main/java/org/geolatte/common/dataformats/json/jackson/MultiLineStringSerializer.java | MultiLineStringSerializer.writeShapeSpecificSerialization | @Override
public void writeShapeSpecificSerialization(MultiLineString value, JsonGenerator jgen, SerializerProvider provider)
throws IOException {
jgen.writeFieldName( "type");
jgen.writeString( "MultiLineString");
jgen.writeArrayFieldStart( "coordinates");
// set beanproperty to null since w... | java | @Override
public void writeShapeSpecificSerialization(MultiLineString value, JsonGenerator jgen, SerializerProvider provider)
throws IOException {
jgen.writeFieldName( "type");
jgen.writeString( "MultiLineString");
jgen.writeArrayFieldStart( "coordinates");
// set beanproperty to null since w... | [
"@",
"Override",
"public",
"void",
"writeShapeSpecificSerialization",
"(",
"MultiLineString",
"value",
",",
"JsonGenerator",
"jgen",
",",
"SerializerProvider",
"provider",
")",
"throws",
"IOException",
"{",
"jgen",
".",
"writeFieldName",
"(",
"\"type\"",
")",
";",
"... | Method that can be called to ask implementation to serialize values of type this serializer handles.
@param value Value to serialize; can not be null.
@param jgen Generator used to output resulting Json content
@param provider Provider that can be used to get serializers for serializing Objects value contains, if any.
... | [
"Method",
"that",
"can",
"be",
"called",
"to",
"ask",
"implementation",
"to",
"serialize",
"values",
"of",
"type",
"this",
"serializer",
"handles",
"."
] | train | https://github.com/GeoLatte/geolatte-common/blob/dc7f92b04d8c6cb706e78cb95e746d8f12089d95/src/main/java/org/geolatte/common/dataformats/json/jackson/MultiLineStringSerializer.java#L61-L82 |
alkacon/opencms-core | src/org/opencms/ui/apps/modules/CmsModuleApp.java | CmsModuleApp.openReport | public void openReport(String newState, A_CmsReportThread thread, String label) {
setReport(newState, thread);
m_labels.put(thread, label);
openSubView(newState, true);
} | java | public void openReport(String newState, A_CmsReportThread thread, String label) {
setReport(newState, thread);
m_labels.put(thread, label);
openSubView(newState, true);
} | [
"public",
"void",
"openReport",
"(",
"String",
"newState",
",",
"A_CmsReportThread",
"thread",
",",
"String",
"label",
")",
"{",
"setReport",
"(",
"newState",
",",
"thread",
")",
";",
"m_labels",
".",
"put",
"(",
"thread",
",",
"label",
")",
";",
"openSubV... | Changes to a new sub-view and stores a report to be displayed by that subview.<p<
@param newState the new state
@param thread the report thread which should be displayed in the sub view
@param label the label to display for the report | [
"Changes",
"to",
"a",
"new",
"sub",
"-",
"view",
"and",
"stores",
"a",
"report",
"to",
"be",
"displayed",
"by",
"that",
"subview",
".",
"<p<"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/apps/modules/CmsModuleApp.java#L667-L672 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/util/ConcurrencyUtil.java | ConcurrencyUtil.setMax | public static <E> void setMax(E obj, AtomicLongFieldUpdater<E> updater, long value) {
for (; ; ) {
long current = updater.get(obj);
if (current >= value) {
return;
}
if (updater.compareAndSet(obj, current, value)) {
return;
... | java | public static <E> void setMax(E obj, AtomicLongFieldUpdater<E> updater, long value) {
for (; ; ) {
long current = updater.get(obj);
if (current >= value) {
return;
}
if (updater.compareAndSet(obj, current, value)) {
return;
... | [
"public",
"static",
"<",
"E",
">",
"void",
"setMax",
"(",
"E",
"obj",
",",
"AtomicLongFieldUpdater",
"<",
"E",
">",
"updater",
",",
"long",
"value",
")",
"{",
"for",
"(",
";",
";",
")",
"{",
"long",
"current",
"=",
"updater",
".",
"get",
"(",
"obj"... | Atomically sets the max value.
If the current value is larger than the provided value, the call is ignored.
So it will not happen that a smaller value will overwrite a larger value. | [
"Atomically",
"sets",
"the",
"max",
"value",
"."
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/util/ConcurrencyUtil.java#L56-L67 |
paypal/SeLion | client/src/main/java/com/paypal/selion/configuration/ListenerInfo.java | ListenerInfo.getBooleanValFromVMArg | static boolean getBooleanValFromVMArg(String vmArgValue, boolean defaultStateWhenNotDefined) {
String sysProperty = System.getProperty(vmArgValue);
boolean flag = defaultStateWhenNotDefined;
if ((sysProperty != null) && (!sysProperty.isEmpty())) {
flag = Boolean.parseBoolean(sysPrope... | java | static boolean getBooleanValFromVMArg(String vmArgValue, boolean defaultStateWhenNotDefined) {
String sysProperty = System.getProperty(vmArgValue);
boolean flag = defaultStateWhenNotDefined;
if ((sysProperty != null) && (!sysProperty.isEmpty())) {
flag = Boolean.parseBoolean(sysPrope... | [
"static",
"boolean",
"getBooleanValFromVMArg",
"(",
"String",
"vmArgValue",
",",
"boolean",
"defaultStateWhenNotDefined",
")",
"{",
"String",
"sysProperty",
"=",
"System",
".",
"getProperty",
"(",
"vmArgValue",
")",
";",
"boolean",
"flag",
"=",
"defaultStateWhenNotDef... | Returns boolean value of the JVM argument when defined, else returns the {@code defaultStateWhenNotDefined}.
@param vmArgValue
The VM argument name.
@param defaultStateWhenNotDefined
A boolean to indicate default state of the listener. | [
"Returns",
"boolean",
"value",
"of",
"the",
"JVM",
"argument",
"when",
"defined",
"else",
"returns",
"the",
"{",
"@code",
"defaultStateWhenNotDefined",
"}",
"."
] | train | https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/client/src/main/java/com/paypal/selion/configuration/ListenerInfo.java#L95-L102 |
gsi-upm/Shanks | shanks-core/src/main/java/es/upm/dit/gsi/shanks/model/scenario/portrayal/Scenario3DPortrayal.java | Scenario3DPortrayal.situateDevice | public void situateDevice(Device d, double x, double y, double z) {
devices.setObjectLocation(d, new Double3D(x, y, z));
} | java | public void situateDevice(Device d, double x, double y, double z) {
devices.setObjectLocation(d, new Double3D(x, y, z));
} | [
"public",
"void",
"situateDevice",
"(",
"Device",
"d",
",",
"double",
"x",
",",
"double",
"y",
",",
"double",
"z",
")",
"{",
"devices",
".",
"setObjectLocation",
"(",
"d",
",",
"new",
"Double3D",
"(",
"x",
",",
"y",
",",
"z",
")",
")",
";",
"}"
] | To place a device in the simulation
@param d
@param x
@param y
@param z | [
"To",
"place",
"a",
"device",
"in",
"the",
"simulation"
] | train | https://github.com/gsi-upm/Shanks/blob/35d87a81c22731f4f83bbd0571c9c6d466bd16be/shanks-core/src/main/java/es/upm/dit/gsi/shanks/model/scenario/portrayal/Scenario3DPortrayal.java#L181-L183 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WFieldLayoutRenderer.java | WFieldLayoutRenderer.doRender | @Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
WFieldLayout fieldLayout = (WFieldLayout) component;
XmlStringBuilder xml = renderContext.getWriter();
int labelWidth = fieldLayout.getLabelWidth();
String title = fieldLayout.getTitle();
xml.appendTagOpen(... | java | @Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
WFieldLayout fieldLayout = (WFieldLayout) component;
XmlStringBuilder xml = renderContext.getWriter();
int labelWidth = fieldLayout.getLabelWidth();
String title = fieldLayout.getTitle();
xml.appendTagOpen(... | [
"@",
"Override",
"public",
"void",
"doRender",
"(",
"final",
"WComponent",
"component",
",",
"final",
"WebXmlRenderContext",
"renderContext",
")",
"{",
"WFieldLayout",
"fieldLayout",
"=",
"(",
"WFieldLayout",
")",
"component",
";",
"XmlStringBuilder",
"xml",
"=",
... | Paints the given WFieldLayout.
@param component the WFieldLayout to paint.
@param renderContext the RenderContext to paint to. | [
"Paints",
"the",
"given",
"WFieldLayout",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WFieldLayoutRenderer.java#L23-L51 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java | DefaultGroovyMethods.collectNested | public static List collectNested(Iterable self, Closure transform) {
return (List) collectNested(self, new ArrayList(), transform);
} | java | public static List collectNested(Iterable self, Closure transform) {
return (List) collectNested(self, new ArrayList(), transform);
} | [
"public",
"static",
"List",
"collectNested",
"(",
"Iterable",
"self",
",",
"Closure",
"transform",
")",
"{",
"return",
"(",
"List",
")",
"collectNested",
"(",
"self",
",",
"new",
"ArrayList",
"(",
")",
",",
"transform",
")",
";",
"}"
] | Recursively iterates through this Iterable transforming each non-Collection value
into a new value using the closure as a transformer. Returns a potentially nested
list of transformed values.
<pre class="groovyTestCase">
assert [2,[4,6],[8],[]] == [1,[2,3],[4],[]].collectNested { it * 2 }
</pre>
@param self an It... | [
"Recursively",
"iterates",
"through",
"this",
"Iterable",
"transforming",
"each",
"non",
"-",
"Collection",
"value",
"into",
"a",
"new",
"value",
"using",
"the",
"closure",
"as",
"a",
"transformer",
".",
"Returns",
"a",
"potentially",
"nested",
"list",
"of",
"... | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L3703-L3705 |
querydsl/querydsl | querydsl-sql/src/main/java/com/querydsl/sql/mysql/AbstractMySQLQuery.java | AbstractMySQLQuery.smallResult | @WithBridgeMethods(value = MySQLQuery.class, castRequired = true)
public C smallResult() {
return addFlag(Position.AFTER_SELECT, SQL_SMALL_RESULT);
} | java | @WithBridgeMethods(value = MySQLQuery.class, castRequired = true)
public C smallResult() {
return addFlag(Position.AFTER_SELECT, SQL_SMALL_RESULT);
} | [
"@",
"WithBridgeMethods",
"(",
"value",
"=",
"MySQLQuery",
".",
"class",
",",
"castRequired",
"=",
"true",
")",
"public",
"C",
"smallResult",
"(",
")",
"{",
"return",
"addFlag",
"(",
"Position",
".",
"AFTER_SELECT",
",",
"SQL_SMALL_RESULT",
")",
";",
"}"
] | For SQL_SMALL_RESULT, MySQL uses fast temporary tables to store the resulting table instead
of using sorting. This should not normally be needed.
@return the current object | [
"For",
"SQL_SMALL_RESULT",
"MySQL",
"uses",
"fast",
"temporary",
"tables",
"to",
"store",
"the",
"resulting",
"table",
"instead",
"of",
"using",
"sorting",
".",
"This",
"should",
"not",
"normally",
"be",
"needed",
"."
] | train | https://github.com/querydsl/querydsl/blob/2bf234caf78549813a1e0f44d9c30ecc5ef734e3/querydsl-sql/src/main/java/com/querydsl/sql/mysql/AbstractMySQLQuery.java#L189-L192 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/HexUtil.java | HexUtil.encodeColor | public static String encodeColor(Color color, String prefix) {
final StringBuffer builder = new StringBuffer(prefix);
String colorHex;
colorHex = Integer.toHexString(color.getRed());
if (1 == colorHex.length()) {
builder.append('0');
}
builder.append(colorHex);
colorHex = Integer.toHexString(co... | java | public static String encodeColor(Color color, String prefix) {
final StringBuffer builder = new StringBuffer(prefix);
String colorHex;
colorHex = Integer.toHexString(color.getRed());
if (1 == colorHex.length()) {
builder.append('0');
}
builder.append(colorHex);
colorHex = Integer.toHexString(co... | [
"public",
"static",
"String",
"encodeColor",
"(",
"Color",
"color",
",",
"String",
"prefix",
")",
"{",
"final",
"StringBuffer",
"builder",
"=",
"new",
"StringBuffer",
"(",
"prefix",
")",
";",
"String",
"colorHex",
";",
"colorHex",
"=",
"Integer",
".",
"toHex... | 将{@link Color}编码为Hex形式
@param color {@link Color}
@param prefix 前缀字符串,可以是#、0x等
@return Hex字符串
@since 3.0.8 | [
"将",
"{",
"@link",
"Color",
"}",
"编码为Hex形式"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/HexUtil.java#L222-L241 |
BlueBrain/bluima | modules/bluima_typesystem/src/main/java/ch/epfl/bbp/uima/genia/Event.java | Event.setThemes_protein | public void setThemes_protein(int i, Protein v) {
if (Event_Type.featOkTst && ((Event_Type)jcasType).casFeat_themes_protein == null)
jcasType.jcas.throwFeatMissing("themes_protein", "ch.epfl.bbp.uima.genia.Event");
jcasType.jcas.checkArrayBounds(jcasType.ll_cas.ll_getRefValue(addr, ((Event_Type)jcasType)... | java | public void setThemes_protein(int i, Protein v) {
if (Event_Type.featOkTst && ((Event_Type)jcasType).casFeat_themes_protein == null)
jcasType.jcas.throwFeatMissing("themes_protein", "ch.epfl.bbp.uima.genia.Event");
jcasType.jcas.checkArrayBounds(jcasType.ll_cas.ll_getRefValue(addr, ((Event_Type)jcasType)... | [
"public",
"void",
"setThemes_protein",
"(",
"int",
"i",
",",
"Protein",
"v",
")",
"{",
"if",
"(",
"Event_Type",
".",
"featOkTst",
"&&",
"(",
"(",
"Event_Type",
")",
"jcasType",
")",
".",
"casFeat_themes_protein",
"==",
"null",
")",
"jcasType",
".",
"jcas",... | indexed setter for themes_protein - sets an indexed value -
@generated
@param i index in the array to set
@param v value to set into the array | [
"indexed",
"setter",
"for",
"themes_protein",
"-",
"sets",
"an",
"indexed",
"value",
"-"
] | train | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_typesystem/src/main/java/ch/epfl/bbp/uima/genia/Event.java#L141-L145 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/ZoneMeta.java | ZoneMeta.getCustomTimeZone | public static SimpleTimeZone getCustomTimeZone(int offset) {
boolean negative = false;
int tmp = offset;
if (offset < 0) {
negative = true;
tmp = -offset;
}
int hour, min, sec;
if (ASSERT) {
Assert.assrt("millis!=0", tmp % 1000 != 0);... | java | public static SimpleTimeZone getCustomTimeZone(int offset) {
boolean negative = false;
int tmp = offset;
if (offset < 0) {
negative = true;
tmp = -offset;
}
int hour, min, sec;
if (ASSERT) {
Assert.assrt("millis!=0", tmp % 1000 != 0);... | [
"public",
"static",
"SimpleTimeZone",
"getCustomTimeZone",
"(",
"int",
"offset",
")",
"{",
"boolean",
"negative",
"=",
"false",
";",
"int",
"tmp",
"=",
"offset",
";",
"if",
"(",
"offset",
"<",
"0",
")",
"{",
"negative",
"=",
"true",
";",
"tmp",
"=",
"-... | Creates a custom zone for the offset
@param offset GMT offset in milliseconds
@return A custom TimeZone for the offset with normalized time zone id | [
"Creates",
"a",
"custom",
"zone",
"for",
"the",
"offset"
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/ZoneMeta.java#L775-L798 |
mikepenz/Crossfader | library/src/main/java/com/mikepenz/crossfader/Crossfader.java | Crossfader.setLeftMargin | protected void setLeftMargin(View view, int leftMargin) {
SlidingPaneLayout.LayoutParams lp = (SlidingPaneLayout.LayoutParams) view.getLayoutParams();
lp.leftMargin = leftMargin;
lp.rightMargin = 0;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
lp.setMar... | java | protected void setLeftMargin(View view, int leftMargin) {
SlidingPaneLayout.LayoutParams lp = (SlidingPaneLayout.LayoutParams) view.getLayoutParams();
lp.leftMargin = leftMargin;
lp.rightMargin = 0;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
lp.setMar... | [
"protected",
"void",
"setLeftMargin",
"(",
"View",
"view",
",",
"int",
"leftMargin",
")",
"{",
"SlidingPaneLayout",
".",
"LayoutParams",
"lp",
"=",
"(",
"SlidingPaneLayout",
".",
"LayoutParams",
")",
"view",
".",
"getLayoutParams",
"(",
")",
";",
"lp",
".",
... | define the left margin of the given view
@param view
@param leftMargin | [
"define",
"the",
"left",
"margin",
"of",
"the",
"given",
"view"
] | train | https://github.com/mikepenz/Crossfader/blob/b2e1ee461bc3bcdd897d83f0fad950663bdc73b4/library/src/main/java/com/mikepenz/crossfader/Crossfader.java#L393-L403 |
operasoftware/operaprestodriver | src/com/opera/core/systems/OperaDesktopDriver.java | OperaDesktopDriver.findWidgetByStringId | public QuickWidget findWidgetByStringId(QuickWidgetType type, int windowId, String stringId) {
String text = desktopUtils.getString(stringId, true);
return findWidgetByText(type, windowId, text);
} | java | public QuickWidget findWidgetByStringId(QuickWidgetType type, int windowId, String stringId) {
String text = desktopUtils.getString(stringId, true);
return findWidgetByText(type, windowId, text);
} | [
"public",
"QuickWidget",
"findWidgetByStringId",
"(",
"QuickWidgetType",
"type",
",",
"int",
"windowId",
",",
"String",
"stringId",
")",
"{",
"String",
"text",
"=",
"desktopUtils",
".",
"getString",
"(",
"stringId",
",",
"true",
")",
";",
"return",
"findWidgetBy... | Finds widget with the text specified by string id in the window with the given id.
@param windowId id of parent window
@param stringId string id of the widget
@return QuickWidget or null if no matching widget found | [
"Finds",
"widget",
"with",
"the",
"text",
"specified",
"by",
"string",
"id",
"in",
"the",
"window",
"with",
"the",
"given",
"id",
"."
] | train | https://github.com/operasoftware/operaprestodriver/blob/1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01/src/com/opera/core/systems/OperaDesktopDriver.java#L379-L383 |
intellimate/Izou | src/main/java/org/intellimate/izou/security/storage/SecureStorageImpl.java | SecureStorageImpl.createKeyStore | private KeyStore createKeyStore(String fileName, String password) {
File file = new File(fileName);
KeyStore keyStore = null;
try {
keyStore = KeyStore.getInstance("JCEKS");
if (file.exists()) {
keyStore.load(new FileInputStream(file), password.toCharArra... | java | private KeyStore createKeyStore(String fileName, String password) {
File file = new File(fileName);
KeyStore keyStore = null;
try {
keyStore = KeyStore.getInstance("JCEKS");
if (file.exists()) {
keyStore.load(new FileInputStream(file), password.toCharArra... | [
"private",
"KeyStore",
"createKeyStore",
"(",
"String",
"fileName",
",",
"String",
"password",
")",
"{",
"File",
"file",
"=",
"new",
"File",
"(",
"fileName",
")",
";",
"KeyStore",
"keyStore",
"=",
"null",
";",
"try",
"{",
"keyStore",
"=",
"KeyStore",
".",
... | Creates a new keystore for the izou aes key
@param fileName the path to the keystore
@param password the password to use with the keystore
@return the newly created keystore | [
"Creates",
"a",
"new",
"keystore",
"for",
"the",
"izou",
"aes",
"key"
] | train | https://github.com/intellimate/Izou/blob/40a808b97998e17655c4a78e30ce7326148aed27/src/main/java/org/intellimate/izou/security/storage/SecureStorageImpl.java#L241-L257 |
jmrozanec/cron-utils | src/main/java/com/cronutils/descriptor/DescriptionStrategy.java | DescriptionStrategy.describe | protected String describe(final Between between, final boolean and) {
return bundle.getString(EVERY) + " %s "
+ MessageFormat.format(bundle.getString("between_x_and_y"), nominalValue(between.getFrom()), nominalValue(between.getTo())) + WHITE_SPACE;
} | java | protected String describe(final Between between, final boolean and) {
return bundle.getString(EVERY) + " %s "
+ MessageFormat.format(bundle.getString("between_x_and_y"), nominalValue(between.getFrom()), nominalValue(between.getTo())) + WHITE_SPACE;
} | [
"protected",
"String",
"describe",
"(",
"final",
"Between",
"between",
",",
"final",
"boolean",
"and",
")",
"{",
"return",
"bundle",
".",
"getString",
"(",
"EVERY",
")",
"+",
"\" %s \"",
"+",
"MessageFormat",
".",
"format",
"(",
"bundle",
".",
"getString",
... | Provide a human readable description for Between instance.
@param between - Between
@return human readable description - String | [
"Provide",
"a",
"human",
"readable",
"description",
"for",
"Between",
"instance",
"."
] | train | https://github.com/jmrozanec/cron-utils/blob/adac5ec8fd9160b082f9762a6eedea0715731170/src/main/java/com/cronutils/descriptor/DescriptionStrategy.java#L137-L140 |
stripe/stripe-android | stripe/src/main/java/com/stripe/android/Stripe.java | Stripe.createTokenSynchronous | public Token createTokenSynchronous(final Card card)
throws AuthenticationException,
InvalidRequestException,
APIConnectionException,
CardException,
APIException {
return createTokenSynchronous(card, mDefaultPublishableKey);
} | java | public Token createTokenSynchronous(final Card card)
throws AuthenticationException,
InvalidRequestException,
APIConnectionException,
CardException,
APIException {
return createTokenSynchronous(card, mDefaultPublishableKey);
} | [
"public",
"Token",
"createTokenSynchronous",
"(",
"final",
"Card",
"card",
")",
"throws",
"AuthenticationException",
",",
"InvalidRequestException",
",",
"APIConnectionException",
",",
"CardException",
",",
"APIException",
"{",
"return",
"createTokenSynchronous",
"(",
"ca... | Blocking method to create a {@link Token}. Do not call this on the UI thread or your app
will crash. This method uses the default publishable key for this {@link Stripe} instance.
@param card the {@link Card} to use for this token
@return a {@link Token} that can be used for this card
@throws AuthenticationException ... | [
"Blocking",
"method",
"to",
"create",
"a",
"{",
"@link",
"Token",
"}",
".",
"Do",
"not",
"call",
"this",
"on",
"the",
"UI",
"thread",
"or",
"your",
"app",
"will",
"crash",
".",
"This",
"method",
"uses",
"the",
"default",
"publishable",
"key",
"for",
"t... | train | https://github.com/stripe/stripe-android/blob/0f199255f3769a3b84583fe3ace47bfae8c3b1c8/stripe/src/main/java/com/stripe/android/Stripe.java#L522-L529 |
UrielCh/ovh-java-sdk | ovh-java-sdk-dedicatedinstallationTemplate/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedinstallationTemplate.java | ApiOvhDedicatedinstallationTemplate.templateName_GET | public OvhTemplates templateName_GET(String templateName) throws IOException {
String qPath = "/dedicated/installationTemplate/{templateName}";
StringBuilder sb = path(qPath, templateName);
String resp = execN(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhTemplates.class);
} | java | public OvhTemplates templateName_GET(String templateName) throws IOException {
String qPath = "/dedicated/installationTemplate/{templateName}";
StringBuilder sb = path(qPath, templateName);
String resp = execN(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhTemplates.class);
} | [
"public",
"OvhTemplates",
"templateName_GET",
"(",
"String",
"templateName",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/dedicated/installationTemplate/{templateName}\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
",",
"templateName",
")",... | Get this object properties
REST: GET /dedicated/installationTemplate/{templateName}
@param templateName [required] This template name | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dedicatedinstallationTemplate/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedinstallationTemplate.java#L29-L34 |
moparisthebest/beehive | beehive-netui-core/src/main/java/org/apache/beehive/netui/core/urls/URLRewriterService.java | URLRewriterService.registerURLRewriter | public static boolean registerURLRewriter( ServletRequest request, URLRewriter rewriter )
{
ArrayList/*< URLRewriter >*/ rewriters = getRewriters( request );
if ( rewriters == null )
{
rewriters = new ArrayList/*< URLRewriter >*/();
rewriters.add( rewriter );
... | java | public static boolean registerURLRewriter( ServletRequest request, URLRewriter rewriter )
{
ArrayList/*< URLRewriter >*/ rewriters = getRewriters( request );
if ( rewriters == null )
{
rewriters = new ArrayList/*< URLRewriter >*/();
rewriters.add( rewriter );
... | [
"public",
"static",
"boolean",
"registerURLRewriter",
"(",
"ServletRequest",
"request",
",",
"URLRewriter",
"rewriter",
")",
"{",
"ArrayList",
"/*< URLRewriter >*/",
"rewriters",
"=",
"getRewriters",
"(",
"request",
")",
";",
"if",
"(",
"rewriters",
"==",
"null",
... | Register a URLRewriter (add to a list) in the request. It will be added to the end
of a list of URLRewriter objects and will be used if {@link #rewriteURL} is called.
@param request the current ServletRequest.
@param rewriter the URLRewriter to register.
@return <code>false</code> if a URLRewriter has been registere... | [
"Register",
"a",
"URLRewriter",
"(",
"add",
"to",
"a",
"list",
")",
"in",
"the",
"request",
".",
"It",
"will",
"be",
"added",
"to",
"the",
"end",
"of",
"a",
"list",
"of",
"URLRewriter",
"objects",
"and",
"will",
"be",
"used",
"if",
"{",
"@link",
"#re... | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/core/urls/URLRewriterService.java#L183-L199 |
oehf/ipf-oht-atna | nodeauth/src/main/java/org/openhealthtools/ihe/atna/nodeauth/SecurityDomainManager.java | SecurityDomainManager.registerURItoSecurityDomain | public void registerURItoSecurityDomain(URI uri, String name) throws URISyntaxException
{
if (uri == null) throw new IllegalArgumentException("URI parameter cannot be null");
if (! securityDomains.containsKey(name) ) throw new IllegalArgumentException("Security domain "+name+" is not a configured security domain."... | java | public void registerURItoSecurityDomain(URI uri, String name) throws URISyntaxException
{
if (uri == null) throw new IllegalArgumentException("URI parameter cannot be null");
if (! securityDomains.containsKey(name) ) throw new IllegalArgumentException("Security domain "+name+" is not a configured security domain."... | [
"public",
"void",
"registerURItoSecurityDomain",
"(",
"URI",
"uri",
",",
"String",
"name",
")",
"throws",
"URISyntaxException",
"{",
"if",
"(",
"uri",
"==",
"null",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"URI parameter cannot be null\"",
")",
";",
... | Registers the association of the given URI to the named security domain. Registration is only needed when a URI needs to use
a security domain other than the default domain.
<br>If the URI was previously registered with another domain that association is replaced with this new one.
@param uri URI to register, may not b... | [
"Registers",
"the",
"association",
"of",
"the",
"given",
"URI",
"to",
"the",
"named",
"security",
"domain",
".",
"Registration",
"is",
"only",
"needed",
"when",
"a",
"URI",
"needs",
"to",
"use",
"a",
"security",
"domain",
"other",
"than",
"the",
"default",
... | train | https://github.com/oehf/ipf-oht-atna/blob/25ed1e926825169c94923a2c89a4618f60478ae8/nodeauth/src/main/java/org/openhealthtools/ihe/atna/nodeauth/SecurityDomainManager.java#L117-L125 |
structr/structr | structr-core/src/main/java/org/structr/schema/compiler/ClassFileManager.java | ClassFileManager.getJavaFileForOutput | @Override
public JavaFileObject getJavaFileForOutput(final Location location, final String className, final Kind kind, final FileObject sibling) throws IOException {
JavaClassObject obj = new JavaClassObject(className, kind);
objects.put(className, obj);
return obj;
} | java | @Override
public JavaFileObject getJavaFileForOutput(final Location location, final String className, final Kind kind, final FileObject sibling) throws IOException {
JavaClassObject obj = new JavaClassObject(className, kind);
objects.put(className, obj);
return obj;
} | [
"@",
"Override",
"public",
"JavaFileObject",
"getJavaFileForOutput",
"(",
"final",
"Location",
"location",
",",
"final",
"String",
"className",
",",
"final",
"Kind",
"kind",
",",
"final",
"FileObject",
"sibling",
")",
"throws",
"IOException",
"{",
"JavaClassObject",... | Gives the compiler an instance of the JavaClassObject so that the
compiler can write the byte code into it.
@param location
@param className
@param kind
@param sibling
@return file object
@throws java.io.IOException | [
"Gives",
"the",
"compiler",
"an",
"instance",
"of",
"the",
"JavaClassObject",
"so",
"that",
"the",
"compiler",
"can",
"write",
"the",
"byte",
"code",
"into",
"it",
"."
] | train | https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-core/src/main/java/org/structr/schema/compiler/ClassFileManager.java#L91-L99 |
raydac/java-binary-block-parser | jbbp/src/main/java/com/igormaznitsa/jbbp/io/JBBPBitOutputStream.java | JBBPBitOutputStream.writeBytes | public void writeBytes(final byte[] array, final int length, final JBBPByteOrder byteOrder) throws IOException {
if (byteOrder == JBBPByteOrder.LITTLE_ENDIAN) {
int i = length < 0 ? array.length - 1 : length - 1;
while (i >= 0) {
this.write(array[i--]);
}
} else {
this.write(arra... | java | public void writeBytes(final byte[] array, final int length, final JBBPByteOrder byteOrder) throws IOException {
if (byteOrder == JBBPByteOrder.LITTLE_ENDIAN) {
int i = length < 0 ? array.length - 1 : length - 1;
while (i >= 0) {
this.write(array[i--]);
}
} else {
this.write(arra... | [
"public",
"void",
"writeBytes",
"(",
"final",
"byte",
"[",
"]",
"array",
",",
"final",
"int",
"length",
",",
"final",
"JBBPByteOrder",
"byteOrder",
")",
"throws",
"IOException",
"{",
"if",
"(",
"byteOrder",
"==",
"JBBPByteOrder",
".",
"LITTLE_ENDIAN",
")",
"... | Write number of items from byte array into stream
@param array array, must not be null
@param length number of items to be written, if -1 then whole array
@param byteOrder order of bytes, if LITTLE_ENDIAN then array will be reversed
@throws IOException it will be thrown if any transport error
@see JBBPByteOrder... | [
"Write",
"number",
"of",
"items",
"from",
"byte",
"array",
"into",
"stream"
] | train | https://github.com/raydac/java-binary-block-parser/blob/6d98abcab01e0c72d525ebcc9e7b694f9ce49f5b/jbbp/src/main/java/com/igormaznitsa/jbbp/io/JBBPBitOutputStream.java#L350-L359 |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/jassimp/AiMesh.java | AiMesh.allocateDataChannel | @SuppressWarnings("unused")
private void allocateDataChannel(int channelType, int channelIndex) {
switch (channelType) {
case NORMALS:
m_normals = ByteBuffer.allocateDirect(
m_numVertices * 3 * SIZEOF_FLOAT);
m_normals.order(ByteOrder.nativeOrder());
... | java | @SuppressWarnings("unused")
private void allocateDataChannel(int channelType, int channelIndex) {
switch (channelType) {
case NORMALS:
m_normals = ByteBuffer.allocateDirect(
m_numVertices * 3 * SIZEOF_FLOAT);
m_normals.order(ByteOrder.nativeOrder());
... | [
"@",
"SuppressWarnings",
"(",
"\"unused\"",
")",
"private",
"void",
"allocateDataChannel",
"(",
"int",
"channelType",
",",
"int",
"channelIndex",
")",
"{",
"switch",
"(",
"channelType",
")",
"{",
"case",
"NORMALS",
":",
"m_normals",
"=",
"ByteBuffer",
".",
"al... | This method is used by JNI. Do not call or modify.<p>
Allocates a byte buffer for a vertex data channel
@param channelType the channel type
@param channelIndex sub-index, used for types that can have multiple
channels, such as texture coordinates | [
"This",
"method",
"is",
"used",
"by",
"JNI",
".",
"Do",
"not",
"call",
"or",
"modify",
".",
"<p",
">"
] | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/jassimp/AiMesh.java#L1302-L1346 |
Gperez88/CalculatorInputView | calculatorInputView/src/main/java/com/gp89developers/calculatorinputview/widget/NumericEditText.java | NumericEditText.setDefaultNumericValue | public void setDefaultNumericValue(double defaultNumericValue, final String defaultNumericFormat) {
mDefaultText = String.format(defaultNumericFormat, defaultNumericValue);
if (hasCustomDecimalSeparator) {
// swap locale decimal separator with custom one for display
mDefaultText ... | java | public void setDefaultNumericValue(double defaultNumericValue, final String defaultNumericFormat) {
mDefaultText = String.format(defaultNumericFormat, defaultNumericValue);
if (hasCustomDecimalSeparator) {
// swap locale decimal separator with custom one for display
mDefaultText ... | [
"public",
"void",
"setDefaultNumericValue",
"(",
"double",
"defaultNumericValue",
",",
"final",
"String",
"defaultNumericFormat",
")",
"{",
"mDefaultText",
"=",
"String",
".",
"format",
"(",
"defaultNumericFormat",
",",
"defaultNumericValue",
")",
";",
"if",
"(",
"h... | Set default numeric value and how it should be displayed, this value will be used if
{@link #clear} is called
@param defaultNumericValue numeric value
@param defaultNumericFormat display format for numeric value | [
"Set",
"default",
"numeric",
"value",
"and",
"how",
"it",
"should",
"be",
"displayed",
"this",
"value",
"will",
"be",
"used",
"if",
"{",
"@link",
"#clear",
"}",
"is",
"called"
] | train | https://github.com/Gperez88/CalculatorInputView/blob/735029095fbcbd32d25cde65529061903f522a89/calculatorInputView/src/main/java/com/gp89developers/calculatorinputview/widget/NumericEditText.java#L121-L130 |
FasterXML/jackson-jr | jr-objects/src/main/java/com/fasterxml/jackson/jr/ob/impl/ValueWriterLocator.java | ValueWriterLocator.findSerializationType | public final int findSerializationType(Class<?> raw)
{
if (raw == _prevClass) {
return _prevType;
}
if (raw == String.class) {
return SER_STRING;
}
ClassKey k = (_key == null) ? new ClassKey(raw, _features) : _key.with(raw, _features);
int type... | java | public final int findSerializationType(Class<?> raw)
{
if (raw == _prevClass) {
return _prevType;
}
if (raw == String.class) {
return SER_STRING;
}
ClassKey k = (_key == null) ? new ClassKey(raw, _features) : _key.with(raw, _features);
int type... | [
"public",
"final",
"int",
"findSerializationType",
"(",
"Class",
"<",
"?",
">",
"raw",
")",
"{",
"if",
"(",
"raw",
"==",
"_prevClass",
")",
"{",
"return",
"_prevType",
";",
"}",
"if",
"(",
"raw",
"==",
"String",
".",
"class",
")",
"{",
"return",
"SER... | The main lookup method used to find type identifier for
given raw class; including Bean types (if allowed). | [
"The",
"main",
"lookup",
"method",
"used",
"to",
"find",
"type",
"identifier",
"for",
"given",
"raw",
"class",
";",
"including",
"Bean",
"types",
"(",
"if",
"allowed",
")",
"."
] | train | https://github.com/FasterXML/jackson-jr/blob/62ca7a82bd90a9be77028e0b62364307d7532837/jr-objects/src/main/java/com/fasterxml/jackson/jr/ob/impl/ValueWriterLocator.java#L115-L137 |
sdaschner/jaxrs-analyzer | src/main/java/com/sebastian_daschner/jaxrs_analyzer/model/JavaUtils.java | JavaUtils.isAnnotationPresent | public static boolean isAnnotationPresent(final AnnotatedElement annotatedElement, final Class<?> annotationClass) {
return Stream.of(annotatedElement.getAnnotations()).map(Annotation::annotationType).map(Class::getName).anyMatch(n -> n.equals(annotationClass.getName()));
} | java | public static boolean isAnnotationPresent(final AnnotatedElement annotatedElement, final Class<?> annotationClass) {
return Stream.of(annotatedElement.getAnnotations()).map(Annotation::annotationType).map(Class::getName).anyMatch(n -> n.equals(annotationClass.getName()));
} | [
"public",
"static",
"boolean",
"isAnnotationPresent",
"(",
"final",
"AnnotatedElement",
"annotatedElement",
",",
"final",
"Class",
"<",
"?",
">",
"annotationClass",
")",
"{",
"return",
"Stream",
".",
"of",
"(",
"annotatedElement",
".",
"getAnnotations",
"(",
")",
... | Checks if the annotation is present on the annotated element.
<b>Note:</b> This step is necessary due to issues with external class loaders (e.g. Maven).
The classes may not be identical and are therefore compared by FQ class name. | [
"Checks",
"if",
"the",
"annotation",
"is",
"present",
"on",
"the",
"annotated",
"element",
".",
"<b",
">",
"Note",
":",
"<",
"/",
"b",
">",
"This",
"step",
"is",
"necessary",
"due",
"to",
"issues",
"with",
"external",
"class",
"loaders",
"(",
"e",
".",... | train | https://github.com/sdaschner/jaxrs-analyzer/blob/4ac62942202d05632977d6c14d3cd7e2d27e2b9b/src/main/java/com/sebastian_daschner/jaxrs_analyzer/model/JavaUtils.java#L78-L80 |
UrielCh/ovh-java-sdk | ovh-java-sdk-ip/src/main/java/net/minidev/ovh/api/ApiOvhIp.java | ApiOvhIp.ip_spam_ipSpamming_unblock_POST | public OvhSpamIp ip_spam_ipSpamming_unblock_POST(String ip, String ipSpamming) throws IOException {
String qPath = "/ip/{ip}/spam/{ipSpamming}/unblock";
StringBuilder sb = path(qPath, ip, ipSpamming);
String resp = exec(qPath, "POST", sb.toString(), null);
return convertTo(resp, OvhSpamIp.class);
} | java | public OvhSpamIp ip_spam_ipSpamming_unblock_POST(String ip, String ipSpamming) throws IOException {
String qPath = "/ip/{ip}/spam/{ipSpamming}/unblock";
StringBuilder sb = path(qPath, ip, ipSpamming);
String resp = exec(qPath, "POST", sb.toString(), null);
return convertTo(resp, OvhSpamIp.class);
} | [
"public",
"OvhSpamIp",
"ip_spam_ipSpamming_unblock_POST",
"(",
"String",
"ip",
",",
"String",
"ipSpamming",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/ip/{ip}/spam/{ipSpamming}/unblock\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
",",... | Release the ip from anti-spam system
REST: POST /ip/{ip}/spam/{ipSpamming}/unblock
@param ip [required]
@param ipSpamming [required] IP address which is sending spam | [
"Release",
"the",
"ip",
"from",
"anti",
"-",
"spam",
"system"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-ip/src/main/java/net/minidev/ovh/api/ApiOvhIp.java#L210-L215 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.