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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
7,700 | jaxio/javaee-lab | javaee7-jpa-query-by-example/src/main/java/com/jaxio/jpa/querybyexample/GenericRepository.java | GenericRepository.find | @Transactional
public List<E> find(E entity, SearchParameters sp) {
if (sp.hasNamedQuery()) {
return byNamedQueryUtil.findByNamedQuery(sp);
}
CriteriaBuilder builder = entityManager.getCriteriaBuilder();
CriteriaQuery<E> criteriaQuery = builder.createQuery(type);
... | java | @Transactional
public List<E> find(E entity, SearchParameters sp) {
if (sp.hasNamedQuery()) {
return byNamedQueryUtil.findByNamedQuery(sp);
}
CriteriaBuilder builder = entityManager.getCriteriaBuilder();
CriteriaQuery<E> criteriaQuery = builder.createQuery(type);
... | [
"@",
"Transactional",
"public",
"List",
"<",
"E",
">",
"find",
"(",
"E",
"entity",
",",
"SearchParameters",
"sp",
")",
"{",
"if",
"(",
"sp",
".",
"hasNamedQuery",
"(",
")",
")",
"{",
"return",
"byNamedQueryUtil",
".",
"findByNamedQuery",
"(",
"sp",
")",
... | Find and load a list of E instance.
@param entity a sample entity whose non-null properties may be used as search hints
@param sp carries additional search information
@return the entities matching the search. | [
"Find",
"and",
"load",
"a",
"list",
"of",
"E",
"instance",
"."
] | 61238b967952446d81cc68424a4e809093a77fcf | https://github.com/jaxio/javaee-lab/blob/61238b967952446d81cc68424a4e809093a77fcf/javaee7-jpa-query-by-example/src/main/java/com/jaxio/jpa/querybyexample/GenericRepository.java#L202-L233 |
7,701 | jaxio/javaee-lab | javaee7-jpa-query-by-example/src/main/java/com/jaxio/jpa/querybyexample/GenericRepository.java | GenericRepository.save | @Transactional
public void save(E entity) {
checkNotNull(entity, "The entity to save cannot be null");
// creation with auto generated id
if (!entity.isIdSet()) {
entityManager.persist(entity);
return;
}
// creation with manually assigned key
... | java | @Transactional
public void save(E entity) {
checkNotNull(entity, "The entity to save cannot be null");
// creation with auto generated id
if (!entity.isIdSet()) {
entityManager.persist(entity);
return;
}
// creation with manually assigned key
... | [
"@",
"Transactional",
"public",
"void",
"save",
"(",
"E",
"entity",
")",
"{",
"checkNotNull",
"(",
"entity",
",",
"\"The entity to save cannot be null\"",
")",
";",
"// creation with auto generated id",
"if",
"(",
"!",
"entity",
".",
"isIdSet",
"(",
")",
")",
"{... | Save or update the given entity E to the repository. Assume that the entity is already present in the persistence context. No merge is done.
@param entity the entity to be saved or updated. | [
"Save",
"or",
"update",
"the",
"given",
"entity",
"E",
"to",
"the",
"repository",
".",
"Assume",
"that",
"the",
"entity",
"is",
"already",
"present",
"in",
"the",
"persistence",
"context",
".",
"No",
"merge",
"is",
"done",
"."
] | 61238b967952446d81cc68424a4e809093a77fcf | https://github.com/jaxio/javaee-lab/blob/61238b967952446d81cc68424a4e809093a77fcf/javaee7-jpa-query-by-example/src/main/java/com/jaxio/jpa/querybyexample/GenericRepository.java#L553-L571 |
7,702 | jaxio/javaee-lab | javaee7-jpa-query-by-example/src/main/java/com/jaxio/jpa/querybyexample/GenericRepository.java | GenericRepository.delete | @Transactional
public void delete(E entity) {
if (entityManager.contains(entity)) {
entityManager.remove(entity);
} else {
// could be a delete on a transient instance
E entityRef = entityManager.getReference(type, entity.getId());
if (entityRef != nu... | java | @Transactional
public void delete(E entity) {
if (entityManager.contains(entity)) {
entityManager.remove(entity);
} else {
// could be a delete on a transient instance
E entityRef = entityManager.getReference(type, entity.getId());
if (entityRef != nu... | [
"@",
"Transactional",
"public",
"void",
"delete",
"(",
"E",
"entity",
")",
"{",
"if",
"(",
"entityManager",
".",
"contains",
"(",
"entity",
")",
")",
"{",
"entityManager",
".",
"remove",
"(",
"entity",
")",
";",
"}",
"else",
"{",
"// could be a delete on a... | Delete the given entity E from the repository.
@param entity the entity to be deleted. | [
"Delete",
"the",
"given",
"entity",
"E",
"from",
"the",
"repository",
"."
] | 61238b967952446d81cc68424a4e809093a77fcf | https://github.com/jaxio/javaee-lab/blob/61238b967952446d81cc68424a4e809093a77fcf/javaee7-jpa-query-by-example/src/main/java/com/jaxio/jpa/querybyexample/GenericRepository.java#L603-L617 |
7,703 | cchantep/acolyte | jdbc-java8/src/main/java/acolyte/jdbc/AcolyteDSL.java | AcolyteDSL.connection | public static Connection connection(ConnectionHandler h, Property... ps) {
return Driver.connection(h, ps);
} | java | public static Connection connection(ConnectionHandler h, Property... ps) {
return Driver.connection(h, ps);
} | [
"public",
"static",
"Connection",
"connection",
"(",
"ConnectionHandler",
"h",
",",
"Property",
"...",
"ps",
")",
"{",
"return",
"Driver",
".",
"connection",
"(",
"h",
",",
"ps",
")",
";",
"}"
] | Creates a connection, managed with given handler.
@param h the connection handler
@param ps the connection properties
@return a new Acolyte connection
<pre>
{@code
import acolyte.jdbc.AcolyteDSL;
import static acolyte.jdbc.AcolyteDSL.connection;
import static acolyte.jdbc.AcolyteDSL.prop;
// With connection property... | [
"Creates",
"a",
"connection",
"managed",
"with",
"given",
"handler",
"."
] | a383dff20fadc08ec9306f2f1f24b2a7e0047449 | https://github.com/cchantep/acolyte/blob/a383dff20fadc08ec9306f2f1f24b2a7e0047449/jdbc-java8/src/main/java/acolyte/jdbc/AcolyteDSL.java#L99-L101 |
7,704 | cchantep/acolyte | jdbc-java8/src/main/java/acolyte/jdbc/AcolyteDSL.java | AcolyteDSL.withQueryResult | public static <A> A withQueryResult(QueryResult res,
Function<java.sql.Connection, A> f) {
return f.apply(connection(handleQuery((x, y) -> res)));
} | java | public static <A> A withQueryResult(QueryResult res,
Function<java.sql.Connection, A> f) {
return f.apply(connection(handleQuery((x, y) -> res)));
} | [
"public",
"static",
"<",
"A",
">",
"A",
"withQueryResult",
"(",
"QueryResult",
"res",
",",
"Function",
"<",
"java",
".",
"sql",
".",
"Connection",
",",
"A",
">",
"f",
")",
"{",
"return",
"f",
".",
"apply",
"(",
"connection",
"(",
"handleQuery",
"(",
... | Executes |f| using a connection accepting only queries,
and answering with |result| to any query.
<pre>
{@code
import static acolyte.jdbc.AcolyteDSL.withQueryResult;
String str = withQueryResult(queryRes, con -> "str");
}
</pre> | [
"Executes",
"|f|",
"using",
"a",
"connection",
"accepting",
"only",
"queries",
"and",
"answering",
"with",
"|result|",
"to",
"any",
"query",
"."
] | a383dff20fadc08ec9306f2f1f24b2a7e0047449 | https://github.com/cchantep/acolyte/blob/a383dff20fadc08ec9306f2f1f24b2a7e0047449/jdbc-java8/src/main/java/acolyte/jdbc/AcolyteDSL.java#L178-L182 |
7,705 | cchantep/acolyte | studio/src/main/java/acolyte/RowFormatter.java | RowFormatter.perform | public void perform(final Appender ap)
throws SQLException, UnsupportedEncodingException {
Connection con = null;
Statement stmt = null;
ResultSet rs = null;
try {
con = JDBC.connect(this.jdbcDriver, this.jdbcUrl,
this.user, this.pas... | java | public void perform(final Appender ap)
throws SQLException, UnsupportedEncodingException {
Connection con = null;
Statement stmt = null;
ResultSet rs = null;
try {
con = JDBC.connect(this.jdbcDriver, this.jdbcUrl,
this.user, this.pas... | [
"public",
"void",
"perform",
"(",
"final",
"Appender",
"ap",
")",
"throws",
"SQLException",
",",
"UnsupportedEncodingException",
"{",
"Connection",
"con",
"=",
"null",
";",
"Statement",
"stmt",
"=",
"null",
";",
"ResultSet",
"rs",
"=",
"null",
";",
"try",
"{... | Performs export. | [
"Performs",
"export",
"."
] | a383dff20fadc08ec9306f2f1f24b2a7e0047449 | https://github.com/cchantep/acolyte/blob/a383dff20fadc08ec9306f2f1f24b2a7e0047449/studio/src/main/java/acolyte/RowFormatter.java#L123-L165 |
7,706 | cchantep/acolyte | studio/src/main/java/acolyte/RowFormatter.java | RowFormatter.appendNull | static void appendNull(final Appender ap,
final Formatting fmt,
final ColumnType col) {
switch (col) {
case BigDecimal:
ap.append(fmt.noneBigDecimal);
break;
case Boolean:
ap.append(fmt.noneBoolean);
... | java | static void appendNull(final Appender ap,
final Formatting fmt,
final ColumnType col) {
switch (col) {
case BigDecimal:
ap.append(fmt.noneBigDecimal);
break;
case Boolean:
ap.append(fmt.noneBoolean);
... | [
"static",
"void",
"appendNull",
"(",
"final",
"Appender",
"ap",
",",
"final",
"Formatting",
"fmt",
",",
"final",
"ColumnType",
"col",
")",
"{",
"switch",
"(",
"col",
")",
"{",
"case",
"BigDecimal",
":",
"ap",
".",
"append",
"(",
"fmt",
".",
"noneBigDecim... | Appends a null value. | [
"Appends",
"a",
"null",
"value",
"."
] | a383dff20fadc08ec9306f2f1f24b2a7e0047449 | https://github.com/cchantep/acolyte/blob/a383dff20fadc08ec9306f2f1f24b2a7e0047449/studio/src/main/java/acolyte/RowFormatter.java#L170-L223 |
7,707 | cchantep/acolyte | studio/src/main/java/acolyte/RowFormatter.java | RowFormatter.appendValues | static void appendValues(final ResultRow rs,
final Appender ap,
final Charset charset,
final Formatting fmt,
final Iterator<ColumnType> cols,
final int colIndex) {
i... | java | static void appendValues(final ResultRow rs,
final Appender ap,
final Charset charset,
final Formatting fmt,
final Iterator<ColumnType> cols,
final int colIndex) {
i... | [
"static",
"void",
"appendValues",
"(",
"final",
"ResultRow",
"rs",
",",
"final",
"Appender",
"ap",
",",
"final",
"Charset",
"charset",
",",
"final",
"Formatting",
"fmt",
",",
"final",
"Iterator",
"<",
"ColumnType",
">",
"cols",
",",
"final",
"int",
"colIndex... | Result set values. | [
"Result",
"set",
"values",
"."
] | a383dff20fadc08ec9306f2f1f24b2a7e0047449 | https://github.com/cchantep/acolyte/blob/a383dff20fadc08ec9306f2f1f24b2a7e0047449/studio/src/main/java/acolyte/RowFormatter.java#L228-L322 |
7,708 | cchantep/acolyte | studio/src/main/java/acolyte/RowFormatter.java | RowFormatter.main | public static void main(final String[] args) throws Exception {
if (args.length < 4) {
throw new IllegalArgumentException();
} // end of if
// ---
if (new File(args[1]).exists()) { // driver path
final Properties conf = new Properties();
conf.put("j... | java | public static void main(final String[] args) throws Exception {
if (args.length < 4) {
throw new IllegalArgumentException();
} // end of if
// ---
if (new File(args[1]).exists()) { // driver path
final Properties conf = new Properties();
conf.put("j... | [
"public",
"static",
"void",
"main",
"(",
"final",
"String",
"[",
"]",
"args",
")",
"throws",
"Exception",
"{",
"if",
"(",
"args",
".",
"length",
"<",
"4",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
")",
";",
"}",
"// end of if",
"// ---",... | CLI runner.
@param args Execution arguments : args[0] - JDBC URL,
args[1] - Path to JAR or JDBC driver,
args[2] - DB user,
args[3] - Encoding,
args[4] - User password,
args[5] - Output format (either "java" or "scala"),
args[6] - SQL statement,
args[7] to args[n] - type(s) of column from 1 to m.
@see ColumnType | [
"CLI",
"runner",
"."
] | a383dff20fadc08ec9306f2f1f24b2a7e0047449 | https://github.com/cchantep/acolyte/blob/a383dff20fadc08ec9306f2f1f24b2a7e0047449/studio/src/main/java/acolyte/RowFormatter.java#L364-L417 |
7,709 | cchantep/acolyte | jdbc-driver/src/main/java/acolyte/jdbc/AbstractCompositeHandler.java | AbstractCompositeHandler.withQueryDetection | public T withQueryDetection(final String... pattern) {
if (pattern == null) {
throw new IllegalArgumentException();
} // end of if
// ---
final Pattern[] ps = new Pattern[pattern.length];
int i = 0;
for (final String p : pattern) {
ps[i++] = Pat... | java | public T withQueryDetection(final String... pattern) {
if (pattern == null) {
throw new IllegalArgumentException();
} // end of if
// ---
final Pattern[] ps = new Pattern[pattern.length];
int i = 0;
for (final String p : pattern) {
ps[i++] = Pat... | [
"public",
"T",
"withQueryDetection",
"(",
"final",
"String",
"...",
"pattern",
")",
"{",
"if",
"(",
"pattern",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
")",
";",
"}",
"// end of if",
"// ---",
"final",
"Pattern",
"[",
"]",
"... | Returns an new handler based on this one, but including given
query detection |pattern|. If there is already existing pattern,
the new one will be used after.
@param pattern Query detection pattern list
@return New composite handler with given detection pattern
@throws java.util.regex.PatternSyntaxException If |patter... | [
"Returns",
"an",
"new",
"handler",
"based",
"on",
"this",
"one",
"but",
"including",
"given",
"query",
"detection",
"|pattern|",
".",
"If",
"there",
"is",
"already",
"existing",
"pattern",
"the",
"new",
"one",
"will",
"be",
"used",
"after",
"."
] | a383dff20fadc08ec9306f2f1f24b2a7e0047449 | https://github.com/cchantep/acolyte/blob/a383dff20fadc08ec9306f2f1f24b2a7e0047449/jdbc-driver/src/main/java/acolyte/jdbc/AbstractCompositeHandler.java#L119-L134 |
7,710 | cchantep/acolyte | jdbc-driver/src/main/java/acolyte/jdbc/AbstractCompositeHandler.java | AbstractCompositeHandler.queryDetectionPattern | protected Pattern[] queryDetectionPattern(final Pattern... pattern) {
if (pattern == null) {
throw new IllegalArgumentException();
} // end of if
// ---
if (this.queryDetection == null) {
return pattern;
} // end of if
// ---
final Patt... | java | protected Pattern[] queryDetectionPattern(final Pattern... pattern) {
if (pattern == null) {
throw new IllegalArgumentException();
} // end of if
// ---
if (this.queryDetection == null) {
return pattern;
} // end of if
// ---
final Patt... | [
"protected",
"Pattern",
"[",
"]",
"queryDetectionPattern",
"(",
"final",
"Pattern",
"...",
"pattern",
")",
"{",
"if",
"(",
"pattern",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
")",
";",
"}",
"// end of if",
"// ---",
"if",
"(",... | Appends given |pattern| to current query detection.
@param pattern the detection pattern
@return the array of detection patterns
@throws IllegalArgumentException if pattern is null | [
"Appends",
"given",
"|pattern|",
"to",
"current",
"query",
"detection",
"."
] | a383dff20fadc08ec9306f2f1f24b2a7e0047449 | https://github.com/cchantep/acolyte/blob/a383dff20fadc08ec9306f2f1f24b2a7e0047449/jdbc-driver/src/main/java/acolyte/jdbc/AbstractCompositeHandler.java#L154-L181 |
7,711 | cchantep/acolyte | jdbc-driver/src/main/java/acolyte/jdbc/ParameterMetaData.java | ParameterMetaData.Default | public static ParameterDef Default(final int sqlType) {
return new ParameterDef(jdbcTypeMappings.get(sqlType),
parameterModeIn,
sqlType,
jdbcTypeNames.get(sqlType),
jdbcTypePrecisions.... | java | public static ParameterDef Default(final int sqlType) {
return new ParameterDef(jdbcTypeMappings.get(sqlType),
parameterModeIn,
sqlType,
jdbcTypeNames.get(sqlType),
jdbcTypePrecisions.... | [
"public",
"static",
"ParameterDef",
"Default",
"(",
"final",
"int",
"sqlType",
")",
"{",
"return",
"new",
"ParameterDef",
"(",
"jdbcTypeMappings",
".",
"get",
"(",
"sqlType",
")",
",",
"parameterModeIn",
",",
"sqlType",
",",
"jdbcTypeNames",
".",
"get",
"(",
... | Default parameter.
@param sqlType the SQL type for the parameter definition
@return the default definition for a parameter of specified SQL type | [
"Default",
"parameter",
"."
] | a383dff20fadc08ec9306f2f1f24b2a7e0047449 | https://github.com/cchantep/acolyte/blob/a383dff20fadc08ec9306f2f1f24b2a7e0047449/jdbc-driver/src/main/java/acolyte/jdbc/ParameterMetaData.java#L185-L194 |
7,712 | cchantep/acolyte | jdbc-driver/src/main/java/acolyte/jdbc/ParameterMetaData.java | ParameterMetaData.Scaled | public static ParameterDef Scaled(final int sqlType, final int scale) {
return new ParameterDef(jdbcTypeMappings.get(sqlType),
parameterModeIn,
sqlType,
jdbcTypeNames.get(sqlType),
jdb... | java | public static ParameterDef Scaled(final int sqlType, final int scale) {
return new ParameterDef(jdbcTypeMappings.get(sqlType),
parameterModeIn,
sqlType,
jdbcTypeNames.get(sqlType),
jdb... | [
"public",
"static",
"ParameterDef",
"Scaled",
"(",
"final",
"int",
"sqlType",
",",
"final",
"int",
"scale",
")",
"{",
"return",
"new",
"ParameterDef",
"(",
"jdbcTypeMappings",
".",
"get",
"(",
"sqlType",
")",
",",
"parameterModeIn",
",",
"sqlType",
",",
"jdb... | Decimal parameter.
@param sqlType the SQL type for the parameter definition
@param scale the scale of the numeric parameter
@return the parameter definition for a number with specified scale | [
"Decimal",
"parameter",
"."
] | a383dff20fadc08ec9306f2f1f24b2a7e0047449 | https://github.com/cchantep/acolyte/blob/a383dff20fadc08ec9306f2f1f24b2a7e0047449/jdbc-driver/src/main/java/acolyte/jdbc/ParameterMetaData.java#L203-L213 |
7,713 | cchantep/acolyte | jdbc-driver/src/main/java/acolyte/jdbc/ParameterMetaData.java | ParameterMetaData.Float | public static ParameterDef Float(final float f) {
final BigDecimal bd = new BigDecimal(Float.toString(f));
return Scaled(Types.FLOAT, bd.scale());
} | java | public static ParameterDef Float(final float f) {
final BigDecimal bd = new BigDecimal(Float.toString(f));
return Scaled(Types.FLOAT, bd.scale());
} | [
"public",
"static",
"ParameterDef",
"Float",
"(",
"final",
"float",
"f",
")",
"{",
"final",
"BigDecimal",
"bd",
"=",
"new",
"BigDecimal",
"(",
"Float",
".",
"toString",
"(",
"f",
")",
")",
";",
"return",
"Scaled",
"(",
"Types",
".",
"FLOAT",
",",
"bd",... | Float constructor.
@param f the float value for the parameter
@return Parameter definition for given float value | [
"Float",
"constructor",
"."
] | a383dff20fadc08ec9306f2f1f24b2a7e0047449 | https://github.com/cchantep/acolyte/blob/a383dff20fadc08ec9306f2f1f24b2a7e0047449/jdbc-driver/src/main/java/acolyte/jdbc/ParameterMetaData.java#L266-L270 |
7,714 | cchantep/acolyte | jdbc-driver/src/main/java/acolyte/jdbc/ParameterMetaData.java | ParameterMetaData.Double | public static ParameterDef Double(final double d) {
final BigDecimal bd = new BigDecimal(String.format(Locale.US, "%f", d)).
stripTrailingZeros();
return Scaled(Types.DOUBLE, bd.scale());
} | java | public static ParameterDef Double(final double d) {
final BigDecimal bd = new BigDecimal(String.format(Locale.US, "%f", d)).
stripTrailingZeros();
return Scaled(Types.DOUBLE, bd.scale());
} | [
"public",
"static",
"ParameterDef",
"Double",
"(",
"final",
"double",
"d",
")",
"{",
"final",
"BigDecimal",
"bd",
"=",
"new",
"BigDecimal",
"(",
"String",
".",
"format",
"(",
"Locale",
".",
"US",
",",
"\"%f\"",
",",
"d",
")",
")",
".",
"stripTrailingZero... | Double constructor.
@param d the double precision value for the parameter
@return Parameter definition for given double precision value | [
"Double",
"constructor",
"."
] | a383dff20fadc08ec9306f2f1f24b2a7e0047449 | https://github.com/cchantep/acolyte/blob/a383dff20fadc08ec9306f2f1f24b2a7e0047449/jdbc-driver/src/main/java/acolyte/jdbc/ParameterMetaData.java#L290-L295 |
7,715 | cchantep/acolyte | jdbc-driver/src/main/java/acolyte/jdbc/RowList.java | RowList.resultSet | public RowResultSet<R> resultSet(int maxRows) {
if (maxRows <= 0) {
return new RowResultSet<R>(getRows());
} // end of if
return new RowResultSet<R>(getRows().subList(0, maxRows));
} | java | public RowResultSet<R> resultSet(int maxRows) {
if (maxRows <= 0) {
return new RowResultSet<R>(getRows());
} // end of if
return new RowResultSet<R>(getRows().subList(0, maxRows));
} | [
"public",
"RowResultSet",
"<",
"R",
">",
"resultSet",
"(",
"int",
"maxRows",
")",
"{",
"if",
"(",
"maxRows",
"<=",
"0",
")",
"{",
"return",
"new",
"RowResultSet",
"<",
"R",
">",
"(",
"getRows",
"(",
")",
")",
";",
"}",
"// end of if",
"return",
"new"... | Returns result set from these rows.
@param maxRows Limit for the maximum number of rows.
If <= 0 no limit will be set.
If the limit is set and exceeded, the excess rows are silently dropped.
@return ResultSet for this list of rows | [
"Returns",
"result",
"set",
"from",
"these",
"rows",
"."
] | a383dff20fadc08ec9306f2f1f24b2a7e0047449 | https://github.com/cchantep/acolyte/blob/a383dff20fadc08ec9306f2f1f24b2a7e0047449/jdbc-driver/src/main/java/acolyte/jdbc/RowList.java#L84-L90 |
7,716 | cchantep/acolyte | jdbc-driver/src/main/java/acolyte/jdbc/RowList.java | RowList.Column | public static <T> Column<T> Column(final Class<T> columnClass,
final String name) {
return new Column<T>(columnClass, name);
} | java | public static <T> Column<T> Column(final Class<T> columnClass,
final String name) {
return new Column<T>(columnClass, name);
} | [
"public",
"static",
"<",
"T",
">",
"Column",
"<",
"T",
">",
"Column",
"(",
"final",
"Class",
"<",
"T",
">",
"columnClass",
",",
"final",
"String",
"name",
")",
"{",
"return",
"new",
"Column",
"<",
"T",
">",
"(",
"columnClass",
",",
"name",
")",
";"... | Creates column definition.
@param <T> the type of the column
@param columnClass the class of the column
@param name the column name
@return the column definition
@throws IllegalArgumentException if |columnClass| is null,
or |name| is empty. | [
"Creates",
"column",
"definition",
"."
] | a383dff20fadc08ec9306f2f1f24b2a7e0047449 | https://github.com/cchantep/acolyte/blob/a383dff20fadc08ec9306f2f1f24b2a7e0047449/jdbc-driver/src/main/java/acolyte/jdbc/RowList.java#L237-L241 |
7,717 | cchantep/acolyte | jdbc-driver/src/main/java/acolyte/jdbc/RowList.java | RowList.getBlob | public java.sql.Blob getBlob(final Object value) throws SQLException {
if (value instanceof java.sql.Blob) return (java.sql.Blob) value;
if (value instanceof byte[]) {
return new SerialBlob((byte[]) value);
} | java | public java.sql.Blob getBlob(final Object value) throws SQLException {
if (value instanceof java.sql.Blob) return (java.sql.Blob) value;
if (value instanceof byte[]) {
return new SerialBlob((byte[]) value);
} | [
"public",
"java",
".",
"sql",
".",
"Blob",
"getBlob",
"(",
"final",
"Object",
"value",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"value",
"instanceof",
"java",
".",
"sql",
".",
"Blob",
")",
"return",
"(",
"java",
".",
"sql",
".",
"Blob",
")",
"v... | Tries to get BLOB from raw |value|.
@param value the binary value
@return the created BLOB
@throws SQLException if fails to create the BLOB | [
"Tries",
"to",
"get",
"BLOB",
"from",
"raw",
"|value|",
"."
] | a383dff20fadc08ec9306f2f1f24b2a7e0047449 | https://github.com/cchantep/acolyte/blob/a383dff20fadc08ec9306f2f1f24b2a7e0047449/jdbc-driver/src/main/java/acolyte/jdbc/RowList.java#L1549-L1554 |
7,718 | cchantep/acolyte | jdbc-driver/src/main/java/acolyte/jdbc/Connection.java | Connection.createBlob | public Blob createBlob(final byte[] data) throws SQLException {
return new javax.sql.rowset.serial.SerialBlob(data);
} | java | public Blob createBlob(final byte[] data) throws SQLException {
return new javax.sql.rowset.serial.SerialBlob(data);
} | [
"public",
"Blob",
"createBlob",
"(",
"final",
"byte",
"[",
"]",
"data",
")",
"throws",
"SQLException",
"{",
"return",
"new",
"javax",
".",
"sql",
".",
"rowset",
".",
"serial",
".",
"SerialBlob",
"(",
"data",
")",
";",
"}"
] | Returns a BLOB with given |data|.
@param data the binary data
@return the created BLOB
@throws SQLException if fails to create a BLOB | [
"Returns",
"a",
"BLOB",
"with",
"given",
"|data|",
"."
] | a383dff20fadc08ec9306f2f1f24b2a7e0047449 | https://github.com/cchantep/acolyte/blob/a383dff20fadc08ec9306f2f1f24b2a7e0047449/jdbc-driver/src/main/java/acolyte/jdbc/Connection.java#L606-L608 |
7,719 | jaxio/javaee-lab | javaee7-jpa-query-by-example/src/main/java/com/jaxio/jpa/querybyexample/DefaultLuceneQueryBuilder.java | DefaultLuceneQueryBuilder.escapeForFuzzy | private String escapeForFuzzy(String word) {
int length = word.length();
char[] tmp = new char[length * 4];
length = ASCIIFoldingFilter.foldToASCII(word.toCharArray(), 0, tmp, 0, length);
return new String(tmp, 0, length);
} | java | private String escapeForFuzzy(String word) {
int length = word.length();
char[] tmp = new char[length * 4];
length = ASCIIFoldingFilter.foldToASCII(word.toCharArray(), 0, tmp, 0, length);
return new String(tmp, 0, length);
} | [
"private",
"String",
"escapeForFuzzy",
"(",
"String",
"word",
")",
"{",
"int",
"length",
"=",
"word",
".",
"length",
"(",
")",
";",
"char",
"[",
"]",
"tmp",
"=",
"new",
"char",
"[",
"length",
"*",
"4",
"]",
";",
"length",
"=",
"ASCIIFoldingFilter",
"... | Apply same filtering as "custom" analyzer. Lowercase is done by QueryParser for fuzzy search.
@param word word
@return word escaped | [
"Apply",
"same",
"filtering",
"as",
"custom",
"analyzer",
".",
"Lowercase",
"is",
"done",
"by",
"QueryParser",
"for",
"fuzzy",
"search",
"."
] | 61238b967952446d81cc68424a4e809093a77fcf | https://github.com/jaxio/javaee-lab/blob/61238b967952446d81cc68424a4e809093a77fcf/javaee7-jpa-query-by-example/src/main/java/com/jaxio/jpa/querybyexample/DefaultLuceneQueryBuilder.java#L163-L168 |
7,720 | adohe/etcd4j | src/main/java/com/xqbase/etcd4j/EtcdClient.java | EtcdClient.get | public String get(String key) throws EtcdClientException {
Preconditions.checkNotNull(key, "key can't be null");
URI uri = buildUriWithKeyAndParams(key, null);
HttpGet httpGet = new HttpGet(uri);
EtcdResult result = syncExecute(httpGet, new int[] {200, 404}, 100);
if (result.is... | java | public String get(String key) throws EtcdClientException {
Preconditions.checkNotNull(key, "key can't be null");
URI uri = buildUriWithKeyAndParams(key, null);
HttpGet httpGet = new HttpGet(uri);
EtcdResult result = syncExecute(httpGet, new int[] {200, 404}, 100);
if (result.is... | [
"public",
"String",
"get",
"(",
"String",
"key",
")",
"throws",
"EtcdClientException",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"key",
",",
"\"key can't be null\"",
")",
";",
"URI",
"uri",
"=",
"buildUriWithKeyAndParams",
"(",
"key",
",",
"null",
")",
"... | Get the value of a key.
@param key the key
@return the corresponding value | [
"Get",
"the",
"value",
"of",
"a",
"key",
"."
] | 8d30ae9aa5da32d8e78287d61e69861c63538629 | https://github.com/adohe/etcd4j/blob/8d30ae9aa5da32d8e78287d61e69861c63538629/src/main/java/com/xqbase/etcd4j/EtcdClient.java#L87-L101 |
7,721 | adohe/etcd4j | src/main/java/com/xqbase/etcd4j/EtcdClient.java | EtcdClient.set | public void set(String key, String value, int ttl) throws EtcdClientException {
set(key, value, ttl, null);
} | java | public void set(String key, String value, int ttl) throws EtcdClientException {
set(key, value, ttl, null);
} | [
"public",
"void",
"set",
"(",
"String",
"key",
",",
"String",
"value",
",",
"int",
"ttl",
")",
"throws",
"EtcdClientException",
"{",
"set",
"(",
"key",
",",
"value",
",",
"ttl",
",",
"null",
")",
";",
"}"
] | Setting the value of a key with optional key TTL
@param key the key
@param value the value
@param ttl optional key TTL | [
"Setting",
"the",
"value",
"of",
"a",
"key",
"with",
"optional",
"key",
"TTL"
] | 8d30ae9aa5da32d8e78287d61e69861c63538629 | https://github.com/adohe/etcd4j/blob/8d30ae9aa5da32d8e78287d61e69861c63538629/src/main/java/com/xqbase/etcd4j/EtcdClient.java#L118-L120 |
7,722 | adohe/etcd4j | src/main/java/com/xqbase/etcd4j/EtcdClient.java | EtcdClient.delete | public void delete(String key) throws EtcdClientException {
Preconditions.checkNotNull(key);
URI uri = buildUriWithKeyAndParams(key, null);
HttpDelete delete = new HttpDelete(uri);
syncExecute(delete, new int[]{200, 404});
} | java | public void delete(String key) throws EtcdClientException {
Preconditions.checkNotNull(key);
URI uri = buildUriWithKeyAndParams(key, null);
HttpDelete delete = new HttpDelete(uri);
syncExecute(delete, new int[]{200, 404});
} | [
"public",
"void",
"delete",
"(",
"String",
"key",
")",
"throws",
"EtcdClientException",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"key",
")",
";",
"URI",
"uri",
"=",
"buildUriWithKeyAndParams",
"(",
"key",
",",
"null",
")",
";",
"HttpDelete",
"delete",
... | Delete a key
@param key the key
// @return operation result | [
"Delete",
"a",
"key"
] | 8d30ae9aa5da32d8e78287d61e69861c63538629 | https://github.com/adohe/etcd4j/blob/8d30ae9aa5da32d8e78287d61e69861c63538629/src/main/java/com/xqbase/etcd4j/EtcdClient.java#L150-L157 |
7,723 | adohe/etcd4j | src/main/java/com/xqbase/etcd4j/EtcdClient.java | EtcdClient.listDir | public List<EtcdNode> listDir(String key, boolean recursive) throws EtcdClientException {
Preconditions.checkNotNull(key);
Map<String, String> params = new HashMap<String, String>();
if (recursive) {
params.put("recursive", String.valueOf(true));
}
URI uri = buildUr... | java | public List<EtcdNode> listDir(String key, boolean recursive) throws EtcdClientException {
Preconditions.checkNotNull(key);
Map<String, String> params = new HashMap<String, String>();
if (recursive) {
params.put("recursive", String.valueOf(true));
}
URI uri = buildUr... | [
"public",
"List",
"<",
"EtcdNode",
">",
"listDir",
"(",
"String",
"key",
",",
"boolean",
"recursive",
")",
"throws",
"EtcdClientException",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"key",
")",
";",
"Map",
"<",
"String",
",",
"String",
">",
"params",
... | Listing a directory with recursive
@param key the dir key
@param recursive recursive
@return CEtcdNode list
@throws EtcdClientException | [
"Listing",
"a",
"directory",
"with",
"recursive"
] | 8d30ae9aa5da32d8e78287d61e69861c63538629 | https://github.com/adohe/etcd4j/blob/8d30ae9aa5da32d8e78287d61e69861c63538629/src/main/java/com/xqbase/etcd4j/EtcdClient.java#L217-L234 |
7,724 | adohe/etcd4j | src/main/java/com/xqbase/etcd4j/EtcdClient.java | EtcdClient.deleteDir | public void deleteDir(String key, boolean recursive) throws EtcdClientException {
Preconditions.checkNotNull(key);
Map<String, String> params = new HashMap<String, String>();
if (recursive) {
params.put("recursive", String.valueOf(true));
} else {
params.put("dir... | java | public void deleteDir(String key, boolean recursive) throws EtcdClientException {
Preconditions.checkNotNull(key);
Map<String, String> params = new HashMap<String, String>();
if (recursive) {
params.put("recursive", String.valueOf(true));
} else {
params.put("dir... | [
"public",
"void",
"deleteDir",
"(",
"String",
"key",
",",
"boolean",
"recursive",
")",
"throws",
"EtcdClientException",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"key",
")",
";",
"Map",
"<",
"String",
",",
"String",
">",
"params",
"=",
"new",
"HashMap"... | Deleting a directory
@param key the dir key
@param recursive set recursive=true if the directory holds keys
// @return operation result
@throws EtcdClientException | [
"Deleting",
"a",
"directory"
] | 8d30ae9aa5da32d8e78287d61e69861c63538629 | https://github.com/adohe/etcd4j/blob/8d30ae9aa5da32d8e78287d61e69861c63538629/src/main/java/com/xqbase/etcd4j/EtcdClient.java#L243-L257 |
7,725 | adohe/etcd4j | src/main/java/com/xqbase/etcd4j/EtcdClient.java | EtcdClient.cas | public EtcdResult cas(String key, String value, Map<String, String> params) throws EtcdClientException {
List<BasicNameValuePair> data = Lists.newArrayList();
data.add(new BasicNameValuePair("value", value));
return put(key, data, params, new int[] {200, 412}, 101, 105);
} | java | public EtcdResult cas(String key, String value, Map<String, String> params) throws EtcdClientException {
List<BasicNameValuePair> data = Lists.newArrayList();
data.add(new BasicNameValuePair("value", value));
return put(key, data, params, new int[] {200, 412}, 101, 105);
} | [
"public",
"EtcdResult",
"cas",
"(",
"String",
"key",
",",
"String",
"value",
",",
"Map",
"<",
"String",
",",
"String",
">",
"params",
")",
"throws",
"EtcdClientException",
"{",
"List",
"<",
"BasicNameValuePair",
">",
"data",
"=",
"Lists",
".",
"newArrayList"... | Atomic Compare-and-Swap
@param key the key
@param value the new value
@param params comparable conditions
@return operation result
@throws EtcdClientException | [
"Atomic",
"Compare",
"-",
"and",
"-",
"Swap"
] | 8d30ae9aa5da32d8e78287d61e69861c63538629 | https://github.com/adohe/etcd4j/blob/8d30ae9aa5da32d8e78287d61e69861c63538629/src/main/java/com/xqbase/etcd4j/EtcdClient.java#L267-L272 |
7,726 | adohe/etcd4j | src/main/java/com/xqbase/etcd4j/EtcdClient.java | EtcdClient.cad | public EtcdResult cad(String key, Map<String, String> params) throws EtcdClientException {
URI uri = buildUriWithKeyAndParams(key, params);
HttpDelete httpDelete = new HttpDelete(uri);
return syncExecute(httpDelete, new int[] {200, 412}, 101);
} | java | public EtcdResult cad(String key, Map<String, String> params) throws EtcdClientException {
URI uri = buildUriWithKeyAndParams(key, params);
HttpDelete httpDelete = new HttpDelete(uri);
return syncExecute(httpDelete, new int[] {200, 412}, 101);
} | [
"public",
"EtcdResult",
"cad",
"(",
"String",
"key",
",",
"Map",
"<",
"String",
",",
"String",
">",
"params",
")",
"throws",
"EtcdClientException",
"{",
"URI",
"uri",
"=",
"buildUriWithKeyAndParams",
"(",
"key",
",",
"params",
")",
";",
"HttpDelete",
"httpDe... | Atomic Compare-and-Delete
@param key the key
@param params comparable conditions
@return operation result
@throws EtcdClientException | [
"Atomic",
"Compare",
"-",
"and",
"-",
"Delete"
] | 8d30ae9aa5da32d8e78287d61e69861c63538629 | https://github.com/adohe/etcd4j/blob/8d30ae9aa5da32d8e78287d61e69861c63538629/src/main/java/com/xqbase/etcd4j/EtcdClient.java#L281-L286 |
7,727 | adohe/etcd4j | src/main/java/com/xqbase/etcd4j/EtcdClient.java | EtcdClient.watch | public ListenableFuture<EtcdResult> watch(String key, long index, boolean recursive) {
Map<String, String> params = new HashMap<String, String>();
params.put("wait", String.valueOf(true));
if (index > 0) {
params.put("waitIndex", String.valueOf(index));
}
if (recursiv... | java | public ListenableFuture<EtcdResult> watch(String key, long index, boolean recursive) {
Map<String, String> params = new HashMap<String, String>();
params.put("wait", String.valueOf(true));
if (index > 0) {
params.put("waitIndex", String.valueOf(index));
}
if (recursiv... | [
"public",
"ListenableFuture",
"<",
"EtcdResult",
">",
"watch",
"(",
"String",
"key",
",",
"long",
"index",
",",
"boolean",
"recursive",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"params",
"=",
"new",
"HashMap",
"<",
"String",
",",
"String",
">"... | Watch for a change on a key
@param key the key
@param index the wait index
@param recursive set recursive true if you want to watch for child keys
@return a future result | [
"Watch",
"for",
"a",
"change",
"on",
"a",
"key"
] | 8d30ae9aa5da32d8e78287d61e69861c63538629 | https://github.com/adohe/etcd4j/blob/8d30ae9aa5da32d8e78287d61e69861c63538629/src/main/java/com/xqbase/etcd4j/EtcdClient.java#L304-L318 |
7,728 | adohe/etcd4j | src/main/java/com/xqbase/etcd4j/EtcdClient.java | EtcdClient.put | private EtcdResult put(String key, List<BasicNameValuePair> data, Map<String, String> params, int[] expectedHttpStatusCodes,
int... expectedErrorCodes) throws EtcdClientException {
URI uri = buildUriWithKeyAndParams(key, params);
HttpPut httpPut = new HttpPut(uri);
UrlEncodedFor... | java | private EtcdResult put(String key, List<BasicNameValuePair> data, Map<String, String> params, int[] expectedHttpStatusCodes,
int... expectedErrorCodes) throws EtcdClientException {
URI uri = buildUriWithKeyAndParams(key, params);
HttpPut httpPut = new HttpPut(uri);
UrlEncodedFor... | [
"private",
"EtcdResult",
"put",
"(",
"String",
"key",
",",
"List",
"<",
"BasicNameValuePair",
">",
"data",
",",
"Map",
"<",
"String",
",",
"String",
">",
"params",
",",
"int",
"[",
"]",
"expectedHttpStatusCodes",
",",
"int",
"...",
"expectedErrorCodes",
")",... | The basic put operation | [
"The",
"basic",
"put",
"operation"
] | 8d30ae9aa5da32d8e78287d61e69861c63538629 | https://github.com/adohe/etcd4j/blob/8d30ae9aa5da32d8e78287d61e69861c63538629/src/main/java/com/xqbase/etcd4j/EtcdClient.java#L335-L344 |
7,729 | adohe/etcd4j | src/main/java/com/xqbase/etcd4j/EtcdClient.java | EtcdClient.buildUriWithKeyAndParams | private URI buildUriWithKeyAndParams(String key, Map<String, String> params) {
StringBuilder sb = new StringBuilder();
sb.append(URI_PREFIX);
if (key.startsWith("/")) {
key = key.substring(1);
}
for (String token : Splitter.on("/").split(key)) {
sb.append(... | java | private URI buildUriWithKeyAndParams(String key, Map<String, String> params) {
StringBuilder sb = new StringBuilder();
sb.append(URI_PREFIX);
if (key.startsWith("/")) {
key = key.substring(1);
}
for (String token : Splitter.on("/").split(key)) {
sb.append(... | [
"private",
"URI",
"buildUriWithKeyAndParams",
"(",
"String",
"key",
",",
"Map",
"<",
"String",
",",
"String",
">",
"params",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"sb",
".",
"append",
"(",
"URI_PREFIX",
")",
";",
"i... | Build url with key and url params | [
"Build",
"url",
"with",
"key",
"and",
"url",
"params"
] | 8d30ae9aa5da32d8e78287d61e69861c63538629 | https://github.com/adohe/etcd4j/blob/8d30ae9aa5da32d8e78287d61e69861c63538629/src/main/java/com/xqbase/etcd4j/EtcdClient.java#L531-L553 |
7,730 | cchantep/acolyte | studio/src/main/java/acolyte/StudioModel.java | StudioModel.setCharset | public void setCharset(final Charset charset) {
final Charset old = this.charset;
this.charset = charset;
this.connectionConfig = System.currentTimeMillis();
this.connectionValidated = false;
this.pcs.firePropertyChange("charset", old, this.charset);
} | java | public void setCharset(final Charset charset) {
final Charset old = this.charset;
this.charset = charset;
this.connectionConfig = System.currentTimeMillis();
this.connectionValidated = false;
this.pcs.firePropertyChange("charset", old, this.charset);
} | [
"public",
"void",
"setCharset",
"(",
"final",
"Charset",
"charset",
")",
"{",
"final",
"Charset",
"old",
"=",
"this",
".",
"charset",
";",
"this",
".",
"charset",
"=",
"charset",
";",
"this",
".",
"connectionConfig",
"=",
"System",
".",
"currentTimeMillis",
... | Sets DB |charset|.
@param charset DB charset
@see #getCharset | [
"Sets",
"DB",
"|charset|",
"."
] | a383dff20fadc08ec9306f2f1f24b2a7e0047449 | https://github.com/cchantep/acolyte/blob/a383dff20fadc08ec9306f2f1f24b2a7e0047449/studio/src/main/java/acolyte/StudioModel.java#L99-L107 |
7,731 | cchantep/acolyte | studio/src/main/java/acolyte/StudioModel.java | StudioModel.setUser | public void setUser(final String user) {
final String old = this.user;
this.user = user;
this.connectionConfig = System.currentTimeMillis();
this.connectionValidated = false;
this.pcs.firePropertyChange("user", old, this.user);
} | java | public void setUser(final String user) {
final String old = this.user;
this.user = user;
this.connectionConfig = System.currentTimeMillis();
this.connectionValidated = false;
this.pcs.firePropertyChange("user", old, this.user);
} | [
"public",
"void",
"setUser",
"(",
"final",
"String",
"user",
")",
"{",
"final",
"String",
"old",
"=",
"this",
".",
"user",
";",
"this",
".",
"user",
"=",
"user",
";",
"this",
".",
"connectionConfig",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
"... | Sets name of DB |user|.
@param user User name
@see #getUser | [
"Sets",
"name",
"of",
"DB",
"|user|",
"."
] | a383dff20fadc08ec9306f2f1f24b2a7e0047449 | https://github.com/cchantep/acolyte/blob/a383dff20fadc08ec9306f2f1f24b2a7e0047449/studio/src/main/java/acolyte/StudioModel.java#L124-L132 |
7,732 | cchantep/acolyte | studio/src/main/java/acolyte/StudioModel.java | StudioModel.setUrl | public void setUrl(final String url) {
final String old = this.url;
this.url = url;
this.connectionConfig = System.currentTimeMillis();
this.connectionValidated = false;
this.pcs.firePropertyChange("url", old, this.url);
} | java | public void setUrl(final String url) {
final String old = this.url;
this.url = url;
this.connectionConfig = System.currentTimeMillis();
this.connectionValidated = false;
this.pcs.firePropertyChange("url", old, this.url);
} | [
"public",
"void",
"setUrl",
"(",
"final",
"String",
"url",
")",
"{",
"final",
"String",
"old",
"=",
"this",
".",
"url",
";",
"this",
".",
"url",
"=",
"url",
";",
"this",
".",
"connectionConfig",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
";",
... | Sets JDBC |url|.
@param url JDBC URL
@see #getUrl | [
"Sets",
"JDBC",
"|url|",
"."
] | a383dff20fadc08ec9306f2f1f24b2a7e0047449 | https://github.com/cchantep/acolyte/blob/a383dff20fadc08ec9306f2f1f24b2a7e0047449/studio/src/main/java/acolyte/StudioModel.java#L166-L174 |
7,733 | cchantep/acolyte | studio/src/main/java/acolyte/StudioModel.java | StudioModel.setDriver | public void setDriver(final Driver driver) {
final Driver old = this.driver;
this.driver = driver;
this.connectionConfig = System.currentTimeMillis();
this.connectionValidated = false;
this.pcs.firePropertyChange("driver", old, this.driver);
} | java | public void setDriver(final Driver driver) {
final Driver old = this.driver;
this.driver = driver;
this.connectionConfig = System.currentTimeMillis();
this.connectionValidated = false;
this.pcs.firePropertyChange("driver", old, this.driver);
} | [
"public",
"void",
"setDriver",
"(",
"final",
"Driver",
"driver",
")",
"{",
"final",
"Driver",
"old",
"=",
"this",
".",
"driver",
";",
"this",
".",
"driver",
"=",
"driver",
";",
"this",
".",
"connectionConfig",
"=",
"System",
".",
"currentTimeMillis",
"(",
... | Sets JDBC |driver|.
@param driver JDBC driver
@see #getDriver | [
"Sets",
"JDBC",
"|driver|",
"."
] | a383dff20fadc08ec9306f2f1f24b2a7e0047449 | https://github.com/cchantep/acolyte/blob/a383dff20fadc08ec9306f2f1f24b2a7e0047449/studio/src/main/java/acolyte/StudioModel.java#L190-L198 |
7,734 | cchantep/acolyte | studio/src/main/java/acolyte/StudioModel.java | StudioModel.setConnectionValidated | public void setConnectionValidated(final boolean validated) {
final boolean old = this.connectionValidated;
this.connectionValidated = validated;
this.pcs.firePropertyChange("connectionValidated",
old, this.connectionValidated);
} | java | public void setConnectionValidated(final boolean validated) {
final boolean old = this.connectionValidated;
this.connectionValidated = validated;
this.pcs.firePropertyChange("connectionValidated",
old, this.connectionValidated);
} | [
"public",
"void",
"setConnectionValidated",
"(",
"final",
"boolean",
"validated",
")",
"{",
"final",
"boolean",
"old",
"=",
"this",
".",
"connectionValidated",
";",
"this",
".",
"connectionValidated",
"=",
"validated",
";",
"this",
".",
"pcs",
".",
"fireProperty... | Sets whether connection is |validated|.
@param validated Connection validated?
@see #isConnectionValidated | [
"Sets",
"whether",
"connection",
"is",
"|validated|",
"."
] | a383dff20fadc08ec9306f2f1f24b2a7e0047449 | https://github.com/cchantep/acolyte/blob/a383dff20fadc08ec9306f2f1f24b2a7e0047449/studio/src/main/java/acolyte/StudioModel.java#L214-L221 |
7,735 | cchantep/acolyte | studio/src/main/java/acolyte/StudioModel.java | StudioModel.setProcessing | public void setProcessing(final boolean processing) {
final boolean old = this.processing;
this.processing = processing;
this.pcs.firePropertyChange("processing", old, this.processing);
} | java | public void setProcessing(final boolean processing) {
final boolean old = this.processing;
this.processing = processing;
this.pcs.firePropertyChange("processing", old, this.processing);
} | [
"public",
"void",
"setProcessing",
"(",
"final",
"boolean",
"processing",
")",
"{",
"final",
"boolean",
"old",
"=",
"this",
".",
"processing",
";",
"this",
".",
"processing",
"=",
"processing",
";",
"this",
".",
"pcs",
".",
"firePropertyChange",
"(",
"\"proc... | Sets whether is |processing|.
@param processing Is processing?
@see #isProcessing | [
"Sets",
"whether",
"is",
"|processing|",
"."
] | a383dff20fadc08ec9306f2f1f24b2a7e0047449 | https://github.com/cchantep/acolyte/blob/a383dff20fadc08ec9306f2f1f24b2a7e0047449/studio/src/main/java/acolyte/StudioModel.java#L237-L242 |
7,736 | cchantep/acolyte | jdbc-driver/src/main/java/acolyte/jdbc/Driver.java | Driver.connect | public acolyte.jdbc.Connection connect(final String url,
final Property... info)
throws SQLException {
return connect(url, props(info));
} | java | public acolyte.jdbc.Connection connect(final String url,
final Property... info)
throws SQLException {
return connect(url, props(info));
} | [
"public",
"acolyte",
".",
"jdbc",
".",
"Connection",
"connect",
"(",
"final",
"String",
"url",
",",
"final",
"Property",
"...",
"info",
")",
"throws",
"SQLException",
"{",
"return",
"connect",
"(",
"url",
",",
"props",
"(",
"info",
")",
")",
";",
"}"
] | Creates a connection to specified |url| with given configuration |info|.
@param url the JDBC URL
@param info the properties for the new connection
@return the configured connection
@throws SQLException if fails to connect
@see #connect(java.lang.String, java.util.Properties) | [
"Creates",
"a",
"connection",
"to",
"specified",
"|url|",
"with",
"given",
"configuration",
"|info|",
"."
] | a383dff20fadc08ec9306f2f1f24b2a7e0047449 | https://github.com/cchantep/acolyte/blob/a383dff20fadc08ec9306f2f1f24b2a7e0047449/jdbc-driver/src/main/java/acolyte/jdbc/Driver.java#L99-L104 |
7,737 | cchantep/acolyte | jdbc-driver/src/main/java/acolyte/jdbc/Driver.java | Driver.unregister | public static ConnectionHandler unregister(final String id) {
if (id == null || id.length() == 0) {
return null; // Not possible
} // end of if
return handlers.remove(id);
} | java | public static ConnectionHandler unregister(final String id) {
if (id == null || id.length() == 0) {
return null; // Not possible
} // end of if
return handlers.remove(id);
} | [
"public",
"static",
"ConnectionHandler",
"unregister",
"(",
"final",
"String",
"id",
")",
"{",
"if",
"(",
"id",
"==",
"null",
"||",
"id",
".",
"length",
"(",
")",
"==",
"0",
")",
"{",
"return",
"null",
";",
"// Not possible",
"}",
"// end of if",
"return... | Unregisters specified handler.
@param id Handler ID
@return Handler, or null if none
@see #register | [
"Unregisters",
"specified",
"handler",
"."
] | a383dff20fadc08ec9306f2f1f24b2a7e0047449 | https://github.com/cchantep/acolyte/blob/a383dff20fadc08ec9306f2f1f24b2a7e0047449/jdbc-driver/src/main/java/acolyte/jdbc/Driver.java#L308-L314 |
7,738 | cchantep/acolyte | jdbc-driver/src/main/java/acolyte/jdbc/Driver.java | Driver.props | private static Properties props(final Property[] info) {
final Properties ps = new Properties();
for (final Property p : info) {
ps.put(p.name, p.value);
}
return ps;
} | java | private static Properties props(final Property[] info) {
final Properties ps = new Properties();
for (final Property p : info) {
ps.put(p.name, p.value);
}
return ps;
} | [
"private",
"static",
"Properties",
"props",
"(",
"final",
"Property",
"[",
"]",
"info",
")",
"{",
"final",
"Properties",
"ps",
"=",
"new",
"Properties",
"(",
")",
";",
"for",
"(",
"final",
"Property",
"p",
":",
"info",
")",
"{",
"ps",
".",
"put",
"("... | Returns prepared properties.
@param info the connection information
@return the connection properties | [
"Returns",
"prepared",
"properties",
"."
] | a383dff20fadc08ec9306f2f1f24b2a7e0047449 | https://github.com/cchantep/acolyte/blob/a383dff20fadc08ec9306f2f1f24b2a7e0047449/jdbc-driver/src/main/java/acolyte/jdbc/Driver.java#L322-L330 |
7,739 | abola/CrawlerPack | src/main/java/com/github/abola/crawler/CrawlerPack.java | CrawlerPack.addCookie | public CrawlerPack addCookie(String name, String value){
if( null == name ) {
log.warn("addCookie: Cookie name null.");
return this;
}
cookies.add( new Cookie("", name, value) );
return this;
} | java | public CrawlerPack addCookie(String name, String value){
if( null == name ) {
log.warn("addCookie: Cookie name null.");
return this;
}
cookies.add( new Cookie("", name, value) );
return this;
} | [
"public",
"CrawlerPack",
"addCookie",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"if",
"(",
"null",
"==",
"name",
")",
"{",
"log",
".",
"warn",
"(",
"\"addCookie: Cookie name null.\"",
")",
";",
"return",
"this",
";",
"}",
"cookies",
".",
"... | Creates a cookie with the given name and value.
@param name the cookie name
@param value the cookie value
@return CrawlerPack | [
"Creates",
"a",
"cookie",
"with",
"the",
"given",
"name",
"and",
"value",
"."
] | a7b7703b7fad519994dc04a9c51d90adc11d618f | https://github.com/abola/CrawlerPack/blob/a7b7703b7fad519994dc04a9c51d90adc11d618f/src/main/java/com/github/abola/crawler/CrawlerPack.java#L113-L122 |
7,740 | abola/CrawlerPack | src/main/java/com/github/abola/crawler/CrawlerPack.java | CrawlerPack.addCookie | public CrawlerPack addCookie(String domain, String name, String value,
String path, Date expires, boolean secure) {
if( null == name ) {
log.warn("addCookie: Cookie name null.");
return this;
}
cookies.add(new Cookie(domain, name, value, ... | java | public CrawlerPack addCookie(String domain, String name, String value,
String path, Date expires, boolean secure) {
if( null == name ) {
log.warn("addCookie: Cookie name null.");
return this;
}
cookies.add(new Cookie(domain, name, value, ... | [
"public",
"CrawlerPack",
"addCookie",
"(",
"String",
"domain",
",",
"String",
"name",
",",
"String",
"value",
",",
"String",
"path",
",",
"Date",
"expires",
",",
"boolean",
"secure",
")",
"{",
"if",
"(",
"null",
"==",
"name",
")",
"{",
"log",
".",
"war... | Creates a cookie with the given name, value, domain attribute,
path attribute, expiration attribute, and secure attribute
@param name the cookie name
@param value the cookie value
@param domain the domain this cookie can be sent to
@param path the path prefix for which this cookie can be sent
@param expires t... | [
"Creates",
"a",
"cookie",
"with",
"the",
"given",
"name",
"value",
"domain",
"attribute",
"path",
"attribute",
"expiration",
"attribute",
"and",
"secure",
"attribute"
] | a7b7703b7fad519994dc04a9c51d90adc11d618f | https://github.com/abola/CrawlerPack/blob/a7b7703b7fad519994dc04a9c51d90adc11d618f/src/main/java/com/github/abola/crawler/CrawlerPack.java#L139-L148 |
7,741 | abola/CrawlerPack | src/main/java/com/github/abola/crawler/CrawlerPack.java | CrawlerPack.getCookies | Cookie[] getCookies(String uri){
if( null == cookies || 0 == cookies.size()) return null;
for(Cookie cookie: cookies){
if("".equals(cookie.getDomain())){
String domain = uri.replaceAll("^.*:\\/\\/([^\\/]+)[\\/]?.*$", "$1");
cookie.setDomain(domain);
... | java | Cookie[] getCookies(String uri){
if( null == cookies || 0 == cookies.size()) return null;
for(Cookie cookie: cookies){
if("".equals(cookie.getDomain())){
String domain = uri.replaceAll("^.*:\\/\\/([^\\/]+)[\\/]?.*$", "$1");
cookie.setDomain(domain);
... | [
"Cookie",
"[",
"]",
"getCookies",
"(",
"String",
"uri",
")",
"{",
"if",
"(",
"null",
"==",
"cookies",
"||",
"0",
"==",
"cookies",
".",
"size",
"(",
")",
")",
"return",
"null",
";",
"for",
"(",
"Cookie",
"cookie",
":",
"cookies",
")",
"{",
"if",
"... | Return a Cookie array
and auto importing domain and path when domain was empty.
@param uri required Apache Common VFS supported file systems and response JSON format content.
@return Cookie[] | [
"Return",
"a",
"Cookie",
"array",
"and",
"auto",
"importing",
"domain",
"and",
"path",
"when",
"domain",
"was",
"empty",
"."
] | a7b7703b7fad519994dc04a9c51d90adc11d618f | https://github.com/abola/CrawlerPack/blob/a7b7703b7fad519994dc04a9c51d90adc11d618f/src/main/java/com/github/abola/crawler/CrawlerPack.java#L157-L172 |
7,742 | abola/CrawlerPack | src/main/java/com/github/abola/crawler/CrawlerPack.java | CrawlerPack.detectCharset | private String detectCharset(byte[] content, Integer offset){
log.debug("detectCharset: offset=" + offset);
// detect failed
if( offset > content.length ) return null;
UniversalDetector detector = new UniversalDetector(null);
detector.handleData(content, offset, content.length ... | java | private String detectCharset(byte[] content, Integer offset){
log.debug("detectCharset: offset=" + offset);
// detect failed
if( offset > content.length ) return null;
UniversalDetector detector = new UniversalDetector(null);
detector.handleData(content, offset, content.length ... | [
"private",
"String",
"detectCharset",
"(",
"byte",
"[",
"]",
"content",
",",
"Integer",
"offset",
")",
"{",
"log",
".",
"debug",
"(",
"\"detectCharset: offset=\"",
"+",
"offset",
")",
";",
"// detect failed",
"if",
"(",
"offset",
">",
"content",
".",
"length... | Detecting real content encoding
@param content
@param offset
@return real charset encoding | [
"Detecting",
"real",
"content",
"encoding"
] | a7b7703b7fad519994dc04a9c51d90adc11d618f | https://github.com/abola/CrawlerPack/blob/a7b7703b7fad519994dc04a9c51d90adc11d618f/src/main/java/com/github/abola/crawler/CrawlerPack.java#L404-L417 |
7,743 | cchantep/acolyte | jdbc-java8/src/main/java/acolyte/jdbc/Java8CompositeHandler.java | Java8CompositeHandler.withUpdateHandler1 | public Java8CompositeHandler withUpdateHandler1(CountUpdateHandler h) {
final UpdateHandler uh = new UpdateHandler() {
public UpdateResult apply(String sql, List<Parameter> ps) {
return new UpdateResult(h.apply(sql, ps));
}
};
retu... | java | public Java8CompositeHandler withUpdateHandler1(CountUpdateHandler h) {
final UpdateHandler uh = new UpdateHandler() {
public UpdateResult apply(String sql, List<Parameter> ps) {
return new UpdateResult(h.apply(sql, ps));
}
};
retu... | [
"public",
"Java8CompositeHandler",
"withUpdateHandler1",
"(",
"CountUpdateHandler",
"h",
")",
"{",
"final",
"UpdateHandler",
"uh",
"=",
"new",
"UpdateHandler",
"(",
")",
"{",
"public",
"UpdateResult",
"apply",
"(",
"String",
"sql",
",",
"List",
"<",
"Parameter",
... | Returns handler that delegates update execution to |h| function.
Given function will be used only if executed statement is not detected
as a query by withQueryDetection.
@param h the new update handler
<pre>
{@code
import acolyte.jdbc.UpdateResult;
import acolyte.jdbc.StatementHandler.Parameter;
import static acolyte... | [
"Returns",
"handler",
"that",
"delegates",
"update",
"execution",
"to",
"|h|",
"function",
".",
"Given",
"function",
"will",
"be",
"used",
"only",
"if",
"executed",
"statement",
"is",
"not",
"detected",
"as",
"a",
"query",
"by",
"withQueryDetection",
"."
] | a383dff20fadc08ec9306f2f1f24b2a7e0047449 | https://github.com/cchantep/acolyte/blob/a383dff20fadc08ec9306f2f1f24b2a7e0047449/jdbc-java8/src/main/java/acolyte/jdbc/Java8CompositeHandler.java#L199-L207 |
7,744 | cchantep/acolyte | jdbc-driver/src/main/java/acolyte/jdbc/CompositeHandler.java | CompositeHandler.withQueryHandler | public CompositeHandler withQueryHandler(final QueryHandler handler) {
if (handler == null) {
throw new IllegalArgumentException();
} // end of if
// ---
return new CompositeHandler(this.queryDetection,
handler,
... | java | public CompositeHandler withQueryHandler(final QueryHandler handler) {
if (handler == null) {
throw new IllegalArgumentException();
} // end of if
// ---
return new CompositeHandler(this.queryDetection,
handler,
... | [
"public",
"CompositeHandler",
"withQueryHandler",
"(",
"final",
"QueryHandler",
"handler",
")",
"{",
"if",
"(",
"handler",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
")",
";",
"}",
"// end of if",
"// ---",
"return",
"new",
"Composi... | Returns a new handler based on this one,
but with given query |handler| appended.
@param handler Query handler
@return a new composite handler with given query handler
@throws IllegalArgumentException if handler is null | [
"Returns",
"a",
"new",
"handler",
"based",
"on",
"this",
"one",
"but",
"with",
"given",
"query",
"|handler|",
"appended",
"."
] | a383dff20fadc08ec9306f2f1f24b2a7e0047449 | https://github.com/cchantep/acolyte/blob/a383dff20fadc08ec9306f2f1f24b2a7e0047449/jdbc-driver/src/main/java/acolyte/jdbc/CompositeHandler.java#L61-L72 |
7,745 | cchantep/acolyte | jdbc-driver/src/main/java/acolyte/jdbc/CompositeHandler.java | CompositeHandler.withUpdateHandler | public CompositeHandler withUpdateHandler(final UpdateHandler handler) {
if (handler == null) {
throw new IllegalArgumentException();
} // end of if
// ---
return new CompositeHandler(this.queryDetection,
this.queryHandler,
... | java | public CompositeHandler withUpdateHandler(final UpdateHandler handler) {
if (handler == null) {
throw new IllegalArgumentException();
} // end of if
// ---
return new CompositeHandler(this.queryDetection,
this.queryHandler,
... | [
"public",
"CompositeHandler",
"withUpdateHandler",
"(",
"final",
"UpdateHandler",
"handler",
")",
"{",
"if",
"(",
"handler",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
")",
";",
"}",
"// end of if",
"// ---",
"return",
"new",
"Compo... | Returns a new handler based on this one,
but with given update |handler| appended.
@param handler Update handler
@return a new composite handler with given update handler
@throws IllegalArgumentException if handler is null | [
"Returns",
"a",
"new",
"handler",
"based",
"on",
"this",
"one",
"but",
"with",
"given",
"update",
"|handler|",
"appended",
"."
] | a383dff20fadc08ec9306f2f1f24b2a7e0047449 | https://github.com/cchantep/acolyte/blob/a383dff20fadc08ec9306f2f1f24b2a7e0047449/jdbc-driver/src/main/java/acolyte/jdbc/CompositeHandler.java#L82-L93 |
7,746 | cchantep/acolyte | jdbc-driver/src/main/java/acolyte/jdbc/PreparedStatement.java | PreparedStatement.generateKeysResultSet | private ResultSet generateKeysResultSet(final UpdateResult res) {
if (this.generatedKeysColumnIndexes == null &&
this.generatedKeysColumnNames == null) {
return res.generatedKeys.resultSet().withStatement(this);
} else if (this.generatedKeysColumnIndexes != null) {
r... | java | private ResultSet generateKeysResultSet(final UpdateResult res) {
if (this.generatedKeysColumnIndexes == null &&
this.generatedKeysColumnNames == null) {
return res.generatedKeys.resultSet().withStatement(this);
} else if (this.generatedKeysColumnIndexes != null) {
r... | [
"private",
"ResultSet",
"generateKeysResultSet",
"(",
"final",
"UpdateResult",
"res",
")",
"{",
"if",
"(",
"this",
".",
"generatedKeysColumnIndexes",
"==",
"null",
"&&",
"this",
".",
"generatedKeysColumnNames",
"==",
"null",
")",
"{",
"return",
"res",
".",
"gene... | Returns the resultset corresponding to the keys generated on update. | [
"Returns",
"the",
"resultset",
"corresponding",
"to",
"the",
"keys",
"generated",
"on",
"update",
"."
] | a383dff20fadc08ec9306f2f1f24b2a7e0047449 | https://github.com/cchantep/acolyte/blob/a383dff20fadc08ec9306f2f1f24b2a7e0047449/jdbc-driver/src/main/java/acolyte/jdbc/PreparedStatement.java#L252-L265 |
7,747 | cchantep/acolyte | jdbc-driver/src/main/java/acolyte/jdbc/PreparedStatement.java | PreparedStatement.setDecimal | void setDecimal(final int parameterIndex,
final BigDecimal x) throws SQLException {
final ParameterDef def = (x == null) ? Decimal : Decimal(x);
setParam(parameterIndex, def, x);
} | java | void setDecimal(final int parameterIndex,
final BigDecimal x) throws SQLException {
final ParameterDef def = (x == null) ? Decimal : Decimal(x);
setParam(parameterIndex, def, x);
} | [
"void",
"setDecimal",
"(",
"final",
"int",
"parameterIndex",
",",
"final",
"BigDecimal",
"x",
")",
"throws",
"SQLException",
"{",
"final",
"ParameterDef",
"def",
"=",
"(",
"x",
"==",
"null",
")",
"?",
"Decimal",
":",
"Decimal",
"(",
"x",
")",
";",
"setPa... | Sets parameter as DECIMAL.
@throws SQLException if fails to set the big decimal value | [
"Sets",
"parameter",
"as",
"DECIMAL",
"."
] | a383dff20fadc08ec9306f2f1f24b2a7e0047449 | https://github.com/cchantep/acolyte/blob/a383dff20fadc08ec9306f2f1f24b2a7e0047449/jdbc-driver/src/main/java/acolyte/jdbc/PreparedStatement.java#L993-L999 |
7,748 | cchantep/acolyte | jdbc-driver/src/main/java/acolyte/jdbc/PreparedStatement.java | PreparedStatement.normalizeClassName | private String normalizeClassName(final Class<?> c) {
if (Blob.class.isAssignableFrom(c)) return "java.sql.Blob";
else if (Array.class.isAssignableFrom(c)) return "java.sql.Array";
return c.getName();
} | java | private String normalizeClassName(final Class<?> c) {
if (Blob.class.isAssignableFrom(c)) return "java.sql.Blob";
else if (Array.class.isAssignableFrom(c)) return "java.sql.Array";
return c.getName();
} | [
"private",
"String",
"normalizeClassName",
"(",
"final",
"Class",
"<",
"?",
">",
"c",
")",
"{",
"if",
"(",
"Blob",
".",
"class",
".",
"isAssignableFrom",
"(",
"c",
")",
")",
"return",
"\"java.sql.Blob\"",
";",
"else",
"if",
"(",
"Array",
".",
"class",
... | Normalizes parameter class name. | [
"Normalizes",
"parameter",
"class",
"name",
"."
] | a383dff20fadc08ec9306f2f1f24b2a7e0047449 | https://github.com/cchantep/acolyte/blob/a383dff20fadc08ec9306f2f1f24b2a7e0047449/jdbc-driver/src/main/java/acolyte/jdbc/PreparedStatement.java#L1041-L1046 |
7,749 | cchantep/acolyte | jdbc-driver/src/main/java/acolyte/jdbc/PreparedStatement.java | PreparedStatement.createBytes | private byte[] createBytes(InputStream stream, long length)
throws SQLException {
ByteArrayOutputStream buff = null;
try {
buff = new ByteArrayOutputStream();
if (length > 0) IOUtils.copyLarge(stream, buff, 0, length);
else IOUtils.copy(stream, buff);
... | java | private byte[] createBytes(InputStream stream, long length)
throws SQLException {
ByteArrayOutputStream buff = null;
try {
buff = new ByteArrayOutputStream();
if (length > 0) IOUtils.copyLarge(stream, buff, 0, length);
else IOUtils.copy(stream, buff);
... | [
"private",
"byte",
"[",
"]",
"createBytes",
"(",
"InputStream",
"stream",
",",
"long",
"length",
")",
"throws",
"SQLException",
"{",
"ByteArrayOutputStream",
"buff",
"=",
"null",
";",
"try",
"{",
"buff",
"=",
"new",
"ByteArrayOutputStream",
"(",
")",
";",
"i... | Creates bytes array from input stream.
@param stream Input stream
@param length | [
"Creates",
"bytes",
"array",
"from",
"input",
"stream",
"."
] | a383dff20fadc08ec9306f2f1f24b2a7e0047449 | https://github.com/cchantep/acolyte/blob/a383dff20fadc08ec9306f2f1f24b2a7e0047449/jdbc-driver/src/main/java/acolyte/jdbc/PreparedStatement.java#L1054-L1071 |
7,750 | cchantep/acolyte | jdbc-driver/src/main/java/acolyte/jdbc/PreparedStatement.java | PreparedStatement.createBlob | private acolyte.jdbc.Blob createBlob(InputStream stream, long length)
throws SQLException {
final acolyte.jdbc.Blob blob = acolyte.jdbc.Blob.Nil();
blob.setBytes(0L, createBytes(stream, length));
return blob;
} | java | private acolyte.jdbc.Blob createBlob(InputStream stream, long length)
throws SQLException {
final acolyte.jdbc.Blob blob = acolyte.jdbc.Blob.Nil();
blob.setBytes(0L, createBytes(stream, length));
return blob;
} | [
"private",
"acolyte",
".",
"jdbc",
".",
"Blob",
"createBlob",
"(",
"InputStream",
"stream",
",",
"long",
"length",
")",
"throws",
"SQLException",
"{",
"final",
"acolyte",
".",
"jdbc",
".",
"Blob",
"blob",
"=",
"acolyte",
".",
"jdbc",
".",
"Blob",
".",
"N... | Creates BLOB from input stream.
@param stream Input stream
@param length | [
"Creates",
"BLOB",
"from",
"input",
"stream",
"."
] | a383dff20fadc08ec9306f2f1f24b2a7e0047449 | https://github.com/cchantep/acolyte/blob/a383dff20fadc08ec9306f2f1f24b2a7e0047449/jdbc-driver/src/main/java/acolyte/jdbc/PreparedStatement.java#L1079-L1087 |
7,751 | mygreen/xlsmapper | src/main/java/com/gh/mygreen/xlsmapper/xml/AnnotationReader.java | AnnotationReader.getAnnotation | @SuppressWarnings("unchecked")
public <A extends Annotation> A getAnnotation(final Class<?> clazz, final Class<A> annClass) throws AnnotationReadException {
if(xmlInfo != null && xmlInfo.containsClassInfo(clazz.getName())) {
final ClassInfo classInfo = xmlInfo.getClassInfo(clazz.getName());
... | java | @SuppressWarnings("unchecked")
public <A extends Annotation> A getAnnotation(final Class<?> clazz, final Class<A> annClass) throws AnnotationReadException {
if(xmlInfo != null && xmlInfo.containsClassInfo(clazz.getName())) {
final ClassInfo classInfo = xmlInfo.getClassInfo(clazz.getName());
... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"A",
"extends",
"Annotation",
">",
"A",
"getAnnotation",
"(",
"final",
"Class",
"<",
"?",
">",
"clazz",
",",
"final",
"Class",
"<",
"A",
">",
"annClass",
")",
"throws",
"AnnotationReadExcepti... | Returns a class annotation for the specified type if such an annotation is present, else null.
@param <A> the type of the annotation
@param clazz the target class
@param annClass the Class object corresponding to the annotation type
@return the target class's annotation for the specified annotation type if present on ... | [
"Returns",
"a",
"class",
"annotation",
"for",
"the",
"specified",
"type",
"if",
"such",
"an",
"annotation",
"is",
"present",
"else",
"null",
"."
] | a0c6b25c622e5f3a50b199ef685d2ee46ad5483c | https://github.com/mygreen/xlsmapper/blob/a0c6b25c622e5f3a50b199ef685d2ee46ad5483c/src/main/java/com/gh/mygreen/xlsmapper/xml/AnnotationReader.java#L89-L105 |
7,752 | cchantep/acolyte | studio/src/main/java/acolyte/Studio.java | Studio.studioProcess | private <T> SwingWorker<T,T> studioProcess(final int timeout, final Callable<T> c, final UnaryFunction<Callable<T>,T> f) {
final Callable<T> cw = new Callable<T>() {
public T call() {
final FutureTask<T> t = new FutureTask<T>(c);
try {
executor.s... | java | private <T> SwingWorker<T,T> studioProcess(final int timeout, final Callable<T> c, final UnaryFunction<Callable<T>,T> f) {
final Callable<T> cw = new Callable<T>() {
public T call() {
final FutureTask<T> t = new FutureTask<T>(c);
try {
executor.s... | [
"private",
"<",
"T",
">",
"SwingWorker",
"<",
"T",
",",
"T",
">",
"studioProcess",
"(",
"final",
"int",
"timeout",
",",
"final",
"Callable",
"<",
"T",
">",
"c",
",",
"final",
"UnaryFunction",
"<",
"Callable",
"<",
"T",
">",
",",
"T",
">",
"f",
")",... | Studio process. | [
"Studio",
"process",
"."
] | a383dff20fadc08ec9306f2f1f24b2a7e0047449 | https://github.com/cchantep/acolyte/blob/a383dff20fadc08ec9306f2f1f24b2a7e0047449/studio/src/main/java/acolyte/Studio.java#L1065-L1093 |
7,753 | cchantep/acolyte | studio/src/main/java/acolyte/Studio.java | Studio.closeKeyStrokes | private static final KeyAdapter closeKeyStrokes(final java.awt.Window window) {
return new KeyAdapter() {
public void keyReleased(KeyEvent e) {
final int kc = e.getKeyCode();
if (kc == KeyEvent.VK_ESCAPE ||
kc == KeyEvent.VK_ENTER) {
... | java | private static final KeyAdapter closeKeyStrokes(final java.awt.Window window) {
return new KeyAdapter() {
public void keyReleased(KeyEvent e) {
final int kc = e.getKeyCode();
if (kc == KeyEvent.VK_ESCAPE ||
kc == KeyEvent.VK_ENTER) {
... | [
"private",
"static",
"final",
"KeyAdapter",
"closeKeyStrokes",
"(",
"final",
"java",
".",
"awt",
".",
"Window",
"window",
")",
"{",
"return",
"new",
"KeyAdapter",
"(",
")",
"{",
"public",
"void",
"keyReleased",
"(",
"KeyEvent",
"e",
")",
"{",
"final",
"int... | Listens to key to close a |window|. | [
"Listens",
"to",
"key",
"to",
"close",
"a",
"|window|",
"."
] | a383dff20fadc08ec9306f2f1f24b2a7e0047449 | https://github.com/cchantep/acolyte/blob/a383dff20fadc08ec9306f2f1f24b2a7e0047449/studio/src/main/java/acolyte/Studio.java#L1098-L1108 |
7,754 | cchantep/acolyte | studio/src/main/java/acolyte/Studio.java | Studio.updateConfig | private void updateConfig() {
// JDBC URL
final String u = this.model.getUrl();
final String url = (u != null) ? u.trim() : null;
if (url == null || url.length() == 0) {
this.conf.remove("jdbc.url");
} else {
this.conf.put("jdbc.url", url);
} // e... | java | private void updateConfig() {
// JDBC URL
final String u = this.model.getUrl();
final String url = (u != null) ? u.trim() : null;
if (url == null || url.length() == 0) {
this.conf.remove("jdbc.url");
} else {
this.conf.put("jdbc.url", url);
} // e... | [
"private",
"void",
"updateConfig",
"(",
")",
"{",
"// JDBC URL",
"final",
"String",
"u",
"=",
"this",
".",
"model",
".",
"getUrl",
"(",
")",
";",
"final",
"String",
"url",
"=",
"(",
"u",
"!=",
"null",
")",
"?",
"u",
".",
"trim",
"(",
")",
":",
"n... | Updates application configuration. | [
"Updates",
"application",
"configuration",
"."
] | a383dff20fadc08ec9306f2f1f24b2a7e0047449 | https://github.com/cchantep/acolyte/blob/a383dff20fadc08ec9306f2f1f24b2a7e0047449/studio/src/main/java/acolyte/Studio.java#L1113-L1149 |
7,755 | cchantep/acolyte | studio/src/main/java/acolyte/Studio.java | Studio.getConnection | private Connection getConnection() throws SQLException {
return JDBC.connect(model.getDriver(), model.getUrl(),
model.getUser(), model.getPassword());
} | java | private Connection getConnection() throws SQLException {
return JDBC.connect(model.getDriver(), model.getUrl(),
model.getUser(), model.getPassword());
} | [
"private",
"Connection",
"getConnection",
"(",
")",
"throws",
"SQLException",
"{",
"return",
"JDBC",
".",
"connect",
"(",
"model",
".",
"getDriver",
"(",
")",
",",
"model",
".",
"getUrl",
"(",
")",
",",
"model",
".",
"getUser",
"(",
")",
",",
"model",
... | Returns JDBC connection for configuration in model. | [
"Returns",
"JDBC",
"connection",
"for",
"configuration",
"in",
"model",
"."
] | a383dff20fadc08ec9306f2f1f24b2a7e0047449 | https://github.com/cchantep/acolyte/blob/a383dff20fadc08ec9306f2f1f24b2a7e0047449/studio/src/main/java/acolyte/Studio.java#L1261-L1265 |
7,756 | cchantep/acolyte | studio/src/main/java/acolyte/Studio.java | Studio.tableData | private <A> TableData<A> tableData(final ResultSet rs,
final RowFunction<A> f)
throws SQLException {
final ResultSetMetaData meta = rs.getMetaData();
final int c = meta.getColumnCount();
final TableData<A> td = new TableData<A>();
for (int... | java | private <A> TableData<A> tableData(final ResultSet rs,
final RowFunction<A> f)
throws SQLException {
final ResultSetMetaData meta = rs.getMetaData();
final int c = meta.getColumnCount();
final TableData<A> td = new TableData<A>();
for (int... | [
"private",
"<",
"A",
">",
"TableData",
"<",
"A",
">",
"tableData",
"(",
"final",
"ResultSet",
"rs",
",",
"final",
"RowFunction",
"<",
"A",
">",
"f",
")",
"throws",
"SQLException",
"{",
"final",
"ResultSetMetaData",
"meta",
"=",
"rs",
".",
"getMetaData",
... | Returns table data from |result| set. | [
"Returns",
"table",
"data",
"from",
"|result|",
"set",
"."
] | a383dff20fadc08ec9306f2f1f24b2a7e0047449 | https://github.com/cchantep/acolyte/blob/a383dff20fadc08ec9306f2f1f24b2a7e0047449/studio/src/main/java/acolyte/Studio.java#L1270-L1292 |
7,757 | cchantep/acolyte | studio/src/main/java/acolyte/Studio.java | Studio.setWaitIcon | private static ImageIcon setWaitIcon(final JLabel label) {
final ImageIcon ico =
new ImageIcon(Studio.class.getResource("loader.gif"));
label.setIcon(ico);
ico.setImageObserver(label);
return ico;
} | java | private static ImageIcon setWaitIcon(final JLabel label) {
final ImageIcon ico =
new ImageIcon(Studio.class.getResource("loader.gif"));
label.setIcon(ico);
ico.setImageObserver(label);
return ico;
} | [
"private",
"static",
"ImageIcon",
"setWaitIcon",
"(",
"final",
"JLabel",
"label",
")",
"{",
"final",
"ImageIcon",
"ico",
"=",
"new",
"ImageIcon",
"(",
"Studio",
".",
"class",
".",
"getResource",
"(",
"\"loader.gif\"",
")",
")",
";",
"label",
".",
"setIcon",
... | Sets wait icon on |label|. | [
"Sets",
"wait",
"icon",
"on",
"|label|",
"."
] | a383dff20fadc08ec9306f2f1f24b2a7e0047449 | https://github.com/cchantep/acolyte/blob/a383dff20fadc08ec9306f2f1f24b2a7e0047449/studio/src/main/java/acolyte/Studio.java#L1297-L1305 |
7,758 | cchantep/acolyte | studio/src/main/java/acolyte/Studio.java | Studio.withColRenderers | private JTable withColRenderers(final JTable table) {
// Data renderers
final DefaultTableCellRenderer dtcr = new DefaultTableCellRenderer();
// BigDecimal
table.setDefaultRenderer(BigDecimal.class, new TableCellRenderer() {
public Component getTableCellRendererComponent(fin... | java | private JTable withColRenderers(final JTable table) {
// Data renderers
final DefaultTableCellRenderer dtcr = new DefaultTableCellRenderer();
// BigDecimal
table.setDefaultRenderer(BigDecimal.class, new TableCellRenderer() {
public Component getTableCellRendererComponent(fin... | [
"private",
"JTable",
"withColRenderers",
"(",
"final",
"JTable",
"table",
")",
"{",
"// Data renderers",
"final",
"DefaultTableCellRenderer",
"dtcr",
"=",
"new",
"DefaultTableCellRenderer",
"(",
")",
";",
"// BigDecimal",
"table",
".",
"setDefaultRenderer",
"(",
"BigD... | Returns table with column renderers. | [
"Returns",
"table",
"with",
"column",
"renderers",
"."
] | a383dff20fadc08ec9306f2f1f24b2a7e0047449 | https://github.com/cchantep/acolyte/blob/a383dff20fadc08ec9306f2f1f24b2a7e0047449/studio/src/main/java/acolyte/Studio.java#L1310-L1365 |
7,759 | cchantep/acolyte | studio/src/main/java/acolyte/Studio.java | Studio.chooseDriver | public void chooseDriver(final JFrame frm, final JTextField field) {
final JFileChooser chooser = new JFileChooser(new File("."));
for (final FileFilter ff : chooser.getChoosableFileFilters()) {
chooser.removeChoosableFileFilter(ff); // clean choosable filters
} // end of for
... | java | public void chooseDriver(final JFrame frm, final JTextField field) {
final JFileChooser chooser = new JFileChooser(new File("."));
for (final FileFilter ff : chooser.getChoosableFileFilters()) {
chooser.removeChoosableFileFilter(ff); // clean choosable filters
} // end of for
... | [
"public",
"void",
"chooseDriver",
"(",
"final",
"JFrame",
"frm",
",",
"final",
"JTextField",
"field",
")",
"{",
"final",
"JFileChooser",
"chooser",
"=",
"new",
"JFileChooser",
"(",
"new",
"File",
"(",
"\".\"",
")",
")",
";",
"for",
"(",
"final",
"FileFilte... | Chooses a JDBC driver. | [
"Chooses",
"a",
"JDBC",
"driver",
"."
] | a383dff20fadc08ec9306f2f1f24b2a7e0047449 | https://github.com/cchantep/acolyte/blob/a383dff20fadc08ec9306f2f1f24b2a7e0047449/studio/src/main/java/acolyte/Studio.java#L1370-L1404 |
7,760 | cchantep/acolyte | studio/src/main/java/acolyte/Studio.java | Studio.displayRows | private static void displayRows(final JFrame frm, final Vector<Map.Entry<String,ColumnType>> cols, final Vector<Vector<Object>> data, final Charset charset, final Formatting fmt, final Callable<Void> end) {
final UnaryFunction<Document,Callable<Void>> f =
new UnaryFunction<Document,Callable<Void>>(... | java | private static void displayRows(final JFrame frm, final Vector<Map.Entry<String,ColumnType>> cols, final Vector<Vector<Object>> data, final Charset charset, final Formatting fmt, final Callable<Void> end) {
final UnaryFunction<Document,Callable<Void>> f =
new UnaryFunction<Document,Callable<Void>>(... | [
"private",
"static",
"void",
"displayRows",
"(",
"final",
"JFrame",
"frm",
",",
"final",
"Vector",
"<",
"Map",
".",
"Entry",
"<",
"String",
",",
"ColumnType",
">",
">",
"cols",
",",
"final",
"Vector",
"<",
"Vector",
"<",
"Object",
">",
">",
"data",
","... | Displays formatted rows. | [
"Displays",
"formatted",
"rows",
"."
] | a383dff20fadc08ec9306f2f1f24b2a7e0047449 | https://github.com/cchantep/acolyte/blob/a383dff20fadc08ec9306f2f1f24b2a7e0047449/studio/src/main/java/acolyte/Studio.java#L1514-L1565 |
7,761 | cchantep/acolyte | studio/src/main/java/acolyte/Configuration.java | Configuration.loadConfig | protected static void loadConfig(final Properties config,
final File f) {
InputStreamReader r = null;
try {
final FileInputStream in = new FileInputStream(f);
r = new InputStreamReader(in, "UTF-8");
config.load(r);
} ca... | java | protected static void loadConfig(final Properties config,
final File f) {
InputStreamReader r = null;
try {
final FileInputStream in = new FileInputStream(f);
r = new InputStreamReader(in, "UTF-8");
config.load(r);
} ca... | [
"protected",
"static",
"void",
"loadConfig",
"(",
"final",
"Properties",
"config",
",",
"final",
"File",
"f",
")",
"{",
"InputStreamReader",
"r",
"=",
"null",
";",
"try",
"{",
"final",
"FileInputStream",
"in",
"=",
"new",
"FileInputStream",
"(",
"f",
")",
... | Loads configuration from |file|.
@param config Configuration container
@param f File to be loaded | [
"Loads",
"configuration",
"from",
"|file|",
"."
] | a383dff20fadc08ec9306f2f1f24b2a7e0047449 | https://github.com/cchantep/acolyte/blob/a383dff20fadc08ec9306f2f1f24b2a7e0047449/studio/src/main/java/acolyte/Configuration.java#L22-L42 |
7,762 | jaxio/javaee-lab | javaee7-jpa-query-by-example/src/main/java/com/jaxio/jpa/querybyexample/MetamodelUtil.java | MetamodelUtil.getCascades | public Collection<CascadeType> getCascades(PluralAttribute<?, ?, ?> attribute) {
if (attribute.getJavaMember() instanceof AccessibleObject) {
AccessibleObject accessibleObject = (AccessibleObject) attribute.getJavaMember();
OneToMany oneToMany = accessibleObject.getAnnotation(OneToMany.c... | java | public Collection<CascadeType> getCascades(PluralAttribute<?, ?, ?> attribute) {
if (attribute.getJavaMember() instanceof AccessibleObject) {
AccessibleObject accessibleObject = (AccessibleObject) attribute.getJavaMember();
OneToMany oneToMany = accessibleObject.getAnnotation(OneToMany.c... | [
"public",
"Collection",
"<",
"CascadeType",
">",
"getCascades",
"(",
"PluralAttribute",
"<",
"?",
",",
"?",
",",
"?",
">",
"attribute",
")",
"{",
"if",
"(",
"attribute",
".",
"getJavaMember",
"(",
")",
"instanceof",
"AccessibleObject",
")",
"{",
"AccessibleO... | Retrieves cascade from metamodel attribute
@param attribute given pluaral attribute
@return an empty collection if no jpa relation annotation can be found. | [
"Retrieves",
"cascade",
"from",
"metamodel",
"attribute"
] | 61238b967952446d81cc68424a4e809093a77fcf | https://github.com/jaxio/javaee-lab/blob/61238b967952446d81cc68424a4e809093a77fcf/javaee7-jpa-query-by-example/src/main/java/com/jaxio/jpa/querybyexample/MetamodelUtil.java#L107-L120 |
7,763 | jaxio/javaee-lab | javaee7-jpa-query-by-example/src/main/java/com/jaxio/jpa/querybyexample/MetamodelUtil.java | MetamodelUtil.getCascades | public Collection<CascadeType> getCascades(SingularAttribute<?, ?> attribute) {
if (attribute.getJavaMember() instanceof AccessibleObject) {
AccessibleObject accessibleObject = (AccessibleObject) attribute.getJavaMember();
OneToOne oneToOne = accessibleObject.getAnnotation(OneToOne.class... | java | public Collection<CascadeType> getCascades(SingularAttribute<?, ?> attribute) {
if (attribute.getJavaMember() instanceof AccessibleObject) {
AccessibleObject accessibleObject = (AccessibleObject) attribute.getJavaMember();
OneToOne oneToOne = accessibleObject.getAnnotation(OneToOne.class... | [
"public",
"Collection",
"<",
"CascadeType",
">",
"getCascades",
"(",
"SingularAttribute",
"<",
"?",
",",
"?",
">",
"attribute",
")",
"{",
"if",
"(",
"attribute",
".",
"getJavaMember",
"(",
")",
"instanceof",
"AccessibleObject",
")",
"{",
"AccessibleObject",
"a... | Retrieves cascade from metamodel attribute on a xToMany relation.
@param attribute given singular attribute
@return an empty collection if no jpa relation annotation can be found. | [
"Retrieves",
"cascade",
"from",
"metamodel",
"attribute",
"on",
"a",
"xToMany",
"relation",
"."
] | 61238b967952446d81cc68424a4e809093a77fcf | https://github.com/jaxio/javaee-lab/blob/61238b967952446d81cc68424a4e809093a77fcf/javaee7-jpa-query-by-example/src/main/java/com/jaxio/jpa/querybyexample/MetamodelUtil.java#L128-L141 |
7,764 | cchantep/acolyte | studio/src/main/java/acolyte/JDBC.java | JDBC.connect | public static Connection connect(final Driver driver, final String url,
final String user, final String pass)
throws SQLException {
final Properties props = new Properties();
props.put("user", user);
props.put("password", pass);
re... | java | public static Connection connect(final Driver driver, final String url,
final String user, final String pass)
throws SQLException {
final Properties props = new Properties();
props.put("user", user);
props.put("password", pass);
re... | [
"public",
"static",
"Connection",
"connect",
"(",
"final",
"Driver",
"driver",
",",
"final",
"String",
"url",
",",
"final",
"String",
"user",
",",
"final",
"String",
"pass",
")",
"throws",
"SQLException",
"{",
"final",
"Properties",
"props",
"=",
"new",
"Pro... | Returns connection using given |driver|.
@param driver JDBC driver
@param url JDBC url
@param user DB user name
@param pass Password for DB user | [
"Returns",
"connection",
"using",
"given",
"|driver|",
"."
] | a383dff20fadc08ec9306f2f1f24b2a7e0047449 | https://github.com/cchantep/acolyte/blob/a383dff20fadc08ec9306f2f1f24b2a7e0047449/studio/src/main/java/acolyte/JDBC.java#L77-L87 |
7,765 | cchantep/acolyte | studio/src/main/java/acolyte/JDBC.java | JDBC.getObject | public static Object getObject(final ResultSet rs,
final String name,
final ColumnType type) throws SQLException {
switch (type) {
case BigDecimal: return rs.getBigDecimal(name);
case Boolean: return rs.getBoolean(nam... | java | public static Object getObject(final ResultSet rs,
final String name,
final ColumnType type) throws SQLException {
switch (type) {
case BigDecimal: return rs.getBigDecimal(name);
case Boolean: return rs.getBoolean(nam... | [
"public",
"static",
"Object",
"getObject",
"(",
"final",
"ResultSet",
"rs",
",",
"final",
"String",
"name",
",",
"final",
"ColumnType",
"type",
")",
"throws",
"SQLException",
"{",
"switch",
"(",
"type",
")",
"{",
"case",
"BigDecimal",
":",
"return",
"rs",
... | Returns value of specified |column| according its type. | [
"Returns",
"value",
"of",
"specified",
"|column|",
"according",
"its",
"type",
"."
] | a383dff20fadc08ec9306f2f1f24b2a7e0047449 | https://github.com/cchantep/acolyte/blob/a383dff20fadc08ec9306f2f1f24b2a7e0047449/studio/src/main/java/acolyte/JDBC.java#L92-L110 |
7,766 | mygreen/xlsmapper | src/main/java/com/gh/mygreen/xlsmapper/xml/MultipleLoaderClassResolver.java | MultipleLoaderClassResolver.classForName | @SuppressWarnings({"unchecked", "rawtypes"})
public Class classForName(String className, Map loaderMap)
throws ClassNotFoundException {
Collection<ClassLoader> loaders = null;
// add context-classloader
loaders = new HashSet<ClassLoader>();
loaders.add(Thread.curren... | java | @SuppressWarnings({"unchecked", "rawtypes"})
public Class classForName(String className, Map loaderMap)
throws ClassNotFoundException {
Collection<ClassLoader> loaders = null;
// add context-classloader
loaders = new HashSet<ClassLoader>();
loaders.add(Thread.curren... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"unchecked\"",
",",
"\"rawtypes\"",
"}",
")",
"public",
"Class",
"classForName",
"(",
"String",
"className",
",",
"Map",
"loaderMap",
")",
"throws",
"ClassNotFoundException",
"{",
"Collection",
"<",
"ClassLoader",
">",
"loaders... | Loads class from multiple ClassLoader.
If this method can not load target class,
it tries to add package java.lang(default package)
and load target class.
Still, if it can not the class, throws ClassNotFoundException.
(behavior is put together on DefaultClassResolver.)
@param className class name -- that wants to lo... | [
"Loads",
"class",
"from",
"multiple",
"ClassLoader",
"."
] | a0c6b25c622e5f3a50b199ef685d2ee46ad5483c | https://github.com/mygreen/xlsmapper/blob/a0c6b25c622e5f3a50b199ef685d2ee46ad5483c/src/main/java/com/gh/mygreen/xlsmapper/xml/MultipleLoaderClassResolver.java#L30-L62 |
7,767 | sonatype/sisu-guice | core/src/com/google/inject/internal/InternalInjectorCreator.java | InternalInjectorCreator.initializeStatically | private void initializeStatically() {
bindingData.initializeBindings();
stopwatch.resetAndLog("Binding initialization");
for (InjectorShell shell : shells) {
shell.getInjector().index();
}
stopwatch.resetAndLog("Binding indexing");
injectionRequestProcessor.process(shells);
stopwatch... | java | private void initializeStatically() {
bindingData.initializeBindings();
stopwatch.resetAndLog("Binding initialization");
for (InjectorShell shell : shells) {
shell.getInjector().index();
}
stopwatch.resetAndLog("Binding indexing");
injectionRequestProcessor.process(shells);
stopwatch... | [
"private",
"void",
"initializeStatically",
"(",
")",
"{",
"bindingData",
".",
"initializeBindings",
"(",
")",
";",
"stopwatch",
".",
"resetAndLog",
"(",
"\"Binding initialization\"",
")",
";",
"for",
"(",
"InjectorShell",
"shell",
":",
"shells",
")",
"{",
"shell... | Initialize and validate everything. | [
"Initialize",
"and",
"validate",
"everything",
"."
] | 45f5c89834c189c5338640bf55e6e6181b9b5611 | https://github.com/sonatype/sisu-guice/blob/45f5c89834c189c5338640bf55e6e6181b9b5611/core/src/com/google/inject/internal/InternalInjectorCreator.java#L122-L161 |
7,768 | sonatype/sisu-guice | core/src/com/google/inject/internal/InternalInjectorCreator.java | InternalInjectorCreator.loadEagerSingletons | void loadEagerSingletons(InjectorImpl injector, Stage stage, final Errors errors) {
List<BindingImpl<?>> candidateBindings = new ArrayList<>();
@SuppressWarnings("unchecked") // casting Collection<Binding> to Collection<BindingImpl> is safe
Collection<BindingImpl<?>> bindingsAtThisLevel =
(Collectio... | java | void loadEagerSingletons(InjectorImpl injector, Stage stage, final Errors errors) {
List<BindingImpl<?>> candidateBindings = new ArrayList<>();
@SuppressWarnings("unchecked") // casting Collection<Binding> to Collection<BindingImpl> is safe
Collection<BindingImpl<?>> bindingsAtThisLevel =
(Collectio... | [
"void",
"loadEagerSingletons",
"(",
"InjectorImpl",
"injector",
",",
"Stage",
"stage",
",",
"final",
"Errors",
"errors",
")",
"{",
"List",
"<",
"BindingImpl",
"<",
"?",
">",
">",
"candidateBindings",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"@",
"Supp... | Loads eager singletons, or all singletons if we're in Stage.PRODUCTION. Bindings discovered
while we're binding these singletons are not be eager. | [
"Loads",
"eager",
"singletons",
"or",
"all",
"singletons",
"if",
"we",
"re",
"in",
"Stage",
".",
"PRODUCTION",
".",
"Bindings",
"discovered",
"while",
"we",
"re",
"binding",
"these",
"singletons",
"are",
"not",
"be",
"eager",
"."
] | 45f5c89834c189c5338640bf55e6e6181b9b5611 | https://github.com/sonatype/sisu-guice/blob/45f5c89834c189c5338640bf55e6e6181b9b5611/core/src/com/google/inject/internal/InternalInjectorCreator.java#L194-L223 |
7,769 | sonatype/sisu-guice | extensions/throwingproviders/src/com/google/inject/throwingproviders/CheckedProvideUtils.java | CheckedProvideUtils.validateExceptions | static void validateExceptions(
Binder binder,
Iterable<TypeLiteral<?>> actualExceptionTypes,
Iterable<Class<? extends Throwable>> expectedExceptionTypes,
Class<? extends CheckedProvider> checkedProvider) {
// Validate the exceptions in the method match the exceptions
// in the CheckedPr... | java | static void validateExceptions(
Binder binder,
Iterable<TypeLiteral<?>> actualExceptionTypes,
Iterable<Class<? extends Throwable>> expectedExceptionTypes,
Class<? extends CheckedProvider> checkedProvider) {
// Validate the exceptions in the method match the exceptions
// in the CheckedPr... | [
"static",
"void",
"validateExceptions",
"(",
"Binder",
"binder",
",",
"Iterable",
"<",
"TypeLiteral",
"<",
"?",
">",
">",
"actualExceptionTypes",
",",
"Iterable",
"<",
"Class",
"<",
"?",
"extends",
"Throwable",
">",
">",
"expectedExceptionTypes",
",",
"Class",
... | Adds errors to the binder if the exceptions aren't valid. | [
"Adds",
"errors",
"to",
"the",
"binder",
"if",
"the",
"exceptions",
"aren",
"t",
"valid",
"."
] | 45f5c89834c189c5338640bf55e6e6181b9b5611 | https://github.com/sonatype/sisu-guice/blob/45f5c89834c189c5338640bf55e6e6181b9b5611/extensions/throwingproviders/src/com/google/inject/throwingproviders/CheckedProvideUtils.java#L78-L107 |
7,770 | sonatype/sisu-guice | core/src/com/google/inject/internal/RealOptionalBinder.java | RealOptionalBinder.invokeJavaOptionalOf | private static Object invokeJavaOptionalOf(Object o) {
try {
return JAVA_OPTIONAL_OF_METHOD.invoke(null, o);
} catch (IllegalAccessException e) {
throw new SecurityException(e);
} catch (IllegalArgumentException e) {
throw new IllegalStateException(e);
} catch (InvocationTargetExceptio... | java | private static Object invokeJavaOptionalOf(Object o) {
try {
return JAVA_OPTIONAL_OF_METHOD.invoke(null, o);
} catch (IllegalAccessException e) {
throw new SecurityException(e);
} catch (IllegalArgumentException e) {
throw new IllegalStateException(e);
} catch (InvocationTargetExceptio... | [
"private",
"static",
"Object",
"invokeJavaOptionalOf",
"(",
"Object",
"o",
")",
"{",
"try",
"{",
"return",
"JAVA_OPTIONAL_OF_METHOD",
".",
"invoke",
"(",
"null",
",",
"o",
")",
";",
"}",
"catch",
"(",
"IllegalAccessException",
"e",
")",
"{",
"throw",
"new",
... | Invokes java.util.Optional.of. | [
"Invokes",
"java",
".",
"util",
".",
"Optional",
".",
"of",
"."
] | 45f5c89834c189c5338640bf55e6e6181b9b5611 | https://github.com/sonatype/sisu-guice/blob/45f5c89834c189c5338640bf55e6e6181b9b5611/core/src/com/google/inject/internal/RealOptionalBinder.java#L106-L116 |
7,771 | sonatype/sisu-guice | extensions/servlet/src/com/google/inject/servlet/ServletDefinition.java | ServletDefinition.service | boolean service(ServletRequest servletRequest, ServletResponse servletResponse)
throws IOException, ServletException {
final HttpServletRequest request = (HttpServletRequest) servletRequest;
final String path = ServletUtils.getContextRelativePath(request);
final boolean serve = shouldServe(path);
... | java | boolean service(ServletRequest servletRequest, ServletResponse servletResponse)
throws IOException, ServletException {
final HttpServletRequest request = (HttpServletRequest) servletRequest;
final String path = ServletUtils.getContextRelativePath(request);
final boolean serve = shouldServe(path);
... | [
"boolean",
"service",
"(",
"ServletRequest",
"servletRequest",
",",
"ServletResponse",
"servletResponse",
")",
"throws",
"IOException",
",",
"ServletException",
"{",
"final",
"HttpServletRequest",
"request",
"=",
"(",
"HttpServletRequest",
")",
"servletRequest",
";",
"f... | Wrapper around the service chain to ensure a servlet is servicing what it must and provides it
with a wrapped request.
@return Returns true if this servlet triggered for the given request. Or false if guice-servlet
should continue dispatching down the servlet pipeline.
@throws IOException If thrown by underlying servl... | [
"Wrapper",
"around",
"the",
"service",
"chain",
"to",
"ensure",
"a",
"servlet",
"is",
"servicing",
"what",
"it",
"must",
"and",
"provides",
"it",
"with",
"a",
"wrapped",
"request",
"."
] | 45f5c89834c189c5338640bf55e6e6181b9b5611 | https://github.com/sonatype/sisu-guice/blob/45f5c89834c189c5338640bf55e6e6181b9b5611/extensions/servlet/src/com/google/inject/servlet/ServletDefinition.java#L178-L193 |
7,772 | sonatype/sisu-guice | core/src/com/google/inject/matcher/Matchers.java | Matchers.not | public static <T> Matcher<T> not(final Matcher<? super T> p) {
return new Not<T>(p);
} | java | public static <T> Matcher<T> not(final Matcher<? super T> p) {
return new Not<T>(p);
} | [
"public",
"static",
"<",
"T",
">",
"Matcher",
"<",
"T",
">",
"not",
"(",
"final",
"Matcher",
"<",
"?",
"super",
"T",
">",
"p",
")",
"{",
"return",
"new",
"Not",
"<",
"T",
">",
"(",
"p",
")",
";",
"}"
] | Inverts the given matcher. | [
"Inverts",
"the",
"given",
"matcher",
"."
] | 45f5c89834c189c5338640bf55e6e6181b9b5611 | https://github.com/sonatype/sisu-guice/blob/45f5c89834c189c5338640bf55e6e6181b9b5611/core/src/com/google/inject/matcher/Matchers.java#L63-L65 |
7,773 | damiencarol/jsr203-hadoop | src/main/java/hdfs/jsr203/HadoopFileSystemProvider.java | HadoopFileSystemProvider.toHadoopPath | private static final HadoopPath toHadoopPath(Path path) {
if (path == null) {
throw new NullPointerException();
}
if (!(path instanceof HadoopPath)) {
throw new ProviderMismatchException();
}
return (HadoopPath) path;
} | java | private static final HadoopPath toHadoopPath(Path path) {
if (path == null) {
throw new NullPointerException();
}
if (!(path instanceof HadoopPath)) {
throw new ProviderMismatchException();
}
return (HadoopPath) path;
} | [
"private",
"static",
"final",
"HadoopPath",
"toHadoopPath",
"(",
"Path",
"path",
")",
"{",
"if",
"(",
"path",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
")",
";",
"}",
"if",
"(",
"!",
"(",
"path",
"instanceof",
"HadoopPath",
")"... | Checks that the given file is a HadoopPath | [
"Checks",
"that",
"the",
"given",
"file",
"is",
"a",
"HadoopPath"
] | d36a4b0c6498fc5d25ce79bd8c5bb69c6ef70057 | https://github.com/damiencarol/jsr203-hadoop/blob/d36a4b0c6498fc5d25ce79bd8c5bb69c6ef70057/src/main/java/hdfs/jsr203/HadoopFileSystemProvider.java#L63-L71 |
7,774 | sonatype/sisu-guice | core/src/com/google/inject/internal/InjectorShell.java | InjectorShell.bindLogger | private static void bindLogger(InjectorImpl injector) {
Key<Logger> key = Key.get(Logger.class);
LoggerFactory loggerFactory = new LoggerFactory();
injector.state.putBinding(
key,
new ProviderInstanceBindingImpl<Logger>(
injector,
key,
SourceProvider.UNKNO... | java | private static void bindLogger(InjectorImpl injector) {
Key<Logger> key = Key.get(Logger.class);
LoggerFactory loggerFactory = new LoggerFactory();
injector.state.putBinding(
key,
new ProviderInstanceBindingImpl<Logger>(
injector,
key,
SourceProvider.UNKNO... | [
"private",
"static",
"void",
"bindLogger",
"(",
"InjectorImpl",
"injector",
")",
"{",
"Key",
"<",
"Logger",
">",
"key",
"=",
"Key",
".",
"get",
"(",
"Logger",
".",
"class",
")",
";",
"LoggerFactory",
"loggerFactory",
"=",
"new",
"LoggerFactory",
"(",
")",
... | The Logger is a special case because it knows the injection point of the injected member. It's
the only binding that does this. | [
"The",
"Logger",
"is",
"a",
"special",
"case",
"because",
"it",
"knows",
"the",
"injection",
"point",
"of",
"the",
"injected",
"member",
".",
"It",
"s",
"the",
"only",
"binding",
"that",
"does",
"this",
"."
] | 45f5c89834c189c5338640bf55e6e6181b9b5611 | https://github.com/sonatype/sisu-guice/blob/45f5c89834c189c5338640bf55e6e6181b9b5611/core/src/com/google/inject/internal/InjectorShell.java#L260-L282 |
7,775 | sonatype/sisu-guice | core/src/com/google/inject/ConfigurationException.java | ConfigurationException.withPartialValue | public ConfigurationException withPartialValue(Object partialValue) {
checkState(this.partialValue == null,
"Can't clobber existing partial value %s with %s", this.partialValue, partialValue);
ConfigurationException result = new ConfigurationException(messages);
result.partialValue = partialValue;
... | java | public ConfigurationException withPartialValue(Object partialValue) {
checkState(this.partialValue == null,
"Can't clobber existing partial value %s with %s", this.partialValue, partialValue);
ConfigurationException result = new ConfigurationException(messages);
result.partialValue = partialValue;
... | [
"public",
"ConfigurationException",
"withPartialValue",
"(",
"Object",
"partialValue",
")",
"{",
"checkState",
"(",
"this",
".",
"partialValue",
"==",
"null",
",",
"\"Can't clobber existing partial value %s with %s\"",
",",
"this",
".",
"partialValue",
",",
"partialValue"... | Returns a copy of this configuration exception with the specified partial value. | [
"Returns",
"a",
"copy",
"of",
"this",
"configuration",
"exception",
"with",
"the",
"specified",
"partial",
"value",
"."
] | 45f5c89834c189c5338640bf55e6e6181b9b5611 | https://github.com/sonatype/sisu-guice/blob/45f5c89834c189c5338640bf55e6e6181b9b5611/core/src/com/google/inject/ConfigurationException.java#L44-L50 |
7,776 | sonatype/sisu-guice | core/src/com/google/inject/spi/Dependency.java | Dependency.get | public static <T> Dependency<T> get(Key<T> key) {
return new Dependency<T>(null, MoreTypes.canonicalizeKey(key), true, -1);
} | java | public static <T> Dependency<T> get(Key<T> key) {
return new Dependency<T>(null, MoreTypes.canonicalizeKey(key), true, -1);
} | [
"public",
"static",
"<",
"T",
">",
"Dependency",
"<",
"T",
">",
"get",
"(",
"Key",
"<",
"T",
">",
"key",
")",
"{",
"return",
"new",
"Dependency",
"<",
"T",
">",
"(",
"null",
",",
"MoreTypes",
".",
"canonicalizeKey",
"(",
"key",
")",
",",
"true",
... | Returns a new dependency that is not attached to an injection point. The returned dependency is
nullable. | [
"Returns",
"a",
"new",
"dependency",
"that",
"is",
"not",
"attached",
"to",
"an",
"injection",
"point",
".",
"The",
"returned",
"dependency",
"is",
"nullable",
"."
] | 45f5c89834c189c5338640bf55e6e6181b9b5611 | https://github.com/sonatype/sisu-guice/blob/45f5c89834c189c5338640bf55e6e6181b9b5611/core/src/com/google/inject/spi/Dependency.java#L56-L58 |
7,777 | sonatype/sisu-guice | core/src/com/google/inject/spi/Dependency.java | Dependency.forInjectionPoints | public static Set<Dependency<?>> forInjectionPoints(Set<InjectionPoint> injectionPoints) {
List<Dependency<?>> dependencies = Lists.newArrayList();
for (InjectionPoint injectionPoint : injectionPoints) {
dependencies.addAll(injectionPoint.getDependencies());
}
return ImmutableSet.copyOf(dependenci... | java | public static Set<Dependency<?>> forInjectionPoints(Set<InjectionPoint> injectionPoints) {
List<Dependency<?>> dependencies = Lists.newArrayList();
for (InjectionPoint injectionPoint : injectionPoints) {
dependencies.addAll(injectionPoint.getDependencies());
}
return ImmutableSet.copyOf(dependenci... | [
"public",
"static",
"Set",
"<",
"Dependency",
"<",
"?",
">",
">",
"forInjectionPoints",
"(",
"Set",
"<",
"InjectionPoint",
">",
"injectionPoints",
")",
"{",
"List",
"<",
"Dependency",
"<",
"?",
">",
">",
"dependencies",
"=",
"Lists",
".",
"newArrayList",
"... | Returns the dependencies from the given injection points. | [
"Returns",
"the",
"dependencies",
"from",
"the",
"given",
"injection",
"points",
"."
] | 45f5c89834c189c5338640bf55e6e6181b9b5611 | https://github.com/sonatype/sisu-guice/blob/45f5c89834c189c5338640bf55e6e6181b9b5611/core/src/com/google/inject/spi/Dependency.java#L61-L67 |
7,778 | damiencarol/jsr203-hadoop | src/main/java/hdfs/jsr203/HadoopPath.java | HadoopPath.normalize | private byte[] normalize(byte[] path) {
if (path.length == 0)
return path;
byte prevC = 0;
for (int i = 0; i < path.length; i++) {
byte c = path[i];
if (c == '\\')
return normalize(path, i);
if (c == (byte) '/' && prevC == '/')
return normalize(path, i - 1);
if ... | java | private byte[] normalize(byte[] path) {
if (path.length == 0)
return path;
byte prevC = 0;
for (int i = 0; i < path.length; i++) {
byte c = path[i];
if (c == '\\')
return normalize(path, i);
if (c == (byte) '/' && prevC == '/')
return normalize(path, i - 1);
if ... | [
"private",
"byte",
"[",
"]",
"normalize",
"(",
"byte",
"[",
"]",
"path",
")",
"{",
"if",
"(",
"path",
".",
"length",
"==",
"0",
")",
"return",
"path",
";",
"byte",
"prevC",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"path... | and check for invalid characters | [
"and",
"check",
"for",
"invalid",
"characters"
] | d36a4b0c6498fc5d25ce79bd8c5bb69c6ef70057 | https://github.com/damiencarol/jsr203-hadoop/blob/d36a4b0c6498fc5d25ce79bd8c5bb69c6ef70057/src/main/java/hdfs/jsr203/HadoopPath.java#L264-L280 |
7,779 | damiencarol/jsr203-hadoop | src/main/java/hdfs/jsr203/HadoopPath.java | HadoopPath.getRawResolvedPath | public org.apache.hadoop.fs.Path getRawResolvedPath() {
return new org.apache.hadoop.fs.Path("hdfs://" + hdfs.getHost() + ":"
+ hdfs.getPort() + new String(getResolvedPath()));
} | java | public org.apache.hadoop.fs.Path getRawResolvedPath() {
return new org.apache.hadoop.fs.Path("hdfs://" + hdfs.getHost() + ":"
+ hdfs.getPort() + new String(getResolvedPath()));
} | [
"public",
"org",
".",
"apache",
".",
"hadoop",
".",
"fs",
".",
"Path",
"getRawResolvedPath",
"(",
")",
"{",
"return",
"new",
"org",
".",
"apache",
".",
"hadoop",
".",
"fs",
".",
"Path",
"(",
"\"hdfs://\"",
"+",
"hdfs",
".",
"getHost",
"(",
")",
"+",
... | Helper to get the raw interface of HDFS path.
@return raw HDFS path object | [
"Helper",
"to",
"get",
"the",
"raw",
"interface",
"of",
"HDFS",
"path",
"."
] | d36a4b0c6498fc5d25ce79bd8c5bb69c6ef70057 | https://github.com/damiencarol/jsr203-hadoop/blob/d36a4b0c6498fc5d25ce79bd8c5bb69c6ef70057/src/main/java/hdfs/jsr203/HadoopPath.java#L534-L537 |
7,780 | damiencarol/jsr203-hadoop | src/main/java/hdfs/jsr203/HadoopPath.java | HadoopPath.initOffsets | private void initOffsets() {
if (offsets == null) {
int count;
int index;
// count names
count = 0;
index = 0;
while (index < path.length) {
byte c = path[index++];
if (c != '/') {
count++;
while (index < path.length && path[index] != '/')
... | java | private void initOffsets() {
if (offsets == null) {
int count;
int index;
// count names
count = 0;
index = 0;
while (index < path.length) {
byte c = path[index++];
if (c != '/') {
count++;
while (index < path.length && path[index] != '/')
... | [
"private",
"void",
"initOffsets",
"(",
")",
"{",
"if",
"(",
"offsets",
"==",
"null",
")",
"{",
"int",
"count",
";",
"int",
"index",
";",
"// count names",
"count",
"=",
"0",
";",
"index",
"=",
"0",
";",
"while",
"(",
"index",
"<",
"path",
".",
"len... | create offset list if not already created | [
"create",
"offset",
"list",
"if",
"not",
"already",
"created"
] | d36a4b0c6498fc5d25ce79bd8c5bb69c6ef70057 | https://github.com/damiencarol/jsr203-hadoop/blob/d36a4b0c6498fc5d25ce79bd8c5bb69c6ef70057/src/main/java/hdfs/jsr203/HadoopPath.java#L661-L695 |
7,781 | Carbonado/Carbonado | src/main/java/com/amazon/carbonado/repo/indexed/IndexedStorage.java | IndexedStorage.storageDelegate | public Storage<S> storageDelegate(StorableIndex<S> index) {
if (mAllIndexInfoMap.get(index) instanceof ManagedIndex) {
// Index is managed by this storage, which is typical.
return null;
}
// Index is managed by master storage, most likely a primary key index.
... | java | public Storage<S> storageDelegate(StorableIndex<S> index) {
if (mAllIndexInfoMap.get(index) instanceof ManagedIndex) {
// Index is managed by this storage, which is typical.
return null;
}
// Index is managed by master storage, most likely a primary key index.
... | [
"public",
"Storage",
"<",
"S",
">",
"storageDelegate",
"(",
"StorableIndex",
"<",
"S",
">",
"index",
")",
"{",
"if",
"(",
"mAllIndexInfoMap",
".",
"get",
"(",
"index",
")",
"instanceof",
"ManagedIndex",
")",
"{",
"// Index is managed by this storage, which is typi... | Required by StorageAccess. | [
"Required",
"by",
"StorageAccess",
"."
] | eee29b365a61c8f03e1a1dc6bed0692e6b04b1db | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/repo/indexed/IndexedStorage.java#L197-L204 |
7,782 | Carbonado/Carbonado | src/main/java/com/amazon/carbonado/util/AnnotationDescPrinter.java | AnnotationDescPrinter.makePlainDescriptor | public static String makePlainDescriptor(Class<? extends Annotation> annotationType) {
return "" + TAG_ANNOTATION + TypeDesc.forClass(annotationType).getDescriptor();
} | java | public static String makePlainDescriptor(Class<? extends Annotation> annotationType) {
return "" + TAG_ANNOTATION + TypeDesc.forClass(annotationType).getDescriptor();
} | [
"public",
"static",
"String",
"makePlainDescriptor",
"(",
"Class",
"<",
"?",
"extends",
"Annotation",
">",
"annotationType",
")",
"{",
"return",
"\"\"",
"+",
"TAG_ANNOTATION",
"+",
"TypeDesc",
".",
"forClass",
"(",
"annotationType",
")",
".",
"getDescriptor",
"(... | Returns an annotation descriptor that has no parameters. | [
"Returns",
"an",
"annotation",
"descriptor",
"that",
"has",
"no",
"parameters",
"."
] | eee29b365a61c8f03e1a1dc6bed0692e6b04b1db | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/util/AnnotationDescPrinter.java#L35-L37 |
7,783 | Carbonado/Carbonado | src/main/java/com/amazon/carbonado/CorruptEncodingException.java | CorruptEncodingException.writeObject | private void writeObject(ObjectOutputStream out) throws IOException {
Storable s = mStorable;
if (s == null) {
out.write(0);
} else {
out.write(1);
out.writeObject(s.storableType());
try {
s.writeTo(out);
} catc... | java | private void writeObject(ObjectOutputStream out) throws IOException {
Storable s = mStorable;
if (s == null) {
out.write(0);
} else {
out.write(1);
out.writeObject(s.storableType());
try {
s.writeTo(out);
} catc... | [
"private",
"void",
"writeObject",
"(",
"ObjectOutputStream",
"out",
")",
"throws",
"IOException",
"{",
"Storable",
"s",
"=",
"mStorable",
";",
"if",
"(",
"s",
"==",
"null",
")",
"{",
"out",
".",
"write",
"(",
"0",
")",
";",
"}",
"else",
"{",
"out",
"... | server is identical. Linking into the actual repository is a bit trickier. | [
"server",
"is",
"identical",
".",
"Linking",
"into",
"the",
"actual",
"repository",
"is",
"a",
"bit",
"trickier",
"."
] | eee29b365a61c8f03e1a1dc6bed0692e6b04b1db | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/CorruptEncodingException.java#L101-L114 |
7,784 | Carbonado/Carbonado | src/main/java/com/amazon/carbonado/raw/GzipCompressor.java | GzipCompressor.compress | public static byte[] compress(byte[] value, int prefix) throws SupportException {
Deflater compressor = cLocalDeflater.get();
if (compressor == null) {
cLocalDeflater.set(compressor = new Deflater());
}
ByteArrayOutputStream bos = new ByteArrayOutputStream(value.length);
... | java | public static byte[] compress(byte[] value, int prefix) throws SupportException {
Deflater compressor = cLocalDeflater.get();
if (compressor == null) {
cLocalDeflater.set(compressor = new Deflater());
}
ByteArrayOutputStream bos = new ByteArrayOutputStream(value.length);
... | [
"public",
"static",
"byte",
"[",
"]",
"compress",
"(",
"byte",
"[",
"]",
"value",
",",
"int",
"prefix",
")",
"throws",
"SupportException",
"{",
"Deflater",
"compressor",
"=",
"cLocalDeflater",
".",
"get",
"(",
")",
";",
"if",
"(",
"compressor",
"==",
"nu... | Encodes into compressed form.
@param value value to compress
@param prefix prefix of byte array to preserve
@return compressed value
@throws SupportException thrown if compression failed | [
"Encodes",
"into",
"compressed",
"form",
"."
] | eee29b365a61c8f03e1a1dc6bed0692e6b04b1db | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/raw/GzipCompressor.java#L53-L72 |
7,785 | Carbonado/Carbonado | src/main/java/com/amazon/carbonado/raw/GzipCompressor.java | GzipCompressor.decompress | public static byte[] decompress(byte[] value, int prefix) throws CorruptEncodingException {
Inflater inflater = cLocalInflater.get();
if (inflater == null) {
cLocalInflater.set(inflater = new Inflater());
}
ByteArrayOutputStream bos = new ByteArrayOutputStream(value.length *... | java | public static byte[] decompress(byte[] value, int prefix) throws CorruptEncodingException {
Inflater inflater = cLocalInflater.get();
if (inflater == null) {
cLocalInflater.set(inflater = new Inflater());
}
ByteArrayOutputStream bos = new ByteArrayOutputStream(value.length *... | [
"public",
"static",
"byte",
"[",
"]",
"decompress",
"(",
"byte",
"[",
"]",
"value",
",",
"int",
"prefix",
")",
"throws",
"CorruptEncodingException",
"{",
"Inflater",
"inflater",
"=",
"cLocalInflater",
".",
"get",
"(",
")",
";",
"if",
"(",
"inflater",
"==",... | Decodes from compressed form.
@param value value to decompress
@param prefix prefix of byte array to preserve
@return decompressed value
@throws CorruptEncodingException thrown if value cannot be decompressed | [
"Decodes",
"from",
"compressed",
"form",
"."
] | eee29b365a61c8f03e1a1dc6bed0692e6b04b1db | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/raw/GzipCompressor.java#L82-L104 |
7,786 | Carbonado/Carbonado | src/main/java/com/amazon/carbonado/repo/replicated/ReplicatedRepository.java | ReplicatedRepository.selectNaturalOrder | private static <S extends Storable> String[] selectNaturalOrder(Repository repo,
Class<S> type,
Filter<S> filter)
throws RepositoryException
{
if (!filter.isOp... | java | private static <S extends Storable> String[] selectNaturalOrder(Repository repo,
Class<S> type,
Filter<S> filter)
throws RepositoryException
{
if (!filter.isOp... | [
"private",
"static",
"<",
"S",
"extends",
"Storable",
">",
"String",
"[",
"]",
"selectNaturalOrder",
"(",
"Repository",
"repo",
",",
"Class",
"<",
"S",
">",
"type",
",",
"Filter",
"<",
"S",
">",
"filter",
")",
"throws",
"RepositoryException",
"{",
"if",
... | Utility method to select the natural ordering of a storage, by looking for a clustered
index on the primary key. Returns null if no clustered index was found. If a filter is
provided, the ordering which utilizes the best index is used. | [
"Utility",
"method",
"to",
"select",
"the",
"natural",
"ordering",
"of",
"a",
"storage",
"by",
"looking",
"for",
"a",
"clustered",
"index",
"on",
"the",
"primary",
"key",
".",
"Returns",
"null",
"if",
"no",
"clustered",
"index",
"was",
"found",
".",
"If",
... | eee29b365a61c8f03e1a1dc6bed0692e6b04b1db | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/repo/replicated/ReplicatedRepository.java#L101-L177 |
7,787 | Carbonado/Carbonado | src/main/java/com/amazon/carbonado/txn/TransactionScope.java | TransactionScope.enter | public Transaction enter(IsolationLevel level) {
mLock.lock();
try {
TransactionImpl<Txn> parent = mActive;
IsolationLevel actualLevel = mTxnMgr.selectIsolationLevel(parent, level);
if (actualLevel == null) {
if (parent == null) {
... | java | public Transaction enter(IsolationLevel level) {
mLock.lock();
try {
TransactionImpl<Txn> parent = mActive;
IsolationLevel actualLevel = mTxnMgr.selectIsolationLevel(parent, level);
if (actualLevel == null) {
if (parent == null) {
... | [
"public",
"Transaction",
"enter",
"(",
"IsolationLevel",
"level",
")",
"{",
"mLock",
".",
"lock",
"(",
")",
";",
"try",
"{",
"TransactionImpl",
"<",
"Txn",
">",
"parent",
"=",
"mActive",
";",
"IsolationLevel",
"actualLevel",
"=",
"mTxnMgr",
".",
"selectIsola... | Enters a new transaction scope which becomes the active transaction.
@param level desired isolation level (may be null)
@throws UnsupportedOperationException if isolation level higher than
supported by repository | [
"Enters",
"a",
"new",
"transaction",
"scope",
"which",
"becomes",
"the",
"active",
"transaction",
"."
] | eee29b365a61c8f03e1a1dc6bed0692e6b04b1db | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/txn/TransactionScope.java#L84-L109 |
7,788 | Carbonado/Carbonado | src/main/java/com/amazon/carbonado/txn/TransactionScope.java | TransactionScope.enterTop | public Transaction enterTop(IsolationLevel level) {
mLock.lock();
try {
IsolationLevel actualLevel = mTxnMgr.selectIsolationLevel(null, level);
if (actualLevel == null) {
throw new UnsupportedOperationException
("Desired isolation level n... | java | public Transaction enterTop(IsolationLevel level) {
mLock.lock();
try {
IsolationLevel actualLevel = mTxnMgr.selectIsolationLevel(null, level);
if (actualLevel == null) {
throw new UnsupportedOperationException
("Desired isolation level n... | [
"public",
"Transaction",
"enterTop",
"(",
"IsolationLevel",
"level",
")",
"{",
"mLock",
".",
"lock",
"(",
")",
";",
"try",
"{",
"IsolationLevel",
"actualLevel",
"=",
"mTxnMgr",
".",
"selectIsolationLevel",
"(",
"null",
",",
"level",
")",
";",
"if",
"(",
"a... | Enters a new top-level transaction scope which becomes the active
transaction.
@param level desired isolation level (may be null)
@throws UnsupportedOperationException if isolation level higher than
supported by repository | [
"Enters",
"a",
"new",
"top",
"-",
"level",
"transaction",
"scope",
"which",
"becomes",
"the",
"active",
"transaction",
"."
] | eee29b365a61c8f03e1a1dc6bed0692e6b04b1db | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/txn/TransactionScope.java#L119-L137 |
7,789 | Carbonado/Carbonado | src/main/java/com/amazon/carbonado/txn/TransactionScope.java | TransactionScope.exited | void exited(TransactionImpl<Txn> txn, TransactionImpl<Txn> active) {
mActive = active;
mTxnMgr.exited(txn, active);
} | java | void exited(TransactionImpl<Txn> txn, TransactionImpl<Txn> active) {
mActive = active;
mTxnMgr.exited(txn, active);
} | [
"void",
"exited",
"(",
"TransactionImpl",
"<",
"Txn",
">",
"txn",
",",
"TransactionImpl",
"<",
"Txn",
">",
"active",
")",
"{",
"mActive",
"=",
"active",
";",
"mTxnMgr",
".",
"exited",
"(",
"txn",
",",
"active",
")",
";",
"}"
] | Called by TransactionImpl with lock held. | [
"Called",
"by",
"TransactionImpl",
"with",
"lock",
"held",
"."
] | eee29b365a61c8f03e1a1dc6bed0692e6b04b1db | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/txn/TransactionScope.java#L140-L143 |
7,790 | Carbonado/Carbonado | src/main/java/com/amazon/carbonado/txn/TransactionScope.java | TransactionScope.register | public <S extends Storable> void register(Class<S> type, Cursor<S> cursor) {
mLock.lock();
try {
checkClosed();
if (mCursors == null) {
mCursors = new IdentityHashMap<Class<?>, CursorList<TransactionImpl<Txn>>>();
}
CursorList<Tran... | java | public <S extends Storable> void register(Class<S> type, Cursor<S> cursor) {
mLock.lock();
try {
checkClosed();
if (mCursors == null) {
mCursors = new IdentityHashMap<Class<?>, CursorList<TransactionImpl<Txn>>>();
}
CursorList<Tran... | [
"public",
"<",
"S",
"extends",
"Storable",
">",
"void",
"register",
"(",
"Class",
"<",
"S",
">",
"type",
",",
"Cursor",
"<",
"S",
">",
"cursor",
")",
"{",
"mLock",
".",
"lock",
"(",
")",
";",
"try",
"{",
"checkClosed",
"(",
")",
";",
"if",
"(",
... | Registers the given cursor against the active transaction, allowing it
to be closed on transaction exit or transaction manager close. If there
is no active transaction in scope, the cursor is registered as not part
of a transaction. Cursors should register when created. | [
"Registers",
"the",
"given",
"cursor",
"against",
"the",
"active",
"transaction",
"allowing",
"it",
"to",
"be",
"closed",
"on",
"transaction",
"exit",
"or",
"transaction",
"manager",
"close",
".",
"If",
"there",
"is",
"no",
"active",
"transaction",
"in",
"scop... | eee29b365a61c8f03e1a1dc6bed0692e6b04b1db | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/txn/TransactionScope.java#L151-L173 |
7,791 | Carbonado/Carbonado | src/main/java/com/amazon/carbonado/txn/TransactionScope.java | TransactionScope.unregister | public <S extends Storable> void unregister(Class<S> type, Cursor<S> cursor) {
mLock.lock();
try {
if (mCursors != null) {
CursorList<TransactionImpl<Txn>> cursorList = mCursors.get(type);
if (cursorList != null) {
TransactionImpl<Txn... | java | public <S extends Storable> void unregister(Class<S> type, Cursor<S> cursor) {
mLock.lock();
try {
if (mCursors != null) {
CursorList<TransactionImpl<Txn>> cursorList = mCursors.get(type);
if (cursorList != null) {
TransactionImpl<Txn... | [
"public",
"<",
"S",
"extends",
"Storable",
">",
"void",
"unregister",
"(",
"Class",
"<",
"S",
">",
"type",
",",
"Cursor",
"<",
"S",
">",
"cursor",
")",
"{",
"mLock",
".",
"lock",
"(",
")",
";",
"try",
"{",
"if",
"(",
"mCursors",
"!=",
"null",
")"... | Unregisters a previously registered cursor. Cursors should unregister
when closed. | [
"Unregisters",
"a",
"previously",
"registered",
"cursor",
".",
"Cursors",
"should",
"unregister",
"when",
"closed",
"."
] | eee29b365a61c8f03e1a1dc6bed0692e6b04b1db | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/txn/TransactionScope.java#L179-L194 |
7,792 | Carbonado/Carbonado | src/main/java/com/amazon/carbonado/txn/TransactionScope.java | TransactionScope.getTxn | public Txn getTxn() throws Exception {
mLock.lock();
try {
checkClosed();
return mActive == null ? null : mActive.getTxn();
} finally {
mLock.unlock();
}
} | java | public Txn getTxn() throws Exception {
mLock.lock();
try {
checkClosed();
return mActive == null ? null : mActive.getTxn();
} finally {
mLock.unlock();
}
} | [
"public",
"Txn",
"getTxn",
"(",
")",
"throws",
"Exception",
"{",
"mLock",
".",
"lock",
"(",
")",
";",
"try",
"{",
"checkClosed",
"(",
")",
";",
"return",
"mActive",
"==",
"null",
"?",
"null",
":",
"mActive",
".",
"getTxn",
"(",
")",
";",
"}",
"fina... | Returns the implementation for the active transaction, or null if there
is no active transaction.
@throws Exception thrown by createTxn or reuseTxn | [
"Returns",
"the",
"implementation",
"for",
"the",
"active",
"transaction",
"or",
"null",
"if",
"there",
"is",
"no",
"active",
"transaction",
"."
] | eee29b365a61c8f03e1a1dc6bed0692e6b04b1db | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/txn/TransactionScope.java#L210-L218 |
7,793 | Carbonado/Carbonado | src/main/java/com/amazon/carbonado/txn/TransactionScope.java | TransactionScope.isForUpdate | public boolean isForUpdate() {
mLock.lock();
try {
return (mClosed || mActive == null) ? false : mActive.isForUpdate();
} finally {
mLock.unlock();
}
} | java | public boolean isForUpdate() {
mLock.lock();
try {
return (mClosed || mActive == null) ? false : mActive.isForUpdate();
} finally {
mLock.unlock();
}
} | [
"public",
"boolean",
"isForUpdate",
"(",
")",
"{",
"mLock",
".",
"lock",
"(",
")",
";",
"try",
"{",
"return",
"(",
"mClosed",
"||",
"mActive",
"==",
"null",
")",
"?",
"false",
":",
"mActive",
".",
"isForUpdate",
"(",
")",
";",
"}",
"finally",
"{",
... | Returns true if an active transaction exists and it is for update. | [
"Returns",
"true",
"if",
"an",
"active",
"transaction",
"exists",
"and",
"it",
"is",
"for",
"update",
"."
] | eee29b365a61c8f03e1a1dc6bed0692e6b04b1db | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/txn/TransactionScope.java#L237-L244 |
7,794 | Carbonado/Carbonado | src/main/java/com/amazon/carbonado/txn/TransactionScope.java | TransactionScope.getIsolationLevel | public IsolationLevel getIsolationLevel() {
mLock.lock();
try {
return (mClosed || mActive == null) ? null : mActive.getIsolationLevel();
} finally {
mLock.unlock();
}
} | java | public IsolationLevel getIsolationLevel() {
mLock.lock();
try {
return (mClosed || mActive == null) ? null : mActive.getIsolationLevel();
} finally {
mLock.unlock();
}
} | [
"public",
"IsolationLevel",
"getIsolationLevel",
"(",
")",
"{",
"mLock",
".",
"lock",
"(",
")",
";",
"try",
"{",
"return",
"(",
"mClosed",
"||",
"mActive",
"==",
"null",
")",
"?",
"null",
":",
"mActive",
".",
"getIsolationLevel",
"(",
")",
";",
"}",
"f... | Returns the isolation level of the active transaction, or null if there
is no active transaction. | [
"Returns",
"the",
"isolation",
"level",
"of",
"the",
"active",
"transaction",
"or",
"null",
"if",
"there",
"is",
"no",
"active",
"transaction",
"."
] | eee29b365a61c8f03e1a1dc6bed0692e6b04b1db | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/txn/TransactionScope.java#L250-L257 |
7,795 | Carbonado/Carbonado | src/main/java/com/amazon/carbonado/txn/TransactionScope.java | TransactionScope.detach | void detach() {
mLock.lock();
try {
if (mDetached || mTxnMgr.removeLocalScope(this)) {
mDetached = true;
} else {
throw new IllegalStateException("Transaction is attached to a different thread");
}
} finally {
... | java | void detach() {
mLock.lock();
try {
if (mDetached || mTxnMgr.removeLocalScope(this)) {
mDetached = true;
} else {
throw new IllegalStateException("Transaction is attached to a different thread");
}
} finally {
... | [
"void",
"detach",
"(",
")",
"{",
"mLock",
".",
"lock",
"(",
")",
";",
"try",
"{",
"if",
"(",
"mDetached",
"||",
"mTxnMgr",
".",
"removeLocalScope",
"(",
"this",
")",
")",
"{",
"mDetached",
"=",
"true",
";",
"}",
"else",
"{",
"throw",
"new",
"Illega... | Called by TransactionImpl. | [
"Called",
"by",
"TransactionImpl",
"."
] | eee29b365a61c8f03e1a1dc6bed0692e6b04b1db | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/txn/TransactionScope.java#L283-L294 |
7,796 | Carbonado/Carbonado | src/main/java/com/amazon/carbonado/txn/TransactionScope.java | TransactionScope.close | void close() throws RepositoryException {
mLock.lock();
if (mClosed) {
mLock.unlock();
return;
}
Map<Class<?>, CursorList<TransactionImpl<Txn>>> cursors;
try {
cursors = mCursors;
// Ensure that map is freed pr... | java | void close() throws RepositoryException {
mLock.lock();
if (mClosed) {
mLock.unlock();
return;
}
Map<Class<?>, CursorList<TransactionImpl<Txn>>> cursors;
try {
cursors = mCursors;
// Ensure that map is freed pr... | [
"void",
"close",
"(",
")",
"throws",
"RepositoryException",
"{",
"mLock",
".",
"lock",
"(",
")",
";",
"if",
"(",
"mClosed",
")",
"{",
"mLock",
".",
"unlock",
"(",
")",
";",
"return",
";",
"}",
"Map",
"<",
"Class",
"<",
"?",
">",
",",
"CursorList",
... | Exits all transactions and closes all cursors. Should be called only
when repository is closed. | [
"Exits",
"all",
"transactions",
"and",
"closes",
"all",
"cursors",
".",
"Should",
"be",
"called",
"only",
"when",
"repository",
"is",
"closed",
"."
] | eee29b365a61c8f03e1a1dc6bed0692e6b04b1db | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/txn/TransactionScope.java#L320-L355 |
7,797 | Carbonado/Carbonado | src/main/java/com/amazon/carbonado/qe/StorableIndexSet.java | StorableIndexSet.addKey | @SuppressWarnings("unchecked")
public void addKey(StorableKey<S> key) {
if (key == null) {
throw new IllegalArgumentException();
}
add(new StorableIndex<S>(key, Direction.UNSPECIFIED));
} | java | @SuppressWarnings("unchecked")
public void addKey(StorableKey<S> key) {
if (key == null) {
throw new IllegalArgumentException();
}
add(new StorableIndex<S>(key, Direction.UNSPECIFIED));
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"void",
"addKey",
"(",
"StorableKey",
"<",
"S",
">",
"key",
")",
"{",
"if",
"(",
"key",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
")",
";",
"}",
"add",
"(",
"n... | Adds the key as a unique index, preserving the property arrangement.
@throws IllegalArgumentException if key is null | [
"Adds",
"the",
"key",
"as",
"a",
"unique",
"index",
"preserving",
"the",
"property",
"arrangement",
"."
] | eee29b365a61c8f03e1a1dc6bed0692e6b04b1db | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/qe/StorableIndexSet.java#L131-L137 |
7,798 | Carbonado/Carbonado | src/main/java/com/amazon/carbonado/qe/StorableIndexSet.java | StorableIndexSet.reduce | public void reduce(Direction defaultDirection) {
List<StorableIndex<S>> group = new ArrayList<StorableIndex<S>>();
Map<StorableIndex<S>, StorableIndex<S>> mergedReplacements =
new TreeMap<StorableIndex<S>, StorableIndex<S>>(STORABLE_INDEX_COMPARATOR);
Iterator<StorableIndex<S>>... | java | public void reduce(Direction defaultDirection) {
List<StorableIndex<S>> group = new ArrayList<StorableIndex<S>>();
Map<StorableIndex<S>, StorableIndex<S>> mergedReplacements =
new TreeMap<StorableIndex<S>, StorableIndex<S>>(STORABLE_INDEX_COMPARATOR);
Iterator<StorableIndex<S>>... | [
"public",
"void",
"reduce",
"(",
"Direction",
"defaultDirection",
")",
"{",
"List",
"<",
"StorableIndex",
"<",
"S",
">>",
"group",
"=",
"new",
"ArrayList",
"<",
"StorableIndex",
"<",
"S",
">",
">",
"(",
")",
";",
"Map",
"<",
"StorableIndex",
"<",
"S",
... | Reduces the size of the set by removing redundant indexes, and merges
others together.
@param defaultDirection replace unspecified property directions with this | [
"Reduces",
"the",
"size",
"of",
"the",
"set",
"by",
"removing",
"redundant",
"indexes",
"and",
"merges",
"others",
"together",
"."
] | eee29b365a61c8f03e1a1dc6bed0692e6b04b1db | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/qe/StorableIndexSet.java#L153-L179 |
7,799 | Carbonado/Carbonado | src/main/java/com/amazon/carbonado/qe/StorableIndexSet.java | StorableIndexSet.setDefaultDirection | public void setDefaultDirection(Direction defaultDirection) {
// Apply default sort direction to those unspecified.
if (defaultDirection != Direction.UNSPECIFIED) {
Map<StorableIndex<S>, StorableIndex<S>> replacements = null;
for (StorableIndex<S> index : this) {
... | java | public void setDefaultDirection(Direction defaultDirection) {
// Apply default sort direction to those unspecified.
if (defaultDirection != Direction.UNSPECIFIED) {
Map<StorableIndex<S>, StorableIndex<S>> replacements = null;
for (StorableIndex<S> index : this) {
... | [
"public",
"void",
"setDefaultDirection",
"(",
"Direction",
"defaultDirection",
")",
"{",
"// Apply default sort direction to those unspecified.\r",
"if",
"(",
"defaultDirection",
"!=",
"Direction",
".",
"UNSPECIFIED",
")",
"{",
"Map",
"<",
"StorableIndex",
"<",
"S",
">"... | Set the default direction for all index properties.
@param defaultDirection replace unspecified property directions with this | [
"Set",
"the",
"default",
"direction",
"for",
"all",
"index",
"properties",
"."
] | eee29b365a61c8f03e1a1dc6bed0692e6b04b1db | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/qe/StorableIndexSet.java#L186-L201 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.