repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
LableOrg/java-uniqueid | uniqueid-zookeeper/src/main/java/org/lable/oss/uniqueid/zookeeper/ResourceClaim.java | ResourceClaim.acquireLock | static String acquireLock(ZooKeeper zookeeper, String lockNode) throws KeeperException, InterruptedException {
// Inspired by the queueing algorithm suggested here:
// http://zookeeper.apache.org/doc/trunk/recipes.html#sc_recipes_Queues
// Acquire a place in the queue by creating an ephemeral, ... | java | static String acquireLock(ZooKeeper zookeeper, String lockNode) throws KeeperException, InterruptedException {
// Inspired by the queueing algorithm suggested here:
// http://zookeeper.apache.org/doc/trunk/recipes.html#sc_recipes_Queues
// Acquire a place in the queue by creating an ephemeral, ... | [
"static",
"String",
"acquireLock",
"(",
"ZooKeeper",
"zookeeper",
",",
"String",
"lockNode",
")",
"throws",
"KeeperException",
",",
"InterruptedException",
"{",
"// Inspired by the queueing algorithm suggested here:",
"// http://zookeeper.apache.org/doc/trunk/recipes.html#sc_recipes_... | Try to acquire a lock on for choosing a resource. This method will wait until it has acquired the lock.
@param zookeeper ZooKeeper connection to use.
@param lockNode Path to the znode representing the locking queue.
@return Name of the first node in the queue. | [
"Try",
"to",
"acquire",
"a",
"lock",
"on",
"for",
"choosing",
"a",
"resource",
".",
"This",
"method",
"will",
"wait",
"until",
"it",
"has",
"acquired",
"the",
"lock",
"."
] | 554e30b2277765f365e7c7f598108de0ab5744f4 | https://github.com/LableOrg/java-uniqueid/blob/554e30b2277765f365e7c7f598108de0ab5744f4/uniqueid-zookeeper/src/main/java/org/lable/oss/uniqueid/zookeeper/ResourceClaim.java#L165-L175 | train |
LableOrg/java-uniqueid | uniqueid-zookeeper/src/main/java/org/lable/oss/uniqueid/zookeeper/ResourceClaim.java | ResourceClaim.takeQueueTicket | static String takeQueueTicket(ZooKeeper zookeeper, String lockNode) throws InterruptedException, KeeperException {
// The ticket number includes a random component to decrease the chances of collision. Collision is handled
// neatly, but it saves a few actions if there is no need to retry ticket acquisi... | java | static String takeQueueTicket(ZooKeeper zookeeper, String lockNode) throws InterruptedException, KeeperException {
// The ticket number includes a random component to decrease the chances of collision. Collision is handled
// neatly, but it saves a few actions if there is no need to retry ticket acquisi... | [
"static",
"String",
"takeQueueTicket",
"(",
"ZooKeeper",
"zookeeper",
",",
"String",
"lockNode",
")",
"throws",
"InterruptedException",
",",
"KeeperException",
"{",
"// The ticket number includes a random component to decrease the chances of collision. Collision is handled",
"// neat... | Take a ticket for the queue. If the ticket was already claimed by another process,
this method retries until it succeeds.
@param zookeeper ZooKeeper connection to use.
@param lockNode Path to the znode representing the locking queue.
@return The claimed ticket. | [
"Take",
"a",
"ticket",
"for",
"the",
"queue",
".",
"If",
"the",
"ticket",
"was",
"already",
"claimed",
"by",
"another",
"process",
"this",
"method",
"retries",
"until",
"it",
"succeeds",
"."
] | 554e30b2277765f365e7c7f598108de0ab5744f4 | https://github.com/LableOrg/java-uniqueid/blob/554e30b2277765f365e7c7f598108de0ab5744f4/uniqueid-zookeeper/src/main/java/org/lable/oss/uniqueid/zookeeper/ResourceClaim.java#L185-L194 | train |
LableOrg/java-uniqueid | uniqueid-zookeeper/src/main/java/org/lable/oss/uniqueid/zookeeper/ResourceClaim.java | ResourceClaim.releaseTicket | static void releaseTicket(ZooKeeper zookeeper, String lockNode, String ticket)
throws KeeperException, InterruptedException {
logger.debug("Releasing ticket {}.", ticket);
try {
zookeeper.delete(lockNode + "/" + ticket, -1);
} catch (KeeperException e) {
if (... | java | static void releaseTicket(ZooKeeper zookeeper, String lockNode, String ticket)
throws KeeperException, InterruptedException {
logger.debug("Releasing ticket {}.", ticket);
try {
zookeeper.delete(lockNode + "/" + ticket, -1);
} catch (KeeperException e) {
if (... | [
"static",
"void",
"releaseTicket",
"(",
"ZooKeeper",
"zookeeper",
",",
"String",
"lockNode",
",",
"String",
"ticket",
")",
"throws",
"KeeperException",
",",
"InterruptedException",
"{",
"logger",
".",
"debug",
"(",
"\"Releasing ticket {}.\"",
",",
"ticket",
")",
"... | Release an acquired lock.
@param zookeeper ZooKeeper connection to use.
@param lockNode Path to the znode representing the locking queue.
@param ticket Name of the first node in the queue. | [
"Release",
"an",
"acquired",
"lock",
"."
] | 554e30b2277765f365e7c7f598108de0ab5744f4 | https://github.com/LableOrg/java-uniqueid/blob/554e30b2277765f365e7c7f598108de0ab5744f4/uniqueid-zookeeper/src/main/java/org/lable/oss/uniqueid/zookeeper/ResourceClaim.java#L203-L215 | train |
LableOrg/java-uniqueid | uniqueid-zookeeper/src/main/java/org/lable/oss/uniqueid/zookeeper/ResourceClaim.java | ResourceClaim.waitInLine | static String waitInLine(ZooKeeper zookeeper, String lockNode, String placeInLine)
throws KeeperException, InterruptedException {
// Get the list of nodes in the queue, and find out what our position is.
List<String> children = zookeeper.getChildren(lockNode, false);
// The list re... | java | static String waitInLine(ZooKeeper zookeeper, String lockNode, String placeInLine)
throws KeeperException, InterruptedException {
// Get the list of nodes in the queue, and find out what our position is.
List<String> children = zookeeper.getChildren(lockNode, false);
// The list re... | [
"static",
"String",
"waitInLine",
"(",
"ZooKeeper",
"zookeeper",
",",
"String",
"lockNode",
",",
"String",
"placeInLine",
")",
"throws",
"KeeperException",
",",
"InterruptedException",
"{",
"// Get the list of nodes in the queue, and find out what our position is.",
"List",
"... | Wait in the queue until the znode in front of us changes.
@param zookeeper ZooKeeper connection to use.
@param lockNode Path to the znode representing the locking queue.
@param placeInLine Name of our current position in the queue.
@return Name of the first node in the queue, when we are it. | [
"Wait",
"in",
"the",
"queue",
"until",
"the",
"znode",
"in",
"front",
"of",
"us",
"changes",
"."
] | 554e30b2277765f365e7c7f598108de0ab5744f4 | https://github.com/LableOrg/java-uniqueid/blob/554e30b2277765f365e7c7f598108de0ab5744f4/uniqueid-zookeeper/src/main/java/org/lable/oss/uniqueid/zookeeper/ResourceClaim.java#L225-L292 | train |
LableOrg/java-uniqueid | uniqueid-zookeeper/src/main/java/org/lable/oss/uniqueid/zookeeper/ResourceClaim.java | ResourceClaim.grabTicket | static boolean grabTicket(ZooKeeper zookeeper, String lockNode, String ticket)
throws InterruptedException, KeeperException {
try {
zookeeper.create(lockNode + "/" + ticket, new byte[0], ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.EPHEMERAL);
} catch (KeeperException e) {
... | java | static boolean grabTicket(ZooKeeper zookeeper, String lockNode, String ticket)
throws InterruptedException, KeeperException {
try {
zookeeper.create(lockNode + "/" + ticket, new byte[0], ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.EPHEMERAL);
} catch (KeeperException e) {
... | [
"static",
"boolean",
"grabTicket",
"(",
"ZooKeeper",
"zookeeper",
",",
"String",
"lockNode",
",",
"String",
"ticket",
")",
"throws",
"InterruptedException",
",",
"KeeperException",
"{",
"try",
"{",
"zookeeper",
".",
"create",
"(",
"lockNode",
"+",
"\"/\"",
"+",
... | Grab a ticket in the queue.
@param zookeeper ZooKeeper connection to use.
@param lockNode Path to the znode representing the locking queue.
@param ticket Name of the ticket to attempt to grab.
@return True on success, false if the ticket was already grabbed by another process. | [
"Grab",
"a",
"ticket",
"in",
"the",
"queue",
"."
] | 554e30b2277765f365e7c7f598108de0ab5744f4 | https://github.com/LableOrg/java-uniqueid/blob/554e30b2277765f365e7c7f598108de0ab5744f4/uniqueid-zookeeper/src/main/java/org/lable/oss/uniqueid/zookeeper/ResourceClaim.java#L302-L318 | train |
LableOrg/java-uniqueid | uniqueid-zookeeper/src/main/java/org/lable/oss/uniqueid/zookeeper/ResourceClaim.java | ResourceClaim.claimResource | int claimResource(ZooKeeper zookeeper, String poolNode, int poolSize)
throws KeeperException, InterruptedException {
logger.debug("Trying to claim a resource.");
List<String> claimedResources = zookeeper.getChildren(poolNode, false);
if (claimedResources.size() >= poolSize) {
... | java | int claimResource(ZooKeeper zookeeper, String poolNode, int poolSize)
throws KeeperException, InterruptedException {
logger.debug("Trying to claim a resource.");
List<String> claimedResources = zookeeper.getChildren(poolNode, false);
if (claimedResources.size() >= poolSize) {
... | [
"int",
"claimResource",
"(",
"ZooKeeper",
"zookeeper",
",",
"String",
"poolNode",
",",
"int",
"poolSize",
")",
"throws",
"KeeperException",
",",
"InterruptedException",
"{",
"logger",
".",
"debug",
"(",
"\"Trying to claim a resource.\"",
")",
";",
"List",
"<",
"St... | Try to claim an available resource from the resource pool.
@param zookeeper ZooKeeper connection to use.
@param poolNode Path to the znode representing the resource pool.
@param poolSize Size of the resource pool.
@return The claimed resource. | [
"Try",
"to",
"claim",
"an",
"available",
"resource",
"from",
"the",
"resource",
"pool",
"."
] | 554e30b2277765f365e7c7f598108de0ab5744f4 | https://github.com/LableOrg/java-uniqueid/blob/554e30b2277765f365e7c7f598108de0ab5744f4/uniqueid-zookeeper/src/main/java/org/lable/oss/uniqueid/zookeeper/ResourceClaim.java#L328-L379 | train |
LableOrg/java-uniqueid | uniqueid-zookeeper/src/main/java/org/lable/oss/uniqueid/zookeeper/ResourceClaim.java | ResourceClaim.relinquishResource | private void relinquishResource(ZooKeeper zookeeper, String poolNode, int resource) {
logger.debug("Relinquishing claimed resource {}.", resource);
try {
zookeeper.delete(poolNode + "/" + Integer.toString(resource), -1);
} catch (InterruptedException e) {
Thread.currentTh... | java | private void relinquishResource(ZooKeeper zookeeper, String poolNode, int resource) {
logger.debug("Relinquishing claimed resource {}.", resource);
try {
zookeeper.delete(poolNode + "/" + Integer.toString(resource), -1);
} catch (InterruptedException e) {
Thread.currentTh... | [
"private",
"void",
"relinquishResource",
"(",
"ZooKeeper",
"zookeeper",
",",
"String",
"poolNode",
",",
"int",
"resource",
")",
"{",
"logger",
".",
"debug",
"(",
"\"Relinquishing claimed resource {}.\"",
",",
"resource",
")",
";",
"try",
"{",
"zookeeper",
".",
"... | Relinquish a claimed resource.
@param zookeeper ZooKeeper connection to use.
@param poolNode Path to the znode representing the resource pool.
@param resource The resource. | [
"Relinquish",
"a",
"claimed",
"resource",
"."
] | 554e30b2277765f365e7c7f598108de0ab5744f4 | https://github.com/LableOrg/java-uniqueid/blob/554e30b2277765f365e7c7f598108de0ab5744f4/uniqueid-zookeeper/src/main/java/org/lable/oss/uniqueid/zookeeper/ResourceClaim.java#L388-L397 | train |
LableOrg/java-uniqueid | uniqueid-zookeeper/src/main/java/org/lable/oss/uniqueid/zookeeper/ClusterID.java | ClusterID.get | public static int get(ZooKeeper zookeeper, String znode) throws IOException {
try {
Stat stat = zookeeper.exists(znode + CLUSTER_ID_NODE, false);
if (stat == null) {
mkdirp(zookeeper, znode);
create(zookeeper, znode + CLUSTER_ID_NODE, String.valueOf(DEFAUL... | java | public static int get(ZooKeeper zookeeper, String znode) throws IOException {
try {
Stat stat = zookeeper.exists(znode + CLUSTER_ID_NODE, false);
if (stat == null) {
mkdirp(zookeeper, znode);
create(zookeeper, znode + CLUSTER_ID_NODE, String.valueOf(DEFAUL... | [
"public",
"static",
"int",
"get",
"(",
"ZooKeeper",
"zookeeper",
",",
"String",
"znode",
")",
"throws",
"IOException",
"{",
"try",
"{",
"Stat",
"stat",
"=",
"zookeeper",
".",
"exists",
"(",
"znode",
"+",
"CLUSTER_ID_NODE",
",",
"false",
")",
";",
"if",
"... | Retrieves the numeric cluster ID from the ZooKeeper quorum.
@param zookeeper ZooKeeper instance to work with.
@return The cluster ID, if configured in the quorum.
@throws IOException Thrown when retrieving the ID fails.
@throws NumberFormatException Thrown when the supposed ID found in the quorum could not b... | [
"Retrieves",
"the",
"numeric",
"cluster",
"ID",
"from",
"the",
"ZooKeeper",
"quorum",
"."
] | 554e30b2277765f365e7c7f598108de0ab5744f4 | https://github.com/LableOrg/java-uniqueid/blob/554e30b2277765f365e7c7f598108de0ab5744f4/uniqueid-zookeeper/src/main/java/org/lable/oss/uniqueid/zookeeper/ClusterID.java#L43-L60 | train |
LableOrg/java-uniqueid | uniqueid-zookeeper/src/main/java/org/lable/oss/uniqueid/zookeeper/ZooKeeperHelper.java | ZooKeeperHelper.pathParts | static List<String> pathParts(String path) {
String[] pathParts = path.split("/");
List<String> parts = new ArrayList<>(pathParts.length);
String pathSoFar = "";
for (String pathPart : pathParts) {
if (!pathPart.equals("")) {
pathSoFar += "/" + pathPart;
... | java | static List<String> pathParts(String path) {
String[] pathParts = path.split("/");
List<String> parts = new ArrayList<>(pathParts.length);
String pathSoFar = "";
for (String pathPart : pathParts) {
if (!pathPart.equals("")) {
pathSoFar += "/" + pathPart;
... | [
"static",
"List",
"<",
"String",
">",
"pathParts",
"(",
"String",
"path",
")",
"{",
"String",
"[",
"]",
"pathParts",
"=",
"path",
".",
"split",
"(",
"\"/\"",
")",
";",
"List",
"<",
"String",
">",
"parts",
"=",
"new",
"ArrayList",
"<>",
"(",
"pathPart... | Parse a znode path, and return a list containing the full paths to its constituent directories.
@param path Path to parse.
@return List of paths. | [
"Parse",
"a",
"znode",
"path",
"and",
"return",
"a",
"list",
"containing",
"the",
"full",
"paths",
"to",
"its",
"constituent",
"directories",
"."
] | 554e30b2277765f365e7c7f598108de0ab5744f4 | https://github.com/LableOrg/java-uniqueid/blob/554e30b2277765f365e7c7f598108de0ab5744f4/uniqueid-zookeeper/src/main/java/org/lable/oss/uniqueid/zookeeper/ZooKeeperHelper.java#L106-L117 | train |
LableOrg/java-uniqueid | uniqueid-core/src/main/java/org/lable/oss/uniqueid/LocalUniqueIDGeneratorFactory.java | LocalUniqueIDGeneratorFactory.generatorFor | public synchronized static IDGenerator generatorFor(int generatorId, int clusterId, Mode mode) {
assertParameterWithinBounds("generatorId", 0, Blueprint.MAX_GENERATOR_ID, generatorId);
assertParameterWithinBounds("clusterId", 0, Blueprint.MAX_CLUSTER_ID, clusterId);
String generatorAndCluster = ... | java | public synchronized static IDGenerator generatorFor(int generatorId, int clusterId, Mode mode) {
assertParameterWithinBounds("generatorId", 0, Blueprint.MAX_GENERATOR_ID, generatorId);
assertParameterWithinBounds("clusterId", 0, Blueprint.MAX_CLUSTER_ID, clusterId);
String generatorAndCluster = ... | [
"public",
"synchronized",
"static",
"IDGenerator",
"generatorFor",
"(",
"int",
"generatorId",
",",
"int",
"clusterId",
",",
"Mode",
"mode",
")",
"{",
"assertParameterWithinBounds",
"(",
"\"generatorId\"",
",",
"0",
",",
"Blueprint",
".",
"MAX_GENERATOR_ID",
",",
"... | Return the UniqueIDGenerator instance for this specific generator-ID, cluster-ID combination. If one was
already created, that is returned.
@param generatorId Generator ID to use (0 ≤ n ≤ 255).
@param clusterId Cluster ID to use (0 ≤ n ≤ 15).
@param mode Generator mode.
@return A thread-safe UniqueIDGenerator... | [
"Return",
"the",
"UniqueIDGenerator",
"instance",
"for",
"this",
"specific",
"generator",
"-",
"ID",
"cluster",
"-",
"ID",
"combination",
".",
"If",
"one",
"was",
"already",
"created",
"that",
"is",
"returned",
"."
] | 554e30b2277765f365e7c7f598108de0ab5744f4 | https://github.com/LableOrg/java-uniqueid/blob/554e30b2277765f365e7c7f598108de0ab5744f4/uniqueid-core/src/main/java/org/lable/oss/uniqueid/LocalUniqueIDGeneratorFactory.java#L45-L54 | train |
LableOrg/java-uniqueid | uniqueid-zookeeper/src/main/java/org/lable/oss/uniqueid/zookeeper/connection/ZooKeeperConnection.java | ZooKeeperConnection.connect | private ZooKeeper connect(String quorumAddresses) throws IOException {
final CountDownLatch latch = new CountDownLatch(1);
ZooKeeper zookeeper;
// Connect to the quorum and wait for the successful connection callback.;
zookeeper = new ZooKeeper(quorumAddresses, (int) SECONDS.toMillis(10... | java | private ZooKeeper connect(String quorumAddresses) throws IOException {
final CountDownLatch latch = new CountDownLatch(1);
ZooKeeper zookeeper;
// Connect to the quorum and wait for the successful connection callback.;
zookeeper = new ZooKeeper(quorumAddresses, (int) SECONDS.toMillis(10... | [
"private",
"ZooKeeper",
"connect",
"(",
"String",
"quorumAddresses",
")",
"throws",
"IOException",
"{",
"final",
"CountDownLatch",
"latch",
"=",
"new",
"CountDownLatch",
"(",
"1",
")",
";",
"ZooKeeper",
"zookeeper",
";",
"// Connect to the quorum and wait for the succes... | Connect to the ZooKeeper quorum, or timeout if it is unreachable.
@throws IOException Thrown when connecting to the ZooKeeper quorum fails. | [
"Connect",
"to",
"the",
"ZooKeeper",
"quorum",
"or",
"timeout",
"if",
"it",
"is",
"unreachable",
"."
] | 554e30b2277765f365e7c7f598108de0ab5744f4 | https://github.com/LableOrg/java-uniqueid/blob/554e30b2277765f365e7c7f598108de0ab5744f4/uniqueid-zookeeper/src/main/java/org/lable/oss/uniqueid/zookeeper/connection/ZooKeeperConnection.java#L153-L177 | train |
LableOrg/java-uniqueid | uniqueid-core/src/main/java/org/lable/oss/uniqueid/AutoRefillStack.java | AutoRefillStack.popOne | byte[] popOne() throws GeneratorException {
try {
return idStack.pop();
} catch (NoSuchElementException e) {
// Cached stack is empty, load up a fresh stack.
idStack.addAll(generator.batch(batchSize));
return popOne();
}
} | java | byte[] popOne() throws GeneratorException {
try {
return idStack.pop();
} catch (NoSuchElementException e) {
// Cached stack is empty, load up a fresh stack.
idStack.addAll(generator.batch(batchSize));
return popOne();
}
} | [
"byte",
"[",
"]",
"popOne",
"(",
")",
"throws",
"GeneratorException",
"{",
"try",
"{",
"return",
"idStack",
".",
"pop",
"(",
")",
";",
"}",
"catch",
"(",
"NoSuchElementException",
"e",
")",
"{",
"// Cached stack is empty, load up a fresh stack.",
"idStack",
".",... | Grab a single ID from the stack. If the stack is empty, load up a new batch from the wrapped generator.
@return A single ID. | [
"Grab",
"a",
"single",
"ID",
"from",
"the",
"stack",
".",
"If",
"the",
"stack",
"is",
"empty",
"load",
"up",
"a",
"new",
"batch",
"from",
"the",
"wrapped",
"generator",
"."
] | 554e30b2277765f365e7c7f598108de0ab5744f4 | https://github.com/LableOrg/java-uniqueid/blob/554e30b2277765f365e7c7f598108de0ab5744f4/uniqueid-core/src/main/java/org/lable/oss/uniqueid/AutoRefillStack.java#L101-L109 | train |
LableOrg/java-uniqueid | uniqueid-core/src/main/java/org/lable/oss/uniqueid/bytes/IDBuilder.java | IDBuilder.build | public static byte[] build(Blueprint blueprint) {
// First 42 bits are the timestamp.
// [0] TTTTTTTT [1] TTTTTTTT [2] TTTTTTTT [3] TTTTTTTT [4] TTTTTTTT [5] TT......
ByteBuffer bb = ByteBuffer.allocate(8);
switch (blueprint.getMode()) {
case SPREAD:
long reve... | java | public static byte[] build(Blueprint blueprint) {
// First 42 bits are the timestamp.
// [0] TTTTTTTT [1] TTTTTTTT [2] TTTTTTTT [3] TTTTTTTT [4] TTTTTTTT [5] TT......
ByteBuffer bb = ByteBuffer.allocate(8);
switch (blueprint.getMode()) {
case SPREAD:
long reve... | [
"public",
"static",
"byte",
"[",
"]",
"build",
"(",
"Blueprint",
"blueprint",
")",
"{",
"// First 42 bits are the timestamp.",
"// [0] TTTTTTTT [1] TTTTTTTT [2] TTTTTTTT [3] TTTTTTTT [4] TTTTTTTT [5] TT......",
"ByteBuffer",
"bb",
"=",
"ByteBuffer",
".",
"allocate",
"(",
"8",... | Perform all the byte mangling needed to create the eight byte ID.
@param blueprint Blueprint containing all needed data to work with.
@return The 8-byte ID. | [
"Perform",
"all",
"the",
"byte",
"mangling",
"needed",
"to",
"create",
"the",
"eight",
"byte",
"ID",
"."
] | 554e30b2277765f365e7c7f598108de0ab5744f4 | https://github.com/LableOrg/java-uniqueid/blob/554e30b2277765f365e7c7f598108de0ab5744f4/uniqueid-core/src/main/java/org/lable/oss/uniqueid/bytes/IDBuilder.java#L48-L80 | train |
gwtplus/google-gin | src/main/java/com/google/gwt/inject/rebind/resolution/BindingInstaller.java | BindingInstaller.ensureAccessible | private void ensureAccessible(Key<?> key, GinjectorBindings parent, GinjectorBindings child) {
// Parent will be null if it is was an optional dependency and it couldn't be created.
if (parent != null && !child.equals(parent) && !child.isBound(key)) {
PrettyPrinter.log(logger, TreeLogger.DEBUG,
... | java | private void ensureAccessible(Key<?> key, GinjectorBindings parent, GinjectorBindings child) {
// Parent will be null if it is was an optional dependency and it couldn't be created.
if (parent != null && !child.equals(parent) && !child.isBound(key)) {
PrettyPrinter.log(logger, TreeLogger.DEBUG,
... | [
"private",
"void",
"ensureAccessible",
"(",
"Key",
"<",
"?",
">",
"key",
",",
"GinjectorBindings",
"parent",
",",
"GinjectorBindings",
"child",
")",
"{",
"// Parent will be null if it is was an optional dependency and it couldn't be created.",
"if",
"(",
"parent",
"!=",
"... | Ensure that the binding for key which exists in the parent Ginjector is also available to the
child Ginjector. | [
"Ensure",
"that",
"the",
"binding",
"for",
"key",
"which",
"exists",
"in",
"the",
"parent",
"Ginjector",
"is",
"also",
"available",
"to",
"the",
"child",
"Ginjector",
"."
] | 595e61ee0d2fa508815c016e924ec0e5cea2a2aa | https://github.com/gwtplus/google-gin/blob/595e61ee0d2fa508815c016e924ec0e5cea2a2aa/src/main/java/com/google/gwt/inject/rebind/resolution/BindingInstaller.java#L116-L127 | train |
gwtplus/google-gin | src/main/java/com/google/gwt/inject/rebind/util/GuiceUtil.java | GuiceUtil.getKey | public Key<?> getKey(FieldLiteral<?> field) {
return getKey(field.getFieldType().getType(), field.getBindingAnnotation());
} | java | public Key<?> getKey(FieldLiteral<?> field) {
return getKey(field.getFieldType().getType(), field.getBindingAnnotation());
} | [
"public",
"Key",
"<",
"?",
">",
"getKey",
"(",
"FieldLiteral",
"<",
"?",
">",
"field",
")",
"{",
"return",
"getKey",
"(",
"field",
".",
"getFieldType",
"(",
")",
".",
"getType",
"(",
")",
",",
"field",
".",
"getBindingAnnotation",
"(",
")",
")",
";",... | Returns a key based on the passed field, taking any binding annotations
into account.
@param field field for which to retrieve the key
@return key for passed field | [
"Returns",
"a",
"key",
"based",
"on",
"the",
"passed",
"field",
"taking",
"any",
"binding",
"annotations",
"into",
"account",
"."
] | 595e61ee0d2fa508815c016e924ec0e5cea2a2aa | https://github.com/gwtplus/google-gin/blob/595e61ee0d2fa508815c016e924ec0e5cea2a2aa/src/main/java/com/google/gwt/inject/rebind/util/GuiceUtil.java#L76-L78 | train |
gwtplus/google-gin | src/main/java/com/google/gwt/inject/rebind/util/GuiceUtil.java | GuiceUtil.getKey | private Key<?> getKey(Type type, Annotation bindingAnnotation) throws ProvisionException {
if (bindingAnnotation == null) {
return Key.get(type);
} else {
return Key.get(type, bindingAnnotation);
}
} | java | private Key<?> getKey(Type type, Annotation bindingAnnotation) throws ProvisionException {
if (bindingAnnotation == null) {
return Key.get(type);
} else {
return Key.get(type, bindingAnnotation);
}
} | [
"private",
"Key",
"<",
"?",
">",
"getKey",
"(",
"Type",
"type",
",",
"Annotation",
"bindingAnnotation",
")",
"throws",
"ProvisionException",
"{",
"if",
"(",
"bindingAnnotation",
"==",
"null",
")",
"{",
"return",
"Key",
".",
"get",
"(",
"type",
")",
";",
... | Gets the Guice binding key for a given Java type with optional
annotations.
@param type Java type to convert in to a key
@param bindingAnnotation binding annotation for this key
@return Guice Key instance for this type/annotations
@throws ProvisionException in case of any failure | [
"Gets",
"the",
"Guice",
"binding",
"key",
"for",
"a",
"given",
"Java",
"type",
"with",
"optional",
"annotations",
"."
] | 595e61ee0d2fa508815c016e924ec0e5cea2a2aa | https://github.com/gwtplus/google-gin/blob/595e61ee0d2fa508815c016e924ec0e5cea2a2aa/src/main/java/com/google/gwt/inject/rebind/util/GuiceUtil.java#L89-L95 | train |
gwtplus/google-gin | src/main/java/com/google/gwt/inject/rebind/util/GuiceUtil.java | GuiceUtil.getMemberInjectionDependencies | public Collection<Dependency> getMemberInjectionDependencies(
Key<?> typeKey, TypeLiteral<?> type) {
Set<Dependency> required = new LinkedHashSet<Dependency>();
for (MethodLiteral<?, Method> method : memberCollector.getMethods(type)) {
required.addAll(getDependencies(typeKey, method));
}
fo... | java | public Collection<Dependency> getMemberInjectionDependencies(
Key<?> typeKey, TypeLiteral<?> type) {
Set<Dependency> required = new LinkedHashSet<Dependency>();
for (MethodLiteral<?, Method> method : memberCollector.getMethods(type)) {
required.addAll(getDependencies(typeKey, method));
}
fo... | [
"public",
"Collection",
"<",
"Dependency",
">",
"getMemberInjectionDependencies",
"(",
"Key",
"<",
"?",
">",
"typeKey",
",",
"TypeLiteral",
"<",
"?",
">",
"type",
")",
"{",
"Set",
"<",
"Dependency",
">",
"required",
"=",
"new",
"LinkedHashSet",
"<",
"Depende... | Collects and returns all keys required to member-inject the given class.
@param typeKey key causing member injection
@param type class for which required keys are calculated
@return keys required to inject given class | [
"Collects",
"and",
"returns",
"all",
"keys",
"required",
"to",
"member",
"-",
"inject",
"the",
"given",
"class",
"."
] | 595e61ee0d2fa508815c016e924ec0e5cea2a2aa | https://github.com/gwtplus/google-gin/blob/595e61ee0d2fa508815c016e924ec0e5cea2a2aa/src/main/java/com/google/gwt/inject/rebind/util/GuiceUtil.java#L134-L147 | train |
gwtplus/google-gin | src/main/java/com/google/gwt/inject/rebind/util/GuiceUtil.java | GuiceUtil.getDependencies | public Collection<Dependency> getDependencies(Key<?> typeKey, MethodLiteral<?, ?> method) {
String context;
if (method.isConstructor()) {
context = "@Inject constructor of " + method.getDeclaringType();
} else if (typeKey == Dependency.GINJECTOR) {
context = "Member injector " + method;
} e... | java | public Collection<Dependency> getDependencies(Key<?> typeKey, MethodLiteral<?, ?> method) {
String context;
if (method.isConstructor()) {
context = "@Inject constructor of " + method.getDeclaringType();
} else if (typeKey == Dependency.GINJECTOR) {
context = "Member injector " + method;
} e... | [
"public",
"Collection",
"<",
"Dependency",
">",
"getDependencies",
"(",
"Key",
"<",
"?",
">",
"typeKey",
",",
"MethodLiteral",
"<",
"?",
",",
"?",
">",
"method",
")",
"{",
"String",
"context",
";",
"if",
"(",
"method",
".",
"isConstructor",
"(",
")",
"... | Collects and returns all keys required to inject the given method.
@param typeKey the key that depends on injecting the arguments of method
@param method method for which required keys are calculated
@return required keys | [
"Collects",
"and",
"returns",
"all",
"keys",
"required",
"to",
"inject",
"the",
"given",
"method",
"."
] | 595e61ee0d2fa508815c016e924ec0e5cea2a2aa | https://github.com/gwtplus/google-gin/blob/595e61ee0d2fa508815c016e924ec0e5cea2a2aa/src/main/java/com/google/gwt/inject/rebind/util/GuiceUtil.java#L156-L172 | train |
gwtplus/google-gin | src/main/java/com/google/gwt/inject/rebind/reflect/FieldLiteral.java | FieldLiteral.get | public static <T> FieldLiteral<T> get(Field field, TypeLiteral<T> declaringType) {
Preconditions.checkArgument(
field.getDeclaringClass().equals(declaringType.getRawType()),
"declaringType (%s) must be the type literal where field was declared (%s)!",
declaringType, field.getDeclaringClass()... | java | public static <T> FieldLiteral<T> get(Field field, TypeLiteral<T> declaringType) {
Preconditions.checkArgument(
field.getDeclaringClass().equals(declaringType.getRawType()),
"declaringType (%s) must be the type literal where field was declared (%s)!",
declaringType, field.getDeclaringClass()... | [
"public",
"static",
"<",
"T",
">",
"FieldLiteral",
"<",
"T",
">",
"get",
"(",
"Field",
"field",
",",
"TypeLiteral",
"<",
"T",
">",
"declaringType",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"field",
".",
"getDeclaringClass",
"(",
")",
".",
"e... | Returns a new field literal based on the passed field and its declaring
type.
@param field field for which the literal is created
@param declaringType the field's declaring type
@return new field literal | [
"Returns",
"a",
"new",
"field",
"literal",
"based",
"on",
"the",
"passed",
"field",
"and",
"its",
"declaring",
"type",
"."
] | 595e61ee0d2fa508815c016e924ec0e5cea2a2aa | https://github.com/gwtplus/google-gin/blob/595e61ee0d2fa508815c016e924ec0e5cea2a2aa/src/main/java/com/google/gwt/inject/rebind/reflect/FieldLiteral.java#L41-L47 | train |
gwtplus/google-gin | src/it/higher-lower/src/main/java/com/google/gwt/gin/higherlower/client/DefaultHigherLowerGame.java | DefaultHigherLowerGame.displayNextCard | public PlayerGuessResult displayNextCard(RelationshipToPreviousCard guess) {
Card card = deck.turnCard();
grid.nextCard(card);
cardsTurnedPlusOne++;
RelationshipToPreviousCard actualRelationshipToPrevious = getRelationshipToPreviousCard(card);
previous = card;
if (actualRelationshipToPrevious =... | java | public PlayerGuessResult displayNextCard(RelationshipToPreviousCard guess) {
Card card = deck.turnCard();
grid.nextCard(card);
cardsTurnedPlusOne++;
RelationshipToPreviousCard actualRelationshipToPrevious = getRelationshipToPreviousCard(card);
previous = card;
if (actualRelationshipToPrevious =... | [
"public",
"PlayerGuessResult",
"displayNextCard",
"(",
"RelationshipToPreviousCard",
"guess",
")",
"{",
"Card",
"card",
"=",
"deck",
".",
"turnCard",
"(",
")",
";",
"grid",
".",
"nextCard",
"(",
"card",
")",
";",
"cardsTurnedPlusOne",
"++",
";",
"RelationshipToP... | Turn the next card.
@param guess the player's guess
@return whether the player was right or wrong | [
"Turn",
"the",
"next",
"card",
"."
] | 595e61ee0d2fa508815c016e924ec0e5cea2a2aa | https://github.com/gwtplus/google-gin/blob/595e61ee0d2fa508815c016e924ec0e5cea2a2aa/src/it/higher-lower/src/main/java/com/google/gwt/gin/higherlower/client/DefaultHigherLowerGame.java#L29-L41 | train |
gwtplus/google-gin | src/main/java/com/google/gwt/inject/client/PrivateGinModule.java | PrivateGinModule.bind | protected final <T> GinAnnotatedBindingBuilder<T> bind(Class<T> clazz) {
return binder.bind(clazz);
} | java | protected final <T> GinAnnotatedBindingBuilder<T> bind(Class<T> clazz) {
return binder.bind(clazz);
} | [
"protected",
"final",
"<",
"T",
">",
"GinAnnotatedBindingBuilder",
"<",
"T",
">",
"bind",
"(",
"Class",
"<",
"T",
">",
"clazz",
")",
"{",
"return",
"binder",
".",
"bind",
"(",
"clazz",
")",
";",
"}"
] | Everything below is copied from AbstractGinModule | [
"Everything",
"below",
"is",
"copied",
"from",
"AbstractGinModule"
] | 595e61ee0d2fa508815c016e924ec0e5cea2a2aa | https://github.com/gwtplus/google-gin/blob/595e61ee0d2fa508815c016e924ec0e5cea2a2aa/src/main/java/com/google/gwt/inject/client/PrivateGinModule.java#L87-L89 | train |
gwtplus/google-gin | src/main/java/com/google/gwt/inject/rebind/binding/BindConstantBinding.java | BindConstantBinding.isConstantKey | public static boolean isConstantKey(Key<?> key) {
Type type = key.getTypeLiteral().getType();
if (!(type instanceof Class)) {
return false;
}
Class clazz = (Class) type;
return clazz == String.class || clazz == Class.class || clazz.isPrimitive()
|| Number.class.isAssignableFrom(clazz... | java | public static boolean isConstantKey(Key<?> key) {
Type type = key.getTypeLiteral().getType();
if (!(type instanceof Class)) {
return false;
}
Class clazz = (Class) type;
return clazz == String.class || clazz == Class.class || clazz.isPrimitive()
|| Number.class.isAssignableFrom(clazz... | [
"public",
"static",
"boolean",
"isConstantKey",
"(",
"Key",
"<",
"?",
">",
"key",
")",
"{",
"Type",
"type",
"=",
"key",
".",
"getTypeLiteral",
"(",
")",
".",
"getType",
"(",
")",
";",
"if",
"(",
"!",
"(",
"type",
"instanceof",
"Class",
")",
")",
"{... | Returns true if the provided key is a valid constant key, i.e. if a
constant binding can be legally created for it.
@param key key to check
@return true if constant key | [
"Returns",
"true",
"if",
"the",
"provided",
"key",
"is",
"a",
"valid",
"constant",
"key",
"i",
".",
"e",
".",
"if",
"a",
"constant",
"binding",
"can",
"be",
"legally",
"created",
"for",
"it",
"."
] | 595e61ee0d2fa508815c016e924ec0e5cea2a2aa | https://github.com/gwtplus/google-gin/blob/595e61ee0d2fa508815c016e924ec0e5cea2a2aa/src/main/java/com/google/gwt/inject/rebind/binding/BindConstantBinding.java#L50-L61 | train |
gwtplus/google-gin | src/main/java/com/google/gwt/inject/rebind/util/PrettyPrinter.java | PrettyPrinter.log | public static void log(TreeLogger logger, TreeLogger.Type type, String formatString,
Object... args) {
if (logger.isLoggable(type)) {
logger.log(type, format(formatString, args));
}
} | java | public static void log(TreeLogger logger, TreeLogger.Type type, String formatString,
Object... args) {
if (logger.isLoggable(type)) {
logger.log(type, format(formatString, args));
}
} | [
"public",
"static",
"void",
"log",
"(",
"TreeLogger",
"logger",
",",
"TreeLogger",
".",
"Type",
"type",
",",
"String",
"formatString",
",",
"Object",
"...",
"args",
")",
"{",
"if",
"(",
"logger",
".",
"isLoggable",
"(",
"type",
")",
")",
"{",
"logger",
... | Log a pretty-printed message if the given log level is active. The message
is only formatted if it will be logged. | [
"Log",
"a",
"pretty",
"-",
"printed",
"message",
"if",
"the",
"given",
"log",
"level",
"is",
"active",
".",
"The",
"message",
"is",
"only",
"formatted",
"if",
"it",
"will",
"be",
"logged",
"."
] | 595e61ee0d2fa508815c016e924ec0e5cea2a2aa | https://github.com/gwtplus/google-gin/blob/595e61ee0d2fa508815c016e924ec0e5cea2a2aa/src/main/java/com/google/gwt/inject/rebind/util/PrettyPrinter.java#L54-L59 | train |
gwtplus/google-gin | src/main/java/com/google/gwt/inject/rebind/util/PrettyPrinter.java | PrettyPrinter.formatObject | private static Object formatObject(Object object) {
if (object instanceof Class) {
return formatArg((Class<?>) object);
} else if (object instanceof Key) {
return formatArg((Key<?>) object);
} else if (object instanceof List) {
List<?> list = (List<?>) object;
// Empirically check if... | java | private static Object formatObject(Object object) {
if (object instanceof Class) {
return formatArg((Class<?>) object);
} else if (object instanceof Key) {
return formatArg((Key<?>) object);
} else if (object instanceof List) {
List<?> list = (List<?>) object;
// Empirically check if... | [
"private",
"static",
"Object",
"formatObject",
"(",
"Object",
"object",
")",
"{",
"if",
"(",
"object",
"instanceof",
"Class",
")",
"{",
"return",
"formatArg",
"(",
"(",
"Class",
"<",
"?",
">",
")",
"object",
")",
";",
"}",
"else",
"if",
"(",
"object",
... | Pretty-print a single object. | [
"Pretty",
"-",
"print",
"a",
"single",
"object",
"."
] | 595e61ee0d2fa508815c016e924ec0e5cea2a2aa | https://github.com/gwtplus/google-gin/blob/595e61ee0d2fa508815c016e924ec0e5cea2a2aa/src/main/java/com/google/gwt/inject/rebind/util/PrettyPrinter.java#L81-L105 | train |
gwtplus/google-gin | src/main/java/com/google/gwt/inject/rebind/binding/FactoryBinding.java | FactoryBinding.extractConstructorParameters | private String[] extractConstructorParameters(Key<?> factoryKey, TypeLiteral<?> implementation,
Constructor constructor, List<Key<?>> methodParams, Errors errors,
Set<Dependency> dependencyCollector) throws ErrorsException {
// Get parameters with annotations.
List<TypeLiteral<?>> ctorParams = impl... | java | private String[] extractConstructorParameters(Key<?> factoryKey, TypeLiteral<?> implementation,
Constructor constructor, List<Key<?>> methodParams, Errors errors,
Set<Dependency> dependencyCollector) throws ErrorsException {
// Get parameters with annotations.
List<TypeLiteral<?>> ctorParams = impl... | [
"private",
"String",
"[",
"]",
"extractConstructorParameters",
"(",
"Key",
"<",
"?",
">",
"factoryKey",
",",
"TypeLiteral",
"<",
"?",
">",
"implementation",
",",
"Constructor",
"constructor",
",",
"List",
"<",
"Key",
"<",
"?",
">",
">",
"methodParams",
",",
... | Matches constructor parameters to method parameters for injection and
records remaining parameters as required keys. | [
"Matches",
"constructor",
"parameters",
"to",
"method",
"parameters",
"for",
"injection",
"and",
"records",
"remaining",
"parameters",
"as",
"required",
"keys",
"."
] | 595e61ee0d2fa508815c016e924ec0e5cea2a2aa | https://github.com/gwtplus/google-gin/blob/595e61ee0d2fa508815c016e924ec0e5cea2a2aa/src/main/java/com/google/gwt/inject/rebind/binding/FactoryBinding.java#L264-L303 | train |
gwtplus/google-gin | src/main/java/com/google/gwt/inject/rebind/resolution/UnresolvedBindingValidator.java | UnresolvedBindingValidator.pruneInvalidOptional | public void pruneInvalidOptional(DependencyExplorerOutput output, InvalidKeys invalidKeys) {
DependencyGraph.GraphPruner prunedGraph = new DependencyGraph.GraphPruner(output.getGraph());
for (Key<?> key : invalidKeys.getInvalidOptionalKeys()) {
prunedGraph.remove(key);
output.removeBinding(key);
... | java | public void pruneInvalidOptional(DependencyExplorerOutput output, InvalidKeys invalidKeys) {
DependencyGraph.GraphPruner prunedGraph = new DependencyGraph.GraphPruner(output.getGraph());
for (Key<?> key : invalidKeys.getInvalidOptionalKeys()) {
prunedGraph.remove(key);
output.removeBinding(key);
... | [
"public",
"void",
"pruneInvalidOptional",
"(",
"DependencyExplorerOutput",
"output",
",",
"InvalidKeys",
"invalidKeys",
")",
"{",
"DependencyGraph",
".",
"GraphPruner",
"prunedGraph",
"=",
"new",
"DependencyGraph",
".",
"GraphPruner",
"(",
"output",
".",
"getGraph",
"... | Prune all of the invalid optional keys from the graph. After this method, all of the keys
remaining in the graph are resolvable. | [
"Prune",
"all",
"of",
"the",
"invalid",
"optional",
"keys",
"from",
"the",
"graph",
".",
"After",
"this",
"method",
"all",
"of",
"the",
"keys",
"remaining",
"in",
"the",
"graph",
"are",
"resolvable",
"."
] | 595e61ee0d2fa508815c016e924ec0e5cea2a2aa | https://github.com/gwtplus/google-gin/blob/595e61ee0d2fa508815c016e924ec0e5cea2a2aa/src/main/java/com/google/gwt/inject/rebind/resolution/UnresolvedBindingValidator.java#L110-L117 | train |
gwtplus/google-gin | src/main/java/com/google/gwt/inject/rebind/resolution/UnresolvedBindingValidator.java | UnresolvedBindingValidator.getAllInvalidKeys | private Map<Key<?>, String> getAllInvalidKeys(DependencyExplorerOutput output) {
Map<Key<?>, String> invalidKeys = new LinkedHashMap<Key<?>, String>();
// Look for errors in the nodes, and either report the error (if its required) or remove the
// node (if its optional).
for (Entry<Key<?>, String> ... | java | private Map<Key<?>, String> getAllInvalidKeys(DependencyExplorerOutput output) {
Map<Key<?>, String> invalidKeys = new LinkedHashMap<Key<?>, String>();
// Look for errors in the nodes, and either report the error (if its required) or remove the
// node (if its optional).
for (Entry<Key<?>, String> ... | [
"private",
"Map",
"<",
"Key",
"<",
"?",
">",
",",
"String",
">",
"getAllInvalidKeys",
"(",
"DependencyExplorerOutput",
"output",
")",
"{",
"Map",
"<",
"Key",
"<",
"?",
">",
",",
"String",
">",
"invalidKeys",
"=",
"new",
"LinkedHashMap",
"<",
"Key",
"<",
... | Returns a map from keys that are invalid to errors explaining why each key is invalid. | [
"Returns",
"a",
"map",
"from",
"keys",
"that",
"are",
"invalid",
"to",
"errors",
"explaining",
"why",
"each",
"key",
"is",
"invalid",
"."
] | 595e61ee0d2fa508815c016e924ec0e5cea2a2aa | https://github.com/gwtplus/google-gin/blob/595e61ee0d2fa508815c016e924ec0e5cea2a2aa/src/main/java/com/google/gwt/inject/rebind/resolution/UnresolvedBindingValidator.java#L122-L151 | train |
gwtplus/google-gin | src/main/java/com/google/gwt/inject/rebind/resolution/UnresolvedBindingValidator.java | UnresolvedBindingValidator.getKeysToRemove | private Set<Key<?>> getKeysToRemove(DependencyGraph graph, Collection<Key<?>> discovered) {
Set<Key<?>> toRemove = new LinkedHashSet<Key<?>>();
while (!discovered.isEmpty()) {
toRemove.addAll(discovered);
discovered = getRequiredSourcesTargeting(graph, discovered);
discovered.removeAll(toRemov... | java | private Set<Key<?>> getKeysToRemove(DependencyGraph graph, Collection<Key<?>> discovered) {
Set<Key<?>> toRemove = new LinkedHashSet<Key<?>>();
while (!discovered.isEmpty()) {
toRemove.addAll(discovered);
discovered = getRequiredSourcesTargeting(graph, discovered);
discovered.removeAll(toRemov... | [
"private",
"Set",
"<",
"Key",
"<",
"?",
">",
">",
"getKeysToRemove",
"(",
"DependencyGraph",
"graph",
",",
"Collection",
"<",
"Key",
"<",
"?",
">",
">",
"discovered",
")",
"{",
"Set",
"<",
"Key",
"<",
"?",
">",
">",
"toRemove",
"=",
"new",
"LinkedHas... | Given the set of optional keys that had problems, compute the set of all optional keys that
should be removed. This may include additional keys, for instance if an optional key requires
an invalid key, than the optional key should also be removed.
<p>This will only add optional keys to {@code toRemove}. Recall that ... | [
"Given",
"the",
"set",
"of",
"optional",
"keys",
"that",
"had",
"problems",
"compute",
"the",
"set",
"of",
"all",
"optional",
"keys",
"that",
"should",
"be",
"removed",
".",
"This",
"may",
"include",
"additional",
"keys",
"for",
"instance",
"if",
"an",
"op... | 595e61ee0d2fa508815c016e924ec0e5cea2a2aa | https://github.com/gwtplus/google-gin/blob/595e61ee0d2fa508815c016e924ec0e5cea2a2aa/src/main/java/com/google/gwt/inject/rebind/resolution/UnresolvedBindingValidator.java#L187-L195 | train |
gwtplus/google-gin | src/main/java/com/google/gwt/inject/rebind/resolution/UnresolvedBindingValidator.java | UnresolvedBindingValidator.getRequiredSourcesTargeting | private Collection<Key<?>> getRequiredSourcesTargeting(
DependencyGraph graph, Iterable<Key<?>> targets) {
Collection<Key<?>> requiredSources = new LinkedHashSet<Key<?>>();
for (Key<?> target : targets) {
for (Dependency edge : graph.getDependenciesTargeting(target)) {
if (!edge.isOptional()... | java | private Collection<Key<?>> getRequiredSourcesTargeting(
DependencyGraph graph, Iterable<Key<?>> targets) {
Collection<Key<?>> requiredSources = new LinkedHashSet<Key<?>>();
for (Key<?> target : targets) {
for (Dependency edge : graph.getDependenciesTargeting(target)) {
if (!edge.isOptional()... | [
"private",
"Collection",
"<",
"Key",
"<",
"?",
">",
">",
"getRequiredSourcesTargeting",
"(",
"DependencyGraph",
"graph",
",",
"Iterable",
"<",
"Key",
"<",
"?",
">",
">",
"targets",
")",
"{",
"Collection",
"<",
"Key",
"<",
"?",
">",
">",
"requiredSources",
... | Returns all of the source keys that have a required dependency on any key in the target set. | [
"Returns",
"all",
"of",
"the",
"source",
"keys",
"that",
"have",
"a",
"required",
"dependency",
"on",
"any",
"key",
"in",
"the",
"target",
"set",
"."
] | 595e61ee0d2fa508815c016e924ec0e5cea2a2aa | https://github.com/gwtplus/google-gin/blob/595e61ee0d2fa508815c016e924ec0e5cea2a2aa/src/main/java/com/google/gwt/inject/rebind/resolution/UnresolvedBindingValidator.java#L200-L213 | train |
gwtplus/google-gin | src/main/java/com/google/gwt/inject/rebind/GuiceBindingVisitor.java | GuiceBindingVisitor.visitScope | public Void visitScope(Scope scope) {
messages.add(new Message(PrettyPrinter.format("Explicit scope unsupported: key=%s scope=%s",
targetKey, scope)));
return null;
} | java | public Void visitScope(Scope scope) {
messages.add(new Message(PrettyPrinter.format("Explicit scope unsupported: key=%s scope=%s",
targetKey, scope)));
return null;
} | [
"public",
"Void",
"visitScope",
"(",
"Scope",
"scope",
")",
"{",
"messages",
".",
"add",
"(",
"new",
"Message",
"(",
"PrettyPrinter",
".",
"format",
"(",
"\"Explicit scope unsupported: key=%s scope=%s\"",
",",
"targetKey",
",",
"scope",
")",
")",
")",
";",
"re... | strange to be using the Guice Scope instead of javax.inject.Scope | [
"strange",
"to",
"be",
"using",
"the",
"Guice",
"Scope",
"instead",
"of",
"javax",
".",
"inject",
".",
"Scope"
] | 595e61ee0d2fa508815c016e924ec0e5cea2a2aa | https://github.com/gwtplus/google-gin/blob/595e61ee0d2fa508815c016e924ec0e5cea2a2aa/src/main/java/com/google/gwt/inject/rebind/GuiceBindingVisitor.java#L140-L144 | train |
gwtplus/google-gin | src/main/java/com/google/gwt/inject/rebind/reflect/ReflectUtil.java | ReflectUtil.getUserPackageName | public static String getUserPackageName(TypeLiteral<?> typeLiteral) {
Map<String, Class<?>> packageNames = new LinkedHashMap<String, Class<?>>();
getTypePackageNames(typeLiteral.getType(), packageNames);
if (packageNames.size() == 0) {
// All type names are public, so typeLiteral is visible from any ... | java | public static String getUserPackageName(TypeLiteral<?> typeLiteral) {
Map<String, Class<?>> packageNames = new LinkedHashMap<String, Class<?>>();
getTypePackageNames(typeLiteral.getType(), packageNames);
if (packageNames.size() == 0) {
// All type names are public, so typeLiteral is visible from any ... | [
"public",
"static",
"String",
"getUserPackageName",
"(",
"TypeLiteral",
"<",
"?",
">",
"typeLiteral",
")",
"{",
"Map",
"<",
"String",
",",
"Class",
"<",
"?",
">",
">",
"packageNames",
"=",
"new",
"LinkedHashMap",
"<",
"String",
",",
"Class",
"<",
"?",
">... | Return the name of the package from which the given type can be used.
<p>Returns a package from which all the type names contained in the given
type literal are visible. Throws {@link IllegalArgumentException} if there
is no such package. If there are multiple such packages, then the type
name can be used from any p... | [
"Return",
"the",
"name",
"of",
"the",
"package",
"from",
"which",
"the",
"given",
"type",
"can",
"be",
"used",
"."
] | 595e61ee0d2fa508815c016e924ec0e5cea2a2aa | https://github.com/gwtplus/google-gin/blob/595e61ee0d2fa508815c016e924ec0e5cea2a2aa/src/main/java/com/google/gwt/inject/rebind/reflect/ReflectUtil.java#L150-L202 | train |
gwtplus/google-gin | src/main/java/com/google/gwt/inject/rebind/reflect/ReflectUtil.java | ReflectUtil.getClassPackageNames | private static void getClassPackageNames(Class<?> clazz, Map<String, Class<?>> packageNames) {
if (isPrivate(clazz)) {
throw new IllegalArgumentException(PrettyPrinter.format(
"Unable to inject an instance of %s because it is a private class.", clazz));
} else if (!isPublic(clazz)) {
packa... | java | private static void getClassPackageNames(Class<?> clazz, Map<String, Class<?>> packageNames) {
if (isPrivate(clazz)) {
throw new IllegalArgumentException(PrettyPrinter.format(
"Unable to inject an instance of %s because it is a private class.", clazz));
} else if (!isPublic(clazz)) {
packa... | [
"private",
"static",
"void",
"getClassPackageNames",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"Map",
"<",
"String",
",",
"Class",
"<",
"?",
">",
">",
"packageNames",
")",
"{",
"if",
"(",
"isPrivate",
"(",
"clazz",
")",
")",
"{",
"throw",
"new",
"Il... | Visits classes to collect package names.
@see {@link #getTypePackageNames}. | [
"Visits",
"classes",
"to",
"collect",
"package",
"names",
"."
] | 595e61ee0d2fa508815c016e924ec0e5cea2a2aa | https://github.com/gwtplus/google-gin/blob/595e61ee0d2fa508815c016e924ec0e5cea2a2aa/src/main/java/com/google/gwt/inject/rebind/reflect/ReflectUtil.java#L235-L247 | train |
gwtplus/google-gin | src/main/java/com/google/gwt/inject/rebind/reflect/ReflectUtil.java | ReflectUtil.getParameterizedTypePackageNames | private static void getParameterizedTypePackageNames(ParameterizedType type,
Map<String, Class<?>> packageNames) {
for (Type argumentType : type.getActualTypeArguments()) {
getTypePackageNames(argumentType, packageNames);
}
getTypePackageNames(type.getRawType(), packageNames);
Type ownerTyp... | java | private static void getParameterizedTypePackageNames(ParameterizedType type,
Map<String, Class<?>> packageNames) {
for (Type argumentType : type.getActualTypeArguments()) {
getTypePackageNames(argumentType, packageNames);
}
getTypePackageNames(type.getRawType(), packageNames);
Type ownerTyp... | [
"private",
"static",
"void",
"getParameterizedTypePackageNames",
"(",
"ParameterizedType",
"type",
",",
"Map",
"<",
"String",
",",
"Class",
"<",
"?",
">",
">",
"packageNames",
")",
"{",
"for",
"(",
"Type",
"argumentType",
":",
"type",
".",
"getActualTypeArgument... | Visits parameterized types to collect package names.
@see {@link #getTypePackageNames}. | [
"Visits",
"parameterized",
"types",
"to",
"collect",
"package",
"names",
"."
] | 595e61ee0d2fa508815c016e924ec0e5cea2a2aa | https://github.com/gwtplus/google-gin/blob/595e61ee0d2fa508815c016e924ec0e5cea2a2aa/src/main/java/com/google/gwt/inject/rebind/reflect/ReflectUtil.java#L254-L265 | train |
gwtplus/google-gin | src/main/java/com/google/gwt/inject/rebind/reflect/ReflectUtil.java | ReflectUtil.getTypeVariablePackageNames | private static void getTypeVariablePackageNames(TypeVariable type,
Map<String, Class<?>> packageNames) {
for (Type boundType : type.getBounds()) {
getTypePackageNames(boundType, packageNames);
}
} | java | private static void getTypeVariablePackageNames(TypeVariable type,
Map<String, Class<?>> packageNames) {
for (Type boundType : type.getBounds()) {
getTypePackageNames(boundType, packageNames);
}
} | [
"private",
"static",
"void",
"getTypeVariablePackageNames",
"(",
"TypeVariable",
"type",
",",
"Map",
"<",
"String",
",",
"Class",
"<",
"?",
">",
">",
"packageNames",
")",
"{",
"for",
"(",
"Type",
"boundType",
":",
"type",
".",
"getBounds",
"(",
")",
")",
... | Visits type variables to collect package names.
@see {@link #getTypeVariablePackageNames}. | [
"Visits",
"type",
"variables",
"to",
"collect",
"package",
"names",
"."
] | 595e61ee0d2fa508815c016e924ec0e5cea2a2aa | https://github.com/gwtplus/google-gin/blob/595e61ee0d2fa508815c016e924ec0e5cea2a2aa/src/main/java/com/google/gwt/inject/rebind/reflect/ReflectUtil.java#L272-L277 | train |
gwtplus/google-gin | src/main/java/com/google/gwt/inject/rebind/reflect/ReflectUtil.java | ReflectUtil.getWildcardTypePackageNames | private static void getWildcardTypePackageNames(WildcardType type,
Map<String, Class<?>> packageNames) {
for (Type boundType : type.getUpperBounds()) {
getTypePackageNames(boundType, packageNames);
}
for (Type boundType : type.getLowerBounds()) {
getTypePackageNames(boundType, packageName... | java | private static void getWildcardTypePackageNames(WildcardType type,
Map<String, Class<?>> packageNames) {
for (Type boundType : type.getUpperBounds()) {
getTypePackageNames(boundType, packageNames);
}
for (Type boundType : type.getLowerBounds()) {
getTypePackageNames(boundType, packageName... | [
"private",
"static",
"void",
"getWildcardTypePackageNames",
"(",
"WildcardType",
"type",
",",
"Map",
"<",
"String",
",",
"Class",
"<",
"?",
">",
">",
"packageNames",
")",
"{",
"for",
"(",
"Type",
"boundType",
":",
"type",
".",
"getUpperBounds",
"(",
")",
"... | Visits wildcard types to collect package names.
@see {@link #getTypeVariablePackageNames}. | [
"Visits",
"wildcard",
"types",
"to",
"collect",
"package",
"names",
"."
] | 595e61ee0d2fa508815c016e924ec0e5cea2a2aa | https://github.com/gwtplus/google-gin/blob/595e61ee0d2fa508815c016e924ec0e5cea2a2aa/src/main/java/com/google/gwt/inject/rebind/reflect/ReflectUtil.java#L284-L293 | train |
gwtplus/google-gin | src/main/java/com/google/gwt/inject/rebind/binding/ProviderMethodBinding.java | ProviderMethodBinding.getCreationStatements | public SourceSnippet getCreationStatements(NameGenerator nameGenerator,
List<InjectorMethod> methodsOutput) throws NoSourceNameException {
String moduleSourceName = ReflectUtil.getSourceName(moduleType);
String createModule = "new " + moduleSourceName + "()";
String type = ReflectUtil.getSourceName(ta... | java | public SourceSnippet getCreationStatements(NameGenerator nameGenerator,
List<InjectorMethod> methodsOutput) throws NoSourceNameException {
String moduleSourceName = ReflectUtil.getSourceName(moduleType);
String createModule = "new " + moduleSourceName + "()";
String type = ReflectUtil.getSourceName(ta... | [
"public",
"SourceSnippet",
"getCreationStatements",
"(",
"NameGenerator",
"nameGenerator",
",",
"List",
"<",
"InjectorMethod",
">",
"methodsOutput",
")",
"throws",
"NoSourceNameException",
"{",
"String",
"moduleSourceName",
"=",
"ReflectUtil",
".",
"getSourceName",
"(",
... | provider methods. | [
"provider",
"methods",
"."
] | 595e61ee0d2fa508815c016e924ec0e5cea2a2aa | https://github.com/gwtplus/google-gin/blob/595e61ee0d2fa508815c016e924ec0e5cea2a2aa/src/main/java/com/google/gwt/inject/rebind/binding/ProviderMethodBinding.java#L75-L86 | train |
gwtplus/google-gin | src/main/java/com/google/gwt/inject/rebind/binding/ExposedChildBinding.java | ExposedChildBinding.getGetterMethodPackage | public String getGetterMethodPackage() {
Binding childBinding = childBindings.getBinding(key);
if (childBinding == null) {
// The child binding should exist before we try to expose it!
errorManager.logError("No child binding found in %s for %s.", childBindings, key);
return "";
} else {
... | java | public String getGetterMethodPackage() {
Binding childBinding = childBindings.getBinding(key);
if (childBinding == null) {
// The child binding should exist before we try to expose it!
errorManager.logError("No child binding found in %s for %s.", childBindings, key);
return "";
} else {
... | [
"public",
"String",
"getGetterMethodPackage",
"(",
")",
"{",
"Binding",
"childBinding",
"=",
"childBindings",
".",
"getBinding",
"(",
"key",
")",
";",
"if",
"(",
"childBinding",
"==",
"null",
")",
"{",
"// The child binding should exist before we try to expose it!",
"... | The getter must be placed in the same package as the child getter, to ensure that its return
type is visible. | [
"The",
"getter",
"must",
"be",
"placed",
"in",
"the",
"same",
"package",
"as",
"the",
"child",
"getter",
"to",
"ensure",
"that",
"its",
"return",
"type",
"is",
"visible",
"."
] | 595e61ee0d2fa508815c016e924ec0e5cea2a2aa | https://github.com/gwtplus/google-gin/blob/595e61ee0d2fa508815c016e924ec0e5cea2a2aa/src/main/java/com/google/gwt/inject/rebind/binding/ExposedChildBinding.java#L59-L68 | train |
gwtplus/google-gin | src/main/java/com/google/gwt/inject/rebind/binding/ParentBinding.java | ParentBinding.getGetterMethodPackage | public String getGetterMethodPackage() {
Binding parentBinding = parentBindings.getBinding(key);
if (parentBinding == null) {
// The parent binding should exist by the time this is called.
errorManager.logError("No parent binding found in %s for %s.", parentBindings, key);
return "";
} els... | java | public String getGetterMethodPackage() {
Binding parentBinding = parentBindings.getBinding(key);
if (parentBinding == null) {
// The parent binding should exist by the time this is called.
errorManager.logError("No parent binding found in %s for %s.", parentBindings, key);
return "";
} els... | [
"public",
"String",
"getGetterMethodPackage",
"(",
")",
"{",
"Binding",
"parentBinding",
"=",
"parentBindings",
".",
"getBinding",
"(",
"key",
")",
";",
"if",
"(",
"parentBinding",
"==",
"null",
")",
"{",
"// The parent binding should exist by the time this is called.",... | The getter must be placed in the same package as the parent getter, to ensure that its return
type is visible. | [
"The",
"getter",
"must",
"be",
"placed",
"in",
"the",
"same",
"package",
"as",
"the",
"parent",
"getter",
"to",
"ensure",
"that",
"its",
"return",
"type",
"is",
"visible",
"."
] | 595e61ee0d2fa508815c016e924ec0e5cea2a2aa | https://github.com/gwtplus/google-gin/blob/595e61ee0d2fa508815c016e924ec0e5cea2a2aa/src/main/java/com/google/gwt/inject/rebind/binding/ParentBinding.java#L60-L69 | train |
gwtplus/google-gin | src/main/java/com/google/gwt/inject/rebind/resolution/BindingPositioner.java | BindingPositioner.getInstallPosition | public GinjectorBindings getInstallPosition(Key<?> key) {
Preconditions.checkNotNull(positions,
"Must call position before calling getInstallPosition(Key<?>)");
GinjectorBindings position = installOverrides.get(key);
if (position == null) {
position = positions.get(key);
}
return posit... | java | public GinjectorBindings getInstallPosition(Key<?> key) {
Preconditions.checkNotNull(positions,
"Must call position before calling getInstallPosition(Key<?>)");
GinjectorBindings position = installOverrides.get(key);
if (position == null) {
position = positions.get(key);
}
return posit... | [
"public",
"GinjectorBindings",
"getInstallPosition",
"(",
"Key",
"<",
"?",
">",
"key",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"positions",
",",
"\"Must call position before calling getInstallPosition(Key<?>)\"",
")",
";",
"GinjectorBindings",
"position",
"="... | Returns the Ginjector where the binding for key should be placed, or null if the key was
removed from the dependency graph earlier. | [
"Returns",
"the",
"Ginjector",
"where",
"the",
"binding",
"for",
"key",
"should",
"be",
"placed",
"or",
"null",
"if",
"the",
"key",
"was",
"removed",
"from",
"the",
"dependency",
"graph",
"earlier",
"."
] | 595e61ee0d2fa508815c016e924ec0e5cea2a2aa | https://github.com/gwtplus/google-gin/blob/595e61ee0d2fa508815c016e924ec0e5cea2a2aa/src/main/java/com/google/gwt/inject/rebind/resolution/BindingPositioner.java#L126-L134 | train |
gwtplus/google-gin | src/main/java/com/google/gwt/inject/rebind/resolution/BindingPositioner.java | BindingPositioner.computeInitialPositions | private void computeInitialPositions() {
positions.putAll(output.getPreExistingLocations());
for (Key<?> key : output.getImplicitlyBoundKeys()) {
GinjectorBindings initialPosition = computeInitialPosition(key);
PrettyPrinter.log(logger, TreeLogger.DEBUG, PrettyPrinter.format(
"Initial hig... | java | private void computeInitialPositions() {
positions.putAll(output.getPreExistingLocations());
for (Key<?> key : output.getImplicitlyBoundKeys()) {
GinjectorBindings initialPosition = computeInitialPosition(key);
PrettyPrinter.log(logger, TreeLogger.DEBUG, PrettyPrinter.format(
"Initial hig... | [
"private",
"void",
"computeInitialPositions",
"(",
")",
"{",
"positions",
".",
"putAll",
"(",
"output",
".",
"getPreExistingLocations",
"(",
")",
")",
";",
"for",
"(",
"Key",
"<",
"?",
">",
"key",
":",
"output",
".",
"getImplicitlyBoundKeys",
"(",
")",
")"... | Place an initial guess in the position map that places each implicit binding as high as
possible in the injector tree without causing double binding. | [
"Place",
"an",
"initial",
"guess",
"in",
"the",
"position",
"map",
"that",
"places",
"each",
"implicit",
"binding",
"as",
"high",
"as",
"possible",
"in",
"the",
"injector",
"tree",
"without",
"causing",
"double",
"binding",
"."
] | 595e61ee0d2fa508815c016e924ec0e5cea2a2aa | https://github.com/gwtplus/google-gin/blob/595e61ee0d2fa508815c016e924ec0e5cea2a2aa/src/main/java/com/google/gwt/inject/rebind/resolution/BindingPositioner.java#L146-L156 | train |
gwtplus/google-gin | src/main/java/com/google/gwt/inject/rebind/resolution/BindingPositioner.java | BindingPositioner.computeInitialPosition | private GinjectorBindings computeInitialPosition(Key<?> key) {
GinjectorBindings initialPosition = output.getGraph().getOrigin();
boolean pinned = initialPosition.isPinned(key);
// If the key is pinned (explicitly bound) at the origin, we may be in a situation where we need
// to install a binding at t... | java | private GinjectorBindings computeInitialPosition(Key<?> key) {
GinjectorBindings initialPosition = output.getGraph().getOrigin();
boolean pinned = initialPosition.isPinned(key);
// If the key is pinned (explicitly bound) at the origin, we may be in a situation where we need
// to install a binding at t... | [
"private",
"GinjectorBindings",
"computeInitialPosition",
"(",
"Key",
"<",
"?",
">",
"key",
")",
"{",
"GinjectorBindings",
"initialPosition",
"=",
"output",
".",
"getGraph",
"(",
")",
".",
"getOrigin",
"(",
")",
";",
"boolean",
"pinned",
"=",
"initialPosition",
... | Returns the highest injector that we could possibly position the key at without causing a
double binding. | [
"Returns",
"the",
"highest",
"injector",
"that",
"we",
"could",
"possibly",
"position",
"the",
"key",
"at",
"without",
"causing",
"a",
"double",
"binding",
"."
] | 595e61ee0d2fa508815c016e924ec0e5cea2a2aa | https://github.com/gwtplus/google-gin/blob/595e61ee0d2fa508815c016e924ec0e5cea2a2aa/src/main/java/com/google/gwt/inject/rebind/resolution/BindingPositioner.java#L162-L187 | train |
gwtplus/google-gin | src/main/java/com/google/gwt/inject/rebind/resolution/BindingPositioner.java | BindingPositioner.canExposeKeyFrom | private boolean canExposeKeyFrom(Key<?> key, GinjectorBindings child, boolean pinned) {
GinjectorBindings parent = child.getParent();
if (parent == null) {
// Can't move above the root.
return false;
} else if (parent.isBoundLocallyInChild(key)) {
// If a sibling module already materializ... | java | private boolean canExposeKeyFrom(Key<?> key, GinjectorBindings child, boolean pinned) {
GinjectorBindings parent = child.getParent();
if (parent == null) {
// Can't move above the root.
return false;
} else if (parent.isBoundLocallyInChild(key)) {
// If a sibling module already materializ... | [
"private",
"boolean",
"canExposeKeyFrom",
"(",
"Key",
"<",
"?",
">",
"key",
",",
"GinjectorBindings",
"child",
",",
"boolean",
"pinned",
")",
"{",
"GinjectorBindings",
"parent",
"=",
"child",
".",
"getParent",
"(",
")",
";",
"if",
"(",
"parent",
"==",
"nul... | Tests whether a key from the given child injector can be made visible in
its parent. For pinned keys, this means that they're exposed to the
parent; for keys that aren't pinned, it means that there's no other
constraint preventing them from floating up.
<p>Note that "pinned" states whether the key was pinned in the i... | [
"Tests",
"whether",
"a",
"key",
"from",
"the",
"given",
"child",
"injector",
"can",
"be",
"made",
"visible",
"in",
"its",
"parent",
".",
"For",
"pinned",
"keys",
"this",
"means",
"that",
"they",
"re",
"exposed",
"to",
"the",
"parent",
";",
"for",
"keys",... | 595e61ee0d2fa508815c016e924ec0e5cea2a2aa | https://github.com/gwtplus/google-gin/blob/595e61ee0d2fa508815c016e924ec0e5cea2a2aa/src/main/java/com/google/gwt/inject/rebind/resolution/BindingPositioner.java#L198-L230 | train |
gwtplus/google-gin | src/main/java/com/google/gwt/inject/rebind/resolution/BindingPositioner.java | BindingPositioner.calculateExactPositions | private void calculateExactPositions() {
while (!workqueue.isEmpty()) {
Key<?> key = workqueue.iterator().next();
workqueue.remove(key);
Set<GinjectorBindings> injectors = getSourceGinjectors(key);
injectors.add(positions.get(key));
GinjectorBindings newPosition = lowest(injecto... | java | private void calculateExactPositions() {
while (!workqueue.isEmpty()) {
Key<?> key = workqueue.iterator().next();
workqueue.remove(key);
Set<GinjectorBindings> injectors = getSourceGinjectors(key);
injectors.add(positions.get(key));
GinjectorBindings newPosition = lowest(injecto... | [
"private",
"void",
"calculateExactPositions",
"(",
")",
"{",
"while",
"(",
"!",
"workqueue",
".",
"isEmpty",
"(",
")",
")",
"{",
"Key",
"<",
"?",
">",
"key",
"=",
"workqueue",
".",
"iterator",
"(",
")",
".",
"next",
"(",
")",
";",
"workqueue",
".",
... | Iterates on the position equation, updating each binding in the queue and re-queueing nodes
that depend on any node we move. This will always terminate, since we only re-queue when we
make a change, and there are a finite number of entries in the injector hierarchy. | [
"Iterates",
"on",
"the",
"position",
"equation",
"updating",
"each",
"binding",
"in",
"the",
"queue",
"and",
"re",
"-",
"queueing",
"nodes",
"that",
"depend",
"on",
"any",
"node",
"we",
"move",
".",
"This",
"will",
"always",
"terminate",
"since",
"we",
"on... | 595e61ee0d2fa508815c016e924ec0e5cea2a2aa | https://github.com/gwtplus/google-gin/blob/595e61ee0d2fa508815c016e924ec0e5cea2a2aa/src/main/java/com/google/gwt/inject/rebind/resolution/BindingPositioner.java#L237-L262 | train |
gwtplus/google-gin | src/main/java/com/google/gwt/inject/rebind/resolution/BindingPositioner.java | BindingPositioner.getSourceGinjectors | private Set<GinjectorBindings> getSourceGinjectors(Key<?> key) {
Set<GinjectorBindings> sourceInjectors = new LinkedHashSet<GinjectorBindings>();
for (Dependency dep : output.getGraph().getDependenciesOf(key)) {
sourceInjectors.add(positions.get(dep.getTarget()));
}
return sourceInjectors;
} | java | private Set<GinjectorBindings> getSourceGinjectors(Key<?> key) {
Set<GinjectorBindings> sourceInjectors = new LinkedHashSet<GinjectorBindings>();
for (Dependency dep : output.getGraph().getDependenciesOf(key)) {
sourceInjectors.add(positions.get(dep.getTarget()));
}
return sourceInjectors;
} | [
"private",
"Set",
"<",
"GinjectorBindings",
">",
"getSourceGinjectors",
"(",
"Key",
"<",
"?",
">",
"key",
")",
"{",
"Set",
"<",
"GinjectorBindings",
">",
"sourceInjectors",
"=",
"new",
"LinkedHashSet",
"<",
"GinjectorBindings",
">",
"(",
")",
";",
"for",
"("... | Returns the injectors where the dependencies for node are currently placed. | [
"Returns",
"the",
"injectors",
"where",
"the",
"dependencies",
"for",
"node",
"are",
"currently",
"placed",
"."
] | 595e61ee0d2fa508815c016e924ec0e5cea2a2aa | https://github.com/gwtplus/google-gin/blob/595e61ee0d2fa508815c016e924ec0e5cea2a2aa/src/main/java/com/google/gwt/inject/rebind/resolution/BindingPositioner.java#L267-L273 | train |
gwtplus/google-gin | src/main/java/com/google/gwt/inject/rebind/util/SourceSnippets.java | SourceSnippets.callChildGetter | public static SourceSnippet callChildGetter(final GinjectorBindings childBindings,
final Key<?> key) {
return new SourceSnippet() {
public String getSource(InjectorWriteContext writeContext) {
return writeContext.callChildGetter(childBindings, key);
}
};
} | java | public static SourceSnippet callChildGetter(final GinjectorBindings childBindings,
final Key<?> key) {
return new SourceSnippet() {
public String getSource(InjectorWriteContext writeContext) {
return writeContext.callChildGetter(childBindings, key);
}
};
} | [
"public",
"static",
"SourceSnippet",
"callChildGetter",
"(",
"final",
"GinjectorBindings",
"childBindings",
",",
"final",
"Key",
"<",
"?",
">",
"key",
")",
"{",
"return",
"new",
"SourceSnippet",
"(",
")",
"{",
"public",
"String",
"getSource",
"(",
"InjectorWrite... | Creates a snippet that evaluates to an injected instance of the given key,
as produced by the given child. | [
"Creates",
"a",
"snippet",
"that",
"evaluates",
"to",
"an",
"injected",
"instance",
"of",
"the",
"given",
"key",
"as",
"produced",
"by",
"the",
"given",
"child",
"."
] | 595e61ee0d2fa508815c016e924ec0e5cea2a2aa | https://github.com/gwtplus/google-gin/blob/595e61ee0d2fa508815c016e924ec0e5cea2a2aa/src/main/java/com/google/gwt/inject/rebind/util/SourceSnippets.java#L34-L41 | train |
gwtplus/google-gin | src/main/java/com/google/gwt/inject/rebind/util/SourceSnippets.java | SourceSnippets.callMethod | public static SourceSnippet callMethod(final String methodName, final String fragmentPackageName,
final Iterable<String> parameters) {
return new SourceSnippet() {
public String getSource(InjectorWriteContext writeContext) {
return writeContext.callMethod(methodName, fragmentPackageName, paramet... | java | public static SourceSnippet callMethod(final String methodName, final String fragmentPackageName,
final Iterable<String> parameters) {
return new SourceSnippet() {
public String getSource(InjectorWriteContext writeContext) {
return writeContext.callMethod(methodName, fragmentPackageName, paramet... | [
"public",
"static",
"SourceSnippet",
"callMethod",
"(",
"final",
"String",
"methodName",
",",
"final",
"String",
"fragmentPackageName",
",",
"final",
"Iterable",
"<",
"String",
">",
"parameters",
")",
"{",
"return",
"new",
"SourceSnippet",
"(",
")",
"{",
"public... | Creates a snippet that evaluates to an invocation of the named method on
the given package fragment.
<p>Used when generating an intermediate invoker method; see
{@link MethodCallUtil#createMethodCallWithInjection}. | [
"Creates",
"a",
"snippet",
"that",
"evaluates",
"to",
"an",
"invocation",
"of",
"the",
"named",
"method",
"on",
"the",
"given",
"package",
"fragment",
"."
] | 595e61ee0d2fa508815c016e924ec0e5cea2a2aa | https://github.com/gwtplus/google-gin/blob/595e61ee0d2fa508815c016e924ec0e5cea2a2aa/src/main/java/com/google/gwt/inject/rebind/util/SourceSnippets.java#L78-L85 | train |
gwtplus/google-gin | src/main/java/com/google/gwt/inject/rebind/util/SourceSnippets.java | SourceSnippets.callParentGetter | public static SourceSnippet callParentGetter(final Key<?> key,
final GinjectorBindings parentBindings) {
return new SourceSnippet() {
public String getSource(InjectorWriteContext writeContext) {
return writeContext.callParentGetter(key, parentBindings);
}
};
} | java | public static SourceSnippet callParentGetter(final Key<?> key,
final GinjectorBindings parentBindings) {
return new SourceSnippet() {
public String getSource(InjectorWriteContext writeContext) {
return writeContext.callParentGetter(key, parentBindings);
}
};
} | [
"public",
"static",
"SourceSnippet",
"callParentGetter",
"(",
"final",
"Key",
"<",
"?",
">",
"key",
",",
"final",
"GinjectorBindings",
"parentBindings",
")",
"{",
"return",
"new",
"SourceSnippet",
"(",
")",
"{",
"public",
"String",
"getSource",
"(",
"InjectorWri... | Creates a snippet that evaluates to an injected instance of the given key,
as produced by the given parent injector. | [
"Creates",
"a",
"snippet",
"that",
"evaluates",
"to",
"an",
"injected",
"instance",
"of",
"the",
"given",
"key",
"as",
"produced",
"by",
"the",
"given",
"parent",
"injector",
"."
] | 595e61ee0d2fa508815c016e924ec0e5cea2a2aa | https://github.com/gwtplus/google-gin/blob/595e61ee0d2fa508815c016e924ec0e5cea2a2aa/src/main/java/com/google/gwt/inject/rebind/util/SourceSnippets.java#L91-L98 | train |
gwtplus/google-gin | src/main/java/com/google/gwt/inject/rebind/util/SourceSnippets.java | SourceSnippets.forText | public static SourceSnippet forText(final String text) {
return new SourceSnippet() {
public String getSource(InjectorWriteContext writeContext) {
return text;
}
};
} | java | public static SourceSnippet forText(final String text) {
return new SourceSnippet() {
public String getSource(InjectorWriteContext writeContext) {
return text;
}
};
} | [
"public",
"static",
"SourceSnippet",
"forText",
"(",
"final",
"String",
"text",
")",
"{",
"return",
"new",
"SourceSnippet",
"(",
")",
"{",
"public",
"String",
"getSource",
"(",
"InjectorWriteContext",
"writeContext",
")",
"{",
"return",
"text",
";",
"}",
"}",
... | Creates a snippet that generates a constant text string. | [
"Creates",
"a",
"snippet",
"that",
"generates",
"a",
"constant",
"text",
"string",
"."
] | 595e61ee0d2fa508815c016e924ec0e5cea2a2aa | https://github.com/gwtplus/google-gin/blob/595e61ee0d2fa508815c016e924ec0e5cea2a2aa/src/main/java/com/google/gwt/inject/rebind/util/SourceSnippets.java#L115-L121 | train |
gwtplus/google-gin | src/main/java/com/google/gwt/inject/rebind/util/NameGenerator.java | NameGenerator.getFragmentClassName | public String getFragmentClassName(String injectorClassName,
FragmentPackageName fragmentPackageName) {
// Sanity check.
Preconditions.checkArgument(!injectorClassName.contains("."),
"The injector class must be a simple name, but it was \"%s\"", injectorClassName);
// Note that the fragment p... | java | public String getFragmentClassName(String injectorClassName,
FragmentPackageName fragmentPackageName) {
// Sanity check.
Preconditions.checkArgument(!injectorClassName.contains("."),
"The injector class must be a simple name, but it was \"%s\"", injectorClassName);
// Note that the fragment p... | [
"public",
"String",
"getFragmentClassName",
"(",
"String",
"injectorClassName",
",",
"FragmentPackageName",
"fragmentPackageName",
")",
"{",
"// Sanity check.",
"Preconditions",
".",
"checkArgument",
"(",
"!",
"injectorClassName",
".",
"contains",
"(",
"\".\"",
")",
","... | Computes the name of a single fragment of a Ginjector.
@param injectorClassName the simple name of the injector's class (not
including its package) | [
"Computes",
"the",
"name",
"of",
"a",
"single",
"fragment",
"of",
"a",
"Ginjector",
"."
] | 595e61ee0d2fa508815c016e924ec0e5cea2a2aa | https://github.com/gwtplus/google-gin/blob/595e61ee0d2fa508815c016e924ec0e5cea2a2aa/src/main/java/com/google/gwt/inject/rebind/util/NameGenerator.java#L104-L117 | train |
gwtplus/google-gin | src/main/java/com/google/gwt/inject/rebind/util/NameGenerator.java | NameGenerator.replaceLast | public static String replaceLast(String source, char toReplace, char with) {
StringBuilder sb = new StringBuilder(source);
int index = sb.lastIndexOf(String.valueOf(toReplace));
if (index != -1) {
sb.setCharAt(index, with);
}
return sb.toString();
} | java | public static String replaceLast(String source, char toReplace, char with) {
StringBuilder sb = new StringBuilder(source);
int index = sb.lastIndexOf(String.valueOf(toReplace));
if (index != -1) {
sb.setCharAt(index, with);
}
return sb.toString();
} | [
"public",
"static",
"String",
"replaceLast",
"(",
"String",
"source",
",",
"char",
"toReplace",
",",
"char",
"with",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
"source",
")",
";",
"int",
"index",
"=",
"sb",
".",
"lastIndexOf",
"(",
... | Static for access from enum. | [
"Static",
"for",
"access",
"from",
"enum",
"."
] | 595e61ee0d2fa508815c016e924ec0e5cea2a2aa | https://github.com/gwtplus/google-gin/blob/595e61ee0d2fa508815c016e924ec0e5cea2a2aa/src/main/java/com/google/gwt/inject/rebind/util/NameGenerator.java#L225-L232 | train |
gwtplus/google-gin | src/main/java/com/google/gwt/inject/rebind/resolution/DependencyExplorer.java | DependencyExplorer.explore | public DependencyExplorerOutput explore(GinjectorBindings origin) {
DependencyExplorerOutput output = new DependencyExplorerOutput();
DependencyGraph.Builder builder = new DependencyGraph.Builder(origin);
for (Dependency edge : origin.getDependencies()) {
Preconditions.checkState(
Depen... | java | public DependencyExplorerOutput explore(GinjectorBindings origin) {
DependencyExplorerOutput output = new DependencyExplorerOutput();
DependencyGraph.Builder builder = new DependencyGraph.Builder(origin);
for (Dependency edge : origin.getDependencies()) {
Preconditions.checkState(
Depen... | [
"public",
"DependencyExplorerOutput",
"explore",
"(",
"GinjectorBindings",
"origin",
")",
"{",
"DependencyExplorerOutput",
"output",
"=",
"new",
"DependencyExplorerOutput",
"(",
")",
";",
"DependencyGraph",
".",
"Builder",
"builder",
"=",
"new",
"DependencyGraph",
".",
... | Explore the unresolved dependencies in the origin Ginjector, and create the corresponding
dependency graph. Also gathers information about key in the dependency graph, such as which
Ginjector it is already available on, or what implicit binding was created for it.
@param origin the ginjector to build a dependency gra... | [
"Explore",
"the",
"unresolved",
"dependencies",
"in",
"the",
"origin",
"Ginjector",
"and",
"create",
"the",
"corresponding",
"dependency",
"graph",
".",
"Also",
"gathers",
"information",
"about",
"key",
"in",
"the",
"dependency",
"graph",
"such",
"as",
"which",
... | 595e61ee0d2fa508815c016e924ec0e5cea2a2aa | https://github.com/gwtplus/google-gin/blob/595e61ee0d2fa508815c016e924ec0e5cea2a2aa/src/main/java/com/google/gwt/inject/rebind/resolution/DependencyExplorer.java#L65-L93 | train |
gwtplus/google-gin | src/main/java/com/google/gwt/inject/rebind/resolution/DependencyExplorer.java | DependencyExplorer.locateHighestAccessibleSource | private GinjectorBindings locateHighestAccessibleSource(Key<?> key, GinjectorBindings origin) {
// If we don't already have a binding, and the key is "pinned", it means that this injector
// is supposed to contain a binding, but it needs to have one created implicitly. We return
// null so that we attempt ... | java | private GinjectorBindings locateHighestAccessibleSource(Key<?> key, GinjectorBindings origin) {
// If we don't already have a binding, and the key is "pinned", it means that this injector
// is supposed to contain a binding, but it needs to have one created implicitly. We return
// null so that we attempt ... | [
"private",
"GinjectorBindings",
"locateHighestAccessibleSource",
"(",
"Key",
"<",
"?",
">",
"key",
",",
"GinjectorBindings",
"origin",
")",
"{",
"// If we don't already have a binding, and the key is \"pinned\", it means that this injector",
"// is supposed to contain a binding, but it... | Find the highest binding in the Ginjector tree that could be used to supply the given key.
<p>This takes care not to use a higher parent binding if the parent only has the binding
because its exposed from this Ginjector. This leads to problems because the resolution
algorithm won't actually create the binding here if... | [
"Find",
"the",
"highest",
"binding",
"in",
"the",
"Ginjector",
"tree",
"that",
"could",
"be",
"used",
"to",
"supply",
"the",
"given",
"key",
"."
] | 595e61ee0d2fa508815c016e924ec0e5cea2a2aa | https://github.com/gwtplus/google-gin/blob/595e61ee0d2fa508815c016e924ec0e5cea2a2aa/src/main/java/com/google/gwt/inject/rebind/resolution/DependencyExplorer.java#L139-L157 | train |
gwtplus/google-gin | src/main/java/com/google/gwt/inject/rebind/resolution/EagerCycleFinder.java | EagerCycleFinder.findAndReportCycles | public boolean findAndReportCycles(DependencyGraph graph) {
this.graph = graph;
cycleDetected = false;
visitedEdge = new LinkedHashMap<Key<?>, Dependency>(graph.size());
for (Key<?> key : graph.getAllKeys()) {
visit(key, null);
}
return cycleDetected;
} | java | public boolean findAndReportCycles(DependencyGraph graph) {
this.graph = graph;
cycleDetected = false;
visitedEdge = new LinkedHashMap<Key<?>, Dependency>(graph.size());
for (Key<?> key : graph.getAllKeys()) {
visit(key, null);
}
return cycleDetected;
} | [
"public",
"boolean",
"findAndReportCycles",
"(",
"DependencyGraph",
"graph",
")",
"{",
"this",
".",
"graph",
"=",
"graph",
";",
"cycleDetected",
"=",
"false",
";",
"visitedEdge",
"=",
"new",
"LinkedHashMap",
"<",
"Key",
"<",
"?",
">",
",",
"Dependency",
">",... | Detects cycles in the given graph.
@return {@code true} if any cycles were detected | [
"Detects",
"cycles",
"in",
"the",
"given",
"graph",
"."
] | 595e61ee0d2fa508815c016e924ec0e5cea2a2aa | https://github.com/gwtplus/google-gin/blob/595e61ee0d2fa508815c016e924ec0e5cea2a2aa/src/main/java/com/google/gwt/inject/rebind/resolution/EagerCycleFinder.java#L72-L82 | train |
gwtplus/google-gin | src/main/java/com/google/gwt/inject/rebind/resolution/EagerCycleFinder.java | EagerCycleFinder.rootCycleAt | static List<Dependency> rootCycleAt(List<Dependency> cycle, Key<?> key) {
for (int i = 0; i < cycle.size(); ++i) {
if (key.equals(cycle.get(i).getSource())) {
List<Dependency> returnValue = new ArrayList<Dependency>();
returnValue.addAll(cycle.subList(i, cycle.size()));
returnValue.add... | java | static List<Dependency> rootCycleAt(List<Dependency> cycle, Key<?> key) {
for (int i = 0; i < cycle.size(); ++i) {
if (key.equals(cycle.get(i).getSource())) {
List<Dependency> returnValue = new ArrayList<Dependency>();
returnValue.addAll(cycle.subList(i, cycle.size()));
returnValue.add... | [
"static",
"List",
"<",
"Dependency",
">",
"rootCycleAt",
"(",
"List",
"<",
"Dependency",
">",
"cycle",
",",
"Key",
"<",
"?",
">",
"key",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"cycle",
".",
"size",
"(",
")",
";",
"++",
"i",
... | Attempts to root the given dependency cycle at the given key. If the key
is present in the cycle, rotates the dependency cycle so that the key is
the first source. Otherwise, returns the cycle unchanged. | [
"Attempts",
"to",
"root",
"the",
"given",
"dependency",
"cycle",
"at",
"the",
"given",
"key",
".",
"If",
"the",
"key",
"is",
"present",
"in",
"the",
"cycle",
"rotates",
"the",
"dependency",
"cycle",
"so",
"that",
"the",
"key",
"is",
"the",
"first",
"sour... | 595e61ee0d2fa508815c016e924ec0e5cea2a2aa | https://github.com/gwtplus/google-gin/blob/595e61ee0d2fa508815c016e924ec0e5cea2a2aa/src/main/java/com/google/gwt/inject/rebind/resolution/EagerCycleFinder.java#L143-L154 | train |
gwtplus/google-gin | src/main/java/com/google/gwt/inject/rebind/reflect/MethodLiteral.java | MethodLiteral.getParameterTypes | public List<TypeLiteral<?>> getParameterTypes() {
if (parameterTypes == null) {
parameterTypes = getDeclaringType().getParameterTypes(getMember());
}
return parameterTypes;
} | java | public List<TypeLiteral<?>> getParameterTypes() {
if (parameterTypes == null) {
parameterTypes = getDeclaringType().getParameterTypes(getMember());
}
return parameterTypes;
} | [
"public",
"List",
"<",
"TypeLiteral",
"<",
"?",
">",
">",
"getParameterTypes",
"(",
")",
"{",
"if",
"(",
"parameterTypes",
"==",
"null",
")",
"{",
"parameterTypes",
"=",
"getDeclaringType",
"(",
")",
".",
"getParameterTypes",
"(",
"getMember",
"(",
")",
")... | Returns this method's parameter types, if appropriate parametrized with
the declaring class's type parameters.
@return parameter types | [
"Returns",
"this",
"method",
"s",
"parameter",
"types",
"if",
"appropriate",
"parametrized",
"with",
"the",
"declaring",
"class",
"s",
"type",
"parameters",
"."
] | 595e61ee0d2fa508815c016e924ec0e5cea2a2aa | https://github.com/gwtplus/google-gin/blob/595e61ee0d2fa508815c016e924ec0e5cea2a2aa/src/main/java/com/google/gwt/inject/rebind/reflect/MethodLiteral.java#L116-L121 | train |
gwtplus/google-gin | src/main/java/com/google/gwt/inject/rebind/GinjectorGenerator.java | GinjectorGenerator.createGinClassLoader | private ClassLoader createGinClassLoader(TreeLogger logger, GeneratorContext context) {
Set<String> exceptions = new LinkedHashSet<String>();
exceptions.add("com.google.inject"); // Need the non-super-source version during generation.
exceptions.add("javax.inject"); // Need the non-super-source version duri... | java | private ClassLoader createGinClassLoader(TreeLogger logger, GeneratorContext context) {
Set<String> exceptions = new LinkedHashSet<String>();
exceptions.add("com.google.inject"); // Need the non-super-source version during generation.
exceptions.add("javax.inject"); // Need the non-super-source version duri... | [
"private",
"ClassLoader",
"createGinClassLoader",
"(",
"TreeLogger",
"logger",
",",
"GeneratorContext",
"context",
")",
"{",
"Set",
"<",
"String",
">",
"exceptions",
"=",
"new",
"LinkedHashSet",
"<",
"String",
">",
"(",
")",
";",
"exceptions",
".",
"add",
"(",... | Creates a new gin-specific class loader that will load GWT and non-GWT types such that there is
never a conflict, especially with super source.
@param logger logger for errors that occur during class loading
@param context generator context in which classes are loaded
@return new gin class loader
@see GinBridgeClassLo... | [
"Creates",
"a",
"new",
"gin",
"-",
"specific",
"class",
"loader",
"that",
"will",
"load",
"GWT",
"and",
"non",
"-",
"GWT",
"types",
"such",
"that",
"there",
"is",
"never",
"a",
"conflict",
"especially",
"with",
"super",
"source",
"."
] | 595e61ee0d2fa508815c016e924ec0e5cea2a2aa | https://github.com/gwtplus/google-gin/blob/595e61ee0d2fa508815c016e924ec0e5cea2a2aa/src/main/java/com/google/gwt/inject/rebind/GinjectorGenerator.java#L86-L101 | train |
gwtplus/google-gin | src/main/java/com/google/gwt/inject/rebind/GinjectorGenerator.java | GinjectorGenerator.loadClass | Class<?> loadClass(String requestedClass, boolean initialize) throws ClassNotFoundException {
String binaryName = requestedClass;
while (true) {
try {
return Class.forName(binaryName, initialize, classLoader);
} catch (ClassNotFoundException e) {
if (!binaryName.contains(".")) {
... | java | Class<?> loadClass(String requestedClass, boolean initialize) throws ClassNotFoundException {
String binaryName = requestedClass;
while (true) {
try {
return Class.forName(binaryName, initialize, classLoader);
} catch (ClassNotFoundException e) {
if (!binaryName.contains(".")) {
... | [
"Class",
"<",
"?",
">",
"loadClass",
"(",
"String",
"requestedClass",
",",
"boolean",
"initialize",
")",
"throws",
"ClassNotFoundException",
"{",
"String",
"binaryName",
"=",
"requestedClass",
";",
"while",
"(",
"true",
")",
"{",
"try",
"{",
"return",
"Class",... | Package accessible for testing. | [
"Package",
"accessible",
"for",
"testing",
"."
] | 595e61ee0d2fa508815c016e924ec0e5cea2a2aa | https://github.com/gwtplus/google-gin/blob/595e61ee0d2fa508815c016e924ec0e5cea2a2aa/src/main/java/com/google/gwt/inject/rebind/GinjectorGenerator.java#L225-L238 | train |
gwtplus/google-gin | src/main/java/com/google/gwt/inject/rebind/output/GinjectorBindingsOutputter.java | GinjectorBindingsOutputter.write | void write(GinjectorBindings bindings) throws UnableToCompleteException {
TypeLiteral<?> ginjectorInterface = bindings.getGinjectorInterface();
String implClassName = ginjectorNameGenerator.getClassName(bindings);
if (implClassName.contains(".")) {
errorManager.logError("Internal error: the injector ... | java | void write(GinjectorBindings bindings) throws UnableToCompleteException {
TypeLiteral<?> ginjectorInterface = bindings.getGinjectorInterface();
String implClassName = ginjectorNameGenerator.getClassName(bindings);
if (implClassName.contains(".")) {
errorManager.logError("Internal error: the injector ... | [
"void",
"write",
"(",
"GinjectorBindings",
"bindings",
")",
"throws",
"UnableToCompleteException",
"{",
"TypeLiteral",
"<",
"?",
">",
"ginjectorInterface",
"=",
"bindings",
".",
"getGinjectorInterface",
"(",
")",
";",
"String",
"implClassName",
"=",
"ginjectorNameGene... | Writes the Ginjector class for the given bindings object, and all its
package-specific fragments. | [
"Writes",
"the",
"Ginjector",
"class",
"for",
"the",
"given",
"bindings",
"object",
"and",
"all",
"its",
"package",
"-",
"specific",
"fragments",
"."
] | 595e61ee0d2fa508815c016e924ec0e5cea2a2aa | https://github.com/gwtplus/google-gin/blob/595e61ee0d2fa508815c016e924ec0e5cea2a2aa/src/main/java/com/google/gwt/inject/rebind/output/GinjectorBindingsOutputter.java#L95-L123 | train |
gwtplus/google-gin | src/main/java/com/google/gwt/inject/rebind/output/GinjectorBindingsOutputter.java | GinjectorBindingsOutputter.outputInterfaceField | private void outputInterfaceField(GinjectorBindings bindings, SourceWriteUtil sourceWriteUtil,
SourceWriter writer) {
// Only the root injector has an interface binding.
if (bindings.getParent() != null) {
return;
}
Class<?> boundGinjectorInterface = getBoundGinjector(bindings);
if (b... | java | private void outputInterfaceField(GinjectorBindings bindings, SourceWriteUtil sourceWriteUtil,
SourceWriter writer) {
// Only the root injector has an interface binding.
if (bindings.getParent() != null) {
return;
}
Class<?> boundGinjectorInterface = getBoundGinjector(bindings);
if (b... | [
"private",
"void",
"outputInterfaceField",
"(",
"GinjectorBindings",
"bindings",
",",
"SourceWriteUtil",
"sourceWriteUtil",
",",
"SourceWriter",
"writer",
")",
"{",
"// Only the root injector has an interface binding.",
"if",
"(",
"bindings",
".",
"getParent",
"(",
")",
"... | Writes code to store and retrieve the current injector interface, if one is
bound. | [
"Writes",
"code",
"to",
"store",
"and",
"retrieve",
"the",
"current",
"injector",
"interface",
"if",
"one",
"is",
"bound",
"."
] | 595e61ee0d2fa508815c016e924ec0e5cea2a2aa | https://github.com/gwtplus/google-gin/blob/595e61ee0d2fa508815c016e924ec0e5cea2a2aa/src/main/java/com/google/gwt/inject/rebind/output/GinjectorBindingsOutputter.java#L219-L249 | train |
gwtplus/google-gin | src/main/java/com/google/gwt/inject/rebind/output/GinjectorBindingsOutputter.java | GinjectorBindingsOutputter.outputMemberInjections | private void outputMemberInjections(GinjectorBindings bindings, FragmentMap fragments,
SourceWriteUtil sourceWriteUtil) {
NameGenerator nameGenerator = bindings.getNameGenerator();
for (TypeLiteral<?> type : bindings.getMemberInjectRequests()) {
if (!reachabilityAnalyzer.isReachableMemberInject(bind... | java | private void outputMemberInjections(GinjectorBindings bindings, FragmentMap fragments,
SourceWriteUtil sourceWriteUtil) {
NameGenerator nameGenerator = bindings.getNameGenerator();
for (TypeLiteral<?> type : bindings.getMemberInjectRequests()) {
if (!reachabilityAnalyzer.isReachableMemberInject(bind... | [
"private",
"void",
"outputMemberInjections",
"(",
"GinjectorBindings",
"bindings",
",",
"FragmentMap",
"fragments",
",",
"SourceWriteUtil",
"sourceWriteUtil",
")",
"{",
"NameGenerator",
"nameGenerator",
"=",
"bindings",
".",
"getNameGenerator",
"(",
")",
";",
"for",
"... | Adds member injections to each fragment. | [
"Adds",
"member",
"injections",
"to",
"each",
"fragment",
"."
] | 595e61ee0d2fa508815c016e924ec0e5cea2a2aa | https://github.com/gwtplus/google-gin/blob/595e61ee0d2fa508815c016e924ec0e5cea2a2aa/src/main/java/com/google/gwt/inject/rebind/output/GinjectorBindingsOutputter.java#L300-L317 | train |
gwtplus/google-gin | src/main/java/com/google/gwt/inject/rebind/output/GinjectorBindingsOutputter.java | GinjectorBindingsOutputter.outputStaticInjectionMethods | void outputStaticInjectionMethods(Class<?> type, FragmentMap fragments,
NameGenerator nameGenerator, SourceWriteUtil sourceWriteUtil) {
String methodName = nameGenerator.convertToValidMemberName("injectStatic_" + type.getName());
SourceSnippetBuilder body = new SourceSnippetBuilder();
for (InjectionPo... | java | void outputStaticInjectionMethods(Class<?> type, FragmentMap fragments,
NameGenerator nameGenerator, SourceWriteUtil sourceWriteUtil) {
String methodName = nameGenerator.convertToValidMemberName("injectStatic_" + type.getName());
SourceSnippetBuilder body = new SourceSnippetBuilder();
for (InjectionPo... | [
"void",
"outputStaticInjectionMethods",
"(",
"Class",
"<",
"?",
">",
"type",
",",
"FragmentMap",
"fragments",
",",
"NameGenerator",
"nameGenerator",
",",
"SourceWriteUtil",
"sourceWriteUtil",
")",
"{",
"String",
"methodName",
"=",
"nameGenerator",
".",
"convertToValid... | Outputs all the static injection methods for the given class. | [
"Outputs",
"all",
"the",
"static",
"injection",
"methods",
"for",
"the",
"given",
"class",
"."
] | 595e61ee0d2fa508815c016e924ec0e5cea2a2aa | https://github.com/gwtplus/google-gin/blob/595e61ee0d2fa508815c016e924ec0e5cea2a2aa/src/main/java/com/google/gwt/inject/rebind/output/GinjectorBindingsOutputter.java#L329-L368 | train |
gwtplus/google-gin | src/main/java/com/google/gwt/inject/rebind/output/GinjectorBindingsOutputter.java | GinjectorBindingsOutputter.outputMethods | void outputMethods(Iterable<InjectorMethod> methods, FragmentMap fragments) {
for (InjectorMethod method : methods) {
FragmentPackageName fragmentPackageName =
fragmentPackageNameFactory.create(method.getPackageName());
GinjectorFragmentOutputter fragment = fragments.get(fragmentPackageName);
... | java | void outputMethods(Iterable<InjectorMethod> methods, FragmentMap fragments) {
for (InjectorMethod method : methods) {
FragmentPackageName fragmentPackageName =
fragmentPackageNameFactory.create(method.getPackageName());
GinjectorFragmentOutputter fragment = fragments.get(fragmentPackageName);
... | [
"void",
"outputMethods",
"(",
"Iterable",
"<",
"InjectorMethod",
">",
"methods",
",",
"FragmentMap",
"fragments",
")",
"{",
"for",
"(",
"InjectorMethod",
"method",
":",
"methods",
")",
"{",
"FragmentPackageName",
"fragmentPackageName",
"=",
"fragmentPackageNameFactory... | Outputs some methods to the fragments they belong to. | [
"Outputs",
"some",
"methods",
"to",
"the",
"fragments",
"they",
"belong",
"to",
"."
] | 595e61ee0d2fa508815c016e924ec0e5cea2a2aa | https://github.com/gwtplus/google-gin/blob/595e61ee0d2fa508815c016e924ec0e5cea2a2aa/src/main/java/com/google/gwt/inject/rebind/output/GinjectorBindingsOutputter.java#L373-L380 | train |
gwtplus/google-gin | src/main/java/com/google/gwt/inject/rebind/output/GinjectorBindingsOutputter.java | GinjectorBindingsOutputter.getBoundGinjector | private static Class<?> getBoundGinjector(GinjectorBindings bindings) {
if (bindings.getGinjectorInterface() == null) {
return null;
}
TypeLiteral<?> ginjectorInterface = bindings.getGinjectorInterface();
Key<?> ginjectorKey = Key.get(ginjectorInterface);
if (!bindings.isBound(ginjectorKey)... | java | private static Class<?> getBoundGinjector(GinjectorBindings bindings) {
if (bindings.getGinjectorInterface() == null) {
return null;
}
TypeLiteral<?> ginjectorInterface = bindings.getGinjectorInterface();
Key<?> ginjectorKey = Key.get(ginjectorInterface);
if (!bindings.isBound(ginjectorKey)... | [
"private",
"static",
"Class",
"<",
"?",
">",
"getBoundGinjector",
"(",
"GinjectorBindings",
"bindings",
")",
"{",
"if",
"(",
"bindings",
".",
"getGinjectorInterface",
"(",
")",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"TypeLiteral",
"<",
"?",
">... | Gets the Ginjector interface that is bound by the given bindings, if any. | [
"Gets",
"the",
"Ginjector",
"interface",
"that",
"is",
"bound",
"by",
"the",
"given",
"bindings",
"if",
"any",
"."
] | 595e61ee0d2fa508815c016e924ec0e5cea2a2aa | https://github.com/gwtplus/google-gin/blob/595e61ee0d2fa508815c016e924ec0e5cea2a2aa/src/main/java/com/google/gwt/inject/rebind/output/GinjectorBindingsOutputter.java#L405-L423 | train |
gwtplus/google-gin | src/main/java/com/google/gwt/inject/rebind/output/GinjectorFragmentOutputter.java | GinjectorFragmentOutputter.writeBindingGetter | void writeBindingGetter(Key<?> key, Binding binding, GinScope scope,
List<InjectorMethod> helperMethodsOutput) {
Context bindingContext = binding.getContext();
SourceSnippetBuilder getterBuilder = new SourceSnippetBuilder();
SourceSnippet creationStatements;
String getter = nameGenerator.getGette... | java | void writeBindingGetter(Key<?> key, Binding binding, GinScope scope,
List<InjectorMethod> helperMethodsOutput) {
Context bindingContext = binding.getContext();
SourceSnippetBuilder getterBuilder = new SourceSnippetBuilder();
SourceSnippet creationStatements;
String getter = nameGenerator.getGette... | [
"void",
"writeBindingGetter",
"(",
"Key",
"<",
"?",
">",
"key",
",",
"Binding",
"binding",
",",
"GinScope",
"scope",
",",
"List",
"<",
"InjectorMethod",
">",
"helperMethodsOutput",
")",
"{",
"Context",
"bindingContext",
"=",
"binding",
".",
"getContext",
"(",
... | Writes a method describing the getter for the given key, along with any
other code necessary to support it. Produces a list of helper methods that
still need to be written. | [
"Writes",
"a",
"method",
"describing",
"the",
"getter",
"for",
"the",
"given",
"key",
"along",
"with",
"any",
"other",
"code",
"necessary",
"to",
"support",
"it",
".",
"Produces",
"a",
"list",
"of",
"helper",
"methods",
"that",
"still",
"need",
"to",
"be",... | 595e61ee0d2fa508815c016e924ec0e5cea2a2aa | https://github.com/gwtplus/google-gin/blob/595e61ee0d2fa508815c016e924ec0e5cea2a2aa/src/main/java/com/google/gwt/inject/rebind/output/GinjectorFragmentOutputter.java#L159-L211 | train |
gwtplus/google-gin | src/main/java/com/google/gwt/inject/rebind/output/GinjectorFragmentOutputter.java | GinjectorFragmentOutputter.commit | void commit() {
if (committed) {
errorManager.logError("Committed the fragment for %s twice.", fragmentPackageName);
return;
}
committed = true;
// Write the field where the enclosing injector is stored.
writer.beginJavaDocComment();
writer.print("Field for the enclosing injector."... | java | void commit() {
if (committed) {
errorManager.logError("Committed the fragment for %s twice.", fragmentPackageName);
return;
}
committed = true;
// Write the field where the enclosing injector is stored.
writer.beginJavaDocComment();
writer.print("Field for the enclosing injector."... | [
"void",
"commit",
"(",
")",
"{",
"if",
"(",
"committed",
")",
"{",
"errorManager",
".",
"logError",
"(",
"\"Committed the fragment for %s twice.\"",
",",
"fragmentPackageName",
")",
";",
"return",
";",
"}",
"committed",
"=",
"true",
";",
"// Write the field where ... | Outputs all the top-level methods and fields of the class, and commits the
writer. Must be the last method invoked on this object. | [
"Outputs",
"all",
"the",
"top",
"-",
"level",
"methods",
"and",
"fields",
"of",
"the",
"class",
"and",
"commits",
"the",
"writer",
".",
"Must",
"be",
"the",
"last",
"method",
"invoked",
"on",
"this",
"object",
"."
] | 595e61ee0d2fa508815c016e924ec0e5cea2a2aa | https://github.com/gwtplus/google-gin/blob/595e61ee0d2fa508815c016e924ec0e5cea2a2aa/src/main/java/com/google/gwt/inject/rebind/output/GinjectorFragmentOutputter.java#L232-L271 | train |
gwtplus/google-gin | src/main/java/com/google/gwt/inject/rebind/BindingsProcessor.java | BindingsProcessor.registerGinjectorBinding | private void registerGinjectorBinding() {
Key<? extends Ginjector> ginjectorKey = Key.get(ginjectorInterface);
rootGinjectorBindings.addBinding(ginjectorKey, bindingFactory.getGinjectorBinding());
} | java | private void registerGinjectorBinding() {
Key<? extends Ginjector> ginjectorKey = Key.get(ginjectorInterface);
rootGinjectorBindings.addBinding(ginjectorKey, bindingFactory.getGinjectorBinding());
} | [
"private",
"void",
"registerGinjectorBinding",
"(",
")",
"{",
"Key",
"<",
"?",
"extends",
"Ginjector",
">",
"ginjectorKey",
"=",
"Key",
".",
"get",
"(",
"ginjectorInterface",
")",
";",
"rootGinjectorBindings",
".",
"addBinding",
"(",
"ginjectorKey",
",",
"bindin... | Create an explicit binding for the Ginjector. | [
"Create",
"an",
"explicit",
"binding",
"for",
"the",
"Ginjector",
"."
] | 595e61ee0d2fa508815c016e924ec0e5cea2a2aa | https://github.com/gwtplus/google-gin/blob/595e61ee0d2fa508815c016e924ec0e5cea2a2aa/src/main/java/com/google/gwt/inject/rebind/BindingsProcessor.java#L115-L118 | train |
gwtplus/google-gin | src/main/java/com/google/gwt/inject/rebind/BindingsProcessor.java | BindingsProcessor.resolveAllUnresolvedBindings | private void resolveAllUnresolvedBindings(GinjectorBindings collection)
throws UnableToCompleteException {
// Create known/explicit bindings before descending into children. This ensures that they are
// available to any children that may need to depend on them.
createBindingsForFactories(collection... | java | private void resolveAllUnresolvedBindings(GinjectorBindings collection)
throws UnableToCompleteException {
// Create known/explicit bindings before descending into children. This ensures that they are
// available to any children that may need to depend on them.
createBindingsForFactories(collection... | [
"private",
"void",
"resolveAllUnresolvedBindings",
"(",
"GinjectorBindings",
"collection",
")",
"throws",
"UnableToCompleteException",
"{",
"// Create known/explicit bindings before descending into children. This ensures that they are",
"// available to any children that may need to depend on... | Create bindings for factories and resolve all implicit bindings for all
unresolved bindings in the each injector.
<p> This performs a depth-first iteration over all the nodes, and fills in the
bindings on the way up the tree. This order is important because creating
implicit bindings in a child {@link GinjectorBindin... | [
"Create",
"bindings",
"for",
"factories",
"and",
"resolve",
"all",
"implicit",
"bindings",
"for",
"all",
"unresolved",
"bindings",
"in",
"the",
"each",
"injector",
"."
] | 595e61ee0d2fa508815c016e924ec0e5cea2a2aa | https://github.com/gwtplus/google-gin/blob/595e61ee0d2fa508815c016e924ec0e5cea2a2aa/src/main/java/com/google/gwt/inject/rebind/BindingsProcessor.java#L133-L147 | train |
gwtplus/google-gin | src/main/java/com/google/gwt/inject/rebind/util/SourceWriteUtil.java | SourceWriteUtil.createFieldInjection | public SourceSnippet createFieldInjection(final FieldLiteral<?> field, final String injecteeName,
NameGenerator nameGenerator, List<InjectorMethod> methodsOutput)
throws NoSourceNameException {
final boolean hasInjectee = injecteeName != null;
final boolean useNativeMethod = field.isPrivate()
... | java | public SourceSnippet createFieldInjection(final FieldLiteral<?> field, final String injecteeName,
NameGenerator nameGenerator, List<InjectorMethod> methodsOutput)
throws NoSourceNameException {
final boolean hasInjectee = injecteeName != null;
final boolean useNativeMethod = field.isPrivate()
... | [
"public",
"SourceSnippet",
"createFieldInjection",
"(",
"final",
"FieldLiteral",
"<",
"?",
">",
"field",
",",
"final",
"String",
"injecteeName",
",",
"NameGenerator",
"nameGenerator",
",",
"List",
"<",
"InjectorMethod",
">",
"methodsOutput",
")",
"throws",
"NoSource... | Creates a field injecting method and returns a string that invokes the
written method.
@param field field to be injected
@param injecteeName variable that references the object into which values
are injected, in the context of the returned call string
@param nameGenerator NameGenerator to be used for ensuring method n... | [
"Creates",
"a",
"field",
"injecting",
"method",
"and",
"returns",
"a",
"string",
"that",
"invokes",
"the",
"written",
"method",
"."
] | 595e61ee0d2fa508815c016e924ec0e5cea2a2aa | https://github.com/gwtplus/google-gin/blob/595e61ee0d2fa508815c016e924ec0e5cea2a2aa/src/main/java/com/google/gwt/inject/rebind/util/SourceWriteUtil.java#L93-L155 | train |
gwtplus/google-gin | src/main/java/com/google/gwt/inject/rebind/util/SourceWriteUtil.java | SourceWriteUtil.writeBindingContext | public void writeBindingContext(SourceWriter writer, Context context) {
// Avoid a trailing \n -- the GWT class source file composer will output an
// ugly extra newline if we do that.
String text = context.toString();
boolean first = true;
for (String line : text.split("\n")) {
if (first) {
... | java | public void writeBindingContext(SourceWriter writer, Context context) {
// Avoid a trailing \n -- the GWT class source file composer will output an
// ugly extra newline if we do that.
String text = context.toString();
boolean first = true;
for (String line : text.split("\n")) {
if (first) {
... | [
"public",
"void",
"writeBindingContext",
"(",
"SourceWriter",
"writer",
",",
"Context",
"context",
")",
"{",
"// Avoid a trailing \\n -- the GWT class source file composer will output an",
"// ugly extra newline if we do that.",
"String",
"text",
"=",
"context",
".",
"toString",
... | Writes out a binding context, followed by a newline.
<p>Binding contexts may contain newlines; this routine translates those for
the SourceWriter to ensure that indents, Javadoc comments, etc are handled
properly. | [
"Writes",
"out",
"a",
"binding",
"context",
"followed",
"by",
"a",
"newline",
"."
] | 595e61ee0d2fa508815c016e924ec0e5cea2a2aa | https://github.com/gwtplus/google-gin/blob/595e61ee0d2fa508815c016e924ec0e5cea2a2aa/src/main/java/com/google/gwt/inject/rebind/util/SourceWriteUtil.java#L205-L221 | train |
gwtplus/google-gin | src/main/java/com/google/gwt/inject/rebind/util/SourceWriteUtil.java | SourceWriteUtil.writeBindingContextJavadoc | public void writeBindingContextJavadoc(SourceWriter writer, Context bindingContext,
String description) {
writer.beginJavaDocComment();
writer.println(description);
writeBindingContext(writer, bindingContext);
writer.endJavaDocComment();
} | java | public void writeBindingContextJavadoc(SourceWriter writer, Context bindingContext,
String description) {
writer.beginJavaDocComment();
writer.println(description);
writeBindingContext(writer, bindingContext);
writer.endJavaDocComment();
} | [
"public",
"void",
"writeBindingContextJavadoc",
"(",
"SourceWriter",
"writer",
",",
"Context",
"bindingContext",
",",
"String",
"description",
")",
"{",
"writer",
".",
"beginJavaDocComment",
"(",
")",
";",
"writer",
".",
"println",
"(",
"description",
")",
";",
... | Write a Javadoc comment for a binding, including its context.
@param description The description of the binding printed before its
location, such as "Foo bound at: "
@param writer The writer to use in displaying the context.
@param bindingContext The context of the binding. | [
"Write",
"a",
"Javadoc",
"comment",
"for",
"a",
"binding",
"including",
"its",
"context",
"."
] | 595e61ee0d2fa508815c016e924ec0e5cea2a2aa | https://github.com/gwtplus/google-gin/blob/595e61ee0d2fa508815c016e924ec0e5cea2a2aa/src/main/java/com/google/gwt/inject/rebind/util/SourceWriteUtil.java#L231-L237 | train |
gwtplus/google-gin | src/main/java/com/google/gwt/inject/rebind/util/SourceWriteUtil.java | SourceWriteUtil.writeBindingContextJavadoc | public void writeBindingContextJavadoc(SourceWriter writer, Context bindingContext,
Key<?> key) {
writeBindingContextJavadoc(writer, bindingContext,
"Binding for " + key.getTypeLiteral() + " declared at:");
} | java | public void writeBindingContextJavadoc(SourceWriter writer, Context bindingContext,
Key<?> key) {
writeBindingContextJavadoc(writer, bindingContext,
"Binding for " + key.getTypeLiteral() + " declared at:");
} | [
"public",
"void",
"writeBindingContextJavadoc",
"(",
"SourceWriter",
"writer",
",",
"Context",
"bindingContext",
",",
"Key",
"<",
"?",
">",
"key",
")",
"{",
"writeBindingContextJavadoc",
"(",
"writer",
",",
"bindingContext",
",",
"\"Binding for \"",
"+",
"key",
".... | Write the Javadoc for the binding of a particular key, showing the context
of the binding.
@param key The bound key.
@param writer The writer to use to write this comment.
@param bindingContext The context of the binding. | [
"Write",
"the",
"Javadoc",
"for",
"the",
"binding",
"of",
"a",
"particular",
"key",
"showing",
"the",
"context",
"of",
"the",
"binding",
"."
] | 595e61ee0d2fa508815c016e924ec0e5cea2a2aa | https://github.com/gwtplus/google-gin/blob/595e61ee0d2fa508815c016e924ec0e5cea2a2aa/src/main/java/com/google/gwt/inject/rebind/util/SourceWriteUtil.java#L247-L251 | train |
gwtplus/google-gin | src/main/java/com/google/gwt/inject/rebind/util/SourceWriteUtil.java | SourceWriteUtil.writeMethod | public void writeMethod(SourceWriter writer, String signature, String body) {
writer.println(signature + " {");
writer.indent();
writer.println(body);
writer.outdent();
writer.println("}");
writer.println();
} | java | public void writeMethod(SourceWriter writer, String signature, String body) {
writer.println(signature + " {");
writer.indent();
writer.println(body);
writer.outdent();
writer.println("}");
writer.println();
} | [
"public",
"void",
"writeMethod",
"(",
"SourceWriter",
"writer",
",",
"String",
"signature",
",",
"String",
"body",
")",
"{",
"writer",
".",
"println",
"(",
"signature",
"+",
"\" {\"",
")",
";",
"writer",
".",
"indent",
"(",
")",
";",
"writer",
".",
"prin... | Writes a method with the given signature and body to the source writer.
@param writer writer that the method is written to
@param signature method's signature
@param body method's body | [
"Writes",
"a",
"method",
"with",
"the",
"given",
"signature",
"and",
"body",
"to",
"the",
"source",
"writer",
"."
] | 595e61ee0d2fa508815c016e924ec0e5cea2a2aa | https://github.com/gwtplus/google-gin/blob/595e61ee0d2fa508815c016e924ec0e5cea2a2aa/src/main/java/com/google/gwt/inject/rebind/util/SourceWriteUtil.java#L260-L267 | train |
gwtplus/google-gin | src/main/java/com/google/gwt/inject/rebind/util/SourceWriteUtil.java | SourceWriteUtil.writeMethod | public void writeMethod(InjectorMethod method, SourceWriter writer,
InjectorWriteContext writeContext) throws NoSourceNameException {
if (method.isNative()) {
writeNativeMethod(writer, method.getMethodSignature(), method.getMethodBody(writeContext));
} else {
writeMethod(writer, method.getMeth... | java | public void writeMethod(InjectorMethod method, SourceWriter writer,
InjectorWriteContext writeContext) throws NoSourceNameException {
if (method.isNative()) {
writeNativeMethod(writer, method.getMethodSignature(), method.getMethodBody(writeContext));
} else {
writeMethod(writer, method.getMeth... | [
"public",
"void",
"writeMethod",
"(",
"InjectorMethod",
"method",
",",
"SourceWriter",
"writer",
",",
"InjectorWriteContext",
"writeContext",
")",
"throws",
"NoSourceNameException",
"{",
"if",
"(",
"method",
".",
"isNative",
"(",
")",
")",
"{",
"writeNativeMethod",
... | Writes the given method to the given source writer. | [
"Writes",
"the",
"given",
"method",
"to",
"the",
"given",
"source",
"writer",
"."
] | 595e61ee0d2fa508815c016e924ec0e5cea2a2aa | https://github.com/gwtplus/google-gin/blob/595e61ee0d2fa508815c016e924ec0e5cea2a2aa/src/main/java/com/google/gwt/inject/rebind/util/SourceWriteUtil.java#L289-L296 | train |
gwtplus/google-gin | src/main/java/com/google/gwt/inject/rebind/util/SourceWriteUtil.java | SourceWriteUtil.writeMethods | public void writeMethods(Iterable<InjectorMethod> methods, SourceWriter writer,
InjectorWriteContext writeContext) throws NoSourceNameException {
for (InjectorMethod method : methods) {
writeMethod(method, writer, writeContext);
}
} | java | public void writeMethods(Iterable<InjectorMethod> methods, SourceWriter writer,
InjectorWriteContext writeContext) throws NoSourceNameException {
for (InjectorMethod method : methods) {
writeMethod(method, writer, writeContext);
}
} | [
"public",
"void",
"writeMethods",
"(",
"Iterable",
"<",
"InjectorMethod",
">",
"methods",
",",
"SourceWriter",
"writer",
",",
"InjectorWriteContext",
"writeContext",
")",
"throws",
"NoSourceNameException",
"{",
"for",
"(",
"InjectorMethod",
"method",
":",
"methods",
... | Writes the given methods to the given source writer.
@param methods the methods to write
@param writer the source writer to which the methods should be written
@param writeContext the context in which to write the methods | [
"Writes",
"the",
"given",
"methods",
"to",
"the",
"given",
"source",
"writer",
"."
] | 595e61ee0d2fa508815c016e924ec0e5cea2a2aa | https://github.com/gwtplus/google-gin/blob/595e61ee0d2fa508815c016e924ec0e5cea2a2aa/src/main/java/com/google/gwt/inject/rebind/util/SourceWriteUtil.java#L305-L310 | train |
gwtplus/google-gin | src/main/java/com/google/gwt/inject/rebind/util/SourceWriteUtil.java | SourceWriteUtil.createMemberInjection | public String createMemberInjection(TypeLiteral<?> type, NameGenerator nameGenerator,
List<InjectorMethod> methodsOutput) throws NoSourceNameException {
String memberInjectMethodName = nameGenerator.getMemberInjectMethodName(type);
String memberInjectMethodSignature = "public void " + memberInjectMethodNa... | java | public String createMemberInjection(TypeLiteral<?> type, NameGenerator nameGenerator,
List<InjectorMethod> methodsOutput) throws NoSourceNameException {
String memberInjectMethodName = nameGenerator.getMemberInjectMethodName(type);
String memberInjectMethodSignature = "public void " + memberInjectMethodNa... | [
"public",
"String",
"createMemberInjection",
"(",
"TypeLiteral",
"<",
"?",
">",
"type",
",",
"NameGenerator",
"nameGenerator",
",",
"List",
"<",
"InjectorMethod",
">",
"methodsOutput",
")",
"throws",
"NoSourceNameException",
"{",
"String",
"memberInjectMethodName",
"=... | Generates all the required injector methods to inject members of the given
type, and a standard member-inject method that invokes them.
@param type type for which the injection is performed
@param nameGenerator the name generator used to create method names
@param methodsOutput a list to which the new injection method... | [
"Generates",
"all",
"the",
"required",
"injector",
"methods",
"to",
"inject",
"members",
"of",
"the",
"given",
"type",
"and",
"a",
"standard",
"member",
"-",
"inject",
"method",
"that",
"invokes",
"them",
"."
] | 595e61ee0d2fa508815c016e924ec0e5cea2a2aa | https://github.com/gwtplus/google-gin/blob/595e61ee0d2fa508815c016e924ec0e5cea2a2aa/src/main/java/com/google/gwt/inject/rebind/util/SourceWriteUtil.java#L322-L341 | train |
gwtplus/google-gin | src/main/java/com/google/gwt/inject/rebind/util/MethodCallUtil.java | MethodCallUtil.createConstructorInjection | public SourceSnippet createConstructorInjection(
MethodLiteral<?, Constructor<?>> constructor, NameGenerator nameGenerator,
List<InjectorMethod> methodsOutput) throws NoSourceNameException {
return createMethodCallWithInjection(constructor, null, nameGenerator, methodsOutput);
} | java | public SourceSnippet createConstructorInjection(
MethodLiteral<?, Constructor<?>> constructor, NameGenerator nameGenerator,
List<InjectorMethod> methodsOutput) throws NoSourceNameException {
return createMethodCallWithInjection(constructor, null, nameGenerator, methodsOutput);
} | [
"public",
"SourceSnippet",
"createConstructorInjection",
"(",
"MethodLiteral",
"<",
"?",
",",
"Constructor",
"<",
"?",
">",
">",
"constructor",
",",
"NameGenerator",
"nameGenerator",
",",
"List",
"<",
"InjectorMethod",
">",
"methodsOutput",
")",
"throws",
"NoSourceN... | Creates a constructor injecting method and returns a string that invokes
the new method. The new method returns the constructed object.
@param constructor constructor to call
@param nameGenerator NameGenerator to be used for ensuring method name uniqueness
@param methodsOutput a list where all new methods created by ... | [
"Creates",
"a",
"constructor",
"injecting",
"method",
"and",
"returns",
"a",
"string",
"that",
"invokes",
"the",
"new",
"method",
".",
"The",
"new",
"method",
"returns",
"the",
"constructed",
"object",
"."
] | 595e61ee0d2fa508815c016e924ec0e5cea2a2aa | https://github.com/gwtplus/google-gin/blob/595e61ee0d2fa508815c016e924ec0e5cea2a2aa/src/main/java/com/google/gwt/inject/rebind/util/MethodCallUtil.java#L52-L56 | train |
gwtplus/google-gin | src/main/java/com/google/gwt/inject/rebind/util/MethodCallUtil.java | MethodCallUtil.createMethodCallWithInjection | public SourceSnippet createMethodCallWithInjection(MethodLiteral<?, ?> method,
String invokeeName, NameGenerator nameGenerator, List<InjectorMethod> methodsOutput)
throws NoSourceNameException {
String[] params = new String[method.getParameterTypes().size()];
return createMethodCallWithInjection(met... | java | public SourceSnippet createMethodCallWithInjection(MethodLiteral<?, ?> method,
String invokeeName, NameGenerator nameGenerator, List<InjectorMethod> methodsOutput)
throws NoSourceNameException {
String[] params = new String[method.getParameterTypes().size()];
return createMethodCallWithInjection(met... | [
"public",
"SourceSnippet",
"createMethodCallWithInjection",
"(",
"MethodLiteral",
"<",
"?",
",",
"?",
">",
"method",
",",
"String",
"invokeeName",
",",
"NameGenerator",
"nameGenerator",
",",
"List",
"<",
"InjectorMethod",
">",
"methodsOutput",
")",
"throws",
"NoSour... | Creates a method that calls the passed method, injecting its parameters
using getters, and returns a string that invokes the new method. The new
method returns the passed method's return value, if any. If a method
without parameters is provided, that method will be called and no
parameters will be passed.
@param met... | [
"Creates",
"a",
"method",
"that",
"calls",
"the",
"passed",
"method",
"injecting",
"its",
"parameters",
"using",
"getters",
"and",
"returns",
"a",
"string",
"that",
"invokes",
"the",
"new",
"method",
".",
"The",
"new",
"method",
"returns",
"the",
"passed",
"... | 595e61ee0d2fa508815c016e924ec0e5cea2a2aa | https://github.com/gwtplus/google-gin/blob/595e61ee0d2fa508815c016e924ec0e5cea2a2aa/src/main/java/com/google/gwt/inject/rebind/util/MethodCallUtil.java#L74-L80 | train |
gwtplus/google-gin | src/main/java/com/google/gwt/inject/rebind/util/MethodCallUtil.java | MethodCallUtil.isLongAccess | private boolean isLongAccess(MethodLiteral<?, ?> method) {
boolean result = method.getReturnType().getRawType().equals(Long.TYPE);
for (TypeLiteral<?> paramLiteral : method.getParameterTypes()) {
result |= paramLiteral.getRawType().equals(Long.TYPE);
}
return result;
} | java | private boolean isLongAccess(MethodLiteral<?, ?> method) {
boolean result = method.getReturnType().getRawType().equals(Long.TYPE);
for (TypeLiteral<?> paramLiteral : method.getParameterTypes()) {
result |= paramLiteral.getRawType().equals(Long.TYPE);
}
return result;
} | [
"private",
"boolean",
"isLongAccess",
"(",
"MethodLiteral",
"<",
"?",
",",
"?",
">",
"method",
")",
"{",
"boolean",
"result",
"=",
"method",
".",
"getReturnType",
"(",
")",
".",
"getRawType",
"(",
")",
".",
"equals",
"(",
"Long",
".",
"TYPE",
")",
";",... | Check whether a method needs to have Long access. | [
"Check",
"whether",
"a",
"method",
"needs",
"to",
"have",
"Long",
"access",
"."
] | 595e61ee0d2fa508815c016e924ec0e5cea2a2aa | https://github.com/gwtplus/google-gin/blob/595e61ee0d2fa508815c016e924ec0e5cea2a2aa/src/main/java/com/google/gwt/inject/rebind/util/MethodCallUtil.java#L156-L163 | train |
gwtplus/google-gin | src/main/java/com/google/gwt/inject/rebind/GinBridgeClassLoader.java | GinBridgeClassLoader.findClass | @Override
protected Class<?> findClass(String name) throws ClassNotFoundException {
if (!loadedClassFiles) {
classFileMap = extractClassFileMap();
loadedClassFiles = true;
}
if (classFileMap == null) {
throw new ClassNotFoundException(name);
}
String internalName = name.replace... | java | @Override
protected Class<?> findClass(String name) throws ClassNotFoundException {
if (!loadedClassFiles) {
classFileMap = extractClassFileMap();
loadedClassFiles = true;
}
if (classFileMap == null) {
throw new ClassNotFoundException(name);
}
String internalName = name.replace... | [
"@",
"Override",
"protected",
"Class",
"<",
"?",
">",
"findClass",
"(",
"String",
"name",
")",
"throws",
"ClassNotFoundException",
"{",
"if",
"(",
"!",
"loadedClassFiles",
")",
"{",
"classFileMap",
"=",
"extractClassFileMap",
"(",
")",
";",
"loadedClassFiles",
... | Looks up classes in GWT's compilation state. | [
"Looks",
"up",
"classes",
"in",
"GWT",
"s",
"compilation",
"state",
"."
] | 595e61ee0d2fa508815c016e924ec0e5cea2a2aa | https://github.com/gwtplus/google-gin/blob/595e61ee0d2fa508815c016e924ec0e5cea2a2aa/src/main/java/com/google/gwt/inject/rebind/GinBridgeClassLoader.java#L135-L160 | train |
gwtplus/google-gin | src/main/java/com/google/gwt/inject/rebind/resolution/ImplicitBindingCreator.java | ImplicitBindingCreator.create | public Binding create(Key<?> key) throws BindingCreationException {
TypeLiteral<?> type = key.getTypeLiteral();
// All steps per:
// http://code.google.com/p/google-guice/wiki/BindingResolution
// 1. Explicit binding - already finished at this point.
// 2. Ask parent injector.
// 3. Ask child... | java | public Binding create(Key<?> key) throws BindingCreationException {
TypeLiteral<?> type = key.getTypeLiteral();
// All steps per:
// http://code.google.com/p/google-guice/wiki/BindingResolution
// 1. Explicit binding - already finished at this point.
// 2. Ask parent injector.
// 3. Ask child... | [
"public",
"Binding",
"create",
"(",
"Key",
"<",
"?",
">",
"key",
")",
"throws",
"BindingCreationException",
"{",
"TypeLiteral",
"<",
"?",
">",
"type",
"=",
"key",
".",
"getTypeLiteral",
"(",
")",
";",
"// All steps per:",
"// http://code.google.com/p/google-guice/... | Creates the implicit binding. | [
"Creates",
"the",
"implicit",
"binding",
"."
] | 595e61ee0d2fa508815c016e924ec0e5cea2a2aa | https://github.com/gwtplus/google-gin/blob/595e61ee0d2fa508815c016e924ec0e5cea2a2aa/src/main/java/com/google/gwt/inject/rebind/resolution/ImplicitBindingCreator.java#L82-L141 | train |
gwtplus/google-gin | src/main/java/com/google/gwt/inject/rebind/output/ReachabilityAnalyzer.java | ReachabilityAnalyzer.traceGinjectorMethods | private void traceGinjectorMethods() {
TypeLiteral<?> ginjectorInterface = rootBindings.getGinjectorInterface();
for (MethodLiteral<?, Method> method
: memberCollector.getMethods(ginjectorInterface)) {
if (!guiceUtil.isMemberInject(method)) {
// It's a constructor method, so just trace t... | java | private void traceGinjectorMethods() {
TypeLiteral<?> ginjectorInterface = rootBindings.getGinjectorInterface();
for (MethodLiteral<?, Method> method
: memberCollector.getMethods(ginjectorInterface)) {
if (!guiceUtil.isMemberInject(method)) {
// It's a constructor method, so just trace t... | [
"private",
"void",
"traceGinjectorMethods",
"(",
")",
"{",
"TypeLiteral",
"<",
"?",
">",
"ginjectorInterface",
"=",
"rootBindings",
".",
"getGinjectorInterface",
"(",
")",
";",
"for",
"(",
"MethodLiteral",
"<",
"?",
",",
"Method",
">",
"method",
":",
"memberCo... | Traces out bindings that are reachable from a GInjector method. | [
"Traces",
"out",
"bindings",
"that",
"are",
"reachable",
"from",
"a",
"GInjector",
"method",
"."
] | 595e61ee0d2fa508815c016e924ec0e5cea2a2aa | https://github.com/gwtplus/google-gin/blob/595e61ee0d2fa508815c016e924ec0e5cea2a2aa/src/main/java/com/google/gwt/inject/rebind/output/ReachabilityAnalyzer.java#L138-L163 | train |
skyscreamer/yoga | yoga-core/src/main/java/org/skyscreamer/yoga/metadata/DefaultMetaDataRegistry.java | DefaultMetaDataRegistry.getNameForType | private String getNameForType( Class<?> type )
{
if ( _typeToStringMap.containsKey( type ) )
{
return _typeToStringMap.get( type );
}
for ( Entry<String, Class<?>> entry : _typeMappings.entrySet() )
{
if ( entry.getValue().isAssignableFrom( type ) )
... | java | private String getNameForType( Class<?> type )
{
if ( _typeToStringMap.containsKey( type ) )
{
return _typeToStringMap.get( type );
}
for ( Entry<String, Class<?>> entry : _typeMappings.entrySet() )
{
if ( entry.getValue().isAssignableFrom( type ) )
... | [
"private",
"String",
"getNameForType",
"(",
"Class",
"<",
"?",
">",
"type",
")",
"{",
"if",
"(",
"_typeToStringMap",
".",
"containsKey",
"(",
"type",
")",
")",
"{",
"return",
"_typeToStringMap",
".",
"get",
"(",
"type",
")",
";",
"}",
"for",
"(",
"Entr... | given a type, get a name. This takes subclassing into consideration. For
now, this will return the first subclass match to the type, not the closest | [
"given",
"a",
"type",
"get",
"a",
"name",
".",
"This",
"takes",
"subclassing",
"into",
"consideration",
".",
"For",
"now",
"this",
"will",
"return",
"the",
"first",
"subclass",
"match",
"to",
"the",
"type",
"not",
"the",
"closest"
] | d98f6b0b2b60ff195cc6878ed54e515e639bc9da | https://github.com/skyscreamer/yoga/blob/d98f6b0b2b60ff195cc6878ed54e515e639bc9da/yoga-core/src/main/java/org/skyscreamer/yoga/metadata/DefaultMetaDataRegistry.java#L86-L101 | train |
hpsa/hpe-application-automation-tools-plugin | src/main/java/com/hp/application/automation/tools/rest/RestClient.java | RestClient.setProxyCfg | public static ProxyInfo setProxyCfg(String host, String port, String userName, String password) {
return new ProxyInfo(host, port, userName, password);
} | java | public static ProxyInfo setProxyCfg(String host, String port, String userName, String password) {
return new ProxyInfo(host, port, userName, password);
} | [
"public",
"static",
"ProxyInfo",
"setProxyCfg",
"(",
"String",
"host",
",",
"String",
"port",
",",
"String",
"userName",
",",
"String",
"password",
")",
"{",
"return",
"new",
"ProxyInfo",
"(",
"host",
",",
"port",
",",
"userName",
",",
"password",
")",
";"... | Set proxy configuration.
@param host
@param port
@param userName
@param password
@return proxyinfo instance | [
"Set",
"proxy",
"configuration",
"."
] | 987536f5551bc76fd028d746a951d1fd72c7567a | https://github.com/hpsa/hpe-application-automation-tools-plugin/blob/987536f5551bc76fd028d746a951d1fd72c7567a/src/main/java/com/hp/application/automation/tools/rest/RestClient.java#L422-L424 | train |
hpsa/hpe-application-automation-tools-plugin | src/main/java/com/hp/application/automation/tools/results/RunResultRecorder.java | RunResultRecorder.createHtmlReport | @SuppressWarnings("squid:S134")
private void createHtmlReport(FilePath reportFolder,
String testFolderPath,
File artifactsDir,
List<String> reportNames,
TestResult testResult) thro... | java | @SuppressWarnings("squid:S134")
private void createHtmlReport(FilePath reportFolder,
String testFolderPath,
File artifactsDir,
List<String> reportNames,
TestResult testResult) thro... | [
"@",
"SuppressWarnings",
"(",
"\"squid:S134\"",
")",
"private",
"void",
"createHtmlReport",
"(",
"FilePath",
"reportFolder",
",",
"String",
"testFolderPath",
",",
"File",
"artifactsDir",
",",
"List",
"<",
"String",
">",
"reportNames",
",",
"TestResult",
"testResult"... | Copy Summary Html reports created by LoadRunner
@param reportFolder
@param testFolderPath
@param artifactsDir
@param reportNames
@param testResult
@throws IOException
@throws InterruptedException | [
"Copy",
"Summary",
"Html",
"reports",
"created",
"by",
"LoadRunner"
] | 987536f5551bc76fd028d746a951d1fd72c7567a | https://github.com/hpsa/hpe-application-automation-tools-plugin/blob/987536f5551bc76fd028d746a951d1fd72c7567a/src/main/java/com/hp/application/automation/tools/results/RunResultRecorder.java#L749-L787 | train |
hpsa/hpe-application-automation-tools-plugin | src/main/java/com/hp/application/automation/tools/results/RunResultRecorder.java | RunResultRecorder.createTransactionSummary | private void createTransactionSummary(FilePath reportFolder,
String testFolderPath,
File artifactsDir,
List<String> reportNames,
TestResult testResult) ... | java | private void createTransactionSummary(FilePath reportFolder,
String testFolderPath,
File artifactsDir,
List<String> reportNames,
TestResult testResult) ... | [
"private",
"void",
"createTransactionSummary",
"(",
"FilePath",
"reportFolder",
",",
"String",
"testFolderPath",
",",
"File",
"artifactsDir",
",",
"List",
"<",
"String",
">",
"reportNames",
",",
"TestResult",
"testResult",
")",
"throws",
"IOException",
",",
"Interru... | Copies and creates the transaction summery on the master
@param reportFolder
@param testFolderPath
@param artifactsDir
@param reportNames
@param testResult
@throws IOException
@throws InterruptedException | [
"Copies",
"and",
"creates",
"the",
"transaction",
"summery",
"on",
"the",
"master"
] | 987536f5551bc76fd028d746a951d1fd72c7567a | https://github.com/hpsa/hpe-application-automation-tools-plugin/blob/987536f5551bc76fd028d746a951d1fd72c7567a/src/main/java/com/hp/application/automation/tools/results/RunResultRecorder.java#L909-L951 | train |
hpsa/hpe-application-automation-tools-plugin | src/main/java/com/hp/application/automation/tools/run/SseBuilder.java | SseBuilder.setProxyCredentials | private void setProxyCredentials(Run<?, ?> run) {
if (proxySettings != null && proxySettings.getFsProxyCredentialsId() != null) {
UsernamePasswordCredentials up = CredentialsProvider.findCredentialById(
proxySettings.getFsProxyCredentialsId(),
StandardUsernamePasswordCredentials.class,
... | java | private void setProxyCredentials(Run<?, ?> run) {
if (proxySettings != null && proxySettings.getFsProxyCredentialsId() != null) {
UsernamePasswordCredentials up = CredentialsProvider.findCredentialById(
proxySettings.getFsProxyCredentialsId(),
StandardUsernamePasswordCredentials.class,
... | [
"private",
"void",
"setProxyCredentials",
"(",
"Run",
"<",
"?",
",",
"?",
">",
"run",
")",
"{",
"if",
"(",
"proxySettings",
"!=",
"null",
"&&",
"proxySettings",
".",
"getFsProxyCredentialsId",
"(",
")",
"!=",
"null",
")",
"{",
"UsernamePasswordCredentials",
... | Get credentials by the credentials id. Then set the user name and password into the SsePoxySetting. | [
"Get",
"credentials",
"by",
"the",
"credentials",
"id",
".",
"Then",
"set",
"the",
"user",
"name",
"and",
"password",
"into",
"the",
"SsePoxySetting",
"."
] | 987536f5551bc76fd028d746a951d1fd72c7567a | https://github.com/hpsa/hpe-application-automation-tools-plugin/blob/987536f5551bc76fd028d746a951d1fd72c7567a/src/main/java/com/hp/application/automation/tools/run/SseBuilder.java#L177-L190 | train |
hpsa/hpe-application-automation-tools-plugin | src/main/java/com/hp/application/automation/tools/run/SseBuilder.java | SseBuilder.getCredentialsById | private UsernamePasswordCredentials getCredentialsById(String credentialsId, Run<?, ?> run, PrintStream logger) {
if (StringUtils.isBlank(credentialsId)) {
throw new NullPointerException("credentials is not configured.");
}
UsernamePasswordCredentials credentials = CredentialsProvider.findCre... | java | private UsernamePasswordCredentials getCredentialsById(String credentialsId, Run<?, ?> run, PrintStream logger) {
if (StringUtils.isBlank(credentialsId)) {
throw new NullPointerException("credentials is not configured.");
}
UsernamePasswordCredentials credentials = CredentialsProvider.findCre... | [
"private",
"UsernamePasswordCredentials",
"getCredentialsById",
"(",
"String",
"credentialsId",
",",
"Run",
"<",
"?",
",",
"?",
">",
"run",
",",
"PrintStream",
"logger",
")",
"{",
"if",
"(",
"StringUtils",
".",
"isBlank",
"(",
"credentialsId",
")",
")",
"{",
... | Get user name password credentials by id. | [
"Get",
"user",
"name",
"password",
"credentials",
"by",
"id",
"."
] | 987536f5551bc76fd028d746a951d1fd72c7567a | https://github.com/hpsa/hpe-application-automation-tools-plugin/blob/987536f5551bc76fd028d746a951d1fd72c7567a/src/main/java/com/hp/application/automation/tools/run/SseBuilder.java#L195-L209 | train |
hpsa/hpe-application-automation-tools-plugin | src/main/java/com/hp/application/automation/tools/results/PerformanceJobReportAction.java | PerformanceJobReportAction.mergeResults | public void mergeResults(LrJobResults resultFiles)
{
for(JobLrScenarioResult scenarioResult : resultFiles.getLrScenarioResults().values())
{
this._resultFiles.addScenario(scenarioResult);
}
} | java | public void mergeResults(LrJobResults resultFiles)
{
for(JobLrScenarioResult scenarioResult : resultFiles.getLrScenarioResults().values())
{
this._resultFiles.addScenario(scenarioResult);
}
} | [
"public",
"void",
"mergeResults",
"(",
"LrJobResults",
"resultFiles",
")",
"{",
"for",
"(",
"JobLrScenarioResult",
"scenarioResult",
":",
"resultFiles",
".",
"getLrScenarioResults",
"(",
")",
".",
"values",
"(",
")",
")",
"{",
"this",
".",
"_resultFiles",
".",
... | Merge results of several runs - espcially useful in pipeline jobs with multiple LR steps
@param resultFiles the result files | [
"Merge",
"results",
"of",
"several",
"runs",
"-",
"espcially",
"useful",
"in",
"pipeline",
"jobs",
"with",
"multiple",
"LR",
"steps"
] | 987536f5551bc76fd028d746a951d1fd72c7567a | https://github.com/hpsa/hpe-application-automation-tools-plugin/blob/987536f5551bc76fd028d746a951d1fd72c7567a/src/main/java/com/hp/application/automation/tools/results/PerformanceJobReportAction.java#L66-L72 | train |
hpsa/hpe-application-automation-tools-plugin | src/main/java/com/hp/application/automation/tools/mc/JobConfigurationProxy.java | JobConfigurationProxy.loginToMC | public JSONObject loginToMC(String mcUrl, String mcUserName, String mcPassword, String proxyAddress, String proxyUsername, String proxyPassword) {
JSONObject returnObject = new JSONObject();
try {
Map<String, String> headers = new HashMap<String, String>();
headers.put(Constants... | java | public JSONObject loginToMC(String mcUrl, String mcUserName, String mcPassword, String proxyAddress, String proxyUsername, String proxyPassword) {
JSONObject returnObject = new JSONObject();
try {
Map<String, String> headers = new HashMap<String, String>();
headers.put(Constants... | [
"public",
"JSONObject",
"loginToMC",
"(",
"String",
"mcUrl",
",",
"String",
"mcUserName",
",",
"String",
"mcPassword",
",",
"String",
"proxyAddress",
",",
"String",
"proxyUsername",
",",
"String",
"proxyPassword",
")",
"{",
"JSONObject",
"returnObject",
"=",
"new"... | Login to MC | [
"Login",
"to",
"MC"
] | 987536f5551bc76fd028d746a951d1fd72c7567a | https://github.com/hpsa/hpe-application-automation-tools-plugin/blob/987536f5551bc76fd028d746a951d1fd72c7567a/src/main/java/com/hp/application/automation/tools/mc/JobConfigurationProxy.java#L32-L74 | train |
hpsa/hpe-application-automation-tools-plugin | src/main/java/com/hp/application/automation/tools/mc/JobConfigurationProxy.java | JobConfigurationProxy.upload | public JSONObject upload(String mcUrl, String mcUserName, String mcPassword, String proxyAddress, String proxyUsername, String proxyPassword, String appPath) throws Exception {
JSONObject json = null;
String hp4mSecret = null;
String jsessionId = null;
File appFile = new File(appPath);... | java | public JSONObject upload(String mcUrl, String mcUserName, String mcPassword, String proxyAddress, String proxyUsername, String proxyPassword, String appPath) throws Exception {
JSONObject json = null;
String hp4mSecret = null;
String jsessionId = null;
File appFile = new File(appPath);... | [
"public",
"JSONObject",
"upload",
"(",
"String",
"mcUrl",
",",
"String",
"mcUserName",
",",
"String",
"mcPassword",
",",
"String",
"proxyAddress",
",",
"String",
"proxyUsername",
",",
"String",
"proxyPassword",
",",
"String",
"appPath",
")",
"throws",
"Exception",... | upload app to MC | [
"upload",
"app",
"to",
"MC"
] | 987536f5551bc76fd028d746a951d1fd72c7567a | https://github.com/hpsa/hpe-application-automation-tools-plugin/blob/987536f5551bc76fd028d746a951d1fd72c7567a/src/main/java/com/hp/application/automation/tools/mc/JobConfigurationProxy.java#L77-L129 | train |
hpsa/hpe-application-automation-tools-plugin | src/main/java/com/hp/application/automation/tools/mc/JobConfigurationProxy.java | JobConfigurationProxy.createTempJob | public String createTempJob(String mcUrl, String mcUserName, String mcPassword, String proxyAddress, String proxyUserName, String proxyPassword) {
JSONObject job = null;
String jobId = null;
String hp4mSecret = null;
String jsessionId = null;
String loginJson = loginToMC(mcUrl, ... | java | public String createTempJob(String mcUrl, String mcUserName, String mcPassword, String proxyAddress, String proxyUserName, String proxyPassword) {
JSONObject job = null;
String jobId = null;
String hp4mSecret = null;
String jsessionId = null;
String loginJson = loginToMC(mcUrl, ... | [
"public",
"String",
"createTempJob",
"(",
"String",
"mcUrl",
",",
"String",
"mcUserName",
",",
"String",
"mcPassword",
",",
"String",
"proxyAddress",
",",
"String",
"proxyUserName",
",",
"String",
"proxyPassword",
")",
"{",
"JSONObject",
"job",
"=",
"null",
";",... | create one temp job | [
"create",
"one",
"temp",
"job"
] | 987536f5551bc76fd028d746a951d1fd72c7567a | https://github.com/hpsa/hpe-application-automation-tools-plugin/blob/987536f5551bc76fd028d746a951d1fd72c7567a/src/main/java/com/hp/application/automation/tools/mc/JobConfigurationProxy.java#L132-L170 | train |
hpsa/hpe-application-automation-tools-plugin | src/main/java/com/hp/application/automation/tools/mc/JobConfigurationProxy.java | JobConfigurationProxy.getJobById | public JSONObject getJobById(String mcUrl, String mcUserName, String mcPassword, String proxyAddress, String proxyUsername, String proxyPassword, String jobUUID) {
JSONObject jobJsonObject = null;
String hp4mSecret = null;
String jsessionId = null;
String loginJson = loginToMC(mcUrl, mc... | java | public JSONObject getJobById(String mcUrl, String mcUserName, String mcPassword, String proxyAddress, String proxyUsername, String proxyPassword, String jobUUID) {
JSONObject jobJsonObject = null;
String hp4mSecret = null;
String jsessionId = null;
String loginJson = loginToMC(mcUrl, mc... | [
"public",
"JSONObject",
"getJobById",
"(",
"String",
"mcUrl",
",",
"String",
"mcUserName",
",",
"String",
"mcPassword",
",",
"String",
"proxyAddress",
",",
"String",
"proxyUsername",
",",
"String",
"proxyPassword",
",",
"String",
"jobUUID",
")",
"{",
"JSONObject",... | get one job by id | [
"get",
"one",
"job",
"by",
"id"
] | 987536f5551bc76fd028d746a951d1fd72c7567a | https://github.com/hpsa/hpe-application-automation-tools-plugin/blob/987536f5551bc76fd028d746a951d1fd72c7567a/src/main/java/com/hp/application/automation/tools/mc/JobConfigurationProxy.java#L173-L209 | train |
hpsa/hpe-application-automation-tools-plugin | src/main/java/com/hp/application/automation/tools/results/parser/jenkinsjunit/Result.java | Result.getSuites | public List<Result.Suites> getSuites() {
if (suites == null) {
suites = new ArrayList<Result.Suites>();
}
return this.suites;
} | java | public List<Result.Suites> getSuites() {
if (suites == null) {
suites = new ArrayList<Result.Suites>();
}
return this.suites;
} | [
"public",
"List",
"<",
"Result",
".",
"Suites",
">",
"getSuites",
"(",
")",
"{",
"if",
"(",
"suites",
"==",
"null",
")",
"{",
"suites",
"=",
"new",
"ArrayList",
"<",
"Result",
".",
"Suites",
">",
"(",
")",
";",
"}",
"return",
"this",
".",
"suites",... | Gets the value of the suites property.
<p>
This accessor method returns a reference to the live list,
not a snapshot. Therefore any modification you make to the
returned list will be present inside the JAXB object.
This is why there is not a <CODE>set</CODE> method for the suites property.
<p>
For example, to add a n... | [
"Gets",
"the",
"value",
"of",
"the",
"suites",
"property",
"."
] | 987536f5551bc76fd028d746a951d1fd72c7567a | https://github.com/hpsa/hpe-application-automation-tools-plugin/blob/987536f5551bc76fd028d746a951d1fd72c7567a/src/main/java/com/hp/application/automation/tools/results/parser/jenkinsjunit/Result.java#L180-L185 | train |
hpsa/hpe-application-automation-tools-plugin | src/main/java/com/hp/application/automation/tools/run/RunFromFileBuilder.java | RunFromFileBuilder.getMCServerSettingsModel | public MCServerSettingsModel getMCServerSettingsModel() {
for (MCServerSettingsModel mcServer : getDescriptor().getMcServers()) {
if (this.runFromFileModel != null
&& runFromFileModel.getMcServerName() != null
&& mcServer.getMcServerName() != null
&& runFromFileModel.getMcServerName().equals(mcServe... | java | public MCServerSettingsModel getMCServerSettingsModel() {
for (MCServerSettingsModel mcServer : getDescriptor().getMcServers()) {
if (this.runFromFileModel != null
&& runFromFileModel.getMcServerName() != null
&& mcServer.getMcServerName() != null
&& runFromFileModel.getMcServerName().equals(mcServe... | [
"public",
"MCServerSettingsModel",
"getMCServerSettingsModel",
"(",
")",
"{",
"for",
"(",
"MCServerSettingsModel",
"mcServer",
":",
"getDescriptor",
"(",
")",
".",
"getMcServers",
"(",
")",
")",
"{",
"if",
"(",
"this",
".",
"runFromFileModel",
"!=",
"null",
"&&"... | Gets mc server settings model.
@return the mc server settings model | [
"Gets",
"mc",
"server",
"settings",
"model",
"."
] | 987536f5551bc76fd028d746a951d1fd72c7567a | https://github.com/hpsa/hpe-application-automation-tools-plugin/blob/987536f5551bc76fd028d746a951d1fd72c7567a/src/main/java/com/hp/application/automation/tools/run/RunFromFileBuilder.java#L475-L485 | train |
hpsa/hpe-application-automation-tools-plugin | src/main/java/com/hp/application/automation/tools/results/LrGraphUtils.java | LrGraphUtils.constructPercentileTransactionGraph | static void constructPercentileTransactionGraph(Map.Entry<String, LrProjectScenarioResults> scenarioResults,
JSONObject scenarioGraphData) {
Map<Integer, TreeMap<String, PercentileTransactionWholeRun>> percentileTransactionResults =
scenarioRes... | java | static void constructPercentileTransactionGraph(Map.Entry<String, LrProjectScenarioResults> scenarioResults,
JSONObject scenarioGraphData) {
Map<Integer, TreeMap<String, PercentileTransactionWholeRun>> percentileTransactionResults =
scenarioRes... | [
"static",
"void",
"constructPercentileTransactionGraph",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"LrProjectScenarioResults",
">",
"scenarioResults",
",",
"JSONObject",
"scenarioGraphData",
")",
"{",
"Map",
"<",
"Integer",
",",
"TreeMap",
"<",
"String",
",",
... | creates dataset for Percentile transaction graph
@param scenarioResults the relative scenario results to create the graph
@param scenarioGraphData the target graph data set | [
"creates",
"dataset",
"for",
"Percentile",
"transaction",
"graph"
] | 987536f5551bc76fd028d746a951d1fd72c7567a | https://github.com/hpsa/hpe-application-automation-tools-plugin/blob/987536f5551bc76fd028d746a951d1fd72c7567a/src/main/java/com/hp/application/automation/tools/results/LrGraphUtils.java#L96-L114 | train |
hpsa/hpe-application-automation-tools-plugin | src/main/java/com/hp/application/automation/tools/results/LrGraphUtils.java | LrGraphUtils.constructAvgTransactionGraph | static void constructAvgTransactionGraph(Map.Entry<String, LrProjectScenarioResults> scenarioResults,
JSONObject scenarioGraphData) {
Map<Integer, TreeMap<String, AvgTransactionResponseTime>> avgTransactionResponseTimeResults =
scenarioResults.getValu... | java | static void constructAvgTransactionGraph(Map.Entry<String, LrProjectScenarioResults> scenarioResults,
JSONObject scenarioGraphData) {
Map<Integer, TreeMap<String, AvgTransactionResponseTime>> avgTransactionResponseTimeResults =
scenarioResults.getValu... | [
"static",
"void",
"constructAvgTransactionGraph",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"LrProjectScenarioResults",
">",
"scenarioResults",
",",
"JSONObject",
"scenarioGraphData",
")",
"{",
"Map",
"<",
"Integer",
",",
"TreeMap",
"<",
"String",
",",
"AvgTra... | Construct avg transaction graph.
@param scenarioResults the scenario results
@param scenarioGraphData the scenario graph data | [
"Construct",
"avg",
"transaction",
"graph",
"."
] | 987536f5551bc76fd028d746a951d1fd72c7567a | https://github.com/hpsa/hpe-application-automation-tools-plugin/blob/987536f5551bc76fd028d746a951d1fd72c7567a/src/main/java/com/hp/application/automation/tools/results/LrGraphUtils.java#L164-L182 | train |
hpsa/hpe-application-automation-tools-plugin | src/main/java/com/hp/application/automation/tools/results/LrGraphUtils.java | LrGraphUtils.constructErrorGraph | static void constructErrorGraph(Map.Entry<String, LrProjectScenarioResults> scenarioResults,
JSONObject scenarioGraphData) {
Map<Integer, TimeRangeResult> errPerSecResults = scenarioResults.getValue().getErrPerSecResults();
JSONObject errPerSecResultsResultsGraphSet =... | java | static void constructErrorGraph(Map.Entry<String, LrProjectScenarioResults> scenarioResults,
JSONObject scenarioGraphData) {
Map<Integer, TimeRangeResult> errPerSecResults = scenarioResults.getValue().getErrPerSecResults();
JSONObject errPerSecResultsResultsGraphSet =... | [
"static",
"void",
"constructErrorGraph",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"LrProjectScenarioResults",
">",
"scenarioResults",
",",
"JSONObject",
"scenarioGraphData",
")",
"{",
"Map",
"<",
"Integer",
",",
"TimeRangeResult",
">",
"errPerSecResults",
"=",
... | Construct error graph.
@param scenarioResults the scenario results
@param scenarioGraphData the scenario graph data | [
"Construct",
"error",
"graph",
"."
] | 987536f5551bc76fd028d746a951d1fd72c7567a | https://github.com/hpsa/hpe-application-automation-tools-plugin/blob/987536f5551bc76fd028d746a951d1fd72c7567a/src/main/java/com/hp/application/automation/tools/results/LrGraphUtils.java#L220-L232 | train |
hpsa/hpe-application-automation-tools-plugin | src/main/java/com/hp/application/automation/tools/results/LrGraphUtils.java | LrGraphUtils.constructAverageThroughput | static void constructAverageThroughput(Map.Entry<String, LrProjectScenarioResults> scenarioResults,
JSONObject scenarioGraphData) {
Map<Integer, WholeRunResult> averageThroughputResults = scenarioResults.getValue().getAverageThroughputResults();
JSONObject aver... | java | static void constructAverageThroughput(Map.Entry<String, LrProjectScenarioResults> scenarioResults,
JSONObject scenarioGraphData) {
Map<Integer, WholeRunResult> averageThroughputResults = scenarioResults.getValue().getAverageThroughputResults();
JSONObject aver... | [
"static",
"void",
"constructAverageThroughput",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"LrProjectScenarioResults",
">",
"scenarioResults",
",",
"JSONObject",
"scenarioGraphData",
")",
"{",
"Map",
"<",
"Integer",
",",
"WholeRunResult",
">",
"averageThroughputRes... | Construct average throughput.
@param scenarioResults the scenario results
@param scenarioGraphData the scenario graph data | [
"Construct",
"average",
"throughput",
"."
] | 987536f5551bc76fd028d746a951d1fd72c7567a | https://github.com/hpsa/hpe-application-automation-tools-plugin/blob/987536f5551bc76fd028d746a951d1fd72c7567a/src/main/java/com/hp/application/automation/tools/results/LrGraphUtils.java#L261-L277 | train |
hpsa/hpe-application-automation-tools-plugin | src/main/java/com/hp/application/automation/tools/results/LrGraphUtils.java | LrGraphUtils.constructTotalThroughputGraph | static void constructTotalThroughputGraph(Map.Entry<String, LrProjectScenarioResults> scenarioResults,
JSONObject scenarioGraphData) {
Map<Integer, WholeRunResult> totalThroughputResults = scenarioResults.getValue().getTotalThroughtputResults();
JSONObject t... | java | static void constructTotalThroughputGraph(Map.Entry<String, LrProjectScenarioResults> scenarioResults,
JSONObject scenarioGraphData) {
Map<Integer, WholeRunResult> totalThroughputResults = scenarioResults.getValue().getTotalThroughtputResults();
JSONObject t... | [
"static",
"void",
"constructTotalThroughputGraph",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"LrProjectScenarioResults",
">",
"scenarioResults",
",",
"JSONObject",
"scenarioGraphData",
")",
"{",
"Map",
"<",
"Integer",
",",
"WholeRunResult",
">",
"totalThroughputRe... | Construct total throughput graph.
@param scenarioResults the scenario results
@param scenarioGraphData the scenario graph data | [
"Construct",
"total",
"throughput",
"graph",
"."
] | 987536f5551bc76fd028d746a951d1fd72c7567a | https://github.com/hpsa/hpe-application-automation-tools-plugin/blob/987536f5551bc76fd028d746a951d1fd72c7567a/src/main/java/com/hp/application/automation/tools/results/LrGraphUtils.java#L308-L324 | train |
hpsa/hpe-application-automation-tools-plugin | src/main/java/com/hp/application/automation/tools/results/LrGraphUtils.java | LrGraphUtils.constructAvgHitsGraph | static void constructAvgHitsGraph(Map.Entry<String, LrProjectScenarioResults> scenarioResults,
JSONObject scenarioGraphData) {
Map<Integer, WholeRunResult> avgHitsPerSec = scenarioResults.getValue().getAverageHitsPerSecondResults();
JSONObject avgHitsPerSecGraphSet ... | java | static void constructAvgHitsGraph(Map.Entry<String, LrProjectScenarioResults> scenarioResults,
JSONObject scenarioGraphData) {
Map<Integer, WholeRunResult> avgHitsPerSec = scenarioResults.getValue().getAverageHitsPerSecondResults();
JSONObject avgHitsPerSecGraphSet ... | [
"static",
"void",
"constructAvgHitsGraph",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"LrProjectScenarioResults",
">",
"scenarioResults",
",",
"JSONObject",
"scenarioGraphData",
")",
"{",
"Map",
"<",
"Integer",
",",
"WholeRunResult",
">",
"avgHitsPerSec",
"=",
... | Construct avg hits graph.
@param scenarioResults the scenario results
@param scenarioGraphData the scenario graph data | [
"Construct",
"avg",
"hits",
"graph",
"."
] | 987536f5551bc76fd028d746a951d1fd72c7567a | https://github.com/hpsa/hpe-application-automation-tools-plugin/blob/987536f5551bc76fd028d746a951d1fd72c7567a/src/main/java/com/hp/application/automation/tools/results/LrGraphUtils.java#L332-L348 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.