repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
devnull-tools/trugger | src/main/java/tools/devnull/trugger/util/factory/ComponentFactory.java | ComponentFactory.toConfigure | public ComponentFactory<T, E> toConfigure(BiConsumer<Context, Annotation> consumer) {
return new ComponentFactory<>(this.annotationType, this.classElement, consumer, this.createFunction);
} | java | public ComponentFactory<T, E> toConfigure(BiConsumer<Context, Annotation> consumer) {
return new ComponentFactory<>(this.annotationType, this.classElement, consumer, this.createFunction);
} | [
"public",
"ComponentFactory",
"<",
"T",
",",
"E",
">",
"toConfigure",
"(",
"BiConsumer",
"<",
"Context",
",",
"Annotation",
">",
"consumer",
")",
"{",
"return",
"new",
"ComponentFactory",
"<>",
"(",
"this",
".",
"annotationType",
",",
"this",
".",
"classElem... | Adds more rules to the context by passing a consumer that will be invoked before creating the
component.
@param consumer the consumer to configure the context
@return a new ComponentFactory | [
"Adds",
"more",
"rules",
"to",
"the",
"context",
"by",
"passing",
"a",
"consumer",
"that",
"will",
"be",
"invoked",
"before",
"creating",
"the",
"component",
"."
] | 614d5f0b30daf82fc251a46fb436d0fc5e787627 | https://github.com/devnull-tools/trugger/blob/614d5f0b30daf82fc251a46fb436d0fc5e787627/src/main/java/tools/devnull/trugger/util/factory/ComponentFactory.java#L131-L133 | train |
devnull-tools/trugger | src/main/java/tools/devnull/trugger/util/factory/ComponentFactory.java | ComponentFactory.createAll | public List<E> createAll(AnnotatedElement element) {
List<E> result = new ArrayList<>();
for (Annotation annotation : element.getAnnotations()) {
create(annotation).ifPresent(result::add);
}
return result;
} | java | public List<E> createAll(AnnotatedElement element) {
List<E> result = new ArrayList<>();
for (Annotation annotation : element.getAnnotations()) {
create(annotation).ifPresent(result::add);
}
return result;
} | [
"public",
"List",
"<",
"E",
">",
"createAll",
"(",
"AnnotatedElement",
"element",
")",
"{",
"List",
"<",
"E",
">",
"result",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
"Annotation",
"annotation",
":",
"element",
".",
"getAnnotations",
"(",... | Creates a list of components based on the annotations of the given element.
@param element the element to search for annotations
@return a list of all components that can be instantiated from the
annotations present in the given element.
@see #create(java.lang.annotation.Annotation) | [
"Creates",
"a",
"list",
"of",
"components",
"based",
"on",
"the",
"annotations",
"of",
"the",
"given",
"element",
"."
] | 614d5f0b30daf82fc251a46fb436d0fc5e787627 | https://github.com/devnull-tools/trugger/blob/614d5f0b30daf82fc251a46fb436d0fc5e787627/src/main/java/tools/devnull/trugger/util/factory/ComponentFactory.java#L183-L189 | train |
redlink-gmbh/redlink-java-sdk | src/main/java/io/redlink/sdk/util/VersionHelper.java | VersionHelper.getVersion | public static String getVersion() {
String version = null;
// try to load from maven properties first
try {
Properties p = new Properties();
InputStream is = VersionHelper.class.getResourceAsStream("/META-INF/maven/io.redlink/redlink-sdk-java/pom.properties");
... | java | public static String getVersion() {
String version = null;
// try to load from maven properties first
try {
Properties p = new Properties();
InputStream is = VersionHelper.class.getResourceAsStream("/META-INF/maven/io.redlink/redlink-sdk-java/pom.properties");
... | [
"public",
"static",
"String",
"getVersion",
"(",
")",
"{",
"String",
"version",
"=",
"null",
";",
"// try to load from maven properties first",
"try",
"{",
"Properties",
"p",
"=",
"new",
"Properties",
"(",
")",
";",
"InputStream",
"is",
"=",
"VersionHelper",
"."... | Get artifact current version
@return version | [
"Get",
"artifact",
"current",
"version"
] | c412ff11bd80da52ade09f2483ab29cdbff5a28a | https://github.com/redlink-gmbh/redlink-java-sdk/blob/c412ff11bd80da52ade09f2483ab29cdbff5a28a/src/main/java/io/redlink/sdk/util/VersionHelper.java#L44-L82 | train |
redlink-gmbh/redlink-java-sdk | src/main/java/io/redlink/sdk/util/VersionHelper.java | VersionHelper.formatApiVersion | protected static String formatApiVersion(String version) {
if (StringUtils.isBlank(version)) {
return VERSION;
} else {
final Matcher matcher = VERSION_PATTERN.matcher(version);
if (matcher.matches()) {
return String.format("%s.%s", matcher.group(1), m... | java | protected static String formatApiVersion(String version) {
if (StringUtils.isBlank(version)) {
return VERSION;
} else {
final Matcher matcher = VERSION_PATTERN.matcher(version);
if (matcher.matches()) {
return String.format("%s.%s", matcher.group(1), m... | [
"protected",
"static",
"String",
"formatApiVersion",
"(",
"String",
"version",
")",
"{",
"if",
"(",
"StringUtils",
".",
"isBlank",
"(",
"version",
")",
")",
"{",
"return",
"VERSION",
";",
"}",
"else",
"{",
"final",
"Matcher",
"matcher",
"=",
"VERSION_PATTERN... | Build a proper api version
@param version raw version
@return api version
@see <a href="http://dev.redlink.io/sdk#introduction">api/sdk versioning</a> | [
"Build",
"a",
"proper",
"api",
"version"
] | c412ff11bd80da52ade09f2483ab29cdbff5a28a | https://github.com/redlink-gmbh/redlink-java-sdk/blob/c412ff11bd80da52ade09f2483ab29cdbff5a28a/src/main/java/io/redlink/sdk/util/VersionHelper.java#L102-L113 | train |
opsmatters/opsmatters-core | src/main/java/com/opsmatters/core/documents/XlsWorkbook.java | XlsWorkbook.numSheets | @Override
public int numSheets()
{
int ret = -1;
if(workbook != null)
ret = workbook.getNumberOfSheets();
else if(writableWorkbook != null)
ret = writableWorkbook.getNumberOfSheets();
return ret;
} | java | @Override
public int numSheets()
{
int ret = -1;
if(workbook != null)
ret = workbook.getNumberOfSheets();
else if(writableWorkbook != null)
ret = writableWorkbook.getNumberOfSheets();
return ret;
} | [
"@",
"Override",
"public",
"int",
"numSheets",
"(",
")",
"{",
"int",
"ret",
"=",
"-",
"1",
";",
"if",
"(",
"workbook",
"!=",
"null",
")",
"ret",
"=",
"workbook",
".",
"getNumberOfSheets",
"(",
")",
";",
"else",
"if",
"(",
"writableWorkbook",
"!=",
"n... | Returns the number of worksheets in the given workbook.
@return The number of worksheets in the given workbook | [
"Returns",
"the",
"number",
"of",
"worksheets",
"in",
"the",
"given",
"workbook",
"."
] | c48904f7e8d029fd45357811ec38a735e261e3fd | https://github.com/opsmatters/opsmatters-core/blob/c48904f7e8d029fd45357811ec38a735e261e3fd/src/main/java/com/opsmatters/core/documents/XlsWorkbook.java#L140-L149 | train |
opsmatters/opsmatters-core | src/main/java/com/opsmatters/core/documents/XlsWorkbook.java | XlsWorkbook.getSheetNames | @Override
public String[] getSheetNames()
{
String[] ret = null;
if(workbook != null)
ret = workbook.getSheetNames();
else if(writableWorkbook != null)
ret = writableWorkbook.getSheetNames();
return ret;
} | java | @Override
public String[] getSheetNames()
{
String[] ret = null;
if(workbook != null)
ret = workbook.getSheetNames();
else if(writableWorkbook != null)
ret = writableWorkbook.getSheetNames();
return ret;
} | [
"@",
"Override",
"public",
"String",
"[",
"]",
"getSheetNames",
"(",
")",
"{",
"String",
"[",
"]",
"ret",
"=",
"null",
";",
"if",
"(",
"workbook",
"!=",
"null",
")",
"ret",
"=",
"workbook",
".",
"getSheetNames",
"(",
")",
";",
"else",
"if",
"(",
"w... | Returns the list of worksheet names from the given Excel XLS file.
@return The list of worksheet names from the given workbook | [
"Returns",
"the",
"list",
"of",
"worksheet",
"names",
"from",
"the",
"given",
"Excel",
"XLS",
"file",
"."
] | c48904f7e8d029fd45357811ec38a735e261e3fd | https://github.com/opsmatters/opsmatters-core/blob/c48904f7e8d029fd45357811ec38a735e261e3fd/src/main/java/com/opsmatters/core/documents/XlsWorkbook.java#L155-L164 | train |
opsmatters/opsmatters-core | src/main/java/com/opsmatters/core/documents/XlsWorkbook.java | XlsWorkbook.getSheet | @Override
public XlsWorksheet getSheet(String name)
{
XlsWorksheet ret = null;
if(workbook != null)
{
Sheet sheet = workbook.getSheet(name);
if(sheet != null)
ret = new XlsWorksheet(sheet);
}
else if(writableWorkbook != null)
... | java | @Override
public XlsWorksheet getSheet(String name)
{
XlsWorksheet ret = null;
if(workbook != null)
{
Sheet sheet = workbook.getSheet(name);
if(sheet != null)
ret = new XlsWorksheet(sheet);
}
else if(writableWorkbook != null)
... | [
"@",
"Override",
"public",
"XlsWorksheet",
"getSheet",
"(",
"String",
"name",
")",
"{",
"XlsWorksheet",
"ret",
"=",
"null",
";",
"if",
"(",
"workbook",
"!=",
"null",
")",
"{",
"Sheet",
"sheet",
"=",
"workbook",
".",
"getSheet",
"(",
"name",
")",
";",
"... | Returns the worksheet with the given name in the workbook.
@param name The name of the worksheet
@return The worksheet with the given name in the workbook | [
"Returns",
"the",
"worksheet",
"with",
"the",
"given",
"name",
"in",
"the",
"workbook",
"."
] | c48904f7e8d029fd45357811ec38a735e261e3fd | https://github.com/opsmatters/opsmatters-core/blob/c48904f7e8d029fd45357811ec38a735e261e3fd/src/main/java/com/opsmatters/core/documents/XlsWorkbook.java#L187-L204 | train |
opsmatters/opsmatters-core | src/main/java/com/opsmatters/core/documents/XlsWorkbook.java | XlsWorkbook.createSheet | @Override
public XlsWorksheet createSheet(FileColumn[] columns, List<String[]> lines, String sheetName)
throws IOException
{
// Create the worksheet and add the cells
WritableSheet sheet = writableWorkbook.createSheet(sheetName, 9999); // Append sheet
try
{
a... | java | @Override
public XlsWorksheet createSheet(FileColumn[] columns, List<String[]> lines, String sheetName)
throws IOException
{
// Create the worksheet and add the cells
WritableSheet sheet = writableWorkbook.createSheet(sheetName, 9999); // Append sheet
try
{
a... | [
"@",
"Override",
"public",
"XlsWorksheet",
"createSheet",
"(",
"FileColumn",
"[",
"]",
"columns",
",",
"List",
"<",
"String",
"[",
"]",
">",
"lines",
",",
"String",
"sheetName",
")",
"throws",
"IOException",
"{",
"// Create the worksheet and add the cells",
"Writa... | Creates a sheet in the workbook with the given name and lines of data.
@param columns The column definitions for the worksheet
@param lines The list of lines to be added to the worksheet
@param sheetName The name of the worksheet to be added
@return The worksheet created
@throws IOException if the sheet cannot be creat... | [
"Creates",
"a",
"sheet",
"in",
"the",
"workbook",
"with",
"the",
"given",
"name",
"and",
"lines",
"of",
"data",
"."
] | c48904f7e8d029fd45357811ec38a735e261e3fd | https://github.com/opsmatters/opsmatters-core/blob/c48904f7e8d029fd45357811ec38a735e261e3fd/src/main/java/com/opsmatters/core/documents/XlsWorkbook.java#L238-L270 | train |
opsmatters/opsmatters-core | src/main/java/com/opsmatters/core/documents/XlsWorkbook.java | XlsWorkbook.appendToSheet | @Override
public void appendToSheet(FileColumn[] columns, List<String[]> lines, String sheetName)
throws IOException
{
try
{
XlsWorksheet sheet = getSheet(sheetName);
if(sheet != null)
appendRows((WritableSheet)sheet.getSheet(), columns, lines, she... | java | @Override
public void appendToSheet(FileColumn[] columns, List<String[]> lines, String sheetName)
throws IOException
{
try
{
XlsWorksheet sheet = getSheet(sheetName);
if(sheet != null)
appendRows((WritableSheet)sheet.getSheet(), columns, lines, she... | [
"@",
"Override",
"public",
"void",
"appendToSheet",
"(",
"FileColumn",
"[",
"]",
"columns",
",",
"List",
"<",
"String",
"[",
"]",
">",
"lines",
",",
"String",
"sheetName",
")",
"throws",
"IOException",
"{",
"try",
"{",
"XlsWorksheet",
"sheet",
"=",
"getShe... | Adds the given lines of data to an existing sheet in the workbook.
@param columns The column definitions for the worksheet
@param lines The list of lines to be added to the worksheet
@param sheetName The name of the worksheet to be added
@throws IOException if the data cannot be appended | [
"Adds",
"the",
"given",
"lines",
"of",
"data",
"to",
"an",
"existing",
"sheet",
"in",
"the",
"workbook",
"."
] | c48904f7e8d029fd45357811ec38a735e261e3fd | https://github.com/opsmatters/opsmatters-core/blob/c48904f7e8d029fd45357811ec38a735e261e3fd/src/main/java/com/opsmatters/core/documents/XlsWorkbook.java#L279-L293 | train |
opsmatters/opsmatters-core | src/main/java/com/opsmatters/core/documents/XlsWorkbook.java | XlsWorkbook.appendRows | private void appendRows(WritableSheet sheet, FileColumn[] columns,
List<String[]> lines, String sheetName)
throws WriteException
{
WritableFont headerFont = new WritableFont(WritableFont.ARIAL, 10, WritableFont.BOLD);
WritableCellFormat headerFormat = new WritableCellFormat(headerF... | java | private void appendRows(WritableSheet sheet, FileColumn[] columns,
List<String[]> lines, String sheetName)
throws WriteException
{
WritableFont headerFont = new WritableFont(WritableFont.ARIAL, 10, WritableFont.BOLD);
WritableCellFormat headerFormat = new WritableCellFormat(headerF... | [
"private",
"void",
"appendRows",
"(",
"WritableSheet",
"sheet",
",",
"FileColumn",
"[",
"]",
"columns",
",",
"List",
"<",
"String",
"[",
"]",
">",
"lines",
",",
"String",
"sheetName",
")",
"throws",
"WriteException",
"{",
"WritableFont",
"headerFont",
"=",
"... | Appends the given lines to the bottom of the given sheet.
@param sheet The sheet to add the lines to
@param columns The column definitions for the worksheet
@param lines The list of lines to be added to the worksheet
@param sheetName The name of the worksheet to be added
@return The array of column widths following the... | [
"Appends",
"the",
"given",
"lines",
"to",
"the",
"bottom",
"of",
"the",
"given",
"sheet",
"."
] | c48904f7e8d029fd45357811ec38a735e261e3fd | https://github.com/opsmatters/opsmatters-core/blob/c48904f7e8d029fd45357811ec38a735e261e3fd/src/main/java/com/opsmatters/core/documents/XlsWorkbook.java#L303-L359 | train |
opsmatters/opsmatters-core | src/main/java/com/opsmatters/core/documents/XlsWorkbook.java | XlsWorkbook.setCellFormatAttributes | public void setCellFormatAttributes(WritableCellFormat cellFormat, FileColumn column)
{
try
{
if(cellFormat != null && column != null)
{
Alignment a = Alignment.GENERAL;
short align = column.getAlign();
if(align == FileColumn.AL... | java | public void setCellFormatAttributes(WritableCellFormat cellFormat, FileColumn column)
{
try
{
if(cellFormat != null && column != null)
{
Alignment a = Alignment.GENERAL;
short align = column.getAlign();
if(align == FileColumn.AL... | [
"public",
"void",
"setCellFormatAttributes",
"(",
"WritableCellFormat",
"cellFormat",
",",
"FileColumn",
"column",
")",
"{",
"try",
"{",
"if",
"(",
"cellFormat",
"!=",
"null",
"&&",
"column",
"!=",
"null",
")",
"{",
"Alignment",
"a",
"=",
"Alignment",
".",
"... | Sets the cell attributes from the given column.
@param cellFormat The dell to set the attributes on
@param column The column definition to take the attributes from | [
"Sets",
"the",
"cell",
"attributes",
"from",
"the",
"given",
"column",
"."
] | c48904f7e8d029fd45357811ec38a735e261e3fd | https://github.com/opsmatters/opsmatters-core/blob/c48904f7e8d029fd45357811ec38a735e261e3fd/src/main/java/com/opsmatters/core/documents/XlsWorkbook.java#L436-L462 | train |
opsmatters/opsmatters-core | src/main/java/com/opsmatters/core/documents/XlsWorkbook.java | XlsWorkbook.close | @Override
public void close()
{
if(workbook != null)
workbook.close();
try
{
if(writableWorkbook != null)
writableWorkbook.close();
}
catch(IOException e)
{
}
catch(WriteException e)
{
}
... | java | @Override
public void close()
{
if(workbook != null)
workbook.close();
try
{
if(writableWorkbook != null)
writableWorkbook.close();
}
catch(IOException e)
{
}
catch(WriteException e)
{
}
... | [
"@",
"Override",
"public",
"void",
"close",
"(",
")",
"{",
"if",
"(",
"workbook",
"!=",
"null",
")",
"workbook",
".",
"close",
"(",
")",
";",
"try",
"{",
"if",
"(",
"writableWorkbook",
"!=",
"null",
")",
"writableWorkbook",
".",
"close",
"(",
")",
";... | Close the workbook. | [
"Close",
"the",
"workbook",
"."
] | c48904f7e8d029fd45357811ec38a735e261e3fd | https://github.com/opsmatters/opsmatters-core/blob/c48904f7e8d029fd45357811ec38a735e261e3fd/src/main/java/com/opsmatters/core/documents/XlsWorkbook.java#L478-L495 | train |
defei/codelogger-utils | src/main/java/org/codelogger/utils/RangeUtils.java | RangeUtils.getDateRanges | public static List<Range<Date>> getDateRanges(Date from, Date to, final Period periodGranulation)
throws InvalidRangeException {
if (from.after(to)) {
throw buildInvalidRangeException(from, to);
}
if (periodGranulation == Period.SINGLE) {
@SuppressWarnings("unchecked") ArrayList<Range<Dat... | java | public static List<Range<Date>> getDateRanges(Date from, Date to, final Period periodGranulation)
throws InvalidRangeException {
if (from.after(to)) {
throw buildInvalidRangeException(from, to);
}
if (periodGranulation == Period.SINGLE) {
@SuppressWarnings("unchecked") ArrayList<Range<Dat... | [
"public",
"static",
"List",
"<",
"Range",
"<",
"Date",
">",
">",
"getDateRanges",
"(",
"Date",
"from",
",",
"Date",
"to",
",",
"final",
"Period",
"periodGranulation",
")",
"throws",
"InvalidRangeException",
"{",
"if",
"(",
"from",
".",
"after",
"(",
"to",
... | Returns Range<Date> list between given date from and date to by
period granulation.
@param from the range from.
@param to the range to.
@param periodGranulation the range granulation.
@return Range<Date> list between given date from and date to by
period granulation. | [
"Returns",
"Range<",
";",
"Date>",
";",
"list",
"between",
"given",
"date",
"from",
"and",
"date",
"to",
"by",
"period",
"granulation",
"."
] | d906f5d217b783c7ae3e53442cd6fb87b20ecc0a | https://github.com/defei/codelogger-utils/blob/d906f5d217b783c7ae3e53442cd6fb87b20ecc0a/src/main/java/org/codelogger/utils/RangeUtils.java#L37-L71 | train |
defei/codelogger-utils | src/main/java/org/codelogger/utils/RangeUtils.java | RangeUtils.getDatePeriod | public static Range<Date> getDatePeriod(final Date date, final Period period) {
Calendar calendar = buildCalendar(date);
Range<Date> dateRange = null;
Date startDate = calendar.getTime();
Date endDate = calendar.getTime();
if (period != Period.DAY) {
for (; period.getValue(date) == period.get... | java | public static Range<Date> getDatePeriod(final Date date, final Period period) {
Calendar calendar = buildCalendar(date);
Range<Date> dateRange = null;
Date startDate = calendar.getTime();
Date endDate = calendar.getTime();
if (period != Period.DAY) {
for (; period.getValue(date) == period.get... | [
"public",
"static",
"Range",
"<",
"Date",
">",
"getDatePeriod",
"(",
"final",
"Date",
"date",
",",
"final",
"Period",
"period",
")",
"{",
"Calendar",
"calendar",
"=",
"buildCalendar",
"(",
"date",
")",
";",
"Range",
"<",
"Date",
">",
"dateRange",
"=",
"n... | Return Range<Date> by given date and period.
@param date the date belong to the range.
@param period the range granulation.
@return a Range<Date> by given date and period. | [
"Return",
"Range<",
";",
"Date>",
";",
"by",
"given",
"date",
"and",
"period",
"."
] | d906f5d217b783c7ae3e53442cd6fb87b20ecc0a | https://github.com/defei/codelogger-utils/blob/d906f5d217b783c7ae3e53442cd6fb87b20ecc0a/src/main/java/org/codelogger/utils/RangeUtils.java#L86-L107 | train |
defei/codelogger-utils | src/main/java/org/codelogger/utils/RangeUtils.java | RangeUtils.buildCalendar | private static Calendar buildCalendar(final Date date) {
Calendar calendar = buildCalendar();
calendar.setTime(date);
return calendar;
} | java | private static Calendar buildCalendar(final Date date) {
Calendar calendar = buildCalendar();
calendar.setTime(date);
return calendar;
} | [
"private",
"static",
"Calendar",
"buildCalendar",
"(",
"final",
"Date",
"date",
")",
"{",
"Calendar",
"calendar",
"=",
"buildCalendar",
"(",
")",
";",
"calendar",
".",
"setTime",
"(",
"date",
")",
";",
"return",
"calendar",
";",
"}"
] | Gets a calendar using the default time zone and locale. The Calendar
returned is based on the given time in the default time zone with the
default locale.
@return an calendar instance. | [
"Gets",
"a",
"calendar",
"using",
"the",
"default",
"time",
"zone",
"and",
"locale",
".",
"The",
"Calendar",
"returned",
"is",
"based",
"on",
"the",
"given",
"time",
"in",
"the",
"default",
"time",
"zone",
"with",
"the",
"default",
"locale",
"."
] | d906f5d217b783c7ae3e53442cd6fb87b20ecc0a | https://github.com/defei/codelogger-utils/blob/d906f5d217b783c7ae3e53442cd6fb87b20ecc0a/src/main/java/org/codelogger/utils/RangeUtils.java#L150-L155 | train |
seedstack/shed | src/main/java/org/seedstack/shed/misc/RetryingExecutor.java | RetryingExecutor.execute | public synchronized void execute(Runnable command) {
if (active.get()) {
stop();
this.command = command;
start();
} else {
this.command = command;
}
} | java | public synchronized void execute(Runnable command) {
if (active.get()) {
stop();
this.command = command;
start();
} else {
this.command = command;
}
} | [
"public",
"synchronized",
"void",
"execute",
"(",
"Runnable",
"command",
")",
"{",
"if",
"(",
"active",
".",
"get",
"(",
")",
")",
"{",
"stop",
"(",
")",
";",
"this",
".",
"command",
"=",
"command",
";",
"start",
"(",
")",
";",
"}",
"else",
"{",
... | Executes the specified command continuously if the executor is started.
@param command the command to execute. | [
"Executes",
"the",
"specified",
"command",
"continuously",
"if",
"the",
"executor",
"is",
"started",
"."
] | 49ecb25aa3777539ab0f29f89abaae5ee93b572e | https://github.com/seedstack/shed/blob/49ecb25aa3777539ab0f29f89abaae5ee93b572e/src/main/java/org/seedstack/shed/misc/RetryingExecutor.java#L100-L108 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/javac/util/Name.java | Name.startsWith | public boolean startsWith(Name prefix) {
byte[] thisBytes = this.getByteArray();
int thisOffset = this.getByteOffset();
int thisLength = this.getByteLength();
byte[] prefixBytes = prefix.getByteArray();
int prefixOffset = prefix.getByteOffset();
int prefixLength =... | java | public boolean startsWith(Name prefix) {
byte[] thisBytes = this.getByteArray();
int thisOffset = this.getByteOffset();
int thisLength = this.getByteLength();
byte[] prefixBytes = prefix.getByteArray();
int prefixOffset = prefix.getByteOffset();
int prefixLength =... | [
"public",
"boolean",
"startsWith",
"(",
"Name",
"prefix",
")",
"{",
"byte",
"[",
"]",
"thisBytes",
"=",
"this",
".",
"getByteArray",
"(",
")",
";",
"int",
"thisOffset",
"=",
"this",
".",
"getByteOffset",
"(",
")",
";",
"int",
"thisLength",
"=",
"this",
... | Does this name start with prefix? | [
"Does",
"this",
"name",
"start",
"with",
"prefix?"
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/javac/util/Name.java#L119-L133 | train |
incodehq-legacy/incode-module-document | dom/src/main/java/org/incode/module/document/dom/impl/docs/DocumentTemplateRepository.java | DocumentTemplateRepository.createBlob | @Programmatic
public DocumentTemplate createBlob(
final DocumentType type,
final LocalDate date,
final String atPath,
final String fileSuffix,
final boolean previewOnly,
final Blob blob,
final RenderingStrategy contentRenderingStrat... | java | @Programmatic
public DocumentTemplate createBlob(
final DocumentType type,
final LocalDate date,
final String atPath,
final String fileSuffix,
final boolean previewOnly,
final Blob blob,
final RenderingStrategy contentRenderingStrat... | [
"@",
"Programmatic",
"public",
"DocumentTemplate",
"createBlob",
"(",
"final",
"DocumentType",
"type",
",",
"final",
"LocalDate",
"date",
",",
"final",
"String",
"atPath",
",",
"final",
"String",
"fileSuffix",
",",
"final",
"boolean",
"previewOnly",
",",
"final",
... | region > createBlob, createClob, createText | [
"region",
">",
"createBlob",
"createClob",
"createText"
] | c62f064e96d6e6007f7fd6a4bc06e03b78b1816c | https://github.com/incodehq-legacy/incode-module-document/blob/c62f064e96d6e6007f7fd6a4bc06e03b78b1816c/dom/src/main/java/org/incode/module/document/dom/impl/docs/DocumentTemplateRepository.java#L54-L73 | train |
incodehq-legacy/incode-module-document | dom/src/main/java/org/incode/module/document/dom/impl/docs/DocumentTemplateRepository.java | DocumentTemplateRepository.findByType | @Programmatic
public List<DocumentTemplate> findByType(final DocumentType documentType) {
return repositoryService.allMatches(
new QueryDefault<>(DocumentTemplate.class,
"findByType",
"type", documentType));
} | java | @Programmatic
public List<DocumentTemplate> findByType(final DocumentType documentType) {
return repositoryService.allMatches(
new QueryDefault<>(DocumentTemplate.class,
"findByType",
"type", documentType));
} | [
"@",
"Programmatic",
"public",
"List",
"<",
"DocumentTemplate",
">",
"findByType",
"(",
"final",
"DocumentType",
"documentType",
")",
"{",
"return",
"repositoryService",
".",
"allMatches",
"(",
"new",
"QueryDefault",
"<>",
"(",
"DocumentTemplate",
".",
"class",
",... | Returns all templates for a type, ordered by application tenancy and date desc. | [
"Returns",
"all",
"templates",
"for",
"a",
"type",
"ordered",
"by",
"application",
"tenancy",
"and",
"date",
"desc",
"."
] | c62f064e96d6e6007f7fd6a4bc06e03b78b1816c | https://github.com/incodehq-legacy/incode-module-document/blob/c62f064e96d6e6007f7fd6a4bc06e03b78b1816c/dom/src/main/java/org/incode/module/document/dom/impl/docs/DocumentTemplateRepository.java#L222-L228 | train |
incodehq-legacy/incode-module-document | dom/src/main/java/org/incode/module/document/dom/impl/docs/DocumentTemplateRepository.java | DocumentTemplateRepository.findByApplicableToAtPathAndCurrent | @Programmatic
public List<DocumentTemplate> findByApplicableToAtPathAndCurrent(final String atPath) {
final LocalDate now = clockService.now();
return repositoryService.allMatches(
new QueryDefault<>(DocumentTemplate.class,
"findByApplicableToAtPathAndCurrent"... | java | @Programmatic
public List<DocumentTemplate> findByApplicableToAtPathAndCurrent(final String atPath) {
final LocalDate now = clockService.now();
return repositoryService.allMatches(
new QueryDefault<>(DocumentTemplate.class,
"findByApplicableToAtPathAndCurrent"... | [
"@",
"Programmatic",
"public",
"List",
"<",
"DocumentTemplate",
">",
"findByApplicableToAtPathAndCurrent",
"(",
"final",
"String",
"atPath",
")",
"{",
"final",
"LocalDate",
"now",
"=",
"clockService",
".",
"now",
"(",
")",
";",
"return",
"repositoryService",
".",
... | Returns all templates available for a particular application tenancy, ordered by most specific tenancy first and
then within that the most recent first. | [
"Returns",
"all",
"templates",
"available",
"for",
"a",
"particular",
"application",
"tenancy",
"ordered",
"by",
"most",
"specific",
"tenancy",
"first",
"and",
"then",
"within",
"that",
"the",
"most",
"recent",
"first",
"."
] | c62f064e96d6e6007f7fd6a4bc06e03b78b1816c | https://github.com/incodehq-legacy/incode-module-document/blob/c62f064e96d6e6007f7fd6a4bc06e03b78b1816c/dom/src/main/java/org/incode/module/document/dom/impl/docs/DocumentTemplateRepository.java#L235-L243 | train |
incodehq-legacy/incode-module-document | dom/src/main/java/org/incode/module/document/dom/impl/docs/DocumentTemplateRepository.java | DocumentTemplateRepository.validateApplicationTenancyAndDate | @Programmatic
public TranslatableString validateApplicationTenancyAndDate(
final DocumentType proposedType,
final String proposedAtPath,
final LocalDate proposedDate,
final DocumentTemplate ignore) {
final List<DocumentTemplate> existingTemplates =
... | java | @Programmatic
public TranslatableString validateApplicationTenancyAndDate(
final DocumentType proposedType,
final String proposedAtPath,
final LocalDate proposedDate,
final DocumentTemplate ignore) {
final List<DocumentTemplate> existingTemplates =
... | [
"@",
"Programmatic",
"public",
"TranslatableString",
"validateApplicationTenancyAndDate",
"(",
"final",
"DocumentType",
"proposedType",
",",
"final",
"String",
"proposedAtPath",
",",
"final",
"LocalDate",
"proposedDate",
",",
"final",
"DocumentTemplate",
"ignore",
")",
"{... | region > validate... | [
"region",
">",
"validate",
"..."
] | c62f064e96d6e6007f7fd6a4bc06e03b78b1816c | https://github.com/incodehq-legacy/incode-module-document/blob/c62f064e96d6e6007f7fd6a4bc06e03b78b1816c/dom/src/main/java/org/incode/module/document/dom/impl/docs/DocumentTemplateRepository.java#L254-L276 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/sjavac/server/CompilerThread.java | CompilerThread.numActiveSubTasks | public synchronized int numActiveSubTasks() {
int c = 0;
for (Future<?> f : subTasks) {
if (!f.isDone() && !f.isCancelled()) {
c++;
}
}
return c;
} | java | public synchronized int numActiveSubTasks() {
int c = 0;
for (Future<?> f : subTasks) {
if (!f.isDone() && !f.isCancelled()) {
c++;
}
}
return c;
} | [
"public",
"synchronized",
"int",
"numActiveSubTasks",
"(",
")",
"{",
"int",
"c",
"=",
"0",
";",
"for",
"(",
"Future",
"<",
"?",
">",
"f",
":",
"subTasks",
")",
"{",
"if",
"(",
"!",
"f",
".",
"isDone",
"(",
")",
"&&",
"!",
"f",
".",
"isCancelled",... | Count the number of active sub tasks. | [
"Count",
"the",
"number",
"of",
"active",
"sub",
"tasks",
"."
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/sjavac/server/CompilerThread.java#L102-L110 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/sjavac/server/CompilerThread.java | CompilerThread.use | public synchronized void use() {
assert(!inUse);
inUse = true;
compiler = com.sun.tools.javac.api.JavacTool.create();
fileManager = compiler.getStandardFileManager(null, null, null);
fileManagerBase = (BaseFileManager)fileManager;
smartFileManager = new SmartFileManager(f... | java | public synchronized void use() {
assert(!inUse);
inUse = true;
compiler = com.sun.tools.javac.api.JavacTool.create();
fileManager = compiler.getStandardFileManager(null, null, null);
fileManagerBase = (BaseFileManager)fileManager;
smartFileManager = new SmartFileManager(f... | [
"public",
"synchronized",
"void",
"use",
"(",
")",
"{",
"assert",
"(",
"!",
"inUse",
")",
";",
"inUse",
"=",
"true",
";",
"compiler",
"=",
"com",
".",
"sun",
".",
"tools",
".",
"javac",
".",
"api",
".",
"JavacTool",
".",
"create",
"(",
")",
";",
... | Prepare the compiler thread for use. It is not yet started.
It will be started by the executor service. | [
"Prepare",
"the",
"compiler",
"thread",
"for",
"use",
".",
"It",
"is",
"not",
"yet",
"started",
".",
"It",
"will",
"be",
"started",
"by",
"the",
"executor",
"service",
"."
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/sjavac/server/CompilerThread.java#L123-L135 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/sjavac/server/CompilerThread.java | CompilerThread.unuse | public synchronized void unuse() {
assert(inUse);
inUse = false;
compiler = null;
fileManager = null;
fileManagerBase = null;
smartFileManager = null;
context = null;
subTasks = null;
} | java | public synchronized void unuse() {
assert(inUse);
inUse = false;
compiler = null;
fileManager = null;
fileManagerBase = null;
smartFileManager = null;
context = null;
subTasks = null;
} | [
"public",
"synchronized",
"void",
"unuse",
"(",
")",
"{",
"assert",
"(",
"inUse",
")",
";",
"inUse",
"=",
"false",
";",
"compiler",
"=",
"null",
";",
"fileManager",
"=",
"null",
";",
"fileManagerBase",
"=",
"null",
";",
"smartFileManager",
"=",
"null",
"... | Prepare the compiler thread for idleness. | [
"Prepare",
"the",
"compiler",
"thread",
"for",
"idleness",
"."
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/sjavac/server/CompilerThread.java#L140-L149 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/sjavac/server/CompilerThread.java | CompilerThread.expect | private static boolean expect(BufferedReader in, String key) throws IOException {
String s = in.readLine();
if (s != null && s.equals(key)) {
return true;
}
return false;
} | java | private static boolean expect(BufferedReader in, String key) throws IOException {
String s = in.readLine();
if (s != null && s.equals(key)) {
return true;
}
return false;
} | [
"private",
"static",
"boolean",
"expect",
"(",
"BufferedReader",
"in",
",",
"String",
"key",
")",
"throws",
"IOException",
"{",
"String",
"s",
"=",
"in",
".",
"readLine",
"(",
")",
";",
"if",
"(",
"s",
"!=",
"null",
"&&",
"s",
".",
"equals",
"(",
"ke... | Expect this key on the next line read from the reader. | [
"Expect",
"this",
"key",
"on",
"the",
"next",
"line",
"read",
"from",
"the",
"reader",
"."
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/sjavac/server/CompilerThread.java#L154-L160 | train |
brianwhu/xillium | data/src/main/java/org/xillium/data/persistence/ParametricStatement.java | ParametricStatement.set | public ParametricStatement set(String sql) throws IllegalArgumentException {
if (_env != null) {
try { sql = Macro.expand(sql, _env.call()); } catch (Exception x) { throw new IllegalArgumentException(x.getMessage(), x); }
}
if (_params != null) {
int count = 0;
int qmark ... | java | public ParametricStatement set(String sql) throws IllegalArgumentException {
if (_env != null) {
try { sql = Macro.expand(sql, _env.call()); } catch (Exception x) { throw new IllegalArgumentException(x.getMessage(), x); }
}
if (_params != null) {
int count = 0;
int qmark ... | [
"public",
"ParametricStatement",
"set",
"(",
"String",
"sql",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"_env",
"!=",
"null",
")",
"{",
"try",
"{",
"sql",
"=",
"Macro",
".",
"expand",
"(",
"sql",
",",
"_env",
".",
"call",
"(",
")",
")"... | Assigns a SQL string to this ParametricStatement. | [
"Assigns",
"a",
"SQL",
"string",
"to",
"this",
"ParametricStatement",
"."
] | e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799 | https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/data/src/main/java/org/xillium/data/persistence/ParametricStatement.java#L134-L156 | train |
brianwhu/xillium | data/src/main/java/org/xillium/data/persistence/ParametricStatement.java | ParametricStatement.executeUpdate | public int executeUpdate(Connection conn, DataObject object) throws SQLException {
PreparedStatement statement = conn.prepareStatement(_sql);
try {
load(statement, object);
return statement.executeUpdate();
} finally {
statement.close();
}
} | java | public int executeUpdate(Connection conn, DataObject object) throws SQLException {
PreparedStatement statement = conn.prepareStatement(_sql);
try {
load(statement, object);
return statement.executeUpdate();
} finally {
statement.close();
}
} | [
"public",
"int",
"executeUpdate",
"(",
"Connection",
"conn",
",",
"DataObject",
"object",
")",
"throws",
"SQLException",
"{",
"PreparedStatement",
"statement",
"=",
"conn",
".",
"prepareStatement",
"(",
"_sql",
")",
";",
"try",
"{",
"load",
"(",
"statement",
"... | Executes an UPDATE or DELETE statement.
@return the number of rows affected | [
"Executes",
"an",
"UPDATE",
"or",
"DELETE",
"statement",
"."
] | e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799 | https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/data/src/main/java/org/xillium/data/persistence/ParametricStatement.java#L271-L279 | train |
brianwhu/xillium | data/src/main/java/org/xillium/data/persistence/ParametricStatement.java | ParametricStatement.executeUpdate | public int executeUpdate(Connection conn, DataObject[] objects) throws SQLException {
PreparedStatement statement = conn.prepareStatement(_sql);
try {
for (DataObject object: objects) {
load(statement, object);
statement.addBatch();
}
i... | java | public int executeUpdate(Connection conn, DataObject[] objects) throws SQLException {
PreparedStatement statement = conn.prepareStatement(_sql);
try {
for (DataObject object: objects) {
load(statement, object);
statement.addBatch();
}
i... | [
"public",
"int",
"executeUpdate",
"(",
"Connection",
"conn",
",",
"DataObject",
"[",
"]",
"objects",
")",
"throws",
"SQLException",
"{",
"PreparedStatement",
"statement",
"=",
"conn",
".",
"prepareStatement",
"(",
"_sql",
")",
";",
"try",
"{",
"for",
"(",
"D... | Executes a batch UPDATE or DELETE statement.
@return the number of rows affected | [
"Executes",
"a",
"batch",
"UPDATE",
"or",
"DELETE",
"statement",
"."
] | e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799 | https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/data/src/main/java/org/xillium/data/persistence/ParametricStatement.java#L286-L298 | train |
brianwhu/xillium | data/src/main/java/org/xillium/data/persistence/ParametricStatement.java | ParametricStatement.executeInsert | public long[] executeInsert(Connection conn, DataObject object, boolean generatedKeys) throws SQLException {
PreparedStatement statement = conn.prepareStatement(_sql, generatedKeys ? Statement.RETURN_GENERATED_KEYS : Statement.NO_GENERATED_KEYS);
try {
load(statement, object);
lo... | java | public long[] executeInsert(Connection conn, DataObject object, boolean generatedKeys) throws SQLException {
PreparedStatement statement = conn.prepareStatement(_sql, generatedKeys ? Statement.RETURN_GENERATED_KEYS : Statement.NO_GENERATED_KEYS);
try {
load(statement, object);
lo... | [
"public",
"long",
"[",
"]",
"executeInsert",
"(",
"Connection",
"conn",
",",
"DataObject",
"object",
",",
"boolean",
"generatedKeys",
")",
"throws",
"SQLException",
"{",
"PreparedStatement",
"statement",
"=",
"conn",
".",
"prepareStatement",
"(",
"_sql",
",",
"g... | Executes an INSERT statement.
@return an array whose length indicates the number of rows inserted. If generatedKeys is true, the array
contains the keys; otherwise the content of the array is not defined. | [
"Executes",
"an",
"INSERT",
"statement",
"."
] | e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799 | https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/data/src/main/java/org/xillium/data/persistence/ParametricStatement.java#L325-L341 | train |
brianwhu/xillium | data/src/main/java/org/xillium/data/persistence/ParametricStatement.java | ParametricStatement.executeProcedure | public int executeProcedure(Connection conn, DataObject object) throws SQLException {
CallableStatement statement = conn.prepareCall(_sql);
try {
for (int i = 0; i < _params.length; ++i) {
if ((_params[i].direction & Param.OUT) == 0) continue;
statement.regist... | java | public int executeProcedure(Connection conn, DataObject object) throws SQLException {
CallableStatement statement = conn.prepareCall(_sql);
try {
for (int i = 0; i < _params.length; ++i) {
if ((_params[i].direction & Param.OUT) == 0) continue;
statement.regist... | [
"public",
"int",
"executeProcedure",
"(",
"Connection",
"conn",
",",
"DataObject",
"object",
")",
"throws",
"SQLException",
"{",
"CallableStatement",
"statement",
"=",
"conn",
".",
"prepareCall",
"(",
"_sql",
")",
";",
"try",
"{",
"for",
"(",
"int",
"i",
"="... | Executes a callable statement that performs updates.
@return the number of rows affected | [
"Executes",
"a",
"callable",
"statement",
"that",
"performs",
"updates",
"."
] | e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799 | https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/data/src/main/java/org/xillium/data/persistence/ParametricStatement.java#L400-L429 | train |
brianwhu/xillium | gear/src/main/java/org/xillium/gear/util/CloseableFutureGroup.java | CloseableFutureGroup.add | public void add(T closeable, Future<?> future) {
_pairs.add(new Pair<T, Future<?>>(closeable, future));
} | java | public void add(T closeable, Future<?> future) {
_pairs.add(new Pair<T, Future<?>>(closeable, future));
} | [
"public",
"void",
"add",
"(",
"T",
"closeable",
",",
"Future",
"<",
"?",
">",
"future",
")",
"{",
"_pairs",
".",
"add",
"(",
"new",
"Pair",
"<",
"T",
",",
"Future",
"<",
"?",
">",
">",
"(",
"closeable",
",",
"future",
")",
")",
";",
"}"
] | Adds an AutoCloseable task and associated Future to this group. | [
"Adds",
"an",
"AutoCloseable",
"task",
"and",
"associated",
"Future",
"to",
"this",
"group",
"."
] | e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799 | https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/gear/src/main/java/org/xillium/gear/util/CloseableFutureGroup.java#L70-L72 | train |
brianwhu/xillium | gear/src/main/java/org/xillium/gear/util/CloseableFutureGroup.java | CloseableFutureGroup.isDone | public boolean isDone() {
int count = 0;
for (Pair<T, Future<?>> pair: _pairs) {
if (pair.second.isDone()) ++count;
}
return count == _pairs.size();
} | java | public boolean isDone() {
int count = 0;
for (Pair<T, Future<?>> pair: _pairs) {
if (pair.second.isDone()) ++count;
}
return count == _pairs.size();
} | [
"public",
"boolean",
"isDone",
"(",
")",
"{",
"int",
"count",
"=",
"0",
";",
"for",
"(",
"Pair",
"<",
"T",
",",
"Future",
"<",
"?",
">",
">",
"pair",
":",
"_pairs",
")",
"{",
"if",
"(",
"pair",
".",
"second",
".",
"isDone",
"(",
")",
")",
"++... | Reports whether all futures in this group has completed. | [
"Reports",
"whether",
"all",
"futures",
"in",
"this",
"group",
"has",
"completed",
"."
] | e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799 | https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/gear/src/main/java/org/xillium/gear/util/CloseableFutureGroup.java#L84-L90 | train |
brianwhu/xillium | gear/src/main/java/org/xillium/gear/util/CloseableFutureGroup.java | CloseableFutureGroup.close | @Override
public void close() {
// waiting phase
int count = 0, last = 0;
do {
last = count;
try { Thread.sleep(500); } catch (Exception x) {}
count = 0;
for (Pair<T, Future<?>> pair: _pairs) {
if (pair.second.isDone()) ++count;... | java | @Override
public void close() {
// waiting phase
int count = 0, last = 0;
do {
last = count;
try { Thread.sleep(500); } catch (Exception x) {}
count = 0;
for (Pair<T, Future<?>> pair: _pairs) {
if (pair.second.isDone()) ++count;... | [
"@",
"Override",
"public",
"void",
"close",
"(",
")",
"{",
"// waiting phase",
"int",
"count",
"=",
"0",
",",
"last",
"=",
"0",
";",
"do",
"{",
"last",
"=",
"count",
";",
"try",
"{",
"Thread",
".",
"sleep",
"(",
"500",
")",
";",
"}",
"catch",
"("... | Closes all Futures.
Waits for futures to complete, then closes those still running after the "waiting phase" has ended. | [
"Closes",
"all",
"Futures",
".",
"Waits",
"for",
"futures",
"to",
"complete",
"then",
"closes",
"those",
"still",
"running",
"after",
"the",
"waiting",
"phase",
"has",
"ended",
"."
] | e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799 | https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/gear/src/main/java/org/xillium/gear/util/CloseableFutureGroup.java#L96-L122 | train |
coopernurse/barrister-java | src/main/java/com/bitmechanic/barrister/Contract.java | Contract.load | public static Contract load(File idlJson) throws IOException {
FileInputStream fis = new FileInputStream(idlJson);
Contract c = load(fis);
fis.close();
return c;
} | java | public static Contract load(File idlJson) throws IOException {
FileInputStream fis = new FileInputStream(idlJson);
Contract c = load(fis);
fis.close();
return c;
} | [
"public",
"static",
"Contract",
"load",
"(",
"File",
"idlJson",
")",
"throws",
"IOException",
"{",
"FileInputStream",
"fis",
"=",
"new",
"FileInputStream",
"(",
"idlJson",
")",
";",
"Contract",
"c",
"=",
"load",
"(",
"fis",
")",
";",
"fis",
".",
"close",
... | Loads the IDL JSON file, parses it, and returns a Contract.
Uses the JacksonSerializer.
@param idlJson Barrister IDL JSON file to load
@return Contract based on the IDL JSON file
@throws IOException If there is a problem reading the file, or if JSON
deserialization fails | [
"Loads",
"the",
"IDL",
"JSON",
"file",
"parses",
"it",
"and",
"returns",
"a",
"Contract",
".",
"Uses",
"the",
"JacksonSerializer",
"."
] | c2b639634c88a25002b66d1fb4a8f5fb51ade6a2 | https://github.com/coopernurse/barrister-java/blob/c2b639634c88a25002b66d1fb4a8f5fb51ade6a2/src/main/java/com/bitmechanic/barrister/Contract.java#L35-L40 | train |
coopernurse/barrister-java | src/main/java/com/bitmechanic/barrister/Contract.java | Contract.load | @SuppressWarnings("unchecked")
public static Contract load(InputStream idlJson, Serializer ser) throws IOException {
return new Contract(ser.readList(idlJson));
} | java | @SuppressWarnings("unchecked")
public static Contract load(InputStream idlJson, Serializer ser) throws IOException {
return new Contract(ser.readList(idlJson));
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"Contract",
"load",
"(",
"InputStream",
"idlJson",
",",
"Serializer",
"ser",
")",
"throws",
"IOException",
"{",
"return",
"new",
"Contract",
"(",
"ser",
".",
"readList",
"(",
"idlJson",
")... | Loads the IDL from the given stream using an arbitrary serializer and returns
a Contract.
@param idlJson Stream containing serialized IDL
@param ser Serializer implementation to use
@return Contract based on the IDL stream
@throws IOException if there is a problem reading the stream, or if deserialization fails | [
"Loads",
"the",
"IDL",
"from",
"the",
"given",
"stream",
"using",
"an",
"arbitrary",
"serializer",
"and",
"returns",
"a",
"Contract",
"."
] | c2b639634c88a25002b66d1fb4a8f5fb51ade6a2 | https://github.com/coopernurse/barrister-java/blob/c2b639634c88a25002b66d1fb4a8f5fb51ade6a2/src/main/java/com/bitmechanic/barrister/Contract.java#L64-L67 | train |
coopernurse/barrister-java | src/main/java/com/bitmechanic/barrister/Contract.java | Contract.getFunction | public Function getFunction(String iface, String func) throws RpcException {
Interface i = interfaces.get(iface);
if (i == null) {
String msg = "Interface '" + iface + "' not found";
throw RpcException.Error.METHOD_NOT_FOUND.exc(msg);
}
Function f = i.getFunction... | java | public Function getFunction(String iface, String func) throws RpcException {
Interface i = interfaces.get(iface);
if (i == null) {
String msg = "Interface '" + iface + "' not found";
throw RpcException.Error.METHOD_NOT_FOUND.exc(msg);
}
Function f = i.getFunction... | [
"public",
"Function",
"getFunction",
"(",
"String",
"iface",
",",
"String",
"func",
")",
"throws",
"RpcException",
"{",
"Interface",
"i",
"=",
"interfaces",
".",
"get",
"(",
"iface",
")",
";",
"if",
"(",
"i",
"==",
"null",
")",
"{",
"String",
"msg",
"=... | Returns the Function associated with the given interface and function name.
@param iface Interface name
@param func Function name in the interface
@return Function that matches iface and func on this Contract
@throws RpcException If no Function matches | [
"Returns",
"the",
"Function",
"associated",
"with",
"the",
"given",
"interface",
"and",
"function",
"name",
"."
] | c2b639634c88a25002b66d1fb4a8f5fb51ade6a2 | https://github.com/coopernurse/barrister-java/blob/c2b639634c88a25002b66d1fb4a8f5fb51ade6a2/src/main/java/com/bitmechanic/barrister/Contract.java#L232-L246 | train |
rvs-fluid-it/mvn-fluid-cd | mvn-ext-freeze/src/main/java/be/fluid_it/mvn/cd/x/freeze/replace/FreezeHandler.java | FreezeHandler.getName | private String getName(String s1, String s2) {
if (s1 == null || "".equals(s1)) return s2;
else return s1;
} | java | private String getName(String s1, String s2) {
if (s1 == null || "".equals(s1)) return s2;
else return s1;
} | [
"private",
"String",
"getName",
"(",
"String",
"s1",
",",
"String",
"s2",
")",
"{",
"if",
"(",
"s1",
"==",
"null",
"||",
"\"\"",
".",
"equals",
"(",
"s1",
")",
")",
"return",
"s2",
";",
"else",
"return",
"s1",
";",
"}"
] | If the first String parameter is nonempty, return it,
else return the second string parameter.
@param s1 The string to be tested.
@param s2 The alternate String.
@return s1 if it isn't empty, else s2. | [
"If",
"the",
"first",
"String",
"parameter",
"is",
"nonempty",
"return",
"it",
"else",
"return",
"the",
"second",
"string",
"parameter",
"."
] | 2aad8ed1cb40f94bd24bad7e6a127956cc277077 | https://github.com/rvs-fluid-it/mvn-fluid-cd/blob/2aad8ed1cb40f94bd24bad7e6a127956cc277077/mvn-ext-freeze/src/main/java/be/fluid_it/mvn/cd/x/freeze/replace/FreezeHandler.java#L261-L264 | train |
rvs-fluid-it/mvn-fluid-cd | mvn-ext-freeze/src/main/java/be/fluid_it/mvn/cd/x/freeze/replace/FreezeHandler.java | FreezeHandler.write | private void write(String s)
throws SAXException {
try {
out.write(s);
out.flush();
} catch (IOException ioException) {
throw new SAXParseException("I/O error",
documentLocator,
ioException);
}
... | java | private void write(String s)
throws SAXException {
try {
out.write(s);
out.flush();
} catch (IOException ioException) {
throw new SAXParseException("I/O error",
documentLocator,
ioException);
}
... | [
"private",
"void",
"write",
"(",
"String",
"s",
")",
"throws",
"SAXException",
"{",
"try",
"{",
"out",
".",
"write",
"(",
"s",
")",
";",
"out",
".",
"flush",
"(",
")",
";",
"}",
"catch",
"(",
"IOException",
"ioException",
")",
"{",
"throw",
"new",
... | suit handler signature requirements | [
"suit",
"handler",
"signature",
"requirements"
] | 2aad8ed1cb40f94bd24bad7e6a127956cc277077 | https://github.com/rvs-fluid-it/mvn-fluid-cd/blob/2aad8ed1cb40f94bd24bad7e6a127956cc277077/mvn-ext-freeze/src/main/java/be/fluid_it/mvn/cd/x/freeze/replace/FreezeHandler.java#L308-L318 | train |
rvs-fluid-it/mvn-fluid-cd | mvn-ext-freeze/src/main/java/be/fluid_it/mvn/cd/x/freeze/replace/FreezeHandler.java | FreezeHandler.printSaxException | void printSaxException(String message, SAXException e) {
System.err.println();
System.err.println("*** SAX Exception -- " + message);
System.err.println(" SystemId = \"" +
documentLocator.getSystemId() + "\"");
e.printStackTrace(System.err);
} | java | void printSaxException(String message, SAXException e) {
System.err.println();
System.err.println("*** SAX Exception -- " + message);
System.err.println(" SystemId = \"" +
documentLocator.getSystemId() + "\"");
e.printStackTrace(System.err);
} | [
"void",
"printSaxException",
"(",
"String",
"message",
",",
"SAXException",
"e",
")",
"{",
"System",
".",
"err",
".",
"println",
"(",
")",
";",
"System",
".",
"err",
".",
"println",
"(",
"\"*** SAX Exception -- \"",
"+",
"message",
")",
";",
"System",
".",... | Utility method to print information about a SAXException.
@param message A message to be included in the error output.
@param e The exception to be printed. | [
"Utility",
"method",
"to",
"print",
"information",
"about",
"a",
"SAXException",
"."
] | 2aad8ed1cb40f94bd24bad7e6a127956cc277077 | https://github.com/rvs-fluid-it/mvn-fluid-cd/blob/2aad8ed1cb40f94bd24bad7e6a127956cc277077/mvn-ext-freeze/src/main/java/be/fluid_it/mvn/cd/x/freeze/replace/FreezeHandler.java#L326-L332 | train |
rvs-fluid-it/mvn-fluid-cd | mvn-ext-freeze/src/main/java/be/fluid_it/mvn/cd/x/freeze/replace/FreezeHandler.java | FreezeHandler.printSaxParseException | void printSaxParseException(String message,
SAXParseException e) {
System.err.println();
System.err.println("*** SAX Parse Exception -- " + message);
System.err.println(" SystemId = \"" + e.getSystemId() + "\"");
System.err.println(" PublicI... | java | void printSaxParseException(String message,
SAXParseException e) {
System.err.println();
System.err.println("*** SAX Parse Exception -- " + message);
System.err.println(" SystemId = \"" + e.getSystemId() + "\"");
System.err.println(" PublicI... | [
"void",
"printSaxParseException",
"(",
"String",
"message",
",",
"SAXParseException",
"e",
")",
"{",
"System",
".",
"err",
".",
"println",
"(",
")",
";",
"System",
".",
"err",
".",
"println",
"(",
"\"*** SAX Parse Exception -- \"",
"+",
"message",
")",
";",
... | Utility method to print information about a SAXParseException.
@param message A message to be included in the error output.
@param e The exception to be printed. | [
"Utility",
"method",
"to",
"print",
"information",
"about",
"a",
"SAXParseException",
"."
] | 2aad8ed1cb40f94bd24bad7e6a127956cc277077 | https://github.com/rvs-fluid-it/mvn-fluid-cd/blob/2aad8ed1cb40f94bd24bad7e6a127956cc277077/mvn-ext-freeze/src/main/java/be/fluid_it/mvn/cd/x/freeze/replace/FreezeHandler.java#L340-L348 | train |
brianwhu/xillium | gear/src/main/java/org/xillium/gear/util/CriticalService.java | CriticalService.call | public void call(final T request, final Functor<String, RemoteService.Response> process, final Functor<Void, RemoteService.Response> confirm) {
try {
String message = process.invoke(RemoteService.call(location, endpoint, true, request));
if (message != null) {
// clean fa... | java | public void call(final T request, final Functor<String, RemoteService.Response> process, final Functor<Void, RemoteService.Response> confirm) {
try {
String message = process.invoke(RemoteService.call(location, endpoint, true, request));
if (message != null) {
// clean fa... | [
"public",
"void",
"call",
"(",
"final",
"T",
"request",
",",
"final",
"Functor",
"<",
"String",
",",
"RemoteService",
".",
"Response",
">",
"process",
",",
"final",
"Functor",
"<",
"Void",
",",
"RemoteService",
".",
"Response",
">",
"confirm",
")",
"{",
... | Starts a critical call and automatically manages uncertain outcomes.
@param request - the request packet
@param process - a functor that processes an invocation/retransmission response. This functor's invoke method must
<ol>
<li>return null if the call is successful</li>
<li>return a non-null message if the call ends ... | [
"Starts",
"a",
"critical",
"call",
"and",
"automatically",
"manages",
"uncertain",
"outcomes",
"."
] | e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799 | https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/gear/src/main/java/org/xillium/gear/util/CriticalService.java#L72-L107 | train |
mcpat/microjiac-public | tools/microjiac-midlet-maven-plugin/src/main/java/de/jiac/micro/mojo/PreverifyMojo.java | PreverifyMojo.execute | public void execute() throws MojoExecutionException, MojoFailureException {
if(preverifyPath == null) {
getLog().debug("skip native preverification");
return;
}
getLog().debug("start native preverification");
final File preverifyCmd= getAbsolutePreverify... | java | public void execute() throws MojoExecutionException, MojoFailureException {
if(preverifyPath == null) {
getLog().debug("skip native preverification");
return;
}
getLog().debug("start native preverification");
final File preverifyCmd= getAbsolutePreverify... | [
"public",
"void",
"execute",
"(",
")",
"throws",
"MojoExecutionException",
",",
"MojoFailureException",
"{",
"if",
"(",
"preverifyPath",
"==",
"null",
")",
"{",
"getLog",
"(",
")",
".",
"debug",
"(",
"\"skip native preverification\"",
")",
";",
"return",
";",
... | The main method of this MoJo | [
"The",
"main",
"method",
"of",
"this",
"MoJo"
] | 3c649e44846981a68e84cc4578719532414d8d35 | https://github.com/mcpat/microjiac-public/blob/3c649e44846981a68e84cc4578719532414d8d35/tools/microjiac-midlet-maven-plugin/src/main/java/de/jiac/micro/mojo/PreverifyMojo.java#L91-L138 | train |
brianwhu/xillium | base/src/main/java/org/xillium/base/beans/Beans.java | Beans.isDisplayable | public static boolean isDisplayable(Class<?> type) {
return Enum.class.isAssignableFrom(type)
|| type == java.net.URL.class || type == java.io.File.class
|| java.math.BigInteger.class.isAssignableFrom(type)
|| java.math.BigDecimal.class.isAssignableFrom(type)
|| j... | java | public static boolean isDisplayable(Class<?> type) {
return Enum.class.isAssignableFrom(type)
|| type == java.net.URL.class || type == java.io.File.class
|| java.math.BigInteger.class.isAssignableFrom(type)
|| java.math.BigDecimal.class.isAssignableFrom(type)
|| j... | [
"public",
"static",
"boolean",
"isDisplayable",
"(",
"Class",
"<",
"?",
">",
"type",
")",
"{",
"return",
"Enum",
".",
"class",
".",
"isAssignableFrom",
"(",
"type",
")",
"||",
"type",
"==",
"java",
".",
"net",
".",
"URL",
".",
"class",
"||",
"type",
... | Tests whether a non-primitive type is directly displayable.
@param type the class object to test
@return whether the type is displayable | [
"Tests",
"whether",
"a",
"non",
"-",
"primitive",
"type",
"is",
"directly",
"displayable",
"."
] | e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799 | https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/base/src/main/java/org/xillium/base/beans/Beans.java#L23-L32 | train |
brianwhu/xillium | base/src/main/java/org/xillium/base/beans/Beans.java | Beans.classForName | public static Class<?> classForName(String name) throws ClassNotFoundException {
if ("void".equals(name)) return void.class;
if ("char".equals(name)) return char.class;
if ("boolean".equals(name)) return boolean.class;
if ("byte".equals(name)) return byte.class;
if ("short".equal... | java | public static Class<?> classForName(String name) throws ClassNotFoundException {
if ("void".equals(name)) return void.class;
if ("char".equals(name)) return char.class;
if ("boolean".equals(name)) return boolean.class;
if ("byte".equals(name)) return byte.class;
if ("short".equal... | [
"public",
"static",
"Class",
"<",
"?",
">",
"classForName",
"(",
"String",
"name",
")",
"throws",
"ClassNotFoundException",
"{",
"if",
"(",
"\"void\"",
".",
"equals",
"(",
"name",
")",
")",
"return",
"void",
".",
"class",
";",
"if",
"(",
"\"char\"",
".",... | Class lookup by name, which also accepts primitive type names.
@param name the full name of the class
@return the class object
@throws ClassNotFoundException if the class is not found | [
"Class",
"lookup",
"by",
"name",
"which",
"also",
"accepts",
"primitive",
"type",
"names",
"."
] | e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799 | https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/base/src/main/java/org/xillium/base/beans/Beans.java#L41-L52 | train |
brianwhu/xillium | base/src/main/java/org/xillium/base/beans/Beans.java | Beans.toPrimitive | public static Class<?> toPrimitive(Class<?> type) {
if (type.isPrimitive()) {
return type;
} else if (type == Boolean.class) {
return Boolean.TYPE;
} else if (type == Character.class) {
return Character.TYPE;
} else if (type == Byte.class) {
... | java | public static Class<?> toPrimitive(Class<?> type) {
if (type.isPrimitive()) {
return type;
} else if (type == Boolean.class) {
return Boolean.TYPE;
} else if (type == Character.class) {
return Character.TYPE;
} else if (type == Byte.class) {
... | [
"public",
"static",
"Class",
"<",
"?",
">",
"toPrimitive",
"(",
"Class",
"<",
"?",
">",
"type",
")",
"{",
"if",
"(",
"type",
".",
"isPrimitive",
"(",
")",
")",
"{",
"return",
"type",
";",
"}",
"else",
"if",
"(",
"type",
"==",
"Boolean",
".",
"cla... | Converts a boxed type to its primitive counterpart.
@param type the type to convert
@return the primitive counterpart | [
"Converts",
"a",
"boxed",
"type",
"to",
"its",
"primitive",
"counterpart",
"."
] | e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799 | https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/base/src/main/java/org/xillium/base/beans/Beans.java#L85-L107 | train |
brianwhu/xillium | base/src/main/java/org/xillium/base/beans/Beans.java | Beans.boxPrimitives | public static Class<?>[] boxPrimitives(Class<?>[] types) {
for (int i = 0; i < types.length; ++i) {
types[i] = boxPrimitive(types[i]);
}
return types;
} | java | public static Class<?>[] boxPrimitives(Class<?>[] types) {
for (int i = 0; i < types.length; ++i) {
types[i] = boxPrimitive(types[i]);
}
return types;
} | [
"public",
"static",
"Class",
"<",
"?",
">",
"[",
"]",
"boxPrimitives",
"(",
"Class",
"<",
"?",
">",
"[",
"]",
"types",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"types",
".",
"length",
";",
"++",
"i",
")",
"{",
"types",
"[",
... | Boxes primitive types.
@param types an array of primitive types to box
@return an array of boxed types | [
"Boxes",
"primitive",
"types",
"."
] | e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799 | https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/base/src/main/java/org/xillium/base/beans/Beans.java#L145-L150 | train |
brianwhu/xillium | base/src/main/java/org/xillium/base/beans/Beans.java | Beans.getKnownField | public static Field getKnownField(Class<?> type, String name) throws NoSuchFieldException {
NoSuchFieldException last = null;
do {
try {
Field field = type.getDeclaredField(name);
field.setAccessible(true);
return field;
} catch (No... | java | public static Field getKnownField(Class<?> type, String name) throws NoSuchFieldException {
NoSuchFieldException last = null;
do {
try {
Field field = type.getDeclaredField(name);
field.setAccessible(true);
return field;
} catch (No... | [
"public",
"static",
"Field",
"getKnownField",
"(",
"Class",
"<",
"?",
">",
"type",
",",
"String",
"name",
")",
"throws",
"NoSuchFieldException",
"{",
"NoSuchFieldException",
"last",
"=",
"null",
";",
"do",
"{",
"try",
"{",
"Field",
"field",
"=",
"type",
".... | Returns a known field by name from the given class disregarding its access control setting, looking through
all super classes if needed.
@param type the class to start with
@param name the name of the field
@return a Field object representing the known field
@throws NoSuchFieldException if the field is not found | [
"Returns",
"a",
"known",
"field",
"by",
"name",
"from",
"the",
"given",
"class",
"disregarding",
"its",
"access",
"control",
"setting",
"looking",
"through",
"all",
"super",
"classes",
"if",
"needed",
"."
] | e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799 | https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/base/src/main/java/org/xillium/base/beans/Beans.java#L161-L174 | train |
brianwhu/xillium | base/src/main/java/org/xillium/base/beans/Beans.java | Beans.accessible | public static <T extends AccessibleObject> T accessible(T object) throws SecurityException {
object.setAccessible(true);
return object;
} | java | public static <T extends AccessibleObject> T accessible(T object) throws SecurityException {
object.setAccessible(true);
return object;
} | [
"public",
"static",
"<",
"T",
"extends",
"AccessibleObject",
">",
"T",
"accessible",
"(",
"T",
"object",
")",
"throws",
"SecurityException",
"{",
"object",
".",
"setAccessible",
"(",
"true",
")",
";",
"return",
"object",
";",
"}"
] | Overrides access control of an AccessibleObject, facilitating fluent coding style.
@param <T> the type of the accessible object
@param object the object to start with
@return the same object with its access control overridden to allow all access
@throws SecurityException if a security manager denies access | [
"Overrides",
"access",
"control",
"of",
"an",
"AccessibleObject",
"facilitating",
"fluent",
"coding",
"style",
"."
] | e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799 | https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/base/src/main/java/org/xillium/base/beans/Beans.java#L223-L226 | train |
brianwhu/xillium | base/src/main/java/org/xillium/base/beans/Beans.java | Beans.setValue | @SuppressWarnings("unchecked")
public static void setValue(Object object, Field field, Object value) throws IllegalArgumentException, IllegalAccessException {
if (value == null) {
//if (Number.class.isAssignableFrom(field.getType())) {
//value = java.math.BigDecimal.ZERO;
... | java | @SuppressWarnings("unchecked")
public static void setValue(Object object, Field field, Object value) throws IllegalArgumentException, IllegalAccessException {
if (value == null) {
//if (Number.class.isAssignableFrom(field.getType())) {
//value = java.math.BigDecimal.ZERO;
... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"void",
"setValue",
"(",
"Object",
"object",
",",
"Field",
"field",
",",
"Object",
"value",
")",
"throws",
"IllegalArgumentException",
",",
"IllegalAccessException",
"{",
"if",
"(",
"value",
... | Assigns a value to the field in an object, converting value type as necessary.
@param object an object
@param field a field of the object
@param value a value to set to the field
@throws IllegalArgumentException if the value is not acceptable by the field
@throws IllegalAccessException if a security manager denies acc... | [
"Assigns",
"a",
"value",
"to",
"the",
"field",
"in",
"an",
"object",
"converting",
"value",
"type",
"as",
"necessary",
"."
] | e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799 | https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/base/src/main/java/org/xillium/base/beans/Beans.java#L409-L462 | train |
brianwhu/xillium | base/src/main/java/org/xillium/base/beans/Beans.java | Beans.fill | public static <T> T fill(T destination, Object source) {
if (destination != source) {
Class<?> stype = source.getClass();
for (Field field: destination.getClass().getFields()) {
try {
Object value = field.get(destination);
if (value... | java | public static <T> T fill(T destination, Object source) {
if (destination != source) {
Class<?> stype = source.getClass();
for (Field field: destination.getClass().getFields()) {
try {
Object value = field.get(destination);
if (value... | [
"public",
"static",
"<",
"T",
">",
"T",
"fill",
"(",
"T",
"destination",
",",
"Object",
"source",
")",
"{",
"if",
"(",
"destination",
"!=",
"source",
")",
"{",
"Class",
"<",
"?",
">",
"stype",
"=",
"source",
".",
"getClass",
"(",
")",
";",
"for",
... | Fills empty, identically named public fields with values from another object.
@param <T> the class of the destination object
@param destination a destination object
@param source a source object
@return the same destination object with fields filled by source | [
"Fills",
"empty",
"identically",
"named",
"public",
"fields",
"with",
"values",
"from",
"another",
"object",
"."
] | e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799 | https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/base/src/main/java/org/xillium/base/beans/Beans.java#L527-L541 | train |
brianwhu/xillium | base/src/main/java/org/xillium/base/beans/Beans.java | Beans.update | public static <T, V> T update(T object, Class<V> type, String pattern, Bifunctor<V, String, V> updater) {
if (type.isPrimitive()) {
throw new IllegalArgumentException("Primitive type must be boxed");
}
Pattern regex = pattern != null ? Pattern.compile(pattern) : null;
for (Fi... | java | public static <T, V> T update(T object, Class<V> type, String pattern, Bifunctor<V, String, V> updater) {
if (type.isPrimitive()) {
throw new IllegalArgumentException("Primitive type must be boxed");
}
Pattern regex = pattern != null ? Pattern.compile(pattern) : null;
for (Fi... | [
"public",
"static",
"<",
"T",
",",
"V",
">",
"T",
"update",
"(",
"T",
"object",
",",
"Class",
"<",
"V",
">",
"type",
",",
"String",
"pattern",
",",
"Bifunctor",
"<",
"V",
",",
"String",
",",
"V",
">",
"updater",
")",
"{",
"if",
"(",
"type",
"."... | Updates an object by modifying all of its public fields that match a certain name pattern or a super type
with a transforming function.
@param <T> the class of the object
@param <V> the class of the object's public fields to be updated
@param object a Java object
@param type an upper bound Class matching, or boxing, t... | [
"Updates",
"an",
"object",
"by",
"modifying",
"all",
"of",
"its",
"public",
"fields",
"that",
"match",
"a",
"certain",
"name",
"pattern",
"or",
"a",
"super",
"type",
"with",
"a",
"transforming",
"function",
"."
] | e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799 | https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/base/src/main/java/org/xillium/base/beans/Beans.java#L579-L592 | train |
brianwhu/xillium | base/src/main/java/org/xillium/base/beans/Beans.java | Beans.print | public static StringBuilder print(StringBuilder sb, Object bean, int level) throws IntrospectionException {
return print(sb, Collections.newSetFromMap(new IdentityHashMap<Object, Boolean>()), bean, level);
} | java | public static StringBuilder print(StringBuilder sb, Object bean, int level) throws IntrospectionException {
return print(sb, Collections.newSetFromMap(new IdentityHashMap<Object, Boolean>()), bean, level);
} | [
"public",
"static",
"StringBuilder",
"print",
"(",
"StringBuilder",
"sb",
",",
"Object",
"bean",
",",
"int",
"level",
")",
"throws",
"IntrospectionException",
"{",
"return",
"print",
"(",
"sb",
",",
"Collections",
".",
"newSetFromMap",
"(",
"new",
"IdentityHashM... | Prints a bean to the StringBuilder.
@param sb a StringBuilder
@param bean an object
@param level indentation level
@return the original StringBuilder
@throws IntrospectionException if bean introspection fails by {@link java.beans.Introspector Introspector} | [
"Prints",
"a",
"bean",
"to",
"the",
"StringBuilder",
"."
] | e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799 | https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/base/src/main/java/org/xillium/base/beans/Beans.java#L617-L619 | train |
devnull-tools/trugger | src/main/java/tools/devnull/trugger/util/ImplementationLoader.java | ImplementationLoader.get | public static <E> E get(Class<E> type) {
ServiceLoader<E> loader = ServiceLoader.load(type);
Iterator<E> iterator = loader.iterator();
if (iterator.hasNext()) {
return iterator.next(); // only one is expected
}
try {
//loads the default implementation
return (E) Class.forName(getDe... | java | public static <E> E get(Class<E> type) {
ServiceLoader<E> loader = ServiceLoader.load(type);
Iterator<E> iterator = loader.iterator();
if (iterator.hasNext()) {
return iterator.next(); // only one is expected
}
try {
//loads the default implementation
return (E) Class.forName(getDe... | [
"public",
"static",
"<",
"E",
">",
"E",
"get",
"(",
"Class",
"<",
"E",
">",
"type",
")",
"{",
"ServiceLoader",
"<",
"E",
">",
"loader",
"=",
"ServiceLoader",
".",
"load",
"(",
"type",
")",
";",
"Iterator",
"<",
"E",
">",
"iterator",
"=",
"loader",
... | Returns the implementation for a given class.
@return the implementation for the given class. | [
"Returns",
"the",
"implementation",
"for",
"a",
"given",
"class",
"."
] | 614d5f0b30daf82fc251a46fb436d0fc5e787627 | https://github.com/devnull-tools/trugger/blob/614d5f0b30daf82fc251a46fb436d0fc5e787627/src/main/java/tools/devnull/trugger/util/ImplementationLoader.java#L52-L64 | train |
phax/ph-masterdata | ph-masterdata/src/main/java/com/helger/masterdata/price/PriceGraduation.java | PriceGraduation.createSimple | @Nonnull
public static IMutablePriceGraduation createSimple (@Nonnull final IMutablePrice aPrice)
{
final PriceGraduation ret = new PriceGraduation (aPrice.getCurrency ());
ret.addItem (new PriceGraduationItem (1, aPrice.getNetAmount ().getValue ()));
return ret;
} | java | @Nonnull
public static IMutablePriceGraduation createSimple (@Nonnull final IMutablePrice aPrice)
{
final PriceGraduation ret = new PriceGraduation (aPrice.getCurrency ());
ret.addItem (new PriceGraduationItem (1, aPrice.getNetAmount ().getValue ()));
return ret;
} | [
"@",
"Nonnull",
"public",
"static",
"IMutablePriceGraduation",
"createSimple",
"(",
"@",
"Nonnull",
"final",
"IMutablePrice",
"aPrice",
")",
"{",
"final",
"PriceGraduation",
"ret",
"=",
"new",
"PriceGraduation",
"(",
"aPrice",
".",
"getCurrency",
"(",
")",
")",
... | Create a simple price graduation that contains one item with the minimum
quantity of 1.
@param aPrice
The price to use. May not be <code>null</code>.
@return Never <code>null</code>. | [
"Create",
"a",
"simple",
"price",
"graduation",
"that",
"contains",
"one",
"item",
"with",
"the",
"minimum",
"quantity",
"of",
"1",
"."
] | ca5e0b03c735b30b47930c018bfb5e71f00d0ff4 | https://github.com/phax/ph-masterdata/blob/ca5e0b03c735b30b47930c018bfb5e71f00d0ff4/ph-masterdata/src/main/java/com/helger/masterdata/price/PriceGraduation.java#L218-L224 | train |
brianwhu/xillium | core/src/main/java/org/xillium/core/ServicePlatform.java | ServicePlatform.contextInitialized | @Override
public void contextInitialized(ServletContextEvent event) {
super.contextInitialized(event);
_dict.addTypeSet(org.xillium.data.validation.StandardDataTypes.class);
_packaged = _context.getResourcePaths("/WEB-INF/lib/");
_extended = discover(System.getProperty("xillium.servi... | java | @Override
public void contextInitialized(ServletContextEvent event) {
super.contextInitialized(event);
_dict.addTypeSet(org.xillium.data.validation.StandardDataTypes.class);
_packaged = _context.getResourcePaths("/WEB-INF/lib/");
_extended = discover(System.getProperty("xillium.servi... | [
"@",
"Override",
"public",
"void",
"contextInitialized",
"(",
"ServletContextEvent",
"event",
")",
"{",
"super",
".",
"contextInitialized",
"(",
"event",
")",
";",
"_dict",
".",
"addTypeSet",
"(",
"org",
".",
"xillium",
".",
"data",
".",
"validation",
".",
"... | Tries to load an XML web application contenxt upon servlet context initialization. If a PlatformControl is detected
in the web application contenxt, registers it with the platform MBean server and stop. Otherwise, continues to load all
module contexts in the application. | [
"Tries",
"to",
"load",
"an",
"XML",
"web",
"application",
"contenxt",
"upon",
"servlet",
"context",
"initialization",
".",
"If",
"a",
"PlatformControl",
"is",
"detected",
"in",
"the",
"web",
"application",
"contenxt",
"registers",
"it",
"with",
"the",
"platform"... | e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799 | https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/core/src/main/java/org/xillium/core/ServicePlatform.java#L89-L131 | train |
brianwhu/xillium | core/src/main/java/org/xillium/core/ServicePlatform.java | ServicePlatform.realize | public void realize(ApplicationContext wac, ConfigurableApplicationContext child) {
if (WebApplicationContextUtils.getWebApplicationContext(_context) == null) {
_context.setAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE, wac);
} else {
_logger.warning("Alr... | java | public void realize(ApplicationContext wac, ConfigurableApplicationContext child) {
if (WebApplicationContextUtils.getWebApplicationContext(_context) == null) {
_context.setAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE, wac);
} else {
_logger.warning("Alr... | [
"public",
"void",
"realize",
"(",
"ApplicationContext",
"wac",
",",
"ConfigurableApplicationContext",
"child",
")",
"{",
"if",
"(",
"WebApplicationContextUtils",
".",
"getWebApplicationContext",
"(",
"_context",
")",
"==",
"null",
")",
"{",
"_context",
".",
"setAttr... | Reloads the platform with the given application context at its root.
<p>If a PlatformControl is detected in the root web application context, module application contexts are <i>not</i> to be
loaded automatically when the servlet context is initialized. Consequently, this method can be called later to load all
module a... | [
"Reloads",
"the",
"platform",
"with",
"the",
"given",
"application",
"context",
"at",
"its",
"root",
"."
] | e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799 | https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/core/src/main/java/org/xillium/core/ServicePlatform.java#L142-L190 | train |
brianwhu/xillium | core/src/main/java/org/xillium/core/ServicePlatform.java | ServicePlatform.destroy | public void destroy() {
XmlWebApplicationContext wac = (XmlWebApplicationContext)WebApplicationContextUtils.getWebApplicationContext(_context);
if (wac != null) {
_context.removeAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE);
} else {
_logger.warn... | java | public void destroy() {
XmlWebApplicationContext wac = (XmlWebApplicationContext)WebApplicationContextUtils.getWebApplicationContext(_context);
if (wac != null) {
_context.removeAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE);
} else {
_logger.warn... | [
"public",
"void",
"destroy",
"(",
")",
"{",
"XmlWebApplicationContext",
"wac",
"=",
"(",
"XmlWebApplicationContext",
")",
"WebApplicationContextUtils",
".",
"getWebApplicationContext",
"(",
"_context",
")",
";",
"if",
"(",
"wac",
"!=",
"null",
")",
"{",
"_context"... | Unloads the platform.
<p>If this method is never called, all application contexts will be unloaded when the servlet context is destroyed.</p> | [
"Unloads",
"the",
"platform",
"."
] | e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799 | https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/core/src/main/java/org/xillium/core/ServicePlatform.java#L205-L260 | train |
brianwhu/xillium | core/src/main/java/org/xillium/core/ServicePlatform.java | ServicePlatform.install | private ApplicationContext install(ApplicationContext wac, ModuleSorter.Sorted sorted, ServiceModuleInfo info) {
// scan special modules, configuring and initializing PlatformAware objects as each module is loaded
wac = install(wac, sorted.specials(), info, true);
// scan regular modules, colle... | java | private ApplicationContext install(ApplicationContext wac, ModuleSorter.Sorted sorted, ServiceModuleInfo info) {
// scan special modules, configuring and initializing PlatformAware objects as each module is loaded
wac = install(wac, sorted.specials(), info, true);
// scan regular modules, colle... | [
"private",
"ApplicationContext",
"install",
"(",
"ApplicationContext",
"wac",
",",
"ModuleSorter",
".",
"Sorted",
"sorted",
",",
"ServiceModuleInfo",
"info",
")",
"{",
"// scan special modules, configuring and initializing PlatformAware objects as each module is loaded",
"wac",
"... | install service modules in the ModuleSorter.Sorted | [
"install",
"service",
"modules",
"in",
"the",
"ModuleSorter",
".",
"Sorted"
] | e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799 | https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/core/src/main/java/org/xillium/core/ServicePlatform.java#L263-L290 | train |
brianwhu/xillium | data/src/main/java/org/xillium/data/persistence/Persistence.java | Persistence.doReadOnly | public <T, F> T doReadOnly(F facility, Task<T, F> task) {
return doTransaction(facility, task, _readonly);
} | java | public <T, F> T doReadOnly(F facility, Task<T, F> task) {
return doTransaction(facility, task, _readonly);
} | [
"public",
"<",
"T",
",",
"F",
">",
"T",
"doReadOnly",
"(",
"F",
"facility",
",",
"Task",
"<",
"T",
",",
"F",
">",
"task",
")",
"{",
"return",
"doTransaction",
"(",
"facility",
",",
"task",
",",
"_readonly",
")",
";",
"}"
] | Executes a task within a read-only transaction. Any exception rolls back the transaction and gets rethrown as a RuntimeException. | [
"Executes",
"a",
"task",
"within",
"a",
"read",
"-",
"only",
"transaction",
".",
"Any",
"exception",
"rolls",
"back",
"the",
"transaction",
"and",
"gets",
"rethrown",
"as",
"a",
"RuntimeException",
"."
] | e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799 | https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/data/src/main/java/org/xillium/data/persistence/Persistence.java#L36-L38 | train |
brianwhu/xillium | data/src/main/java/org/xillium/data/persistence/Persistence.java | Persistence.doReadWrite | public <T, F> T doReadWrite(F facility, Task<T, F> task) {
return doTransaction(facility, task, null);
} | java | public <T, F> T doReadWrite(F facility, Task<T, F> task) {
return doTransaction(facility, task, null);
} | [
"public",
"<",
"T",
",",
"F",
">",
"T",
"doReadWrite",
"(",
"F",
"facility",
",",
"Task",
"<",
"T",
",",
"F",
">",
"task",
")",
"{",
"return",
"doTransaction",
"(",
"facility",
",",
"task",
",",
"null",
")",
";",
"}"
] | Executes a task within a read-write transaction. Any exception rolls back the transaction and gets rethrown as a RuntimeException. | [
"Executes",
"a",
"task",
"within",
"a",
"read",
"-",
"write",
"transaction",
".",
"Any",
"exception",
"rolls",
"back",
"the",
"transaction",
"and",
"gets",
"rethrown",
"as",
"a",
"RuntimeException",
"."
] | e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799 | https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/data/src/main/java/org/xillium/data/persistence/Persistence.java#L43-L45 | train |
brianwhu/xillium | data/src/main/java/org/xillium/data/persistence/Persistence.java | Persistence.getParametricStatement | public ParametricStatement getParametricStatement(String name) {
ParametricStatement statement = _statements.get(name);
if (statement != null) {
return statement;
} else {
throw new RuntimeException("ParametricStatement '" + name + "' not found");
}
} | java | public ParametricStatement getParametricStatement(String name) {
ParametricStatement statement = _statements.get(name);
if (statement != null) {
return statement;
} else {
throw new RuntimeException("ParametricStatement '" + name + "' not found");
}
} | [
"public",
"ParametricStatement",
"getParametricStatement",
"(",
"String",
"name",
")",
"{",
"ParametricStatement",
"statement",
"=",
"_statements",
".",
"get",
"(",
"name",
")",
";",
"if",
"(",
"statement",
"!=",
"null",
")",
"{",
"return",
"statement",
";",
"... | Looks up a ParametricStatement by its name. | [
"Looks",
"up",
"a",
"ParametricStatement",
"by",
"its",
"name",
"."
] | e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799 | https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/data/src/main/java/org/xillium/data/persistence/Persistence.java#L73-L80 | train |
brianwhu/xillium | data/src/main/java/org/xillium/data/persistence/Persistence.java | Persistence.executeSelect | public <T> T executeSelect(String name, DataObject object, ResultSetWorker<T> worker) throws Exception {
ParametricQuery statement = (ParametricQuery)_statements.get(name);
if (statement != null) {
return statement.executeSelect(DataSourceUtils.getConnection(_dataSource), object, worker);... | java | public <T> T executeSelect(String name, DataObject object, ResultSetWorker<T> worker) throws Exception {
ParametricQuery statement = (ParametricQuery)_statements.get(name);
if (statement != null) {
return statement.executeSelect(DataSourceUtils.getConnection(_dataSource), object, worker);... | [
"public",
"<",
"T",
">",
"T",
"executeSelect",
"(",
"String",
"name",
",",
"DataObject",
"object",
",",
"ResultSetWorker",
"<",
"T",
">",
"worker",
")",
"throws",
"Exception",
"{",
"ParametricQuery",
"statement",
"=",
"(",
"ParametricQuery",
")",
"_statements"... | Executes a SELECT statement and passes the result set to the ResultSetWorker. | [
"Executes",
"a",
"SELECT",
"statement",
"and",
"passes",
"the",
"result",
"set",
"to",
"the",
"ResultSetWorker",
"."
] | e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799 | https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/data/src/main/java/org/xillium/data/persistence/Persistence.java#L183-L190 | train |
brianwhu/xillium | data/src/main/java/org/xillium/data/persistence/Persistence.java | Persistence.getResults | public <T extends DataObject> List<T> getResults(String name, DataObject object) throws Exception {
@SuppressWarnings("unchecked")
ObjectMappedQuery<T> statement = (ObjectMappedQuery<T>)_statements.get(name);
if (statement != null) {
return statement.getResults(DataSourceUtils.ge... | java | public <T extends DataObject> List<T> getResults(String name, DataObject object) throws Exception {
@SuppressWarnings("unchecked")
ObjectMappedQuery<T> statement = (ObjectMappedQuery<T>)_statements.get(name);
if (statement != null) {
return statement.getResults(DataSourceUtils.ge... | [
"public",
"<",
"T",
"extends",
"DataObject",
">",
"List",
"<",
"T",
">",
"getResults",
"(",
"String",
"name",
",",
"DataObject",
"object",
")",
"throws",
"Exception",
"{",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"ObjectMappedQuery",
"<",
"T",
">"... | Executes a SELECT statement and returns the result set as a list of objects | [
"Executes",
"a",
"SELECT",
"statement",
"and",
"returns",
"the",
"result",
"set",
"as",
"a",
"list",
"of",
"objects"
] | e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799 | https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/data/src/main/java/org/xillium/data/persistence/Persistence.java#L195-L203 | train |
brianwhu/xillium | data/src/main/java/org/xillium/data/persistence/Persistence.java | Persistence.compile | public int compile() throws SQLException {
int count = 0;
for (Map.Entry<String, ParametricStatement> entry: _statements.entrySet()) {
try {
ParametricStatement statement = entry.getValue();
Connection connection = DataSourceUtils.getConnection(_dataSourc... | java | public int compile() throws SQLException {
int count = 0;
for (Map.Entry<String, ParametricStatement> entry: _statements.entrySet()) {
try {
ParametricStatement statement = entry.getValue();
Connection connection = DataSourceUtils.getConnection(_dataSourc... | [
"public",
"int",
"compile",
"(",
")",
"throws",
"SQLException",
"{",
"int",
"count",
"=",
"0",
";",
"for",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"ParametricStatement",
">",
"entry",
":",
"_statements",
".",
"entrySet",
"(",
")",
")",
"{",
"try"... | Compile all ParametricStatement registered with this Persistence. | [
"Compile",
"all",
"ParametricStatement",
"registered",
"with",
"this",
"Persistence",
"."
] | e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799 | https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/data/src/main/java/org/xillium/data/persistence/Persistence.java#L260-L281 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/doclets/formats/html/ProfileWriterImpl.java | ProfileWriterImpl.addPackageDeprecationInfo | public void addPackageDeprecationInfo(Content li, PackageDoc pkg) {
Tag[] deprs;
if (Util.isDeprecated(pkg)) {
deprs = pkg.tags("deprecated");
HtmlTree deprDiv = new HtmlTree(HtmlTag.DIV);
deprDiv.addStyle(HtmlStyle.deprecatedContent);
Content deprPhrase =... | java | public void addPackageDeprecationInfo(Content li, PackageDoc pkg) {
Tag[] deprs;
if (Util.isDeprecated(pkg)) {
deprs = pkg.tags("deprecated");
HtmlTree deprDiv = new HtmlTree(HtmlTag.DIV);
deprDiv.addStyle(HtmlStyle.deprecatedContent);
Content deprPhrase =... | [
"public",
"void",
"addPackageDeprecationInfo",
"(",
"Content",
"li",
",",
"PackageDoc",
"pkg",
")",
"{",
"Tag",
"[",
"]",
"deprs",
";",
"if",
"(",
"Util",
".",
"isDeprecated",
"(",
"pkg",
")",
")",
"{",
"deprs",
"=",
"pkg",
".",
"tags",
"(",
"\"depreca... | Add the profile package deprecation information to the documentation tree.
@param li the content tree to which the deprecation information will be added
@param pkg the PackageDoc that is added | [
"Add",
"the",
"profile",
"package",
"deprecation",
"information",
"to",
"the",
"documentation",
"tree",
"."
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/doclets/formats/html/ProfileWriterImpl.java#L184-L200 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/doclets/formats/html/ProfileWriterImpl.java | ProfileWriterImpl.getNavLinkPrevious | public Content getNavLinkPrevious() {
Content li;
if (prevProfile == null) {
li = HtmlTree.LI(prevprofileLabel);
} else {
li = HtmlTree.LI(getHyperLink(pathToRoot.resolve(DocPaths.profileSummary(
prevProfile.name)), prevprofileLabel, "", ""));
... | java | public Content getNavLinkPrevious() {
Content li;
if (prevProfile == null) {
li = HtmlTree.LI(prevprofileLabel);
} else {
li = HtmlTree.LI(getHyperLink(pathToRoot.resolve(DocPaths.profileSummary(
prevProfile.name)), prevprofileLabel, "", ""));
... | [
"public",
"Content",
"getNavLinkPrevious",
"(",
")",
"{",
"Content",
"li",
";",
"if",
"(",
"prevProfile",
"==",
"null",
")",
"{",
"li",
"=",
"HtmlTree",
".",
"LI",
"(",
"prevprofileLabel",
")",
";",
"}",
"else",
"{",
"li",
"=",
"HtmlTree",
".",
"LI",
... | Get "PREV PROFILE" link in the navigation bar.
@return a content tree for the previous link | [
"Get",
"PREV",
"PROFILE",
"link",
"in",
"the",
"navigation",
"bar",
"."
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/doclets/formats/html/ProfileWriterImpl.java#L207-L216 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/doclets/formats/html/ProfileWriterImpl.java | ProfileWriterImpl.getNavLinkNext | public Content getNavLinkNext() {
Content li;
if (nextProfile == null) {
li = HtmlTree.LI(nextprofileLabel);
} else {
li = HtmlTree.LI(getHyperLink(pathToRoot.resolve(DocPaths.profileSummary(
nextProfile.name)), nextprofileLabel, "", ""));
}
... | java | public Content getNavLinkNext() {
Content li;
if (nextProfile == null) {
li = HtmlTree.LI(nextprofileLabel);
} else {
li = HtmlTree.LI(getHyperLink(pathToRoot.resolve(DocPaths.profileSummary(
nextProfile.name)), nextprofileLabel, "", ""));
}
... | [
"public",
"Content",
"getNavLinkNext",
"(",
")",
"{",
"Content",
"li",
";",
"if",
"(",
"nextProfile",
"==",
"null",
")",
"{",
"li",
"=",
"HtmlTree",
".",
"LI",
"(",
"nextprofileLabel",
")",
";",
"}",
"else",
"{",
"li",
"=",
"HtmlTree",
".",
"LI",
"("... | Get "NEXT PROFILE" link in the navigation bar.
@return a content tree for the next link | [
"Get",
"NEXT",
"PROFILE",
"link",
"in",
"the",
"navigation",
"bar",
"."
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/doclets/formats/html/ProfileWriterImpl.java#L223-L232 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/javadoc/TypeVariableImpl.java | TypeVariableImpl.owner | public ProgramElementDoc owner() {
Symbol osym = type.tsym.owner;
if ((osym.kind & Kinds.TYP) != 0) {
return env.getClassDoc((ClassSymbol)osym);
}
Names names = osym.name.table.names;
if (osym.name == names.init) {
return env.getConstructorDoc((MethodSymbo... | java | public ProgramElementDoc owner() {
Symbol osym = type.tsym.owner;
if ((osym.kind & Kinds.TYP) != 0) {
return env.getClassDoc((ClassSymbol)osym);
}
Names names = osym.name.table.names;
if (osym.name == names.init) {
return env.getConstructorDoc((MethodSymbo... | [
"public",
"ProgramElementDoc",
"owner",
"(",
")",
"{",
"Symbol",
"osym",
"=",
"type",
".",
"tsym",
".",
"owner",
";",
"if",
"(",
"(",
"osym",
".",
"kind",
"&",
"Kinds",
".",
"TYP",
")",
"!=",
"0",
")",
"{",
"return",
"env",
".",
"getClassDoc",
"(",... | Return the class, interface, method, or constructor within
which this type variable is declared. | [
"Return",
"the",
"class",
"interface",
"method",
"or",
"constructor",
"within",
"which",
"this",
"type",
"variable",
"is",
"declared",
"."
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/javadoc/TypeVariableImpl.java#L71-L82 | train |
SixDimensions/Component-Bindings-Provider | impl/src/main/java/com/sixdimensions/wcm/cq/component/bindings/impl/ComponentBindingsProviderFactoryImpl.java | ComponentBindingsProviderFactoryImpl.activate | protected void activate(final ComponentContext context)
throws InvalidSyntaxException {
log.info("activate");
bundleContext = context.getBundleContext();
sl = new ServiceListener() {
public void serviceChanged(ServiceEvent event) {
if (event.getType() == ServiceEvent.UNREGISTERING) {
cache.unregi... | java | protected void activate(final ComponentContext context)
throws InvalidSyntaxException {
log.info("activate");
bundleContext = context.getBundleContext();
sl = new ServiceListener() {
public void serviceChanged(ServiceEvent event) {
if (event.getType() == ServiceEvent.UNREGISTERING) {
cache.unregi... | [
"protected",
"void",
"activate",
"(",
"final",
"ComponentContext",
"context",
")",
"throws",
"InvalidSyntaxException",
"{",
"log",
".",
"info",
"(",
"\"activate\"",
")",
";",
"bundleContext",
"=",
"context",
".",
"getBundleContext",
"(",
")",
";",
"sl",
"=",
"... | Executed when the service is activated.
@param context
the service's context
@throws InvalidSyntaxException | [
"Executed",
"when",
"the",
"service",
"is",
"activated",
"."
] | 1d4da2f8c274d32edcd0a2593bec1255b8340b5b | https://github.com/SixDimensions/Component-Bindings-Provider/blob/1d4da2f8c274d32edcd0a2593bec1255b8340b5b/impl/src/main/java/com/sixdimensions/wcm/cq/component/bindings/impl/ComponentBindingsProviderFactoryImpl.java#L76-L97 | train |
SixDimensions/Component-Bindings-Provider | impl/src/main/java/com/sixdimensions/wcm/cq/component/bindings/impl/ComponentBindingsProviderFactoryImpl.java | ComponentBindingsProviderFactoryImpl.deactivate | protected void deactivate(ComponentContext context) {
log.info("deactivate");
bundleContext = context.getBundleContext();
bundleContext.removeServiceListener(sl);
log.info("Deactivate successful");
} | java | protected void deactivate(ComponentContext context) {
log.info("deactivate");
bundleContext = context.getBundleContext();
bundleContext.removeServiceListener(sl);
log.info("Deactivate successful");
} | [
"protected",
"void",
"deactivate",
"(",
"ComponentContext",
"context",
")",
"{",
"log",
".",
"info",
"(",
"\"deactivate\"",
")",
";",
"bundleContext",
"=",
"context",
".",
"getBundleContext",
"(",
")",
";",
"bundleContext",
".",
"removeServiceListener",
"(",
"sl... | Executed when the service is deactivated.
@param context
the service's context | [
"Executed",
"when",
"the",
"service",
"is",
"deactivated",
"."
] | 1d4da2f8c274d32edcd0a2593bec1255b8340b5b | https://github.com/SixDimensions/Component-Bindings-Provider/blob/1d4da2f8c274d32edcd0a2593bec1255b8340b5b/impl/src/main/java/com/sixdimensions/wcm/cq/component/bindings/impl/ComponentBindingsProviderFactoryImpl.java#L105-L112 | train |
SixDimensions/Component-Bindings-Provider | impl/src/main/java/com/sixdimensions/wcm/cq/component/bindings/impl/ComponentBindingsProviderFactoryImpl.java | ComponentBindingsProviderFactoryImpl.reloadCache | protected void reloadCache() {
log.info("reloadCache");
cache.clear();
try {
ServiceReference[] references = bundleContext
.getAllServiceReferences(
ComponentBindingsProvider.class.getCanonicalName(),
null);
if (references != null) {
for (ServiceReference reference : references) {
... | java | protected void reloadCache() {
log.info("reloadCache");
cache.clear();
try {
ServiceReference[] references = bundleContext
.getAllServiceReferences(
ComponentBindingsProvider.class.getCanonicalName(),
null);
if (references != null) {
for (ServiceReference reference : references) {
... | [
"protected",
"void",
"reloadCache",
"(",
")",
"{",
"log",
".",
"info",
"(",
"\"reloadCache\"",
")",
";",
"cache",
".",
"clear",
"(",
")",
";",
"try",
"{",
"ServiceReference",
"[",
"]",
"references",
"=",
"bundleContext",
".",
"getAllServiceReferences",
"(",
... | Reloads the cache of Component Binding Providers | [
"Reloads",
"the",
"cache",
"of",
"Component",
"Binding",
"Providers"
] | 1d4da2f8c274d32edcd0a2593bec1255b8340b5b | https://github.com/SixDimensions/Component-Bindings-Provider/blob/1d4da2f8c274d32edcd0a2593bec1255b8340b5b/impl/src/main/java/com/sixdimensions/wcm/cq/component/bindings/impl/ComponentBindingsProviderFactoryImpl.java#L157-L176 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/javadoc/DocLocale.java | DocLocale.htmlSentenceTerminatorFound | private boolean htmlSentenceTerminatorFound(String str, int index) {
for (int i = 0; i < sentenceTerminators.length; i++) {
String terminator = sentenceTerminators[i];
if (str.regionMatches(true, index, terminator,
0, terminator.length())) {
... | java | private boolean htmlSentenceTerminatorFound(String str, int index) {
for (int i = 0; i < sentenceTerminators.length; i++) {
String terminator = sentenceTerminators[i];
if (str.regionMatches(true, index, terminator,
0, terminator.length())) {
... | [
"private",
"boolean",
"htmlSentenceTerminatorFound",
"(",
"String",
"str",
",",
"int",
"index",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"sentenceTerminators",
".",
"length",
";",
"i",
"++",
")",
"{",
"String",
"terminator",
"=",
"sente... | Find out if there is any HTML tag in the given string. If found
return true else return false. | [
"Find",
"out",
"if",
"there",
"is",
"any",
"HTML",
"tag",
"in",
"the",
"given",
"string",
".",
"If",
"found",
"return",
"true",
"else",
"return",
"false",
"."
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/javadoc/DocLocale.java#L233-L242 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/javac/api/JavacTrees.java | JavacTrees.getOriginalType | public TypeMirror getOriginalType(javax.lang.model.type.ErrorType errorType) {
if (errorType instanceof com.sun.tools.javac.code.Type.ErrorType) {
return ((com.sun.tools.javac.code.Type.ErrorType)errorType).getOriginalType();
}
return com.sun.tools.javac.code.Type.noType;
} | java | public TypeMirror getOriginalType(javax.lang.model.type.ErrorType errorType) {
if (errorType instanceof com.sun.tools.javac.code.Type.ErrorType) {
return ((com.sun.tools.javac.code.Type.ErrorType)errorType).getOriginalType();
}
return com.sun.tools.javac.code.Type.noType;
} | [
"public",
"TypeMirror",
"getOriginalType",
"(",
"javax",
".",
"lang",
".",
"model",
".",
"type",
".",
"ErrorType",
"errorType",
")",
"{",
"if",
"(",
"errorType",
"instanceof",
"com",
".",
"sun",
".",
"tools",
".",
"javac",
".",
"code",
".",
"Type",
".",
... | Gets the original type from the ErrorType object.
@param errorType The errorType for which we want to get the original type.
@returns TypeMirror corresponding to the original type, replaced by the ErrorType.
noType (type.tag == NONE) is returned if there is no original type. | [
"Gets",
"the",
"original",
"type",
"from",
"the",
"ErrorType",
"object",
"."
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/javac/api/JavacTrees.java#L875-L881 | train |
Wadpam/guja | guja-core/src/main/java/com/wadpam/guja/service/JavaMailService.java | JavaMailService.createBodyPart | private static MimeBodyPart createBodyPart(byte[] data, String type, String filename) throws MessagingException {
final MimeBodyPart attachmentPart = new MimeBodyPart();
attachmentPart.setFileName(filename);
ByteArrayDataSource source = new ByteArrayDataSource(data, type);
attachmentPart... | java | private static MimeBodyPart createBodyPart(byte[] data, String type, String filename) throws MessagingException {
final MimeBodyPart attachmentPart = new MimeBodyPart();
attachmentPart.setFileName(filename);
ByteArrayDataSource source = new ByteArrayDataSource(data, type);
attachmentPart... | [
"private",
"static",
"MimeBodyPart",
"createBodyPart",
"(",
"byte",
"[",
"]",
"data",
",",
"String",
"type",
",",
"String",
"filename",
")",
"throws",
"MessagingException",
"{",
"final",
"MimeBodyPart",
"attachmentPart",
"=",
"new",
"MimeBodyPart",
"(",
")",
";"... | Build attachment part | [
"Build",
"attachment",
"part"
] | eb8ba8e6794a96ea0dd9744cada4f9ad9618f114 | https://github.com/Wadpam/guja/blob/eb8ba8e6794a96ea0dd9744cada4f9ad9618f114/guja-core/src/main/java/com/wadpam/guja/service/JavaMailService.java#L207-L215 | train |
brianwhu/xillium | data/src/main/java/org/xillium/data/persistence/ObjectMappedQuery.java | ObjectMappedQuery.getObject | public T getObject(Connection conn, DataObject object) throws Exception {
return executeSelect(conn, object, new ResultSetMapper<SingleObjectCollector<T>>(new SingleObjectCollector<T>())).value;
} | java | public T getObject(Connection conn, DataObject object) throws Exception {
return executeSelect(conn, object, new ResultSetMapper<SingleObjectCollector<T>>(new SingleObjectCollector<T>())).value;
} | [
"public",
"T",
"getObject",
"(",
"Connection",
"conn",
",",
"DataObject",
"object",
")",
"throws",
"Exception",
"{",
"return",
"executeSelect",
"(",
"conn",
",",
"object",
",",
"new",
"ResultSetMapper",
"<",
"SingleObjectCollector",
"<",
"T",
">",
">",
"(",
... | Executes the query and returns the first row of the results as a single object. | [
"Executes",
"the",
"query",
"and",
"returns",
"the",
"first",
"row",
"of",
"the",
"results",
"as",
"a",
"single",
"object",
"."
] | e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799 | https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/data/src/main/java/org/xillium/data/persistence/ObjectMappedQuery.java#L135-L137 | train |
brianwhu/xillium | data/src/main/java/org/xillium/data/persistence/ObjectMappedQuery.java | ObjectMappedQuery.getResults | public Collector<T> getResults(Connection conn, DataObject object, Collector<T> collector) throws Exception {
return executeSelect(conn, object, new ResultSetMapper<Collector<T>>(collector));
} | java | public Collector<T> getResults(Connection conn, DataObject object, Collector<T> collector) throws Exception {
return executeSelect(conn, object, new ResultSetMapper<Collector<T>>(collector));
} | [
"public",
"Collector",
"<",
"T",
">",
"getResults",
"(",
"Connection",
"conn",
",",
"DataObject",
"object",
",",
"Collector",
"<",
"T",
">",
"collector",
")",
"throws",
"Exception",
"{",
"return",
"executeSelect",
"(",
"conn",
",",
"object",
",",
"new",
"R... | Executes the query and passes the results to a Collector. | [
"Executes",
"the",
"query",
"and",
"passes",
"the",
"results",
"to",
"a",
"Collector",
"."
] | e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799 | https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/data/src/main/java/org/xillium/data/persistence/ObjectMappedQuery.java#L142-L144 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/javac/file/CacheFSInfo.java | CacheFSInfo.preRegister | public static void preRegister(Context context) {
context.put(FSInfo.class, new Context.Factory<FSInfo>() {
public FSInfo make(Context c) {
FSInfo instance = new CacheFSInfo();
c.put(FSInfo.class, instance);
return instance;
}
});
... | java | public static void preRegister(Context context) {
context.put(FSInfo.class, new Context.Factory<FSInfo>() {
public FSInfo make(Context c) {
FSInfo instance = new CacheFSInfo();
c.put(FSInfo.class, instance);
return instance;
}
});
... | [
"public",
"static",
"void",
"preRegister",
"(",
"Context",
"context",
")",
"{",
"context",
".",
"put",
"(",
"FSInfo",
".",
"class",
",",
"new",
"Context",
".",
"Factory",
"<",
"FSInfo",
">",
"(",
")",
"{",
"public",
"FSInfo",
"make",
"(",
"Context",
"c... | Register a Context.Factory to create a CacheFSInfo. | [
"Register",
"a",
"Context",
".",
"Factory",
"to",
"create",
"a",
"CacheFSInfo",
"."
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/javac/file/CacheFSInfo.java#L49-L57 | train |
petrbouda/joyrest | joyrest-core/src/main/java/org/joyrest/model/request/InternalRequest.java | InternalRequest.getContentType | public MediaType getContentType() {
if (isNull(this.contentType)) {
contentType = getHeader(HeaderName.CONTENT_TYPE)
.map(MediaType::of)
.orElse(WILDCARD);
}
return contentType;
} | java | public MediaType getContentType() {
if (isNull(this.contentType)) {
contentType = getHeader(HeaderName.CONTENT_TYPE)
.map(MediaType::of)
.orElse(WILDCARD);
}
return contentType;
} | [
"public",
"MediaType",
"getContentType",
"(",
")",
"{",
"if",
"(",
"isNull",
"(",
"this",
".",
"contentType",
")",
")",
"{",
"contentType",
"=",
"getHeader",
"(",
"HeaderName",
".",
"CONTENT_TYPE",
")",
".",
"map",
"(",
"MediaType",
"::",
"of",
")",
".",... | Returns a content-type header value
@return content-type header value in {@link Optional} object | [
"Returns",
"a",
"content",
"-",
"type",
"header",
"value"
] | 58903f06fb7f0b8fdf1ef91318fb48a88bf970e0 | https://github.com/petrbouda/joyrest/blob/58903f06fb7f0b8fdf1ef91318fb48a88bf970e0/joyrest-core/src/main/java/org/joyrest/model/request/InternalRequest.java#L95-L103 | train |
petrbouda/joyrest | joyrest-core/src/main/java/org/joyrest/model/request/InternalRequest.java | InternalRequest.getAccept | public List<MediaType> getAccept() {
if (isNull(accept)) {
List<MediaType> accepts = getHeader(HeaderName.ACCEPT)
.map(MediaType::list)
.get();
this.accept = nonEmpty(accepts) ? accepts : singletonList(WILDCARD);
}
return accept;
} | java | public List<MediaType> getAccept() {
if (isNull(accept)) {
List<MediaType> accepts = getHeader(HeaderName.ACCEPT)
.map(MediaType::list)
.get();
this.accept = nonEmpty(accepts) ? accepts : singletonList(WILDCARD);
}
return accept;
} | [
"public",
"List",
"<",
"MediaType",
">",
"getAccept",
"(",
")",
"{",
"if",
"(",
"isNull",
"(",
"accept",
")",
")",
"{",
"List",
"<",
"MediaType",
">",
"accepts",
"=",
"getHeader",
"(",
"HeaderName",
".",
"ACCEPT",
")",
".",
"map",
"(",
"MediaType",
"... | Returns a accept header value
@return accept header value in {@link Optional} object | [
"Returns",
"a",
"accept",
"header",
"value"
] | 58903f06fb7f0b8fdf1ef91318fb48a88bf970e0 | https://github.com/petrbouda/joyrest/blob/58903f06fb7f0b8fdf1ef91318fb48a88bf970e0/joyrest-core/src/main/java/org/joyrest/model/request/InternalRequest.java#L110-L119 | train |
redbox-mint-contrib/redbox-web-service | src/main/java/com/googlecode/fascinator/redbox/ws/security/TokenBasedVerifier.java | TokenBasedVerifier.verify | public int verify(Request request, Response response) {
String authValue = request.getHeaders().getValues("Authorization");
log.debug("Auth header value is: "+ authValue);
if (authValue == null) {
return Verifier.RESULT_MISSING;
}
String[] tokenValues = authValue.split(" ");
if (tokenValues.length < 2) {... | java | public int verify(Request request, Response response) {
String authValue = request.getHeaders().getValues("Authorization");
log.debug("Auth header value is: "+ authValue);
if (authValue == null) {
return Verifier.RESULT_MISSING;
}
String[] tokenValues = authValue.split(" ");
if (tokenValues.length < 2) {... | [
"public",
"int",
"verify",
"(",
"Request",
"request",
",",
"Response",
"response",
")",
"{",
"String",
"authValue",
"=",
"request",
".",
"getHeaders",
"(",
")",
".",
"getValues",
"(",
"\"Authorization\"",
")",
";",
"log",
".",
"debug",
"(",
"\"Auth header va... | Verifies that the token passed is valid.
TODO: While this works, this isn't the proper "Restlet" way to do it and
should utilise the framework more. | [
"Verifies",
"that",
"the",
"token",
"passed",
"is",
"valid",
"."
] | 58ce9e7c3c36c55f19c4be86d787163608112550 | https://github.com/redbox-mint-contrib/redbox-web-service/blob/58ce9e7c3c36c55f19c4be86d787163608112550/src/main/java/com/googlecode/fascinator/redbox/ws/security/TokenBasedVerifier.java#L26-L44 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/javac/code/TypeAnnotations.java | TypeAnnotations.organizeTypeAnnotationsSignatures | public void organizeTypeAnnotationsSignatures(final Env<AttrContext> env, final JCClassDecl tree) {
annotate.afterRepeated( new Worker() {
@Override
public void run() {
JavaFileObject oldSource = log.useSource(env.toplevel.sourcefile);
try {
... | java | public void organizeTypeAnnotationsSignatures(final Env<AttrContext> env, final JCClassDecl tree) {
annotate.afterRepeated( new Worker() {
@Override
public void run() {
JavaFileObject oldSource = log.useSource(env.toplevel.sourcefile);
try {
... | [
"public",
"void",
"organizeTypeAnnotationsSignatures",
"(",
"final",
"Env",
"<",
"AttrContext",
">",
"env",
",",
"final",
"JCClassDecl",
"tree",
")",
"{",
"annotate",
".",
"afterRepeated",
"(",
"new",
"Worker",
"(",
")",
"{",
"@",
"Override",
"public",
"void",... | Separate type annotations from declaration annotations and
determine the correct positions for type annotations.
This version only visits types in signatures and should be
called from MemberEnter.
The method takes the Annotate object as parameter and
adds an Annotate.Worker to the correct Annotate queue for
later proce... | [
"Separate",
"type",
"annotations",
"from",
"declaration",
"annotations",
"and",
"determine",
"the",
"correct",
"positions",
"for",
"type",
"annotations",
".",
"This",
"version",
"only",
"visits",
"types",
"in",
"signatures",
"and",
"should",
"be",
"called",
"from"... | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/javac/code/TypeAnnotations.java#L120-L133 | train |
arakelian/more-commons | src/main/java/com/arakelian/core/utils/ClassUtils.java | ClassUtils.classForNameWithException | public static Class<?> classForNameWithException(final String name, final ClassLoader cl)
throws ClassNotFoundException {
if (cl != null) {
try {
return Class.forName(name, false, cl);
} catch (final ClassNotFoundException | NoClassDefFoundError e) {
... | java | public static Class<?> classForNameWithException(final String name, final ClassLoader cl)
throws ClassNotFoundException {
if (cl != null) {
try {
return Class.forName(name, false, cl);
} catch (final ClassNotFoundException | NoClassDefFoundError e) {
... | [
"public",
"static",
"Class",
"<",
"?",
">",
"classForNameWithException",
"(",
"final",
"String",
"name",
",",
"final",
"ClassLoader",
"cl",
")",
"throws",
"ClassNotFoundException",
"{",
"if",
"(",
"cl",
"!=",
"null",
")",
"{",
"try",
"{",
"return",
"Class",
... | Get the Class from the class name.
@param name
the class name.
@param cl
the class loader to use, if null then the defining class loader of this class will
be utilized.
@return the Class, otherwise null if the class cannot be found.
@throws ClassNotFoundException
if the class cannot be found. | [
"Get",
"the",
"Class",
"from",
"the",
"class",
"name",
"."
] | 83c607044f64a7f6c005a67866c0ef7cb68d6e29 | https://github.com/arakelian/more-commons/blob/83c607044f64a7f6c005a67866c0ef7cb68d6e29/src/main/java/com/arakelian/core/utils/ClassUtils.java#L36-L46 | train |
arakelian/more-commons | src/main/java/com/arakelian/core/utils/ClassUtils.java | ClassUtils.getContextClassLoader | public static ClassLoader getContextClassLoader() {
return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {
@Override
public ClassLoader run() {
ClassLoader cl = null;
try {
cl = Thread.currentThread().getContextClass... | java | public static ClassLoader getContextClassLoader() {
return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {
@Override
public ClassLoader run() {
ClassLoader cl = null;
try {
cl = Thread.currentThread().getContextClass... | [
"public",
"static",
"ClassLoader",
"getContextClassLoader",
"(",
")",
"{",
"return",
"AccessController",
".",
"doPrivileged",
"(",
"new",
"PrivilegedAction",
"<",
"ClassLoader",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"ClassLoader",
"run",
"(",
")",
"{",
... | Get the context class loader.
@return the context class loader, otherwise null security privilages are not set. | [
"Get",
"the",
"context",
"class",
"loader",
"."
] | 83c607044f64a7f6c005a67866c0ef7cb68d6e29 | https://github.com/arakelian/more-commons/blob/83c607044f64a7f6c005a67866c0ef7cb68d6e29/src/main/java/com/arakelian/core/utils/ClassUtils.java#L53-L66 | train |
brianwhu/xillium | core/src/main/java/org/xillium/core/util/CompoundChannel.java | CompoundChannel.sendMessage | @Override
public void sendMessage(String subject, String message) {
first.sendMessage(subject, message);
second.sendMessage(subject, message);
} | java | @Override
public void sendMessage(String subject, String message) {
first.sendMessage(subject, message);
second.sendMessage(subject, message);
} | [
"@",
"Override",
"public",
"void",
"sendMessage",
"(",
"String",
"subject",
",",
"String",
"message",
")",
"{",
"first",
".",
"sendMessage",
"(",
"subject",
",",
"message",
")",
";",
"second",
".",
"sendMessage",
"(",
"subject",
",",
"message",
")",
";",
... | Sends a message that consists of a subject and a message body. | [
"Sends",
"a",
"message",
"that",
"consists",
"of",
"a",
"subject",
"and",
"a",
"message",
"body",
"."
] | e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799 | https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/core/src/main/java/org/xillium/core/util/CompoundChannel.java#L20-L24 | train |
opsmatters/opsmatters-core | src/main/java/com/opsmatters/core/documents/FileColumn.java | FileColumn.getCellType | private short getCellType(String value)
{
short ret = STRING_TYPE;
if(value.equals("number"))
ret = NUMBER_TYPE;
else if(value.equals("datetime"))
ret = DATETIME_TYPE;
else if(value.equals("boolean"))
ret = BOOLEAN_TYPE;
return ret;
} | java | private short getCellType(String value)
{
short ret = STRING_TYPE;
if(value.equals("number"))
ret = NUMBER_TYPE;
else if(value.equals("datetime"))
ret = DATETIME_TYPE;
else if(value.equals("boolean"))
ret = BOOLEAN_TYPE;
return ret;
} | [
"private",
"short",
"getCellType",
"(",
"String",
"value",
")",
"{",
"short",
"ret",
"=",
"STRING_TYPE",
";",
"if",
"(",
"value",
".",
"equals",
"(",
"\"number\"",
")",
")",
"ret",
"=",
"NUMBER_TYPE",
";",
"else",
"if",
"(",
"value",
".",
"equals",
"("... | Returns the cell type for the given value.
@param value The cell type value
@return The code for the cell type | [
"Returns",
"the",
"cell",
"type",
"for",
"the",
"given",
"value",
"."
] | c48904f7e8d029fd45357811ec38a735e261e3fd | https://github.com/opsmatters/opsmatters-core/blob/c48904f7e8d029fd45357811ec38a735e261e3fd/src/main/java/com/opsmatters/core/documents/FileColumn.java#L257-L269 | train |
opsmatters/opsmatters-core | src/main/java/com/opsmatters/core/documents/FileColumn.java | FileColumn.getDataType | private short getDataType(String value)
{
short ret = STRING_TYPE;
if(value.equals("number"))
ret = NUMBER_TYPE;
else if(value.equals("integer"))
ret = INTEGER_TYPE;
else if(value.equals("decimal"))
ret = DECIMAL_TYPE;
else if(value.equals... | java | private short getDataType(String value)
{
short ret = STRING_TYPE;
if(value.equals("number"))
ret = NUMBER_TYPE;
else if(value.equals("integer"))
ret = INTEGER_TYPE;
else if(value.equals("decimal"))
ret = DECIMAL_TYPE;
else if(value.equals... | [
"private",
"short",
"getDataType",
"(",
"String",
"value",
")",
"{",
"short",
"ret",
"=",
"STRING_TYPE",
";",
"if",
"(",
"value",
".",
"equals",
"(",
"\"number\"",
")",
")",
"ret",
"=",
"NUMBER_TYPE",
";",
"else",
"if",
"(",
"value",
".",
"equals",
"("... | Returns the data type for the given value.
@param value The data type value
@return The code for the data type | [
"Returns",
"the",
"data",
"type",
"for",
"the",
"given",
"value",
"."
] | c48904f7e8d029fd45357811ec38a735e261e3fd | https://github.com/opsmatters/opsmatters-core/blob/c48904f7e8d029fd45357811ec38a735e261e3fd/src/main/java/com/opsmatters/core/documents/FileColumn.java#L276-L294 | train |
opsmatters/opsmatters-core | src/main/java/com/opsmatters/core/documents/FileColumn.java | FileColumn.getAlignment | private short getAlignment(String value)
{
short ret = ALIGN_LEFT;
if(value.equals("centre"))
ret = ALIGN_CENTRE;
else if(value.equals("left"))
ret = ALIGN_LEFT;
else if(value.equals("right"))
ret = ALIGN_RIGHT;
else if(value.equals("justi... | java | private short getAlignment(String value)
{
short ret = ALIGN_LEFT;
if(value.equals("centre"))
ret = ALIGN_CENTRE;
else if(value.equals("left"))
ret = ALIGN_LEFT;
else if(value.equals("right"))
ret = ALIGN_RIGHT;
else if(value.equals("justi... | [
"private",
"short",
"getAlignment",
"(",
"String",
"value",
")",
"{",
"short",
"ret",
"=",
"ALIGN_LEFT",
";",
"if",
"(",
"value",
".",
"equals",
"(",
"\"centre\"",
")",
")",
"ret",
"=",
"ALIGN_CENTRE",
";",
"else",
"if",
"(",
"value",
".",
"equals",
"(... | Returns the alignment for the given value.
@param value The alignment value
@return The code for the alignment | [
"Returns",
"the",
"alignment",
"for",
"the",
"given",
"value",
"."
] | c48904f7e8d029fd45357811ec38a735e261e3fd | https://github.com/opsmatters/opsmatters-core/blob/c48904f7e8d029fd45357811ec38a735e261e3fd/src/main/java/com/opsmatters/core/documents/FileColumn.java#L301-L317 | train |
opsmatters/opsmatters-core | src/main/java/com/opsmatters/core/documents/FileColumn.java | FileColumn.getCellFormat | public WritableCellFormat getCellFormat(boolean create)
{
WritableCellFormat ret = null;
if(cellFormat != null)
ret = cellFormat;
else if(create)
ret = new WritableCellFormat(NumberFormats.TEXT);
return ret;
} | java | public WritableCellFormat getCellFormat(boolean create)
{
WritableCellFormat ret = null;
if(cellFormat != null)
ret = cellFormat;
else if(create)
ret = new WritableCellFormat(NumberFormats.TEXT);
return ret;
} | [
"public",
"WritableCellFormat",
"getCellFormat",
"(",
"boolean",
"create",
")",
"{",
"WritableCellFormat",
"ret",
"=",
"null",
";",
"if",
"(",
"cellFormat",
"!=",
"null",
")",
"ret",
"=",
"cellFormat",
";",
"else",
"if",
"(",
"create",
")",
"ret",
"=",
"ne... | Returns the format object for this column.
@param create <CODE>true</CODE> if the format object should be created if it doesn't exist
@return The format object for this column | [
"Returns",
"the",
"format",
"object",
"for",
"this",
"column",
"."
] | c48904f7e8d029fd45357811ec38a735e261e3fd | https://github.com/opsmatters/opsmatters-core/blob/c48904f7e8d029fd45357811ec38a735e261e3fd/src/main/java/com/opsmatters/core/documents/FileColumn.java#L560-L568 | train |
opsmatters/opsmatters-core | src/main/java/com/opsmatters/core/documents/FileColumn.java | FileColumn.convert | private String convert(String str, String dateFormat)
{
String ret = str;
// Carry out the required string conversion
long longValue = 0L;
double doubleValue = 0.0d;
// Convert the input value to a number
if(str.length() > 0)
{
if(inputType == IN... | java | private String convert(String str, String dateFormat)
{
String ret = str;
// Carry out the required string conversion
long longValue = 0L;
double doubleValue = 0.0d;
// Convert the input value to a number
if(str.length() > 0)
{
if(inputType == IN... | [
"private",
"String",
"convert",
"(",
"String",
"str",
",",
"String",
"dateFormat",
")",
"{",
"String",
"ret",
"=",
"str",
";",
"// Carry out the required string conversion",
"long",
"longValue",
"=",
"0L",
";",
"double",
"doubleValue",
"=",
"0.0d",
";",
"// Conv... | Convert the given string using the defined input and output formats and types.
@param str The value to be converted
@param dateFormat The date format to use if the value is a date
@return The converted value | [
"Convert",
"the",
"given",
"string",
"using",
"the",
"defined",
"input",
"and",
"output",
"formats",
"and",
"types",
"."
] | c48904f7e8d029fd45357811ec38a735e261e3fd | https://github.com/opsmatters/opsmatters-core/blob/c48904f7e8d029fd45357811ec38a735e261e3fd/src/main/java/com/opsmatters/core/documents/FileColumn.java#L640-L682 | train |
opsmatters/opsmatters-core | src/main/java/com/opsmatters/core/documents/FileColumn.java | FileColumn.parseDateTime | private long parseDateTime(String str, String format)
{
return FormatUtilities.getDateTime(str, format, false, true);
} | java | private long parseDateTime(String str, String format)
{
return FormatUtilities.getDateTime(str, format, false, true);
} | [
"private",
"long",
"parseDateTime",
"(",
"String",
"str",
",",
"String",
"format",
")",
"{",
"return",
"FormatUtilities",
".",
"getDateTime",
"(",
"str",
",",
"format",
",",
"false",
",",
"true",
")",
";",
"}"
] | Parses the given date string in the given format to a milliseconds vale.
@param str The formatted date to be parsed
@param format The format to use when parsing the date
@return The date in milliseconds | [
"Parses",
"the",
"given",
"date",
"string",
"in",
"the",
"given",
"format",
"to",
"a",
"milliseconds",
"vale",
"."
] | c48904f7e8d029fd45357811ec38a735e261e3fd | https://github.com/opsmatters/opsmatters-core/blob/c48904f7e8d029fd45357811ec38a735e261e3fd/src/main/java/com/opsmatters/core/documents/FileColumn.java#L690-L693 | train |
opsmatters/opsmatters-core | src/main/java/com/opsmatters/core/documents/FileColumn.java | FileColumn.convertDateTime | private String convertDateTime(long dt, String format)
{
if(format.length() == 0)
format = Formats.DATETIME_FORMAT;
return FormatUtilities.getFormattedDateTime(dt, format, false, 0L);
} | java | private String convertDateTime(long dt, String format)
{
if(format.length() == 0)
format = Formats.DATETIME_FORMAT;
return FormatUtilities.getFormattedDateTime(dt, format, false, 0L);
} | [
"private",
"String",
"convertDateTime",
"(",
"long",
"dt",
",",
"String",
"format",
")",
"{",
"if",
"(",
"format",
".",
"length",
"(",
")",
"==",
"0",
")",
"format",
"=",
"Formats",
".",
"DATETIME_FORMAT",
";",
"return",
"FormatUtilities",
".",
"getFormatt... | Converts the given milliseconds date value to the output date format.
@param dt The date to be formatted
@param format The format to use for the date
@return The formatted date | [
"Converts",
"the",
"given",
"milliseconds",
"date",
"value",
"to",
"the",
"output",
"date",
"format",
"."
] | c48904f7e8d029fd45357811ec38a735e261e3fd | https://github.com/opsmatters/opsmatters-core/blob/c48904f7e8d029fd45357811ec38a735e261e3fd/src/main/java/com/opsmatters/core/documents/FileColumn.java#L701-L706 | train |
opsmatters/opsmatters-core | src/main/java/com/opsmatters/core/documents/FileColumn.java | FileColumn.convertDecimal | private String convertDecimal(double d, String format)
{
String ret = "";
if(format.length() > 0)
{
DecimalFormat f = new DecimalFormat(format);
ret = f.format(d);
}
else
{
ret = Double.toString(d);
}
return ret;
... | java | private String convertDecimal(double d, String format)
{
String ret = "";
if(format.length() > 0)
{
DecimalFormat f = new DecimalFormat(format);
ret = f.format(d);
}
else
{
ret = Double.toString(d);
}
return ret;
... | [
"private",
"String",
"convertDecimal",
"(",
"double",
"d",
",",
"String",
"format",
")",
"{",
"String",
"ret",
"=",
"\"\"",
";",
"if",
"(",
"format",
".",
"length",
"(",
")",
">",
"0",
")",
"{",
"DecimalFormat",
"f",
"=",
"new",
"DecimalFormat",
"(",
... | Converts the given numeric value to the output date format.
@param d The value to be converted
@param format The format to use for the value
@return The formatted value | [
"Converts",
"the",
"given",
"numeric",
"value",
"to",
"the",
"output",
"date",
"format",
"."
] | c48904f7e8d029fd45357811ec38a735e261e3fd | https://github.com/opsmatters/opsmatters-core/blob/c48904f7e8d029fd45357811ec38a735e261e3fd/src/main/java/com/opsmatters/core/documents/FileColumn.java#L714-L729 | train |
opsmatters/opsmatters-core | src/main/java/com/opsmatters/core/documents/FileColumn.java | FileColumn.convertString | private String convertString(String str, String format, String expr)
{
String ret = str;
String[] params = null;
if(format.length() > 0)
{
ret = "";
if(expr.length() > 0) // Indicates a format using regex
{
Pattern pattern = getPa... | java | private String convertString(String str, String format, String expr)
{
String ret = str;
String[] params = null;
if(format.length() > 0)
{
ret = "";
if(expr.length() > 0) // Indicates a format using regex
{
Pattern pattern = getPa... | [
"private",
"String",
"convertString",
"(",
"String",
"str",
",",
"String",
"format",
",",
"String",
"expr",
")",
"{",
"String",
"ret",
"=",
"str",
";",
"String",
"[",
"]",
"params",
"=",
"null",
";",
"if",
"(",
"format",
".",
"length",
"(",
")",
">",... | Converts the given string value to the output string format.
@param str The value to be converted
@param format The format to use for the value
@param expr A regex to use for formatting the value
@return The formatted value | [
"Converts",
"the",
"given",
"string",
"value",
"to",
"the",
"output",
"string",
"format",
"."
] | c48904f7e8d029fd45357811ec38a735e261e3fd | https://github.com/opsmatters/opsmatters-core/blob/c48904f7e8d029fd45357811ec38a735e261e3fd/src/main/java/com/opsmatters/core/documents/FileColumn.java#L738-L768 | train |
opsmatters/opsmatters-core | src/main/java/com/opsmatters/core/documents/FileColumn.java | FileColumn.getPattern | private Pattern getPattern(String expr)
{
Pattern pattern = patterns.get(expr);
if(pattern == null)
{
pattern = Pattern.compile(expr);
patterns.put(expr, pattern);
}
return pattern;
} | java | private Pattern getPattern(String expr)
{
Pattern pattern = patterns.get(expr);
if(pattern == null)
{
pattern = Pattern.compile(expr);
patterns.put(expr, pattern);
}
return pattern;
} | [
"private",
"Pattern",
"getPattern",
"(",
"String",
"expr",
")",
"{",
"Pattern",
"pattern",
"=",
"patterns",
".",
"get",
"(",
"expr",
")",
";",
"if",
"(",
"pattern",
"==",
"null",
")",
"{",
"pattern",
"=",
"Pattern",
".",
"compile",
"(",
"expr",
")",
... | Returns the pattern for the given regular expression.
@param expr A regex to use for formatting
@return The pattern for the expression | [
"Returns",
"the",
"pattern",
"for",
"the",
"given",
"regular",
"expression",
"."
] | c48904f7e8d029fd45357811ec38a735e261e3fd | https://github.com/opsmatters/opsmatters-core/blob/c48904f7e8d029fd45357811ec38a735e261e3fd/src/main/java/com/opsmatters/core/documents/FileColumn.java#L775-L784 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/javadoc/DocletInvoker.java | DocletInvoker.languageVersion | public LanguageVersion languageVersion() {
try {
Object retVal;
String methodName = "languageVersion";
Class<?>[] paramTypes = new Class<?>[0];
Object[] params = new Object[0];
try {
retVal = invoke(methodName, JAVA_1_1, paramTypes, par... | java | public LanguageVersion languageVersion() {
try {
Object retVal;
String methodName = "languageVersion";
Class<?>[] paramTypes = new Class<?>[0];
Object[] params = new Object[0];
try {
retVal = invoke(methodName, JAVA_1_1, paramTypes, par... | [
"public",
"LanguageVersion",
"languageVersion",
"(",
")",
"{",
"try",
"{",
"Object",
"retVal",
";",
"String",
"methodName",
"=",
"\"languageVersion\"",
";",
"Class",
"<",
"?",
">",
"[",
"]",
"paramTypes",
"=",
"new",
"Class",
"<",
"?",
">",
"[",
"0",
"]"... | Return the language version supported by this doclet.
If the method does not exist in the doclet, assume version 1.1. | [
"Return",
"the",
"language",
"version",
"supported",
"by",
"this",
"doclet",
".",
"If",
"the",
"method",
"does",
"not",
"exist",
"in",
"the",
"doclet",
"assume",
"version",
"1",
".",
"1",
"."
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/javadoc/DocletInvoker.java#L255-L276 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/javadoc/DocletInvoker.java | DocletInvoker.invoke | private Object invoke(String methodName, Object returnValueIfNonExistent,
Class<?>[] paramTypes, Object[] params)
throws DocletInvokeException {
Method meth;
try {
meth = docletClass.getMethod(methodName, paramTypes);
} catch (NoSuchM... | java | private Object invoke(String methodName, Object returnValueIfNonExistent,
Class<?>[] paramTypes, Object[] params)
throws DocletInvokeException {
Method meth;
try {
meth = docletClass.getMethod(methodName, paramTypes);
} catch (NoSuchM... | [
"private",
"Object",
"invoke",
"(",
"String",
"methodName",
",",
"Object",
"returnValueIfNonExistent",
",",
"Class",
"<",
"?",
">",
"[",
"]",
"paramTypes",
",",
"Object",
"[",
"]",
"params",
")",
"throws",
"DocletInvokeException",
"{",
"Method",
"meth",
";",
... | Utility method for calling doclet functionality | [
"Utility",
"method",
"for",
"calling",
"doclet",
"functionality"
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/javadoc/DocletInvoker.java#L281-L338 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/javac/file/ZipFileIndexCache.java | ZipFileIndexCache.getZipFileIndexes | public synchronized List<ZipFileIndex> getZipFileIndexes(boolean openedOnly) {
List<ZipFileIndex> zipFileIndexes = new ArrayList<ZipFileIndex>();
zipFileIndexes.addAll(map.values());
if (openedOnly) {
for(ZipFileIndex elem : zipFileIndexes) {
if (!elem.isOpen()) {
... | java | public synchronized List<ZipFileIndex> getZipFileIndexes(boolean openedOnly) {
List<ZipFileIndex> zipFileIndexes = new ArrayList<ZipFileIndex>();
zipFileIndexes.addAll(map.values());
if (openedOnly) {
for(ZipFileIndex elem : zipFileIndexes) {
if (!elem.isOpen()) {
... | [
"public",
"synchronized",
"List",
"<",
"ZipFileIndex",
">",
"getZipFileIndexes",
"(",
"boolean",
"openedOnly",
")",
"{",
"List",
"<",
"ZipFileIndex",
">",
"zipFileIndexes",
"=",
"new",
"ArrayList",
"<",
"ZipFileIndex",
">",
"(",
")",
";",
"zipFileIndexes",
".",
... | Returns a list of all ZipFileIndex entries
@param openedOnly If true it returns a list of only opened ZipFileIndex entries, otherwise
all ZipFileEntry(s) are included into the list.
@return A list of ZipFileIndex entries, or an empty list | [
"Returns",
"a",
"list",
"of",
"all",
"ZipFileIndex",
"entries"
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/javac/file/ZipFileIndexCache.java#L77-L91 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/javac/file/ZipFileIndexCache.java | ZipFileIndexCache.setOpenedIndexes | public synchronized void setOpenedIndexes(List<ZipFileIndex>indexes) throws IllegalStateException {
if (map.isEmpty()) {
String msg =
"Setting opened indexes should be called only when the ZipFileCache is empty. "
+ "Call JavacFileManager.flush() before callin... | java | public synchronized void setOpenedIndexes(List<ZipFileIndex>indexes) throws IllegalStateException {
if (map.isEmpty()) {
String msg =
"Setting opened indexes should be called only when the ZipFileCache is empty. "
+ "Call JavacFileManager.flush() before callin... | [
"public",
"synchronized",
"void",
"setOpenedIndexes",
"(",
"List",
"<",
"ZipFileIndex",
">",
"indexes",
")",
"throws",
"IllegalStateException",
"{",
"if",
"(",
"map",
".",
"isEmpty",
"(",
")",
")",
"{",
"String",
"msg",
"=",
"\"Setting opened indexes should be cal... | Sets already opened list of ZipFileIndexes from an outside client
of the compiler. This functionality should be used in a non-batch clients of the compiler. | [
"Sets",
"already",
"opened",
"list",
"of",
"ZipFileIndexes",
"from",
"an",
"outside",
"client",
"of",
"the",
"compiler",
".",
"This",
"functionality",
"should",
"be",
"used",
"in",
"a",
"non",
"-",
"batch",
"clients",
"of",
"the",
"compiler",
"."
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/javac/file/ZipFileIndexCache.java#L137-L148 | train |
qsardb/qsardb | model/src/main/java/org/qsardb/model/Qdb.java | Qdb.close | public void close() throws IOException, QdbException {
this.compoundRegistry.close();
this.propertyRegistry.close();
this.descriptorRegistry.close();
this.modelRegistry.close();
this.predictionRegistry.close();
try {
this.storage.close();
} finally {
this.storage = null;
}
try {
if(this.tem... | java | public void close() throws IOException, QdbException {
this.compoundRegistry.close();
this.propertyRegistry.close();
this.descriptorRegistry.close();
this.modelRegistry.close();
this.predictionRegistry.close();
try {
this.storage.close();
} finally {
this.storage = null;
}
try {
if(this.tem... | [
"public",
"void",
"close",
"(",
")",
"throws",
"IOException",
",",
"QdbException",
"{",
"this",
".",
"compoundRegistry",
".",
"close",
"(",
")",
";",
"this",
".",
"propertyRegistry",
".",
"close",
"(",
")",
";",
"this",
".",
"descriptorRegistry",
".",
"clo... | Frees resources. | [
"Frees",
"resources",
"."
] | 9798f524abd973878b9040927aed8131885127fa | https://github.com/qsardb/qsardb/blob/9798f524abd973878b9040927aed8131885127fa/model/src/main/java/org/qsardb/model/Qdb.java#L143-L163 | train |
defei/codelogger-utils | src/main/java/org/codelogger/utils/ExceptionThrowerFactory.java | ExceptionThrowerFactory.instance | public static ExceptionThrower instance(Class<? extends RuntimeException> classType) {
iae.throwIfNull(classType, "The parameter of exception type can not be null.");
if (classType.equals(IllegalArgumentException.class)) {
return iae;
} else {
iae.throwIfTrue(true, "Not ... | java | public static ExceptionThrower instance(Class<? extends RuntimeException> classType) {
iae.throwIfNull(classType, "The parameter of exception type can not be null.");
if (classType.equals(IllegalArgumentException.class)) {
return iae;
} else {
iae.throwIfTrue(true, "Not ... | [
"public",
"static",
"ExceptionThrower",
"instance",
"(",
"Class",
"<",
"?",
"extends",
"RuntimeException",
">",
"classType",
")",
"{",
"iae",
".",
"throwIfNull",
"(",
"classType",
",",
"\"The parameter of exception type can not be null.\"",
")",
";",
"if",
"(",
"cla... | Return specify exception type singleton exceptionThrower.
@param classType
the exception you want to use to thrower.
@return an exception thrower instance. | [
"Return",
"specify",
"exception",
"type",
"singleton",
"exceptionThrower",
"."
] | d906f5d217b783c7ae3e53442cd6fb87b20ecc0a | https://github.com/defei/codelogger-utils/blob/d906f5d217b783c7ae3e53442cd6fb87b20ecc0a/src/main/java/org/codelogger/utils/ExceptionThrowerFactory.java#L15-L25 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.