id int32 0 165k | 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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
107,000 | pro-grade/pro-grade | src/main/java/net/sourceforge/prograde/policy/ProGradePolicy.java | ProGradePolicy.getCertificates | private Certificate[] getCertificates(String parsedCertificates, KeyStore keystore) throws Exception {
String[] splitCertificates = new String[0];
if (parsedCertificates != null) {
splitCertificates = parsedCertificates.split(",");
}
if (splitCertificates.length > 0 && keysto... | java | private Certificate[] getCertificates(String parsedCertificates, KeyStore keystore) throws Exception {
String[] splitCertificates = new String[0];
if (parsedCertificates != null) {
splitCertificates = parsedCertificates.split(",");
}
if (splitCertificates.length > 0 && keysto... | [
"private",
"Certificate",
"[",
"]",
"getCertificates",
"(",
"String",
"parsedCertificates",
",",
"KeyStore",
"keystore",
")",
"throws",
"Exception",
"{",
"String",
"[",
"]",
"splitCertificates",
"=",
"new",
"String",
"[",
"0",
"]",
";",
"if",
"(",
"parsedCerti... | Private method for getting certificates from KeyStore.
@param parsedCertificates signedBy part of policy file defines certificates
@param keystore KeyStore which is used by this policy file
@return array of Certificates
@throws Exception when there was any problem during getting Certificates | [
"Private",
"method",
"for",
"getting",
"certificates",
"from",
"KeyStore",
"."
] | 371b0d1349c37bd048a06206d3fa1b0c3c1cd9ab | https://github.com/pro-grade/pro-grade/blob/371b0d1349c37bd048a06206d3fa1b0c3c1cd9ab/src/main/java/net/sourceforge/prograde/policy/ProGradePolicy.java#L892-L918 |
107,001 | bpsm/edn-java | src/main/java/us/bpsm/edn/Symbol.java | Symbol.newSymbol | public static Symbol newSymbol(String prefix, String name) {
checkArguments(prefix, name);
return new Symbol(prefix, name);
} | java | public static Symbol newSymbol(String prefix, String name) {
checkArguments(prefix, name);
return new Symbol(prefix, name);
} | [
"public",
"static",
"Symbol",
"newSymbol",
"(",
"String",
"prefix",
",",
"String",
"name",
")",
"{",
"checkArguments",
"(",
"prefix",
",",
"name",
")",
";",
"return",
"new",
"Symbol",
"(",
"prefix",
",",
"name",
")",
";",
"}"
] | Provide a Symbol with the given prefix and name.
@param prefix
An empty String or a non-empty String obeying the
restrictions specified by edn. Never null.
@param name
A non-empty string obeying the restrictions specified by edn.
Never null.
@return a Symbol, never null. | [
"Provide",
"a",
"Symbol",
"with",
"the",
"given",
"prefix",
"and",
"name",
"."
] | c5dfdb77431da1aca3c257599b237a21575629b2 | https://github.com/bpsm/edn-java/blob/c5dfdb77431da1aca3c257599b237a21575629b2/src/main/java/us/bpsm/edn/Symbol.java#L50-L53 |
107,002 | LachlanMcKee/gsonpath | library/src/main/java/gsonpath/GsonUtil.java | GsonUtil.isValidValue | public static boolean isValidValue(JsonReader in) throws IOException {
if (in.peek() == JsonToken.NULL) {
in.skipValue();
return false;
}
return true;
} | java | public static boolean isValidValue(JsonReader in) throws IOException {
if (in.peek() == JsonToken.NULL) {
in.skipValue();
return false;
}
return true;
} | [
"public",
"static",
"boolean",
"isValidValue",
"(",
"JsonReader",
"in",
")",
"throws",
"IOException",
"{",
"if",
"(",
"in",
".",
"peek",
"(",
")",
"==",
"JsonToken",
".",
"NULL",
")",
"{",
"in",
".",
"skipValue",
"(",
")",
";",
"return",
"false",
";",
... | Determines whether the next value within the reader is not null.
@param in the json reader used to read the stream
@return true if a valid value exists, or false if the value is null.
@throws IOException see {@link JsonReader#skipValue()} | [
"Determines",
"whether",
"the",
"next",
"value",
"within",
"the",
"reader",
"is",
"not",
"null",
"."
] | 7462869521b163684d66a07feef0ddbadc8949b5 | https://github.com/LachlanMcKee/gsonpath/blob/7462869521b163684d66a07feef0ddbadc8949b5/library/src/main/java/gsonpath/GsonUtil.java#L27-L33 |
107,003 | rnorth/visible-assertions | src/main/java/org/rnorth/visibleassertions/VisibleAssertions.java | VisibleAssertions.assertThat | public static <T> void assertThat(String whatTheObjectIs, T actual, Matcher<? super T> matcher) {
Description description = new StringDescription();
if (matcher.matches(actual)) {
description.appendText(whatTheObjectIs);
description.appendText(" ");
matcher.describeTo... | java | public static <T> void assertThat(String whatTheObjectIs, T actual, Matcher<? super T> matcher) {
Description description = new StringDescription();
if (matcher.matches(actual)) {
description.appendText(whatTheObjectIs);
description.appendText(" ");
matcher.describeTo... | [
"public",
"static",
"<",
"T",
">",
"void",
"assertThat",
"(",
"String",
"whatTheObjectIs",
",",
"T",
"actual",
",",
"Matcher",
"<",
"?",
"super",
"T",
">",
"matcher",
")",
"{",
"Description",
"description",
"=",
"new",
"StringDescription",
"(",
")",
";",
... | Assert using a Hamcrest matcher.
@param whatTheObjectIs what is the thing being tested, in a logical sense
@param actual the actual value
@param matcher a matcher to check the actual value against
@param <T> class of the actual value | [
"Assert",
"using",
"a",
"Hamcrest",
"matcher",
"."
] | 6d7a7724db40ac0e9f87279553f814b790310b3b | https://github.com/rnorth/visible-assertions/blob/6d7a7724db40ac0e9f87279553f814b790310b3b/src/main/java/org/rnorth/visibleassertions/VisibleAssertions.java#L345-L359 |
107,004 | rnorth/visible-assertions | src/main/java/org/rnorth/visibleassertions/VisibleAssertions.java | VisibleAssertions.pass | public static void pass(String message) {
if (Boolean.getBoolean("visibleassertions.silence") || Boolean.getBoolean("visibleassertions.silence.passes")) {
return;
}
System.out.println(" " + green(TICK_MARK + " " + message));
} | java | public static void pass(String message) {
if (Boolean.getBoolean("visibleassertions.silence") || Boolean.getBoolean("visibleassertions.silence.passes")) {
return;
}
System.out.println(" " + green(TICK_MARK + " " + message));
} | [
"public",
"static",
"void",
"pass",
"(",
"String",
"message",
")",
"{",
"if",
"(",
"Boolean",
".",
"getBoolean",
"(",
"\"visibleassertions.silence\"",
")",
"||",
"Boolean",
".",
"getBoolean",
"(",
"\"visibleassertions.silence.passes\"",
")",
")",
"{",
"return",
... | Indicate that something passed.
@param message message to display alongside a green tick | [
"Indicate",
"that",
"something",
"passed",
"."
] | 6d7a7724db40ac0e9f87279553f814b790310b3b | https://github.com/rnorth/visible-assertions/blob/6d7a7724db40ac0e9f87279553f814b790310b3b/src/main/java/org/rnorth/visibleassertions/VisibleAssertions.java#L422-L427 |
107,005 | xsonorg/xson | src/main/java/org/xson/core/asm/Attribute.java | Attribute.write | protected ByteVector write(
final ClassWriter cw,
final byte[] code,
final int len,
final int maxStack,
final int maxLocals)
{
ByteVector v = new ByteVector();
v.data = value;
v.length = value.length;
return v;
} | java | protected ByteVector write(
final ClassWriter cw,
final byte[] code,
final int len,
final int maxStack,
final int maxLocals)
{
ByteVector v = new ByteVector();
v.data = value;
v.length = value.length;
return v;
} | [
"protected",
"ByteVector",
"write",
"(",
"final",
"ClassWriter",
"cw",
",",
"final",
"byte",
"[",
"]",
"code",
",",
"final",
"int",
"len",
",",
"final",
"int",
"maxStack",
",",
"final",
"int",
"maxLocals",
")",
"{",
"ByteVector",
"v",
"=",
"new",
"ByteVe... | Returns the byte array form of this attribute.
@param cw the class to which this attribute must be added. This parameter
can be used to add to the constant pool of this class the items
that corresponds to this attribute.
@param code the bytecode of the method corresponding to this code
attribute, or <tt>null</tt> if t... | [
"Returns",
"the",
"byte",
"array",
"form",
"of",
"this",
"attribute",
"."
] | ce1e197ec4ef9be448ed6ca96513e886151f83a9 | https://github.com/xsonorg/xson/blob/ce1e197ec4ef9be448ed6ca96513e886151f83a9/src/main/java/org/xson/core/asm/Attribute.java#L153-L164 |
107,006 | xsonorg/xson | src/main/java/org/xson/core/asm/Attribute.java | Attribute.getCount | final int getCount() {
int count = 0;
Attribute attr = this;
while (attr != null) {
count += 1;
attr = attr.next;
}
return count;
} | java | final int getCount() {
int count = 0;
Attribute attr = this;
while (attr != null) {
count += 1;
attr = attr.next;
}
return count;
} | [
"final",
"int",
"getCount",
"(",
")",
"{",
"int",
"count",
"=",
"0",
";",
"Attribute",
"attr",
"=",
"this",
";",
"while",
"(",
"attr",
"!=",
"null",
")",
"{",
"count",
"+=",
"1",
";",
"attr",
"=",
"attr",
".",
"next",
";",
"}",
"return",
"count",... | Returns the length of the attribute list that begins with this attribute.
@return the length of the attribute list that begins with this attribute. | [
"Returns",
"the",
"length",
"of",
"the",
"attribute",
"list",
"that",
"begins",
"with",
"this",
"attribute",
"."
] | ce1e197ec4ef9be448ed6ca96513e886151f83a9 | https://github.com/xsonorg/xson/blob/ce1e197ec4ef9be448ed6ca96513e886151f83a9/src/main/java/org/xson/core/asm/Attribute.java#L171-L179 |
107,007 | xsonorg/xson | src/main/java/org/xson/core/asm/Attribute.java | Attribute.getSize | final int getSize(
final ClassWriter cw,
final byte[] code,
final int len,
final int maxStack,
final int maxLocals)
{
Attribute attr = this;
int size = 0;
while (attr != null) {
cw.newUTF8(attr.type);
size += attr.write(cw, code... | java | final int getSize(
final ClassWriter cw,
final byte[] code,
final int len,
final int maxStack,
final int maxLocals)
{
Attribute attr = this;
int size = 0;
while (attr != null) {
cw.newUTF8(attr.type);
size += attr.write(cw, code... | [
"final",
"int",
"getSize",
"(",
"final",
"ClassWriter",
"cw",
",",
"final",
"byte",
"[",
"]",
"code",
",",
"final",
"int",
"len",
",",
"final",
"int",
"maxStack",
",",
"final",
"int",
"maxLocals",
")",
"{",
"Attribute",
"attr",
"=",
"this",
";",
"int",... | Returns the size of all the attributes in this attribute list.
@param cw the class writer to be used to convert the attributes into byte
arrays, with the {@link #write write} method.
@param code the bytecode of the method corresponding to these code
attributes, or <tt>null</tt> if these attributes are not code
attribu... | [
"Returns",
"the",
"size",
"of",
"all",
"the",
"attributes",
"in",
"this",
"attribute",
"list",
"."
] | ce1e197ec4ef9be448ed6ca96513e886151f83a9 | https://github.com/xsonorg/xson/blob/ce1e197ec4ef9be448ed6ca96513e886151f83a9/src/main/java/org/xson/core/asm/Attribute.java#L201-L216 |
107,008 | xsonorg/xson | src/main/java/org/xson/core/asm/Attribute.java | Attribute.put | final void put(
final ClassWriter cw,
final byte[] code,
final int len,
final int maxStack,
final int maxLocals,
final ByteVector out)
{
Attribute attr = this;
while (attr != null) {
ByteVector b = attr.write(cw, code, len, maxStack, maxLoc... | java | final void put(
final ClassWriter cw,
final byte[] code,
final int len,
final int maxStack,
final int maxLocals,
final ByteVector out)
{
Attribute attr = this;
while (attr != null) {
ByteVector b = attr.write(cw, code, len, maxStack, maxLoc... | [
"final",
"void",
"put",
"(",
"final",
"ClassWriter",
"cw",
",",
"final",
"byte",
"[",
"]",
"code",
",",
"final",
"int",
"len",
",",
"final",
"int",
"maxStack",
",",
"final",
"int",
"maxLocals",
",",
"final",
"ByteVector",
"out",
")",
"{",
"Attribute",
... | Writes all the attributes of this attribute list in the given byte
vector.
@param cw the class writer to be used to convert the attributes into byte
arrays, with the {@link #write write} method.
@param code the bytecode of the method corresponding to these code
attributes, or <tt>null</tt> if these attributes are not ... | [
"Writes",
"all",
"the",
"attributes",
"of",
"this",
"attribute",
"list",
"in",
"the",
"given",
"byte",
"vector",
"."
] | ce1e197ec4ef9be448ed6ca96513e886151f83a9 | https://github.com/xsonorg/xson/blob/ce1e197ec4ef9be448ed6ca96513e886151f83a9/src/main/java/org/xson/core/asm/Attribute.java#L238-L253 |
107,009 | xsonorg/xson | src/main/java/org/xson/core/asm/Label.java | Label.addReference | private void addReference(
final int sourcePosition,
final int referencePosition)
{
if (srcAndRefPositions == null) {
srcAndRefPositions = new int[6];
}
if (referenceCount >= srcAndRefPositions.length) {
int[] a = new int[srcAndRefPositions.length + 6]... | java | private void addReference(
final int sourcePosition,
final int referencePosition)
{
if (srcAndRefPositions == null) {
srcAndRefPositions = new int[6];
}
if (referenceCount >= srcAndRefPositions.length) {
int[] a = new int[srcAndRefPositions.length + 6]... | [
"private",
"void",
"addReference",
"(",
"final",
"int",
"sourcePosition",
",",
"final",
"int",
"referencePosition",
")",
"{",
"if",
"(",
"srcAndRefPositions",
"==",
"null",
")",
"{",
"srcAndRefPositions",
"=",
"new",
"int",
"[",
"6",
"]",
";",
"}",
"if",
"... | Adds a forward reference to this label. This method must be called only
for a true forward reference, i.e. only if this label is not resolved
yet. For backward references, the offset of the reference can be, and
must be, computed and stored directly.
@param sourcePosition the position of the referencing instruction. T... | [
"Adds",
"a",
"forward",
"reference",
"to",
"this",
"label",
".",
"This",
"method",
"must",
"be",
"called",
"only",
"for",
"a",
"true",
"forward",
"reference",
"i",
".",
"e",
".",
"only",
"if",
"this",
"label",
"is",
"not",
"resolved",
"yet",
".",
"For"... | ce1e197ec4ef9be448ed6ca96513e886151f83a9 | https://github.com/xsonorg/xson/blob/ce1e197ec4ef9be448ed6ca96513e886151f83a9/src/main/java/org/xson/core/asm/Label.java#L317-L335 |
107,010 | xsonorg/xson | src/main/java/org/xson/core/asm/Label.java | Label.inSameSubroutine | boolean inSameSubroutine(final Label block) {
for (int i = 0; i < srcAndRefPositions.length; ++i) {
if ((srcAndRefPositions[i] & block.srcAndRefPositions[i]) != 0) {
return true;
}
}
return false;
} | java | boolean inSameSubroutine(final Label block) {
for (int i = 0; i < srcAndRefPositions.length; ++i) {
if ((srcAndRefPositions[i] & block.srcAndRefPositions[i]) != 0) {
return true;
}
}
return false;
} | [
"boolean",
"inSameSubroutine",
"(",
"final",
"Label",
"block",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"srcAndRefPositions",
".",
"length",
";",
"++",
"i",
")",
"{",
"if",
"(",
"(",
"srcAndRefPositions",
"[",
"i",
"]",
"&",
"block"... | Returns true if this basic block and the given one belong to a common
subroutine.
@param block another basic block.
@return true if this basic block and the given one belong to a common
subroutine. | [
"Returns",
"true",
"if",
"this",
"basic",
"block",
"and",
"the",
"given",
"one",
"belong",
"to",
"a",
"common",
"subroutine",
"."
] | ce1e197ec4ef9be448ed6ca96513e886151f83a9 | https://github.com/xsonorg/xson/blob/ce1e197ec4ef9be448ed6ca96513e886151f83a9/src/main/java/org/xson/core/asm/Label.java#L441-L448 |
107,011 | xsonorg/xson | src/main/java/org/xson/core/asm/Label.java | Label.visitSubroutine | void visitSubroutine(final Label JSR, final long id, final int nbSubroutines)
{
if (JSR != null) {
if ((status & VISITED) != 0) {
return;
}
status |= VISITED;
// adds JSR to the successors of this block, if it is a RET block
if ((st... | java | void visitSubroutine(final Label JSR, final long id, final int nbSubroutines)
{
if (JSR != null) {
if ((status & VISITED) != 0) {
return;
}
status |= VISITED;
// adds JSR to the successors of this block, if it is a RET block
if ((st... | [
"void",
"visitSubroutine",
"(",
"final",
"Label",
"JSR",
",",
"final",
"long",
"id",
",",
"final",
"int",
"nbSubroutines",
")",
"{",
"if",
"(",
"JSR",
"!=",
"null",
")",
"{",
"if",
"(",
"(",
"status",
"&",
"VISITED",
")",
"!=",
"0",
")",
"{",
"retu... | Finds the basic blocks that belong to a given subroutine, and marks these
blocks as belonging to this subroutine. This recursive method follows the
control flow graph to find all the blocks that are reachable from the
current block WITHOUT following any JSR target.
@param JSR a JSR block that jumps to this subroutine.... | [
"Finds",
"the",
"basic",
"blocks",
"that",
"belong",
"to",
"a",
"given",
"subroutine",
"and",
"marks",
"these",
"blocks",
"as",
"belonging",
"to",
"this",
"subroutine",
".",
"This",
"recursive",
"method",
"follows",
"the",
"control",
"flow",
"graph",
"to",
"... | ce1e197ec4ef9be448ed6ca96513e886151f83a9 | https://github.com/xsonorg/xson/blob/ce1e197ec4ef9be448ed6ca96513e886151f83a9/src/main/java/org/xson/core/asm/Label.java#L476-L512 |
107,012 | xsonorg/xson | src/main/java/org/xson/core/asm/MethodWriter.java | MethodWriter.noSuccessor | private void noSuccessor() {
if (compute == FRAMES) {
Label l = new Label();
l.frame = new Frame();
l.frame.owner = l;
l.resolve(this, code.length, code.data);
previousBlock.successor = l;
previousBlock = l;
} else {
cur... | java | private void noSuccessor() {
if (compute == FRAMES) {
Label l = new Label();
l.frame = new Frame();
l.frame.owner = l;
l.resolve(this, code.length, code.data);
previousBlock.successor = l;
previousBlock = l;
} else {
cur... | [
"private",
"void",
"noSuccessor",
"(",
")",
"{",
"if",
"(",
"compute",
"==",
"FRAMES",
")",
"{",
"Label",
"l",
"=",
"new",
"Label",
"(",
")",
";",
"l",
".",
"frame",
"=",
"new",
"Frame",
"(",
")",
";",
"l",
".",
"frame",
".",
"owner",
"=",
"l",... | Ends the current basic block. This method must be used in the case where
the current basic block does not have any successor. | [
"Ends",
"the",
"current",
"basic",
"block",
".",
"This",
"method",
"must",
"be",
"used",
"in",
"the",
"case",
"where",
"the",
"current",
"basic",
"block",
"does",
"not",
"have",
"any",
"successor",
"."
] | ce1e197ec4ef9be448ed6ca96513e886151f83a9 | https://github.com/xsonorg/xson/blob/ce1e197ec4ef9be448ed6ca96513e886151f83a9/src/main/java/org/xson/core/asm/MethodWriter.java#L1498-L1510 |
107,013 | xsonorg/xson | src/main/java/org/xson/core/asm/MethodWriter.java | MethodWriter.visitFrame | private void visitFrame(final Frame f) {
int i, t;
int nTop = 0;
int nLocal = 0;
int nStack = 0;
int[] locals = f.inputLocals;
int[] stacks = f.inputStack;
// computes the number of locals (ignores TOP types that are just after
// a LONG or a DOUBLE, and a... | java | private void visitFrame(final Frame f) {
int i, t;
int nTop = 0;
int nLocal = 0;
int nStack = 0;
int[] locals = f.inputLocals;
int[] stacks = f.inputStack;
// computes the number of locals (ignores TOP types that are just after
// a LONG or a DOUBLE, and a... | [
"private",
"void",
"visitFrame",
"(",
"final",
"Frame",
"f",
")",
"{",
"int",
"i",
",",
"t",
";",
"int",
"nTop",
"=",
"0",
";",
"int",
"nLocal",
"=",
"0",
";",
"int",
"nStack",
"=",
"0",
";",
"int",
"[",
"]",
"locals",
"=",
"f",
".",
"inputLoca... | Visits a frame that has been computed from scratch.
@param f the frame that must be visited. | [
"Visits",
"a",
"frame",
"that",
"has",
"been",
"computed",
"from",
"scratch",
"."
] | ce1e197ec4ef9be448ed6ca96513e886151f83a9 | https://github.com/xsonorg/xson/blob/ce1e197ec4ef9be448ed6ca96513e886151f83a9/src/main/java/org/xson/core/asm/MethodWriter.java#L1521-L1568 |
107,014 | xsonorg/xson | src/main/java/org/xson/core/asm/MethodWriter.java | MethodWriter.readInt | static int readInt(final byte[] b, final int index) {
return ((b[index] & 0xFF) << 24) | ((b[index + 1] & 0xFF) << 16)
| ((b[index + 2] & 0xFF) << 8) | (b[index + 3] & 0xFF);
} | java | static int readInt(final byte[] b, final int index) {
return ((b[index] & 0xFF) << 24) | ((b[index + 1] & 0xFF) << 16)
| ((b[index + 2] & 0xFF) << 8) | (b[index + 3] & 0xFF);
} | [
"static",
"int",
"readInt",
"(",
"final",
"byte",
"[",
"]",
"b",
",",
"final",
"int",
"index",
")",
"{",
"return",
"(",
"(",
"b",
"[",
"index",
"]",
"&",
"0xFF",
")",
"<<",
"24",
")",
"|",
"(",
"(",
"b",
"[",
"index",
"+",
"1",
"]",
"&",
"0... | Reads a signed int value in the given byte array.
@param b a byte array.
@param index the start index of the value to be read.
@return the read value. | [
"Reads",
"a",
"signed",
"int",
"value",
"in",
"the",
"given",
"byte",
"array",
"."
] | ce1e197ec4ef9be448ed6ca96513e886151f83a9 | https://github.com/xsonorg/xson/blob/ce1e197ec4ef9be448ed6ca96513e886151f83a9/src/main/java/org/xson/core/asm/MethodWriter.java#L2518-L2521 |
107,015 | xsonorg/xson | src/main/java/org/xson/core/asm/MethodWriter.java | MethodWriter.writeShort | static void writeShort(final byte[] b, final int index, final int s) {
b[index] = (byte) (s >>> 8);
b[index + 1] = (byte) s;
} | java | static void writeShort(final byte[] b, final int index, final int s) {
b[index] = (byte) (s >>> 8);
b[index + 1] = (byte) s;
} | [
"static",
"void",
"writeShort",
"(",
"final",
"byte",
"[",
"]",
"b",
",",
"final",
"int",
"index",
",",
"final",
"int",
"s",
")",
"{",
"b",
"[",
"index",
"]",
"=",
"(",
"byte",
")",
"(",
"s",
">>>",
"8",
")",
";",
"b",
"[",
"index",
"+",
"1",... | Writes a short value in the given byte array.
@param b a byte array.
@param index where the first byte of the short value must be written.
@param s the value to be written in the given byte array. | [
"Writes",
"a",
"short",
"value",
"in",
"the",
"given",
"byte",
"array",
"."
] | ce1e197ec4ef9be448ed6ca96513e886151f83a9 | https://github.com/xsonorg/xson/blob/ce1e197ec4ef9be448ed6ca96513e886151f83a9/src/main/java/org/xson/core/asm/MethodWriter.java#L2530-L2533 |
107,016 | xsonorg/xson | src/main/java/org/xson/core/asm/MethodWriter.java | MethodWriter.getNewOffset | static void getNewOffset(
final int[] indexes,
final int[] sizes,
final Label label)
{
if ((label.status & Label.RESIZED) == 0) {
label.position = getNewOffset(indexes, sizes, 0, label.position);
label.status |= Label.RESIZED;
}
} | java | static void getNewOffset(
final int[] indexes,
final int[] sizes,
final Label label)
{
if ((label.status & Label.RESIZED) == 0) {
label.position = getNewOffset(indexes, sizes, 0, label.position);
label.status |= Label.RESIZED;
}
} | [
"static",
"void",
"getNewOffset",
"(",
"final",
"int",
"[",
"]",
"indexes",
",",
"final",
"int",
"[",
"]",
"sizes",
",",
"final",
"Label",
"label",
")",
"{",
"if",
"(",
"(",
"label",
".",
"status",
"&",
"Label",
".",
"RESIZED",
")",
"==",
"0",
")",... | Updates the offset of the given label.
@param indexes current positions of the instructions to be resized. Each
instruction must be designated by the index of its <i>last</i>
byte, plus one (or, in other words, by the index of the <i>first</i>
byte of the <i>next</i> instruction).
@param sizes the number of bytes to b... | [
"Updates",
"the",
"offset",
"of",
"the",
"given",
"label",
"."
] | ce1e197ec4ef9be448ed6ca96513e886151f83a9 | https://github.com/xsonorg/xson/blob/ce1e197ec4ef9be448ed6ca96513e886151f83a9/src/main/java/org/xson/core/asm/MethodWriter.java#L2591-L2600 |
107,017 | xsonorg/xson | src/main/java/org/xson/core/asm/ClassReader.java | ClassReader.readClass | private static byte[] readClass(final InputStream is) throws IOException {
if (is == null) {
throw new IOException("Class not found");
}
byte[] b = new byte[is.available()];
int len = 0;
while (true) {
int n = is.read(b, len, b.length - len);
i... | java | private static byte[] readClass(final InputStream is) throws IOException {
if (is == null) {
throw new IOException("Class not found");
}
byte[] b = new byte[is.available()];
int len = 0;
while (true) {
int n = is.read(b, len, b.length - len);
i... | [
"private",
"static",
"byte",
"[",
"]",
"readClass",
"(",
"final",
"InputStream",
"is",
")",
"throws",
"IOException",
"{",
"if",
"(",
"is",
"==",
"null",
")",
"{",
"throw",
"new",
"IOException",
"(",
"\"Class not found\"",
")",
";",
"}",
"byte",
"[",
"]",... | Reads the bytecode of a class.
@param is an input stream from which to read the class.
@return the bytecode read from the given input stream.
@throws IOException if a problem occurs during reading. | [
"Reads",
"the",
"bytecode",
"of",
"a",
"class",
"."
] | ce1e197ec4ef9be448ed6ca96513e886151f83a9 | https://github.com/xsonorg/xson/blob/ce1e197ec4ef9be448ed6ca96513e886151f83a9/src/main/java/org/xson/core/asm/ClassReader.java#L380-L403 |
107,018 | xsonorg/xson | src/main/java/org/xson/core/asm/ClassReader.java | ClassReader.readParameterAnnotations | private void readParameterAnnotations(
int v,
final String desc,
final char[] buf,
final boolean visible,
final MethodVisitor mv)
{
int i;
int n = b[v++] & 0xFF;
// workaround for a bug in javac (javac compiler generates a parameter
// annotati... | java | private void readParameterAnnotations(
int v,
final String desc,
final char[] buf,
final boolean visible,
final MethodVisitor mv)
{
int i;
int n = b[v++] & 0xFF;
// workaround for a bug in javac (javac compiler generates a parameter
// annotati... | [
"private",
"void",
"readParameterAnnotations",
"(",
"int",
"v",
",",
"final",
"String",
"desc",
",",
"final",
"char",
"[",
"]",
"buf",
",",
"final",
"boolean",
"visible",
",",
"final",
"MethodVisitor",
"mv",
")",
"{",
"int",
"i",
";",
"int",
"n",
"=",
... | Reads parameter annotations and makes the given visitor visit them.
@param v start offset in {@link #b b} of the annotations to be read.
@param desc the method descriptor.
@param buf buffer to be used to call {@link #readUTF8 readUTF8},
{@link #readClass(int,char[]) readClass} or
{@link #readConst readConst}.
@param v... | [
"Reads",
"parameter",
"annotations",
"and",
"makes",
"the",
"given",
"visitor",
"visit",
"them",
"."
] | ce1e197ec4ef9be448ed6ca96513e886151f83a9 | https://github.com/xsonorg/xson/blob/ce1e197ec4ef9be448ed6ca96513e886151f83a9/src/main/java/org/xson/core/asm/ClassReader.java#L1471-L1503 |
107,019 | xsonorg/xson | src/main/java/org/xson/core/asm/Frame.java | Frame.push | private void push(final int type) {
// creates and/or resizes the output stack array if necessary
if (outputStack == null) {
outputStack = new int[10];
}
int n = outputStack.length;
if (outputStackTop >= n) {
int[] t = new int[Math.max(outputStackTop + 1, ... | java | private void push(final int type) {
// creates and/or resizes the output stack array if necessary
if (outputStack == null) {
outputStack = new int[10];
}
int n = outputStack.length;
if (outputStackTop >= n) {
int[] t = new int[Math.max(outputStackTop + 1, ... | [
"private",
"void",
"push",
"(",
"final",
"int",
"type",
")",
"{",
"// creates and/or resizes the output stack array if necessary",
"if",
"(",
"outputStack",
"==",
"null",
")",
"{",
"outputStack",
"=",
"new",
"int",
"[",
"10",
"]",
";",
"}",
"int",
"n",
"=",
... | Pushes a new type onto the output frame stack.
@param type the type that must be pushed. | [
"Pushes",
"a",
"new",
"type",
"onto",
"the",
"output",
"frame",
"stack",
"."
] | ce1e197ec4ef9be448ed6ca96513e886151f83a9 | https://github.com/xsonorg/xson/blob/ce1e197ec4ef9be448ed6ca96513e886151f83a9/src/main/java/org/xson/core/asm/Frame.java#L562-L580 |
107,020 | xsonorg/xson | src/main/java/org/xson/core/asm/Frame.java | Frame.pop | private void pop(final String desc) {
char c = desc.charAt(0);
if (c == '(') {
pop((MethodWriter.getArgumentsAndReturnSizes(desc) >> 2) - 1);
} else if (c == 'J' || c == 'D') {
pop(2);
} else {
pop(1);
}
} | java | private void pop(final String desc) {
char c = desc.charAt(0);
if (c == '(') {
pop((MethodWriter.getArgumentsAndReturnSizes(desc) >> 2) - 1);
} else if (c == 'J' || c == 'D') {
pop(2);
} else {
pop(1);
}
} | [
"private",
"void",
"pop",
"(",
"final",
"String",
"desc",
")",
"{",
"char",
"c",
"=",
"desc",
".",
"charAt",
"(",
"0",
")",
";",
"if",
"(",
"c",
"==",
"'",
"'",
")",
"{",
"pop",
"(",
"(",
"MethodWriter",
".",
"getArgumentsAndReturnSizes",
"(",
"des... | Pops a type from the output frame stack.
@param desc the descriptor of the type to be popped. Can also be a method
descriptor (in this case this method pops the types corresponding
to the method arguments). | [
"Pops",
"a",
"type",
"from",
"the",
"output",
"frame",
"stack",
"."
] | ce1e197ec4ef9be448ed6ca96513e886151f83a9 | https://github.com/xsonorg/xson/blob/ce1e197ec4ef9be448ed6ca96513e886151f83a9/src/main/java/org/xson/core/asm/Frame.java#L710-L719 |
107,021 | xsonorg/xson | src/main/java/org/xson/core/asm/Frame.java | Frame.initInputFrame | void initInputFrame(
final ClassWriter cw,
final int access,
final Type[] args,
final int maxLocals)
{
inputLocals = new int[maxLocals];
inputStack = new int[0];
int i = 0;
if ((access & Opcodes.ACC_STATIC) == 0) {
if ((access & MethodWrite... | java | void initInputFrame(
final ClassWriter cw,
final int access,
final Type[] args,
final int maxLocals)
{
inputLocals = new int[maxLocals];
inputStack = new int[0];
int i = 0;
if ((access & Opcodes.ACC_STATIC) == 0) {
if ((access & MethodWrite... | [
"void",
"initInputFrame",
"(",
"final",
"ClassWriter",
"cw",
",",
"final",
"int",
"access",
",",
"final",
"Type",
"[",
"]",
"args",
",",
"final",
"int",
"maxLocals",
")",
"{",
"inputLocals",
"=",
"new",
"int",
"[",
"maxLocals",
"]",
";",
"inputStack",
"=... | Initializes the input frame of the first basic block from the method
descriptor.
@param cw the ClassWriter to which this label belongs.
@param access the access flags of the method to which this label belongs.
@param args the formal parameter types of this method.
@param maxLocals the maximum number of local variables... | [
"Initializes",
"the",
"input",
"frame",
"of",
"the",
"first",
"basic",
"block",
"from",
"the",
"method",
"descriptor",
"."
] | ce1e197ec4ef9be448ed6ca96513e886151f83a9 | https://github.com/xsonorg/xson/blob/ce1e197ec4ef9be448ed6ca96513e886151f83a9/src/main/java/org/xson/core/asm/Frame.java#L786-L812 |
107,022 | xsonorg/xson | src/main/java/org/xson/core/asm/AnnotationWriter.java | AnnotationWriter.getSize | int getSize() {
int size = 0;
AnnotationWriter aw = this;
while (aw != null) {
size += aw.bv.length;
aw = aw.next;
}
return size;
} | java | int getSize() {
int size = 0;
AnnotationWriter aw = this;
while (aw != null) {
size += aw.bv.length;
aw = aw.next;
}
return size;
} | [
"int",
"getSize",
"(",
")",
"{",
"int",
"size",
"=",
"0",
";",
"AnnotationWriter",
"aw",
"=",
"this",
";",
"while",
"(",
"aw",
"!=",
"null",
")",
"{",
"size",
"+=",
"aw",
".",
"bv",
".",
"length",
";",
"aw",
"=",
"aw",
".",
"next",
";",
"}",
... | Returns the size of this annotation writer list.
@return the size of this annotation writer list. | [
"Returns",
"the",
"size",
"of",
"this",
"annotation",
"writer",
"list",
"."
] | ce1e197ec4ef9be448ed6ca96513e886151f83a9 | https://github.com/xsonorg/xson/blob/ce1e197ec4ef9be448ed6ca96513e886151f83a9/src/main/java/org/xson/core/asm/AnnotationWriter.java#L242-L250 |
107,023 | xsonorg/xson | src/main/java/org/xson/core/asm/AnnotationWriter.java | AnnotationWriter.put | void put(final ByteVector out) {
int n = 0;
int size = 2;
AnnotationWriter aw = this;
AnnotationWriter last = null;
while (aw != null) {
++n;
size += aw.bv.length;
aw.visitEnd(); // in case user forgot to call visitEnd
aw.prev = las... | java | void put(final ByteVector out) {
int n = 0;
int size = 2;
AnnotationWriter aw = this;
AnnotationWriter last = null;
while (aw != null) {
++n;
size += aw.bv.length;
aw.visitEnd(); // in case user forgot to call visitEnd
aw.prev = las... | [
"void",
"put",
"(",
"final",
"ByteVector",
"out",
")",
"{",
"int",
"n",
"=",
"0",
";",
"int",
"size",
"=",
"2",
";",
"AnnotationWriter",
"aw",
"=",
"this",
";",
"AnnotationWriter",
"last",
"=",
"null",
";",
"while",
"(",
"aw",
"!=",
"null",
")",
"{... | Puts the annotations of this annotation writer list into the given byte
vector.
@param out where the annotations must be put. | [
"Puts",
"the",
"annotations",
"of",
"this",
"annotation",
"writer",
"list",
"into",
"the",
"given",
"byte",
"vector",
"."
] | ce1e197ec4ef9be448ed6ca96513e886151f83a9 | https://github.com/xsonorg/xson/blob/ce1e197ec4ef9be448ed6ca96513e886151f83a9/src/main/java/org/xson/core/asm/AnnotationWriter.java#L258-L278 |
107,024 | xsonorg/xson | src/main/java/org/xson/core/asm/AnnotationWriter.java | AnnotationWriter.put | static void put(
final AnnotationWriter[] panns,
final int off,
final ByteVector out)
{
int size = 1 + 2 * (panns.length - off);
for (int i = off; i < panns.length; ++i) {
size += panns[i] == null ? 0 : panns[i].getSize();
}
out.putInt(size).putByt... | java | static void put(
final AnnotationWriter[] panns,
final int off,
final ByteVector out)
{
int size = 1 + 2 * (panns.length - off);
for (int i = off; i < panns.length; ++i) {
size += panns[i] == null ? 0 : panns[i].getSize();
}
out.putInt(size).putByt... | [
"static",
"void",
"put",
"(",
"final",
"AnnotationWriter",
"[",
"]",
"panns",
",",
"final",
"int",
"off",
",",
"final",
"ByteVector",
"out",
")",
"{",
"int",
"size",
"=",
"1",
"+",
"2",
"*",
"(",
"panns",
".",
"length",
"-",
"off",
")",
";",
"for",... | Puts the given annotation lists into the given byte vector.
@param panns an array of annotation writer lists.
@param off index of the first annotation to be written.
@param out where the annotations must be put. | [
"Puts",
"the",
"given",
"annotation",
"lists",
"into",
"the",
"given",
"byte",
"vector",
"."
] | ce1e197ec4ef9be448ed6ca96513e886151f83a9 | https://github.com/xsonorg/xson/blob/ce1e197ec4ef9be448ed6ca96513e886151f83a9/src/main/java/org/xson/core/asm/AnnotationWriter.java#L287-L315 |
107,025 | xsonorg/xson | src/main/java/org/xson/core/asm/Type.java | Type.getType | public static Type getType(final Class c) {
if (c.isPrimitive()) {
if (c == Integer.TYPE) {
return INT_TYPE;
} else if (c == Void.TYPE) {
return VOID_TYPE;
} else if (c == Boolean.TYPE) {
return BOOLEAN_TYPE;
} else ... | java | public static Type getType(final Class c) {
if (c.isPrimitive()) {
if (c == Integer.TYPE) {
return INT_TYPE;
} else if (c == Void.TYPE) {
return VOID_TYPE;
} else if (c == Boolean.TYPE) {
return BOOLEAN_TYPE;
} else ... | [
"public",
"static",
"Type",
"getType",
"(",
"final",
"Class",
"c",
")",
"{",
"if",
"(",
"c",
".",
"isPrimitive",
"(",
")",
")",
"{",
"if",
"(",
"c",
"==",
"Integer",
".",
"TYPE",
")",
"{",
"return",
"INT_TYPE",
";",
"}",
"else",
"if",
"(",
"c",
... | Returns the Java type corresponding to the given class.
@param c a class.
@return the Java type corresponding to the given class. | [
"Returns",
"the",
"Java",
"type",
"corresponding",
"to",
"the",
"given",
"class",
"."
] | ce1e197ec4ef9be448ed6ca96513e886151f83a9 | https://github.com/xsonorg/xson/blob/ce1e197ec4ef9be448ed6ca96513e886151f83a9/src/main/java/org/xson/core/asm/Type.java#L227-L251 |
107,026 | xsonorg/xson | src/main/java/org/xson/core/asm/Type.java | Type.getArgumentTypes | public static Type[] getArgumentTypes(final Method method) {
Class[] classes = method.getParameterTypes();
Type[] types = new Type[classes.length];
for (int i = classes.length - 1; i >= 0; --i) {
types[i] = getType(classes[i]);
}
return types;
} | java | public static Type[] getArgumentTypes(final Method method) {
Class[] classes = method.getParameterTypes();
Type[] types = new Type[classes.length];
for (int i = classes.length - 1; i >= 0; --i) {
types[i] = getType(classes[i]);
}
return types;
} | [
"public",
"static",
"Type",
"[",
"]",
"getArgumentTypes",
"(",
"final",
"Method",
"method",
")",
"{",
"Class",
"[",
"]",
"classes",
"=",
"method",
".",
"getParameterTypes",
"(",
")",
";",
"Type",
"[",
"]",
"types",
"=",
"new",
"Type",
"[",
"classes",
"... | Returns the Java types corresponding to the argument types of the given
method.
@param method a method.
@return the Java types corresponding to the argument types of the given
method. | [
"Returns",
"the",
"Java",
"types",
"corresponding",
"to",
"the",
"argument",
"types",
"of",
"the",
"given",
"method",
"."
] | ce1e197ec4ef9be448ed6ca96513e886151f83a9 | https://github.com/xsonorg/xson/blob/ce1e197ec4ef9be448ed6ca96513e886151f83a9/src/main/java/org/xson/core/asm/Type.java#L296-L303 |
107,027 | xsonorg/xson | src/main/java/org/xson/core/asm/Type.java | Type.getReturnType | public static Type getReturnType(final String methodDescriptor) {
char[] buf = methodDescriptor.toCharArray();
return getType(buf, methodDescriptor.indexOf(')') + 1);
} | java | public static Type getReturnType(final String methodDescriptor) {
char[] buf = methodDescriptor.toCharArray();
return getType(buf, methodDescriptor.indexOf(')') + 1);
} | [
"public",
"static",
"Type",
"getReturnType",
"(",
"final",
"String",
"methodDescriptor",
")",
"{",
"char",
"[",
"]",
"buf",
"=",
"methodDescriptor",
".",
"toCharArray",
"(",
")",
";",
"return",
"getType",
"(",
"buf",
",",
"methodDescriptor",
".",
"indexOf",
... | Returns the Java type corresponding to the return type of the given
method descriptor.
@param methodDescriptor a method descriptor.
@return the Java type corresponding to the return type of the given
method descriptor. | [
"Returns",
"the",
"Java",
"type",
"corresponding",
"to",
"the",
"return",
"type",
"of",
"the",
"given",
"method",
"descriptor",
"."
] | ce1e197ec4ef9be448ed6ca96513e886151f83a9 | https://github.com/xsonorg/xson/blob/ce1e197ec4ef9be448ed6ca96513e886151f83a9/src/main/java/org/xson/core/asm/Type.java#L313-L316 |
107,028 | xsonorg/xson | src/main/java/org/xson/core/asm/Type.java | Type.getClassName | public String getClassName() {
switch (sort) {
case VOID:
return "void";
case BOOLEAN:
return "boolean";
case CHAR:
return "char";
case BYTE:
return "byte";
case SHORT:
ret... | java | public String getClassName() {
switch (sort) {
case VOID:
return "void";
case BOOLEAN:
return "boolean";
case CHAR:
return "char";
case BYTE:
return "byte";
case SHORT:
ret... | [
"public",
"String",
"getClassName",
"(",
")",
"{",
"switch",
"(",
"sort",
")",
"{",
"case",
"VOID",
":",
"return",
"\"void\"",
";",
"case",
"BOOLEAN",
":",
"return",
"\"boolean\"",
";",
"case",
"CHAR",
":",
"return",
"\"char\"",
";",
"case",
"BYTE",
":",... | Returns the name of the class corresponding to this type.
@return the fully qualified name of the class corresponding to this type. | [
"Returns",
"the",
"name",
"of",
"the",
"class",
"corresponding",
"to",
"this",
"type",
"."
] | ce1e197ec4ef9be448ed6ca96513e886151f83a9 | https://github.com/xsonorg/xson/blob/ce1e197ec4ef9be448ed6ca96513e886151f83a9/src/main/java/org/xson/core/asm/Type.java#L426-L456 |
107,029 | xsonorg/xson | src/main/java/org/xson/core/asm/Type.java | Type.getDescriptor | private void getDescriptor(final StringBuffer buf) {
switch (sort) {
case VOID:
buf.append('V');
return;
case BOOLEAN:
buf.append('Z');
return;
case CHAR:
buf.append('C');
return;
... | java | private void getDescriptor(final StringBuffer buf) {
switch (sort) {
case VOID:
buf.append('V');
return;
case BOOLEAN:
buf.append('Z');
return;
case CHAR:
buf.append('C');
return;
... | [
"private",
"void",
"getDescriptor",
"(",
"final",
"StringBuffer",
"buf",
")",
"{",
"switch",
"(",
"sort",
")",
"{",
"case",
"VOID",
":",
"buf",
".",
"append",
"(",
"'",
"'",
")",
";",
"return",
";",
"case",
"BOOLEAN",
":",
"buf",
".",
"append",
"(",
... | Appends the descriptor corresponding to this Java type to the given
string buffer.
@param buf the string buffer to which the descriptor must be appended. | [
"Appends",
"the",
"descriptor",
"corresponding",
"to",
"this",
"Java",
"type",
"to",
"the",
"given",
"string",
"buffer",
"."
] | ce1e197ec4ef9be448ed6ca96513e886151f83a9 | https://github.com/xsonorg/xson/blob/ce1e197ec4ef9be448ed6ca96513e886151f83a9/src/main/java/org/xson/core/asm/Type.java#L514-L552 |
107,030 | xsonorg/xson | src/main/java/org/xson/core/asm/Type.java | Type.getOpcode | public int getOpcode(final int opcode) {
if (opcode == Opcodes.IALOAD || opcode == Opcodes.IASTORE) {
switch (sort) {
case BOOLEAN:
case BYTE:
return opcode + 5;
case CHAR:
return opcode + 6;
case... | java | public int getOpcode(final int opcode) {
if (opcode == Opcodes.IALOAD || opcode == Opcodes.IASTORE) {
switch (sort) {
case BOOLEAN:
case BYTE:
return opcode + 5;
case CHAR:
return opcode + 6;
case... | [
"public",
"int",
"getOpcode",
"(",
"final",
"int",
"opcode",
")",
"{",
"if",
"(",
"opcode",
"==",
"Opcodes",
".",
"IALOAD",
"||",
"opcode",
"==",
"Opcodes",
".",
"IASTORE",
")",
"{",
"switch",
"(",
"sort",
")",
"{",
"case",
"BOOLEAN",
":",
"case",
"B... | Returns a JVM instruction opcode adapted to this Java type.
@param opcode a JVM instruction opcode. This opcode must be one of ILOAD,
ISTORE, IALOAD, IASTORE, IADD, ISUB, IMUL, IDIV, IREM, INEG, ISHL,
ISHR, IUSHR, IAND, IOR, IXOR and IRETURN.
@return an opcode that is similar to the given opcode, but adapted to
this J... | [
"Returns",
"a",
"JVM",
"instruction",
"opcode",
"adapted",
"to",
"this",
"Java",
"type",
"."
] | ce1e197ec4ef9be448ed6ca96513e886151f83a9 | https://github.com/xsonorg/xson/blob/ce1e197ec4ef9be448ed6ca96513e886151f83a9/src/main/java/org/xson/core/asm/Type.java#L690-L735 |
107,031 | xsonorg/xson | src/main/java/org/xson/core/asm/FieldWriter.java | FieldWriter.getSize | int getSize() {
int size = 8;
if (value != 0) {
cw.newUTF8("ConstantValue");
size += 8;
}
if ((access & Opcodes.ACC_SYNTHETIC) != 0
&& (cw.version & 0xffff) < Opcodes.V1_5)
{
cw.newUTF8("Synthetic");
size += 6;
... | java | int getSize() {
int size = 8;
if (value != 0) {
cw.newUTF8("ConstantValue");
size += 8;
}
if ((access & Opcodes.ACC_SYNTHETIC) != 0
&& (cw.version & 0xffff) < Opcodes.V1_5)
{
cw.newUTF8("Synthetic");
size += 6;
... | [
"int",
"getSize",
"(",
")",
"{",
"int",
"size",
"=",
"8",
";",
"if",
"(",
"value",
"!=",
"0",
")",
"{",
"cw",
".",
"newUTF8",
"(",
"\"ConstantValue\"",
")",
";",
"size",
"+=",
"8",
";",
"}",
"if",
"(",
"(",
"access",
"&",
"Opcodes",
".",
"ACC_S... | Returns the size of this field.
@return the size of this field. | [
"Returns",
"the",
"size",
"of",
"this",
"field",
"."
] | ce1e197ec4ef9be448ed6ca96513e886151f83a9 | https://github.com/xsonorg/xson/blob/ce1e197ec4ef9be448ed6ca96513e886151f83a9/src/main/java/org/xson/core/asm/FieldWriter.java#L175-L207 |
107,032 | xsonorg/xson | src/main/java/org/xson/core/asm/FieldWriter.java | FieldWriter.put | void put(final ByteVector out) {
out.putShort(access).putShort(name).putShort(desc);
int attributeCount = 0;
if (value != 0) {
++attributeCount;
}
if ((access & Opcodes.ACC_SYNTHETIC) != 0
&& (cw.version & 0xffff) < Opcodes.V1_5)
{
... | java | void put(final ByteVector out) {
out.putShort(access).putShort(name).putShort(desc);
int attributeCount = 0;
if (value != 0) {
++attributeCount;
}
if ((access & Opcodes.ACC_SYNTHETIC) != 0
&& (cw.version & 0xffff) < Opcodes.V1_5)
{
... | [
"void",
"put",
"(",
"final",
"ByteVector",
"out",
")",
"{",
"out",
".",
"putShort",
"(",
"access",
")",
".",
"putShort",
"(",
"name",
")",
".",
"putShort",
"(",
"desc",
")",
";",
"int",
"attributeCount",
"=",
"0",
";",
"if",
"(",
"value",
"!=",
"0"... | Puts the content of this field into the given byte vector.
@param out where the content of this field must be put. | [
"Puts",
"the",
"content",
"of",
"this",
"field",
"into",
"the",
"given",
"byte",
"vector",
"."
] | ce1e197ec4ef9be448ed6ca96513e886151f83a9 | https://github.com/xsonorg/xson/blob/ce1e197ec4ef9be448ed6ca96513e886151f83a9/src/main/java/org/xson/core/asm/FieldWriter.java#L214-L268 |
107,033 | lucasr/probe | library/src/main/java/org/lucasr/probe/ViewClassUtil.java | ViewClassUtil.loadViewClass | static Class<?> loadViewClass(Context context, String name)
throws ClassNotFoundException {
return context.getClassLoader().loadClass(name).asSubclass(View.class);
} | java | static Class<?> loadViewClass(Context context, String name)
throws ClassNotFoundException {
return context.getClassLoader().loadClass(name).asSubclass(View.class);
} | [
"static",
"Class",
"<",
"?",
">",
"loadViewClass",
"(",
"Context",
"context",
",",
"String",
"name",
")",
"throws",
"ClassNotFoundException",
"{",
"return",
"context",
".",
"getClassLoader",
"(",
")",
".",
"loadClass",
"(",
"name",
")",
".",
"asSubclass",
"(... | Loads class for the given class name. | [
"Loads",
"class",
"for",
"the",
"given",
"class",
"name",
"."
] | cd15cc04383a1bf85de2f4c345d2018415b9ddc9 | https://github.com/lucasr/probe/blob/cd15cc04383a1bf85de2f4c345d2018415b9ddc9/library/src/main/java/org/lucasr/probe/ViewClassUtil.java#L41-L44 |
107,034 | lucasr/probe | library/src/main/java/org/lucasr/probe/ViewClassUtil.java | ViewClassUtil.findViewClass | static Class<?> findViewClass(Context context, String name)
throws ClassNotFoundException {
if (name.indexOf('.') >= 0) {
return loadViewClass(context, name);
}
for (String prefix : VIEW_CLASS_PREFIX_LIST) {
try {
return loadViewClass(context,... | java | static Class<?> findViewClass(Context context, String name)
throws ClassNotFoundException {
if (name.indexOf('.') >= 0) {
return loadViewClass(context, name);
}
for (String prefix : VIEW_CLASS_PREFIX_LIST) {
try {
return loadViewClass(context,... | [
"static",
"Class",
"<",
"?",
">",
"findViewClass",
"(",
"Context",
"context",
",",
"String",
"name",
")",
"throws",
"ClassNotFoundException",
"{",
"if",
"(",
"name",
".",
"indexOf",
"(",
"'",
"'",
")",
">=",
"0",
")",
"{",
"return",
"loadViewClass",
"(",... | Tries to load class using a predefined list of class prefixes for
Android views. | [
"Tries",
"to",
"load",
"class",
"using",
"a",
"predefined",
"list",
"of",
"class",
"prefixes",
"for",
"Android",
"views",
"."
] | cd15cc04383a1bf85de2f4c345d2018415b9ddc9 | https://github.com/lucasr/probe/blob/cd15cc04383a1bf85de2f4c345d2018415b9ddc9/library/src/main/java/org/lucasr/probe/ViewClassUtil.java#L63-L78 |
107,035 | callstats-io/callstats.java | callstats-java-sdk/src/main/java/io/callstats/sdk/internal/CallStatsAuthenticator.java | CallStatsAuthenticator.scheduleAuthentication | private void scheduleAuthentication(final int appId, final String bridgeId,
final CallStatsHttp2Client httpClient) {
scheduler.schedule(new Runnable() {
public void run() {
sendAsyncAuthenticationRequest(appId, bridgeId, httpClient);
}
}, authenticationRetryTimeout, TimeUnit.MILLISECON... | java | private void scheduleAuthentication(final int appId, final String bridgeId,
final CallStatsHttp2Client httpClient) {
scheduler.schedule(new Runnable() {
public void run() {
sendAsyncAuthenticationRequest(appId, bridgeId, httpClient);
}
}, authenticationRetryTimeout, TimeUnit.MILLISECON... | [
"private",
"void",
"scheduleAuthentication",
"(",
"final",
"int",
"appId",
",",
"final",
"String",
"bridgeId",
",",
"final",
"CallStatsHttp2Client",
"httpClient",
")",
"{",
"scheduler",
".",
"schedule",
"(",
"new",
"Runnable",
"(",
")",
"{",
"public",
"void",
... | Schedule authentication.
@param appId the app id
@param appSecret the app secret
@param bridgeId the bridge id
@param httpClient the http client | [
"Schedule",
"authentication",
"."
] | 04ec34f1490b75952ed90da706d59e311e2b44f1 | https://github.com/callstats-io/callstats.java/blob/04ec34f1490b75952ed90da706d59e311e2b44f1/callstats-java-sdk/src/main/java/io/callstats/sdk/internal/CallStatsAuthenticator.java#L166-L173 |
107,036 | callstats-io/callstats.java | callstats-java-sdk/src/main/java/io/callstats/sdk/internal/CallStatsBridgeKeepAliveManager.java | CallStatsBridgeKeepAliveManager.startKeepAliveSender | public void startKeepAliveSender(String authToken) {
this.token = authToken;
stopKeepAliveSender();
logger.info("Starting keepAlive Sender");
future = scheduler.scheduleAtFixedRate(new Runnable() {
public void run() {
sendKeepAliveBridgeMessage(appId, bridgeId, token, httpClient);
}... | java | public void startKeepAliveSender(String authToken) {
this.token = authToken;
stopKeepAliveSender();
logger.info("Starting keepAlive Sender");
future = scheduler.scheduleAtFixedRate(new Runnable() {
public void run() {
sendKeepAliveBridgeMessage(appId, bridgeId, token, httpClient);
}... | [
"public",
"void",
"startKeepAliveSender",
"(",
"String",
"authToken",
")",
"{",
"this",
".",
"token",
"=",
"authToken",
";",
"stopKeepAliveSender",
"(",
")",
";",
"logger",
".",
"info",
"(",
"\"Starting keepAlive Sender\"",
")",
";",
"future",
"=",
"scheduler",
... | Start keep alive sender.
@param authToken authentication token | [
"Start",
"keep",
"alive",
"sender",
"."
] | 04ec34f1490b75952ed90da706d59e311e2b44f1 | https://github.com/callstats-io/callstats.java/blob/04ec34f1490b75952ed90da706d59e311e2b44f1/callstats-java-sdk/src/main/java/io/callstats/sdk/internal/CallStatsBridgeKeepAliveManager.java#L103-L113 |
107,037 | callstats-io/callstats.java | callstats-java-sdk/src/main/java/io/callstats/sdk/internal/CallStatsBridgeKeepAliveManager.java | CallStatsBridgeKeepAliveManager.sendKeepAliveBridgeMessage | private void sendKeepAliveBridgeMessage(int appId, String bridgeId, String token,
final CallStatsHttp2Client httpClient) {
long apiTS = System.currentTimeMillis();
BridgeKeepAliveMessage message = new BridgeKeepAliveMessage(bridgeId, apiTS);
String requestMessageString = gson.toJson(message);
http... | java | private void sendKeepAliveBridgeMessage(int appId, String bridgeId, String token,
final CallStatsHttp2Client httpClient) {
long apiTS = System.currentTimeMillis();
BridgeKeepAliveMessage message = new BridgeKeepAliveMessage(bridgeId, apiTS);
String requestMessageString = gson.toJson(message);
http... | [
"private",
"void",
"sendKeepAliveBridgeMessage",
"(",
"int",
"appId",
",",
"String",
"bridgeId",
",",
"String",
"token",
",",
"final",
"CallStatsHttp2Client",
"httpClient",
")",
"{",
"long",
"apiTS",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
";",
"Bridg... | Send keep alive bridge message.
@param appId the app id
@param bridgeId the bridge id
@param token the token
@param httpClient the http client | [
"Send",
"keep",
"alive",
"bridge",
"message",
"."
] | 04ec34f1490b75952ed90da706d59e311e2b44f1 | https://github.com/callstats-io/callstats.java/blob/04ec34f1490b75952ed90da706d59e311e2b44f1/callstats-java-sdk/src/main/java/io/callstats/sdk/internal/CallStatsBridgeKeepAliveManager.java#L124-L164 |
107,038 | callstats-io/callstats.java | callstats-java-sdk/src/main/java/io/callstats/sdk/CallStats.java | CallStats.sendCallStatsBridgeStatusUpdate | public void sendCallStatsBridgeStatusUpdate(BridgeStatusInfo bridgeStatusInfo) {
if (!isInitialized()) {
bridgeStatusInfoQueue.push(bridgeStatusInfo);
return;
}
long epoch = System.currentTimeMillis();
String token = getToken();
BridgeStatusUpdateMessage eventMessage =
new Bridg... | java | public void sendCallStatsBridgeStatusUpdate(BridgeStatusInfo bridgeStatusInfo) {
if (!isInitialized()) {
bridgeStatusInfoQueue.push(bridgeStatusInfo);
return;
}
long epoch = System.currentTimeMillis();
String token = getToken();
BridgeStatusUpdateMessage eventMessage =
new Bridg... | [
"public",
"void",
"sendCallStatsBridgeStatusUpdate",
"(",
"BridgeStatusInfo",
"bridgeStatusInfo",
")",
"{",
"if",
"(",
"!",
"isInitialized",
"(",
")",
")",
"{",
"bridgeStatusInfoQueue",
".",
"push",
"(",
"bridgeStatusInfo",
")",
";",
"return",
";",
"}",
"long",
... | Send call stats bridge status update.
@param bridgeStatusInfo the bridge status info | [
"Send",
"call",
"stats",
"bridge",
"status",
"update",
"."
] | 04ec34f1490b75952ed90da706d59e311e2b44f1 | https://github.com/callstats-io/callstats.java/blob/04ec34f1490b75952ed90da706d59e311e2b44f1/callstats-java-sdk/src/main/java/io/callstats/sdk/CallStats.java#L194-L242 |
107,039 | callstats-io/callstats.java | callstats-java-sample-maven/sample.sdk/src/main/java/io/callstats/sample/sdk/LocalTokenGenerator.java | LocalTokenGenerator.readEcPrivateKey | private PrivateKey readEcPrivateKey(String fileName) throws InvalidKeySpecException, NoSuchAlgorithmException, IOException, NoSuchProviderException
{
StringBuilder sb = new StringBuilder();
BufferedReader br = new BufferedReader(new FileReader(fileName));
try {
char[] cbuf = new char[1024];
... | java | private PrivateKey readEcPrivateKey(String fileName) throws InvalidKeySpecException, NoSuchAlgorithmException, IOException, NoSuchProviderException
{
StringBuilder sb = new StringBuilder();
BufferedReader br = new BufferedReader(new FileReader(fileName));
try {
char[] cbuf = new char[1024];
... | [
"private",
"PrivateKey",
"readEcPrivateKey",
"(",
"String",
"fileName",
")",
"throws",
"InvalidKeySpecException",
",",
"NoSuchAlgorithmException",
",",
"IOException",
",",
"NoSuchProviderException",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",... | Reads JWK into PrivateKEy instance
@param fileName Path to the JWK file
@return java.security.PrivateKey instance of JWK
@throws InvalidKeySpecException
@throws NoSuchAlgorithmException
@throws IOException
@throws NoSuchProviderException | [
"Reads",
"JWK",
"into",
"PrivateKEy",
"instance"
] | 04ec34f1490b75952ed90da706d59e311e2b44f1 | https://github.com/callstats-io/callstats.java/blob/04ec34f1490b75952ed90da706d59e311e2b44f1/callstats-java-sample-maven/sample.sdk/src/main/java/io/callstats/sample/sdk/LocalTokenGenerator.java#L182-L213 |
107,040 | callstats-io/callstats.java | callstats-java-sdk/src/main/java/io/callstats/sdk/messages/BridgeStatusUpdateMessage.java | BridgeStatusUpdateMessage.setLocalID | public void setLocalID(String userID) {
try {
this.localID = URLEncoder.encode(userID, "UTF-8");
} catch (UnsupportedEncodingException e) {
logger.error("UnsupportedEncodingException " + e.getMessage(), e);
e.printStackTrace();
throw new RuntimeException(e);
} ;
} | java | public void setLocalID(String userID) {
try {
this.localID = URLEncoder.encode(userID, "UTF-8");
} catch (UnsupportedEncodingException e) {
logger.error("UnsupportedEncodingException " + e.getMessage(), e);
e.printStackTrace();
throw new RuntimeException(e);
} ;
} | [
"public",
"void",
"setLocalID",
"(",
"String",
"userID",
")",
"{",
"try",
"{",
"this",
".",
"localID",
"=",
"URLEncoder",
".",
"encode",
"(",
"userID",
",",
"\"UTF-8\"",
")",
";",
"}",
"catch",
"(",
"UnsupportedEncodingException",
"e",
")",
"{",
"logger",
... | Sets the bridge id.
@param userID the new bridge id | [
"Sets",
"the",
"bridge",
"id",
"."
] | 04ec34f1490b75952ed90da706d59e311e2b44f1 | https://github.com/callstats-io/callstats.java/blob/04ec34f1490b75952ed90da706d59e311e2b44f1/callstats-java-sdk/src/main/java/io/callstats/sdk/messages/BridgeStatusUpdateMessage.java#L154-L162 |
107,041 | FaritorKang/unmz-common-util | src/main/java/net/unmz/java/util/date/DateUtils.java | DateUtils.daysBetween | public static final int daysBetween(Date early, Date late) {
java.util.GregorianCalendar calst = new java.util.GregorianCalendar();
java.util.GregorianCalendar caled = new java.util.GregorianCalendar();
calst.setTime(early);
caled.setTime(late);
// 设置时间为0时
calst.set(java.... | java | public static final int daysBetween(Date early, Date late) {
java.util.GregorianCalendar calst = new java.util.GregorianCalendar();
java.util.GregorianCalendar caled = new java.util.GregorianCalendar();
calst.setTime(early);
caled.setTime(late);
// 设置时间为0时
calst.set(java.... | [
"public",
"static",
"final",
"int",
"daysBetween",
"(",
"Date",
"early",
",",
"Date",
"late",
")",
"{",
"java",
".",
"util",
".",
"GregorianCalendar",
"calst",
"=",
"new",
"java",
".",
"util",
".",
"GregorianCalendar",
"(",
")",
";",
"java",
".",
"util",... | Returns the days between two dates. Positive values indicate that the
second date is after the first, and negative values indicate, well, the
opposite. Relying on specific times is problematic.
@param early
the "first date"
@param late
the "second date"
@return the days between the two dates | [
"Returns",
"the",
"days",
"between",
"two",
"dates",
".",
"Positive",
"values",
"indicate",
"that",
"the",
"second",
"date",
"is",
"after",
"the",
"first",
"and",
"negative",
"values",
"indicate",
"well",
"the",
"opposite",
".",
"Relying",
"on",
"specific",
... | 2912b8889b85ed910d536f85b24b6fa68035814a | https://github.com/FaritorKang/unmz-common-util/blob/2912b8889b85ed910d536f85b24b6fa68035814a/src/main/java/net/unmz/java/util/date/DateUtils.java#L181-L198 |
107,042 | FaritorKang/unmz-common-util | src/main/java/net/unmz/java/util/xml/JaxbUtils.java | JaxbUtils.toXml | public String toXml(Object root, String encoding) {
try {
StringWriter writer = new StringWriter();
createMarshaller(encoding).marshal(root, writer);
return writer.toString();
} catch (JAXBException e) {
throw new RuntimeException(e);
}
} | java | public String toXml(Object root, String encoding) {
try {
StringWriter writer = new StringWriter();
createMarshaller(encoding).marshal(root, writer);
return writer.toString();
} catch (JAXBException e) {
throw new RuntimeException(e);
}
} | [
"public",
"String",
"toXml",
"(",
"Object",
"root",
",",
"String",
"encoding",
")",
"{",
"try",
"{",
"StringWriter",
"writer",
"=",
"new",
"StringWriter",
"(",
")",
";",
"createMarshaller",
"(",
"encoding",
")",
".",
"marshal",
"(",
"root",
",",
"writer",
... | Java Object->Xml. | [
"Java",
"Object",
"-",
">",
"Xml",
"."
] | 2912b8889b85ed910d536f85b24b6fa68035814a | https://github.com/FaritorKang/unmz-common-util/blob/2912b8889b85ed910d536f85b24b6fa68035814a/src/main/java/net/unmz/java/util/xml/JaxbUtils.java#L42-L50 |
107,043 | google/gwtmockito | gwtmockito/src/main/java/com/google/gwtmockito/fakes/FakeUiBinderProvider.java | FakeUiBinderProvider.getFake | @Override
public UiBinder<?, ?> getFake(final Class<?> type) {
return (UiBinder<?, ?>) Proxy.newProxyInstance(
FakeUiBinderProvider.class.getClassLoader(),
new Class<?>[] {type},
new InvocationHandler() {
@Override
public Object invoke(Object proxy, Method method, Objec... | java | @Override
public UiBinder<?, ?> getFake(final Class<?> type) {
return (UiBinder<?, ?>) Proxy.newProxyInstance(
FakeUiBinderProvider.class.getClassLoader(),
new Class<?>[] {type},
new InvocationHandler() {
@Override
public Object invoke(Object proxy, Method method, Objec... | [
"@",
"Override",
"public",
"UiBinder",
"<",
"?",
",",
"?",
">",
"getFake",
"(",
"final",
"Class",
"<",
"?",
">",
"type",
")",
"{",
"return",
"(",
"UiBinder",
"<",
"?",
",",
"?",
">",
")",
"Proxy",
".",
"newProxyInstance",
"(",
"FakeUiBinderProvider",
... | Returns a new instance of FakeUiBinder that implements the given interface.
This is accomplished by returning a dynamic proxy object that delegates
calls to a backing FakeUiBinder.
@param type interface to be implemented by the returned type. This must
represent an interface that directly extends {@link UiBinder}. | [
"Returns",
"a",
"new",
"instance",
"of",
"FakeUiBinder",
"that",
"implements",
"the",
"given",
"interface",
".",
"This",
"is",
"accomplished",
"by",
"returning",
"a",
"dynamic",
"proxy",
"object",
"that",
"delegates",
"calls",
"to",
"a",
"backing",
"FakeUiBinder... | e886a9b9d290169b5f83582dd89b7545c5f198a2 | https://github.com/google/gwtmockito/blob/e886a9b9d290169b5f83582dd89b7545c5f198a2/gwtmockito/src/main/java/com/google/gwtmockito/fakes/FakeUiBinderProvider.java#L51-L70 |
107,044 | google/gwtmockito | gwtmockito/src/main/java/com/google/gwtmockito/fakes/FakeClientBundleProvider.java | FakeClientBundleProvider.createFakeResource | @SuppressWarnings("unchecked") // safe since the proxy implements type
private <T> T createFakeResource(Class<T> type, final String name) {
return (T) Proxy.newProxyInstance(
FakeClientBundleProvider.class.getClassLoader(),
new Class<?>[] {type},
new InvocationHandler() {
@Overri... | java | @SuppressWarnings("unchecked") // safe since the proxy implements type
private <T> T createFakeResource(Class<T> type, final String name) {
return (T) Proxy.newProxyInstance(
FakeClientBundleProvider.class.getClassLoader(),
new Class<?>[] {type},
new InvocationHandler() {
@Overri... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"// safe since the proxy implements type",
"private",
"<",
"T",
">",
"T",
"createFakeResource",
"(",
"Class",
"<",
"T",
">",
"type",
",",
"final",
"String",
"name",
")",
"{",
"return",
"(",
"T",
")",
"Proxy",... | Creates a fake resource class that returns its own name where possible. | [
"Creates",
"a",
"fake",
"resource",
"class",
"that",
"returns",
"its",
"own",
"name",
"where",
"possible",
"."
] | e886a9b9d290169b5f83582dd89b7545c5f198a2 | https://github.com/google/gwtmockito/blob/e886a9b9d290169b5f83582dd89b7545c5f198a2/gwtmockito/src/main/java/com/google/gwtmockito/fakes/FakeClientBundleProvider.java#L71-L106 |
107,045 | google/gwtmockito | gwtmockito/src/main/java/com/google/gwtmockito/impl/StubGenerator.java | StubGenerator.shouldStub | public static boolean shouldStub(CtMethod method, Collection<Class<?>> classesToStub) {
// Stub any methods for which we have given explicit implementations
if (STUB_METHODS.containsKey(new ClassAndMethod(
method.getDeclaringClass().getName(), method.getName()))) {
return true;
}
// Stub ... | java | public static boolean shouldStub(CtMethod method, Collection<Class<?>> classesToStub) {
// Stub any methods for which we have given explicit implementations
if (STUB_METHODS.containsKey(new ClassAndMethod(
method.getDeclaringClass().getName(), method.getName()))) {
return true;
}
// Stub ... | [
"public",
"static",
"boolean",
"shouldStub",
"(",
"CtMethod",
"method",
",",
"Collection",
"<",
"Class",
"<",
"?",
">",
">",
"classesToStub",
")",
"{",
"// Stub any methods for which we have given explicit implementations",
"if",
"(",
"STUB_METHODS",
".",
"containsKey",... | Returns whether the behavior of the given method should be replaced. | [
"Returns",
"whether",
"the",
"behavior",
"of",
"the",
"given",
"method",
"should",
"be",
"replaced",
"."
] | e886a9b9d290169b5f83582dd89b7545c5f198a2 | https://github.com/google/gwtmockito/blob/e886a9b9d290169b5f83582dd89b7545c5f198a2/gwtmockito/src/main/java/com/google/gwtmockito/impl/StubGenerator.java#L76-L96 |
107,046 | google/gwtmockito | gwtmockito/src/main/java/com/google/gwtmockito/impl/StubGenerator.java | StubGenerator.invoke | public static Object invoke(Class<?> returnType, String className, String methodName) {
// If we have an explicit implementation for this method, invoke it
if (STUB_METHODS.containsKey(new ClassAndMethod(className, methodName))) {
return STUB_METHODS.get(new ClassAndMethod(className, methodName)).invoke()... | java | public static Object invoke(Class<?> returnType, String className, String methodName) {
// If we have an explicit implementation for this method, invoke it
if (STUB_METHODS.containsKey(new ClassAndMethod(className, methodName))) {
return STUB_METHODS.get(new ClassAndMethod(className, methodName)).invoke()... | [
"public",
"static",
"Object",
"invoke",
"(",
"Class",
"<",
"?",
">",
"returnType",
",",
"String",
"className",
",",
"String",
"methodName",
")",
"{",
"// If we have an explicit implementation for this method, invoke it",
"if",
"(",
"STUB_METHODS",
".",
"containsKey",
... | Invokes the stubbed behavior of the given method. | [
"Invokes",
"the",
"stubbed",
"behavior",
"of",
"the",
"given",
"method",
"."
] | e886a9b9d290169b5f83582dd89b7545c5f198a2 | https://github.com/google/gwtmockito/blob/e886a9b9d290169b5f83582dd89b7545c5f198a2/gwtmockito/src/main/java/com/google/gwtmockito/impl/StubGenerator.java#L99-L127 |
107,047 | mojohaus/aspectj-maven-plugin | src/main/java/org/codehaus/mojo/aspectj/CompilationFailedException.java | CompilationFailedException.create | public static CompilationFailedException create(final IMessage[] errors) {
final StringBuilder sb = new StringBuilder();
sb.append("AJC compiler errors:").append(LINE_SEPARATOR);
for (final IMessage error : errors) {
sb.append(error.toString()).append(LINE_SEPARATOR);
}
... | java | public static CompilationFailedException create(final IMessage[] errors) {
final StringBuilder sb = new StringBuilder();
sb.append("AJC compiler errors:").append(LINE_SEPARATOR);
for (final IMessage error : errors) {
sb.append(error.toString()).append(LINE_SEPARATOR);
}
... | [
"public",
"static",
"CompilationFailedException",
"create",
"(",
"final",
"IMessage",
"[",
"]",
"errors",
")",
"{",
"final",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"sb",
".",
"append",
"(",
"\"AJC compiler errors:\"",
")",
".",
"app... | Factory method which creates a CompilationFailedException from the supplied AJC IMessages.
@param errors A non-empty array of IMessage objects which
@return A CompilationFailedException containing a string representation of the supplied errors. | [
"Factory",
"method",
"which",
"creates",
"a",
"CompilationFailedException",
"from",
"the",
"supplied",
"AJC",
"IMessages",
"."
] | 120ee1ce08b93873931035ed98cd70e3ccceeefb | https://github.com/mojohaus/aspectj-maven-plugin/blob/120ee1ce08b93873931035ed98cd70e3ccceeefb/src/main/java/org/codehaus/mojo/aspectj/CompilationFailedException.java#L27-L36 |
107,048 | mojohaus/aspectj-maven-plugin | src/main/java/org/codehaus/mojo/aspectj/EclipseAjcMojo.java | EclipseAjcMojo.writeDocument | private void writeDocument( Document document, File file )
throws TransformerException, FileNotFoundException
{
document.normalize();
DOMSource source = new DOMSource( document );
StreamResult result = new StreamResult( new FileOutputStream( file ) );
Transformer transformer ... | java | private void writeDocument( Document document, File file )
throws TransformerException, FileNotFoundException
{
document.normalize();
DOMSource source = new DOMSource( document );
StreamResult result = new StreamResult( new FileOutputStream( file ) );
Transformer transformer ... | [
"private",
"void",
"writeDocument",
"(",
"Document",
"document",
",",
"File",
"file",
")",
"throws",
"TransformerException",
",",
"FileNotFoundException",
"{",
"document",
".",
"normalize",
"(",
")",
";",
"DOMSource",
"source",
"=",
"new",
"DOMSource",
"(",
"doc... | write document to the file
@param document
@param file
@throws TransformerException
@throws FileNotFoundException | [
"write",
"document",
"to",
"the",
"file"
] | 120ee1ce08b93873931035ed98cd70e3ccceeefb | https://github.com/mojohaus/aspectj-maven-plugin/blob/120ee1ce08b93873931035ed98cd70e3ccceeefb/src/main/java/org/codehaus/mojo/aspectj/EclipseAjcMojo.java#L319-L328 |
107,049 | mojohaus/aspectj-maven-plugin | src/main/java/org/codehaus/mojo/aspectj/AjcHelper.java | AjcHelper.createClassPath | @SuppressWarnings( "unchecked" )
public static String createClassPath( MavenProject project, List<Artifact> pluginArtifacts, List<String> outDirs )
{
String cp = new String();
Set<Artifact> classPathElements = Collections.synchronizedSet( new LinkedHashSet<Artifact>() );
Set<Artifact> de... | java | @SuppressWarnings( "unchecked" )
public static String createClassPath( MavenProject project, List<Artifact> pluginArtifacts, List<String> outDirs )
{
String cp = new String();
Set<Artifact> classPathElements = Collections.synchronizedSet( new LinkedHashSet<Artifact>() );
Set<Artifact> de... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"String",
"createClassPath",
"(",
"MavenProject",
"project",
",",
"List",
"<",
"Artifact",
">",
"pluginArtifacts",
",",
"List",
"<",
"String",
">",
"outDirs",
")",
"{",
"String",
"cp",
"="... | Constructs AspectJ compiler classpath string
@param project the Maven Project
@param pluginArtifacts the plugin Artifacts
@param outDirs the outputDirectories
@return a os spesific classpath string | [
"Constructs",
"AspectJ",
"compiler",
"classpath",
"string"
] | 120ee1ce08b93873931035ed98cd70e3ccceeefb | https://github.com/mojohaus/aspectj-maven-plugin/blob/120ee1ce08b93873931035ed98cd70e3ccceeefb/src/main/java/org/codehaus/mojo/aspectj/AjcHelper.java#L89-L124 |
107,050 | mojohaus/aspectj-maven-plugin | src/main/java/org/codehaus/mojo/aspectj/AjcHelper.java | AjcHelper.getBuildFilesForAjdtFile | public static Set<String> getBuildFilesForAjdtFile( String ajdtBuildDefFile, File basedir )
throws MojoExecutionException
{
Set<String> result = new LinkedHashSet<String>();
Properties ajdtBuildProperties = new Properties();
try
{
ajdtBuildProperties.load( new Fi... | java | public static Set<String> getBuildFilesForAjdtFile( String ajdtBuildDefFile, File basedir )
throws MojoExecutionException
{
Set<String> result = new LinkedHashSet<String>();
Properties ajdtBuildProperties = new Properties();
try
{
ajdtBuildProperties.load( new Fi... | [
"public",
"static",
"Set",
"<",
"String",
">",
"getBuildFilesForAjdtFile",
"(",
"String",
"ajdtBuildDefFile",
",",
"File",
"basedir",
")",
"throws",
"MojoExecutionException",
"{",
"Set",
"<",
"String",
">",
"result",
"=",
"new",
"LinkedHashSet",
"<",
"String",
"... | Based on a AJDT build properties file resolves the combination of all
include and exclude statements and returns a set of all the files to be
compiled and weaved.
@param ajdtBuildDefFile the ajdtBuildDefFile
@param basedir the baseDirectory
@return
@throws MojoExecutionException | [
"Based",
"on",
"a",
"AJDT",
"build",
"properties",
"file",
"resolves",
"the",
"combination",
"of",
"all",
"include",
"and",
"exclude",
"statements",
"and",
"returns",
"a",
"set",
"of",
"all",
"the",
"files",
"to",
"be",
"compiled",
"and",
"weaved",
"."
] | 120ee1ce08b93873931035ed98cd70e3ccceeefb | https://github.com/mojohaus/aspectj-maven-plugin/blob/120ee1ce08b93873931035ed98cd70e3ccceeefb/src/main/java/org/codehaus/mojo/aspectj/AjcHelper.java#L136-L159 |
107,051 | mojohaus/aspectj-maven-plugin | src/main/java/org/codehaus/mojo/aspectj/AjcHelper.java | AjcHelper.getBuildFilesForSourceDirs | public static Set<String> getBuildFilesForSourceDirs( List<String> sourceDirs, String[] includes, String[] excludes )
throws MojoExecutionException
{
Set<String> result = new LinkedHashSet<String>();
for ( String sourceDir : sourceDirs )
{
try
{
... | java | public static Set<String> getBuildFilesForSourceDirs( List<String> sourceDirs, String[] includes, String[] excludes )
throws MojoExecutionException
{
Set<String> result = new LinkedHashSet<String>();
for ( String sourceDir : sourceDirs )
{
try
{
... | [
"public",
"static",
"Set",
"<",
"String",
">",
"getBuildFilesForSourceDirs",
"(",
"List",
"<",
"String",
">",
"sourceDirs",
",",
"String",
"[",
"]",
"includes",
",",
"String",
"[",
"]",
"excludes",
")",
"throws",
"MojoExecutionException",
"{",
"Set",
"<",
"S... | Based on a set of sourcedirs, apply include and exclude statements and
returns a set of all the files to be compiled and weaved.
@param sourceDirs
@param includes
@param excludes
@return
@throws MojoExecutionException | [
"Based",
"on",
"a",
"set",
"of",
"sourcedirs",
"apply",
"include",
"and",
"exclude",
"statements",
"and",
"returns",
"a",
"set",
"of",
"all",
"the",
"files",
"to",
"be",
"compiled",
"and",
"weaved",
"."
] | 120ee1ce08b93873931035ed98cd70e3ccceeefb | https://github.com/mojohaus/aspectj-maven-plugin/blob/120ee1ce08b93873931035ed98cd70e3ccceeefb/src/main/java/org/codehaus/mojo/aspectj/AjcHelper.java#L171-L198 |
107,052 | mojohaus/aspectj-maven-plugin | src/main/java/org/codehaus/mojo/aspectj/AjcHelper.java | AjcHelper.getWeaveSourceFiles | public static Set<String> getWeaveSourceFiles( String[] weaveDirs )
throws MojoExecutionException
{
Set<String> result = new HashSet<String>();
for ( int i = 0; i < weaveDirs.length; i++ )
{
String weaveDir = weaveDirs[i];
if ( FileUtils.fileExists( weaveDir ... | java | public static Set<String> getWeaveSourceFiles( String[] weaveDirs )
throws MojoExecutionException
{
Set<String> result = new HashSet<String>();
for ( int i = 0; i < weaveDirs.length; i++ )
{
String weaveDir = weaveDirs[i];
if ( FileUtils.fileExists( weaveDir ... | [
"public",
"static",
"Set",
"<",
"String",
">",
"getWeaveSourceFiles",
"(",
"String",
"[",
"]",
"weaveDirs",
")",
"throws",
"MojoExecutionException",
"{",
"Set",
"<",
"String",
">",
"result",
"=",
"new",
"HashSet",
"<",
"String",
">",
"(",
")",
";",
"for",
... | Based on a set of weavedirs returns a set of all the files to be weaved.
@return
@throws MojoExecutionException | [
"Based",
"on",
"a",
"set",
"of",
"weavedirs",
"returns",
"a",
"set",
"of",
"all",
"the",
"files",
"to",
"be",
"weaved",
"."
] | 120ee1ce08b93873931035ed98cd70e3ccceeefb | https://github.com/mojohaus/aspectj-maven-plugin/blob/120ee1ce08b93873931035ed98cd70e3ccceeefb/src/main/java/org/codehaus/mojo/aspectj/AjcHelper.java#L206-L227 |
107,053 | mojohaus/aspectj-maven-plugin | src/main/java/org/codehaus/mojo/aspectj/AjcHelper.java | AjcHelper.readBuildConfigFile | public static List<String> readBuildConfigFile( String fileName, File outputDir )
throws IOException
{
List<String> arguments = new ArrayList<String>();
File argFile = new File( outputDir, fileName );
if ( FileUtils.fileExists( argFile.getAbsolutePath() ) )
{
File... | java | public static List<String> readBuildConfigFile( String fileName, File outputDir )
throws IOException
{
List<String> arguments = new ArrayList<String>();
File argFile = new File( outputDir, fileName );
if ( FileUtils.fileExists( argFile.getAbsolutePath() ) )
{
File... | [
"public",
"static",
"List",
"<",
"String",
">",
"readBuildConfigFile",
"(",
"String",
"fileName",
",",
"File",
"outputDir",
")",
"throws",
"IOException",
"{",
"List",
"<",
"String",
">",
"arguments",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
"... | Reads a build config file, and returns the List of all compiler arguments.
@param fileName the filename of the argfile
@param outputDir the build output area
@return
@throws IOException | [
"Reads",
"a",
"build",
"config",
"file",
"and",
"returns",
"the",
"List",
"of",
"all",
"compiler",
"arguments",
"."
] | 120ee1ce08b93873931035ed98cd70e3ccceeefb | https://github.com/mojohaus/aspectj-maven-plugin/blob/120ee1ce08b93873931035ed98cd70e3ccceeefb/src/main/java/org/codehaus/mojo/aspectj/AjcHelper.java#L264-L285 |
107,054 | mojohaus/aspectj-maven-plugin | src/main/java/org/codehaus/mojo/aspectj/AjcHelper.java | AjcHelper.getAsCsv | protected static String getAsCsv( String[] strings )
{
String csv = "";
if ( null != strings )
{
for ( int i = 0; i < strings.length; i++ )
{
csv += strings[i];
if ( i < ( strings.length - 1 ) )
{
csv... | java | protected static String getAsCsv( String[] strings )
{
String csv = "";
if ( null != strings )
{
for ( int i = 0; i < strings.length; i++ )
{
csv += strings[i];
if ( i < ( strings.length - 1 ) )
{
csv... | [
"protected",
"static",
"String",
"getAsCsv",
"(",
"String",
"[",
"]",
"strings",
")",
"{",
"String",
"csv",
"=",
"\"\"",
";",
"if",
"(",
"null",
"!=",
"strings",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"strings",
".",
"length",
... | Convert a string array to a comma separated list
@param strings
@return | [
"Convert",
"a",
"string",
"array",
"to",
"a",
"comma",
"separated",
"list"
] | 120ee1ce08b93873931035ed98cd70e3ccceeefb | https://github.com/mojohaus/aspectj-maven-plugin/blob/120ee1ce08b93873931035ed98cd70e3ccceeefb/src/main/java/org/codehaus/mojo/aspectj/AjcHelper.java#L293-L308 |
107,055 | mojohaus/aspectj-maven-plugin | src/main/java/org/codehaus/mojo/aspectj/AjcHelper.java | AjcHelper.resolveIncludeExcludeString | protected static Set<String> resolveIncludeExcludeString( String input, File basedir )
throws MojoExecutionException
{
Set<String> inclExlSet = new LinkedHashSet<String>();
try
{
if ( null == input || input.trim().equals( "" ) )
{
return inclEx... | java | protected static Set<String> resolveIncludeExcludeString( String input, File basedir )
throws MojoExecutionException
{
Set<String> inclExlSet = new LinkedHashSet<String>();
try
{
if ( null == input || input.trim().equals( "" ) )
{
return inclEx... | [
"protected",
"static",
"Set",
"<",
"String",
">",
"resolveIncludeExcludeString",
"(",
"String",
"input",
",",
"File",
"basedir",
")",
"throws",
"MojoExecutionException",
"{",
"Set",
"<",
"String",
">",
"inclExlSet",
"=",
"new",
"LinkedHashSet",
"<",
"String",
">... | Helper method to find all .java or .aj files specified by the
includeString. The includeString is a comma separated list over files, or
directories relative to the specified basedir. Examples of correct
listings
<pre>
src/main/java/
src/main/java
src/main/java/com/project/AClass.java
src/main/java/com/project/AnAspect... | [
"Helper",
"method",
"to",
"find",
"all",
".",
"java",
"or",
".",
"aj",
"files",
"specified",
"by",
"the",
"includeString",
".",
"The",
"includeString",
"is",
"a",
"comma",
"separated",
"list",
"over",
"files",
"or",
"directories",
"relative",
"to",
"the",
... | 120ee1ce08b93873931035ed98cd70e3ccceeefb | https://github.com/mojohaus/aspectj-maven-plugin/blob/120ee1ce08b93873931035ed98cd70e3ccceeefb/src/main/java/org/codehaus/mojo/aspectj/AjcHelper.java#L329-L367 |
107,056 | mojohaus/aspectj-maven-plugin | src/main/java/org/codehaus/mojo/aspectj/AjcReportMojo.java | AjcReportMojo.executeReport | @SuppressWarnings( "unchecked" )
protected void executeReport( Locale locale )
throws MavenReportException
{
getLog().info( "Starting generating ajdoc" );
project.getCompileSourceRoots().add( basedir.getAbsolutePath() + "/" + aspectDirectory );
project.getTestCompileSourceRoots(... | java | @SuppressWarnings( "unchecked" )
protected void executeReport( Locale locale )
throws MavenReportException
{
getLog().info( "Starting generating ajdoc" );
project.getCompileSourceRoots().add( basedir.getAbsolutePath() + "/" + aspectDirectory );
project.getTestCompileSourceRoots(... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"protected",
"void",
"executeReport",
"(",
"Locale",
"locale",
")",
"throws",
"MavenReportException",
"{",
"getLog",
"(",
")",
".",
"info",
"(",
"\"Starting generating ajdoc\"",
")",
";",
"project",
".",
"getComp... | Executes this ajdoc-report generation. | [
"Executes",
"this",
"ajdoc",
"-",
"report",
"generation",
"."
] | 120ee1ce08b93873931035ed98cd70e3ccceeefb | https://github.com/mojohaus/aspectj-maven-plugin/blob/120ee1ce08b93873931035ed98cd70e3ccceeefb/src/main/java/org/codehaus/mojo/aspectj/AjcReportMojo.java#L212-L281 |
107,057 | mojohaus/aspectj-maven-plugin | src/main/java/org/codehaus/mojo/aspectj/AjcReportMojo.java | AjcReportMojo.getSourceDirectories | @SuppressWarnings( "unchecked" )
protected List<String> getSourceDirectories()
{
List<String> sourceDirectories = new ArrayList<String>();
sourceDirectories.addAll( project.getCompileSourceRoots() );
sourceDirectories.addAll( project.getTestCompileSourceRoots() );
return sourceDi... | java | @SuppressWarnings( "unchecked" )
protected List<String> getSourceDirectories()
{
List<String> sourceDirectories = new ArrayList<String>();
sourceDirectories.addAll( project.getCompileSourceRoots() );
sourceDirectories.addAll( project.getTestCompileSourceRoots() );
return sourceDi... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"protected",
"List",
"<",
"String",
">",
"getSourceDirectories",
"(",
")",
"{",
"List",
"<",
"String",
">",
"sourceDirectories",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"sourceDirectories"... | Get the directories containg sources | [
"Get",
"the",
"directories",
"containg",
"sources"
] | 120ee1ce08b93873931035ed98cd70e3ccceeefb | https://github.com/mojohaus/aspectj-maven-plugin/blob/120ee1ce08b93873931035ed98cd70e3ccceeefb/src/main/java/org/codehaus/mojo/aspectj/AjcReportMojo.java#L286-L293 |
107,058 | mojohaus/aspectj-maven-plugin | src/main/java/org/codehaus/mojo/aspectj/AjcReportMojo.java | AjcReportMojo.getClasspathDirectories | protected List<String> getClasspathDirectories()
{
return Arrays.asList( project.getBuild().getOutputDirectory(),
project.getBuild().getTestOutputDirectory() );
} | java | protected List<String> getClasspathDirectories()
{
return Arrays.asList( project.getBuild().getOutputDirectory(),
project.getBuild().getTestOutputDirectory() );
} | [
"protected",
"List",
"<",
"String",
">",
"getClasspathDirectories",
"(",
")",
"{",
"return",
"Arrays",
".",
"asList",
"(",
"project",
".",
"getBuild",
"(",
")",
".",
"getOutputDirectory",
"(",
")",
",",
"project",
".",
"getBuild",
"(",
")",
".",
"getTestOu... | get compileroutput directory. | [
"get",
"compileroutput",
"directory",
"."
] | 120ee1ce08b93873931035ed98cd70e3ccceeefb | https://github.com/mojohaus/aspectj-maven-plugin/blob/120ee1ce08b93873931035ed98cd70e3ccceeefb/src/main/java/org/codehaus/mojo/aspectj/AjcReportMojo.java#L306-L310 |
107,059 | mojohaus/aspectj-maven-plugin | src/main/java/org/codehaus/mojo/aspectj/AjcReportMojo.java | AjcReportMojo.setComplianceLevel | public void setComplianceLevel( String complianceLevel )
{
if ( AjcHelper.isValidComplianceLevel( complianceLevel ) )
{
ajcOptions.add( "-source" );
ajcOptions.add( complianceLevel );
}
} | java | public void setComplianceLevel( String complianceLevel )
{
if ( AjcHelper.isValidComplianceLevel( complianceLevel ) )
{
ajcOptions.add( "-source" );
ajcOptions.add( complianceLevel );
}
} | [
"public",
"void",
"setComplianceLevel",
"(",
"String",
"complianceLevel",
")",
"{",
"if",
"(",
"AjcHelper",
".",
"isValidComplianceLevel",
"(",
"complianceLevel",
")",
")",
"{",
"ajcOptions",
".",
"add",
"(",
"\"-source\"",
")",
";",
"ajcOptions",
".",
"add",
... | Setters which when called sets compiler arguments | [
"Setters",
"which",
"when",
"called",
"sets",
"compiler",
"arguments"
] | 120ee1ce08b93873931035ed98cd70e3ccceeefb | https://github.com/mojohaus/aspectj-maven-plugin/blob/120ee1ce08b93873931035ed98cd70e3ccceeefb/src/main/java/org/codehaus/mojo/aspectj/AjcReportMojo.java#L425-L432 |
107,060 | mojohaus/aspectj-maven-plugin | src/main/java/org/codehaus/mojo/aspectj/AbstractAjcCompiler.java | AbstractAjcCompiler.assembleArguments | protected void assembleArguments()
throws MojoExecutionException {
if (XhasMember) {
ajcOptions.add("-XhasMember");
}
// Add classpath
ajcOptions.add("-classpath");
ajcOptions.add(AjcHelper.createClassPath(project, null, getClasspathDirectories()));
... | java | protected void assembleArguments()
throws MojoExecutionException {
if (XhasMember) {
ajcOptions.add("-XhasMember");
}
// Add classpath
ajcOptions.add("-classpath");
ajcOptions.add(AjcHelper.createClassPath(project, null, getClasspathDirectories()));
... | [
"protected",
"void",
"assembleArguments",
"(",
")",
"throws",
"MojoExecutionException",
"{",
"if",
"(",
"XhasMember",
")",
"{",
"ajcOptions",
".",
"add",
"(",
"\"-XhasMember\"",
")",
";",
"}",
"// Add classpath",
"ajcOptions",
".",
"add",
"(",
"\"-classpath\"",
... | Assembles a complete ajc compiler arguments list.
@throws MojoExecutionException error in configuration | [
"Assembles",
"a",
"complete",
"ajc",
"compiler",
"arguments",
"list",
"."
] | 120ee1ce08b93873931035ed98cd70e3ccceeefb | https://github.com/mojohaus/aspectj-maven-plugin/blob/120ee1ce08b93873931035ed98cd70e3ccceeefb/src/main/java/org/codehaus/mojo/aspectj/AbstractAjcCompiler.java#L565-L637 |
107,061 | mojohaus/aspectj-maven-plugin | src/main/java/org/codehaus/mojo/aspectj/AbstractAjcCompiler.java | AbstractAjcCompiler.addModulesArgument | private void addModulesArgument(final String argument, final List<String> arguments, final Module[] modules,
final String aditionalpath, final String role)
throws MojoExecutionException {
StringBuilder buf = new StringBuilder();
if (null != aditionalpath)... | java | private void addModulesArgument(final String argument, final List<String> arguments, final Module[] modules,
final String aditionalpath, final String role)
throws MojoExecutionException {
StringBuilder buf = new StringBuilder();
if (null != aditionalpath)... | [
"private",
"void",
"addModulesArgument",
"(",
"final",
"String",
"argument",
",",
"final",
"List",
"<",
"String",
">",
"arguments",
",",
"final",
"Module",
"[",
"]",
"modules",
",",
"final",
"String",
"aditionalpath",
",",
"final",
"String",
"role",
")",
"th... | Finds all artifacts in the weavemodule property, and adds them to the ajc options.
@param argument
@param arguments
@param modules
@param aditionalpath
@param role
@throws MojoExecutionException | [
"Finds",
"all",
"artifacts",
"in",
"the",
"weavemodule",
"property",
"and",
"adds",
"them",
"to",
"the",
"ajc",
"options",
"."
] | 120ee1ce08b93873931035ed98cd70e3ccceeefb | https://github.com/mojohaus/aspectj-maven-plugin/blob/120ee1ce08b93873931035ed98cd70e3ccceeefb/src/main/java/org/codehaus/mojo/aspectj/AbstractAjcCompiler.java#L671-L716 |
107,062 | mojohaus/aspectj-maven-plugin | src/main/java/org/codehaus/mojo/aspectj/AbstractAjcCompiler.java | AbstractAjcCompiler.isBuildNeeded | protected boolean isBuildNeeded()
throws MojoExecutionException {
File outDir = getOutputDirectory();
return hasNoPreviousBuild(outDir) || hasArgumentsChanged(outDir) ||
hasSourcesChanged(outDir) || hasNonWeavedClassesChanged(outDir);
} | java | protected boolean isBuildNeeded()
throws MojoExecutionException {
File outDir = getOutputDirectory();
return hasNoPreviousBuild(outDir) || hasArgumentsChanged(outDir) ||
hasSourcesChanged(outDir) || hasNonWeavedClassesChanged(outDir);
} | [
"protected",
"boolean",
"isBuildNeeded",
"(",
")",
"throws",
"MojoExecutionException",
"{",
"File",
"outDir",
"=",
"getOutputDirectory",
"(",
")",
";",
"return",
"hasNoPreviousBuild",
"(",
"outDir",
")",
"||",
"hasArgumentsChanged",
"(",
"outDir",
")",
"||",
"hasS... | Checks modifications that would make us need a build
@return <code>true</code> if build is needed, otherwise <code>false</code>
@throws MojoExecutionException | [
"Checks",
"modifications",
"that",
"would",
"make",
"us",
"need",
"a",
"build"
] | 120ee1ce08b93873931035ed98cd70e3ccceeefb | https://github.com/mojohaus/aspectj-maven-plugin/blob/120ee1ce08b93873931035ed98cd70e3ccceeefb/src/main/java/org/codehaus/mojo/aspectj/AbstractAjcCompiler.java#L724-L730 |
107,063 | GoogleCloudPlatform/appengine-mapreduce | java/src/main/java/com/google/appengine/tools/mapreduce/inputs/LogInputReader.java | LogInputReader.next | @Override
public RequestLogs next() throws NoSuchElementException {
Preconditions.checkNotNull(logIterator, "Reader was not initialized via beginSlice()");
if (logIterator.hasNext()) {
lastLog = logIterator.next();
return lastLog;
} else {
log.fine("Shard completed: " + shardLogQuery.get... | java | @Override
public RequestLogs next() throws NoSuchElementException {
Preconditions.checkNotNull(logIterator, "Reader was not initialized via beginSlice()");
if (logIterator.hasNext()) {
lastLog = logIterator.next();
return lastLog;
} else {
log.fine("Shard completed: " + shardLogQuery.get... | [
"@",
"Override",
"public",
"RequestLogs",
"next",
"(",
")",
"throws",
"NoSuchElementException",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"logIterator",
",",
"\"Reader was not initialized via beginSlice()\"",
")",
";",
"if",
"(",
"logIterator",
".",
"hasNext",
"... | Retrieve the next RequestLog | [
"Retrieve",
"the",
"next",
"RequestLog"
] | 2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6 | https://github.com/GoogleCloudPlatform/appengine-mapreduce/blob/2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6/java/src/main/java/com/google/appengine/tools/mapreduce/inputs/LogInputReader.java#L76-L87 |
107,064 | GoogleCloudPlatform/appengine-mapreduce | java/src/main/java/com/google/appengine/tools/mapreduce/inputs/LogInputReader.java | LogInputReader.getProgress | @Override
public Double getProgress() {
if ((shardLogQuery.getStartTimeUsec() == null) || (shardLogQuery.getEndTimeUsec() == null)) {
return null;
} else if (lastLog == null) {
return 0.0;
} else {
long processedTimeUsec = shardLogQuery.getEndTimeUsec() - lastLog.getEndTimeUsec();
... | java | @Override
public Double getProgress() {
if ((shardLogQuery.getStartTimeUsec() == null) || (shardLogQuery.getEndTimeUsec() == null)) {
return null;
} else if (lastLog == null) {
return 0.0;
} else {
long processedTimeUsec = shardLogQuery.getEndTimeUsec() - lastLog.getEndTimeUsec();
... | [
"@",
"Override",
"public",
"Double",
"getProgress",
"(",
")",
"{",
"if",
"(",
"(",
"shardLogQuery",
".",
"getStartTimeUsec",
"(",
")",
"==",
"null",
")",
"||",
"(",
"shardLogQuery",
".",
"getEndTimeUsec",
"(",
")",
"==",
"null",
")",
")",
"{",
"return",
... | Determine the approximate progress for this shard assuming the RequestLogs are uniformly
distributed across the entire time range. | [
"Determine",
"the",
"approximate",
"progress",
"for",
"this",
"shard",
"assuming",
"the",
"RequestLogs",
"are",
"uniformly",
"distributed",
"across",
"the",
"entire",
"time",
"range",
"."
] | 2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6 | https://github.com/GoogleCloudPlatform/appengine-mapreduce/blob/2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6/java/src/main/java/com/google/appengine/tools/mapreduce/inputs/LogInputReader.java#L93-L104 |
107,065 | GoogleCloudPlatform/appengine-mapreduce | java/src/main/java/com/google/appengine/tools/mapreduce/servlets/ShufflerServlet.java | ShufflerServlet.enqueueCallbackTask | private static void enqueueCallbackTask(final ShufflerParams shufflerParams, final String url,
final String taskName) {
RetryHelper.runWithRetries(callable(new Runnable() {
@Override
public void run() {
String hostname = ModulesServiceFactory.getModulesService().getVersionHostname(
... | java | private static void enqueueCallbackTask(final ShufflerParams shufflerParams, final String url,
final String taskName) {
RetryHelper.runWithRetries(callable(new Runnable() {
@Override
public void run() {
String hostname = ModulesServiceFactory.getModulesService().getVersionHostname(
... | [
"private",
"static",
"void",
"enqueueCallbackTask",
"(",
"final",
"ShufflerParams",
"shufflerParams",
",",
"final",
"String",
"url",
",",
"final",
"String",
"taskName",
")",
"{",
"RetryHelper",
".",
"runWithRetries",
"(",
"callable",
"(",
"new",
"Runnable",
"(",
... | Notifies the caller that the job has completed. | [
"Notifies",
"the",
"caller",
"that",
"the",
"job",
"has",
"completed",
"."
] | 2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6 | https://github.com/GoogleCloudPlatform/appengine-mapreduce/blob/2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6/java/src/main/java/com/google/appengine/tools/mapreduce/servlets/ShufflerServlet.java#L222-L239 |
107,066 | GoogleCloudPlatform/appengine-mapreduce | java/src/main/java/com/google/appengine/tools/mapreduce/outputs/GoogleCloudStorageFileOutput.java | GoogleCloudStorageFileOutput.finish | @Override
public GoogleCloudStorageFileSet finish(Collection<? extends OutputWriter<ByteBuffer>> writers) {
List<String> out = Lists.newArrayList();
for (OutputWriter<ByteBuffer> w : writers) {
GoogleCloudStorageFileOutputWriter writer = (GoogleCloudStorageFileOutputWriter) w;
out.add(writer.getFi... | java | @Override
public GoogleCloudStorageFileSet finish(Collection<? extends OutputWriter<ByteBuffer>> writers) {
List<String> out = Lists.newArrayList();
for (OutputWriter<ByteBuffer> w : writers) {
GoogleCloudStorageFileOutputWriter writer = (GoogleCloudStorageFileOutputWriter) w;
out.add(writer.getFi... | [
"@",
"Override",
"public",
"GoogleCloudStorageFileSet",
"finish",
"(",
"Collection",
"<",
"?",
"extends",
"OutputWriter",
"<",
"ByteBuffer",
">",
">",
"writers",
")",
"{",
"List",
"<",
"String",
">",
"out",
"=",
"Lists",
".",
"newArrayList",
"(",
")",
";",
... | Returns a list of GcsFilename that has one element for each reduce shard. | [
"Returns",
"a",
"list",
"of",
"GcsFilename",
"that",
"has",
"one",
"element",
"for",
"each",
"reduce",
"shard",
"."
] | 2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6 | https://github.com/GoogleCloudPlatform/appengine-mapreduce/blob/2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6/java/src/main/java/com/google/appengine/tools/mapreduce/outputs/GoogleCloudStorageFileOutput.java#L74-L82 |
107,067 | GoogleCloudPlatform/appengine-mapreduce | java/src/main/java/com/google/appengine/tools/mapreduce/outputs/SliceSegmentingOutputWriter.java | SliceSegmentingOutputWriter.beginSlice | @Override
public void beginSlice() throws IOException {
writer = createWriter(sliceCount++);
writer.setContext(getContext());
writer.beginShard();
writer.beginSlice();
} | java | @Override
public void beginSlice() throws IOException {
writer = createWriter(sliceCount++);
writer.setContext(getContext());
writer.beginShard();
writer.beginSlice();
} | [
"@",
"Override",
"public",
"void",
"beginSlice",
"(",
")",
"throws",
"IOException",
"{",
"writer",
"=",
"createWriter",
"(",
"sliceCount",
"++",
")",
";",
"writer",
".",
"setContext",
"(",
"getContext",
"(",
")",
")",
";",
"writer",
".",
"beginShard",
"(",... | Creates a new writer. | [
"Creates",
"a",
"new",
"writer",
"."
] | 2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6 | https://github.com/GoogleCloudPlatform/appengine-mapreduce/blob/2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6/java/src/main/java/com/google/appengine/tools/mapreduce/outputs/SliceSegmentingOutputWriter.java#L30-L36 |
107,068 | GoogleCloudPlatform/appengine-mapreduce | java/src/main/java/com/google/appengine/tools/mapreduce/MapOnlyMapper.java | MapOnlyMapper.forMapper | public static <I, Void, V> MapOnlyMapper<I, V> forMapper(Mapper<I, Void, V> mapper) {
return new MapperAdapter<>(mapper);
} | java | public static <I, Void, V> MapOnlyMapper<I, V> forMapper(Mapper<I, Void, V> mapper) {
return new MapperAdapter<>(mapper);
} | [
"public",
"static",
"<",
"I",
",",
"Void",
",",
"V",
">",
"MapOnlyMapper",
"<",
"I",
",",
"V",
">",
"forMapper",
"(",
"Mapper",
"<",
"I",
",",
"Void",
",",
"V",
">",
"mapper",
")",
"{",
"return",
"new",
"MapperAdapter",
"<>",
"(",
"mapper",
")",
... | Returns a MapOnlyMapper for a given Mapper passing only the values to the output. | [
"Returns",
"a",
"MapOnlyMapper",
"for",
"a",
"given",
"Mapper",
"passing",
"only",
"the",
"values",
"to",
"the",
"output",
"."
] | 2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6 | https://github.com/GoogleCloudPlatform/appengine-mapreduce/blob/2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6/java/src/main/java/com/google/appengine/tools/mapreduce/MapOnlyMapper.java#L22-L24 |
107,069 | GoogleCloudPlatform/appengine-mapreduce | java/src/main/java/com/google/appengine/tools/mapreduce/impl/shardedjob/ShardedJobRunner.java | ShardedJobRunner.handleLockHeld | private void handleLockHeld(String taskId, ShardedJobStateImpl<T> jobState,
IncrementalTaskState<T> taskState) {
long currentTime = System.currentTimeMillis();
int sliceTimeoutMillis = jobState.getSettings().getSliceTimeoutMillis();
long lockExpiration = taskState.getLockInfo().lockedSince() + sliceTi... | java | private void handleLockHeld(String taskId, ShardedJobStateImpl<T> jobState,
IncrementalTaskState<T> taskState) {
long currentTime = System.currentTimeMillis();
int sliceTimeoutMillis = jobState.getSettings().getSliceTimeoutMillis();
long lockExpiration = taskState.getLockInfo().lockedSince() + sliceTi... | [
"private",
"void",
"handleLockHeld",
"(",
"String",
"taskId",
",",
"ShardedJobStateImpl",
"<",
"T",
">",
"jobState",
",",
"IncrementalTaskState",
"<",
"T",
">",
"taskState",
")",
"{",
"long",
"currentTime",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
";... | Handle a locked slice case. | [
"Handle",
"a",
"locked",
"slice",
"case",
"."
] | 2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6 | https://github.com/GoogleCloudPlatform/appengine-mapreduce/blob/2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6/java/src/main/java/com/google/appengine/tools/mapreduce/impl/shardedjob/ShardedJobRunner.java#L301-L325 |
107,070 | GoogleCloudPlatform/appengine-mapreduce | java/src/main/java/com/google/appengine/tools/mapreduce/impl/BigQueryMarshallerByType.java | BigQueryMarshallerByType.toBytes | @Override
public ByteBuffer toBytes(T object) {
if (!type.equals(object.getClass())) {
throw new RuntimeException(
"The type of the object does not match the parameter type of this marshaller. ");
}
Map<String, Object> jsonObject = dataMarshaller.mapFieldNameToValue(object);
ByteArrayO... | java | @Override
public ByteBuffer toBytes(T object) {
if (!type.equals(object.getClass())) {
throw new RuntimeException(
"The type of the object does not match the parameter type of this marshaller. ");
}
Map<String, Object> jsonObject = dataMarshaller.mapFieldNameToValue(object);
ByteArrayO... | [
"@",
"Override",
"public",
"ByteBuffer",
"toBytes",
"(",
"T",
"object",
")",
"{",
"if",
"(",
"!",
"type",
".",
"equals",
"(",
"object",
".",
"getClass",
"(",
")",
")",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"\"The type of the object does not matc... | Validates that the type of the object to serialize is the same as the type for which schema was
generated. The type should match exactly as interface and abstract classes are not supported. | [
"Validates",
"that",
"the",
"type",
"of",
"the",
"object",
"to",
"serialize",
"is",
"the",
"same",
"as",
"the",
"type",
"for",
"which",
"schema",
"was",
"generated",
".",
"The",
"type",
"should",
"match",
"exactly",
"as",
"interface",
"and",
"abstract",
"c... | 2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6 | https://github.com/GoogleCloudPlatform/appengine-mapreduce/blob/2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6/java/src/main/java/com/google/appengine/tools/mapreduce/impl/BigQueryMarshallerByType.java#L55-L70 |
107,071 | GoogleCloudPlatform/appengine-mapreduce | java/src/main/java/com/google/appengine/tools/mapreduce/impl/handlers/StatusHandler.java | StatusHandler.handleCommand | static void handleCommand(
String command, HttpServletRequest request, HttpServletResponse response) {
response.setContentType("application/json");
boolean isPost = "POST".equals(request.getMethod());
JSONObject retValue = null;
try {
if (command.equals(LIST_JOBS_PATH) && !isPost) {
... | java | static void handleCommand(
String command, HttpServletRequest request, HttpServletResponse response) {
response.setContentType("application/json");
boolean isPost = "POST".equals(request.getMethod());
JSONObject retValue = null;
try {
if (command.equals(LIST_JOBS_PATH) && !isPost) {
... | [
"static",
"void",
"handleCommand",
"(",
"String",
"command",
",",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
")",
"{",
"response",
".",
"setContentType",
"(",
"\"application/json\"",
")",
";",
"boolean",
"isPost",
"=",
"\"POST\"",
".",
... | Handles all status page commands. | [
"Handles",
"all",
"status",
"page",
"commands",
"."
] | 2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6 | https://github.com/GoogleCloudPlatform/appengine-mapreduce/blob/2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6/java/src/main/java/com/google/appengine/tools/mapreduce/impl/handlers/StatusHandler.java#L79-L116 |
107,072 | GoogleCloudPlatform/appengine-mapreduce | java/src/main/java/com/google/appengine/tools/mapreduce/inputs/DatastoreShardStrategy.java | DatastoreShardStrategy.getScatterSplitPoints | private List<Range> getScatterSplitPoints(String namespace, String kind, final int numSegments) {
Query query = createQuery(namespace, kind).addSort(SCATTER_RESERVED_PROPERTY).setKeysOnly();
List<Key> splitPoints = sortKeys(runQuery(query, numSegments - 1));
List<Range> result = new ArrayList<>(splitPoints.... | java | private List<Range> getScatterSplitPoints(String namespace, String kind, final int numSegments) {
Query query = createQuery(namespace, kind).addSort(SCATTER_RESERVED_PROPERTY).setKeysOnly();
List<Key> splitPoints = sortKeys(runQuery(query, numSegments - 1));
List<Range> result = new ArrayList<>(splitPoints.... | [
"private",
"List",
"<",
"Range",
">",
"getScatterSplitPoints",
"(",
"String",
"namespace",
",",
"String",
"kind",
",",
"final",
"int",
"numSegments",
")",
"{",
"Query",
"query",
"=",
"createQuery",
"(",
"namespace",
",",
"kind",
")",
".",
"addSort",
"(",
"... | Uses the scatter property to distribute ranges to segments.
A random scatter property is added to 1 out of every 512 entities see:
https://github.com/GoogleCloudPlatform/appengine-mapreduce/wiki/ScatterPropertyImplementation
Retrieving the entities with the highest scatter values provides a random sample of entities.... | [
"Uses",
"the",
"scatter",
"property",
"to",
"distribute",
"ranges",
"to",
"segments",
"."
] | 2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6 | https://github.com/GoogleCloudPlatform/appengine-mapreduce/blob/2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6/java/src/main/java/com/google/appengine/tools/mapreduce/inputs/DatastoreShardStrategy.java#L258-L270 |
107,073 | GoogleCloudPlatform/appengine-mapreduce | java/src/main/java/com/google/appengine/tools/mapreduce/impl/handlers/MapReduceServletImpl.java | MapReduceServletImpl.doGet | public static void doGet(HttpServletRequest request, HttpServletResponse response)
throws IOException {
String handler = getHandler(request);
if (handler.startsWith(COMMAND_PATH)) {
if (!checkForAjax(request, response)) {
return;
}
StatusHandler.handleCommand(handler.substring(CO... | java | public static void doGet(HttpServletRequest request, HttpServletResponse response)
throws IOException {
String handler = getHandler(request);
if (handler.startsWith(COMMAND_PATH)) {
if (!checkForAjax(request, response)) {
return;
}
StatusHandler.handleCommand(handler.substring(CO... | [
"public",
"static",
"void",
"doGet",
"(",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
")",
"throws",
"IOException",
"{",
"String",
"handler",
"=",
"getHandler",
"(",
"request",
")",
";",
"if",
"(",
"handler",
".",
"startsWith",
"(",
... | Handle GET http requests. | [
"Handle",
"GET",
"http",
"requests",
"."
] | 2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6 | https://github.com/GoogleCloudPlatform/appengine-mapreduce/blob/2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6/java/src/main/java/com/google/appengine/tools/mapreduce/impl/handlers/MapReduceServletImpl.java#L79-L90 |
107,074 | GoogleCloudPlatform/appengine-mapreduce | java/src/main/java/com/google/appengine/tools/mapreduce/impl/handlers/MapReduceServletImpl.java | MapReduceServletImpl.doPost | public static void doPost(HttpServletRequest request, HttpServletResponse response)
throws IOException {
String handler = getHandler(request);
if (handler.startsWith(CONTROLLER_PATH)) {
if (!checkForTaskQueue(request, response)) {
return;
}
new ShardedJobRunner<>().completeShard(... | java | public static void doPost(HttpServletRequest request, HttpServletResponse response)
throws IOException {
String handler = getHandler(request);
if (handler.startsWith(CONTROLLER_PATH)) {
if (!checkForTaskQueue(request, response)) {
return;
}
new ShardedJobRunner<>().completeShard(... | [
"public",
"static",
"void",
"doPost",
"(",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
")",
"throws",
"IOException",
"{",
"String",
"handler",
"=",
"getHandler",
"(",
"request",
")",
";",
"if",
"(",
"handler",
".",
"startsWith",
"(",... | Handle POST http requests. | [
"Handle",
"POST",
"http",
"requests",
"."
] | 2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6 | https://github.com/GoogleCloudPlatform/appengine-mapreduce/blob/2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6/java/src/main/java/com/google/appengine/tools/mapreduce/impl/handlers/MapReduceServletImpl.java#L95-L122 |
107,075 | GoogleCloudPlatform/appengine-mapreduce | java/src/main/java/com/google/appengine/tools/mapreduce/impl/handlers/MapReduceServletImpl.java | MapReduceServletImpl.checkForAjax | private static boolean checkForAjax(HttpServletRequest request, HttpServletResponse response)
throws IOException {
if (!"XMLHttpRequest".equals(request.getHeader("X-Requested-With"))) {
log.log(
Level.SEVERE, "Received unexpected non-XMLHttpRequest command. Possible CSRF attack.");
respo... | java | private static boolean checkForAjax(HttpServletRequest request, HttpServletResponse response)
throws IOException {
if (!"XMLHttpRequest".equals(request.getHeader("X-Requested-With"))) {
log.log(
Level.SEVERE, "Received unexpected non-XMLHttpRequest command. Possible CSRF attack.");
respo... | [
"private",
"static",
"boolean",
"checkForAjax",
"(",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"\"XMLHttpRequest\"",
".",
"equals",
"(",
"request",
".",
"getHeader",
"(",
"\"X-Requeste... | Checks to ensure that the current request was sent via an AJAX request.
If the request was not sent by an AJAX request, returns false, and sets
the response status code to 403. This protects against CSRF attacks against
AJAX only handlers.
@return true if the request is a task queue request | [
"Checks",
"to",
"ensure",
"that",
"the",
"current",
"request",
"was",
"sent",
"via",
"an",
"AJAX",
"request",
"."
] | 2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6 | https://github.com/GoogleCloudPlatform/appengine-mapreduce/blob/2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6/java/src/main/java/com/google/appengine/tools/mapreduce/impl/handlers/MapReduceServletImpl.java#L133-L143 |
107,076 | GoogleCloudPlatform/appengine-mapreduce | java/src/main/java/com/google/appengine/tools/mapreduce/impl/handlers/MapReduceServletImpl.java | MapReduceServletImpl.checkForTaskQueue | private static boolean checkForTaskQueue(HttpServletRequest request,
HttpServletResponse response) throws IOException {
if (request.getHeader("X-AppEngine-QueueName") == null) {
log.log(Level.SEVERE, "Received unexpected non-task queue request. Possible CSRF attack.");
response.sendError(
... | java | private static boolean checkForTaskQueue(HttpServletRequest request,
HttpServletResponse response) throws IOException {
if (request.getHeader("X-AppEngine-QueueName") == null) {
log.log(Level.SEVERE, "Received unexpected non-task queue request. Possible CSRF attack.");
response.sendError(
... | [
"private",
"static",
"boolean",
"checkForTaskQueue",
"(",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
")",
"throws",
"IOException",
"{",
"if",
"(",
"request",
".",
"getHeader",
"(",
"\"X-AppEngine-QueueName\"",
")",
"==",
"null",
")",
"{... | Checks to ensure that the current request was sent via the task queue.
If the request is not in the task queue, returns false, and sets the
response status code to 403. This protects against CSRF attacks against
task queue-only handlers.
@return true if the request is a task queue request | [
"Checks",
"to",
"ensure",
"that",
"the",
"current",
"request",
"was",
"sent",
"via",
"the",
"task",
"queue",
"."
] | 2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6 | https://github.com/GoogleCloudPlatform/appengine-mapreduce/blob/2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6/java/src/main/java/com/google/appengine/tools/mapreduce/impl/handlers/MapReduceServletImpl.java#L154-L163 |
107,077 | GoogleCloudPlatform/appengine-mapreduce | java/src/main/java/com/google/appengine/tools/mapreduce/impl/handlers/MapReduceServletImpl.java | MapReduceServletImpl.getHandler | private static String getHandler(HttpServletRequest request) {
String pathInfo = request.getPathInfo();
return pathInfo == null ? "" : pathInfo.substring(1);
} | java | private static String getHandler(HttpServletRequest request) {
String pathInfo = request.getPathInfo();
return pathInfo == null ? "" : pathInfo.substring(1);
} | [
"private",
"static",
"String",
"getHandler",
"(",
"HttpServletRequest",
"request",
")",
"{",
"String",
"pathInfo",
"=",
"request",
".",
"getPathInfo",
"(",
")",
";",
"return",
"pathInfo",
"==",
"null",
"?",
"\"\"",
":",
"pathInfo",
".",
"substring",
"(",
"1"... | Returns the handler portion of the URL path.
For examples (for a servlet mapped as /foo/*):
getHandler(https://www.google.com/foo/bar) -> bar
getHandler(https://www.google.com/foo/bar/id) -> bar/id | [
"Returns",
"the",
"handler",
"portion",
"of",
"the",
"URL",
"path",
"."
] | 2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6 | https://github.com/GoogleCloudPlatform/appengine-mapreduce/blob/2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6/java/src/main/java/com/google/appengine/tools/mapreduce/impl/handlers/MapReduceServletImpl.java#L172-L175 |
107,078 | GoogleCloudPlatform/appengine-mapreduce | java/src/main/java/com/google/appengine/tools/mapreduce/impl/handlers/MemoryLimiter.java | MemoryLimiter.claim | public long claim(long toClaimMb) throws RejectRequestException {
Preconditions.checkArgument(toClaimMb >= 0);
if (toClaimMb == 0) {
return 0;
}
int neededForRequest = capRequestedSize(toClaimMb);
boolean acquired = false;
try {
acquired = amountRemaining.tryAcquire(neededForRequest,... | java | public long claim(long toClaimMb) throws RejectRequestException {
Preconditions.checkArgument(toClaimMb >= 0);
if (toClaimMb == 0) {
return 0;
}
int neededForRequest = capRequestedSize(toClaimMb);
boolean acquired = false;
try {
acquired = amountRemaining.tryAcquire(neededForRequest,... | [
"public",
"long",
"claim",
"(",
"long",
"toClaimMb",
")",
"throws",
"RejectRequestException",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"toClaimMb",
">=",
"0",
")",
";",
"if",
"(",
"toClaimMb",
"==",
"0",
")",
"{",
"return",
"0",
";",
"}",
"int",
... | This method attempts to claim ram to the provided request. This may block waiting for some to
be available. Ultimately it is either granted memory or an exception is thrown.
@param toClaimMb The amount of memory the request wishes to claim. (In Megabytes)
@return The amount of memory which was claimed. (This may be di... | [
"This",
"method",
"attempts",
"to",
"claim",
"ram",
"to",
"the",
"provided",
"request",
".",
"This",
"may",
"block",
"waiting",
"for",
"some",
"to",
"be",
"available",
".",
"Ultimately",
"it",
"is",
"either",
"granted",
"memory",
"or",
"an",
"exception",
"... | 2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6 | https://github.com/GoogleCloudPlatform/appengine-mapreduce/blob/2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6/java/src/main/java/com/google/appengine/tools/mapreduce/impl/handlers/MemoryLimiter.java#L44-L67 |
107,079 | GoogleCloudPlatform/appengine-mapreduce | java/src/main/java/com/google/appengine/tools/mapreduce/impl/shardedjob/IncrementalTaskState.java | IncrementalTaskState.create | static <T extends IncrementalTask> IncrementalTaskState<T> create(
String taskId, String jobId, long createTime, T initialTask) {
return new IncrementalTaskState<>(taskId, jobId, createTime, new LockInfo(null, null),
checkNotNull(initialTask), new Status(StatusCode.RUNNING));
} | java | static <T extends IncrementalTask> IncrementalTaskState<T> create(
String taskId, String jobId, long createTime, T initialTask) {
return new IncrementalTaskState<>(taskId, jobId, createTime, new LockInfo(null, null),
checkNotNull(initialTask), new Status(StatusCode.RUNNING));
} | [
"static",
"<",
"T",
"extends",
"IncrementalTask",
">",
"IncrementalTaskState",
"<",
"T",
">",
"create",
"(",
"String",
"taskId",
",",
"String",
"jobId",
",",
"long",
"createTime",
",",
"T",
"initialTask",
")",
"{",
"return",
"new",
"IncrementalTaskState",
"<>"... | Returns a new running IncrementalTaskState. | [
"Returns",
"a",
"new",
"running",
"IncrementalTaskState",
"."
] | 2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6 | https://github.com/GoogleCloudPlatform/appengine-mapreduce/blob/2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6/java/src/main/java/com/google/appengine/tools/mapreduce/impl/shardedjob/IncrementalTaskState.java#L79-L83 |
107,080 | GoogleCloudPlatform/appengine-mapreduce | java/src/main/java/com/google/appengine/tools/mapreduce/DatastoreMutationPool.java | DatastoreMutationPool.delete | public void delete(Key key) {
// This is probably a serious overestimation, but I can't see a good
// way to find the size in the public API.
int bytesHere = KeyFactory.keyToString(key).length();
// Do this before the add so that we guarantee that size is never > sizeLimit
if (deletesBytes + bytesH... | java | public void delete(Key key) {
// This is probably a serious overestimation, but I can't see a good
// way to find the size in the public API.
int bytesHere = KeyFactory.keyToString(key).length();
// Do this before the add so that we guarantee that size is never > sizeLimit
if (deletesBytes + bytesH... | [
"public",
"void",
"delete",
"(",
"Key",
"key",
")",
"{",
"// This is probably a serious overestimation, but I can't see a good",
"// way to find the size in the public API.",
"int",
"bytesHere",
"=",
"KeyFactory",
".",
"keyToString",
"(",
"key",
")",
".",
"length",
"(",
"... | Adds a mutation to put the given entity to the datastore. | [
"Adds",
"a",
"mutation",
"to",
"put",
"the",
"given",
"entity",
"to",
"the",
"datastore",
"."
] | 2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6 | https://github.com/GoogleCloudPlatform/appengine-mapreduce/blob/2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6/java/src/main/java/com/google/appengine/tools/mapreduce/DatastoreMutationPool.java#L151-L167 |
107,081 | GoogleCloudPlatform/appengine-mapreduce | java/src/main/java/com/google/appengine/tools/mapreduce/DatastoreMutationPool.java | DatastoreMutationPool.put | public void put(Entity entity) {
int bytesHere = EntityTranslator.convertToPb(entity).getSerializedSize();
// Do this before the add so that we guarantee that size is never > sizeLimit
if (putsBytes + bytesHere >= params.getBytesLimit()) {
flushPuts();
}
putsBytes += bytesHere;
puts.add(... | java | public void put(Entity entity) {
int bytesHere = EntityTranslator.convertToPb(entity).getSerializedSize();
// Do this before the add so that we guarantee that size is never > sizeLimit
if (putsBytes + bytesHere >= params.getBytesLimit()) {
flushPuts();
}
putsBytes += bytesHere;
puts.add(... | [
"public",
"void",
"put",
"(",
"Entity",
"entity",
")",
"{",
"int",
"bytesHere",
"=",
"EntityTranslator",
".",
"convertToPb",
"(",
"entity",
")",
".",
"getSerializedSize",
"(",
")",
";",
"// Do this before the add so that we guarantee that size is never > sizeLimit",
"if... | Adds a mutation deleting the entity with the given key. | [
"Adds",
"a",
"mutation",
"deleting",
"the",
"entity",
"with",
"the",
"given",
"key",
"."
] | 2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6 | https://github.com/GoogleCloudPlatform/appengine-mapreduce/blob/2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6/java/src/main/java/com/google/appengine/tools/mapreduce/DatastoreMutationPool.java#L172-L186 |
107,082 | GoogleCloudPlatform/appengine-mapreduce | java/src/main/java/com/google/appengine/tools/mapreduce/impl/sort/SortWorker.java | SortWorker.writeOutData | private void writeOutData() {
if (valuesHeld == 0) {
return;
}
int batchSize = batchItemSizePerEmmit == null ? DEFAULT_SORT_BATCH_PER_EMIT_BYTES
: batchItemSizePerEmmit;
ByteBuffer currentKey = getKeyValueFromPointer(0).getKey();
List<ByteBuffer> currentValues = new ArrayList<>();
... | java | private void writeOutData() {
if (valuesHeld == 0) {
return;
}
int batchSize = batchItemSizePerEmmit == null ? DEFAULT_SORT_BATCH_PER_EMIT_BYTES
: batchItemSizePerEmmit;
ByteBuffer currentKey = getKeyValueFromPointer(0).getKey();
List<ByteBuffer> currentValues = new ArrayList<>();
... | [
"private",
"void",
"writeOutData",
"(",
")",
"{",
"if",
"(",
"valuesHeld",
"==",
"0",
")",
"{",
"return",
";",
"}",
"int",
"batchSize",
"=",
"batchItemSizePerEmmit",
"==",
"null",
"?",
"DEFAULT_SORT_BATCH_PER_EMIT_BYTES",
":",
"batchItemSizePerEmmit",
";",
"Byte... | Writes out the key value pairs in order.
If there are multiple consecutive values with the same key, they can be combined to avoid
repeating the key.
In the event the buffer is full, there is one leftover item which did not go into it,
and hence was not sorted. So a merge between this one item and the sorted list is do... | [
"Writes",
"out",
"the",
"key",
"value",
"pairs",
"in",
"order",
".",
"If",
"there",
"are",
"multiple",
"consecutive",
"values",
"with",
"the",
"same",
"key",
"they",
"can",
"be",
"combined",
"to",
"avoid",
"repeating",
"the",
"key",
".",
"In",
"the",
"ev... | 2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6 | https://github.com/GoogleCloudPlatform/appengine-mapreduce/blob/2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6/java/src/main/java/com/google/appengine/tools/mapreduce/impl/sort/SortWorker.java#L149-L183 |
107,083 | GoogleCloudPlatform/appengine-mapreduce | java/src/main/java/com/google/appengine/tools/mapreduce/impl/sort/SortWorker.java | SortWorker.addValue | public void addValue(ByteBuffer key, ByteBuffer value) {
if (isFull) {
throw new IllegalArgumentException("Already full");
}
if (value.remaining() + key.remaining() + POINTER_SIZE_BYTES > memoryBuffer.remaining()) {
leftover = new KeyValue<>(key, value);
isFull = true;
} else {
i... | java | public void addValue(ByteBuffer key, ByteBuffer value) {
if (isFull) {
throw new IllegalArgumentException("Already full");
}
if (value.remaining() + key.remaining() + POINTER_SIZE_BYTES > memoryBuffer.remaining()) {
leftover = new KeyValue<>(key, value);
isFull = true;
} else {
i... | [
"public",
"void",
"addValue",
"(",
"ByteBuffer",
"key",
",",
"ByteBuffer",
"value",
")",
"{",
"if",
"(",
"isFull",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Already full\"",
")",
";",
"}",
"if",
"(",
"value",
".",
"remaining",
"(",
")",... | Add a new key and value to the in memory buffer. | [
"Add",
"a",
"new",
"key",
"and",
"value",
"to",
"the",
"in",
"memory",
"buffer",
"."
] | 2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6 | https://github.com/GoogleCloudPlatform/appengine-mapreduce/blob/2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6/java/src/main/java/com/google/appengine/tools/mapreduce/impl/sort/SortWorker.java#L227-L239 |
107,084 | GoogleCloudPlatform/appengine-mapreduce | java/src/main/java/com/google/appengine/tools/mapreduce/impl/sort/SortWorker.java | SortWorker.getKeyFromPointer | final ByteBuffer getKeyFromPointer(int index) {
int origionalLimit = memoryBuffer.limit();
memoryBuffer.limit(memoryBuffer.capacity());
int pointerOffset = computePointerOffset(index);
int keyPos = memoryBuffer.getInt(pointerOffset);
int valuePos = memoryBuffer.getInt(pointerOffset + 4);
memor... | java | final ByteBuffer getKeyFromPointer(int index) {
int origionalLimit = memoryBuffer.limit();
memoryBuffer.limit(memoryBuffer.capacity());
int pointerOffset = computePointerOffset(index);
int keyPos = memoryBuffer.getInt(pointerOffset);
int valuePos = memoryBuffer.getInt(pointerOffset + 4);
memor... | [
"final",
"ByteBuffer",
"getKeyFromPointer",
"(",
"int",
"index",
")",
"{",
"int",
"origionalLimit",
"=",
"memoryBuffer",
".",
"limit",
"(",
")",
";",
"memoryBuffer",
".",
"limit",
"(",
"memoryBuffer",
".",
"capacity",
"(",
")",
")",
";",
"int",
"pointerOffse... | Get a key given the index of its pointer. | [
"Get",
"a",
"key",
"given",
"the",
"index",
"of",
"its",
"pointer",
"."
] | 2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6 | https://github.com/GoogleCloudPlatform/appengine-mapreduce/blob/2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6/java/src/main/java/com/google/appengine/tools/mapreduce/impl/sort/SortWorker.java#L244-L254 |
107,085 | GoogleCloudPlatform/appengine-mapreduce | java/src/main/java/com/google/appengine/tools/mapreduce/impl/sort/SortWorker.java | SortWorker.getKeyValueFromPointer | final KeyValue<ByteBuffer, ByteBuffer> getKeyValueFromPointer(int index) {
int origionalLimit = memoryBuffer.limit();
memoryBuffer.limit(memoryBuffer.capacity());
int pointerOffset = computePointerOffset(index);
int keyPos = memoryBuffer.getInt(pointerOffset);
int valuePos = memoryBuffer.getInt(po... | java | final KeyValue<ByteBuffer, ByteBuffer> getKeyValueFromPointer(int index) {
int origionalLimit = memoryBuffer.limit();
memoryBuffer.limit(memoryBuffer.capacity());
int pointerOffset = computePointerOffset(index);
int keyPos = memoryBuffer.getInt(pointerOffset);
int valuePos = memoryBuffer.getInt(po... | [
"final",
"KeyValue",
"<",
"ByteBuffer",
",",
"ByteBuffer",
">",
"getKeyValueFromPointer",
"(",
"int",
"index",
")",
"{",
"int",
"origionalLimit",
"=",
"memoryBuffer",
".",
"limit",
"(",
")",
";",
"memoryBuffer",
".",
"limit",
"(",
"memoryBuffer",
".",
"capacit... | Get a key and its value given the index of its pointer. | [
"Get",
"a",
"key",
"and",
"its",
"value",
"given",
"the",
"index",
"of",
"its",
"pointer",
"."
] | 2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6 | https://github.com/GoogleCloudPlatform/appengine-mapreduce/blob/2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6/java/src/main/java/com/google/appengine/tools/mapreduce/impl/sort/SortWorker.java#L259-L271 |
107,086 | GoogleCloudPlatform/appengine-mapreduce | java/src/main/java/com/google/appengine/tools/mapreduce/impl/sort/SortWorker.java | SortWorker.swapPointers | final void swapPointers(int indexA, int indexB) {
assert indexA >= 0 && indexA < valuesHeld;
assert indexB >= 0 && indexB < valuesHeld;
ByteBuffer a = copyPointer(indexA);
ByteBuffer b = readPointer(indexB);
writePointer(indexA, b);
writePointer(indexB, a);
} | java | final void swapPointers(int indexA, int indexB) {
assert indexA >= 0 && indexA < valuesHeld;
assert indexB >= 0 && indexB < valuesHeld;
ByteBuffer a = copyPointer(indexA);
ByteBuffer b = readPointer(indexB);
writePointer(indexA, b);
writePointer(indexB, a);
} | [
"final",
"void",
"swapPointers",
"(",
"int",
"indexA",
",",
"int",
"indexB",
")",
"{",
"assert",
"indexA",
">=",
"0",
"&&",
"indexA",
"<",
"valuesHeld",
";",
"assert",
"indexB",
">=",
"0",
"&&",
"indexB",
"<",
"valuesHeld",
";",
"ByteBuffer",
"a",
"=",
... | Place the pointer at indexA in indexB and vice versa. | [
"Place",
"the",
"pointer",
"at",
"indexA",
"in",
"indexB",
"and",
"vice",
"versa",
"."
] | 2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6 | https://github.com/GoogleCloudPlatform/appengine-mapreduce/blob/2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6/java/src/main/java/com/google/appengine/tools/mapreduce/impl/sort/SortWorker.java#L292-L300 |
107,087 | GoogleCloudPlatform/appengine-mapreduce | java/src/main/java/com/google/appengine/tools/mapreduce/impl/sort/SortWorker.java | SortWorker.readPointer | final ByteBuffer readPointer(int index) {
int pointerOffset = computePointerOffset(index);
return sliceOutRange(pointerOffset, pointerOffset + POINTER_SIZE_BYTES);
} | java | final ByteBuffer readPointer(int index) {
int pointerOffset = computePointerOffset(index);
return sliceOutRange(pointerOffset, pointerOffset + POINTER_SIZE_BYTES);
} | [
"final",
"ByteBuffer",
"readPointer",
"(",
"int",
"index",
")",
"{",
"int",
"pointerOffset",
"=",
"computePointerOffset",
"(",
"index",
")",
";",
"return",
"sliceOutRange",
"(",
"pointerOffset",
",",
"pointerOffset",
"+",
"POINTER_SIZE_BYTES",
")",
";",
"}"
] | Read a pointer from the specified index. | [
"Read",
"a",
"pointer",
"from",
"the",
"specified",
"index",
"."
] | 2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6 | https://github.com/GoogleCloudPlatform/appengine-mapreduce/blob/2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6/java/src/main/java/com/google/appengine/tools/mapreduce/impl/sort/SortWorker.java#L328-L331 |
107,088 | GoogleCloudPlatform/appengine-mapreduce | java/src/main/java/com/google/appengine/tools/mapreduce/impl/sort/SortWorker.java | SortWorker.copyPointer | final ByteBuffer copyPointer(int index) {
ByteBuffer pointer = readPointer(index);
// Making a copy for so that someone can modify the underlying impl
ByteBuffer result = ByteBuffer.allocate(pointer.capacity());
result.put(pointer);
result.flip();
return result;
} | java | final ByteBuffer copyPointer(int index) {
ByteBuffer pointer = readPointer(index);
// Making a copy for so that someone can modify the underlying impl
ByteBuffer result = ByteBuffer.allocate(pointer.capacity());
result.put(pointer);
result.flip();
return result;
} | [
"final",
"ByteBuffer",
"copyPointer",
"(",
"int",
"index",
")",
"{",
"ByteBuffer",
"pointer",
"=",
"readPointer",
"(",
"index",
")",
";",
"// Making a copy for so that someone can modify the underlying impl",
"ByteBuffer",
"result",
"=",
"ByteBuffer",
".",
"allocate",
"... | Get a Copy of a pointer | [
"Get",
"a",
"Copy",
"of",
"a",
"pointer"
] | 2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6 | https://github.com/GoogleCloudPlatform/appengine-mapreduce/blob/2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6/java/src/main/java/com/google/appengine/tools/mapreduce/impl/sort/SortWorker.java#L336-L343 |
107,089 | GoogleCloudPlatform/appengine-mapreduce | java/src/main/java/com/google/appengine/tools/mapreduce/impl/sort/SortWorker.java | SortWorker.addPointer | final void addPointer(int keyPos, int keySize, int valuePos, int valueSize) {
assert keyPos + keySize == valuePos;
int start = memoryBuffer.limit() - POINTER_SIZE_BYTES;
memoryBuffer.putInt(start, keyPos);
memoryBuffer.putInt(start + 4, valuePos);
memoryBuffer.putInt(start + 8, valueSize);
memor... | java | final void addPointer(int keyPos, int keySize, int valuePos, int valueSize) {
assert keyPos + keySize == valuePos;
int start = memoryBuffer.limit() - POINTER_SIZE_BYTES;
memoryBuffer.putInt(start, keyPos);
memoryBuffer.putInt(start + 4, valuePos);
memoryBuffer.putInt(start + 8, valueSize);
memor... | [
"final",
"void",
"addPointer",
"(",
"int",
"keyPos",
",",
"int",
"keySize",
",",
"int",
"valuePos",
",",
"int",
"valueSize",
")",
"{",
"assert",
"keyPos",
"+",
"keySize",
"==",
"valuePos",
";",
"int",
"start",
"=",
"memoryBuffer",
".",
"limit",
"(",
")",... | Add a pointer to the key value pair with the provided parameters. | [
"Add",
"a",
"pointer",
"to",
"the",
"key",
"value",
"pair",
"with",
"the",
"provided",
"parameters",
"."
] | 2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6 | https://github.com/GoogleCloudPlatform/appengine-mapreduce/blob/2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6/java/src/main/java/com/google/appengine/tools/mapreduce/impl/sort/SortWorker.java#L348-L356 |
107,090 | GoogleCloudPlatform/appengine-mapreduce | java/src/main/java/com/google/appengine/tools/mapreduce/impl/sort/SortWorker.java | SortWorker.spliceIn | private static int spliceIn(ByteBuffer src, ByteBuffer dest) {
int position = dest.position();
int srcPos = src.position();
dest.put(src);
src.position(srcPos);
return position;
} | java | private static int spliceIn(ByteBuffer src, ByteBuffer dest) {
int position = dest.position();
int srcPos = src.position();
dest.put(src);
src.position(srcPos);
return position;
} | [
"private",
"static",
"int",
"spliceIn",
"(",
"ByteBuffer",
"src",
",",
"ByteBuffer",
"dest",
")",
"{",
"int",
"position",
"=",
"dest",
".",
"position",
"(",
")",
";",
"int",
"srcPos",
"=",
"src",
".",
"position",
"(",
")",
";",
"dest",
".",
"put",
"(... | Write the contents of src to dest, without messing with src's position.
@param dest (position is advanced)
@return the pos in dest where src is written | [
"Write",
"the",
"contents",
"of",
"src",
"to",
"dest",
"without",
"messing",
"with",
"src",
"s",
"position",
"."
] | 2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6 | https://github.com/GoogleCloudPlatform/appengine-mapreduce/blob/2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6/java/src/main/java/com/google/appengine/tools/mapreduce/impl/sort/SortWorker.java#L364-L370 |
107,091 | GoogleCloudPlatform/appengine-mapreduce | java/src/main/java/com/google/appengine/tools/mapreduce/impl/shardedjob/InProcessShardedJobRunner.java | InProcessShardedJobRunner.runJob | public static <T extends IncrementalTask> void runJob(
List<T> initialTasks, ShardedJobController<T> controller) {
List<T> results = new ArrayList<>();
for (T task : initialTasks) {
Preconditions.checkNotNull(task, "Null initial task: %s", initialTasks);
task.prepare();
do {
task... | java | public static <T extends IncrementalTask> void runJob(
List<T> initialTasks, ShardedJobController<T> controller) {
List<T> results = new ArrayList<>();
for (T task : initialTasks) {
Preconditions.checkNotNull(task, "Null initial task: %s", initialTasks);
task.prepare();
do {
task... | [
"public",
"static",
"<",
"T",
"extends",
"IncrementalTask",
">",
"void",
"runJob",
"(",
"List",
"<",
"T",
">",
"initialTasks",
",",
"ShardedJobController",
"<",
"T",
">",
"controller",
")",
"{",
"List",
"<",
"T",
">",
"results",
"=",
"new",
"ArrayList",
... | Runs the given job and returns its result. | [
"Runs",
"the",
"given",
"job",
"and",
"returns",
"its",
"result",
"."
] | 2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6 | https://github.com/GoogleCloudPlatform/appengine-mapreduce/blob/2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6/java/src/main/java/com/google/appengine/tools/mapreduce/impl/shardedjob/InProcessShardedJobRunner.java#L24-L37 |
107,092 | GoogleCloudPlatform/appengine-mapreduce | java/src/main/java/com/google/appengine/tools/mapreduce/impl/Shuffling.java | Shuffling.multimapToList | private static <K, V> List<KeyValue<K, List<V>>> multimapToList(
Marshaller<K> keyMarshaller, ListMultimap<Bytes, V> in) {
List<Bytes> keys = Ordering.natural().sortedCopy(in.keySet());
ImmutableList.Builder<KeyValue<K, List<V>>> out = ImmutableList.builder();
for (Bytes keyBytes : keys) {
K key... | java | private static <K, V> List<KeyValue<K, List<V>>> multimapToList(
Marshaller<K> keyMarshaller, ListMultimap<Bytes, V> in) {
List<Bytes> keys = Ordering.natural().sortedCopy(in.keySet());
ImmutableList.Builder<KeyValue<K, List<V>>> out = ImmutableList.builder();
for (Bytes keyBytes : keys) {
K key... | [
"private",
"static",
"<",
"K",
",",
"V",
">",
"List",
"<",
"KeyValue",
"<",
"K",
",",
"List",
"<",
"V",
">",
">",
">",
"multimapToList",
"(",
"Marshaller",
"<",
"K",
">",
"keyMarshaller",
",",
"ListMultimap",
"<",
"Bytes",
",",
"V",
">",
"in",
")",... | Also turns the keys back from Bytes into K. | [
"Also",
"turns",
"the",
"keys",
"back",
"from",
"Bytes",
"into",
"K",
"."
] | 2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6 | https://github.com/GoogleCloudPlatform/appengine-mapreduce/blob/2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6/java/src/main/java/com/google/appengine/tools/mapreduce/impl/Shuffling.java#L99-L108 |
107,093 | GoogleCloudPlatform/appengine-mapreduce | java/src/main/java/com/google/appengine/tools/mapreduce/outputs/InMemoryOutput.java | InMemoryOutput.finish | @Override
public List<List<O>> finish(Collection<? extends OutputWriter<O>> writers) {
ImmutableList.Builder<List<O>> out = ImmutableList.builder();
for (OutputWriter<O> w : writers) {
InMemoryOutputWriter<O> writer = (InMemoryOutputWriter<O>) w;
out.add(ImmutableList.copyOf(writer.getResult()));
... | java | @Override
public List<List<O>> finish(Collection<? extends OutputWriter<O>> writers) {
ImmutableList.Builder<List<O>> out = ImmutableList.builder();
for (OutputWriter<O> w : writers) {
InMemoryOutputWriter<O> writer = (InMemoryOutputWriter<O>) w;
out.add(ImmutableList.copyOf(writer.getResult()));
... | [
"@",
"Override",
"public",
"List",
"<",
"List",
"<",
"O",
">",
">",
"finish",
"(",
"Collection",
"<",
"?",
"extends",
"OutputWriter",
"<",
"O",
">",
">",
"writers",
")",
"{",
"ImmutableList",
".",
"Builder",
"<",
"List",
"<",
"O",
">>",
"out",
"=",
... | Returns a list of lists where the outer list has one element for each
reduce shard, which is a list of the values emitted by that shard, in
order. | [
"Returns",
"a",
"list",
"of",
"lists",
"where",
"the",
"outer",
"list",
"has",
"one",
"element",
"for",
"each",
"reduce",
"shard",
"which",
"is",
"a",
"list",
"of",
"the",
"values",
"emitted",
"by",
"that",
"shard",
"in",
"order",
"."
] | 2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6 | https://github.com/GoogleCloudPlatform/appengine-mapreduce/blob/2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6/java/src/main/java/com/google/appengine/tools/mapreduce/outputs/InMemoryOutput.java#L39-L47 |
107,094 | GoogleCloudPlatform/appengine-mapreduce | java/src/main/java/com/google/appengine/tools/mapreduce/impl/MergingReader.java | MergingReader.next | @Override
public KeyValue<K, Iterator<V>> next() throws NoSuchElementException {
if (combineValues) {
skipLeftoverItems();
}
PeekingInputReader<KeyValue<ByteBuffer, ? extends Iterable<V>>> reader =
lowestReaderQueue.remove();
KeyValue<ByteBuffer, ? extends Iterable<V>> lowest = reader.ne... | java | @Override
public KeyValue<K, Iterator<V>> next() throws NoSuchElementException {
if (combineValues) {
skipLeftoverItems();
}
PeekingInputReader<KeyValue<ByteBuffer, ? extends Iterable<V>>> reader =
lowestReaderQueue.remove();
KeyValue<ByteBuffer, ? extends Iterable<V>> lowest = reader.ne... | [
"@",
"Override",
"public",
"KeyValue",
"<",
"K",
",",
"Iterator",
"<",
"V",
">",
">",
"next",
"(",
")",
"throws",
"NoSuchElementException",
"{",
"if",
"(",
"combineValues",
")",
"{",
"skipLeftoverItems",
"(",
")",
";",
"}",
"PeekingInputReader",
"<",
"KeyV... | Returns the next KeyValues object for the reducer. This is the entry point.
@throws NoSuchElementException if there are no more keys in the input. | [
"Returns",
"the",
"next",
"KeyValues",
"object",
"for",
"the",
"reducer",
".",
"This",
"is",
"the",
"entry",
"point",
"."
] | 2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6 | https://github.com/GoogleCloudPlatform/appengine-mapreduce/blob/2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6/java/src/main/java/com/google/appengine/tools/mapreduce/impl/MergingReader.java#L167-L185 |
107,095 | GoogleCloudPlatform/appengine-mapreduce | java/src/main/java/com/google/appengine/tools/mapreduce/impl/MergingReader.java | MergingReader.skipLeftoverItems | private void skipLeftoverItems() {
if (lastKey == null || lowestReaderQueue.isEmpty()) {
return;
}
boolean itemSkiped;
do {
PeekingInputReader<KeyValue<ByteBuffer, ? extends Iterable<V>>> reader =
lowestReaderQueue.remove();
itemSkiped = skipItemsOnReader(reader);
addRe... | java | private void skipLeftoverItems() {
if (lastKey == null || lowestReaderQueue.isEmpty()) {
return;
}
boolean itemSkiped;
do {
PeekingInputReader<KeyValue<ByteBuffer, ? extends Iterable<V>>> reader =
lowestReaderQueue.remove();
itemSkiped = skipItemsOnReader(reader);
addRe... | [
"private",
"void",
"skipLeftoverItems",
"(",
")",
"{",
"if",
"(",
"lastKey",
"==",
"null",
"||",
"lowestReaderQueue",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
";",
"}",
"boolean",
"itemSkiped",
";",
"do",
"{",
"PeekingInputReader",
"<",
"KeyValue",
"<... | It is possible that a reducer does not iterate over all of the items given to it for a given
key. However on the next callback they expect to receive items for the following key. this
method skips over all the left over items from the previous key they did not read. | [
"It",
"is",
"possible",
"that",
"a",
"reducer",
"does",
"not",
"iterate",
"over",
"all",
"of",
"the",
"items",
"given",
"to",
"it",
"for",
"a",
"given",
"key",
".",
"However",
"on",
"the",
"next",
"callback",
"they",
"expect",
"to",
"receive",
"items",
... | 2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6 | https://github.com/GoogleCloudPlatform/appengine-mapreduce/blob/2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6/java/src/main/java/com/google/appengine/tools/mapreduce/impl/MergingReader.java#L199-L210 |
107,096 | GoogleCloudPlatform/appengine-mapreduce | java/src/main/java/com/google/appengine/tools/mapreduce/impl/MergingReader.java | MergingReader.skipItemsOnReader | private boolean skipItemsOnReader(
PeekingInputReader<KeyValue<ByteBuffer, ? extends Iterable<V>>> reader) {
boolean itemSkipped = false;
KeyValue<ByteBuffer, ? extends Iterable<V>> keyValue = reader.peek();
while (keyValue != null && compareBuffers(keyValue.getKey(), lastKey.getValue()) == 0) {
... | java | private boolean skipItemsOnReader(
PeekingInputReader<KeyValue<ByteBuffer, ? extends Iterable<V>>> reader) {
boolean itemSkipped = false;
KeyValue<ByteBuffer, ? extends Iterable<V>> keyValue = reader.peek();
while (keyValue != null && compareBuffers(keyValue.getKey(), lastKey.getValue()) == 0) {
... | [
"private",
"boolean",
"skipItemsOnReader",
"(",
"PeekingInputReader",
"<",
"KeyValue",
"<",
"ByteBuffer",
",",
"?",
"extends",
"Iterable",
"<",
"V",
">",
">",
">",
"reader",
")",
"{",
"boolean",
"itemSkipped",
"=",
"false",
";",
"KeyValue",
"<",
"ByteBuffer",
... | Helper function for skipLeftoverItems to skip items matching last key on a single reader. | [
"Helper",
"function",
"for",
"skipLeftoverItems",
"to",
"skip",
"items",
"matching",
"last",
"key",
"on",
"a",
"single",
"reader",
"."
] | 2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6 | https://github.com/GoogleCloudPlatform/appengine-mapreduce/blob/2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6/java/src/main/java/com/google/appengine/tools/mapreduce/impl/MergingReader.java#L215-L225 |
107,097 | GoogleCloudPlatform/appengine-mapreduce | java/src/main/java/com/google/appengine/tools/mapreduce/inputs/LevelDbInputReader.java | LevelDbInputReader.readPhysicalRecord | private Record readPhysicalRecord(boolean expectEnd) throws IOException {
int bytesToBlockEnd = findBytesToBlockEnd();
if (bytesToBlockEnd < HEADER_LENGTH) {
readToTmp(bytesToBlockEnd, expectEnd);
return createRecordFromTmp(RecordType.NONE);
}
readToTmp(HEADER_LENGTH, expectEnd);
int ch... | java | private Record readPhysicalRecord(boolean expectEnd) throws IOException {
int bytesToBlockEnd = findBytesToBlockEnd();
if (bytesToBlockEnd < HEADER_LENGTH) {
readToTmp(bytesToBlockEnd, expectEnd);
return createRecordFromTmp(RecordType.NONE);
}
readToTmp(HEADER_LENGTH, expectEnd);
int ch... | [
"private",
"Record",
"readPhysicalRecord",
"(",
"boolean",
"expectEnd",
")",
"throws",
"IOException",
"{",
"int",
"bytesToBlockEnd",
"=",
"findBytesToBlockEnd",
"(",
")",
";",
"if",
"(",
"bytesToBlockEnd",
"<",
"HEADER_LENGTH",
")",
"{",
"readToTmp",
"(",
"bytesTo... | Reads the next record from the LevelDb data stream.
@param expectEnd if end of stream encountered will throw {@link NoSuchElementException} when
true and {@link CorruptDataException} when false.
@return Record data of the physical record read.
@throws IOException | [
"Reads",
"the",
"next",
"record",
"from",
"the",
"LevelDb",
"data",
"stream",
"."
] | 2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6 | https://github.com/GoogleCloudPlatform/appengine-mapreduce/blob/2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6/java/src/main/java/com/google/appengine/tools/mapreduce/inputs/LevelDbInputReader.java#L188-L211 |
107,098 | GoogleCloudPlatform/appengine-mapreduce | java/src/main/java/com/google/appengine/tools/mapreduce/inputs/LevelDbInputReader.java | LevelDbInputReader.copyAll | private static ByteBuffer copyAll(List<ByteBuffer> buffers) {
int size = 0;
for (ByteBuffer b : buffers) {
size += b.remaining();
}
ByteBuffer result = allocate(size);
for (ByteBuffer b : buffers) {
result.put(b);
}
result.flip();
return result;
} | java | private static ByteBuffer copyAll(List<ByteBuffer> buffers) {
int size = 0;
for (ByteBuffer b : buffers) {
size += b.remaining();
}
ByteBuffer result = allocate(size);
for (ByteBuffer b : buffers) {
result.put(b);
}
result.flip();
return result;
} | [
"private",
"static",
"ByteBuffer",
"copyAll",
"(",
"List",
"<",
"ByteBuffer",
">",
"buffers",
")",
"{",
"int",
"size",
"=",
"0",
";",
"for",
"(",
"ByteBuffer",
"b",
":",
"buffers",
")",
"{",
"size",
"+=",
"b",
".",
"remaining",
"(",
")",
";",
"}",
... | Copies a list of byteBuffers into a single new byteBuffer. | [
"Copies",
"a",
"list",
"of",
"byteBuffers",
"into",
"a",
"single",
"new",
"byteBuffer",
"."
] | 2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6 | https://github.com/GoogleCloudPlatform/appengine-mapreduce/blob/2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6/java/src/main/java/com/google/appengine/tools/mapreduce/inputs/LevelDbInputReader.java#L268-L279 |
107,099 | GoogleCloudPlatform/appengine-mapreduce | java/src/main/java/com/google/appengine/tools/mapreduce/outputs/SizeSegmentedGoogleCloudStorageFileOutput.java | SizeSegmentedGoogleCloudStorageFileOutput.finish | @Override
public GoogleCloudStorageFileSet finish(Collection<? extends OutputWriter<ByteBuffer>> writers)
throws IOException {
List<String> fileNames = new ArrayList<>();
for (OutputWriter<ByteBuffer> writer : writers) {
SizeSegmentingGoogleCloudStorageFileWriter segWriter =
(SizeSegment... | java | @Override
public GoogleCloudStorageFileSet finish(Collection<? extends OutputWriter<ByteBuffer>> writers)
throws IOException {
List<String> fileNames = new ArrayList<>();
for (OutputWriter<ByteBuffer> writer : writers) {
SizeSegmentingGoogleCloudStorageFileWriter segWriter =
(SizeSegment... | [
"@",
"Override",
"public",
"GoogleCloudStorageFileSet",
"finish",
"(",
"Collection",
"<",
"?",
"extends",
"OutputWriter",
"<",
"ByteBuffer",
">",
">",
"writers",
")",
"throws",
"IOException",
"{",
"List",
"<",
"String",
">",
"fileNames",
"=",
"new",
"ArrayList",... | Returns a list of all the filenames written by the output writers
@throws IOException | [
"Returns",
"a",
"list",
"of",
"all",
"the",
"filenames",
"written",
"by",
"the",
"output",
"writers"
] | 2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6 | https://github.com/GoogleCloudPlatform/appengine-mapreduce/blob/2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6/java/src/main/java/com/google/appengine/tools/mapreduce/outputs/SizeSegmentedGoogleCloudStorageFileOutput.java#L116-L128 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.