repo stringlengths 7 59 | path stringlengths 17 234 | func_name stringlengths 3 117 | original_string stringlengths 63 281k | language stringclasses 1
value | code stringlengths 63 281k | code_tokens listlengths 20 16.3k | docstring stringlengths 1 34k | docstring_tokens listlengths 1 3.44k | sha stringlengths 40 40 | url stringlengths 106 339 | partition stringclasses 3
values | summary stringlengths 3 248 | output stringlengths 142 281k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/templates/AbsPathChecker.java | AbsPathChecker.visitFunction | public boolean visitFunction(ExpressionOwner owner, Function func)
{
if((func instanceof FuncCurrent) ||
(func instanceof FuncExtFunction))
m_isAbs = false;
return true;
} | java | public boolean visitFunction(ExpressionOwner owner, Function func)
{
if((func instanceof FuncCurrent) ||
(func instanceof FuncExtFunction))
m_isAbs = false;
return true;
} | [
"public",
"boolean",
"visitFunction",
"(",
"ExpressionOwner",
"owner",
",",
"Function",
"func",
")",
"{",
"if",
"(",
"(",
"func",
"instanceof",
"FuncCurrent",
")",
"||",
"(",
"func",
"instanceof",
"FuncExtFunction",
")",
")",
"m_isAbs",
"=",
"false",
";",
"r... | Visit a function.
@param owner The owner of the expression, to which the expression can
be reset if rewriting takes place.
@param func The function reference object.
@return true if the sub expressions should be traversed. | [
"Visit",
"a",
"function",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/templates/AbsPathChecker.java#L60-L66 | train | Visit a function. | Of course, here is the Java code you requested:
```java
public boolean visitFunction(ExpressionOwner owner, Function func)
{
if((func instanceof FuncCurrent) ||
(func instanceof FuncExtFunction))
m_isAbs = false;
return true;
}
```
Hope this helps! |
lessthanoptimal/ejml | main/ejml-simple/src/org/ejml/simple/SimpleMatrix.java | SimpleMatrix.diag | public static SimpleMatrix diag( Class type, double ...vals ) {
SimpleMatrix M = new SimpleMatrix(vals.length,vals.length,type);
for (int i = 0; i < vals.length; i++) {
M.set(i,i,vals[i]);
}
return M;
} | java | public static SimpleMatrix diag( Class type, double ...vals ) {
SimpleMatrix M = new SimpleMatrix(vals.length,vals.length,type);
for (int i = 0; i < vals.length; i++) {
M.set(i,i,vals[i]);
}
return M;
} | [
"public",
"static",
"SimpleMatrix",
"diag",
"(",
"Class",
"type",
",",
"double",
"...",
"vals",
")",
"{",
"SimpleMatrix",
"M",
"=",
"new",
"SimpleMatrix",
"(",
"vals",
".",
"length",
",",
"vals",
".",
"length",
",",
"type",
")",
";",
"for",
"(",
"int",... | Creates a real valued diagonal matrix of the specified type | [
"Creates",
"a",
"real",
"valued",
"diagonal",
"matrix",
"of",
"the",
"specified",
"type"
] | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-simple/src/org/ejml/simple/SimpleMatrix.java#L269-L275 | train | Diagonal matrix. | Of course, here is the Java code you requested:
```java
public static SimpleMatrix diag( Class type, double ...vals ) {
SimpleMatrix M = new SimpleMatrix(vals.length,vals.length,type);
for (int i = 0; i < vals.length; i++) {
M.set(i,i,vals[i]);
}
return M;
}
```
Hope thi... |
Alluxio/alluxio | core/common/src/main/java/alluxio/concurrent/jsr/ForkJoinTask.java | ForkJoinTask.pollNextLocalTask | protected static ForkJoinTask<?> pollNextLocalTask() {
Thread t;
return ((t = Thread.currentThread()) instanceof ForkJoinWorkerThread)
? ((ForkJoinWorkerThread) t).workQueue.nextLocalTask()
: null;
} | java | protected static ForkJoinTask<?> pollNextLocalTask() {
Thread t;
return ((t = Thread.currentThread()) instanceof ForkJoinWorkerThread)
? ((ForkJoinWorkerThread) t).workQueue.nextLocalTask()
: null;
} | [
"protected",
"static",
"ForkJoinTask",
"<",
"?",
">",
"pollNextLocalTask",
"(",
")",
"{",
"Thread",
"t",
";",
"return",
"(",
"(",
"t",
"=",
"Thread",
".",
"currentThread",
"(",
")",
")",
"instanceof",
"ForkJoinWorkerThread",
")",
"?",
"(",
"(",
"ForkJoinWo... | Unschedules and returns, without executing, the next task queued by the current thread but not
yet executed, if the current thread is operating in a ForkJoinPool. This method is designed
primarily to support extensions, and is unlikely to be useful otherwise.
@return the next task, or {@code null} if none are availabl... | [
"Unschedules",
"and",
"returns",
"without",
"executing",
"the",
"next",
"task",
"queued",
"by",
"the",
"current",
"thread",
"but",
"not",
"yet",
"executed",
"if",
"the",
"current",
"thread",
"is",
"operating",
"in",
"a",
"ForkJoinPool",
".",
"This",
"method",
... | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/concurrent/jsr/ForkJoinTask.java#L498-L503 | train | Polls the next local task. | Of course, here is the Java code you requested:
```java
protected static ForkJoinTask<?> pollNextLocalTask() {
Thread t;
return ((t = Thread.currentThread()) instanceof ForkJoinWorkerThread)
? ((ForkJoinWorkerThread) t).workQueue.nextLocalTask()
: null;
}
```
Hope this helps! |
opsmatters/opsmatters-core | src/main/java/com/opsmatters/core/documents/OutputFileWriter.java | OutputFileWriter.getCSVOutput | private byte[] getCSVOutput(List<String[]> lines)
{
StringWriter writer = new StringWriter();
csv = new CSVWriter(writer, delimiter.separator().charAt(0));
for(int i = 0; i < lines.size(); i++)
{
csv.writeNext((String[])lines.get(i), quotes);
}
// The con... | java | private byte[] getCSVOutput(List<String[]> lines)
{
StringWriter writer = new StringWriter();
csv = new CSVWriter(writer, delimiter.separator().charAt(0));
for(int i = 0; i < lines.size(); i++)
{
csv.writeNext((String[])lines.get(i), quotes);
}
// The con... | [
"private",
"byte",
"[",
"]",
"getCSVOutput",
"(",
"List",
"<",
"String",
"[",
"]",
">",
"lines",
")",
"{",
"StringWriter",
"writer",
"=",
"new",
"StringWriter",
"(",
")",
";",
"csv",
"=",
"new",
"CSVWriter",
"(",
"writer",
",",
"delimiter",
".",
"separ... | Returns the CSV output file data.
@param lines The lines to add to the output file
@return The byte array representing the CSV output file data | [
"Returns",
"the",
"CSV",
"output",
"file",
"data",
"."
] | c48904f7e8d029fd45357811ec38a735e261e3fd | https://github.com/opsmatters/opsmatters-core/blob/c48904f7e8d029fd45357811ec38a735e261e3fd/src/main/java/com/opsmatters/core/documents/OutputFileWriter.java#L225-L236 | train | Get the CSV output of a single SECTYPE file. | Of course, here is the Java code you requested:
```java
private byte[] getCSVOutput(List<String[]> lines)
{
StringWriter writer = new StringWriter();
csv = new CSVWriter(writer, delimiter.separator().charAt(0));
for(int i = 0; i < lines.size(); i++)
{
csv.writeNext((Stri... |
killme2008/xmemcached | src/main/java/com/google/code/yanf4j/buffer/AbstractIoBuffer.java | AbstractIoBuffer.getEnumSet | @Override
public <E extends Enum<E>> EnumSet<E> getEnumSet(Class<E> enumClass) {
return toEnumSet(enumClass, get() & BYTE_MASK);
} | java | @Override
public <E extends Enum<E>> EnumSet<E> getEnumSet(Class<E> enumClass) {
return toEnumSet(enumClass, get() & BYTE_MASK);
} | [
"@",
"Override",
"public",
"<",
"E",
"extends",
"Enum",
"<",
"E",
">",
">",
"EnumSet",
"<",
"E",
">",
"getEnumSet",
"(",
"Class",
"<",
"E",
">",
"enumClass",
")",
"{",
"return",
"toEnumSet",
"(",
"enumClass",
",",
"get",
"(",
")",
"&",
"BYTE_MASK",
... | {@inheritDoc} | [
"{"
] | 66150915938813b3e3413de1d7b43b6ff9b1478d | https://github.com/killme2008/xmemcached/blob/66150915938813b3e3413de1d7b43b6ff9b1478d/src/main/java/com/google/code/yanf4j/buffer/AbstractIoBuffer.java#L2294-L2297 | train | Get an enum set from the value. | Of course, here is the Java code you requested:
```java
@Override
public <E extends Enum<E>> EnumSet<E> getEnumSet(Class<E> enumClass) {
return toEnumSet(enumClass, get() & BYTE_MASK);
}
```
Hope this helps! |
Ordinastie/MalisisCore | src/main/java/net/malisis/core/renderer/model/loader/ObjFileImporter.java | ObjFileImporter.addVertex | private void addVertex(String data)
{
String coords[] = data.split("\\s+");
float x = 0;
float y = 0;
float z = 0;
if (coords.length != 3)
{
MalisisCore.log.error("[ObjFileImporter] Wrong coordinates number {} at line {} : {}", coords.length, lineNumber, currentLine);
}
else
{
x = Float.parseFl... | java | private void addVertex(String data)
{
String coords[] = data.split("\\s+");
float x = 0;
float y = 0;
float z = 0;
if (coords.length != 3)
{
MalisisCore.log.error("[ObjFileImporter] Wrong coordinates number {} at line {} : {}", coords.length, lineNumber, currentLine);
}
else
{
x = Float.parseFl... | [
"private",
"void",
"addVertex",
"(",
"String",
"data",
")",
"{",
"String",
"coords",
"[",
"]",
"=",
"data",
".",
"split",
"(",
"\"\\\\s+\"",
")",
";",
"float",
"x",
"=",
"0",
";",
"float",
"y",
"=",
"0",
";",
"float",
"z",
"=",
"0",
";",
"if",
... | Creates a new {@link Vertex} from data and adds it to {@link #vertexes}.
@param data the data | [
"Creates",
"a",
"new",
"{",
"@link",
"Vertex",
"}",
"from",
"data",
"and",
"adds",
"it",
"to",
"{",
"@link",
"#vertexes",
"}",
"."
] | 4f8e1fa462d5c372fc23414482ba9f429881cc54 | https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/renderer/model/loader/ObjFileImporter.java#L206-L224 | train | Add a vertex to the list of vertices. | Of course, here is the Java code you requested:
```java
private void addVertex(String data)
{
String coords[] = data.split("\\s+");
float x = 0;
float y = 0;
float z = 0;
if (coords.length != 3)
{
MalisisCore.log.error("[ObjFileImporter] Wrong coordinates number {} at line {} : {}", coords.length, line... |
OpenLiberty/open-liberty | dev/com.ibm.ws.channelfw/src/com/ibm/ws/tcpchannel/internal/TCPReadRequestContextImpl.java | TCPReadRequestContextImpl.read | @Override
public VirtualConnection read(long numBytes, TCPReadCompletedCallback readCallback, boolean forceQueue, int timeout) {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
Tr.entry(tc, "read(" + numBytes + ",..," + forceQueue + "," + timeout + ")");
}
getT... | java | @Override
public VirtualConnection read(long numBytes, TCPReadCompletedCallback readCallback, boolean forceQueue, int timeout) {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
Tr.entry(tc, "read(" + numBytes + ",..," + forceQueue + "," + timeout + ")");
}
getT... | [
"@",
"Override",
"public",
"VirtualConnection",
"read",
"(",
"long",
"numBytes",
",",
"TCPReadCompletedCallback",
"readCallback",
",",
"boolean",
"forceQueue",
",",
"int",
"timeout",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&"... | /*
@see com.ibm.wsspi.tcpchannel.TCPReadRequestContext#read(long,
com.ibm.wsspi.tcpchannel.TCPReadCompletedCallback, boolean, int) | [
"/",
"*"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.channelfw/src/com/ibm/ws/tcpchannel/internal/TCPReadRequestContextImpl.java#L106-L142 | train | read method for async read | Of course, here is the Java code you requested:
```java
@Override
public VirtualConnection read(long numBytes, TCPReadCompletedCallback readCallback, boolean forceQueue, int timeout) {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
Tr.entry(tc, "read(" + numBytes + ",..," + ... |
apache/incubator-gobblin | gobblin-core-base/src/main/java/org/apache/gobblin/instrumented/extractor/InstrumentedExtractorBase.java | InstrumentedExtractorBase.regenerateMetrics | protected void regenerateMetrics() {
if (isInstrumentationEnabled()) {
this.readRecordsMeter = Optional.of(this.metricContext.meter(MetricNames.ExtractorMetrics.RECORDS_READ_METER));
this.dataRecordExceptionsMeter =
Optional.of(this.metricContext.meter(MetricNames.ExtractorMetrics.RECORDS_FAIL... | java | protected void regenerateMetrics() {
if (isInstrumentationEnabled()) {
this.readRecordsMeter = Optional.of(this.metricContext.meter(MetricNames.ExtractorMetrics.RECORDS_READ_METER));
this.dataRecordExceptionsMeter =
Optional.of(this.metricContext.meter(MetricNames.ExtractorMetrics.RECORDS_FAIL... | [
"protected",
"void",
"regenerateMetrics",
"(",
")",
"{",
"if",
"(",
"isInstrumentationEnabled",
"(",
")",
")",
"{",
"this",
".",
"readRecordsMeter",
"=",
"Optional",
".",
"of",
"(",
"this",
".",
"metricContext",
".",
"meter",
"(",
"MetricNames",
".",
"Extrac... | Generates metrics for the instrumentation of this class. | [
"Generates",
"metrics",
"for",
"the",
"instrumentation",
"of",
"this",
"class",
"."
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-core-base/src/main/java/org/apache/gobblin/instrumented/extractor/InstrumentedExtractorBase.java#L104-L115 | train | Regenerate metrics. | Of course, here is the Java code you requested:
```java
protected void regenerateMetrics() {
if (isInstrumentationEnabled()) {
this.readRecordsMeter = Optional.of(this.metricContext.meter(MetricNames.ExtractorMetrics.RECORDS_READ_METER));
this.dataRecordExceptionsMeter =
Optional.of(this.metr... |
js-lib-com/tiny-container | src/main/java/js/container/ManagedClass.java | ManagedClass.initializeStaticFields | private void initializeStaticFields() throws ConfigException {
if (config == null) {
return;
}
for (Config config : config.findChildren("static-field")) {
String fieldName = config.getAttribute("name");
if (fieldName == null) {
throw new ConfigException("Missing <name> attribute from static fi... | java | private void initializeStaticFields() throws ConfigException {
if (config == null) {
return;
}
for (Config config : config.findChildren("static-field")) {
String fieldName = config.getAttribute("name");
if (fieldName == null) {
throw new ConfigException("Missing <name> attribute from static fi... | [
"private",
"void",
"initializeStaticFields",
"(",
")",
"throws",
"ConfigException",
"{",
"if",
"(",
"config",
"==",
"null",
")",
"{",
"return",
";",
"}",
"for",
"(",
"Config",
"config",
":",
"config",
".",
"findChildren",
"(",
"\"static-field\"",
")",
")",
... | Initialize implementation class static, not final, fields. Static initializer reads name / value pairs from
<code>static-field</code> configuration element, see sample below. String value is converted to instance field type using
{@link Converter#asObject(String, Class)} utility. This means that configured value should... | [
"Initialize",
"implementation",
"class",
"static",
"not",
"final",
"fields",
".",
"Static",
"initializer",
"reads",
"name",
"/",
"value",
"pairs",
"from",
"<code",
">",
"static",
"-",
"field<",
"/",
"code",
">",
"configuration",
"element",
"see",
"sample",
"be... | ef68deb9ec40b217b4cd2df56d9c5a213dd6b89e | https://github.com/js-lib-com/tiny-container/blob/ef68deb9ec40b217b4cd2df56d9c5a213dd6b89e/src/main/java/js/container/ManagedClass.java#L1009-L1035 | test | Initializes the static fields of the managed class. | Of course, here is the Java code you requested:
```java
private void initializeStaticFields() throws ConfigException {
if (config == null) {
return;
}
for (Config config : config.findChildren("static-field")) {
String fieldName = config.getAttribute("name");
if (fieldName == null) {
throw new... |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/util/Cache.java | MemoryCache.accept | public synchronized void accept(CacheVisitor<K,V> visitor) {
expungeExpiredEntries();
Map<K,V> cached = getCachedEntries();
visitor.visit(cached);
} | java | public synchronized void accept(CacheVisitor<K,V> visitor) {
expungeExpiredEntries();
Map<K,V> cached = getCachedEntries();
visitor.visit(cached);
} | [
"public",
"synchronized",
"void",
"accept",
"(",
"CacheVisitor",
"<",
"K",
",",
"V",
">",
"visitor",
")",
"{",
"expungeExpiredEntries",
"(",
")",
";",
"Map",
"<",
"K",
",",
"V",
">",
"cached",
"=",
"getCachedEntries",
"(",
")",
";",
"visitor",
".",
"vi... | it is a heavyweight method. | [
"it",
"is",
"a",
"heavyweight",
"method",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/util/Cache.java#L442-L447 | train | Accept the cache visitor. | Of course, here is the Java code you requested:
```java
public synchronized void accept(CacheVisitor<K,V> visitor) {
expungeExpiredEntries();
Map<K,V> cached = getCachedEntries();
visitor.visit(cached);
}
```
Hope this helps! |
jbundle/jbundle | thin/base/screen/screen/src/main/java/org/jbundle/thin/base/screen/BaseApplet.java | BaseApplet.onLogonDialog | public int onLogonDialog()
{
String strDisplay = "Login required";
strDisplay = this.getTask().getString(strDisplay);
for (int i = 1; i < 3; i++)
{
String strUserName = this.getProperty(Params.USER_NAME);
Frame frame = ScreenUtil.getFrame(this);
Lo... | java | public int onLogonDialog()
{
String strDisplay = "Login required";
strDisplay = this.getTask().getString(strDisplay);
for (int i = 1; i < 3; i++)
{
String strUserName = this.getProperty(Params.USER_NAME);
Frame frame = ScreenUtil.getFrame(this);
Lo... | [
"public",
"int",
"onLogonDialog",
"(",
")",
"{",
"String",
"strDisplay",
"=",
"\"Login required\"",
";",
"strDisplay",
"=",
"this",
".",
"getTask",
"(",
")",
".",
"getString",
"(",
"strDisplay",
")",
";",
"for",
"(",
"int",
"i",
"=",
"1",
";",
"i",
"<"... | Display the logon dialog and login.
@return | [
"Display",
"the",
"logon",
"dialog",
"and",
"login",
"."
] | 4037fcfa85f60c7d0096c453c1a3cd573c2b0abc | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/screen/screen/src/main/java/org/jbundle/thin/base/screen/BaseApplet.java#L401-L448 | train | On Logon Dialog Method. | Of course, here is the Java code you requested:
```java
public int onLogonDialog()
{
String strDisplay = "Login required";
strDisplay = this.getTask().getString(strDisplay);
for (int i = 1; i < 3; i++)
{
String strUserName = this.getProperty(Params.USER_NAME);
... |
kiegroup/optaplanner | optaplanner-core/src/main/java/org/optaplanner/core/config/heuristic/selector/move/generic/chained/KOptMoveSelectorConfig.java | KOptMoveSelectorConfig.buildBaseMoveSelector | @Override
public MoveSelector buildBaseMoveSelector(HeuristicConfigPolicy configPolicy,
SelectionCacheType minimumCacheType, boolean randomSelection) {
EntitySelectorConfig entitySelectorConfig_ = entitySelectorConfig == null ? new EntitySelectorConfig()
: entitySelectorConfig;
... | java | @Override
public MoveSelector buildBaseMoveSelector(HeuristicConfigPolicy configPolicy,
SelectionCacheType minimumCacheType, boolean randomSelection) {
EntitySelectorConfig entitySelectorConfig_ = entitySelectorConfig == null ? new EntitySelectorConfig()
: entitySelectorConfig;
... | [
"@",
"Override",
"public",
"MoveSelector",
"buildBaseMoveSelector",
"(",
"HeuristicConfigPolicy",
"configPolicy",
",",
"SelectionCacheType",
"minimumCacheType",
",",
"boolean",
"randomSelection",
")",
"{",
"EntitySelectorConfig",
"entitySelectorConfig_",
"=",
"entitySelectorCon... | ************************************************************************ | [
"************************************************************************"
] | b8f1459b4e6b0f7aafe941fd165bff640c11d7d5 | https://github.com/kiegroup/optaplanner/blob/b8f1459b4e6b0f7aafe941fd165bff640c11d7d5/optaplanner-core/src/main/java/org/optaplanner/core/config/heuristic/selector/move/generic/chained/KOptMoveSelectorConfig.java#L71-L88 | valid | Build the base MoveSelector. | Of course, here is the Java code you requested:
```java
@Override
public MoveSelector buildBaseMoveSelector(HeuristicConfigPolicy configPolicy,
SelectionCacheType minimumCacheType, boolean randomSelection) {
EntitySelectorConfig entitySelectorConfig_ = entitySelectorConfig == null ? new EntityS... |
dita-ot/dita-ot | src/main/java/org/dita/dost/util/XMLUtils.java | XMLUtils.close | public static void close(final InputSource input) throws IOException {
if (input != null) {
final InputStream i = input.getByteStream();
if (i != null) {
i.close();
} else {
final Reader w = input.getCharacterStream();
if (w != ... | java | public static void close(final InputSource input) throws IOException {
if (input != null) {
final InputStream i = input.getByteStream();
if (i != null) {
i.close();
} else {
final Reader w = input.getCharacterStream();
if (w != ... | [
"public",
"static",
"void",
"close",
"(",
"final",
"InputSource",
"input",
")",
"throws",
"IOException",
"{",
"if",
"(",
"input",
"!=",
"null",
")",
"{",
"final",
"InputStream",
"i",
"=",
"input",
".",
"getByteStream",
"(",
")",
";",
"if",
"(",
"i",
"!... | Close input source. | [
"Close",
"input",
"source",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/XMLUtils.java#L585-L597 | train | Close a InputSource. | Of course, here is the Java code you requested:
```java
public static void close(final InputSource input) throws IOException {
if (input != null) {
final InputStream i = input.getByteStream();
if (i != null) {
i.close();
} else {
final Reader ... |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/DateUtilities.java | DateUtilities.createDate | public static Date createDate(final int day, final int month, final int year) {
Calendar cal = Calendar.getInstance();
cal.clear();
cal.set(Calendar.DAY_OF_MONTH, day);
cal.set(Calendar.MONTH, month - 1);
cal.set(Calendar.YEAR, year);
return cal.getTime();
} | java | public static Date createDate(final int day, final int month, final int year) {
Calendar cal = Calendar.getInstance();
cal.clear();
cal.set(Calendar.DAY_OF_MONTH, day);
cal.set(Calendar.MONTH, month - 1);
cal.set(Calendar.YEAR, year);
return cal.getTime();
} | [
"public",
"static",
"Date",
"createDate",
"(",
"final",
"int",
"day",
",",
"final",
"int",
"month",
",",
"final",
"int",
"year",
")",
"{",
"Calendar",
"cal",
"=",
"Calendar",
".",
"getInstance",
"(",
")",
";",
"cal",
".",
"clear",
"(",
")",
";",
"cal... | Creates a date from the given components.
@param day the day of the month, 1-31.
@param month the month, 1-12.
@param year the year.
@return a date with the specified settings. | [
"Creates",
"a",
"date",
"from",
"the",
"given",
"components",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/DateUtilities.java#L29-L38 | train | Creates a Date object from the given values. | Of course, here is the Java code you requested:
```java
public static Date createDate(final int day, final int month, final int year) {
Calendar cal = Calendar.getInstance();
cal.clear();
cal.set(Calendar.DAY_OF_MONTH, day);
cal.set(Calendar.MONTH, month - 1);
cal.set(Calendar.YEAR, year);
return cal.get... |
lisicnu/droidUtil | src/main/java/com/github/lisicnu/libDroid/view/ScrollTextView.java | ScrollTextView.setScrollMode | public boolean setScrollMode(int mode) {
if (mode != MODE_LEFT_AND_RIGHT && mode != MODE_RIGHT_TO_LEFT) {
return false;
}
scrollMode = mode;
if (mode == MODE_RIGHT_TO_LEFT) {
distance = 100;
} else {
offset = -1;
if (getWidth() > MA... | java | public boolean setScrollMode(int mode) {
if (mode != MODE_LEFT_AND_RIGHT && mode != MODE_RIGHT_TO_LEFT) {
return false;
}
scrollMode = mode;
if (mode == MODE_RIGHT_TO_LEFT) {
distance = 100;
} else {
offset = -1;
if (getWidth() > MA... | [
"public",
"boolean",
"setScrollMode",
"(",
"int",
"mode",
")",
"{",
"if",
"(",
"mode",
"!=",
"MODE_LEFT_AND_RIGHT",
"&&",
"mode",
"!=",
"MODE_RIGHT_TO_LEFT",
")",
"{",
"return",
"false",
";",
"}",
"scrollMode",
"=",
"mode",
";",
"if",
"(",
"mode",
"==",
... | 更新显示的MODE, 如果mode 非法将设置失败, 不做任何更改
@param mode
@return 返回设置是否成功 | [
"更新显示的MODE",
"如果mode",
"非法将设置失败",
"不做任何更改"
] | e4d6cf3e3f60e5efb5a75672607ded94d1725519 | https://github.com/lisicnu/droidUtil/blob/e4d6cf3e3f60e5efb5a75672607ded94d1725519/src/main/java/com/github/lisicnu/libDroid/view/ScrollTextView.java#L99-L118 | train | Sets the scroll mode. | Of course, here is the Java code you requested:
```java
public boolean setScrollMode(int mode) {
if (mode != MODE_LEFT_AND_RIGHT && mode != MODE_RIGHT_TO_LEFT) {
return false;
}
scrollMode = mode;
if (mode == MODE_RIGHT_TO_LEFT) {
distance = 100;
} else {... |
apache/reef | lang/java/reef-runtime-mock/src/main/java/org/apache/reef/mock/driver/MockDriverRestartContext.java | MockDriverRestartContext.getIdleActiveContexts | public List<MockActiveContext> getIdleActiveContexts() {
final List<MockActiveContext> idleActiveContexts = new ArrayList<>();
final Set<String> activeContextsWithRunningTasks = new HashSet<>();
for (final MockRunningTask task : this.runningTasks) {
activeContextsWithRunningTasks.add(task.getActiveCon... | java | public List<MockActiveContext> getIdleActiveContexts() {
final List<MockActiveContext> idleActiveContexts = new ArrayList<>();
final Set<String> activeContextsWithRunningTasks = new HashSet<>();
for (final MockRunningTask task : this.runningTasks) {
activeContextsWithRunningTasks.add(task.getActiveCon... | [
"public",
"List",
"<",
"MockActiveContext",
">",
"getIdleActiveContexts",
"(",
")",
"{",
"final",
"List",
"<",
"MockActiveContext",
">",
"idleActiveContexts",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"final",
"Set",
"<",
"String",
">",
"activeContextsWithRu... | Pass these active contexts to the {@link org.apache.reef.driver.parameters.DriverRestartContextActiveHandlers}.
These active contexts have no tasks running.
@return | [
"Pass",
"these",
"active",
"contexts",
"to",
"the",
"{"
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-runtime-mock/src/main/java/org/apache/reef/mock/driver/MockDriverRestartContext.java#L120-L132 | train | Gets the idle active contexts. | Of course, here is the Java code you requested:
```java
public List<MockActiveContext> getIdleActiveContexts() {
final List<MockActiveContext> idleActiveContexts = new ArrayList<>();
final Set<String> activeContextsWithRunningTasks = new HashSet<>();
for (final MockRunningTask task : this.runningTasks) {
... |
stratosphere/stratosphere | stratosphere-runtime/src/main/java/eu/stratosphere/nephele/jobmanager/web/JobmanagerInfoServlet.java | JobmanagerInfoServlet.writeJsonUpdatesForJob | private void writeJsonUpdatesForJob(PrintWriter wrt, JobID jobId) {
try {
List<AbstractEvent> events = jobmanager.getEvents(jobId);
//Serialize job to json
wrt.write("{");
wrt.write("\"jobid\": \"" + jobId + "\",");
wrt.write("\"timestamp\": \"" + System.currentTimeMillis() + "\",");
wrt.... | java | private void writeJsonUpdatesForJob(PrintWriter wrt, JobID jobId) {
try {
List<AbstractEvent> events = jobmanager.getEvents(jobId);
//Serialize job to json
wrt.write("{");
wrt.write("\"jobid\": \"" + jobId + "\",");
wrt.write("\"timestamp\": \"" + System.currentTimeMillis() + "\",");
wrt.... | [
"private",
"void",
"writeJsonUpdatesForJob",
"(",
"PrintWriter",
"wrt",
",",
"JobID",
"jobId",
")",
"{",
"try",
"{",
"List",
"<",
"AbstractEvent",
">",
"events",
"=",
"jobmanager",
".",
"getEvents",
"(",
"jobId",
")",
";",
"//Serialize job to json",
"wrt",
"."... | Writes all updates (events) for a given job since a given time
@param wrt
@param jobId | [
"Writes",
"all",
"updates",
"(",
"events",
")",
"for",
"a",
"given",
"job",
"since",
"a",
"given",
"time"
] | c543a08f9676c5b2b0a7088123bd6e795a8ae0c8 | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-runtime/src/main/java/eu/stratosphere/nephele/jobmanager/web/JobmanagerInfoServlet.java#L370-L448 | train | Write the JSON updates for a given job. | Of course, here is the Java code you requested:
```java
private void writeJsonUpdatesForJob(PrintWriter wrt, JobID jobId) {
try {
List<AbstractEvent> events = jobmanager.getEvents(jobId);
//Serialize job to json
wrt.write("{");
wrt.write("\"jobid\": \"" + jobId + "\",");
wrt.write("\"timest... |
Netflix/ribbon | ribbon-loadbalancer/src/main/java/com/netflix/loadbalancer/LoadBalancerContext.java | LoadBalancerContext.deriveHostAndPortFromVipAddress | protected Pair<String, Integer> deriveHostAndPortFromVipAddress(String vipAddress)
throws URISyntaxException, ClientException {
Pair<String, Integer> hostAndPort = new Pair<String, Integer>(null, -1);
URI uri = new URI(vipAddress);
String scheme = uri.getScheme();
if (schem... | java | protected Pair<String, Integer> deriveHostAndPortFromVipAddress(String vipAddress)
throws URISyntaxException, ClientException {
Pair<String, Integer> hostAndPort = new Pair<String, Integer>(null, -1);
URI uri = new URI(vipAddress);
String scheme = uri.getScheme();
if (schem... | [
"protected",
"Pair",
"<",
"String",
",",
"Integer",
">",
"deriveHostAndPortFromVipAddress",
"(",
"String",
"vipAddress",
")",
"throws",
"URISyntaxException",
",",
"ClientException",
"{",
"Pair",
"<",
"String",
",",
"Integer",
">",
"hostAndPort",
"=",
"new",
"Pair"... | Derive the host and port from virtual address if virtual address is indeed contains the actual host
and port of the server. This is the final resort to compute the final URI in {@link #getServerFromLoadBalancer(java.net.URI, Object)}
if there is no load balancer available and the request URI is incomplete. Sub classes ... | [
"Derive",
"the",
"host",
"and",
"port",
"from",
"virtual",
"address",
"if",
"virtual",
"address",
"is",
"indeed",
"contains",
"the",
"actual",
"host",
"and",
"port",
"of",
"the",
"server",
".",
"This",
"is",
"the",
"final",
"resort",
"to",
"compute",
"the"... | d15cd7715b0bf2f64ae6ca98c5e4d184f178e261 | https://github.com/Netflix/ribbon/blob/d15cd7715b0bf2f64ae6ca98c5e4d184f178e261/ribbon-loadbalancer/src/main/java/com/netflix/loadbalancer/LoadBalancerContext.java#L408-L430 | train | Derive host and port from vip address. | Of course, here is the Java code you requested:
```java
protected Pair<String, Integer> deriveHostAndPortFromVipAddress(String vipAddress)
throws URISyntaxException, ClientException {
Pair<String, Integer> hostAndPort = new Pair<String, Integer>(null, -1);
URI uri = new URI(vipAddress);
... |
fuinorg/srcgen4javassist | src/main/java/org/fuin/srcgen4javassist/SgClass.java | SgClass.findClassByName | public final SgClass findClassByName(final String name) {
if (name == null) {
throw new IllegalArgumentException("The argument 'name' cannot be null!");
}
for (int i = 0; i < classes.size(); i++) {
final SgClass clasz = classes.get(i);
if (clasz.getName(... | java | public final SgClass findClassByName(final String name) {
if (name == null) {
throw new IllegalArgumentException("The argument 'name' cannot be null!");
}
for (int i = 0; i < classes.size(); i++) {
final SgClass clasz = classes.get(i);
if (clasz.getName(... | [
"public",
"final",
"SgClass",
"findClassByName",
"(",
"final",
"String",
"name",
")",
"{",
"if",
"(",
"name",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"The argument 'name' cannot be null!\"",
")",
";",
"}",
"for",
"(",
"int",
... | Find an inner class by it's name.
@param name
Full qualified name of the class to find - Cannot be null.
@return Class or null if it's not found. | [
"Find",
"an",
"inner",
"class",
"by",
"it",
"s",
"name",
"."
] | 355828113cfce3cdd3d69ba242c5bdfc7d899f2f | https://github.com/fuinorg/srcgen4javassist/blob/355828113cfce3cdd3d69ba242c5bdfc7d899f2f/src/main/java/org/fuin/srcgen4javassist/SgClass.java#L512-L523 | train | Find the class with the specified name. | Of course, here is the Java code you requested:
```java
public final SgClass findClassByName(final String name) {
if (name == null) {
throw new IllegalArgumentException("The argument 'name' cannot be null!");
}
for (int i = 0; i < classes.size(); i++) {
final SgClas... |
google/j2objc | jre_emul/android/platform/external/okhttp/okio/okio/src/main/java/okio/Okio.java | Okio.source | public static Source source(File file) throws FileNotFoundException {
if (file == null) throw new IllegalArgumentException("file == null");
return source(new FileInputStream(file));
} | java | public static Source source(File file) throws FileNotFoundException {
if (file == null) throw new IllegalArgumentException("file == null");
return source(new FileInputStream(file));
} | [
"public",
"static",
"Source",
"source",
"(",
"File",
"file",
")",
"throws",
"FileNotFoundException",
"{",
"if",
"(",
"file",
"==",
"null",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"file == null\"",
")",
";",
"return",
"source",
"(",
"new",
"File... | Returns a source that reads from {@code file}. | [
"Returns",
"a",
"source",
"that",
"reads",
"from",
"{"
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/okhttp/okio/okio/src/main/java/okio/Okio.java#L162-L165 | train | Creates a source from a file. | Of course, here is the Java code you requested:
```java
public static Source source(File file) throws FileNotFoundException {
if (file == null) throw new IllegalArgumentException("file == null");
return source(new FileInputStream(file));
}
```
Hope this helps! |
Azure/azure-sdk-for-java | servicebus/data-plane/azure-servicebus/src/main/java/com/microsoft/azure/servicebus/management/ManagementClientAsync.java | ManagementClientAsync.updateRuleAsync | public CompletableFuture<RuleDescription> updateRuleAsync(String topicName, String subscriptionName, RuleDescription ruleDescription) {
return putRuleAsync(topicName, subscriptionName, ruleDescription, true);
} | java | public CompletableFuture<RuleDescription> updateRuleAsync(String topicName, String subscriptionName, RuleDescription ruleDescription) {
return putRuleAsync(topicName, subscriptionName, ruleDescription, true);
} | [
"public",
"CompletableFuture",
"<",
"RuleDescription",
">",
"updateRuleAsync",
"(",
"String",
"topicName",
",",
"String",
"subscriptionName",
",",
"RuleDescription",
"ruleDescription",
")",
"{",
"return",
"putRuleAsync",
"(",
"topicName",
",",
"subscriptionName",
",",
... | Updates an existing rule.
@param topicName - Name of the topic.
@param subscriptionName - Name of the subscription.
@param ruleDescription - A {@link RuleDescription} object describing the attributes with which the rule will be updated.
@return {@link RuleDescription} of the updated rule.
@throws IllegalArgumentExcepti... | [
"Updates",
"an",
"existing",
"rule",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/servicebus/data-plane/azure-servicebus/src/main/java/com/microsoft/azure/servicebus/management/ManagementClientAsync.java#L720-L722 | train | Update rule async. | Of course, here is the Java code you requested:
```java
public CompletableFuture<RuleDescription> updateRuleAsync(String topicName, String subscriptionName, RuleDescription ruleDescription) {
return putRuleAsync(topicName, subscriptionName, ruleDescription, true);
}
```
Hope this helps! |
looly/hutool | hutool-poi/src/main/java/cn/hutool/poi/excel/style/StyleUtil.java | StyleUtil.createFont | public static Font createFont(Workbook workbook, short color, short fontSize, String fontName) {
final Font font = workbook.createFont();
return setFontStyle(font, color, fontSize, fontName);
} | java | public static Font createFont(Workbook workbook, short color, short fontSize, String fontName) {
final Font font = workbook.createFont();
return setFontStyle(font, color, fontSize, fontName);
} | [
"public",
"static",
"Font",
"createFont",
"(",
"Workbook",
"workbook",
",",
"short",
"color",
",",
"short",
"fontSize",
",",
"String",
"fontName",
")",
"{",
"final",
"Font",
"font",
"=",
"workbook",
".",
"createFont",
"(",
")",
";",
"return",
"setFontStyle",... | 创建字体
@param workbook {@link Workbook}
@param color 字体颜色
@param fontSize 字体大小
@param fontName 字体名称,可以为null使用默认字体
@return {@link Font} | [
"创建字体"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-poi/src/main/java/cn/hutool/poi/excel/style/StyleUtil.java#L120-L123 | train | Creates a font with the specified color and font size and font name. | Of course, here is the Java code you requested:
```java
public static Font createFont(Workbook workbook, short color, short fontSize, String fontName) {
final Font font = workbook.createFont();
return setFontStyle(font, color, fontSize, fontName);
}
```
Hope this helps! |
Azure/azure-storage-android | microsoft-azure-storage/src/com/microsoft/azure/storage/queue/CloudQueue.java | CloudQueue.delete | @DoesServiceRequest
public void delete(QueueRequestOptions options, OperationContext opContext) throws StorageException {
if (opContext == null) {
opContext = new OperationContext();
}
opContext.initialize();
options = QueueRequestOptions.populateAndApplyDefaults(options... | java | @DoesServiceRequest
public void delete(QueueRequestOptions options, OperationContext opContext) throws StorageException {
if (opContext == null) {
opContext = new OperationContext();
}
opContext.initialize();
options = QueueRequestOptions.populateAndApplyDefaults(options... | [
"@",
"DoesServiceRequest",
"public",
"void",
"delete",
"(",
"QueueRequestOptions",
"options",
",",
"OperationContext",
"opContext",
")",
"throws",
"StorageException",
"{",
"if",
"(",
"opContext",
"==",
"null",
")",
"{",
"opContext",
"=",
"new",
"OperationContext",
... | Deletes the queue, using the specified request options and operation context.
@param options
A {@link QueueRequestOptions} object that specifies any additional options for the request. Specifying
<code>null</code> will use the default request options from the associated service client (
{@link CloudQueueClient}).
@par... | [
"Deletes",
"the",
"queue",
"using",
"the",
"specified",
"request",
"options",
"and",
"operation",
"context",
"."
] | 2c643c37c6b8c9081058add284c601a2393afc93 | https://github.com/Azure/azure-storage-android/blob/2c643c37c6b8c9081058add284c601a2393afc93/microsoft-azure-storage/src/com/microsoft/azure/storage/queue/CloudQueue.java#L569-L580 | valid | Deletes a single language language | Of course, here is the Java code you requested:
```java
@DoesServiceRequest
public void delete(QueueRequestOptions options, OperationContext opContext) throws StorageException {
if (opContext == null) {
opContext = new OperationContext();
}
opContext.initialize();
optio... |
moparisthebest/beehive | beehive-netui-tags/src/main/java/org/apache/beehive/netui/databinding/datagrid/runtime/util/JspUtil.java | JspUtil.getPageContext | public static PageContext getPageContext(JspContext jspContext) {
if(!(jspContext instanceof PageContext))
throw new IllegalStateException(Bundle.getErrorString("DataGridUtil_IllegalJspContext", new Object[]{(jspContext != null ? jspContext.getClass().getName() : "null")}));
else
... | java | public static PageContext getPageContext(JspContext jspContext) {
if(!(jspContext instanceof PageContext))
throw new IllegalStateException(Bundle.getErrorString("DataGridUtil_IllegalJspContext", new Object[]{(jspContext != null ? jspContext.getClass().getName() : "null")}));
else
... | [
"public",
"static",
"PageContext",
"getPageContext",
"(",
"JspContext",
"jspContext",
")",
"{",
"if",
"(",
"!",
"(",
"jspContext",
"instanceof",
"PageContext",
")",
")",
"throw",
"new",
"IllegalStateException",
"(",
"Bundle",
".",
"getErrorString",
"(",
"\"DataGri... | Attempt to convert a {@link JspContext} into a {@link PageContext}.
@param jspContext the jsp context
@return the page context
@throws IllegalStateException if the {@link JspContext} can't be converted into a {@link PageContext} | [
"Attempt",
"to",
"convert",
"a",
"{"
] | 4246a0cc40ce3c05f1a02c2da2653ac622703d77 | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/databinding/datagrid/runtime/util/JspUtil.java#L63-L68 | train | Get the PageContext from the jspContext. | Of course, here is the Java code you requested:
```java
public static PageContext getPageContext(JspContext jspContext) {
if(!(jspContext instanceof PageContext))
throw new IllegalStateException(Bundle.getErrorString("DataGridUtil_IllegalJspContext", new Object[]{(jspContext != null ? jspContext.ge... |
aws/aws-sdk-java | aws-java-sdk-pinpoint/src/main/java/com/amazonaws/services/pinpoint/model/transform/EmailMessageMarshaller.java | EmailMessageMarshaller.marshall | public void marshall(EmailMessage emailMessage, ProtocolMarshaller protocolMarshaller) {
if (emailMessage == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(emailMessage.getBody(), BODY_BINDING);
... | java | public void marshall(EmailMessage emailMessage, ProtocolMarshaller protocolMarshaller) {
if (emailMessage == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(emailMessage.getBody(), BODY_BINDING);
... | [
"public",
"void",
"marshall",
"(",
"EmailMessage",
"emailMessage",
",",
"ProtocolMarshaller",
"protocolMarshaller",
")",
"{",
"if",
"(",
"emailMessage",
"==",
"null",
")",
"{",
"throw",
"new",
"SdkClientException",
"(",
"\"Invalid argument passed to marshall(...)\"",
")... | Marshall the given parameter object. | [
"Marshall",
"the",
"given",
"parameter",
"object",
"."
] | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-pinpoint/src/main/java/com/amazonaws/services/pinpoint/model/transform/EmailMessageMarshaller.java#L56-L73 | train | marshalls the given EmailMessage to the JSON object. | Of course, here is the Java code you requested:
```java
public void marshall(EmailMessage emailMessage, ProtocolMarshaller protocolMarshaller) {
if (emailMessage == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarsha... |
banq/jdonframework | src/main/java/com/jdon/async/disruptor/DisruptorFactory.java | DisruptorFactory.loadEvenHandler | protected Collection loadEvenHandler(String topic) {
Collection ehs = new ArrayList();
Collection<String> consumers = (Collection<String>) containerWrapper.lookup(ConsumerLoader.TOPICNAME + topic);
if (consumers == null || consumers.size() == 0) {
Debug.logWarning("[Jdonframework]there is no any consumer c... | java | protected Collection loadEvenHandler(String topic) {
Collection ehs = new ArrayList();
Collection<String> consumers = (Collection<String>) containerWrapper.lookup(ConsumerLoader.TOPICNAME + topic);
if (consumers == null || consumers.size() == 0) {
Debug.logWarning("[Jdonframework]there is no any consumer c... | [
"protected",
"Collection",
"loadEvenHandler",
"(",
"String",
"topic",
")",
"{",
"Collection",
"ehs",
"=",
"new",
"ArrayList",
"(",
")",
";",
"Collection",
"<",
"String",
">",
"consumers",
"=",
"(",
"Collection",
"<",
"String",
">",
")",
"containerWrapper",
"... | if there are many consumers, execution order will be alphabetical list by
Name of @Consumer class.
@param topic
@return | [
"if",
"there",
"are",
"many",
"consumers",
"execution",
"order",
"will",
"be",
"alphabetical",
"list",
"by",
"Name",
"of",
"@Consumer",
"class",
"."
] | 72b451caac04f775e57f52aaed3d8775044ead53 | https://github.com/banq/jdonframework/blob/72b451caac04f775e57f52aaed3d8775044ead53/src/main/java/com/jdon/async/disruptor/DisruptorFactory.java#L195-L209 | train | load even handler | Of course, here is the Java code you requested:
```java
protected Collection loadEvenHandler(String topic) {
Collection ehs = new ArrayList();
Collection<String> consumers = (Collection<String>) containerWrapper.lookup(ConsumerLoader.TOPICNAME + topic);
if (consumers == null || consumers.size() == 0) {
De... |
moleculer-java/moleculer-java | src/main/java/services/moleculer/breaker/CircuitBreaker.java | CircuitBreaker.stopped | @Override
public void stopped() {
// Stop timer
if (timer != null) {
timer.cancel(false);
timer = null;
}
// Remove counters and types
final long stamp = lock.writeLock();
try {
errorCounters.clear();
} finally {
lock.unlockWrite(stamp);
}
ignoredTypes.clear();
} | java | @Override
public void stopped() {
// Stop timer
if (timer != null) {
timer.cancel(false);
timer = null;
}
// Remove counters and types
final long stamp = lock.writeLock();
try {
errorCounters.clear();
} finally {
lock.unlockWrite(stamp);
}
ignoredTypes.clear();
} | [
"@",
"Override",
"public",
"void",
"stopped",
"(",
")",
"{",
"// Stop timer\r",
"if",
"(",
"timer",
"!=",
"null",
")",
"{",
"timer",
".",
"cancel",
"(",
"false",
")",
";",
"timer",
"=",
"null",
";",
"}",
"// Remove counters and types\r",
"final",
"long",
... | --- STOP BREAKER --- | [
"---",
"STOP",
"BREAKER",
"---"
] | 27575c44b9ecacc17c4456ceacf5d1851abf1cc4 | https://github.com/moleculer-java/moleculer-java/blob/27575c44b9ecacc17c4456ceacf5d1851abf1cc4/src/main/java/services/moleculer/breaker/CircuitBreaker.java#L133-L150 | train | Called by the application to inform us that the application has stopped. | Of course, here is the Java code you requested:
```java
@Override
public void stopped() {
// Stop timer
if (timer != null) {
timer.cancel(false);
timer = null;
}
// Remove counters and types
final long stamp = lock.writeLock();
try {
errorCounters.clear();
} finally {
loc... |
m-m-m/util | text/src/main/java/net/sf/mmm/util/text/base/UnicodeUtilImpl.java | UnicodeUtilImpl.initIso843 | private static void initIso843(Map<Character, String> map) {
// Greek letters
map.put(GREEK_CAPITAL_LETTER_ALPHA, "A");
map.put(GREEK_CAPITAL_LETTER_BETA, "B");
map.put(GREEK_CAPITAL_LETTER_GAMMA, "G");
map.put(GREEK_CAPITAL_LETTER_DELTA, "D");
map.put(GREEK_CAPITAL_LETTER_EPSILON, "E");
ma... | java | private static void initIso843(Map<Character, String> map) {
// Greek letters
map.put(GREEK_CAPITAL_LETTER_ALPHA, "A");
map.put(GREEK_CAPITAL_LETTER_BETA, "B");
map.put(GREEK_CAPITAL_LETTER_GAMMA, "G");
map.put(GREEK_CAPITAL_LETTER_DELTA, "D");
map.put(GREEK_CAPITAL_LETTER_EPSILON, "E");
ma... | [
"private",
"static",
"void",
"initIso843",
"(",
"Map",
"<",
"Character",
",",
"String",
">",
"map",
")",
"{",
"// Greek letters",
"map",
".",
"put",
"(",
"GREEK_CAPITAL_LETTER_ALPHA",
",",
"\"A\"",
")",
";",
"map",
".",
"put",
"(",
"GREEK_CAPITAL_LETTER_BETA",... | Implementation of <a href="http://en.wikipedia.org/wiki/ISO_843">ISO 843</a> (Greek transliteration).
@param map is where to add the transliteration mapping. | [
"Implementation",
"of",
"<a",
"href",
"=",
"http",
":",
"//",
"en",
".",
"wikipedia",
".",
"org",
"/",
"wiki",
"/",
"ISO_843",
">",
"ISO",
"843<",
"/",
"a",
">",
"(",
"Greek",
"transliteration",
")",
"."
] | f0e4e084448f8dfc83ca682a9e1618034a094ce6 | https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/text/src/main/java/net/sf/mmm/util/text/base/UnicodeUtilImpl.java#L304-L370 | train | Initialize the ISO 843 mapping. | Of course, here is the Java code you requested:
```java
private static void initIso843(Map<Character, String> map) {
// Greek letters
map.put(GREEK_CAPITAL_LETTER_ALPHA, "A");
map.put(GREEK_CAPITAL_LETTER_BETA, "B");
map.put(GREEK_CAPITAL_LETTER_GAMMA, "G");
map.put(GREEK_CAPITAL_LETTER_DELTA, "D"... |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/ContainerTx.java | ContainerTx.releaseResources | protected void releaseResources()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "releaseResources : State = " + stateStrs[state]);
// If the state is not complete, then the ContainerTx should not
// be cleared, and should not be returned to the ... | java | protected void releaseResources()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "releaseResources : State = " + stateStrs[state]);
// If the state is not complete, then the ContainerTx should not
// be cleared, and should not be returned to the ... | [
"protected",
"void",
"releaseResources",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"releaseResources : State = \"",
"+",
"stateStrs"... | d154342.10 d215317 | [
"d154342",
".",
"10",
"d215317"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/ContainerTx.java#L1747-L1780 | train | This method is called by the ContainerTx when the ContainerTx is complete. | Of course, here is the Java code you requested:
```java
protected void releaseResources()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "releaseResources : State = " + stateStrs[state]);
// If the state is not complete, then the ContainerTx should not
... |
google/closure-compiler | src/com/google/javascript/jscomp/NodeUtil.java | NodeUtil.isDeclarationLValue | public static boolean isDeclarationLValue(Node n) {
boolean isLValue = isLValue(n);
if (!isLValue) {
return false;
}
Node parent = n.getParent();
switch (parent.getToken()) {
case IMPORT_SPEC:
case VAR:
case LET:
case CONST:
case PARAM_LIST:
case IMPORT:
... | java | public static boolean isDeclarationLValue(Node n) {
boolean isLValue = isLValue(n);
if (!isLValue) {
return false;
}
Node parent = n.getParent();
switch (parent.getToken()) {
case IMPORT_SPEC:
case VAR:
case LET:
case CONST:
case PARAM_LIST:
case IMPORT:
... | [
"public",
"static",
"boolean",
"isDeclarationLValue",
"(",
"Node",
"n",
")",
"{",
"boolean",
"isLValue",
"=",
"isLValue",
"(",
"n",
")",
";",
"if",
"(",
"!",
"isLValue",
")",
"{",
"return",
"false",
";",
"}",
"Node",
"parent",
"=",
"n",
".",
"getParent... | Determines whether this node is used as an L-value that is a declaration.
<p><code>x = 5;</code> is an L-value but does not declare a variable. | [
"Determines",
"whether",
"this",
"node",
"is",
"used",
"as",
"an",
"L",
"-",
"value",
"that",
"is",
"a",
"declaration",
"."
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/NodeUtil.java#L3375-L3403 | train | Checks if n is a declaration of a C ++ L - Value. | Of course, here is the Java code you requested:
```java
public static boolean isDeclarationLValue(Node n) {
boolean isLValue = isLValue(n);
if (!isLValue) {
return false;
}
Node parent = n.getParent();
switch (parent.getToken()) {
case IMPORT_SPEC:
case VAR:
case LET:
... |
wkgcass/Style | src/main/java/net/cassite/style/reflect/FieldSupport.java | FieldSupport.set | public FieldSupport<FieldType, ObjectType> set(ObjectType obj, Object toSet) {
try {
f.setAccessible(true);
f.set(obj, toSet);
return this;
} catch (Exception e) {
throw $(e);
... | java | public FieldSupport<FieldType, ObjectType> set(ObjectType obj, Object toSet) {
try {
f.setAccessible(true);
f.set(obj, toSet);
return this;
} catch (Exception e) {
throw $(e);
... | [
"public",
"FieldSupport",
"<",
"FieldType",
",",
"ObjectType",
">",
"set",
"(",
"ObjectType",
"obj",
",",
"Object",
"toSet",
")",
"{",
"try",
"{",
"f",
".",
"setAccessible",
"(",
"true",
")",
";",
"f",
".",
"set",
"(",
"obj",
",",
"toSet",
")",
";",
... | set accessible to 'true' then set field value
@param obj the object whose field should be modified
@param toSet the new value for the field of obj being modified
@return <code>this</code> | [
"set",
"accessible",
"to",
"true",
"then",
"set",
"field",
"value"
] | db3ea64337251f46f734279480e365293bececbd | https://github.com/wkgcass/Style/blob/db3ea64337251f46f734279480e365293bececbd/src/main/java/net/cassite/style/reflect/FieldSupport.java#L88-L96 | train | Sets the value of the field toSet. | Of course, here is the Java code you requested:
```java
public FieldSupport<FieldType, ObjectType> set(ObjectType obj, Object toSet) {
try {
f.setAccessible(true);
f.set(obj, toSet);
return this;
} catch (Exception ... |
RestComm/jss7 | mtp/mtp-impl/src/main/java/org/restcomm/protocols/ss7/mtp/Mtp2.java | Mtp2.processRx | private void processRx(byte[] buff, int len) {
int i = 0;
// start HDLC alg
while (i < len) {
while (rxState.bits <= 24 && i < len) {
int b = buff[i++] & 0xff;
hdlc.fasthdlc_rx_load_nocheck(rxState, b);
if (rxState.state == 0) {
... | java | private void processRx(byte[] buff, int len) {
int i = 0;
// start HDLC alg
while (i < len) {
while (rxState.bits <= 24 && i < len) {
int b = buff[i++] & 0xff;
hdlc.fasthdlc_rx_load_nocheck(rxState, b);
if (rxState.state == 0) {
... | [
"private",
"void",
"processRx",
"(",
"byte",
"[",
"]",
"buff",
",",
"int",
"len",
")",
"{",
"int",
"i",
"=",
"0",
";",
"// start HDLC alg",
"while",
"(",
"i",
"<",
"len",
")",
"{",
"while",
"(",
"rxState",
".",
"bits",
"<=",
"24",
"&&",
"i",
"<",... | Handles received data.
@param buff the buffer which conatins received data.
@param len the number of received bytes. | [
"Handles",
"received",
"data",
"."
] | 402b4b3984e581c581e309cb5f6a858fde6dbc33 | https://github.com/RestComm/jss7/blob/402b4b3984e581c581e309cb5f6a858fde6dbc33/mtp/mtp-impl/src/main/java/org/restcomm/protocols/ss7/mtp/Mtp2.java#L974-L1037 | train | Process the received data. | Of course, here is the Java code you requested:
```java
private void processRx(byte[] buff, int len) {
int i = 0;
// start HDLC alg
while (i < len) {
while (rxState.bits <= 24 && i < len) {
int b = buff[i++] & 0xff;
hdlc.fasthdlc_rx_load_nocheck(rxSta... |
citrusframework/citrus | modules/citrus-core/src/main/java/com/consol/citrus/variable/dictionary/AbstractDataDictionary.java | AbstractDataDictionary.convertIfNecessary | protected <T> T convertIfNecessary(String value, T originalValue) {
if (originalValue == null) {
return (T) value;
}
return TypeConversionUtils.convertIfNecessary(value, (Class<T>) originalValue.getClass());
} | java | protected <T> T convertIfNecessary(String value, T originalValue) {
if (originalValue == null) {
return (T) value;
}
return TypeConversionUtils.convertIfNecessary(value, (Class<T>) originalValue.getClass());
} | [
"protected",
"<",
"T",
">",
"T",
"convertIfNecessary",
"(",
"String",
"value",
",",
"T",
"originalValue",
")",
"{",
"if",
"(",
"originalValue",
"==",
"null",
")",
"{",
"return",
"(",
"T",
")",
"value",
";",
"}",
"return",
"TypeConversionUtils",
".",
"con... | Convert to original value type if necessary.
@param value
@param originalValue
@param <T>
@return | [
"Convert",
"to",
"original",
"value",
"type",
"if",
"necessary",
"."
] | 55c58ef74c01d511615e43646ca25c1b2301c56d | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/variable/dictionary/AbstractDataDictionary.java#L62-L68 | train | Convert the value to a type if necessary. | Of course, here is the Java code you requested:
```java
protected <T> T convertIfNecessary(String value, T originalValue) {
if (originalValue == null) {
return (T) value;
}
return TypeConversionUtils.convertIfNecessary(value, (Class<T>) originalValue.getClass());
}
```
Hope th... |
tango-controls/JTango | dao/src/main/java/fr/esrf/TangoApi/DatabaseDAODefaultImpl.java | DatabaseDAODefaultImpl.get_host_list | public String[] get_host_list(Database database) throws DevFailed {
if (!database.isAccess_checked()) checkAccess(database);
// Query info from database
DeviceData argIn = new DeviceData();
argIn.insert("*");
DeviceData argOut = command_inout(database, "DbGetHostList", argIn);
... | java | public String[] get_host_list(Database database) throws DevFailed {
if (!database.isAccess_checked()) checkAccess(database);
// Query info from database
DeviceData argIn = new DeviceData();
argIn.insert("*");
DeviceData argOut = command_inout(database, "DbGetHostList", argIn);
... | [
"public",
"String",
"[",
"]",
"get_host_list",
"(",
"Database",
"database",
")",
"throws",
"DevFailed",
"{",
"if",
"(",
"!",
"database",
".",
"isAccess_checked",
"(",
")",
")",
"checkAccess",
"(",
"database",
")",
";",
"//\tQuery info from database",
"DeviceData... | ========================================================================== | [
"=========================================================================="
] | 1ccc9dcb83e6de2359a9f1906d170571cacf1345 | https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/dao/src/main/java/fr/esrf/TangoApi/DatabaseDAODefaultImpl.java#L169-L177 | train | Get the host list of the database | Of course, here is the Java code you requested:
```java
public String[] get_host_list(Database database) throws DevFailed {
if (!database.isAccess_checked()) checkAccess(database);
// Query info from database
DeviceData argIn = new DeviceData();
argIn.insert("*");
DeviceData ar... |
Karumi/Dexter | dexter/src/main/java/com/karumi/dexter/DexterInstance.java | DexterInstance.checkPermission | void checkPermission(PermissionListener listener, String permission, Thread thread) {
checkSinglePermission(listener, permission, thread);
} | java | void checkPermission(PermissionListener listener, String permission, Thread thread) {
checkSinglePermission(listener, permission, thread);
} | [
"void",
"checkPermission",
"(",
"PermissionListener",
"listener",
",",
"String",
"permission",
",",
"Thread",
"thread",
")",
"{",
"checkSinglePermission",
"(",
"listener",
",",
"permission",
",",
"thread",
")",
";",
"}"
] | Checks the state of a specific permission reporting it when ready to the listener.
@param listener The class that will be reported when the state of the permission is ready
@param permission One of the values found in {@link android.Manifest.permission}
@param thread thread the Listener methods will be called on | [
"Checks",
"the",
"state",
"of",
"a",
"specific",
"permission",
"reporting",
"it",
"when",
"ready",
"to",
"the",
"listener",
"."
] | 11cfa35a2eaa51f01f6678adb69bed0382a867e7 | https://github.com/Karumi/Dexter/blob/11cfa35a2eaa51f01f6678adb69bed0382a867e7/dexter/src/main/java/com/karumi/dexter/DexterInstance.java#L85-L87 | train | Check permission. | Of course, here is the Java code you requested:
```java
void checkPermission(PermissionListener listener, String permission, Thread thread) {
checkSinglePermission(listener, permission, thread);
}
```
Hope this helps! |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/lang/reflect/ReflectionUtils.java | ReflectionUtils.getArgumentTypes | @NullSafe
public static Class[] getArgumentTypes(Object... arguments) {
Class[] argumentTypes = null;
if (arguments != null) {
argumentTypes = new Class[arguments.length];
for (int index = 0; index < arguments.length; index++) {
argumentTypes[index] = getClass(arguments[index]);
}
... | java | @NullSafe
public static Class[] getArgumentTypes(Object... arguments) {
Class[] argumentTypes = null;
if (arguments != null) {
argumentTypes = new Class[arguments.length];
for (int index = 0; index < arguments.length; index++) {
argumentTypes[index] = getClass(arguments[index]);
}
... | [
"@",
"NullSafe",
"public",
"static",
"Class",
"[",
"]",
"getArgumentTypes",
"(",
"Object",
"...",
"arguments",
")",
"{",
"Class",
"[",
"]",
"argumentTypes",
"=",
"null",
";",
"if",
"(",
"arguments",
"!=",
"null",
")",
"{",
"argumentTypes",
"=",
"new",
"C... | Determines the class types for all the given arguments.
@param arguments the array of (object) arguments from which to determine their class types.
@return an array of class types for each object in the array of arguments, or null if the given array is null.
This method is careful to guard against null elements given ... | [
"Determines",
"the",
"class",
"types",
"for",
"all",
"the",
"given",
"arguments",
"."
] | f2163c149fbbef05015e688132064ebcac7c49ab | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/lang/reflect/ReflectionUtils.java#L69-L82 | train | Gets the argument types. | Of course, here is the Java code you requested:
```java
@NullSafe
public static Class[] getArgumentTypes(Object... arguments) {
Class[] argumentTypes = null;
if (arguments != null) {
argumentTypes = new Class[arguments.length];
for (int index = 0; index < arguments.length; index++) {
ar... |
robolectric/robolectric | shadows/framework/src/main/java/org/robolectric/shadows/ShadowDisplay.java | ShadowDisplay.setRotation | public void setRotation(int rotation) {
if (isJB()) {
this.rotation = rotation;
} else {
ShadowDisplayManager.changeDisplay(realObject.getDisplayId(),
di -> di.rotation = rotation);
}
} | java | public void setRotation(int rotation) {
if (isJB()) {
this.rotation = rotation;
} else {
ShadowDisplayManager.changeDisplay(realObject.getDisplayId(),
di -> di.rotation = rotation);
}
} | [
"public",
"void",
"setRotation",
"(",
"int",
"rotation",
")",
"{",
"if",
"(",
"isJB",
"(",
")",
")",
"{",
"this",
".",
"rotation",
"=",
"rotation",
";",
"}",
"else",
"{",
"ShadowDisplayManager",
".",
"changeDisplay",
"(",
"realObject",
".",
"getDisplayId",... | Changes the rotation for this display.
Any registered {@link android.hardware.display.DisplayManager.DisplayListener}s will be
notified of the change.
@param rotation one of {@link Surface#ROTATION_0}, {@link Surface#ROTATION_90},
{@link Surface#ROTATION_180}, {@link Surface#ROTATION_270} | [
"Changes",
"the",
"rotation",
"for",
"this",
"display",
"."
] | 4fa79a2c72f8abbf742ab920419653c207b41d62 | https://github.com/robolectric/robolectric/blob/4fa79a2c72f8abbf742ab920419653c207b41d62/shadows/framework/src/main/java/org/robolectric/shadows/ShadowDisplay.java#L367-L374 | valid | Sets the rotation of the CRA. | Of course, here is the Java code you requested:
```java
public void setRotation(int rotation) {
if (isJB()) {
this.rotation = rotation;
} else {
ShadowDisplayManager.changeDisplay(realObject.getDisplayId(),
di -> di.rotation = rotation);
}
}
```
Hope this helps! |
Azure/azure-sdk-for-java | compute/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/compute/v2018_04_01/implementation/SnapshotsInner.java | SnapshotsInner.beginCreateOrUpdateAsync | public ServiceFuture<SnapshotInner> beginCreateOrUpdateAsync(String resourceGroupName, String snapshotName, SnapshotInner snapshot, final ServiceCallback<SnapshotInner> serviceCallback) {
return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, snapshotName, snapshot), se... | java | public ServiceFuture<SnapshotInner> beginCreateOrUpdateAsync(String resourceGroupName, String snapshotName, SnapshotInner snapshot, final ServiceCallback<SnapshotInner> serviceCallback) {
return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, snapshotName, snapshot), se... | [
"public",
"ServiceFuture",
"<",
"SnapshotInner",
">",
"beginCreateOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"snapshotName",
",",
"SnapshotInner",
"snapshot",
",",
"final",
"ServiceCallback",
"<",
"SnapshotInner",
">",
"serviceCallback",
")",
"{"... | Creates or updates a snapshot.
@param resourceGroupName The name of the resource group.
@param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters.
@param sn... | [
"Creates",
"or",
"updates",
"a",
"snapshot",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/compute/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/compute/v2018_04_01/implementation/SnapshotsInner.java#L235-L237 | train | Creates or updates a snapshot. | Of course, here is the Java code you requested:
```java
public ServiceFuture<SnapshotInner> beginCreateOrUpdateAsync(String resourceGroupName, String snapshotName, SnapshotInner snapshot, final ServiceCallback<SnapshotInner> serviceCallback) {
return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceRes... |
RestComm/sip-servlets | sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/core/session/SipListenersHolder.java | SipListenersHolder.addListenerToBunch | protected void addListenerToBunch(EventListener listener) {
boolean added = false;
if (listener instanceof SipApplicationSessionAttributeListener) {
this.addListener((SipApplicationSessionAttributeListener) listener);
added = true;
}
if (listener instanceof SipApplicationSessionBindingListener) {
this... | java | protected void addListenerToBunch(EventListener listener) {
boolean added = false;
if (listener instanceof SipApplicationSessionAttributeListener) {
this.addListener((SipApplicationSessionAttributeListener) listener);
added = true;
}
if (listener instanceof SipApplicationSessionBindingListener) {
this... | [
"protected",
"void",
"addListenerToBunch",
"(",
"EventListener",
"listener",
")",
"{",
"boolean",
"added",
"=",
"false",
";",
"if",
"(",
"listener",
"instanceof",
"SipApplicationSessionAttributeListener",
")",
"{",
"this",
".",
"addListener",
"(",
"(",
"SipApplicati... | } | [
"}"
] | fd7011d2803ab1d205b140768a760c8c69e0c997 | https://github.com/RestComm/sip-servlets/blob/fd7011d2803ab1d205b140768a760c8c69e0c997/sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/core/session/SipListenersHolder.java#L137-L218 | train | Add a listener to the Bunch. | Of course, here is the Java code you requested:
```java
protected void addListenerToBunch(EventListener listener) {
boolean added = false;
if (listener instanceof SipApplicationSessionAttributeListener) {
this.addListener((SipApplicationSessionAttributeListener) listener);
added = true;
}
if (listener i... |
MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/com/send/parameters/DateParameter.java | DateParameter.writeTo | public void writeTo(final PacketOutputStream os) throws IOException {
os.write(QUOTE);
os.write(dateByteFormat());
os.write(QUOTE);
} | java | public void writeTo(final PacketOutputStream os) throws IOException {
os.write(QUOTE);
os.write(dateByteFormat());
os.write(QUOTE);
} | [
"public",
"void",
"writeTo",
"(",
"final",
"PacketOutputStream",
"os",
")",
"throws",
"IOException",
"{",
"os",
".",
"write",
"(",
"QUOTE",
")",
";",
"os",
".",
"write",
"(",
"dateByteFormat",
"(",
")",
")",
";",
"os",
".",
"write",
"(",
"QUOTE",
")",
... | Write to server OutputStream in text protocol.
@param os output buffer | [
"Write",
"to",
"server",
"OutputStream",
"in",
"text",
"protocol",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/com/send/parameters/DateParameter.java#L89-L93 | train | Write the data to the packet output stream. | Of course, here is the Java code you requested:
```java
public void writeTo(final PacketOutputStream os) throws IOException {
os.write(QUOTE);
os.write(dateByteFormat());
os.write(QUOTE);
}
```
Hope this helps! |
pgjdbc/pgjdbc | pgjdbc/src/main/java/org/postgresql/geometric/PGpoint.java | PGpoint.toBytes | public void toBytes(byte[] b, int offset) {
ByteConverter.float8(b, offset, x);
ByteConverter.float8(b, offset + 8, y);
} | java | public void toBytes(byte[] b, int offset) {
ByteConverter.float8(b, offset, x);
ByteConverter.float8(b, offset + 8, y);
} | [
"public",
"void",
"toBytes",
"(",
"byte",
"[",
"]",
"b",
",",
"int",
"offset",
")",
"{",
"ByteConverter",
".",
"float8",
"(",
"b",
",",
"offset",
",",
"x",
")",
";",
"ByteConverter",
".",
"float8",
"(",
"b",
",",
"offset",
"+",
"8",
",",
"y",
")"... | Populate the byte array with PGpoint in the binary syntax expected by org.postgresql. | [
"Populate",
"the",
"byte",
"array",
"with",
"PGpoint",
"in",
"the",
"binary",
"syntax",
"expected",
"by",
"org",
".",
"postgresql",
"."
] | 95ba7b261e39754674c5817695ae5ebf9a341fae | https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/geometric/PGpoint.java#L121-L124 | train | Converts the float8 value to a byte array. | Of course, here is the Java code you requested:
```java
public void toBytes(byte[] b, int offset) {
ByteConverter.float8(b, offset, x);
ByteConverter.float8(b, offset + 8, y);
}
```
Hope this helps! |
spring-projects/spring-security | web/src/main/java/org/springframework/security/web/authentication/ui/DefaultLogoutPageGeneratingFilter.java | DefaultLogoutPageGeneratingFilter.setResolveHiddenInputs | public void setResolveHiddenInputs(
Function<HttpServletRequest, Map<String, String>> resolveHiddenInputs) {
Assert.notNull(resolveHiddenInputs, "resolveHiddenInputs cannot be null");
this.resolveHiddenInputs = resolveHiddenInputs;
} | java | public void setResolveHiddenInputs(
Function<HttpServletRequest, Map<String, String>> resolveHiddenInputs) {
Assert.notNull(resolveHiddenInputs, "resolveHiddenInputs cannot be null");
this.resolveHiddenInputs = resolveHiddenInputs;
} | [
"public",
"void",
"setResolveHiddenInputs",
"(",
"Function",
"<",
"HttpServletRequest",
",",
"Map",
"<",
"String",
",",
"String",
">",
">",
"resolveHiddenInputs",
")",
"{",
"Assert",
".",
"notNull",
"(",
"resolveHiddenInputs",
",",
"\"resolveHiddenInputs cannot be nul... | Sets a Function used to resolve a Map of the hidden inputs where the key is the
name of the input and the value is the value of the input. Typically this is used
to resolve the CSRF token.
@param resolveHiddenInputs the function to resolve the inputs | [
"Sets",
"a",
"Function",
"used",
"to",
"resolve",
"a",
"Map",
"of",
"the",
"hidden",
"inputs",
"where",
"the",
"key",
"is",
"the",
"name",
"of",
"the",
"input",
"and",
"the",
"value",
"is",
"the",
"value",
"of",
"the",
"input",
".",
"Typically",
"this"... | 98a8467e4c2ae05b3e09c67ece856944fa48ed23 | https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/web/src/main/java/org/springframework/security/web/authentication/ui/DefaultLogoutPageGeneratingFilter.java#L90-L94 | test | Sets the function that will be called when the hidden inputs should be resolved. | Of course, here is the Java code you requested:
```java
public void setResolveHiddenInputs(
Function<HttpServletRequest, Map<String, String>> resolveHiddenInputs) {
Assert.notNull(resolveHiddenInputs, "resolveHiddenInputs cannot be null");
this.resolveHiddenInputs = resolveHiddenInputs;
}
```
Hope this helps! |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/processor/XSLTElementProcessor.java | XSLTElementProcessor.ignorableWhitespace | public void ignorableWhitespace(
StylesheetHandler handler, char ch[], int start, int length)
throws org.xml.sax.SAXException
{
// no op
} | java | public void ignorableWhitespace(
StylesheetHandler handler, char ch[], int start, int length)
throws org.xml.sax.SAXException
{
// no op
} | [
"public",
"void",
"ignorableWhitespace",
"(",
"StylesheetHandler",
"handler",
",",
"char",
"ch",
"[",
"]",
",",
"int",
"start",
",",
"int",
"length",
")",
"throws",
"org",
".",
"xml",
".",
"sax",
".",
"SAXException",
"{",
"// no op",
"}"
] | Receive notification of ignorable whitespace in element content.
@param handler non-null reference to current StylesheetHandler that is constructing the Templates.
@param ch The whitespace characters.
@param start The start position in the character array.
@param length The number of characters to use from the
charac... | [
"Receive",
"notification",
"of",
"ignorable",
"whitespace",
"in",
"element",
"content",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/processor/XSLTElementProcessor.java#L215-L221 | train | Ignorable whitespace is not supported. | Of course, here is the Java code you requested:
```java
public void ignorableWhitespace(
StylesheetHandler handler, char ch[], int start, int length)
throws org.xml.sax.SAXException
{
// no op
}
```
Hope this helps! |
alkacon/opencms-core | src-modules/org/opencms/workplace/list/CmsListMetadata.java | CmsListMetadata.addColumn | public void addColumn(CmsListColumnDefinition listColumn, int position) {
setListIdForColumn(listColumn);
if (m_columns.elementList().isEmpty()) {
listColumn.setPrintable(true);
} else {
listColumn.setPrintable(listColumn.isSorteable());
}
if ((listColumn... | java | public void addColumn(CmsListColumnDefinition listColumn, int position) {
setListIdForColumn(listColumn);
if (m_columns.elementList().isEmpty()) {
listColumn.setPrintable(true);
} else {
listColumn.setPrintable(listColumn.isSorteable());
}
if ((listColumn... | [
"public",
"void",
"addColumn",
"(",
"CmsListColumnDefinition",
"listColumn",
",",
"int",
"position",
")",
"{",
"setListIdForColumn",
"(",
"listColumn",
")",
";",
"if",
"(",
"m_columns",
".",
"elementList",
"(",
")",
".",
"isEmpty",
"(",
")",
")",
"{",
"listC... | Adds a new column definition at the given position.<p>
By default a column is printable if it is the first column in the list,
or if it is sorteable.<p>
If you want to override this behaviour, use the
{@link CmsListColumnDefinition#setPrintable(boolean)}
method after calling this one.
@param listColumn the column de... | [
"Adds",
"a",
"new",
"column",
"definition",
"at",
"the",
"given",
"position",
".",
"<p",
">"
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/list/CmsListMetadata.java#L152-L164 | train | Adds a column to the table. | Of course, here is the Java code you requested:
```java
public void addColumn(CmsListColumnDefinition listColumn, int position) {
setListIdForColumn(listColumn);
if (m_columns.elementList().isEmpty()) {
listColumn.setPrintable(true);
} else {
listColumn.setPrintable(lis... |
pac4j/pac4j | pac4j-core/src/main/java/org/pac4j/core/profile/BasicUserProfile.java | BasicUserProfile.getAuthenticationAttribute | public Object getAuthenticationAttribute(final String name) {
return ProfileHelper.getInternalAttributeHandler().restore(this.authenticationAttributes.get(name));
} | java | public Object getAuthenticationAttribute(final String name) {
return ProfileHelper.getInternalAttributeHandler().restore(this.authenticationAttributes.get(name));
} | [
"public",
"Object",
"getAuthenticationAttribute",
"(",
"final",
"String",
"name",
")",
"{",
"return",
"ProfileHelper",
".",
"getInternalAttributeHandler",
"(",
")",
".",
"restore",
"(",
"this",
".",
"authenticationAttributes",
".",
"get",
"(",
"name",
")",
")",
... | Return the authentication attribute with name.
@param name authentication attribute name
@return the authentication attribute with name | [
"Return",
"the",
"authentication",
"attribute",
"with",
"name",
"."
] | d9cd029f8783792b31dd48bf1e32f80628f2c4a3 | https://github.com/pac4j/pac4j/blob/d9cd029f8783792b31dd48bf1e32f80628f2c4a3/pac4j-core/src/main/java/org/pac4j/core/profile/BasicUserProfile.java#L260-L262 | train | Get authentication attribute. | Of course, here is the Java code you requested:
```java
public Object getAuthenticationAttribute(final String name) {
return ProfileHelper.getInternalAttributeHandler().restore(this.authenticationAttributes.get(name));
}
```
Hope this helps! |
spotify/helios | helios-client/src/main/java/com/spotify/helios/client/HeliosClient.java | HeliosClient.listHosts | public ListenableFuture<List<String>> listHosts(final Set<String> unparsedHostSelectors) {
final Multimap<String, String> query = HashMultimap.create();
query.putAll("selector", unparsedHostSelectors);
return listHosts(query);
} | java | public ListenableFuture<List<String>> listHosts(final Set<String> unparsedHostSelectors) {
final Multimap<String, String> query = HashMultimap.create();
query.putAll("selector", unparsedHostSelectors);
return listHosts(query);
} | [
"public",
"ListenableFuture",
"<",
"List",
"<",
"String",
">",
">",
"listHosts",
"(",
"final",
"Set",
"<",
"String",
">",
"unparsedHostSelectors",
")",
"{",
"final",
"Multimap",
"<",
"String",
",",
"String",
">",
"query",
"=",
"HashMultimap",
".",
"create",
... | Returns a list of all hosts registered in the Helios cluster which match the given list of
host
selectors.
<p>
For example, {@code listHosts(Arrays.asList("site=foo"))} will return all agents in the
cluster whose labels match the expression {@code site=foo}.</p> | [
"Returns",
"a",
"list",
"of",
"all",
"hosts",
"registered",
"in",
"the",
"Helios",
"cluster",
"which",
"match",
"the",
"given",
"list",
"of",
"host",
"selectors",
".",
"<p",
">",
"For",
"example",
"{"
] | c9000bc1d6908651570be8b057d4981bba4df5b4 | https://github.com/spotify/helios/blob/c9000bc1d6908651570be8b057d4981bba4df5b4/helios-client/src/main/java/com/spotify/helios/client/HeliosClient.java#L386-L391 | train | List hosts. | Of course, here is the Java code you requested:
```java
public ListenableFuture<List<String>> listHosts(final Set<String> unparsedHostSelectors) {
final Multimap<String, String> query = HashMultimap.create();
query.putAll("selector", unparsedHostSelectors);
return listHosts(query);
}
```
Hope this help... |
alkacon/opencms-core | src/org/opencms/ui/apps/sitemanager/CmsEditSiteForm.java | CmsEditSiteForm.isValidAliase | boolean isValidAliase() {
boolean ret = true;
for (I_CmsEditableGroupRow row : m_aliasGroup.getRows()) {
FormLayout layout = (FormLayout)(row.getComponent());
TextField field = (TextField)layout.getComponent(0);
ret = ret & field.isValid();
}
return ... | java | boolean isValidAliase() {
boolean ret = true;
for (I_CmsEditableGroupRow row : m_aliasGroup.getRows()) {
FormLayout layout = (FormLayout)(row.getComponent());
TextField field = (TextField)layout.getComponent(0);
ret = ret & field.isValid();
}
return ... | [
"boolean",
"isValidAliase",
"(",
")",
"{",
"boolean",
"ret",
"=",
"true",
";",
"for",
"(",
"I_CmsEditableGroupRow",
"row",
":",
"m_aliasGroup",
".",
"getRows",
"(",
")",
")",
"{",
"FormLayout",
"layout",
"=",
"(",
"FormLayout",
")",
"(",
"row",
".",
"get... | Are the aliase valid?<p>
@return true if ok | [
"Are",
"the",
"aliase",
"valid?<p",
">"
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/apps/sitemanager/CmsEditSiteForm.java#L1294-L1304 | train | Checks if the alias is valid. | Of course, here is the Java code you requested:
```java
boolean isValidAliase() {
boolean ret = true;
for (I_CmsEditableGroupRow row : m_aliasGroup.getRows()) {
FormLayout layout = (FormLayout)(row.getComponent());
TextField field = (TextField)layout.getComponent(0);
... |
nutzam/ssdb4j | src/main/java/org/nutz/ssdb4j/SSDBs.java | SSDBs.simple | public static final SSDB simple(String host, int port, int timeout) {
return new SimpleClient(host, port, timeout);
} | java | public static final SSDB simple(String host, int port, int timeout) {
return new SimpleClient(host, port, timeout);
} | [
"public",
"static",
"final",
"SSDB",
"simple",
"(",
"String",
"host",
",",
"int",
"port",
",",
"int",
"timeout",
")",
"{",
"return",
"new",
"SimpleClient",
"(",
"host",
",",
"port",
",",
"timeout",
")",
";",
"}"
] | 指定配置生成一个单连接的客户端
@param host 主机名
@param port 端口
@param timeout 超时设置 | [
"指定配置生成一个单连接的客户端"
] | 9d907857b9bbf5d068c72e5fc7590df24db63862 | https://github.com/nutzam/ssdb4j/blob/9d907857b9bbf5d068c72e5fc7590df24db63862/src/main/java/org/nutz/ssdb4j/SSDBs.java#L52-L54 | test | Create a simple SSDB connection. | Of course, here is the Java code you requested:
```java
public static final SSDB simple(String host, int port, int timeout) {
return new SimpleClient(host, port, timeout);
}
```
Hope this helps! |
wildfly/wildfly | ee/src/main/java/org/jboss/as/ee/component/ManagedReferenceLifecycleMethodInterceptor.java | ManagedReferenceLifecycleMethodInterceptor.processInvocation | public Object processInvocation(final InterceptorContext context) throws Exception {
final ManagedReference reference = (ManagedReference) context.getPrivateData(ComponentInstance.class).getInstanceData(contextKey);
final Object instance = reference.getInstance();
try {
final Method ... | java | public Object processInvocation(final InterceptorContext context) throws Exception {
final ManagedReference reference = (ManagedReference) context.getPrivateData(ComponentInstance.class).getInstanceData(contextKey);
final Object instance = reference.getInstance();
try {
final Method ... | [
"public",
"Object",
"processInvocation",
"(",
"final",
"InterceptorContext",
"context",
")",
"throws",
"Exception",
"{",
"final",
"ManagedReference",
"reference",
"=",
"(",
"ManagedReference",
")",
"context",
".",
"getPrivateData",
"(",
"ComponentInstance",
".",
"clas... | {@inheritDoc} | [
"{"
] | 64896f1500fe465ad83d96ede9fa19d0c3747f18 | https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/ee/src/main/java/org/jboss/as/ee/component/ManagedReferenceLifecycleMethodInterceptor.java#L73-L106 | test | Process the invocation of the component. | Of course, here is the Java code you requested:
```java
public Object processInvocation(final InterceptorContext context) throws Exception {
final ManagedReference reference = (ManagedReference) context.getPrivateData(ComponentInstance.class).getInstanceData(contextKey);
final Object instance = referen... |
i-net-software/jlessc | src/com/inet/lib/less/ColorUtils.java | ColorUtils.toHSV | static HSV toHSV( double color ) {
long argb = Double.doubleToRawLongBits( color );
double a = alpha( color );
double r = clamp( ((argb >> 32) & 0xFFFF) / (double)0xFF00 );
double g = clamp( ((argb >> 16) & 0xFFFF) / (double)0xFF00 );
double b = clamp( ((argb >> 0) & 0xFFFF) / (d... | java | static HSV toHSV( double color ) {
long argb = Double.doubleToRawLongBits( color );
double a = alpha( color );
double r = clamp( ((argb >> 32) & 0xFFFF) / (double)0xFF00 );
double g = clamp( ((argb >> 16) & 0xFFFF) / (double)0xFF00 );
double b = clamp( ((argb >> 0) & 0xFFFF) / (d... | [
"static",
"HSV",
"toHSV",
"(",
"double",
"color",
")",
"{",
"long",
"argb",
"=",
"Double",
".",
"doubleToRawLongBits",
"(",
"color",
")",
";",
"double",
"a",
"=",
"alpha",
"(",
"color",
")",
";",
"double",
"r",
"=",
"clamp",
"(",
"(",
"(",
"argb",
... | Create a HSV color.
@param color argb color
@return the HSL | [
"Create",
"a",
"HSV",
"color",
"."
] | 15b13e1637f6cc2e4d72df021e23ee0ca8d5e629 | https://github.com/i-net-software/jlessc/blob/15b13e1637f6cc2e4d72df021e23ee0ca8d5e629/src/com/inet/lib/less/ColorUtils.java#L315-L344 | train | Convert a color to a HSV color. | Of course, here is the Java code you requested:
```java
static HSV toHSV( double color ) {
long argb = Double.doubleToRawLongBits( color );
double a = alpha( color );
double r = clamp( ((argb >> 32) & 0xFFFF) / (double)0xFF00 );
double g = clamp( ((argb >> 16) & 0xFFFF) / (double)0xFF00... |
Unidata/thredds | cdm/src/main/java/ucar/nc2/dt/grid/GridCoordSys.java | GridCoordSys.isGlobalLon | @Override
public boolean isGlobalLon() {
if (!isLatLon) return false;
if (!(horizXaxis instanceof CoordinateAxis1D)) return false;
CoordinateAxis1D lon = (CoordinateAxis1D) horizXaxis;
double first = lon.getCoordEdge(0);
double last = lon.getCoordEdge((int) lon.getSize());
double min = ... | java | @Override
public boolean isGlobalLon() {
if (!isLatLon) return false;
if (!(horizXaxis instanceof CoordinateAxis1D)) return false;
CoordinateAxis1D lon = (CoordinateAxis1D) horizXaxis;
double first = lon.getCoordEdge(0);
double last = lon.getCoordEdge((int) lon.getSize());
double min = ... | [
"@",
"Override",
"public",
"boolean",
"isGlobalLon",
"(",
")",
"{",
"if",
"(",
"!",
"isLatLon",
")",
"return",
"false",
";",
"if",
"(",
"!",
"(",
"horizXaxis",
"instanceof",
"CoordinateAxis1D",
")",
")",
"return",
"false",
";",
"CoordinateAxis1D",
"lon",
"... | Is this a global coverage over longitude ?
@return true if isLatLon and longitude wraps | [
"Is",
"this",
"a",
"global",
"coverage",
"over",
"longitude",
"?"
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/dt/grid/GridCoordSys.java#L723-L733 | test | Returns true if the Horiz X axis is a global longitude coordinate axis. | Of course, here is the Java code you requested:
```java
@Override
public boolean isGlobalLon() {
if (!isLatLon) return false;
if (!(horizXaxis instanceof CoordinateAxis1D)) return false;
CoordinateAxis1D lon = (CoordinateAxis1D) horizXaxis;
double first = lon.getCoordEdge(0);
double last = ... |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/math/ArrayMath.java | ArrayMath.norm_inf | public static double norm_inf(float[] a) {
double max = Double.NEGATIVE_INFINITY;
for (int i = 0; i < a.length; i++) {
if (Math.abs(a[i]) > max) {
max = Math.abs(a[i]);
}
}
return max;
} | java | public static double norm_inf(float[] a) {
double max = Double.NEGATIVE_INFINITY;
for (int i = 0; i < a.length; i++) {
if (Math.abs(a[i]) > max) {
max = Math.abs(a[i]);
}
}
return max;
} | [
"public",
"static",
"double",
"norm_inf",
"(",
"float",
"[",
"]",
"a",
")",
"{",
"double",
"max",
"=",
"Double",
".",
"NEGATIVE_INFINITY",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"a",
".",
"length",
";",
"i",
"++",
")",
"{",
"if",
... | Computes inf-norm of vector
@return inf-norm of a | [
"Computes",
"inf",
"-",
"norm",
"of",
"vector"
] | b3d44bab9ec07ace0d13612c448a6b7298c1f681 | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/math/ArrayMath.java#L594-L602 | train | Norm_inf returns the maximum absolute value of the float array | Of course, here is the Java code you requested:
```java
public static double norm_inf(float[] a) {
double max = Double.NEGATIVE_INFINITY;
for (int i = 0; i < a.length; i++) {
if (Math.abs(a[i]) > max) {
max = Math.abs(a[i]);
}
}
return max;
}
```
Hope this helps! |
tupilabs/tap4j | tap4j/src/main/java/org/tap4j/model/TapElementFactory.java | TapElementFactory.createTextElement | public static Text createTextElement(String tapLine) {
Matcher m = Patterns.TEXT_PATTERN.matcher(tapLine);
if (m.matches()) {
Text result = new Text(tapLine);
result.setIndentationString(m.group(1));
result.indentation = m.group(1).length();
return resul... | java | public static Text createTextElement(String tapLine) {
Matcher m = Patterns.TEXT_PATTERN.matcher(tapLine);
if (m.matches()) {
Text result = new Text(tapLine);
result.setIndentationString(m.group(1));
result.indentation = m.group(1).length();
return resul... | [
"public",
"static",
"Text",
"createTextElement",
"(",
"String",
"tapLine",
")",
"{",
"Matcher",
"m",
"=",
"Patterns",
".",
"TEXT_PATTERN",
".",
"matcher",
"(",
"tapLine",
")",
";",
"if",
"(",
"m",
".",
"matches",
"(",
")",
")",
"{",
"Text",
"result",
"... | Create a text element. This element is created when none of the other elements have matched the TAP stream line.
@param tapLine TAP stream line
@return a {@link Text} TAP element | [
"Create",
"a",
"text",
"element",
".",
"This",
"element",
"is",
"created",
"when",
"none",
"of",
"the",
"other",
"elements",
"have",
"matched",
"the",
"TAP",
"stream",
"line",
"."
] | 1793b653ce7f3a06a7b5c9557cdf601e28dd1f55 | https://github.com/tupilabs/tap4j/blob/1793b653ce7f3a06a7b5c9557cdf601e28dd1f55/tap4j/src/main/java/org/tap4j/model/TapElementFactory.java#L48-L60 | train | Create a Text object from a tap line. | Of course, here is the Java code you requested:
```java
public static Text createTextElement(String tapLine) {
Matcher m = Patterns.TEXT_PATTERN.matcher(tapLine);
if (m.matches()) {
Text result = new Text(tapLine);
result.setIndentationString(m.group(1));
result.in... |
mjeanroy/junit-servers | junit-servers-core/src/main/java/com/github/mjeanroy/junit/servers/client/Cookies.java | Cookies.cookie | public static Cookie cookie(String name, String value) {
return new Cookie.Builder(name, value).build();
} | java | public static Cookie cookie(String name, String value) {
return new Cookie.Builder(name, value).build();
} | [
"public",
"static",
"Cookie",
"cookie",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"return",
"new",
"Cookie",
".",
"Builder",
"(",
"name",
",",
"value",
")",
".",
"build",
"(",
")",
";",
"}"
] | Create cookie with a name and a value, all other parameters will
use the default values:
<ul>
<li>The webapp path is initialized with {@code "src/main/webapp"}</li>
<li>The path is initialized with {@code "/"}</li>
<li>The port is initialized with zero.</li>
<li>The cookie is not secured.</li>
<li>The cookie is not ht... | [
"Create",
"cookie",
"with",
"a",
"name",
"and",
"a",
"value",
"all",
"other",
"parameters",
"will",
"use",
"the",
"default",
"values",
":"
] | e5628ac13414da9ab0110491c011e2b02239155c | https://github.com/mjeanroy/junit-servers/blob/e5628ac13414da9ab0110491c011e2b02239155c/junit-servers-core/src/main/java/com/github/mjeanroy/junit/servers/client/Cookies.java#L77-L79 | valid | Create a new Cookie with the given name and value. | Of course, here is the Java code you requested:
```java
public static Cookie cookie(String name, String value) {
return new Cookie.Builder(name, value).build();
}
```
Hope this helps! |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-legacy/xwiki-commons-legacy-component/xwiki-commons-legacy-component-default/src/main/java/org/xwiki/component/logging/AbstractLogger.java | AbstractLogger.formatMessage | protected String formatMessage(String message, Object... objects)
{
try {
return MessageFormat.format(message, objects);
} catch (IllegalArgumentException e) {
debug("Caught exception while formatting logging message: " + message, e);
// Try to save the message f... | java | protected String formatMessage(String message, Object... objects)
{
try {
return MessageFormat.format(message, objects);
} catch (IllegalArgumentException e) {
debug("Caught exception while formatting logging message: " + message, e);
// Try to save the message f... | [
"protected",
"String",
"formatMessage",
"(",
"String",
"message",
",",
"Object",
"...",
"objects",
")",
"{",
"try",
"{",
"return",
"MessageFormat",
".",
"format",
"(",
"message",
",",
"objects",
")",
";",
"}",
"catch",
"(",
"IllegalArgumentException",
"e",
"... | Formats the message like {@code MessageFormat.format(String, Object...)} but also checks for Exceptions and
catches them as logging should be robust and not interfere with normal program flow. The Exception caught will be
passed to the loggers debug output.
@param message message in Formatter format syntax
@param obje... | [
"Formats",
"the",
"message",
"like",
"{",
"@code",
"MessageFormat",
".",
"format",
"(",
"String",
"Object",
"...",
")",
"}",
"but",
"also",
"checks",
"for",
"Exceptions",
"and",
"catches",
"them",
"as",
"logging",
"should",
"be",
"robust",
"and",
"not",
"i... | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-legacy/xwiki-commons-legacy-component/xwiki-commons-legacy-component-default/src/main/java/org/xwiki/component/logging/AbstractLogger.java#L44-L66 | train | This method is used to format a message for logging. | Of course, here is the Java code you requested:
```java
protected String formatMessage(String message, Object... objects)
{
try {
return MessageFormat.format(message, objects);
} catch (IllegalArgumentException e) {
debug("Caught exception while formatting logging message: "... |
sdaschner/jaxrs-analyzer | src/main/java/com/sebastian_daschner/jaxrs_analyzer/model/JavaUtils.java | JavaUtils.toClassName | public static String toClassName(final String type) {
switch (type.charAt(0)) {
case 'V':
return CLASS_PRIMITIVE_VOID;
case 'Z':
return CLASS_PRIMITIVE_BOOLEAN;
case 'C':
return CLASS_PRIMITIVE_CHAR;
case 'B':
... | java | public static String toClassName(final String type) {
switch (type.charAt(0)) {
case 'V':
return CLASS_PRIMITIVE_VOID;
case 'Z':
return CLASS_PRIMITIVE_BOOLEAN;
case 'C':
return CLASS_PRIMITIVE_CHAR;
case 'B':
... | [
"public",
"static",
"String",
"toClassName",
"(",
"final",
"String",
"type",
")",
"{",
"switch",
"(",
"type",
".",
"charAt",
"(",
"0",
")",
")",
"{",
"case",
"'",
"'",
":",
"return",
"CLASS_PRIMITIVE_VOID",
";",
"case",
"'",
"'",
":",
"return",
"CLASS_... | Converts the given JVM object type signature to a class name. Erasures parametrized types.
<p>
Example: {@code Ljava/util/List<Ljava/lang/String;>; -> java/util/List}
@throws IllegalArgumentException If the type is not a reference or array type. | [
"Converts",
"the",
"given",
"JVM",
"object",
"type",
"signature",
"to",
"a",
"class",
"name",
".",
"Erasures",
"parametrized",
"types",
".",
"<p",
">",
"Example",
":",
"{",
"@code",
"Ljava",
"/",
"util",
"/",
"List<Ljava",
"/",
"lang",
"/",
"String",
";"... | 4ac62942202d05632977d6c14d3cd7e2d27e2b9b | https://github.com/sdaschner/jaxrs-analyzer/blob/4ac62942202d05632977d6c14d3cd7e2d27e2b9b/src/main/java/com/sebastian_daschner/jaxrs_analyzer/model/JavaUtils.java#L230-L264 | train | Returns the class name of the type. | Of course, here is the Java code you requested:
```java
public static String toClassName(final String type) {
switch (type.charAt(0)) {
case 'V':
return CLASS_PRIMITIVE_VOID;
case 'Z':
return CLASS_PRIMITIVE_BOOLEAN;
case 'C':
... |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/ChainImpl.java | ChainImpl.setAtomGroups | @Override
public void setAtomGroups(List<Group> groups){
for (Group g:groups){
g.setChain(this);
}
this.groups = groups;
} | java | @Override
public void setAtomGroups(List<Group> groups){
for (Group g:groups){
g.setChain(this);
}
this.groups = groups;
} | [
"@",
"Override",
"public",
"void",
"setAtomGroups",
"(",
"List",
"<",
"Group",
">",
"groups",
")",
"{",
"for",
"(",
"Group",
"g",
":",
"groups",
")",
"{",
"g",
".",
"setChain",
"(",
"this",
")",
";",
"}",
"this",
".",
"groups",
"=",
"groups",
";",
... | {@inheritDoc} | [
"{",
"@inheritDoc",
"}"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/ChainImpl.java#L338-L344 | train | Sets the Atom Groups for this Chain. | Of course, here is the Java code you requested:
```java
@Override
public void setAtomGroups(List<Group> groups){
for (Group g:groups){
g.setChain(this);
}
this.groups = groups;
}
```
Hope this helps! |
google/flogger | api/src/main/java/com/google/common/flogger/backend/FormatOptions.java | FormatOptions.checkFlagConsistency | static boolean checkFlagConsistency(int flags, boolean hasWidth) {
// Check that we specify at most one of 'prefix plus' and 'prefix space'.
if ((flags & (FLAG_PREFIX_PLUS_FOR_POSITIVE_VALUES | FLAG_PREFIX_SPACE_FOR_POSITIVE_VALUES))
== (FLAG_PREFIX_PLUS_FOR_POSITIVE_VALUES | FLAG_PREFIX_SPACE_FOR_POSIT... | java | static boolean checkFlagConsistency(int flags, boolean hasWidth) {
// Check that we specify at most one of 'prefix plus' and 'prefix space'.
if ((flags & (FLAG_PREFIX_PLUS_FOR_POSITIVE_VALUES | FLAG_PREFIX_SPACE_FOR_POSITIVE_VALUES))
== (FLAG_PREFIX_PLUS_FOR_POSITIVE_VALUES | FLAG_PREFIX_SPACE_FOR_POSIT... | [
"static",
"boolean",
"checkFlagConsistency",
"(",
"int",
"flags",
",",
"boolean",
"hasWidth",
")",
"{",
"// Check that we specify at most one of 'prefix plus' and 'prefix space'.",
"if",
"(",
"(",
"flags",
"&",
"(",
"FLAG_PREFIX_PLUS_FOR_POSITIVE_VALUES",
"|",
"FLAG_PREFIX_SP... | Helper to check for legal combinations of flags. | [
"Helper",
"to",
"check",
"for",
"legal",
"combinations",
"of",
"flags",
"."
] | a164967a93a9f4ce92f34319fc0cc7c91a57321c | https://github.com/google/flogger/blob/a164967a93a9f4ce92f34319fc0cc7c91a57321c/api/src/main/java/com/google/common/flogger/backend/FormatOptions.java#L353-L369 | train | Check that the flags are consistent with the CSP flags. | Of course, here is the Java code you requested:
```java
static boolean checkFlagConsistency(int flags, boolean hasWidth) {
// Check that we specify at most one of 'prefix plus' and 'prefix space'.
if ((flags & (FLAG_PREFIX_PLUS_FOR_POSITIVE_VALUES | FLAG_PREFIX_SPACE_FOR_POSITIVE_VALUES))
== (FLAG_PREF... |
yan74/afplib | org.afplib/src/main/java/org/afplib/afplib/impl/BMOImpl.java | BMOImpl.setOvlyName | public void setOvlyName(String newOvlyName) {
String oldOvlyName = ovlyName;
ovlyName = newOvlyName;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, AfplibPackage.BMO__OVLY_NAME, oldOvlyName, ovlyName));
} | java | public void setOvlyName(String newOvlyName) {
String oldOvlyName = ovlyName;
ovlyName = newOvlyName;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, AfplibPackage.BMO__OVLY_NAME, oldOvlyName, ovlyName));
} | [
"public",
"void",
"setOvlyName",
"(",
"String",
"newOvlyName",
")",
"{",
"String",
"oldOvlyName",
"=",
"ovlyName",
";",
"ovlyName",
"=",
"newOvlyName",
";",
"if",
"(",
"eNotificationRequired",
"(",
")",
")",
"eNotify",
"(",
"new",
"ENotificationImpl",
"(",
"th... | <!-- begin-user-doc -->
<!-- end-user-doc -->
@generated | [
"<!",
"--",
"begin",
"-",
"user",
"-",
"doc",
"--",
">",
"<!",
"--",
"end",
"-",
"user",
"-",
"doc",
"--",
">"
] | 9ff0513f9448bdf8c0b0e31dc4910c094c48fb2f | https://github.com/yan74/afplib/blob/9ff0513f9448bdf8c0b0e31dc4910c094c48fb2f/org.afplib/src/main/java/org/afplib/afplib/impl/BMOImpl.java#L105-L110 | train | Sets the name of the OVLY file. | Of course, here is the Java code you requested:
```java
public void setOvlyName(String newOvlyName) {
String oldOvlyName = ovlyName;
ovlyName = newOvlyName;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, AfplibPackage.BMO__OVLY_NAME, oldOvlyName, ovlyName));
}
```
Hope th... |
OpenLiberty/open-liberty | dev/com.ibm.ws.monitor/src/com/ibm/ws/pmi/stat/StatsImpl.java | StatsImpl.getJ2EEStatisticNames | public String[] getJ2EEStatisticNames() {
ArrayList members = copyStatistics();
if (members == null)
return new String[0];
String[] ret = new String[members.size()];
for (int i = 0; i < ret.length; i++) {
if (members.get(i) != null)
ret[i] = ((Sta... | java | public String[] getJ2EEStatisticNames() {
ArrayList members = copyStatistics();
if (members == null)
return new String[0];
String[] ret = new String[members.size()];
for (int i = 0; i < ret.length; i++) {
if (members.get(i) != null)
ret[i] = ((Sta... | [
"public",
"String",
"[",
"]",
"getJ2EEStatisticNames",
"(",
")",
"{",
"ArrayList",
"members",
"=",
"copyStatistics",
"(",
")",
";",
"if",
"(",
"members",
"==",
"null",
")",
"return",
"new",
"String",
"[",
"0",
"]",
";",
"String",
"[",
"]",
"ret",
"=",
... | /*
JSR77 proxy: NOT exposed via WSStats | [
"/",
"*",
"JSR77",
"proxy",
":",
"NOT",
"exposed",
"via",
"WSStats"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.monitor/src/com/ibm/ws/pmi/stat/StatsImpl.java#L297-L308 | train | Get the J2EE statistical names. | Of course, here is the Java code you requested:
```java
public String[] getJ2EEStatisticNames() {
ArrayList members = copyStatistics();
if (members == null)
return new String[0];
String[] ret = new String[members.size()];
for (int i = 0; i < ret.length; i++) {
i... |
undertow-io/undertow | core/src/main/java/io/undertow/protocols/ssl/UndertowXnioSsl.java | UndertowXnioSsl.createSSLEngine | private static SSLEngine createSSLEngine(SSLContext sslContext, OptionMap optionMap, InetSocketAddress peerAddress, boolean client) {
final SSLEngine engine = sslContext.createSSLEngine(
optionMap.get(Options.SSL_PEER_HOST_NAME, peerAddress.getHostString()),
optionMap.get(Options... | java | private static SSLEngine createSSLEngine(SSLContext sslContext, OptionMap optionMap, InetSocketAddress peerAddress, boolean client) {
final SSLEngine engine = sslContext.createSSLEngine(
optionMap.get(Options.SSL_PEER_HOST_NAME, peerAddress.getHostString()),
optionMap.get(Options... | [
"private",
"static",
"SSLEngine",
"createSSLEngine",
"(",
"SSLContext",
"sslContext",
",",
"OptionMap",
"optionMap",
",",
"InetSocketAddress",
"peerAddress",
",",
"boolean",
"client",
")",
"{",
"final",
"SSLEngine",
"engine",
"=",
"sslContext",
".",
"createSSLEngine",... | Create a new SSL engine, configured from an option map.
@param sslContext the SSL context
@param optionMap the SSL options
@param peerAddress the peer address of the connection
@return the configured SSL engine | [
"Create",
"a",
"new",
"SSL",
"engine",
"configured",
"from",
"an",
"option",
"map",
"."
] | 87de0b856a7a4ba8faf5b659537b9af07b763263 | https://github.com/undertow-io/undertow/blob/87de0b856a7a4ba8faf5b659537b9af07b763263/core/src/main/java/io/undertow/protocols/ssl/UndertowXnioSsl.java#L214-L244 | train | Create SSL engine. | Of course, here is the Java code you requested:
```java
private static SSLEngine createSSLEngine(SSLContext sslContext, OptionMap optionMap, InetSocketAddress peerAddress, boolean client) {
final SSLEngine engine = sslContext.createSSLEngine(
optionMap.get(Options.SSL_PEER_HOST_NAME, peerAddres... |
RestComm/jain-slee.sip | enablers/sip-publication-client/sbb/src/main/java/org/mobicents/slee/enabler/sip/PublicationClientChildSbb.java | PublicationClientChildSbb.setSbbContext | @Override
public void setSbbContext(SbbContext sbbContext) {
this.sbbContext = (SbbContextExt) sbbContext;
if (tracer == null) {
tracer = sbbContext.getTracer(PublicationClientChildSbb.class.getSimpleName());
}
try {
//sip ra
this.sipActivityContextInterfaceFactory = (SipActivityContextInterfaceFactor... | java | @Override
public void setSbbContext(SbbContext sbbContext) {
this.sbbContext = (SbbContextExt) sbbContext;
if (tracer == null) {
tracer = sbbContext.getTracer(PublicationClientChildSbb.class.getSimpleName());
}
try {
//sip ra
this.sipActivityContextInterfaceFactory = (SipActivityContextInterfaceFactor... | [
"@",
"Override",
"public",
"void",
"setSbbContext",
"(",
"SbbContext",
"sbbContext",
")",
"{",
"this",
".",
"sbbContext",
"=",
"(",
"SbbContextExt",
")",
"sbbContext",
";",
"if",
"(",
"tracer",
"==",
"null",
")",
"{",
"tracer",
"=",
"sbbContext",
".",
"get... | /*
(non-Javadoc)
@see javax.slee.Sbb#setSbbContext(javax.slee.SbbContext) | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | 2c173af0a760cb0ea13fe0ffa58c0f82b14731f9 | https://github.com/RestComm/jain-slee.sip/blob/2c173af0a760cb0ea13fe0ffa58c0f82b14731f9/enablers/sip-publication-client/sbb/src/main/java/org/mobicents/slee/enabler/sip/PublicationClientChildSbb.java#L724-L781 | train | Set the SIP context for this SIP | Of course, here is the Java code you requested:
```java
@Override
public void setSbbContext(SbbContext sbbContext) {
this.sbbContext = (SbbContextExt) sbbContext;
if (tracer == null) {
tracer = sbbContext.getTracer(PublicationClientChildSbb.class.getSimpleName());
}
try {
//sip ra
this.sipActivityCon... |
jbundle/jbundle | thin/base/screen/grid/src/main/java/org/jbundle/thin/base/screen/grid/sort/SortableHeaderRenderer.java | SortableHeaderRenderer.getHeaderRendererIcon | protected Icon getHeaderRendererIcon(boolean bCurrentOrder) {
// Get current classloader
ClassLoader cl = this.getClass().getClassLoader();
// Create icons
try {
if (ASCENDING_ICON == null)
{
ASCENDING_ICON = new ImageIcon(cl.getResource("images... | java | protected Icon getHeaderRendererIcon(boolean bCurrentOrder) {
// Get current classloader
ClassLoader cl = this.getClass().getClassLoader();
// Create icons
try {
if (ASCENDING_ICON == null)
{
ASCENDING_ICON = new ImageIcon(cl.getResource("images... | [
"protected",
"Icon",
"getHeaderRendererIcon",
"(",
"boolean",
"bCurrentOrder",
")",
"{",
"// Get current classloader",
"ClassLoader",
"cl",
"=",
"this",
".",
"getClass",
"(",
")",
".",
"getClassLoader",
"(",
")",
";",
"// Create icons",
"try",
"{",
"if",
"(",
"A... | Get the ascending/descending icon. | [
"Get",
"the",
"ascending",
"/",
"descending",
"icon",
"."
] | 4037fcfa85f60c7d0096c453c1a3cd573c2b0abc | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/screen/grid/src/main/java/org/jbundle/thin/base/screen/grid/sort/SortableHeaderRenderer.java#L75-L89 | train | Get the header renderer icon. | Of course, here is the Java code you requested:
```java
protected Icon getHeaderRendererIcon(boolean bCurrentOrder) {
// Get current classloader
ClassLoader cl = this.getClass().getClassLoader();
// Create icons
try {
if (ASCENDING_ICON == null)
{
... |
roboconf/roboconf-platform | miscellaneous/roboconf-tooling-core/src/main/java/net/roboconf/tooling/core/ProjectUtils.java | ProjectUtils.createSimpleProject | private static void createSimpleProject( File targetDirectory, CreationBean creationBean )
throws IOException {
// Create the directory structure
String[] directoriesToCreate = creationBean.isReusableRecipe() ? RR_DIRECTORIES : ALL_DIRECTORIES;
for( String s : directoriesToCreate ) {
File dir = new File( tar... | java | private static void createSimpleProject( File targetDirectory, CreationBean creationBean )
throws IOException {
// Create the directory structure
String[] directoriesToCreate = creationBean.isReusableRecipe() ? RR_DIRECTORIES : ALL_DIRECTORIES;
for( String s : directoriesToCreate ) {
File dir = new File( tar... | [
"private",
"static",
"void",
"createSimpleProject",
"(",
"File",
"targetDirectory",
",",
"CreationBean",
"creationBean",
")",
"throws",
"IOException",
"{",
"// Create the directory structure",
"String",
"[",
"]",
"directoriesToCreate",
"=",
"creationBean",
".",
"isReusabl... | Creates a simple project for Roboconf.
@param targetDirectory the directory into which the Roboconf files must be copied
@param creationBean the creation properties
@throws IOException if something went wrong | [
"Creates",
"a",
"simple",
"project",
"for",
"Roboconf",
"."
] | add54eead479effb138d0ff53a2d637902b82702 | https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/miscellaneous/roboconf-tooling-core/src/main/java/net/roboconf/tooling/core/ProjectUtils.java#L138-L159 | train | Create a simple project. | Of course, here is the Java code you requested:
```java
private static void createSimpleProject( File targetDirectory, CreationBean creationBean )
throws IOException {
// Create the directory structure
String[] directoriesToCreate = creationBean.isReusableRecipe() ? RR_DIRECTORIES : ALL_DIRECTORIES;
for( Strin... |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/models/JobSchedulePatchOptions.java | JobSchedulePatchOptions.withIfModifiedSince | public JobSchedulePatchOptions withIfModifiedSince(DateTime ifModifiedSince) {
if (ifModifiedSince == null) {
this.ifModifiedSince = null;
} else {
this.ifModifiedSince = new DateTimeRfc1123(ifModifiedSince);
}
return this;
} | java | public JobSchedulePatchOptions withIfModifiedSince(DateTime ifModifiedSince) {
if (ifModifiedSince == null) {
this.ifModifiedSince = null;
} else {
this.ifModifiedSince = new DateTimeRfc1123(ifModifiedSince);
}
return this;
} | [
"public",
"JobSchedulePatchOptions",
"withIfModifiedSince",
"(",
"DateTime",
"ifModifiedSince",
")",
"{",
"if",
"(",
"ifModifiedSince",
"==",
"null",
")",
"{",
"this",
".",
"ifModifiedSince",
"=",
"null",
";",
"}",
"else",
"{",
"this",
".",
"ifModifiedSince",
"=... | Set a timestamp indicating the last modified time of the resource known to the client. The operation will be performed only if the resource on the service has been modified since the specified time.
@param ifModifiedSince the ifModifiedSince value to set
@return the JobSchedulePatchOptions object itself. | [
"Set",
"a",
"timestamp",
"indicating",
"the",
"last",
"modified",
"time",
"of",
"the",
"resource",
"known",
"to",
"the",
"client",
".",
"The",
"operation",
"will",
"be",
"performed",
"only",
"if",
"the",
"resource",
"on",
"the",
"service",
"has",
"been",
"... | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/models/JobSchedulePatchOptions.java#L222-L229 | train | Sets the ifModifiedSince value for the job schedule patch option. | Of course, here is the Java code you requested:
```java
public JobSchedulePatchOptions withIfModifiedSince(DateTime ifModifiedSince) {
if (ifModifiedSince == null) {
this.ifModifiedSince = null;
} else {
this.ifModifiedSince = new DateTimeRfc1123(ifModifiedSince);
}
... |
liuyukuai/commons | commons-core/src/main/java/com/itxiaoer/commons/core/page/PageUtils.java | PageUtils.page | public static int page(String page, int maxValue) {
if (StringUtils.isBlank(page)) {
return DEFAULT_MIN_PAGE;
}
int parseInt = NumUtils.intVal(page);
return parseInt <= 0 ? DEFAULT_MIN_PAGE : (parseInt > maxValue ? maxValue : parseInt);
} | java | public static int page(String page, int maxValue) {
if (StringUtils.isBlank(page)) {
return DEFAULT_MIN_PAGE;
}
int parseInt = NumUtils.intVal(page);
return parseInt <= 0 ? DEFAULT_MIN_PAGE : (parseInt > maxValue ? maxValue : parseInt);
} | [
"public",
"static",
"int",
"page",
"(",
"String",
"page",
",",
"int",
"maxValue",
")",
"{",
"if",
"(",
"StringUtils",
".",
"isBlank",
"(",
"page",
")",
")",
"{",
"return",
"DEFAULT_MIN_PAGE",
";",
"}",
"int",
"parseInt",
"=",
"NumUtils",
".",
"intVal",
... | 解析page参数
@param page page参数
@param maxValue 分页最大值
@return page | [
"解析page参数"
] | ba67eddb542446b12f419f1866dbaa82e47fbf35 | https://github.com/liuyukuai/commons/blob/ba67eddb542446b12f419f1866dbaa82e47fbf35/commons-core/src/main/java/com/itxiaoer/commons/core/page/PageUtils.java#L52-L58 | train | Get the page number from a string. | Of course, here is the Java code you requested:
```java
public static int page(String page, int maxValue) {
if (StringUtils.isBlank(page)) {
return DEFAULT_MIN_PAGE;
}
int parseInt = NumUtils.intVal(page);
return parseInt <= 0 ? DEFAULT_MIN_PAGE : (parseInt > maxValue ? maxV... |
cdk/cdk | base/core/src/main/java/org/openscience/cdk/graph/EssentialCycles.java | EssentialCycles.membersOfBasis | private List<Cycle> membersOfBasis(final List<Cycle> cycles) {
int start = basis.size();
for (final Cycle c : cycles) {
if (basis.isIndependent(c)) basis.add(c);
}
return basis.members().subList(start, basis.size());
} | java | private List<Cycle> membersOfBasis(final List<Cycle> cycles) {
int start = basis.size();
for (final Cycle c : cycles) {
if (basis.isIndependent(c)) basis.add(c);
}
return basis.members().subList(start, basis.size());
} | [
"private",
"List",
"<",
"Cycle",
">",
"membersOfBasis",
"(",
"final",
"List",
"<",
"Cycle",
">",
"cycles",
")",
"{",
"int",
"start",
"=",
"basis",
".",
"size",
"(",
")",
";",
"for",
"(",
"final",
"Cycle",
"c",
":",
"cycles",
")",
"{",
"if",
"(",
... | For a list of equal length cycles return those which are members of the
minimum cycle basis.
@param cycles cycles to add to the basis
@return cycles which were added to the basis | [
"For",
"a",
"list",
"of",
"equal",
"length",
"cycles",
"return",
"those",
"which",
"are",
"members",
"of",
"the",
"minimum",
"cycle",
"basis",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/core/src/main/java/org/openscience/cdk/graph/EssentialCycles.java#L156-L162 | train | Returns the members of the given list of cycles. | Of course, here is the Java code you requested:
```java
private List<Cycle> membersOfBasis(final List<Cycle> cycles) {
int start = basis.size();
for (final Cycle c : cycles) {
if (basis.isIndependent(c)) basis.add(c);
}
return basis.members().subList(start, basis.size());
... |
aws/aws-sdk-java | aws-java-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/BatchDetectSentimentResult.java | BatchDetectSentimentResult.withResultList | public BatchDetectSentimentResult withResultList(BatchDetectSentimentItemResult... resultList) {
if (this.resultList == null) {
setResultList(new java.util.ArrayList<BatchDetectSentimentItemResult>(resultList.length));
}
for (BatchDetectSentimentItemResult ele : resultList) {
... | java | public BatchDetectSentimentResult withResultList(BatchDetectSentimentItemResult... resultList) {
if (this.resultList == null) {
setResultList(new java.util.ArrayList<BatchDetectSentimentItemResult>(resultList.length));
}
for (BatchDetectSentimentItemResult ele : resultList) {
... | [
"public",
"BatchDetectSentimentResult",
"withResultList",
"(",
"BatchDetectSentimentItemResult",
"...",
"resultList",
")",
"{",
"if",
"(",
"this",
".",
"resultList",
"==",
"null",
")",
"{",
"setResultList",
"(",
"new",
"java",
".",
"util",
".",
"ArrayList",
"<",
... | <p>
A list of objects containing the results of the operation. The results are sorted in ascending order by the
<code>Index</code> field and match the order of the documents in the input list. If all of the documents contain
an error, the <code>ResultList</code> is empty.
</p>
<p>
<b>NOTE:</b> This method appends the v... | [
"<p",
">",
"A",
"list",
"of",
"objects",
"containing",
"the",
"results",
"of",
"the",
"operation",
".",
"The",
"results",
"are",
"sorted",
"in",
"ascending",
"order",
"by",
"the",
"<code",
">",
"Index<",
"/",
"code",
">",
"field",
"and",
"match",
"the",
... | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/BatchDetectSentimentResult.java#L100-L108 | train | A list of objects containing a single entry. | Of course, here is the Java code you requested:
```java
public BatchDetectSentimentResult withResultList(BatchDetectSentimentItemResult... resultList) {
if (this.resultList == null) {
setResultList(new java.util.ArrayList<BatchDetectSentimentItemResult>(resultList.length));
}
for (B... |
biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/util/FileDownloadUtils.java | FileDownloadUtils.deleteDirectory | public static void deleteDirectory(Path dir) throws IOException {
if(dir == null || !Files.exists(dir))
return;
Files.walkFileTree(dir, new SimpleFileVisitor<Path>() {
@Override
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
Files.delete... | java | public static void deleteDirectory(Path dir) throws IOException {
if(dir == null || !Files.exists(dir))
return;
Files.walkFileTree(dir, new SimpleFileVisitor<Path>() {
@Override
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
Files.delete... | [
"public",
"static",
"void",
"deleteDirectory",
"(",
"Path",
"dir",
")",
"throws",
"IOException",
"{",
"if",
"(",
"dir",
"==",
"null",
"||",
"!",
"Files",
".",
"exists",
"(",
"dir",
")",
")",
"return",
";",
"Files",
".",
"walkFileTree",
"(",
"dir",
",",... | Recursively delete a folder & contents
@param dir directory to delete | [
"Recursively",
"delete",
"a",
"folder",
"&",
"contents"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/util/FileDownloadUtils.java#L255-L274 | train | Delete a directory. | Of course, here is the Java code you requested:
```java
public static void deleteDirectory(Path dir) throws IOException {
if(dir == null || !Files.exists(dir))
return;
Files.walkFileTree(dir, new SimpleFileVisitor<Path>() {
@Override
public FileVisitResult visitFile(Path file, BasicFileAttribu... |
PistoiaHELM/HELM2NotationToolkit | src/main/java/org/helm/notation2/tools/HELM1Utils.java | HELM1Utils.convertAdHocMonomersIntoSMILES | private static Map<String, String> convertAdHocMonomersIntoSMILES(Map<String, String> monomersList) throws HELM1FormatException, ChemistryException {
Map<String, String> convert = new HashMap<String, String>();
try {
for (Map.Entry<String, String> element : monomersList.entrySet()) {
Monomer... | java | private static Map<String, String> convertAdHocMonomersIntoSMILES(Map<String, String> monomersList) throws HELM1FormatException, ChemistryException {
Map<String, String> convert = new HashMap<String, String>();
try {
for (Map.Entry<String, String> element : monomersList.entrySet()) {
Monomer... | [
"private",
"static",
"Map",
"<",
"String",
",",
"String",
">",
"convertAdHocMonomersIntoSMILES",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"monomersList",
")",
"throws",
"HELM1FormatException",
",",
"ChemistryException",
"{",
"Map",
"<",
"String",
",",
"Str... | method to translate/convert the adhocMonomers into valid SMILES
@param monomersList Map of adhocMonomers with the type and the alternate
monomer id SMILES
@return Map of adhocMonomers with the monomer alternate id and the
appropriate SMILES
@throws HELM1FormatException if the SMILES for the Monomer can not be found
@t... | [
"method",
"to",
"translate",
"/",
"convert",
"the",
"adhocMonomers",
"into",
"valid",
"SMILES"
] | ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38 | https://github.com/PistoiaHELM/HELM2NotationToolkit/blob/ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38/src/main/java/org/helm/notation2/tools/HELM1Utils.java#L418-L436 | train | method to convert a list of monomers into a map of smiles | Of course, here is the Java code you requested:
```java
private static Map<String, String> convertAdHocMonomersIntoSMILES(Map<String, String> monomersList) throws HELM1FormatException, ChemistryException {
Map<String, String> convert = new HashMap<String, String>();
try {
for (Map.Entry<String, String... |
mcxiaoke/Android-Next | core/src/main/java/com/mcxiaoke/next/utils/ViewUtils.java | ViewUtils.isLayoutRtl | public static boolean isLayoutRtl(View view) {
if (Build.VERSION.SDK_INT >= VERSION_CODES.JELLY_BEAN_MR1) {
return view.getLayoutDirection() == View.LAYOUT_DIRECTION_RTL;
} else {
// All layouts are LTR before JB MR1.
return false;
}
} | java | public static boolean isLayoutRtl(View view) {
if (Build.VERSION.SDK_INT >= VERSION_CODES.JELLY_BEAN_MR1) {
return view.getLayoutDirection() == View.LAYOUT_DIRECTION_RTL;
} else {
// All layouts are LTR before JB MR1.
return false;
}
} | [
"public",
"static",
"boolean",
"isLayoutRtl",
"(",
"View",
"view",
")",
"{",
"if",
"(",
"Build",
".",
"VERSION",
".",
"SDK_INT",
">=",
"VERSION_CODES",
".",
"JELLY_BEAN_MR1",
")",
"{",
"return",
"view",
".",
"getLayoutDirection",
"(",
")",
"==",
"View",
".... | 23 * Returns true if view's layout direction is right-to-left.
24 *
25 * @param view the View whose layout is being considered
26 | [
"23",
"*",
"Returns",
"true",
"if",
"view",
"s",
"layout",
"direction",
"is",
"right",
"-",
"to",
"-",
"left",
".",
"24",
"*",
"25",
"*"
] | 1bfdf99d0b81a849aa0fa6697c53ed673151ca39 | https://github.com/mcxiaoke/Android-Next/blob/1bfdf99d0b81a849aa0fa6697c53ed673151ca39/core/src/main/java/com/mcxiaoke/next/utils/ViewUtils.java#L62-L69 | train | Check if the layout direction is RTL | Of course, here is the Java code you requested:
```java
public static boolean isLayoutRtl(View view) {
if (Build.VERSION.SDK_INT >= VERSION_CODES.JELLY_BEAN_MR1) {
return view.getLayoutDirection() == View.LAYOUT_DIRECTION_RTL;
} else {
// All layouts are LTR before JB MR1.
... |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/network/linkset_channel_binding.java | linkset_channel_binding.get_filtered | public static linkset_channel_binding[] get_filtered(nitro_service service, String id, String filter) throws Exception{
linkset_channel_binding obj = new linkset_channel_binding();
obj.set_id(id);
options option = new options();
option.set_filter(filter);
linkset_channel_binding[] response = (linkset_channel_... | java | public static linkset_channel_binding[] get_filtered(nitro_service service, String id, String filter) throws Exception{
linkset_channel_binding obj = new linkset_channel_binding();
obj.set_id(id);
options option = new options();
option.set_filter(filter);
linkset_channel_binding[] response = (linkset_channel_... | [
"public",
"static",
"linkset_channel_binding",
"[",
"]",
"get_filtered",
"(",
"nitro_service",
"service",
",",
"String",
"id",
",",
"String",
"filter",
")",
"throws",
"Exception",
"{",
"linkset_channel_binding",
"obj",
"=",
"new",
"linkset_channel_binding",
"(",
")"... | Use this API to fetch filtered set of linkset_channel_binding resources.
filter string should be in JSON format.eg: "port:80,servicetype:HTTP". | [
"Use",
"this",
"API",
"to",
"fetch",
"filtered",
"set",
"of",
"linkset_channel_binding",
"resources",
".",
"filter",
"string",
"should",
"be",
"in",
"JSON",
"format",
".",
"eg",
":",
"port",
":",
"80",
"servicetype",
":",
"HTTP",
"."
] | 2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4 | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/network/linkset_channel_binding.java#L165-L172 | train | Use this API to fetch filtered set of linkset_channel_binding resources of given name. set the filter parameter values in filter parameter. | Of course, here is the Java code you requested:
```java
public static linkset_channel_binding[] get_filtered(nitro_service service, String id, String filter) throws Exception{
linkset_channel_binding obj = new linkset_channel_binding();
obj.set_id(id);
options option = new options();
option.set_filter(filter);... |
abmargb/jamppa | src/main/java/org/jivesoftware/smack/Connection.java | Connection.firePacketInterceptors | protected void firePacketInterceptors(Packet packet) {
if (packet != null) {
for (InterceptorWrapper interceptorWrapper : interceptors.values()) {
interceptorWrapper.notifyListener(packet);
}
}
} | java | protected void firePacketInterceptors(Packet packet) {
if (packet != null) {
for (InterceptorWrapper interceptorWrapper : interceptors.values()) {
interceptorWrapper.notifyListener(packet);
}
}
} | [
"protected",
"void",
"firePacketInterceptors",
"(",
"Packet",
"packet",
")",
"{",
"if",
"(",
"packet",
"!=",
"null",
")",
"{",
"for",
"(",
"InterceptorWrapper",
"interceptorWrapper",
":",
"interceptors",
".",
"values",
"(",
")",
")",
"{",
"interceptorWrapper",
... | Process interceptors. Interceptors may modify the packet that is about to
be sent. Since the thread that requested to send the packet will invoke
all interceptors, it is important that interceptors perform their work as
soon as possible so that the thread does not remain blocked for a long
period.
@param packet
the pa... | [
"Process",
"interceptors",
".",
"Interceptors",
"may",
"modify",
"the",
"packet",
"that",
"is",
"about",
"to",
"be",
"sent",
".",
"Since",
"the",
"thread",
"that",
"requested",
"to",
"send",
"the",
"packet",
"will",
"invoke",
"all",
"interceptors",
"it",
"is... | 76f253239923df40904c462e3b88e7278b36b282 | https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jivesoftware/smack/Connection.java#L791-L797 | test | Fire the interceptors for a packet. | Of course, here is the Java code you requested:
```java
protected void firePacketInterceptors(Packet packet) {
if (packet != null) {
for (InterceptorWrapper interceptorWrapper : interceptors.values()) {
interceptorWrapper.notifyListener(packet);
}
}
}
```
Ho... |
uber/NullAway | compile-bench/src/main/java/com/uber/nullaway/benchmark/NullAwayBenchmarkHarness.java | NullAwayBenchmarkHarness.addNullAwayArgsAndRun | private static void addNullAwayArgsAndRun(String[] args) {
String nullawayJar = getJarFileForClass(NullAway.class).getFile();
String annotPackages = args[0];
String[] javacArgs = Arrays.copyOfRange(args, 1, args.length);
// run NullAway first
List<String> nullawayArgs =
Arrays.asList(
... | java | private static void addNullAwayArgsAndRun(String[] args) {
String nullawayJar = getJarFileForClass(NullAway.class).getFile();
String annotPackages = args[0];
String[] javacArgs = Arrays.copyOfRange(args, 1, args.length);
// run NullAway first
List<String> nullawayArgs =
Arrays.asList(
... | [
"private",
"static",
"void",
"addNullAwayArgsAndRun",
"(",
"String",
"[",
"]",
"args",
")",
"{",
"String",
"nullawayJar",
"=",
"getJarFileForClass",
"(",
"NullAway",
".",
"class",
")",
".",
"getFile",
"(",
")",
";",
"String",
"annotPackages",
"=",
"args",
"[... | Here we assume that the javac command has no existing processorpath and no other error prone
flags are being passed. In this case, we assume the annotated packages are passed as the first
argument and the remaining javac args as the rest. We run two configs, one with NullAway added
in a warning-only mode and one with n... | [
"Here",
"we",
"assume",
"that",
"the",
"javac",
"command",
"has",
"no",
"existing",
"processorpath",
"and",
"no",
"other",
"error",
"prone",
"flags",
"are",
"being",
"passed",
".",
"In",
"this",
"case",
"we",
"assume",
"the",
"annotated",
"packages",
"are",
... | c3979b4241f80411dbba6aac3ff653acbb88d00b | https://github.com/uber/NullAway/blob/c3979b4241f80411dbba6aac3ff653acbb88d00b/compile-bench/src/main/java/com/uber/nullaway/benchmark/NullAwayBenchmarkHarness.java#L69-L94 | train | Add NullAway args and run. | Of course, here is the Java code you requested:
```java
private static void addNullAwayArgsAndRun(String[] args) {
String nullawayJar = getJarFileForClass(NullAway.class).getFile();
String annotPackages = args[0];
String[] javacArgs = Arrays.copyOfRange(args, 1, args.length);
// run NullAway first
... |
phax/ph-web | ph-servlet/src/main/java/com/helger/servlet/ServletHelper.java | ServletHelper.getRequestQueryString | @Nullable
public static String getRequestQueryString (@Nullable final HttpServletRequest aRequest)
{
String ret = null;
if (aRequest != null)
try
{
if (aRequest.isAsyncSupported () && aRequest.isAsyncStarted ())
ret = (String) aRequest.getAttribute (AsyncContext.ASYNC_QUERY_STR... | java | @Nullable
public static String getRequestQueryString (@Nullable final HttpServletRequest aRequest)
{
String ret = null;
if (aRequest != null)
try
{
if (aRequest.isAsyncSupported () && aRequest.isAsyncStarted ())
ret = (String) aRequest.getAttribute (AsyncContext.ASYNC_QUERY_STR... | [
"@",
"Nullable",
"public",
"static",
"String",
"getRequestQueryString",
"(",
"@",
"Nullable",
"final",
"HttpServletRequest",
"aRequest",
")",
"{",
"String",
"ret",
"=",
"null",
";",
"if",
"(",
"aRequest",
"!=",
"null",
")",
"try",
"{",
"if",
"(",
"aRequest",... | Work around an exception that can occur in Jetty 9.3.13:
<pre>
java.lang.NullPointerException: null
at org.eclipse.jetty.server.Request.getQueryString(Request.java:1119) ~[jetty-server-9.3.13.v20161014.jar:9.3.13.v20161014]
at com.helger.web.servlet.request.RequestHelper.getURL(RequestHelper.java:340) ~[ph-web-8.6.2.j... | [
"Work",
"around",
"an",
"exception",
"that",
"can",
"occur",
"in",
"Jetty",
"9",
".",
"3",
".",
"13",
":"
] | d445fd25184605b62682c93c9782409acf0ae813 | https://github.com/phax/ph-web/blob/d445fd25184605b62682c93c9782409acf0ae813/ph-servlet/src/main/java/com/helger/servlet/ServletHelper.java#L209-L229 | train | Get the query string of the request. | Of course, here is the Java code you requested:
```java
@Nullable
public static String getRequestQueryString (@Nullable final HttpServletRequest aRequest)
{
String ret = null;
if (aRequest != null)
try
{
if (aRequest.isAsyncSupported () && aRequest.isAsyncStarted ())
ret = (St... |
OpenLiberty/open-liberty | dev/com.ibm.ws.monitor/src/com/ibm/ws/pmi/stat/StatsImpl.java | StatsImpl.getJ2EEStatistics | public StatisticImpl[] getJ2EEStatistics() {
ArrayList members = copyStatistics();
if (members == null || members.size() == 0)
return new StatisticImpl[0];
StatisticImpl[] ret = new StatisticImpl[members.size()];
for (int i = 0; i < ret.length; i++) {
ret[i] = (S... | java | public StatisticImpl[] getJ2EEStatistics() {
ArrayList members = copyStatistics();
if (members == null || members.size() == 0)
return new StatisticImpl[0];
StatisticImpl[] ret = new StatisticImpl[members.size()];
for (int i = 0; i < ret.length; i++) {
ret[i] = (S... | [
"public",
"StatisticImpl",
"[",
"]",
"getJ2EEStatistics",
"(",
")",
"{",
"ArrayList",
"members",
"=",
"copyStatistics",
"(",
")",
";",
"if",
"(",
"members",
"==",
"null",
"||",
"members",
".",
"size",
"(",
")",
"==",
"0",
")",
"return",
"new",
"Statistic... | /*
JSR77 proxy: NOT exposed via WSStats | [
"/",
"*",
"JSR77",
"proxy",
":",
"NOT",
"exposed",
"via",
"WSStats"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.monitor/src/com/ibm/ws/pmi/stat/StatsImpl.java#L282-L292 | train | Get the J2EE Statistics. | Of course, here is the Java code you requested:
```java
public StatisticImpl[] getJ2EEStatistics() {
ArrayList members = copyStatistics();
if (members == null || members.size() == 0)
return new StatisticImpl[0];
StatisticImpl[] ret = new StatisticImpl[members.size()];
for (... |
pravega/pravega | common/src/main/java/io/pravega/common/io/serialization/VersionedSerializer.java | VersionedSerializer.serialize | public void serialize(RevisionDataOutput dataOutput, T object) throws IOException {
serialize(dataOutput.getBaseStream(), object);
} | java | public void serialize(RevisionDataOutput dataOutput, T object) throws IOException {
serialize(dataOutput.getBaseStream(), object);
} | [
"public",
"void",
"serialize",
"(",
"RevisionDataOutput",
"dataOutput",
",",
"T",
"object",
")",
"throws",
"IOException",
"{",
"serialize",
"(",
"dataOutput",
".",
"getBaseStream",
"(",
")",
",",
"object",
")",
";",
"}"
] | Serializes the given object to the given RevisionDataOutput. This overload is usually invoked for serializing
nested classes or collections.
@param dataOutput The RevisionDataOutput to serialize to.
@param object The object to serialize.
@throws IOException If an IO Exception occurred. | [
"Serializes",
"the",
"given",
"object",
"to",
"the",
"given",
"RevisionDataOutput",
".",
"This",
"overload",
"is",
"usually",
"invoked",
"for",
"serializing",
"nested",
"classes",
"or",
"collections",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/io/serialization/VersionedSerializer.java#L115-L117 | train | Serialize the object to the given revision data output. | Of course, here is the Java code you requested:
```java
public void serialize(RevisionDataOutput dataOutput, T object) throws IOException {
serialize(dataOutput.getBaseStream(), object);
}
```
Hope this helps! |
elki-project/elki | elki-data-generator/src/main/java/de/lmu/ifi/dbs/elki/data/synthetic/bymodel/GeneratorSingleCluster.java | GeneratorSingleCluster.generate | @Override
public List<double[]> generate(int count) {
ArrayList<double[]> result = new ArrayList<>(count);
while(result.size() < count) {
double[] d = new double[dim];
for(int i = 0; i < dim; i++) {
d[i] = axes.get(i).nextRandom();
}
if(trans != null) {
d = trans.apply(... | java | @Override
public List<double[]> generate(int count) {
ArrayList<double[]> result = new ArrayList<>(count);
while(result.size() < count) {
double[] d = new double[dim];
for(int i = 0; i < dim; i++) {
d[i] = axes.get(i).nextRandom();
}
if(trans != null) {
d = trans.apply(... | [
"@",
"Override",
"public",
"List",
"<",
"double",
"[",
"]",
">",
"generate",
"(",
"int",
"count",
")",
"{",
"ArrayList",
"<",
"double",
"[",
"]",
">",
"result",
"=",
"new",
"ArrayList",
"<>",
"(",
"count",
")",
";",
"while",
"(",
"result",
".",
"si... | Generate the given number of additional points.
@see de.lmu.ifi.dbs.elki.data.synthetic.bymodel.GeneratorInterface#generate(int) | [
"Generate",
"the",
"given",
"number",
"of",
"additional",
"points",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-data-generator/src/main/java/de/lmu/ifi/dbs/elki/data/synthetic/bymodel/GeneratorSingleCluster.java#L221-L241 | train | Generate a random vector of random values. | Of course, here is the Java code you requested:
```java
@Override
public List<double[]> generate(int count) {
ArrayList<double[]> result = new ArrayList<>(count);
while(result.size() < count) {
double[] d = new double[dim];
for(int i = 0; i < dim; i++) {
d[i] = axes.get(i).nextRandom();
... |
Whiley/WhileyCompilerCollection | src/main/java/wycc/util/ArrayUtils.java | ArrayUtils.append | public static <T> T[] append(Class<T> type, T lhs, T... rhs) {
T[] rs = (T[]) Array.newInstance(type, rhs.length+1);
System.arraycopy(rhs, 0, rs, 1, rhs.length);
rs[0] = lhs;
return rs;
} | java | public static <T> T[] append(Class<T> type, T lhs, T... rhs) {
T[] rs = (T[]) Array.newInstance(type, rhs.length+1);
System.arraycopy(rhs, 0, rs, 1, rhs.length);
rs[0] = lhs;
return rs;
} | [
"public",
"static",
"<",
"T",
">",
"T",
"[",
"]",
"append",
"(",
"Class",
"<",
"T",
">",
"type",
",",
"T",
"lhs",
",",
"T",
"...",
"rhs",
")",
"{",
"T",
"[",
"]",
"rs",
"=",
"(",
"T",
"[",
"]",
")",
"Array",
".",
"newInstance",
"(",
"type",... | Append an element onto an array of unknown type together, producing a
fresh array whose length equals that of the second plus one.
@param lhs
The left-hand side. This element will be copied
first into the resulting array.
@param rhs
The right-hand side. Elements of this array will be copied
last into the resulting arr... | [
"Append",
"an",
"element",
"onto",
"an",
"array",
"of",
"unknown",
"type",
"together",
"producing",
"a",
"fresh",
"array",
"whose",
"length",
"equals",
"that",
"of",
"the",
"second",
"plus",
"one",
"."
] | 18f08b7826eb42ce9e3605c6b242cab87cae25b7 | https://github.com/Whiley/WhileyCompilerCollection/blob/18f08b7826eb42ce9e3605c6b242cab87cae25b7/src/main/java/wycc/util/ArrayUtils.java#L174-L179 | valid | Append two objects to the end of the array. | Of course, here is the Java code you requested:
```java
public static <T> T[] append(Class<T> type, T lhs, T... rhs) {
T[] rs = (T[]) Array.newInstance(type, rhs.length+1);
System.arraycopy(rhs, 0, rs, 1, rhs.length);
rs[0] = lhs;
return rs;
}
```
Hope this helps! |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/db/shared/MultiTable.java | MultiTable.open | public void open() throws DBException
{
// Ignore open - wait for move(+1);
// 1. Synchronize selection:
Record record = this.getRecord();
Iterator<BaseTable> iterator = this.getTables();
while (iterator.hasNext())
{
BaseTable table = iterator.next();
... | java | public void open() throws DBException
{
// Ignore open - wait for move(+1);
// 1. Synchronize selection:
Record record = this.getRecord();
Iterator<BaseTable> iterator = this.getTables();
while (iterator.hasNext())
{
BaseTable table = iterator.next();
... | [
"public",
"void",
"open",
"(",
")",
"throws",
"DBException",
"{",
"// Ignore open - wait for move(+1);",
"// 1. Synchronize selection:",
"Record",
"record",
"=",
"this",
".",
"getRecord",
"(",
")",
";",
"Iterator",
"<",
"BaseTable",
">",
"iterator",
"=",
"this",
"... | Do the physical Open on this table (requery the table).
Note - ignore's open because open is used as a flag to indicate moveNext in process. | [
"Do",
"the",
"physical",
"Open",
"on",
"this",
"table",
"(",
"requery",
"the",
"table",
")",
".",
"Note",
"-",
"ignore",
"s",
"open",
"because",
"open",
"is",
"used",
"as",
"a",
"flag",
"to",
"indicate",
"moveNext",
"in",
"process",
"."
] | 4037fcfa85f60c7d0096c453c1a3cd573c2b0abc | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/shared/MultiTable.java#L91-L114 | train | Open the CRT file. | Of course, here is the Java code you requested:
```java
public void open() throws DBException
{
// Ignore open - wait for move(+1);
// 1. Synchronize selection:
Record record = this.getRecord();
Iterator<BaseTable> iterator = this.getTables();
while (iterator.hasNext())
... |
javalite/activeweb | activeweb/src/main/java/org/javalite/activeweb/HttpSupport.java | HttpSupport.view | protected void view(Map values){
for(Object key:values.keySet() ){
assign(key.toString(), values.get(key));
}
} | java | protected void view(Map values){
for(Object key:values.keySet() ){
assign(key.toString(), values.get(key));
}
} | [
"protected",
"void",
"view",
"(",
"Map",
"values",
")",
"{",
"for",
"(",
"Object",
"key",
":",
"values",
".",
"keySet",
"(",
")",
")",
"{",
"assign",
"(",
"key",
".",
"toString",
"(",
")",
",",
"values",
".",
"get",
"(",
"key",
")",
")",
";",
"... | Convenience method, calls {@link #assign(String, Object)} internally.
The keys in teh map are converted to String values.
@param values map with values to pass to view. | [
"Convenience",
"method",
"calls",
"{",
"@link",
"#assign",
"(",
"String",
"Object",
")",
"}",
"internally",
".",
"The",
"keys",
"in",
"teh",
"map",
"are",
"converted",
"to",
"String",
"values",
"."
] | f25f589da94852b6f5625182360732e0861794a6 | https://github.com/javalite/activeweb/blob/f25f589da94852b6f5625182360732e0861794a6/activeweb/src/main/java/org/javalite/activeweb/HttpSupport.java#L114-L118 | train | View the map of the result set. | Of course, here is the Java code you requested:
```java
protected void view(Map values){
for(Object key:values.keySet() ){
assign(key.toString(), values.get(key));
}
}
```
Hope this helps! |
JM-Lab/utils-java8 | src/main/java/kr/jm/utils/helper/JMOptional.java | JMOptional.getOptional | public static Optional<String> getOptional(String string) {
return Optional.ofNullable(string).filter(getIsEmpty().negate());
} | java | public static Optional<String> getOptional(String string) {
return Optional.ofNullable(string).filter(getIsEmpty().negate());
} | [
"public",
"static",
"Optional",
"<",
"String",
">",
"getOptional",
"(",
"String",
"string",
")",
"{",
"return",
"Optional",
".",
"ofNullable",
"(",
"string",
")",
".",
"filter",
"(",
"getIsEmpty",
"(",
")",
".",
"negate",
"(",
")",
")",
";",
"}"
] | Gets optional.
@param string the string
@return the optional | [
"Gets",
"optional",
"."
] | 9e407b3f28a7990418a1e877229fa8344f4d78a5 | https://github.com/JM-Lab/utils-java8/blob/9e407b3f28a7990418a1e877229fa8344f4d78a5/src/main/java/kr/jm/utils/helper/JMOptional.java#L22-L24 | train | Gets optional. | Of course, here is the Java code you requested:
```java
public static Optional<String> getOptional(String string) {
return Optional.ofNullable(string).filter(getIsEmpty().negate());
}
```
Hope this helps! |
jdereg/java-util | src/main/java/com/cedarsoftware/util/UrlUtilities.java | UrlUtilities.getCookies | public static void getCookies(URLConnection conn, Map store)
{
// let's determine the domain from where these cookies are being sent
String domain = getCookieDomainFromHost(conn.getURL().getHost());
Map domainStore; // this is where we will store cookies for this domain
// now let's... | java | public static void getCookies(URLConnection conn, Map store)
{
// let's determine the domain from where these cookies are being sent
String domain = getCookieDomainFromHost(conn.getURL().getHost());
Map domainStore; // this is where we will store cookies for this domain
// now let's... | [
"public",
"static",
"void",
"getCookies",
"(",
"URLConnection",
"conn",
",",
"Map",
"store",
")",
"{",
"// let's determine the domain from where these cookies are being sent",
"String",
"domain",
"=",
"getCookieDomainFromHost",
"(",
"conn",
".",
"getURL",
"(",
")",
".",... | Retrieves and stores cookies returned by the host on the other side of
the open java.net.URLConnection.
<p>
The connection MUST have been opened using the connect() method or a
IOException will be thrown.
@param conn a java.net.URLConnection - must be open, or IOException will
be thrown | [
"Retrieves",
"and",
"stores",
"cookies",
"returned",
"by",
"the",
"host",
"on",
"the",
"other",
"side",
"of",
"the",
"open",
"java",
".",
"net",
".",
"URLConnection",
".",
"<p",
">",
"The",
"connection",
"MUST",
"have",
"been",
"opened",
"using",
"the",
... | a2dce61aed16d6454ee575174dda1ba6bff0015c | https://github.com/jdereg/java-util/blob/a2dce61aed16d6454ee575174dda1ba6bff0015c/src/main/java/com/cedarsoftware/util/UrlUtilities.java#L254-L314 | train | Get the cookies from the URLConnection. | Of course, here is the Java code you requested:
```java
public static void getCookies(URLConnection conn, Map store)
{
// let's determine the domain from where these cookies are being sent
String domain = getCookieDomainFromHost(conn.getURL().getHost());
Map domainStore; // this is where we... |
dbflute-session/tomcat-boot | src/main/java/org/dbflute/tomcat/TomcatBoot.java | TomcatBoot.go | public void go() { // public as parts, no wait
info("...Booting the Tomcat: port=" + port + " contextPath=" + contextPath);
if (development) {
registerShutdownHook();
}
prepareServer();
final URI uri = startServer();
info("Boot successful" + (development ? " a... | java | public void go() { // public as parts, no wait
info("...Booting the Tomcat: port=" + port + " contextPath=" + contextPath);
if (development) {
registerShutdownHook();
}
prepareServer();
final URI uri = startServer();
info("Boot successful" + (development ? " a... | [
"public",
"void",
"go",
"(",
")",
"{",
"// public as parts, no wait",
"info",
"(",
"\"...Booting the Tomcat: port=\"",
"+",
"port",
"+",
"\" contextPath=\"",
"+",
"contextPath",
")",
";",
"if",
"(",
"development",
")",
"{",
"registerShutdownHook",
"(",
")",
";",
... | ------ | [
"------"
] | fe941f88b6be083781873126f5b12d4c16bb9073 | https://github.com/dbflute-session/tomcat-boot/blob/fe941f88b6be083781873126f5b12d4c16bb9073/src/main/java/org/dbflute/tomcat/TomcatBoot.java#L379-L390 | train | Boot the Tomcat server. | Of course, here is the Java code you requested:
```java
public void go() { // public as parts, no wait
info("...Booting the Tomcat: port=" + port + " contextPath=" + contextPath);
if (development) {
registerShutdownHook();
}
prepareServer();
final URI uri = startServ... |
algolia/algoliasearch-client-android | algoliasearch/src/main/java/com/algolia/search/saas/Index.java | Index.searchRaw | protected byte[] searchRaw(@Nullable Query query, @Nullable RequestOptions requestOptions) throws AlgoliaException {
if (query == null) {
query = new Query();
}
try {
String paramsString = query.build();
if (paramsString.length() > 0) {
JSONOb... | java | protected byte[] searchRaw(@Nullable Query query, @Nullable RequestOptions requestOptions) throws AlgoliaException {
if (query == null) {
query = new Query();
}
try {
String paramsString = query.build();
if (paramsString.length() > 0) {
JSONOb... | [
"protected",
"byte",
"[",
"]",
"searchRaw",
"(",
"@",
"Nullable",
"Query",
"query",
",",
"@",
"Nullable",
"RequestOptions",
"requestOptions",
")",
"throws",
"AlgoliaException",
"{",
"if",
"(",
"query",
"==",
"null",
")",
"{",
"query",
"=",
"new",
"Query",
... | Searches inside the index.
@param requestOptions Request-specific options.
@return a byte array containing search results
@throws AlgoliaException | [
"Searches",
"inside",
"the",
"index",
"."
] | 3293ba6e6116a4f6c1face2cc606bc047d6d4a3c | https://github.com/algolia/algoliasearch-client-android/blob/3293ba6e6116a4f6c1face2cc606bc047d6d4a3c/algoliasearch/src/main/java/com/algolia/search/saas/Index.java#L1373-L1390 | test | Search raw data. | Of course, here is the Java code you requested:
```java
protected byte[] searchRaw(@Nullable Query query, @Nullable RequestOptions requestOptions) throws AlgoliaException {
if (query == null) {
query = new Query();
}
try {
String paramsString = query.build();
... |
aws/aws-sdk-java | aws-java-sdk-greengrass/src/main/java/com/amazonaws/services/greengrass/AWSGreengrassClient.java | AWSGreengrassClient.createSubscriptionDefinitionVersion | @Override
public CreateSubscriptionDefinitionVersionResult createSubscriptionDefinitionVersion(CreateSubscriptionDefinitionVersionRequest request) {
request = beforeClientExecution(request);
return executeCreateSubscriptionDefinitionVersion(request);
} | java | @Override
public CreateSubscriptionDefinitionVersionResult createSubscriptionDefinitionVersion(CreateSubscriptionDefinitionVersionRequest request) {
request = beforeClientExecution(request);
return executeCreateSubscriptionDefinitionVersion(request);
} | [
"@",
"Override",
"public",
"CreateSubscriptionDefinitionVersionResult",
"createSubscriptionDefinitionVersion",
"(",
"CreateSubscriptionDefinitionVersionRequest",
"request",
")",
"{",
"request",
"=",
"beforeClientExecution",
"(",
"request",
")",
";",
"return",
"executeCreateSubscr... | Creates a version of a subscription definition which has already been defined.
@param createSubscriptionDefinitionVersionRequest
@return Result of the CreateSubscriptionDefinitionVersion operation returned by the service.
@throws BadRequestException
invalid request
@sample AWSGreengrass.CreateSubscriptionDefinitionVer... | [
"Creates",
"a",
"version",
"of",
"a",
"subscription",
"definition",
"which",
"has",
"already",
"been",
"defined",
"."
] | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-greengrass/src/main/java/com/amazonaws/services/greengrass/AWSGreengrassClient.java#L1245-L1249 | train | Creates a version of a subscription definition. | Of course, here is the Java code you requested:
```java
@Override
public CreateSubscriptionDefinitionVersionResult createSubscriptionDefinitionVersion(CreateSubscriptionDefinitionVersionRequest request) {
request = beforeClientExecution(request);
return executeCreateSubscriptionDefinitionVersion(re... |
leancloud/java-sdk-all | core/src/main/java/cn/leancloud/AVPush.java | AVPush.setData | public void setData(JSONObject data) {
try {
Map<String, Object> map = new HashMap<String, Object>();
Iterator iter = data.keySet().iterator();
while (iter.hasNext()) {
String key = (String) iter.next();
Object value = data.get(key);
map.put(key, value);
}
this.... | java | public void setData(JSONObject data) {
try {
Map<String, Object> map = new HashMap<String, Object>();
Iterator iter = data.keySet().iterator();
while (iter.hasNext()) {
String key = (String) iter.next();
Object value = data.get(key);
map.put(key, value);
}
this.... | [
"public",
"void",
"setData",
"(",
"JSONObject",
"data",
")",
"{",
"try",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"map",
"=",
"new",
"HashMap",
"<",
"String",
",",
"Object",
">",
"(",
")",
";",
"Iterator",
"iter",
"=",
"data",
".",
"keySet",
... | Sets the entire data of the push message. See the push guide for more details on the data
format. This will overwrite any data specified in AVPush.setMessage(String). | [
"Sets",
"the",
"entire",
"data",
"of",
"the",
"push",
"message",
".",
"See",
"the",
"push",
"guide",
"for",
"more",
"details",
"on",
"the",
"data",
"format",
".",
"This",
"will",
"overwrite",
"any",
"data",
"specified",
"in",
"AVPush",
".",
"setMessage",
... | 323f8e7ee38051b1350790e5192304768c5c9f5f | https://github.com/leancloud/java-sdk-all/blob/323f8e7ee38051b1350790e5192304768c5c9f5f/core/src/main/java/cn/leancloud/AVPush.java#L119-L132 | train | Sets the data in the XML document. | Of course, here is the Java code you requested:
```java
public void setData(JSONObject data) {
try {
Map<String, Object> map = new HashMap<String, Object>();
Iterator iter = data.keySet().iterator();
while (iter.hasNext()) {
String key = (String) iter.next();
Object value = data.g... |
amaembo/streamex | src/main/java/one/util/streamex/DoubleStreamEx.java | DoubleStreamEx.constant | public static DoubleStreamEx constant(double value, long length) {
return of(new ConstSpliterator.OfDouble(value, length, false));
} | java | public static DoubleStreamEx constant(double value, long length) {
return of(new ConstSpliterator.OfDouble(value, length, false));
} | [
"public",
"static",
"DoubleStreamEx",
"constant",
"(",
"double",
"value",
",",
"long",
"length",
")",
"{",
"return",
"of",
"(",
"new",
"ConstSpliterator",
".",
"OfDouble",
"(",
"value",
",",
"length",
",",
"false",
")",
")",
";",
"}"
] | Returns a sequential unordered {@code DoubleStreamEx} of given length
which elements are equal to supplied value.
@param value the constant value
@param length the length of the stream
@return a new {@code DoubleStreamEx}
@since 0.1.2 | [
"Returns",
"a",
"sequential",
"unordered",
"{",
"@code",
"DoubleStreamEx",
"}",
"of",
"given",
"length",
"which",
"elements",
"are",
"equal",
"to",
"supplied",
"value",
"."
] | 936bbd1b7dfbcf64a3b990682bfc848213441d14 | https://github.com/amaembo/streamex/blob/936bbd1b7dfbcf64a3b990682bfc848213441d14/src/main/java/one/util/streamex/DoubleStreamEx.java#L1887-L1889 | train | Creates a stream consisting of the elements of the specified double value. | Of course, here is the Java code you requested:
```java
public static DoubleStreamEx constant(double value, long length) {
return of(new ConstSpliterator.OfDouble(value, length, false));
}
```
Hope this helps! |
jboss-integration/fuse-bxms-integ | switchyard/switchyard-component-common-knowledge/src/main/java/org/switchyard/component/common/knowledge/config/model/KnowledgeSwitchYardScanner.java | KnowledgeSwitchYardScanner.toManifestModel | protected ManifestModel toManifestModel(Manifest[] manifestAnnotations, KnowledgeNamespace knowledgeNamespace) {
if (manifestAnnotations == null || manifestAnnotations.length == 0) {
return null;
}
Manifest manifestAnnotation = manifestAnnotations[0];
ManifestModel manifestMo... | java | protected ManifestModel toManifestModel(Manifest[] manifestAnnotations, KnowledgeNamespace knowledgeNamespace) {
if (manifestAnnotations == null || manifestAnnotations.length == 0) {
return null;
}
Manifest manifestAnnotation = manifestAnnotations[0];
ManifestModel manifestMo... | [
"protected",
"ManifestModel",
"toManifestModel",
"(",
"Manifest",
"[",
"]",
"manifestAnnotations",
",",
"KnowledgeNamespace",
"knowledgeNamespace",
")",
"{",
"if",
"(",
"manifestAnnotations",
"==",
"null",
"||",
"manifestAnnotations",
".",
"length",
"==",
"0",
")",
... | Converts manifest annotations to manifest model.
@param manifestAnnotations annotations
@param knowledgeNamespace knowledgeNamespace
@return model | [
"Converts",
"manifest",
"annotations",
"to",
"manifest",
"model",
"."
] | ca5c012bf867ea15d1250f0991af3cd7e708aaaf | https://github.com/jboss-integration/fuse-bxms-integ/blob/ca5c012bf867ea15d1250f0991af3cd7e708aaaf/switchyard/switchyard-component-common-knowledge/src/main/java/org/switchyard/component/common/knowledge/config/model/KnowledgeSwitchYardScanner.java#L210-L222 | train | To manifest model. | Of course, here is the Java code you requested:
```java
protected ManifestModel toManifestModel(Manifest[] manifestAnnotations, KnowledgeNamespace knowledgeNamespace) {
if (manifestAnnotations == null || manifestAnnotations.length == 0) {
return null;
}
Manifest manifestAnnotation =... |
KostyaSha/yet-another-docker-plugin | yet-another-docker-its/src/main/java/com/github/kostyasha/it/rule/DockerRule.java | DockerRule.buildImage | public String buildImage(Map<String, File> plugins) throws IOException, InterruptedException {
LOG.debug("Building image for {}", plugins);
// final File tempDirectory = TempFileHelper.createTempDirectory("build-image", targetDir().toPath());
final File buildDir = new File(targetDir().getAbsolute... | java | public String buildImage(Map<String, File> plugins) throws IOException, InterruptedException {
LOG.debug("Building image for {}", plugins);
// final File tempDirectory = TempFileHelper.createTempDirectory("build-image", targetDir().toPath());
final File buildDir = new File(targetDir().getAbsolute... | [
"public",
"String",
"buildImage",
"(",
"Map",
"<",
"String",
",",
"File",
">",
"plugins",
")",
"throws",
"IOException",
",",
"InterruptedException",
"{",
"LOG",
".",
"debug",
"(",
"\"Building image for {}\"",
",",
"plugins",
")",
";",
"// final File tempDir... | Build docker image containing specified plugins. | [
"Build",
"docker",
"image",
"containing",
"specified",
"plugins",
"."
] | 40b12e39ff94c3834cff7e028c3dd01c88e87d77 | https://github.com/KostyaSha/yet-another-docker-plugin/blob/40b12e39ff94c3834cff7e028c3dd01c88e87d77/yet-another-docker-its/src/main/java/com/github/kostyasha/it/rule/DockerRule.java#L377-L427 | train | Build image for the given plugins. | Of course, here is the Java code you requested:
```java
public String buildImage(Map<String, File> plugins) throws IOException, InterruptedException {
LOG.debug("Building image for {}", plugins);
// final File tempDirectory = TempFileHelper.createTempDirectory("build-image", targetDir().toPath());
... |
exoplatform/jcr | exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/resource/VersionResource.java | VersionResource.getProperty | public HierarchicalProperty getProperty(QName name) throws PathNotFoundException, AccessDeniedException,
RepositoryException
{
if (DeltaVConstants.VERSIONNAME.equals(name))
{
return new HierarchicalProperty(name, version.getName());
}
else if (DeltaVConstants.DISPLAYNAME... | java | public HierarchicalProperty getProperty(QName name) throws PathNotFoundException, AccessDeniedException,
RepositoryException
{
if (DeltaVConstants.VERSIONNAME.equals(name))
{
return new HierarchicalProperty(name, version.getName());
}
else if (DeltaVConstants.DISPLAYNAME... | [
"public",
"HierarchicalProperty",
"getProperty",
"(",
"QName",
"name",
")",
"throws",
"PathNotFoundException",
",",
"AccessDeniedException",
",",
"RepositoryException",
"{",
"if",
"(",
"DeltaVConstants",
".",
"VERSIONNAME",
".",
"equals",
"(",
"name",
")",
")",
"{",... | {@inheritDoc} | [
"{"
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/resource/VersionResource.java#L74-L190 | train | Gets the HierarchicalProperty with the specified name. | Of course, here is the Java code you requested:
```java
public HierarchicalProperty getProperty(QName name) throws PathNotFoundException, AccessDeniedException,
RepositoryException
{
if (DeltaVConstants.VERSIONNAME.equals(name))
{
return new HierarchicalProperty(name, version.getName... |
javagl/ND | nd-distance/src/main/java/de/javagl/nd/distance/tuples/d/DoubleTupleDistanceFunctions.java | DoubleTupleDistanceFunctions.computeAngularSimilarity | static double computeAngularSimilarity(
DoubleTuple t0, DoubleTuple t1)
{
return 1 - Math.acos(computeCosineSimilarity(t0, t1)) / Math.PI;
} | java | static double computeAngularSimilarity(
DoubleTuple t0, DoubleTuple t1)
{
return 1 - Math.acos(computeCosineSimilarity(t0, t1)) / Math.PI;
} | [
"static",
"double",
"computeAngularSimilarity",
"(",
"DoubleTuple",
"t0",
",",
"DoubleTuple",
"t1",
")",
"{",
"return",
"1",
"-",
"Math",
".",
"acos",
"(",
"computeCosineSimilarity",
"(",
"t0",
",",
"t1",
")",
")",
"/",
"Math",
".",
"PI",
";",
"}"
] | Computes the angular similarity between the given tuples
@param t0 The first tuple
@param t1 The second tuple
@return The angular similarity
@throws IllegalArgumentException If the given tuples do not
have the same {@link Tuple#getSize() size} | [
"Computes",
"the",
"angular",
"similarity",
"between",
"the",
"given",
"tuples"
] | bcb655aaf5fc88af6194f73a27cca079186ff559 | https://github.com/javagl/ND/blob/bcb655aaf5fc88af6194f73a27cca079186ff559/nd-distance/src/main/java/de/javagl/nd/distance/tuples/d/DoubleTupleDistanceFunctions.java#L206-L210 | train | Computes the angular similarity between two tuples of the specified type. | Of course, here is the Java code you requested:
```java
static double computeAngularSimilarity(
DoubleTuple t0, DoubleTuple t1)
{
return 1 - Math.acos(computeCosineSimilarity(t0, t1)) / Math.PI;
}
```
Hope this helps! |
aws/aws-sdk-java | aws-java-sdk-config/src/main/java/com/amazonaws/services/config/model/transform/ConfigurationAggregatorMarshaller.java | ConfigurationAggregatorMarshaller.marshall | public void marshall(ConfigurationAggregator configurationAggregator, ProtocolMarshaller protocolMarshaller) {
if (configurationAggregator == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(configurat... | java | public void marshall(ConfigurationAggregator configurationAggregator, ProtocolMarshaller protocolMarshaller) {
if (configurationAggregator == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(configurat... | [
"public",
"void",
"marshall",
"(",
"ConfigurationAggregator",
"configurationAggregator",
",",
"ProtocolMarshaller",
"protocolMarshaller",
")",
"{",
"if",
"(",
"configurationAggregator",
"==",
"null",
")",
"{",
"throw",
"new",
"SdkClientException",
"(",
"\"Invalid argument... | Marshall the given parameter object. | [
"Marshall",
"the",
"given",
"parameter",
"object",
"."
] | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-config/src/main/java/com/amazonaws/services/config/model/transform/ConfigurationAggregatorMarshaller.java#L53-L69 | train | marshalls the given configurationAggregator to the given protocolMarshaller. | Of course, here is the Java code you requested:
```java
public void marshall(ConfigurationAggregator configurationAggregator, ProtocolMarshaller protocolMarshaller) {
if (configurationAggregator == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
... |
shrinkwrap/descriptors | api-base/src/main/java/org/jboss/shrinkwrap/descriptor/api/Descriptors.java | Descriptors.create | public static <T extends Descriptor> T create(final Class<T> type) throws IllegalArgumentException {
return create(type, null);
} | java | public static <T extends Descriptor> T create(final Class<T> type) throws IllegalArgumentException {
return create(type, null);
} | [
"public",
"static",
"<",
"T",
"extends",
"Descriptor",
">",
"T",
"create",
"(",
"final",
"Class",
"<",
"T",
">",
"type",
")",
"throws",
"IllegalArgumentException",
"{",
"return",
"create",
"(",
"type",
",",
"null",
")",
";",
"}"
] | Creates a new Descriptor instance; the predefined default descriptor name for this type will be used.
@param <T>
@param type
@return
@see #create(Class, String)
@throws IllegalArgumentException
If the type is not specified | [
"Creates",
"a",
"new",
"Descriptor",
"instance",
";",
"the",
"predefined",
"default",
"descriptor",
"name",
"for",
"this",
"type",
"will",
"be",
"used",
"."
] | 023ba080e6396b9f4dd8275dc4e5c0ebb6b5e6ba | https://github.com/shrinkwrap/descriptors/blob/023ba080e6396b9f4dd8275dc4e5c0ebb6b5e6ba/api-base/src/main/java/org/jboss/shrinkwrap/descriptor/api/Descriptors.java#L45-L47 | train | Create a new instance of a class descriptor. | Of course, here is the Java code you requested:
```java
public static <T extends Descriptor> T create(final Class<T> type) throws IllegalArgumentException {
return create(type, null);
}
```
Hope this helps! |
sawano/java-commons | src/main/java/se/sawano/java/commons/lang/validate/Validate.java | Validate.matchesPattern | public static CharSequence matchesPattern(final CharSequence input, final String pattern, final String message) {
return INSTANCE.matchesPattern(input, pattern, message);
} | java | public static CharSequence matchesPattern(final CharSequence input, final String pattern, final String message) {
return INSTANCE.matchesPattern(input, pattern, message);
} | [
"public",
"static",
"CharSequence",
"matchesPattern",
"(",
"final",
"CharSequence",
"input",
",",
"final",
"String",
"pattern",
",",
"final",
"String",
"message",
")",
"{",
"return",
"INSTANCE",
".",
"matchesPattern",
"(",
"input",
",",
"pattern",
",",
"message"... | Method without varargs to increase performance | [
"Method",
"without",
"varargs",
"to",
"increase",
"performance"
] | 6f219c9e8dec4401dbe528d17ae6ec1ef9c0d284 | https://github.com/sawano/java-commons/blob/6f219c9e8dec4401dbe528d17ae6ec1ef9c0d284/src/main/java/se/sawano/java/commons/lang/validate/Validate.java#L176-L178 | train | Returns a CharSequence that matches the given pattern. | Of course, here is the Java code you requested:
```java
public static CharSequence matchesPattern(final CharSequence input, final String pattern, final String message) {
return INSTANCE.matchesPattern(input, pattern, message);
}
```
Hope this helps! |
micronaut-projects/micronaut-core | core/src/main/java/io/micronaut/core/util/StringUtils.java | StringUtils.tokenizeToStringArray | public static String[] tokenizeToStringArray(String str, String delimiters) {
return tokenizeToStringArray(str, delimiters, true, true);
} | java | public static String[] tokenizeToStringArray(String str, String delimiters) {
return tokenizeToStringArray(str, delimiters, true, true);
} | [
"public",
"static",
"String",
"[",
"]",
"tokenizeToStringArray",
"(",
"String",
"str",
",",
"String",
"delimiters",
")",
"{",
"return",
"tokenizeToStringArray",
"(",
"str",
",",
"delimiters",
",",
"true",
",",
"true",
")",
";",
"}"
] | Tokenize the given String into a String array via a StringTokenizer.
Trims tokens and omits empty tokens.
<p>The given delimiters string is supposed to consist of any number of
delimiter characters. Each of those characters can be used to separate
tokens. A delimiter is always a single character; for multi-character
de... | [
"Tokenize",
"the",
"given",
"String",
"into",
"a",
"String",
"array",
"via",
"a",
"StringTokenizer",
".",
"Trims",
"tokens",
"and",
"omits",
"empty",
"tokens",
".",
"<p",
">",
"The",
"given",
"delimiters",
"string",
"is",
"supposed",
"to",
"consist",
"of",
... | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/core/src/main/java/io/micronaut/core/util/StringUtils.java#L169-L171 | train | Tokenize a string into an array of tokens. | Of course, here is the Java code you requested:
```java
public static String[] tokenizeToStringArray(String str, String delimiters) {
return tokenizeToStringArray(str, delimiters, true, true);
}
```
Hope this helps! |
ZieIony/Carbon | carbon/src/main/java/carbon/drawable/ripple/RippleDrawableICS.java | RippleDrawableICS.tryBackgroundEnter | private void tryBackgroundEnter(boolean focused) {
if (mBackground == null) {
mBackground = new RippleBackground(this, mHotspotBounds);
}
mBackground.setup(mState.mMaxRadius, mDensity);
mBackground.enter(focused);
} | java | private void tryBackgroundEnter(boolean focused) {
if (mBackground == null) {
mBackground = new RippleBackground(this, mHotspotBounds);
}
mBackground.setup(mState.mMaxRadius, mDensity);
mBackground.enter(focused);
} | [
"private",
"void",
"tryBackgroundEnter",
"(",
"boolean",
"focused",
")",
"{",
"if",
"(",
"mBackground",
"==",
"null",
")",
"{",
"mBackground",
"=",
"new",
"RippleBackground",
"(",
"this",
",",
"mHotspotBounds",
")",
";",
"}",
"mBackground",
".",
"setup",
"("... | Creates an active hotspot at the specified location. | [
"Creates",
"an",
"active",
"hotspot",
"at",
"the",
"specified",
"location",
"."
] | 78b0a432bd49edc7a6a13ce111cab274085d1693 | https://github.com/ZieIony/Carbon/blob/78b0a432bd49edc7a6a13ce111cab274085d1693/carbon/src/main/java/carbon/drawable/ripple/RippleDrawableICS.java#L547-L554 | train | Try to enter a new background. | Of course, here is the Java code you requested:
```java
private void tryBackgroundEnter(boolean focused) {
if (mBackground == null) {
mBackground = new RippleBackground(this, mHotspotBounds);
}
mBackground.setup(mState.mMaxRadius, mDensity);
mBackground.enter(focused);
... |
alkacon/opencms-core | src/org/opencms/ui/sitemap/CmsSitemapTreeController.java | CmsSitemapTreeController.readSitemapEntryFolderIfPossible | protected CmsResource readSitemapEntryFolderIfPossible(CmsResource resource) {
CmsObject cms = A_CmsUI.getCmsObject();
try {
if (resource.isFolder()) {
return resource;
}
CmsResource parent = cms.readParentFolder(resource.getStructureId());
... | java | protected CmsResource readSitemapEntryFolderIfPossible(CmsResource resource) {
CmsObject cms = A_CmsUI.getCmsObject();
try {
if (resource.isFolder()) {
return resource;
}
CmsResource parent = cms.readParentFolder(resource.getStructureId());
... | [
"protected",
"CmsResource",
"readSitemapEntryFolderIfPossible",
"(",
"CmsResource",
"resource",
")",
"{",
"CmsObject",
"cms",
"=",
"A_CmsUI",
".",
"getCmsObject",
"(",
")",
";",
"try",
"{",
"if",
"(",
"resource",
".",
"isFolder",
"(",
")",
")",
"{",
"return",
... | If the given resource is the default file of a sitmeap entry folder, then returns that
folder, else the original file.<p>
@param resource a resource
@return the resource or its parent folder | [
"If",
"the",
"given",
"resource",
"is",
"the",
"default",
"file",
"of",
"a",
"sitmeap",
"entry",
"folder",
"then",
"returns",
"that",
"folder",
"else",
"the",
"original",
"file",
".",
"<p",
">"
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/sitemap/CmsSitemapTreeController.java#L1205-L1222 | train | Reads the sitemap entry folder if possible. | Of course, here is the Java code you requested:
```java
protected CmsResource readSitemapEntryFolderIfPossible(CmsResource resource) {
CmsObject cms = A_CmsUI.getCmsObject();
try {
if (resource.isFolder()) {
return resource;
}
CmsResource parent = cm... |
deephacks/confit | provider-jpa20/src/main/java/org/deephacks/confit/internal/jpa/JpaBeanQueryAssembler.java | JpaBeanQueryAssembler.assembleBeans | public List<Bean> assembleBeans() {
connectReferences();
if (beansQuery.size() == 0) {
// if no specific beans where requested (such as query for a
// specific schema) return what is available.
return new ArrayList<>(beans.values());
}
List<Bean> init... | java | public List<Bean> assembleBeans() {
connectReferences();
if (beansQuery.size() == 0) {
// if no specific beans where requested (such as query for a
// specific schema) return what is available.
return new ArrayList<>(beans.values());
}
List<Bean> init... | [
"public",
"List",
"<",
"Bean",
">",
"assembleBeans",
"(",
")",
"{",
"connectReferences",
"(",
")",
";",
"if",
"(",
"beansQuery",
".",
"size",
"(",
")",
"==",
"0",
")",
"{",
"// if no specific beans where requested (such as query for a",
"// specific schema) return w... | Assemble beans and initalize their properties and references
from what have been provided.
@return the beans that were provided in the inital query. | [
"Assemble",
"beans",
"and",
"initalize",
"their",
"properties",
"and",
"references",
"from",
"what",
"have",
"been",
"provided",
"."
] | 4e6d4ee5fed32cbc5104433e61de1bcf1b360832 | https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/provider-jpa20/src/main/java/org/deephacks/confit/internal/jpa/JpaBeanQueryAssembler.java#L135-L151 | train | Assemble beans. | Of course, here is the Java code you requested:
```java
public List<Bean> assembleBeans() {
connectReferences();
if (beansQuery.size() == 0) {
// if no specific beans where requested (such as query for a
// specific schema) return what is available.
return new Array... |
fozziethebeat/S-Space | src/main/java/edu/ucla/sspace/util/TrieMap.java | TrieMap.countOverlap | private int countOverlap(CharSequence c1, int start1,
CharSequence c2, int start2) {
// The maxium overlap is the number of characters in the sequences
int maxOverlap = Math.min(c1.length() - start1, c2.length() - start2);
int overlap = 0;
for (; overlap < maxOverlap; ++overlap)... | java | private int countOverlap(CharSequence c1, int start1,
CharSequence c2, int start2) {
// The maxium overlap is the number of characters in the sequences
int maxOverlap = Math.min(c1.length() - start1, c2.length() - start2);
int overlap = 0;
for (; overlap < maxOverlap; ++overlap)... | [
"private",
"int",
"countOverlap",
"(",
"CharSequence",
"c1",
",",
"int",
"start1",
",",
"CharSequence",
"c2",
",",
"int",
"start2",
")",
"{",
"// The maxium overlap is the number of characters in the sequences",
"int",
"maxOverlap",
"=",
"Math",
".",
"min",
"(",
"c1... | Returns the number of overlapping characters between {@code c1} and
{@code c2} starting and the provided indices into the sequences.
@param c1 a character sequence
@param start1 the index into {@code c1} at which the overlap test should
start
@param c2 a character sequence
@param start2 the index into {@code c2} at wh... | [
"Returns",
"the",
"number",
"of",
"overlapping",
"characters",
"between",
"{",
"@code",
"c1",
"}",
"and",
"{",
"@code",
"c2",
"}",
"starting",
"and",
"the",
"provided",
"indices",
"into",
"the",
"sequences",
"."
] | a608102737dfd3d59038a9ead33fe60356bc6029 | https://github.com/fozziethebeat/S-Space/blob/a608102737dfd3d59038a9ead33fe60356bc6029/src/main/java/edu/ucla/sspace/util/TrieMap.java#L340-L351 | train | Count the number of characters that overlap between two CharSequences. | Of course, here is the Java code you requested:
```java
private int countOverlap(CharSequence c1, int start1,
CharSequence c2, int start2) {
// The maxium overlap is the number of characters in the sequences
int maxOverlap = Math.min(c1.length() - start1, c2.length() - start2);
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.