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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
148,000 | mlhartme/sushi | src/main/java/net/oneandone/sushi/io/Buffer.java | Buffer.copy | public long copy(InputStream in, OutputStream out, long max) throws IOException {
int chunk;
long all;
long remaining;
remaining = max;
all = 0;
while (remaining > 0) {
// cast is save because the buffer.length is an integer
chunk = in.rea... | java | public long copy(InputStream in, OutputStream out, long max) throws IOException {
int chunk;
long all;
long remaining;
remaining = max;
all = 0;
while (remaining > 0) {
// cast is save because the buffer.length is an integer
chunk = in.rea... | [
"public",
"long",
"copy",
"(",
"InputStream",
"in",
",",
"OutputStream",
"out",
",",
"long",
"max",
")",
"throws",
"IOException",
"{",
"int",
"chunk",
";",
"long",
"all",
";",
"long",
"remaining",
";",
"remaining",
"=",
"max",
";",
"all",
"=",
"0",
";"... | Copies up to max bytes.
@return number of bytes actually copied | [
"Copies",
"up",
"to",
"max",
"bytes",
"."
] | 4af33414b04bd58584d4febe5cc63ef6c7346a75 | https://github.com/mlhartme/sushi/blob/4af33414b04bd58584d4febe5cc63ef6c7346a75/src/main/java/net/oneandone/sushi/io/Buffer.java#L165-L184 |
148,001 | mlhartme/sushi | src/main/java/net/oneandone/sushi/io/Buffer.java | Buffer.skip | public long skip(InputStream src, long n) throws IOException {
long done;
int chunk;
if (n <= 0) {
return 0;
}
done = 0;
while (done < n) {
chunk = src.read(buffer, 0, (int) Math.min(Integer.MAX_VALUE, n - done));
if (chunk == -1) {
... | java | public long skip(InputStream src, long n) throws IOException {
long done;
int chunk;
if (n <= 0) {
return 0;
}
done = 0;
while (done < n) {
chunk = src.read(buffer, 0, (int) Math.min(Integer.MAX_VALUE, n - done));
if (chunk == -1) {
... | [
"public",
"long",
"skip",
"(",
"InputStream",
"src",
",",
"long",
"n",
")",
"throws",
"IOException",
"{",
"long",
"done",
";",
"int",
"chunk",
";",
"if",
"(",
"n",
"<=",
"0",
")",
"{",
"return",
"0",
";",
"}",
"done",
"=",
"0",
";",
"while",
"(",... | skip the specified number of bytes - or less, if eof is reached | [
"skip",
"the",
"specified",
"number",
"of",
"bytes",
"-",
"or",
"less",
"if",
"eof",
"is",
"reached"
] | 4af33414b04bd58584d4febe5cc63ef6c7346a75 | https://github.com/mlhartme/sushi/blob/4af33414b04bd58584d4febe5cc63ef6c7346a75/src/main/java/net/oneandone/sushi/io/Buffer.java#L187-L203 |
148,002 | mlhartme/sushi | src/main/java/net/oneandone/sushi/io/LineReader.java | LineReader.next | public String next() throws IOException {
String result;
int len;
Matcher matcher;
while (true) {
matcher = format.separator.matcher(buffer);
if (matcher.find()) {
len = matcher.end();
if (buffer.start + len == buffer.end) {
... | java | public String next() throws IOException {
String result;
int len;
Matcher matcher;
while (true) {
matcher = format.separator.matcher(buffer);
if (matcher.find()) {
len = matcher.end();
if (buffer.start + len == buffer.end) {
... | [
"public",
"String",
"next",
"(",
")",
"throws",
"IOException",
"{",
"String",
"result",
";",
"int",
"len",
";",
"Matcher",
"matcher",
";",
"while",
"(",
"true",
")",
"{",
"matcher",
"=",
"format",
".",
"separator",
".",
"matcher",
"(",
"buffer",
")",
"... | Never closes the underlying reader. @return next line of null for end of file | [
"Never",
"closes",
"the",
"underlying",
"reader",
"."
] | 4af33414b04bd58584d4febe5cc63ef6c7346a75 | https://github.com/mlhartme/sushi/blob/4af33414b04bd58584d4febe5cc63ef6c7346a75/src/main/java/net/oneandone/sushi/io/LineReader.java#L77-L125 |
148,003 | udoprog/ffwd-client-java | src/main/java/com/google/protobuf250/UninitializedMessageException.java | UninitializedMessageException.buildDescription | private static String buildDescription(final List<String> missingFields) {
final StringBuilder description =
new StringBuilder("Message missing required fields: ");
boolean first = true;
for (final String field : missingFields) {
if (first) {
first = false;
} else {
descrip... | java | private static String buildDescription(final List<String> missingFields) {
final StringBuilder description =
new StringBuilder("Message missing required fields: ");
boolean first = true;
for (final String field : missingFields) {
if (first) {
first = false;
} else {
descrip... | [
"private",
"static",
"String",
"buildDescription",
"(",
"final",
"List",
"<",
"String",
">",
"missingFields",
")",
"{",
"final",
"StringBuilder",
"description",
"=",
"new",
"StringBuilder",
"(",
"\"Message missing required fields: \"",
")",
";",
"boolean",
"first",
... | Construct the description string for this exception. | [
"Construct",
"the",
"description",
"string",
"for",
"this",
"exception",
"."
] | b4161d2b138e3edb8fa9420cc3cc653d5764cf5b | https://github.com/udoprog/ffwd-client-java/blob/b4161d2b138e3edb8fa9420cc3cc653d5764cf5b/src/main/java/com/google/protobuf250/UninitializedMessageException.java#L85-L98 |
148,004 | yfpeng/pengyifan-bioc | src/main/java/com/pengyifan/bioc/io/BioCCollectionReader.java | BioCCollectionReader.readCollection | public BioCCollection readCollection()
throws XMLStreamException {
if (collection != null) {
BioCCollection thisCollection = collection;
collection = null;
return thisCollection;
}
return null;
} | java | public BioCCollection readCollection()
throws XMLStreamException {
if (collection != null) {
BioCCollection thisCollection = collection;
collection = null;
return thisCollection;
}
return null;
} | [
"public",
"BioCCollection",
"readCollection",
"(",
")",
"throws",
"XMLStreamException",
"{",
"if",
"(",
"collection",
"!=",
"null",
")",
"{",
"BioCCollection",
"thisCollection",
"=",
"collection",
";",
"collection",
"=",
"null",
";",
"return",
"thisCollection",
";... | Reads the collection of documents.
@return the BioC collection
@throws XMLStreamException if an unexpected processing error occurs | [
"Reads",
"the",
"collection",
"of",
"documents",
"."
] | e09cce1969aa598ff89e7957237375715d7a1a3a | https://github.com/yfpeng/pengyifan-bioc/blob/e09cce1969aa598ff89e7957237375715d7a1a3a/src/main/java/com/pengyifan/bioc/io/BioCCollectionReader.java#L127-L135 |
148,005 | synchronoss/cpo-api | cpo-core/src/main/java/org/synchronoss/cpo/BindableWhereBuilder.java | BindableWhereBuilder.visitBegin | @Override
public boolean visitBegin(Node node) throws Exception {
BindableCpoWhere jcw = (BindableCpoWhere) node;
whereClause.append(jcw.toString(cpoClass));
if (jcw.hasParent() || jcw.getLogical() != CpoWhere.LOGIC_NONE) {
whereClause.append(" (");
} else {
whereClause.append(" ");
}
... | java | @Override
public boolean visitBegin(Node node) throws Exception {
BindableCpoWhere jcw = (BindableCpoWhere) node;
whereClause.append(jcw.toString(cpoClass));
if (jcw.hasParent() || jcw.getLogical() != CpoWhere.LOGIC_NONE) {
whereClause.append(" (");
} else {
whereClause.append(" ");
}
... | [
"@",
"Override",
"public",
"boolean",
"visitBegin",
"(",
"Node",
"node",
")",
"throws",
"Exception",
"{",
"BindableCpoWhere",
"jcw",
"=",
"(",
"BindableCpoWhere",
")",
"node",
";",
"whereClause",
".",
"append",
"(",
"jcw",
".",
"toString",
"(",
"cpoClass",
"... | This is called by composite nodes prior to visiting children
@param node The node to be visited
@return a boolean (false) to end visit or (true) to continue visiting | [
"This",
"is",
"called",
"by",
"composite",
"nodes",
"prior",
"to",
"visiting",
"children"
] | dc745aca3b3206abf80b85d9689b0132f5baa694 | https://github.com/synchronoss/cpo-api/blob/dc745aca3b3206abf80b85d9689b0132f5baa694/cpo-core/src/main/java/org/synchronoss/cpo/BindableWhereBuilder.java#L61-L72 |
148,006 | synchronoss/cpo-api | cpo-core/src/main/java/org/synchronoss/cpo/BindableWhereBuilder.java | BindableWhereBuilder.visitEnd | @Override
public boolean visitEnd(Node node) throws Exception {
BindableCpoWhere bcw = (BindableCpoWhere) node;
if (bcw.hasParent() || bcw.getLogical() != CpoWhere.LOGIC_NONE) {
whereClause.append(")");
}
return true;
} | java | @Override
public boolean visitEnd(Node node) throws Exception {
BindableCpoWhere bcw = (BindableCpoWhere) node;
if (bcw.hasParent() || bcw.getLogical() != CpoWhere.LOGIC_NONE) {
whereClause.append(")");
}
return true;
} | [
"@",
"Override",
"public",
"boolean",
"visitEnd",
"(",
"Node",
"node",
")",
"throws",
"Exception",
"{",
"BindableCpoWhere",
"bcw",
"=",
"(",
"BindableCpoWhere",
")",
"node",
";",
"if",
"(",
"bcw",
".",
"hasParent",
"(",
")",
"||",
"bcw",
".",
"getLogical",... | This is called by composite nodes after visiting children
@param node The node to be visited
@return a boolean (false) to end visit or (true) to continue visiting | [
"This",
"is",
"called",
"by",
"composite",
"nodes",
"after",
"visiting",
"children"
] | dc745aca3b3206abf80b85d9689b0132f5baa694 | https://github.com/synchronoss/cpo-api/blob/dc745aca3b3206abf80b85d9689b0132f5baa694/cpo-core/src/main/java/org/synchronoss/cpo/BindableWhereBuilder.java#L91-L98 |
148,007 | synchronoss/cpo-api | cpo-core/src/main/java/org/synchronoss/cpo/BindableWhereBuilder.java | BindableWhereBuilder.visit | @Override
public boolean visit(Node node) throws Exception {
BindableCpoWhere bcw = (BindableCpoWhere) node;
CpoAttribute attribute;
whereClause.append(bcw.toString(cpoClass));
if (bcw.getValue() != null) {
attribute = cpoClass.getAttributeJava(bcw.getAttribute());
if (attribute == null) {... | java | @Override
public boolean visit(Node node) throws Exception {
BindableCpoWhere bcw = (BindableCpoWhere) node;
CpoAttribute attribute;
whereClause.append(bcw.toString(cpoClass));
if (bcw.getValue() != null) {
attribute = cpoClass.getAttributeJava(bcw.getAttribute());
if (attribute == null) {... | [
"@",
"Override",
"public",
"boolean",
"visit",
"(",
"Node",
"node",
")",
"throws",
"Exception",
"{",
"BindableCpoWhere",
"bcw",
"=",
"(",
"BindableCpoWhere",
")",
"node",
";",
"CpoAttribute",
"attribute",
";",
"whereClause",
".",
"append",
"(",
"bcw",
".",
"... | This is called for component elements which have no children
@param node The element to be visited
@return a boolean (false) to end visit or (true) to continue visiting | [
"This",
"is",
"called",
"for",
"component",
"elements",
"which",
"have",
"no",
"children"
] | dc745aca3b3206abf80b85d9689b0132f5baa694 | https://github.com/synchronoss/cpo-api/blob/dc745aca3b3206abf80b85d9689b0132f5baa694/cpo-core/src/main/java/org/synchronoss/cpo/BindableWhereBuilder.java#L106-L135 |
148,008 | gilberto-torrezan/gwt-views | src/main/java/com/github/gilbertotorrezan/gwtviews/client/analytics/UniversalAnalyticsTracker.java | UniversalAnalyticsTracker.sendPageView | public static void sendPageView(String pageWithParameters){
if (analytics == null){
return;
}
analytics.sendPageView().documentPath(pageWithParameters).go();
} | java | public static void sendPageView(String pageWithParameters){
if (analytics == null){
return;
}
analytics.sendPageView().documentPath(pageWithParameters).go();
} | [
"public",
"static",
"void",
"sendPageView",
"(",
"String",
"pageWithParameters",
")",
"{",
"if",
"(",
"analytics",
"==",
"null",
")",
"{",
"return",
";",
"}",
"analytics",
".",
"sendPageView",
"(",
")",
".",
"documentPath",
"(",
"pageWithParameters",
")",
".... | Tracks a page view. Do nothing if the UniversalAnalyticsTracker is not configured.
@param pageWithParameters The current page for tracking, including query parameters. Can be obtained by calling {@link URLToken#toString()}.
@see Analytics#sendPageView() | [
"Tracks",
"a",
"page",
"view",
".",
"Do",
"nothing",
"if",
"the",
"UniversalAnalyticsTracker",
"is",
"not",
"configured",
"."
] | c6511435d14b5aa93a722b0e861230d0ae2159e5 | https://github.com/gilberto-torrezan/gwt-views/blob/c6511435d14b5aa93a722b0e861230d0ae2159e5/src/main/java/com/github/gilbertotorrezan/gwtviews/client/analytics/UniversalAnalyticsTracker.java#L106-L111 |
148,009 | ZenHarbinger/l2fprod-properties-editor | src/main/java/com/l2fprod/common/propertysheet/PropertySheetTableModel.java | PropertySheetTableModel.setCategorySortingComparator | public void setCategorySortingComparator(Comparator comp) {
Comparator old = categorySortingComparator;
categorySortingComparator = comp;
if (categorySortingComparator != old) {
buildModel();
}
} | java | public void setCategorySortingComparator(Comparator comp) {
Comparator old = categorySortingComparator;
categorySortingComparator = comp;
if (categorySortingComparator != old) {
buildModel();
}
} | [
"public",
"void",
"setCategorySortingComparator",
"(",
"Comparator",
"comp",
")",
"{",
"Comparator",
"old",
"=",
"categorySortingComparator",
";",
"categorySortingComparator",
"=",
"comp",
";",
"if",
"(",
"categorySortingComparator",
"!=",
"old",
")",
"{",
"buildModel... | Set the comparator used for sorting categories. If this changes the
comparator, the model will be rebuilt.
@param comp | [
"Set",
"the",
"comparator",
"used",
"for",
"sorting",
"categories",
".",
"If",
"this",
"changes",
"the",
"comparator",
"the",
"model",
"will",
"be",
"rebuilt",
"."
] | d9b15c3f0b6ac1d9a2a9d315be073d2a4a419c32 | https://github.com/ZenHarbinger/l2fprod-properties-editor/blob/d9b15c3f0b6ac1d9a2a9d315be073d2a4a419c32/src/main/java/com/l2fprod/common/propertysheet/PropertySheetTableModel.java#L266-L272 |
148,010 | ZenHarbinger/l2fprod-properties-editor | src/main/java/com/l2fprod/common/propertysheet/PropertySheetTableModel.java | PropertySheetTableModel.setPropertySortingComparator | public void setPropertySortingComparator(Comparator comp) {
Comparator old = propertySortingComparator;
propertySortingComparator = comp;
if (propertySortingComparator != old) {
buildModel();
}
} | java | public void setPropertySortingComparator(Comparator comp) {
Comparator old = propertySortingComparator;
propertySortingComparator = comp;
if (propertySortingComparator != old) {
buildModel();
}
} | [
"public",
"void",
"setPropertySortingComparator",
"(",
"Comparator",
"comp",
")",
"{",
"Comparator",
"old",
"=",
"propertySortingComparator",
";",
"propertySortingComparator",
"=",
"comp",
";",
"if",
"(",
"propertySortingComparator",
"!=",
"old",
")",
"{",
"buildModel... | Set the comparator used for sorting properties. If this changes the
comparator, the model will be rebuilt.
@param comp | [
"Set",
"the",
"comparator",
"used",
"for",
"sorting",
"properties",
".",
"If",
"this",
"changes",
"the",
"comparator",
"the",
"model",
"will",
"be",
"rebuilt",
"."
] | d9b15c3f0b6ac1d9a2a9d315be073d2a4a419c32 | https://github.com/ZenHarbinger/l2fprod-properties-editor/blob/d9b15c3f0b6ac1d9a2a9d315be073d2a4a419c32/src/main/java/com/l2fprod/common/propertysheet/PropertySheetTableModel.java#L280-L286 |
148,011 | ZenHarbinger/l2fprod-properties-editor | src/main/java/com/l2fprod/common/propertysheet/PropertySheetTableModel.java | PropertySheetTableModel.addPropertiesToModel | private void addPropertiesToModel(List<Property> localProperties, Item parent) {
for (Property property : localProperties) {
Item propertyItem = new Item(property, parent);
model.add(propertyItem);
// add any sub-properties
Property[] subProperties = property.get... | java | private void addPropertiesToModel(List<Property> localProperties, Item parent) {
for (Property property : localProperties) {
Item propertyItem = new Item(property, parent);
model.add(propertyItem);
// add any sub-properties
Property[] subProperties = property.get... | [
"private",
"void",
"addPropertiesToModel",
"(",
"List",
"<",
"Property",
">",
"localProperties",
",",
"Item",
"parent",
")",
"{",
"for",
"(",
"Property",
"property",
":",
"localProperties",
")",
"{",
"Item",
"propertyItem",
"=",
"new",
"Item",
"(",
"property",... | Add the specified properties to the model using the specified parent.
@param localProperties the properties to add to the end of the model
@param parent the {@link Item} parent of these properties, null if none | [
"Add",
"the",
"specified",
"properties",
"to",
"the",
"model",
"using",
"the",
"specified",
"parent",
"."
] | d9b15c3f0b6ac1d9a2a9d315be073d2a4a419c32 | https://github.com/ZenHarbinger/l2fprod-properties-editor/blob/d9b15c3f0b6ac1d9a2a9d315be073d2a4a419c32/src/main/java/com/l2fprod/common/propertysheet/PropertySheetTableModel.java#L516-L527 |
148,012 | ZenHarbinger/l2fprod-properties-editor | src/main/java/com/l2fprod/common/propertysheet/PropertySheetTableModel.java | PropertySheetTableModel.getPropertiesForCategory | private List<Property> getPropertiesForCategory(List<Property> localProperties, String category) {
List<Property> categoryProperties = new ArrayList<Property>();
for (Property property : localProperties) {
if (property.getCategory() != null && property.getCategory().equals(category)) {
... | java | private List<Property> getPropertiesForCategory(List<Property> localProperties, String category) {
List<Property> categoryProperties = new ArrayList<Property>();
for (Property property : localProperties) {
if (property.getCategory() != null && property.getCategory().equals(category)) {
... | [
"private",
"List",
"<",
"Property",
">",
"getPropertiesForCategory",
"(",
"List",
"<",
"Property",
">",
"localProperties",
",",
"String",
"category",
")",
"{",
"List",
"<",
"Property",
">",
"categoryProperties",
"=",
"new",
"ArrayList",
"<",
"Property",
">",
"... | Convenience method to get all the properties of one category. | [
"Convenience",
"method",
"to",
"get",
"all",
"the",
"properties",
"of",
"one",
"category",
"."
] | d9b15c3f0b6ac1d9a2a9d315be073d2a4a419c32 | https://github.com/ZenHarbinger/l2fprod-properties-editor/blob/d9b15c3f0b6ac1d9a2a9d315be073d2a4a419c32/src/main/java/com/l2fprod/common/propertysheet/PropertySheetTableModel.java#L532-L540 |
148,013 | opendatatrentino/s-match | src/main/java/it/unitn/disi/smatch/matchers/element/gloss/BasicGlossMatcher.java | BasicGlossMatcher.isWordMoreGeneral | public boolean isWordMoreGeneral(String source, String target) throws MatcherLibraryException {
try {
List<ISense> sSenses = linguisticOracle.getSenses(source);
List<ISense> tSenses = linguisticOracle.getSenses(target);
for (ISense sSense : sSenses) {
for... | java | public boolean isWordMoreGeneral(String source, String target) throws MatcherLibraryException {
try {
List<ISense> sSenses = linguisticOracle.getSenses(source);
List<ISense> tSenses = linguisticOracle.getSenses(target);
for (ISense sSense : sSenses) {
for... | [
"public",
"boolean",
"isWordMoreGeneral",
"(",
"String",
"source",
",",
"String",
"target",
")",
"throws",
"MatcherLibraryException",
"{",
"try",
"{",
"List",
"<",
"ISense",
">",
"sSenses",
"=",
"linguisticOracle",
".",
"getSenses",
"(",
"source",
")",
";",
"L... | Checks the source is more general than the target or not.
@param source sense of source
@param target sense of target
@return true if the source is more general than target
@throws MatcherLibraryException MatcherLibraryException | [
"Checks",
"the",
"source",
"is",
"more",
"general",
"than",
"the",
"target",
"or",
"not",
"."
] | ba5982ef406b7010c2f92592e43887a485935aa1 | https://github.com/opendatatrentino/s-match/blob/ba5982ef406b7010c2f92592e43887a485935aa1/src/main/java/it/unitn/disi/smatch/matchers/element/gloss/BasicGlossMatcher.java#L72-L92 |
148,014 | yfpeng/pengyifan-bioc | src/main/java/com/pengyifan/bioc/io/BioCCollectionWriter.java | BioCCollectionWriter.writeCollection | public void writeCollection(BioCCollection collection)
throws XMLStreamException {
if (hasWritten) {
throw new IllegalStateException(
"writeCollection can only be invoked once.");
}
hasWritten = true;
writer.writeStartDocument(
collection.getEncoding(),
collection.... | java | public void writeCollection(BioCCollection collection)
throws XMLStreamException {
if (hasWritten) {
throw new IllegalStateException(
"writeCollection can only be invoked once.");
}
hasWritten = true;
writer.writeStartDocument(
collection.getEncoding(),
collection.... | [
"public",
"void",
"writeCollection",
"(",
"BioCCollection",
"collection",
")",
"throws",
"XMLStreamException",
"{",
"if",
"(",
"hasWritten",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"writeCollection can only be invoked once.\"",
")",
";",
"}",
"hasWritt... | Writes the whole BioC collection into the BioC file. This method can only
be called once.
@param collection the BioC collection
@throws XMLStreamException if an unexpected processing error occurs | [
"Writes",
"the",
"whole",
"BioC",
"collection",
"into",
"the",
"BioC",
"file",
".",
"This",
"method",
"can",
"only",
"be",
"called",
"once",
"."
] | e09cce1969aa598ff89e7957237375715d7a1a3a | https://github.com/yfpeng/pengyifan-bioc/blob/e09cce1969aa598ff89e7957237375715d7a1a3a/src/main/java/com/pengyifan/bioc/io/BioCCollectionWriter.java#L135-L156 |
148,015 | synchronoss/cpo-api | cpo-core/src/main/java/org/synchronoss/cpo/GUID.java | GUID.hexFormat | private static String hexFormat(int trgt) {
String s = Integer.toHexString(trgt);
int sz = s.length();
if (sz == 8) {
return s;
}
int fill = 8 - sz;
StringBuilder buf = new StringBuilder();
for (int i = 0; i < fill; ++i) {
// add leading zeros
buf.append('0');
}
b... | java | private static String hexFormat(int trgt) {
String s = Integer.toHexString(trgt);
int sz = s.length();
if (sz == 8) {
return s;
}
int fill = 8 - sz;
StringBuilder buf = new StringBuilder();
for (int i = 0; i < fill; ++i) {
// add leading zeros
buf.append('0');
}
b... | [
"private",
"static",
"String",
"hexFormat",
"(",
"int",
"trgt",
")",
"{",
"String",
"s",
"=",
"Integer",
".",
"toHexString",
"(",
"trgt",
")",
";",
"int",
"sz",
"=",
"s",
".",
"length",
"(",
")",
";",
"if",
"(",
"sz",
"==",
"8",
")",
"{",
"return... | Returns an 8 character hexidecimal representation of trgt. If the result is not equal to eight characters leading
zeros are prefixed.
@return 8 character hex representation of trgt | [
"Returns",
"an",
"8",
"character",
"hexidecimal",
"representation",
"of",
"trgt",
".",
"If",
"the",
"result",
"is",
"not",
"equal",
"to",
"eight",
"characters",
"leading",
"zeros",
"are",
"prefixed",
"."
] | dc745aca3b3206abf80b85d9689b0132f5baa694 | https://github.com/synchronoss/cpo-api/blob/dc745aca3b3206abf80b85d9689b0132f5baa694/cpo-core/src/main/java/org/synchronoss/cpo/GUID.java#L97-L113 |
148,016 | mlhartme/sushi | src/main/java/net/oneandone/sushi/xml/Selector.java | Selector.longer | public long longer(Node element, String path) throws XmlException {
String str;
str = string(element, path);
try {
return Long.parseLong(str);
} catch (NumberFormatException e) {
throw new XmlException("number expected node " + path + ": " + str);
}
} | java | public long longer(Node element, String path) throws XmlException {
String str;
str = string(element, path);
try {
return Long.parseLong(str);
} catch (NumberFormatException e) {
throw new XmlException("number expected node " + path + ": " + str);
}
} | [
"public",
"long",
"longer",
"(",
"Node",
"element",
",",
"String",
"path",
")",
"throws",
"XmlException",
"{",
"String",
"str",
";",
"str",
"=",
"string",
"(",
"element",
",",
"path",
")",
";",
"try",
"{",
"return",
"Long",
".",
"parseLong",
"(",
"str"... | Checkstyle rejects method name long_ | [
"Checkstyle",
"rejects",
"method",
"name",
"long_"
] | 4af33414b04bd58584d4febe5cc63ef6c7346a75 | https://github.com/mlhartme/sushi/blob/4af33414b04bd58584d4febe5cc63ef6c7346a75/src/main/java/net/oneandone/sushi/xml/Selector.java#L112-L121 |
148,017 | wkgcass/Style | src/main/java/net/cassite/style/IfBlock.java | IfBlock.End | public T End() {
if (procceed)
if (initVal != null && !initVal.equals(false)) {
return body.apply(initVal);
} else {
return null;
}
else
... | java | public T End() {
if (procceed)
if (initVal != null && !initVal.equals(false)) {
return body.apply(initVal);
} else {
return null;
}
else
... | [
"public",
"T",
"End",
"(",
")",
"{",
"if",
"(",
"procceed",
")",
"if",
"(",
"initVal",
"!=",
"null",
"&&",
"!",
"initVal",
".",
"equals",
"(",
"false",
")",
")",
"{",
"return",
"body",
".",
"apply",
"(",
"initVal",
")",
";",
"}",
"else",
"{",
"... | execute the if expression without an Else block
@return if-expression result | [
"execute",
"the",
"if",
"expression",
"without",
"an",
"Else",
"block"
] | db3ea64337251f46f734279480e365293bececbd | https://github.com/wkgcass/Style/blob/db3ea64337251f46f734279480e365293bececbd/src/main/java/net/cassite/style/IfBlock.java#L267-L276 |
148,018 | DDTH/ddth-dao | ddth-dao-core/src/main/java/com/github/ddth/dao/utils/BoUtils.java | BoUtils.createObject | @SuppressWarnings("unchecked")
public static <T> T createObject(String className, ClassLoader classLoader,
Class<T> clazzToCast) throws InstantiationException, IllegalAccessException,
IllegalArgumentException, InvocationTargetException, NoSuchMethodException,
SecurityException, C... | java | @SuppressWarnings("unchecked")
public static <T> T createObject(String className, ClassLoader classLoader,
Class<T> clazzToCast) throws InstantiationException, IllegalAccessException,
IllegalArgumentException, InvocationTargetException, NoSuchMethodException,
SecurityException, C... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
">",
"T",
"createObject",
"(",
"String",
"className",
",",
"ClassLoader",
"classLoader",
",",
"Class",
"<",
"T",
">",
"clazzToCast",
")",
"throws",
"InstantiationException",
",",
... | Create a new object.
@param className
@param classLoader
@param clazzToCast
@return
@throws InstantiationException
@throws IllegalAccessException
@throws IllegalArgumentException
@throws InvocationTargetException
@throws NoSuchMethodException
@throws SecurityException
@throws ClassNotFoundException | [
"Create",
"a",
"new",
"object",
"."
] | 8d059ddf641a1629aa53851f9d1b41abf175a180 | https://github.com/DDTH/ddth-dao/blob/8d059ddf641a1629aa53851f9d1b41abf175a180/ddth-dao-core/src/main/java/com/github/ddth/dao/utils/BoUtils.java#L42-L53 |
148,019 | DDTH/ddth-dao | ddth-dao-core/src/main/java/com/github/ddth/dao/utils/BoUtils.java | BoUtils.toJson | public static String toJson(BaseBo bo) {
if (bo == null) {
return null;
}
String clazz = bo.getClass().getName();
Map<String, Object> data = new HashMap<>();
data.put(FIELD_CLASSNAME, clazz);
data.put(FIELD_BODATA, bo.toJson());
return SerializationUti... | java | public static String toJson(BaseBo bo) {
if (bo == null) {
return null;
}
String clazz = bo.getClass().getName();
Map<String, Object> data = new HashMap<>();
data.put(FIELD_CLASSNAME, clazz);
data.put(FIELD_BODATA, bo.toJson());
return SerializationUti... | [
"public",
"static",
"String",
"toJson",
"(",
"BaseBo",
"bo",
")",
"{",
"if",
"(",
"bo",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"String",
"clazz",
"=",
"bo",
".",
"getClass",
"(",
")",
".",
"getName",
"(",
")",
";",
"Map",
"<",
"Strin... | Serialize a BO to JSON string.
@param bo
@return | [
"Serialize",
"a",
"BO",
"to",
"JSON",
"string",
"."
] | 8d059ddf641a1629aa53851f9d1b41abf175a180 | https://github.com/DDTH/ddth-dao/blob/8d059ddf641a1629aa53851f9d1b41abf175a180/ddth-dao-core/src/main/java/com/github/ddth/dao/utils/BoUtils.java#L63-L72 |
148,020 | DDTH/ddth-dao | ddth-dao-core/src/main/java/com/github/ddth/dao/utils/BoUtils.java | BoUtils.toBytes | public static byte[] toBytes(BaseBo bo) {
if (bo == null) {
return null;
}
String clazz = bo.getClass().getName();
Map<String, Object> data = new HashMap<>();
data.put(FIELD_CLASSNAME, clazz);
data.put(FIELD_BODATA, bo.toBytes());
return SerializationU... | java | public static byte[] toBytes(BaseBo bo) {
if (bo == null) {
return null;
}
String clazz = bo.getClass().getName();
Map<String, Object> data = new HashMap<>();
data.put(FIELD_CLASSNAME, clazz);
data.put(FIELD_BODATA, bo.toBytes());
return SerializationU... | [
"public",
"static",
"byte",
"[",
"]",
"toBytes",
"(",
"BaseBo",
"bo",
")",
"{",
"if",
"(",
"bo",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"String",
"clazz",
"=",
"bo",
".",
"getClass",
"(",
")",
".",
"getName",
"(",
")",
";",
"Map",
... | Serialize a BO to a byte array.
@param bo
@return | [
"Serialize",
"a",
"BO",
"to",
"a",
"byte",
"array",
"."
] | 8d059ddf641a1629aa53851f9d1b41abf175a180 | https://github.com/DDTH/ddth-dao/blob/8d059ddf641a1629aa53851f9d1b41abf175a180/ddth-dao-core/src/main/java/com/github/ddth/dao/utils/BoUtils.java#L151-L160 |
148,021 | DDTH/ddth-dao | ddth-dao-core/src/main/java/com/github/ddth/dao/utils/BoUtils.java | BoUtils.bytesToDocument | @SuppressWarnings("unchecked")
public static Map<String, Object> bytesToDocument(byte[] data) {
return data != null && data.length > 0
? SerializationUtils.fromByteArrayFst(data, Map.class)
: null;
} | java | @SuppressWarnings("unchecked")
public static Map<String, Object> bytesToDocument(byte[] data) {
return data != null && data.length > 0
? SerializationUtils.fromByteArrayFst(data, Map.class)
: null;
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"Map",
"<",
"String",
",",
"Object",
">",
"bytesToDocument",
"(",
"byte",
"[",
"]",
"data",
")",
"{",
"return",
"data",
"!=",
"null",
"&&",
"data",
".",
"length",
">",
"0",
"?",
"S... | De-serialize byte array to "document".
@param data
@return
@since 0.10.0 | [
"De",
"-",
"serialize",
"byte",
"array",
"to",
"document",
"."
] | 8d059ddf641a1629aa53851f9d1b41abf175a180 | https://github.com/DDTH/ddth-dao/blob/8d059ddf641a1629aa53851f9d1b41abf175a180/ddth-dao-core/src/main/java/com/github/ddth/dao/utils/BoUtils.java#L238-L243 |
148,022 | DDTH/ddth-dao | ddth-dao-core/src/main/java/com/github/ddth/dao/utils/BoUtils.java | BoUtils.documentToBytes | public static byte[] documentToBytes(Map<String, Object> doc) {
return doc != null ? SerializationUtils.toByteArrayFst(doc) : ArrayUtils.EMPTY_BYTE_ARRAY;
} | java | public static byte[] documentToBytes(Map<String, Object> doc) {
return doc != null ? SerializationUtils.toByteArrayFst(doc) : ArrayUtils.EMPTY_BYTE_ARRAY;
} | [
"public",
"static",
"byte",
"[",
"]",
"documentToBytes",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"doc",
")",
"{",
"return",
"doc",
"!=",
"null",
"?",
"SerializationUtils",
".",
"toByteArrayFst",
"(",
"doc",
")",
":",
"ArrayUtils",
".",
"EMPTY_BYTE_A... | Serialize "document" to byte array.
@param doc
@return
@since 0.10.0 | [
"Serialize",
"document",
"to",
"byte",
"array",
"."
] | 8d059ddf641a1629aa53851f9d1b41abf175a180 | https://github.com/DDTH/ddth-dao/blob/8d059ddf641a1629aa53851f9d1b41abf175a180/ddth-dao-core/src/main/java/com/github/ddth/dao/utils/BoUtils.java#L252-L254 |
148,023 | lisicnu/droidUtil | src/main/java/com/github/lisicnu/libDroid/helper/INIHelper.java | INIHelper.save | public void save() {
FileWriter fw = null;
BufferedWriter bw = null;
try {
fw = new FileWriter(file);
bw = new BufferedWriter(fw);
for (Iterator<Object> iterator = ini.keySet().iterator(); iterator.hasNext(); ) {
String key = iterator.next().to... | java | public void save() {
FileWriter fw = null;
BufferedWriter bw = null;
try {
fw = new FileWriter(file);
bw = new BufferedWriter(fw);
for (Iterator<Object> iterator = ini.keySet().iterator(); iterator.hasNext(); ) {
String key = iterator.next().to... | [
"public",
"void",
"save",
"(",
")",
"{",
"FileWriter",
"fw",
"=",
"null",
";",
"BufferedWriter",
"bw",
"=",
"null",
";",
"try",
"{",
"fw",
"=",
"new",
"FileWriter",
"(",
"file",
")",
";",
"bw",
"=",
"new",
"BufferedWriter",
"(",
"fw",
")",
";",
"fo... | save the file. | [
"save",
"the",
"file",
"."
] | e4d6cf3e3f60e5efb5a75672607ded94d1725519 | https://github.com/lisicnu/droidUtil/blob/e4d6cf3e3f60e5efb5a75672607ded94d1725519/src/main/java/com/github/lisicnu/libDroid/helper/INIHelper.java#L65-L103 |
148,024 | sematext/ActionGenerator | ag-player-es/src/main/java/com/sematext/ag/es/util/JSONUtils.java | JSONUtils.getElasticSearchAddDocument | public static String getElasticSearchAddDocument(Map<String, String> values) {
StringBuilder builder = new StringBuilder();
builder.append("{");
boolean first = true;
for (Map.Entry<String, String> pair : values.entrySet()) {
if (!first) {
builder.append(",");
}
JSONUtils.addEl... | java | public static String getElasticSearchAddDocument(Map<String, String> values) {
StringBuilder builder = new StringBuilder();
builder.append("{");
boolean first = true;
for (Map.Entry<String, String> pair : values.entrySet()) {
if (!first) {
builder.append(",");
}
JSONUtils.addEl... | [
"public",
"static",
"String",
"getElasticSearchAddDocument",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"values",
")",
"{",
"StringBuilder",
"builder",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"builder",
".",
"append",
"(",
"\"{\"",
")",
";",
"boolean... | Returns ElasticSearch add command.
@param values
values to include
@return XML as String | [
"Returns",
"ElasticSearch",
"add",
"command",
"."
] | 10f4a3e680f20d7d151f5d40e6758aeb072d474f | https://github.com/sematext/ActionGenerator/blob/10f4a3e680f20d7d151f5d40e6758aeb072d474f/ag-player-es/src/main/java/com/sematext/ag/es/util/JSONUtils.java#L39-L52 |
148,025 | sematext/ActionGenerator | ag-player-es/src/main/java/com/sematext/ag/es/util/JSONUtils.java | JSONUtils.getElasticSearchBulkHeader | public static String getElasticSearchBulkHeader(SimpleDataEvent event, String index, String type) {
StringBuilder builder = new StringBuilder();
builder.append("{\"index\":{\"_index\":\"");
builder.append(index);
builder.append("\",\"_type\":\"");
builder.append(type);
builder.append("\",\"_id\"... | java | public static String getElasticSearchBulkHeader(SimpleDataEvent event, String index, String type) {
StringBuilder builder = new StringBuilder();
builder.append("{\"index\":{\"_index\":\"");
builder.append(index);
builder.append("\",\"_type\":\"");
builder.append(type);
builder.append("\",\"_id\"... | [
"public",
"static",
"String",
"getElasticSearchBulkHeader",
"(",
"SimpleDataEvent",
"event",
",",
"String",
"index",
",",
"String",
"type",
")",
"{",
"StringBuilder",
"builder",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"builder",
".",
"append",
"(",
"\"{\\\"i... | Constructs ES bulk header for the document.
@param event
data event
@param index
index name
@param type
document type
@return ES bulk header | [
"Constructs",
"ES",
"bulk",
"header",
"for",
"the",
"document",
"."
] | 10f4a3e680f20d7d151f5d40e6758aeb072d474f | https://github.com/sematext/ActionGenerator/blob/10f4a3e680f20d7d151f5d40e6758aeb072d474f/ag-player-es/src/main/java/com/sematext/ag/es/util/JSONUtils.java#L65-L75 |
148,026 | globocom/GloboDNS-Client | src/main/java/com/globo/globodns/client/model/Record.java | Record.getId | public Long getId() {
if (this.genericRecordAttributes.getId() != null) {
return this.genericRecordAttributes.getId();
} else if (this.typeARecordAttributes.getId() != null) {
return this.typeARecordAttributes.getId();
} else if (this.typeAAAARecordAttributes.getId() != n... | java | public Long getId() {
if (this.genericRecordAttributes.getId() != null) {
return this.genericRecordAttributes.getId();
} else if (this.typeARecordAttributes.getId() != null) {
return this.typeARecordAttributes.getId();
} else if (this.typeAAAARecordAttributes.getId() != n... | [
"public",
"Long",
"getId",
"(",
")",
"{",
"if",
"(",
"this",
".",
"genericRecordAttributes",
".",
"getId",
"(",
")",
"!=",
"null",
")",
"{",
"return",
"this",
".",
"genericRecordAttributes",
".",
"getId",
"(",
")",
";",
"}",
"else",
"if",
"(",
"this",
... | FIXME Better way of accessing the variables? | [
"FIXME",
"Better",
"way",
"of",
"accessing",
"the",
"variables?"
] | 4f9b742bdc598c41299fcf92e8443ce419709618 | https://github.com/globocom/GloboDNS-Client/blob/4f9b742bdc598c41299fcf92e8443ce419709618/src/main/java/com/globo/globodns/client/model/Record.java#L125-L145 |
148,027 | DDTH/ddth-dao | ddth-dao-core/src/main/java/com/github/ddth/dao/BaseDao.java | BaseDao.addProfiling | public static ProfilingRecord addProfiling(long execTimeMs, String command, long durationMs) {
ProfilingRecord record = new ProfilingRecord(execTimeMs, command, durationMs);
List<ProfilingRecord> records = profilingRecords.get();
records.add(record);
while (records.size() > 100) {
... | java | public static ProfilingRecord addProfiling(long execTimeMs, String command, long durationMs) {
ProfilingRecord record = new ProfilingRecord(execTimeMs, command, durationMs);
List<ProfilingRecord> records = profilingRecords.get();
records.add(record);
while (records.size() > 100) {
... | [
"public",
"static",
"ProfilingRecord",
"addProfiling",
"(",
"long",
"execTimeMs",
",",
"String",
"command",
",",
"long",
"durationMs",
")",
"{",
"ProfilingRecord",
"record",
"=",
"new",
"ProfilingRecord",
"(",
"execTimeMs",
",",
"command",
",",
"durationMs",
")",
... | Adds a new profiling record.
@param execTimeMs
@param command
@return | [
"Adds",
"a",
"new",
"profiling",
"record",
"."
] | 8d059ddf641a1629aa53851f9d1b41abf175a180 | https://github.com/DDTH/ddth-dao/blob/8d059ddf641a1629aa53851f9d1b41abf175a180/ddth-dao-core/src/main/java/com/github/ddth/dao/BaseDao.java#L63-L71 |
148,028 | DDTH/ddth-dao | ddth-dao-core/src/main/java/com/github/ddth/dao/BaseDao.java | BaseDao.removeFromCache | protected void removeFromCache(String cacheName, String key) {
try {
ICache cache = getCache(cacheName);
if (cache != null) {
cache.delete(key);
}
} catch (CacheException e) {
LOGGER.warn(e.getMessage(), e);
}
} | java | protected void removeFromCache(String cacheName, String key) {
try {
ICache cache = getCache(cacheName);
if (cache != null) {
cache.delete(key);
}
} catch (CacheException e) {
LOGGER.warn(e.getMessage(), e);
}
} | [
"protected",
"void",
"removeFromCache",
"(",
"String",
"cacheName",
",",
"String",
"key",
")",
"{",
"try",
"{",
"ICache",
"cache",
"=",
"getCache",
"(",
"cacheName",
")",
";",
"if",
"(",
"cache",
"!=",
"null",
")",
"{",
"cache",
".",
"delete",
"(",
"ke... | Removes an entry from cache.
@param cacheName
@param key | [
"Removes",
"an",
"entry",
"from",
"cache",
"."
] | 8d059ddf641a1629aa53851f9d1b41abf175a180 | https://github.com/DDTH/ddth-dao/blob/8d059ddf641a1629aa53851f9d1b41abf175a180/ddth-dao-core/src/main/java/com/github/ddth/dao/BaseDao.java#L144-L153 |
148,029 | DDTH/ddth-dao | ddth-dao-core/src/main/java/com/github/ddth/dao/BaseDao.java | BaseDao.putToCache | protected void putToCache(String cacheName, String key, Object value) {
putToCache(cacheName, key, value, 0);
} | java | protected void putToCache(String cacheName, String key, Object value) {
putToCache(cacheName, key, value, 0);
} | [
"protected",
"void",
"putToCache",
"(",
"String",
"cacheName",
",",
"String",
"key",
",",
"Object",
"value",
")",
"{",
"putToCache",
"(",
"cacheName",
",",
"key",
",",
"value",
",",
"0",
")",
";",
"}"
] | Puts an entry to cache, with default TTL.
@param cacheName
@param key
@param value | [
"Puts",
"an",
"entry",
"to",
"cache",
"with",
"default",
"TTL",
"."
] | 8d059ddf641a1629aa53851f9d1b41abf175a180 | https://github.com/DDTH/ddth-dao/blob/8d059ddf641a1629aa53851f9d1b41abf175a180/ddth-dao-core/src/main/java/com/github/ddth/dao/BaseDao.java#L162-L164 |
148,030 | DDTH/ddth-dao | ddth-dao-core/src/main/java/com/github/ddth/dao/BaseDao.java | BaseDao.putToCache | protected void putToCache(String cacheName, String key, Object value, long ttlSeconds) {
if (cacheItemsExpireAfterWrite) {
putToCache(cacheName, key, value, ttlSeconds, 0);
} else {
putToCache(cacheName, key, value, 0, ttlSeconds);
}
} | java | protected void putToCache(String cacheName, String key, Object value, long ttlSeconds) {
if (cacheItemsExpireAfterWrite) {
putToCache(cacheName, key, value, ttlSeconds, 0);
} else {
putToCache(cacheName, key, value, 0, ttlSeconds);
}
} | [
"protected",
"void",
"putToCache",
"(",
"String",
"cacheName",
",",
"String",
"key",
",",
"Object",
"value",
",",
"long",
"ttlSeconds",
")",
"{",
"if",
"(",
"cacheItemsExpireAfterWrite",
")",
"{",
"putToCache",
"(",
"cacheName",
",",
"key",
",",
"value",
","... | Puts an entry to cache, with specific TTL.
@param cacheName
@param key
@param value
@param ttlSeconds | [
"Puts",
"an",
"entry",
"to",
"cache",
"with",
"specific",
"TTL",
"."
] | 8d059ddf641a1629aa53851f9d1b41abf175a180 | https://github.com/DDTH/ddth-dao/blob/8d059ddf641a1629aa53851f9d1b41abf175a180/ddth-dao-core/src/main/java/com/github/ddth/dao/BaseDao.java#L174-L180 |
148,031 | acromusashi/acromusashi-stream | src/main/java/acromusashi/stream/component/rabbitmq/CachingConnectionFactory.java | CachingConnectionFactory.reset | protected void reset()
{
this.active = false;
synchronized (this.cachedChannelsNonTransactional)
{
for (ChannelProxy channel : this.cachedChannelsNonTransactional)
{
try
{
channel.getTargetChannel().close();
... | java | protected void reset()
{
this.active = false;
synchronized (this.cachedChannelsNonTransactional)
{
for (ChannelProxy channel : this.cachedChannelsNonTransactional)
{
try
{
channel.getTargetChannel().close();
... | [
"protected",
"void",
"reset",
"(",
")",
"{",
"this",
".",
"active",
"=",
"false",
";",
"synchronized",
"(",
"this",
".",
"cachedChannelsNonTransactional",
")",
"{",
"for",
"(",
"ChannelProxy",
"channel",
":",
"this",
".",
"cachedChannelsNonTransactional",
")",
... | Reset the Channel cache and underlying shared Connection, to be reinitialized on next access. | [
"Reset",
"the",
"Channel",
"cache",
"and",
"underlying",
"shared",
"Connection",
"to",
"be",
"reinitialized",
"on",
"next",
"access",
"."
] | 65b1f335d771d657c5640a2056ab5c8546eddec9 | https://github.com/acromusashi/acromusashi-stream/blob/65b1f335d771d657c5640a2056ab5c8546eddec9/src/main/java/acromusashi/stream/component/rabbitmq/CachingConnectionFactory.java#L344-L378 |
148,032 | acromusashi/acromusashi-stream | src/main/java/acromusashi/stream/bean/FieldExtractor.java | FieldExtractor.extractKeyHead | public static String extractKeyHead(String key, String delimeter)
{
int index = key.indexOf(delimeter);
if (index == -1)
{
return key;
}
String result = key.substring(0, index);
return result;
} | java | public static String extractKeyHead(String key, String delimeter)
{
int index = key.indexOf(delimeter);
if (index == -1)
{
return key;
}
String result = key.substring(0, index);
return result;
} | [
"public",
"static",
"String",
"extractKeyHead",
"(",
"String",
"key",
",",
"String",
"delimeter",
")",
"{",
"int",
"index",
"=",
"key",
".",
"indexOf",
"(",
"delimeter",
")",
";",
"if",
"(",
"index",
"==",
"-",
"1",
")",
"{",
"return",
"key",
";",
"}... | Extract the value of keyHead.
@param key is used to get string.
@param delimeter key delimeter
@return the value of keyHead . | [
"Extract",
"the",
"value",
"of",
"keyHead",
"."
] | 65b1f335d771d657c5640a2056ab5c8546eddec9 | https://github.com/acromusashi/acromusashi-stream/blob/65b1f335d771d657c5640a2056ab5c8546eddec9/src/main/java/acromusashi/stream/bean/FieldExtractor.java#L87-L97 |
148,033 | acromusashi/acromusashi-stream | src/main/java/acromusashi/stream/bean/FieldExtractor.java | FieldExtractor.extractKeyTail | public static String extractKeyTail(String key, String delimeter)
{
int index = key.indexOf(delimeter);
if (index == -1)
{
return null;
}
String result = key.substring(index + delimeter.length());
return result;
} | java | public static String extractKeyTail(String key, String delimeter)
{
int index = key.indexOf(delimeter);
if (index == -1)
{
return null;
}
String result = key.substring(index + delimeter.length());
return result;
} | [
"public",
"static",
"String",
"extractKeyTail",
"(",
"String",
"key",
",",
"String",
"delimeter",
")",
"{",
"int",
"index",
"=",
"key",
".",
"indexOf",
"(",
"delimeter",
")",
";",
"if",
"(",
"index",
"==",
"-",
"1",
")",
"{",
"return",
"null",
";",
"... | Extract the value of keyTail.
@param key is used to get string.
@param delimeter key delimeter
@return the value of keyTail . | [
"Extract",
"the",
"value",
"of",
"keyTail",
"."
] | 65b1f335d771d657c5640a2056ab5c8546eddec9 | https://github.com/acromusashi/acromusashi-stream/blob/65b1f335d771d657c5640a2056ab5c8546eddec9/src/main/java/acromusashi/stream/bean/FieldExtractor.java#L106-L115 |
148,034 | grycap/coreutils | coreutils-fiber/src/main/java/es/upv/grycap/coreutils/fiber/http/Http2Client.java | Http2Client.asyncPost | public void asyncPost(final String url, final String mediaType, final Supplier<String> supplier, final Callback callback) {
requireNonNull(supplier, "A valid supplier expected");
asyncPostBytes(url, mediaType, () -> ofNullable(supplier.get()).orElse("").getBytes(), callback);
} | java | public void asyncPost(final String url, final String mediaType, final Supplier<String> supplier, final Callback callback) {
requireNonNull(supplier, "A valid supplier expected");
asyncPostBytes(url, mediaType, () -> ofNullable(supplier.get()).orElse("").getBytes(), callback);
} | [
"public",
"void",
"asyncPost",
"(",
"final",
"String",
"url",
",",
"final",
"String",
"mediaType",
",",
"final",
"Supplier",
"<",
"String",
">",
"supplier",
",",
"final",
"Callback",
"callback",
")",
"{",
"requireNonNull",
"(",
"supplier",
",",
"\"A valid supp... | Posts data to a server via a HTTP POST request.
@param url - URL target of this request
@param mediaType - Content-Type header for this request
@param supplier - supplies the content of this request
@param callback - is called back when the response is readable | [
"Posts",
"data",
"to",
"a",
"server",
"via",
"a",
"HTTP",
"POST",
"request",
"."
] | e6db61dc50b49ea7276c0c29c7401204681a10c2 | https://github.com/grycap/coreutils/blob/e6db61dc50b49ea7276c0c29c7401204681a10c2/coreutils-fiber/src/main/java/es/upv/grycap/coreutils/fiber/http/Http2Client.java#L114-L117 |
148,035 | grycap/coreutils | coreutils-fiber/src/main/java/es/upv/grycap/coreutils/fiber/http/Http2Client.java | Http2Client.asyncPostBytes | public void asyncPostBytes(final String url, final String mediaType, final Supplier<byte[]> supplier, final Callback callback) {
final String url2 = requireNonNull(trimToNull(url), "A non-empty URL expected");
final String mediaType2 = requireNonNull(trimToNull(mediaType), "A non-empty media type expected");
requ... | java | public void asyncPostBytes(final String url, final String mediaType, final Supplier<byte[]> supplier, final Callback callback) {
final String url2 = requireNonNull(trimToNull(url), "A non-empty URL expected");
final String mediaType2 = requireNonNull(trimToNull(mediaType), "A non-empty media type expected");
requ... | [
"public",
"void",
"asyncPostBytes",
"(",
"final",
"String",
"url",
",",
"final",
"String",
"mediaType",
",",
"final",
"Supplier",
"<",
"byte",
"[",
"]",
">",
"supplier",
",",
"final",
"Callback",
"callback",
")",
"{",
"final",
"String",
"url2",
"=",
"requi... | Posts the content of a buffer of bytes to a server via a HTTP POST request.
@param url - URL target of this request
@param mediaType - Content-Type header for this request
@param supplier - supplies the content of this request
@param callback - is called back when the response is readable | [
"Posts",
"the",
"content",
"of",
"a",
"buffer",
"of",
"bytes",
"to",
"a",
"server",
"via",
"a",
"HTTP",
"POST",
"request",
"."
] | e6db61dc50b49ea7276c0c29c7401204681a10c2 | https://github.com/grycap/coreutils/blob/e6db61dc50b49ea7276c0c29c7401204681a10c2/coreutils-fiber/src/main/java/es/upv/grycap/coreutils/fiber/http/Http2Client.java#L126-L144 |
148,036 | grycap/coreutils | coreutils-fiber/src/main/java/es/upv/grycap/coreutils/fiber/http/Http2Client.java | Http2Client.asyncPut | public void asyncPut(final String url, final String mediaType, final Supplier<String> supplier, final Callback callback) {
requireNonNull(supplier, "A valid supplier expected");
asyncPutBytes(url, mediaType, () -> ofNullable(supplier.get()).orElse("").getBytes(), callback);
} | java | public void asyncPut(final String url, final String mediaType, final Supplier<String> supplier, final Callback callback) {
requireNonNull(supplier, "A valid supplier expected");
asyncPutBytes(url, mediaType, () -> ofNullable(supplier.get()).orElse("").getBytes(), callback);
} | [
"public",
"void",
"asyncPut",
"(",
"final",
"String",
"url",
",",
"final",
"String",
"mediaType",
",",
"final",
"Supplier",
"<",
"String",
">",
"supplier",
",",
"final",
"Callback",
"callback",
")",
"{",
"requireNonNull",
"(",
"supplier",
",",
"\"A valid suppl... | Puts data to a server via a HTTP PUT request.
@param url - URL target of this request
@param mediaType - Content-Type header for this request
@param supplier - supplies the content of this request
@param callback - is called back when the response is readable | [
"Puts",
"data",
"to",
"a",
"server",
"via",
"a",
"HTTP",
"PUT",
"request",
"."
] | e6db61dc50b49ea7276c0c29c7401204681a10c2 | https://github.com/grycap/coreutils/blob/e6db61dc50b49ea7276c0c29c7401204681a10c2/coreutils-fiber/src/main/java/es/upv/grycap/coreutils/fiber/http/Http2Client.java#L153-L156 |
148,037 | grycap/coreutils | coreutils-fiber/src/main/java/es/upv/grycap/coreutils/fiber/http/Http2Client.java | Http2Client.asyncDelete | public void asyncDelete(final String url, final Callback callback) {
final String url2 = requireNonNull(trimToNull(url), "A non-empty URL expected");
requireNonNull(callback, "A valid callback expected");
// prepare request
final Request request = new Request.Builder().url(url2).delete().build();
// submit re... | java | public void asyncDelete(final String url, final Callback callback) {
final String url2 = requireNonNull(trimToNull(url), "A non-empty URL expected");
requireNonNull(callback, "A valid callback expected");
// prepare request
final Request request = new Request.Builder().url(url2).delete().build();
// submit re... | [
"public",
"void",
"asyncDelete",
"(",
"final",
"String",
"url",
",",
"final",
"Callback",
"callback",
")",
"{",
"final",
"String",
"url2",
"=",
"requireNonNull",
"(",
"trimToNull",
"(",
"url",
")",
",",
"\"A non-empty URL expected\"",
")",
";",
"requireNonNull",... | Delete HTTP method.
@param url - URL target of this request
@param callback - is called back when the response is readable | [
"Delete",
"HTTP",
"method",
"."
] | e6db61dc50b49ea7276c0c29c7401204681a10c2 | https://github.com/grycap/coreutils/blob/e6db61dc50b49ea7276c0c29c7401204681a10c2/coreutils-fiber/src/main/java/es/upv/grycap/coreutils/fiber/http/Http2Client.java#L190-L197 |
148,038 | fuinorg/objects4j | src/main/java/org/fuin/objects4j/vo/WeeklyOpeningHours.java | WeeklyOpeningHours.asRemovedChanges | public List<Change> asRemovedChanges() {
final WeeklyOpeningHours normalized = this.normalize();
final List<Change> changes = new ArrayList<>();
for (final DayOpeningHours doh : normalized) {
changes.addAll(doh.asRemovedChanges());
}
return changes;
} | java | public List<Change> asRemovedChanges() {
final WeeklyOpeningHours normalized = this.normalize();
final List<Change> changes = new ArrayList<>();
for (final DayOpeningHours doh : normalized) {
changes.addAll(doh.asRemovedChanges());
}
return changes;
} | [
"public",
"List",
"<",
"Change",
">",
"asRemovedChanges",
"(",
")",
"{",
"final",
"WeeklyOpeningHours",
"normalized",
"=",
"this",
".",
"normalize",
"(",
")",
";",
"final",
"List",
"<",
"Change",
">",
"changes",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
"... | Returns all days and hour ranges as if they were removed.
@return Removed day changes. | [
"Returns",
"all",
"days",
"and",
"hour",
"ranges",
"as",
"if",
"they",
"were",
"removed",
"."
] | e7f278b5bae073ebb6a76053650571c718f36246 | https://github.com/fuinorg/objects4j/blob/e7f278b5bae073ebb6a76053650571c718f36246/src/main/java/org/fuin/objects4j/vo/WeeklyOpeningHours.java#L213-L220 |
148,039 | acromusashi/acromusashi-stream | src/main/java/acromusashi/stream/entity/StreamMessageHeader.java | StreamMessageHeader.addHistory | public void addHistory(Object historyKey)
{
if (this.history == null)
{
this.history = new KeyHistory();
}
this.history.addKey(historyKey.toString());
} | java | public void addHistory(Object historyKey)
{
if (this.history == null)
{
this.history = new KeyHistory();
}
this.history.addKey(historyKey.toString());
} | [
"public",
"void",
"addHistory",
"(",
"Object",
"historyKey",
")",
"{",
"if",
"(",
"this",
".",
"history",
"==",
"null",
")",
"{",
"this",
".",
"history",
"=",
"new",
"KeyHistory",
"(",
")",
";",
"}",
"this",
".",
"history",
".",
"addKey",
"(",
"histo... | Add key to history.
@param historyKey history key | [
"Add",
"key",
"to",
"history",
"."
] | 65b1f335d771d657c5640a2056ab5c8546eddec9 | https://github.com/acromusashi/acromusashi-stream/blob/65b1f335d771d657c5640a2056ab5c8546eddec9/src/main/java/acromusashi/stream/entity/StreamMessageHeader.java#L121-L129 |
148,040 | acromusashi/acromusashi-stream | src/main/java/acromusashi/stream/entity/StreamMessageHeader.java | StreamMessageHeader.addAdditionalHeader | public void addAdditionalHeader(String key, String value)
{
if (this.additionalHeader == null)
{
this.additionalHeader = Maps.newLinkedHashMap();
}
this.additionalHeader.put(key, value);
} | java | public void addAdditionalHeader(String key, String value)
{
if (this.additionalHeader == null)
{
this.additionalHeader = Maps.newLinkedHashMap();
}
this.additionalHeader.put(key, value);
} | [
"public",
"void",
"addAdditionalHeader",
"(",
"String",
"key",
",",
"String",
"value",
")",
"{",
"if",
"(",
"this",
".",
"additionalHeader",
"==",
"null",
")",
"{",
"this",
".",
"additionalHeader",
"=",
"Maps",
".",
"newLinkedHashMap",
"(",
")",
";",
"}",
... | Add value to additional header.
@param key key
@param value value | [
"Add",
"value",
"to",
"additional",
"header",
"."
] | 65b1f335d771d657c5640a2056ab5c8546eddec9 | https://github.com/acromusashi/acromusashi-stream/blob/65b1f335d771d657c5640a2056ab5c8546eddec9/src/main/java/acromusashi/stream/entity/StreamMessageHeader.java#L217-L225 |
148,041 | fuinorg/objects4j | src/main/java/org/fuin/objects4j/vo/UserNameStrValidator.java | UserNameStrValidator.isValid | public static final boolean isValid(final String value) {
if (value == null) {
return true;
}
if ((value.length() < 3) || (value.length() > 20)) {
return false;
}
return PATTERN.matcher(value.toString()).matches();
} | java | public static final boolean isValid(final String value) {
if (value == null) {
return true;
}
if ((value.length() < 3) || (value.length() > 20)) {
return false;
}
return PATTERN.matcher(value.toString()).matches();
} | [
"public",
"static",
"final",
"boolean",
"isValid",
"(",
"final",
"String",
"value",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"return",
"true",
";",
"}",
"if",
"(",
"(",
"value",
".",
"length",
"(",
")",
"<",
"3",
")",
"||",
"(",
"val... | Check that a given string is a well-formed user id.
@param value
Value to check.
@return Returns <code>true</code> if it's a valid user id else <code>false</code> is returned. | [
"Check",
"that",
"a",
"given",
"string",
"is",
"a",
"well",
"-",
"formed",
"user",
"id",
"."
] | e7f278b5bae073ebb6a76053650571c718f36246 | https://github.com/fuinorg/objects4j/blob/e7f278b5bae073ebb6a76053650571c718f36246/src/main/java/org/fuin/objects4j/vo/UserNameStrValidator.java#L52-L60 |
148,042 | projectodd/wunderboss-release | core/src/main/java/org/projectodd/wunderboss/Options.java | Options.get | public Object get(Object key) {
Object val = super.get(key);
if (val == null && key instanceof Option) {
val = ((Option)key).defaultValue;
}
return val;
} | java | public Object get(Object key) {
Object val = super.get(key);
if (val == null && key instanceof Option) {
val = ((Option)key).defaultValue;
}
return val;
} | [
"public",
"Object",
"get",
"(",
"Object",
"key",
")",
"{",
"Object",
"val",
"=",
"super",
".",
"get",
"(",
"key",
")",
";",
"if",
"(",
"val",
"==",
"null",
"&&",
"key",
"instanceof",
"Option",
")",
"{",
"val",
"=",
"(",
"(",
"Option",
")",
"key",... | Looks up key in the options.
If key is an Option, its default value will be returned if the key
isn't found.
@param key
@return | [
"Looks",
"up",
"key",
"in",
"the",
"options",
"."
] | f67c68e80c5798169e3a9b2015e278239dbf005d | https://github.com/projectodd/wunderboss-release/blob/f67c68e80c5798169e3a9b2015e278239dbf005d/core/src/main/java/org/projectodd/wunderboss/Options.java#L46-L53 |
148,043 | fuinorg/objects4j | src/main/java/org/fuin/objects4j/common/Contract.java | Contract.validate | @NotNull
public static <TYPE> Set<ConstraintViolation<TYPE>> validate(@NotNull final Validator validator, @Nullable final TYPE value,
@Nullable final Class<?>... groups) {
if (value == null) {
return new HashSet<ConstraintViolation<TYPE>>();
}
return validator.validat... | java | @NotNull
public static <TYPE> Set<ConstraintViolation<TYPE>> validate(@NotNull final Validator validator, @Nullable final TYPE value,
@Nullable final Class<?>... groups) {
if (value == null) {
return new HashSet<ConstraintViolation<TYPE>>();
}
return validator.validat... | [
"@",
"NotNull",
"public",
"static",
"<",
"TYPE",
">",
"Set",
"<",
"ConstraintViolation",
"<",
"TYPE",
">",
">",
"validate",
"(",
"@",
"NotNull",
"final",
"Validator",
"validator",
",",
"@",
"Nullable",
"final",
"TYPE",
"value",
",",
"@",
"Nullable",
"final... | Validates the given object.
@param validator
Validator to use.
@param value
Value to validate.
@param groups
Group or list of groups targeted for validation (defaults to {@link Default})
@return List of constraint violations.
@param <TYPE>
Type of the validated object. | [
"Validates",
"the",
"given",
"object",
"."
] | e7f278b5bae073ebb6a76053650571c718f36246 | https://github.com/fuinorg/objects4j/blob/e7f278b5bae073ebb6a76053650571c718f36246/src/main/java/org/fuin/objects4j/common/Contract.java#L261-L268 |
148,044 | fuinorg/objects4j | src/main/java/org/fuin/objects4j/common/Contract.java | Contract.validate | @NotNull
public static <TYPE> Set<ConstraintViolation<TYPE>> validate(@Nullable final TYPE value, @Nullable final Class<?>... groups) {
return validate(getValidator(), value, groups);
} | java | @NotNull
public static <TYPE> Set<ConstraintViolation<TYPE>> validate(@Nullable final TYPE value, @Nullable final Class<?>... groups) {
return validate(getValidator(), value, groups);
} | [
"@",
"NotNull",
"public",
"static",
"<",
"TYPE",
">",
"Set",
"<",
"ConstraintViolation",
"<",
"TYPE",
">",
">",
"validate",
"(",
"@",
"Nullable",
"final",
"TYPE",
"value",
",",
"@",
"Nullable",
"final",
"Class",
"<",
"?",
">",
"...",
"groups",
")",
"{"... | Validates the given object using a default validator.
@param value
Value to validate.
@param groups
Group or list of groups targeted for validation (defaults to {@link Default})
@return List of constraint violations.
@param <TYPE>
Type of the validated object. | [
"Validates",
"the",
"given",
"object",
"using",
"a",
"default",
"validator",
"."
] | e7f278b5bae073ebb6a76053650571c718f36246 | https://github.com/fuinorg/objects4j/blob/e7f278b5bae073ebb6a76053650571c718f36246/src/main/java/org/fuin/objects4j/common/Contract.java#L283-L286 |
148,045 | lisicnu/droidUtil | src/main/java/com/github/lisicnu/libDroid/util/HardwareUtils.java | HardwareUtils.getMacAddr | public static String getMacAddr(Context context) {
String mac = "";
try {
WifiManager wifiManager = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);
WifiInfo wifi = wifiManager.getConnectionInfo();
mac = wifi.getMacAddress();
} catch (Exception e)... | java | public static String getMacAddr(Context context) {
String mac = "";
try {
WifiManager wifiManager = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);
WifiInfo wifi = wifiManager.getConnectionInfo();
mac = wifi.getMacAddress();
} catch (Exception e)... | [
"public",
"static",
"String",
"getMacAddr",
"(",
"Context",
"context",
")",
"{",
"String",
"mac",
"=",
"\"\"",
";",
"try",
"{",
"WifiManager",
"wifiManager",
"=",
"(",
"WifiManager",
")",
"context",
".",
"getSystemService",
"(",
"Context",
".",
"WIFI_SERVICE",... | get mac address.
@param context
@return if error, will return {@link #MAC_EMPTY} | [
"get",
"mac",
"address",
"."
] | e4d6cf3e3f60e5efb5a75672607ded94d1725519 | https://github.com/lisicnu/droidUtil/blob/e4d6cf3e3f60e5efb5a75672607ded94d1725519/src/main/java/com/github/lisicnu/libDroid/util/HardwareUtils.java#L97-L115 |
148,046 | lisicnu/droidUtil | src/main/java/com/github/lisicnu/libDroid/util/HardwareUtils.java | HardwareUtils.getStatusBarHeight | public static int getStatusBarHeight(Context context) {
if (context == null) return 0;
Class<?> c = null;
Object obj = null;
int x = 0, statusBarHeight = 0;
try {
c = Class.forName("com.android.internal.R$dimen");
obj = c.newInstance();
Field f... | java | public static int getStatusBarHeight(Context context) {
if (context == null) return 0;
Class<?> c = null;
Object obj = null;
int x = 0, statusBarHeight = 0;
try {
c = Class.forName("com.android.internal.R$dimen");
obj = c.newInstance();
Field f... | [
"public",
"static",
"int",
"getStatusBarHeight",
"(",
"Context",
"context",
")",
"{",
"if",
"(",
"context",
"==",
"null",
")",
"return",
"0",
";",
"Class",
"<",
"?",
">",
"c",
"=",
"null",
";",
"Object",
"obj",
"=",
"null",
";",
"int",
"x",
"=",
"0... | get status bar height in px.
@param context
@return | [
"get",
"status",
"bar",
"height",
"in",
"px",
"."
] | e4d6cf3e3f60e5efb5a75672607ded94d1725519 | https://github.com/lisicnu/droidUtil/blob/e4d6cf3e3f60e5efb5a75672607ded94d1725519/src/main/java/com/github/lisicnu/libDroid/util/HardwareUtils.java#L128-L143 |
148,047 | acromusashi/acromusashi-stream | src/main/java/acromusashi/stream/hook/AmLogServerEndPoint.java | AmLogServerEndPoint.onOpen | @OnOpen
public void onOpen(Session session)
{
logger.info("WebSocket connected. : SessionId={}", session.getId());
AmLogServerAdapter.getInstance().onOpen(session);
} | java | @OnOpen
public void onOpen(Session session)
{
logger.info("WebSocket connected. : SessionId={}", session.getId());
AmLogServerAdapter.getInstance().onOpen(session);
} | [
"@",
"OnOpen",
"public",
"void",
"onOpen",
"(",
"Session",
"session",
")",
"{",
"logger",
".",
"info",
"(",
"\"WebSocket connected. : SessionId={}\"",
",",
"session",
".",
"getId",
"(",
")",
")",
";",
"AmLogServerAdapter",
".",
"getInstance",
"(",
")",
".",
... | Websocket connection open.
@param session session | [
"Websocket",
"connection",
"open",
"."
] | 65b1f335d771d657c5640a2056ab5c8546eddec9 | https://github.com/acromusashi/acromusashi-stream/blob/65b1f335d771d657c5640a2056ab5c8546eddec9/src/main/java/acromusashi/stream/hook/AmLogServerEndPoint.java#L46-L51 |
148,048 | acromusashi/acromusashi-stream | src/main/java/acromusashi/stream/hook/AmLogServerEndPoint.java | AmLogServerEndPoint.onClose | @OnClose
public void onClose(Session session, CloseReason closeReason)
{
logger.info("WebSocket closed. : SessionId={}, Reason={}", session.getId(),
closeReason.toString());
AmLogServerAdapter.getInstance().onClose(session);
} | java | @OnClose
public void onClose(Session session, CloseReason closeReason)
{
logger.info("WebSocket closed. : SessionId={}, Reason={}", session.getId(),
closeReason.toString());
AmLogServerAdapter.getInstance().onClose(session);
} | [
"@",
"OnClose",
"public",
"void",
"onClose",
"(",
"Session",
"session",
",",
"CloseReason",
"closeReason",
")",
"{",
"logger",
".",
"info",
"(",
"\"WebSocket closed. : SessionId={}, Reason={}\"",
",",
"session",
".",
"getId",
"(",
")",
",",
"closeReason",
".",
"... | Websocket connection close.
@param session session
@param closeReason closeReason | [
"Websocket",
"connection",
"close",
"."
] | 65b1f335d771d657c5640a2056ab5c8546eddec9 | https://github.com/acromusashi/acromusashi-stream/blob/65b1f335d771d657c5640a2056ab5c8546eddec9/src/main/java/acromusashi/stream/hook/AmLogServerEndPoint.java#L59-L65 |
148,049 | fuinorg/objects4j | src/main/java/org/fuin/objects4j/ui/AnnotationAnalyzer.java | AnnotationAnalyzer.createClassInfo | public final ClassTextInfo createClassInfo(@NotNull final Class<?> clasz, @NotNull final Locale locale,
@NotNull final Class<? extends Annotation> annotationClasz) {
Contract.requireArgNotNull("clasz", clasz);
Contract.requireArgNotNull("locale", locale);
Contract.requireArgNot... | java | public final ClassTextInfo createClassInfo(@NotNull final Class<?> clasz, @NotNull final Locale locale,
@NotNull final Class<? extends Annotation> annotationClasz) {
Contract.requireArgNotNull("clasz", clasz);
Contract.requireArgNotNull("locale", locale);
Contract.requireArgNot... | [
"public",
"final",
"ClassTextInfo",
"createClassInfo",
"(",
"@",
"NotNull",
"final",
"Class",
"<",
"?",
">",
"clasz",
",",
"@",
"NotNull",
"final",
"Locale",
"locale",
",",
"@",
"NotNull",
"final",
"Class",
"<",
"?",
"extends",
"Annotation",
">",
"annotation... | Returns the text information for a given class.
@param clasz
Class.
@param locale
Locale to use.
@param annotationClasz
Type of annotation to find.
@return Label information - Never <code>null</code>. | [
"Returns",
"the",
"text",
"information",
"for",
"a",
"given",
"class",
"."
] | e7f278b5bae073ebb6a76053650571c718f36246 | https://github.com/fuinorg/objects4j/blob/e7f278b5bae073ebb6a76053650571c718f36246/src/main/java/org/fuin/objects4j/ui/AnnotationAnalyzer.java#L69-L92 |
148,050 | fuinorg/objects4j | src/main/java/org/fuin/objects4j/ui/AnnotationAnalyzer.java | AnnotationAnalyzer.createFieldInfo | public final FieldTextInfo createFieldInfo(@NotNull final Field field, @NotNull final Locale locale,
@NotNull final Class<? extends Annotation> annotationClasz) {
Contract.requireArgNotNull("field", field);
Contract.requireArgNotNull("locale", locale);
Contract.requireArgNotNul... | java | public final FieldTextInfo createFieldInfo(@NotNull final Field field, @NotNull final Locale locale,
@NotNull final Class<? extends Annotation> annotationClasz) {
Contract.requireArgNotNull("field", field);
Contract.requireArgNotNull("locale", locale);
Contract.requireArgNotNul... | [
"public",
"final",
"FieldTextInfo",
"createFieldInfo",
"(",
"@",
"NotNull",
"final",
"Field",
"field",
",",
"@",
"NotNull",
"final",
"Locale",
"locale",
",",
"@",
"NotNull",
"final",
"Class",
"<",
"?",
"extends",
"Annotation",
">",
"annotationClasz",
")",
"{",... | Returns the text information for a given field of a class.
@param field
Field to inspect.
@param locale
Locale to use.
@param annotationClasz
Type of annotation to find.
@return Label information - May be <code>null</code> in case the annotation was not found. | [
"Returns",
"the",
"text",
"information",
"for",
"a",
"given",
"field",
"of",
"a",
"class",
"."
] | e7f278b5bae073ebb6a76053650571c718f36246 | https://github.com/fuinorg/objects4j/blob/e7f278b5bae073ebb6a76053650571c718f36246/src/main/java/org/fuin/objects4j/ui/AnnotationAnalyzer.java#L152-L172 |
148,051 | fuinorg/objects4j | src/main/java/org/fuin/objects4j/ui/AnnotationAnalyzer.java | AnnotationAnalyzer.invoke | @SuppressWarnings("unchecked")
private static <T> T invoke(final Object obj, final String methodName) {
return (T) invoke(obj, methodName, null, null);
} | java | @SuppressWarnings("unchecked")
private static <T> T invoke(final Object obj, final String methodName) {
return (T) invoke(obj, methodName, null, null);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"private",
"static",
"<",
"T",
">",
"T",
"invoke",
"(",
"final",
"Object",
"obj",
",",
"final",
"String",
"methodName",
")",
"{",
"return",
"(",
"T",
")",
"invoke",
"(",
"obj",
",",
"methodName",
",",
... | Calls a method with no arguments using reflection and maps all errors into a runtime exception.
@param obj
The object the underlying method is invoked from - Cannot be <code>null</code>.
@param methodName
Name of the Method - Cannot be <code>null</code>.
@return The result of dispatching the method represented by thi... | [
"Calls",
"a",
"method",
"with",
"no",
"arguments",
"using",
"reflection",
"and",
"maps",
"all",
"errors",
"into",
"a",
"runtime",
"exception",
"."
] | e7f278b5bae073ebb6a76053650571c718f36246 | https://github.com/fuinorg/objects4j/blob/e7f278b5bae073ebb6a76053650571c718f36246/src/main/java/org/fuin/objects4j/ui/AnnotationAnalyzer.java#L275-L278 |
148,052 | fuinorg/objects4j | src/main/java/org/fuin/objects4j/ui/AnnotationAnalyzer.java | AnnotationAnalyzer.invoke | private static Object invoke(@NotNull final Object obj, @NotEmpty final String methodName, @Nullable final Class<?>[] argTypes,
@Nullable final Object[] args) {
Contract.requireArgNotNull("obj", obj);
Contract.requireArgNotNull("methodName", methodName);
final Class<?>[] argT... | java | private static Object invoke(@NotNull final Object obj, @NotEmpty final String methodName, @Nullable final Class<?>[] argTypes,
@Nullable final Object[] args) {
Contract.requireArgNotNull("obj", obj);
Contract.requireArgNotNull("methodName", methodName);
final Class<?>[] argT... | [
"private",
"static",
"Object",
"invoke",
"(",
"@",
"NotNull",
"final",
"Object",
"obj",
",",
"@",
"NotEmpty",
"final",
"String",
"methodName",
",",
"@",
"Nullable",
"final",
"Class",
"<",
"?",
">",
"[",
"]",
"argTypes",
",",
"@",
"Nullable",
"final",
"Ob... | Calls a method with reflection and maps all errors into a runtime exception.
@param obj
The object the underlying method is invoked from - Cannot be <code>null</code>.
@param methodName
Name of the Method - Cannot be <code>null</code> or empty.
@param argTypes
The list of parameters - May be <code>null</code>.
@param ... | [
"Calls",
"a",
"method",
"with",
"reflection",
"and",
"maps",
"all",
"errors",
"into",
"a",
"runtime",
"exception",
"."
] | e7f278b5bae073ebb6a76053650571c718f36246 | https://github.com/fuinorg/objects4j/blob/e7f278b5bae073ebb6a76053650571c718f36246/src/main/java/org/fuin/objects4j/ui/AnnotationAnalyzer.java#L294-L343 |
148,053 | fuinorg/objects4j | src/main/java/org/fuin/objects4j/vo/DayOpeningHours.java | DayOpeningHours.diff | public final List<Change> diff(final DayOpeningHours toOther) {
Contract.requireArgNotNull("toOther", toOther);
if (dayOfTheWeek != toOther.dayOfTheWeek) {
throw new ConstraintViolationException(
"Expected same day (" + dayOfTheWeek + ") for argument 'toOther', but was: "... | java | public final List<Change> diff(final DayOpeningHours toOther) {
Contract.requireArgNotNull("toOther", toOther);
if (dayOfTheWeek != toOther.dayOfTheWeek) {
throw new ConstraintViolationException(
"Expected same day (" + dayOfTheWeek + ") for argument 'toOther', but was: "... | [
"public",
"final",
"List",
"<",
"Change",
">",
"diff",
"(",
"final",
"DayOpeningHours",
"toOther",
")",
"{",
"Contract",
".",
"requireArgNotNull",
"(",
"\"toOther\"",
",",
"toOther",
")",
";",
"if",
"(",
"dayOfTheWeek",
"!=",
"toOther",
".",
"dayOfTheWeek",
... | Returns the difference when changing this opening hours to the other one. The day of the week must be equal for both compared
instances.
@param toOther
Opening hours to compare with.
@return List of changes or an empty list if both are equal. | [
"Returns",
"the",
"difference",
"when",
"changing",
"this",
"opening",
"hours",
"to",
"the",
"other",
"one",
".",
"The",
"day",
"of",
"the",
"week",
"must",
"be",
"equal",
"for",
"both",
"compared",
"instances",
"."
] | e7f278b5bae073ebb6a76053650571c718f36246 | https://github.com/fuinorg/objects4j/blob/e7f278b5bae073ebb6a76053650571c718f36246/src/main/java/org/fuin/objects4j/vo/DayOpeningHours.java#L206-L252 |
148,054 | fuinorg/objects4j | src/main/java/org/fuin/objects4j/vo/DayOpeningHours.java | DayOpeningHours.asRemovedChanges | public List<Change> asRemovedChanges() {
final List<Change> changes = new ArrayList<>();
for (final HourRange hr : hourRanges) {
changes.add(new Change(ChangeType.REMOVED, dayOfTheWeek, hr));
}
return changes;
} | java | public List<Change> asRemovedChanges() {
final List<Change> changes = new ArrayList<>();
for (final HourRange hr : hourRanges) {
changes.add(new Change(ChangeType.REMOVED, dayOfTheWeek, hr));
}
return changes;
} | [
"public",
"List",
"<",
"Change",
">",
"asRemovedChanges",
"(",
")",
"{",
"final",
"List",
"<",
"Change",
">",
"changes",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
"final",
"HourRange",
"hr",
":",
"hourRanges",
")",
"{",
"changes",
".",
... | Returns all hour ranges of this day as if they were removed.
@return Removed day changes. | [
"Returns",
"all",
"hour",
"ranges",
"of",
"this",
"day",
"as",
"if",
"they",
"were",
"removed",
"."
] | e7f278b5bae073ebb6a76053650571c718f36246 | https://github.com/fuinorg/objects4j/blob/e7f278b5bae073ebb6a76053650571c718f36246/src/main/java/org/fuin/objects4j/vo/DayOpeningHours.java#L351-L357 |
148,055 | fuinorg/objects4j | src/main/java/org/fuin/objects4j/vo/DayOpeningHours.java | DayOpeningHours.asAddedChanges | public List<Change> asAddedChanges() {
final List<Change> changes = new ArrayList<>();
for (final HourRange hr : hourRanges) {
changes.add(new Change(ChangeType.ADDED, dayOfTheWeek, hr));
}
return changes;
} | java | public List<Change> asAddedChanges() {
final List<Change> changes = new ArrayList<>();
for (final HourRange hr : hourRanges) {
changes.add(new Change(ChangeType.ADDED, dayOfTheWeek, hr));
}
return changes;
} | [
"public",
"List",
"<",
"Change",
">",
"asAddedChanges",
"(",
")",
"{",
"final",
"List",
"<",
"Change",
">",
"changes",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
"final",
"HourRange",
"hr",
":",
"hourRanges",
")",
"{",
"changes",
".",
... | Returns all hour ranges of this day as if they were added.
@return Added day changes. | [
"Returns",
"all",
"hour",
"ranges",
"of",
"this",
"day",
"as",
"if",
"they",
"were",
"added",
"."
] | e7f278b5bae073ebb6a76053650571c718f36246 | https://github.com/fuinorg/objects4j/blob/e7f278b5bae073ebb6a76053650571c718f36246/src/main/java/org/fuin/objects4j/vo/DayOpeningHours.java#L364-L370 |
148,056 | fuinorg/objects4j | src/main/java/org/fuin/objects4j/vo/DayOpeningHours.java | DayOpeningHours.isValid | public static boolean isValid(@Nullable final String dayOpeningHours) {
if (dayOpeningHours == null) {
return true;
}
final int p = dayOpeningHours.indexOf(' ');
if (p < 0) {
return false;
}
final String dayOfTheWeekStr = dayOpeningHours.substring(... | java | public static boolean isValid(@Nullable final String dayOpeningHours) {
if (dayOpeningHours == null) {
return true;
}
final int p = dayOpeningHours.indexOf(' ');
if (p < 0) {
return false;
}
final String dayOfTheWeekStr = dayOpeningHours.substring(... | [
"public",
"static",
"boolean",
"isValid",
"(",
"@",
"Nullable",
"final",
"String",
"dayOpeningHours",
")",
"{",
"if",
"(",
"dayOpeningHours",
"==",
"null",
")",
"{",
"return",
"true",
";",
"}",
"final",
"int",
"p",
"=",
"dayOpeningHours",
".",
"indexOf",
"... | Verifies if the string can be converted into an instance of this class.
@param dayOpeningHours
String to test.
@return {@literal true} if the string is valid, else {@literal false}. | [
"Verifies",
"if",
"the",
"string",
"can",
"be",
"converted",
"into",
"an",
"instance",
"of",
"this",
"class",
"."
] | e7f278b5bae073ebb6a76053650571c718f36246 | https://github.com/fuinorg/objects4j/blob/e7f278b5bae073ebb6a76053650571c718f36246/src/main/java/org/fuin/objects4j/vo/DayOpeningHours.java#L436-L447 |
148,057 | Lucas3oo/jicunit | src/jicunit-framework/src/main/java/org/jicunit/framework/internal/JicUnitServletClient.java | JicUnitServletClient.runAtServer | public Document runAtServer(String containerUrl, String testClassName, String testDisplayName) {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder;
try {
String url = containerUrl
+ String.format("?%s=%s&%s=%s", TEST_CLASS_NAME_PARAM, testClassNam... | java | public Document runAtServer(String containerUrl, String testClassName, String testDisplayName) {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder;
try {
String url = containerUrl
+ String.format("?%s=%s&%s=%s", TEST_CLASS_NAME_PARAM, testClassNam... | [
"public",
"Document",
"runAtServer",
"(",
"String",
"containerUrl",
",",
"String",
"testClassName",
",",
"String",
"testDisplayName",
")",
"{",
"DocumentBuilderFactory",
"factory",
"=",
"DocumentBuilderFactory",
".",
"newInstance",
"(",
")",
";",
"DocumentBuilder",
"b... | Execute the test at the server
@param containerUrl
@param testClassName
@param testDisplayName
@return | [
"Execute",
"the",
"test",
"at",
"the",
"server"
] | 1ed41891ccf8e5c6068c6b544d214280bb93945b | https://github.com/Lucas3oo/jicunit/blob/1ed41891ccf8e5c6068c6b544d214280bb93945b/src/jicunit-framework/src/main/java/org/jicunit/framework/internal/JicUnitServletClient.java#L44-L61 |
148,058 | Lucas3oo/jicunit | src/jicunit-framework/src/main/java/org/jicunit/framework/internal/JicUnitServletClient.java | JicUnitServletClient.processResults | public void processResults(Document document) throws Throwable {
Element root = document.getDocumentElement();
root.normalize();
// top element should testcase which has attributes for the outcome of the test
// e.g <testcase classname="TheClass" name="theName(TheClass)" status="Error"><exception m... | java | public void processResults(Document document) throws Throwable {
Element root = document.getDocumentElement();
root.normalize();
// top element should testcase which has attributes for the outcome of the test
// e.g <testcase classname="TheClass" name="theName(TheClass)" status="Error"><exception m... | [
"public",
"void",
"processResults",
"(",
"Document",
"document",
")",
"throws",
"Throwable",
"{",
"Element",
"root",
"=",
"document",
".",
"getDocumentElement",
"(",
")",
";",
"root",
".",
"normalize",
"(",
")",
";",
"// top element should testcase which has attribu... | Processes the actual XML result and generate exceptions in case there was
an issue on the server side.
@param document
@throws Throwable | [
"Processes",
"the",
"actual",
"XML",
"result",
"and",
"generate",
"exceptions",
"in",
"case",
"there",
"was",
"an",
"issue",
"on",
"the",
"server",
"side",
"."
] | 1ed41891ccf8e5c6068c6b544d214280bb93945b | https://github.com/Lucas3oo/jicunit/blob/1ed41891ccf8e5c6068c6b544d214280bb93945b/src/jicunit-framework/src/main/java/org/jicunit/framework/internal/JicUnitServletClient.java#L70-L82 |
148,059 | globocom/GloboDNS-Client | src/main/java/com/globo/globodns/client/AbstractAPI.java | AbstractAPI.buildHttpRequestFactory | protected HttpRequestFactory buildHttpRequestFactory() {
HttpRequestFactory request = this.getGloboDns().getHttpTransport().createRequestFactory(new HttpRequestInitializer() {
@Override
public void initialize(HttpRequest request) throws IOException {
request.setNumberOfRetries(AbstractAPI.this.globoDns.getN... | java | protected HttpRequestFactory buildHttpRequestFactory() {
HttpRequestFactory request = this.getGloboDns().getHttpTransport().createRequestFactory(new HttpRequestInitializer() {
@Override
public void initialize(HttpRequest request) throws IOException {
request.setNumberOfRetries(AbstractAPI.this.globoDns.getN... | [
"protected",
"HttpRequestFactory",
"buildHttpRequestFactory",
"(",
")",
"{",
"HttpRequestFactory",
"request",
"=",
"this",
".",
"getGloboDns",
"(",
")",
".",
"getHttpTransport",
"(",
")",
".",
"createRequestFactory",
"(",
"new",
"HttpRequestInitializer",
"(",
")",
"... | Customize HttpRequestFactory with authentication and error handling.
@return new instance of HttpRequestFactory | [
"Customize",
"HttpRequestFactory",
"with",
"authentication",
"and",
"error",
"handling",
"."
] | 4f9b742bdc598c41299fcf92e8443ce419709618 | https://github.com/globocom/GloboDNS-Client/blob/4f9b742bdc598c41299fcf92e8443ce419709618/src/main/java/com/globo/globodns/client/AbstractAPI.java#L80-L119 |
148,060 | DDTH/ddth-dao | ddth-dao-core/src/main/java/com/github/ddth/dao/nosql/cassandra/CassandraKdWideColumnStorage.java | CassandraKdWideColumnStorage.bytesMapToDocument | protected Map<String, Object> bytesMapToDocument(Map<String, byte[]> data) {
if (data == null || data.size() == 0) {
return null;
}
Map<String, Object> doc = new HashMap<>();
data.forEach((k, v) -> {
Object value = SerializationUtils.fromByteArrayFst(v);
... | java | protected Map<String, Object> bytesMapToDocument(Map<String, byte[]> data) {
if (data == null || data.size() == 0) {
return null;
}
Map<String, Object> doc = new HashMap<>();
data.forEach((k, v) -> {
Object value = SerializationUtils.fromByteArrayFst(v);
... | [
"protected",
"Map",
"<",
"String",
",",
"Object",
">",
"bytesMapToDocument",
"(",
"Map",
"<",
"String",
",",
"byte",
"[",
"]",
">",
"data",
")",
"{",
"if",
"(",
"data",
"==",
"null",
"||",
"data",
".",
"size",
"(",
")",
"==",
"0",
")",
"{",
"retu... | De-serialize byte-array map to "document".
@param data
@return | [
"De",
"-",
"serialize",
"byte",
"-",
"array",
"map",
"to",
"document",
"."
] | 8d059ddf641a1629aa53851f9d1b41abf175a180 | https://github.com/DDTH/ddth-dao/blob/8d059ddf641a1629aa53851f9d1b41abf175a180/ddth-dao-core/src/main/java/com/github/ddth/dao/nosql/cassandra/CassandraKdWideColumnStorage.java#L342-L354 |
148,061 | DDTH/ddth-dao | ddth-dao-core/src/main/java/com/github/ddth/dao/nosql/cassandra/CassandraKdWideColumnStorage.java | CassandraKdWideColumnStorage.documentToBytesMap | @SuppressWarnings("unchecked")
protected Map<String, byte[]> documentToBytesMap(Map<String, Object> doc) {
if (doc == null || doc.size() == 0) {
return Collections.EMPTY_MAP;
}
Map<String, byte[]> data = new HashMap<>();
doc.forEach((k, v) -> {
byte[] value = ... | java | @SuppressWarnings("unchecked")
protected Map<String, byte[]> documentToBytesMap(Map<String, Object> doc) {
if (doc == null || doc.size() == 0) {
return Collections.EMPTY_MAP;
}
Map<String, byte[]> data = new HashMap<>();
doc.forEach((k, v) -> {
byte[] value = ... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"protected",
"Map",
"<",
"String",
",",
"byte",
"[",
"]",
">",
"documentToBytesMap",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"doc",
")",
"{",
"if",
"(",
"doc",
"==",
"null",
"||",
"doc",
".",
... | Sereialize "document" to byte-array map.
@param doc
@return | [
"Sereialize",
"document",
"to",
"byte",
"-",
"array",
"map",
"."
] | 8d059ddf641a1629aa53851f9d1b41abf175a180 | https://github.com/DDTH/ddth-dao/blob/8d059ddf641a1629aa53851f9d1b41abf175a180/ddth-dao-core/src/main/java/com/github/ddth/dao/nosql/cassandra/CassandraKdWideColumnStorage.java#L362-L375 |
148,062 | fuinorg/objects4j | src/main/java/org/fuin/objects4j/ui/FontSize.java | FontSize.toPixel | public final int toPixel() {
if (unit == FontSizeUnit.PIXEL) {
return Math.round(size);
}
if (unit == FontSizeUnit.EM) {
return Math.round(16 * size);
}
if (unit == FontSizeUnit.PERCENT) {
return Math.round(size / 100 * 16);
}
... | java | public final int toPixel() {
if (unit == FontSizeUnit.PIXEL) {
return Math.round(size);
}
if (unit == FontSizeUnit.EM) {
return Math.round(16 * size);
}
if (unit == FontSizeUnit.PERCENT) {
return Math.round(size / 100 * 16);
}
... | [
"public",
"final",
"int",
"toPixel",
"(",
")",
"{",
"if",
"(",
"unit",
"==",
"FontSizeUnit",
".",
"PIXEL",
")",
"{",
"return",
"Math",
".",
"round",
"(",
"size",
")",
";",
"}",
"if",
"(",
"unit",
"==",
"FontSizeUnit",
".",
"EM",
")",
"{",
"return",... | Returns the font size expressed in pixels.
@return Pixels. | [
"Returns",
"the",
"font",
"size",
"expressed",
"in",
"pixels",
"."
] | e7f278b5bae073ebb6a76053650571c718f36246 | https://github.com/fuinorg/objects4j/blob/e7f278b5bae073ebb6a76053650571c718f36246/src/main/java/org/fuin/objects4j/ui/FontSize.java#L79-L93 |
148,063 | fuinorg/objects4j | src/main/java/org/fuin/objects4j/ui/FontSize.java | FontSize.toPoint | public final float toPoint() {
if (unit == FontSizeUnit.PIXEL) {
return (size / 4 * 3);
}
if (unit == FontSizeUnit.EM) {
return (size * 12);
}
if (unit == FontSizeUnit.PERCENT) {
return (size / 100 * 12);
}
if (unit ==... | java | public final float toPoint() {
if (unit == FontSizeUnit.PIXEL) {
return (size / 4 * 3);
}
if (unit == FontSizeUnit.EM) {
return (size * 12);
}
if (unit == FontSizeUnit.PERCENT) {
return (size / 100 * 12);
}
if (unit ==... | [
"public",
"final",
"float",
"toPoint",
"(",
")",
"{",
"if",
"(",
"unit",
"==",
"FontSizeUnit",
".",
"PIXEL",
")",
"{",
"return",
"(",
"size",
"/",
"4",
"*",
"3",
")",
";",
"}",
"if",
"(",
"unit",
"==",
"FontSizeUnit",
".",
"EM",
")",
"{",
"return... | Returns the font size expressed in points.
@return Points. | [
"Returns",
"the",
"font",
"size",
"expressed",
"in",
"points",
"."
] | e7f278b5bae073ebb6a76053650571c718f36246 | https://github.com/fuinorg/objects4j/blob/e7f278b5bae073ebb6a76053650571c718f36246/src/main/java/org/fuin/objects4j/ui/FontSize.java#L100-L114 |
148,064 | Lucas3oo/jicunit | src/jicunit-framework/src/main/java/org/jicunit/framework/internal/ParameterizedProxyRunner.java | ParameterizedProxyRunner.getChildren | @Override
protected List<Runner> getChildren() {
// one runner for each parameter
List<Runner> runners = super.getChildren();
List<Runner> proxyRunners = new ArrayList<>(runners.size());
for (Runner runner : runners) {
// if the next line fails then the internal of Parameterized.class has been u... | java | @Override
protected List<Runner> getChildren() {
// one runner for each parameter
List<Runner> runners = super.getChildren();
List<Runner> proxyRunners = new ArrayList<>(runners.size());
for (Runner runner : runners) {
// if the next line fails then the internal of Parameterized.class has been u... | [
"@",
"Override",
"protected",
"List",
"<",
"Runner",
">",
"getChildren",
"(",
")",
"{",
"// one runner for each parameter",
"List",
"<",
"Runner",
">",
"runners",
"=",
"super",
".",
"getChildren",
"(",
")",
";",
"List",
"<",
"Runner",
">",
"proxyRunners",
"=... | replace the runners with slightly modified BasicProxyRunner | [
"replace",
"the",
"runners",
"with",
"slightly",
"modified",
"BasicProxyRunner"
] | 1ed41891ccf8e5c6068c6b544d214280bb93945b | https://github.com/Lucas3oo/jicunit/blob/1ed41891ccf8e5c6068c6b544d214280bb93945b/src/jicunit-framework/src/main/java/org/jicunit/framework/internal/ParameterizedProxyRunner.java#L32-L50 |
148,065 | DDTH/ddth-dao | ddth-dao-core/src/main/java/com/github/ddth/dao/utils/DbcHelper.java | DbcHelper.registerJdbcDataSource | public static boolean registerJdbcDataSource(String name, DataSource dataSource) {
return jdbcDataSources.putIfAbsent(name, dataSource) == null;
} | java | public static boolean registerJdbcDataSource(String name, DataSource dataSource) {
return jdbcDataSources.putIfAbsent(name, dataSource) == null;
} | [
"public",
"static",
"boolean",
"registerJdbcDataSource",
"(",
"String",
"name",
",",
"DataSource",
"dataSource",
")",
"{",
"return",
"jdbcDataSources",
".",
"putIfAbsent",
"(",
"name",
",",
"dataSource",
")",
"==",
"null",
";",
"}"
] | Registers a named JDBC datasource.
@param name
@param dataSource
@return | [
"Registers",
"a",
"named",
"JDBC",
"datasource",
"."
] | 8d059ddf641a1629aa53851f9d1b41abf175a180 | https://github.com/DDTH/ddth-dao/blob/8d059ddf641a1629aa53851f9d1b41abf175a180/ddth-dao-core/src/main/java/com/github/ddth/dao/utils/DbcHelper.java#L39-L41 |
148,066 | DDTH/ddth-dao | ddth-dao-core/src/main/java/com/github/ddth/dao/utils/DbcHelper.java | DbcHelper.startTransaction | public static boolean startTransaction(Connection conn) throws SQLException {
if (conn == null) {
return false;
}
String dsName = openConnDsName.get().get(conn);
OpenConnStats connStats = dsName != null ? openConnStats.get().get(dsName) : null;
if (connStats != null &... | java | public static boolean startTransaction(Connection conn) throws SQLException {
if (conn == null) {
return false;
}
String dsName = openConnDsName.get().get(conn);
OpenConnStats connStats = dsName != null ? openConnStats.get().get(dsName) : null;
if (connStats != null &... | [
"public",
"static",
"boolean",
"startTransaction",
"(",
"Connection",
"conn",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"conn",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"String",
"dsName",
"=",
"openConnDsName",
".",
"get",
"(",
")",
".",
... | Starts a transaction. Has no effect if already in a transaction.
@param conn
@throws SQLException
@since 0.4.0 | [
"Starts",
"a",
"transaction",
".",
"Has",
"no",
"effect",
"if",
"already",
"in",
"a",
"transaction",
"."
] | 8d059ddf641a1629aa53851f9d1b41abf175a180 | https://github.com/DDTH/ddth-dao/blob/8d059ddf641a1629aa53851f9d1b41abf175a180/ddth-dao-core/src/main/java/com/github/ddth/dao/utils/DbcHelper.java#L160-L172 |
148,067 | DDTH/ddth-dao | ddth-dao-core/src/main/java/com/github/ddth/dao/utils/DbcHelper.java | DbcHelper.detectDbVendor | public static DatabaseVendor detectDbVendor(Connection conn) throws SQLException {
DatabaseMetaData dmd = conn.getMetaData();
String dpn = dmd.getDatabaseProductName();
if (StringUtils.equalsAnyIgnoreCase("MySQL", dpn)) {
return DatabaseVendor.MYSQL;
}
if (StringUtils... | java | public static DatabaseVendor detectDbVendor(Connection conn) throws SQLException {
DatabaseMetaData dmd = conn.getMetaData();
String dpn = dmd.getDatabaseProductName();
if (StringUtils.equalsAnyIgnoreCase("MySQL", dpn)) {
return DatabaseVendor.MYSQL;
}
if (StringUtils... | [
"public",
"static",
"DatabaseVendor",
"detectDbVendor",
"(",
"Connection",
"conn",
")",
"throws",
"SQLException",
"{",
"DatabaseMetaData",
"dmd",
"=",
"conn",
".",
"getMetaData",
"(",
")",
";",
"String",
"dpn",
"=",
"dmd",
".",
"getDatabaseProductName",
"(",
")"... | Detect database vender info.
@param conn
@return
@throws SQLException | [
"Detect",
"database",
"vender",
"info",
"."
] | 8d059ddf641a1629aa53851f9d1b41abf175a180 | https://github.com/DDTH/ddth-dao/blob/8d059ddf641a1629aa53851f9d1b41abf175a180/ddth-dao-core/src/main/java/com/github/ddth/dao/utils/DbcHelper.java#L298-L311 |
148,068 | sematext/ActionGenerator | ag-player-solr/src/main/java/com/sematext/ag/solr/util/XMLUtils.java | XMLUtils.getSolrAddDocument | public static String getSolrAddDocument(Map<String, String> values) {
StringBuilder builder = new StringBuilder();
builder.append("<add><doc>");
for (Map.Entry<String, String> pair : values.entrySet()) {
XMLUtils.addSolrField(builder, pair);
}
builder.append("</doc></add>");
return builder... | java | public static String getSolrAddDocument(Map<String, String> values) {
StringBuilder builder = new StringBuilder();
builder.append("<add><doc>");
for (Map.Entry<String, String> pair : values.entrySet()) {
XMLUtils.addSolrField(builder, pair);
}
builder.append("</doc></add>");
return builder... | [
"public",
"static",
"String",
"getSolrAddDocument",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"values",
")",
"{",
"StringBuilder",
"builder",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"builder",
".",
"append",
"(",
"\"<add><doc>\"",
")",
";",
"for",
... | Returns Apache Solr add command.
@param values
values to include
@return XML as String | [
"Returns",
"Apache",
"Solr",
"add",
"command",
"."
] | 10f4a3e680f20d7d151f5d40e6758aeb072d474f | https://github.com/sematext/ActionGenerator/blob/10f4a3e680f20d7d151f5d40e6758aeb072d474f/ag-player-solr/src/main/java/com/sematext/ag/solr/util/XMLUtils.java#L37-L45 |
148,069 | Lucas3oo/jicunit | src/jicunit-framework/src/main/java/org/jicunit/framework/internal/ExceptionUtil.java | ExceptionUtil.filterdStackTrace | public static String filterdStackTrace(String stackTrace) {
boolean skip = false;
StringBuilder filteredStackTrace = new StringBuilder();
// read line by line until the reflective call to the test method is found
String[] segments = stackTrace.split("\n");
for (int i = 0; i < segments.length; i++) {... | java | public static String filterdStackTrace(String stackTrace) {
boolean skip = false;
StringBuilder filteredStackTrace = new StringBuilder();
// read line by line until the reflective call to the test method is found
String[] segments = stackTrace.split("\n");
for (int i = 0; i < segments.length; i++) {... | [
"public",
"static",
"String",
"filterdStackTrace",
"(",
"String",
"stackTrace",
")",
"{",
"boolean",
"skip",
"=",
"false",
";",
"StringBuilder",
"filteredStackTrace",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"// read line by line until the reflective call to the test m... | Removes all entries that has to do with the internal way of
running the test method.
@param stackTrace
@return filtered stackTrace | [
"Removes",
"all",
"entries",
"that",
"has",
"to",
"do",
"with",
"the",
"internal",
"way",
"of",
"running",
"the",
"test",
"method",
"."
] | 1ed41891ccf8e5c6068c6b544d214280bb93945b | https://github.com/Lucas3oo/jicunit/blob/1ed41891ccf8e5c6068c6b544d214280bb93945b/src/jicunit-framework/src/main/java/org/jicunit/framework/internal/ExceptionUtil.java#L69-L100 |
148,070 | DDTH/ddth-dao | ddth-dao-core/src/main/java/com/github/ddth/dao/BaseBo.java | BaseBo.cloneData | @SuppressWarnings("unchecked")
protected static <T> Map<String, T> cloneData(Map<String, T> data) {
return SerializationUtils.fromByteArray(SerializationUtils.toByteArray(data), Map.class);
} | java | @SuppressWarnings("unchecked")
protected static <T> Map<String, T> cloneData(Map<String, T> data) {
return SerializationUtils.fromByteArray(SerializationUtils.toByteArray(data), Map.class);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"protected",
"static",
"<",
"T",
">",
"Map",
"<",
"String",
",",
"T",
">",
"cloneData",
"(",
"Map",
"<",
"String",
",",
"T",
">",
"data",
")",
"{",
"return",
"SerializationUtils",
".",
"fromByteArray",
... | Deep-clone data.
@param data
@return
@since 0.10.0 | [
"Deep",
"-",
"clone",
"data",
"."
] | 8d059ddf641a1629aa53851f9d1b41abf175a180 | https://github.com/DDTH/ddth-dao/blob/8d059ddf641a1629aa53851f9d1b41abf175a180/ddth-dao-core/src/main/java/com/github/ddth/dao/BaseBo.java#L44-L47 |
148,071 | DDTH/ddth-dao | ddth-dao-core/src/main/java/com/github/ddth/dao/BaseBo.java | BaseBo.getAttributes | public Map<String, Object> getAttributes() {
if (attributes == null) {
return null;
}
Lock lock = lockForRead();
try {
return cloneData(attributes);
} finally {
lock.unlock();
}
} | java | public Map<String, Object> getAttributes() {
if (attributes == null) {
return null;
}
Lock lock = lockForRead();
try {
return cloneData(attributes);
} finally {
lock.unlock();
}
} | [
"public",
"Map",
"<",
"String",
",",
"Object",
">",
"getAttributes",
"(",
")",
"{",
"if",
"(",
"attributes",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"Lock",
"lock",
"=",
"lockForRead",
"(",
")",
";",
"try",
"{",
"return",
"cloneData",
"("... | Get all BO's attributes as a map.
@return
@since 0.8.2 | [
"Get",
"all",
"BO",
"s",
"attributes",
"as",
"a",
"map",
"."
] | 8d059ddf641a1629aa53851f9d1b41abf175a180 | https://github.com/DDTH/ddth-dao/blob/8d059ddf641a1629aa53851f9d1b41abf175a180/ddth-dao-core/src/main/java/com/github/ddth/dao/BaseBo.java#L136-L146 |
148,072 | DDTH/ddth-dao | ddth-dao-core/src/main/java/com/github/ddth/dao/BaseBo.java | BaseBo.getAttributesAsJsonString | public String getAttributesAsJsonString() {
if (attributes == null) {
return "null";
}
Lock lock = lockForRead();
try {
return SerializationUtils.toJsonString(attributes);
} finally {
lock.unlock();
}
} | java | public String getAttributesAsJsonString() {
if (attributes == null) {
return "null";
}
Lock lock = lockForRead();
try {
return SerializationUtils.toJsonString(attributes);
} finally {
lock.unlock();
}
} | [
"public",
"String",
"getAttributesAsJsonString",
"(",
")",
"{",
"if",
"(",
"attributes",
"==",
"null",
")",
"{",
"return",
"\"null\"",
";",
"}",
"Lock",
"lock",
"=",
"lockForRead",
"(",
")",
";",
"try",
"{",
"return",
"SerializationUtils",
".",
"toJsonString... | Get all BO's attributes as a JSON-string.
@return
@since 0.10.0 | [
"Get",
"all",
"BO",
"s",
"attributes",
"as",
"a",
"JSON",
"-",
"string",
"."
] | 8d059ddf641a1629aa53851f9d1b41abf175a180 | https://github.com/DDTH/ddth-dao/blob/8d059ddf641a1629aa53851f9d1b41abf175a180/ddth-dao-core/src/main/java/com/github/ddth/dao/BaseBo.java#L209-L219 |
148,073 | DDTH/ddth-dao | ddth-dao-core/src/main/java/com/github/ddth/dao/BaseBo.java | BaseBo.removeAttribute | protected BaseBo removeAttribute(String attrName, boolean triggerChange) {
Lock lock = lockForWrite();
try {
attributes.remove(attrName);
if (triggerChange) {
triggerChange(attrName);
}
markDirty();
return this;
} finall... | java | protected BaseBo removeAttribute(String attrName, boolean triggerChange) {
Lock lock = lockForWrite();
try {
attributes.remove(attrName);
if (triggerChange) {
triggerChange(attrName);
}
markDirty();
return this;
} finall... | [
"protected",
"BaseBo",
"removeAttribute",
"(",
"String",
"attrName",
",",
"boolean",
"triggerChange",
")",
"{",
"Lock",
"lock",
"=",
"lockForWrite",
"(",
")",
";",
"try",
"{",
"attributes",
".",
"remove",
"(",
"attrName",
")",
";",
"if",
"(",
"triggerChange"... | Remove a BO's attribute.
@param attrName
@param triggerChange
if set to {@code true} {@link #triggerChange(String)} will be
called
@return
@since 0.7.1 | [
"Remove",
"a",
"BO",
"s",
"attribute",
"."
] | 8d059ddf641a1629aa53851f9d1b41abf175a180 | https://github.com/DDTH/ddth-dao/blob/8d059ddf641a1629aa53851f9d1b41abf175a180/ddth-dao-core/src/main/java/com/github/ddth/dao/BaseBo.java#L360-L372 |
148,074 | DDTH/ddth-dao | ddth-dao-core/src/main/java/com/github/ddth/dao/BaseBo.java | BaseBo.tryLockForRead | protected Lock tryLockForRead(long time, TimeUnit unit) throws InterruptedException {
if (time < 0 || unit == null) {
return tryLockForRead();
}
Lock lock = readLock();
return lock.tryLock(time, unit) ? lock : null;
} | java | protected Lock tryLockForRead(long time, TimeUnit unit) throws InterruptedException {
if (time < 0 || unit == null) {
return tryLockForRead();
}
Lock lock = readLock();
return lock.tryLock(time, unit) ? lock : null;
} | [
"protected",
"Lock",
"tryLockForRead",
"(",
"long",
"time",
",",
"TimeUnit",
"unit",
")",
"throws",
"InterruptedException",
"{",
"if",
"(",
"time",
"<",
"0",
"||",
"unit",
"==",
"null",
")",
"{",
"return",
"tryLockForRead",
"(",
")",
";",
"}",
"Lock",
"l... | Try to lock the BO for read.
@param time
@param unit
@return the "read"-lock in "lock" state if successful, {@code null} otherwise
@throws InterruptedException
@since 0.10.0 | [
"Try",
"to",
"lock",
"the",
"BO",
"for",
"read",
"."
] | 8d059ddf641a1629aa53851f9d1b41abf175a180 | https://github.com/DDTH/ddth-dao/blob/8d059ddf641a1629aa53851f9d1b41abf175a180/ddth-dao-core/src/main/java/com/github/ddth/dao/BaseBo.java#L487-L493 |
148,075 | DDTH/ddth-dao | ddth-dao-core/src/main/java/com/github/ddth/dao/BaseBo.java | BaseBo.tryLockForWrite | protected Lock tryLockForWrite(long time, TimeUnit unit) throws InterruptedException {
if (time < 0 || unit == null) {
return tryLockForWrite();
}
Lock lock = writeLock();
return lock.tryLock(time, unit) ? lock : null;
} | java | protected Lock tryLockForWrite(long time, TimeUnit unit) throws InterruptedException {
if (time < 0 || unit == null) {
return tryLockForWrite();
}
Lock lock = writeLock();
return lock.tryLock(time, unit) ? lock : null;
} | [
"protected",
"Lock",
"tryLockForWrite",
"(",
"long",
"time",
",",
"TimeUnit",
"unit",
")",
"throws",
"InterruptedException",
"{",
"if",
"(",
"time",
"<",
"0",
"||",
"unit",
"==",
"null",
")",
"{",
"return",
"tryLockForWrite",
"(",
")",
";",
"}",
"Lock",
... | Try to lock the BO for write.
@param time
@param unit
@return the "write"-lock in "lock" state if successful, {@code null} otherwise
@throws InterruptedException
@since 0.10.0 | [
"Try",
"to",
"lock",
"the",
"BO",
"for",
"write",
"."
] | 8d059ddf641a1629aa53851f9d1b41abf175a180 | https://github.com/DDTH/ddth-dao/blob/8d059ddf641a1629aa53851f9d1b41abf175a180/ddth-dao-core/src/main/java/com/github/ddth/dao/BaseBo.java#L536-L542 |
148,076 | DDTH/ddth-dao | ddth-dao-core/src/main/java/com/github/ddth/dao/BaseBo.java | BaseBo.toMap | public Map<String, Object> toMap() {
Lock lock = lockForWrite();
try {
Map<String, Object> data = new HashMap<>();
data.put(SER_FIELD_DIRTY, dirty);
data.put(SER_FIELD_ATTRS, attributes != null ? cloneData(attributes) : new HashMap<>());
return data;
... | java | public Map<String, Object> toMap() {
Lock lock = lockForWrite();
try {
Map<String, Object> data = new HashMap<>();
data.put(SER_FIELD_DIRTY, dirty);
data.put(SER_FIELD_ATTRS, attributes != null ? cloneData(attributes) : new HashMap<>());
return data;
... | [
"public",
"Map",
"<",
"String",
",",
"Object",
">",
"toMap",
"(",
")",
"{",
"Lock",
"lock",
"=",
"lockForWrite",
"(",
")",
";",
"try",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"data",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"data",
".",... | Serialize the BO to a Java map.
@return BO's data as a Java map, can be used to de-serialize the BO via {@link #fromMap(Map)} | [
"Serialize",
"the",
"BO",
"to",
"a",
"Java",
"map",
"."
] | 8d059ddf641a1629aa53851f9d1b41abf175a180 | https://github.com/DDTH/ddth-dao/blob/8d059ddf641a1629aa53851f9d1b41abf175a180/ddth-dao-core/src/main/java/com/github/ddth/dao/BaseBo.java#L592-L602 |
148,077 | DDTH/ddth-dao | ddth-dao-core/src/main/java/com/github/ddth/dao/BaseBo.java | BaseBo.toJson | public String toJson() {
Map<String, Object> data = toMap();
return SerializationUtils.toJsonString(data);
} | java | public String toJson() {
Map<String, Object> data = toMap();
return SerializationUtils.toJsonString(data);
} | [
"public",
"String",
"toJson",
"(",
")",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"data",
"=",
"toMap",
"(",
")",
";",
"return",
"SerializationUtils",
".",
"toJsonString",
"(",
"data",
")",
";",
"}"
] | Serialize the BO to JSON string.
@return BO's data as a JSON string, can be used to de-serialize the BO via
{@link #fromJson(String)} | [
"Serialize",
"the",
"BO",
"to",
"JSON",
"string",
"."
] | 8d059ddf641a1629aa53851f9d1b41abf175a180 | https://github.com/DDTH/ddth-dao/blob/8d059ddf641a1629aa53851f9d1b41abf175a180/ddth-dao-core/src/main/java/com/github/ddth/dao/BaseBo.java#L630-L633 |
148,078 | lisicnu/droidUtil | src/main/java/com/github/lisicnu/libDroid/util/LightUtils.java | LightUtils.acquireLock | public static boolean acquireLock(Context context) {
if (wl != null && wl.isHeld()) {
return true;
}
powerManager = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
wl = powerManager.newWakeLock(PowerManager.SCREEN_BRIGHT_WAKE_LOCK, TAG);
if (wl == nu... | java | public static boolean acquireLock(Context context) {
if (wl != null && wl.isHeld()) {
return true;
}
powerManager = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
wl = powerManager.newWakeLock(PowerManager.SCREEN_BRIGHT_WAKE_LOCK, TAG);
if (wl == nu... | [
"public",
"static",
"boolean",
"acquireLock",
"(",
"Context",
"context",
")",
"{",
"if",
"(",
"wl",
"!=",
"null",
"&&",
"wl",
".",
"isHeld",
"(",
")",
")",
"{",
"return",
"true",
";",
"}",
"powerManager",
"=",
"(",
"PowerManager",
")",
"context",
".",
... | if the keep light has been opened, will default exit.
@param context | [
"if",
"the",
"keep",
"light",
"has",
"been",
"opened",
"will",
"default",
"exit",
"."
] | e4d6cf3e3f60e5efb5a75672607ded94d1725519 | https://github.com/lisicnu/droidUtil/blob/e4d6cf3e3f60e5efb5a75672607ded94d1725519/src/main/java/com/github/lisicnu/libDroid/util/LightUtils.java#L25-L40 |
148,079 | sematext/ActionGenerator | ag-player/src/main/java/com/sematext/ag/PlayerConfig.java | PlayerConfig.get | public String get(String key) {
if (properties.get(key) != null) {
return properties.get(key);
} else {
return getConfigurationValue(key);
}
} | java | public String get(String key) {
if (properties.get(key) != null) {
return properties.get(key);
} else {
return getConfigurationValue(key);
}
} | [
"public",
"String",
"get",
"(",
"String",
"key",
")",
"{",
"if",
"(",
"properties",
".",
"get",
"(",
"key",
")",
"!=",
"null",
")",
"{",
"return",
"properties",
".",
"get",
"(",
"key",
")",
";",
"}",
"else",
"{",
"return",
"getConfigurationValue",
"(... | Return property value for a given name.
@param key
property name
@return property value | [
"Return",
"property",
"value",
"for",
"a",
"given",
"name",
"."
] | 10f4a3e680f20d7d151f5d40e6758aeb072d474f | https://github.com/sematext/ActionGenerator/blob/10f4a3e680f20d7d151f5d40e6758aeb072d474f/ag-player/src/main/java/com/sematext/ag/PlayerConfig.java#L104-L110 |
148,080 | sematext/ActionGenerator | ag-player/src/main/java/com/sematext/ag/PlayerConfig.java | PlayerConfig.checkRequired | public void checkRequired(String key) throws InitializationFailedException {
if (properties.get(key) == null && getConfigurationValue(key) == null) {
throw new InitializationFailedException("Missing required property in config: " + key);
}
} | java | public void checkRequired(String key) throws InitializationFailedException {
if (properties.get(key) == null && getConfigurationValue(key) == null) {
throw new InitializationFailedException("Missing required property in config: " + key);
}
} | [
"public",
"void",
"checkRequired",
"(",
"String",
"key",
")",
"throws",
"InitializationFailedException",
"{",
"if",
"(",
"properties",
".",
"get",
"(",
"key",
")",
"==",
"null",
"&&",
"getConfigurationValue",
"(",
"key",
")",
"==",
"null",
")",
"{",
"throw",... | Checks if a property value for a given key exists.
@param key
property name
@throws InitializationFailedException
throw when a given property is not defined | [
"Checks",
"if",
"a",
"property",
"value",
"for",
"a",
"given",
"key",
"exists",
"."
] | 10f4a3e680f20d7d151f5d40e6758aeb072d474f | https://github.com/sematext/ActionGenerator/blob/10f4a3e680f20d7d151f5d40e6758aeb072d474f/ag-player/src/main/java/com/sematext/ag/PlayerConfig.java#L120-L124 |
148,081 | fuinorg/objects4j | src/main/java/org/fuin/objects4j/common/ConstraintViolationException.java | ConstraintViolationException.getConstraintViolations | public final Set<ConstraintViolation<Object>> getConstraintViolations() {
if (constraintViolations == null) {
return null;
}
return Collections.unmodifiableSet(constraintViolations);
} | java | public final Set<ConstraintViolation<Object>> getConstraintViolations() {
if (constraintViolations == null) {
return null;
}
return Collections.unmodifiableSet(constraintViolations);
} | [
"public",
"final",
"Set",
"<",
"ConstraintViolation",
"<",
"Object",
">",
">",
"getConstraintViolations",
"(",
")",
"{",
"if",
"(",
"constraintViolations",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return",
"Collections",
".",
"unmodifiableSet",
"("... | Returns the constraint violations.
@return Immutable set of constraint violations or <code>null</code> if only a message is available. | [
"Returns",
"the",
"constraint",
"violations",
"."
] | e7f278b5bae073ebb6a76053650571c718f36246 | https://github.com/fuinorg/objects4j/blob/e7f278b5bae073ebb6a76053650571c718f36246/src/main/java/org/fuin/objects4j/common/ConstraintViolationException.java#L63-L68 |
148,082 | projectodd/wunderboss-release | messaging-hornetq/src/main/java/org/projectodd/wunderboss/messaging/hornetq/HQMessaging.java | HQMessaging.invokeDestroy | private void invokeDestroy(String method, String name) {
Class clazz = this.jmsServerManager().getClass();
Method destroy = null;
for (Method each: clazz.getMethods()) {
if (method.equals(each.getName())) {
destroy = each;
break;
}
... | java | private void invokeDestroy(String method, String name) {
Class clazz = this.jmsServerManager().getClass();
Method destroy = null;
for (Method each: clazz.getMethods()) {
if (method.equals(each.getName())) {
destroy = each;
break;
}
... | [
"private",
"void",
"invokeDestroy",
"(",
"String",
"method",
",",
"String",
"name",
")",
"{",
"Class",
"clazz",
"=",
"this",
".",
"jmsServerManager",
"(",
")",
".",
"getClass",
"(",
")",
";",
"Method",
"destroy",
"=",
"null",
";",
"for",
"(",
"Method",
... | HornetQ 2.3 has single-arity destroy functions, 2.4 has double-arity | [
"HornetQ",
"2",
".",
"3",
"has",
"single",
"-",
"arity",
"destroy",
"functions",
"2",
".",
"4",
"has",
"double",
"-",
"arity"
] | f67c68e80c5798169e3a9b2015e278239dbf005d | https://github.com/projectodd/wunderboss-release/blob/f67c68e80c5798169e3a9b2015e278239dbf005d/messaging-hornetq/src/main/java/org/projectodd/wunderboss/messaging/hornetq/HQMessaging.java#L190-L213 |
148,083 | lisicnu/droidUtil | src/main/java/com/github/lisicnu/libDroid/util/ContextUtils.java | ContextUtils.CopyAssets | public static int CopyAssets(Context context, String srcFile, String dstFile) {
int result = COPY_SUCCESS;
InputStream in = null;
OutputStream out = null;
try {
File fi;
if (dstFile.equals(FileUtils.getFileName(dstFile))) {
fi = new File(context.... | java | public static int CopyAssets(Context context, String srcFile, String dstFile) {
int result = COPY_SUCCESS;
InputStream in = null;
OutputStream out = null;
try {
File fi;
if (dstFile.equals(FileUtils.getFileName(dstFile))) {
fi = new File(context.... | [
"public",
"static",
"int",
"CopyAssets",
"(",
"Context",
"context",
",",
"String",
"srcFile",
",",
"String",
"dstFile",
")",
"{",
"int",
"result",
"=",
"COPY_SUCCESS",
";",
"InputStream",
"in",
"=",
"null",
";",
"OutputStream",
"out",
"=",
"null",
";",
"tr... | copy assets file to destinations.
@param context
@param srcFile source file in assets.
@param dstFile destination files, full path with folder. if folder is empty,
means copy to context's files folder.
@return {@link #COPY_SUCCESS} means success.{@link #COPY_DST_EXIST},
{@link #COPY_ERROR} | [
"copy",
"assets",
"file",
"to",
"destinations",
"."
] | e4d6cf3e3f60e5efb5a75672607ded94d1725519 | https://github.com/lisicnu/droidUtil/blob/e4d6cf3e3f60e5efb5a75672607ded94d1725519/src/main/java/com/github/lisicnu/libDroid/util/ContextUtils.java#L40-L92 |
148,084 | lisicnu/droidUtil | src/main/java/com/github/lisicnu/libDroid/util/ContextUtils.java | ContextUtils.isLauncherActivity | public static boolean isLauncherActivity(Intent intent) {
if (intent == null)
return false;
if (StringUtils.isNullOrEmpty(intent.getAction())) {
return false;
}
if (intent.getCategories() == null)
return false;
return Intent.ACTION_MAIN.equa... | java | public static boolean isLauncherActivity(Intent intent) {
if (intent == null)
return false;
if (StringUtils.isNullOrEmpty(intent.getAction())) {
return false;
}
if (intent.getCategories() == null)
return false;
return Intent.ACTION_MAIN.equa... | [
"public",
"static",
"boolean",
"isLauncherActivity",
"(",
"Intent",
"intent",
")",
"{",
"if",
"(",
"intent",
"==",
"null",
")",
"return",
"false",
";",
"if",
"(",
"StringUtils",
".",
"isNullOrEmpty",
"(",
"intent",
".",
"getAction",
"(",
")",
")",
")",
"... | check whether is launcher or not.
@param intent
@return | [
"check",
"whether",
"is",
"launcher",
"or",
"not",
"."
] | e4d6cf3e3f60e5efb5a75672607ded94d1725519 | https://github.com/lisicnu/droidUtil/blob/e4d6cf3e3f60e5efb5a75672607ded94d1725519/src/main/java/com/github/lisicnu/libDroid/util/ContextUtils.java#L100-L113 |
148,085 | fuinorg/objects4j | src/main/java/org/fuin/objects4j/vo/AbstractUuidValueObject.java | AbstractUuidValueObject.isValid | public static boolean isValid(final String value) {
if (value == null) {
return true;
}
final String uuidPattern = "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-" + "[0-9a-f]{4}-[0-9a-f]{12}$";
return Pattern.matches(uuidPattern, value);
} | java | public static boolean isValid(final String value) {
if (value == null) {
return true;
}
final String uuidPattern = "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-" + "[0-9a-f]{4}-[0-9a-f]{12}$";
return Pattern.matches(uuidPattern, value);
} | [
"public",
"static",
"boolean",
"isValid",
"(",
"final",
"String",
"value",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"return",
"true",
";",
"}",
"final",
"String",
"uuidPattern",
"=",
"\"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-\"",
"+",
"\"[0-9a-f]{4}-[... | Verifies that a given string is a valid UUID.
@param value
Value to check. A <code>null</code> value returns <code>true</code>.
@return TRUE if it's a valid key, else FALSE. | [
"Verifies",
"that",
"a",
"given",
"string",
"is",
"a",
"valid",
"UUID",
"."
] | e7f278b5bae073ebb6a76053650571c718f36246 | https://github.com/fuinorg/objects4j/blob/e7f278b5bae073ebb6a76053650571c718f36246/src/main/java/org/fuin/objects4j/vo/AbstractUuidValueObject.java#L70-L76 |
148,086 | acromusashi/acromusashi-stream | src/main/java/acromusashi/stream/spout/AmBaseSpout.java | AmBaseSpout.extractSpecificConfig | protected Object extractSpecificConfig(String key)
{
if (this.specificConfig == null)
{
return null;
}
Object result = this.specificConfig.get(key);
return result;
} | java | protected Object extractSpecificConfig(String key)
{
if (this.specificConfig == null)
{
return null;
}
Object result = this.specificConfig.get(key);
return result;
} | [
"protected",
"Object",
"extractSpecificConfig",
"(",
"String",
"key",
")",
"{",
"if",
"(",
"this",
".",
"specificConfig",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"Object",
"result",
"=",
"this",
".",
"specificConfig",
".",
"get",
"(",
"key",
... | Get config value from specific config.
@param key Config key
@return Specific Config value | [
"Get",
"config",
"value",
"from",
"specific",
"config",
"."
] | 65b1f335d771d657c5640a2056ab5c8546eddec9 | https://github.com/acromusashi/acromusashi-stream/blob/65b1f335d771d657c5640a2056ab5c8546eddec9/src/main/java/acromusashi/stream/spout/AmBaseSpout.java#L214-L223 |
148,087 | acromusashi/acromusashi-stream | src/main/java/acromusashi/stream/spout/AmBaseSpout.java | AmBaseSpout.getSpecificConfig | protected Map<String, Object> getSpecificConfig()
{
if (this.specificConfig == null)
{
return null;
}
Map<String, Object> result = Collections.unmodifiableMap(this.specificConfig);
return result;
} | java | protected Map<String, Object> getSpecificConfig()
{
if (this.specificConfig == null)
{
return null;
}
Map<String, Object> result = Collections.unmodifiableMap(this.specificConfig);
return result;
} | [
"protected",
"Map",
"<",
"String",
",",
"Object",
">",
"getSpecificConfig",
"(",
")",
"{",
"if",
"(",
"this",
".",
"specificConfig",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"Map",
"<",
"String",
",",
"Object",
">",
"result",
"=",
"Collectio... | Get unmodifiable specific config.
@return Unmodifiable specific config. | [
"Get",
"unmodifiable",
"specific",
"config",
"."
] | 65b1f335d771d657c5640a2056ab5c8546eddec9 | https://github.com/acromusashi/acromusashi-stream/blob/65b1f335d771d657c5640a2056ab5c8546eddec9/src/main/java/acromusashi/stream/spout/AmBaseSpout.java#L230-L239 |
148,088 | jriecken/gae-java-mini-profiler | src/main/java/ca/jimr/gae/profiler/MiniProfiler.java | MiniProfiler.step | public static Step step(String stepName)
{
Root root = PROFILER_STEPS.get();
if (root != null)
{
Profile data = new Profile(root.nextId(), stepName);
return new Step(root, data);
} else
{
return new Step(null, null);
}
} | java | public static Step step(String stepName)
{
Root root = PROFILER_STEPS.get();
if (root != null)
{
Profile data = new Profile(root.nextId(), stepName);
return new Step(root, data);
} else
{
return new Step(null, null);
}
} | [
"public",
"static",
"Step",
"step",
"(",
"String",
"stepName",
")",
"{",
"Root",
"root",
"=",
"PROFILER_STEPS",
".",
"get",
"(",
")",
";",
"if",
"(",
"root",
"!=",
"null",
")",
"{",
"Profile",
"data",
"=",
"new",
"Profile",
"(",
"root",
".",
"nextId"... | Start a profiling step.
@param stepName
The name of the step.
@return A {@code Step} object whose {@link Step#close()} method should be
called to finish the step. | [
"Start",
"a",
"profiling",
"step",
"."
] | 184e3d2470104e066919960d6fbfe0cdc05921d5 | https://github.com/jriecken/gae-java-mini-profiler/blob/184e3d2470104e066919960d6fbfe0cdc05921d5/src/main/java/ca/jimr/gae/profiler/MiniProfiler.java#L375-L386 |
148,089 | projectodd/wunderboss-release | web/src/main/java/org/projectodd/wunderboss/web/async/WebsocketUtil.java | WebsocketUtil.createTextHandler | static public MessageHandler.Whole<String> createTextHandler(final MessageHandler.Whole proxy) {
return new MessageHandler.Whole<String>() {
public void onMessage(String msg) {
proxy.onMessage(msg);
}};
} | java | static public MessageHandler.Whole<String> createTextHandler(final MessageHandler.Whole proxy) {
return new MessageHandler.Whole<String>() {
public void onMessage(String msg) {
proxy.onMessage(msg);
}};
} | [
"static",
"public",
"MessageHandler",
".",
"Whole",
"<",
"String",
">",
"createTextHandler",
"(",
"final",
"MessageHandler",
".",
"Whole",
"proxy",
")",
"{",
"return",
"new",
"MessageHandler",
".",
"Whole",
"<",
"String",
">",
"(",
")",
"{",
"public",
"void"... | generics and Undertow's dependence on ParameterizedType | [
"generics",
"and",
"Undertow",
"s",
"dependence",
"on",
"ParameterizedType"
] | f67c68e80c5798169e3a9b2015e278239dbf005d | https://github.com/projectodd/wunderboss-release/blob/f67c68e80c5798169e3a9b2015e278239dbf005d/web/src/main/java/org/projectodd/wunderboss/web/async/WebsocketUtil.java#L25-L30 |
148,090 | projectodd/wunderboss-release | web/src/main/java/org/projectodd/wunderboss/web/async/WebsocketUtil.java | WebsocketUtil.createBinaryHandler | static public MessageHandler.Whole<byte[]> createBinaryHandler(final MessageHandler.Whole proxy) {
return new MessageHandler.Whole<byte[]>() {
public void onMessage(byte[] msg) {
proxy.onMessage(msg);
}};
} | java | static public MessageHandler.Whole<byte[]> createBinaryHandler(final MessageHandler.Whole proxy) {
return new MessageHandler.Whole<byte[]>() {
public void onMessage(byte[] msg) {
proxy.onMessage(msg);
}};
} | [
"static",
"public",
"MessageHandler",
".",
"Whole",
"<",
"byte",
"[",
"]",
">",
"createBinaryHandler",
"(",
"final",
"MessageHandler",
".",
"Whole",
"proxy",
")",
"{",
"return",
"new",
"MessageHandler",
".",
"Whole",
"<",
"byte",
"[",
"]",
">",
"(",
")",
... | The binary version of createTextHandler | [
"The",
"binary",
"version",
"of",
"createTextHandler"
] | f67c68e80c5798169e3a9b2015e278239dbf005d | https://github.com/projectodd/wunderboss-release/blob/f67c68e80c5798169e3a9b2015e278239dbf005d/web/src/main/java/org/projectodd/wunderboss/web/async/WebsocketUtil.java#L33-L38 |
148,091 | torakiki/event-studio | src/main/java/org/sejda/eventstudio/DefaultEventStudio.java | DefaultEventStudio.remove | public <T> boolean remove(Class<T> eventClass, Listener<T> listener) {
return remove(eventClass, listener, HIDDEN_STATION);
} | java | public <T> boolean remove(Class<T> eventClass, Listener<T> listener) {
return remove(eventClass, listener, HIDDEN_STATION);
} | [
"public",
"<",
"T",
">",
"boolean",
"remove",
"(",
"Class",
"<",
"T",
">",
"eventClass",
",",
"Listener",
"<",
"T",
">",
"listener",
")",
"{",
"return",
"remove",
"(",
"eventClass",
",",
"listener",
",",
"HIDDEN_STATION",
")",
";",
"}"
] | Removes the given listener listening on the given event, from the hidden station, hiding the station abstraction.
@return true if the listener was found and removed
@see EventStudio#remove(Listener, String)
@see DefaultEventStudio#HIDDEN_STATION | [
"Removes",
"the",
"given",
"listener",
"listening",
"on",
"the",
"given",
"event",
"from",
"the",
"hidden",
"station",
"hiding",
"the",
"station",
"abstraction",
"."
] | 2937b7ed28bb185a79b9cfb98c4de2eb37690a4a | https://github.com/torakiki/event-studio/blob/2937b7ed28bb185a79b9cfb98c4de2eb37690a4a/src/main/java/org/sejda/eventstudio/DefaultEventStudio.java#L179-L181 |
148,092 | projectodd/wunderboss-release | core/src/main/java/org/projectodd/wunderboss/ec/ConcreteDaemonContext.java | ConcreteDaemonContext.setAction | @Override
public void setAction(final Runnable action) {
super.setAction(new Runnable() {
@Override
public void run() {
if (!isRunning) {
thread = new Thread(wrappedAction(action), "wunderboss-daemon-thread[" + name + "]");
thre... | java | @Override
public void setAction(final Runnable action) {
super.setAction(new Runnable() {
@Override
public void run() {
if (!isRunning) {
thread = new Thread(wrappedAction(action), "wunderboss-daemon-thread[" + name + "]");
thre... | [
"@",
"Override",
"public",
"void",
"setAction",
"(",
"final",
"Runnable",
"action",
")",
"{",
"super",
".",
"setAction",
"(",
"new",
"Runnable",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
"run",
"(",
")",
"{",
"if",
"(",
"!",
"isRunning",
")",
... | Wraps the given action in a Runnable that starts a supervised thread. | [
"Wraps",
"the",
"given",
"action",
"in",
"a",
"Runnable",
"that",
"starts",
"a",
"supervised",
"thread",
"."
] | f67c68e80c5798169e3a9b2015e278239dbf005d | https://github.com/projectodd/wunderboss-release/blob/f67c68e80c5798169e3a9b2015e278239dbf005d/core/src/main/java/org/projectodd/wunderboss/ec/ConcreteDaemonContext.java#L38-L50 |
148,093 | projectodd/wunderboss-release | web-undertow/src/main/java/org/projectodd/wunderboss/web/undertow/UndertowWeb.java | UndertowWeb.register | protected boolean register(String path, List<String> vhosts, HttpHandler handler) {
return pathology.add(path, vhosts, handler);
} | java | protected boolean register(String path, List<String> vhosts, HttpHandler handler) {
return pathology.add(path, vhosts, handler);
} | [
"protected",
"boolean",
"register",
"(",
"String",
"path",
",",
"List",
"<",
"String",
">",
"vhosts",
",",
"HttpHandler",
"handler",
")",
"{",
"return",
"pathology",
".",
"add",
"(",
"path",
",",
"vhosts",
",",
"handler",
")",
";",
"}"
] | For the WF subclass | [
"For",
"the",
"WF",
"subclass"
] | f67c68e80c5798169e3a9b2015e278239dbf005d | https://github.com/projectodd/wunderboss-release/blob/f67c68e80c5798169e3a9b2015e278239dbf005d/web-undertow/src/main/java/org/projectodd/wunderboss/web/undertow/UndertowWeb.java#L228-L230 |
148,094 | fuinorg/objects4j | src/main/java/org/fuin/objects4j/ui/TextFieldInfo.java | TextFieldInfo.create | public static TextFieldInfo create(@NotNull final Field field, @NotNull final Locale locale) {
final TextField textField = field.getAnnotation(TextField.class);
if (textField == null) {
return null;
}
return new TextFieldInfo(field, textField.width());
} | java | public static TextFieldInfo create(@NotNull final Field field, @NotNull final Locale locale) {
final TextField textField = field.getAnnotation(TextField.class);
if (textField == null) {
return null;
}
return new TextFieldInfo(field, textField.width());
} | [
"public",
"static",
"TextFieldInfo",
"create",
"(",
"@",
"NotNull",
"final",
"Field",
"field",
",",
"@",
"NotNull",
"final",
"Locale",
"locale",
")",
"{",
"final",
"TextField",
"textField",
"=",
"field",
".",
"getAnnotation",
"(",
"TextField",
".",
"class",
... | Return the text field information for a given field.
@param field
Field to check for <code>@TextField</code> annotation.
@param locale
Locale to use.
@return Information or <code>null</code>. | [
"Return",
"the",
"text",
"field",
"information",
"for",
"a",
"given",
"field",
"."
] | e7f278b5bae073ebb6a76053650571c718f36246 | https://github.com/fuinorg/objects4j/blob/e7f278b5bae073ebb6a76053650571c718f36246/src/main/java/org/fuin/objects4j/ui/TextFieldInfo.java#L107-L115 |
148,095 | Commonjava/webdav-handler | common/src/main/java/net/sf/webdav/methods/AbstractMethod.java | AbstractMethod.getDepth | protected int getDepth( final WebdavRequest req )
{
int depth = INFINITY;
final String depthStr = req.getHeader( "Depth" );
if ( depthStr != null )
{
if ( depthStr.equals( "0" ) )
{
depth = 0;
}
else if ( depthStr.equals... | java | protected int getDepth( final WebdavRequest req )
{
int depth = INFINITY;
final String depthStr = req.getHeader( "Depth" );
if ( depthStr != null )
{
if ( depthStr.equals( "0" ) )
{
depth = 0;
}
else if ( depthStr.equals... | [
"protected",
"int",
"getDepth",
"(",
"final",
"WebdavRequest",
"req",
")",
"{",
"int",
"depth",
"=",
"INFINITY",
";",
"final",
"String",
"depthStr",
"=",
"req",
".",
"getHeader",
"(",
"\"Depth\"",
")",
";",
"if",
"(",
"depthStr",
"!=",
"null",
")",
"{",
... | reads the depth header from the request and returns it as a int
@param req
@return the depth from the depth header | [
"reads",
"the",
"depth",
"header",
"from",
"the",
"request",
"and",
"returns",
"it",
"as",
"a",
"int"
] | 39bb7032fc75c1b67d3f2440dd1c234ead96cb9d | https://github.com/Commonjava/webdav-handler/blob/39bb7032fc75c1b67d3f2440dd1c234ead96cb9d/common/src/main/java/net/sf/webdav/methods/AbstractMethod.java#L217-L233 |
148,096 | Commonjava/webdav-handler | common/src/main/java/net/sf/webdav/methods/AbstractMethod.java | AbstractMethod.getETag | protected String getETag( final StoredObject so )
{
String resourceLength = "";
String lastModified = "";
if ( so != null && so.isResource() )
{
resourceLength = new Long( so.getResourceLength() ).toString();
lastModified = new Long( so.getLastModified()
... | java | protected String getETag( final StoredObject so )
{
String resourceLength = "";
String lastModified = "";
if ( so != null && so.isResource() )
{
resourceLength = new Long( so.getResourceLength() ).toString();
lastModified = new Long( so.getLastModified()
... | [
"protected",
"String",
"getETag",
"(",
"final",
"StoredObject",
"so",
")",
"{",
"String",
"resourceLength",
"=",
"\"\"",
";",
"String",
"lastModified",
"=",
"\"\"",
";",
"if",
"(",
"so",
"!=",
"null",
"&&",
"so",
".",
"isResource",
"(",
")",
")",
"{",
... | Get the ETag associated with a file.
@param so
StoredObject to get resourceLength, lastModified and a hashCode of
StoredObject
@return the ETag | [
"Get",
"the",
"ETag",
"associated",
"with",
"a",
"file",
"."
] | 39bb7032fc75c1b67d3f2440dd1c234ead96cb9d | https://github.com/Commonjava/webdav-handler/blob/39bb7032fc75c1b67d3f2440dd1c234ead96cb9d/common/src/main/java/net/sf/webdav/methods/AbstractMethod.java#L255-L270 |
148,097 | Commonjava/webdav-handler | common/src/main/java/net/sf/webdav/methods/AbstractMethod.java | AbstractMethod.sendReport | protected void sendReport( final WebdavRequest req, final WebdavResponse resp, final Hashtable<String, WebdavStatus> errorList )
throws IOException
{
resp.setStatus( WebdavStatus.SC_MULTI_STATUS );
final String absoluteUri = req.getRequestURI();
// String relativePath = getRelative... | java | protected void sendReport( final WebdavRequest req, final WebdavResponse resp, final Hashtable<String, WebdavStatus> errorList )
throws IOException
{
resp.setStatus( WebdavStatus.SC_MULTI_STATUS );
final String absoluteUri = req.getRequestURI();
// String relativePath = getRelative... | [
"protected",
"void",
"sendReport",
"(",
"final",
"WebdavRequest",
"req",
",",
"final",
"WebdavResponse",
"resp",
",",
"final",
"Hashtable",
"<",
"String",
",",
"WebdavStatus",
">",
"errorList",
")",
"throws",
"IOException",
"{",
"resp",
".",
"setStatus",
"(",
... | Send a multistatus element containing a complete error report to the
client.
@param req
Servlet request
@param resp
Servlet response
@param errorList
List of error to be displayed | [
"Send",
"a",
"multistatus",
"element",
"containing",
"a",
"complete",
"error",
"report",
"to",
"the",
"client",
"."
] | 39bb7032fc75c1b67d3f2440dd1c234ead96cb9d | https://github.com/Commonjava/webdav-handler/blob/39bb7032fc75c1b67d3f2440dd1c234ead96cb9d/common/src/main/java/net/sf/webdav/methods/AbstractMethod.java#L402-L462 |
148,098 | projectodd/wunderboss-release | ruby/src/main/java/org/projectodd/wunderboss/ruby/RubyHelper.java | RubyHelper.setIfPossible | public static boolean setIfPossible(final Ruby ruby, final Object target, final String name, final Object value) {
boolean success = false;
if (defined( ruby, target, name + "=" )) {
JavaEmbedUtils.invokeMethod( ruby, target, name + "=", new Object[] { value }, void.class );
succ... | java | public static boolean setIfPossible(final Ruby ruby, final Object target, final String name, final Object value) {
boolean success = false;
if (defined( ruby, target, name + "=" )) {
JavaEmbedUtils.invokeMethod( ruby, target, name + "=", new Object[] { value }, void.class );
succ... | [
"public",
"static",
"boolean",
"setIfPossible",
"(",
"final",
"Ruby",
"ruby",
",",
"final",
"Object",
"target",
",",
"final",
"String",
"name",
",",
"final",
"Object",
"value",
")",
"{",
"boolean",
"success",
"=",
"false",
";",
"if",
"(",
"defined",
"(",
... | Set a property on a Ruby object, if possible.
<p>
If the target responds to {@code name=}, the property will be set.
Otherwise, not.
</p>
@param ruby
The Ruby interpreter.
@param target
The target object.
@param name
The basic name of the property.
@param value
The value to attempt to set.
@return {@code true} if suc... | [
"Set",
"a",
"property",
"on",
"a",
"Ruby",
"object",
"if",
"possible",
"."
] | f67c68e80c5798169e3a9b2015e278239dbf005d | https://github.com/projectodd/wunderboss-release/blob/f67c68e80c5798169e3a9b2015e278239dbf005d/ruby/src/main/java/org/projectodd/wunderboss/ruby/RubyHelper.java#L58-L65 |
148,099 | projectodd/wunderboss-release | ruby/src/main/java/org/projectodd/wunderboss/ruby/RubyHelper.java | RubyHelper.requireIfAvailable | public static boolean requireIfAvailable(Ruby ruby, String requirement, boolean logErrors) {
boolean success = false;
try {
StringBuilder script = new StringBuilder();
script.append("require %q(");
script.append(requirement);
script.append(")\n");
... | java | public static boolean requireIfAvailable(Ruby ruby, String requirement, boolean logErrors) {
boolean success = false;
try {
StringBuilder script = new StringBuilder();
script.append("require %q(");
script.append(requirement);
script.append(")\n");
... | [
"public",
"static",
"boolean",
"requireIfAvailable",
"(",
"Ruby",
"ruby",
",",
"String",
"requirement",
",",
"boolean",
"logErrors",
")",
"{",
"boolean",
"success",
"=",
"false",
";",
"try",
"{",
"StringBuilder",
"script",
"=",
"new",
"StringBuilder",
"(",
")"... | Calls "require 'requirement'" in the Ruby provided.
@return boolean If successful, returns true, otherwise false. | [
"Calls",
"require",
"requirement",
"in",
"the",
"Ruby",
"provided",
"."
] | f67c68e80c5798169e3a9b2015e278239dbf005d | https://github.com/projectodd/wunderboss-release/blob/f67c68e80c5798169e3a9b2015e278239dbf005d/ruby/src/main/java/org/projectodd/wunderboss/ruby/RubyHelper.java#L116-L132 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.