id int32 0 165k | repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 |
|---|---|---|---|---|---|---|---|---|---|---|---|
59,400 | wdullaer/MaterialDateTimePicker | library/src/main/java/com/wdullaer/materialdatetimepicker/HapticFeedbackController.java | HapticFeedbackController.hasVibratePermission | private boolean hasVibratePermission(Context context) {
PackageManager pm = context.getPackageManager();
int hasPerm = pm.checkPermission(android.Manifest.permission.VIBRATE, context.getPackageName());
return hasPerm == PackageManager.PERMISSION_GRANTED;
} | java | private boolean hasVibratePermission(Context context) {
PackageManager pm = context.getPackageManager();
int hasPerm = pm.checkPermission(android.Manifest.permission.VIBRATE, context.getPackageName());
return hasPerm == PackageManager.PERMISSION_GRANTED;
} | [
"private",
"boolean",
"hasVibratePermission",
"(",
"Context",
"context",
")",
"{",
"PackageManager",
"pm",
"=",
"context",
".",
"getPackageManager",
"(",
")",
";",
"int",
"hasPerm",
"=",
"pm",
".",
"checkPermission",
"(",
"android",
".",
"Manifest",
".",
"perm... | Method to verify that vibrate permission has been granted.
Allows users of the library to disabled vibrate support if desired.
@return true if Vibrate permission has been granted | [
"Method",
"to",
"verify",
"that",
"vibrate",
"permission",
"has",
"been",
"granted",
"."
] | 0a8fe28f19db4f5a5a6cfc525a852416232873a8 | https://github.com/wdullaer/MaterialDateTimePicker/blob/0a8fe28f19db4f5a5a6cfc525a852416232873a8/library/src/main/java/com/wdullaer/materialdatetimepicker/HapticFeedbackController.java#L61-L65 |
59,401 | wdullaer/MaterialDateTimePicker | library/src/main/java/com/wdullaer/materialdatetimepicker/time/TimePickerDialog.java | TimePickerDialog.newInstance | @SuppressWarnings("SameParameterValue")
public static TimePickerDialog newInstance(OnTimeSetListener callback,
int hourOfDay, int minute, int second, boolean is24HourMode) {
TimePickerDialog ret = new TimePickerDialog();
ret.initialize(callback, hourOfDay, minute, second, is24HourMode);
... | java | @SuppressWarnings("SameParameterValue")
public static TimePickerDialog newInstance(OnTimeSetListener callback,
int hourOfDay, int minute, int second, boolean is24HourMode) {
TimePickerDialog ret = new TimePickerDialog();
ret.initialize(callback, hourOfDay, minute, second, is24HourMode);
... | [
"@",
"SuppressWarnings",
"(",
"\"SameParameterValue\"",
")",
"public",
"static",
"TimePickerDialog",
"newInstance",
"(",
"OnTimeSetListener",
"callback",
",",
"int",
"hourOfDay",
",",
"int",
"minute",
",",
"int",
"second",
",",
"boolean",
"is24HourMode",
")",
"{",
... | Create a new TimePickerDialog instance with a given intial selection
@param callback How the parent is notified that the time is set.
@param hourOfDay The initial hour of the dialog.
@param minute The initial minute of the dialog.
@param second The initial second of the dialog.
@param is24HourMode Tr... | [
"Create",
"a",
"new",
"TimePickerDialog",
"instance",
"with",
"a",
"given",
"intial",
"selection"
] | 0a8fe28f19db4f5a5a6cfc525a852416232873a8 | https://github.com/wdullaer/MaterialDateTimePicker/blob/0a8fe28f19db4f5a5a6cfc525a852416232873a8/library/src/main/java/com/wdullaer/materialdatetimepicker/time/TimePickerDialog.java#L197-L203 |
59,402 | wdullaer/MaterialDateTimePicker | library/src/main/java/com/wdullaer/materialdatetimepicker/time/TimePickerDialog.java | TimePickerDialog.newInstance | public static TimePickerDialog newInstance(OnTimeSetListener callback,
int hourOfDay, int minute, boolean is24HourMode) {
return TimePickerDialog.newInstance(callback, hourOfDay, minute, 0, is24HourMode);
} | java | public static TimePickerDialog newInstance(OnTimeSetListener callback,
int hourOfDay, int minute, boolean is24HourMode) {
return TimePickerDialog.newInstance(callback, hourOfDay, minute, 0, is24HourMode);
} | [
"public",
"static",
"TimePickerDialog",
"newInstance",
"(",
"OnTimeSetListener",
"callback",
",",
"int",
"hourOfDay",
",",
"int",
"minute",
",",
"boolean",
"is24HourMode",
")",
"{",
"return",
"TimePickerDialog",
".",
"newInstance",
"(",
"callback",
",",
"hourOfDay",... | Create a new TimePickerDialog instance with a given initial selection
@param callback How the parent is notified that the time is set.
@param hourOfDay The initial hour of the dialog.
@param minute The initial minute of the dialog.
@param is24HourMode True to render 24 hour mode, false to render AM / PM se... | [
"Create",
"a",
"new",
"TimePickerDialog",
"instance",
"with",
"a",
"given",
"initial",
"selection"
] | 0a8fe28f19db4f5a5a6cfc525a852416232873a8 | https://github.com/wdullaer/MaterialDateTimePicker/blob/0a8fe28f19db4f5a5a6cfc525a852416232873a8/library/src/main/java/com/wdullaer/materialdatetimepicker/time/TimePickerDialog.java#L213-L216 |
59,403 | wdullaer/MaterialDateTimePicker | library/src/main/java/com/wdullaer/materialdatetimepicker/time/TimePickerDialog.java | TimePickerDialog.newInstance | @SuppressWarnings({"unused", "SameParameterValue"})
public static TimePickerDialog newInstance(OnTimeSetListener callback, boolean is24HourMode) {
Calendar now = Calendar.getInstance();
return TimePickerDialog.newInstance(callback, now.get(Calendar.HOUR_OF_DAY), now.get(Calendar.MINUTE), is24HourMod... | java | @SuppressWarnings({"unused", "SameParameterValue"})
public static TimePickerDialog newInstance(OnTimeSetListener callback, boolean is24HourMode) {
Calendar now = Calendar.getInstance();
return TimePickerDialog.newInstance(callback, now.get(Calendar.HOUR_OF_DAY), now.get(Calendar.MINUTE), is24HourMod... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"unused\"",
",",
"\"SameParameterValue\"",
"}",
")",
"public",
"static",
"TimePickerDialog",
"newInstance",
"(",
"OnTimeSetListener",
"callback",
",",
"boolean",
"is24HourMode",
")",
"{",
"Calendar",
"now",
"=",
"Calendar",
".",
... | Create a new TimePickerDialog instance initialized to the current system time
@param callback How the parent is notified that the time is set.
@param is24HourMode True to render 24 hour mode, false to render AM / PM selectors.
@return a new TimePickerDialog instance. | [
"Create",
"a",
"new",
"TimePickerDialog",
"instance",
"initialized",
"to",
"the",
"current",
"system",
"time"
] | 0a8fe28f19db4f5a5a6cfc525a852416232873a8 | https://github.com/wdullaer/MaterialDateTimePicker/blob/0a8fe28f19db4f5a5a6cfc525a852416232873a8/library/src/main/java/com/wdullaer/materialdatetimepicker/time/TimePickerDialog.java#L224-L228 |
59,404 | wdullaer/MaterialDateTimePicker | library/src/main/java/com/wdullaer/materialdatetimepicker/time/TimePickerDialog.java | TimePickerDialog.processKeyUp | private boolean processKeyUp(int keyCode) {
if (keyCode == KeyEvent.KEYCODE_TAB) {
if(mInKbMode) {
if (isTypedTimeFullyLegal()) {
finishKbMode(true);
}
return true;
}
} else if (keyCode == KeyEvent.KEYCODE_ENTER)... | java | private boolean processKeyUp(int keyCode) {
if (keyCode == KeyEvent.KEYCODE_TAB) {
if(mInKbMode) {
if (isTypedTimeFullyLegal()) {
finishKbMode(true);
}
return true;
}
} else if (keyCode == KeyEvent.KEYCODE_ENTER)... | [
"private",
"boolean",
"processKeyUp",
"(",
"int",
"keyCode",
")",
"{",
"if",
"(",
"keyCode",
"==",
"KeyEvent",
".",
"KEYCODE_TAB",
")",
"{",
"if",
"(",
"mInKbMode",
")",
"{",
"if",
"(",
"isTypedTimeFullyLegal",
"(",
")",
")",
"{",
"finishKbMode",
"(",
"t... | For keyboard mode, processes key events.
@param keyCode the pressed key.
@return true if the key was successfully processed, false otherwise. | [
"For",
"keyboard",
"mode",
"processes",
"key",
"events",
"."
] | 0a8fe28f19db4f5a5a6cfc525a852416232873a8 | https://github.com/wdullaer/MaterialDateTimePicker/blob/0a8fe28f19db4f5a5a6cfc525a852416232873a8/library/src/main/java/com/wdullaer/materialdatetimepicker/time/TimePickerDialog.java#L1287-L1349 |
59,405 | wdullaer/MaterialDateTimePicker | library/src/main/java/com/wdullaer/materialdatetimepicker/date/MonthView.java | MonthView.setMonthParams | public void setMonthParams(int selectedDay, int year, int month, int weekStart) {
if (month == -1 && year == -1) {
throw new InvalidParameterException("You must specify month and year for this view");
}
mSelectedDay = selectedDay;
// Allocate space for caching the day numbe... | java | public void setMonthParams(int selectedDay, int year, int month, int weekStart) {
if (month == -1 && year == -1) {
throw new InvalidParameterException("You must specify month and year for this view");
}
mSelectedDay = selectedDay;
// Allocate space for caching the day numbe... | [
"public",
"void",
"setMonthParams",
"(",
"int",
"selectedDay",
",",
"int",
"year",
",",
"int",
"month",
",",
"int",
"weekStart",
")",
"{",
"if",
"(",
"month",
"==",
"-",
"1",
"&&",
"year",
"==",
"-",
"1",
")",
"{",
"throw",
"new",
"InvalidParameterExce... | Sets all the parameters for displaying this week. The only required
parameter is the week number. Other parameters have a default value and
will only update if a new value is included, except for focus month,
which will always default to no focus month if no value is passed in. | [
"Sets",
"all",
"the",
"parameters",
"for",
"displaying",
"this",
"week",
".",
"The",
"only",
"required",
"parameter",
"is",
"the",
"week",
"number",
".",
"Other",
"parameters",
"have",
"a",
"default",
"value",
"and",
"will",
"only",
"update",
"if",
"a",
"n... | 0a8fe28f19db4f5a5a6cfc525a852416232873a8 | https://github.com/wdullaer/MaterialDateTimePicker/blob/0a8fe28f19db4f5a5a6cfc525a852416232873a8/library/src/main/java/com/wdullaer/materialdatetimepicker/date/MonthView.java#L291-L332 |
59,406 | wdullaer/MaterialDateTimePicker | library/src/main/java/com/wdullaer/materialdatetimepicker/date/MonthView.java | MonthView.getDayFromLocation | public int getDayFromLocation(float x, float y) {
final int day = getInternalDayFromLocation(x, y);
if (day < 1 || day > mNumCells) {
return -1;
}
return day;
} | java | public int getDayFromLocation(float x, float y) {
final int day = getInternalDayFromLocation(x, y);
if (day < 1 || day > mNumCells) {
return -1;
}
return day;
} | [
"public",
"int",
"getDayFromLocation",
"(",
"float",
"x",
",",
"float",
"y",
")",
"{",
"final",
"int",
"day",
"=",
"getInternalDayFromLocation",
"(",
"x",
",",
"y",
")",
";",
"if",
"(",
"day",
"<",
"1",
"||",
"day",
">",
"mNumCells",
")",
"{",
"retur... | Calculates the day that the given x position is in, accounting for week
number. Returns the day or -1 if the position wasn't in a day.
@param x The x position of the touch event
@return The day number, or -1 if the position wasn't in a day | [
"Calculates",
"the",
"day",
"that",
"the",
"given",
"x",
"position",
"is",
"in",
"accounting",
"for",
"week",
"number",
".",
"Returns",
"the",
"day",
"or",
"-",
"1",
"if",
"the",
"position",
"wasn",
"t",
"in",
"a",
"day",
"."
] | 0a8fe28f19db4f5a5a6cfc525a852416232873a8 | https://github.com/wdullaer/MaterialDateTimePicker/blob/0a8fe28f19db4f5a5a6cfc525a852416232873a8/library/src/main/java/com/wdullaer/materialdatetimepicker/date/MonthView.java#L503-L509 |
59,407 | wdullaer/MaterialDateTimePicker | library/src/main/java/com/wdullaer/materialdatetimepicker/date/MonthView.java | MonthView.getInternalDayFromLocation | protected int getInternalDayFromLocation(float x, float y) {
int dayStart = mEdgePadding;
if (x < dayStart || x > mWidth - mEdgePadding) {
return -1;
}
// Selection is (x - start) / (pixels/day) == (x -s) * day / pixels
int row = (int) (y - getMonthHeaderSize()) / mRo... | java | protected int getInternalDayFromLocation(float x, float y) {
int dayStart = mEdgePadding;
if (x < dayStart || x > mWidth - mEdgePadding) {
return -1;
}
// Selection is (x - start) / (pixels/day) == (x -s) * day / pixels
int row = (int) (y - getMonthHeaderSize()) / mRo... | [
"protected",
"int",
"getInternalDayFromLocation",
"(",
"float",
"x",
",",
"float",
"y",
")",
"{",
"int",
"dayStart",
"=",
"mEdgePadding",
";",
"if",
"(",
"x",
"<",
"dayStart",
"||",
"x",
">",
"mWidth",
"-",
"mEdgePadding",
")",
"{",
"return",
"-",
"1",
... | Calculates the day that the given x position is in, accounting for week
number.
@param x The x position of the touch event
@return The day number | [
"Calculates",
"the",
"day",
"that",
"the",
"given",
"x",
"position",
"is",
"in",
"accounting",
"for",
"week",
"number",
"."
] | 0a8fe28f19db4f5a5a6cfc525a852416232873a8 | https://github.com/wdullaer/MaterialDateTimePicker/blob/0a8fe28f19db4f5a5a6cfc525a852416232873a8/library/src/main/java/com/wdullaer/materialdatetimepicker/date/MonthView.java#L518-L530 |
59,408 | wdullaer/MaterialDateTimePicker | library/src/main/java/com/wdullaer/materialdatetimepicker/date/MonthView.java | MonthView.getWeekDayLabel | private String getWeekDayLabel(Calendar day) {
Locale locale = mController.getLocale();
// Localised short version of the string is not available on API < 18
if (Build.VERSION.SDK_INT < 18) {
String dayName = new SimpleDateFormat("E", locale).format(day.getTime());
Strin... | java | private String getWeekDayLabel(Calendar day) {
Locale locale = mController.getLocale();
// Localised short version of the string is not available on API < 18
if (Build.VERSION.SDK_INT < 18) {
String dayName = new SimpleDateFormat("E", locale).format(day.getTime());
Strin... | [
"private",
"String",
"getWeekDayLabel",
"(",
"Calendar",
"day",
")",
"{",
"Locale",
"locale",
"=",
"mController",
".",
"getLocale",
"(",
")",
";",
"// Localised short version of the string is not available on API < 18",
"if",
"(",
"Build",
".",
"VERSION",
".",
"SDK_IN... | Return a 1 or 2 letter String for use as a weekday label
@param day The day for which to generate a label
@return The weekday label | [
"Return",
"a",
"1",
"or",
"2",
"letter",
"String",
"for",
"use",
"as",
"a",
"weekday",
"label"
] | 0a8fe28f19db4f5a5a6cfc525a852416232873a8 | https://github.com/wdullaer/MaterialDateTimePicker/blob/0a8fe28f19db4f5a5a6cfc525a852416232873a8/library/src/main/java/com/wdullaer/materialdatetimepicker/date/MonthView.java#L571-L612 |
59,409 | wdullaer/MaterialDateTimePicker | library/src/main/java/com/wdullaer/materialdatetimepicker/time/RadialTextsView.java | RadialTextsView.calculateGridSizes | private void calculateGridSizes(float numbersRadius, float xCenter, float yCenter,
float textSize, float[] textGridHeights, float[] textGridWidths) {
/*
* The numbers need to be drawn in a 7x7 grid, representing the points on the Unit Circle.
*/
float offset1 = numbersRadiu... | java | private void calculateGridSizes(float numbersRadius, float xCenter, float yCenter,
float textSize, float[] textGridHeights, float[] textGridWidths) {
/*
* The numbers need to be drawn in a 7x7 grid, representing the points on the Unit Circle.
*/
float offset1 = numbersRadiu... | [
"private",
"void",
"calculateGridSizes",
"(",
"float",
"numbersRadius",
",",
"float",
"xCenter",
",",
"float",
"yCenter",
",",
"float",
"textSize",
",",
"float",
"[",
"]",
"textGridHeights",
",",
"float",
"[",
"]",
"textGridWidths",
")",
"{",
"/*\n * The... | Using the trigonometric Unit Circle, calculate the positions that the text will need to be
drawn at based on the specified circle radius. Place the values in the textGridHeights and
textGridWidths parameters. | [
"Using",
"the",
"trigonometric",
"Unit",
"Circle",
"calculate",
"the",
"positions",
"that",
"the",
"text",
"will",
"need",
"to",
"be",
"drawn",
"at",
"based",
"on",
"the",
"specified",
"circle",
"radius",
".",
"Place",
"the",
"values",
"in",
"the",
"textGrid... | 0a8fe28f19db4f5a5a6cfc525a852416232873a8 | https://github.com/wdullaer/MaterialDateTimePicker/blob/0a8fe28f19db4f5a5a6cfc525a852416232873a8/library/src/main/java/com/wdullaer/materialdatetimepicker/time/RadialTextsView.java#L265-L295 |
59,410 | wdullaer/MaterialDateTimePicker | library/src/main/java/com/wdullaer/materialdatetimepicker/time/RadialTextsView.java | RadialTextsView.drawTexts | private void drawTexts(Canvas canvas, float textSize, Typeface typeface, String[] texts,
float[] textGridWidths, float[] textGridHeights) {
mPaint.setTextSize(textSize);
mPaint.setTypeface(typeface);
Paint[] textPaints = assignTextColors(texts);
canvas.drawText(texts[0], text... | java | private void drawTexts(Canvas canvas, float textSize, Typeface typeface, String[] texts,
float[] textGridWidths, float[] textGridHeights) {
mPaint.setTextSize(textSize);
mPaint.setTypeface(typeface);
Paint[] textPaints = assignTextColors(texts);
canvas.drawText(texts[0], text... | [
"private",
"void",
"drawTexts",
"(",
"Canvas",
"canvas",
",",
"float",
"textSize",
",",
"Typeface",
"typeface",
",",
"String",
"[",
"]",
"texts",
",",
"float",
"[",
"]",
"textGridWidths",
",",
"float",
"[",
"]",
"textGridHeights",
")",
"{",
"mPaint",
".",
... | Draw the 12 text values at the positions specified by the textGrid parameters. | [
"Draw",
"the",
"12",
"text",
"values",
"at",
"the",
"positions",
"specified",
"by",
"the",
"textGrid",
"parameters",
"."
] | 0a8fe28f19db4f5a5a6cfc525a852416232873a8 | https://github.com/wdullaer/MaterialDateTimePicker/blob/0a8fe28f19db4f5a5a6cfc525a852416232873a8/library/src/main/java/com/wdullaer/materialdatetimepicker/time/RadialTextsView.java#L311-L328 |
59,411 | wdullaer/MaterialDateTimePicker | library/src/main/java/com/wdullaer/materialdatetimepicker/time/RadialSelectorView.java | RadialSelectorView.setSelection | public void setSelection(int selectionDegrees, boolean isInnerCircle, boolean forceDrawDot) {
mSelectionDegrees = selectionDegrees;
mSelectionRadians = selectionDegrees * Math.PI / 180;
mForceDrawDot = forceDrawDot;
if (mHasInnerCircle) {
if (isInnerCircle) {
... | java | public void setSelection(int selectionDegrees, boolean isInnerCircle, boolean forceDrawDot) {
mSelectionDegrees = selectionDegrees;
mSelectionRadians = selectionDegrees * Math.PI / 180;
mForceDrawDot = forceDrawDot;
if (mHasInnerCircle) {
if (isInnerCircle) {
... | [
"public",
"void",
"setSelection",
"(",
"int",
"selectionDegrees",
",",
"boolean",
"isInnerCircle",
",",
"boolean",
"forceDrawDot",
")",
"{",
"mSelectionDegrees",
"=",
"selectionDegrees",
";",
"mSelectionRadians",
"=",
"selectionDegrees",
"*",
"Math",
".",
"PI",
"/",... | Set the selection.
@param selectionDegrees The degrees to be selected.
@param isInnerCircle Whether the selection should be in the inner circle or outer. Will be
ignored if hasInnerCircle was initialized to false.
@param forceDrawDot Whether to force the dot in the center of the selection circle to be
drawn. If false, ... | [
"Set",
"the",
"selection",
"."
] | 0a8fe28f19db4f5a5a6cfc525a852416232873a8 | https://github.com/wdullaer/MaterialDateTimePicker/blob/0a8fe28f19db4f5a5a6cfc525a852416232873a8/library/src/main/java/com/wdullaer/materialdatetimepicker/time/RadialSelectorView.java#L156-L168 |
59,412 | wdullaer/MaterialDateTimePicker | library/src/main/java/com/wdullaer/materialdatetimepicker/date/DayPickerView.java | DayPickerView.setUpRecyclerView | protected void setUpRecyclerView(DatePickerDialog.ScrollOrientation scrollOrientation) {
setVerticalScrollBarEnabled(false);
setFadingEdgeLength(0);
int gravity = scrollOrientation == DatePickerDialog.ScrollOrientation.VERTICAL
? Gravity.TOP
: Gravity.START;
... | java | protected void setUpRecyclerView(DatePickerDialog.ScrollOrientation scrollOrientation) {
setVerticalScrollBarEnabled(false);
setFadingEdgeLength(0);
int gravity = scrollOrientation == DatePickerDialog.ScrollOrientation.VERTICAL
? Gravity.TOP
: Gravity.START;
... | [
"protected",
"void",
"setUpRecyclerView",
"(",
"DatePickerDialog",
".",
"ScrollOrientation",
"scrollOrientation",
")",
"{",
"setVerticalScrollBarEnabled",
"(",
"false",
")",
";",
"setFadingEdgeLength",
"(",
"0",
")",
";",
"int",
"gravity",
"=",
"scrollOrientation",
"=... | Sets all the required fields for the list view. Override this method to
set a different list view behavior. | [
"Sets",
"all",
"the",
"required",
"fields",
"for",
"the",
"list",
"view",
".",
"Override",
"this",
"method",
"to",
"set",
"a",
"different",
"list",
"view",
"behavior",
"."
] | 0a8fe28f19db4f5a5a6cfc525a852416232873a8 | https://github.com/wdullaer/MaterialDateTimePicker/blob/0a8fe28f19db4f5a5a6cfc525a852416232873a8/library/src/main/java/com/wdullaer/materialdatetimepicker/date/DayPickerView.java#L113-L125 |
59,413 | wdullaer/MaterialDateTimePicker | library/src/main/java/com/wdullaer/materialdatetimepicker/date/AccessibleDateAnimator.java | AccessibleDateAnimator.dispatchPopulateAccessibilityEvent | @Override
public boolean dispatchPopulateAccessibilityEvent(AccessibilityEvent event) {
if (event.getEventType() == AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED) {
// Clear the event's current text so that only the current date will be spoken.
event.getText().clear();
int... | java | @Override
public boolean dispatchPopulateAccessibilityEvent(AccessibilityEvent event) {
if (event.getEventType() == AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED) {
// Clear the event's current text so that only the current date will be spoken.
event.getText().clear();
int... | [
"@",
"Override",
"public",
"boolean",
"dispatchPopulateAccessibilityEvent",
"(",
"AccessibilityEvent",
"event",
")",
"{",
"if",
"(",
"event",
".",
"getEventType",
"(",
")",
"==",
"AccessibilityEvent",
".",
"TYPE_WINDOW_STATE_CHANGED",
")",
"{",
"// Clear the event's cur... | Announce the currently-selected date when launched. | [
"Announce",
"the",
"currently",
"-",
"selected",
"date",
"when",
"launched",
"."
] | 0a8fe28f19db4f5a5a6cfc525a852416232873a8 | https://github.com/wdullaer/MaterialDateTimePicker/blob/0a8fe28f19db4f5a5a6cfc525a852416232873a8/library/src/main/java/com/wdullaer/materialdatetimepicker/date/AccessibleDateAnimator.java#L39-L52 |
59,414 | wdullaer/MaterialDateTimePicker | library/src/main/java/com/wdullaer/materialdatetimepicker/time/AmPmCirclesView.java | AmPmCirclesView.getIsTouchingAmOrPm | public int getIsTouchingAmOrPm(float xCoord, float yCoord) {
if (!mDrawValuesReady) {
return -1;
}
int squaredYDistance = (int) ((yCoord - mAmPmYCenter)*(yCoord - mAmPmYCenter));
int distanceToAmCenter =
(int) Math.sqrt((xCoord - mAmXCenter)*(xCoord - mAmXCe... | java | public int getIsTouchingAmOrPm(float xCoord, float yCoord) {
if (!mDrawValuesReady) {
return -1;
}
int squaredYDistance = (int) ((yCoord - mAmPmYCenter)*(yCoord - mAmPmYCenter));
int distanceToAmCenter =
(int) Math.sqrt((xCoord - mAmXCenter)*(xCoord - mAmXCe... | [
"public",
"int",
"getIsTouchingAmOrPm",
"(",
"float",
"xCoord",
",",
"float",
"yCoord",
")",
"{",
"if",
"(",
"!",
"mDrawValuesReady",
")",
"{",
"return",
"-",
"1",
";",
"}",
"int",
"squaredYDistance",
"=",
"(",
"int",
")",
"(",
"(",
"yCoord",
"-",
"mAm... | Calculate whether the coordinates are touching the AM or PM circle. | [
"Calculate",
"whether",
"the",
"coordinates",
"are",
"touching",
"the",
"AM",
"or",
"PM",
"circle",
"."
] | 0a8fe28f19db4f5a5a6cfc525a852416232873a8 | https://github.com/wdullaer/MaterialDateTimePicker/blob/0a8fe28f19db4f5a5a6cfc525a852416232873a8/library/src/main/java/com/wdullaer/materialdatetimepicker/time/AmPmCirclesView.java#L135-L156 |
59,415 | spotbugs/spotbugs | spotbugs-ant/src/main/java/edu/umd/cs/findbugs/anttask/FindBugsTask.java | FindBugsTask.setExcludeFilter | public void setExcludeFilter(File filterFile) {
if (filterFile != null && filterFile.length() > 0) {
excludeFile = filterFile;
} else {
if (filterFile != null) {
log("Warning: exclude filter file " + filterFile
+ (filterFile.exists() ? " is... | java | public void setExcludeFilter(File filterFile) {
if (filterFile != null && filterFile.length() > 0) {
excludeFile = filterFile;
} else {
if (filterFile != null) {
log("Warning: exclude filter file " + filterFile
+ (filterFile.exists() ? " is... | [
"public",
"void",
"setExcludeFilter",
"(",
"File",
"filterFile",
")",
"{",
"if",
"(",
"filterFile",
"!=",
"null",
"&&",
"filterFile",
".",
"length",
"(",
")",
">",
"0",
")",
"{",
"excludeFile",
"=",
"filterFile",
";",
"}",
"else",
"{",
"if",
"(",
"filt... | Set the exclude filter file
@param filterFile
exclude filter file | [
"Set",
"the",
"exclude",
"filter",
"file"
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs-ant/src/main/java/edu/umd/cs/findbugs/anttask/FindBugsTask.java#L421-L431 |
59,416 | spotbugs/spotbugs | spotbugs-ant/src/main/java/edu/umd/cs/findbugs/anttask/FindBugsTask.java | FindBugsTask.setIncludeFilter | public void setIncludeFilter(File filterFile) {
if (filterFile != null && filterFile.length() > 0) {
includeFile = filterFile;
} else {
if (filterFile != null) {
log("Warning: include filter file " + filterFile
+ (filterFile.exists() ? " is... | java | public void setIncludeFilter(File filterFile) {
if (filterFile != null && filterFile.length() > 0) {
includeFile = filterFile;
} else {
if (filterFile != null) {
log("Warning: include filter file " + filterFile
+ (filterFile.exists() ? " is... | [
"public",
"void",
"setIncludeFilter",
"(",
"File",
"filterFile",
")",
"{",
"if",
"(",
"filterFile",
"!=",
"null",
"&&",
"filterFile",
".",
"length",
"(",
")",
">",
"0",
")",
"{",
"includeFile",
"=",
"filterFile",
";",
"}",
"else",
"{",
"if",
"(",
"filt... | Set the include filter file
@param filterFile
include filter file | [
"Set",
"the",
"include",
"filter",
"file"
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs-ant/src/main/java/edu/umd/cs/findbugs/anttask/FindBugsTask.java#L439-L449 |
59,417 | spotbugs/spotbugs | spotbugs-ant/src/main/java/edu/umd/cs/findbugs/anttask/FindBugsTask.java | FindBugsTask.setBaselineBugs | public void setBaselineBugs(File baselineBugs) {
if (baselineBugs != null && baselineBugs.length() > 0) {
this.baselineBugs = baselineBugs;
} else {
if (baselineBugs != null) {
log("Warning: baseline bugs file " + baselineBugs
+ (baselineBu... | java | public void setBaselineBugs(File baselineBugs) {
if (baselineBugs != null && baselineBugs.length() > 0) {
this.baselineBugs = baselineBugs;
} else {
if (baselineBugs != null) {
log("Warning: baseline bugs file " + baselineBugs
+ (baselineBu... | [
"public",
"void",
"setBaselineBugs",
"(",
"File",
"baselineBugs",
")",
"{",
"if",
"(",
"baselineBugs",
"!=",
"null",
"&&",
"baselineBugs",
".",
"length",
"(",
")",
">",
"0",
")",
"{",
"this",
".",
"baselineBugs",
"=",
"baselineBugs",
";",
"}",
"else",
"{... | Set the baseline bugs file
@param baselineBugs
baseline bugs file | [
"Set",
"the",
"baseline",
"bugs",
"file"
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs-ant/src/main/java/edu/umd/cs/findbugs/anttask/FindBugsTask.java#L457-L467 |
59,418 | spotbugs/spotbugs | spotbugs-ant/src/main/java/edu/umd/cs/findbugs/anttask/FindBugsTask.java | FindBugsTask.setAuxClasspath | public void setAuxClasspath(Path src) {
boolean nonEmpty = false;
String[] elementList = src.list();
for (String anElementList : elementList) {
if (!"".equals(anElementList)) {
nonEmpty = true;
break;
}
}
if (nonEmpty) {
... | java | public void setAuxClasspath(Path src) {
boolean nonEmpty = false;
String[] elementList = src.list();
for (String anElementList : elementList) {
if (!"".equals(anElementList)) {
nonEmpty = true;
break;
}
}
if (nonEmpty) {
... | [
"public",
"void",
"setAuxClasspath",
"(",
"Path",
"src",
")",
"{",
"boolean",
"nonEmpty",
"=",
"false",
";",
"String",
"[",
"]",
"elementList",
"=",
"src",
".",
"list",
"(",
")",
";",
"for",
"(",
"String",
"anElementList",
":",
"elementList",
")",
"{",
... | the auxclasspath to use.
@param src
auxclasspath to use | [
"the",
"auxclasspath",
"to",
"use",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs-ant/src/main/java/edu/umd/cs/findbugs/anttask/FindBugsTask.java#L495-L513 |
59,419 | spotbugs/spotbugs | spotbugs-ant/src/main/java/edu/umd/cs/findbugs/anttask/FindBugsTask.java | FindBugsTask.setAuxClasspathRef | public void setAuxClasspathRef(Reference r) {
Path path = createAuxClasspath();
path.setRefid(r);
path.toString(); // Evaluated for its side-effects (throwing a
// BuildException)
} | java | public void setAuxClasspathRef(Reference r) {
Path path = createAuxClasspath();
path.setRefid(r);
path.toString(); // Evaluated for its side-effects (throwing a
// BuildException)
} | [
"public",
"void",
"setAuxClasspathRef",
"(",
"Reference",
"r",
")",
"{",
"Path",
"path",
"=",
"createAuxClasspath",
"(",
")",
";",
"path",
".",
"setRefid",
"(",
"r",
")",
";",
"path",
".",
"toString",
"(",
")",
";",
"// Evaluated for its side-effects (throwing... | Adds a reference to a sourcepath defined elsewhere.
@param r
reference to a sourcepath defined elsewhere | [
"Adds",
"a",
"reference",
"to",
"a",
"sourcepath",
"defined",
"elsewhere",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs-ant/src/main/java/edu/umd/cs/findbugs/anttask/FindBugsTask.java#L533-L538 |
59,420 | spotbugs/spotbugs | spotbugs-ant/src/main/java/edu/umd/cs/findbugs/anttask/FindBugsTask.java | FindBugsTask.setAuxAnalyzepath | public void setAuxAnalyzepath(Path src) {
boolean nonEmpty = false;
String[] elementList = src.list();
for (String anElementList : elementList) {
if (!"".equals(anElementList)) {
nonEmpty = true;
break;
}
}
if (nonEmpty) {... | java | public void setAuxAnalyzepath(Path src) {
boolean nonEmpty = false;
String[] elementList = src.list();
for (String anElementList : elementList) {
if (!"".equals(anElementList)) {
nonEmpty = true;
break;
}
}
if (nonEmpty) {... | [
"public",
"void",
"setAuxAnalyzepath",
"(",
"Path",
"src",
")",
"{",
"boolean",
"nonEmpty",
"=",
"false",
";",
"String",
"[",
"]",
"elementList",
"=",
"src",
".",
"list",
"(",
")",
";",
"for",
"(",
"String",
"anElementList",
":",
"elementList",
")",
"{",... | the auxAnalyzepath to use.
@param src
auxAnalyzepath | [
"the",
"auxAnalyzepath",
"to",
"use",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs-ant/src/main/java/edu/umd/cs/findbugs/anttask/FindBugsTask.java#L546-L564 |
59,421 | spotbugs/spotbugs | spotbugs-ant/src/main/java/edu/umd/cs/findbugs/anttask/FindBugsTask.java | FindBugsTask.setSourcePath | public void setSourcePath(Path src) {
if (sourcePath == null) {
sourcePath = src;
} else {
sourcePath.append(src);
}
} | java | public void setSourcePath(Path src) {
if (sourcePath == null) {
sourcePath = src;
} else {
sourcePath.append(src);
}
} | [
"public",
"void",
"setSourcePath",
"(",
"Path",
"src",
")",
"{",
"if",
"(",
"sourcePath",
"==",
"null",
")",
"{",
"sourcePath",
"=",
"src",
";",
"}",
"else",
"{",
"sourcePath",
".",
"append",
"(",
"src",
")",
";",
"}",
"}"
] | the sourcepath to use.
@param src
sourcepath | [
"the",
"sourcepath",
"to",
"use",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs-ant/src/main/java/edu/umd/cs/findbugs/anttask/FindBugsTask.java#L594-L600 |
59,422 | spotbugs/spotbugs | spotbugs-ant/src/main/java/edu/umd/cs/findbugs/anttask/FindBugsTask.java | FindBugsTask.setExcludePath | public void setExcludePath(Path src) {
if (excludePath == null) {
excludePath = src;
} else {
excludePath.append(src);
}
} | java | public void setExcludePath(Path src) {
if (excludePath == null) {
excludePath = src;
} else {
excludePath.append(src);
}
} | [
"public",
"void",
"setExcludePath",
"(",
"Path",
"src",
")",
"{",
"if",
"(",
"excludePath",
"==",
"null",
")",
"{",
"excludePath",
"=",
"src",
";",
"}",
"else",
"{",
"excludePath",
".",
"append",
"(",
"src",
")",
";",
"}",
"}"
] | the excludepath to use.
@param src
excludepath | [
"the",
"excludepath",
"to",
"use",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs-ant/src/main/java/edu/umd/cs/findbugs/anttask/FindBugsTask.java#L630-L636 |
59,423 | spotbugs/spotbugs | spotbugs-ant/src/main/java/edu/umd/cs/findbugs/anttask/FindBugsTask.java | FindBugsTask.setIncludePath | public void setIncludePath(Path src) {
if (includePath == null) {
includePath = src;
} else {
includePath.append(src);
}
} | java | public void setIncludePath(Path src) {
if (includePath == null) {
includePath = src;
} else {
includePath.append(src);
}
} | [
"public",
"void",
"setIncludePath",
"(",
"Path",
"src",
")",
"{",
"if",
"(",
"includePath",
"==",
"null",
")",
"{",
"includePath",
"=",
"src",
";",
"}",
"else",
"{",
"includePath",
".",
"append",
"(",
"src",
")",
";",
"}",
"}"
] | the includepath to use.
@param src
includepath | [
"the",
"includepath",
"to",
"use",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs-ant/src/main/java/edu/umd/cs/findbugs/anttask/FindBugsTask.java#L666-L672 |
59,424 | spotbugs/spotbugs | spotbugs-ant/src/main/java/edu/umd/cs/findbugs/anttask/FindBugsTask.java | FindBugsTask.checkParameters | @Override
protected void checkParameters() {
super.checkParameters();
if (projectFile == null && classLocations.size() == 0 && filesets.size() == 0 && dirsets.size() == 0 && auxAnalyzepath == null) {
throw new BuildException("either projectfile, <class/>, <fileset/> or <auxAnalyzepath/>... | java | @Override
protected void checkParameters() {
super.checkParameters();
if (projectFile == null && classLocations.size() == 0 && filesets.size() == 0 && dirsets.size() == 0 && auxAnalyzepath == null) {
throw new BuildException("either projectfile, <class/>, <fileset/> or <auxAnalyzepath/>... | [
"@",
"Override",
"protected",
"void",
"checkParameters",
"(",
")",
"{",
"super",
".",
"checkParameters",
"(",
")",
";",
"if",
"(",
"projectFile",
"==",
"null",
"&&",
"classLocations",
".",
"size",
"(",
")",
"==",
"0",
"&&",
"filesets",
".",
"size",
"(",
... | Check that all required attributes have been set | [
"Check",
"that",
"all",
"required",
"attributes",
"have",
"been",
"set"
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs-ant/src/main/java/edu/umd/cs/findbugs/anttask/FindBugsTask.java#L752-L787 |
59,425 | spotbugs/spotbugs | eclipsePlugin/src/de/tobject/findbugs/properties/DetectorProvider.java | DetectorProvider.isEclipsePluginDisabled | static boolean isEclipsePluginDisabled(String pluginId, Map<URI, Plugin> allPlugins) {
for (Plugin plugin : allPlugins.values()) {
if(pluginId.equals(plugin.getPluginId())) {
return false;
}
}
return true;
} | java | static boolean isEclipsePluginDisabled(String pluginId, Map<URI, Plugin> allPlugins) {
for (Plugin plugin : allPlugins.values()) {
if(pluginId.equals(plugin.getPluginId())) {
return false;
}
}
return true;
} | [
"static",
"boolean",
"isEclipsePluginDisabled",
"(",
"String",
"pluginId",
",",
"Map",
"<",
"URI",
",",
"Plugin",
">",
"allPlugins",
")",
"{",
"for",
"(",
"Plugin",
"plugin",
":",
"allPlugins",
".",
"values",
"(",
")",
")",
"{",
"if",
"(",
"pluginId",
".... | Eclipse plugin can be disabled ONLY by user, so it must NOT be in the
list of loaded plugins | [
"Eclipse",
"plugin",
"can",
"be",
"disabled",
"ONLY",
"by",
"user",
"so",
"it",
"must",
"NOT",
"be",
"in",
"the",
"list",
"of",
"loaded",
"plugins"
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/properties/DetectorProvider.java#L135-L142 |
59,426 | spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/DataflowCFGPrinter.java | DataflowCFGPrinter.printCFG | public static <Fact, AnalysisType extends BasicAbstractDataflowAnalysis<Fact>> void printCFG(
Dataflow<Fact, AnalysisType> dataflow, PrintStream out) {
DataflowCFGPrinter<Fact, AnalysisType> printer = new DataflowCFGPrinter<>(dataflow);
printer.print(out);
} | java | public static <Fact, AnalysisType extends BasicAbstractDataflowAnalysis<Fact>> void printCFG(
Dataflow<Fact, AnalysisType> dataflow, PrintStream out) {
DataflowCFGPrinter<Fact, AnalysisType> printer = new DataflowCFGPrinter<>(dataflow);
printer.print(out);
} | [
"public",
"static",
"<",
"Fact",
",",
"AnalysisType",
"extends",
"BasicAbstractDataflowAnalysis",
"<",
"Fact",
">",
">",
"void",
"printCFG",
"(",
"Dataflow",
"<",
"Fact",
",",
"AnalysisType",
">",
"dataflow",
",",
"PrintStream",
"out",
")",
"{",
"DataflowCFGPrin... | Print CFG annotated with results from given dataflow analysis.
@param <Fact>
Dataflow fact type
@param <AnalysisType>
Dataflow analysis type
@param dataflow
dataflow driver
@param out
PrintStream to use | [
"Print",
"CFG",
"annotated",
"with",
"results",
"from",
"given",
"dataflow",
"analysis",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/DataflowCFGPrinter.java#L107-L111 |
59,427 | spotbugs/spotbugs | eclipsePlugin/src/de/tobject/findbugs/classify/AccuracyClassificationPulldownAction.java | AccuracyClassificationPulldownAction.fillMenu | private void fillMenu() {
isBugItem = new MenuItem(menu, SWT.RADIO);
isBugItem.setText("Bug");
notBugItem = new MenuItem(menu, SWT.RADIO);
notBugItem.setText("Not Bug");
isBugItem.addSelectionListener(new SelectionAdapter() {
/*
* (non-Javadoc)
... | java | private void fillMenu() {
isBugItem = new MenuItem(menu, SWT.RADIO);
isBugItem.setText("Bug");
notBugItem = new MenuItem(menu, SWT.RADIO);
notBugItem.setText("Not Bug");
isBugItem.addSelectionListener(new SelectionAdapter() {
/*
* (non-Javadoc)
... | [
"private",
"void",
"fillMenu",
"(",
")",
"{",
"isBugItem",
"=",
"new",
"MenuItem",
"(",
"menu",
",",
"SWT",
".",
"RADIO",
")",
";",
"isBugItem",
".",
"setText",
"(",
"\"Bug\"",
")",
";",
"notBugItem",
"=",
"new",
"MenuItem",
"(",
"menu",
",",
"SWT",
... | Fill the classification menu. | [
"Fill",
"the",
"classification",
"menu",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/classify/AccuracyClassificationPulldownAction.java#L98-L147 |
59,428 | spotbugs/spotbugs | eclipsePlugin/src/de/tobject/findbugs/classify/AccuracyClassificationPulldownAction.java | AccuracyClassificationPulldownAction.syncMenu | private void syncMenu() {
if (bugInstance != null) {
isBugItem.setEnabled(true);
notBugItem.setEnabled(true);
BugProperty isBugProperty = bugInstance.lookupProperty(BugProperty.IS_BUG);
if (isBugProperty == null) {
// Unclassified
... | java | private void syncMenu() {
if (bugInstance != null) {
isBugItem.setEnabled(true);
notBugItem.setEnabled(true);
BugProperty isBugProperty = bugInstance.lookupProperty(BugProperty.IS_BUG);
if (isBugProperty == null) {
// Unclassified
... | [
"private",
"void",
"syncMenu",
"(",
")",
"{",
"if",
"(",
"bugInstance",
"!=",
"null",
")",
"{",
"isBugItem",
".",
"setEnabled",
"(",
"true",
")",
";",
"notBugItem",
".",
"setEnabled",
"(",
"true",
")",
";",
"BugProperty",
"isBugProperty",
"=",
"bugInstance... | Update menu to match currently selected BugInstance. | [
"Update",
"menu",
"to",
"match",
"currently",
"selected",
"BugInstance",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/classify/AccuracyClassificationPulldownAction.java#L257-L282 |
59,429 | spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/bcp/PatternMatcher.java | PatternMatcher.execute | public PatternMatcher execute() throws DataflowAnalysisException {
workList.addLast(cfg.getEntry());
while (!workList.isEmpty()) {
BasicBlock basicBlock = workList.removeLast();
visitedBlockMap.put(basicBlock, basicBlock);
// Scan instructions of basic block for pos... | java | public PatternMatcher execute() throws DataflowAnalysisException {
workList.addLast(cfg.getEntry());
while (!workList.isEmpty()) {
BasicBlock basicBlock = workList.removeLast();
visitedBlockMap.put(basicBlock, basicBlock);
// Scan instructions of basic block for pos... | [
"public",
"PatternMatcher",
"execute",
"(",
")",
"throws",
"DataflowAnalysisException",
"{",
"workList",
".",
"addLast",
"(",
"cfg",
".",
"getEntry",
"(",
")",
")",
";",
"while",
"(",
"!",
"workList",
".",
"isEmpty",
"(",
")",
")",
"{",
"BasicBlock",
"basi... | Search for examples of the ByteCodePattern.
@return this object
@throws DataflowAnalysisException
if the ValueNumberAnalysis did not produce useful values for
the method | [
"Search",
"for",
"examples",
"of",
"the",
"ByteCodePattern",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/bcp/PatternMatcher.java#L114-L140 |
59,430 | spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/bcp/PatternMatcher.java | PatternMatcher.attemptMatch | private void attemptMatch(BasicBlock basicBlock, BasicBlock.InstructionIterator instructionIterator)
throws DataflowAnalysisException {
work(new State(basicBlock, instructionIterator, pattern.getFirst()));
} | java | private void attemptMatch(BasicBlock basicBlock, BasicBlock.InstructionIterator instructionIterator)
throws DataflowAnalysisException {
work(new State(basicBlock, instructionIterator, pattern.getFirst()));
} | [
"private",
"void",
"attemptMatch",
"(",
"BasicBlock",
"basicBlock",
",",
"BasicBlock",
".",
"InstructionIterator",
"instructionIterator",
")",
"throws",
"DataflowAnalysisException",
"{",
"work",
"(",
"new",
"State",
"(",
"basicBlock",
",",
"instructionIterator",
",",
... | Attempt to begin a match.
@param basicBlock
the basic block
@param instructionIterator
the instruction iterator positioned just before the first
instruction to be matched | [
"Attempt",
"to",
"begin",
"a",
"match",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/bcp/PatternMatcher.java#L159-L162 |
59,431 | spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/generic/GenericUtilities.java | GenericUtilities.getString | public static final String getString(Type type) {
if (type instanceof GenericObjectType) {
return ((GenericObjectType) type).toString(true);
} else if (type instanceof ArrayType) {
return TypeCategory.asString((ArrayType) type);
} else {
return type.toString()... | java | public static final String getString(Type type) {
if (type instanceof GenericObjectType) {
return ((GenericObjectType) type).toString(true);
} else if (type instanceof ArrayType) {
return TypeCategory.asString((ArrayType) type);
} else {
return type.toString()... | [
"public",
"static",
"final",
"String",
"getString",
"(",
"Type",
"type",
")",
"{",
"if",
"(",
"type",
"instanceof",
"GenericObjectType",
")",
"{",
"return",
"(",
"(",
"GenericObjectType",
")",
"type",
")",
".",
"toString",
"(",
"true",
")",
";",
"}",
"el... | Get String representation of a Type including Generic information | [
"Get",
"String",
"representation",
"of",
"a",
"Type",
"including",
"Generic",
"information"
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/generic/GenericUtilities.java#L210-L218 |
59,432 | spotbugs/spotbugs | spotbugs/src/gui/main/edu/umd/cs/findbugs/gui2/MainFrameLoadSaveHelper.java | MainFrameLoadSaveHelper.askToSave | private boolean askToSave() {
if (mainFrame.isProjectChanged()) {
int response = JOptionPane.showConfirmDialog(mainFrame, L10N.getLocalString("dlg.save_current_changes",
"The current project has been changed, Save current changes?"), L10N.getLocalString("dlg.save_changes",
... | java | private boolean askToSave() {
if (mainFrame.isProjectChanged()) {
int response = JOptionPane.showConfirmDialog(mainFrame, L10N.getLocalString("dlg.save_current_changes",
"The current project has been changed, Save current changes?"), L10N.getLocalString("dlg.save_changes",
... | [
"private",
"boolean",
"askToSave",
"(",
")",
"{",
"if",
"(",
"mainFrame",
".",
"isProjectChanged",
"(",
")",
")",
"{",
"int",
"response",
"=",
"JOptionPane",
".",
"showConfirmDialog",
"(",
"mainFrame",
",",
"L10N",
".",
"getLocalString",
"(",
"\"dlg.save_curre... | Returns true if cancelled | [
"Returns",
"true",
"if",
"cancelled"
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/gui/main/edu/umd/cs/findbugs/gui2/MainFrameLoadSaveHelper.java#L161-L180 |
59,433 | spotbugs/spotbugs | spotbugs/src/gui/main/edu/umd/cs/findbugs/gui2/MainFrameLoadSaveHelper.java | MainFrameLoadSaveHelper.saveAnalysis | SaveReturn saveAnalysis(final File f) {
Future<Object> waiter = mainFrame.getBackgroundExecutor().submit(() -> {
BugSaver.saveBugs(f, mainFrame.getBugCollection(), mainFrame.getProject());
return null;
});
try {
waiter.get();
} catch (InterruptedExcep... | java | SaveReturn saveAnalysis(final File f) {
Future<Object> waiter = mainFrame.getBackgroundExecutor().submit(() -> {
BugSaver.saveBugs(f, mainFrame.getBugCollection(), mainFrame.getProject());
return null;
});
try {
waiter.get();
} catch (InterruptedExcep... | [
"SaveReturn",
"saveAnalysis",
"(",
"final",
"File",
"f",
")",
"{",
"Future",
"<",
"Object",
">",
"waiter",
"=",
"mainFrame",
".",
"getBackgroundExecutor",
"(",
")",
".",
"submit",
"(",
"(",
")",
"->",
"{",
"BugSaver",
".",
"saveBugs",
"(",
"f",
",",
"m... | Save current analysis as file passed in. Return SAVE_SUCCESSFUL if save
successful. Method doesn't do much. This method is more if need to do
other things in the future for saving analysis. And to keep saving naming
convention. | [
"Save",
"current",
"analysis",
"as",
"file",
"passed",
"in",
".",
"Return",
"SAVE_SUCCESSFUL",
"if",
"save",
"successful",
".",
"Method",
"doesn",
"t",
"do",
"much",
".",
"This",
"method",
"is",
"more",
"if",
"need",
"to",
"do",
"other",
"things",
"in",
... | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/gui/main/edu/umd/cs/findbugs/gui2/MainFrameLoadSaveHelper.java#L472-L489 |
59,434 | spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/URLClassPath.java | URLClassPath.getClassPath | public String getClassPath() {
StringBuilder buf = new StringBuilder();
for (Entry entry : entryList) {
if (buf.length() > 0) {
buf.append(File.pathSeparator);
}
buf.append(entry.getURL());
}
return buf.toString();
} | java | public String getClassPath() {
StringBuilder buf = new StringBuilder();
for (Entry entry : entryList) {
if (buf.length() > 0) {
buf.append(File.pathSeparator);
}
buf.append(entry.getURL());
}
return buf.toString();
} | [
"public",
"String",
"getClassPath",
"(",
")",
"{",
"StringBuilder",
"buf",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"Entry",
"entry",
":",
"entryList",
")",
"{",
"if",
"(",
"buf",
".",
"length",
"(",
")",
">",
"0",
")",
"{",
"buf",
"... | Return the classpath string.
@return the classpath string | [
"Return",
"the",
"classpath",
"string",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/URLClassPath.java#L342-L351 |
59,435 | spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/URLClassPath.java | URLClassPath.getInputStreamForResource | private InputStream getInputStreamForResource(String resourceName) {
// Try each classpath entry, in order, until we find one
// that has the resource. Catch and ignore IOExceptions.
// FIXME: The following code should throw IOException.
//
// URL.openStream() does not seem to ... | java | private InputStream getInputStreamForResource(String resourceName) {
// Try each classpath entry, in order, until we find one
// that has the resource. Catch and ignore IOExceptions.
// FIXME: The following code should throw IOException.
//
// URL.openStream() does not seem to ... | [
"private",
"InputStream",
"getInputStreamForResource",
"(",
"String",
"resourceName",
")",
"{",
"// Try each classpath entry, in order, until we find one",
"// that has the resource. Catch and ignore IOExceptions.",
"// FIXME: The following code should throw IOException.",
"//",
"// URL.open... | Open a stream to read given resource.
@param resourceName
name of resource to load, e.g. "java/lang/Object.class"
@return input stream to read resource, or null if resource could not be
found
@throws IOException
if an IO error occurs trying to determine whether or not the
resource exists | [
"Open",
"a",
"stream",
"to",
"read",
"given",
"resource",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/URLClassPath.java#L364-L399 |
59,436 | spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/URLClassPath.java | URLClassPath.lookupClass | public JavaClass lookupClass(String className) throws ClassNotFoundException {
if (classesThatCantBeFound.contains(className)) {
throw new ClassNotFoundException("Error while looking for class " + className + ": class not found");
}
String resourceName = className.replace('.', '/') +... | java | public JavaClass lookupClass(String className) throws ClassNotFoundException {
if (classesThatCantBeFound.contains(className)) {
throw new ClassNotFoundException("Error while looking for class " + className + ": class not found");
}
String resourceName = className.replace('.', '/') +... | [
"public",
"JavaClass",
"lookupClass",
"(",
"String",
"className",
")",
"throws",
"ClassNotFoundException",
"{",
"if",
"(",
"classesThatCantBeFound",
".",
"contains",
"(",
"className",
")",
")",
"{",
"throw",
"new",
"ClassNotFoundException",
"(",
"\"Error while looking... | Look up a class from the classpath.
@param className
name of class to look up
@return the JavaClass object for the class
@throws ClassNotFoundException
if the class couldn't be found | [
"Look",
"up",
"a",
"class",
"from",
"the",
"classpath",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/URLClassPath.java#L412-L445 |
59,437 | spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/URLClassPath.java | URLClassPath.getURLProtocol | public static String getURLProtocol(String urlString) {
String protocol = null;
int firstColon = urlString.indexOf(':');
if (firstColon >= 0) {
String specifiedProtocol = urlString.substring(0, firstColon);
if (FindBugs.knownURLProtocolSet.contains(specifiedProtocol)) {
... | java | public static String getURLProtocol(String urlString) {
String protocol = null;
int firstColon = urlString.indexOf(':');
if (firstColon >= 0) {
String specifiedProtocol = urlString.substring(0, firstColon);
if (FindBugs.knownURLProtocolSet.contains(specifiedProtocol)) {
... | [
"public",
"static",
"String",
"getURLProtocol",
"(",
"String",
"urlString",
")",
"{",
"String",
"protocol",
"=",
"null",
";",
"int",
"firstColon",
"=",
"urlString",
".",
"indexOf",
"(",
"'",
"'",
")",
";",
"if",
"(",
"firstColon",
">=",
"0",
")",
"{",
... | Get the URL protocol of given URL string.
@param urlString
the URL string
@return the protocol name ("http", "file", etc.), or null if there is no
protocol | [
"Get",
"the",
"URL",
"protocol",
"of",
"given",
"URL",
"string",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/URLClassPath.java#L466-L476 |
59,438 | spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/URLClassPath.java | URLClassPath.getFileExtension | public static String getFileExtension(String fileName) {
int lastDot = fileName.lastIndexOf('.');
return (lastDot >= 0) ? fileName.substring(lastDot) : null;
} | java | public static String getFileExtension(String fileName) {
int lastDot = fileName.lastIndexOf('.');
return (lastDot >= 0) ? fileName.substring(lastDot) : null;
} | [
"public",
"static",
"String",
"getFileExtension",
"(",
"String",
"fileName",
")",
"{",
"int",
"lastDot",
"=",
"fileName",
".",
"lastIndexOf",
"(",
"'",
"'",
")",
";",
"return",
"(",
"lastDot",
">=",
"0",
")",
"?",
"fileName",
".",
"substring",
"(",
"last... | Get the file extension of given fileName.
@return the file extension, or null if there is no file extension | [
"Get",
"the",
"file",
"extension",
"of",
"given",
"fileName",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/URLClassPath.java#L483-L486 |
59,439 | spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/vna/ValueNumberFrame.java | ValueNumberFrame.killLoadsOfField | public void killLoadsOfField(XField field) {
if (!REDUNDANT_LOAD_ELIMINATION) {
return;
}
HashSet<AvailableLoad> killMe = new HashSet<>();
for (AvailableLoad availableLoad : getAvailableLoadMap().keySet()) {
if (availableLoad.getField().equals(field)) {
... | java | public void killLoadsOfField(XField field) {
if (!REDUNDANT_LOAD_ELIMINATION) {
return;
}
HashSet<AvailableLoad> killMe = new HashSet<>();
for (AvailableLoad availableLoad : getAvailableLoadMap().keySet()) {
if (availableLoad.getField().equals(field)) {
... | [
"public",
"void",
"killLoadsOfField",
"(",
"XField",
"field",
")",
"{",
"if",
"(",
"!",
"REDUNDANT_LOAD_ELIMINATION",
")",
"{",
"return",
";",
"}",
"HashSet",
"<",
"AvailableLoad",
">",
"killMe",
"=",
"new",
"HashSet",
"<>",
"(",
")",
";",
"for",
"(",
"A... | Kill all loads of given field.
@param field
the field | [
"Kill",
"all",
"loads",
"of",
"given",
"field",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/vna/ValueNumberFrame.java#L175-L189 |
59,440 | spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/xml/MetaCharacterMap.java | MetaCharacterMap.addMeta | public void addMeta(char meta, String replacement) {
metaCharacterSet.set(meta);
replacementMap.put(new String(new char[] { meta }), replacement);
} | java | public void addMeta(char meta, String replacement) {
metaCharacterSet.set(meta);
replacementMap.put(new String(new char[] { meta }), replacement);
} | [
"public",
"void",
"addMeta",
"(",
"char",
"meta",
",",
"String",
"replacement",
")",
"{",
"metaCharacterSet",
".",
"set",
"(",
"meta",
")",
";",
"replacementMap",
".",
"put",
"(",
"new",
"String",
"(",
"new",
"char",
"[",
"]",
"{",
"meta",
"}",
")",
... | Add a metacharacter and its replacement.
@param meta
the metacharacter
@param replacement
the String to replace the metacharacter with | [
"Add",
"a",
"metacharacter",
"and",
"its",
"replacement",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/xml/MetaCharacterMap.java#L53-L56 |
59,441 | spotbugs/spotbugs | eclipsePlugin/src/de/tobject/findbugs/FindbugsPlugin.java | FindbugsPlugin.getResourceString | public static String getResourceString(String key) {
ResourceBundle bundle = FindbugsPlugin.getDefault().getResourceBundle();
try {
return bundle.getString(key);
} catch (MissingResourceException e) {
return key;
}
} | java | public static String getResourceString(String key) {
ResourceBundle bundle = FindbugsPlugin.getDefault().getResourceBundle();
try {
return bundle.getString(key);
} catch (MissingResourceException e) {
return key;
}
} | [
"public",
"static",
"String",
"getResourceString",
"(",
"String",
"key",
")",
"{",
"ResourceBundle",
"bundle",
"=",
"FindbugsPlugin",
".",
"getDefault",
"(",
")",
".",
"getResourceBundle",
"(",
")",
";",
"try",
"{",
"return",
"bundle",
".",
"getString",
"(",
... | Returns the string from the plugin's resource bundle, or 'key' if not
found. | [
"Returns",
"the",
"string",
"from",
"the",
"plugin",
"s",
"resource",
"bundle",
"or",
"key",
"if",
"not",
"found",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/FindbugsPlugin.java#L456-L463 |
59,442 | spotbugs/spotbugs | eclipsePlugin/src/de/tobject/findbugs/FindbugsPlugin.java | FindbugsPlugin.getFindBugsEnginePluginLocation | public static String getFindBugsEnginePluginLocation() {
// findbugs.home should be set to the directory the plugin is
// installed in.
URL u = plugin.getBundle().getEntry("/");
try {
URL bundleRoot = FileLocator.resolve(u);
String path = bundleRoot.getPath();
... | java | public static String getFindBugsEnginePluginLocation() {
// findbugs.home should be set to the directory the plugin is
// installed in.
URL u = plugin.getBundle().getEntry("/");
try {
URL bundleRoot = FileLocator.resolve(u);
String path = bundleRoot.getPath();
... | [
"public",
"static",
"String",
"getFindBugsEnginePluginLocation",
"(",
")",
"{",
"// findbugs.home should be set to the directory the plugin is",
"// installed in.",
"URL",
"u",
"=",
"plugin",
".",
"getBundle",
"(",
")",
".",
"getEntry",
"(",
"\"/\"",
")",
";",
"try",
... | Find the filesystem path of the FindBugs plugin directory.
@return the filesystem path of the FindBugs plugin directory, or null if
the FindBugs plugin directory cannot be found | [
"Find",
"the",
"filesystem",
"path",
"of",
"the",
"FindBugs",
"plugin",
"directory",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/FindbugsPlugin.java#L508-L530 |
59,443 | spotbugs/spotbugs | eclipsePlugin/src/de/tobject/findbugs/FindbugsPlugin.java | FindbugsPlugin.logException | public void logException(Throwable e, String message) {
logMessage(IStatus.ERROR, message, e);
} | java | public void logException(Throwable e, String message) {
logMessage(IStatus.ERROR, message, e);
} | [
"public",
"void",
"logException",
"(",
"Throwable",
"e",
",",
"String",
"message",
")",
"{",
"logMessage",
"(",
"IStatus",
".",
"ERROR",
",",
"message",
",",
"e",
")",
";",
"}"
] | Log an exception.
@param e
the exception
@param message
message describing how/why the exception occurred | [
"Log",
"an",
"exception",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/FindbugsPlugin.java#L548-L550 |
59,444 | spotbugs/spotbugs | eclipsePlugin/src/de/tobject/findbugs/FindbugsPlugin.java | FindbugsPlugin.getBugCollectionFile | public static IPath getBugCollectionFile(IProject project) {
// IPath path = project.getWorkingLocation(PLUGIN_ID); //
// project-specific but not user-specific?
IPath path = getDefault().getStateLocation(); // user-specific but not
// project-specific
return path.append(project.... | java | public static IPath getBugCollectionFile(IProject project) {
// IPath path = project.getWorkingLocation(PLUGIN_ID); //
// project-specific but not user-specific?
IPath path = getDefault().getStateLocation(); // user-specific but not
// project-specific
return path.append(project.... | [
"public",
"static",
"IPath",
"getBugCollectionFile",
"(",
"IProject",
"project",
")",
"{",
"// IPath path = project.getWorkingLocation(PLUGIN_ID); //",
"// project-specific but not user-specific?",
"IPath",
"path",
"=",
"getDefault",
"(",
")",
".",
"getStateLocation",
"(",
")... | Get the file resource used to store findbugs warnings for a project.
@param project
the project
@return the IPath to the file (which may not actually exist in the
filesystem yet) | [
"Get",
"the",
"file",
"resource",
"used",
"to",
"store",
"findbugs",
"warnings",
"for",
"a",
"project",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/FindbugsPlugin.java#L610-L616 |
59,445 | spotbugs/spotbugs | eclipsePlugin/src/de/tobject/findbugs/FindbugsPlugin.java | FindbugsPlugin.getBugCollection | public static SortedBugCollection getBugCollection(IProject project, IProgressMonitor monitor)
throws CoreException {
SortedBugCollection bugCollection = (SortedBugCollection) project.getSessionProperty(SESSION_PROPERTY_BUG_COLLECTION);
if (bugCollection == null) {
try {
... | java | public static SortedBugCollection getBugCollection(IProject project, IProgressMonitor monitor)
throws CoreException {
SortedBugCollection bugCollection = (SortedBugCollection) project.getSessionProperty(SESSION_PROPERTY_BUG_COLLECTION);
if (bugCollection == null) {
try {
... | [
"public",
"static",
"SortedBugCollection",
"getBugCollection",
"(",
"IProject",
"project",
",",
"IProgressMonitor",
"monitor",
")",
"throws",
"CoreException",
"{",
"SortedBugCollection",
"bugCollection",
"=",
"(",
"SortedBugCollection",
")",
"project",
".",
"getSessionPro... | Get the stored BugCollection for project. If there is no stored bug
collection for the project, or if an error occurs reading the stored bug
collection, a default empty collection is created and returned.
@param project
the eclipse project
@param monitor
a progress monitor
@return the stored BugCollection, never null
... | [
"Get",
"the",
"stored",
"BugCollection",
"for",
"project",
".",
"If",
"there",
"is",
"no",
"stored",
"bug",
"collection",
"for",
"the",
"project",
"or",
"if",
"an",
"error",
"occurs",
"reading",
"the",
"stored",
"bug",
"collection",
"a",
"default",
"empty",
... | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/FindbugsPlugin.java#L653-L669 |
59,446 | spotbugs/spotbugs | eclipsePlugin/src/de/tobject/findbugs/FindbugsPlugin.java | FindbugsPlugin.readBugCollectionAndProject | private static void readBugCollectionAndProject(IProject project, IProgressMonitor monitor)
throws IOException, DocumentException, CoreException {
SortedBugCollection bugCollection;
IPath bugCollectionPath = getBugCollectionFile(project);
// Don't turn the path to an IFile because i... | java | private static void readBugCollectionAndProject(IProject project, IProgressMonitor monitor)
throws IOException, DocumentException, CoreException {
SortedBugCollection bugCollection;
IPath bugCollectionPath = getBugCollectionFile(project);
// Don't turn the path to an IFile because i... | [
"private",
"static",
"void",
"readBugCollectionAndProject",
"(",
"IProject",
"project",
",",
"IProgressMonitor",
"monitor",
")",
"throws",
"IOException",
",",
"DocumentException",
",",
"CoreException",
"{",
"SortedBugCollection",
"bugCollection",
";",
"IPath",
"bugCollect... | Read saved bug collection and findbugs project from file. Will populate
the bug collection and findbugs project session properties if successful.
If there is no saved bug collection and project for the eclipse project,
then FileNotFoundException will be thrown.
@param project
the eclipse project
@param monitor
a progr... | [
"Read",
"saved",
"bug",
"collection",
"and",
"findbugs",
"project",
"from",
"file",
".",
"Will",
"populate",
"the",
"bug",
"collection",
"and",
"findbugs",
"project",
"session",
"properties",
"if",
"successful",
".",
"If",
"there",
"is",
"no",
"saved",
"bug",
... | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/FindbugsPlugin.java#L703-L729 |
59,447 | spotbugs/spotbugs | eclipsePlugin/src/de/tobject/findbugs/FindbugsPlugin.java | FindbugsPlugin.storeBugCollection | public static void storeBugCollection(IProject project, final SortedBugCollection bugCollection, IProgressMonitor monitor)
throws IOException, CoreException {
// Store the bug collection and findbugs project in the session
project.setSessionProperty(SESSION_PROPERTY_BUG_COLLECTION, bugColle... | java | public static void storeBugCollection(IProject project, final SortedBugCollection bugCollection, IProgressMonitor monitor)
throws IOException, CoreException {
// Store the bug collection and findbugs project in the session
project.setSessionProperty(SESSION_PROPERTY_BUG_COLLECTION, bugColle... | [
"public",
"static",
"void",
"storeBugCollection",
"(",
"IProject",
"project",
",",
"final",
"SortedBugCollection",
"bugCollection",
",",
"IProgressMonitor",
"monitor",
")",
"throws",
"IOException",
",",
"CoreException",
"{",
"// Store the bug collection and findbugs project i... | Store a new bug collection for a project. The collection is stored in the
session, and also in a file in the project.
@param project
the project
@param bugCollection
the bug collection
@param monitor
progress monitor
@throws IOException
@throws CoreException | [
"Store",
"a",
"new",
"bug",
"collection",
"for",
"a",
"project",
".",
"The",
"collection",
"is",
"stored",
"in",
"the",
"session",
"and",
"also",
"in",
"a",
"file",
"in",
"the",
"project",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/FindbugsPlugin.java#L744-L753 |
59,448 | spotbugs/spotbugs | eclipsePlugin/src/de/tobject/findbugs/FindbugsPlugin.java | FindbugsPlugin.saveCurrentBugCollection | public static void saveCurrentBugCollection(IProject project, IProgressMonitor monitor) throws CoreException {
if (isBugCollectionDirty(project)) {
SortedBugCollection bugCollection = (SortedBugCollection) project.getSessionProperty(SESSION_PROPERTY_BUG_COLLECTION);
if (bugCollection !=... | java | public static void saveCurrentBugCollection(IProject project, IProgressMonitor monitor) throws CoreException {
if (isBugCollectionDirty(project)) {
SortedBugCollection bugCollection = (SortedBugCollection) project.getSessionProperty(SESSION_PROPERTY_BUG_COLLECTION);
if (bugCollection !=... | [
"public",
"static",
"void",
"saveCurrentBugCollection",
"(",
"IProject",
"project",
",",
"IProgressMonitor",
"monitor",
")",
"throws",
"CoreException",
"{",
"if",
"(",
"isBugCollectionDirty",
"(",
"project",
")",
")",
"{",
"SortedBugCollection",
"bugCollection",
"=",
... | If necessary, save current bug collection for project to disk.
@param project
the project
@param monitor
a progress monitor
@throws CoreException | [
"If",
"necessary",
"save",
"current",
"bug",
"collection",
"for",
"project",
"to",
"disk",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/FindbugsPlugin.java#L764-L772 |
59,449 | spotbugs/spotbugs | eclipsePlugin/src/de/tobject/findbugs/FindbugsPlugin.java | FindbugsPlugin.getProjectPreferences | public static UserPreferences getProjectPreferences(IProject project, boolean forceRead) {
try {
UserPreferences prefs = (UserPreferences) project.getSessionProperty(SESSION_PROPERTY_USERPREFS);
if (prefs == null || forceRead) {
prefs = readUserPreferences(project);
... | java | public static UserPreferences getProjectPreferences(IProject project, boolean forceRead) {
try {
UserPreferences prefs = (UserPreferences) project.getSessionProperty(SESSION_PROPERTY_USERPREFS);
if (prefs == null || forceRead) {
prefs = readUserPreferences(project);
... | [
"public",
"static",
"UserPreferences",
"getProjectPreferences",
"(",
"IProject",
"project",
",",
"boolean",
"forceRead",
")",
"{",
"try",
"{",
"UserPreferences",
"prefs",
"=",
"(",
"UserPreferences",
")",
"project",
".",
"getSessionProperty",
"(",
"SESSION_PROPERTY_US... | Get project own preferences set.
@param project
must be non null, exist and be opened
@param forceRead
@return current project preferences, independently if project preferences
are enabled or disabled for given project. | [
"Get",
"project",
"own",
"preferences",
"set",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/FindbugsPlugin.java#L907-L922 |
59,450 | spotbugs/spotbugs | eclipsePlugin/src/de/tobject/findbugs/FindbugsPlugin.java | FindbugsPlugin.saveUserPreferences | public static void saveUserPreferences(IProject project, final UserPreferences userPrefs) throws CoreException {
FileOutput userPrefsOutput = new FileOutput() {
@Override
public void writeFile(OutputStream os) throws IOException {
userPrefs.write(os);
}
... | java | public static void saveUserPreferences(IProject project, final UserPreferences userPrefs) throws CoreException {
FileOutput userPrefsOutput = new FileOutput() {
@Override
public void writeFile(OutputStream os) throws IOException {
userPrefs.write(os);
}
... | [
"public",
"static",
"void",
"saveUserPreferences",
"(",
"IProject",
"project",
",",
"final",
"UserPreferences",
"userPrefs",
")",
"throws",
"CoreException",
"{",
"FileOutput",
"userPrefsOutput",
"=",
"new",
"FileOutput",
"(",
")",
"{",
"@",
"Override",
"public",
"... | Save current UserPreferences for given project or workspace.
@param project
the project or null for workspace
@throws CoreException | [
"Save",
"current",
"UserPreferences",
"for",
"given",
"project",
"or",
"workspace",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/FindbugsPlugin.java#L960-L1020 |
59,451 | spotbugs/spotbugs | eclipsePlugin/src/de/tobject/findbugs/FindbugsPlugin.java | FindbugsPlugin.resetStore | private static void resetStore(IPreferenceStore store, String prefix) {
int start = 0;
// 99 is paranoia.
while(start < 99){
String name = prefix + start;
if(store.contains(name)){
store.setToDefault(name);
} else {
break;
... | java | private static void resetStore(IPreferenceStore store, String prefix) {
int start = 0;
// 99 is paranoia.
while(start < 99){
String name = prefix + start;
if(store.contains(name)){
store.setToDefault(name);
} else {
break;
... | [
"private",
"static",
"void",
"resetStore",
"(",
"IPreferenceStore",
"store",
",",
"String",
"prefix",
")",
"{",
"int",
"start",
"=",
"0",
";",
"// 99 is paranoia.",
"while",
"(",
"start",
"<",
"99",
")",
"{",
"String",
"name",
"=",
"prefix",
"+",
"start",
... | Removes all consequent enumerated keys from given store staring with given prefix | [
"Removes",
"all",
"consequent",
"enumerated",
"keys",
"from",
"given",
"store",
"staring",
"with",
"given",
"prefix"
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/FindbugsPlugin.java#L1025-L1037 |
59,452 | spotbugs/spotbugs | eclipsePlugin/src/de/tobject/findbugs/FindbugsPlugin.java | FindbugsPlugin.ensureReadWrite | private static void ensureReadWrite(IFile file) throws CoreException {
/*
* fix for bug 1683264: we should checkout file before writing to it
*/
if (file.isReadOnly()) {
IStatus checkOutStatus = ResourcesPlugin.getWorkspace().validateEdit(new IFile[] { file }, null);
... | java | private static void ensureReadWrite(IFile file) throws CoreException {
/*
* fix for bug 1683264: we should checkout file before writing to it
*/
if (file.isReadOnly()) {
IStatus checkOutStatus = ResourcesPlugin.getWorkspace().validateEdit(new IFile[] { file }, null);
... | [
"private",
"static",
"void",
"ensureReadWrite",
"(",
"IFile",
"file",
")",
"throws",
"CoreException",
"{",
"/*\n * fix for bug 1683264: we should checkout file before writing to it\n */",
"if",
"(",
"file",
".",
"isReadOnly",
"(",
")",
")",
"{",
"IStatus",
... | Ensure that a file is writable. If not currently writable, check it as so
that we can edit it.
@param file
- file that should be made writable
@throws CoreException | [
"Ensure",
"that",
"a",
"file",
"is",
"writable",
".",
"If",
"not",
"currently",
"writable",
"check",
"it",
"as",
"so",
"that",
"we",
"can",
"edit",
"it",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/FindbugsPlugin.java#L1047-L1057 |
59,453 | spotbugs/spotbugs | eclipsePlugin/src/de/tobject/findbugs/FindbugsPlugin.java | FindbugsPlugin.readUserPreferences | private static UserPreferences readUserPreferences(IProject project) throws CoreException {
IFile userPrefsFile = getUserPreferencesFile(project);
if (!userPrefsFile.exists()) {
return null;
}
try {
// force is preventing us for out-of-sync exception if file was
... | java | private static UserPreferences readUserPreferences(IProject project) throws CoreException {
IFile userPrefsFile = getUserPreferencesFile(project);
if (!userPrefsFile.exists()) {
return null;
}
try {
// force is preventing us for out-of-sync exception if file was
... | [
"private",
"static",
"UserPreferences",
"readUserPreferences",
"(",
"IProject",
"project",
")",
"throws",
"CoreException",
"{",
"IFile",
"userPrefsFile",
"=",
"getUserPreferencesFile",
"(",
"project",
")",
";",
"if",
"(",
"!",
"userPrefsFile",
".",
"exists",
"(",
... | Read UserPreferences for project from the file in the project directory.
Returns null if the preferences have not been saved to a file, or if
there is an error reading the preferences file.
@param project
the project to get the UserPreferences for
@return the UserPreferences, or null if the UserPreferences file could
... | [
"Read",
"UserPreferences",
"for",
"project",
"from",
"the",
"file",
"in",
"the",
"project",
"directory",
".",
"Returns",
"null",
"if",
"the",
"preferences",
"have",
"not",
"been",
"saved",
"to",
"a",
"file",
"or",
"if",
"there",
"is",
"an",
"error",
"readi... | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/FindbugsPlugin.java#L1070-L1086 |
59,454 | spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/RecursiveFileSearch.java | RecursiveFileSearch.search | public RecursiveFileSearch search() throws InterruptedException {
File baseFile = new File(baseDir);
String basePath = bestEffortCanonicalPath(baseFile);
directoryWorkList.add(baseFile);
directoriesScanned.add(basePath);
directoriesScannedList.add(basePath);
while (!dire... | java | public RecursiveFileSearch search() throws InterruptedException {
File baseFile = new File(baseDir);
String basePath = bestEffortCanonicalPath(baseFile);
directoryWorkList.add(baseFile);
directoriesScanned.add(basePath);
directoriesScannedList.add(basePath);
while (!dire... | [
"public",
"RecursiveFileSearch",
"search",
"(",
")",
"throws",
"InterruptedException",
"{",
"File",
"baseFile",
"=",
"new",
"File",
"(",
"baseDir",
")",
";",
"String",
"basePath",
"=",
"bestEffortCanonicalPath",
"(",
"baseFile",
")",
";",
"directoryWorkList",
".",... | Perform the search.
@return this object
@throws InterruptedException
if the thread is interrupted before the search completes | [
"Perform",
"the",
"search",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/RecursiveFileSearch.java#L83-L124 |
59,455 | spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/bcel/BCELUtil.java | BCELUtil.getMethodDescriptor | public static MethodDescriptor getMethodDescriptor(JavaClass jclass, Method method) {
return DescriptorFactory.instance().getMethodDescriptor(jclass.getClassName().replace('.', '/'), method.getName(),
method.getSignature(), method.isStatic());
} | java | public static MethodDescriptor getMethodDescriptor(JavaClass jclass, Method method) {
return DescriptorFactory.instance().getMethodDescriptor(jclass.getClassName().replace('.', '/'), method.getName(),
method.getSignature(), method.isStatic());
} | [
"public",
"static",
"MethodDescriptor",
"getMethodDescriptor",
"(",
"JavaClass",
"jclass",
",",
"Method",
"method",
")",
"{",
"return",
"DescriptorFactory",
".",
"instance",
"(",
")",
".",
"getMethodDescriptor",
"(",
"jclass",
".",
"getClassName",
"(",
")",
".",
... | Construct a MethodDescriptor from JavaClass and method.
@param jclass
a JavaClass
@param method
a Method belonging to the JavaClass
@return a MethodDescriptor identifying the method | [
"Construct",
"a",
"MethodDescriptor",
"from",
"JavaClass",
"and",
"method",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/bcel/BCELUtil.java#L52-L55 |
59,456 | spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/bcel/BCELUtil.java | BCELUtil.getClassDescriptor | public static ClassDescriptor getClassDescriptor(JavaClass jclass) {
return DescriptorFactory.instance().getClassDescriptor(ClassName.toSlashedClassName(jclass.getClassName()));
} | java | public static ClassDescriptor getClassDescriptor(JavaClass jclass) {
return DescriptorFactory.instance().getClassDescriptor(ClassName.toSlashedClassName(jclass.getClassName()));
} | [
"public",
"static",
"ClassDescriptor",
"getClassDescriptor",
"(",
"JavaClass",
"jclass",
")",
"{",
"return",
"DescriptorFactory",
".",
"instance",
"(",
")",
".",
"getClassDescriptor",
"(",
"ClassName",
".",
"toSlashedClassName",
"(",
"jclass",
".",
"getClassName",
"... | Construct a ClassDescriptor from a JavaClass.
@param jclass
a JavaClass
@return a ClassDescriptor identifying that JavaClass | [
"Construct",
"a",
"ClassDescriptor",
"from",
"a",
"JavaClass",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/bcel/BCELUtil.java#L64-L66 |
59,457 | spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/bcel/BCELUtil.java | BCELUtil.preTiger | public static boolean preTiger(JavaClass jclass) {
return jclass.getMajor() < JDK15_MAJOR || (jclass.getMajor() == JDK15_MAJOR && jclass.getMinor() < JDK15_MINOR);
} | java | public static boolean preTiger(JavaClass jclass) {
return jclass.getMajor() < JDK15_MAJOR || (jclass.getMajor() == JDK15_MAJOR && jclass.getMinor() < JDK15_MINOR);
} | [
"public",
"static",
"boolean",
"preTiger",
"(",
"JavaClass",
"jclass",
")",
"{",
"return",
"jclass",
".",
"getMajor",
"(",
")",
"<",
"JDK15_MAJOR",
"||",
"(",
"jclass",
".",
"getMajor",
"(",
")",
"==",
"JDK15_MAJOR",
"&&",
"jclass",
".",
"getMinor",
"(",
... | Checks if classfile was compiled for pre 1.5 target | [
"Checks",
"if",
"classfile",
"was",
"compiled",
"for",
"pre",
"1",
".",
"5",
"target"
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/bcel/BCELUtil.java#L75-L78 |
59,458 | spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/Plugin.java | Plugin.addBugCategory | public void addBugCategory(BugCategory bugCategory) {
BugCategory old = bugCategories.get(bugCategory.getCategory());
if (old != null) {
throw new IllegalArgumentException("Category already exists");
}
bugCategories.put(bugCategory.getCategory(), bugCategory);
} | java | public void addBugCategory(BugCategory bugCategory) {
BugCategory old = bugCategories.get(bugCategory.getCategory());
if (old != null) {
throw new IllegalArgumentException("Category already exists");
}
bugCategories.put(bugCategory.getCategory(), bugCategory);
} | [
"public",
"void",
"addBugCategory",
"(",
"BugCategory",
"bugCategory",
")",
"{",
"BugCategory",
"old",
"=",
"bugCategories",
".",
"get",
"(",
"bugCategory",
".",
"getCategory",
"(",
")",
")",
";",
"if",
"(",
"old",
"!=",
"null",
")",
"{",
"throw",
"new",
... | Add a BugCategory reported by the Plugin.
@param bugCategory | [
"Add",
"a",
"BugCategory",
"reported",
"by",
"the",
"Plugin",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/Plugin.java#L272-L278 |
59,459 | spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/Plugin.java | Plugin.getFactoryByShortName | public DetectorFactory getFactoryByShortName(final String shortName) {
return findFirstMatchingFactory(factory -> factory.getShortName().equals(shortName));
} | java | public DetectorFactory getFactoryByShortName(final String shortName) {
return findFirstMatchingFactory(factory -> factory.getShortName().equals(shortName));
} | [
"public",
"DetectorFactory",
"getFactoryByShortName",
"(",
"final",
"String",
"shortName",
")",
"{",
"return",
"findFirstMatchingFactory",
"(",
"factory",
"->",
"factory",
".",
"getShortName",
"(",
")",
".",
"equals",
"(",
"shortName",
")",
")",
";",
"}"
] | Look up a DetectorFactory by short name.
@param shortName
the short name
@return the DetectorFactory | [
"Look",
"up",
"a",
"DetectorFactory",
"by",
"short",
"name",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/Plugin.java#L317-L319 |
59,460 | spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/Plugin.java | Plugin.getFactoryByFullName | public DetectorFactory getFactoryByFullName(final String fullName) {
return findFirstMatchingFactory(factory -> factory.getFullName().equals(fullName));
} | java | public DetectorFactory getFactoryByFullName(final String fullName) {
return findFirstMatchingFactory(factory -> factory.getFullName().equals(fullName));
} | [
"public",
"DetectorFactory",
"getFactoryByFullName",
"(",
"final",
"String",
"fullName",
")",
"{",
"return",
"findFirstMatchingFactory",
"(",
"factory",
"->",
"factory",
".",
"getFullName",
"(",
")",
".",
"equals",
"(",
"fullName",
")",
")",
";",
"}"
] | Look up a DetectorFactory by full name.
@param fullName
the full name
@return the DetectorFactory | [
"Look",
"up",
"a",
"DetectorFactory",
"by",
"full",
"name",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/Plugin.java#L328-L330 |
59,461 | spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/jsr305/DirectlyRelevantTypeQualifiersDatabase.java | DirectlyRelevantTypeQualifiersDatabase.getDirectlyRelevantTypeQualifiers | public Collection<TypeQualifierValue<?>> getDirectlyRelevantTypeQualifiers(MethodDescriptor m) {
Collection<TypeQualifierValue<?>> result = methodToDirectlyRelevantQualifiersMap.get(m);
if (result != null) {
return result;
}
return Collections.<TypeQualifierValue<?>> emptyLis... | java | public Collection<TypeQualifierValue<?>> getDirectlyRelevantTypeQualifiers(MethodDescriptor m) {
Collection<TypeQualifierValue<?>> result = methodToDirectlyRelevantQualifiersMap.get(m);
if (result != null) {
return result;
}
return Collections.<TypeQualifierValue<?>> emptyLis... | [
"public",
"Collection",
"<",
"TypeQualifierValue",
"<",
"?",
">",
">",
"getDirectlyRelevantTypeQualifiers",
"(",
"MethodDescriptor",
"m",
")",
"{",
"Collection",
"<",
"TypeQualifierValue",
"<",
"?",
">",
">",
"result",
"=",
"methodToDirectlyRelevantQualifiersMap",
"."... | Get the directly-relevant type qualifiers applied to given method.
@param m
MethodDescriptor identifying a method
@return Collection of type qualifiers applied directly to that method | [
"Get",
"the",
"directly",
"-",
"relevant",
"type",
"qualifiers",
"applied",
"to",
"given",
"method",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/jsr305/DirectlyRelevantTypeQualifiersDatabase.java#L58-L64 |
59,462 | spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/jsr305/DirectlyRelevantTypeQualifiersDatabase.java | DirectlyRelevantTypeQualifiersDatabase.setDirectlyRelevantTypeQualifiers | public void setDirectlyRelevantTypeQualifiers(MethodDescriptor methodDescriptor, Collection<TypeQualifierValue<?>> qualifiers) {
methodToDirectlyRelevantQualifiersMap.put(methodDescriptor, qualifiers);
allKnownQualifiers.addAll(qualifiers);
} | java | public void setDirectlyRelevantTypeQualifiers(MethodDescriptor methodDescriptor, Collection<TypeQualifierValue<?>> qualifiers) {
methodToDirectlyRelevantQualifiersMap.put(methodDescriptor, qualifiers);
allKnownQualifiers.addAll(qualifiers);
} | [
"public",
"void",
"setDirectlyRelevantTypeQualifiers",
"(",
"MethodDescriptor",
"methodDescriptor",
",",
"Collection",
"<",
"TypeQualifierValue",
"<",
"?",
">",
">",
"qualifiers",
")",
"{",
"methodToDirectlyRelevantQualifiersMap",
".",
"put",
"(",
"methodDescriptor",
",",... | Set the collection of directly-relevant type qualifiers for a given
method.
@param methodDescriptor
MethodDescriptor identifying a method
@param qualifiers
collection of directly-relevant type qualifiers for the method | [
"Set",
"the",
"collection",
"of",
"directly",
"-",
"relevant",
"type",
"qualifiers",
"for",
"a",
"given",
"method",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/jsr305/DirectlyRelevantTypeQualifiersDatabase.java#L84-L87 |
59,463 | spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/detect/InheritanceUnsafeGetResource.java | InheritanceUnsafeGetResource.adjustPriority | private int adjustPriority(int priority) {
try {
Subtypes2 subtypes2 = AnalysisContext.currentAnalysisContext().getSubtypes2();
if (!subtypes2.hasSubtypes(getClassDescriptor())) {
priority++;
} else {
Set<ClassDescriptor> mySubtypes = subtype... | java | private int adjustPriority(int priority) {
try {
Subtypes2 subtypes2 = AnalysisContext.currentAnalysisContext().getSubtypes2();
if (!subtypes2.hasSubtypes(getClassDescriptor())) {
priority++;
} else {
Set<ClassDescriptor> mySubtypes = subtype... | [
"private",
"int",
"adjustPriority",
"(",
"int",
"priority",
")",
"{",
"try",
"{",
"Subtypes2",
"subtypes2",
"=",
"AnalysisContext",
".",
"currentAnalysisContext",
"(",
")",
".",
"getSubtypes2",
"(",
")",
";",
"if",
"(",
"!",
"subtypes2",
".",
"hasSubtypes",
... | Adjust the priority of a warning about to be reported.
@param priority
initial priority
@return adjusted priority | [
"Adjust",
"the",
"priority",
"of",
"a",
"warning",
"about",
"to",
"be",
"reported",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/detect/InheritanceUnsafeGetResource.java#L136-L162 |
59,464 | spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/DetectorFactoryCollection.java | DetectorFactoryCollection.registerDetector | void registerDetector(DetectorFactory factory) {
if (FindBugs.DEBUG) {
System.out.println("Registering detector: " + factory.getFullName());
}
String detectorName = factory.getShortName();
if(!factoryList.contains(factory)) {
factoryList.add(factory);
} el... | java | void registerDetector(DetectorFactory factory) {
if (FindBugs.DEBUG) {
System.out.println("Registering detector: " + factory.getFullName());
}
String detectorName = factory.getShortName();
if(!factoryList.contains(factory)) {
factoryList.add(factory);
} el... | [
"void",
"registerDetector",
"(",
"DetectorFactory",
"factory",
")",
"{",
"if",
"(",
"FindBugs",
".",
"DEBUG",
")",
"{",
"System",
".",
"out",
".",
"println",
"(",
"\"Registering detector: \"",
"+",
"factory",
".",
"getFullName",
"(",
")",
")",
";",
"}",
"S... | Register a DetectorFactory. | [
"Register",
"a",
"DetectorFactory",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/DetectorFactoryCollection.java#L268-L281 |
59,465 | spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/DetectorFactoryCollection.java | DetectorFactoryCollection.lookupBugPattern | public @CheckForNull BugPattern lookupBugPattern(String bugType) {
if (bugType == null) {
return null;
}
return bugPatternMap.get(bugType);
} | java | public @CheckForNull BugPattern lookupBugPattern(String bugType) {
if (bugType == null) {
return null;
}
return bugPatternMap.get(bugType);
} | [
"public",
"@",
"CheckForNull",
"BugPattern",
"lookupBugPattern",
"(",
"String",
"bugType",
")",
"{",
"if",
"(",
"bugType",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return",
"bugPatternMap",
".",
"get",
"(",
"bugType",
")",
";",
"}"
] | Look up bug pattern.
@param bugType
the bug type for the bug pattern
@return the BugPattern, or null if it can't be found | [
"Look",
"up",
"bug",
"pattern",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/DetectorFactoryCollection.java#L475-L480 |
59,466 | spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/DetectorFactoryCollection.java | DetectorFactoryCollection.getBugCategories | public Collection<String> getBugCategories() {
ArrayList<String> result = new ArrayList<>(categoryDescriptionMap.size());
for(BugCategory c : categoryDescriptionMap.values()) {
if (!c.isHidden()) {
result.add(c.getCategory());
}
}
return result;
... | java | public Collection<String> getBugCategories() {
ArrayList<String> result = new ArrayList<>(categoryDescriptionMap.size());
for(BugCategory c : categoryDescriptionMap.values()) {
if (!c.isHidden()) {
result.add(c.getCategory());
}
}
return result;
... | [
"public",
"Collection",
"<",
"String",
">",
"getBugCategories",
"(",
")",
"{",
"ArrayList",
"<",
"String",
">",
"result",
"=",
"new",
"ArrayList",
"<>",
"(",
"categoryDescriptionMap",
".",
"size",
"(",
")",
")",
";",
"for",
"(",
"BugCategory",
"c",
":",
... | Get a Collection containing all known bug category keys. E.g.,
"CORRECTNESS", "MT_CORRECTNESS", "PERFORMANCE", etc.
Excludes hidden bug categories
@return Collection of bug category keys. | [
"Get",
"a",
"Collection",
"containing",
"all",
"known",
"bug",
"category",
"keys",
".",
"E",
".",
"g",
".",
"CORRECTNESS",
"MT_CORRECTNESS",
"PERFORMANCE",
"etc",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/DetectorFactoryCollection.java#L539-L547 |
59,467 | spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/detect/FindInconsistentSync2.java | FindInconsistentSync2.isGetterMethod | public static boolean isGetterMethod(ClassContext classContext, Method method) {
MethodGen methodGen = classContext.getMethodGen(method);
if (methodGen == null) {
return false;
}
InstructionList il = methodGen.getInstructionList();
// System.out.println("Checking gett... | java | public static boolean isGetterMethod(ClassContext classContext, Method method) {
MethodGen methodGen = classContext.getMethodGen(method);
if (methodGen == null) {
return false;
}
InstructionList il = methodGen.getInstructionList();
// System.out.println("Checking gett... | [
"public",
"static",
"boolean",
"isGetterMethod",
"(",
"ClassContext",
"classContext",
",",
"Method",
"method",
")",
"{",
"MethodGen",
"methodGen",
"=",
"classContext",
".",
"getMethodGen",
"(",
"method",
")",
";",
"if",
"(",
"methodGen",
"==",
"null",
")",
"{"... | Determine whether or not the the given method is a getter method. I.e.,
if it just returns the value of an instance field.
@param classContext
the ClassContext for the class containing the method
@param method
the method | [
"Determine",
"whether",
"or",
"not",
"the",
"the",
"given",
"method",
"is",
"a",
"getter",
"method",
".",
"I",
".",
"e",
".",
"if",
"it",
"just",
"returns",
"the",
"value",
"of",
"an",
"instance",
"field",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/detect/FindInconsistentSync2.java#L813-L865 |
59,468 | spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/detect/FindInconsistentSync2.java | FindInconsistentSync2.getStats | private FieldStats getStats(XField field) {
FieldStats stats = statMap.get(field);
if (stats == null) {
stats = new FieldStats(field);
statMap.put(field, stats);
}
return stats;
} | java | private FieldStats getStats(XField field) {
FieldStats stats = statMap.get(field);
if (stats == null) {
stats = new FieldStats(field);
statMap.put(field, stats);
}
return stats;
} | [
"private",
"FieldStats",
"getStats",
"(",
"XField",
"field",
")",
"{",
"FieldStats",
"stats",
"=",
"statMap",
".",
"get",
"(",
"field",
")",
";",
"if",
"(",
"stats",
"==",
"null",
")",
"{",
"stats",
"=",
"new",
"FieldStats",
"(",
"field",
")",
";",
"... | Get the access statistics for given field. | [
"Get",
"the",
"access",
"statistics",
"for",
"given",
"field",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/detect/FindInconsistentSync2.java#L870-L877 |
59,469 | spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/detect/FindInconsistentSync2.java | FindInconsistentSync2.findLockedMethods | private static Set<Method> findLockedMethods(ClassContext classContext, SelfCalls selfCalls, Set<CallSite> obviouslyLockedSites)
{
JavaClass javaClass = classContext.getJavaClass();
Method[] methodList = javaClass.getMethods();
CallGraph callGraph = selfCalls.getCallGraph();
// In... | java | private static Set<Method> findLockedMethods(ClassContext classContext, SelfCalls selfCalls, Set<CallSite> obviouslyLockedSites)
{
JavaClass javaClass = classContext.getJavaClass();
Method[] methodList = javaClass.getMethods();
CallGraph callGraph = selfCalls.getCallGraph();
// In... | [
"private",
"static",
"Set",
"<",
"Method",
">",
"findLockedMethods",
"(",
"ClassContext",
"classContext",
",",
"SelfCalls",
"selfCalls",
",",
"Set",
"<",
"CallSite",
">",
"obviouslyLockedSites",
")",
"{",
"JavaClass",
"javaClass",
"=",
"classContext",
".",
"getJav... | Find methods that appear to always be called from a locked context. We
assume that nonpublic methods will only be called from within the class,
which is not really a valid assumption. | [
"Find",
"methods",
"that",
"appear",
"to",
"always",
"be",
"called",
"from",
"a",
"locked",
"context",
".",
"We",
"assume",
"that",
"nonpublic",
"methods",
"will",
"only",
"be",
"called",
"from",
"within",
"the",
"class",
"which",
"is",
"not",
"really",
"a... | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/detect/FindInconsistentSync2.java#L951-L1000 |
59,470 | spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/detect/FindInconsistentSync2.java | FindInconsistentSync2.findObviouslyLockedCallSites | private static Set<CallSite> findObviouslyLockedCallSites(ClassContext classContext, SelfCalls selfCalls)
throws CFGBuilderException, DataflowAnalysisException {
ConstantPoolGen cpg = classContext.getConstantPoolGen();
// Find all obviously locked call sites
Set<CallSite> obviouslyL... | java | private static Set<CallSite> findObviouslyLockedCallSites(ClassContext classContext, SelfCalls selfCalls)
throws CFGBuilderException, DataflowAnalysisException {
ConstantPoolGen cpg = classContext.getConstantPoolGen();
// Find all obviously locked call sites
Set<CallSite> obviouslyL... | [
"private",
"static",
"Set",
"<",
"CallSite",
">",
"findObviouslyLockedCallSites",
"(",
"ClassContext",
"classContext",
",",
"SelfCalls",
"selfCalls",
")",
"throws",
"CFGBuilderException",
",",
"DataflowAnalysisException",
"{",
"ConstantPoolGen",
"cpg",
"=",
"classContext"... | Find all self-call sites that are obviously locked. | [
"Find",
"all",
"self",
"-",
"call",
"sites",
"that",
"are",
"obviously",
"locked",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/detect/FindInconsistentSync2.java#L1048-L1102 |
59,471 | spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/detect/WrongMapIterator.java | WrongMapIterator.implementsMap | private static boolean implementsMap(ClassDescriptor d) {
while (d != null) {
try {
// Do not report this warning for EnumMap: EnumMap.keySet()/get() iteration is as fast as entrySet() iteration
if ("java.util.EnumMap".equals(d.getDottedClassName())) {
... | java | private static boolean implementsMap(ClassDescriptor d) {
while (d != null) {
try {
// Do not report this warning for EnumMap: EnumMap.keySet()/get() iteration is as fast as entrySet() iteration
if ("java.util.EnumMap".equals(d.getDottedClassName())) {
... | [
"private",
"static",
"boolean",
"implementsMap",
"(",
"ClassDescriptor",
"d",
")",
"{",
"while",
"(",
"d",
"!=",
"null",
")",
"{",
"try",
"{",
"// Do not report this warning for EnumMap: EnumMap.keySet()/get() iteration is as fast as entrySet() iteration",
"if",
"(",
"\"jav... | Determine from the class descriptor for a variable whether that variable
implements java.util.Map.
@param d
class descriptor for variable we want to check implements Map
@return true iff the descriptor corresponds to an implementor of Map | [
"Determine",
"from",
"the",
"class",
"descriptor",
"for",
"a",
"variable",
"whether",
"that",
"variable",
"implements",
"java",
".",
"util",
".",
"Map",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/detect/WrongMapIterator.java#L163-L187 |
59,472 | spotbugs/spotbugs | eclipsePlugin/src/de/tobject/findbugs/properties/FindbugsPropertyPage.java | FindbugsPropertyPage.restoreDefaultSettings | private void restoreDefaultSettings() {
if (getProject() != null) {
// By default, don't run FindBugs automatically
chkEnableFindBugs.setSelection(false);
chkRunAtFullBuild.setEnabled(false);
FindBugsPreferenceInitializer.restoreDefaults(projectStore);
} e... | java | private void restoreDefaultSettings() {
if (getProject() != null) {
// By default, don't run FindBugs automatically
chkEnableFindBugs.setSelection(false);
chkRunAtFullBuild.setEnabled(false);
FindBugsPreferenceInitializer.restoreDefaults(projectStore);
} e... | [
"private",
"void",
"restoreDefaultSettings",
"(",
")",
"{",
"if",
"(",
"getProject",
"(",
")",
"!=",
"null",
")",
"{",
"// By default, don't run FindBugs automatically",
"chkEnableFindBugs",
".",
"setSelection",
"(",
"false",
")",
";",
"chkRunAtFullBuild",
".",
"set... | Restore default settings. This just changes the dialog widgets - the user
still needs to confirm by clicking the "OK" button. | [
"Restore",
"default",
"settings",
".",
"This",
"just",
"changes",
"the",
"dialog",
"widgets",
"-",
"the",
"user",
"still",
"needs",
"to",
"confirm",
"by",
"clicking",
"the",
"OK",
"button",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/properties/FindbugsPropertyPage.java#L426-L437 |
59,473 | spotbugs/spotbugs | eclipsePlugin/src/de/tobject/findbugs/properties/FindbugsPropertyPage.java | FindbugsPropertyPage.performOk | @Override
public boolean performOk() {
reportConfigurationTab.performOk();
boolean analysisSettingsChanged = false;
boolean reporterSettingsChanged = false;
boolean needRedisplayMarkers = false;
if (workspaceSettingsTab != null) {
workspaceSettingsTab.performOK();... | java | @Override
public boolean performOk() {
reportConfigurationTab.performOk();
boolean analysisSettingsChanged = false;
boolean reporterSettingsChanged = false;
boolean needRedisplayMarkers = false;
if (workspaceSettingsTab != null) {
workspaceSettingsTab.performOK();... | [
"@",
"Override",
"public",
"boolean",
"performOk",
"(",
")",
"{",
"reportConfigurationTab",
".",
"performOk",
"(",
")",
";",
"boolean",
"analysisSettingsChanged",
"=",
"false",
";",
"boolean",
"reporterSettingsChanged",
"=",
"false",
";",
"boolean",
"needRedisplayMa... | Will be called when the user presses the OK button.
@see IPreferencePage#performOk() | [
"Will",
"be",
"called",
"when",
"the",
"user",
"presses",
"the",
"OK",
"button",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/properties/FindbugsPropertyPage.java#L450-L525 |
59,474 | spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/Tokenizer.java | Tokenizer.next | public Token next() throws IOException {
skipWhitespace();
int c = reader.read();
if (c < 0) {
return new Token(Token.EOF);
} else if (c == '\n') {
return new Token(Token.EOL);
} else if (c == '\'' || c == '"') {
return munchString(c);
... | java | public Token next() throws IOException {
skipWhitespace();
int c = reader.read();
if (c < 0) {
return new Token(Token.EOF);
} else if (c == '\n') {
return new Token(Token.EOL);
} else if (c == '\'' || c == '"') {
return munchString(c);
... | [
"public",
"Token",
"next",
"(",
")",
"throws",
"IOException",
"{",
"skipWhitespace",
"(",
")",
";",
"int",
"c",
"=",
"reader",
".",
"read",
"(",
")",
";",
"if",
"(",
"c",
"<",
"0",
")",
"{",
"return",
"new",
"Token",
"(",
"Token",
".",
"EOF",
")"... | Get the next Token in the stream.
@return the Token | [
"Get",
"the",
"next",
"Token",
"in",
"the",
"stream",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/Tokenizer.java#L89-L106 |
59,475 | spotbugs/spotbugs | eclipsePlugin/src/de/tobject/findbugs/reporter/Reporter.java | Reporter.reportResultsToConsole | private void reportResultsToConsole() {
if (!isStreamReportingEnabled()) {
return;
}
printToStream("Finished, found: " + bugCount + " bugs");
ConfigurableXmlOutputStream xmlStream = new ConfigurableXmlOutputStream(stream, true);
ProjectStats stats = bugCollection.getP... | java | private void reportResultsToConsole() {
if (!isStreamReportingEnabled()) {
return;
}
printToStream("Finished, found: " + bugCount + " bugs");
ConfigurableXmlOutputStream xmlStream = new ConfigurableXmlOutputStream(stream, true);
ProjectStats stats = bugCollection.getP... | [
"private",
"void",
"reportResultsToConsole",
"(",
")",
"{",
"if",
"(",
"!",
"isStreamReportingEnabled",
"(",
")",
")",
"{",
"return",
";",
"}",
"printToStream",
"(",
"\"Finished, found: \"",
"+",
"bugCount",
"+",
"\" bugs\"",
")",
";",
"ConfigurableXmlOutputStream... | If there is a FB console opened, report results and statistics to it. | [
"If",
"there",
"is",
"a",
"FB",
"console",
"opened",
"report",
"results",
"and",
"statistics",
"to",
"it",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/reporter/Reporter.java#L184-L221 |
59,476 | spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/bcp/ByteCodePattern.java | ByteCodePattern.addWild | public ByteCodePattern addWild(int numWild) {
Wild wild = isLastWild();
if (wild != null) {
wild.setMinAndMax(0, numWild);
} else {
addElement(new Wild(numWild));
}
return this;
} | java | public ByteCodePattern addWild(int numWild) {
Wild wild = isLastWild();
if (wild != null) {
wild.setMinAndMax(0, numWild);
} else {
addElement(new Wild(numWild));
}
return this;
} | [
"public",
"ByteCodePattern",
"addWild",
"(",
"int",
"numWild",
")",
"{",
"Wild",
"wild",
"=",
"isLastWild",
"(",
")",
";",
"if",
"(",
"wild",
"!=",
"null",
")",
"{",
"wild",
".",
"setMinAndMax",
"(",
"0",
",",
"numWild",
")",
";",
"}",
"else",
"{",
... | Add a wildcard to match between 0 and given number of instructions. If
there is already a wildcard at the end of the current pattern, resets its
max value to that given.
@param numWild
maximum number of instructions to be matched by the wildcard | [
"Add",
"a",
"wildcard",
"to",
"match",
"between",
"0",
"and",
"given",
"number",
"of",
"instructions",
".",
"If",
"there",
"is",
"already",
"a",
"wildcard",
"at",
"the",
"end",
"of",
"the",
"current",
"pattern",
"resets",
"its",
"max",
"value",
"to",
"th... | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/bcp/ByteCodePattern.java#L61-L69 |
59,477 | spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/CFG.java | CFG.lookupEdgeById | public Edge lookupEdgeById(int id) {
Iterator<Edge> i = edgeIterator();
while (i.hasNext()) {
Edge edge = i.next();
if (edge.getId() == id) {
return edge;
}
}
return null;
} | java | public Edge lookupEdgeById(int id) {
Iterator<Edge> i = edgeIterator();
while (i.hasNext()) {
Edge edge = i.next();
if (edge.getId() == id) {
return edge;
}
}
return null;
} | [
"public",
"Edge",
"lookupEdgeById",
"(",
"int",
"id",
")",
"{",
"Iterator",
"<",
"Edge",
">",
"i",
"=",
"edgeIterator",
"(",
")",
";",
"while",
"(",
"i",
".",
"hasNext",
"(",
")",
")",
"{",
"Edge",
"edge",
"=",
"i",
".",
"next",
"(",
")",
";",
... | Look up an Edge by its id.
@param id
the id of the edge to look up
@return the Edge, or null if no matching Edge was found | [
"Look",
"up",
"an",
"Edge",
"by",
"its",
"id",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/CFG.java#L271-L280 |
59,478 | spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/CFG.java | CFG.lookupBlockByLabel | public BasicBlock lookupBlockByLabel(int blockLabel) {
for (Iterator<BasicBlock> i = blockIterator(); i.hasNext();) {
BasicBlock basicBlock = i.next();
if (basicBlock.getLabel() == blockLabel) {
return basicBlock;
}
}
return null;
} | java | public BasicBlock lookupBlockByLabel(int blockLabel) {
for (Iterator<BasicBlock> i = blockIterator(); i.hasNext();) {
BasicBlock basicBlock = i.next();
if (basicBlock.getLabel() == blockLabel) {
return basicBlock;
}
}
return null;
} | [
"public",
"BasicBlock",
"lookupBlockByLabel",
"(",
"int",
"blockLabel",
")",
"{",
"for",
"(",
"Iterator",
"<",
"BasicBlock",
">",
"i",
"=",
"blockIterator",
"(",
")",
";",
"i",
".",
"hasNext",
"(",
")",
";",
")",
"{",
"BasicBlock",
"basicBlock",
"=",
"i"... | Look up a BasicBlock by its unique label.
@param blockLabel
the label of a BasicBlock
@return the BasicBlock with the given label, or null if there is no such
BasicBlock | [
"Look",
"up",
"a",
"BasicBlock",
"by",
"its",
"unique",
"label",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/CFG.java#L290-L298 |
59,479 | spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/CFG.java | CFG.orderedLocations | public Collection<Location> orderedLocations() {
TreeSet<Location> tree = new TreeSet<>();
for (Iterator<Location> locs = locationIterator(); locs.hasNext();) {
Location loc = locs.next();
tree.add(loc);
}
return tree;
} | java | public Collection<Location> orderedLocations() {
TreeSet<Location> tree = new TreeSet<>();
for (Iterator<Location> locs = locationIterator(); locs.hasNext();) {
Location loc = locs.next();
tree.add(loc);
}
return tree;
} | [
"public",
"Collection",
"<",
"Location",
">",
"orderedLocations",
"(",
")",
"{",
"TreeSet",
"<",
"Location",
">",
"tree",
"=",
"new",
"TreeSet",
"<>",
"(",
")",
";",
"for",
"(",
"Iterator",
"<",
"Location",
">",
"locs",
"=",
"locationIterator",
"(",
")",... | Returns a collection of locations, ordered according to the compareTo
ordering over locations. If you want to list all the locations in a CFG
for debugging purposes, this is a good order to do so in.
@return collection of locations | [
"Returns",
"a",
"collection",
"of",
"locations",
"ordered",
"according",
"to",
"the",
"compareTo",
"ordering",
"over",
"locations",
".",
"If",
"you",
"want",
"to",
"list",
"all",
"the",
"locations",
"in",
"a",
"CFG",
"for",
"debugging",
"purposes",
"this",
"... | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/CFG.java#L336-L343 |
59,480 | spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/CFG.java | CFG.getBlocks | public Collection<BasicBlock> getBlocks(BitSet labelSet) {
LinkedList<BasicBlock> result = new LinkedList<>();
for (Iterator<BasicBlock> i = blockIterator(); i.hasNext();) {
BasicBlock block = i.next();
if (labelSet.get(block.getLabel())) {
result.add(block);
... | java | public Collection<BasicBlock> getBlocks(BitSet labelSet) {
LinkedList<BasicBlock> result = new LinkedList<>();
for (Iterator<BasicBlock> i = blockIterator(); i.hasNext();) {
BasicBlock block = i.next();
if (labelSet.get(block.getLabel())) {
result.add(block);
... | [
"public",
"Collection",
"<",
"BasicBlock",
">",
"getBlocks",
"(",
"BitSet",
"labelSet",
")",
"{",
"LinkedList",
"<",
"BasicBlock",
">",
"result",
"=",
"new",
"LinkedList",
"<>",
"(",
")",
";",
"for",
"(",
"Iterator",
"<",
"BasicBlock",
">",
"i",
"=",
"bl... | Get Collection of basic blocks whose IDs are specified by given BitSet.
@param labelSet
BitSet of block labels
@return a Collection containing the blocks whose IDs are given | [
"Get",
"Collection",
"of",
"basic",
"blocks",
"whose",
"IDs",
"are",
"specified",
"by",
"given",
"BitSet",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/CFG.java#L352-L361 |
59,481 | spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/CFG.java | CFG.getBlocksContainingInstructionWithOffset | public Collection<BasicBlock> getBlocksContainingInstructionWithOffset(int offset) {
LinkedList<BasicBlock> result = new LinkedList<>();
for (Iterator<BasicBlock> i = blockIterator(); i.hasNext();) {
BasicBlock block = i.next();
if (block.containsInstructionWithOffset(offset)) {
... | java | public Collection<BasicBlock> getBlocksContainingInstructionWithOffset(int offset) {
LinkedList<BasicBlock> result = new LinkedList<>();
for (Iterator<BasicBlock> i = blockIterator(); i.hasNext();) {
BasicBlock block = i.next();
if (block.containsInstructionWithOffset(offset)) {
... | [
"public",
"Collection",
"<",
"BasicBlock",
">",
"getBlocksContainingInstructionWithOffset",
"(",
"int",
"offset",
")",
"{",
"LinkedList",
"<",
"BasicBlock",
">",
"result",
"=",
"new",
"LinkedList",
"<>",
"(",
")",
";",
"for",
"(",
"Iterator",
"<",
"BasicBlock",
... | Get a Collection of basic blocks which contain the bytecode instruction
with given offset.
@param offset
the bytecode offset of an instruction
@return Collection of BasicBlock objects which contain the instruction
with that offset | [
"Get",
"a",
"Collection",
"of",
"basic",
"blocks",
"which",
"contain",
"the",
"bytecode",
"instruction",
"with",
"given",
"offset",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/CFG.java#L372-L381 |
59,482 | spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/CFG.java | CFG.getLocationsContainingInstructionWithOffset | public Collection<Location> getLocationsContainingInstructionWithOffset(int offset) {
LinkedList<Location> result = new LinkedList<>();
for (Iterator<Location> i = locationIterator(); i.hasNext();) {
Location location = i.next();
if (location.getHandle().getPosition() == offset) ... | java | public Collection<Location> getLocationsContainingInstructionWithOffset(int offset) {
LinkedList<Location> result = new LinkedList<>();
for (Iterator<Location> i = locationIterator(); i.hasNext();) {
Location location = i.next();
if (location.getHandle().getPosition() == offset) ... | [
"public",
"Collection",
"<",
"Location",
">",
"getLocationsContainingInstructionWithOffset",
"(",
"int",
"offset",
")",
"{",
"LinkedList",
"<",
"Location",
">",
"result",
"=",
"new",
"LinkedList",
"<>",
"(",
")",
";",
"for",
"(",
"Iterator",
"<",
"Location",
"... | Get a Collection of Locations which specify the instruction at given
bytecode offset.
@param offset
the bytecode offset
@return all Locations referring to the instruction at that offset | [
"Get",
"a",
"Collection",
"of",
"Locations",
"which",
"specify",
"the",
"instruction",
"at",
"given",
"bytecode",
"offset",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/CFG.java#L391-L400 |
59,483 | spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/CFG.java | CFG.getNumNonExceptionSucessors | public int getNumNonExceptionSucessors(BasicBlock block) {
int numNonExceptionSuccessors = block.getNumNonExceptionSuccessors();
if (numNonExceptionSuccessors < 0) {
numNonExceptionSuccessors = 0;
for (Iterator<Edge> i = outgoingEdgeIterator(block); i.hasNext();) {
... | java | public int getNumNonExceptionSucessors(BasicBlock block) {
int numNonExceptionSuccessors = block.getNumNonExceptionSuccessors();
if (numNonExceptionSuccessors < 0) {
numNonExceptionSuccessors = 0;
for (Iterator<Edge> i = outgoingEdgeIterator(block); i.hasNext();) {
... | [
"public",
"int",
"getNumNonExceptionSucessors",
"(",
"BasicBlock",
"block",
")",
"{",
"int",
"numNonExceptionSuccessors",
"=",
"block",
".",
"getNumNonExceptionSuccessors",
"(",
")",
";",
"if",
"(",
"numNonExceptionSuccessors",
"<",
"0",
")",
"{",
"numNonExceptionSucc... | Get number of non-exception control successors of given basic block.
@param block
a BasicBlock
@return number of non-exception control successors of the basic block | [
"Get",
"number",
"of",
"non",
"-",
"exception",
"control",
"successors",
"of",
"given",
"basic",
"block",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/CFG.java#L590-L603 |
59,484 | spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/CFG.java | CFG.getLocationAtEntry | public Location getLocationAtEntry() {
InstructionHandle handle = getEntry().getFirstInstruction();
assert handle != null;
return new Location(handle, getEntry());
} | java | public Location getLocationAtEntry() {
InstructionHandle handle = getEntry().getFirstInstruction();
assert handle != null;
return new Location(handle, getEntry());
} | [
"public",
"Location",
"getLocationAtEntry",
"(",
")",
"{",
"InstructionHandle",
"handle",
"=",
"getEntry",
"(",
")",
".",
"getFirstInstruction",
"(",
")",
";",
"assert",
"handle",
"!=",
"null",
";",
"return",
"new",
"Location",
"(",
"handle",
",",
"getEntry",
... | Get the Location representing the entry to the CFG. Note that this is a
"fake" Location, and shouldn't be relied on to yield source line
information.
@return Location at entry to CFG | [
"Get",
"the",
"Location",
"representing",
"the",
"entry",
"to",
"the",
"CFG",
".",
"Note",
"that",
"this",
"is",
"a",
"fake",
"Location",
"and",
"shouldn",
"t",
"be",
"relied",
"on",
"to",
"yield",
"source",
"line",
"information",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/CFG.java#L612-L616 |
59,485 | spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/plan/ExecutionPlan.java | ExecutionPlan.addPlugin | public void addPlugin(Plugin plugin) throws OrderingConstraintException {
if (DEBUG) {
System.out.println("Adding plugin " + plugin.getPluginId() + " to execution plan");
}
pluginList.add(plugin);
// Add ordering constraints
copyTo(plugin.interPassConstraintIterator... | java | public void addPlugin(Plugin plugin) throws OrderingConstraintException {
if (DEBUG) {
System.out.println("Adding plugin " + plugin.getPluginId() + " to execution plan");
}
pluginList.add(plugin);
// Add ordering constraints
copyTo(plugin.interPassConstraintIterator... | [
"public",
"void",
"addPlugin",
"(",
"Plugin",
"plugin",
")",
"throws",
"OrderingConstraintException",
"{",
"if",
"(",
"DEBUG",
")",
"{",
"System",
".",
"out",
".",
"println",
"(",
"\"Adding plugin \"",
"+",
"plugin",
".",
"getPluginId",
"(",
")",
"+",
"\" to... | Add a Plugin whose Detectors should be added to the execution plan. | [
"Add",
"a",
"Plugin",
"whose",
"Detectors",
"should",
"be",
"added",
"to",
"the",
"execution",
"plan",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/plan/ExecutionPlan.java#L112-L132 |
59,486 | spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/plan/ExecutionPlan.java | ExecutionPlan.assignToPass | private void assignToPass(DetectorFactory factory, AnalysisPass pass) {
pass.addToPass(factory);
assignedToPassSet.add(factory);
} | java | private void assignToPass(DetectorFactory factory, AnalysisPass pass) {
pass.addToPass(factory);
assignedToPassSet.add(factory);
} | [
"private",
"void",
"assignToPass",
"(",
"DetectorFactory",
"factory",
",",
"AnalysisPass",
"pass",
")",
"{",
"pass",
".",
"addToPass",
"(",
"factory",
")",
";",
"assignedToPassSet",
".",
"add",
"(",
"factory",
")",
";",
"}"
] | Make a DetectorFactory a member of an AnalysisPass. | [
"Make",
"a",
"DetectorFactory",
"a",
"member",
"of",
"an",
"AnalysisPass",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/plan/ExecutionPlan.java#L466-L469 |
59,487 | spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/InstructionScannerDriver.java | InstructionScannerDriver.execute | public void execute(InstructionScannerGenerator generator) {
// Pump the instructions in the path through the generator and all
// generated scanners
while (edgeIter.hasNext()) {
Edge edge = edgeIter.next();
BasicBlock source = edge.getSource();
if (DEBUG) {
... | java | public void execute(InstructionScannerGenerator generator) {
// Pump the instructions in the path through the generator and all
// generated scanners
while (edgeIter.hasNext()) {
Edge edge = edgeIter.next();
BasicBlock source = edge.getSource();
if (DEBUG) {
... | [
"public",
"void",
"execute",
"(",
"InstructionScannerGenerator",
"generator",
")",
"{",
"// Pump the instructions in the path through the generator and all",
"// generated scanners",
"while",
"(",
"edgeIter",
".",
"hasNext",
"(",
")",
")",
"{",
"Edge",
"edge",
"=",
"edgeI... | Execute by driving the InstructionScannerGenerator over all instructions.
Each generated InstructionScanner is driven over all instructions and
edges.
@param generator
the InstructionScannerGenerator | [
"Execute",
"by",
"driving",
"the",
"InstructionScannerGenerator",
"over",
"all",
"instructions",
".",
"Each",
"generated",
"InstructionScanner",
"is",
"driven",
"over",
"all",
"instructions",
"and",
"edges",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/InstructionScannerDriver.java#L61-L100 |
59,488 | spotbugs/spotbugs | eclipsePlugin/src/de/tobject/findbugs/builder/FindBugsBuilder.java | FindBugsBuilder.build | @SuppressWarnings("rawtypes")
@Override
protected IProject[] build(int kind, Map args, IProgressMonitor monitor) throws CoreException {
monitor.subTask("Running SpotBugs...");
switch (kind) {
case IncrementalProjectBuilder.FULL_BUILD: {
FindBugs2Eclipse.cleanClassClache(getPr... | java | @SuppressWarnings("rawtypes")
@Override
protected IProject[] build(int kind, Map args, IProgressMonitor monitor) throws CoreException {
monitor.subTask("Running SpotBugs...");
switch (kind) {
case IncrementalProjectBuilder.FULL_BUILD: {
FindBugs2Eclipse.cleanClassClache(getPr... | [
"@",
"SuppressWarnings",
"(",
"\"rawtypes\"",
")",
"@",
"Override",
"protected",
"IProject",
"[",
"]",
"build",
"(",
"int",
"kind",
",",
"Map",
"args",
",",
"IProgressMonitor",
"monitor",
")",
"throws",
"CoreException",
"{",
"monitor",
".",
"subTask",
"(",
"... | Run the builder.
@see IncrementalProjectBuilder#build | [
"Run",
"the",
"builder",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/builder/FindBugsBuilder.java#L62-L103 |
59,489 | spotbugs/spotbugs | eclipsePlugin/src/de/tobject/findbugs/builder/FindBugsBuilder.java | FindBugsBuilder.work | protected void work(final IResource resource, final List<WorkItem> resources, IProgressMonitor monitor) {
IPreferenceStore store = FindbugsPlugin.getPluginPreferences(getProject());
boolean runAsJob = store.getBoolean(FindBugsConstants.KEY_RUN_ANALYSIS_AS_EXTRA_JOB);
FindBugsJob fbJob = new Star... | java | protected void work(final IResource resource, final List<WorkItem> resources, IProgressMonitor monitor) {
IPreferenceStore store = FindbugsPlugin.getPluginPreferences(getProject());
boolean runAsJob = store.getBoolean(FindBugsConstants.KEY_RUN_ANALYSIS_AS_EXTRA_JOB);
FindBugsJob fbJob = new Star... | [
"protected",
"void",
"work",
"(",
"final",
"IResource",
"resource",
",",
"final",
"List",
"<",
"WorkItem",
">",
"resources",
",",
"IProgressMonitor",
"monitor",
")",
"{",
"IPreferenceStore",
"store",
"=",
"FindbugsPlugin",
".",
"getPluginPreferences",
"(",
"getPro... | Run a FindBugs analysis on the given resource as build job BUT not
delaying the current Java build
@param resources
The resource to run the analysis on.
@param monitor | [
"Run",
"a",
"FindBugs",
"analysis",
"on",
"the",
"given",
"resource",
"as",
"build",
"job",
"BUT",
"not",
"delaying",
"the",
"current",
"Java",
"build"
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/builder/FindBugsBuilder.java#L167-L194 |
59,490 | spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/ClassNotFoundExceptionParser.java | ClassNotFoundExceptionParser.getMissingClassName | public static @DottedClassName
String getMissingClassName(ClassNotFoundException ex) {
// If the exception has a ResourceNotFoundException as the cause,
// then we have an easy answer.
Throwable cause = ex.getCause();
if (cause instanceof ResourceNotFoundException) {
Stri... | java | public static @DottedClassName
String getMissingClassName(ClassNotFoundException ex) {
// If the exception has a ResourceNotFoundException as the cause,
// then we have an easy answer.
Throwable cause = ex.getCause();
if (cause instanceof ResourceNotFoundException) {
Stri... | [
"public",
"static",
"@",
"DottedClassName",
"String",
"getMissingClassName",
"(",
"ClassNotFoundException",
"ex",
")",
"{",
"// If the exception has a ResourceNotFoundException as the cause,",
"// then we have an easy answer.",
"Throwable",
"cause",
"=",
"ex",
".",
"getCause",
... | Get the name of the missing class from a ClassNotFoundException.
@param ex
the ClassNotFoundException
@return the name of the missing class, or null if we couldn't figure out
the class name | [
"Get",
"the",
"name",
"of",
"the",
"missing",
"class",
"from",
"a",
"ClassNotFoundException",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/ClassNotFoundExceptionParser.java#L66-L94 |
59,491 | spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/SourceInfoMap.java | SourceInfoMap.addFieldLine | public void addFieldLine(String className, String fieldName, SourceLineRange range) {
fieldLineMap.put(new FieldDescriptor(className, fieldName), range);
} | java | public void addFieldLine(String className, String fieldName, SourceLineRange range) {
fieldLineMap.put(new FieldDescriptor(className, fieldName), range);
} | [
"public",
"void",
"addFieldLine",
"(",
"String",
"className",
",",
"String",
"fieldName",
",",
"SourceLineRange",
"range",
")",
"{",
"fieldLineMap",
".",
"put",
"(",
"new",
"FieldDescriptor",
"(",
"className",
",",
"fieldName",
")",
",",
"range",
")",
";",
"... | Add a line number entry for a field.
@param className
name of class containing the field
@param fieldName
name of field
@param range
the line number(s) of the field | [
"Add",
"a",
"line",
"number",
"entry",
"for",
"a",
"field",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/SourceInfoMap.java#L251-L253 |
59,492 | spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/SourceInfoMap.java | SourceInfoMap.addMethodLine | public void addMethodLine(String className, String methodName, String methodSignature, SourceLineRange range) {
methodLineMap.put(new MethodDescriptor(className, methodName, methodSignature), range);
} | java | public void addMethodLine(String className, String methodName, String methodSignature, SourceLineRange range) {
methodLineMap.put(new MethodDescriptor(className, methodName, methodSignature), range);
} | [
"public",
"void",
"addMethodLine",
"(",
"String",
"className",
",",
"String",
"methodName",
",",
"String",
"methodSignature",
",",
"SourceLineRange",
"range",
")",
"{",
"methodLineMap",
".",
"put",
"(",
"new",
"MethodDescriptor",
"(",
"className",
",",
"methodName... | Add a line number entry for a method.
@param className
name of class containing the method
@param methodName
name of method
@param methodSignature
signature of method
@param range
the line number of the method | [
"Add",
"a",
"line",
"number",
"entry",
"for",
"a",
"method",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/SourceInfoMap.java#L267-L269 |
59,493 | spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/SourceInfoMap.java | SourceInfoMap.getFieldLine | public @CheckForNull
SourceLineRange getFieldLine(String className, String fieldName) {
return fieldLineMap.get(new FieldDescriptor(className, fieldName));
} | java | public @CheckForNull
SourceLineRange getFieldLine(String className, String fieldName) {
return fieldLineMap.get(new FieldDescriptor(className, fieldName));
} | [
"public",
"@",
"CheckForNull",
"SourceLineRange",
"getFieldLine",
"(",
"String",
"className",
",",
"String",
"fieldName",
")",
"{",
"return",
"fieldLineMap",
".",
"get",
"(",
"new",
"FieldDescriptor",
"(",
"className",
",",
"fieldName",
")",
")",
";",
"}"
] | Look up the line number range for a field.
@param className
name of class containing the field
@param fieldName
name of field
@return the line number range, or null if no line number is known for the
field | [
"Look",
"up",
"the",
"line",
"number",
"range",
"for",
"a",
"field",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/SourceInfoMap.java#L293-L296 |
59,494 | spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/SourceInfoMap.java | SourceInfoMap.getMethodLine | public @CheckForNull
SourceLineRange getMethodLine(String className, String methodName, String methodSignature) {
return methodLineMap.get(new MethodDescriptor(className, methodName, methodSignature));
} | java | public @CheckForNull
SourceLineRange getMethodLine(String className, String methodName, String methodSignature) {
return methodLineMap.get(new MethodDescriptor(className, methodName, methodSignature));
} | [
"public",
"@",
"CheckForNull",
"SourceLineRange",
"getMethodLine",
"(",
"String",
"className",
",",
"String",
"methodName",
",",
"String",
"methodSignature",
")",
"{",
"return",
"methodLineMap",
".",
"get",
"(",
"new",
"MethodDescriptor",
"(",
"className",
",",
"m... | Look up the line number range for a method.
@param className
name of class containing the method
@param methodName
name of method
@param methodSignature
signature of method
@return the line number range, or null if no line number is known for the
method | [
"Look",
"up",
"the",
"line",
"number",
"range",
"for",
"a",
"method",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/SourceInfoMap.java#L310-L313 |
59,495 | spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/SourceInfoMap.java | SourceInfoMap.parseVersionNumber | private static String parseVersionNumber(String line) {
StringTokenizer tokenizer = new StringTokenizer(line, " \t");
if (!expect(tokenizer, "sourceInfo") || !expect(tokenizer, "version") || !tokenizer.hasMoreTokens()) {
return null;
}
return tokenizer.nextToken();
} | java | private static String parseVersionNumber(String line) {
StringTokenizer tokenizer = new StringTokenizer(line, " \t");
if (!expect(tokenizer, "sourceInfo") || !expect(tokenizer, "version") || !tokenizer.hasMoreTokens()) {
return null;
}
return tokenizer.nextToken();
} | [
"private",
"static",
"String",
"parseVersionNumber",
"(",
"String",
"line",
")",
"{",
"StringTokenizer",
"tokenizer",
"=",
"new",
"StringTokenizer",
"(",
"line",
",",
"\" \\t\"",
")",
";",
"if",
"(",
"!",
"expect",
"(",
"tokenizer",
",",
"\"sourceInfo\"",
")",... | Parse the sourceInfo version string.
@param line
the first line of the sourceInfo file
@return the version number constant, or null if the line does not appear
to be a version string | [
"Parse",
"the",
"sourceInfo",
"version",
"string",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/SourceInfoMap.java#L433-L441 |
59,496 | spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/SourceInfoMap.java | SourceInfoMap.expect | private static boolean expect(StringTokenizer tokenizer, String token) {
if (!tokenizer.hasMoreTokens()) {
return false;
}
String s = tokenizer.nextToken();
if (DEBUG) {
System.out.println("token=" + s);
}
return s.equals(token);
} | java | private static boolean expect(StringTokenizer tokenizer, String token) {
if (!tokenizer.hasMoreTokens()) {
return false;
}
String s = tokenizer.nextToken();
if (DEBUG) {
System.out.println("token=" + s);
}
return s.equals(token);
} | [
"private",
"static",
"boolean",
"expect",
"(",
"StringTokenizer",
"tokenizer",
",",
"String",
"token",
")",
"{",
"if",
"(",
"!",
"tokenizer",
".",
"hasMoreTokens",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
"String",
"s",
"=",
"tokenizer",
".",
"ne... | Expect a particular token string to be returned by the given
StringTokenizer.
@param tokenizer
the StringTokenizer
@param token
the expectedToken
@return true if the expected token was returned, false if not | [
"Expect",
"a",
"particular",
"token",
"string",
"to",
"be",
"returned",
"by",
"the",
"given",
"StringTokenizer",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/SourceInfoMap.java#L453-L462 |
59,497 | spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/SloppyBugComparator.java | SloppyBugComparator.compareClassesAllowingNull | private int compareClassesAllowingNull(ClassAnnotation lhs, ClassAnnotation rhs) {
if (lhs == null || rhs == null) {
return compareNullElements(lhs, rhs);
}
String lhsClassName = classNameRewriter.rewriteClassName(lhs.getClassName());
String rhsClassName = classNameRewriter.... | java | private int compareClassesAllowingNull(ClassAnnotation lhs, ClassAnnotation rhs) {
if (lhs == null || rhs == null) {
return compareNullElements(lhs, rhs);
}
String lhsClassName = classNameRewriter.rewriteClassName(lhs.getClassName());
String rhsClassName = classNameRewriter.... | [
"private",
"int",
"compareClassesAllowingNull",
"(",
"ClassAnnotation",
"lhs",
",",
"ClassAnnotation",
"rhs",
")",
"{",
"if",
"(",
"lhs",
"==",
"null",
"||",
"rhs",
"==",
"null",
")",
"{",
"return",
"compareNullElements",
"(",
"lhs",
",",
"rhs",
")",
";",
... | Compare class annotations.
@param lhs
left hand class annotation
@param rhs
right hand class annotation
@return comparison of the class annotations | [
"Compare",
"class",
"annotations",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/SloppyBugComparator.java#L63-L80 |
59,498 | spotbugs/spotbugs | spotbugs/src/gui/main/edu/umd/cs/findbugs/gui2/BugSet.java | BugSet.countFilteredBugs | static int countFilteredBugs() {
int result = 0;
for (BugLeafNode bug : getMainBugSet().mainList) {
if (suppress(bug)) {
result++;
}
}
return result;
} | java | static int countFilteredBugs() {
int result = 0;
for (BugLeafNode bug : getMainBugSet().mainList) {
if (suppress(bug)) {
result++;
}
}
return result;
} | [
"static",
"int",
"countFilteredBugs",
"(",
")",
"{",
"int",
"result",
"=",
"0",
";",
"for",
"(",
"BugLeafNode",
"bug",
":",
"getMainBugSet",
"(",
")",
".",
"mainList",
")",
"{",
"if",
"(",
"suppress",
"(",
"bug",
")",
")",
"{",
"result",
"++",
";",
... | used to update the status bar in mainframe with the number of bugs that
are filtered out | [
"used",
"to",
"update",
"the",
"status",
"bar",
"in",
"mainframe",
"with",
"the",
"number",
"of",
"bugs",
"that",
"are",
"filtered",
"out"
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/gui/main/edu/umd/cs/findbugs/gui2/BugSet.java#L182-L191 |
59,499 | spotbugs/spotbugs | spotbugs/src/gui/main/edu/umd/cs/findbugs/gui2/BugSet.java | BugSet.query | public BugSet query(BugAspects a) {
BugSet result = this;
for (SortableValue sp : a) {
result = result.query(sp);
}
return result;
} | java | public BugSet query(BugAspects a) {
BugSet result = this;
for (SortableValue sp : a) {
result = result.query(sp);
}
return result;
} | [
"public",
"BugSet",
"query",
"(",
"BugAspects",
"a",
")",
"{",
"BugSet",
"result",
"=",
"this",
";",
"for",
"(",
"SortableValue",
"sp",
":",
"a",
")",
"{",
"result",
"=",
"result",
".",
"query",
"(",
"sp",
")",
";",
"}",
"return",
"result",
";",
"}... | Gives you back the BugSet containing all bugs that match your query | [
"Gives",
"you",
"back",
"the",
"BugSet",
"containing",
"all",
"bugs",
"that",
"match",
"your",
"query"
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/gui/main/edu/umd/cs/findbugs/gui2/BugSet.java#L341-L348 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.