repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/props/WarningPropertyUtil.java | WarningPropertyUtil.pcToLocation | private static Location pcToLocation(ClassContext classContext, Method method, int pc) throws CFGBuilderException {
CFG cfg = classContext.getCFG(method);
for (Iterator<Location> i = cfg.locationIterator(); i.hasNext();) {
Location location = i.next();
if (location.getHandle().ge... | java | private static Location pcToLocation(ClassContext classContext, Method method, int pc) throws CFGBuilderException {
CFG cfg = classContext.getCFG(method);
for (Iterator<Location> i = cfg.locationIterator(); i.hasNext();) {
Location location = i.next();
if (location.getHandle().ge... | [
"private",
"static",
"Location",
"pcToLocation",
"(",
"ClassContext",
"classContext",
",",
"Method",
"method",
",",
"int",
"pc",
")",
"throws",
"CFGBuilderException",
"{",
"CFG",
"cfg",
"=",
"classContext",
".",
"getCFG",
"(",
"method",
")",
";",
"for",
"(",
... | Get a Location matching the given PC value. Because of JSR subroutines,
there may be multiple Locations referring to the given instruction. This
method simply returns one of them arbitrarily.
@param classContext
the ClassContext containing the method
@param method
the method
@param pc
a PC value of an instruction in t... | [
"Get",
"a",
"Location",
"matching",
"the",
"given",
"PC",
"value",
".",
"Because",
"of",
"JSR",
"subroutines",
"there",
"may",
"be",
"multiple",
"Locations",
"referring",
"to",
"the",
"given",
"instruction",
".",
"This",
"method",
"simply",
"returns",
"one",
... | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/props/WarningPropertyUtil.java#L75-L84 | train |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/props/WarningPropertyUtil.java | WarningPropertyUtil.addReceiverObjectType | private static void addReceiverObjectType(WarningPropertySet<WarningProperty> propertySet, ClassContext classContext,
Method method, Location location) {
try {
Instruction ins = location.getHandle().getInstruction();
if (!receiverObjectInstructionSet.get(ins.getOpcode())) {
... | java | private static void addReceiverObjectType(WarningPropertySet<WarningProperty> propertySet, ClassContext classContext,
Method method, Location location) {
try {
Instruction ins = location.getHandle().getInstruction();
if (!receiverObjectInstructionSet.get(ins.getOpcode())) {
... | [
"private",
"static",
"void",
"addReceiverObjectType",
"(",
"WarningPropertySet",
"<",
"WarningProperty",
">",
"propertySet",
",",
"ClassContext",
"classContext",
",",
"Method",
"method",
",",
"Location",
"location",
")",
"{",
"try",
"{",
"Instruction",
"ins",
"=",
... | Add a RECEIVER_OBJECT_TYPE warning property for a particular location in
a method to given warning property set.
@param propertySet
the property set
@param classContext
ClassContext of the class containing the method
@param method
the method
@param location
Location within the method | [
"Add",
"a",
"RECEIVER_OBJECT_TYPE",
"warning",
"property",
"for",
"a",
"particular",
"location",
"in",
"a",
"method",
"to",
"given",
"warning",
"property",
"set",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/props/WarningPropertyUtil.java#L99-L121 | train |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/model/MovedClassMap.java | MovedClassMap.buildClassSet | private Set<String> buildClassSet(BugCollection bugCollection) {
Set<String> classSet = new HashSet<>();
for (Iterator<BugInstance> i = bugCollection.iterator(); i.hasNext();) {
BugInstance warning = i.next();
for (Iterator<BugAnnotation> j = warning.annotationIterator(); j.hasN... | java | private Set<String> buildClassSet(BugCollection bugCollection) {
Set<String> classSet = new HashSet<>();
for (Iterator<BugInstance> i = bugCollection.iterator(); i.hasNext();) {
BugInstance warning = i.next();
for (Iterator<BugAnnotation> j = warning.annotationIterator(); j.hasN... | [
"private",
"Set",
"<",
"String",
">",
"buildClassSet",
"(",
"BugCollection",
"bugCollection",
")",
"{",
"Set",
"<",
"String",
">",
"classSet",
"=",
"new",
"HashSet",
"<>",
"(",
")",
";",
"for",
"(",
"Iterator",
"<",
"BugInstance",
">",
"i",
"=",
"bugColl... | Find set of classes referenced in given BugCollection.
@param bugCollection
@return set of classes referenced in the BugCollection | [
"Find",
"set",
"of",
"classes",
"referenced",
"in",
"given",
"BugCollection",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/model/MovedClassMap.java#L109-L124 | train |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/detect/FindDeadLocalStores.java | FindDeadLocalStores.suppressWarningsIfOneLiveStoreOnLine | private void suppressWarningsIfOneLiveStoreOnLine(BugAccumulator accumulator, BitSet liveStoreSourceLineSet) {
if (!SUPPRESS_IF_AT_LEAST_ONE_LIVE_STORE_ON_LINE) {
return;
}
// Eliminate any accumulated warnings for instructions
// that (due to inlining) *can* be live stores.... | java | private void suppressWarningsIfOneLiveStoreOnLine(BugAccumulator accumulator, BitSet liveStoreSourceLineSet) {
if (!SUPPRESS_IF_AT_LEAST_ONE_LIVE_STORE_ON_LINE) {
return;
}
// Eliminate any accumulated warnings for instructions
// that (due to inlining) *can* be live stores.... | [
"private",
"void",
"suppressWarningsIfOneLiveStoreOnLine",
"(",
"BugAccumulator",
"accumulator",
",",
"BitSet",
"liveStoreSourceLineSet",
")",
"{",
"if",
"(",
"!",
"SUPPRESS_IF_AT_LEAST_ONE_LIVE_STORE_ON_LINE",
")",
"{",
"return",
";",
"}",
"// Eliminate any accumulated warni... | If feature is enabled, suppress warnings where there is at least one live
store on the line where the warning would be reported.
@param accumulator
BugAccumulator containing warnings for method
@param liveStoreSourceLineSet
bitset of lines where at least one live store was seen | [
"If",
"feature",
"is",
"enabled",
"suppress",
"warnings",
"where",
"there",
"is",
"at",
"least",
"one",
"live",
"store",
"on",
"the",
"line",
"where",
"the",
"warning",
"would",
"be",
"reported",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/detect/FindDeadLocalStores.java#L624-L642 | train |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/detect/FindDeadLocalStores.java | FindDeadLocalStores.countLocalStoresLoadsAndIncrements | private void countLocalStoresLoadsAndIncrements(int[] localStoreCount, int[] localLoadCount, int[] localIncrementCount,
CFG cfg) {
for (Iterator<Location> i = cfg.locationIterator(); i.hasNext();) {
Location location = i.next();
if (location.getBasicBlock().isExceptionHandle... | java | private void countLocalStoresLoadsAndIncrements(int[] localStoreCount, int[] localLoadCount, int[] localIncrementCount,
CFG cfg) {
for (Iterator<Location> i = cfg.locationIterator(); i.hasNext();) {
Location location = i.next();
if (location.getBasicBlock().isExceptionHandle... | [
"private",
"void",
"countLocalStoresLoadsAndIncrements",
"(",
"int",
"[",
"]",
"localStoreCount",
",",
"int",
"[",
"]",
"localLoadCount",
",",
"int",
"[",
"]",
"localIncrementCount",
",",
"CFG",
"cfg",
")",
"{",
"for",
"(",
"Iterator",
"<",
"Location",
">",
... | Count stores, loads, and increments of local variables in method whose
CFG is given.
@param localStoreCount
counts of local stores (indexed by local)
@param localLoadCount
counts of local loads (indexed by local)
@param localIncrementCount
counts of local increments (indexed by local)
@param cfg
control flow graph (CF... | [
"Count",
"stores",
"loads",
"and",
"increments",
"of",
"local",
"variables",
"in",
"method",
"whose",
"CFG",
"is",
"given",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/detect/FindDeadLocalStores.java#L657-L684 | train |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/detect/FindDeadLocalStores.java | FindDeadLocalStores.isStore | private boolean isStore(Location location) {
Instruction ins = location.getHandle().getInstruction();
return (ins instanceof StoreInstruction) || (ins instanceof IINC);
} | java | private boolean isStore(Location location) {
Instruction ins = location.getHandle().getInstruction();
return (ins instanceof StoreInstruction) || (ins instanceof IINC);
} | [
"private",
"boolean",
"isStore",
"(",
"Location",
"location",
")",
"{",
"Instruction",
"ins",
"=",
"location",
".",
"getHandle",
"(",
")",
".",
"getInstruction",
"(",
")",
";",
"return",
"(",
"ins",
"instanceof",
"StoreInstruction",
")",
"||",
"(",
"ins",
... | Is instruction at given location a store?
@param location
the location
@return true if instruction at given location is a store, false if not | [
"Is",
"instruction",
"at",
"given",
"location",
"a",
"store?"
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/detect/FindDeadLocalStores.java#L716-L719 | train |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/detect/FindDeadLocalStores.java | FindDeadLocalStores.isLoad | private boolean isLoad(Location location) {
Instruction ins = location.getHandle().getInstruction();
return (ins instanceof LoadInstruction) || (ins instanceof IINC);
} | java | private boolean isLoad(Location location) {
Instruction ins = location.getHandle().getInstruction();
return (ins instanceof LoadInstruction) || (ins instanceof IINC);
} | [
"private",
"boolean",
"isLoad",
"(",
"Location",
"location",
")",
"{",
"Instruction",
"ins",
"=",
"location",
".",
"getHandle",
"(",
")",
".",
"getInstruction",
"(",
")",
";",
"return",
"(",
"ins",
"instanceof",
"LoadInstruction",
")",
"||",
"(",
"ins",
"i... | Is instruction at given location a load?
@param location
the location
@return true if instruction at given location is a load, false if not | [
"Is",
"instruction",
"at",
"given",
"location",
"a",
"load?"
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/detect/FindDeadLocalStores.java#L728-L731 | train |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/classfile/analysis/AnnotationValue.java | AnnotationValue.getAnnotationVisitor | public AnnotationVisitor getAnnotationVisitor() {
return new AnnotationVisitor(FindBugsASM.ASM_VERSION) {
@Override
public void visit(String name, Object value) {
name = canonicalString(name);
valueMap.put(name, value);
}
/*
... | java | public AnnotationVisitor getAnnotationVisitor() {
return new AnnotationVisitor(FindBugsASM.ASM_VERSION) {
@Override
public void visit(String name, Object value) {
name = canonicalString(name);
valueMap.put(name, value);
}
/*
... | [
"public",
"AnnotationVisitor",
"getAnnotationVisitor",
"(",
")",
"{",
"return",
"new",
"AnnotationVisitor",
"(",
"FindBugsASM",
".",
"ASM_VERSION",
")",
"{",
"@",
"Override",
"public",
"void",
"visit",
"(",
"String",
"name",
",",
"Object",
"value",
")",
"{",
"... | Get an AnnotationVisitor which can populate this AnnotationValue object. | [
"Get",
"an",
"AnnotationVisitor",
"which",
"can",
"populate",
"this",
"AnnotationValue",
"object",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/classfile/analysis/AnnotationValue.java#L113-L174 | train |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/classfile/engine/ClassParser.java | ClassParser.readConstant | private Constant readConstant() throws InvalidClassFileFormatException, IOException {
int tag = in.readUnsignedByte();
if (tag < 0 || tag >= CONSTANT_FORMAT_MAP.length) {
throw new InvalidClassFileFormatException(expectedClassDescriptor, codeBaseEntry);
}
String format = CONS... | java | private Constant readConstant() throws InvalidClassFileFormatException, IOException {
int tag = in.readUnsignedByte();
if (tag < 0 || tag >= CONSTANT_FORMAT_MAP.length) {
throw new InvalidClassFileFormatException(expectedClassDescriptor, codeBaseEntry);
}
String format = CONS... | [
"private",
"Constant",
"readConstant",
"(",
")",
"throws",
"InvalidClassFileFormatException",
",",
"IOException",
"{",
"int",
"tag",
"=",
"in",
".",
"readUnsignedByte",
"(",
")",
";",
"if",
"(",
"tag",
"<",
"0",
"||",
"tag",
">=",
"CONSTANT_FORMAT_MAP",
".",
... | Read a constant from the constant pool. Return null for
@return a StaticConstant
@throws InvalidClassFileFormatException
@throws IOException | [
"Read",
"a",
"constant",
"from",
"the",
"constant",
"pool",
".",
"Return",
"null",
"for"
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/classfile/engine/ClassParser.java#L243-L284 | train |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/classfile/engine/ClassParser.java | ClassParser.getUtf8String | private String getUtf8String(int refIndex) throws InvalidClassFileFormatException {
checkConstantPoolIndex(refIndex);
Constant refConstant = constantPool[refIndex];
checkConstantTag(refConstant, IClassConstants.CONSTANT_Utf8);
return (String) refConstant.data[0];
} | java | private String getUtf8String(int refIndex) throws InvalidClassFileFormatException {
checkConstantPoolIndex(refIndex);
Constant refConstant = constantPool[refIndex];
checkConstantTag(refConstant, IClassConstants.CONSTANT_Utf8);
return (String) refConstant.data[0];
} | [
"private",
"String",
"getUtf8String",
"(",
"int",
"refIndex",
")",
"throws",
"InvalidClassFileFormatException",
"{",
"checkConstantPoolIndex",
"(",
"refIndex",
")",
";",
"Constant",
"refConstant",
"=",
"constantPool",
"[",
"refIndex",
"]",
";",
"checkConstantTag",
"("... | Get the UTF-8 string constant at given constant pool index.
@param refIndex
the constant pool index
@return the String at that index
@throws InvalidClassFileFormatException | [
"Get",
"the",
"UTF",
"-",
"8",
"string",
"constant",
"at",
"given",
"constant",
"pool",
"index",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/classfile/engine/ClassParser.java#L333-L338 | train |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/classfile/engine/ClassParser.java | ClassParser.checkConstantPoolIndex | private void checkConstantPoolIndex(int index) throws InvalidClassFileFormatException {
if (index < 0 || index >= constantPool.length || constantPool[index] == null) {
throw new InvalidClassFileFormatException(expectedClassDescriptor, codeBaseEntry);
}
} | java | private void checkConstantPoolIndex(int index) throws InvalidClassFileFormatException {
if (index < 0 || index >= constantPool.length || constantPool[index] == null) {
throw new InvalidClassFileFormatException(expectedClassDescriptor, codeBaseEntry);
}
} | [
"private",
"void",
"checkConstantPoolIndex",
"(",
"int",
"index",
")",
"throws",
"InvalidClassFileFormatException",
"{",
"if",
"(",
"index",
"<",
"0",
"||",
"index",
">=",
"constantPool",
".",
"length",
"||",
"constantPool",
"[",
"index",
"]",
"==",
"null",
")... | Check that a constant pool index is valid.
@param index
the index to check
@throws InvalidClassFileFormatException
if the index is not valid | [
"Check",
"that",
"a",
"constant",
"pool",
"index",
"is",
"valid",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/classfile/engine/ClassParser.java#L348-L352 | train |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/classfile/engine/ClassParser.java | ClassParser.checkConstantTag | private void checkConstantTag(Constant constant, int expectedTag) throws InvalidClassFileFormatException {
if (constant.tag != expectedTag) {
throw new InvalidClassFileFormatException(expectedClassDescriptor, codeBaseEntry);
}
} | java | private void checkConstantTag(Constant constant, int expectedTag) throws InvalidClassFileFormatException {
if (constant.tag != expectedTag) {
throw new InvalidClassFileFormatException(expectedClassDescriptor, codeBaseEntry);
}
} | [
"private",
"void",
"checkConstantTag",
"(",
"Constant",
"constant",
",",
"int",
"expectedTag",
")",
"throws",
"InvalidClassFileFormatException",
"{",
"if",
"(",
"constant",
".",
"tag",
"!=",
"expectedTag",
")",
"{",
"throw",
"new",
"InvalidClassFileFormatException",
... | Check that a constant has the expected tag.
@param constant
the constant to check
@param expectedTag
the expected constant tag
@throws InvalidClassFileFormatException
if the constant's tag does not match the expected tag | [
"Check",
"that",
"a",
"constant",
"has",
"the",
"expected",
"tag",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/classfile/engine/ClassParser.java#L364-L368 | train |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/classfile/engine/ClassParser.java | ClassParser.getSignatureFromNameAndType | private String getSignatureFromNameAndType(int index) throws InvalidClassFileFormatException {
checkConstantPoolIndex(index);
Constant constant = constantPool[index];
checkConstantTag(constant, IClassConstants.CONSTANT_NameAndType);
return getUtf8String((Integer) constant.data[1]);
} | java | private String getSignatureFromNameAndType(int index) throws InvalidClassFileFormatException {
checkConstantPoolIndex(index);
Constant constant = constantPool[index];
checkConstantTag(constant, IClassConstants.CONSTANT_NameAndType);
return getUtf8String((Integer) constant.data[1]);
} | [
"private",
"String",
"getSignatureFromNameAndType",
"(",
"int",
"index",
")",
"throws",
"InvalidClassFileFormatException",
"{",
"checkConstantPoolIndex",
"(",
"index",
")",
";",
"Constant",
"constant",
"=",
"constantPool",
"[",
"index",
"]",
";",
"checkConstantTag",
"... | Get the signature from a CONSTANT_NameAndType.
@param index
the index of the CONSTANT_NameAndType
@return the signature
@throws InvalidClassFileFormatException | [
"Get",
"the",
"signature",
"from",
"a",
"CONSTANT_NameAndType",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/classfile/engine/ClassParser.java#L496-L501 | train |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/deref/UnconditionalValueDerefAnalysis.java | UnconditionalValueDerefAnalysis.checkUnconditionalDerefDatabase | private void checkUnconditionalDerefDatabase(Location location, ValueNumberFrame vnaFrame, UnconditionalValueDerefSet fact)
throws DataflowAnalysisException {
ConstantPoolGen constantPool = methodGen.getConstantPool();
for (ValueNumber vn : checkUnconditionalDerefDatabase(location, vnaFrame... | java | private void checkUnconditionalDerefDatabase(Location location, ValueNumberFrame vnaFrame, UnconditionalValueDerefSet fact)
throws DataflowAnalysisException {
ConstantPoolGen constantPool = methodGen.getConstantPool();
for (ValueNumber vn : checkUnconditionalDerefDatabase(location, vnaFrame... | [
"private",
"void",
"checkUnconditionalDerefDatabase",
"(",
"Location",
"location",
",",
"ValueNumberFrame",
"vnaFrame",
",",
"UnconditionalValueDerefSet",
"fact",
")",
"throws",
"DataflowAnalysisException",
"{",
"ConstantPoolGen",
"constantPool",
"=",
"methodGen",
".",
"get... | Check method call at given location to see if it unconditionally
dereferences a parameter. Mark any such arguments as derefs.
@param location
the Location of the method call
@param vnaFrame
ValueNumberFrame at the Location
@param fact
the dataflow value to modify
@throws DataflowAnalysisException | [
"Check",
"method",
"call",
"at",
"given",
"location",
"to",
"see",
"if",
"it",
"unconditionally",
"dereferences",
"a",
"parameter",
".",
"Mark",
"any",
"such",
"arguments",
"as",
"derefs",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/deref/UnconditionalValueDerefAnalysis.java#L319-L327 | train |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/deref/UnconditionalValueDerefAnalysis.java | UnconditionalValueDerefAnalysis.checkInstance | private void checkInstance(Location location, ValueNumberFrame vnaFrame, UnconditionalValueDerefSet fact)
throws DataflowAnalysisException {
// See if this instruction has a null check.
// If it does, the fall through predecessor will be
// identify itself as the null check.
... | java | private void checkInstance(Location location, ValueNumberFrame vnaFrame, UnconditionalValueDerefSet fact)
throws DataflowAnalysisException {
// See if this instruction has a null check.
// If it does, the fall through predecessor will be
// identify itself as the null check.
... | [
"private",
"void",
"checkInstance",
"(",
"Location",
"location",
",",
"ValueNumberFrame",
"vnaFrame",
",",
"UnconditionalValueDerefSet",
"fact",
")",
"throws",
"DataflowAnalysisException",
"{",
"// See if this instruction has a null check.",
"// If it does, the fall through predece... | Check to see if the instruction has a null check associated with it, and
if so, add a dereference.
@param location
the Location of the instruction
@param vnaFrame
ValueNumberFrame at the Location of the instruction
@param fact
the dataflow value to modify
@throws DataflowAnalysisException | [
"Check",
"to",
"see",
"if",
"the",
"instruction",
"has",
"a",
"null",
"check",
"associated",
"with",
"it",
"and",
"if",
"so",
"add",
"a",
"dereference",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/deref/UnconditionalValueDerefAnalysis.java#L600-L655 | train |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/deref/UnconditionalValueDerefAnalysis.java | UnconditionalValueDerefAnalysis.duplicateFact | private UnconditionalValueDerefSet duplicateFact(UnconditionalValueDerefSet fact) {
UnconditionalValueDerefSet copyOfFact = createFact();
copy(fact, copyOfFact);
fact = copyOfFact;
return fact;
} | java | private UnconditionalValueDerefSet duplicateFact(UnconditionalValueDerefSet fact) {
UnconditionalValueDerefSet copyOfFact = createFact();
copy(fact, copyOfFact);
fact = copyOfFact;
return fact;
} | [
"private",
"UnconditionalValueDerefSet",
"duplicateFact",
"(",
"UnconditionalValueDerefSet",
"fact",
")",
"{",
"UnconditionalValueDerefSet",
"copyOfFact",
"=",
"createFact",
"(",
")",
";",
"copy",
"(",
"fact",
",",
"copyOfFact",
")",
";",
"fact",
"=",
"copyOfFact",
... | Return a duplicate of given dataflow fact.
@param fact
a dataflow fact
@return a duplicate of the input dataflow fact | [
"Return",
"a",
"duplicate",
"of",
"given",
"dataflow",
"fact",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/deref/UnconditionalValueDerefAnalysis.java#L892-L897 | train |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/deref/UnconditionalValueDerefAnalysis.java | UnconditionalValueDerefAnalysis.findValueKnownNonnullOnBranch | private @CheckForNull
ValueNumber findValueKnownNonnullOnBranch(UnconditionalValueDerefSet fact, Edge edge) {
IsNullValueFrame invFrame = invDataflow.getResultFact(edge.getSource());
if (!invFrame.isValid()) {
return null;
}
IsNullConditionDecision decision = invFrame.ge... | java | private @CheckForNull
ValueNumber findValueKnownNonnullOnBranch(UnconditionalValueDerefSet fact, Edge edge) {
IsNullValueFrame invFrame = invDataflow.getResultFact(edge.getSource());
if (!invFrame.isValid()) {
return null;
}
IsNullConditionDecision decision = invFrame.ge... | [
"private",
"@",
"CheckForNull",
"ValueNumber",
"findValueKnownNonnullOnBranch",
"(",
"UnconditionalValueDerefSet",
"fact",
",",
"Edge",
"edge",
")",
"{",
"IsNullValueFrame",
"invFrame",
"=",
"invDataflow",
".",
"getResultFact",
"(",
"edge",
".",
"getSource",
"(",
")",... | Clear deref sets of values if this edge is the non-null branch of an if
comparison.
@param fact
a datflow fact
@param edge
edge to check
@return possibly-modified dataflow fact | [
"Clear",
"deref",
"sets",
"of",
"values",
"if",
"this",
"edge",
"is",
"the",
"non",
"-",
"null",
"branch",
"of",
"an",
"if",
"comparison",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/deref/UnconditionalValueDerefAnalysis.java#L909-L931 | train |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/deref/UnconditionalValueDerefAnalysis.java | UnconditionalValueDerefAnalysis.isExceptionEdge | private boolean isExceptionEdge(Edge edge) {
boolean isExceptionEdge = edge.isExceptionEdge();
if (isExceptionEdge) {
if (DEBUG) {
System.out.println("NOT Ignoring " + edge);
}
return true; // false
}
if (edge.getType() != EdgeTypes.FAL... | java | private boolean isExceptionEdge(Edge edge) {
boolean isExceptionEdge = edge.isExceptionEdge();
if (isExceptionEdge) {
if (DEBUG) {
System.out.println("NOT Ignoring " + edge);
}
return true; // false
}
if (edge.getType() != EdgeTypes.FAL... | [
"private",
"boolean",
"isExceptionEdge",
"(",
"Edge",
"edge",
")",
"{",
"boolean",
"isExceptionEdge",
"=",
"edge",
".",
"isExceptionEdge",
"(",
")",
";",
"if",
"(",
"isExceptionEdge",
")",
"{",
"if",
"(",
"DEBUG",
")",
"{",
"System",
".",
"out",
".",
"pr... | Determine whether dataflow should be propagated on given edge.
@param edge
the edge
@return true if dataflow should be propagated on the edge, false
otherwise | [
"Determine",
"whether",
"dataflow",
"should",
"be",
"propagated",
"on",
"given",
"edge",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/deref/UnconditionalValueDerefAnalysis.java#L941-L956 | train |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/Hierarchy.java | Hierarchy.isSubtype | public static boolean isSubtype(ReferenceType t, ReferenceType possibleSupertype) throws ClassNotFoundException {
return Global.getAnalysisCache().getDatabase(Subtypes2.class).isSubtype(t, possibleSupertype);
} | java | public static boolean isSubtype(ReferenceType t, ReferenceType possibleSupertype) throws ClassNotFoundException {
return Global.getAnalysisCache().getDatabase(Subtypes2.class).isSubtype(t, possibleSupertype);
} | [
"public",
"static",
"boolean",
"isSubtype",
"(",
"ReferenceType",
"t",
",",
"ReferenceType",
"possibleSupertype",
")",
"throws",
"ClassNotFoundException",
"{",
"return",
"Global",
".",
"getAnalysisCache",
"(",
")",
".",
"getDatabase",
"(",
"Subtypes2",
".",
"class",... | Determine if one reference type is a subtype of another.
@param t
a reference type
@param possibleSupertype
the possible supertype
@return true if t is a subtype of possibleSupertype, false if not | [
"Determine",
"if",
"one",
"reference",
"type",
"is",
"a",
"subtype",
"of",
"another",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/Hierarchy.java#L109-L111 | train |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/Hierarchy.java | Hierarchy.isMonitorWait | public static boolean isMonitorWait(String methodName, String methodSig) {
return "wait".equals(methodName) && ("()V".equals(methodSig) || "(J)V".equals(methodSig) || "(JI)V".equals(methodSig));
} | java | public static boolean isMonitorWait(String methodName, String methodSig) {
return "wait".equals(methodName) && ("()V".equals(methodSig) || "(J)V".equals(methodSig) || "(JI)V".equals(methodSig));
} | [
"public",
"static",
"boolean",
"isMonitorWait",
"(",
"String",
"methodName",
",",
"String",
"methodSig",
")",
"{",
"return",
"\"wait\"",
".",
"equals",
"(",
"methodName",
")",
"&&",
"(",
"\"()V\"",
".",
"equals",
"(",
"methodSig",
")",
"||",
"\"(J)V\"",
".",... | Determine if method whose name and signature is specified is a monitor
wait operation.
@param methodName
name of the method
@param methodSig
signature of the method
@return true if the method is a monitor wait, false if not | [
"Determine",
"if",
"method",
"whose",
"name",
"and",
"signature",
"is",
"specified",
"is",
"a",
"monitor",
"wait",
"operation",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/Hierarchy.java#L151-L153 | train |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/Hierarchy.java | Hierarchy.isMonitorNotify | public static boolean isMonitorNotify(String methodName, String methodSig) {
return ("notify".equals(methodName) || "notifyAll".equals(methodName)) && "()V".equals(methodSig);
} | java | public static boolean isMonitorNotify(String methodName, String methodSig) {
return ("notify".equals(methodName) || "notifyAll".equals(methodName)) && "()V".equals(methodSig);
} | [
"public",
"static",
"boolean",
"isMonitorNotify",
"(",
"String",
"methodName",
",",
"String",
"methodSig",
")",
"{",
"return",
"(",
"\"notify\"",
".",
"equals",
"(",
"methodName",
")",
"||",
"\"notifyAll\"",
".",
"equals",
"(",
"methodName",
")",
")",
"&&",
... | Determine if method whose name and signature is specified is a monitor
notify operation.
@param methodName
name of the method
@param methodSig
signature of the method
@return true if the method is a monitor notify, false if not | [
"Determine",
"if",
"method",
"whose",
"name",
"and",
"signature",
"is",
"specified",
"is",
"a",
"monitor",
"notify",
"operation",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/Hierarchy.java#L190-L192 | train |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/Hierarchy.java | Hierarchy.isMonitorNotify | public static boolean isMonitorNotify(Instruction ins, ConstantPoolGen cpg) {
if (!(ins instanceof InvokeInstruction)) {
return false;
}
if (ins.getOpcode() == Const.INVOKESTATIC) {
return false;
}
InvokeInstruction inv = (InvokeInstruction) ins;
... | java | public static boolean isMonitorNotify(Instruction ins, ConstantPoolGen cpg) {
if (!(ins instanceof InvokeInstruction)) {
return false;
}
if (ins.getOpcode() == Const.INVOKESTATIC) {
return false;
}
InvokeInstruction inv = (InvokeInstruction) ins;
... | [
"public",
"static",
"boolean",
"isMonitorNotify",
"(",
"Instruction",
"ins",
",",
"ConstantPoolGen",
"cpg",
")",
"{",
"if",
"(",
"!",
"(",
"ins",
"instanceof",
"InvokeInstruction",
")",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"ins",
".",
"getOpco... | Determine if given Instruction is a monitor wait.
@param ins
the Instruction
@param cpg
the ConstantPoolGen for the Instruction
@return true if the instruction is a monitor wait, false if not | [
"Determine",
"if",
"given",
"Instruction",
"is",
"a",
"monitor",
"wait",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/Hierarchy.java#L204-L217 | train |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/Hierarchy.java | Hierarchy.visitSuperClassMethods | public static JavaClassAndMethod visitSuperClassMethods(JavaClassAndMethod method, JavaClassAndMethodChooser chooser)
throws ClassNotFoundException {
return findMethod(method.getJavaClass().getSuperClasses(), method.getMethod().getName(), method.getMethod()
.getSignature(), chooser);... | java | public static JavaClassAndMethod visitSuperClassMethods(JavaClassAndMethod method, JavaClassAndMethodChooser chooser)
throws ClassNotFoundException {
return findMethod(method.getJavaClass().getSuperClasses(), method.getMethod().getName(), method.getMethod()
.getSignature(), chooser);... | [
"public",
"static",
"JavaClassAndMethod",
"visitSuperClassMethods",
"(",
"JavaClassAndMethod",
"method",
",",
"JavaClassAndMethodChooser",
"chooser",
")",
"throws",
"ClassNotFoundException",
"{",
"return",
"findMethod",
"(",
"method",
".",
"getJavaClass",
"(",
")",
".",
... | Visit all superclass methods which the given method overrides.
@param method
the method
@param chooser
chooser which visits each superclass method
@return the chosen method, or null if no method is chosen
@throws ClassNotFoundException | [
"Visit",
"all",
"superclass",
"methods",
"which",
"the",
"given",
"method",
"overrides",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/Hierarchy.java#L272-L276 | train |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/Hierarchy.java | Hierarchy.visitSuperInterfaceMethods | public static JavaClassAndMethod visitSuperInterfaceMethods(JavaClassAndMethod method, JavaClassAndMethodChooser chooser)
throws ClassNotFoundException {
return findMethod(method.getJavaClass().getAllInterfaces(), method.getMethod().getName(), method.getMethod()
.getSignature(), choo... | java | public static JavaClassAndMethod visitSuperInterfaceMethods(JavaClassAndMethod method, JavaClassAndMethodChooser chooser)
throws ClassNotFoundException {
return findMethod(method.getJavaClass().getAllInterfaces(), method.getMethod().getName(), method.getMethod()
.getSignature(), choo... | [
"public",
"static",
"JavaClassAndMethod",
"visitSuperInterfaceMethods",
"(",
"JavaClassAndMethod",
"method",
",",
"JavaClassAndMethodChooser",
"chooser",
")",
"throws",
"ClassNotFoundException",
"{",
"return",
"findMethod",
"(",
"method",
".",
"getJavaClass",
"(",
")",
".... | Visit all superinterface methods which the given method implements.
@param method
the method
@param chooser
chooser which visits each superinterface method
@return the chosen method, or null if no method is chosen
@throws ClassNotFoundException | [
"Visit",
"all",
"superinterface",
"methods",
"which",
"the",
"given",
"method",
"implements",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/Hierarchy.java#L288-L292 | train |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/Hierarchy.java | Hierarchy.resolveMethodCallTargets | public static Set<JavaClassAndMethod> resolveMethodCallTargets(ReferenceType receiverType,
InvokeInstruction invokeInstruction, ConstantPoolGen cpg) throws ClassNotFoundException {
return resolveMethodCallTargets(receiverType, invokeInstruction, cpg, false);
} | java | public static Set<JavaClassAndMethod> resolveMethodCallTargets(ReferenceType receiverType,
InvokeInstruction invokeInstruction, ConstantPoolGen cpg) throws ClassNotFoundException {
return resolveMethodCallTargets(receiverType, invokeInstruction, cpg, false);
} | [
"public",
"static",
"Set",
"<",
"JavaClassAndMethod",
">",
"resolveMethodCallTargets",
"(",
"ReferenceType",
"receiverType",
",",
"InvokeInstruction",
"invokeInstruction",
",",
"ConstantPoolGen",
"cpg",
")",
"throws",
"ClassNotFoundException",
"{",
"return",
"resolveMethodC... | Resolve possible instance method call targets. Assumes that invokevirtual
and invokeinterface methods may call any subtype of the receiver class.
@param receiverType
type of the receiver object
@param invokeInstruction
the InvokeInstruction
@param cpg
the ConstantPoolGen
@return Set of methods which might be called
@t... | [
"Resolve",
"possible",
"instance",
"method",
"call",
"targets",
".",
"Assumes",
"that",
"invokevirtual",
"and",
"invokeinterface",
"methods",
"may",
"call",
"any",
"subtype",
"of",
"the",
"receiver",
"class",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/Hierarchy.java#L774-L777 | train |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/Hierarchy.java | Hierarchy.isConcrete | @Deprecated
public static boolean isConcrete(XMethod xmethod) {
int accessFlags = xmethod.getAccessFlags();
return (accessFlags & Const.ACC_ABSTRACT) == 0 && (accessFlags & Const.ACC_NATIVE) == 0;
} | java | @Deprecated
public static boolean isConcrete(XMethod xmethod) {
int accessFlags = xmethod.getAccessFlags();
return (accessFlags & Const.ACC_ABSTRACT) == 0 && (accessFlags & Const.ACC_NATIVE) == 0;
} | [
"@",
"Deprecated",
"public",
"static",
"boolean",
"isConcrete",
"(",
"XMethod",
"xmethod",
")",
"{",
"int",
"accessFlags",
"=",
"xmethod",
".",
"getAccessFlags",
"(",
")",
";",
"return",
"(",
"accessFlags",
"&",
"Const",
".",
"ACC_ABSTRACT",
")",
"==",
"0",
... | Return whether or not the given method is concrete.
@param xmethod
the method
@return true if the method is concrete, false otherwise | [
"Return",
"whether",
"or",
"not",
"the",
"given",
"method",
"is",
"concrete",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/Hierarchy.java#L875-L879 | train |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/Hierarchy.java | Hierarchy.findField | public static Field findField(String className, String fieldName) throws ClassNotFoundException {
JavaClass jclass = Repository.lookupClass(className);
while (jclass != null) {
Field[] fieldList = jclass.getFields();
for (Field field : fieldList) {
if (field.getN... | java | public static Field findField(String className, String fieldName) throws ClassNotFoundException {
JavaClass jclass = Repository.lookupClass(className);
while (jclass != null) {
Field[] fieldList = jclass.getFields();
for (Field field : fieldList) {
if (field.getN... | [
"public",
"static",
"Field",
"findField",
"(",
"String",
"className",
",",
"String",
"fieldName",
")",
"throws",
"ClassNotFoundException",
"{",
"JavaClass",
"jclass",
"=",
"Repository",
".",
"lookupClass",
"(",
"className",
")",
";",
"while",
"(",
"jclass",
"!="... | Find a field with given name defined in given class.
@param className
the name of the class
@param fieldName
the name of the field
@return the Field, or null if no such field could be found | [
"Find",
"a",
"field",
"with",
"given",
"name",
"defined",
"in",
"given",
"class",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/Hierarchy.java#L890-L905 | train |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/Hierarchy.java | Hierarchy.isInnerClassAccess | public static boolean isInnerClassAccess(INVOKESTATIC inv, ConstantPoolGen cpg) {
String methodName = inv.getName(cpg);
return methodName.startsWith("access$");
} | java | public static boolean isInnerClassAccess(INVOKESTATIC inv, ConstantPoolGen cpg) {
String methodName = inv.getName(cpg);
return methodName.startsWith("access$");
} | [
"public",
"static",
"boolean",
"isInnerClassAccess",
"(",
"INVOKESTATIC",
"inv",
",",
"ConstantPoolGen",
"cpg",
")",
"{",
"String",
"methodName",
"=",
"inv",
".",
"getName",
"(",
"cpg",
")",
";",
"return",
"methodName",
".",
"startsWith",
"(",
"\"access$\"",
"... | Determine whether the given INVOKESTATIC instruction is an inner-class
field accessor method.
@param inv
the INVOKESTATIC instruction
@param cpg
the ConstantPoolGen for the method
@return true if the instruction is an inner-class field accessor, false
if not | [
"Determine",
"whether",
"the",
"given",
"INVOKESTATIC",
"instruction",
"is",
"an",
"inner",
"-",
"class",
"field",
"accessor",
"method",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/Hierarchy.java#L970-L973 | train |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/Hierarchy.java | Hierarchy.getInnerClassAccess | public static InnerClassAccess getInnerClassAccess(INVOKESTATIC inv, ConstantPoolGen cpg) throws ClassNotFoundException {
String className = inv.getClassName(cpg);
String methodName = inv.getName(cpg);
String methodSig = inv.getSignature(cpg);
InnerClassAccess access = AnalysisContext.... | java | public static InnerClassAccess getInnerClassAccess(INVOKESTATIC inv, ConstantPoolGen cpg) throws ClassNotFoundException {
String className = inv.getClassName(cpg);
String methodName = inv.getName(cpg);
String methodSig = inv.getSignature(cpg);
InnerClassAccess access = AnalysisContext.... | [
"public",
"static",
"InnerClassAccess",
"getInnerClassAccess",
"(",
"INVOKESTATIC",
"inv",
",",
"ConstantPoolGen",
"cpg",
")",
"throws",
"ClassNotFoundException",
"{",
"String",
"className",
"=",
"inv",
".",
"getClassName",
"(",
"cpg",
")",
";",
"String",
"methodNam... | Get the InnerClassAccess for access method called by given INVOKESTATIC.
@param inv
the INVOKESTATIC instruction
@param cpg
the ConstantPoolGen for the method
@return the InnerClassAccess, or null if the instruction is not an
inner-class access | [
"Get",
"the",
"InnerClassAccess",
"for",
"access",
"method",
"called",
"by",
"given",
"INVOKESTATIC",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/Hierarchy.java#L985-L994 | train |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/config/SortedProperties.java | SortedProperties.keys | @SuppressWarnings("unchecked")
@Override
public synchronized Enumeration<Object> keys() {
// sort elements based on detector (prop key) names
Set<?> set = keySet();
return (Enumeration<Object>) sortKeys((Set<String>) set);
} | java | @SuppressWarnings("unchecked")
@Override
public synchronized Enumeration<Object> keys() {
// sort elements based on detector (prop key) names
Set<?> set = keySet();
return (Enumeration<Object>) sortKeys((Set<String>) set);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"@",
"Override",
"public",
"synchronized",
"Enumeration",
"<",
"Object",
">",
"keys",
"(",
")",
"{",
"// sort elements based on detector (prop key) names",
"Set",
"<",
"?",
">",
"set",
"=",
"keySet",
"(",
")",
... | Overriden to be able to write properties sorted by keys to the disk
@see java.util.Hashtable#keys() | [
"Overriden",
"to",
"be",
"able",
"to",
"write",
"properties",
"sorted",
"by",
"keys",
"to",
"the",
"disk"
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/config/SortedProperties.java#L19-L25 | train |
spotbugs/spotbugs | eclipsePlugin/src/de/tobject/findbugs/builder/FindBugsWorker.java | FindBugsWorker.loadXml | public void loadXml(String fileName) throws CoreException {
if (fileName == null) {
return;
}
st = new StopTimer();
// clear markers
clearMarkers(null);
final Project findBugsProject = new Project();
final Reporter bugReporter = new Reporter(javaProj... | java | public void loadXml(String fileName) throws CoreException {
if (fileName == null) {
return;
}
st = new StopTimer();
// clear markers
clearMarkers(null);
final Project findBugsProject = new Project();
final Reporter bugReporter = new Reporter(javaProj... | [
"public",
"void",
"loadXml",
"(",
"String",
"fileName",
")",
"throws",
"CoreException",
"{",
"if",
"(",
"fileName",
"==",
"null",
")",
"{",
"return",
";",
"}",
"st",
"=",
"new",
"StopTimer",
"(",
")",
";",
"// clear markers",
"clearMarkers",
"(",
"null",
... | Load existing FindBugs xml report for the given collection of files.
@param fileName
xml file name to load bugs from
@throws CoreException | [
"Load",
"existing",
"FindBugs",
"xml",
"report",
"for",
"the",
"given",
"collection",
"of",
"files",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/builder/FindBugsWorker.java#L247-L264 | train |
spotbugs/spotbugs | eclipsePlugin/src/de/tobject/findbugs/builder/FindBugsWorker.java | FindBugsWorker.clearMarkers | private void clearMarkers(List<WorkItem> files) throws CoreException {
if (files == null) {
project.deleteMarkers(FindBugsMarker.NAME, true, IResource.DEPTH_INFINITE);
return;
}
for (WorkItem item : files) {
if (item != null) {
item.clearMarker... | java | private void clearMarkers(List<WorkItem> files) throws CoreException {
if (files == null) {
project.deleteMarkers(FindBugsMarker.NAME, true, IResource.DEPTH_INFINITE);
return;
}
for (WorkItem item : files) {
if (item != null) {
item.clearMarker... | [
"private",
"void",
"clearMarkers",
"(",
"List",
"<",
"WorkItem",
">",
"files",
")",
"throws",
"CoreException",
"{",
"if",
"(",
"files",
"==",
"null",
")",
"{",
"project",
".",
"deleteMarkers",
"(",
"FindBugsMarker",
".",
"NAME",
",",
"true",
",",
"IResourc... | Clear associated markers
@param files | [
"Clear",
"associated",
"markers"
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/builder/FindBugsWorker.java#L271-L281 | train |
spotbugs/spotbugs | eclipsePlugin/src/de/tobject/findbugs/builder/FindBugsWorker.java | FindBugsWorker.collectClassFiles | private void collectClassFiles(List<WorkItem> resources, Map<IPath, IPath> outLocations, Project fbProject) {
for (WorkItem workItem : resources) {
workItem.addFilesToProject(fbProject, outLocations);
}
} | java | private void collectClassFiles(List<WorkItem> resources, Map<IPath, IPath> outLocations, Project fbProject) {
for (WorkItem workItem : resources) {
workItem.addFilesToProject(fbProject, outLocations);
}
} | [
"private",
"void",
"collectClassFiles",
"(",
"List",
"<",
"WorkItem",
">",
"resources",
",",
"Map",
"<",
"IPath",
",",
"IPath",
">",
"outLocations",
",",
"Project",
"fbProject",
")",
"{",
"for",
"(",
"WorkItem",
"workItem",
":",
"resources",
")",
"{",
"wor... | Updates given outputFiles map with class name patterns matching given
java source names
@param resources
java sources
@param outLocations
key is src root, value is output location this directory
@param fbProject | [
"Updates",
"given",
"outputFiles",
"map",
"with",
"class",
"name",
"patterns",
"matching",
"given",
"java",
"source",
"names"
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/builder/FindBugsWorker.java#L293-L297 | train |
spotbugs/spotbugs | eclipsePlugin/src/de/tobject/findbugs/builder/FindBugsWorker.java | FindBugsWorker.runFindBugs | private void runFindBugs(final FindBugs2 findBugs) {
if (DEBUG) {
FindbugsPlugin.log("Running findbugs in thread " + Thread.currentThread().getName());
}
System.setProperty("findbugs.progress", "true");
try {
// Perform the analysis! (note: This is not thread-safe... | java | private void runFindBugs(final FindBugs2 findBugs) {
if (DEBUG) {
FindbugsPlugin.log("Running findbugs in thread " + Thread.currentThread().getName());
}
System.setProperty("findbugs.progress", "true");
try {
// Perform the analysis! (note: This is not thread-safe... | [
"private",
"void",
"runFindBugs",
"(",
"final",
"FindBugs2",
"findBugs",
")",
"{",
"if",
"(",
"DEBUG",
")",
"{",
"FindbugsPlugin",
".",
"log",
"(",
"\"Running findbugs in thread \"",
"+",
"Thread",
".",
"currentThread",
"(",
")",
".",
"getName",
"(",
")",
")... | this method will block current thread until the findbugs is running
@param findBugs
fb engine, which will be <b>disposed</b> after the analysis is
done | [
"this",
"method",
"will",
"block",
"current",
"thread",
"until",
"the",
"findbugs",
"is",
"running"
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/builder/FindBugsWorker.java#L306-L325 | train |
spotbugs/spotbugs | eclipsePlugin/src/de/tobject/findbugs/builder/FindBugsWorker.java | FindBugsWorker.updateBugCollection | private void updateBugCollection(Project findBugsProject, Reporter bugReporter, boolean incremental) {
SortedBugCollection newBugCollection = bugReporter.getBugCollection();
try {
st.newPoint("getBugCollection");
SortedBugCollection oldBugCollection = FindbugsPlugin.getBugCollect... | java | private void updateBugCollection(Project findBugsProject, Reporter bugReporter, boolean incremental) {
SortedBugCollection newBugCollection = bugReporter.getBugCollection();
try {
st.newPoint("getBugCollection");
SortedBugCollection oldBugCollection = FindbugsPlugin.getBugCollect... | [
"private",
"void",
"updateBugCollection",
"(",
"Project",
"findBugsProject",
",",
"Reporter",
"bugReporter",
",",
"boolean",
"incremental",
")",
"{",
"SortedBugCollection",
"newBugCollection",
"=",
"bugReporter",
".",
"getBugCollection",
"(",
")",
";",
"try",
"{",
"... | Update the BugCollection for the project.
@param findBugsProject
FindBugs project representing analyzed classes
@param bugReporter
Reporter used to collect the new warnings | [
"Update",
"the",
"BugCollection",
"for",
"the",
"project",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/builder/FindBugsWorker.java#L334-L358 | train |
spotbugs/spotbugs | eclipsePlugin/src/de/tobject/findbugs/builder/FindBugsWorker.java | FindBugsWorker.getFilterPath | public static IPath getFilterPath(String filePath, IProject project) {
IPath path = new Path(filePath);
if (path.isAbsolute()) {
return path;
}
if (project != null) {
// try first project relative location
IPath newPath = project.getLocation().append(p... | java | public static IPath getFilterPath(String filePath, IProject project) {
IPath path = new Path(filePath);
if (path.isAbsolute()) {
return path;
}
if (project != null) {
// try first project relative location
IPath newPath = project.getLocation().append(p... | [
"public",
"static",
"IPath",
"getFilterPath",
"(",
"String",
"filePath",
",",
"IProject",
"project",
")",
"{",
"IPath",
"path",
"=",
"new",
"Path",
"(",
"filePath",
")",
";",
"if",
"(",
"path",
".",
"isAbsolute",
"(",
")",
")",
"{",
"return",
"path",
"... | Checks the given path and convert it to absolute path if it is specified
relative to the given project or workspace
@param filePath
project relative OR workspace relative OR absolute OS file
path (1.3.8+ version)
@param project
might be null (only for workspace relative or absolute paths)
@return absolute path which m... | [
"Checks",
"the",
"given",
"path",
"and",
"convert",
"it",
"to",
"absolute",
"path",
"if",
"it",
"is",
"specified",
"relative",
"to",
"the",
"given",
"project",
"or",
"workspace"
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/builder/FindBugsWorker.java#L403-L427 | train |
spotbugs/spotbugs | eclipsePlugin/src/de/tobject/findbugs/builder/FindBugsWorker.java | FindBugsWorker.toFilterPath | public static IPath toFilterPath(String filePath, IProject project) {
IPath path = new Path(filePath);
IPath commonPath;
if (project != null) {
commonPath = project.getLocation();
IPath relativePath = getRelativePath(path, commonPath);
if (!relativePath.equals... | java | public static IPath toFilterPath(String filePath, IProject project) {
IPath path = new Path(filePath);
IPath commonPath;
if (project != null) {
commonPath = project.getLocation();
IPath relativePath = getRelativePath(path, commonPath);
if (!relativePath.equals... | [
"public",
"static",
"IPath",
"toFilterPath",
"(",
"String",
"filePath",
",",
"IProject",
"project",
")",
"{",
"IPath",
"path",
"=",
"new",
"Path",
"(",
"filePath",
")",
";",
"IPath",
"commonPath",
";",
"if",
"(",
"project",
"!=",
"null",
")",
"{",
"commo... | Checks the given absolute path and convert it to relative path if it is
relative to the given project or workspace. This representation can be
used to store filter paths in user preferences file
@param filePath
absolute OS file path
@param project
might be null
@return filter file path as stored in preferences which m... | [
"Checks",
"the",
"given",
"absolute",
"path",
"and",
"convert",
"it",
"to",
"relative",
"path",
"if",
"it",
"is",
"relative",
"to",
"the",
"given",
"project",
"or",
"workspace",
".",
"This",
"representation",
"can",
"be",
"used",
"to",
"store",
"filter",
"... | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/builder/FindBugsWorker.java#L441-L453 | train |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/config/ProjectFilterSettings.java | ProjectFilterSettings.fromEncodedString | public static ProjectFilterSettings fromEncodedString(String s) {
ProjectFilterSettings result = new ProjectFilterSettings();
if (s.length() > 0) {
int bar = s.indexOf(FIELD_DELIMITER);
String minPriority;
if (bar >= 0) {
minPriority = s.substring(0, ... | java | public static ProjectFilterSettings fromEncodedString(String s) {
ProjectFilterSettings result = new ProjectFilterSettings();
if (s.length() > 0) {
int bar = s.indexOf(FIELD_DELIMITER);
String minPriority;
if (bar >= 0) {
minPriority = s.substring(0, ... | [
"public",
"static",
"ProjectFilterSettings",
"fromEncodedString",
"(",
"String",
"s",
")",
"{",
"ProjectFilterSettings",
"result",
"=",
"new",
"ProjectFilterSettings",
"(",
")",
";",
"if",
"(",
"s",
".",
"length",
"(",
")",
">",
"0",
")",
"{",
"int",
"bar",
... | Create ProjectFilterSettings from an encoded string.
@param s
the encoded string
@return the ProjectFilterSettings | [
"Create",
"ProjectFilterSettings",
"from",
"an",
"encoded",
"string",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/config/ProjectFilterSettings.java#L151-L223 | train |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/config/ProjectFilterSettings.java | ProjectFilterSettings.hiddenFromEncodedString | public static void hiddenFromEncodedString(ProjectFilterSettings result, String s) {
if (s.length() > 0) {
int bar = s.indexOf(FIELD_DELIMITER);
String categories;
if (bar >= 0) {
categories = s.substring(0, bar);
} else {
categori... | java | public static void hiddenFromEncodedString(ProjectFilterSettings result, String s) {
if (s.length() > 0) {
int bar = s.indexOf(FIELD_DELIMITER);
String categories;
if (bar >= 0) {
categories = s.substring(0, bar);
} else {
categori... | [
"public",
"static",
"void",
"hiddenFromEncodedString",
"(",
"ProjectFilterSettings",
"result",
",",
"String",
"s",
")",
"{",
"if",
"(",
"s",
".",
"length",
"(",
")",
">",
"0",
")",
"{",
"int",
"bar",
"=",
"s",
".",
"indexOf",
"(",
"FIELD_DELIMITER",
")",... | set the hidden bug categories on the specifed ProjectFilterSettings from
an encoded string
@param result
the ProjectFilterSettings from which to remove bug categories
@param s
the encoded string
@see ProjectFilterSettings#hiddenFromEncodedString(ProjectFilterSettings,
String) | [
"set",
"the",
"hidden",
"bug",
"categories",
"on",
"the",
"specifed",
"ProjectFilterSettings",
"from",
"an",
"encoded",
"string"
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/config/ProjectFilterSettings.java#L236-L253 | train |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/config/ProjectFilterSettings.java | ProjectFilterSettings.displayWarning | public boolean displayWarning(BugInstance bugInstance) {
int priority = bugInstance.getPriority();
if (priority > getMinPriorityAsInt()) {
return false;
}
int rank = bugInstance.getBugRank();
if (rank > getMinRank()) {
return false;
}
Bu... | java | public boolean displayWarning(BugInstance bugInstance) {
int priority = bugInstance.getPriority();
if (priority > getMinPriorityAsInt()) {
return false;
}
int rank = bugInstance.getBugRank();
if (rank > getMinRank()) {
return false;
}
Bu... | [
"public",
"boolean",
"displayWarning",
"(",
"BugInstance",
"bugInstance",
")",
"{",
"int",
"priority",
"=",
"bugInstance",
".",
"getPriority",
"(",
")",
";",
"if",
"(",
"priority",
">",
"getMinPriorityAsInt",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
... | Return whether or not a warning should be displayed, according to the
project filter settings.
@param bugInstance
the warning
@return true if the warning should be displayed, false if not | [
"Return",
"whether",
"or",
"not",
"a",
"warning",
"should",
"be",
"displayed",
"according",
"to",
"the",
"project",
"filter",
"settings",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/config/ProjectFilterSettings.java#L263-L292 | train |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/config/ProjectFilterSettings.java | ProjectFilterSettings.setMinPriority | public void setMinPriority(String minPriority) {
this.minPriority = minPriority;
Integer value = priorityNameToValueMap.get(minPriority);
if (value == null) {
value = priorityNameToValueMap.get(DEFAULT_PRIORITY);
if (value == null) {
throw new IllegalStat... | java | public void setMinPriority(String minPriority) {
this.minPriority = minPriority;
Integer value = priorityNameToValueMap.get(minPriority);
if (value == null) {
value = priorityNameToValueMap.get(DEFAULT_PRIORITY);
if (value == null) {
throw new IllegalStat... | [
"public",
"void",
"setMinPriority",
"(",
"String",
"minPriority",
")",
"{",
"this",
".",
"minPriority",
"=",
"minPriority",
";",
"Integer",
"value",
"=",
"priorityNameToValueMap",
".",
"get",
"(",
"minPriority",
")",
";",
"if",
"(",
"value",
"==",
"null",
")... | Set minimum warning priority threshold.
@param minPriority
the priority threshold: one of "High", "Medium", or "Low" | [
"Set",
"minimum",
"warning",
"priority",
"threshold",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/config/ProjectFilterSettings.java#L300-L313 | train |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/config/ProjectFilterSettings.java | ProjectFilterSettings.hiddenToEncodedString | public String hiddenToEncodedString() {
StringBuilder buf = new StringBuilder();
// Encode hidden bug categories
for (Iterator<String> i = hiddenBugCategorySet.iterator(); i.hasNext();) {
buf.append(i.next());
if (i.hasNext()) {
buf.append(LISTITEM_DELIMIT... | java | public String hiddenToEncodedString() {
StringBuilder buf = new StringBuilder();
// Encode hidden bug categories
for (Iterator<String> i = hiddenBugCategorySet.iterator(); i.hasNext();) {
buf.append(i.next());
if (i.hasNext()) {
buf.append(LISTITEM_DELIMIT... | [
"public",
"String",
"hiddenToEncodedString",
"(",
")",
"{",
"StringBuilder",
"buf",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"// Encode hidden bug categories",
"for",
"(",
"Iterator",
"<",
"String",
">",
"i",
"=",
"hiddenBugCategorySet",
".",
"iterator",
"(",
... | Create a string containing the encoded form of the hidden bug categories
@return an encoded string | [
"Create",
"a",
"string",
"containing",
"the",
"encoded",
"form",
"of",
"the",
"hidden",
"bug",
"categories"
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/config/ProjectFilterSettings.java#L416-L428 | train |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/config/ProjectFilterSettings.java | ProjectFilterSettings.toEncodedString | public String toEncodedString() {
// Priority threshold
StringBuilder buf = new StringBuilder();
buf.append(getMinPriority());
// Encode enabled bug categories. Note that these aren't really used for
// much.
// They only come in to play when parsed by a version of FindB... | java | public String toEncodedString() {
// Priority threshold
StringBuilder buf = new StringBuilder();
buf.append(getMinPriority());
// Encode enabled bug categories. Note that these aren't really used for
// much.
// They only come in to play when parsed by a version of FindB... | [
"public",
"String",
"toEncodedString",
"(",
")",
"{",
"// Priority threshold",
"StringBuilder",
"buf",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"buf",
".",
"append",
"(",
"getMinPriority",
"(",
")",
")",
";",
"// Encode enabled bug categories. Note that these aren'... | Create a string containing the encoded form of the ProjectFilterSettings.
@return an encoded string | [
"Create",
"a",
"string",
"containing",
"the",
"encoded",
"form",
"of",
"the",
"ProjectFilterSettings",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/config/ProjectFilterSettings.java#L435-L461 | train |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/config/ProjectFilterSettings.java | ProjectFilterSettings.getIntPriorityAsString | public static String getIntPriorityAsString(int prio) {
String minPriority;
switch (prio) {
case Priorities.EXP_PRIORITY:
minPriority = ProjectFilterSettings.EXPERIMENTAL_PRIORITY;
break;
case Priorities.LOW_PRIORITY:
minPriority = ProjectFilterSetting... | java | public static String getIntPriorityAsString(int prio) {
String minPriority;
switch (prio) {
case Priorities.EXP_PRIORITY:
minPriority = ProjectFilterSettings.EXPERIMENTAL_PRIORITY;
break;
case Priorities.LOW_PRIORITY:
minPriority = ProjectFilterSetting... | [
"public",
"static",
"String",
"getIntPriorityAsString",
"(",
"int",
"prio",
")",
"{",
"String",
"minPriority",
";",
"switch",
"(",
"prio",
")",
"{",
"case",
"Priorities",
".",
"EXP_PRIORITY",
":",
"minPriority",
"=",
"ProjectFilterSettings",
".",
"EXPERIMENTAL_PRI... | Convert an integer warning priority threshold value to a String. | [
"Convert",
"an",
"integer",
"warning",
"priority",
"threshold",
"value",
"to",
"a",
"String",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/config/ProjectFilterSettings.java#L529-L549 | train |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/graph/Transpose.java | Transpose.transpose | public GraphType transpose(GraphType orig, GraphToolkit<GraphType, EdgeType, VertexType> toolkit) {
GraphType trans = toolkit.createGraph();
// For each vertex in original graph, create an equivalent
// vertex in the transposed graph,
// ensuring that vertex labels in the transposed gr... | java | public GraphType transpose(GraphType orig, GraphToolkit<GraphType, EdgeType, VertexType> toolkit) {
GraphType trans = toolkit.createGraph();
// For each vertex in original graph, create an equivalent
// vertex in the transposed graph,
// ensuring that vertex labels in the transposed gr... | [
"public",
"GraphType",
"transpose",
"(",
"GraphType",
"orig",
",",
"GraphToolkit",
"<",
"GraphType",
",",
"EdgeType",
",",
"VertexType",
">",
"toolkit",
")",
"{",
"GraphType",
"trans",
"=",
"toolkit",
".",
"createGraph",
"(",
")",
";",
"// For each vertex in ori... | Transpose a graph. Note that the original graph is not modified; the new
graph and its vertices and edges are new objects.
@param orig
the graph to transpose
@param toolkit
a GraphToolkit to be used to create the transposed Graph
@return the transposed Graph | [
"Transpose",
"a",
"graph",
".",
"Note",
"that",
"the",
"original",
"graph",
"is",
"not",
"modified",
";",
"the",
"new",
"graph",
"and",
"its",
"vertices",
"and",
"edges",
"are",
"new",
"objects",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/graph/Transpose.java#L54-L95 | train |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/vna/MergeTree.java | MergeTree.mapInputToOutput | public void mapInputToOutput(ValueNumber input, ValueNumber output) {
BitSet inputSet = getInputSet(output);
inputSet.set(input.getNumber());
if (DEBUG) {
System.out.println(input.getNumber() + "->" + output.getNumber());
System.out.println("Input set for " + output.getNu... | java | public void mapInputToOutput(ValueNumber input, ValueNumber output) {
BitSet inputSet = getInputSet(output);
inputSet.set(input.getNumber());
if (DEBUG) {
System.out.println(input.getNumber() + "->" + output.getNumber());
System.out.println("Input set for " + output.getNu... | [
"public",
"void",
"mapInputToOutput",
"(",
"ValueNumber",
"input",
",",
"ValueNumber",
"output",
")",
"{",
"BitSet",
"inputSet",
"=",
"getInputSet",
"(",
"output",
")",
";",
"inputSet",
".",
"set",
"(",
"input",
".",
"getNumber",
"(",
")",
")",
";",
"if",
... | Map an input ValueNumber to an output ValueNumber.
@param input
the input ValueNumber
@param output
the output ValueNumber | [
"Map",
"an",
"input",
"ValueNumber",
"to",
"an",
"output",
"ValueNumber",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/vna/MergeTree.java#L62-L69 | train |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/vna/MergeTree.java | MergeTree.getInputSet | public BitSet getInputSet(ValueNumber output) {
BitSet outputSet = outputToInputMap.get(output);
if (outputSet == null) {
if (DEBUG) {
System.out.println("Create new input set for " + output.getNumber());
}
outputSet = new BitSet();
outputT... | java | public BitSet getInputSet(ValueNumber output) {
BitSet outputSet = outputToInputMap.get(output);
if (outputSet == null) {
if (DEBUG) {
System.out.println("Create new input set for " + output.getNumber());
}
outputSet = new BitSet();
outputT... | [
"public",
"BitSet",
"getInputSet",
"(",
"ValueNumber",
"output",
")",
"{",
"BitSet",
"outputSet",
"=",
"outputToInputMap",
".",
"get",
"(",
"output",
")",
";",
"if",
"(",
"outputSet",
"==",
"null",
")",
"{",
"if",
"(",
"DEBUG",
")",
"{",
"System",
".",
... | Get the set of input ValueNumbers which directly contributed to the given
output ValueNumber.
@param output
the output ValueNumber
@return the set of direct input ValueNumbers | [
"Get",
"the",
"set",
"of",
"input",
"ValueNumbers",
"which",
"directly",
"contributed",
"to",
"the",
"given",
"output",
"ValueNumber",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/vna/MergeTree.java#L79-L89 | train |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/detect/Naming.java | Naming.mightInheritFromException | private static boolean mightInheritFromException(ClassDescriptor d) {
while (d != null) {
try {
if ("java.lang.Exception".equals(d.getDottedClassName())) {
return true;
}
XClass classNameAndInfo = Global.getAnalysisCache().getClassA... | java | private static boolean mightInheritFromException(ClassDescriptor d) {
while (d != null) {
try {
if ("java.lang.Exception".equals(d.getDottedClassName())) {
return true;
}
XClass classNameAndInfo = Global.getAnalysisCache().getClassA... | [
"private",
"static",
"boolean",
"mightInheritFromException",
"(",
"ClassDescriptor",
"d",
")",
"{",
"while",
"(",
"d",
"!=",
"null",
")",
"{",
"try",
"{",
"if",
"(",
"\"java.lang.Exception\"",
".",
"equals",
"(",
"d",
".",
"getDottedClassName",
"(",
")",
")"... | Determine whether the class descriptor ultimately inherits from
java.lang.Exception
@param d
class descriptor we want to check
@return true iff the descriptor ultimately inherits from Exception | [
"Determine",
"whether",
"the",
"class",
"descriptor",
"ultimately",
"inherits",
"from",
"java",
".",
"lang",
".",
"Exception"
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/detect/Naming.java#L341-L354 | train |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/LaunchAppropriateUI.java | LaunchAppropriateUI.launch | public void launch() throws Exception {
// Sanity-check the loaded BCEL classes
if (!CheckBcel.check()) {
System.exit(1);
}
int launchProperty = getLaunchProperty();
if (GraphicsEnvironment.isHeadless() || launchProperty == TEXTUI) {
FindBugs2.main(args)... | java | public void launch() throws Exception {
// Sanity-check the loaded BCEL classes
if (!CheckBcel.check()) {
System.exit(1);
}
int launchProperty = getLaunchProperty();
if (GraphicsEnvironment.isHeadless() || launchProperty == TEXTUI) {
FindBugs2.main(args)... | [
"public",
"void",
"launch",
"(",
")",
"throws",
"Exception",
"{",
"// Sanity-check the loaded BCEL classes",
"if",
"(",
"!",
"CheckBcel",
".",
"check",
"(",
")",
")",
"{",
"System",
".",
"exit",
"(",
"1",
")",
";",
"}",
"int",
"launchProperty",
"=",
"getLa... | Launch the appropriate UI.
@throws java.lang.Exception | [
"Launch",
"the",
"appropriate",
"UI",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/LaunchAppropriateUI.java#L97-L117 | train |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/LaunchAppropriateUI.java | LaunchAppropriateUI.getLaunchProperty | private int getLaunchProperty() {
// See if the first command line argument specifies the UI.
if (args.length > 0) {
String firstArg = args[0];
if (firstArg.startsWith("-")) {
String uiName = firstArg.substring(1);
if (uiNameToCodeMap.containsKey(u... | java | private int getLaunchProperty() {
// See if the first command line argument specifies the UI.
if (args.length > 0) {
String firstArg = args[0];
if (firstArg.startsWith("-")) {
String uiName = firstArg.substring(1);
if (uiNameToCodeMap.containsKey(u... | [
"private",
"int",
"getLaunchProperty",
"(",
")",
"{",
"// See if the first command line argument specifies the UI.",
"if",
"(",
"args",
".",
"length",
">",
"0",
")",
"{",
"String",
"firstArg",
"=",
"args",
"[",
"0",
"]",
";",
"if",
"(",
"firstArg",
".",
"start... | Find out what UI should be launched.
<p>
First, we check the command line arguments to see if the first argument
specifies the UI (e.g., "-textui", "-gui", etc.)
<p>
If the first command line argument does not specify the UI, then we check
the <code>findbugs.launchUI</code> system property to one of the
following val... | [
"Find",
"out",
"what",
"UI",
"should",
"be",
"launched",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/LaunchAppropriateUI.java#L145-L187 | train |
spotbugs/spotbugs | eclipsePlugin/src/de/tobject/findbugs/nature/FindBugsNature.java | FindBugsNature.configure | @Override
public void configure() throws CoreException {
if (DEBUG) {
System.out.println("Adding findbugs to the project build spec.");
}
// register FindBugs builder
addToBuildSpec(FindbugsPlugin.BUILDER_ID);
} | java | @Override
public void configure() throws CoreException {
if (DEBUG) {
System.out.println("Adding findbugs to the project build spec.");
}
// register FindBugs builder
addToBuildSpec(FindbugsPlugin.BUILDER_ID);
} | [
"@",
"Override",
"public",
"void",
"configure",
"(",
")",
"throws",
"CoreException",
"{",
"if",
"(",
"DEBUG",
")",
"{",
"System",
".",
"out",
".",
"println",
"(",
"\"Adding findbugs to the project build spec.\"",
")",
";",
"}",
"// register FindBugs builder",
"add... | Adds the FindBugs builder to the project.
@see IProjectNature#configure | [
"Adds",
"the",
"FindBugs",
"builder",
"to",
"the",
"project",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/nature/FindBugsNature.java#L52-L59 | train |
spotbugs/spotbugs | eclipsePlugin/src/de/tobject/findbugs/nature/FindBugsNature.java | FindBugsNature.deconfigure | @Override
public void deconfigure() throws CoreException {
if (DEBUG) {
System.out.println("Removing findbugs from the project build spec.");
}
// de-register FindBugs builder
removeFromBuildSpec(FindbugsPlugin.BUILDER_ID);
} | java | @Override
public void deconfigure() throws CoreException {
if (DEBUG) {
System.out.println("Removing findbugs from the project build spec.");
}
// de-register FindBugs builder
removeFromBuildSpec(FindbugsPlugin.BUILDER_ID);
} | [
"@",
"Override",
"public",
"void",
"deconfigure",
"(",
")",
"throws",
"CoreException",
"{",
"if",
"(",
"DEBUG",
")",
"{",
"System",
".",
"out",
".",
"println",
"(",
"\"Removing findbugs from the project build spec.\"",
")",
";",
"}",
"// de-register FindBugs builder... | Removes the FindBugs builder from the project.
@see IProjectNature#deconfigure | [
"Removes",
"the",
"FindBugs",
"builder",
"from",
"the",
"project",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/nature/FindBugsNature.java#L66-L73 | train |
spotbugs/spotbugs | eclipsePlugin/src/de/tobject/findbugs/nature/FindBugsNature.java | FindBugsNature.removeFromBuildSpec | protected void removeFromBuildSpec(String builderID) throws CoreException {
MarkerUtil.removeMarkers(getProject());
IProjectDescription description = getProject().getDescription();
ICommand[] commands = description.getBuildSpec();
for (int i = 0; i < commands.length; ++i) {
i... | java | protected void removeFromBuildSpec(String builderID) throws CoreException {
MarkerUtil.removeMarkers(getProject());
IProjectDescription description = getProject().getDescription();
ICommand[] commands = description.getBuildSpec();
for (int i = 0; i < commands.length; ++i) {
i... | [
"protected",
"void",
"removeFromBuildSpec",
"(",
"String",
"builderID",
")",
"throws",
"CoreException",
"{",
"MarkerUtil",
".",
"removeMarkers",
"(",
"getProject",
"(",
")",
")",
";",
"IProjectDescription",
"description",
"=",
"getProject",
"(",
")",
".",
"getDesc... | Removes the given builder from the build spec for the given project. | [
"Removes",
"the",
"given",
"builder",
"from",
"the",
"build",
"spec",
"for",
"the",
"given",
"project",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/nature/FindBugsNature.java#L78-L92 | train |
spotbugs/spotbugs | eclipsePlugin/src/de/tobject/findbugs/nature/FindBugsNature.java | FindBugsNature.addToBuildSpec | protected void addToBuildSpec(String builderID) throws CoreException {
IProjectDescription description = getProject().getDescription();
ICommand findBugsCommand = getFindBugsCommand(description);
if (findBugsCommand == null) {
// Add a Java command to the build spec
IComm... | java | protected void addToBuildSpec(String builderID) throws CoreException {
IProjectDescription description = getProject().getDescription();
ICommand findBugsCommand = getFindBugsCommand(description);
if (findBugsCommand == null) {
// Add a Java command to the build spec
IComm... | [
"protected",
"void",
"addToBuildSpec",
"(",
"String",
"builderID",
")",
"throws",
"CoreException",
"{",
"IProjectDescription",
"description",
"=",
"getProject",
"(",
")",
".",
"getDescription",
"(",
")",
";",
"ICommand",
"findBugsCommand",
"=",
"getFindBugsCommand",
... | Adds a builder to the build spec for the given project. | [
"Adds",
"a",
"builder",
"to",
"the",
"build",
"spec",
"for",
"the",
"given",
"project",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/nature/FindBugsNature.java#L97-L106 | train |
spotbugs/spotbugs | eclipsePlugin/src/de/tobject/findbugs/nature/FindBugsNature.java | FindBugsNature.getFindBugsCommand | private ICommand getFindBugsCommand(IProjectDescription description) {
ICommand[] commands = description.getBuildSpec();
for (int i = 0; i < commands.length; ++i) {
if (FindbugsPlugin.BUILDER_ID.equals(commands[i].getBuilderName())) {
return commands[i];
}
... | java | private ICommand getFindBugsCommand(IProjectDescription description) {
ICommand[] commands = description.getBuildSpec();
for (int i = 0; i < commands.length; ++i) {
if (FindbugsPlugin.BUILDER_ID.equals(commands[i].getBuilderName())) {
return commands[i];
}
... | [
"private",
"ICommand",
"getFindBugsCommand",
"(",
"IProjectDescription",
"description",
")",
"{",
"ICommand",
"[",
"]",
"commands",
"=",
"description",
".",
"getBuildSpec",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"commands",
".",
"l... | Find the specific FindBugs command amongst the build spec of a given
description | [
"Find",
"the",
"specific",
"FindBugs",
"command",
"amongst",
"the",
"build",
"spec",
"of",
"a",
"given",
"description"
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/nature/FindBugsNature.java#L112-L120 | train |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/config/CommandLine.java | CommandLine.addSwitch | public void addSwitch(String option, String description) {
optionList.add(option);
optionDescriptionMap.put(option, description);
if (option.length() > maxWidth) {
maxWidth = option.length();
}
} | java | public void addSwitch(String option, String description) {
optionList.add(option);
optionDescriptionMap.put(option, description);
if (option.length() > maxWidth) {
maxWidth = option.length();
}
} | [
"public",
"void",
"addSwitch",
"(",
"String",
"option",
",",
"String",
"description",
")",
"{",
"optionList",
".",
"add",
"(",
"option",
")",
";",
"optionDescriptionMap",
".",
"put",
"(",
"option",
",",
"description",
")",
";",
"if",
"(",
"option",
".",
... | Add a command line switch. This method is for adding options that do not
require an argument.
@param option
the option, must start with "-"
@param description
single line description of the option | [
"Add",
"a",
"command",
"line",
"switch",
".",
"This",
"method",
"is",
"for",
"adding",
"options",
"that",
"do",
"not",
"require",
"an",
"argument",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/config/CommandLine.java#L94-L101 | train |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/config/CommandLine.java | CommandLine.addSwitchWithOptionalExtraPart | public void addSwitchWithOptionalExtraPart(String option, String optionExtraPartSynopsis, String description) {
optionList.add(option);
optionExtraPartSynopsisMap.put(option, optionExtraPartSynopsis);
optionDescriptionMap.put(option, description);
// Option will display as -foo[:extraPa... | java | public void addSwitchWithOptionalExtraPart(String option, String optionExtraPartSynopsis, String description) {
optionList.add(option);
optionExtraPartSynopsisMap.put(option, optionExtraPartSynopsis);
optionDescriptionMap.put(option, description);
// Option will display as -foo[:extraPa... | [
"public",
"void",
"addSwitchWithOptionalExtraPart",
"(",
"String",
"option",
",",
"String",
"optionExtraPartSynopsis",
",",
"String",
"description",
")",
"{",
"optionList",
".",
"add",
"(",
"option",
")",
";",
"optionExtraPartSynopsisMap",
".",
"put",
"(",
"option",... | Add a command line switch that allows optional extra information to be
specified as part of it.
@param option
the option, must start with "-"
@param optionExtraPartSynopsis
synopsis of the optional extra information
@param description
single-line description of the option | [
"Add",
"a",
"command",
"line",
"switch",
"that",
"allows",
"optional",
"extra",
"information",
"to",
"be",
"specified",
"as",
"part",
"of",
"it",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/config/CommandLine.java#L114-L124 | train |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/config/CommandLine.java | CommandLine.addOption | public void addOption(String option, String argumentDesc, String description) {
optionList.add(option);
optionDescriptionMap.put(option, description);
requiresArgumentSet.add(option);
argumentDescriptionMap.put(option, argumentDesc);
int width = option.length() + 3 + argumentDes... | java | public void addOption(String option, String argumentDesc, String description) {
optionList.add(option);
optionDescriptionMap.put(option, description);
requiresArgumentSet.add(option);
argumentDescriptionMap.put(option, argumentDesc);
int width = option.length() + 3 + argumentDes... | [
"public",
"void",
"addOption",
"(",
"String",
"option",
",",
"String",
"argumentDesc",
",",
"String",
"description",
")",
"{",
"optionList",
".",
"add",
"(",
"option",
")",
";",
"optionDescriptionMap",
".",
"put",
"(",
"option",
",",
"description",
")",
";",... | Add an option requiring an argument.
@param option
the option, must start with "-"
@param argumentDesc
brief (one or two word) description of the argument
@param description
single line description of the option | [
"Add",
"an",
"option",
"requiring",
"an",
"argument",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/config/CommandLine.java#L136-L146 | train |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/config/CommandLine.java | CommandLine.printUsage | public void printUsage(OutputStream os) {
int count = 0;
PrintStream out = UTF8.printStream(os);
for (String option : optionList) {
if (optionGroups.containsKey(count)) {
out.println(" " + optionGroups.get(count));
}
count++;
if ... | java | public void printUsage(OutputStream os) {
int count = 0;
PrintStream out = UTF8.printStream(os);
for (String option : optionList) {
if (optionGroups.containsKey(count)) {
out.println(" " + optionGroups.get(count));
}
count++;
if ... | [
"public",
"void",
"printUsage",
"(",
"OutputStream",
"os",
")",
"{",
"int",
"count",
"=",
"0",
";",
"PrintStream",
"out",
"=",
"UTF8",
".",
"printStream",
"(",
"os",
")",
";",
"for",
"(",
"String",
"option",
":",
"optionList",
")",
"{",
"if",
"(",
"o... | Print command line usage information to given stream.
@param os
the output stream | [
"Print",
"command",
"line",
"usage",
"information",
"to",
"given",
"stream",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/config/CommandLine.java#L377-L410 | train |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/LockSet.java | LockSet.setLockCount | public void setLockCount(int valueNumber, int lockCount) {
int index = findIndex(valueNumber);
if (index < 0) {
addEntry(index, valueNumber, lockCount);
} else {
array[index + 1] = lockCount;
}
} | java | public void setLockCount(int valueNumber, int lockCount) {
int index = findIndex(valueNumber);
if (index < 0) {
addEntry(index, valueNumber, lockCount);
} else {
array[index + 1] = lockCount;
}
} | [
"public",
"void",
"setLockCount",
"(",
"int",
"valueNumber",
",",
"int",
"lockCount",
")",
"{",
"int",
"index",
"=",
"findIndex",
"(",
"valueNumber",
")",
";",
"if",
"(",
"index",
"<",
"0",
")",
"{",
"addEntry",
"(",
"index",
",",
"valueNumber",
",",
"... | Set the lock count for a lock object.
@param valueNumber
value number of the lock object
@param lockCount
the lock count for the lock | [
"Set",
"the",
"lock",
"count",
"for",
"a",
"lock",
"object",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/LockSet.java#L103-L110 | train |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/LockSet.java | LockSet.getNumLockedObjects | public int getNumLockedObjects() {
int result = 0;
for (int i = 0; i + 1 < array.length; i += 2) {
if (array[i] == INVALID) {
break;
}
if (array[i + 1] > 0) {
++result;
}
}
return result;
} | java | public int getNumLockedObjects() {
int result = 0;
for (int i = 0; i + 1 < array.length; i += 2) {
if (array[i] == INVALID) {
break;
}
if (array[i + 1] > 0) {
++result;
}
}
return result;
} | [
"public",
"int",
"getNumLockedObjects",
"(",
")",
"{",
"int",
"result",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"+",
"1",
"<",
"array",
".",
"length",
";",
"i",
"+=",
"2",
")",
"{",
"if",
"(",
"array",
"[",
"i",
"]",
"==",
... | Get the number of distinct lock values with positive lock counts. | [
"Get",
"the",
"number",
"of",
"distinct",
"lock",
"values",
"with",
"positive",
"lock",
"counts",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/LockSet.java#L125-L136 | train |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/LockSet.java | LockSet.copyFrom | public void copyFrom(LockSet other) {
if (other.array.length != array.length) {
array = new int[other.array.length];
}
System.arraycopy(other.array, 0, array, 0, array.length);
this.defaultLockCount = other.defaultLockCount;
} | java | public void copyFrom(LockSet other) {
if (other.array.length != array.length) {
array = new int[other.array.length];
}
System.arraycopy(other.array, 0, array, 0, array.length);
this.defaultLockCount = other.defaultLockCount;
} | [
"public",
"void",
"copyFrom",
"(",
"LockSet",
"other",
")",
"{",
"if",
"(",
"other",
".",
"array",
".",
"length",
"!=",
"array",
".",
"length",
")",
"{",
"array",
"=",
"new",
"int",
"[",
"other",
".",
"array",
".",
"length",
"]",
";",
"}",
"System"... | Make this LockSet the same as the given one.
@param other
the LockSet to copy | [
"Make",
"this",
"LockSet",
"the",
"same",
"as",
"the",
"given",
"one",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/LockSet.java#L144-L150 | train |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/LockSet.java | LockSet.meetWith | public void meetWith(LockSet other) {
for (int i = 0; i + 1 < array.length; i += 2) {
int valueNumber = array[i];
if (valueNumber < 0) {
break;
}
int mine = array[i + 1];
int his = other.getLockCount(valueNumber);
array[i +... | java | public void meetWith(LockSet other) {
for (int i = 0; i + 1 < array.length; i += 2) {
int valueNumber = array[i];
if (valueNumber < 0) {
break;
}
int mine = array[i + 1];
int his = other.getLockCount(valueNumber);
array[i +... | [
"public",
"void",
"meetWith",
"(",
"LockSet",
"other",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"+",
"1",
"<",
"array",
".",
"length",
";",
"i",
"+=",
"2",
")",
"{",
"int",
"valueNumber",
"=",
"array",
"[",
"i",
"]",
";",
"if",
"... | Meet this LockSet with another LockSet, storing the result in this
object.
@param other
the other LockSet | [
"Meet",
"this",
"LockSet",
"with",
"another",
"LockSet",
"storing",
"the",
"result",
"in",
"this",
"object",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/LockSet.java#L168-L192 | train |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/LockSet.java | LockSet.containsReturnValue | public boolean containsReturnValue(ValueNumberFactory factory) {
for (int i = 0; i + 1 < array.length; i += 2) {
int valueNumber = array[i];
if (valueNumber < 0) {
break;
}
int lockCount = array[i + 1];
if (lockCount > 0 && factory.forN... | java | public boolean containsReturnValue(ValueNumberFactory factory) {
for (int i = 0; i + 1 < array.length; i += 2) {
int valueNumber = array[i];
if (valueNumber < 0) {
break;
}
int lockCount = array[i + 1];
if (lockCount > 0 && factory.forN... | [
"public",
"boolean",
"containsReturnValue",
"(",
"ValueNumberFactory",
"factory",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"+",
"1",
"<",
"array",
".",
"length",
";",
"i",
"+=",
"2",
")",
"{",
"int",
"valueNumber",
"=",
"array",
"[",
"i"... | Determine whether or not this lock set contains any locked values which
are method return values.
@param factory
the ValueNumberFactory that produced the lock values | [
"Determine",
"whether",
"or",
"not",
"this",
"lock",
"set",
"contains",
"any",
"locked",
"values",
"which",
"are",
"method",
"return",
"values",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/LockSet.java#L211-L223 | train |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/LockSet.java | LockSet.isEmpty | public boolean isEmpty() {
for (int i = 0; i + 1 < array.length; i += 2) {
int valueNumber = array[i];
if (valueNumber < 0) {
return true;
}
int myLockCount = array[i + 1];
if (myLockCount > 0) {
return false;
... | java | public boolean isEmpty() {
for (int i = 0; i + 1 < array.length; i += 2) {
int valueNumber = array[i];
if (valueNumber < 0) {
return true;
}
int myLockCount = array[i + 1];
if (myLockCount > 0) {
return false;
... | [
"public",
"boolean",
"isEmpty",
"(",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"+",
"1",
"<",
"array",
".",
"length",
";",
"i",
"+=",
"2",
")",
"{",
"int",
"valueNumber",
"=",
"array",
"[",
"i",
"]",
";",
"if",
"(",
"valueNumber",
... | Return whether or not this lock set is empty, meaning that no locks have
a positive lock count.
@return true if no locks are held, false if at least one lock is held | [
"Return",
"whether",
"or",
"not",
"this",
"lock",
"set",
"is",
"empty",
"meaning",
"that",
"no",
"locks",
"have",
"a",
"positive",
"lock",
"count",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/LockSet.java#L257-L269 | train |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/SimplePathEnumerator.java | SimplePathEnumerator.enumerate | public SimplePathEnumerator enumerate() {
Iterator<Edge> entryOut = cfg.outgoingEdgeIterator(cfg.getEntry());
if (!entryOut.hasNext()) {
throw new IllegalStateException();
}
Edge entryEdge = entryOut.next();
LinkedList<Edge> init = new LinkedList<>();
init.ad... | java | public SimplePathEnumerator enumerate() {
Iterator<Edge> entryOut = cfg.outgoingEdgeIterator(cfg.getEntry());
if (!entryOut.hasNext()) {
throw new IllegalStateException();
}
Edge entryEdge = entryOut.next();
LinkedList<Edge> init = new LinkedList<>();
init.ad... | [
"public",
"SimplePathEnumerator",
"enumerate",
"(",
")",
"{",
"Iterator",
"<",
"Edge",
">",
"entryOut",
"=",
"cfg",
".",
"outgoingEdgeIterator",
"(",
"cfg",
".",
"getEntry",
"(",
")",
")",
";",
"if",
"(",
"!",
"entryOut",
".",
"hasNext",
"(",
")",
")",
... | Enumerate the simple paths.
@return this object | [
"Enumerate",
"the",
"simple",
"paths",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/SimplePathEnumerator.java#L97-L113 | train |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/detect/NumberConstructor.java | NumberConstructor.visitClassContext | @Override
public void visitClassContext(ClassContext classContext) {
int majorVersion = classContext.getJavaClass().getMajor();
if (majorVersion >= Const.MAJOR_1_5 && hasInterestingMethod(classContext.getJavaClass().getConstantPool(), methods)) {
super.visitClassContext(classContext);
... | java | @Override
public void visitClassContext(ClassContext classContext) {
int majorVersion = classContext.getJavaClass().getMajor();
if (majorVersion >= Const.MAJOR_1_5 && hasInterestingMethod(classContext.getJavaClass().getConstantPool(), methods)) {
super.visitClassContext(classContext);
... | [
"@",
"Override",
"public",
"void",
"visitClassContext",
"(",
"ClassContext",
"classContext",
")",
"{",
"int",
"majorVersion",
"=",
"classContext",
".",
"getJavaClass",
"(",
")",
".",
"getMajor",
"(",
")",
";",
"if",
"(",
"majorVersion",
">=",
"Const",
".",
"... | The detector is only meaningful for Java5 class libraries.
@param classContext
the context object that holds the JavaClass parsed | [
"The",
"detector",
"is",
"only",
"meaningful",
"for",
"Java5",
"class",
"libraries",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/detect/NumberConstructor.java#L105-L111 | train |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/jsr305/TypeQualifierResolver.java | TypeQualifierResolver.resolveTypeQualifiers | public static Collection<AnnotationValue> resolveTypeQualifiers(AnnotationValue value) {
LinkedList<AnnotationValue> result = new LinkedList<>();
resolveTypeQualifierNicknames(value, result, new LinkedList<ClassDescriptor>());
return result;
} | java | public static Collection<AnnotationValue> resolveTypeQualifiers(AnnotationValue value) {
LinkedList<AnnotationValue> result = new LinkedList<>();
resolveTypeQualifierNicknames(value, result, new LinkedList<ClassDescriptor>());
return result;
} | [
"public",
"static",
"Collection",
"<",
"AnnotationValue",
">",
"resolveTypeQualifiers",
"(",
"AnnotationValue",
"value",
")",
"{",
"LinkedList",
"<",
"AnnotationValue",
">",
"result",
"=",
"new",
"LinkedList",
"<>",
"(",
")",
";",
"resolveTypeQualifierNicknames",
"(... | Resolve an AnnotationValue into a list of AnnotationValues representing
type qualifier annotations.
@param value
AnnotationValue representing the use of an annotation
@return Collection of AnnotationValues representing resolved
TypeQualifier annotations | [
"Resolve",
"an",
"AnnotationValue",
"into",
"a",
"list",
"of",
"AnnotationValues",
"representing",
"type",
"qualifier",
"annotations",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/jsr305/TypeQualifierResolver.java#L88-L92 | train |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/graph/MergeVertices.java | MergeVertices.mergeVertices | public void mergeVertices(Set<VertexType> vertexSet, GraphType g, VertexCombinator<VertexType> combinator,
GraphToolkit<GraphType, EdgeType, VertexType> toolkit) {
// Special case: if the vertex set contains a single vertex
// or is empty, there is nothing to do
if (vertexSet.size()... | java | public void mergeVertices(Set<VertexType> vertexSet, GraphType g, VertexCombinator<VertexType> combinator,
GraphToolkit<GraphType, EdgeType, VertexType> toolkit) {
// Special case: if the vertex set contains a single vertex
// or is empty, there is nothing to do
if (vertexSet.size()... | [
"public",
"void",
"mergeVertices",
"(",
"Set",
"<",
"VertexType",
">",
"vertexSet",
",",
"GraphType",
"g",
",",
"VertexCombinator",
"<",
"VertexType",
">",
"combinator",
",",
"GraphToolkit",
"<",
"GraphType",
",",
"EdgeType",
",",
"VertexType",
">",
"toolkit",
... | Merge the specified set of vertices into a single vertex.
@param vertexSet
the set of vertices to be merged
@param g
the graph to be modified
@param combinator
object used to combine vertices
@param toolkit
GraphToolkit used to copy auxiliary information for edges | [
"Merge",
"the",
"specified",
"set",
"of",
"vertices",
"into",
"a",
"single",
"vertex",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/graph/MergeVertices.java#L52-L109 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.