method stringlengths 13 441k | clean_method stringlengths 7 313k | doc stringlengths 17 17.3k | comment stringlengths 3 1.42k | method_name stringlengths 1 273 | extra dict | imports list | imports_info stringlengths 19 34.8k | cluster_imports_info stringlengths 15 3.66k | libraries list | libraries_info stringlengths 6 661 | id int64 0 2.92M |
|---|---|---|---|---|---|---|---|---|---|---|---|
private ArrayList<Integer> getIntermediatePathRowIndex(final Integer source,
final Integer target) {
final Map<Integer, EdgePropertiesImpl> ri = VersantGraph.this.getRowIndex(source);
final ArrayList<Integer> path = new ArrayList<Integer>();
//TODO
final Integer predecessor = ri.get(target).getPredecessor();
if (ri.get(target).getPredecessor() > 0) {
path.addAll(this.getIntermediatePathRowIndex(source, predecessor));
path.add(predecessor);
path.addAll(this.getIntermediatePathRowIndex(predecessor, target));
}
return path;
} | ArrayList<Integer> function(final Integer source, final Integer target) { final Map<Integer, EdgePropertiesImpl> ri = VersantGraph.this.getRowIndex(source); final ArrayList<Integer> path = new ArrayList<Integer>(); final Integer predecessor = ri.get(target).getPredecessor(); if (ri.get(target).getPredecessor() > 0) { path.addAll(this.getIntermediatePathRowIndex(source, predecessor)); path.add(predecessor); path.addAll(this.getIntermediatePathRowIndex(predecessor, target)); } return path; } | /**
* Returns incomplete shortest path between 2 nodes using this graph's
* predecessor matrix.
*
* @param source
* source node.
* @param target
* target node.
* @return list of nodes in the path.
*/ | Returns incomplete shortest path between 2 nodes using this graph's predecessor matrix | getIntermediatePathRowIndex | {
"repo_name": "NickCharsley/zoodb",
"path": "tst/org/zoodb/test/jdo/sna/VersantGraph.java",
"license": "gpl-3.0",
"size": 20095
} | [
"java.util.ArrayList",
"java.util.Map"
] | import java.util.ArrayList; import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 1,908,336 |
@Override
public String getUnlocalizedName(ItemStack stack)
{
ItemFish.FishType itemfish$fishtype = ItemFish.FishType.byItemStack(stack);
return this.getUnlocalizedName() + "." + itemfish$fishtype.getUnlocalizedName();
} | String function(ItemStack stack) { ItemFish.FishType itemfish$fishtype = ItemFish.FishType.byItemStack(stack); return this.getUnlocalizedName() + "." + itemfish$fishtype.getUnlocalizedName(); } | /**
* Returns the unlocalized name of this item. This version accepts an ItemStack so different stacks can have
* different names based on their damage or NBT.
*/ | Returns the unlocalized name of this item. This version accepts an ItemStack so different stacks can have different names based on their damage or NBT | getUnlocalizedName | {
"repo_name": "epolixa/Bityard",
"path": "src/main/java/com/epolixa/bityard/item/ItemFish.java",
"license": "lgpl-2.1",
"size": 6586
} | [
"net.minecraft.item.ItemStack"
] | import net.minecraft.item.ItemStack; | import net.minecraft.item.*; | [
"net.minecraft.item"
] | net.minecraft.item; | 1,832,089 |
public void setAttributes(Collection<NodeAttribute> attributes) {
this.attributes = CollectionUtils.copyOf(attributes);
} | void function(Collection<NodeAttribute> attributes) { this.attributes = CollectionUtils.copyOf(attributes); } | /**
* Set the attributes of the node.
*
* @param attributes A List containing all the attributes.
*/ | Set the attributes of the node | setAttributes | {
"repo_name": "wichtounet/jtheque-xml-utils",
"path": "src/main/java/org/jtheque/xml/utils/Node.java",
"license": "apache-2.0",
"size": 7442
} | [
"java.util.Collection",
"org.jtheque.utils.collections.CollectionUtils"
] | import java.util.Collection; import org.jtheque.utils.collections.CollectionUtils; | import java.util.*; import org.jtheque.utils.collections.*; | [
"java.util",
"org.jtheque.utils"
] | java.util; org.jtheque.utils; | 1,857,978 |
public char getTranscribedBase(String chr, int pos) throws IOException {
return getTranscribedBase(chr, pos, null);
}
| char function(String chr, int pos) throws IOException { return getTranscribedBase(chr, pos, null); } | /**
* Get the oriented transcribed base at the position based on orientation of overlapping exon
* @param chr Chromosome
* @param pos Position
* @return The transcribed base
* @throws IOException
*/ | Get the oriented transcribed base at the position based on orientation of overlapping exon | getTranscribedBase | {
"repo_name": "mgarber/scriptureV2",
"path": "src/java/broad/core/sequence/TranscribedRegions.java",
"license": "lgpl-3.0",
"size": 12654
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 1,363,200 |
private void insertNameVariants(long rawContactId, long dataId, int fromIndex, int toIndex,
boolean initiallyExact, boolean buildCollationKey) {
if (fromIndex == toIndex) {
insertNameVariant(rawContactId, dataId, toIndex,
initiallyExact ? NameLookupType.NAME_EXACT : NameLookupType.NAME_VARIANT,
buildCollationKey);
return;
}
// Swap the first token with each other token (including itself, which is a no-op)
// and recursively insert all permutations for the remaining tokens
String firstToken = mNames[fromIndex];
for (int i = fromIndex; i < toIndex; i++) {
mNames[fromIndex] = mNames[i];
mNames[i] = firstToken;
insertNameVariants(rawContactId, dataId, fromIndex + 1, toIndex,
initiallyExact && i == fromIndex, buildCollationKey);
mNames[i] = mNames[fromIndex];
mNames[fromIndex] = firstToken;
}
} | void function(long rawContactId, long dataId, int fromIndex, int toIndex, boolean initiallyExact, boolean buildCollationKey) { if (fromIndex == toIndex) { insertNameVariant(rawContactId, dataId, toIndex, initiallyExact ? NameLookupType.NAME_EXACT : NameLookupType.NAME_VARIANT, buildCollationKey); return; } String firstToken = mNames[fromIndex]; for (int i = fromIndex; i < toIndex; i++) { mNames[fromIndex] = mNames[i]; mNames[i] = firstToken; insertNameVariants(rawContactId, dataId, fromIndex + 1, toIndex, initiallyExact && i == fromIndex, buildCollationKey); mNames[i] = mNames[fromIndex]; mNames[fromIndex] = firstToken; } } | /**
* Inserts all name variants based on permutations of tokens between
* fromIndex and toIndex
*
* @param initiallyExact true if the name without permutations is the exact
* original name
* @param buildCollationKey true if a collation key makes sense for these
* permutations (false if at least one of the tokens is a
* nickname cluster key)
*/ | Inserts all name variants based on permutations of tokens between fromIndex and toIndex | insertNameVariants | {
"repo_name": "s20121035/rk3288_android5.1_repo",
"path": "packages/providers/ContactsProvider/src/com/android/providers/contacts/NameLookupBuilder.java",
"license": "gpl-3.0",
"size": 13210
} | [
"com.android.providers.contacts.ContactsDatabaseHelper"
] | import com.android.providers.contacts.ContactsDatabaseHelper; | import com.android.providers.contacts.*; | [
"com.android.providers"
] | com.android.providers; | 1,619,354 |
@Generated(value = "com.sun.tools.xjc.Driver", date = "2015-10-25T05:29:34+06:00", comments = "JAXB RI v2.2.11")
public void setRet(long value) {
this.ret = value;
} | @Generated(value = STR, date = STR, comments = STR) void function(long value) { this.ret = value; } | /**
* Sets the value of the ret property.
*
*/ | Sets the value of the ret property | setRet | {
"repo_name": "kanonirov/lanb-client",
"path": "src/main/java/ru/lanbilling/webservice/wsdl/DelSearchTemplateResponse.java",
"license": "mit",
"size": 1725
} | [
"javax.annotation.Generated"
] | import javax.annotation.Generated; | import javax.annotation.*; | [
"javax.annotation"
] | javax.annotation; | 2,807,389 |
public void testInsertSame2()
{
PriorityList p = new PriorityList();
p.add("One", 1);
p.add("Two", 2);
p.add("Three", 3);
assertEquals("size", 3, p.size());
assertEquals("Three", "Three", p.get(0));
assertEquals("Two", "Two", p.get(1));
assertEquals("One", "One", p.get(2));
p.add("TwoTwo", 2);
assertEquals("2: size", 4, p.size());
assertEquals("2: Three", "Three", p.get(0));
assertEquals("2: Two", "Two", p.get(1));
assertEquals("2: TwoTwo", "TwoTwo", p.get(2));
assertEquals("2: One", "One", p.get(3));
} | void function() { PriorityList p = new PriorityList(); p.add("One", 1); p.add("Two", 2); p.add("Three", 3); assertEquals("size", 3, p.size()); assertEquals("Three", "Three", p.get(0)); assertEquals("Two", "Two", p.get(1)); assertEquals("One", "One", p.get(2)); p.add(STR, 2); assertEquals(STR, 4, p.size()); assertEquals(STR, "Three", p.get(0)); assertEquals(STR, "Two", p.get(1)); assertEquals(STR, STR, p.get(2)); assertEquals(STR, "One", p.get(3)); } | /**
* DOCUMENT ME!
*/ | DOCUMENT ME | testInsertSame2 | {
"repo_name": "hgschmie/EyeWiki",
"path": "src/test/de/softwareforge/eyewiki/util/PriorityListTest.java",
"license": "lgpl-2.1",
"size": 4266
} | [
"de.softwareforge.eyewiki.util.PriorityList"
] | import de.softwareforge.eyewiki.util.PriorityList; | import de.softwareforge.eyewiki.util.*; | [
"de.softwareforge.eyewiki"
] | de.softwareforge.eyewiki; | 2,591,831 |
public CacheSimpleConfig setAsyncBackupCount(int asyncBackupCount) {
this.asyncBackupCount = checkAsyncBackupCount(backupCount, asyncBackupCount);
return this;
} | CacheSimpleConfig function(int asyncBackupCount) { this.asyncBackupCount = checkAsyncBackupCount(backupCount, asyncBackupCount); return this; } | /**
* Sets the number of asynchronous backups for this {@link com.hazelcast.cache.ICache}.
*
* @param asyncBackupCount the number of asynchronous synchronous backups to set
* @return the updated CacheSimpleConfig
* @throws IllegalArgumentException if asyncBackupCount smaller than 0,
* or larger than the maximum number of backups,
* or the sum of the backups and async backups is larger than the maximum number of backups
* @see #setBackupCount(int)
* @see #getAsyncBackupCount()
*/ | Sets the number of asynchronous backups for this <code>com.hazelcast.cache.ICache</code> | setAsyncBackupCount | {
"repo_name": "mdogan/hazelcast",
"path": "hazelcast/src/main/java/com/hazelcast/config/CacheSimpleConfig.java",
"license": "apache-2.0",
"size": 44439
} | [
"com.hazelcast.internal.util.Preconditions"
] | import com.hazelcast.internal.util.Preconditions; | import com.hazelcast.internal.util.*; | [
"com.hazelcast.internal"
] | com.hazelcast.internal; | 868,461 |
public static Value explode(Env env,
StringValue separator,
StringValue string,
@Optional("0x7fffffff") long limit)
{
if (separator.length() == 0) {
env.warning(L.l("Delimiter is empty"));
return BooleanValue.FALSE;
}
int head = 0;
ArrayValue array = new ArrayValueImpl();
int separatorLength = separator.length();
int stringLength = string.length();
long ulimit;
if (limit >= 0) {
ulimit = limit;
} else {
ulimit = 0x7fffffff;
}
for (int i = 0; i < stringLength; ++i) {
if (ulimit <= array.getSize() + 1) {
break;
}
if (string.regionMatches(i, separator, 0, separatorLength)) {
StringValue chunk = string.substring(head, i);
array.append(chunk);
head = i + separatorLength;
i = head - 1;
}
}
StringValue chunk = string.substring(head);
array.append(chunk);
while (array.getSize() > 0 && limit++ < 0) {
array.pop(env);
}
return array;
} | static Value function(Env env, StringValue separator, StringValue string, @Optional(STR) long limit) { if (separator.length() == 0) { env.warning(L.l(STR)); return BooleanValue.FALSE; } int head = 0; ArrayValue array = new ArrayValueImpl(); int separatorLength = separator.length(); int stringLength = string.length(); long ulimit; if (limit >= 0) { ulimit = limit; } else { ulimit = 0x7fffffff; } for (int i = 0; i < stringLength; ++i) { if (ulimit <= array.getSize() + 1) { break; } if (string.regionMatches(i, separator, 0, separatorLength)) { StringValue chunk = string.substring(head, i); array.append(chunk); head = i + separatorLength; i = head - 1; } } StringValue chunk = string.substring(head); array.append(chunk); while (array.getSize() > 0 && limit++ < 0) { array.pop(env); } return array; } | /**
* Explodes a string into an array
*
* @param separator the separator string
* @param string the string to be exploded
* @param limit the max number of elements
* @return an array of exploded values
*/ | Explodes a string into an array | explode | {
"repo_name": "smba/oak",
"path": "quercus/src/main/java/com/caucho/quercus/lib/string/StringModule.java",
"license": "lgpl-3.0",
"size": 155187
} | [
"com.caucho.quercus.annotation.Optional",
"com.caucho.quercus.env.ArrayValue",
"com.caucho.quercus.env.ArrayValueImpl",
"com.caucho.quercus.env.BooleanValue",
"com.caucho.quercus.env.Env",
"com.caucho.quercus.env.StringValue",
"com.caucho.quercus.env.Value"
] | import com.caucho.quercus.annotation.Optional; import com.caucho.quercus.env.ArrayValue; import com.caucho.quercus.env.ArrayValueImpl; import com.caucho.quercus.env.BooleanValue; import com.caucho.quercus.env.Env; import com.caucho.quercus.env.StringValue; import com.caucho.quercus.env.Value; | import com.caucho.quercus.annotation.*; import com.caucho.quercus.env.*; | [
"com.caucho.quercus"
] | com.caucho.quercus; | 1,022,209 |
public List<Template> getAllTemplates() {
return new ArrayList<>(templatesByName.values());
} | List<Template> function() { return new ArrayList<>(templatesByName.values()); } | /**
* Gets all templates.
*
* @return all registered {@link Template}s
*/ | Gets all templates | getAllTemplates | {
"repo_name": "cm-is-dog/rapidminer-studio-core",
"path": "src/main/java/com/rapidminer/template/TemplateManager.java",
"license": "agpl-3.0",
"size": 4497
} | [
"java.util.ArrayList",
"java.util.List"
] | import java.util.ArrayList; import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 1,374,598 |
public DialogPanel getDialogPanel() {
return dialogPanel;
} | DialogPanel function() { return dialogPanel; } | /**
* Get the Dialog Panel used in this sheet org.xito
* @return
*/ | Get the Dialog Panel used in this sheet org.xito | getDialogPanel | {
"repo_name": "drichan/xito",
"path": "modules/dazzle/src/main/java/org/xito/dazzle/dialog/SheetDialog.java",
"license": "apache-2.0",
"size": 22240
} | [
"org.xito.dialog.DialogPanel"
] | import org.xito.dialog.DialogPanel; | import org.xito.dialog.*; | [
"org.xito.dialog"
] | org.xito.dialog; | 2,354,710 |
NotificationSchemaDto schemaDto = createNotificationSchema(null, NotificationTypeDto.SYSTEM);
Assert.assertNotNull(schemaDto.getId());
LOG.debug("Create notification schema with id {}", schemaDto.getId());
} | NotificationSchemaDto schemaDto = createNotificationSchema(null, NotificationTypeDto.SYSTEM); Assert.assertNotNull(schemaDto.getId()); LOG.debug(STR, schemaDto.getId()); } | /**
* Test create notification schema.
*
* @throws Exception the exception
*/ | Test create notification schema | testCreateNotificationSchema | {
"repo_name": "abohomol/kaa",
"path": "server/node/src/test/java/org/kaaproject/kaa/server/control/ControlServerNotificationSchemaIT.java",
"license": "apache-2.0",
"size": 4524
} | [
"org.junit.Assert",
"org.kaaproject.kaa.common.dto.NotificationSchemaDto",
"org.kaaproject.kaa.common.dto.NotificationTypeDto"
] | import org.junit.Assert; import org.kaaproject.kaa.common.dto.NotificationSchemaDto; import org.kaaproject.kaa.common.dto.NotificationTypeDto; | import org.junit.*; import org.kaaproject.kaa.common.dto.*; | [
"org.junit",
"org.kaaproject.kaa"
] | org.junit; org.kaaproject.kaa; | 376,263 |
public static <T> List<T> readList(ObjectDataInput in) throws IOException {
int size = in.readInt();
if (size == 0) {
return Collections.emptyList();
}
List<T> list = new ArrayList<>(size);
for (int i = 0; i < size; i++) {
T item = in.readObject();
list.add(item);
}
return list;
} | static <T> List<T> function(ObjectDataInput in) throws IOException { int size = in.readInt(); if (size == 0) { return Collections.emptyList(); } List<T> list = new ArrayList<>(size); for (int i = 0; i < size; i++) { T item = in.readObject(); list.add(item); } return list; } | /**
* Reads a list from the given {@link ObjectDataInput}. It is expected that
* the next int read from the data input is the list's size, then that
* many objects are read from the data input and returned as a list.
*
* @param in data input to read from
* @param <T> type of items
* @return list of items read from data input
* @throws IOException when an error occurs while reading from the input
*/ | Reads a list from the given <code>ObjectDataInput</code>. It is expected that the next int read from the data input is the list's size, then that many objects are read from the data input and returned as a list | readList | {
"repo_name": "emre-aydin/hazelcast",
"path": "hazelcast/src/main/java/com/hazelcast/internal/serialization/impl/SerializationUtil.java",
"license": "apache-2.0",
"size": 16747
} | [
"com.hazelcast.nio.ObjectDataInput",
"java.io.IOException",
"java.util.ArrayList",
"java.util.Collections",
"java.util.List"
] | import com.hazelcast.nio.ObjectDataInput; import java.io.IOException; import java.util.ArrayList; import java.util.Collections; import java.util.List; | import com.hazelcast.nio.*; import java.io.*; import java.util.*; | [
"com.hazelcast.nio",
"java.io",
"java.util"
] | com.hazelcast.nio; java.io; java.util; | 1,479,851 |
public void handshake(ClientListenerProtocolVersion ver) throws IOException, SQLException {
BinaryWriterExImpl writer = new BinaryWriterExImpl(null, new BinaryHeapOutputStream(HANDSHAKE_MSG_SIZE),
null, null);
writer.writeByte((byte)ClientListenerRequest.HANDSHAKE);
writer.writeShort(ver.major());
writer.writeShort(ver.minor());
writer.writeShort(ver.maintenance());
writer.writeByte(ClientListenerNioListener.JDBC_CLIENT);
writer.writeBoolean(connProps.isDistributedJoins());
writer.writeBoolean(connProps.isEnforceJoinOrder());
writer.writeBoolean(connProps.isCollocated());
writer.writeBoolean(connProps.isReplicatedOnly());
writer.writeBoolean(connProps.isAutoCloseServerCursor());
writer.writeBoolean(connProps.isLazy());
writer.writeBoolean(connProps.isSkipReducerOnUpdate());
if (ver.compareTo(VER_2_7_0) >= 0)
writer.writeString(connProps.nestedTxMode());
if (ver.compareTo(VER_2_8_0) >= 0)
writer.writeByte(nullableBooleanToByte(connProps.isDataPageScanEnabled()));
if (!F.isEmpty(connProps.getUsername())) {
assert ver.compareTo(VER_2_5_0) >= 0 : "Authentication is supported since 2.5";
writer.writeString(connProps.getUsername());
writer.writeString(connProps.getPassword());
}
send(writer.array());
BinaryReaderExImpl reader = new BinaryReaderExImpl(null, new BinaryHeapInputStream(read()),
null, null, false);
boolean accepted = reader.readBoolean();
if (accepted) {
if (reader.available() > 0) {
byte maj = reader.readByte();
byte min = reader.readByte();
byte maintenance = reader.readByte();
String stage = reader.readString();
long ts = reader.readLong();
byte[] hash = reader.readByteArray();
igniteVer = new IgniteProductVersion(maj, min, maintenance, stage, ts, hash);
}
else
igniteVer = new IgniteProductVersion((byte)2, (byte)0, (byte)0, "Unknown", 0L, null);
srvProtocolVer = ver;
}
else {
short maj = reader.readShort();
short min = reader.readShort();
short maintenance = reader.readShort();
String err = reader.readString();
ClientListenerProtocolVersion srvProtoVer0 = ClientListenerProtocolVersion.create(maj, min, maintenance);
if (srvProtoVer0.compareTo(VER_2_5_0) < 0 && !F.isEmpty(connProps.getUsername())) {
throw new SQLException("Authentication doesn't support by remote server[driverProtocolVer="
+ CURRENT_VER + ", remoteNodeProtocolVer=" + srvProtoVer0 + ", err=" + err
+ ", url=" + connProps.getUrl() + ']', SqlStateCode.CONNECTION_REJECTED);
}
if (VER_2_7_0.equals(srvProtoVer0)
|| VER_2_5_0.equals(srvProtoVer0)
|| VER_2_4_0.equals(srvProtoVer0)
|| VER_2_3_0.equals(srvProtoVer0)
|| VER_2_1_5.equals(srvProtoVer0))
handshake(srvProtoVer0);
else if (VER_2_1_0.equals(srvProtoVer0))
handshake_2_1_0();
else {
throw new SQLException("Handshake failed [driverProtocolVer=" + CURRENT_VER +
", remoteNodeProtocolVer=" + srvProtoVer0 + ", err=" + err + ']',
SqlStateCode.CONNECTION_REJECTED);
}
}
} | void function(ClientListenerProtocolVersion ver) throws IOException, SQLException { BinaryWriterExImpl writer = new BinaryWriterExImpl(null, new BinaryHeapOutputStream(HANDSHAKE_MSG_SIZE), null, null); writer.writeByte((byte)ClientListenerRequest.HANDSHAKE); writer.writeShort(ver.major()); writer.writeShort(ver.minor()); writer.writeShort(ver.maintenance()); writer.writeByte(ClientListenerNioListener.JDBC_CLIENT); writer.writeBoolean(connProps.isDistributedJoins()); writer.writeBoolean(connProps.isEnforceJoinOrder()); writer.writeBoolean(connProps.isCollocated()); writer.writeBoolean(connProps.isReplicatedOnly()); writer.writeBoolean(connProps.isAutoCloseServerCursor()); writer.writeBoolean(connProps.isLazy()); writer.writeBoolean(connProps.isSkipReducerOnUpdate()); if (ver.compareTo(VER_2_7_0) >= 0) writer.writeString(connProps.nestedTxMode()); if (ver.compareTo(VER_2_8_0) >= 0) writer.writeByte(nullableBooleanToByte(connProps.isDataPageScanEnabled())); if (!F.isEmpty(connProps.getUsername())) { assert ver.compareTo(VER_2_5_0) >= 0 : STR; writer.writeString(connProps.getUsername()); writer.writeString(connProps.getPassword()); } send(writer.array()); BinaryReaderExImpl reader = new BinaryReaderExImpl(null, new BinaryHeapInputStream(read()), null, null, false); boolean accepted = reader.readBoolean(); if (accepted) { if (reader.available() > 0) { byte maj = reader.readByte(); byte min = reader.readByte(); byte maintenance = reader.readByte(); String stage = reader.readString(); long ts = reader.readLong(); byte[] hash = reader.readByteArray(); igniteVer = new IgniteProductVersion(maj, min, maintenance, stage, ts, hash); } else igniteVer = new IgniteProductVersion((byte)2, (byte)0, (byte)0, STR, 0L, null); srvProtocolVer = ver; } else { short maj = reader.readShort(); short min = reader.readShort(); short maintenance = reader.readShort(); String err = reader.readString(); ClientListenerProtocolVersion srvProtoVer0 = ClientListenerProtocolVersion.create(maj, min, maintenance); if (srvProtoVer0.compareTo(VER_2_5_0) < 0 && !F.isEmpty(connProps.getUsername())) { throw new SQLException(STR + CURRENT_VER + STR + srvProtoVer0 + STR + err + STR + connProps.getUrl() + ']', SqlStateCode.CONNECTION_REJECTED); } if (VER_2_7_0.equals(srvProtoVer0) VER_2_5_0.equals(srvProtoVer0) VER_2_4_0.equals(srvProtoVer0) VER_2_3_0.equals(srvProtoVer0) VER_2_1_5.equals(srvProtoVer0)) handshake(srvProtoVer0); else if (VER_2_1_0.equals(srvProtoVer0)) handshake_2_1_0(); else { throw new SQLException(STR + CURRENT_VER + STR + srvProtoVer0 + STR + err + ']', SqlStateCode.CONNECTION_REJECTED); } } } | /**
* Used for versions: 2.1.5 and 2.3.0. The protocol version is changed but handshake format isn't changed.
*
* @param ver JDBC client version.
* @throws IOException On IO error.
* @throws SQLException On connection reject.
*/ | Used for versions: 2.1.5 and 2.3.0. The protocol version is changed but handshake format isn't changed | handshake | {
"repo_name": "BiryukovVA/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/internal/jdbc/thin/JdbcThinTcpIo.java",
"license": "apache-2.0",
"size": 26354
} | [
"java.io.IOException",
"java.sql.SQLException",
"org.apache.ignite.internal.binary.BinaryReaderExImpl",
"org.apache.ignite.internal.binary.BinaryWriterExImpl",
"org.apache.ignite.internal.binary.streams.BinaryHeapInputStream",
"org.apache.ignite.internal.binary.streams.BinaryHeapOutputStream",
"org.apache.ignite.internal.processors.odbc.ClientListenerNioListener",
"org.apache.ignite.internal.processors.odbc.ClientListenerProtocolVersion",
"org.apache.ignite.internal.processors.odbc.ClientListenerRequest",
"org.apache.ignite.internal.processors.odbc.SqlStateCode",
"org.apache.ignite.internal.util.typedef.F",
"org.apache.ignite.lang.IgniteProductVersion"
] | import java.io.IOException; import java.sql.SQLException; import org.apache.ignite.internal.binary.BinaryReaderExImpl; import org.apache.ignite.internal.binary.BinaryWriterExImpl; import org.apache.ignite.internal.binary.streams.BinaryHeapInputStream; import org.apache.ignite.internal.binary.streams.BinaryHeapOutputStream; import org.apache.ignite.internal.processors.odbc.ClientListenerNioListener; import org.apache.ignite.internal.processors.odbc.ClientListenerProtocolVersion; import org.apache.ignite.internal.processors.odbc.ClientListenerRequest; import org.apache.ignite.internal.processors.odbc.SqlStateCode; import org.apache.ignite.internal.util.typedef.F; import org.apache.ignite.lang.IgniteProductVersion; | import java.io.*; import java.sql.*; import org.apache.ignite.internal.binary.*; import org.apache.ignite.internal.binary.streams.*; import org.apache.ignite.internal.processors.odbc.*; import org.apache.ignite.internal.util.typedef.*; import org.apache.ignite.lang.*; | [
"java.io",
"java.sql",
"org.apache.ignite"
] | java.io; java.sql; org.apache.ignite; | 1,794,864 |
public static AsymmetricKeyParameter createKey(InputStream inStr) throws IOException
{
return createKey(SubjectPublicKeyInfo.getInstance(new ASN1InputStream(inStr).readObject()));
} | static AsymmetricKeyParameter function(InputStream inStr) throws IOException { return createKey(SubjectPublicKeyInfo.getInstance(new ASN1InputStream(inStr).readObject())); } | /**
* Create a public key from a SubjectPublicKeyInfo encoding read from a stream
*
* @param inStr the stream to read the SubjectPublicKeyInfo encoding from
* @return the appropriate key parameter
* @throws IOException on an error decoding the key
*/ | Create a public key from a SubjectPublicKeyInfo encoding read from a stream | createKey | {
"repo_name": "onessimofalconi/bc-java",
"path": "core/src/main/java/org/bouncycastle/crypto/util/PublicKeyFactory.java",
"license": "mit",
"size": 8113
} | [
"java.io.IOException",
"java.io.InputStream",
"org.bouncycastle.asn1.ASN1InputStream",
"org.bouncycastle.asn1.x509.SubjectPublicKeyInfo",
"org.bouncycastle.crypto.params.AsymmetricKeyParameter"
] | import java.io.IOException; import java.io.InputStream; import org.bouncycastle.asn1.ASN1InputStream; import org.bouncycastle.asn1.x509.SubjectPublicKeyInfo; import org.bouncycastle.crypto.params.AsymmetricKeyParameter; | import java.io.*; import org.bouncycastle.asn1.*; import org.bouncycastle.asn1.x509.*; import org.bouncycastle.crypto.params.*; | [
"java.io",
"org.bouncycastle.asn1",
"org.bouncycastle.crypto"
] | java.io; org.bouncycastle.asn1; org.bouncycastle.crypto; | 1,700,759 |
public static List<Integer> getPeripheralPoints(
boolean[] discretePixels,
int imageSideLength,
int numLayers,
boolean includeDiagonal) {
assert(discretePixels.length == imageSideLength * imageSideLength);
int numScanDirections = includeDiagonal ? 8 : 4;
int numPeripherals = imageSideLength * numScanDirections * numLayers;
List<Integer> peripherals = new ArrayList<Integer>(numPeripherals);
int half = (int)(Math.ceil(imageSideLength / 2.0));
int last = imageSideLength - 1;
// Layers
for (int i = 0; i < numLayers; i++) {
// Horizontal LTR
peripherals.addAll(scan(discretePixels, imageSideLength, i, true, true));
// Horizontal RTL
peripherals.addAll(scan(discretePixels, imageSideLength, i, true, false));
// Vertial Down
peripherals.addAll(scan(discretePixels, imageSideLength, i, false, true));
// Vertical Up
peripherals.addAll(scan(discretePixels, imageSideLength, i, false, false));
// Diagnals
if (includeDiagonal) {
// Top Left to Bottom Right
peripherals.addAll(diagonalScan(discretePixels, imageSideLength, i, 0, half, 0,
0, half, 0,
1, 1));
// Top Right to Bottom Left
peripherals.addAll(diagonalScan(discretePixels, imageSideLength, i, last - half, last, 0,
0, half, last,
1, -1));
// Bottom Left to Top Right
peripherals.addAll(diagonalScan(discretePixels, imageSideLength, i, 0, half, last,
last - half, last, 0,
-1, 1));
// Bottom Right to Top Left
peripherals.addAll(diagonalScan(discretePixels, imageSideLength, i, last - half, last, last,
last - half, last, last,
-1, -1));
}
}
assert(peripherals.size() == numPeripherals);
return peripherals;
} | static List<Integer> function( boolean[] discretePixels, int imageSideLength, int numLayers, boolean includeDiagonal) { assert(discretePixels.length == imageSideLength * imageSideLength); int numScanDirections = includeDiagonal ? 8 : 4; int numPeripherals = imageSideLength * numScanDirections * numLayers; List<Integer> peripherals = new ArrayList<Integer>(numPeripherals); int half = (int)(Math.ceil(imageSideLength / 2.0)); int last = imageSideLength - 1; for (int i = 0; i < numLayers; i++) { peripherals.addAll(scan(discretePixels, imageSideLength, i, true, true)); peripherals.addAll(scan(discretePixels, imageSideLength, i, true, false)); peripherals.addAll(scan(discretePixels, imageSideLength, i, false, true)); peripherals.addAll(scan(discretePixels, imageSideLength, i, false, false)); if (includeDiagonal) { peripherals.addAll(diagonalScan(discretePixels, imageSideLength, i, 0, half, 0, 0, half, 0, 1, 1)); peripherals.addAll(diagonalScan(discretePixels, imageSideLength, i, last - half, last, 0, 0, half, last, 1, -1)); peripherals.addAll(diagonalScan(discretePixels, imageSideLength, i, 0, half, last, last - half, last, 0, -1, 1)); peripherals.addAll(diagonalScan(discretePixels, imageSideLength, i, last - half, last, last, last - half, last, last, -1, -1)); } } assert(peripherals.size() == numPeripherals); return peripherals; } | /**
* Get the peripheral points for an already discrete set of pixels.
* This should be used if the caller needs the discrete pixels for other work and does not want
* want to recreate them.
* |discretePixels| must be a |imageSideLength| x |imageSideLength| square.
*/ | Get the peripheral points for an already discrete set of pixels. This should be used if the caller needs the discrete pixels for other work and does not want want to recreate them. |discretePixels| must be a |imageSideLength| x |imageSideLength| square | getPeripheralPoints | {
"repo_name": "eriq-augustine/jocr",
"path": "src/com/eriqaugustine/ocr/utils/ImageUtils.java",
"license": "gpl-2.0",
"size": 15917
} | [
"java.util.ArrayList",
"java.util.List"
] | import java.util.ArrayList; import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 2,392,241 |
@SuppressWarnings({"SynchronizationOnLocalVariableOrMethodParameter", "BusyWait"})
private void sendSessionAttributes(Map<?, ?> attrs, GridTaskSessionImpl ses)
throws IgniteCheckedException {
assert attrs != null;
assert ses != null;
Collection<ComputeJobSibling> siblings = ses.getJobSiblings();
GridIoManager commMgr = ctx.io();
long timeout = ses.getEndTime() - U.currentTimeMillis();
if (timeout <= 0) {
U.warn(log, "Session attributes won't be set due to task timeout: " + attrs);
return;
}
Set<UUID> rcvrs = new HashSet<>();
UUID locNodeId = ctx.localNodeId();
synchronized (ses) {
if (ses.isClosed()) {
if (log.isDebugEnabled())
log.debug("Setting session attributes on closed session (will ignore): " + ses);
return;
}
ses.setInternal(attrs);
// Do this inside of synchronization block, so every message
// ID will be associated with a certain session state.
for (ComputeJobSibling s : siblings) {
GridJobSiblingImpl sib = (GridJobSiblingImpl)s;
UUID nodeId = sib.nodeId();
if (!nodeId.equals(locNodeId) && !sib.isJobDone() && !rcvrs.contains(nodeId))
rcvrs.add(nodeId);
}
}
if (ctx.event().isRecordable(EVT_TASK_SESSION_ATTR_SET)) {
Event evt = new TaskEvent(
ctx.discovery().localNode(),
"Changed attributes: " + attrs,
EVT_TASK_SESSION_ATTR_SET,
ses.getId(),
ses.getTaskName(),
ses.getTaskClassName(),
false,
null);
ctx.event().record(evt);
}
IgniteCheckedException ex = null;
// Every job gets an individual message to keep track of ghost requests.
for (ComputeJobSibling s : ses.getJobSiblings()) {
GridJobSiblingImpl sib = (GridJobSiblingImpl)s;
UUID nodeId = sib.nodeId();
// Pair can be null if job is finished.
if (rcvrs.remove(nodeId)) {
ClusterNode node = ctx.discovery().node(nodeId);
// Check that node didn't change (it could happen in case of failover).
if (node != null) {
boolean loc = node.id().equals(ctx.localNodeId()) && !ctx.config().isMarshalLocalJobs();
GridTaskSessionRequest req = new GridTaskSessionRequest(
ses.getId(),
null,
loc ? null : U.marshal(marsh, attrs),
attrs);
// Make sure to go through IO manager always, since order
// should be preserved here.
try {
commMgr.sendOrderedMessage(
node,
sib.jobTopic(),
req,
SYSTEM_POOL,
timeout,
false);
}
catch (IgniteCheckedException e) {
node = e instanceof ClusterTopologyCheckedException ? null : ctx.discovery().node(nodeId);
if (node != null) {
try {
// Since communication on remote node may stop before
// we get discovery notification, we give ourselves the
// best effort to detect it.
Thread.sleep(DISCO_TIMEOUT);
}
catch (InterruptedException ignore) {
U.warn(log, "Got interrupted while sending session attributes.");
}
node = ctx.discovery().node(nodeId);
}
String err = "Failed to send session attribute request message to node " +
"(normal case if node left grid) [node=" + node + ", req=" + req + ']';
if (node != null)
U.warn(log, err);
else if (log.isDebugEnabled())
log.debug(err);
if (ex == null)
ex = e;
}
}
}
}
if (ex != null)
throw ex;
} | @SuppressWarnings({STR, STR}) void function(Map<?, ?> attrs, GridTaskSessionImpl ses) throws IgniteCheckedException { assert attrs != null; assert ses != null; Collection<ComputeJobSibling> siblings = ses.getJobSiblings(); GridIoManager commMgr = ctx.io(); long timeout = ses.getEndTime() - U.currentTimeMillis(); if (timeout <= 0) { U.warn(log, STR + attrs); return; } Set<UUID> rcvrs = new HashSet<>(); UUID locNodeId = ctx.localNodeId(); synchronized (ses) { if (ses.isClosed()) { if (log.isDebugEnabled()) log.debug(STR + ses); return; } ses.setInternal(attrs); for (ComputeJobSibling s : siblings) { GridJobSiblingImpl sib = (GridJobSiblingImpl)s; UUID nodeId = sib.nodeId(); if (!nodeId.equals(locNodeId) && !sib.isJobDone() && !rcvrs.contains(nodeId)) rcvrs.add(nodeId); } } if (ctx.event().isRecordable(EVT_TASK_SESSION_ATTR_SET)) { Event evt = new TaskEvent( ctx.discovery().localNode(), STR + attrs, EVT_TASK_SESSION_ATTR_SET, ses.getId(), ses.getTaskName(), ses.getTaskClassName(), false, null); ctx.event().record(evt); } IgniteCheckedException ex = null; for (ComputeJobSibling s : ses.getJobSiblings()) { GridJobSiblingImpl sib = (GridJobSiblingImpl)s; UUID nodeId = sib.nodeId(); if (rcvrs.remove(nodeId)) { ClusterNode node = ctx.discovery().node(nodeId); if (node != null) { boolean loc = node.id().equals(ctx.localNodeId()) && !ctx.config().isMarshalLocalJobs(); GridTaskSessionRequest req = new GridTaskSessionRequest( ses.getId(), null, loc ? null : U.marshal(marsh, attrs), attrs); try { commMgr.sendOrderedMessage( node, sib.jobTopic(), req, SYSTEM_POOL, timeout, false); } catch (IgniteCheckedException e) { node = e instanceof ClusterTopologyCheckedException ? null : ctx.discovery().node(nodeId); if (node != null) { try { Thread.sleep(DISCO_TIMEOUT); } catch (InterruptedException ignore) { U.warn(log, STR); } node = ctx.discovery().node(nodeId); } String err = STR + STR + node + STR + req + ']'; if (node != null) U.warn(log, err); else if (log.isDebugEnabled()) log.debug(err); if (ex == null) ex = e; } } } } if (ex != null) throw ex; } | /**
* This method will make the best attempt to send attributes to all jobs.
*
* @param attrs Deserialized session attributes.
* @param ses Task session.
* @throws IgniteCheckedException If send to any of the jobs failed.
*/ | This method will make the best attempt to send attributes to all jobs | sendSessionAttributes | {
"repo_name": "shroman/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/internal/processors/task/GridTaskProcessor.java",
"license": "apache-2.0",
"size": 52188
} | [
"java.util.Collection",
"java.util.HashSet",
"java.util.Map",
"java.util.Set",
"org.apache.ignite.IgniteCheckedException",
"org.apache.ignite.cluster.ClusterNode",
"org.apache.ignite.compute.ComputeJobSibling",
"org.apache.ignite.events.Event",
"org.apache.ignite.events.TaskEvent",
"org.apache.ignite.internal.GridJobSiblingImpl",
"org.apache.ignite.internal.GridTaskSessionImpl",
"org.apache.ignite.internal.GridTaskSessionRequest",
"org.apache.ignite.internal.cluster.ClusterTopologyCheckedException",
"org.apache.ignite.internal.managers.communication.GridIoManager",
"org.apache.ignite.internal.util.typedef.internal.U"
] | import java.util.Collection; import java.util.HashSet; import java.util.Map; import java.util.Set; import org.apache.ignite.IgniteCheckedException; import org.apache.ignite.cluster.ClusterNode; import org.apache.ignite.compute.ComputeJobSibling; import org.apache.ignite.events.Event; import org.apache.ignite.events.TaskEvent; import org.apache.ignite.internal.GridJobSiblingImpl; import org.apache.ignite.internal.GridTaskSessionImpl; import org.apache.ignite.internal.GridTaskSessionRequest; import org.apache.ignite.internal.cluster.ClusterTopologyCheckedException; import org.apache.ignite.internal.managers.communication.GridIoManager; import org.apache.ignite.internal.util.typedef.internal.U; | import java.util.*; import org.apache.ignite.*; import org.apache.ignite.cluster.*; import org.apache.ignite.compute.*; import org.apache.ignite.events.*; import org.apache.ignite.internal.*; import org.apache.ignite.internal.cluster.*; import org.apache.ignite.internal.managers.communication.*; import org.apache.ignite.internal.util.typedef.internal.*; | [
"java.util",
"org.apache.ignite"
] | java.util; org.apache.ignite; | 223,410 |
public void launchFramework(final BootstrapConfig config, final LogProvider logProvider) {
if (config == null)
throw new IllegalArgumentException("bootstrap config must not be null");
boolean isClient = config.getProcessType().equals(BootstrapConstants.LOC_PROCESS_TYPE_CLIENT);
try {
String nTime = config.get(BootstrapConstants.LAUNCH_TIME);
startTime = nTime == null ? System.nanoTime() : Long.parseLong(nTime);
if (isClient) {
Tr.audit(tc, "audit.launchTime.client", config.getProcessName());
} else {
Tr.audit(tc, "audit.launchTime", config.getProcessName());
}
outputLicenseRestrictionMessage();
outputEmbeddedProductExtensions();
outputEnvironmentVariableProductExtensions();
// Save the bootstrap config locally
this.config = config;
boolean j2secManager = false;
if (config.get(BootstrapConstants.JAVA_2_SECURITY_PROPERTY) != null) {
j2secManager = true;
}
String j2secNoRethrow = config.get(BootstrapConstants.JAVA_2_SECURITY_NORETHROW);
if (j2secManager) { | void function(final BootstrapConfig config, final LogProvider logProvider) { if (config == null) throw new IllegalArgumentException(STR); boolean isClient = config.getProcessType().equals(BootstrapConstants.LOC_PROCESS_TYPE_CLIENT); try { String nTime = config.get(BootstrapConstants.LAUNCH_TIME); startTime = nTime == null ? System.nanoTime() : Long.parseLong(nTime); if (isClient) { Tr.audit(tc, STR, config.getProcessName()); } else { Tr.audit(tc, STR, config.getProcessName()); } outputLicenseRestrictionMessage(); outputEmbeddedProductExtensions(); outputEnvironmentVariableProductExtensions(); this.config = config; boolean j2secManager = false; if (config.get(BootstrapConstants.JAVA_2_SECURITY_PROPERTY) != null) { j2secManager = true; } String j2secNoRethrow = config.get(BootstrapConstants.JAVA_2_SECURITY_NORETHROW); if (j2secManager) { | /**
* Create and launch the OSGi framework
*
* @param config
* BootstrapConfig object encapsulating active initial framework
* properties
* @param logProvider
* The initialized/active log provider that must be included in
* framework management activities (start/stop/.. ), or null
* @param callback
*/ | Create and launch the OSGi framework | launchFramework | {
"repo_name": "OpenLiberty/open-liberty",
"path": "dev/com.ibm.ws.kernel.boot.nested/src/com/ibm/ws/kernel/launch/internal/FrameworkManager.java",
"license": "epl-1.0",
"size": 59263
} | [
"com.ibm.websphere.ras.Tr",
"com.ibm.ws.kernel.boot.BootstrapConfig",
"com.ibm.ws.kernel.boot.internal.BootstrapConstants",
"com.ibm.wsspi.logprovider.LogProvider"
] | import com.ibm.websphere.ras.Tr; import com.ibm.ws.kernel.boot.BootstrapConfig; import com.ibm.ws.kernel.boot.internal.BootstrapConstants; import com.ibm.wsspi.logprovider.LogProvider; | import com.ibm.websphere.ras.*; import com.ibm.ws.kernel.boot.*; import com.ibm.ws.kernel.boot.internal.*; import com.ibm.wsspi.logprovider.*; | [
"com.ibm.websphere",
"com.ibm.ws",
"com.ibm.wsspi"
] | com.ibm.websphere; com.ibm.ws; com.ibm.wsspi; | 1,896,379 |
public final List<Statement> getStatements() {
return myStatements;
} | final List<Statement> function() { return myStatements; } | /**
* <p>This method returns the list of statements in
* for this operation procedure declaration.</p>
*
* @return The list of {@link Statement} representation objects.
*/ | This method returns the list of statements in for this operation procedure declaration | getStatements | {
"repo_name": "mikekab/RESOLVE",
"path": "src/main/java/edu/clemson/cs/rsrg/absyn/declarations/operationdecl/OperationProcedureDec.java",
"license": "bsd-3-clause",
"size": 10021
} | [
"edu.clemson.cs.rsrg.absyn.statements.Statement",
"java.util.List"
] | import edu.clemson.cs.rsrg.absyn.statements.Statement; import java.util.List; | import edu.clemson.cs.rsrg.absyn.statements.*; import java.util.*; | [
"edu.clemson.cs",
"java.util"
] | edu.clemson.cs; java.util; | 2,556,031 |
Page getOutput(); | Page getOutput(); | /**
* Gets an output page from the operator. If no output data is currently
* available, return null.
*/ | Gets an output page from the operator. If no output data is currently available, return null | getOutput | {
"repo_name": "Teradata/presto",
"path": "presto-main/src/main/java/com/facebook/presto/operator/Operator.java",
"license": "apache-2.0",
"size": 3262
} | [
"com.facebook.presto.spi.Page"
] | import com.facebook.presto.spi.Page; | import com.facebook.presto.spi.*; | [
"com.facebook.presto"
] | com.facebook.presto; | 605,577 |
public IDataset getEnergy_transfer(); | IDataset function(); | /**
* Energy change caused by beamline component
* <p>
* <b>Type:</b> NX_FLOAT
* <b>Units:</b> NX_ENERGY
* <b>Dimensions:</b> 1: i;
* </p>
*
* @return the value.
*/ | Energy change caused by beamline component Type: NX_FLOAT Units: NX_ENERGY Dimensions: 1: i; | getEnergy_transfer | {
"repo_name": "jonahkichwacoders/dawnsci",
"path": "org.eclipse.dawnsci.nexus/src/org/eclipse/dawnsci/nexus/NXbeam.java",
"license": "epl-1.0",
"size": 5452
} | [
"org.eclipse.dawnsci.analysis.api.dataset.IDataset"
] | import org.eclipse.dawnsci.analysis.api.dataset.IDataset; | import org.eclipse.dawnsci.analysis.api.dataset.*; | [
"org.eclipse.dawnsci"
] | org.eclipse.dawnsci; | 2,740,085 |
void serialize(ByteBuffer buf) throws IOException; | void serialize(ByteBuffer buf) throws IOException; | /**
* Serialize the Object contained in this DeferredSerialization
* @return Serialized representation of the object stored
* @throws IOException Thrown here because FastSerialzier throws IOException
*/ | Serialize the Object contained in this DeferredSerialization | serialize | {
"repo_name": "deerwalk/voltdb",
"path": "src/frontend/org/voltcore/utils/DeferredSerialization.java",
"license": "agpl-3.0",
"size": 1674
} | [
"java.io.IOException",
"java.nio.ByteBuffer"
] | import java.io.IOException; import java.nio.ByteBuffer; | import java.io.*; import java.nio.*; | [
"java.io",
"java.nio"
] | java.io; java.nio; | 2,626,051 |
Configurer registerHandlerDefinition(BiFunction<Configuration, Class, HandlerDefinition> handlerDefinitionClass);
/**
* Registers a {@link Snapshotter} instance with this {@link Configurer}. Defaults to a {@link
* org.axonframework.eventsourcing.AggregateSnapshotter} implementation.
*
* @param snapshotterBuilder the builder function for the {@link Snapshotter} | Configurer registerHandlerDefinition(BiFunction<Configuration, Class, HandlerDefinition> handlerDefinitionClass); /** * Registers a {@link Snapshotter} instance with this {@link Configurer}. Defaults to a { * org.axonframework.eventsourcing.AggregateSnapshotter} implementation. * * @param snapshotterBuilder the builder function for the {@link Snapshotter} | /**
* Registers the definition of a Handler class. Defaults to annotation based recognition of handler methods.
*
* @param handlerDefinitionClass A function providing the definition based on the current Configuration as well
* as the class being inspected.
* @return the current instance of the Configurer, for chaining purposes
*/ | Registers the definition of a Handler class. Defaults to annotation based recognition of handler methods | registerHandlerDefinition | {
"repo_name": "krosenvold/AxonFramework",
"path": "config/src/main/java/org/axonframework/config/Configurer.java",
"license": "apache-2.0",
"size": 30466
} | [
"java.util.function.BiFunction",
"org.axonframework.eventsourcing.Snapshotter",
"org.axonframework.messaging.annotation.HandlerDefinition"
] | import java.util.function.BiFunction; import org.axonframework.eventsourcing.Snapshotter; import org.axonframework.messaging.annotation.HandlerDefinition; | import java.util.function.*; import org.axonframework.eventsourcing.*; import org.axonframework.messaging.annotation.*; | [
"java.util",
"org.axonframework.eventsourcing",
"org.axonframework.messaging"
] | java.util; org.axonframework.eventsourcing; org.axonframework.messaging; | 396,332 |
@SuppressWarnings("unchecked")
public static double getExclusiveAvailabilityOfStorageCombination(Set<BackendService> storageServiceCombination, Set<BackendService> superSet) {
double exclusiveAvailability = 0, availability = 0, unavailability = 0;
availability = getAvailabilityOfCombination(storageServiceCombination);
log.debug("availability:"+availability);
unavailability = getUnavailabilityOfCombination( new HashSet<BackendService>(CollectionUtils.disjunction(superSet, storageServiceCombination)) );
exclusiveAvailability = availability;
if(unavailability != 0){
exclusiveAvailability = availability * unavailability;
}
log.debug("exclusive availability:"+exclusiveAvailability);
return exclusiveAvailability;
} | @SuppressWarnings(STR) static double function(Set<BackendService> storageServiceCombination, Set<BackendService> superSet) { double exclusiveAvailability = 0, availability = 0, unavailability = 0; availability = getAvailabilityOfCombination(storageServiceCombination); log.debug(STR+availability); unavailability = getUnavailabilityOfCombination( new HashSet<BackendService>(CollectionUtils.disjunction(superSet, storageServiceCombination)) ); exclusiveAvailability = availability; if(unavailability != 0){ exclusiveAvailability = availability * unavailability; } log.debug(STR+exclusiveAvailability); return exclusiveAvailability; } | /**
* Get probability of only the storageServiceCombination being available while no other storage in superSet is available
* @param storageServiceCombination subset superSet
* @param superSet combination of front end storage services
* @return probability for the storageServiceCombination being available exclusively
*/ | Get probability of only the storageServiceCombination being available while no other storage in superSet is available | getExclusiveAvailabilityOfStorageCombination | {
"repo_name": "joe42/nubisave",
"path": "splitter/src/com/github/joe42/splitter/backend/BackendServices.java",
"license": "gpl-3.0",
"size": 8684
} | [
"java.util.HashSet",
"java.util.Set",
"org.apache.commons.collections.CollectionUtils"
] | import java.util.HashSet; import java.util.Set; import org.apache.commons.collections.CollectionUtils; | import java.util.*; import org.apache.commons.collections.*; | [
"java.util",
"org.apache.commons"
] | java.util; org.apache.commons; | 1,580,635 |
@Override
public void run() {
long startTimeNs = SystemClock.elapsedRealtimeNanos();
String testName = getTestClassName();
GnssTestDetails testDetails;
try {
testDetails = new GnssTestDetails(testName, GnssTestDetails.ResultCode.PASS);
} catch (Throwable e) {
testDetails = new GnssTestDetails(testName, "DeactivateFeatures", e);
}
GnssTestDetails.ResultCode resultCode = testDetails.getResultCode();
if (resultCode == GnssTestDetails.ResultCode.SKIPPED) {
// this is an invalid state at this point of the test setup
throw new IllegalStateException("Deactivation of features cannot skip the test.");
}
if (resultCode == GnssTestDetails.ResultCode.PASS) {
testDetails = executeActivityTests(testName);
}
// This set the test UI so the operator can report the result of the test
updateResult(testDetails);
}
protected void activitySetUp() throws Throwable {} | void function() { long startTimeNs = SystemClock.elapsedRealtimeNanos(); String testName = getTestClassName(); GnssTestDetails testDetails; try { testDetails = new GnssTestDetails(testName, GnssTestDetails.ResultCode.PASS); } catch (Throwable e) { testDetails = new GnssTestDetails(testName, STR, e); } GnssTestDetails.ResultCode resultCode = testDetails.getResultCode(); if (resultCode == GnssTestDetails.ResultCode.SKIPPED) { throw new IllegalStateException(STR); } if (resultCode == GnssTestDetails.ResultCode.PASS) { testDetails = executeActivityTests(testName); } updateResult(testDetails); } protected void activitySetUp() throws Throwable {} | /**
* The main execution {@link Thread}.
*
* This function executes in a background thread, allowing the test run freely behind the
* scenes. It provides the following execution hooks:
* - Activity SetUp/CleanUp (not available in JUnit)
* - executeTests: to implement several execution engines
*/ | The main execution <code>Thread</code>. This function executes in a background thread, allowing the test run freely behind the scenes. It provides the following execution hooks: - Activity SetUp/CleanUp (not available in JUnit) - executeTests: to implement several execution engines | run | {
"repo_name": "wiki2014/Learning-Summary",
"path": "alps/cts/apps/CtsVerifier/src/com/android/cts/verifier/location/base/BaseGnssTestActivity.java",
"license": "gpl-3.0",
"size": 15232
} | [
"android.os.SystemClock",
"com.android.cts.verifier.location.reporting.GnssTestDetails"
] | import android.os.SystemClock; import com.android.cts.verifier.location.reporting.GnssTestDetails; | import android.os.*; import com.android.cts.verifier.location.reporting.*; | [
"android.os",
"com.android.cts"
] | android.os; com.android.cts; | 1,460,409 |
private static SpeechletResponse makeSimpleAskResponse(final String speechText) {
SimpleCard card = new SimpleCard();
card.setTitle(Constants.APP_NAME);
card.setContent(speechText);
final SsmlOutputSpeech speech = new SsmlOutputSpeech();
speech.setSsml(String.format("<speak>%s</speak>", speechText));
Reprompt reprompt = new Reprompt();
reprompt.setOutputSpeech(speech);
return SpeechletResponse.newAskResponse(speech, reprompt, card);
} | static SpeechletResponse function(final String speechText) { SimpleCard card = new SimpleCard(); card.setTitle(Constants.APP_NAME); card.setContent(speechText); final SsmlOutputSpeech speech = new SsmlOutputSpeech(); speech.setSsml(String.format(STR, speechText)); Reprompt reprompt = new Reprompt(); reprompt.setOutputSpeech(speech); return SpeechletResponse.newAskResponse(speech, reprompt, card); } | /**
* simple static method to a basic ask response, using the same speech text throughout
* @param speechText
* @return
*/ | simple static method to a basic ask response, using the same speech text throughout | makeSimpleAskResponse | {
"repo_name": "strugglingcomic/CeruleanSmock",
"path": "cerulean-smock-alexa-skill/src/main/java/ceruleansmock/BaseCookBookSpeechlet.java",
"license": "mit",
"size": 14954
} | [
"com.amazon.speech.speechlet.SpeechletResponse",
"com.amazon.speech.ui.Reprompt",
"com.amazon.speech.ui.SimpleCard",
"com.amazon.speech.ui.SsmlOutputSpeech"
] | import com.amazon.speech.speechlet.SpeechletResponse; import com.amazon.speech.ui.Reprompt; import com.amazon.speech.ui.SimpleCard; import com.amazon.speech.ui.SsmlOutputSpeech; | import com.amazon.speech.speechlet.*; import com.amazon.speech.ui.*; | [
"com.amazon.speech"
] | com.amazon.speech; | 1,877,952 |
void renameCollection(ClientSession clientSession, MongoNamespace newCollectionNamespace,
RenameCollectionOptions renameCollectionOptions); | void renameCollection(ClientSession clientSession, MongoNamespace newCollectionNamespace, RenameCollectionOptions renameCollectionOptions); | /**
* Rename the collection with oldCollectionName to the newCollectionName.
*
* @param clientSession the client session with which to associate this operation
* @param newCollectionNamespace the name the collection will be renamed to
* @param renameCollectionOptions the options for renaming a collection
* @throws com.mongodb.MongoServerException if you provide a newCollectionName that is the name of an existing collection and dropTarget
* is false, or if the oldCollectionName is the name of a collection that doesn't exist
* @since 3.6
* @mongodb.server.release 3.6
* @mongodb.driver.manual reference/command/renameCollection Rename collection
*/ | Rename the collection with oldCollectionName to the newCollectionName | renameCollection | {
"repo_name": "rozza/mongo-java-driver",
"path": "driver-sync/src/main/com/mongodb/client/MongoCollection.java",
"license": "apache-2.0",
"size": 102106
} | [
"com.mongodb.MongoNamespace",
"com.mongodb.client.model.RenameCollectionOptions"
] | import com.mongodb.MongoNamespace; import com.mongodb.client.model.RenameCollectionOptions; | import com.mongodb.*; import com.mongodb.client.model.*; | [
"com.mongodb",
"com.mongodb.client"
] | com.mongodb; com.mongodb.client; | 1,841,060 |
@Test
@SmallTest
public void testOnDemandAccessibilityEventsUMARecorded_100Percent() throws Throwable {
// Build a simple web page with a few nodes to traverse.
setupTestWithHTML("<p>This is a test 1</p>\n"
+ "<p>This is a test 2</p>\n"
+ "<p>This is a test 3</p>");
// Set the relevant events type masks to be empty so no events are dispatched.
mActivityTestRule.mWcax.setEventTypeMaskEmptyForTesting();
// Find the three text nodes.
int vvId1 = waitForNodeMatching(sTextMatcher, "This is a test 1");
int vvId2 = waitForNodeMatching(sTextMatcher, "This is a test 2");
int vvId3 = waitForNodeMatching(sTextMatcher, "This is a test 3");
AccessibilityNodeInfo mNodeInfo1 = createAccessibilityNodeInfo(vvId1);
AccessibilityNodeInfo mNodeInfo2 = createAccessibilityNodeInfo(vvId2);
AccessibilityNodeInfo mNodeInfo3 = createAccessibilityNodeInfo(vvId3);
Assert.assertNotNull(NODE_TIMEOUT_ERROR, mNodeInfo1);
Assert.assertNotNull(NODE_TIMEOUT_ERROR, mNodeInfo2);
Assert.assertNotNull(NODE_TIMEOUT_ERROR, mNodeInfo3);
// Focus each node in turn to generate events.
focusNode(vvId1);
focusNode(vvId2);
focusNode(vvId3);
// Signal end of test.
mActivityTestRule.sendEndOfTestSignal();
// Force recording of UMA histograms.
mActivityTestRule.mWcax.forceRecordUMAHistogramsForTesting();
// Verify results were recorded in histograms.
Assert.assertEquals(ONDEMAND_HISTOGRAM_ERROR, 1,
RecordHistogram.getHistogramTotalCountForTesting(PERCENTAGE_DROPPED_HISTOGRAM));
Assert.assertEquals(ONDEMAND_HISTOGRAM_ERROR, 1,
RecordHistogram.getHistogramTotalCountForTesting(EVENTS_DROPPED_HISTOGRAM));
Assert.assertEquals(ONDEMAND_HISTOGRAM_ERROR, 1,
RecordHistogram.getHistogramTotalCountForTesting(ONE_HUNDRED_PERCENT_HISTOGRAM));
} | void function() throws Throwable { setupTestWithHTML(STR + STR + STR); mActivityTestRule.mWcax.setEventTypeMaskEmptyForTesting(); int vvId1 = waitForNodeMatching(sTextMatcher, STR); int vvId2 = waitForNodeMatching(sTextMatcher, STR); int vvId3 = waitForNodeMatching(sTextMatcher, STR); AccessibilityNodeInfo mNodeInfo1 = createAccessibilityNodeInfo(vvId1); AccessibilityNodeInfo mNodeInfo2 = createAccessibilityNodeInfo(vvId2); AccessibilityNodeInfo mNodeInfo3 = createAccessibilityNodeInfo(vvId3); Assert.assertNotNull(NODE_TIMEOUT_ERROR, mNodeInfo1); Assert.assertNotNull(NODE_TIMEOUT_ERROR, mNodeInfo2); Assert.assertNotNull(NODE_TIMEOUT_ERROR, mNodeInfo3); focusNode(vvId1); focusNode(vvId2); focusNode(vvId3); mActivityTestRule.sendEndOfTestSignal(); mActivityTestRule.mWcax.forceRecordUMAHistogramsForTesting(); Assert.assertEquals(ONDEMAND_HISTOGRAM_ERROR, 1, RecordHistogram.getHistogramTotalCountForTesting(PERCENTAGE_DROPPED_HISTOGRAM)); Assert.assertEquals(ONDEMAND_HISTOGRAM_ERROR, 1, RecordHistogram.getHistogramTotalCountForTesting(EVENTS_DROPPED_HISTOGRAM)); Assert.assertEquals(ONDEMAND_HISTOGRAM_ERROR, 1, RecordHistogram.getHistogramTotalCountForTesting(ONE_HUNDRED_PERCENT_HISTOGRAM)); } | /**
* Test that UMA histogram for 100% events dropped is recorded for the OnDemand AT feature.
*/ | Test that UMA histogram for 100% events dropped is recorded for the OnDemand AT feature | testOnDemandAccessibilityEventsUMARecorded_100Percent | {
"repo_name": "ric2b/Vivaldi-browser",
"path": "chromium/content/public/android/javatests/src/org/chromium/content/browser/accessibility/WebContentsAccessibilityTest.java",
"license": "bsd-3-clause",
"size": 108058
} | [
"android.view.accessibility.AccessibilityNodeInfo",
"org.chromium.base.metrics.RecordHistogram",
"org.junit.Assert"
] | import android.view.accessibility.AccessibilityNodeInfo; import org.chromium.base.metrics.RecordHistogram; import org.junit.Assert; | import android.view.accessibility.*; import org.chromium.base.metrics.*; import org.junit.*; | [
"android.view",
"org.chromium.base",
"org.junit"
] | android.view; org.chromium.base; org.junit; | 346,154 |
public RemoveRandomReturn removeRandom(RandomGrabArrayItemExclusionList excluding, ObjectContainer container, ClientContext context, long now); | RemoveRandomReturn function(RandomGrabArrayItemExclusionList excluding, ObjectContainer container, ClientContext context, long now); | /** Return a random RandomGrabArrayItem, or a time at which there will be one, or null
* if the RGA is empty and should be removed by the parent. */ | Return a random RandomGrabArrayItem, or a time at which there will be one, or null | removeRandom | {
"repo_name": "saces/fred",
"path": "src/freenet/support/RemoveRandom.java",
"license": "gpl-2.0",
"size": 1422
} | [
"com.db4o.ObjectContainer"
] | import com.db4o.ObjectContainer; | import com.db4o.*; | [
"com.db4o"
] | com.db4o; | 80,537 |
public PdfIndirectObject addToBody(PdfObject object, int refNumber) throws IOException {
PdfIndirectObject iobj = body.add(object, refNumber);
return iobj;
} | PdfIndirectObject function(PdfObject object, int refNumber) throws IOException { PdfIndirectObject iobj = body.add(object, refNumber); return iobj; } | /**
* Use this method to add a PDF object to the PDF body.
* Use this method only if you know what you're doing!
* @param object
* @param refNumber
* @return a PdfIndirectObject
* @throws IOException
*/ | Use this method to add a PDF object to the PDF body. Use this method only if you know what you're doing | addToBody | {
"repo_name": "bullda/DroidText",
"path": "src/core/com/lowagie/text/pdf/PdfWriter.java",
"license": "lgpl-3.0",
"size": 118678
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 2,891,575 |
public void doRemoveWorkFlowResourceByListId( List<Integer> lListIdResource, String strResourceType, Integer nIdWorflow )
{
if ( isAvailable( ) )
{
TransactionManager.beginTransaction( null );
try
{
_service.doRemoveWorkFlowResourceByListId( lListIdResource, strResourceType, nIdWorflow );
TransactionManager.commitTransaction( null );
}
catch( Exception e )
{
TransactionManager.rollBack( null );
throw new AppException( e.getMessage( ), e );
}
}
} | void function( List<Integer> lListIdResource, String strResourceType, Integer nIdWorflow ) { if ( isAvailable( ) ) { TransactionManager.beginTransaction( null ); try { _service.doRemoveWorkFlowResourceByListId( lListIdResource, strResourceType, nIdWorflow ); TransactionManager.commitTransaction( null ); } catch( Exception e ) { TransactionManager.rollBack( null ); throw new AppException( e.getMessage( ), e ); } } } | /**
* Remove list of resource workflow by list id
*
* @param lListIdResource
* list of id resource
* @param strResourceType
* the ressource type
* @param nIdWorflow
* the workflow id
*/ | Remove list of resource workflow by list id | doRemoveWorkFlowResourceByListId | {
"repo_name": "lutece-platform/lutece-core",
"path": "src/java/fr/paris/lutece/portal/service/workflow/WorkflowService.java",
"license": "bsd-3-clause",
"size": 36553
} | [
"fr.paris.lutece.portal.service.util.AppException",
"fr.paris.lutece.util.sql.TransactionManager",
"java.util.List"
] | import fr.paris.lutece.portal.service.util.AppException; import fr.paris.lutece.util.sql.TransactionManager; import java.util.List; | import fr.paris.lutece.portal.service.util.*; import fr.paris.lutece.util.sql.*; import java.util.*; | [
"fr.paris.lutece",
"java.util"
] | fr.paris.lutece; java.util; | 117,192 |
super.paint(g);
int selectionCount =
Globals.curEditor().getSelectionManager().getSelections().size();
if (selectionCount == 1) {
FigEdge edge = (FigEdge) getContent();
if (edge instanceof Clarifiable) {
((Clarifiable) edge).paintClarifiers(g);
}
for (PathItemPlacementStrategy strategy
: edge.getPathItemStrategies()) {
strategy.paint(g);
}
}
}
| super.paint(g); int selectionCount = Globals.curEditor().getSelectionManager().getSelections().size(); if (selectionCount == 1) { FigEdge edge = (FigEdge) getContent(); if (edge instanceof Clarifiable) { ((Clarifiable) edge).paintClarifiers(g); } for (PathItemPlacementStrategy strategy : edge.getPathItemStrategies()) { strategy.paint(g); } } } | /**
* This extends the standard selection painting to also highlight
* the editable text labels and their placement strategies should
* there be only one selected item.
*
* @see org.tigris.gef.base.Selection#paint(java.awt.Graphics)
* @param g the graphics object
*/ | This extends the standard selection painting to also highlight the editable text labels and their placement strategies should there be only one selected item | paint | {
"repo_name": "ckaestne/LEADT",
"path": "workspace/argouml_critics/argouml-app/src/org/argouml/uml/diagram/ui/SelectionEdgeClarifiers.java",
"license": "gpl-3.0",
"size": 3073
} | [
"org.tigris.gef.base.Globals",
"org.tigris.gef.base.PathItemPlacementStrategy",
"org.tigris.gef.presentation.FigEdge"
] | import org.tigris.gef.base.Globals; import org.tigris.gef.base.PathItemPlacementStrategy; import org.tigris.gef.presentation.FigEdge; | import org.tigris.gef.base.*; import org.tigris.gef.presentation.*; | [
"org.tigris.gef"
] | org.tigris.gef; | 505,664 |
private List<GridCacheEntryEx> lockEntries(Collection<? extends K> keys) {
List<GridCacheEntryEx> locked = new ArrayList<>(keys.size());
boolean nullKeys = false;
while (true) {
for (K key : keys) {
if (key == null) {
nullKeys = true;
break;
}
GridCacheEntryEx entry = entryEx(ctx.toCacheKeyObject(key));
locked.add(entry);
}
if (nullKeys)
break;
for (int i = 0; i < locked.size(); i++) {
GridCacheEntryEx entry = locked.get(i);
GridUnsafe.monitorEnter(entry);
if (entry.obsolete()) {
// Unlock all locked.
for (int j = 0; j <= i; j++)
GridUnsafe.monitorExit(locked.get(j));
// Clear entries.
locked.clear();
// Retry.
break;
}
}
if (!locked.isEmpty())
return locked;
}
assert nullKeys;
AffinityTopologyVersion topVer = ctx.affinity().affinityTopologyVersion();
for (GridCacheEntryEx entry : locked)
ctx.evicts().touch(entry, topVer);
throw new NullPointerException("Null key.");
} | List<GridCacheEntryEx> function(Collection<? extends K> keys) { List<GridCacheEntryEx> locked = new ArrayList<>(keys.size()); boolean nullKeys = false; while (true) { for (K key : keys) { if (key == null) { nullKeys = true; break; } GridCacheEntryEx entry = entryEx(ctx.toCacheKeyObject(key)); locked.add(entry); } if (nullKeys) break; for (int i = 0; i < locked.size(); i++) { GridCacheEntryEx entry = locked.get(i); GridUnsafe.monitorEnter(entry); if (entry.obsolete()) { for (int j = 0; j <= i; j++) GridUnsafe.monitorExit(locked.get(j)); locked.clear(); break; } } if (!locked.isEmpty()) return locked; } assert nullKeys; AffinityTopologyVersion topVer = ctx.affinity().affinityTopologyVersion(); for (GridCacheEntryEx entry : locked) ctx.evicts().touch(entry, topVer); throw new NullPointerException(STR); } | /**
* Acquires java-level locks on cache entries.
*
* @param keys Keys to lock.
* @return Collection of locked entries.
*/ | Acquires java-level locks on cache entries | lockEntries | {
"repo_name": "mcherkasov/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java",
"license": "apache-2.0",
"size": 53663
} | [
"java.util.ArrayList",
"java.util.Collection",
"java.util.List",
"org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion",
"org.apache.ignite.internal.processors.cache.GridCacheEntryEx",
"org.apache.ignite.internal.util.GridUnsafe"
] | import java.util.ArrayList; import java.util.Collection; import java.util.List; import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion; import org.apache.ignite.internal.processors.cache.GridCacheEntryEx; import org.apache.ignite.internal.util.GridUnsafe; | import java.util.*; import org.apache.ignite.internal.processors.affinity.*; import org.apache.ignite.internal.processors.cache.*; import org.apache.ignite.internal.util.*; | [
"java.util",
"org.apache.ignite"
] | java.util; org.apache.ignite; | 2,196,412 |
@Test
@Ignore
public void testRejectSchemaRenameWithDeps() throws Exception
{
try
{
connection.rename( "cn=nis,ou=schema", "cn=foo" );
fail( "should not be able to rename nis which has samba as it's dependent" );
}
catch ( LdapException onse )
{
// expected
}
assertNotNull( connection.lookup( "cn=nis,ou=schema" ) );
//noinspection EmptyCatchBlock
try
{
connection.lookup( "cn=foo,ou=schema" );
fail( "the foo schema should not be present after rejecting the rename" );
}
catch ( LdapException e )
{
}
} | void function() throws Exception { try { connection.rename( STR, STR ); fail( STR ); } catch ( LdapException onse ) { } assertNotNull( connection.lookup( STR ) ); try { connection.lookup( STR ); fail( STR ); } catch ( LdapException e ) { } } | /**
* Makes sure we can NOT change the name of a schema that has dependents.
* Will use the nis schema which comes out of the box and has samba as
* it's dependent.
*
* @throws Exception on error
*/ | Makes sure we can NOT change the name of a schema that has dependents. Will use the nis schema which comes out of the box and has samba as it's dependent | testRejectSchemaRenameWithDeps | {
"repo_name": "drankye/directory-server",
"path": "core-integ/src/test/java/org/apache/directory/server/core/schema/MetaSchemaHandlerIT.java",
"license": "apache-2.0",
"size": 34369
} | [
"org.apache.directory.api.ldap.model.exception.LdapException",
"org.junit.Assert"
] | import org.apache.directory.api.ldap.model.exception.LdapException; import org.junit.Assert; | import org.apache.directory.api.ldap.model.exception.*; import org.junit.*; | [
"org.apache.directory",
"org.junit"
] | org.apache.directory; org.junit; | 2,661,123 |
public MiniSatStyleSolver underlyingSolver() {
return this.solver;
} | MiniSatStyleSolver function() { return this.solver; } | /**
* Returns the underlying core solver.
* <p>
* ATTENTION: by influencing the underlying solver directly, you can mess things up completely! You should really
* know, what you are doing.
* @return the underlying core solver
*/ | Returns the underlying core solver. know, what you are doing | underlyingSolver | {
"repo_name": "logic-ng/LogicNG",
"path": "src/main/java/org/logicng/solvers/MiniSat.java",
"license": "apache-2.0",
"size": 19668
} | [
"org.logicng.solvers.sat.MiniSatStyleSolver"
] | import org.logicng.solvers.sat.MiniSatStyleSolver; | import org.logicng.solvers.sat.*; | [
"org.logicng.solvers"
] | org.logicng.solvers; | 2,557,542 |
void onScroll(int absoluteScroll);
}
static class SavedState extends BaseSavedState {
Bundle mState;
public SavedState(Parcelable superState) {
super(superState);
}
public SavedState(Parcel in) {
super(in);
mState = in.readBundle();
} | void onScroll(int absoluteScroll); } static class SavedState extends BaseSavedState { Bundle mState; public SavedState(Parcelable superState) { super(superState); } public SavedState(Parcel in) { super(in); mState = in.readBundle(); } | /**
* Callback method to be invoked when the layer has been scrolled. This will be
* called after the scroll has completed
*
* @param absoluteScroll The absolute scrolling delta relative to the position of the container
*/ | Callback method to be invoked when the layer has been scrolled. This will be called after the scroll has completed | onScroll | {
"repo_name": "juliaodynak/Kv-009",
"path": "LibrarySlidingLayer/src/main/java/com/wunderlist/slidinglayer/SlidingLayer.java",
"license": "gpl-2.0",
"size": 48684
} | [
"android.os.Bundle",
"android.os.Parcel",
"android.os.Parcelable"
] | import android.os.Bundle; import android.os.Parcel; import android.os.Parcelable; | import android.os.*; | [
"android.os"
] | android.os; | 1,405,340 |
public static void doReleaseSession(@Nullable Session ses, @Nullable ContentSource contentSource) throws XccException {
if (ses == null) {
return;
}
if (contentSource != null) {
SessionHolder sesHolder = (SessionHolder) TransactionSynchronizationManager.getResource(contentSource);
if (sesHolder != null && sessionEquals(sesHolder, ses)) {
// It's the transactional Session: Don't close it.
sesHolder.released();
return;
}
}
logger.debug("Returning XDBC Session to ContentSource");
doCloseSession(ses, contentSource);
} | static void function(@Nullable Session ses, @Nullable ContentSource contentSource) throws XccException { if (ses == null) { return; } if (contentSource != null) { SessionHolder sesHolder = (SessionHolder) TransactionSynchronizationManager.getResource(contentSource); if (sesHolder != null && sessionEquals(sesHolder, ses)) { sesHolder.released(); return; } } logger.debug(STR); doCloseSession(ses, contentSource); } | /**
* Actually close the given Session, obtained from the given ContentSource.
* Same as {@link #releaseSession}, but throwing the original XccException.
* <p>Directly accessed by {@link TransactionAwareContentSourceProxy}.
* @param ses the Session to close if necessary
* (if this is {@code null}, the call will be ignored)
* @param contentSource the ContentSource that the Session was obtained from
* (may be {@code null})
* @throws XccException if thrown by XDBC methods
* @see #doGetSession
*/ | Actually close the given Session, obtained from the given ContentSource. Same as <code>#releaseSession</code>, but throwing the original XccException. Directly accessed by <code>TransactionAwareContentSourceProxy</code> | doReleaseSession | {
"repo_name": "stoussaint/spring-data-marklogic",
"path": "src/main/java/com/_4dconcept/springframework/data/marklogic/datasource/ContentSourceUtils.java",
"license": "apache-2.0",
"size": 19626
} | [
"com.marklogic.xcc.ContentSource",
"com.marklogic.xcc.Session",
"com.marklogic.xcc.exceptions.XccException",
"org.springframework.lang.Nullable",
"org.springframework.transaction.support.TransactionSynchronizationManager"
] | import com.marklogic.xcc.ContentSource; import com.marklogic.xcc.Session; import com.marklogic.xcc.exceptions.XccException; import org.springframework.lang.Nullable; import org.springframework.transaction.support.TransactionSynchronizationManager; | import com.marklogic.xcc.*; import com.marklogic.xcc.exceptions.*; import org.springframework.lang.*; import org.springframework.transaction.support.*; | [
"com.marklogic.xcc",
"org.springframework.lang",
"org.springframework.transaction"
] | com.marklogic.xcc; org.springframework.lang; org.springframework.transaction; | 2,026,564 |
void importNewObject(@Unretained(ENTRY_EVENT_NEW_VALUE) Object nv, boolean isSerialized); | void importNewObject(@Unretained(ENTRY_EVENT_NEW_VALUE) Object nv, boolean isSerialized); | /**
* Import a new value that is currently in object form.
*
* @param nv the new value to import; unretained if isUnretainedNewReferenceOk returns true
* @param isSerialized true if the imported new value represents data that needs to be
* serialized; false if the imported new value is a simple sequence of bytes.
*/ | Import a new value that is currently in object form | importNewObject | {
"repo_name": "davebarnes97/geode",
"path": "geode-core/src/main/java/org/apache/geode/internal/cache/EntryEventImpl.java",
"license": "apache-2.0",
"size": 99239
} | [
"org.apache.geode.internal.offheap.annotations.Unretained"
] | import org.apache.geode.internal.offheap.annotations.Unretained; | import org.apache.geode.internal.offheap.annotations.*; | [
"org.apache.geode"
] | org.apache.geode; | 67,299 |
public static void showAlert(Activity activity, int titleResId, int msgResId,
int positiveText, DialogInterface.OnClickListener positiveListener) {
AlertDialog dialog = buildAlert(activity, titleResId, msgResId,
positiveText, positiveListener, 0, null, 0, null);
dialog.show();
} | static void function(Activity activity, int titleResId, int msgResId, int positiveText, DialogInterface.OnClickListener positiveListener) { AlertDialog dialog = buildAlert(activity, titleResId, msgResId, positiveText, positiveListener, 0, null, 0, null); dialog.show(); } | /**
* Build an AlertDialog
* @param activity The current activity
* @param titleResId Resource id of title
* @param msgResId Resource id of message
* @param positiveText Resource id of positive button text
* @param positiveListener Positive button listener
*/ | Build an AlertDialog | showAlert | {
"repo_name": "ibuttimer/moviequest",
"path": "app/src/main/java/ie/ianbuttimer/moviequest/utils/Dialog.java",
"license": "gpl-3.0",
"size": 10271
} | [
"android.app.Activity",
"android.content.DialogInterface",
"android.support.v7.app.AlertDialog"
] | import android.app.Activity; import android.content.DialogInterface; import android.support.v7.app.AlertDialog; | import android.app.*; import android.content.*; import android.support.v7.app.*; | [
"android.app",
"android.content",
"android.support"
] | android.app; android.content; android.support; | 2,142,807 |
public static void getBlockLocations(String source, Configuration conf ) throws IOException{
FileSystem fileSystem = FileSystem.get(conf);
Path srcPath = new Path(source);
// Check if the file already exists
// Get the filename out of the file path
String filename = source.substring(source.lastIndexOf('/') + 1, source.length());
FileStatus fileStatus = fileSystem.getFileStatus(srcPath);
System.out.println("File :" + fileStatus.toString() );
BlockLocation[] blkLocations = fileSystem.getFileBlockLocations(fileStatus, 0, fileStatus.getLen());
int blkCount = blkLocations.length;
System.out.println("Length "+ blkLocations[0].toString() + " blk count "+ blkCount);
System.out.println("File :" + filename);
for (int i=0; i < blkCount; i++) {
String[] hosts = blkLocations[i].getHosts();
System.out.format("Host %s: %s %n", hosts[i], blkLocations[0].toString());
}
String[ ] names = blkLocations[0].getNames();
int namesCount = names.length;
for (int j=0; j < namesCount; j++){
System.out.println(names[j]);
}
String[ ] topology = blkLocations[0].getTopologyPaths();
int topCount = topology.length;
for (int j=0; j < topCount; j++){
System.out.println(topology[j]);
}
System.out.println("Offset: " + blkLocations[0].getOffset());
System.out.println("Length: " + blkLocations[0].getLength());
} | static void function(String source, Configuration conf ) throws IOException{ FileSystem fileSystem = FileSystem.get(conf); Path srcPath = new Path(source); String filename = source.substring(source.lastIndexOf('/') + 1, source.length()); FileStatus fileStatus = fileSystem.getFileStatus(srcPath); System.out.println(STR + fileStatus.toString() ); BlockLocation[] blkLocations = fileSystem.getFileBlockLocations(fileStatus, 0, fileStatus.getLen()); int blkCount = blkLocations.length; System.out.println(STR+ blkLocations[0].toString() + STR+ blkCount); System.out.println(STR + filename); for (int i=0; i < blkCount; i++) { String[] hosts = blkLocations[i].getHosts(); System.out.format(STR, hosts[i], blkLocations[0].toString()); } String[ ] names = blkLocations[0].getNames(); int namesCount = names.length; for (int j=0; j < namesCount; j++){ System.out.println(names[j]); } String[ ] topology = blkLocations[0].getTopologyPaths(); int topCount = topology.length; for (int j=0; j < topCount; j++){ System.out.println(topology[j]); } System.out.println(STR + blkLocations[0].getOffset()); System.out.println(STR + blkLocations[0].getLength()); } | /***
* Get the block location
*
*/ | Get the block location | getBlockLocations | {
"repo_name": "bikash/PDHC",
"path": "src/org/apache/hadoop/TD/SecureDelete.java",
"license": "apache-2.0",
"size": 10048
} | [
"java.io.IOException",
"org.apache.hadoop.conf.Configuration",
"org.apache.hadoop.fs.BlockLocation",
"org.apache.hadoop.fs.FileStatus",
"org.apache.hadoop.fs.FileSystem",
"org.apache.hadoop.fs.Path"
] | import java.io.IOException; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.BlockLocation; import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; | import java.io.*; import org.apache.hadoop.conf.*; import org.apache.hadoop.fs.*; | [
"java.io",
"org.apache.hadoop"
] | java.io; org.apache.hadoop; | 1,858,032 |
public static synchronized int update(Class<?> modelClass, ContentValues values, long id) {
UpdateHandler updateHandler = new UpdateHandler(Connector.getDatabase());
return updateHandler.onUpdate(modelClass, id, values);
} | static synchronized int function(Class<?> modelClass, ContentValues values, long id) { UpdateHandler updateHandler = new UpdateHandler(Connector.getDatabase()); return updateHandler.onUpdate(modelClass, id, values); } | /**
* Updates the corresponding record by id with ContentValues. Returns the
* number of affected rows.
*
* <pre>
* ContentValues cv = new ContentValues();
* cv.put("name", "Jim");
* DataSupport.update(Person.class, cv, 1);
* </pre>
*
* This means that the name of record 1 will be updated into Jim.<br>
*
* @param modelClass
* Which table to update by class.
* @param values
* A map from column names to new column values. null is a valid
* value that will be translated to NULL.
* @param id
* Which record to update.
* @return The number of rows affected.
*/ | Updates the corresponding record by id with ContentValues. Returns the number of affected rows. <code> ContentValues cv = new ContentValues(); cv.put("name", "Jim"); DataSupport.update(Person.class, cv, 1); </code> This means that the name of record 1 will be updated into Jim | update | {
"repo_name": "stepway/LitePal",
"path": "litepal/src/main/java/org/litepal/crud/DataSupport.java",
"license": "apache-2.0",
"size": 44405
} | [
"android.content.ContentValues",
"org.litepal.tablemanager.Connector"
] | import android.content.ContentValues; import org.litepal.tablemanager.Connector; | import android.content.*; import org.litepal.tablemanager.*; | [
"android.content",
"org.litepal.tablemanager"
] | android.content; org.litepal.tablemanager; | 997,394 |
private void recordUnpairedResult(Failure failure, ResultType resultType) {
long runtime = System.currentTimeMillis() - startTime;
Description description = failure.getDescription();
results.add(
new TestResult(
description.getClassName(),
description.getMethodName(),
runtime,
resultType,
failure.getException(),
null,
null));
} | void function(Failure failure, ResultType resultType) { long runtime = System.currentTimeMillis() - startTime; Description description = failure.getDescription(); results.add( new TestResult( description.getClassName(), description.getMethodName(), runtime, resultType, failure.getException(), null, null)); } | /**
* It's possible to encounter a Failure/Skip before we've started any tests (and therefore
* before testStarted() has been called). The known example is a @BeforeClass that throws an
* exception, but there may be others.
*
* <p>Recording these unexpected failures helps us propagate failures back up to the "buck test"
* process.
*/ | It's possible to encounter a Failure/Skip before we've started any tests (and therefore before testStarted() has been called). The known example is a @BeforeClass that throws an exception, but there may be others. Recording these unexpected failures helps us propagate failures back up to the "buck test" process | recordUnpairedResult | {
"repo_name": "brettwooldridge/buck",
"path": "src/com/facebook/buck/testrunner/JUnitRunner.java",
"license": "apache-2.0",
"size": 19959
} | [
"com.facebook.buck.test.result.type.ResultType",
"org.junit.runner.Description",
"org.junit.runner.notification.Failure"
] | import com.facebook.buck.test.result.type.ResultType; import org.junit.runner.Description; import org.junit.runner.notification.Failure; | import com.facebook.buck.test.result.type.*; import org.junit.runner.*; import org.junit.runner.notification.*; | [
"com.facebook.buck",
"org.junit.runner"
] | com.facebook.buck; org.junit.runner; | 1,216,337 |
public static String asCommaDelimitedString(Collection<String> strings) {
StringBuilder sb = new StringBuilder();
for (String string : strings) {
if (sb.length() > 0) {
sb.append(COMMA_DELIMITER);
}
sb.append(string);
}
return sb.toString();
} | static String function(Collection<String> strings) { StringBuilder sb = new StringBuilder(); for (String string : strings) { if (sb.length() > 0) { sb.append(COMMA_DELIMITER); } sb.append(string); } return sb.toString(); } | /**
* Marshals a collection of strings to a single comma-delimited string.
* Returns null if collection is null or empty.
*/ | Marshals a collection of strings to a single comma-delimited string. Returns null if collection is null or empty | asCommaDelimitedString | {
"repo_name": "papicella/snappy-store",
"path": "gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/StartupMessageData.java",
"license": "apache-2.0",
"size": 6339
} | [
"java.util.Collection"
] | import java.util.Collection; | import java.util.*; | [
"java.util"
] | java.util; | 1,789,142 |
public boolean isAboveBeacon(Location loc) {
Point2D point = new Point2D.Double(loc.getBlockX(),loc.getBlockZ());
if (baseBlocks.containsKey(point)) {
BeaconObj beacon = baseBlocks.get(point);
// Check ownership
if (beacon.getOwnership() == null) {
return false;
}
// Check height - if block is lower than the beacon, then it's not a part of it
if (beacon.getY() > loc.getBlockY()) {
return false;
}
// It's a defense block
return true;
}
return false;
} | boolean function(Location loc) { Point2D point = new Point2D.Double(loc.getBlockX(),loc.getBlockZ()); if (baseBlocks.containsKey(point)) { BeaconObj beacon = baseBlocks.get(point); if (beacon.getOwnership() == null) { return false; } if (beacon.getY() > loc.getBlockY()) { return false; } return true; } return false; } | /**
* Check if this block is above an owned beacon or above a defense
* @param loc
* @return
*/ | Check if this block is above an owned beacon or above a defense | isAboveBeacon | {
"repo_name": "ebaldino/beaconz",
"path": "src/main/java/com/wasteofplastic/beaconz/Register.java",
"license": "mit",
"size": 49817
} | [
"java.awt.geom.Point2D",
"org.bukkit.Location"
] | import java.awt.geom.Point2D; import org.bukkit.Location; | import java.awt.geom.*; import org.bukkit.*; | [
"java.awt",
"org.bukkit"
] | java.awt; org.bukkit; | 1,948,273 |
public boolean isFinalAndApprovedThesis() {
return !getEvaluationMark().getValue().equals(GradeScale.RE);
} | boolean function() { return !getEvaluationMark().getValue().equals(GradeScale.RE); } | /**
* Same as the above but also ensures that the student had a positive grade.
*
* @return <code>true</code> if the student had a positive grade
*/ | Same as the above but also ensures that the student had a positive grade | isFinalAndApprovedThesis | {
"repo_name": "andre-nunes/fenixedu-academic",
"path": "src/main/java/org/fenixedu/academic/domain/thesis/Thesis.java",
"license": "lgpl-3.0",
"size": 56700
} | [
"org.fenixedu.academic.domain.GradeScale"
] | import org.fenixedu.academic.domain.GradeScale; | import org.fenixedu.academic.domain.*; | [
"org.fenixedu.academic"
] | org.fenixedu.academic; | 536,512 |
public T compareAndSetAndGet(final T newVal, final T expVal) {
checkRemoved();
try {
if (ctx.dataStructures().knownType(expVal) && ctx.dataStructures().knownType(newVal)) {
EntryProcessorResult<T> res =
atomicView.invoke(key, new ReferenceCompareAndSetAndGetEntryProcessor<T>(expVal, newVal));
assert res != null;
return res.get();
} | T function(final T newVal, final T expVal) { checkRemoved(); try { if (ctx.dataStructures().knownType(expVal) && ctx.dataStructures().knownType(newVal)) { EntryProcessorResult<T> res = atomicView.invoke(key, new ReferenceCompareAndSetAndGetEntryProcessor<T>(expVal, newVal)); assert res != null; return res.get(); } | /**
* Compares current value with specified value for equality and, if they are equal, replaces current value.
*
* @param newVal New value to set.
* @param expVal Expected value.
* @return Original value.
*/ | Compares current value with specified value for equality and, if they are equal, replaces current value | compareAndSetAndGet | {
"repo_name": "vadopolski/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicReferenceImpl.java",
"license": "apache-2.0",
"size": 16588
} | [
"javax.cache.processor.EntryProcessorResult"
] | import javax.cache.processor.EntryProcessorResult; | import javax.cache.processor.*; | [
"javax.cache"
] | javax.cache; | 721,606 |
public static void closeMessageProducer(MessageProducer producer) {
if (producer != null) {
try {
producer.close();
}
catch (JMSException ex) {
logger.trace("Could not close JMS MessageProducer", ex);
}
catch (Throwable ex) {
// We don't trust the JMS provider: It might throw RuntimeException or Error.
logger.trace("Unexpected exception on closing JMS MessageProducer", ex);
}
}
}
| static void function(MessageProducer producer) { if (producer != null) { try { producer.close(); } catch (JMSException ex) { logger.trace(STR, ex); } catch (Throwable ex) { logger.trace(STR, ex); } } } | /**
* Close the given JMS MessageProducer and ignore any thrown exception.
* This is useful for typical <code>finally</code> blocks in manual JMS code.
* @param producer the JMS MessageProducer to close (may be <code>null</code>)
*/ | Close the given JMS MessageProducer and ignore any thrown exception. This is useful for typical <code>finally</code> blocks in manual JMS code | closeMessageProducer | {
"repo_name": "codeApeFromChina/resource",
"path": "frame_packages/java_libs/spring-2.5.6-src/src/org/springframework/jms/support/JmsUtils.java",
"license": "unlicense",
"size": 11240
} | [
"javax.jms.JMSException",
"javax.jms.MessageProducer"
] | import javax.jms.JMSException; import javax.jms.MessageProducer; | import javax.jms.*; | [
"javax.jms"
] | javax.jms; | 599,315 |
public void doEdit_tool(RunData data, Context context)
{
SessionState state = ((JetspeedRunData) data).getPortletSessionState(((JetspeedRunData) data).getJs_peid());
state.setAttribute("mode", "editTool");
String id = data.getParameters().getString("id");
// get the tool
Site site = (Site) state.getAttribute("site");
SitePage page = (SitePage) state.getAttribute("page");
ToolConfiguration tool = page.getTool(id);
state.setAttribute("tool", tool);
} // doEdit_tool | void function(RunData data, Context context) { SessionState state = ((JetspeedRunData) data).getPortletSessionState(((JetspeedRunData) data).getJs_peid()); state.setAttribute("mode", STR); String id = data.getParameters().getString("id"); Site site = (Site) state.getAttribute("site"); SitePage page = (SitePage) state.getAttribute("page"); ToolConfiguration tool = page.getTool(id); state.setAttribute("tool", tool); } | /**
* Edit an existing tool.
*/ | Edit an existing tool | doEdit_tool | {
"repo_name": "kingmook/sakai",
"path": "site/site-tool/tool/src/java/org/sakaiproject/site/tool/AdminSitesAction.java",
"license": "apache-2.0",
"size": 77028
} | [
"org.sakaiproject.cheftool.Context",
"org.sakaiproject.cheftool.JetspeedRunData",
"org.sakaiproject.cheftool.RunData",
"org.sakaiproject.event.api.SessionState",
"org.sakaiproject.site.api.Site",
"org.sakaiproject.site.api.SitePage",
"org.sakaiproject.site.api.ToolConfiguration"
] | import org.sakaiproject.cheftool.Context; import org.sakaiproject.cheftool.JetspeedRunData; import org.sakaiproject.cheftool.RunData; import org.sakaiproject.event.api.SessionState; import org.sakaiproject.site.api.Site; import org.sakaiproject.site.api.SitePage; import org.sakaiproject.site.api.ToolConfiguration; | import org.sakaiproject.cheftool.*; import org.sakaiproject.event.api.*; import org.sakaiproject.site.api.*; | [
"org.sakaiproject.cheftool",
"org.sakaiproject.event",
"org.sakaiproject.site"
] | org.sakaiproject.cheftool; org.sakaiproject.event; org.sakaiproject.site; | 2,459,051 |
public static boolean fileExists(String filename) {
File file = new File(filename);
boolean b = true;
if (!file.exists()) {
LOGGER.error("File doesn't exits : " + filename);
b = false;
}
return b;
}
| static boolean function(String filename) { File file = new File(filename); boolean b = true; if (!file.exists()) { LOGGER.error(STR + filename); b = false; } return b; } | /**
* check to see if the filename or diectory exists
*
* @param filename
* @return
*/ | check to see if the filename or diectory exists | fileExists | {
"repo_name": "TreeBASE/treebasetest",
"path": "treebase-web/src/main/java/org/cipres/treebase/web/util/WebUtil.java",
"license": "bsd-3-clause",
"size": 7809
} | [
"java.io.File"
] | import java.io.File; | import java.io.*; | [
"java.io"
] | java.io; | 493,138 |
public static void exportToXML(HashMap names, Writer wrt, String encoding, boolean onlyASCII) throws IOException {
wrt.write("<?xml version=\"1.0\" encoding=\"");
wrt.write(SimpleXMLParser.escapeXML(encoding, onlyASCII));
wrt.write("\"?>\n<Destination>\n");
for (Iterator it = names.entrySet().iterator(); it.hasNext();) {
Map.Entry entry = (Map.Entry)it.next();
String key = (String)entry.getKey();
String value = (String)entry.getValue();
wrt.write(" <Name Page=\"");
wrt.write(SimpleXMLParser.escapeXML(value, onlyASCII));
wrt.write("\">");
wrt.write(SimpleXMLParser.escapeXML(escapeBinaryString(key), onlyASCII));
wrt.write("</Name>\n");
}
wrt.write("</Destination>\n");
wrt.flush();
} | static void function(HashMap names, Writer wrt, String encoding, boolean onlyASCII) throws IOException { wrt.write(STR1.0\STRSTR\STR); for (Iterator it = names.entrySet().iterator(); it.hasNext();) { Map.Entry entry = (Map.Entry)it.next(); String key = (String)entry.getKey(); String value = (String)entry.getValue(); wrt.write(STRSTR\">"); wrt.write(SimpleXMLParser.escapeXML(escapeBinaryString(key), onlyASCII)); wrt.write(STR); } wrt.write(STR); wrt.flush(); } | /**
* Exports the bookmarks to XML.
* @param names the names
* @param wrt the export destination. The writer is not closed
* @param encoding the encoding according to IANA conventions
* @param onlyASCII codes above 127 will always be escaped with &#nn; if <CODE>true</CODE>,
* whatever the encoding
* @throws IOException on error
*/ | Exports the bookmarks to XML | exportToXML | {
"repo_name": "MesquiteProject/MesquiteArchive",
"path": "trunk/Mesquite Project/LibrarySource/com/lowagie/text/pdf/SimpleNamedDestination.java",
"license": "lgpl-3.0",
"size": 12818
} | [
"java.io.IOException",
"java.io.Writer",
"java.util.HashMap",
"java.util.Iterator",
"java.util.Map"
] | import java.io.IOException; import java.io.Writer; import java.util.HashMap; import java.util.Iterator; import java.util.Map; | import java.io.*; import java.util.*; | [
"java.io",
"java.util"
] | java.io; java.util; | 2,235,171 |
public Predicate<StorageKey> toKeyPredicate() {
return new KeyPredicate(constraints);
} | Predicate<StorageKey> function() { return new KeyPredicate(constraints); } | /**
* Get a {@link Predicate} that tests {@link StorageKey} objects.
*
* If a {@code StorageKey} matches the predicate, it <em>may</em> represent a
* partition that is responsible for entities that match this set of
* constraints. If it does not match the predicate, it cannot be responsible
* for entities that match this constraint set.
*
* @return a Predicate for testing StorageKey objects
*/ | Get a <code>Predicate</code> that tests <code>StorageKey</code> objects. If a StorageKey matches the predicate, it may represent a partition that is responsible for entities that match this set of constraints. If it does not match the predicate, it cannot be responsible for entities that match this constraint set | toKeyPredicate | {
"repo_name": "grchanan/kite",
"path": "kite-data/kite-data-core/src/main/java/org/kitesdk/data/spi/Constraints.java",
"license": "apache-2.0",
"size": 22896
} | [
"com.google.common.base.Predicate"
] | import com.google.common.base.Predicate; | import com.google.common.base.*; | [
"com.google.common"
] | com.google.common; | 1,393,265 |
@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
public static final IntentsClient create(IntentsStub stub) {
return new IntentsClient(stub);
}
protected IntentsClient(IntentsSettings settings) throws IOException {
this.settings = settings;
this.stub = ((IntentsStubSettings) settings.getStubSettings()).createStub();
this.operationsClient = OperationsClient.create(this.stub.getOperationsStub());
}
@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
protected IntentsClient(IntentsStub stub) {
this.settings = null;
this.stub = stub;
this.operationsClient = OperationsClient.create(this.stub.getOperationsStub());
} | @BetaApi(STR) static final IntentsClient function(IntentsStub stub) { return new IntentsClient(stub); } protected IntentsClient(IntentsSettings settings) throws IOException { this.settings = settings; this.stub = ((IntentsStubSettings) settings.getStubSettings()).createStub(); this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); } @BetaApi(STR) protected IntentsClient(IntentsStub stub) { this.settings = null; this.stub = stub; this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); } | /**
* Constructs an instance of IntentsClient, using the given stub for making calls. This is for
* advanced usage - prefer to use IntentsSettings}.
*/ | Constructs an instance of IntentsClient, using the given stub for making calls. This is for advanced usage - prefer to use IntentsSettings} | create | {
"repo_name": "pongad/api-client-staging",
"path": "generated/java/gapic-google-cloud-dialogflow-v2beta1/src/main/java/com/google/cloud/dialogflow/v2beta1/IntentsClient.java",
"license": "bsd-3-clause",
"size": 46557
} | [
"com.google.api.core.BetaApi",
"com.google.cloud.dialogflow.v2beta1.stub.IntentsStub",
"com.google.cloud.dialogflow.v2beta1.stub.IntentsStubSettings",
"com.google.longrunning.OperationsClient",
"java.io.IOException"
] | import com.google.api.core.BetaApi; import com.google.cloud.dialogflow.v2beta1.stub.IntentsStub; import com.google.cloud.dialogflow.v2beta1.stub.IntentsStubSettings; import com.google.longrunning.OperationsClient; import java.io.IOException; | import com.google.api.core.*; import com.google.cloud.dialogflow.v2beta1.stub.*; import com.google.longrunning.*; import java.io.*; | [
"com.google.api",
"com.google.cloud",
"com.google.longrunning",
"java.io"
] | com.google.api; com.google.cloud; com.google.longrunning; java.io; | 1,111,648 |
public static ClassLoader resolveServerClassLoader(Map<String, ?> env,
MBeanServer mbs)
throws InstanceNotFoundException {
if (env == null)
return Thread.currentThread().getContextClassLoader();
Object loader = env.get(DEFAULT_CLASS_LOADER);
Object name = env.get(DEFAULT_CLASS_LOADER_NAME);
if (loader != null && name != null) {
final String msg = "Only one of " +
DEFAULT_CLASS_LOADER + " or " +
DEFAULT_CLASS_LOADER_NAME +
" should be specified.";
throw new IllegalArgumentException(msg);
}
if (loader == null && name == null)
return Thread.currentThread().getContextClassLoader();
if (loader != null) {
if (loader instanceof ClassLoader) {
return (ClassLoader) loader;
} else {
final String msg =
"ClassLoader object is not an instance of " +
ClassLoader.class.getName() + " : " +
loader.getClass().getName();
throw new IllegalArgumentException(msg);
}
}
ObjectName on;
if (name instanceof ObjectName) {
on = (ObjectName) name;
} else {
final String msg =
"ClassLoader name is not an instance of " +
ObjectName.class.getName() + " : " +
name.getClass().getName();
throw new IllegalArgumentException(msg);
}
if (mbs == null)
throw new IllegalArgumentException("Null MBeanServer object");
return mbs.getClassLoader(on);
}
/**
* Get the Connector Client default class loader.
* <p>
* Returns:
* <ul>
* <li>
* The ClassLoader object found in <var>env</var> for
* <code>jmx.remote.default.class.loader</code>, if any.
* </li>
* <li>The {@code Thread.currentThread().getContextClassLoader()} | static ClassLoader function(Map<String, ?> env, MBeanServer mbs) throws InstanceNotFoundException { if (env == null) return Thread.currentThread().getContextClassLoader(); Object loader = env.get(DEFAULT_CLASS_LOADER); Object name = env.get(DEFAULT_CLASS_LOADER_NAME); if (loader != null && name != null) { final String msg = STR + DEFAULT_CLASS_LOADER + STR + DEFAULT_CLASS_LOADER_NAME + STR; throw new IllegalArgumentException(msg); } if (loader == null && name == null) return Thread.currentThread().getContextClassLoader(); if (loader != null) { if (loader instanceof ClassLoader) { return (ClassLoader) loader; } else { final String msg = STR + ClassLoader.class.getName() + STR + loader.getClass().getName(); throw new IllegalArgumentException(msg); } } ObjectName on; if (name instanceof ObjectName) { on = (ObjectName) name; } else { final String msg = STR + ObjectName.class.getName() + STR + name.getClass().getName(); throw new IllegalArgumentException(msg); } if (mbs == null) throw new IllegalArgumentException(STR); return mbs.getClassLoader(on); } /** * Get the Connector Client default class loader. * <p> * Returns: * <ul> * <li> * The ClassLoader object found in <var>env</var> for * <code>jmx.remote.default.class.loader</code>, if any. * </li> * <li>The {@code Thread.currentThread().getContextClassLoader()} | /**
* Get the Connector Server default class loader.
* <p>
* Returns:
* <ul>
* <li>
* The ClassLoader object found in <var>env</var> for
* <code>jmx.remote.default.class.loader</code>, if any.
* </li>
* <li>
* The ClassLoader pointed to by the ObjectName found in
* <var>env</var> for <code>jmx.remote.default.class.loader.name</code>,
* and registered in <var>mbs</var> if any.
* </li>
* <li>
* The current thread's context classloader otherwise.
* </li>
* </ul>
*
* @param env Environment attributes.
* @param mbs The MBeanServer for which the connector server provides
* remote access.
*
* @return the connector server's default class loader.
*
* @exception IllegalArgumentException if one of the following is true:
* <ul>
* <li>both
* <code>jmx.remote.default.class.loader</code> and
* <code>jmx.remote.default.class.loader.name</code> are specified,
* </li>
* <li>or
* <code>jmx.remote.default.class.loader</code> is not
* an instance of {@link ClassLoader},
* </li>
* <li>or
* <code>jmx.remote.default.class.loader.name</code> is not
* an instance of {@link ObjectName},
* </li>
* <li>or
* <code>jmx.remote.default.class.loader.name</code> is specified
* but <var>mbs</var> is null.
* </li>
* </ul>
* @exception InstanceNotFoundException if
* <code>jmx.remote.default.class.loader.name</code> is specified
* and the ClassLoader MBean is not found in <var>mbs</var>.
*/ | Get the Connector Server default class loader. Returns: The ClassLoader object found in env for <code>jmx.remote.default.class.loader</code>, if any. The ClassLoader pointed to by the ObjectName found in env for <code>jmx.remote.default.class.loader.name</code>, and registered in mbs if any. The current thread's context classloader otherwise. | resolveServerClassLoader | {
"repo_name": "34benma/openjdk",
"path": "jdk/src/java.management/share/classes/com/sun/jmx/remote/util/EnvHelp.java",
"license": "gpl-2.0",
"size": 28712
} | [
"java.util.Map",
"javax.management.InstanceNotFoundException",
"javax.management.MBeanServer",
"javax.management.ObjectName"
] | import java.util.Map; import javax.management.InstanceNotFoundException; import javax.management.MBeanServer; import javax.management.ObjectName; | import java.util.*; import javax.management.*; | [
"java.util",
"javax.management"
] | java.util; javax.management; | 181,280 |
@ApiModelProperty(value = "The unix timestamp in seconds the currency was added to the system")
public Long getCreatedDate() {
return createdDate;
} | @ApiModelProperty(value = STR) Long function() { return createdDate; } | /**
* The unix timestamp in seconds the currency was added to the system
* @return createdDate
**/ | The unix timestamp in seconds the currency was added to the system | getCreatedDate | {
"repo_name": "knetikmedia/knetikcloud-java-client",
"path": "src/main/java/com/knetikcloud/model/CurrencyResource.java",
"license": "apache-2.0",
"size": 8330
} | [
"io.swagger.annotations.ApiModelProperty"
] | import io.swagger.annotations.ApiModelProperty; | import io.swagger.annotations.*; | [
"io.swagger.annotations"
] | io.swagger.annotations; | 1,919,956 |
public void test0101() throws JavaScriptModelException {
IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0101", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
char[] source = sourceUnit.getSource().toCharArray();
ASTNode result = runConversion(sourceUnit, false);
ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
assertNotNull("Expression should not be null", node); //$NON-NLS-1$
WhileStatement whileStatement = this.ast.newWhileStatement();
whileStatement.setExpression(this.ast.newBooleanLiteral(true));
whileStatement.setBody(this.ast.newBlock());
assertTrue("Both AST trees should be identical", whileStatement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
checkSourceRange(node, "while(true) {}", source);//$NON-NLS-1$
}
| void function() throws JavaScriptModelException { IJavaScriptUnit sourceUnit = getCompilationUnit(STR , "src", STR, STR); char[] source = sourceUnit.getSource().toCharArray(); ASTNode result = runConversion(sourceUnit, false); ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0); assertNotNull(STR, node); WhileStatement whileStatement = this.ast.newWhileStatement(); whileStatement.setExpression(this.ast.newBooleanLiteral(true)); whileStatement.setBody(this.ast.newBlock()); assertTrue(STR, whileStatement.subtreeMatch(new ASTMatcher(), node)); checkSourceRange(node, STR, source); } | /**
* WhileStatement ==> WhileStatement
*/ | WhileStatement ==> WhileStatement | test0101 | {
"repo_name": "echoes-tech/eclipse.jsdt.core",
"path": "org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTConverterTest.java",
"license": "epl-1.0",
"size": 521652
} | [
"org.eclipse.wst.jsdt.core.IJavaScriptUnit",
"org.eclipse.wst.jsdt.core.JavaScriptModelException",
"org.eclipse.wst.jsdt.core.dom.ASTMatcher",
"org.eclipse.wst.jsdt.core.dom.ASTNode",
"org.eclipse.wst.jsdt.core.dom.JavaScriptUnit",
"org.eclipse.wst.jsdt.core.dom.WhileStatement"
] | import org.eclipse.wst.jsdt.core.IJavaScriptUnit; import org.eclipse.wst.jsdt.core.JavaScriptModelException; import org.eclipse.wst.jsdt.core.dom.ASTMatcher; import org.eclipse.wst.jsdt.core.dom.ASTNode; import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit; import org.eclipse.wst.jsdt.core.dom.WhileStatement; | import org.eclipse.wst.jsdt.core.*; import org.eclipse.wst.jsdt.core.dom.*; | [
"org.eclipse.wst"
] | org.eclipse.wst; | 2,129,324 |
private static Map<Integer, String> find(String parse, String POS) {
Map<Integer, String> map = new HashMap<Integer, String>();
int i = parse.indexOf("(" + POS);
while (i != -1) {
// get NP from parse starting at i
int count = -1;
int j = i;
String temp = "";
do {
char c = parse.charAt(j++);
temp += c;
if (c == '(') {
count++;
}
if (c == ')') {
count--;
}
} while (count != -1);
map.put(i, temp);
i = parse.indexOf("(" + POS, i + 1);
}
return map;
}
| static Map<Integer, String> function(String parse, String POS) { Map<Integer, String> map = new HashMap<Integer, String>(); int i = parse.indexOf("(" + POS); while (i != -1) { int count = -1; int j = i; String temp = STR(" + POS, i + 1); } return map; } | /**
* Finds all POS instances in parse
* @param parse input parsed string
* @param POS part of speech tag
* @return A <code>Map</code> of POS tagged strings in input along with the position where they occur
*/ | Finds all POS instances in parse | find | {
"repo_name": "vishnujayvel/QAGenerator",
"path": "src/info/ephyra/trec/CorefResolver.java",
"license": "gpl-3.0",
"size": 32852
} | [
"java.util.HashMap",
"java.util.Map"
] | import java.util.HashMap; import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 2,873,695 |
@Path(IRestResourcesConstants.REST_TRANSFORMER)
@POST
@Consumes(MediaType.MULTIPART_FORM_DATA)
public Response pushTransformer(final FormDataMultiPart multipart,
@Context UriInfo uriInfo) throws Exception {
String transformerName = multipart.getField(IChappyServiceNamesConstants.TRANSFORMER_NAME).getValue();
byte[] transformerData = Base64.getDecoder().decode(multipart
.getField(IChappyServiceNamesConstants.TRANSFORMER_DATA).getValue());
CustomTransformerStorageProvider.getInstance().pushNewTransformer(transformerName, transformerData);
return Response.ok().build();
}
| @Path(IRestResourcesConstants.REST_TRANSFORMER) @Consumes(MediaType.MULTIPART_FORM_DATA) Response function(final FormDataMultiPart multipart, @Context UriInfo uriInfo) throws Exception { String transformerName = multipart.getField(IChappyServiceNamesConstants.TRANSFORMER_NAME).getValue(); byte[] transformerData = Base64.getDecoder().decode(multipart .getField(IChappyServiceNamesConstants.TRANSFORMER_DATA).getValue()); CustomTransformerStorageProvider.getInstance().pushNewTransformer(transformerName, transformerData); return Response.ok().build(); } | /**
* post transformer resources
* @param multipart
* @param uriInfo
* @return response with cookie used for the put operations.
* @throws Exception
*/ | post transformer resources | pushTransformer | {
"repo_name": "gdimitriu/chappy",
"path": "chappy-services/src/main/java/chappy/services/servers/rest/resources/transform/AddTransformResources.java",
"license": "gpl-3.0",
"size": 3478
} | [
"java.util.Base64",
"javax.ws.rs.Consumes",
"javax.ws.rs.Path",
"javax.ws.rs.core.Context",
"javax.ws.rs.core.MediaType",
"javax.ws.rs.core.Response",
"javax.ws.rs.core.UriInfo",
"org.glassfish.jersey.media.multipart.FormDataMultiPart"
] | import java.util.Base64; import javax.ws.rs.Consumes; import javax.ws.rs.Path; import javax.ws.rs.core.Context; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import javax.ws.rs.core.UriInfo; import org.glassfish.jersey.media.multipart.FormDataMultiPart; | import java.util.*; import javax.ws.rs.*; import javax.ws.rs.core.*; import org.glassfish.jersey.media.multipart.*; | [
"java.util",
"javax.ws",
"org.glassfish.jersey"
] | java.util; javax.ws; org.glassfish.jersey; | 83,240 |
public void informMetaDataChanged(MetaData newMetadata);
| void function(MetaData newMetadata); | /**
* This method is called if the meta data is newly assigned. The given MetaData might be null,
* if the ports have been cleared.
*/ | This method is called if the meta data is newly assigned. The given MetaData might be null, if the ports have been cleared | informMetaDataChanged | {
"repo_name": "aborg0/rapidminer-vega",
"path": "src/com/rapidminer/operator/ports/MetaDataChangeListener.java",
"license": "agpl-3.0",
"size": 1435
} | [
"com.rapidminer.operator.ports.metadata.MetaData"
] | import com.rapidminer.operator.ports.metadata.MetaData; | import com.rapidminer.operator.ports.metadata.*; | [
"com.rapidminer.operator"
] | com.rapidminer.operator; | 1,374,605 |
public List<String> getDatasetsNames(int pid) {
File problemFile = new File(Config.getProperty("problems.directory"),
String.valueOf(pid));
List<String> result = new ArrayList<>();
File[] list = problemFile.listFiles(new FilenameFilter() { | List<String> function(int pid) { File problemFile = new File(Config.getProperty(STR), String.valueOf(pid)); List<String> result = new ArrayList<>(); File[] list = problemFile.listFiles(new FilenameFilter() { | /**
* Reporta el nombre sin extension de los juegos de datos validos (o sea los
* que son pares de archivos .in/.out correspondientes)
*
* @param pid
* @return una lista ordenada con los nombres de los datasets validos para
* el problema
*/ | Reporta el nombre sin extension de los juegos de datos validos (o sea los que son pares de archivos .in/.out correspondientes) | getDatasetsNames | {
"repo_name": "dovier/coj-web",
"path": "src/main/java/cu/uci/coj/utils/Utils.java",
"license": "gpl-3.0",
"size": 22635
} | [
"java.io.File",
"java.io.FilenameFilter",
"java.util.ArrayList",
"java.util.List"
] | import java.io.File; import java.io.FilenameFilter; import java.util.ArrayList; import java.util.List; | import java.io.*; import java.util.*; | [
"java.io",
"java.util"
] | java.io; java.util; | 2,740,400 |
public void setBackgroundPainter(Painter p) {
Painter old = getBackgroundPainter();
backgroundPainter = p;
firePropertyChange("backgroundPainter", old, getBackgroundPainter());
repaint();
} | void function(Painter p) { Painter old = getBackgroundPainter(); backgroundPainter = p; firePropertyChange(STR, old, getBackgroundPainter()); repaint(); } | /**
* Sets a Painter to use to paint the background of this component By default there is already a single painter
* installed which draws the normal background for this component according to the current Look and Feel. Calling
* <CODE>setBackgroundPainter</CODE> will replace that existing painter.
*
* @param p the new painter
* @see #getBackgroundPainter()
*/ | Sets a Painter to use to paint the background of this component By default there is already a single painter installed which draws the normal background for this component according to the current Look and Feel. Calling <code>setBackgroundPainter</code> will replace that existing painter | setBackgroundPainter | {
"repo_name": "sing-group/aibench-project",
"path": "aibench-pluginmanager/src/main/java/org/jdesktop/swingx/JXLabel.java",
"license": "lgpl-3.0",
"size": 50628
} | [
"org.jdesktop.swingx.painter.Painter"
] | import org.jdesktop.swingx.painter.Painter; | import org.jdesktop.swingx.painter.*; | [
"org.jdesktop.swingx"
] | org.jdesktop.swingx; | 2,425,763 |
EReference getAnonymous_linkingOp_2__ConstraintExpr_1(); | EReference getAnonymous_linkingOp_2__ConstraintExpr_1(); | /**
* Returns the meta object for the containment reference list '{@link cruise.umple.umple.Anonymous_linkingOp_2_#getConstraintExpr_1 <em>Constraint Expr 1</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the containment reference list '<em>Constraint Expr 1</em>'.
* @see cruise.umple.umple.Anonymous_linkingOp_2_#getConstraintExpr_1()
* @see #getAnonymous_linkingOp_2_()
* @generated
*/ | Returns the meta object for the containment reference list '<code>cruise.umple.umple.Anonymous_linkingOp_2_#getConstraintExpr_1 Constraint Expr 1</code>'. | getAnonymous_linkingOp_2__ConstraintExpr_1 | {
"repo_name": "ahmedvc/umple",
"path": "cruise.umple.xtext/src-gen/cruise/umple/umple/UmplePackage.java",
"license": "mit",
"size": 485842
} | [
"org.eclipse.emf.ecore.EReference"
] | import org.eclipse.emf.ecore.EReference; | import org.eclipse.emf.ecore.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 392,470 |
public static void main(String[] args) throws JMException, IOException {
pMOEADStudy exp = new pMOEADStudy();
exp.experimentName_ = "pMOEADStudy";
exp.algorithmNameList_ = new String[]{"MOEADseq", "pMOEAD1T", "pMOEAD2T", "pMOEAD4T"};
exp.problemList_ = new String[]{"LZ09_F1", "LZ09_F2", "LZ09_F3", "LZ09_F4", "LZ09_F5",
"LZ09_F6", "LZ09_F7", "LZ09_F8", "LZ09_F9"};
exp.paretoFrontFile_ = new String[9];
exp.indicatorList_ = new String[]{"EPSILON"};
int numberOfAlgorithms = exp.algorithmNameList_.length;
exp.experimentBaseDirectory_ = "D:/Sheffield/experiments/" + exp.experimentName_;
exp.paretoFrontDirectory_ = "";
exp.algorithmSettings_ = new Settings[numberOfAlgorithms];
exp.independentRuns_ = 10;
exp.initExperiment();
// Run the experiments
int numberOfThreads;
exp.runExperiment(numberOfThreads = 1);
exp.generateQualityIndicators();
// Generate latex tables
exp.generateLatexTables();
// Configure the R scripts to be generated
int rows;
int columns;
String prefix;
String[] problems;
boolean notch;
// Configuring scripts for LZ09
rows = 3;
columns = 3;
prefix = new String("LZ09");
problems = new String[]{"LZ09_F1", "LZ09_F2", "LZ09_F3", "LZ09_F4", "LZ09_F5",
"LZ09_F6", "LZ09_F7", "LZ09_F8", "LZ09_F9"};
exp.generateRBoxplotScripts(rows, columns, problems, prefix, notch = false, exp);
exp.generateRWilcoxonScripts(problems, prefix, exp);
// Applying Friedman test
Friedman test = new Friedman(exp);
test.executeTest("EPSILON");
} // main | static void function(String[] args) throws JMException, IOException { pMOEADStudy exp = new pMOEADStudy(); exp.experimentName_ = STR; exp.algorithmNameList_ = new String[]{STR, STR, STR, STR}; exp.problemList_ = new String[]{STR, STR, STR, STR, STR, STR, STR, STR, STR}; exp.paretoFrontFile_ = new String[9]; exp.indicatorList_ = new String[]{STR}; int numberOfAlgorithms = exp.algorithmNameList_.length; exp.experimentBaseDirectory_ = STR + exp.experimentName_; exp.paretoFrontDirectory_ = STRLZ09"); problems = new String[]{STR, STR, STR, STR, STR, STR, STR, STR, STR}; exp.generateRBoxplotScripts(rows, columns, problems, prefix, notch = false, exp); exp.generateRWilcoxonScripts(problems, prefix, exp); Friedman test = new Friedman(exp); test.executeTest(STR); } | /**
* Main method
*
* @param args
* @throws JMException
* @throws IOException
*/ | Main method | main | {
"repo_name": "dkatsios/JSOptimizer",
"path": "JSOptimizer/JMETALHOME/jmetal/experiments/studies/pMOEADStudy.java",
"license": "gpl-3.0",
"size": 4673
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 1,698,734 |
@Adjacency(label = MODULE_JNDI, direction = Direction.OUT)
JNDIResourceModel getModuleJndiReference(); | @Adjacency(label = MODULE_JNDI, direction = Direction.OUT) JNDIResourceModel getModuleJndiReference(); | /**
* Contains the module jndi location for this resource.
*/ | Contains the module jndi location for this resource | getModuleJndiReference | {
"repo_name": "mareknovotny/windup",
"path": "rules-java-ee/addon/src/main/java/org/jboss/windup/rules/apps/javaee/model/EjbSessionBeanModel.java",
"license": "epl-1.0",
"size": 4745
} | [
"com.tinkerpop.blueprints.Direction",
"com.tinkerpop.frames.Adjacency"
] | import com.tinkerpop.blueprints.Direction; import com.tinkerpop.frames.Adjacency; | import com.tinkerpop.blueprints.*; import com.tinkerpop.frames.*; | [
"com.tinkerpop.blueprints",
"com.tinkerpop.frames"
] | com.tinkerpop.blueprints; com.tinkerpop.frames; | 1,234,041 |
@SuppressWarnings("unchecked")
public <T> WeakReference<T> newWeakReference(final T referent, final Runnable onEnqueueTask) {
if(referent==null) throw new IllegalArgumentException("The passed referent was null");
if(onEnqueueTask!=null) {
checkForLink(referent, onEnqueueTask);
} | @SuppressWarnings(STR) <T> WeakReference<T> function(final T referent, final Runnable onEnqueueTask) { if(referent==null) throw new IllegalArgumentException(STR); if(onEnqueueTask!=null) { checkForLink(referent, onEnqueueTask); } | /**
* Creates a new weak reference
* @param referent The referent which when enqueued will trigger the passed task
* @param onEnqueueTask the task to run when the referent becomes weakly reachable
* @return the reference
*/ | Creates a new weak reference | newWeakReference | {
"repo_name": "nickman/heliosutils",
"path": "src/main/java/com/heliosapm/utils/ref/ReferenceService.java",
"license": "apache-2.0",
"size": 24851
} | [
"java.lang.ref.WeakReference"
] | import java.lang.ref.WeakReference; | import java.lang.ref.*; | [
"java.lang"
] | java.lang; | 273,828 |
synchronized void awaitSegmentArchived(long awaitIdx) throws IgniteInterruptedCheckedException {
while (lastArchivedAbsoluteIndex() < awaitIdx && !interrupted) {
try {
wait(2000);
}
catch (InterruptedException e) {
throw new IgniteInterruptedCheckedException(e);
}
}
checkInterrupted();
} | synchronized void awaitSegmentArchived(long awaitIdx) throws IgniteInterruptedCheckedException { while (lastArchivedAbsoluteIndex() < awaitIdx && !interrupted) { try { wait(2000); } catch (InterruptedException e) { throw new IgniteInterruptedCheckedException(e); } } checkInterrupted(); } | /**
* Method will wait activation of particular WAL segment index.
*
* @param awaitIdx absolute index {@link #lastArchivedAbsoluteIndex()} to become true.
* @throws IgniteInterruptedCheckedException if interrupted.
*/ | Method will wait activation of particular WAL segment index | awaitSegmentArchived | {
"repo_name": "ptupitsyn/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/wal/aware/SegmentArchivedStorage.java",
"license": "apache-2.0",
"size": 5269
} | [
"org.apache.ignite.internal.IgniteInterruptedCheckedException"
] | import org.apache.ignite.internal.IgniteInterruptedCheckedException; | import org.apache.ignite.internal.*; | [
"org.apache.ignite"
] | org.apache.ignite; | 1,570,386 |
public void testEquals() {
ConcurrentNavigableMap map1 = map5();
ConcurrentNavigableMap map2 = map5();
assertEquals(map1, map2);
assertEquals(map2, map1);
map1.clear();
assertFalse(map1.equals(map2));
assertFalse(map2.equals(map1));
} | void function() { ConcurrentNavigableMap map1 = map5(); ConcurrentNavigableMap map2 = map5(); assertEquals(map1, map2); assertEquals(map2, map1); map1.clear(); assertFalse(map1.equals(map2)); assertFalse(map2.equals(map1)); } | /**
* Maps with same contents are equal
*/ | Maps with same contents are equal | testEquals | {
"repo_name": "AdmireTheDistance/android_libcore",
"path": "jsr166-tests/src/test/java/jsr166/ConcurrentSkipListSubMapTest.java",
"license": "gpl-2.0",
"size": 42185
} | [
"java.util.concurrent.ConcurrentNavigableMap"
] | import java.util.concurrent.ConcurrentNavigableMap; | import java.util.concurrent.*; | [
"java.util"
] | java.util; | 2,605,751 |
private void loadResponsesFromContext()
{
// remove the tab for the responses if it is set
tabPanel.remove(responsesTabHeader);
// load the new responses
List<ResponseNode> responseNodeList =
studyDesignContext.getStudyDesign().getResponseList();
if (responseNodeList != null && responseNodeList.size() > 0) {
CovarianceCorrelationDeckPanel panel =
new CovarianceCorrelationDeckPanel(this, responseNodeList, true);
panel.loadCovariance(
studyDesignContext.getCovarianceByName(
GlimmpseConstants.RESPONSES_COVARIANCE_LABEL));
tabPanel.add(responsesTabHeader, panel);
}
}
| void function() { tabPanel.remove(responsesTabHeader); List<ResponseNode> responseNodeList = studyDesignContext.getStudyDesign().getResponseList(); if (responseNodeList != null && responseNodeList.size() > 0) { CovarianceCorrelationDeckPanel panel = new CovarianceCorrelationDeckPanel(this, responseNodeList, true); panel.loadCovariance( studyDesignContext.getCovarianceByName( GlimmpseConstants.RESPONSES_COVARIANCE_LABEL)); tabPanel.add(responsesTabHeader, panel); } } | /**
* Load the response variables from the context
*/ | Load the response variables from the context | loadResponsesFromContext | {
"repo_name": "SampleSizeShop/GlimmpseWeb",
"path": "src/edu/ucdenver/bios/glimmpseweb/client/guided/WithinParticipantCovariancePanel.java",
"license": "gpl-2.0",
"size": 10341
} | [
"edu.ucdenver.bios.glimmpseweb.client.GlimmpseConstants",
"edu.ucdenver.bios.webservice.common.domain.ResponseNode",
"java.util.List"
] | import edu.ucdenver.bios.glimmpseweb.client.GlimmpseConstants; import edu.ucdenver.bios.webservice.common.domain.ResponseNode; import java.util.List; | import edu.ucdenver.bios.glimmpseweb.client.*; import edu.ucdenver.bios.webservice.common.domain.*; import java.util.*; | [
"edu.ucdenver.bios",
"java.util"
] | edu.ucdenver.bios; java.util; | 856,626 |
@Override
public void afterInvalidate(EntryEvent oevt) {
fail("Unexpected listener callback: afterInvalidated");
} | void function(EntryEvent oevt) { fail(STR); } | /**
* is called when an object is invalidated.
*
* @param oevt the ObjectEvent object representing the source object of the event.
*/ | is called when an object is invalidated | afterInvalidate | {
"repo_name": "jdeppe-pivotal/geode",
"path": "geode-core/src/distributedTest/java/org/apache/geode/internal/cache/SystemFailureDUnitTest.java",
"license": "apache-2.0",
"size": 22921
} | [
"org.apache.geode.cache.EntryEvent",
"org.apache.geode.test.dunit.Assert"
] | import org.apache.geode.cache.EntryEvent; import org.apache.geode.test.dunit.Assert; | import org.apache.geode.cache.*; import org.apache.geode.test.dunit.*; | [
"org.apache.geode"
] | org.apache.geode; | 253,795 |
@Test
@Specification({
"inbound.must.reject.request.with.400.if.host.header.occurs.more.than.once/request",
"inbound.must.reject.request.with.400.if.host.header.occurs.more.than.once/response" })
public void inboundMustRejectRequestWith400IfHostHeaderOccursMoreThanOnce() throws Exception {
k3po.finish();
} | @Specification({ STR, STR }) void function() throws Exception { k3po.finish(); } | /**
* See <a href="https://tools.ietf.org/html/rfc7230#section-5.4">RFC 7230 section 5.4: Host</a>.
*/ | See RFC 7230 section 5.4: Host | inboundMustRejectRequestWith400IfHostHeaderOccursMoreThanOnce | {
"repo_name": "irina-mitrea-luxoft/k3po",
"path": "specification/http/src/test/java/org/kaazing/specification/http/rfc7230/MessageRoutingIT.java",
"license": "agpl-3.0",
"size": 11741
} | [
"org.kaazing.k3po.junit.annotation.Specification"
] | import org.kaazing.k3po.junit.annotation.Specification; | import org.kaazing.k3po.junit.annotation.*; | [
"org.kaazing.k3po"
] | org.kaazing.k3po; | 1,143,412 |
protected Tuple<BlobStoreIndexShardSnapshots, Integer> buildBlobStoreIndexShardSnapshots(Map<String, BlobMetaData> blobs) {
int latest = -1;
Set<String> blobKeys = blobs.keySet();
for (String name : blobKeys) {
if (name.startsWith(SNAPSHOT_INDEX_PREFIX)) {
try {
int gen = Integer.parseInt(name.substring(SNAPSHOT_INDEX_PREFIX.length()));
if (gen > latest) {
latest = gen;
}
} catch (NumberFormatException ex) {
logger.warn("failed to parse index file name [{}]", name);
}
}
}
if (latest >= 0) {
try {
final BlobStoreIndexShardSnapshots shardSnapshots =
indexShardSnapshotsFormat.read(blobContainer, Integer.toString(latest));
return new Tuple<>(shardSnapshots, latest);
} catch (IOException e) {
final String file = SNAPSHOT_INDEX_PREFIX + latest;
logger.warn(() -> new ParameterizedMessage("failed to read index file [{}]", file), e);
}
} else if (blobKeys.isEmpty() == false) {
logger.debug("Could not find a readable index-N file in a non-empty shard snapshot directory [{}]", blobContainer.path());
}
// We couldn't load the index file - falling back to loading individual snapshots
List<SnapshotFiles> snapshots = new ArrayList<>();
for (String name : blobKeys) {
try {
BlobStoreIndexShardSnapshot snapshot = null;
if (name.startsWith(SNAPSHOT_PREFIX)) {
snapshot = indexShardSnapshotFormat.readBlob(blobContainer, name);
}
if (snapshot != null) {
snapshots.add(new SnapshotFiles(snapshot.snapshot(), snapshot.indexFiles()));
}
} catch (IOException e) {
logger.warn(() -> new ParameterizedMessage("failed to read commit point [{}]", name), e);
}
}
return new Tuple<>(new BlobStoreIndexShardSnapshots(snapshots), -1);
}
}
private class SnapshotContext extends Context {
private final Store store;
private final IndexShardSnapshotStatus snapshotStatus;
private final long startTime;
SnapshotContext(IndexShard shard, SnapshotId snapshotId, IndexId indexId, IndexShardSnapshotStatus snapshotStatus, long startTime) {
super(snapshotId, Version.CURRENT, indexId, shard.shardId());
this.snapshotStatus = snapshotStatus;
this.store = shard.store();
this.startTime = startTime;
} | Tuple<BlobStoreIndexShardSnapshots, Integer> function(Map<String, BlobMetaData> blobs) { int latest = -1; Set<String> blobKeys = blobs.keySet(); for (String name : blobKeys) { if (name.startsWith(SNAPSHOT_INDEX_PREFIX)) { try { int gen = Integer.parseInt(name.substring(SNAPSHOT_INDEX_PREFIX.length())); if (gen > latest) { latest = gen; } } catch (NumberFormatException ex) { logger.warn(STR, name); } } } if (latest >= 0) { try { final BlobStoreIndexShardSnapshots shardSnapshots = indexShardSnapshotsFormat.read(blobContainer, Integer.toString(latest)); return new Tuple<>(shardSnapshots, latest); } catch (IOException e) { final String file = SNAPSHOT_INDEX_PREFIX + latest; logger.warn(() -> new ParameterizedMessage(STR, file), e); } } else if (blobKeys.isEmpty() == false) { logger.debug(STR, blobContainer.path()); } List<SnapshotFiles> snapshots = new ArrayList<>(); for (String name : blobKeys) { try { BlobStoreIndexShardSnapshot snapshot = null; if (name.startsWith(SNAPSHOT_PREFIX)) { snapshot = indexShardSnapshotFormat.readBlob(blobContainer, name); } if (snapshot != null) { snapshots.add(new SnapshotFiles(snapshot.snapshot(), snapshot.indexFiles())); } } catch (IOException e) { logger.warn(() -> new ParameterizedMessage(STR, name), e); } } return new Tuple<>(new BlobStoreIndexShardSnapshots(snapshots), -1); } } private class SnapshotContext extends Context { private final Store store; private final IndexShardSnapshotStatus snapshotStatus; private final long startTime; SnapshotContext(IndexShard shard, SnapshotId snapshotId, IndexId indexId, IndexShardSnapshotStatus snapshotStatus, long startTime) { super(snapshotId, Version.CURRENT, indexId, shard.shardId()); this.snapshotStatus = snapshotStatus; this.store = shard.store(); this.startTime = startTime; } | /**
* Loads all available snapshots in the repository
*
* @param blobs list of blobs in repository
* @return tuple of BlobStoreIndexShardSnapshots and the last snapshot index generation
*/ | Loads all available snapshots in the repository | buildBlobStoreIndexShardSnapshots | {
"repo_name": "rajanm/elasticsearch",
"path": "server/src/main/java/org/elasticsearch/repositories/blobstore/BlobStoreRepository.java",
"license": "apache-2.0",
"size": 79218
} | [
"java.io.IOException",
"java.util.ArrayList",
"java.util.List",
"java.util.Map",
"java.util.Set",
"org.apache.logging.log4j.message.ParameterizedMessage",
"org.elasticsearch.Version",
"org.elasticsearch.common.blobstore.BlobMetaData",
"org.elasticsearch.common.collect.Tuple",
"org.elasticsearch.index.shard.IndexShard",
"org.elasticsearch.index.snapshots.IndexShardSnapshotStatus",
"org.elasticsearch.index.snapshots.blobstore.BlobStoreIndexShardSnapshot",
"org.elasticsearch.index.snapshots.blobstore.BlobStoreIndexShardSnapshots",
"org.elasticsearch.index.snapshots.blobstore.SnapshotFiles",
"org.elasticsearch.index.store.Store",
"org.elasticsearch.repositories.IndexId",
"org.elasticsearch.snapshots.SnapshotId"
] | import java.io.IOException; import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.Set; import org.apache.logging.log4j.message.ParameterizedMessage; import org.elasticsearch.Version; import org.elasticsearch.common.blobstore.BlobMetaData; import org.elasticsearch.common.collect.Tuple; import org.elasticsearch.index.shard.IndexShard; import org.elasticsearch.index.snapshots.IndexShardSnapshotStatus; import org.elasticsearch.index.snapshots.blobstore.BlobStoreIndexShardSnapshot; import org.elasticsearch.index.snapshots.blobstore.BlobStoreIndexShardSnapshots; import org.elasticsearch.index.snapshots.blobstore.SnapshotFiles; import org.elasticsearch.index.store.Store; import org.elasticsearch.repositories.IndexId; import org.elasticsearch.snapshots.SnapshotId; | import java.io.*; import java.util.*; import org.apache.logging.log4j.message.*; import org.elasticsearch.*; import org.elasticsearch.common.blobstore.*; import org.elasticsearch.common.collect.*; import org.elasticsearch.index.shard.*; import org.elasticsearch.index.snapshots.*; import org.elasticsearch.index.snapshots.blobstore.*; import org.elasticsearch.index.store.*; import org.elasticsearch.repositories.*; import org.elasticsearch.snapshots.*; | [
"java.io",
"java.util",
"org.apache.logging",
"org.elasticsearch",
"org.elasticsearch.common",
"org.elasticsearch.index",
"org.elasticsearch.repositories",
"org.elasticsearch.snapshots"
] | java.io; java.util; org.apache.logging; org.elasticsearch; org.elasticsearch.common; org.elasticsearch.index; org.elasticsearch.repositories; org.elasticsearch.snapshots; | 906,204 |
public static StringBuilder getFileContent(final String path) throws IOException {
return getFileContent(path, EncodingUtils.CHARSET_UTF_8);
}
| static StringBuilder function(final String path) throws IOException { return getFileContent(path, EncodingUtils.CHARSET_UTF_8); } | /**
* Get the content of a file (charset used: UTF-8).
*
* @param path
* The path of the file
* @return The buffered content
* @throws IOException
* Exception thrown if problems occurs during reading
*/ | Get the content of a file (charset used: UTF-8) | getFileContent | {
"repo_name": "Gilandel/utils-io",
"path": "src/main/java/fr/landel/utils/io/FileUtils.java",
"license": "apache-2.0",
"size": 21083
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 2,352,194 |
protected void drawLabel(Graphics2D g2, Rectangle2D plotArea, double value,
int cat, double startAngle, double extent) {
FontRenderContext frc = g2.getFontRenderContext();
String label = null;
if (this.dataExtractOrder == TableOrder.BY_ROW) {
// if series are in rows, then the categories are the column keys
label = this.labelGenerator.generateColumnLabel(this.dataset, cat);
}
else {
// if series are in columns, then the categories are the row keys
label = this.labelGenerator.generateRowLabel(this.dataset, cat);
}
Rectangle2D labelBounds = getLabelFont().getStringBounds(label, frc);
LineMetrics lm = getLabelFont().getLineMetrics(label, frc);
double ascent = lm.getAscent();
Point2D labelLocation = calculateLabelLocation(labelBounds, ascent,
plotArea, startAngle);
Composite saveComposite = g2.getComposite();
g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER,
1.0f));
g2.setPaint(getLabelPaint());
g2.setFont(getLabelFont());
g2.drawString(label, (float) labelLocation.getX(),
(float) labelLocation.getY());
g2.setComposite(saveComposite);
}
| void function(Graphics2D g2, Rectangle2D plotArea, double value, int cat, double startAngle, double extent) { FontRenderContext frc = g2.getFontRenderContext(); String label = null; if (this.dataExtractOrder == TableOrder.BY_ROW) { label = this.labelGenerator.generateColumnLabel(this.dataset, cat); } else { label = this.labelGenerator.generateRowLabel(this.dataset, cat); } Rectangle2D labelBounds = getLabelFont().getStringBounds(label, frc); LineMetrics lm = getLabelFont().getLineMetrics(label, frc); double ascent = lm.getAscent(); Point2D labelLocation = calculateLabelLocation(labelBounds, ascent, plotArea, startAngle); Composite saveComposite = g2.getComposite(); g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 1.0f)); g2.setPaint(getLabelPaint()); g2.setFont(getLabelFont()); g2.drawString(label, (float) labelLocation.getX(), (float) labelLocation.getY()); g2.setComposite(saveComposite); } | /**
* Draws the label for one axis.
*
* @param g2 the graphics device.
* @param plotArea the plot area
* @param value the value of the label (ignored).
* @param cat the category (zero-based index).
* @param startAngle the starting angle.
* @param extent the extent of the arc.
*/ | Draws the label for one axis | drawLabel | {
"repo_name": "fluidware/Eastwood-Charts",
"path": "source/org/jfree/chart/plot/SpiderWebPlot.java",
"license": "lgpl-2.1",
"size": 56201
} | [
"java.awt.AlphaComposite",
"java.awt.Composite",
"java.awt.Graphics2D",
"java.awt.font.FontRenderContext",
"java.awt.font.LineMetrics",
"java.awt.geom.Point2D",
"java.awt.geom.Rectangle2D",
"org.jfree.util.TableOrder"
] | import java.awt.AlphaComposite; import java.awt.Composite; import java.awt.Graphics2D; import java.awt.font.FontRenderContext; import java.awt.font.LineMetrics; import java.awt.geom.Point2D; import java.awt.geom.Rectangle2D; import org.jfree.util.TableOrder; | import java.awt.*; import java.awt.font.*; import java.awt.geom.*; import org.jfree.util.*; | [
"java.awt",
"org.jfree.util"
] | java.awt; org.jfree.util; | 2,224,866 |
private Comparator<? super HistoryExternalApplication> historyUSListComparator = new Comparator<HistoryExternalApplication>() {
@Override
public int compare(HistoryExternalApplication lhs,
HistoryExternalApplication rhs) {
return lhs.getID().compareTo(rhs.getID());
}
}; | Comparator<? super HistoryExternalApplication> historyUSListComparator = new Comparator<HistoryExternalApplication>() { public int function(HistoryExternalApplication lhs, HistoryExternalApplication rhs) { return lhs.getID().compareTo(rhs.getID()); } }; | /**
* Comparator for InstalledExternalApplications.
*
* @param lhs
* @param rhs
* @return < 0 if the rhs Date is less than the lhs Date or lhs is null
* and rhs not, 0 if they are equal or both null, > 0 if rhs
* Date is greater or rhs is null and lhs not
*/ | Comparator for InstalledExternalApplications | compare | {
"repo_name": "ischweizer/MoSeS--Client-",
"path": "moses/src/de/da_sense/moses/client/HistoryFragment.java",
"license": "apache-2.0",
"size": 9448
} | [
"de.da_sense.moses.client.abstraction.apks.HistoryExternalApplication",
"java.util.Comparator"
] | import de.da_sense.moses.client.abstraction.apks.HistoryExternalApplication; import java.util.Comparator; | import de.da_sense.moses.client.abstraction.apks.*; import java.util.*; | [
"de.da_sense.moses",
"java.util"
] | de.da_sense.moses; java.util; | 1,337,265 |
public Collection<ZusatzRolleCustomBean> getN_zusatz_rollen() {
return this.n_zusatz_rollen;
} | Collection<ZusatzRolleCustomBean> function() { return this.n_zusatz_rollen; } | /**
* DOCUMENT ME!
*
* @return DOCUMENT ME!
*/ | DOCUMENT ME | getN_zusatz_rollen | {
"repo_name": "cismet/lagis-client",
"path": "src/main/java/de/cismet/cids/custom/beans/lagis/FlurstueckCustomBean.java",
"license": "gpl-3.0",
"size": 18712
} | [
"java.util.Collection"
] | import java.util.Collection; | import java.util.*; | [
"java.util"
] | java.util; | 1,960,577 |
protected static Font getDefaultFont(int size, int font) {
final Integer key = Integer.valueOf((size << 8) + font);
Font f = defaultFonts.get(key);
if (f == null) {
int fontIndex = font & 0xf;
assert (fontIndex >= 1 && fontIndex <= 9);
boolean isBold = (font & 0x0010) > 0;
boolean isItalic = (font & 0x0020) > 0;
boolean isUnderline = (font & 0x0040) > 0;
String fontName = defaultFontNames[fontIndex - 1];
int fontStyle = Font.PLAIN;
if (isItalic)
fontStyle |= Font.ITALIC;
if (isBold)
fontStyle |= Font.BOLD;
f = new Font(fontName, fontStyle, size);
if (isUnderline) {
// TODO: why doesn't underlining doesn't work? Why why why?
Hashtable<TextAttribute, Object> hash = new Hashtable<TextAttribute, Object>();
hash.put(TextAttribute.UNDERLINE, TextAttribute.UNDERLINE_ON);
f = f.deriveFont(hash);
}
defaultFonts.put(key, f);
}
return f;
}
// tertiary symbols.
private final ArrayList<HexData> attributes = new ArrayList<HexData>();
// name of the map board is derived from the file name
private String baseName;
// hex data organized by index
private Hex[] hexes;
// hexline data
private final ArrayList<HexLine> hexLines = new ArrayList<HexLine>();
// hexside data
private final ArrayList<HexSide> hexSides = new ArrayList<HexSide>();
// layout of the hexes or squares
private Layout layout;
// line definitions needed for hex sides and lines
private LineDefinition[] lineDefinitions;
// organizes all the drawable elements in order of drawing priority
private ArrayList<MapLayer> mapElements = new ArrayList<MapLayer>();
// grid numbering systems
private final ArrayList<MapSheet> mapSheets = new ArrayList<MapSheet>();
// labels; not necessary actual places corresponding to a hex, although
// that's how it's described by ADC2
private final ArrayList<PlaceName> placeNames = new ArrayList<PlaceName>();
// optional place symbol in addition to primary and secondary mapboard
// symbol
private final ArrayList<HexData> placeSymbols = new ArrayList<HexData>();
// primary mapboard symbols. Every hex must have one even if it's null.
private final ArrayList<HexData> primaryMapBoardSymbols = new ArrayList<HexData>();
// and secondary mapboard symbols (typically a lot fewer)
private final ArrayList<HexData> secondaryMapBoardSymbols = new ArrayList<HexData>();
// overlay symbol. there's only one, but we make it an ArrayList<> for consistency
// with other drawing objects
private final ArrayList<MapBoardOverlay> overlaySymbol = new ArrayList<MapBoardOverlay>();
// symbol set associated with this map -- needed for mapboard symbols
private SymbolSet set;
// How many hex columns in the map.
private int columns;
// How many hex rows in the map.
private int rows;
// background map color when hexes are not drawn.
private Color tableColor;
// version information needed for rendering hexes and determining hex dimensions
private boolean isPreV208 = true;
// map file path
private String path;
// The VASSAL BoardPicker object which is the tree parent of Board.
private BoardPicker boardPicker;
private byte[] drawingPriorities = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
// initialize the drawing elements which must all be ArrayList<>'s.
public MapBoard() {
mapElements.add(new MapLayer(primaryMapBoardSymbols, "Primary MapBoard Symbols", false));
mapElements.add(new MapLayer(secondaryMapBoardSymbols, "Secondary MapBoard Symbols", false));
mapElements.add(new MapLayer(hexSides, "Hex Sides", true));
mapElements.add(new MapLayer(hexLines, "Hex Lines", true));
mapElements.add(new MapLayer(placeSymbols, "Place Symbols", false));
mapElements.add(new MapLayer(attributes, "Attributes", false));
mapElements.add(new MapLayer(overlaySymbol, "Overlay Symbol", true));
mapElements.add(new MapLayer(placeNames, "Place Names", true));
} | static Font function(int size, int font) { final Integer key = Integer.valueOf((size << 8) + font); Font f = defaultFonts.get(key); if (f == null) { int fontIndex = font & 0xf; assert (fontIndex >= 1 && fontIndex <= 9); boolean isBold = (font & 0x0010) > 0; boolean isItalic = (font & 0x0020) > 0; boolean isUnderline = (font & 0x0040) > 0; String fontName = defaultFontNames[fontIndex - 1]; int fontStyle = Font.PLAIN; if (isItalic) fontStyle = Font.ITALIC; if (isBold) fontStyle = Font.BOLD; f = new Font(fontName, fontStyle, size); if (isUnderline) { Hashtable<TextAttribute, Object> hash = new Hashtable<TextAttribute, Object>(); hash.put(TextAttribute.UNDERLINE, TextAttribute.UNDERLINE_ON); f = f.deriveFont(hash); } defaultFonts.put(key, f); } return f; } private final ArrayList<HexData> attributes = new ArrayList<HexData>(); private String baseName; private Hex[] hexes; private final ArrayList<HexLine> hexLines = new ArrayList<HexLine>(); private final ArrayList<HexSide> hexSides = new ArrayList<HexSide>(); private Layout layout; private LineDefinition[] lineDefinitions; private ArrayList<MapLayer> mapElements = new ArrayList<MapLayer>(); private final ArrayList<MapSheet> mapSheets = new ArrayList<MapSheet>(); private final ArrayList<PlaceName> placeNames = new ArrayList<PlaceName>(); private final ArrayList<HexData> placeSymbols = new ArrayList<HexData>(); private final ArrayList<HexData> primaryMapBoardSymbols = new ArrayList<HexData>(); private final ArrayList<HexData> secondaryMapBoardSymbols = new ArrayList<HexData>(); private final ArrayList<MapBoardOverlay> overlaySymbol = new ArrayList<MapBoardOverlay>(); private SymbolSet set; private int columns; private int rows; private Color tableColor; private boolean isPreV208 = true; private String path; private BoardPicker boardPicker; private byte[] drawingPriorities = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; public MapBoard() { mapElements.add(new MapLayer(primaryMapBoardSymbols, STR, false)); mapElements.add(new MapLayer(secondaryMapBoardSymbols, STR, false)); mapElements.add(new MapLayer(hexSides, STR, true)); mapElements.add(new MapLayer(hexLines, STR, true)); mapElements.add(new MapLayer(placeSymbols, STR, false)); mapElements.add(new MapLayer(attributes, STR, false)); mapElements.add(new MapLayer(overlaySymbol, STR, true)); mapElements.add(new MapLayer(placeNames, STR, true)); } | /**
* Get a font based on size and font index. If this font has not already been created, then it will be generated.
* Can be reused later if the same font was already created.
*
* @param size Font size.
* @param font Font index. See MapBoard.java for format.
*/ | Get a font based on size and font index. If this font has not already been created, then it will be generated. Can be reused later if the same font was already created | getDefaultFont | {
"repo_name": "rzymek/vassal-src",
"path": "src/VASSAL/tools/imports/adc2/MapBoard.java",
"license": "lgpl-2.1",
"size": 95356
} | [
"java.awt.Color",
"java.awt.Font",
"java.awt.font.TextAttribute",
"java.util.ArrayList",
"java.util.Hashtable"
] | import java.awt.Color; import java.awt.Font; import java.awt.font.TextAttribute; import java.util.ArrayList; import java.util.Hashtable; | import java.awt.*; import java.awt.font.*; import java.util.*; | [
"java.awt",
"java.util"
] | java.awt; java.util; | 2,015,148 |
protected void addInInteractionFlowsPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_InteractionFlowElement_inInteractionFlows_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_InteractionFlowElement_inInteractionFlows_feature", "_UI_InteractionFlowElement_type"),
CorePackage.Literals.INTERACTION_FLOW_ELEMENT__IN_INTERACTION_FLOWS,
true,
false,
true,
null,
null,
null));
} | void function(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString(STR), getString(STR, STR, STR), CorePackage.Literals.INTERACTION_FLOW_ELEMENT__IN_INTERACTION_FLOWS, true, false, true, null, null, null)); } | /**
* This adds a property descriptor for the In Interaction Flows feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/ | This adds a property descriptor for the In Interaction Flows feature. | addInInteractionFlowsPropertyDescriptor | {
"repo_name": "ifml/ifml-editor",
"path": "plugins/IFMLEditor.edit/src/IFML/Core/provider/IFMLModuleItemProvider.java",
"license": "mit",
"size": 7945
} | [
"org.eclipse.emf.edit.provider.ComposeableAdapterFactory"
] | import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; | import org.eclipse.emf.edit.provider.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 2,225,252 |
public void catching(Throwable throwable) {
if (instanceofLAL) {
((LocationAwareLogger) logger).log(CATCHING_MARKER, FQCN, LocationAwareLogger.ERROR_INT, "catching", null, throwable);
}
}
| void function(Throwable throwable) { if (instanceofLAL) { ((LocationAwareLogger) logger).log(CATCHING_MARKER, FQCN, LocationAwareLogger.ERROR_INT, STR, null, throwable); } } | /**
* Log an exception being caught. The generated log event uses Level ERROR.
*
* @param throwable
* the exception being caught.
*/ | Log an exception being caught. The generated log event uses Level ERROR | catching | {
"repo_name": "liqilun/iticket",
"path": "src/main/java/com/iticket/util/SimpleLogger.java",
"license": "apache-2.0",
"size": 11833
} | [
"org.slf4j.spi.LocationAwareLogger"
] | import org.slf4j.spi.LocationAwareLogger; | import org.slf4j.spi.*; | [
"org.slf4j.spi"
] | org.slf4j.spi; | 2,192,293 |
protected void createShape() {
objectId = createShape(radius);
Logger.getLogger(this.getClass().getName()).log(Level.FINE, "Created Shape {0}", Long.toHexString(objectId));
// new SphereShape(radius);
// objectId.setLocalScaling(Converter.convert(getScale()));
// objectId.setMargin(margin);
setScale(scale); // Set the scale to 1
setMargin(margin);
} | void function() { objectId = createShape(radius); Logger.getLogger(this.getClass().getName()).log(Level.FINE, STR, Long.toHexString(objectId)); setScale(scale); setMargin(margin); } | /**
* Instantiate the configured shape in Bullet.
*/ | Instantiate the configured shape in Bullet | createShape | {
"repo_name": "zzuegg/jmonkeyengine",
"path": "jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/SphereCollisionShape.java",
"license": "bsd-3-clause",
"size": 4537
} | [
"java.util.logging.Level",
"java.util.logging.Logger"
] | import java.util.logging.Level; import java.util.logging.Logger; | import java.util.logging.*; | [
"java.util"
] | java.util; | 474,551 |
public JSONArray put(final Map<String, Object> value) {
this.put(new JSONObject(value));
return this;
} | JSONArray function(final Map<String, Object> value) { this.put(new JSONObject(value)); return this; } | /**
* Put a value in the JSONArray, where the value will be a JSONObject which is produced from a Map.
*
* @param value A Map value.
*
* @return this.
*/ | Put a value in the JSONArray, where the value will be a JSONObject which is produced from a Map | put | {
"repo_name": "Maescool/PlotSquared",
"path": "Core/src/main/java/com/intellectualcrafters/json/JSONArray.java",
"license": "gpl-3.0",
"size": 31911
} | [
"java.util.Map"
] | import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 1,601,871 |
private Comparator<PathData> getOrderComparator() {
return this.orderComparator;
} | Comparator<PathData> function() { return this.orderComparator; } | /**
* Get the comparator to be used for sorting files.
* @return comparator
*/ | Get the comparator to be used for sorting files | getOrderComparator | {
"repo_name": "dennishuo/hadoop",
"path": "hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/shell/Ls.java",
"license": "apache-2.0",
"size": 13563
} | [
"java.util.Comparator"
] | import java.util.Comparator; | import java.util.*; | [
"java.util"
] | java.util; | 76,130 |
public void setSampleRateDivider(int divider) {
BoundaryException.assertWithinBounds(divider, 1, 256);
sampleRateDivider = divider;
writeSampleRateDivider();
} | void function(int divider) { BoundaryException.assertWithinBounds(divider, 1, 256); sampleRateDivider = divider; writeSampleRateDivider(); } | /**
* set the sample rate divider. This divides the internal sample rate by the
* specified value.
*
* @param divider the sample rate divider
*/ | set the sample rate divider. This divides the internal sample rate by the specified value | setSampleRateDivider | {
"repo_name": "RobotsByTheC/CMonster2016",
"path": "src/main/java/edu/wpi/first/wpilibj/ITG3200.java",
"license": "bsd-3-clause",
"size": 14756
} | [
"edu.wpi.first.wpilibj.util.BoundaryException"
] | import edu.wpi.first.wpilibj.util.BoundaryException; | import edu.wpi.first.wpilibj.util.*; | [
"edu.wpi.first"
] | edu.wpi.first; | 620,382 |
public static void setDefaultHandler() {
synchronized (CleanHandler.class) {
if (s_setDefault)
return;
if (System.getProperties().getProperty
("java.util.logging.config.file") == null &&
System.getProperties().getProperty
("java.util.logging.config.class") == null) {
overrideExistingHandlers(Level.INFO); // nothing set previously
}
s_setDefault = true;
}
} | static void function() { synchronized (CleanHandler.class) { if (s_setDefault) return; if (System.getProperties().getProperty (STR) == null && System.getProperties().getProperty (STR) == null) { overrideExistingHandlers(Level.INFO); } s_setDefault = true; } } | /** If the user has not specified a java property for the global
Handler, then set the default global handler to
this CleanHandler at an INFO level.
*/ | If the user has not specified a java property for the global | setDefaultHandler | {
"repo_name": "ctrueden/jtk",
"path": "src/main/java/edu/mines/jtk/util/CleanHandler.java",
"license": "epl-1.0",
"size": 4439
} | [
"java.util.logging.Level"
] | import java.util.logging.Level; | import java.util.logging.*; | [
"java.util"
] | java.util; | 225,068 |
default Web3jEndpointProducerBuilder gasLimit(BigInteger gasLimit) {
doSetProperty("gasLimit", gasLimit);
return this;
} | default Web3jEndpointProducerBuilder gasLimit(BigInteger gasLimit) { doSetProperty(STR, gasLimit); return this; } | /**
* The maximum gas allowed in this block.
*
* The option is a: <code>java.math.BigInteger</code> type.
*
* Group: common
*/ | The maximum gas allowed in this block. The option is a: <code>java.math.BigInteger</code> type. Group: common | gasLimit | {
"repo_name": "DariusX/camel",
"path": "core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/Web3jEndpointBuilderFactory.java",
"license": "apache-2.0",
"size": 51259
} | [
"java.math.BigInteger"
] | import java.math.BigInteger; | import java.math.*; | [
"java.math"
] | java.math; | 2,234,874 |
return Kind.MemberValuePair;
}
public TDMemberValuePair(TDLocation<SMemberValuePair> location) {
super(location);
}
public TDMemberValuePair(Name name, Expr value) {
super(new TDLocation<SMemberValuePair>(SMemberValuePair.make(TDTree.<SName>treeOf(name), TDTree.<SExpr>treeOf(value))));
} | return Kind.MemberValuePair; } public TDMemberValuePair(TDLocation<SMemberValuePair> location) { super(location); } public TDMemberValuePair(Name name, Expr value) { super(new TDLocation<SMemberValuePair>(SMemberValuePair.make(TDTree.<SName>treeOf(name), TDTree.<SExpr>treeOf(value)))); } | /**
* Returns the kind of this annotation member value pair.
*
* @return the kind of this annotation member value pair.
*/ | Returns the kind of this annotation member value pair | kind | {
"repo_name": "ptitjes/jlato",
"path": "src/main/java/org/jlato/internal/td/expr/TDMemberValuePair.java",
"license": "lgpl-3.0",
"size": 4338
} | [
"org.jlato.internal.bu.expr.SExpr",
"org.jlato.internal.bu.expr.SMemberValuePair",
"org.jlato.internal.bu.name.SName",
"org.jlato.internal.td.TDLocation",
"org.jlato.internal.td.TDTree",
"org.jlato.tree.Kind",
"org.jlato.tree.expr.Expr",
"org.jlato.tree.expr.MemberValuePair",
"org.jlato.tree.name.Name"
] | import org.jlato.internal.bu.expr.SExpr; import org.jlato.internal.bu.expr.SMemberValuePair; import org.jlato.internal.bu.name.SName; import org.jlato.internal.td.TDLocation; import org.jlato.internal.td.TDTree; import org.jlato.tree.Kind; import org.jlato.tree.expr.Expr; import org.jlato.tree.expr.MemberValuePair; import org.jlato.tree.name.Name; | import org.jlato.internal.bu.expr.*; import org.jlato.internal.bu.name.*; import org.jlato.internal.td.*; import org.jlato.tree.*; import org.jlato.tree.expr.*; import org.jlato.tree.name.*; | [
"org.jlato.internal",
"org.jlato.tree"
] | org.jlato.internal; org.jlato.tree; | 1,887,869 |
private static Geometry viaPrepSQL(Geometry geom, Connection conn) throws SQLException {
PreparedStatement prep = conn.prepareStatement("SELECT ?::geometry");
PGgeometry wrapper = new PGgeometry(geom);
prep.setObject(1, wrapper, Types.OTHER);
ResultSet rs = prep.executeQuery();
rs.next();
PGgeometry resultwrapper = ((PGgeometry) rs.getObject(1));
return resultwrapper.getGeometry();
} | static Geometry function(Geometry geom, Connection conn) throws SQLException { PreparedStatement prep = conn.prepareStatement(STR); PGgeometry wrapper = new PGgeometry(geom); prep.setObject(1, wrapper, Types.OTHER); ResultSet rs = prep.executeQuery(); rs.next(); PGgeometry resultwrapper = ((PGgeometry) rs.getObject(1)); return resultwrapper.getGeometry(); } | /**
* Pass a geometry representation through the SQL server via prepared
* statement
*/ | Pass a geometry representation through the SQL server via prepared statement | viaPrepSQL | {
"repo_name": "imincik/pkg-postgis-1.5",
"path": "java/jdbc/src/examples/TestParser.java",
"license": "gpl-2.0",
"size": 25353
} | [
"java.sql.Connection",
"java.sql.PreparedStatement",
"java.sql.ResultSet",
"java.sql.SQLException",
"java.sql.Types",
"org.postgis.Geometry",
"org.postgis.PGgeometry"
] | import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Types; import org.postgis.Geometry; import org.postgis.PGgeometry; | import java.sql.*; import org.postgis.*; | [
"java.sql",
"org.postgis"
] | java.sql; org.postgis; | 2,366,295 |
void setRequestBody(RequestBody requestBody); | void setRequestBody(RequestBody requestBody); | /**
* Sets this Operation's requestBody property to the given object.
*
* @param requestBody the request body applicable for this operation
**/ | Sets this Operation's requestBody property to the given object | setRequestBody | {
"repo_name": "arthurdm/microprofile-open-api",
"path": "api/src/main/java/org/eclipse/microprofile/openapi/models/Operation.java",
"license": "apache-2.0",
"size": 13146
} | [
"org.eclipse.microprofile.openapi.models.parameters.RequestBody"
] | import org.eclipse.microprofile.openapi.models.parameters.RequestBody; | import org.eclipse.microprofile.openapi.models.parameters.*; | [
"org.eclipse.microprofile"
] | org.eclipse.microprofile; | 1,968,957 |
@Override
public void run() {
// initialize the session
SSLSocket socket = secureSocket.getSocket();
SSLSession session = socket.getSession();
Logger.log(String.format(
"Client path %s, session %s, client port %s",
config.getRootPath(), session.getCipherSuite().toString(),
String.valueOf(socket.getLocalPort())));
try (ClientConnectionHandler handler = new ClientConnectionHandler(
secureSocket, config);) {
synchronized (this) {
executor = ClientExecutorFactory.getInstance(executorType,
handler, config, data);
notify();
}
boolean authenticated = handler.postAuth(config.getUser(),
config.getPassword());
if (authenticated) {
boolean continueExecution;
do {
continueExecution = executor.execute();
} while (continueExecution);
}
} catch (IOException e) {
Logger.logError(e);
}
} | void function() { SSLSocket socket = secureSocket.getSocket(); SSLSession session = socket.getSession(); Logger.log(String.format( STR, config.getRootPath(), session.getCipherSuite().toString(), String.valueOf(socket.getLocalPort()))); try (ClientConnectionHandler handler = new ClientConnectionHandler( secureSocket, config);) { synchronized (this) { executor = ClientExecutorFactory.getInstance(executorType, handler, config, data); notify(); } boolean authenticated = handler.postAuth(config.getUser(), config.getPassword()); if (authenticated) { boolean continueExecution; do { continueExecution = executor.execute(); } while (continueExecution); } } catch (IOException e) { Logger.logError(e); } } | /**
* Main method of this client thread. Should not be called directly, as
* the operating system does not create a new thread in this case. Call
* {@link #start()} instead.
*/ | Main method of this client thread. Should not be called directly, as the operating system does not create a new thread in this case. Call <code>#start()</code> instead | run | {
"repo_name": "faf0/EncSync",
"path": "src/client/Client.java",
"license": "gpl-3.0",
"size": 7994
} | [
"java.io.IOException",
"javax.net.ssl.SSLSession",
"javax.net.ssl.SSLSocket"
] | import java.io.IOException; import javax.net.ssl.SSLSession; import javax.net.ssl.SSLSocket; | import java.io.*; import javax.net.ssl.*; | [
"java.io",
"javax.net"
] | java.io; javax.net; | 2,344,989 |
public void addKeyValue(String key, Object value) {
keys.add(key);
resources.setThemeProperty(themeName, key, value);
//theme.put(key, value);
Collections.sort(keys);
int row = keys.indexOf(key);
fireTableRowsInserted(row, row);
refreshTheme();
} | void function(String key, Object value) { keys.add(key); resources.setThemeProperty(themeName, key, value); Collections.sort(keys); int row = keys.indexOf(key); fireTableRowsInserted(row, row); refreshTheme(); } | /**
* This method is only used for constants!
*/ | This method is only used for constants | addKeyValue | {
"repo_name": "sdwolf/CodenameOne",
"path": "CodenameOneDesigner/src/com/codename1/designer/ThemeEditor.java",
"license": "gpl-2.0",
"size": 99092
} | [
"java.util.Collections"
] | import java.util.Collections; | import java.util.*; | [
"java.util"
] | java.util; | 1,563,329 |
private void testProgressLines(ProjectFile file)
{
SimpleDateFormat df = new SimpleDateFormat("dd/MM/yyyy");
List<View> views = file.getViews();
//
// Retrieve the Gantt Chart view
//
GanttChartView view = (GanttChartView) views.get(0);
assertEquals("Gantt Chart", view.getName());
assertTrue(view.getProgressLinesEnabled());
assertFalse(view.getProgressLinesAtCurrentDate());
assertTrue(view.getProgressLinesAtRecurringIntervals());
assertEquals(Interval.WEEKLY, view.getProgressLinesInterval());
assertEquals(1, view.getProgressLinesIntervalDailyDayNumber());
assertTrue(view.isProgressLinesIntervalDailyWorkday());
boolean[] weeklyDay = view.getProgressLinesIntervalWeeklyDay();
assertFalse(weeklyDay[Day.SUNDAY.getValue()]);
assertTrue(weeklyDay[Day.MONDAY.getValue()]);
assertFalse(weeklyDay[Day.TUESDAY.getValue()]);
assertFalse(weeklyDay[Day.WEDNESDAY.getValue()]);
assertFalse(weeklyDay[Day.THURSDAY.getValue()]);
assertFalse(weeklyDay[Day.FRIDAY.getValue()]);
assertFalse(weeklyDay[Day.SATURDAY.getValue()]);
assertEquals(1, view.getProgressLinesIntervalWeekleyWeekNumber());
assertFalse(view.getProgressLinesIntervalMonthlyDay());
assertEquals(1, view.getProgressLinesIntervalMonthlyDayMonthNumber());
assertEquals(1, view.getProgressLinesIntervalMonthlyDayDayNumber());
assertEquals(ProgressLineDay.DAY, view.getProgressLinesIntervalMonthlyFirstLastDay());
assertTrue(view.getProgressLinesIntervalMonthlyFirstLast());
assertEquals(1, view.getProgressLinesIntervalMonthlyFirstLastMonthNumber());
assertFalse(view.getProgressLinesBeginAtProjectStart());
assertEquals("13/05/2010", df.format(view.getProgressLinesBeginAtDate()));
assertTrue(view.getProgressLinesDisplaySelected());
assertTrue(view.getProgressLinesActualPlan());
assertEquals(0, view.getProgressLinesDisplayType());
assertFalse(view.getProgressLinesShowDate());
assertEquals(26, view.getProgressLinesDateFormat());
assertEquals("[FontStyle fontBase=[FontBase name=Arial size=8] italic=false bold=false underline=false strikethrough=false color=java.awt.Color[r=0,g=0,b=0] backgroundColor=null backgroundPattern=Solid]", view.getProgressLinesFontStyle().toString());
assertEquals("java.awt.Color[r=255,g=0,b=0]", view.getProgressLinesCurrentLineColor().toString());
assertEquals(LineStyle.SOLID, view.getProgressLinesCurrentLineStyle());
assertEquals("java.awt.Color[r=255,g=0,b=0]", view.getProgressLinesCurrentProgressPointColor().toString());
assertEquals(13, view.getProgressLinesCurrentProgressPointShape());
assertEquals(null, view.getProgressLinesOtherLineColor());
assertEquals(LineStyle.SOLID, view.getProgressLinesOtherLineStyle());
assertEquals(null, view.getProgressLinesOtherProgressPointColor());
assertEquals(0, view.getProgressLinesOtherProgressPointShape());
assertEquals(2, view.getProgressLinesDisplaySelectedDates().length);
assertEquals("01/02/2010", df.format(view.getProgressLinesDisplaySelectedDates()[0]));
assertEquals("01/01/2010", df.format(view.getProgressLinesDisplaySelectedDates()[1]));
}
private static final String[] TABLE_FONT_STYLES =
{
"[ColumnFontStyle rowUniqueID=3 fieldType=Text2 color=java.awt.Color[r=0,g=0,b=255]]",
"[ColumnFontStyle rowUniqueID=-1 fieldType=Task Name italic=false bold=true underline=false font=[FontBase name=Arial Black size=8] color=null backgroundColor=java.awt.Color[r=0,g=0,b=0] backgroundPattern=Transparent]",
"[ColumnFontStyle rowUniqueID=-1 fieldType=Duration italic=false bold=true underline=false font=[FontBase name=Arial size=8] color=null backgroundColor=java.awt.Color[r=0,g=0,b=0] backgroundPattern=Transparent]",
"[ColumnFontStyle rowUniqueID=-1 fieldType=Start italic=true bold=false underline=false font=[FontBase name=Arial size=8] color=null backgroundColor=java.awt.Color[r=0,g=0,b=0] backgroundPattern=Transparent]",
"[ColumnFontStyle rowUniqueID=-1 fieldType=Finish italic=true bold=true underline=false font=[FontBase name=Arial size=8] color=null backgroundColor=java.awt.Color[r=0,g=0,b=0] backgroundPattern=Transparent]",
"[ColumnFontStyle rowUniqueID=-1 fieldType=Predecessors italic=false bold=false underline=false font=[FontBase name=Arial size=10] color=null backgroundColor=java.awt.Color[r=0,g=0,b=0] backgroundPattern=Transparent]",
"[ColumnFontStyle rowUniqueID=-1 fieldType=Text1 italic=false bold=false underline=true font=[FontBase name=Arial size=8] color=null backgroundColor=java.awt.Color[r=0,g=0,b=0] backgroundPattern=Transparent]",
"[ColumnFontStyle rowUniqueID=-1 fieldType=Text2 italic=false bold=false underline=false font=[FontBase name=Arial size=8] color=java.awt.Color[r=255,g=0,b=0] backgroundColor=java.awt.Color[r=0,g=0,b=0] backgroundPattern=Transparent]"
};
private static Set<String> TABLE_FONT_STYLES_SET = new HashSet<String>();
static
{
for (String style : TABLE_FONT_STYLES)
{
TABLE_FONT_STYLES_SET.add(style);
}
} | void function(ProjectFile file) { SimpleDateFormat df = new SimpleDateFormat(STR); List<View> views = file.getViews(); assertEquals(STR, view.getName()); assertTrue(view.getProgressLinesEnabled()); assertFalse(view.getProgressLinesAtCurrentDate()); assertTrue(view.getProgressLinesAtRecurringIntervals()); assertEquals(Interval.WEEKLY, view.getProgressLinesInterval()); assertEquals(1, view.getProgressLinesIntervalDailyDayNumber()); assertTrue(view.isProgressLinesIntervalDailyWorkday()); boolean[] weeklyDay = view.getProgressLinesIntervalWeeklyDay(); assertFalse(weeklyDay[Day.SUNDAY.getValue()]); assertTrue(weeklyDay[Day.MONDAY.getValue()]); assertFalse(weeklyDay[Day.TUESDAY.getValue()]); assertFalse(weeklyDay[Day.WEDNESDAY.getValue()]); assertFalse(weeklyDay[Day.THURSDAY.getValue()]); assertFalse(weeklyDay[Day.FRIDAY.getValue()]); assertFalse(weeklyDay[Day.SATURDAY.getValue()]); assertEquals(1, view.getProgressLinesIntervalWeekleyWeekNumber()); assertFalse(view.getProgressLinesIntervalMonthlyDay()); assertEquals(1, view.getProgressLinesIntervalMonthlyDayMonthNumber()); assertEquals(1, view.getProgressLinesIntervalMonthlyDayDayNumber()); assertEquals(ProgressLineDay.DAY, view.getProgressLinesIntervalMonthlyFirstLastDay()); assertTrue(view.getProgressLinesIntervalMonthlyFirstLast()); assertEquals(1, view.getProgressLinesIntervalMonthlyFirstLastMonthNumber()); assertFalse(view.getProgressLinesBeginAtProjectStart()); assertEquals(STR, df.format(view.getProgressLinesBeginAtDate())); assertTrue(view.getProgressLinesDisplaySelected()); assertTrue(view.getProgressLinesActualPlan()); assertEquals(0, view.getProgressLinesDisplayType()); assertFalse(view.getProgressLinesShowDate()); assertEquals(26, view.getProgressLinesDateFormat()); assertEquals(STR, view.getProgressLinesFontStyle().toString()); assertEquals(STR, view.getProgressLinesCurrentLineColor().toString()); assertEquals(LineStyle.SOLID, view.getProgressLinesCurrentLineStyle()); assertEquals(STR, view.getProgressLinesCurrentProgressPointColor().toString()); assertEquals(13, view.getProgressLinesCurrentProgressPointShape()); assertEquals(null, view.getProgressLinesOtherLineColor()); assertEquals(LineStyle.SOLID, view.getProgressLinesOtherLineStyle()); assertEquals(null, view.getProgressLinesOtherProgressPointColor()); assertEquals(0, view.getProgressLinesOtherProgressPointShape()); assertEquals(2, view.getProgressLinesDisplaySelectedDates().length); assertEquals(STR, df.format(view.getProgressLinesDisplaySelectedDates()[0])); assertEquals(STR, df.format(view.getProgressLinesDisplaySelectedDates()[1])); } private static final String[] TABLE_FONT_STYLES = { STR, STR, STR, STR, STR, STR, STR, STR }; private static Set<String> TABLE_FONT_STYLES_SET = new HashSet<String>(); static { for (String style : TABLE_FONT_STYLES) { TABLE_FONT_STYLES_SET.add(style); } } | /**
* Test the progress line settings.
*
* @param file project file
*/ | Test the progress line settings | testProgressLines | {
"repo_name": "tmyroadctfig/mpxj",
"path": "net/sf/mpxj/junit/MppGanttTest.java",
"license": "lgpl-2.1",
"size": 20210
} | [
"java.text.SimpleDateFormat",
"java.util.HashSet",
"java.util.List",
"java.util.Set",
"net.sf.mpxj.Day",
"net.sf.mpxj.ProjectFile",
"net.sf.mpxj.View",
"net.sf.mpxj.mpp.Interval",
"net.sf.mpxj.mpp.LineStyle",
"net.sf.mpxj.mpp.ProgressLineDay"
] | import java.text.SimpleDateFormat; import java.util.HashSet; import java.util.List; import java.util.Set; import net.sf.mpxj.Day; import net.sf.mpxj.ProjectFile; import net.sf.mpxj.View; import net.sf.mpxj.mpp.Interval; import net.sf.mpxj.mpp.LineStyle; import net.sf.mpxj.mpp.ProgressLineDay; | import java.text.*; import java.util.*; import net.sf.mpxj.*; import net.sf.mpxj.mpp.*; | [
"java.text",
"java.util",
"net.sf.mpxj"
] | java.text; java.util; net.sf.mpxj; | 1,372,175 |
@Source("com/google/appinventor/images/listPicker.png")
ImageResource listpicker(); | @Source(STR) ImageResource listpicker(); | /**
* Designer palette item: ListPicker component
*/ | Designer palette item: ListPicker component | listpicker | {
"repo_name": "satgod/appinventor",
"path": "appinventor/appengine/src/com/google/appinventor/client/Images.java",
"license": "mit",
"size": 12209
} | [
"com.google.gwt.resources.client.ImageResource"
] | import com.google.gwt.resources.client.ImageResource; | import com.google.gwt.resources.client.*; | [
"com.google.gwt"
] | com.google.gwt; | 1,410,564 |
@Deprecated
public Path getBasePath() {
return getCheckpointPath();
} | Path function() { return getCheckpointPath(); } | /**
* Gets the base directory where all the checkpoints are stored. The job-specific checkpoint
* directory is created inside this directory.
*
* @return The base directory for checkpoints.
* @deprecated Deprecated in favor of {@link #getCheckpointPath()}.
*/ | Gets the base directory where all the checkpoints are stored. The job-specific checkpoint directory is created inside this directory | getBasePath | {
"repo_name": "rmetzger/flink",
"path": "flink-runtime/src/main/java/org/apache/flink/runtime/state/filesystem/FsStateBackend.java",
"license": "apache-2.0",
"size": 28249
} | [
"org.apache.flink.core.fs.Path"
] | import org.apache.flink.core.fs.Path; | import org.apache.flink.core.fs.*; | [
"org.apache.flink"
] | org.apache.flink; | 1,099,718 |
processOutputString = FileUtils.readFileToString(new File(RESOURCE_PATH + "processlist.txt"),
StandardCharsets.UTF_8.toString());
log.info("string=" + processOutputString);
} | processOutputString = FileUtils.readFileToString(new File(RESOURCE_PATH + STR), StandardCharsets.UTF_8.toString()); log.info(STR + processOutputString); } | /**
* Before test handler
*/ | Before test handler | setup | {
"repo_name": "ria-ee/X-Road",
"path": "src/monitor/src/test/java/ee/ria/xroad/monitor/executablelister/ProcessListerTest.java",
"license": "mit",
"size": 3325
} | [
"java.io.File",
"java.nio.charset.StandardCharsets",
"org.apache.commons.io.FileUtils"
] | import java.io.File; import java.nio.charset.StandardCharsets; import org.apache.commons.io.FileUtils; | import java.io.*; import java.nio.charset.*; import org.apache.commons.io.*; | [
"java.io",
"java.nio",
"org.apache.commons"
] | java.io; java.nio; org.apache.commons; | 723,232 |
@VisibleForTesting
protected boolean configureLog4j(URL url){
if (url.getFile().toLowerCase().endsWith(".xml")){
DOMConfigurator.configure(url);
} else {
PropertyConfigurator.configure(url);
}
// Previous calls doesn't throw any exceptions and doesn't return fail state.
// So we check appenders, as most representative error indicator
Logger rootLogger = LogManager.getRootLogger();
if (!rootLogger.getAllAppenders().hasMoreElements()){
logToConsole("Log4j error during load configuraton file or no appenders presented");
LogManager.resetConfiguration();
return false;
}
return true;
}
private static class FileInfo {
private final String sourceDescriptor;
private final String logFileName;
public FileInfo(String sourceDescriptor, String logFileName) {
this.sourceDescriptor = sourceDescriptor;
this.logFileName = logFileName;
} | boolean function(URL url){ if (url.getFile().toLowerCase().endsWith(".xml")){ DOMConfigurator.configure(url); } else { PropertyConfigurator.configure(url); } Logger rootLogger = LogManager.getRootLogger(); if (!rootLogger.getAllAppenders().hasMoreElements()){ logToConsole(STR); LogManager.resetConfiguration(); return false; } return true; } private static class FileInfo { private final String sourceDescriptor; private final String logFileName; public FileInfo(String sourceDescriptor, String logFileName) { this.sourceDescriptor = sourceDescriptor; this.logFileName = logFileName; } | /**
* Configures log4j from {@link URL} and checks regular Log4j configure class by extension (like default log4j
* loader)
* @param url to configuration file
* @return {@code true} if one or more appenders was added, {@code false} otherwise
*/ | Configures log4j from <code>URL</code> and checks regular Log4j configure class by extension (like default log4j loader) | configureLog4j | {
"repo_name": "NCNecros/jcommune",
"path": "jcommune-view/jcommune-web-controller/src/main/java/org/jtalks/jcommune/web/listeners/LoggerInitializationListener.java",
"license": "lgpl-2.1",
"size": 10876
} | [
"org.apache.log4j.LogManager",
"org.apache.log4j.Logger",
"org.apache.log4j.PropertyConfigurator",
"org.apache.log4j.xml.DOMConfigurator"
] | import org.apache.log4j.LogManager; import org.apache.log4j.Logger; import org.apache.log4j.PropertyConfigurator; import org.apache.log4j.xml.DOMConfigurator; | import org.apache.log4j.*; import org.apache.log4j.xml.*; | [
"org.apache.log4j"
] | org.apache.log4j; | 1,086,293 |
default DataTransactionResult remove(Vector3i coordinates, Class<? extends DataManipulator<?, ?>> manipulatorClass) {
return remove(coordinates.getX(), coordinates.getY(), coordinates.getZ(), manipulatorClass);
} | default DataTransactionResult remove(Vector3i coordinates, Class<? extends DataManipulator<?, ?>> manipulatorClass) { return remove(coordinates.getX(), coordinates.getY(), coordinates.getZ(), manipulatorClass); } | /**
* Attempts to remove the given {@link DataManipulator} represented by the
* block at the given location if possible.
*
* <p>Certain {@link DataManipulator}s can not be removed due to certain
* dependencies relying on the particular data to function.</p>
*
* @param coordinates The position of the block
* @param manipulatorClass The data class
* @return If the manipulator was removed
*/ | Attempts to remove the given <code>DataManipulator</code> represented by the block at the given location if possible. Certain <code>DataManipulator</code>s can not be removed due to certain dependencies relying on the particular data to function | remove | {
"repo_name": "kashike/SpongeAPI",
"path": "src/main/java/org/spongepowered/api/world/extent/LocationCompositeValueStore.java",
"license": "mit",
"size": 38496
} | [
"com.flowpowered.math.vector.Vector3i",
"org.spongepowered.api.data.DataTransactionResult",
"org.spongepowered.api.data.manipulator.DataManipulator"
] | import com.flowpowered.math.vector.Vector3i; import org.spongepowered.api.data.DataTransactionResult; import org.spongepowered.api.data.manipulator.DataManipulator; | import com.flowpowered.math.vector.*; import org.spongepowered.api.data.*; import org.spongepowered.api.data.manipulator.*; | [
"com.flowpowered.math",
"org.spongepowered.api"
] | com.flowpowered.math; org.spongepowered.api; | 1,559,109 |
@Override
public void update(ComplexEventChunk<StateEvent> updatingEventChunk, Object storeEvents, UpdateAttributeMapper[]
updateAttributeMappers) {
updatingEventChunk.reset();
while (updatingEventChunk.hasNext()) {
StateEvent updatingEvent = updatingEventChunk.next();
try {
for (int i = 0; i < ((HazelcastCollectionEventHolder) storeEvents).size(); i++) {
StreamEvent storeEvent = ((HazelcastCollectionEventHolder) storeEvents).get(i);
updatingEvent.setEvent(storeEventPosition, storeEvent);
if ((Boolean) expressionExecutor.execute(updatingEvent)) {
for (UpdateAttributeMapper updateAttributeMapper : updateAttributeMappers) {
updateAttributeMapper.mapOutputData(updatingEvent, storeEvent);
}
((HazelcastCollectionEventHolder) storeEvents).set(i, storeEvent);
}
}
} finally {
updatingEvent.setEvent(storeEventPosition, null);
}
}
} | void function(ComplexEventChunk<StateEvent> updatingEventChunk, Object storeEvents, UpdateAttributeMapper[] updateAttributeMappers) { updatingEventChunk.reset(); while (updatingEventChunk.hasNext()) { StateEvent updatingEvent = updatingEventChunk.next(); try { for (int i = 0; i < ((HazelcastCollectionEventHolder) storeEvents).size(); i++) { StreamEvent storeEvent = ((HazelcastCollectionEventHolder) storeEvents).get(i); updatingEvent.setEvent(storeEventPosition, storeEvent); if ((Boolean) expressionExecutor.execute(updatingEvent)) { for (UpdateAttributeMapper updateAttributeMapper : updateAttributeMappers) { updateAttributeMapper.mapOutputData(updatingEvent, storeEvent); } ((HazelcastCollectionEventHolder) storeEvents).set(i, storeEvent); } } } finally { updatingEvent.setEvent(storeEventPosition, null); } } } | /**
* Called when updating the event table entries.
*
* @param updatingEventChunk Event list that needs to be updated.
* @param storeEvents Map of store events.
* @param updateAttributeMappers Mapping positions array.
*/ | Called when updating the event table entries | update | {
"repo_name": "lgobinath/siddhi",
"path": "modules/siddhi-extensions/event-table/src/main/java/org/wso2/siddhi/extension/table/hazelcast/HazelcastCollectionOperator.java",
"license": "apache-2.0",
"size": 5947
} | [
"org.wso2.siddhi.core.event.ComplexEventChunk",
"org.wso2.siddhi.core.event.state.StateEvent",
"org.wso2.siddhi.core.event.stream.StreamEvent",
"org.wso2.siddhi.core.util.collection.UpdateAttributeMapper"
] | import org.wso2.siddhi.core.event.ComplexEventChunk; import org.wso2.siddhi.core.event.state.StateEvent; import org.wso2.siddhi.core.event.stream.StreamEvent; import org.wso2.siddhi.core.util.collection.UpdateAttributeMapper; | import org.wso2.siddhi.core.event.*; import org.wso2.siddhi.core.event.state.*; import org.wso2.siddhi.core.event.stream.*; import org.wso2.siddhi.core.util.collection.*; | [
"org.wso2.siddhi"
] | org.wso2.siddhi; | 1,325,785 |
private int findNextHintCandidate(int line, int col, int mode) {
int index = Sudoku2.getIndex(line, col);
int showHintCellValue = getShowHintCellValue();
if (showHintCellValue == 0) {
return index;
}
switch (mode) {
case KeyEvent.VK_DOWN:
// let's start with the next line
line++;
if (line == 9) {
line = 0;
col++;
if (col == 9) {
return index;
}
}
for (int i = col; i < 9; i++) {
int j = i == col ? line : 0;
for (; j < 9; j++) {
if (sudoku.getValue(j, i) == 0
&& sudoku.isCandidate(j, i, showHintCellValue, !showCandidates)) {
return Sudoku2.getIndex(j, i);
}
}
}
break;
case KeyEvent.VK_UP:
// let's start with the previous line
line--;
if (line < 0) {
line = 8;
col--;
if (col < 0) {
return index;
}
}
for (int i = col; i >= 0; i--) {
int j = i == col ? line : 8;
for (; j >= 0; j--) {
if (sudoku.getValue(j, i) == 0
&& sudoku.isCandidate(j, i, showHintCellValue, !showCandidates)) {
return Sudoku2.getIndex(j, i);
}
}
}
break;
case KeyEvent.VK_LEFT:
// lets start left
index--;
if (index < 0) {
return index + 1;
}
while (index >= 0) {
if (sudoku.getValue(index) == 0
&& sudoku.isCandidate(index, showHintCellValue, !showCandidates)) {
return index;
}
index--;
}
if (index < 0) {
index = Sudoku2.getIndex(line, col);
}
break;
case KeyEvent.VK_RIGHT:
// lets start right
index++;
if (index >= sudoku.getCells().length) {
return index - 1;
}
while (index < sudoku.getCells().length) {
if (sudoku.getValue(index) == 0
&& sudoku.isCandidate(index, showHintCellValue, !showCandidates)) {
return index;
}
index++;
}
if (index >= sudoku.getCells().length) {
index = Sudoku2.getIndex(line, col);
}
break;
}
return index;
} | int function(int line, int col, int mode) { int index = Sudoku2.getIndex(line, col); int showHintCellValue = getShowHintCellValue(); if (showHintCellValue == 0) { return index; } switch (mode) { case KeyEvent.VK_DOWN: line++; if (line == 9) { line = 0; col++; if (col == 9) { return index; } } for (int i = col; i < 9; i++) { int j = i == col ? line : 0; for (; j < 9; j++) { if (sudoku.getValue(j, i) == 0 && sudoku.isCandidate(j, i, showHintCellValue, !showCandidates)) { return Sudoku2.getIndex(j, i); } } } break; case KeyEvent.VK_UP: line--; if (line < 0) { line = 8; col--; if (col < 0) { return index; } } for (int i = col; i >= 0; i--) { int j = i == col ? line : 8; for (; j >= 0; j--) { if (sudoku.getValue(j, i) == 0 && sudoku.isCandidate(j, i, showHintCellValue, !showCandidates)) { return Sudoku2.getIndex(j, i); } } } break; case KeyEvent.VK_LEFT: index--; if (index < 0) { return index + 1; } while (index >= 0) { if (sudoku.getValue(index) == 0 && sudoku.isCandidate(index, showHintCellValue, !showCandidates)) { return index; } index--; } if (index < 0) { index = Sudoku2.getIndex(line, col); } break; case KeyEvent.VK_RIGHT: index++; if (index >= sudoku.getCells().length) { return index - 1; } while (index < sudoku.getCells().length) { if (sudoku.getValue(index) == 0 && sudoku.isCandidate(index, showHintCellValue, !showCandidates)) { return index; } index++; } if (index >= sudoku.getCells().length) { index = Sudoku2.getIndex(line, col); } break; } return index; } | /**
* Finds the next colored cell, if filters are applied. mode gives the
* direction in which to search (as KeyEvent). The search wraps at sudoku
* boundaries.
*
* @param line
* @param col
* @param mode
* @return
*/ | Finds the next colored cell, if filters are applied. mode gives the direction in which to search (as KeyEvent). The search wraps at sudoku boundaries | findNextHintCandidate | {
"repo_name": "mbraeunlein/ExtendedHodoku",
"path": "src/sudoku/SudokuPanel.java",
"license": "gpl-3.0",
"size": 182080
} | [
"java.awt.event.KeyEvent"
] | import java.awt.event.KeyEvent; | import java.awt.event.*; | [
"java.awt"
] | java.awt; | 2,090,274 |
Iterator<E> descendingIterator();
| Iterator<E> descendingIterator(); | /**
* Returns an iterator over the elements in this deque in reverse
* sequential order. The elements will be returned in order from
* last (tail) to first (head).
*
* @return an iterator over the elements in this deque in reverse
* sequence
*/ | Returns an iterator over the elements in this deque in reverse sequential order. The elements will be returned in order from last (tail) to first (head) | descendingIterator | {
"repo_name": "jinmiao0601/appcutt",
"path": "app/src/main/java/com/appcutt/demo/libs/imageloader/com/nostra13/universalimageloader/core/assist/deque/Deque.java",
"license": "apache-2.0",
"size": 22747
} | [
"java.util.Iterator"
] | import java.util.Iterator; | import java.util.*; | [
"java.util"
] | java.util; | 1,957,098 |
private void initFileSystem() throws IOException {
if (fs != null) {
return;
}
org.apache.hadoop.conf.Configuration hadoopConf = HadoopFileSystem.getHadoopConfiguration();
if (fsConfig != null) {
String disableCacheName = String.format("fs.%s.impl.disable.cache", new Path(basePath).toUri().getScheme());
hadoopConf.setBoolean(disableCacheName, true);
for (String key : fsConfig.keySet()) {
hadoopConf.set(key, fsConfig.getString(key, null));
}
}
fs = new Path(basePath).getFileSystem(hadoopConf);
} | void function() throws IOException { if (fs != null) { return; } org.apache.hadoop.conf.Configuration hadoopConf = HadoopFileSystem.getHadoopConfiguration(); if (fsConfig != null) { String disableCacheName = String.format(STR, new Path(basePath).toUri().getScheme()); hadoopConf.setBoolean(disableCacheName, true); for (String key : fsConfig.keySet()) { hadoopConf.set(key, fsConfig.getString(key, null)); } } fs = new Path(basePath).getFileSystem(hadoopConf); } | /**
* Create a file system with the user-defined {@code HDFS} configuration.
* @throws IOException
*/ | Create a file system with the user-defined HDFS configuration | initFileSystem | {
"repo_name": "zohar-mizrahi/flink",
"path": "flink-connectors/flink-connector-filesystem/src/main/java/org/apache/flink/streaming/connectors/fs/bucketing/BucketingSink.java",
"license": "apache-2.0",
"size": 41225
} | [
"java.io.IOException",
"org.apache.flink.configuration.Configuration",
"org.apache.flink.runtime.fs.hdfs.HadoopFileSystem",
"org.apache.hadoop.fs.Path"
] | import java.io.IOException; import org.apache.flink.configuration.Configuration; import org.apache.flink.runtime.fs.hdfs.HadoopFileSystem; import org.apache.hadoop.fs.Path; | import java.io.*; import org.apache.flink.configuration.*; import org.apache.flink.runtime.fs.hdfs.*; import org.apache.hadoop.fs.*; | [
"java.io",
"org.apache.flink",
"org.apache.hadoop"
] | java.io; org.apache.flink; org.apache.hadoop; | 1,619,193 |
public final void setRewrite(final ASTRewrite rewrite, final CompilationUnit root) {
Assert.isTrue(rewrite == null || root != null);
fRewrite= rewrite;
fRoot= root;
} | final void function(final ASTRewrite rewrite, final CompilationUnit root) { Assert.isTrue(rewrite == null root != null); fRewrite= rewrite; fRoot= root; } | /**
* Sets the AST rewrite to use for member visibility adjustments.
* <p>
* This method must be called before calling {@link MemberVisibilityAdjustor#adjustVisibility(IProgressMonitor)}. The default is to use a compilation unit rewrite.
*
* @param rewrite the AST rewrite to set
* @param root the root of the AST used in the rewrite
*/ | Sets the AST rewrite to use for member visibility adjustments. This method must be called before calling <code>MemberVisibilityAdjustor#adjustVisibility(IProgressMonitor)</code>. The default is to use a compilation unit rewrite | setRewrite | {
"repo_name": "elucash/eclipse-oxygen",
"path": "org.eclipse.jdt.ui/src/org/eclipse/jdt/internal/corext/refactoring/structure/MemberVisibilityAdjustor.java",
"license": "epl-1.0",
"size": 56703
} | [
"org.eclipse.core.runtime.Assert",
"org.eclipse.jdt.core.dom.CompilationUnit",
"org.eclipse.jdt.core.dom.rewrite.ASTRewrite"
] | import org.eclipse.core.runtime.Assert; import org.eclipse.jdt.core.dom.CompilationUnit; import org.eclipse.jdt.core.dom.rewrite.ASTRewrite; | import org.eclipse.core.runtime.*; import org.eclipse.jdt.core.dom.*; import org.eclipse.jdt.core.dom.rewrite.*; | [
"org.eclipse.core",
"org.eclipse.jdt"
] | org.eclipse.core; org.eclipse.jdt; | 1,683,928 |
public Object eval(final Reader reader, final Bindings bindings, final String language)
throws ScriptException {
if (!scriptEngines.containsKey(language))
throw new IllegalArgumentException("Language [%s] not supported");
try {
evaluationCount.incrementAndGet();
return scriptEngines.get(language).eval(reader, bindings);
} finally {
evaluationCount.decrementAndGet();
}
} | Object function(final Reader reader, final Bindings bindings, final String language) throws ScriptException { if (!scriptEngines.containsKey(language)) throw new IllegalArgumentException(STR); try { evaluationCount.incrementAndGet(); return scriptEngines.get(language).eval(reader, bindings); } finally { evaluationCount.decrementAndGet(); } } | /**
* Evaluate a script with {@code Bindings} for a particular language.
*/ | Evaluate a script with Bindings for a particular language | eval | {
"repo_name": "mpollmeier/tinkerpop3",
"path": "gremlin-groovy/src/main/java/com/tinkerpop/gremlin/groovy/engine/ScriptEngines.java",
"license": "apache-2.0",
"size": 10772
} | [
"java.io.Reader",
"javax.script.Bindings",
"javax.script.ScriptException"
] | import java.io.Reader; import javax.script.Bindings; import javax.script.ScriptException; | import java.io.*; import javax.script.*; | [
"java.io",
"javax.script"
] | java.io; javax.script; | 1,441,245 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.