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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
line/armeria | core/src/main/java/com/linecorp/armeria/server/HttpStatusException.java | HttpStatusException.of | public static HttpStatusException of(int statusCode) {
if (statusCode < 0 || statusCode >= 1000) {
final HttpStatus status = HttpStatus.valueOf(statusCode);
if (Flags.verboseExceptions()) {
return new HttpStatusException(status);
} else {
retur... | java | public static HttpStatusException of(int statusCode) {
if (statusCode < 0 || statusCode >= 1000) {
final HttpStatus status = HttpStatus.valueOf(statusCode);
if (Flags.verboseExceptions()) {
return new HttpStatusException(status);
} else {
retur... | [
"public",
"static",
"HttpStatusException",
"of",
"(",
"int",
"statusCode",
")",
"{",
"if",
"(",
"statusCode",
"<",
"0",
"||",
"statusCode",
">=",
"1000",
")",
"{",
"final",
"HttpStatus",
"status",
"=",
"HttpStatus",
".",
"valueOf",
"(",
"statusCode",
")",
... | Returns a new {@link HttpStatusException} instance with the specified HTTP status code. | [
"Returns",
"a",
"new",
"{"
] | 67d29e019fd35a35f89c45cc8f9119ff9b12b44d | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/server/HttpStatusException.java#L42-L53 | train | Gets the exception of the given status code. | Of course, here is the Java code you requested:
```java
public static HttpStatusException of(int statusCode) {
if (statusCode < 0 || statusCode >= 1000) {
final HttpStatus status = HttpStatus.valueOf(statusCode);
if (Flags.verboseExceptions()) {
return new HttpStatusExce... |
micronaut-projects/micronaut-core | management/src/main/java/io/micronaut/management/health/monitor/HealthMonitorTask.java | HealthMonitorTask.monitor | @Scheduled(
fixedDelay = "${micronaut.health.monitor.interval:1m}",
initialDelay = "${micronaut.health.monitor.initial-delay:1m}")
void monitor() {
if (LOG.isDebugEnabled()) {
LOG.debug("Starting health monitor check");
}
List<Publisher<HealthResult>> healthResult... | java | @Scheduled(
fixedDelay = "${micronaut.health.monitor.interval:1m}",
initialDelay = "${micronaut.health.monitor.initial-delay:1m}")
void monitor() {
if (LOG.isDebugEnabled()) {
LOG.debug("Starting health monitor check");
}
List<Publisher<HealthResult>> healthResult... | [
"@",
"Scheduled",
"(",
"fixedDelay",
"=",
"\"${micronaut.health.monitor.interval:1m}\"",
",",
"initialDelay",
"=",
"\"${micronaut.health.monitor.initial-delay:1m}\"",
")",
"void",
"monitor",
"(",
")",
"{",
"if",
"(",
"LOG",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
... | Start the continuous health monitor. | [
"Start",
"the",
"continuous",
"health",
"monitor",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/management/src/main/java/io/micronaut/management/health/monitor/HealthMonitorTask.java#L78-L131 | train | Monitor the service for a single instance of a single class. | Of course, here is the Java code you requested:
```java
@Scheduled(
fixedDelay = "${micronaut.health.monitor.interval:1m}",
initialDelay = "${micronaut.health.monitor.initial-delay:1m}")
void monitor() {
if (LOG.isDebugEnabled()) {
LOG.debug("Starting health monitor check");
... |
wuman/orientdb-android | core/src/main/java/com/orientechnologies/orient/core/config/OStorageConfiguration.java | OStorageConfiguration.load | public OStorageConfiguration load() throws OSerializationException {
final byte[] record = storage.readRecord(CONFIG_RID, null, false, null).buffer;
if (record == null)
throw new OStorageException("Cannot load database's configuration. The database seems to be corrupted.");
fromStream(record);... | java | public OStorageConfiguration load() throws OSerializationException {
final byte[] record = storage.readRecord(CONFIG_RID, null, false, null).buffer;
if (record == null)
throw new OStorageException("Cannot load database's configuration. The database seems to be corrupted.");
fromStream(record);... | [
"public",
"OStorageConfiguration",
"load",
"(",
")",
"throws",
"OSerializationException",
"{",
"final",
"byte",
"[",
"]",
"record",
"=",
"storage",
".",
"readRecord",
"(",
"CONFIG_RID",
",",
"null",
",",
"false",
",",
"null",
")",
".",
"buffer",
";",
"if",
... | This method load the record information by the internal cluster segment. It's for compatibility with older database than
0.9.25.
@param iRequesterId
@compatibility 0.9.25
@return
@throws OSerializationException | [
"This",
"method",
"load",
"the",
"record",
"information",
"by",
"the",
"internal",
"cluster",
"segment",
".",
"It",
"s",
"for",
"compatibility",
"with",
"older",
"database",
"than",
"0",
".",
"9",
".",
"25",
"."
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/core/src/main/java/com/orientechnologies/orient/core/config/OStorageConfiguration.java#L89-L97 | train | Loads the
configuration from the database. | Of course, here is the Java code you requested:
```java
public OStorageConfiguration load() throws OSerializationException {
final byte[] record = storage.readRecord(CONFIG_RID, null, false, null).buffer;
if (record == null)
throw new OStorageException("Cannot load database's configuration. The data... |
mikepenz/FastAdapter | library-core/src/main/java/com/mikepenz/fastadapter/select/SelectExtension.java | SelectExtension.toggleSelection | public void toggleSelection(int position) {
if (mFastAdapter.getItem(position).isSelected()) {
deselect(position);
} else {
select(position);
}
} | java | public void toggleSelection(int position) {
if (mFastAdapter.getItem(position).isSelected()) {
deselect(position);
} else {
select(position);
}
} | [
"public",
"void",
"toggleSelection",
"(",
"int",
"position",
")",
"{",
"if",
"(",
"mFastAdapter",
".",
"getItem",
"(",
"position",
")",
".",
"isSelected",
"(",
")",
")",
"{",
"deselect",
"(",
"position",
")",
";",
"}",
"else",
"{",
"select",
"(",
"posi... | toggles the selection of the item at the given position
@param position the global position | [
"toggles",
"the",
"selection",
"of",
"the",
"item",
"at",
"the",
"given",
"position"
] | 3b2412abe001ba58422e0125846b704d4dba4ae9 | https://github.com/mikepenz/FastAdapter/blob/3b2412abe001ba58422e0125846b704d4dba4ae9/library-core/src/main/java/com/mikepenz/fastadapter/select/SelectExtension.java#L259-L265 | train | Toggle selection of a single item | Of course, here is the Java code you requested:
```java
public void toggleSelection(int position) {
if (mFastAdapter.getItem(position).isSelected()) {
deselect(position);
} else {
select(position);
}
}
```
Hope this helps! |
strator-dev/greenpepper | greenpepper/greenpepper-client/src/main/java/com/greenpepper/server/domain/Reference.java | Reference.getRequirement | @ManyToOne( cascade = {CascadeType.PERSIST, CascadeType.ALL} )
@JoinColumn(name="REQUIREMENT_ID")
public Requirement getRequirement()
{
return requirement;
} | java | @ManyToOne( cascade = {CascadeType.PERSIST, CascadeType.ALL} )
@JoinColumn(name="REQUIREMENT_ID")
public Requirement getRequirement()
{
return requirement;
} | [
"@",
"ManyToOne",
"(",
"cascade",
"=",
"{",
"CascadeType",
".",
"PERSIST",
",",
"CascadeType",
".",
"ALL",
"}",
")",
"@",
"JoinColumn",
"(",
"name",
"=",
"\"REQUIREMENT_ID\"",
")",
"public",
"Requirement",
"getRequirement",
"(",
")",
"{",
"return",
"requirem... | <p>Getter for the field <code>requirement</code>.</p>
@return a {@link com.greenpepper.server.domain.Requirement} object. | [
"<p",
">",
"Getter",
"for",
"the",
"field",
"<code",
">",
"requirement<",
"/",
"code",
">",
".",
"<",
"/",
"p",
">"
] | 2a61e6c179b74085babcc559d677490b0cad2d30 | https://github.com/strator-dev/greenpepper/blob/2a61e6c179b74085babcc559d677490b0cad2d30/greenpepper/greenpepper-client/src/main/java/com/greenpepper/server/domain/Reference.java#L98-L103 | train | Gets the value of the requirement property. | Of course, here is the Java code you requested:
```java
@ManyToOne( cascade = {CascadeType.PERSIST, CascadeType.ALL} )
@JoinColumn(name="REQUIREMENT_ID")
public Requirement getRequirement()
{
return requirement;
}
```
Hope this helps! |
sarl/sarl | sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/services/Services.java | Services.runDependencyGraph | @SuppressWarnings("checkstyle:npathcomplexity")
private static void runDependencyGraph(Queue<DependencyNode> roots, List<Service> infraServices, List<Service> freeServices,
Accessors accessors) {
final boolean async = accessors.isAsyncStateWaitingEnabled();
final Set<Class<? extends Service>> executed = new Tre... | java | @SuppressWarnings("checkstyle:npathcomplexity")
private static void runDependencyGraph(Queue<DependencyNode> roots, List<Service> infraServices, List<Service> freeServices,
Accessors accessors) {
final boolean async = accessors.isAsyncStateWaitingEnabled();
final Set<Class<? extends Service>> executed = new Tre... | [
"@",
"SuppressWarnings",
"(",
"\"checkstyle:npathcomplexity\"",
")",
"private",
"static",
"void",
"runDependencyGraph",
"(",
"Queue",
"<",
"DependencyNode",
">",
"roots",
",",
"List",
"<",
"Service",
">",
"infraServices",
",",
"List",
"<",
"Service",
">",
"freeSer... | Run the dependency graph for the services.
@param roots filled with the services that have no dependency.
@param infraServices filled with the infrastructure services.
@param freeServices filled with the services that are executed before/after all the dependent services.
@param accessors permits to retreive informatio... | [
"Run",
"the",
"dependency",
"graph",
"for",
"the",
"services",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/services/Services.java#L280-L309 | train | Run the dependency graph. | Of course, here is the Java code you requested:
```java
@SuppressWarnings("checkstyle:npathcomplexity")
private static void runDependencyGraph(Queue<DependencyNode> roots, List<Service> infraServices, List<Service> freeServices,
Accessors accessors) {
final boolean async = accessors.isAsyncStateWaitingEnabled();... |
finmath/finmath-lib | src/main/java/net/finmath/montecarlo/automaticdifferentiation/backward/alternative/RandomVariableUniqueVariableFactory.java | RandomVariableUniqueVariableFactory.createRandomVariable | public RandomVariable createRandomVariable(RandomVariable randomvariable, boolean isConstant, ArrayList<RandomVariableUniqueVariable> parentVariables, RandomVariableUniqueVariable.OperatorType parentOperatorType) {
int factoryID = currentFactoryID++;
listOfAllVariables.add(
factoryID,
randomvariable... | java | public RandomVariable createRandomVariable(RandomVariable randomvariable, boolean isConstant, ArrayList<RandomVariableUniqueVariable> parentVariables, RandomVariableUniqueVariable.OperatorType parentOperatorType) {
int factoryID = currentFactoryID++;
listOfAllVariables.add(
factoryID,
randomvariable... | [
"public",
"RandomVariable",
"createRandomVariable",
"(",
"RandomVariable",
"randomvariable",
",",
"boolean",
"isConstant",
",",
"ArrayList",
"<",
"RandomVariableUniqueVariable",
">",
"parentVariables",
",",
"RandomVariableUniqueVariable",
".",
"OperatorType",
"parentOperatorTyp... | Add an object of {@link RandomVariable} to variable list at the index of the current ID
and rises the current ID to the next one.
@param randomvariable object of {@link RandomVariable} to add to ArrayList and return as {@link RandomVariableUniqueVariable}
@param isConstant boolean such that if true the derivative will ... | [
"Add",
"an",
"object",
"of",
"{"
] | a3c067d52dd33feb97d851df6cab130e4116759f | https://github.com/finmath/finmath-lib/blob/a3c067d52dd33feb97d851df6cab130e4116759f/src/main/java/net/finmath/montecarlo/automaticdifferentiation/backward/alternative/RandomVariableUniqueVariableFactory.java#L49-L59 | train | Creates a new random variable unique variable. | Of course, here is the Java code you requested:
```java
public RandomVariable createRandomVariable(RandomVariable randomvariable, boolean isConstant, ArrayList<RandomVariableUniqueVariable> parentVariables, RandomVariableUniqueVariable.OperatorType parentOperatorType) {
int factoryID = currentFactoryID++;
li... |
DDTH/ddth-cache-adapter | ddth-cache-adapter-core/src/main/java/com/github/ddth/cacheadapter/cacheimpl/memcached/XMemcachedCacheFactory.java | XMemcachedCacheFactory.createCacheInternal | @Override
protected XMemcachedCache createCacheInternal(String name, long capacity, long expireAfterWrite,
long expireAfterAccess, Properties cacheProps) {
XMemcachedCache cache = new XMemcachedCache(keyMode);
cache.setName(name).setCapacity(capacity).setExpireAfterAccess(expireAfterAcce... | java | @Override
protected XMemcachedCache createCacheInternal(String name, long capacity, long expireAfterWrite,
long expireAfterAccess, Properties cacheProps) {
XMemcachedCache cache = new XMemcachedCache(keyMode);
cache.setName(name).setCapacity(capacity).setExpireAfterAccess(expireAfterAcce... | [
"@",
"Override",
"protected",
"XMemcachedCache",
"createCacheInternal",
"(",
"String",
"name",
",",
"long",
"capacity",
",",
"long",
"expireAfterWrite",
",",
"long",
"expireAfterAccess",
",",
"Properties",
"cacheProps",
")",
"{",
"XMemcachedCache",
"cache",
"=",
"ne... | {@inheritDoc} | [
"{"
] | 7c897570cd2ce45f305601abbc4d3d61273da532 | https://github.com/DDTH/ddth-cache-adapter/blob/7c897570cd2ce45f305601abbc4d3d61273da532/ddth-cache-adapter-core/src/main/java/com/github/ddth/cacheadapter/cacheimpl/memcached/XMemcachedCacheFactory.java#L194-L203 | valid | Create a cache. | Of course, here is the Java code you requested:
```java
@Override
protected XMemcachedCache createCacheInternal(String name, long capacity, long expireAfterWrite,
long expireAfterAccess, Properties cacheProps) {
XMemcachedCache cache = new XMemcachedCache(keyMode);
cache.setName(name).s... |
jboss-integration/fuse-bxms-integ | switchyard/switchyard-component-common-knowledge/src/main/java/org/switchyard/component/common/knowledge/expression/ContextMap.java | ContextMap.putAll | @Override
public void putAll(Map<? extends String, ? extends Object> m) {
for (Entry<? extends String, ? extends Object> entry : m.entrySet()) {
setProperty(entry.getKey(), entry.getValue(), _scope);
}
} | java | @Override
public void putAll(Map<? extends String, ? extends Object> m) {
for (Entry<? extends String, ? extends Object> entry : m.entrySet()) {
setProperty(entry.getKey(), entry.getValue(), _scope);
}
} | [
"@",
"Override",
"public",
"void",
"putAll",
"(",
"Map",
"<",
"?",
"extends",
"String",
",",
"?",
"extends",
"Object",
">",
"m",
")",
"{",
"for",
"(",
"Entry",
"<",
"?",
"extends",
"String",
",",
"?",
"extends",
"Object",
">",
"entry",
":",
"m",
".... | {@inheritDoc} | [
"{"
] | ca5c012bf867ea15d1250f0991af3cd7e708aaaf | https://github.com/jboss-integration/fuse-bxms-integ/blob/ca5c012bf867ea15d1250f0991af3cd7e708aaaf/switchyard/switchyard-component-common-knowledge/src/main/java/org/switchyard/component/common/knowledge/expression/ContextMap.java#L188-L193 | train | Override putAll to allow the caller to override this method. | Of course, here is the Java code you requested:
```java
@Override
public void putAll(Map<? extends String, ? extends Object> m) {
for (Entry<? extends String, ? extends Object> entry : m.entrySet()) {
setProperty(entry.getKey(), entry.getValue(), _scope);
}
}
```
Hope this helps! |
real-logic/agrona | agrona/src/main/java/org/agrona/concurrent/HighResolutionClock.java | HighResolutionClock.epochMicros | public static long epochMicros()
{
final Instant now = Instant.now();
final long seconds = now.getEpochSecond();
final long nanosFromSecond = now.getNano();
return (seconds * 1_000_000) + (nanosFromSecond / 1_000);
} | java | public static long epochMicros()
{
final Instant now = Instant.now();
final long seconds = now.getEpochSecond();
final long nanosFromSecond = now.getNano();
return (seconds * 1_000_000) + (nanosFromSecond / 1_000);
} | [
"public",
"static",
"long",
"epochMicros",
"(",
")",
"{",
"final",
"Instant",
"now",
"=",
"Instant",
".",
"now",
"(",
")",
";",
"final",
"long",
"seconds",
"=",
"now",
".",
"getEpochSecond",
"(",
")",
";",
"final",
"long",
"nanosFromSecond",
"=",
"now",
... | The number of microseconds since the 1 Jan 1970 UTC.
@return the number of microseconds since the 1 Jan 1970 UTC. | [
"The",
"number",
"of",
"microseconds",
"since",
"the",
"1",
"Jan",
"1970",
"UTC",
"."
] | d1ea76e6e3598cd6a0d34879687652ef123f639b | https://github.com/real-logic/agrona/blob/d1ea76e6e3598cd6a0d34879687652ef123f639b/agrona/src/main/java/org/agrona/concurrent/HighResolutionClock.java#L42-L49 | train | Get the epoch microseconds. | Of course, here is the Java code you requested:
```java
public static long epochMicros()
{
final Instant now = Instant.now();
final long seconds = now.getEpochSecond();
final long nanosFromSecond = now.getNano();
return (seconds * 1_000_000) + (nanosFromSecond / 1_000);
}
```
... |
oblac/jodd | jodd-db/src/main/java/jodd/db/oom/dao/GenericDao.java | GenericDao.find | public <E> List<E> find(final Class<E> entityType, final Object criteria) {
return query(dbOom.entities().find(entityType, criteria)).autoClose().list(entityType);
} | java | public <E> List<E> find(final Class<E> entityType, final Object criteria) {
return query(dbOom.entities().find(entityType, criteria)).autoClose().list(entityType);
} | [
"public",
"<",
"E",
">",
"List",
"<",
"E",
">",
"find",
"(",
"final",
"Class",
"<",
"E",
">",
"entityType",
",",
"final",
"Object",
"criteria",
")",
"{",
"return",
"query",
"(",
"dbOom",
".",
"entities",
"(",
")",
".",
"find",
"(",
"entityType",
",... | Finds list of entities matching given criteria. | [
"Finds",
"list",
"of",
"entities",
"matching",
"given",
"criteria",
"."
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-db/src/main/java/jodd/db/oom/dao/GenericDao.java#L208-L210 | test | Find entities by criteria. | Of course, here is the Java code you requested:
```java
public <E> List<E> find(final Class<E> entityType, final Object criteria) {
return query(dbOom.entities().find(entityType, criteria)).autoClose().list(entityType);
}
```
Hope this helps! |
atomix/atomix | protocols/raft/src/main/java/io/atomix/protocols/raft/service/RaftServiceContext.java | RaftServiceContext.applyCommand | private OperationResult applyCommand(long index, long sequence, long timestamp, PrimitiveOperation operation, RaftSession session) {
long eventIndex = session.getEventIndex();
Commit<byte[]> commit = new DefaultCommit<>(index, operation.id(), operation.value(), session, timestamp);
OperationResult result;... | java | private OperationResult applyCommand(long index, long sequence, long timestamp, PrimitiveOperation operation, RaftSession session) {
long eventIndex = session.getEventIndex();
Commit<byte[]> commit = new DefaultCommit<>(index, operation.id(), operation.value(), session, timestamp);
OperationResult result;... | [
"private",
"OperationResult",
"applyCommand",
"(",
"long",
"index",
",",
"long",
"sequence",
",",
"long",
"timestamp",
",",
"PrimitiveOperation",
"operation",
",",
"RaftSession",
"session",
")",
"{",
"long",
"eventIndex",
"=",
"session",
".",
"getEventIndex",
"(",... | Applies the given commit to the state machine. | [
"Applies",
"the",
"given",
"commit",
"to",
"the",
"state",
"machine",
"."
] | 3a94b7c80576d762dd0d396d4645df07a0b37c31 | https://github.com/atomix/atomix/blob/3a94b7c80576d762dd0d396d4645df07a0b37c31/protocols/raft/src/main/java/io/atomix/protocols/raft/service/RaftServiceContext.java#L532-L565 | train | Apply a command to the state machine. | Of course, here is the Java code you requested:
```java
private OperationResult applyCommand(long index, long sequence, long timestamp, PrimitiveOperation operation, RaftSession session) {
long eventIndex = session.getEventIndex();
Commit<byte[]> commit = new DefaultCommit<>(index, operation.id(), operation.v... |
SeleniumHQ/selenium | java/server/src/org/openqa/grid/selenium/GridLauncherV3.java | GridLauncherV3.buildLauncher | private GridItemLauncher buildLauncher(String[] args) {
if (Arrays.asList(args).contains("-htmlSuite")) {
out.println(Joiner.on("\n").join(
"Download the Selenium HTML Runner from http://www.seleniumhq.org/download/ and",
"use that to run your HTML suite."));
return null;
}
... | java | private GridItemLauncher buildLauncher(String[] args) {
if (Arrays.asList(args).contains("-htmlSuite")) {
out.println(Joiner.on("\n").join(
"Download the Selenium HTML Runner from http://www.seleniumhq.org/download/ and",
"use that to run your HTML suite."));
return null;
}
... | [
"private",
"GridItemLauncher",
"buildLauncher",
"(",
"String",
"[",
"]",
"args",
")",
"{",
"if",
"(",
"Arrays",
".",
"asList",
"(",
"args",
")",
".",
"contains",
"(",
"\"-htmlSuite\"",
")",
")",
"{",
"out",
".",
"println",
"(",
"Joiner",
".",
"on",
"("... | From the {@code args}, builds a new {@link GridItemLauncher} and populates it properly.
@return null if no role is found, or a properly populated {@link GridItemLauncher}. | [
"From",
"the",
"{",
"@code",
"args",
"}",
"builds",
"a",
"new",
"{",
"@link",
"GridItemLauncher",
"}",
"and",
"populates",
"it",
"properly",
"."
] | 7af172729f17b20269c8ca4ea6f788db48616535 | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/server/src/org/openqa/grid/selenium/GridLauncherV3.java#L95-L125 | train | Build the launcher. | Of course, here is the Java code you requested:
```java
private GridItemLauncher buildLauncher(String[] args) {
if (Arrays.asList(args).contains("-htmlSuite")) {
out.println(Joiner.on("\n").join(
"Download the Selenium HTML Runner from http://www.seleniumhq.org/download/ and",
"use that t... |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/field/ReferenceField.java | ReferenceField.getIDFromCode | public int getIDFromCode(String strCode)
{
int iID = 0;
try {
iID = Integer.parseInt(strCode); // Special case - if an integer, just convert it.
} catch (NumberFormatException ex) {
iID = 0;
}
if (iID == 0)
{
Record record = t... | java | public int getIDFromCode(String strCode)
{
int iID = 0;
try {
iID = Integer.parseInt(strCode); // Special case - if an integer, just convert it.
} catch (NumberFormatException ex) {
iID = 0;
}
if (iID == 0)
{
Record record = t... | [
"public",
"int",
"getIDFromCode",
"(",
"String",
"strCode",
")",
"{",
"int",
"iID",
"=",
"0",
";",
"try",
"{",
"iID",
"=",
"Integer",
".",
"parseInt",
"(",
"strCode",
")",
";",
"// Special case - if an integer, just convert it.",
"}",
"catch",
"(",
"NumberForm... | Get the referenced record's ID given the code.
This method converts the code to the record ID by reading the secondary key of the referenced record.
@param strCode The code to convert (ie., "EMAIL_TYPE")
@return int The ID of the referenced record (or 0 if not found). | [
"Get",
"the",
"referenced",
"record",
"s",
"ID",
"given",
"the",
"code",
".",
"This",
"method",
"converts",
"the",
"code",
"to",
"the",
"record",
"ID",
"by",
"reading",
"the",
"secondary",
"key",
"of",
"the",
"referenced",
"record",
"."
] | 4037fcfa85f60c7d0096c453c1a3cd573c2b0abc | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/ReferenceField.java#L249-L264 | train | Get the ID from the code. | Of course, here is the Java code you requested:
```java
public int getIDFromCode(String strCode)
{
int iID = 0;
try {
iID = Integer.parseInt(strCode); // Special case - if an integer, just convert it.
} catch (NumberFormatException ex) {
iID = 0;
}
... |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/util/ManifestDigester.java | ManifestDigester.findSection | @SuppressWarnings("fallthrough")
private boolean findSection(int offset, Position pos)
{
int i = offset, len = rawBytes.length;
int last = offset;
int next;
boolean allBlank = true;
pos.endOfFirstLine = -1;
while (i < len) {
byte b = rawBytes[i];
... | java | @SuppressWarnings("fallthrough")
private boolean findSection(int offset, Position pos)
{
int i = offset, len = rawBytes.length;
int last = offset;
int next;
boolean allBlank = true;
pos.endOfFirstLine = -1;
while (i < len) {
byte b = rawBytes[i];
... | [
"@",
"SuppressWarnings",
"(",
"\"fallthrough\"",
")",
"private",
"boolean",
"findSection",
"(",
"int",
"offset",
",",
"Position",
"pos",
")",
"{",
"int",
"i",
"=",
"offset",
",",
"len",
"=",
"rawBytes",
".",
"length",
";",
"int",
"last",
"=",
"offset",
"... | find a section in the manifest.
@param offset should point to the starting offset with in the
raw bytes of the next section.
@pos set by
@returns false if end of bytes has been reached, otherwise returns
true | [
"find",
"a",
"section",
"in",
"the",
"manifest",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/util/ManifestDigester.java#L65-L108 | train | Find a section in the source file. | Of course, here is the Java code you requested:
```java
@SuppressWarnings("fallthrough")
private boolean findSection(int offset, Position pos)
{
int i = offset, len = rawBytes.length;
int last = offset;
int next;
boolean allBlank = true;
pos.endOfFirstLine = -1;
... |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/HashMap.java | HashMap.putMapEntries | final void putMapEntries(Map<? extends K, ? extends V> m, boolean evict) {
int s = m.size();
if (s > 0) {
if (table == null) { // pre-size
float ft = ((float)s / loadFactor) + 1.0F;
int t = ((ft < (float)MAXIMUM_CAPACITY) ?
(int)ft : M... | java | final void putMapEntries(Map<? extends K, ? extends V> m, boolean evict) {
int s = m.size();
if (s > 0) {
if (table == null) { // pre-size
float ft = ((float)s / loadFactor) + 1.0F;
int t = ((ft < (float)MAXIMUM_CAPACITY) ?
(int)ft : M... | [
"final",
"void",
"putMapEntries",
"(",
"Map",
"<",
"?",
"extends",
"K",
",",
"?",
"extends",
"V",
">",
"m",
",",
"boolean",
"evict",
")",
"{",
"int",
"s",
"=",
"m",
".",
"size",
"(",
")",
";",
"if",
"(",
"s",
">",
"0",
")",
"{",
"if",
"(",
... | Implements Map.putAll and Map constructor
@param m the map
@param evict false when initially constructing this map, else
true (relayed to method afterNodeInsertion). | [
"Implements",
"Map",
".",
"putAll",
"and",
"Map",
"constructor"
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/HashMap.java#L505-L523 | train | Put the entries of the map into the cache. | Of course, here is the Java code you requested:
```java
final void putMapEntries(Map<? extends K, ? extends V> m, boolean evict) {
int s = m.size();
if (s > 0) {
if (table == null) { // pre-size
float ft = ((float)s / loadFactor) + 1.0F;
int t = ((ft < (float... |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/io/MPConnection.java | MPConnection.getVersion | public ProtocolVersion getVersion()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "getVersion");
// The ProtocolVersion to be returned
ProtocolVersion version = ProtocolVersion.UNKNOWN;
// Get the MetaData out of the connection
ConnectionMetaData co... | java | public ProtocolVersion getVersion()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "getVersion");
// The ProtocolVersion to be returned
ProtocolVersion version = ProtocolVersion.UNKNOWN;
// Get the MetaData out of the connection
ConnectionMetaData co... | [
"public",
"ProtocolVersion",
"getVersion",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"getVersion\"",
")",
";",
"// The Protocol... | Retrieve the ProtocolVersion associated with this connection.
@return the version of the connection protocol. | [
"Retrieve",
"the",
"ProtocolVersion",
"associated",
"with",
"this",
"connection",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/io/MPConnection.java#L219-L237 | train | Get the version of the protocol. | Of course, here is the Java code you requested:
```java
public ProtocolVersion getVersion()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "getVersion");
// The ProtocolVersion to be returned
ProtocolVersion version = ProtocolVersion.UNKNOWN;
// Get the... |
jtrfp/javamod | src/main/java/de/quippy/javamod/mixer/dsp/FFT.java | FFT.prepareFFTTables | private void prepareFFTTables()
{
int n2 = ss2;
int nu1 = nu-1;
int k = 0;
int x = 0;
for (int l=1; l<=nu; l++)
{
while (k < ss)
{
for (int i=1; i<=n2; i++)
{
double p = (double)bitrev(k >> nu1, nu);
double arg = (Math.PI * p * 2.0D) / (double) ss;
fftSin[x] = (long) (Math.sin(... | java | private void prepareFFTTables()
{
int n2 = ss2;
int nu1 = nu-1;
int k = 0;
int x = 0;
for (int l=1; l<=nu; l++)
{
while (k < ss)
{
for (int i=1; i<=n2; i++)
{
double p = (double)bitrev(k >> nu1, nu);
double arg = (Math.PI * p * 2.0D) / (double) ss;
fftSin[x] = (long) (Math.sin(... | [
"private",
"void",
"prepareFFTTables",
"(",
")",
"{",
"int",
"n2",
"=",
"ss2",
";",
"int",
"nu1",
"=",
"nu",
"-",
"1",
";",
"int",
"k",
"=",
"0",
";",
"int",
"x",
"=",
"0",
";",
"for",
"(",
"int",
"l",
"=",
"1",
";",
"l",
"<=",
"nu",
";",
... | We will here precalculate all sin and cos values
and all other things we can store
@since 03.10.2007 | [
"We",
"will",
"here",
"precalculate",
"all",
"sin",
"and",
"cos",
"values",
"and",
"all",
"other",
"things",
"we",
"can",
"store"
] | cda4fe943a589dc49415f4413453e2eece72076a | https://github.com/jtrfp/javamod/blob/cda4fe943a589dc49415f4413453e2eece72076a/src/main/java/de/quippy/javamod/mixer/dsp/FFT.java#L71-L100 | train | prepare the Fourier Transpose of the Fourier Transpose | Of course, here is the Java code you requested:
```java
private void prepareFFTTables()
{
int n2 = ss2;
int nu1 = nu-1;
int k = 0;
int x = 0;
for (int l=1; l<=nu; l++)
{
while (k < ss)
{
for (int i=1; i<=n2; i++)
{
double p = (double)bitrev(k >> nu1, nu);
double arg = (Math.PI * p ... |
rometools/rome-propono | src/main/java/com/rometools/propono/blogclient/atomprotocol/AtomEntryIterator.java | AtomEntryIterator.next | @Override
public BlogEntry next() {
try {
final ClientEntry entry = iterator.next();
if (entry instanceof ClientMediaEntry) {
return new AtomResource(collection, (ClientMediaEntry) entry);
} else {
return new AtomEntry(collection, entry);
... | java | @Override
public BlogEntry next() {
try {
final ClientEntry entry = iterator.next();
if (entry instanceof ClientMediaEntry) {
return new AtomResource(collection, (ClientMediaEntry) entry);
} else {
return new AtomEntry(collection, entry);
... | [
"@",
"Override",
"public",
"BlogEntry",
"next",
"(",
")",
"{",
"try",
"{",
"final",
"ClientEntry",
"entry",
"=",
"iterator",
".",
"next",
"(",
")",
";",
"if",
"(",
"entry",
"instanceof",
"ClientMediaEntry",
")",
"{",
"return",
"new",
"AtomResource",
"(",
... | Get next entry. | [
"Get",
"next",
"entry",
"."
] | 721de8d5a47998f92969d1ee3db80bdaa3f26fb2 | https://github.com/rometools/rome-propono/blob/721de8d5a47998f92969d1ee3db80bdaa3f26fb2/src/main/java/com/rometools/propono/blogclient/atomprotocol/AtomEntryIterator.java#L58-L71 | train | Gets the next entry in the blog. | Of course, here is the Java code you requested:
```java
@Override
public BlogEntry next() {
try {
final ClientEntry entry = iterator.next();
if (entry instanceof ClientMediaEntry) {
return new AtomResource(collection, (ClientMediaEntry) entry);
} else {
... |
meertensinstituut/mtas | src/main/java/mtas/solr/handler/component/util/MtasSolrComponentFacet.java | MtasSolrComponentFacet.prepare | public void prepare(ResponseBuilder rb, ComponentFields mtasFields)
throws IOException {
Set<String> ids = MtasSolrResultUtil
.getIdsFromParameters(rb.req.getParams(), PARAM_MTAS_FACET);
if (!ids.isEmpty()) {
int tmpCounter = 0;
String tmpValue;
String[] fields = new String[ids.s... | java | public void prepare(ResponseBuilder rb, ComponentFields mtasFields)
throws IOException {
Set<String> ids = MtasSolrResultUtil
.getIdsFromParameters(rb.req.getParams(), PARAM_MTAS_FACET);
if (!ids.isEmpty()) {
int tmpCounter = 0;
String tmpValue;
String[] fields = new String[ids.s... | [
"public",
"void",
"prepare",
"(",
"ResponseBuilder",
"rb",
",",
"ComponentFields",
"mtasFields",
")",
"throws",
"IOException",
"{",
"Set",
"<",
"String",
">",
"ids",
"=",
"MtasSolrResultUtil",
".",
"getIdsFromParameters",
"(",
"rb",
".",
"req",
".",
"getParams",... | /*
(non-Javadoc)
@see
mtas.solr.handler.component.util.MtasSolrComponent#prepare(org.apache.solr.
handler.component.ResponseBuilder,
mtas.codec.util.CodecComponent.ComponentFields) | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | f02ae730848616bd88b553efa7f9eddc32818e64 | https://github.com/meertensinstituut/mtas/blob/f02ae730848616bd88b553efa7f9eddc32818e64/src/main/java/mtas/solr/handler/component/util/MtasSolrComponentFacet.java#L146-L418 | train | Prepare the response. | Of course, here is the Java code you requested:
```java
public void prepare(ResponseBuilder rb, ComponentFields mtasFields)
throws IOException {
Set<String> ids = MtasSolrResultUtil
.getIdsFromParameters(rb.req.getParams(), PARAM_MTAS_FACET);
if (!ids.isEmpty()) {
int tmpCounter = 0;
... |
alkacon/opencms-core | src-gwt/org/opencms/acacia/client/widgets/serialdate/CmsSerialDateValue.java | CmsSerialDateValue.readWeekDay | private WeekDay readWeekDay(JSONValue val) throws IllegalArgumentException {
String str = readOptionalString(val);
if (null != str) {
return WeekDay.valueOf(str);
}
throw new IllegalArgumentException();
} | java | private WeekDay readWeekDay(JSONValue val) throws IllegalArgumentException {
String str = readOptionalString(val);
if (null != str) {
return WeekDay.valueOf(str);
}
throw new IllegalArgumentException();
} | [
"private",
"WeekDay",
"readWeekDay",
"(",
"JSONValue",
"val",
")",
"throws",
"IllegalArgumentException",
"{",
"String",
"str",
"=",
"readOptionalString",
"(",
"val",
")",
";",
"if",
"(",
"null",
"!=",
"str",
")",
"{",
"return",
"WeekDay",
".",
"valueOf",
"("... | Read a single weekday from the provided JSON value.
@param val the value to read the week day from.
@return the week day read
@throws IllegalArgumentException thrown if the provided JSON value is not the representation of a week day. | [
"Read",
"a",
"single",
"weekday",
"from",
"the",
"provided",
"JSON",
"value",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/acacia/client/widgets/serialdate/CmsSerialDateValue.java#L401-L408 | train | read a calendar component from the input value. | Of course, here is the Java code you requested:
```java
private WeekDay readWeekDay(JSONValue val) throws IllegalArgumentException {
String str = readOptionalString(val);
if (null != str) {
return WeekDay.valueOf(str);
}
throw new IllegalArgumentException();
}
```
Hope... |
sd4324530/fastweixin | src/main/java/com/github/sd4324530/fastweixin/api/JsAPI.java | JsAPI.getSignature | public GetSignatureResponse getSignature(String nonceStr, long timestame, String url) {
BeanUtil.requireNonNull(url, "请传入当前网页的URL,不包含#及其后面部分");
GetSignatureResponse response = new GetSignatureResponse();
String jsApiTicket = this.config.getJsApiTicket();
String sign;
try {
... | java | public GetSignatureResponse getSignature(String nonceStr, long timestame, String url) {
BeanUtil.requireNonNull(url, "请传入当前网页的URL,不包含#及其后面部分");
GetSignatureResponse response = new GetSignatureResponse();
String jsApiTicket = this.config.getJsApiTicket();
String sign;
try {
... | [
"public",
"GetSignatureResponse",
"getSignature",
"(",
"String",
"nonceStr",
",",
"long",
"timestame",
",",
"String",
"url",
")",
"{",
"BeanUtil",
".",
"requireNonNull",
"(",
"url",
",",
"\"请传入当前网页的URL,不包含#及其后面部分\");",
"",
"",
"GetSignatureResponse",
"response",
"="... | 获取js-sdk所需的签名,给调用者最大的自由度,控制生成签名的参数
@param nonceStr 随机字符串
@param timestame 时间戳
@param url 当前网页的URL,不包含#及其后面部分
@return 签名以及相关参数 | [
"获取js",
"-",
"sdk所需的签名,给调用者最大的自由度,控制生成签名的参数"
] | 6bc0a7abfa23aad0dbad4c3123a47a7fb53f3447 | https://github.com/sd4324530/fastweixin/blob/6bc0a7abfa23aad0dbad4c3123a47a7fb53f3447/src/main/java/com/github/sd4324530/fastweixin/api/JsAPI.java#L47-L66 | train | Get signature response. | Of course, here is the Java code you requested:
```java
public GetSignatureResponse getSignature(String nonceStr, long timestame, String url) {
BeanUtil.requireNonNull(url, "请传入当前网页的URL,不包含#及其后面部分");
GetSignatureResponse response = new GetSignatureResponse();
String jsApiTicket = this.config.ge... |
alipay/sofa-rpc | extension-impl/registry-sofa/src/main/java/com/alipay/sofa/rpc/registry/sofa/SofaRegistrySubscribeCallback.java | SofaRegistrySubscribeCallback.composeUserAndConfigData | private ComposeUserData composeUserAndConfigData(UserData userData, ConfigData configData) {
ComposeUserData result = new ComposeUserData();
Map<String, List<ProviderInfo>> zoneData = new HashMap<String, List<ProviderInfo>>();
if (userData == null) {
return result;
} else {... | java | private ComposeUserData composeUserAndConfigData(UserData userData, ConfigData configData) {
ComposeUserData result = new ComposeUserData();
Map<String, List<ProviderInfo>> zoneData = new HashMap<String, List<ProviderInfo>>();
if (userData == null) {
return result;
} else {... | [
"private",
"ComposeUserData",
"composeUserAndConfigData",
"(",
"UserData",
"userData",
",",
"ConfigData",
"configData",
")",
"{",
"ComposeUserData",
"result",
"=",
"new",
"ComposeUserData",
"(",
")",
";",
"Map",
"<",
"String",
",",
"List",
"<",
"ProviderInfo",
">"... | merge data
@param userData
@param configData
@return | [
"merge",
"data"
] | a31406410291e56696185a29c3ba4bd1f54488fd | https://github.com/alipay/sofa-rpc/blob/a31406410291e56696185a29c3ba4bd1f54488fd/extension-impl/registry-sofa/src/main/java/com/alipay/sofa/rpc/registry/sofa/SofaRegistrySubscribeCallback.java#L169-L193 | train | compose user data and config data | Of course, here is the Java code you requested:
```java
private ComposeUserData composeUserAndConfigData(UserData userData, ConfigData configData) {
ComposeUserData result = new ComposeUserData();
Map<String, List<ProviderInfo>> zoneData = new HashMap<String, List<ProviderInfo>>();
if (userDa... |
aws/aws-sdk-java | aws-java-sdk-opsworks/src/main/java/com/amazonaws/services/opsworks/AWSOpsWorksClient.java | AWSOpsWorksClient.describeLoadBasedAutoScaling | @Override
public DescribeLoadBasedAutoScalingResult describeLoadBasedAutoScaling(DescribeLoadBasedAutoScalingRequest request) {
request = beforeClientExecution(request);
return executeDescribeLoadBasedAutoScaling(request);
} | java | @Override
public DescribeLoadBasedAutoScalingResult describeLoadBasedAutoScaling(DescribeLoadBasedAutoScalingRequest request) {
request = beforeClientExecution(request);
return executeDescribeLoadBasedAutoScaling(request);
} | [
"@",
"Override",
"public",
"DescribeLoadBasedAutoScalingResult",
"describeLoadBasedAutoScaling",
"(",
"DescribeLoadBasedAutoScalingRequest",
"request",
")",
"{",
"request",
"=",
"beforeClientExecution",
"(",
"request",
")",
";",
"return",
"executeDescribeLoadBasedAutoScaling",
... | <p>
Describes load-based auto scaling configurations for specified layers.
</p>
<note>
<p>
You must specify at least one of the parameters.
</p>
</note>
<p>
<b>Required Permissions</b>: To use this action, an IAM user must have a Show, Deploy, or Manage permissions
level for the stack, or an attached policy that explic... | [
"<p",
">",
"Describes",
"load",
"-",
"based",
"auto",
"scaling",
"configurations",
"for",
"specified",
"layers",
".",
"<",
"/",
"p",
">",
"<note",
">",
"<p",
">",
"You",
"must",
"specify",
"at",
"least",
"one",
"of",
"the",
"parameters",
".",
"<",
"/",... | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-opsworks/src/main/java/com/amazonaws/services/opsworks/AWSOpsWorksClient.java#L2444-L2448 | train | Retrieves the details of an AutoScaling region that is used to load an AutoScaling region. | Of course, here is the Java code you requested:
```java
@Override
public DescribeLoadBasedAutoScalingResult describeLoadBasedAutoScaling(DescribeLoadBasedAutoScalingRequest request) {
request = beforeClientExecution(request);
return executeDescribeLoadBasedAutoScaling(request);
}
```
Hope this... |
icode/ameba | src/main/java/ameba/message/error/ErrorProcessingFeature.java | ErrorProcessingFeature.configure | @Override
public boolean configure(FeatureContext context) {
context.register(DefaultExceptionMapper.class)
.register(StatusMapper.class);
return true;
} | java | @Override
public boolean configure(FeatureContext context) {
context.register(DefaultExceptionMapper.class)
.register(StatusMapper.class);
return true;
} | [
"@",
"Override",
"public",
"boolean",
"configure",
"(",
"FeatureContext",
"context",
")",
"{",
"context",
".",
"register",
"(",
"DefaultExceptionMapper",
".",
"class",
")",
".",
"register",
"(",
"StatusMapper",
".",
"class",
")",
";",
"return",
"true",
";",
... | {@inheritDoc} | [
"{"
] | 9d4956e935898e41331b2745e400ef869cd265e0 | https://github.com/icode/ameba/blob/9d4956e935898e41331b2745e400ef869cd265e0/src/main/java/ameba/message/error/ErrorProcessingFeature.java#L16-L21 | train | Override this to register the exception and status mapper classes. | Of course, here is the Java code you requested:
```java
@Override
public boolean configure(FeatureContext context) {
context.register(DefaultExceptionMapper.class)
.register(StatusMapper.class);
return true;
}
```
Hope this helps! |
knowm/XChange | xchange-okcoin/src/main/java/org/knowm/xchange/okcoin/service/OkCoinMarketDataServiceRaw.java | OkCoinMarketDataServiceRaw.getFutureKline | public List<OkCoinFutureKline> getFutureKline(
CurrencyPair currencyPair,
OkCoinKlineType type,
FuturesContract contractType,
Integer size,
Long since)
throws IOException {
List<Object[]> list =
okCoin.getFutureKline(
"1",
OkCoinAdapters.adaptSymbo... | java | public List<OkCoinFutureKline> getFutureKline(
CurrencyPair currencyPair,
OkCoinKlineType type,
FuturesContract contractType,
Integer size,
Long since)
throws IOException {
List<Object[]> list =
okCoin.getFutureKline(
"1",
OkCoinAdapters.adaptSymbo... | [
"public",
"List",
"<",
"OkCoinFutureKline",
">",
"getFutureKline",
"(",
"CurrencyPair",
"currencyPair",
",",
"OkCoinKlineType",
"type",
",",
"FuturesContract",
"contractType",
",",
"Integer",
"size",
",",
"Long",
"since",
")",
"throws",
"IOException",
"{",
"List",
... | 获取OKEx合约K线信息
@param currencyPair
@param type
@param contractType
@param size
@param since
@return
@throws IOException | [
"获取OKEx合约K线信息"
] | e45f437ac8e0b89cd66cdcb3258bdb1bf3d88186 | https://github.com/knowm/XChange/blob/e45f437ac8e0b89cd66cdcb3258bdb1bf3d88186/xchange-okcoin/src/main/java/org/knowm/xchange/okcoin/service/OkCoinMarketDataServiceRaw.java#L190-L208 | train | Get a list of OkCoinFutureKline objects from OkCoin | Of course, here is the Java code you requested:
```java
public List<OkCoinFutureKline> getFutureKline(
CurrencyPair currencyPair,
OkCoinKlineType type,
FuturesContract contractType,
Integer size,
Long since)
throws IOException {
List<Object[]> list =
okCoin.getFutureKlin... |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/AOStream.java | AOStream.removeConsumerKey | public final void removeConsumerKey(String selector, JSRemoteConsumerPoint aock)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "removeConsumerKey", new Object[] { selector, aock });
synchronized (this)
{
JSRemoteConsumerPoint aock2 = (JSRemoteConsumerPoint... | java | public final void removeConsumerKey(String selector, JSRemoteConsumerPoint aock)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "removeConsumerKey", new Object[] { selector, aock });
synchronized (this)
{
JSRemoteConsumerPoint aock2 = (JSRemoteConsumerPoint... | [
"public",
"final",
"void",
"removeConsumerKey",
"(",
"String",
"selector",
",",
"JSRemoteConsumerPoint",
"aock",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry... | Method to remove the given JSRemoteConsumerPoint from the consumerKeyTable
@param selector The string representation of the SelectionCriteria(s) of this JSRemoteConsumerPoint
@param aock The JSRemoteConsumerPoint to remove | [
"Method",
"to",
"remove",
"the",
"given",
"JSRemoteConsumerPoint",
"from",
"the",
"consumerKeyTable"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/AOStream.java#L1068-L1084 | train | Removes a consumer key from the table. | Of course, here is the Java code you requested:
```java
public final void removeConsumerKey(String selector, JSRemoteConsumerPoint aock)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "removeConsumerKey", new Object[] { selector, aock });
synchronized (this)
{
... |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/MessageFormat.java | MessageFormat.findOtherSubMessage | private int findOtherSubMessage(int partIndex) {
int count=msgPattern.countParts();
MessagePattern.Part part=msgPattern.getPart(partIndex);
if(part.getType().hasNumericValue()) {
++partIndex;
}
// Iterate over (ARG_SELECTOR [ARG_INT|ARG_DOUBLE] message) tuples
... | java | private int findOtherSubMessage(int partIndex) {
int count=msgPattern.countParts();
MessagePattern.Part part=msgPattern.getPart(partIndex);
if(part.getType().hasNumericValue()) {
++partIndex;
}
// Iterate over (ARG_SELECTOR [ARG_INT|ARG_DOUBLE] message) tuples
... | [
"private",
"int",
"findOtherSubMessage",
"(",
"int",
"partIndex",
")",
"{",
"int",
"count",
"=",
"msgPattern",
".",
"countParts",
"(",
")",
";",
"MessagePattern",
".",
"Part",
"part",
"=",
"msgPattern",
".",
"getPart",
"(",
"partIndex",
")",
";",
"if",
"("... | Finds the "other" sub-message.
@param partIndex the index of the first PluralFormat argument style part.
@return the "other" sub-message start part index. | [
"Finds",
"the",
"other",
"sub",
"-",
"message",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/MessageFormat.java#L1940-L1965 | train | Find other sub - message. | Of course, here is the Java code you requested:
```java
private int findOtherSubMessage(int partIndex) {
int count=msgPattern.countParts();
MessagePattern.Part part=msgPattern.getPart(partIndex);
if(part.getType().hasNumericValue()) {
++partIndex;
}
// Iterate over (... |
stratosphere/stratosphere | stratosphere-core/src/main/java/eu/stratosphere/api/common/io/BinaryInputFormat.java | BinaryInputFormat.createStatistics | protected SequentialStatistics createStatistics(List<FileStatus> files, FileBaseStatistics stats)
throws IOException {
if (files.isEmpty()) {
return null;
}
BlockInfo blockInfo = this.createBlockInfo();
long totalCount = 0;
for (FileStatus file : files) {
// invalid file
if (file.getLen() < bloc... | java | protected SequentialStatistics createStatistics(List<FileStatus> files, FileBaseStatistics stats)
throws IOException {
if (files.isEmpty()) {
return null;
}
BlockInfo blockInfo = this.createBlockInfo();
long totalCount = 0;
for (FileStatus file : files) {
// invalid file
if (file.getLen() < bloc... | [
"protected",
"SequentialStatistics",
"createStatistics",
"(",
"List",
"<",
"FileStatus",
">",
"files",
",",
"FileBaseStatistics",
"stats",
")",
"throws",
"IOException",
"{",
"if",
"(",
"files",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
... | Fill in the statistics. The last modification time and the total input size are prefilled.
@param files
The files that are associated with this block input format.
@param stats
The pre-filled statistics. | [
"Fill",
"in",
"the",
"statistics",
".",
"The",
"last",
"modification",
"time",
"and",
"the",
"total",
"input",
"size",
"are",
"prefilled",
"."
] | c543a08f9676c5b2b0a7088123bd6e795a8ae0c8 | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-core/src/main/java/eu/stratosphere/api/common/io/BinaryInputFormat.java#L197-L223 | train | Create the sequential statistics from the given files. | Of course, here is the Java code you requested:
```java
protected SequentialStatistics createStatistics(List<FileStatus> files, FileBaseStatistics stats)
throws IOException {
if (files.isEmpty()) {
return null;
}
BlockInfo blockInfo = this.createBlockInfo();
long totalCount = 0;
for (FileStatus file ... |
kiswanij/jk-util | src/main/java/com/jk/util/JKObjectUtil.java | JKObjectUtil.populate | public static void populate(Object instance, Map<String, Object> values) {
try {
BeanUtilsBean beanUtilBean = new BeanUtilsBean();
for (String key : values.keySet()) {
Object value = values.get(key);
beanUtilBean.setProperty(instance, key, value);
}
} catch (Exception e) {
JKExceptionUti... | java | public static void populate(Object instance, Map<String, Object> values) {
try {
BeanUtilsBean beanUtilBean = new BeanUtilsBean();
for (String key : values.keySet()) {
Object value = values.get(key);
beanUtilBean.setProperty(instance, key, value);
}
} catch (Exception e) {
JKExceptionUti... | [
"public",
"static",
"void",
"populate",
"(",
"Object",
"instance",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"values",
")",
"{",
"try",
"{",
"BeanUtilsBean",
"beanUtilBean",
"=",
"new",
"BeanUtilsBean",
"(",
")",
";",
"for",
"(",
"String",
"key",
":... | Populate.
@param instance the instance
@param values the values | [
"Populate",
"."
] | 8e0c85818423406f769444c76194a748e0a0fc0a | https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/JKObjectUtil.java#L548-L558 | train | Populates the given instance with values from the Map. | Of course, here is the Java code you requested:
```java
public static void populate(Object instance, Map<String, Object> values) {
try {
BeanUtilsBean beanUtilBean = new BeanUtilsBean();
for (String key : values.keySet()) {
Object value = values.get(key);
beanUtilBean.setProperty(instance, key, va... |
alkacon/opencms-core | src/org/opencms/ui/apps/A_CmsWorkplaceApp.java | A_CmsWorkplaceApp.getParamFromState | public static String getParamFromState(String state, String paramName) {
String prefix = PARAM_SEPARATOR + paramName + PARAM_ASSIGN;
if (state.contains(prefix)) {
String result = state.substring(state.indexOf(prefix) + prefix.length());
if (result.contains(PARAM_SEPARATOR)) {
... | java | public static String getParamFromState(String state, String paramName) {
String prefix = PARAM_SEPARATOR + paramName + PARAM_ASSIGN;
if (state.contains(prefix)) {
String result = state.substring(state.indexOf(prefix) + prefix.length());
if (result.contains(PARAM_SEPARATOR)) {
... | [
"public",
"static",
"String",
"getParamFromState",
"(",
"String",
"state",
",",
"String",
"paramName",
")",
"{",
"String",
"prefix",
"=",
"PARAM_SEPARATOR",
"+",
"paramName",
"+",
"PARAM_ASSIGN",
";",
"if",
"(",
"state",
".",
"contains",
"(",
"prefix",
")",
... | Parses the requested parameter from the given state.<p>
@param state the state
@param paramName the parameter name
@return the parameter value | [
"Parses",
"the",
"requested",
"parameter",
"from",
"the",
"given",
"state",
".",
"<p",
">"
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/apps/A_CmsWorkplaceApp.java#L183-L194 | train | Gets the parameter from the state. | Of course, here is the Java code you requested:
```java
public static String getParamFromState(String state, String paramName) {
String prefix = PARAM_SEPARATOR + paramName + PARAM_ASSIGN;
if (state.contains(prefix)) {
String result = state.substring(state.indexOf(prefix) + prefix.length()... |
threerings/playn | core/src/playn/core/util/TextBlock.java | TextBlock.toImage | public CanvasImage toImage(Align align, int fillColor) {
float pad = pad();
CanvasImage image = graphics().createImage(bounds.width()+2*pad, bounds.height()+2*pad);
image.canvas().setFillColor(fillColor);
fill(image.canvas(), align, pad, pad);
return image;
} | java | public CanvasImage toImage(Align align, int fillColor) {
float pad = pad();
CanvasImage image = graphics().createImage(bounds.width()+2*pad, bounds.height()+2*pad);
image.canvas().setFillColor(fillColor);
fill(image.canvas(), align, pad, pad);
return image;
} | [
"public",
"CanvasImage",
"toImage",
"(",
"Align",
"align",
",",
"int",
"fillColor",
")",
"{",
"float",
"pad",
"=",
"pad",
"(",
")",
";",
"CanvasImage",
"image",
"=",
"graphics",
"(",
")",
".",
"createImage",
"(",
"bounds",
".",
"width",
"(",
")",
"+",
... | Creates a canvas image large enough to accommodate this text block and renders the lines into
it. The image will include padding around the edge to ensure that antialiasing has a bit of
extra space to do its work. | [
"Creates",
"a",
"canvas",
"image",
"large",
"enough",
"to",
"accommodate",
"this",
"text",
"block",
"and",
"renders",
"the",
"lines",
"into",
"it",
".",
"The",
"image",
"will",
"include",
"padding",
"around",
"the",
"edge",
"to",
"ensure",
"that",
"antialias... | c266eeb39188dcada4b00992a0d1199759e03d42 | https://github.com/threerings/playn/blob/c266eeb39188dcada4b00992a0d1199759e03d42/core/src/playn/core/util/TextBlock.java#L148-L154 | train | Create a canvas image with the specified fill color and alignment. | Of course, here is the Java code you requested:
```java
public CanvasImage toImage(Align align, int fillColor) {
float pad = pad();
CanvasImage image = graphics().createImage(bounds.width()+2*pad, bounds.height()+2*pad);
image.canvas().setFillColor(fillColor);
fill(image.canvas(), align, pad, pad);
... |
JRebirth/JRebirth | org.jrebirth.af/showcase/analyzer/src/main/java/org/jrebirth/af/showcase/analyzer/ui/properties/PropertiesModel.java | PropertiesModel.processWave | @Override
@OnWave(EditorWaves.DO_SELECT_EVENT_ACTION)
protected void processWave(final Wave wave) {
if (EditorWaves.DO_SELECT_EVENT == wave.waveType()) {
final JRebirthEvent event = wave.get(PropertiesWaves.EVENT_OBJECT);
view().getNodeName().setText(event.target());
}
... | java | @Override
@OnWave(EditorWaves.DO_SELECT_EVENT_ACTION)
protected void processWave(final Wave wave) {
if (EditorWaves.DO_SELECT_EVENT == wave.waveType()) {
final JRebirthEvent event = wave.get(PropertiesWaves.EVENT_OBJECT);
view().getNodeName().setText(event.target());
}
... | [
"@",
"Override",
"@",
"OnWave",
"(",
"EditorWaves",
".",
"DO_SELECT_EVENT_ACTION",
")",
"protected",
"void",
"processWave",
"(",
"final",
"Wave",
"wave",
")",
"{",
"if",
"(",
"EditorWaves",
".",
"DO_SELECT_EVENT",
"==",
"wave",
".",
"waveType",
"(",
")",
")"... | {@inheritDoc} | [
"{"
] | 93f4fc087b83c73db540333b9686e97b4cec694d | https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/showcase/analyzer/src/main/java/org/jrebirth/af/showcase/analyzer/ui/properties/PropertiesModel.java#L52-L61 | train | Process a CRUD event. | Of course, here is the Java code you requested:
```java
@Override
@OnWave(EditorWaves.DO_SELECT_EVENT_ACTION)
protected void processWave(final Wave wave) {
if (EditorWaves.DO_SELECT_EVENT == wave.waveType()) {
final JRebirthEvent event = wave.get(PropertiesWaves.EVENT_OBJECT);
... |
zaproxy/zaproxy | src/org/apache/commons/httpclient/HttpMethodBase.java | HttpMethodBase.writeRequestLine | protected void writeRequestLine(HttpState state, HttpConnection conn)
throws IOException, HttpException {
LOG.trace(
"enter HttpMethodBase.writeRequestLine(HttpState, HttpConnection)");
String requestLine = getRequestLine(conn);
if (Wire.HEADER_WIRE.enabled()) {
Wire.... | java | protected void writeRequestLine(HttpState state, HttpConnection conn)
throws IOException, HttpException {
LOG.trace(
"enter HttpMethodBase.writeRequestLine(HttpState, HttpConnection)");
String requestLine = getRequestLine(conn);
if (Wire.HEADER_WIRE.enabled()) {
Wire.... | [
"protected",
"void",
"writeRequestLine",
"(",
"HttpState",
"state",
",",
"HttpConnection",
"conn",
")",
"throws",
"IOException",
",",
"HttpException",
"{",
"LOG",
".",
"trace",
"(",
"\"enter HttpMethodBase.writeRequestLine(HttpState, HttpConnection)\"",
")",
";",
"String"... | Writes the request line to the given {@link HttpConnection connection}.
<p>
Subclasses may want to override this method to to customize the
processing.
</p>
@param state the {@link HttpState state} information associated with this method
@param conn the {@link HttpConnection connection} used to execute
this HTTP meth... | [
"Writes",
"the",
"request",
"line",
"to",
"the",
"given",
"{",
"@link",
"HttpConnection",
"connection",
"}",
"."
] | 0cbe5121f2ae1ecca222513d182759210c569bec | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/apache/commons/httpclient/HttpMethodBase.java#L2342-L2351 | train | Write request line. | Of course, here is the Java code you requested:
```java
protected void writeRequestLine(HttpState state, HttpConnection conn)
throws IOException, HttpException {
LOG.trace(
"enter HttpMethodBase.writeRequestLine(HttpState, HttpConnection)");
String requestLine = getRequestLine(conn);
... |
CenturyLinkCloud/clc-java-sdk | sdk/src/main/java/com/centurylink/cloud/sdk/server/services/dsl/domain/group/filters/GroupFilter.java | GroupFilter.and | @Override
public GroupFilter and(GroupFilter otherFilter) {
checkNotNull(otherFilter, "Other filter must be not a null");
evaluation = new AndEvaluation<>(evaluation, otherFilter, GroupMetadata::getId);
return this;
} | java | @Override
public GroupFilter and(GroupFilter otherFilter) {
checkNotNull(otherFilter, "Other filter must be not a null");
evaluation = new AndEvaluation<>(evaluation, otherFilter, GroupMetadata::getId);
return this;
} | [
"@",
"Override",
"public",
"GroupFilter",
"and",
"(",
"GroupFilter",
"otherFilter",
")",
"{",
"checkNotNull",
"(",
"otherFilter",
",",
"\"Other filter must be not a null\"",
")",
";",
"evaluation",
"=",
"new",
"AndEvaluation",
"<>",
"(",
"evaluation",
",",
"otherFil... | {@inheritDoc} | [
"{"
] | c026322f077dea71b1acf9f2d665253d79d9bf85 | https://github.com/CenturyLinkCloud/clc-java-sdk/blob/c026322f077dea71b1acf9f2d665253d79d9bf85/sdk/src/main/java/com/centurylink/cloud/sdk/server/services/dsl/domain/group/filters/GroupFilter.java#L175-L182 | train | Method allow to add filters to the result. | Of course, here is the Java code you requested:
```java
@Override
public GroupFilter and(GroupFilter otherFilter) {
checkNotNull(otherFilter, "Other filter must be not a null");
evaluation = new AndEvaluation<>(evaluation, otherFilter, GroupMetadata::getId);
return this;
}
```
Hope t... |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPSpecificationOptionPersistenceImpl.java | CPSpecificationOptionPersistenceImpl.findByGroupId_First | @Override
public CPSpecificationOption findByGroupId_First(long groupId,
OrderByComparator<CPSpecificationOption> orderByComparator)
throws NoSuchCPSpecificationOptionException {
CPSpecificationOption cpSpecificationOption = fetchByGroupId_First(groupId,
orderByComparator);
if (cpSpecificationOption != nu... | java | @Override
public CPSpecificationOption findByGroupId_First(long groupId,
OrderByComparator<CPSpecificationOption> orderByComparator)
throws NoSuchCPSpecificationOptionException {
CPSpecificationOption cpSpecificationOption = fetchByGroupId_First(groupId,
orderByComparator);
if (cpSpecificationOption != nu... | [
"@",
"Override",
"public",
"CPSpecificationOption",
"findByGroupId_First",
"(",
"long",
"groupId",
",",
"OrderByComparator",
"<",
"CPSpecificationOption",
">",
"orderByComparator",
")",
"throws",
"NoSuchCPSpecificationOptionException",
"{",
"CPSpecificationOption",
"cpSpecifica... | Returns the first cp specification option in the ordered set where groupId = ?.
@param groupId the group ID
@param orderByComparator the comparator to order the set by (optionally <code>null</code>)
@return the first matching cp specification option
@throws NoSuchCPSpecificationOptionException if a matching cp spe... | [
"Returns",
"the",
"first",
"cp",
"specification",
"option",
"in",
"the",
"ordered",
"set",
"where",
"groupId",
"=",
"?",
";",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPSpecificationOptionPersistenceImpl.java#L1691-L1712 | train | Returns the cp specification option in the ordered set where groupId = ? ; and orderByComparator = null. | Of course, here is the Java code you requested:
```java
@Override
public CPSpecificationOption findByGroupId_First(long groupId,
OrderByComparator<CPSpecificationOption> orderByComparator)
throws NoSuchCPSpecificationOptionException {
CPSpecificationOption cpSpecificationOption = fetchByGroupId_First(groupId,
... |
aws/aws-sdk-java | aws-java-sdk-iot/src/main/java/com/amazonaws/services/iot/model/GetEffectivePoliciesResult.java | GetEffectivePoliciesResult.setEffectivePolicies | public void setEffectivePolicies(java.util.Collection<EffectivePolicy> effectivePolicies) {
if (effectivePolicies == null) {
this.effectivePolicies = null;
return;
}
this.effectivePolicies = new java.util.ArrayList<EffectivePolicy>(effectivePolicies);
} | java | public void setEffectivePolicies(java.util.Collection<EffectivePolicy> effectivePolicies) {
if (effectivePolicies == null) {
this.effectivePolicies = null;
return;
}
this.effectivePolicies = new java.util.ArrayList<EffectivePolicy>(effectivePolicies);
} | [
"public",
"void",
"setEffectivePolicies",
"(",
"java",
".",
"util",
".",
"Collection",
"<",
"EffectivePolicy",
">",
"effectivePolicies",
")",
"{",
"if",
"(",
"effectivePolicies",
"==",
"null",
")",
"{",
"this",
".",
"effectivePolicies",
"=",
"null",
";",
"retu... | <p>
The effective policies.
</p>
@param effectivePolicies
The effective policies. | [
"<p",
">",
"The",
"effective",
"policies",
".",
"<",
"/",
"p",
">"
] | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-iot/src/main/java/com/amazonaws/services/iot/model/GetEffectivePoliciesResult.java#L49-L56 | train | Sets the value of the effectivePolicies property. | Of course, here is the Java code you requested:
```java
public void setEffectivePolicies(java.util.Collection<EffectivePolicy> effectivePolicies) {
if (effectivePolicies == null) {
this.effectivePolicies = null;
return;
}
this.effectivePolicies = new java.util.ArrayList... |
twitter/hraven | hraven-core/src/main/java/com/twitter/hraven/ScaldingJobDescFactory.java | ScaldingJobDescFactory.stripAppId | String stripAppId(String origId) {
if (origId == null || origId.isEmpty()) {
return "";
}
Matcher m = stripBracketsPattern.matcher(origId);
String cleanedAppId = m.replaceAll("");
Matcher tailMatcher = stripSequencePattern.matcher(cleanedAppId);
if (tailMatcher.matches()) {
cleanedAp... | java | String stripAppId(String origId) {
if (origId == null || origId.isEmpty()) {
return "";
}
Matcher m = stripBracketsPattern.matcher(origId);
String cleanedAppId = m.replaceAll("");
Matcher tailMatcher = stripSequencePattern.matcher(cleanedAppId);
if (tailMatcher.matches()) {
cleanedAp... | [
"String",
"stripAppId",
"(",
"String",
"origId",
")",
"{",
"if",
"(",
"origId",
"==",
"null",
"||",
"origId",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"\"\"",
";",
"}",
"Matcher",
"m",
"=",
"stripBracketsPattern",
".",
"matcher",
"(",
"origId",
")... | Strips out metadata in brackets to get a clean app name. There are multiple job name formats
used by various frameworks. This method attempts to normalize these job names into a somewhat
human readable appId format. | [
"Strips",
"out",
"metadata",
"in",
"brackets",
"to",
"get",
"a",
"clean",
"app",
"name",
".",
"There",
"are",
"multiple",
"job",
"name",
"formats",
"used",
"by",
"various",
"frameworks",
".",
"This",
"method",
"attempts",
"to",
"normalize",
"these",
"job",
... | e35996b6e2f016bcd18db0bad320be7c93d95208 | https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-core/src/main/java/com/twitter/hraven/ScaldingJobDescFactory.java#L69-L80 | train | Strip the brackets and sequence from the given application ID. | Of course, here is the Java code you requested:
```java
String stripAppId(String origId) {
if (origId == null || origId.isEmpty()) {
return "";
}
Matcher m = stripBracketsPattern.matcher(origId);
String cleanedAppId = m.replaceAll("");
Matcher tailMatcher = stripSequencePattern.matcher(cleane... |
phax/ph-datetime | ph-holiday/src/main/java/com/helger/holiday/parser/AbstractHolidayParser.java | AbstractHolidayParser.isValid | protected static final boolean isValid (final Holiday aHoliday, final int nYear)
{
return _isValidInYear (aHoliday, nYear) && _isValidForCycle (aHoliday, nYear);
} | java | protected static final boolean isValid (final Holiday aHoliday, final int nYear)
{
return _isValidInYear (aHoliday, nYear) && _isValidForCycle (aHoliday, nYear);
} | [
"protected",
"static",
"final",
"boolean",
"isValid",
"(",
"final",
"Holiday",
"aHoliday",
",",
"final",
"int",
"nYear",
")",
"{",
"return",
"_isValidInYear",
"(",
"aHoliday",
",",
"nYear",
")",
"&&",
"_isValidForCycle",
"(",
"aHoliday",
",",
"nYear",
")",
"... | Evaluates if the provided <code>Holiday</code> instance is valid for the
provided year.
@param aHoliday
The holiday configuration entry to validate
@param nYear
The year to validate against.
@return is valid for the year. | [
"Evaluates",
"if",
"the",
"provided",
"<code",
">",
"Holiday<",
"/",
"code",
">",
"instance",
"is",
"valid",
"for",
"the",
"provided",
"year",
"."
] | cfaff01cb76d9affb934800ff55734b5a7d8983e | https://github.com/phax/ph-datetime/blob/cfaff01cb76d9affb934800ff55734b5a7d8983e/ph-holiday/src/main/java/com/helger/holiday/parser/AbstractHolidayParser.java#L53-L56 | train | Check if the given holidays is valid for the given year. | Of course, here is the Java code you requested:
```java
protected static final boolean isValid (final Holiday aHoliday, final int nYear)
{
return _isValidInYear (aHoliday, nYear) && _isValidForCycle (aHoliday, nYear);
}
```
Hope this helps! |
liferay/com-liferay-commerce | commerce-discount-service/src/main/java/com/liferay/commerce/discount/service/persistence/impl/CommerceDiscountRulePersistenceImpl.java | CommerceDiscountRulePersistenceImpl.clearCache | @Override
public void clearCache(CommerceDiscountRule commerceDiscountRule) {
entityCache.removeResult(CommerceDiscountRuleModelImpl.ENTITY_CACHE_ENABLED,
CommerceDiscountRuleImpl.class, commerceDiscountRule.getPrimaryKey());
finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
finderCache.clearCa... | java | @Override
public void clearCache(CommerceDiscountRule commerceDiscountRule) {
entityCache.removeResult(CommerceDiscountRuleModelImpl.ENTITY_CACHE_ENABLED,
CommerceDiscountRuleImpl.class, commerceDiscountRule.getPrimaryKey());
finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
finderCache.clearCa... | [
"@",
"Override",
"public",
"void",
"clearCache",
"(",
"CommerceDiscountRule",
"commerceDiscountRule",
")",
"{",
"entityCache",
".",
"removeResult",
"(",
"CommerceDiscountRuleModelImpl",
".",
"ENTITY_CACHE_ENABLED",
",",
"CommerceDiscountRuleImpl",
".",
"class",
",",
"comm... | Clears the cache for the commerce discount rule.
<p>
The {@link EntityCache} and {@link FinderCache} are both cleared by this method.
</p> | [
"Clears",
"the",
"cache",
"for",
"the",
"commerce",
"discount",
"rule",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-discount-service/src/main/java/com/liferay/commerce/discount/service/persistence/impl/CommerceDiscountRulePersistenceImpl.java#L702-L709 | train | Clears the cache for the commerce discount rule. | Of course, here is the Java code you requested:
```java
@Override
public void clearCache(CommerceDiscountRule commerceDiscountRule) {
entityCache.removeResult(CommerceDiscountRuleModelImpl.ENTITY_CACHE_ENABLED,
CommerceDiscountRuleImpl.class, commerceDiscountRule.getPrimaryKey());
finderCache.clearCache(FINDE... |
cdk/cdk | legacy/src/main/java/org/openscience/cdk/smiles/FixBondOrdersTool.java | FixBondOrdersTool.getAtomNosForRingGroup | private List<Integer> getAtomNosForRingGroup(IAtomContainer molecule, List<Integer> ringGroup, IRingSet ringSet) {
List<Integer> atc = new ArrayList<Integer>();
for (Integer i : ringGroup) {
for (IAtom atom : ringSet.getAtomContainer(i).atoms()) {
if (atc.size() > 0) {
... | java | private List<Integer> getAtomNosForRingGroup(IAtomContainer molecule, List<Integer> ringGroup, IRingSet ringSet) {
List<Integer> atc = new ArrayList<Integer>();
for (Integer i : ringGroup) {
for (IAtom atom : ringSet.getAtomContainer(i).atoms()) {
if (atc.size() > 0) {
... | [
"private",
"List",
"<",
"Integer",
">",
"getAtomNosForRingGroup",
"(",
"IAtomContainer",
"molecule",
",",
"List",
"<",
"Integer",
">",
"ringGroup",
",",
"IRingSet",
"ringSet",
")",
"{",
"List",
"<",
"Integer",
">",
"atc",
"=",
"new",
"ArrayList",
"<",
"Integ... | Gets the List of atom nos corresponding to a particular set of fused rings.
@param {@link IAtomContainer} molecule
@param ringGroup
@param {@link IRingSet} ringSet
@return List of atom numbers for each set | [
"Gets",
"the",
"List",
"of",
"atom",
"nos",
"corresponding",
"to",
"a",
"particular",
"set",
"of",
"fused",
"rings",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/legacy/src/main/java/org/openscience/cdk/smiles/FixBondOrdersTool.java#L378-L392 | train | Get the atomNos for a ringGroup. | Of course, here is the Java code you requested:
```java
private List<Integer> getAtomNosForRingGroup(IAtomContainer molecule, List<Integer> ringGroup, IRingSet ringSet) {
List<Integer> atc = new ArrayList<Integer>();
for (Integer i : ringGroup) {
for (IAtom atom : ringSet.getAtomContainer(i... |
azkaban/azkaban | az-hadoop-jobtype-plugin/src/main/java/azkaban/jobtype/HadoopJobUtils.java | HadoopJobUtils.killAllSpawnedHadoopJobs | public static Set<String> killAllSpawnedHadoopJobs(String logFilePath, Logger log) {
Set<String> allSpawnedJobs = findApplicationIdFromLog(logFilePath, log);
log.info("applicationIds to kill: " + allSpawnedJobs);
for (String appId : allSpawnedJobs) {
try {
killJobOnCluster(appId, log);
... | java | public static Set<String> killAllSpawnedHadoopJobs(String logFilePath, Logger log) {
Set<String> allSpawnedJobs = findApplicationIdFromLog(logFilePath, log);
log.info("applicationIds to kill: " + allSpawnedJobs);
for (String appId : allSpawnedJobs) {
try {
killJobOnCluster(appId, log);
... | [
"public",
"static",
"Set",
"<",
"String",
">",
"killAllSpawnedHadoopJobs",
"(",
"String",
"logFilePath",
",",
"Logger",
"log",
")",
"{",
"Set",
"<",
"String",
">",
"allSpawnedJobs",
"=",
"findApplicationIdFromLog",
"(",
"logFilePath",
",",
"log",
")",
";",
"lo... | Pass in a log file, this method will find all the hadoop jobs it has launched, and kills it
Only works with Hadoop2
@return a Set<String>. The set will contain the applicationIds that this job tried to kill. | [
"Pass",
"in",
"a",
"log",
"file",
"this",
"method",
"will",
"find",
"all",
"the",
"hadoop",
"jobs",
"it",
"has",
"launched",
"and",
"kills",
"it"
] | d258ea7d6e66807c6eff79c5325d6d3443618dff | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-hadoop-jobtype-plugin/src/main/java/azkaban/jobtype/HadoopJobUtils.java#L409-L422 | train | Kill all hadoop jobs in the cluster. | Of course, here is the Java code you requested:
```java
public static Set<String> killAllSpawnedHadoopJobs(String logFilePath, Logger log) {
Set<String> allSpawnedJobs = findApplicationIdFromLog(logFilePath, log);
log.info("applicationIds to kill: " + allSpawnedJobs);
for (String appId : allSpawnedJobs) {... |
tango-controls/JTango | common/src/main/java/fr/esrf/TangoApi/events/TangoDataReady.java | TangoDataReady.removeTangoDataReadyListener | public void removeTangoDataReadyListener(ITangoDataReadyListener listener)
throws DevFailed {
event_listeners.remove(ITangoDataReadyListener.class, listener);
if (event_listeners.size() == 0)
unsubscribe_event(event_identifier);
} | java | public void removeTangoDataReadyListener(ITangoDataReadyListener listener)
throws DevFailed {
event_listeners.remove(ITangoDataReadyListener.class, listener);
if (event_listeners.size() == 0)
unsubscribe_event(event_identifier);
} | [
"public",
"void",
"removeTangoDataReadyListener",
"(",
"ITangoDataReadyListener",
"listener",
")",
"throws",
"DevFailed",
"{",
"event_listeners",
".",
"remove",
"(",
"ITangoDataReadyListener",
".",
"class",
",",
"listener",
")",
";",
"if",
"(",
"event_listeners",
".",... | ============================================================== | [
"=============================================================="
] | 1ccc9dcb83e6de2359a9f1906d170571cacf1345 | https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/common/src/main/java/fr/esrf/TangoApi/events/TangoDataReady.java#L76-L82 | train | Remove a TangoDataReadyListener. | Of course, here is the Java code you requested:
```java
public void removeTangoDataReadyListener(ITangoDataReadyListener listener)
throws DevFailed {
event_listeners.remove(ITangoDataReadyListener.class, listener);
if (event_listeners.size() == 0)
unsubscribe_event(event_identif... |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/Base64Util.java | Base64Util.decode | public static byte[] decode(final char[] input) {
int iLen = input.length;
if (iLen % 4 != 0) {
throw new IllegalArgumentException(
"Length of Base64 encoded input string is not a multiple of 4.");
}
while (iLen > 0 && input[iLen - 1] == '=') {
iLen--;
}
int oLen = (iLen * 3) / 4;
byte[] out... | java | public static byte[] decode(final char[] input) {
int iLen = input.length;
if (iLen % 4 != 0) {
throw new IllegalArgumentException(
"Length of Base64 encoded input string is not a multiple of 4.");
}
while (iLen > 0 && input[iLen - 1] == '=') {
iLen--;
}
int oLen = (iLen * 3) / 4;
byte[] out... | [
"public",
"static",
"byte",
"[",
"]",
"decode",
"(",
"final",
"char",
"[",
"]",
"input",
")",
"{",
"int",
"iLen",
"=",
"input",
".",
"length",
";",
"if",
"(",
"iLen",
"%",
"4",
"!=",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"... | Decodes a byte array from Base64 format. No blanks or line breaks are allowed within the Base64 encoded data.
@param input a character array containing the Base64 encoded data.
@return An array containing the decoded data bytes.
@throws IllegalArgumentException if the input is not valid Base64 encoded data. | [
"Decodes",
"a",
"byte",
"array",
"from",
"Base64",
"format",
".",
"No",
"blanks",
"or",
"line",
"breaks",
"are",
"allowed",
"within",
"the",
"Base64",
"encoded",
"data",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/Base64Util.java#L192-L243 | train | Decodes the given Base64 encoded string. | Of course, here is the Java code you requested:
```java
public static byte[] decode(final char[] input) {
int iLen = input.length;
if (iLen % 4 != 0) {
throw new IllegalArgumentException(
"Length of Base64 encoded input string is not a multiple of 4.");
}
while (iLen > 0 && input[iLen - 1] == '=') {
... |
alkacon/opencms-core | src/org/opencms/configuration/CmsVfsConfiguration.java | CmsVfsConfiguration.generateResourceTypeXml | public static void generateResourceTypeXml(
Element startNode,
List<I_CmsResourceType> resourceTypes,
boolean module) {
for (int i = 0; i < resourceTypes.size(); i++) {
I_CmsResourceType resType = resourceTypes.get(i);
// only add this resource type to the xml ou... | java | public static void generateResourceTypeXml(
Element startNode,
List<I_CmsResourceType> resourceTypes,
boolean module) {
for (int i = 0; i < resourceTypes.size(); i++) {
I_CmsResourceType resType = resourceTypes.get(i);
// only add this resource type to the xml ou... | [
"public",
"static",
"void",
"generateResourceTypeXml",
"(",
"Element",
"startNode",
",",
"List",
"<",
"I_CmsResourceType",
">",
"resourceTypes",
",",
"boolean",
"module",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"resourceTypes",
".",
"size"... | Creates the xml output for resourcetype nodes.<p>
@param startNode the startnode to add all rescource types to
@param resourceTypes the list of resource types
@param module flag, signaling to add them module resource types or not | [
"Creates",
"the",
"xml",
"output",
"for",
"resourcetype",
"nodes",
".",
"<p",
">"
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/configuration/CmsVfsConfiguration.java#L316-L392 | train | Generates the XML for the resource type list. | Of course, here is the Java code you requested:
```java
public static void generateResourceTypeXml(
Element startNode,
List<I_CmsResourceType> resourceTypes,
boolean module) {
for (int i = 0; i < resourceTypes.size(); i++) {
I_CmsResourceType resType = resourceTypes.get(i);... |
Jasig/uPortal | uPortal-security/uPortal-security-core/src/main/java/org/apereo/portal/security/provider/RDBMPermissionImpl.java | RDBMPermissionImpl.primUpdate | private void primUpdate(IPermission[] perms) throws Exception {
Connection conn = null;
try {
conn = RDBMServices.getConnection();
String sQuery = getUpdatePermissionSql();
PreparedStatement ps = conn.prepareStatement(sQuery);
try {
RDBMSe... | java | private void primUpdate(IPermission[] perms) throws Exception {
Connection conn = null;
try {
conn = RDBMServices.getConnection();
String sQuery = getUpdatePermissionSql();
PreparedStatement ps = conn.prepareStatement(sQuery);
try {
RDBMSe... | [
"private",
"void",
"primUpdate",
"(",
"IPermission",
"[",
"]",
"perms",
")",
"throws",
"Exception",
"{",
"Connection",
"conn",
"=",
"null",
";",
"try",
"{",
"conn",
"=",
"RDBMServices",
".",
"getConnection",
"(",
")",
";",
"String",
"sQuery",
"=",
"getUpda... | Update the IPermissions in the store.
@param perms org.apereo.portal.security.IPermission[]
@exception Exception | [
"Update",
"the",
"IPermissions",
"in",
"the",
"store",
"."
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-security/uPortal-security-core/src/main/java/org/apereo/portal/security/provider/RDBMPermissionImpl.java#L515-L545 | train | Update the permissions in the database. | Of course, here is the Java code you requested:
```java
private void primUpdate(IPermission[] perms) throws Exception {
Connection conn = null;
try {
conn = RDBMServices.getConnection();
String sQuery = getUpdatePermissionSql();
PreparedStatement ps = conn.prepareSt... |
pushtorefresh/storio | storio-common/src/main/java/com/pushtorefresh/storio3/internal/InternalQueries.java | InternalQueries.unmodifiableNonNullList | @SuppressWarnings("unchecked")
@NonNull
public static <T> List<T> unmodifiableNonNullList(@Nullable List<T> list) {
return list == null || list.isEmpty()
? (List<T>) emptyList()
: unmodifiableList(list);
} | java | @SuppressWarnings("unchecked")
@NonNull
public static <T> List<T> unmodifiableNonNullList(@Nullable List<T> list) {
return list == null || list.isEmpty()
? (List<T>) emptyList()
: unmodifiableList(list);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"@",
"NonNull",
"public",
"static",
"<",
"T",
">",
"List",
"<",
"T",
">",
"unmodifiableNonNullList",
"(",
"@",
"Nullable",
"List",
"<",
"T",
">",
"list",
")",
"{",
"return",
"list",
"==",
"null",
"||",
... | Converts list of something to unmodifiable non-null list.
@param list list to convert, can be {@code null}.
@return non-null, unmodifiable list of something. | [
"Converts",
"list",
"of",
"something",
"to",
"unmodifiable",
"non",
"-",
"null",
"list",
"."
] | 58f53d81bcc7b069c8bb271c46a90e37775abe8d | https://github.com/pushtorefresh/storio/blob/58f53d81bcc7b069c8bb271c46a90e37775abe8d/storio-common/src/main/java/com/pushtorefresh/storio3/internal/InternalQueries.java#L92-L98 | train | Returns an unmodifiable list of a list of tokens. | Of course, here is the Java code you requested:
```java
@SuppressWarnings("unchecked")
@NonNull
public static <T> List<T> unmodifiableNonNullList(@Nullable List<T> list) {
return list == null || list.isEmpty()
? (List<T>) emptyList()
: unmodifiableList(list);
}
```
... |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/lang/UCharacter.java | UCharacter.offsetByCodePoints | public static int offsetByCodePoints(char[] text, int start, int count, int index,
int codePointOffset) {
int limit = start + count;
if (start < 0 || limit < start || limit > text.length || index < start || index > limit) {
throw new IndexOutOfBoundsException("index ( " + index +... | java | public static int offsetByCodePoints(char[] text, int start, int count, int index,
int codePointOffset) {
int limit = start + count;
if (start < 0 || limit < start || limit > text.length || index < start || index > limit) {
throw new IndexOutOfBoundsException("index ( " + index +... | [
"public",
"static",
"int",
"offsetByCodePoints",
"(",
"char",
"[",
"]",
"text",
",",
"int",
"start",
",",
"int",
"count",
",",
"int",
"index",
",",
"int",
"codePointOffset",
")",
"{",
"int",
"limit",
"=",
"start",
"+",
"count",
";",
"if",
"(",
"start",... | Equivalent to the
{@link Character#offsetByCodePoints(char[], int, int, int, int)}
method, for convenience. Adjusts the char index by a code point offset.
@param text the characters to check
@param start the start of the range to check
@param count the length of the range to check
@param index the index to adjust
@par... | [
"Equivalent",
"to",
"the",
"{"
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/lang/UCharacter.java#L5615-L5662 | train | Method offsetByCodePoints. | Of course, here is the Java code you requested:
```java
public static int offsetByCodePoints(char[] text, int start, int count, int index,
int codePointOffset) {
int limit = start + count;
if (start < 0 || limit < start || limit > text.length || index < start || index > limit) {
... |
ginere/ginere-base | src/main/java/eu/ginere/base/util/image/ImageSize.java | ImageSize.getResizedWidth | public static int getResizedWidth(String fileName,String mimeType,InputStream input,int maxWidth, int maxHeight) throws ImageSizeException, FormatNotSuported, FileNotFoundException, DaoManagerException {
Dimension d = getDimensions(fileName,mimeType,input);
return getResizedWidth(d, maxWidth, maxHeight);
... | java | public static int getResizedWidth(String fileName,String mimeType,InputStream input,int maxWidth, int maxHeight) throws ImageSizeException, FormatNotSuported, FileNotFoundException, DaoManagerException {
Dimension d = getDimensions(fileName,mimeType,input);
return getResizedWidth(d, maxWidth, maxHeight);
... | [
"public",
"static",
"int",
"getResizedWidth",
"(",
"String",
"fileName",
",",
"String",
"mimeType",
",",
"InputStream",
"input",
",",
"int",
"maxWidth",
",",
"int",
"maxHeight",
")",
"throws",
"ImageSizeException",
",",
"FormatNotSuported",
",",
"FileNotFoundExcepti... | } | [
"}"
] | b1cc1c5834bd8a31df475c6f3fc0ee51273c5a24 | https://github.com/ginere/ginere-base/blob/b1cc1c5834bd8a31df475c6f3fc0ee51273c5a24/src/main/java/eu/ginere/base/util/image/ImageSize.java#L117-L120 | train | Get the original width of an image from the input stream. | Of course, here is the Java code you requested:
```java
public static int getResizedWidth(String fileName,String mimeType,InputStream input,int maxWidth, int maxHeight) throws ImageSizeException, FormatNotSuported, FileNotFoundException, DaoManagerException {
Dimension d = getDimensions(fileName,mimeType,input)... |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.authentication.builtin/src/com/ibm/wsspi/security/common/auth/module/IdentityAssertionLoginModule.java | IdentityAssertionLoginModule.updateSubjectWithTemporarySubjectContents | protected void updateSubjectWithTemporarySubjectContents() {
subject.getPrincipals().addAll(temporarySubject.getPrincipals());
subject.getPublicCredentials().addAll(temporarySubject.getPublicCredentials());
subject.getPrivateCredentials().addAll(temporarySubject.getPrivateCredentials());
} | java | protected void updateSubjectWithTemporarySubjectContents() {
subject.getPrincipals().addAll(temporarySubject.getPrincipals());
subject.getPublicCredentials().addAll(temporarySubject.getPublicCredentials());
subject.getPrivateCredentials().addAll(temporarySubject.getPrivateCredentials());
} | [
"protected",
"void",
"updateSubjectWithTemporarySubjectContents",
"(",
")",
"{",
"subject",
".",
"getPrincipals",
"(",
")",
".",
"addAll",
"(",
"temporarySubject",
".",
"getPrincipals",
"(",
")",
")",
";",
"subject",
".",
"getPublicCredentials",
"(",
")",
".",
"... | Sets the subject with the temporary subject contents that was not set already from the
shared state. | [
"Sets",
"the",
"subject",
"with",
"the",
"temporary",
"subject",
"contents",
"that",
"was",
"not",
"set",
"already",
"from",
"the",
"shared",
"state",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.authentication.builtin/src/com/ibm/wsspi/security/common/auth/module/IdentityAssertionLoginModule.java#L261-L265 | train | Update the subject with the temporary subject contents. | Of course, here is the Java code you requested:
```java
protected void updateSubjectWithTemporarySubjectContents() {
subject.getPrincipals().addAll(temporarySubject.getPrincipals());
subject.getPublicCredentials().addAll(temporarySubject.getPublicCredentials());
subject.getPrivateCredentials().... |
VoltDB/voltdb | src/frontend/org/voltdb/planner/MVQueryRewriter.java | MVQueryRewriter.gbyTablesEqual | private boolean gbyTablesEqual(MaterializedViewInfo mv) {
if (m_selectStmt.hasComplexGroupby() != mv.getGroupbyexpressionsjson().isEmpty()) {
if (m_selectStmt.hasComplexGroupby()) { // when both have complex GBY expressions, anonymize table/column of SEL stmt and compare the two expressions.
... | java | private boolean gbyTablesEqual(MaterializedViewInfo mv) {
if (m_selectStmt.hasComplexGroupby() != mv.getGroupbyexpressionsjson().isEmpty()) {
if (m_selectStmt.hasComplexGroupby()) { // when both have complex GBY expressions, anonymize table/column of SEL stmt and compare the two expressions.
... | [
"private",
"boolean",
"gbyTablesEqual",
"(",
"MaterializedViewInfo",
"mv",
")",
"{",
"if",
"(",
"m_selectStmt",
".",
"hasComplexGroupby",
"(",
")",
"!=",
"mv",
".",
"getGroupbyexpressionsjson",
"(",
")",
".",
"isEmpty",
"(",
")",
")",
"{",
"if",
"(",
"m_sele... | Checks if the group-by column/expression of given candidate MV matches with that of SELECT stmt.
To do this, we first check if both or neither of the stmt and MV contains complex group-by expressions (e.g.
"group by a + b" or "group by abs(a)"):
1. When both contain complex group-by expressions, extract the group-by ex... | [
"Checks",
"if",
"the",
"group",
"-",
"by",
"column",
"/",
"expression",
"of",
"given",
"candidate",
"MV",
"matches",
"with",
"that",
"of",
"SELECT",
"stmt",
".",
"To",
"do",
"this",
"we",
"first",
"check",
"if",
"both",
"or",
"neither",
"of",
"the",
"s... | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/planner/MVQueryRewriter.java#L181-L200 | train | Checks if the GBY tables are equal. | Of course, here is the Java code you requested:
```java
private boolean gbyTablesEqual(MaterializedViewInfo mv) {
if (m_selectStmt.hasComplexGroupby() != mv.getGroupbyexpressionsjson().isEmpty()) {
if (m_selectStmt.hasComplexGroupby()) { // when both have complex GBY expressions, anonymize tabl... |
jeremylong/DependencyCheck | maven/src/main/java/org/owasp/dependencycheck/maven/BaseDependencyCheckMojo.java | BaseDependencyCheckMojo.collectMavenDependencies | private ExceptionCollection collectMavenDependencies(Engine engine, MavenProject project,
List<DependencyNode> nodes, ProjectBuildingRequest buildingRequest, boolean aggregate) {
ExceptionCollection exCol = collectDependencyManagementDependencies(buildingRequest, project, nodes, aggregate);
... | java | private ExceptionCollection collectMavenDependencies(Engine engine, MavenProject project,
List<DependencyNode> nodes, ProjectBuildingRequest buildingRequest, boolean aggregate) {
ExceptionCollection exCol = collectDependencyManagementDependencies(buildingRequest, project, nodes, aggregate);
... | [
"private",
"ExceptionCollection",
"collectMavenDependencies",
"(",
"Engine",
"engine",
",",
"MavenProject",
"project",
",",
"List",
"<",
"DependencyNode",
">",
"nodes",
",",
"ProjectBuildingRequest",
"buildingRequest",
",",
"boolean",
"aggregate",
")",
"{",
"ExceptionCo... | Resolves the projects artifacts using Aether and scans the resulting
dependencies.
@param engine the core dependency-check engine
@param project the project being scanned
@param nodes the list of dependency nodes, generally obtained via the
DependencyGraphBuilder
@param buildingRequest the Maven project building reque... | [
"Resolves",
"the",
"projects",
"artifacts",
"using",
"Aether",
"and",
"scans",
"the",
"resulting",
"dependencies",
"."
] | 6cc7690ea12e4ca1454210ceaa2e9a5523f0926c | https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/maven/src/main/java/org/owasp/dependencycheck/maven/BaseDependencyCheckMojo.java#L949-L1076 | train | Collect Maven dependencies. | Of course, here is the Java code you requested:
```java
private ExceptionCollection collectMavenDependencies(Engine engine, MavenProject project,
List<DependencyNode> nodes, ProjectBuildingRequest buildingRequest, boolean aggregate) {
ExceptionCollection exCol = collectDependencyManagementDependen... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.