id
int32
0
165k
repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
59,700
spotbugs/spotbugs
spotbugs/src/gui/main/edu/umd/cs/findbugs/sourceViewer/NavigableTextPane.java
NavigableTextPane.scrollLinesToVisible
public void scrollLinesToVisible(int startLine, int endLine, Collection<Integer> otherLines) { int startY, endY; try { startY = lineToY(startLine); } catch (BadLocationException ble) { if (MainFrame.GUI2_DEBUG) { ble.printStackTrace(); } ...
java
public void scrollLinesToVisible(int startLine, int endLine, Collection<Integer> otherLines) { int startY, endY; try { startY = lineToY(startLine); } catch (BadLocationException ble) { if (MainFrame.GUI2_DEBUG) { ble.printStackTrace(); } ...
[ "public", "void", "scrollLinesToVisible", "(", "int", "startLine", ",", "int", "endLine", ",", "Collection", "<", "Integer", ">", "otherLines", ")", "{", "int", "startY", ",", "endY", ";", "try", "{", "startY", "=", "lineToY", "(", "startLine", ")", ";", ...
scroll the specified primary lines into view, along with as many of the other lines as is convenient
[ "scroll", "the", "specified", "primary", "lines", "into", "view", "along", "with", "as", "many", "of", "the", "other", "lines", "as", "is", "convenient" ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/gui/main/edu/umd/cs/findbugs/sourceViewer/NavigableTextPane.java#L129-L178
59,701
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/npe/NullDerefAndRedundantComparisonFinder.java
NullDerefAndRedundantComparisonFinder.examineBasicBlocks
private void examineBasicBlocks() throws DataflowAnalysisException, CFGBuilderException { // Look for null check blocks where the reference being checked // is definitely null, or null on some path Iterator<BasicBlock> bbIter = invDataflow.getCFG().blockIterator(); while (bbIter.hasNext(...
java
private void examineBasicBlocks() throws DataflowAnalysisException, CFGBuilderException { // Look for null check blocks where the reference being checked // is definitely null, or null on some path Iterator<BasicBlock> bbIter = invDataflow.getCFG().blockIterator(); while (bbIter.hasNext(...
[ "private", "void", "examineBasicBlocks", "(", ")", "throws", "DataflowAnalysisException", ",", "CFGBuilderException", "{", "// Look for null check blocks where the reference being checked", "// is definitely null, or null on some path", "Iterator", "<", "BasicBlock", ">", "bbIter", ...
Examine basic blocks for null checks and potentially-redundant null comparisons. @throws DataflowAnalysisException @throws CFGBuilderException
[ "Examine", "basic", "blocks", "for", "null", "checks", "and", "potentially", "-", "redundant", "null", "comparisons", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/npe/NullDerefAndRedundantComparisonFinder.java#L185-L218
59,702
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/npe/NullDerefAndRedundantComparisonFinder.java
NullDerefAndRedundantComparisonFinder.examineNullValues
private void examineNullValues() throws CFGBuilderException, DataflowAnalysisException { Set<LocationWhereValueBecomesNull> locationWhereValueBecomesNullSet = invDataflow.getAnalysis() .getLocationWhereValueBecomesNullSet(); if (DEBUG_DEREFS) { System.out.println("-----------...
java
private void examineNullValues() throws CFGBuilderException, DataflowAnalysisException { Set<LocationWhereValueBecomesNull> locationWhereValueBecomesNullSet = invDataflow.getAnalysis() .getLocationWhereValueBecomesNullSet(); if (DEBUG_DEREFS) { System.out.println("-----------...
[ "private", "void", "examineNullValues", "(", ")", "throws", "CFGBuilderException", ",", "DataflowAnalysisException", "{", "Set", "<", "LocationWhereValueBecomesNull", ">", "locationWhereValueBecomesNullSet", "=", "invDataflow", ".", "getAnalysis", "(", ")", ".", "getLocat...
Examine null values. Report any that are guaranteed to be dereferenced on non-implicit-exception paths. @throws CFGBuilderException @throws DataflowAnalysisException
[ "Examine", "null", "values", ".", "Report", "any", "that", "are", "guaranteed", "to", "be", "dereferenced", "on", "non", "-", "implicit", "-", "exception", "paths", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/npe/NullDerefAndRedundantComparisonFinder.java#L227-L267
59,703
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/npe/NullDerefAndRedundantComparisonFinder.java
NullDerefAndRedundantComparisonFinder.noteUnconditionallyDereferencedNullValue
private void noteUnconditionallyDereferencedNullValue(Location thisLocation, Map<ValueNumber, SortedSet<Location>> bugLocations, Map<ValueNumber, NullValueUnconditionalDeref> nullValueGuaranteedDerefMap, UnconditionalValueDerefSet derefSet, IsNullValue isNullValue, ValueNumber valueN...
java
private void noteUnconditionallyDereferencedNullValue(Location thisLocation, Map<ValueNumber, SortedSet<Location>> bugLocations, Map<ValueNumber, NullValueUnconditionalDeref> nullValueGuaranteedDerefMap, UnconditionalValueDerefSet derefSet, IsNullValue isNullValue, ValueNumber valueN...
[ "private", "void", "noteUnconditionallyDereferencedNullValue", "(", "Location", "thisLocation", ",", "Map", "<", "ValueNumber", ",", "SortedSet", "<", "Location", ">", ">", "bugLocations", ",", "Map", "<", "ValueNumber", ",", "NullValueUnconditionalDeref", ">", "nullV...
Note the locations where a known-null value is unconditionally dereferenced. @param thisLocation @param bugLocations @param nullValueGuaranteedDerefMap map of null values to sets of Locations where they are derefed @param derefSet set of values known to be unconditionally dereferenced @param isNullValue the null value...
[ "Note", "the", "locations", "where", "a", "known", "-", "null", "value", "is", "unconditionally", "dereferenced", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/npe/NullDerefAndRedundantComparisonFinder.java#L602-L636
59,704
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/npe/NullDerefAndRedundantComparisonFinder.java
NullDerefAndRedundantComparisonFinder.examineRedundantBranches
private void examineRedundantBranches() { for (RedundantBranch redundantBranch : redundantBranchList) { if (DEBUG) { System.out.println("Redundant branch: " + redundantBranch); } int lineNumber = redundantBranch.lineNumber; // The source to byteco...
java
private void examineRedundantBranches() { for (RedundantBranch redundantBranch : redundantBranchList) { if (DEBUG) { System.out.println("Redundant branch: " + redundantBranch); } int lineNumber = redundantBranch.lineNumber; // The source to byteco...
[ "private", "void", "examineRedundantBranches", "(", ")", "{", "for", "(", "RedundantBranch", "redundantBranch", ":", "redundantBranchList", ")", "{", "if", "(", "DEBUG", ")", "{", "System", ".", "out", ".", "println", "(", "\"Redundant branch: \"", "+", "redunda...
Examine redundant branches.
[ "Examine", "redundant", "branches", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/npe/NullDerefAndRedundantComparisonFinder.java#L641-L686
59,705
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/npe/NullDerefAndRedundantComparisonFinder.java
NullDerefAndRedundantComparisonFinder.analyzeIfNullBranch
private void analyzeIfNullBranch(BasicBlock basicBlock, InstructionHandle lastHandle) throws DataflowAnalysisException { Location location = new Location(lastHandle, basicBlock); IsNullValueFrame frame = invDataflow.getFactAtLocation(location); if (!frame.isValid()) { // This is p...
java
private void analyzeIfNullBranch(BasicBlock basicBlock, InstructionHandle lastHandle) throws DataflowAnalysisException { Location location = new Location(lastHandle, basicBlock); IsNullValueFrame frame = invDataflow.getFactAtLocation(location); if (!frame.isValid()) { // This is p...
[ "private", "void", "analyzeIfNullBranch", "(", "BasicBlock", "basicBlock", ",", "InstructionHandle", "lastHandle", ")", "throws", "DataflowAnalysisException", "{", "Location", "location", "=", "new", "Location", "(", "lastHandle", ",", "basicBlock", ")", ";", "IsNullV...
This is called for both IFNULL and IFNONNULL instructions.
[ "This", "is", "called", "for", "both", "IFNULL", "and", "IFNONNULL", "instructions", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/npe/NullDerefAndRedundantComparisonFinder.java#L751-L811
59,706
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/BugInstance.java
BugInstance.getBugPattern
public @Nonnull BugPattern getBugPattern() { BugPattern result = DetectorFactoryCollection.instance().lookupBugPattern(getType()); if (result != null) { return result; } AnalysisContext.logError("Unable to find description of bug pattern " + getType()); result = Detec...
java
public @Nonnull BugPattern getBugPattern() { BugPattern result = DetectorFactoryCollection.instance().lookupBugPattern(getType()); if (result != null) { return result; } AnalysisContext.logError("Unable to find description of bug pattern " + getType()); result = Detec...
[ "public", "@", "Nonnull", "BugPattern", "getBugPattern", "(", ")", "{", "BugPattern", "result", "=", "DetectorFactoryCollection", ".", "instance", "(", ")", ".", "lookupBugPattern", "(", "getType", "(", ")", ")", ";", "if", "(", "result", "!=", "null", ")", ...
Get the BugPattern.
[ "Get", "the", "BugPattern", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/BugInstance.java#L307-L318
59,707
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/BugInstance.java
BugInstance.findPrimaryAnnotationOfType
@CheckForNull private <T extends BugAnnotation> T findPrimaryAnnotationOfType(Class<T> cls) { T firstMatch = null; for (Iterator<BugAnnotation> i = annotationIterator(); i.hasNext();) { BugAnnotation annotation = i.next(); if (cls.isAssignableFrom(annotation.getClass())) { ...
java
@CheckForNull private <T extends BugAnnotation> T findPrimaryAnnotationOfType(Class<T> cls) { T firstMatch = null; for (Iterator<BugAnnotation> i = annotationIterator(); i.hasNext();) { BugAnnotation annotation = i.next(); if (cls.isAssignableFrom(annotation.getClass())) { ...
[ "@", "CheckForNull", "private", "<", "T", "extends", "BugAnnotation", ">", "T", "findPrimaryAnnotationOfType", "(", "Class", "<", "T", ">", "cls", ")", "{", "T", "firstMatch", "=", "null", ";", "for", "(", "Iterator", "<", "BugAnnotation", ">", "i", "=", ...
Find the first BugAnnotation in the list of annotations that is the same type or a subtype as the given Class parameter. @param cls the Class parameter @return the first matching BugAnnotation of the given type, or null if there is no such BugAnnotation
[ "Find", "the", "first", "BugAnnotation", "in", "the", "list", "of", "annotations", "that", "is", "the", "same", "type", "or", "a", "subtype", "as", "the", "given", "Class", "parameter", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/BugInstance.java#L469-L483
59,708
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/BugInstance.java
BugInstance.getAnnotationWithRole
public @CheckForNull <A extends BugAnnotation> A getAnnotationWithRole(Class<A> c, String role) { for(BugAnnotation a : annotationList) { if (c.isInstance(a) && Objects.equals(role, a.getDescription())) { return c.cast(a); } } return null; }
java
public @CheckForNull <A extends BugAnnotation> A getAnnotationWithRole(Class<A> c, String role) { for(BugAnnotation a : annotationList) { if (c.isInstance(a) && Objects.equals(role, a.getDescription())) { return c.cast(a); } } return null; }
[ "public", "@", "CheckForNull", "<", "A", "extends", "BugAnnotation", ">", "A", "getAnnotationWithRole", "(", "Class", "<", "A", ">", "c", ",", "String", "role", ")", "{", "for", "(", "BugAnnotation", "a", ":", "annotationList", ")", "{", "if", "(", "c", ...
Get the first bug annotation with the specified class and role; return null if no such annotation exists;
[ "Get", "the", "first", "bug", "annotation", "with", "the", "specified", "class", "and", "role", ";", "return", "null", "if", "no", "such", "annotation", "exists", ";" ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/BugInstance.java#L596-L603
59,709
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/BugInstance.java
BugInstance.getProperty
public String getProperty(String name) { BugProperty prop = lookupProperty(name); return prop != null ? prop.getValue() : null; }
java
public String getProperty(String name) { BugProperty prop = lookupProperty(name); return prop != null ? prop.getValue() : null; }
[ "public", "String", "getProperty", "(", "String", "name", ")", "{", "BugProperty", "prop", "=", "lookupProperty", "(", "name", ")", ";", "return", "prop", "!=", "null", "?", "prop", ".", "getValue", "(", ")", ":", "null", ";", "}" ]
Get value of given property. @param name name of the property to get @return the value of the named property, or null if the property has not been set
[ "Get", "value", "of", "given", "property", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/BugInstance.java#L672-L675
59,710
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/BugInstance.java
BugInstance.getProperty
public String getProperty(String name, String defaultValue) { String value = getProperty(name); return value != null ? value : defaultValue; }
java
public String getProperty(String name, String defaultValue) { String value = getProperty(name); return value != null ? value : defaultValue; }
[ "public", "String", "getProperty", "(", "String", "name", ",", "String", "defaultValue", ")", "{", "String", "value", "=", "getProperty", "(", "name", ")", ";", "return", "value", "!=", "null", "?", "value", ":", "defaultValue", ";", "}" ]
Get value of given property, returning given default value if the property has not been set. @param name name of the property to get @param defaultValue default value to return if propery is not set @return the value of the named property, or the default value if the property has not been set
[ "Get", "value", "of", "given", "property", "returning", "given", "default", "value", "if", "the", "property", "has", "not", "been", "set", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/BugInstance.java#L688-L691
59,711
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/BugInstance.java
BugInstance.setProperty
@Nonnull public BugInstance setProperty(String name, String value) { BugProperty prop = lookupProperty(name); if (prop != null) { prop.setValue(value); } else { prop = new BugProperty(name, value); addProperty(prop); } return this; }
java
@Nonnull public BugInstance setProperty(String name, String value) { BugProperty prop = lookupProperty(name); if (prop != null) { prop.setValue(value); } else { prop = new BugProperty(name, value); addProperty(prop); } return this; }
[ "@", "Nonnull", "public", "BugInstance", "setProperty", "(", "String", "name", ",", "String", "value", ")", "{", "BugProperty", "prop", "=", "lookupProperty", "(", "name", ")", ";", "if", "(", "prop", "!=", "null", ")", "{", "prop", ".", "setValue", "(",...
Set value of given property. @param name name of the property to set @param value the value of the property @return this object, so calls can be chained
[ "Set", "value", "of", "given", "property", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/BugInstance.java#L711-L721
59,712
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/BugInstance.java
BugInstance.lookupProperty
public BugProperty lookupProperty(String name) { BugProperty prop = propertyListHead; while (prop != null) { if (prop.getName().equals(name)) { break; } prop = prop.getNext(); } return prop; }
java
public BugProperty lookupProperty(String name) { BugProperty prop = propertyListHead; while (prop != null) { if (prop.getName().equals(name)) { break; } prop = prop.getNext(); } return prop; }
[ "public", "BugProperty", "lookupProperty", "(", "String", "name", ")", "{", "BugProperty", "prop", "=", "propertyListHead", ";", "while", "(", "prop", "!=", "null", ")", "{", "if", "(", "prop", ".", "getName", "(", ")", ".", "equals", "(", "name", ")", ...
Look up a property by name. @param name name of the property to look for @return the BugProperty with the given name, or null if the property has not been set
[ "Look", "up", "a", "property", "by", "name", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/BugInstance.java#L731-L742
59,713
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/BugInstance.java
BugInstance.deleteProperty
public boolean deleteProperty(String name) { BugProperty prev = null; BugProperty prop = propertyListHead; while (prop != null) { if (prop.getName().equals(name)) { break; } prev = prop; prop = prop.getNext(); } if...
java
public boolean deleteProperty(String name) { BugProperty prev = null; BugProperty prop = propertyListHead; while (prop != null) { if (prop.getName().equals(name)) { break; } prev = prop; prop = prop.getNext(); } if...
[ "public", "boolean", "deleteProperty", "(", "String", "name", ")", "{", "BugProperty", "prev", "=", "null", ";", "BugProperty", "prop", "=", "propertyListHead", ";", "while", "(", "prop", "!=", "null", ")", "{", "if", "(", "prop", ".", "getName", "(", ")...
Delete property with given name. @param name name of the property to delete @return true if a property with that name was deleted, or false if there is no such property
[ "Delete", "property", "with", "given", "name", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/BugInstance.java#L752-L783
59,714
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/BugInstance.java
BugInstance.addAnnotations
@Nonnull public BugInstance addAnnotations(Collection<? extends BugAnnotation> annotationCollection) { for (BugAnnotation annotation : annotationCollection) { add(annotation); } return this; }
java
@Nonnull public BugInstance addAnnotations(Collection<? extends BugAnnotation> annotationCollection) { for (BugAnnotation annotation : annotationCollection) { add(annotation); } return this; }
[ "@", "Nonnull", "public", "BugInstance", "addAnnotations", "(", "Collection", "<", "?", "extends", "BugAnnotation", ">", "annotationCollection", ")", "{", "for", "(", "BugAnnotation", "annotation", ":", "annotationCollection", ")", "{", "add", "(", "annotation", "...
Add a Collection of BugAnnotations. @param annotationCollection Collection of BugAnnotations
[ "Add", "a", "Collection", "of", "BugAnnotations", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/BugInstance.java#L807-L813
59,715
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/BugInstance.java
BugInstance.addClassAndMethod
@Nonnull public BugInstance addClassAndMethod(PreorderVisitor visitor) { addClass(visitor); XMethod m = visitor.getXMethod(); addMethod(visitor); if (!MemberUtils.isUserGenerated(m)) { foundInAutogeneratedMethod(); } return this; }
java
@Nonnull public BugInstance addClassAndMethod(PreorderVisitor visitor) { addClass(visitor); XMethod m = visitor.getXMethod(); addMethod(visitor); if (!MemberUtils.isUserGenerated(m)) { foundInAutogeneratedMethod(); } return this; }
[ "@", "Nonnull", "public", "BugInstance", "addClassAndMethod", "(", "PreorderVisitor", "visitor", ")", "{", "addClass", "(", "visitor", ")", ";", "XMethod", "m", "=", "visitor", ".", "getXMethod", "(", ")", ";", "addMethod", "(", "visitor", ")", ";", "if", ...
Add a class annotation and a method annotation for the class and method which the given visitor is currently visiting. @param visitor the BetterVisitor @return this object
[ "Add", "a", "class", "annotation", "and", "a", "method", "annotation", "for", "the", "class", "and", "method", "which", "the", "given", "visitor", "is", "currently", "visiting", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/BugInstance.java#L839-L848
59,716
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/BugInstance.java
BugInstance.addClassAndMethod
@Nonnull public BugInstance addClassAndMethod(JavaClass javaClass, Method method) { addClass(javaClass.getClassName()); addMethod(javaClass, method); if (!MemberUtils.isUserGenerated(method)) { foundInAutogeneratedMethod(); } return this; }
java
@Nonnull public BugInstance addClassAndMethod(JavaClass javaClass, Method method) { addClass(javaClass.getClassName()); addMethod(javaClass, method); if (!MemberUtils.isUserGenerated(method)) { foundInAutogeneratedMethod(); } return this; }
[ "@", "Nonnull", "public", "BugInstance", "addClassAndMethod", "(", "JavaClass", "javaClass", ",", "Method", "method", ")", "{", "addClass", "(", "javaClass", ".", "getClassName", "(", ")", ")", ";", "addMethod", "(", "javaClass", ",", "method", ")", ";", "if...
Add class and method annotations for given class and method. @param javaClass the class @param method the method @return this object
[ "Add", "class", "and", "method", "annotations", "for", "given", "class", "and", "method", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/BugInstance.java#L903-L912
59,717
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/BugInstance.java
BugInstance.addClass
@Nonnull public BugInstance addClass(ClassNode classNode) { String dottedClassName = ClassName.toDottedClassName(classNode.name); ClassAnnotation classAnnotation = new ClassAnnotation(dottedClassName); add(classAnnotation); return this; }
java
@Nonnull public BugInstance addClass(ClassNode classNode) { String dottedClassName = ClassName.toDottedClassName(classNode.name); ClassAnnotation classAnnotation = new ClassAnnotation(dottedClassName); add(classAnnotation); return this; }
[ "@", "Nonnull", "public", "BugInstance", "addClass", "(", "ClassNode", "classNode", ")", "{", "String", "dottedClassName", "=", "ClassName", ".", "toDottedClassName", "(", "classNode", ".", "name", ")", ";", "ClassAnnotation", "classAnnotation", "=", "new", "Class...
Add a class annotation for the classNode. @param classNode the ASM visitor @return this object
[ "Add", "a", "class", "annotation", "for", "the", "classNode", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/BugInstance.java#L959-L965
59,718
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/BugInstance.java
BugInstance.addClass
@Nonnull public BugInstance addClass(PreorderVisitor visitor) { String className = visitor.getDottedClassName(); addClass(className); return this; }
java
@Nonnull public BugInstance addClass(PreorderVisitor visitor) { String className = visitor.getDottedClassName(); addClass(className); return this; }
[ "@", "Nonnull", "public", "BugInstance", "addClass", "(", "PreorderVisitor", "visitor", ")", "{", "String", "className", "=", "visitor", ".", "getDottedClassName", "(", ")", ";", "addClass", "(", "className", ")", ";", "return", "this", ";", "}" ]
Add a class annotation for the class that the visitor is currently visiting. @param visitor the BetterVisitor @return this object
[ "Add", "a", "class", "annotation", "for", "the", "class", "that", "the", "visitor", "is", "currently", "visiting", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/BugInstance.java#L1003-L1008
59,719
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/BugInstance.java
BugInstance.addSuperclass
@Nonnull public BugInstance addSuperclass(PreorderVisitor visitor) { String className = ClassName.toDottedClassName(visitor.getSuperclassName()); addClass(className); return this; }
java
@Nonnull public BugInstance addSuperclass(PreorderVisitor visitor) { String className = ClassName.toDottedClassName(visitor.getSuperclassName()); addClass(className); return this; }
[ "@", "Nonnull", "public", "BugInstance", "addSuperclass", "(", "PreorderVisitor", "visitor", ")", "{", "String", "className", "=", "ClassName", ".", "toDottedClassName", "(", "visitor", ".", "getSuperclassName", "(", ")", ")", ";", "addClass", "(", "className", ...
Add a class annotation for the superclass of the class the visitor is currently visiting. @param visitor the BetterVisitor @return this object
[ "Add", "a", "class", "annotation", "for", "the", "superclass", "of", "the", "class", "the", "visitor", "is", "currently", "visiting", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/BugInstance.java#L1018-L1023
59,720
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/BugInstance.java
BugInstance.addType
@Nonnull public BugInstance addType(String typeDescriptor) { TypeAnnotation typeAnnotation = new TypeAnnotation(typeDescriptor); add(typeAnnotation); return this; }
java
@Nonnull public BugInstance addType(String typeDescriptor) { TypeAnnotation typeAnnotation = new TypeAnnotation(typeDescriptor); add(typeAnnotation); return this; }
[ "@", "Nonnull", "public", "BugInstance", "addType", "(", "String", "typeDescriptor", ")", "{", "TypeAnnotation", "typeAnnotation", "=", "new", "TypeAnnotation", "(", "typeDescriptor", ")", ";", "add", "(", "typeAnnotation", ")", ";", "return", "this", ";", "}" ]
Add a type annotation. Handy for referring to array types. <p> For information on type descriptors, <br> see http://java.sun.com/docs/books/vmspec/2nd-edition/html/ClassFile.doc. html#14152 <br> or http://www.murrayc.com/learning/java/java_classfileformat.shtml# TypeDescriptors @param typeDescriptor a jvm type descri...
[ "Add", "a", "type", "annotation", ".", "Handy", "for", "referring", "to", "array", "types", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/BugInstance.java#L1045-L1050
59,721
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/BugInstance.java
BugInstance.addField
@Nonnull public BugInstance addField(String className, String fieldName, String fieldSig, boolean isStatic) { addField(new FieldAnnotation(className, fieldName, fieldSig, isStatic)); return this; }
java
@Nonnull public BugInstance addField(String className, String fieldName, String fieldSig, boolean isStatic) { addField(new FieldAnnotation(className, fieldName, fieldSig, isStatic)); return this; }
[ "@", "Nonnull", "public", "BugInstance", "addField", "(", "String", "className", ",", "String", "fieldName", ",", "String", "fieldSig", ",", "boolean", "isStatic", ")", "{", "addField", "(", "new", "FieldAnnotation", "(", "className", ",", "fieldName", ",", "f...
Add a field annotation. @param className name of the class containing the field @param fieldName the name of the field @param fieldSig type signature of the field @param isStatic whether or not the field is static @return this object
[ "Add", "a", "field", "annotation", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/BugInstance.java#L1134-L1138
59,722
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/BugInstance.java
BugInstance.addField
@Nonnull public BugInstance addField(FieldVariable field) { return addField(field.getClassName(), field.getFieldName(), field.getFieldSig(), field.isStatic()); }
java
@Nonnull public BugInstance addField(FieldVariable field) { return addField(field.getClassName(), field.getFieldName(), field.getFieldSig(), field.isStatic()); }
[ "@", "Nonnull", "public", "BugInstance", "addField", "(", "FieldVariable", "field", ")", "{", "return", "addField", "(", "field", ".", "getClassName", "(", ")", ",", "field", ".", "getFieldName", "(", ")", ",", "field", ".", "getFieldSig", "(", ")", ",", ...
Add a field annotation for a FieldVariable matched in a ByteCodePattern. @param field the FieldVariable @return this object
[ "Add", "a", "field", "annotation", "for", "a", "FieldVariable", "matched", "in", "a", "ByteCodePattern", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/BugInstance.java#L1185-L1188
59,723
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/BugInstance.java
BugInstance.addField
@Nonnull public BugInstance addField(FieldDescriptor fieldDescriptor) { FieldAnnotation fieldAnnotation = FieldAnnotation.fromFieldDescriptor(fieldDescriptor); add(fieldAnnotation); return this; }
java
@Nonnull public BugInstance addField(FieldDescriptor fieldDescriptor) { FieldAnnotation fieldAnnotation = FieldAnnotation.fromFieldDescriptor(fieldDescriptor); add(fieldAnnotation); return this; }
[ "@", "Nonnull", "public", "BugInstance", "addField", "(", "FieldDescriptor", "fieldDescriptor", ")", "{", "FieldAnnotation", "fieldAnnotation", "=", "FieldAnnotation", ".", "fromFieldDescriptor", "(", "fieldDescriptor", ")", ";", "add", "(", "fieldAnnotation", ")", ";...
Add a field annotation for a FieldDescriptor. @param fieldDescriptor the FieldDescriptor @return this object
[ "Add", "a", "field", "annotation", "for", "a", "FieldDescriptor", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/BugInstance.java#L1224-L1229
59,724
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/BugInstance.java
BugInstance.addVisitedField
@Nonnull public BugInstance addVisitedField(PreorderVisitor visitor) { FieldAnnotation f = FieldAnnotation.fromVisitedField(visitor); addField(f); return this; }
java
@Nonnull public BugInstance addVisitedField(PreorderVisitor visitor) { FieldAnnotation f = FieldAnnotation.fromVisitedField(visitor); addField(f); return this; }
[ "@", "Nonnull", "public", "BugInstance", "addVisitedField", "(", "PreorderVisitor", "visitor", ")", "{", "FieldAnnotation", "f", "=", "FieldAnnotation", ".", "fromVisitedField", "(", "visitor", ")", ";", "addField", "(", "f", ")", ";", "return", "this", ";", "...
Add a field annotation for the field which is being visited by given visitor. @param visitor the visitor @return this object
[ "Add", "a", "field", "annotation", "for", "the", "field", "which", "is", "being", "visited", "by", "given", "visitor", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/BugInstance.java#L1265-L1270
59,725
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/BugInstance.java
BugInstance.addOptionalLocalVariable
@Nonnull public BugInstance addOptionalLocalVariable(DismantleBytecode dbc, OpcodeStack.Item item) { int register = item.getRegisterNumber(); if (register >= 0) { this.add(LocalVariableAnnotation.getLocalVariableAnnotation(dbc.getMethod(), register, dbc.getPC() - 1, dbc.getPC())); ...
java
@Nonnull public BugInstance addOptionalLocalVariable(DismantleBytecode dbc, OpcodeStack.Item item) { int register = item.getRegisterNumber(); if (register >= 0) { this.add(LocalVariableAnnotation.getLocalVariableAnnotation(dbc.getMethod(), register, dbc.getPC() - 1, dbc.getPC())); ...
[ "@", "Nonnull", "public", "BugInstance", "addOptionalLocalVariable", "(", "DismantleBytecode", "dbc", ",", "OpcodeStack", ".", "Item", "item", ")", "{", "int", "register", "=", "item", ".", "getRegisterNumber", "(", ")", ";", "if", "(", "register", ">=", "0", ...
Local variable adders
[ "Local", "variable", "adders" ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/BugInstance.java#L1275-L1283
59,726
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/BugInstance.java
BugInstance.addMethod
@Nonnull public BugInstance addMethod(PreorderVisitor visitor) { MethodAnnotation methodAnnotation = MethodAnnotation.fromVisitedMethod(visitor); addMethod(methodAnnotation); addSourceLinesForMethod(methodAnnotation, SourceLineAnnotation.fromVisitedMethod(visitor)); return this; ...
java
@Nonnull public BugInstance addMethod(PreorderVisitor visitor) { MethodAnnotation methodAnnotation = MethodAnnotation.fromVisitedMethod(visitor); addMethod(methodAnnotation); addSourceLinesForMethod(methodAnnotation, SourceLineAnnotation.fromVisitedMethod(visitor)); return this; ...
[ "@", "Nonnull", "public", "BugInstance", "addMethod", "(", "PreorderVisitor", "visitor", ")", "{", "MethodAnnotation", "methodAnnotation", "=", "MethodAnnotation", ".", "fromVisitedMethod", "(", "visitor", ")", ";", "addMethod", "(", "methodAnnotation", ")", ";", "a...
Add a method annotation for the method which the given visitor is currently visiting. If the method has source line information, then a SourceLineAnnotation is added to the method. @param visitor the BetterVisitor @return this object
[ "Add", "a", "method", "annotation", "for", "the", "method", "which", "the", "given", "visitor", "is", "currently", "visiting", ".", "If", "the", "method", "has", "source", "line", "information", "then", "a", "SourceLineAnnotation", "is", "added", "to", "the", ...
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/BugInstance.java#L1396-L1402
59,727
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/BugInstance.java
BugInstance.addCalledMethod
@Nonnull public BugInstance addCalledMethod(DismantleBytecode visitor) { return addMethod(MethodAnnotation.fromCalledMethod(visitor)).describe(MethodAnnotation.METHOD_CALLED); }
java
@Nonnull public BugInstance addCalledMethod(DismantleBytecode visitor) { return addMethod(MethodAnnotation.fromCalledMethod(visitor)).describe(MethodAnnotation.METHOD_CALLED); }
[ "@", "Nonnull", "public", "BugInstance", "addCalledMethod", "(", "DismantleBytecode", "visitor", ")", "{", "return", "addMethod", "(", "MethodAnnotation", ".", "fromCalledMethod", "(", "visitor", ")", ")", ".", "describe", "(", "MethodAnnotation", ".", "METHOD_CALLE...
Add a method annotation for the method which has been called by the method currently being visited by given visitor. Assumes that the visitor has just looked at an invoke instruction of some kind. @param visitor the DismantleBytecode object @return this object
[ "Add", "a", "method", "annotation", "for", "the", "method", "which", "has", "been", "called", "by", "the", "method", "currently", "being", "visited", "by", "given", "visitor", ".", "Assumes", "that", "the", "visitor", "has", "just", "looked", "at", "an", "...
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/BugInstance.java#L1413-L1416
59,728
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/BugInstance.java
BugInstance.addCalledMethod
@Nonnull public BugInstance addCalledMethod(String className, String methodName, String methodSig, boolean isStatic) { return addMethod(MethodAnnotation.fromCalledMethod(className, methodName, methodSig, isStatic)).describe( MethodAnnotation.METHOD_CALLED); }
java
@Nonnull public BugInstance addCalledMethod(String className, String methodName, String methodSig, boolean isStatic) { return addMethod(MethodAnnotation.fromCalledMethod(className, methodName, methodSig, isStatic)).describe( MethodAnnotation.METHOD_CALLED); }
[ "@", "Nonnull", "public", "BugInstance", "addCalledMethod", "(", "String", "className", ",", "String", "methodName", ",", "String", "methodSig", ",", "boolean", "isStatic", ")", "{", "return", "addMethod", "(", "MethodAnnotation", ".", "fromCalledMethod", "(", "cl...
Add a method annotation. @param className name of class containing called method @param methodName name of called method @param methodSig signature of called method @param isStatic true if called method is static, false if not @return this object
[ "Add", "a", "method", "annotation", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/BugInstance.java#L1436-L1440
59,729
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/BugInstance.java
BugInstance.addParameterAnnotation
@Nonnull public BugInstance addParameterAnnotation(int index, String role) { return addInt(index + 1).describe(role); }
java
@Nonnull public BugInstance addParameterAnnotation(int index, String role) { return addInt(index + 1).describe(role); }
[ "@", "Nonnull", "public", "BugInstance", "addParameterAnnotation", "(", "int", "index", ",", "String", "role", ")", "{", "return", "addInt", "(", "index", "+", "1", ")", ".", "describe", "(", "role", ")", ";", "}" ]
Add an annotation about a parameter @param index parameter index, starting from 0 @param role the role used to describe the parameter
[ "Add", "an", "annotation", "about", "a", "parameter" ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/BugInstance.java#L1544-L1547
59,730
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/BugInstance.java
BugInstance.addString
@Nonnull public BugInstance addString(char c) { add(StringAnnotation.fromRawString(Character.toString(c))); return this; }
java
@Nonnull public BugInstance addString(char c) { add(StringAnnotation.fromRawString(Character.toString(c))); return this; }
[ "@", "Nonnull", "public", "BugInstance", "addString", "(", "char", "c", ")", "{", "add", "(", "StringAnnotation", ".", "fromRawString", "(", "Character", ".", "toString", "(", "c", ")", ")", ")", ";", "return", "this", ";", "}" ]
Add a String annotation. @param c the char value @return this object
[ "Add", "a", "String", "annotation", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/BugInstance.java#L1569-L1573
59,731
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/BugInstance.java
BugInstance.addSourceLine
@Nonnull public BugInstance addSourceLine(ClassContext classContext, MethodGen methodGen, String sourceFile, InstructionHandle start, InstructionHandle end) { // Make sure start and end are really in the right order. if (start.getPosition() > end.getPosition()) { InstructionH...
java
@Nonnull public BugInstance addSourceLine(ClassContext classContext, MethodGen methodGen, String sourceFile, InstructionHandle start, InstructionHandle end) { // Make sure start and end are really in the right order. if (start.getPosition() > end.getPosition()) { InstructionH...
[ "@", "Nonnull", "public", "BugInstance", "addSourceLine", "(", "ClassContext", "classContext", ",", "MethodGen", "methodGen", ",", "String", "sourceFile", ",", "InstructionHandle", "start", ",", "InstructionHandle", "end", ")", "{", "// Make sure start and end are really ...
Add a source line annotation describing a range of instructions. @param classContext the ClassContext @param methodGen the method @param sourceFile source file the method is defined in @param start the start instruction in the range @param end the end instruction in the range (inclusive) @return this object
[ "Add", "a", "source", "line", "annotation", "describing", "a", "range", "of", "instructions", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/BugInstance.java#L1681-L1696
59,732
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/BugInstance.java
BugInstance.addUnknownSourceLine
@Nonnull public BugInstance addUnknownSourceLine(String className, String sourceFile) { SourceLineAnnotation sourceLineAnnotation = SourceLineAnnotation.createUnknown(className, sourceFile); if (sourceLineAnnotation != null) { add(sourceLineAnnotation); } return this; ...
java
@Nonnull public BugInstance addUnknownSourceLine(String className, String sourceFile) { SourceLineAnnotation sourceLineAnnotation = SourceLineAnnotation.createUnknown(className, sourceFile); if (sourceLineAnnotation != null) { add(sourceLineAnnotation); } return this; ...
[ "@", "Nonnull", "public", "BugInstance", "addUnknownSourceLine", "(", "String", "className", ",", "String", "sourceFile", ")", "{", "SourceLineAnnotation", "sourceLineAnnotation", "=", "SourceLineAnnotation", ".", "createUnknown", "(", "className", ",", "sourceFile", ")...
Add a non-specific source line annotation. This will result in the entire source file being displayed. @param className the class name @param sourceFile the source file name @return this object
[ "Add", "a", "non", "-", "specific", "source", "line", "annotation", ".", "This", "will", "result", "in", "the", "entire", "source", "file", "being", "displayed", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/BugInstance.java#L1834-L1841
59,733
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/BugInstance.java
BugInstance.describe
@Nonnull public BugInstance describe(String description) { annotationList.get(annotationList.size() - 1).setDescription(description); return this; }
java
@Nonnull public BugInstance describe(String description) { annotationList.get(annotationList.size() - 1).setDescription(description); return this; }
[ "@", "Nonnull", "public", "BugInstance", "describe", "(", "String", "description", ")", "{", "annotationList", ".", "get", "(", "annotationList", ".", "size", "(", ")", "-", "1", ")", ".", "setDescription", "(", "description", ")", ";", "return", "this", "...
Add a description to the most recently added bug annotation. @param description the description to add @return this object
[ "Add", "a", "description", "to", "the", "most", "recently", "added", "bug", "annotation", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/BugInstance.java#L1926-L1930
59,734
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/type/TypeAnalysis.java
TypeAnalysis.getEdgeExceptionSet
public ExceptionSet getEdgeExceptionSet(Edge edge) { CachedExceptionSet cachedExceptionSet = thrownExceptionSetMap.get(edge.getSource()); return cachedExceptionSet.getEdgeExceptionSet(edge); }
java
public ExceptionSet getEdgeExceptionSet(Edge edge) { CachedExceptionSet cachedExceptionSet = thrownExceptionSetMap.get(edge.getSource()); return cachedExceptionSet.getEdgeExceptionSet(edge); }
[ "public", "ExceptionSet", "getEdgeExceptionSet", "(", "Edge", "edge", ")", "{", "CachedExceptionSet", "cachedExceptionSet", "=", "thrownExceptionSetMap", ".", "get", "(", "edge", ".", "getSource", "(", ")", ")", ";", "return", "cachedExceptionSet", ".", "getEdgeExce...
Get the set of exceptions that can be thrown on given edge. This should only be called after the analysis completes. @param edge the Edge @return the ExceptionSet
[ "Get", "the", "set", "of", "exceptions", "that", "can", "be", "thrown", "on", "given", "edge", ".", "This", "should", "only", "be", "called", "after", "the", "analysis", "completes", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/type/TypeAnalysis.java#L313-L316
59,735
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/type/TypeAnalysis.java
TypeAnalysis.getCachedExceptionSet
private CachedExceptionSet getCachedExceptionSet(BasicBlock basicBlock) { CachedExceptionSet cachedExceptionSet = thrownExceptionSetMap.get(basicBlock); if (cachedExceptionSet == null) { // When creating the cached exception type set for the first time: // - the block result is s...
java
private CachedExceptionSet getCachedExceptionSet(BasicBlock basicBlock) { CachedExceptionSet cachedExceptionSet = thrownExceptionSetMap.get(basicBlock); if (cachedExceptionSet == null) { // When creating the cached exception type set for the first time: // - the block result is s...
[ "private", "CachedExceptionSet", "getCachedExceptionSet", "(", "BasicBlock", "basicBlock", ")", "{", "CachedExceptionSet", "cachedExceptionSet", "=", "thrownExceptionSetMap", ".", "get", "(", "basicBlock", ")", ";", "if", "(", "cachedExceptionSet", "==", "null", ")", ...
Get the cached set of exceptions that can be thrown from given basic block. If this information hasn't been computed yet, then an empty exception set is returned. @param basicBlock the block to get the cached exception set for @return the CachedExceptionSet for the block
[ "Get", "the", "cached", "set", "of", "exceptions", "that", "can", "be", "thrown", "from", "given", "basic", "block", ".", "If", "this", "information", "hasn", "t", "been", "computed", "yet", "then", "an", "empty", "exception", "set", "is", "returned", "." ...
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/type/TypeAnalysis.java#L697-L715
59,736
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/type/TypeAnalysis.java
TypeAnalysis.computeBlockExceptionSet
private CachedExceptionSet computeBlockExceptionSet(BasicBlock basicBlock, TypeFrame result) throws DataflowAnalysisException { ExceptionSet exceptionSet = computeThrownExceptionTypes(basicBlock); TypeFrame copyOfResult = createFact(); copy(result, copyOfResult); CachedExceptionSet c...
java
private CachedExceptionSet computeBlockExceptionSet(BasicBlock basicBlock, TypeFrame result) throws DataflowAnalysisException { ExceptionSet exceptionSet = computeThrownExceptionTypes(basicBlock); TypeFrame copyOfResult = createFact(); copy(result, copyOfResult); CachedExceptionSet c...
[ "private", "CachedExceptionSet", "computeBlockExceptionSet", "(", "BasicBlock", "basicBlock", ",", "TypeFrame", "result", ")", "throws", "DataflowAnalysisException", "{", "ExceptionSet", "exceptionSet", "=", "computeThrownExceptionTypes", "(", "basicBlock", ")", ";", "TypeF...
Compute the set of exceptions that can be thrown from the given basic block. This should only be called if the existing cached exception set is out of date. @param basicBlock the basic block @param result the result fact for the block; this is used to determine whether or not the cached exception set is up to date @re...
[ "Compute", "the", "set", "of", "exceptions", "that", "can", "be", "thrown", "from", "the", "given", "basic", "block", ".", "This", "should", "only", "be", "called", "if", "the", "existing", "cached", "exception", "set", "is", "out", "of", "date", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/type/TypeAnalysis.java#L729-L741
59,737
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/type/TypeAnalysis.java
TypeAnalysis.computeEdgeExceptionSet
private ExceptionSet computeEdgeExceptionSet(Edge edge, ExceptionSet thrownExceptionSet) { if (thrownExceptionSet.isEmpty()) { return thrownExceptionSet; } ExceptionSet result = exceptionSetFactory.createExceptionSet(); if (edge.getType() == UNHANDLED_EXCEPTION_EDGE) { ...
java
private ExceptionSet computeEdgeExceptionSet(Edge edge, ExceptionSet thrownExceptionSet) { if (thrownExceptionSet.isEmpty()) { return thrownExceptionSet; } ExceptionSet result = exceptionSetFactory.createExceptionSet(); if (edge.getType() == UNHANDLED_EXCEPTION_EDGE) { ...
[ "private", "ExceptionSet", "computeEdgeExceptionSet", "(", "Edge", "edge", ",", "ExceptionSet", "thrownExceptionSet", ")", "{", "if", "(", "thrownExceptionSet", ".", "isEmpty", "(", ")", ")", "{", "return", "thrownExceptionSet", ";", "}", "ExceptionSet", "result", ...
Based on the set of exceptions that can be thrown from the source basic block, compute the set of exceptions that can propagate along given exception edge. This method should be called for each outgoing exception edge in sequence, so the caught exceptions can be removed from the thrown exception set as needed. @param ...
[ "Based", "on", "the", "set", "of", "exceptions", "that", "can", "be", "thrown", "from", "the", "source", "basic", "block", "compute", "the", "set", "of", "exceptions", "that", "can", "propagate", "along", "given", "exception", "edge", ".", "This", "method", ...
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/type/TypeAnalysis.java#L757-L825
59,738
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/type/TypeAnalysis.java
TypeAnalysis.computeThrownExceptionTypes
private ExceptionSet computeThrownExceptionTypes(BasicBlock basicBlock) throws DataflowAnalysisException { ExceptionSet exceptionTypeSet = exceptionSetFactory.createExceptionSet(); InstructionHandle pei = basicBlock.getExceptionThrower(); Instruction ins = pei.getInstruction(); // ...
java
private ExceptionSet computeThrownExceptionTypes(BasicBlock basicBlock) throws DataflowAnalysisException { ExceptionSet exceptionTypeSet = exceptionSetFactory.createExceptionSet(); InstructionHandle pei = basicBlock.getExceptionThrower(); Instruction ins = pei.getInstruction(); // ...
[ "private", "ExceptionSet", "computeThrownExceptionTypes", "(", "BasicBlock", "basicBlock", ")", "throws", "DataflowAnalysisException", "{", "ExceptionSet", "exceptionTypeSet", "=", "exceptionSetFactory", ".", "createExceptionSet", "(", ")", ";", "InstructionHandle", "pei", ...
Compute the set of exception types that can be thrown by given basic block. @param basicBlock the basic block @return the set of exceptions that can be thrown by the block
[ "Compute", "the", "set", "of", "exception", "types", "that", "can", "be", "thrown", "by", "given", "basic", "block", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/type/TypeAnalysis.java#L835-L937
59,739
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/visitclass/Util.java
Util.getOuterClass
@CheckForNull public static JavaClass getOuterClass(JavaClass obj) throws ClassNotFoundException { for (Attribute a : obj.getAttributes()) { if (a instanceof InnerClasses) { for (InnerClass ic : ((InnerClasses) a).getInnerClasses()) { if (obj.getClassNameIndex...
java
@CheckForNull public static JavaClass getOuterClass(JavaClass obj) throws ClassNotFoundException { for (Attribute a : obj.getAttributes()) { if (a instanceof InnerClasses) { for (InnerClass ic : ((InnerClasses) a).getInnerClasses()) { if (obj.getClassNameIndex...
[ "@", "CheckForNull", "public", "static", "JavaClass", "getOuterClass", "(", "JavaClass", "obj", ")", "throws", "ClassNotFoundException", "{", "for", "(", "Attribute", "a", ":", "obj", ".", "getAttributes", "(", ")", ")", "{", "if", "(", "a", "instanceof", "I...
Determine the outer class of obj. @param obj @return JavaClass for outer class, or null if obj is not an outer class @throws ClassNotFoundException
[ "Determine", "the", "outer", "class", "of", "obj", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/visitclass/Util.java#L54-L70
59,740
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/graph/SearchTree.java
SearchTree.addVerticesToSet
public void addVerticesToSet(Set<VertexType> set) { // Add the vertex for this object set.add(this.m_vertex); // Add vertices for all children Iterator<SearchTree<VertexType>> i = childIterator(); while (i.hasNext()) { SearchTree<VertexType> child = i.next(); ...
java
public void addVerticesToSet(Set<VertexType> set) { // Add the vertex for this object set.add(this.m_vertex); // Add vertices for all children Iterator<SearchTree<VertexType>> i = childIterator(); while (i.hasNext()) { SearchTree<VertexType> child = i.next(); ...
[ "public", "void", "addVerticesToSet", "(", "Set", "<", "VertexType", ">", "set", ")", "{", "// Add the vertex for this object", "set", ".", "add", "(", "this", ".", "m_vertex", ")", ";", "// Add vertices for all children", "Iterator", "<", "SearchTree", "<", "Vert...
Add all vertices contained in this search tree to the given set.
[ "Add", "all", "vertices", "contained", "in", "this", "search", "tree", "to", "the", "given", "set", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/graph/SearchTree.java#L71-L81
59,741
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/detect/CheckTypeQualifiers.java
CheckTypeQualifiers.checkQualifier
private void checkQualifier(XMethod xmethod, CFG cfg, TypeQualifierValue<?> typeQualifierValue, ForwardTypeQualifierDataflowFactory forwardDataflowFactory, BackwardTypeQualifierDataflowFactory backwardDataflowFactory, ValueNumberDataflow vnaDataflow) throws CheckedAnalysisExc...
java
private void checkQualifier(XMethod xmethod, CFG cfg, TypeQualifierValue<?> typeQualifierValue, ForwardTypeQualifierDataflowFactory forwardDataflowFactory, BackwardTypeQualifierDataflowFactory backwardDataflowFactory, ValueNumberDataflow vnaDataflow) throws CheckedAnalysisExc...
[ "private", "void", "checkQualifier", "(", "XMethod", "xmethod", ",", "CFG", "cfg", ",", "TypeQualifierValue", "<", "?", ">", "typeQualifierValue", ",", "ForwardTypeQualifierDataflowFactory", "forwardDataflowFactory", ",", "BackwardTypeQualifierDataflowFactory", "backwardDataf...
Check a specific TypeQualifierValue on a method. @param xmethod MethodDescriptor of method @param cfg CFG of method @param typeQualifierValue TypeQualifierValue to check @param forwardDataflowFactory ForwardTypeQualifierDataflowFactory used to create forward dataflow analysis objects @param backwardDataflowFactory Bac...
[ "Check", "a", "specific", "TypeQualifierValue", "on", "a", "method", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/detect/CheckTypeQualifiers.java#L216-L257
59,742
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/ClassHash.java
ClassHash.setMethodHash
public void setMethodHash(XMethod method, byte[] methodHash) { methodHashMap.put(method, new MethodHash(method.getName(), method.getSignature(), method.isStatic(), methodHash)); }
java
public void setMethodHash(XMethod method, byte[] methodHash) { methodHashMap.put(method, new MethodHash(method.getName(), method.getSignature(), method.isStatic(), methodHash)); }
[ "public", "void", "setMethodHash", "(", "XMethod", "method", ",", "byte", "[", "]", "methodHash", ")", "{", "methodHashMap", ".", "put", "(", "method", ",", "new", "MethodHash", "(", "method", ".", "getName", "(", ")", ",", "method", ".", "getSignature", ...
Set method hash for given method. @param method the method @param methodHash the method hash
[ "Set", "method", "hash", "for", "given", "method", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/ClassHash.java#L93-L95
59,743
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/ClassHash.java
ClassHash.setClassHash
public void setClassHash(byte[] classHash) { this.classHash = new byte[classHash.length]; System.arraycopy(classHash, 0, this.classHash, 0, classHash.length); }
java
public void setClassHash(byte[] classHash) { this.classHash = new byte[classHash.length]; System.arraycopy(classHash, 0, this.classHash, 0, classHash.length); }
[ "public", "void", "setClassHash", "(", "byte", "[", "]", "classHash", ")", "{", "this", ".", "classHash", "=", "new", "byte", "[", "classHash", ".", "length", "]", ";", "System", ".", "arraycopy", "(", "classHash", ",", "0", ",", "this", ".", "classHas...
Set class hash. @param classHash the class hash value to set
[ "Set", "class", "hash", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/ClassHash.java#L119-L122
59,744
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/ClassHash.java
ClassHash.computeHash
public ClassHash computeHash(JavaClass javaClass) { this.className = javaClass.getClassName(); Method[] methodList = new Method[javaClass.getMethods().length]; // Sort methods System.arraycopy(javaClass.getMethods(), 0, methodList, 0, javaClass.getMethods().length); Arrays.sort...
java
public ClassHash computeHash(JavaClass javaClass) { this.className = javaClass.getClassName(); Method[] methodList = new Method[javaClass.getMethods().length]; // Sort methods System.arraycopy(javaClass.getMethods(), 0, methodList, 0, javaClass.getMethods().length); Arrays.sort...
[ "public", "ClassHash", "computeHash", "(", "JavaClass", "javaClass", ")", "{", "this", ".", "className", "=", "javaClass", ".", "getClassName", "(", ")", ";", "Method", "[", "]", "methodList", "=", "new", "Method", "[", "javaClass", ".", "getMethods", "(", ...
Compute hash for given class and all of its methods. @param javaClass the class @return this object
[ "Compute", "hash", "for", "given", "class", "and", "all", "of", "its", "methods", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/ClassHash.java#L142-L193
59,745
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/ClassHash.java
ClassHash.hashToString
public static String hashToString(byte[] hash) { StringBuilder buf = new StringBuilder(); for (byte b : hash) { buf.append(HEX_CHARS[(b >> 4) & 0xF]); buf.append(HEX_CHARS[b & 0xF]); } return buf.toString(); }
java
public static String hashToString(byte[] hash) { StringBuilder buf = new StringBuilder(); for (byte b : hash) { buf.append(HEX_CHARS[(b >> 4) & 0xF]); buf.append(HEX_CHARS[b & 0xF]); } return buf.toString(); }
[ "public", "static", "String", "hashToString", "(", "byte", "[", "]", "hash", ")", "{", "StringBuilder", "buf", "=", "new", "StringBuilder", "(", ")", ";", "for", "(", "byte", "b", ":", "hash", ")", "{", "buf", ".", "append", "(", "HEX_CHARS", "[", "(...
Convert a hash to a string of hex digits. @param hash the hash @return a String representation of the hash
[ "Convert", "a", "hash", "to", "a", "string", "of", "hex", "digits", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/ClassHash.java#L242-L249
59,746
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/ClassHash.java
ClassHash.stringToHash
public static byte[] stringToHash(String s) { if (s.length() % 2 != 0) { throw new IllegalArgumentException("Invalid hash string: " + s); } byte[] hash = new byte[s.length() / 2]; for (int i = 0; i < s.length(); i += 2) { byte b = (byte) ((hexDigitValue(s.charAt(i...
java
public static byte[] stringToHash(String s) { if (s.length() % 2 != 0) { throw new IllegalArgumentException("Invalid hash string: " + s); } byte[] hash = new byte[s.length() / 2]; for (int i = 0; i < s.length(); i += 2) { byte b = (byte) ((hexDigitValue(s.charAt(i...
[ "public", "static", "byte", "[", "]", "stringToHash", "(", "String", "s", ")", "{", "if", "(", "s", ".", "length", "(", ")", "%", "2", "!=", "0", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Invalid hash string: \"", "+", "s", ")", ";"...
Convert a string of hex digits to a hash. @param s string of hex digits @return the hash value represented by the string
[ "Convert", "a", "string", "of", "hex", "digits", "to", "a", "hash", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/ClassHash.java#L270-L280
59,747
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/bcp/PatternElement.java
PatternElement.lookup
public static Variable lookup(String varName, BindingSet bindingSet) { if (bindingSet == null) { return null; } Binding binding = bindingSet.lookup(varName); return (binding != null) ? binding.getVariable() : null; }
java
public static Variable lookup(String varName, BindingSet bindingSet) { if (bindingSet == null) { return null; } Binding binding = bindingSet.lookup(varName); return (binding != null) ? binding.getVariable() : null; }
[ "public", "static", "Variable", "lookup", "(", "String", "varName", ",", "BindingSet", "bindingSet", ")", "{", "if", "(", "bindingSet", "==", "null", ")", "{", "return", "null", ";", "}", "Binding", "binding", "=", "bindingSet", ".", "lookup", "(", "varNam...
Look up a variable definition in given BindingSet. @param varName the name of the variable @param bindingSet the BindingSet to look in @return the Variable, or null if no Variable is bound to the name
[ "Look", "up", "a", "variable", "definition", "in", "given", "BindingSet", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/bcp/PatternElement.java#L140-L146
59,748
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/props/WarningPropertySet.java
WarningPropertySet.addProperty
public WarningPropertySet<T> addProperty(T prop) { map.put(prop, Boolean.TRUE); return this; }
java
public WarningPropertySet<T> addProperty(T prop) { map.put(prop, Boolean.TRUE); return this; }
[ "public", "WarningPropertySet", "<", "T", ">", "addProperty", "(", "T", "prop", ")", "{", "map", ".", "put", "(", "prop", ",", "Boolean", ".", "TRUE", ")", ";", "return", "this", ";", "}" ]
Add a warning property to the set. The warning implicitly has the boolean value "true" as its attribute. @param prop the WarningProperty @return this object
[ "Add", "a", "warning", "property", "to", "the", "set", ".", "The", "warning", "implicitly", "has", "the", "boolean", "value", "true", "as", "its", "attribute", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/props/WarningPropertySet.java#L83-L86
59,749
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/props/WarningPropertySet.java
WarningPropertySet.setProperty
public WarningPropertySet<T> setProperty(T prop, String value) { map.put(prop, value); return this; }
java
public WarningPropertySet<T> setProperty(T prop, String value) { map.put(prop, value); return this; }
[ "public", "WarningPropertySet", "<", "T", ">", "setProperty", "(", "T", "prop", ",", "String", "value", ")", "{", "map", ".", "put", "(", "prop", ",", "value", ")", ";", "return", "this", ";", "}" ]
Add a warning property and its attribute value. @param prop the WarningProperty @param value the attribute value @return this object
[ "Add", "a", "warning", "property", "and", "its", "attribute", "value", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/props/WarningPropertySet.java#L109-L112
59,750
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/props/WarningPropertySet.java
WarningPropertySet.checkProperty
public boolean checkProperty(T prop, Object value) { Object attribute = getProperty(prop); return (attribute != null && attribute.equals(value)); }
java
public boolean checkProperty(T prop, Object value) { Object attribute = getProperty(prop); return (attribute != null && attribute.equals(value)); }
[ "public", "boolean", "checkProperty", "(", "T", "prop", ",", "Object", "value", ")", "{", "Object", "attribute", "=", "getProperty", "(", "prop", ")", ";", "return", "(", "attribute", "!=", "null", "&&", "attribute", ".", "equals", "(", "value", ")", ")"...
Check whether or not the given WarningProperty has the given attribute value. @param prop the WarningProperty @param value the attribute value @return true if the set contains the WarningProperty and has an attribute equal to the one given, false otherwise
[ "Check", "whether", "or", "not", "the", "given", "WarningProperty", "has", "the", "given", "attribute", "value", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/props/WarningPropertySet.java#L149-L152
59,751
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/props/WarningPropertySet.java
WarningPropertySet.computePriority
public int computePriority(int basePriority) { boolean relaxedReporting = FindBugsAnalysisFeatures.isRelaxedMode(); boolean atLeastMedium = false; boolean falsePositive = false; boolean atMostLow = false; boolean atMostMedium = false; boolean peggedHigh = false; ...
java
public int computePriority(int basePriority) { boolean relaxedReporting = FindBugsAnalysisFeatures.isRelaxedMode(); boolean atLeastMedium = false; boolean falsePositive = false; boolean atMostLow = false; boolean atMostMedium = false; boolean peggedHigh = false; ...
[ "public", "int", "computePriority", "(", "int", "basePriority", ")", "{", "boolean", "relaxedReporting", "=", "FindBugsAnalysisFeatures", ".", "isRelaxedMode", "(", ")", ";", "boolean", "atLeastMedium", "=", "false", ";", "boolean", "falsePositive", "=", "false", ...
Use the PriorityAdjustments specified by the set's WarningProperty elements to compute a warning priority from the given base priority. @param basePriority the base priority @return the computed warning priority
[ "Use", "the", "PriorityAdjustments", "specified", "by", "the", "set", "s", "WarningProperty", "elements", "to", "compute", "a", "warning", "priority", "from", "the", "given", "base", "priority", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/props/WarningPropertySet.java#L175-L253
59,752
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/props/WarningPropertySet.java
WarningPropertySet.decorateBugInstance
public void decorateBugInstance(BugInstance bugInstance) { int priority = computePriority(bugInstance.getPriority()); bugInstance.setPriority(priority); for (Map.Entry<T, Object> entry : map.entrySet()) { WarningProperty prop = entry.getKey(); Object attribute = entry.get...
java
public void decorateBugInstance(BugInstance bugInstance) { int priority = computePriority(bugInstance.getPriority()); bugInstance.setPriority(priority); for (Map.Entry<T, Object> entry : map.entrySet()) { WarningProperty prop = entry.getKey(); Object attribute = entry.get...
[ "public", "void", "decorateBugInstance", "(", "BugInstance", "bugInstance", ")", "{", "int", "priority", "=", "computePriority", "(", "bugInstance", ".", "getPriority", "(", ")", ")", ";", "bugInstance", ".", "setPriority", "(", "priority", ")", ";", "for", "(...
Decorate given BugInstance with properties. @param bugInstance the BugInstance
[ "Decorate", "given", "BugInstance", "with", "properties", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/props/WarningPropertySet.java#L274-L285
59,753
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/vna/ValueNumberAnalysis.java
ValueNumberAnalysis.getEntryValueForParameter
public ValueNumber getEntryValueForParameter(int param) { SignatureParser sigParser = new SignatureParser(methodGen.getSignature()); int p = 0; int slotOffset = methodGen.isStatic() ? 0 : 1; for ( String paramSig : sigParser.parameterSignatures()) { if (p == param) { ...
java
public ValueNumber getEntryValueForParameter(int param) { SignatureParser sigParser = new SignatureParser(methodGen.getSignature()); int p = 0; int slotOffset = methodGen.isStatic() ? 0 : 1; for ( String paramSig : sigParser.parameterSignatures()) { if (p == param) { ...
[ "public", "ValueNumber", "getEntryValueForParameter", "(", "int", "param", ")", "{", "SignatureParser", "sigParser", "=", "new", "SignatureParser", "(", "methodGen", ".", "getSignature", "(", ")", ")", ";", "int", "p", "=", "0", ";", "int", "slotOffset", "=", ...
Get the value number assigned to the given parameter upon entry to the method. @param param a parameter (0 == first parameter) @return the ValueNumber assigned to that parameter
[ "Get", "the", "value", "number", "assigned", "to", "the", "given", "parameter", "upon", "entry", "to", "the", "method", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/vna/ValueNumberAnalysis.java#L162-L177
59,754
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/xml/XMLOutputUtil.java
XMLOutputUtil.writeCollection
public static void writeCollection(XMLOutput xmlOutput, Collection<? extends XMLWriteable> collection) throws IOException { for (XMLWriteable obj : collection) { obj.writeXML(xmlOutput); } }
java
public static void writeCollection(XMLOutput xmlOutput, Collection<? extends XMLWriteable> collection) throws IOException { for (XMLWriteable obj : collection) { obj.writeXML(xmlOutput); } }
[ "public", "static", "void", "writeCollection", "(", "XMLOutput", "xmlOutput", ",", "Collection", "<", "?", "extends", "XMLWriteable", ">", "collection", ")", "throws", "IOException", "{", "for", "(", "XMLWriteable", "obj", ":", "collection", ")", "{", "obj", "...
Write a Collection of XMLWriteable objects. @param xmlOutput the XMLOutput object to write to @param collection Collection of XMLWriteable objects
[ "Write", "a", "Collection", "of", "XMLWriteable", "objects", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/xml/XMLOutputUtil.java#L109-L113
59,755
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/classfile/analysis/MethodInfo.java
MethodInfo.addParameterAnnotation
@Override public void addParameterAnnotation(int param, AnnotationValue annotationValue) { HashMap<Integer, Map<ClassDescriptor, AnnotationValue>> updatedAnnotations = new HashMap<>( methodParameterAnnotations); Map<ClassDescriptor, AnnotationValue> paramMap = updatedAnnotations.get(...
java
@Override public void addParameterAnnotation(int param, AnnotationValue annotationValue) { HashMap<Integer, Map<ClassDescriptor, AnnotationValue>> updatedAnnotations = new HashMap<>( methodParameterAnnotations); Map<ClassDescriptor, AnnotationValue> paramMap = updatedAnnotations.get(...
[ "@", "Override", "public", "void", "addParameterAnnotation", "(", "int", "param", ",", "AnnotationValue", "annotationValue", ")", "{", "HashMap", "<", "Integer", ",", "Map", "<", "ClassDescriptor", ",", "AnnotationValue", ">", ">", "updatedAnnotations", "=", "new"...
Destructively add a parameter annotation. @param param parameter (0 == first parameter) @param annotationValue an AnnotationValue representing a parameter annotation
[ "Destructively", "add", "a", "parameter", "annotation", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/classfile/analysis/MethodInfo.java#L592-L605
59,756
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/classfile/impl/SingleFileCodeBase.java
SingleFileCodeBase.getResourceName
String getResourceName() { if (!resourceNameKnown) { // The resource name of a classfile can only be determined by // reading // the file and parsing the constant pool. // If we can't do this for some reason, then we just // make the resource name equa...
java
String getResourceName() { if (!resourceNameKnown) { // The resource name of a classfile can only be determined by // reading // the file and parsing the constant pool. // If we can't do this for some reason, then we just // make the resource name equa...
[ "String", "getResourceName", "(", ")", "{", "if", "(", "!", "resourceNameKnown", ")", "{", "// The resource name of a classfile can only be determined by", "// reading", "// the file and parsing the constant pool.", "// If we can't do this for some reason, then we just", "// make the r...
Get the resource name of the single file. We have to open the file and parse the constant pool in order to find this out. @return the resource name (e.g., "java/lang/String.class" if the class is java.lang.String)
[ "Get", "the", "resource", "name", "of", "the", "single", "file", ".", "We", "have", "to", "open", "the", "file", "and", "parse", "the", "constant", "pool", "in", "order", "to", "find", "this", "out", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/classfile/impl/SingleFileCodeBase.java#L242-L259
59,757
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/SourceFile.java
SourceFile.getInputStreamFromOffset
public InputStream getInputStreamFromOffset(int offset) throws IOException { loadFileData(); return new ByteArrayInputStream(data, offset, data.length - offset); }
java
public InputStream getInputStreamFromOffset(int offset) throws IOException { loadFileData(); return new ByteArrayInputStream(data, offset, data.length - offset); }
[ "public", "InputStream", "getInputStreamFromOffset", "(", "int", "offset", ")", "throws", "IOException", "{", "loadFileData", "(", ")", ";", "return", "new", "ByteArrayInputStream", "(", "data", ",", "offset", ",", "data", ".", "length", "-", "offset", ")", ";...
Get an InputStream on data starting at given offset. @param offset the start offset @return an InputStream on the data in the source file, starting at the given offset
[ "Get", "an", "InputStream", "on", "data", "starting", "at", "given", "offset", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/SourceFile.java#L141-L144
59,758
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/SourceFile.java
SourceFile.addLineOffset
public void addLineOffset(int offset) { if (numLines >= lineNumberMap.length) { // Grow the line number map. int capacity = lineNumberMap.length * 2; int[] newLineNumberMap = new int[capacity]; System.arraycopy(lineNumberMap, 0, newLineNumberMap, 0, lineNumberMap....
java
public void addLineOffset(int offset) { if (numLines >= lineNumberMap.length) { // Grow the line number map. int capacity = lineNumberMap.length * 2; int[] newLineNumberMap = new int[capacity]; System.arraycopy(lineNumberMap, 0, newLineNumberMap, 0, lineNumberMap....
[ "public", "void", "addLineOffset", "(", "int", "offset", ")", "{", "if", "(", "numLines", ">=", "lineNumberMap", ".", "length", ")", "{", "// Grow the line number map.", "int", "capacity", "=", "lineNumberMap", ".", "length", "*", "2", ";", "int", "[", "]", ...
Add a source line byte offset. This method should be called for each line in the source file, in order. @param offset the byte offset of the next source line
[ "Add", "a", "source", "line", "byte", "offset", ".", "This", "method", "should", "be", "called", "for", "each", "line", "in", "the", "source", "file", "in", "order", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/SourceFile.java#L153-L163
59,759
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/SourceFile.java
SourceFile.getLineOffset
public int getLineOffset(int line) { try { loadFileData(); } catch (IOException e) { System.err.println("SourceFile.getLineOffset: " + e.getMessage()); return -1; } if (line < 0 || line >= numLines) { return -1; } return lin...
java
public int getLineOffset(int line) { try { loadFileData(); } catch (IOException e) { System.err.println("SourceFile.getLineOffset: " + e.getMessage()); return -1; } if (line < 0 || line >= numLines) { return -1; } return lin...
[ "public", "int", "getLineOffset", "(", "int", "line", ")", "{", "try", "{", "loadFileData", "(", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "System", ".", "err", ".", "println", "(", "\"SourceFile.getLineOffset: \"", "+", "e", ".", "getMe...
Get the byte offset in the data for a source line. Note that lines are considered to be zero-index, so the first line in the file is numbered zero. @param line the line number @return the byte offset in the file's data for the line, or -1 if the line is not valid
[ "Get", "the", "byte", "offset", "in", "the", "data", "for", "a", "source", "line", ".", "Note", "that", "lines", "are", "considered", "to", "be", "zero", "-", "index", "so", "the", "first", "line", "in", "the", "file", "is", "numbered", "zero", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/SourceFile.java#L175-L186
59,760
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/graph/StronglyConnectedComponents.java
StronglyConnectedComponents.findStronglyConnectedComponents
public void findStronglyConnectedComponents(GraphType g, GraphToolkit<GraphType, EdgeType, VertexType> toolkit) { // Perform the initial depth first search DepthFirstSearch<GraphType, EdgeType, VertexType> initialDFS = new DepthFirstSearch<>(g); if (m_vertexChooser != null) { initia...
java
public void findStronglyConnectedComponents(GraphType g, GraphToolkit<GraphType, EdgeType, VertexType> toolkit) { // Perform the initial depth first search DepthFirstSearch<GraphType, EdgeType, VertexType> initialDFS = new DepthFirstSearch<>(g); if (m_vertexChooser != null) { initia...
[ "public", "void", "findStronglyConnectedComponents", "(", "GraphType", "g", ",", "GraphToolkit", "<", "GraphType", ",", "EdgeType", ",", "VertexType", ">", "toolkit", ")", "{", "// Perform the initial depth first search", "DepthFirstSearch", "<", "GraphType", ",", "Edge...
Find the strongly connected components in given graph. @param g the graph @param toolkit a GraphToolkit, used to create temporary graphs used by the algorithm
[ "Find", "the", "strongly", "connected", "components", "in", "given", "graph", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/graph/StronglyConnectedComponents.java#L65-L122
59,761
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/util/SplitCamelCaseIdentifier.java
SplitCamelCaseIdentifier.split
public Collection<String> split() { String s = ident; Set<String> result = new HashSet<>(); while (s.length() > 0) { StringBuilder buf = new StringBuilder(); char first = s.charAt(0); buf.append(first); int i = 1; if (s.length() > 1)...
java
public Collection<String> split() { String s = ident; Set<String> result = new HashSet<>(); while (s.length() > 0) { StringBuilder buf = new StringBuilder(); char first = s.charAt(0); buf.append(first); int i = 1; if (s.length() > 1)...
[ "public", "Collection", "<", "String", ">", "split", "(", ")", "{", "String", "s", "=", "ident", ";", "Set", "<", "String", ">", "result", "=", "new", "HashSet", "<>", "(", ")", ";", "while", "(", "s", ".", "length", "(", ")", ">", "0", ")", "{...
Split the identifier into words. @return Collection of words in the identifier
[ "Split", "the", "identifier", "into", "words", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/util/SplitCamelCaseIdentifier.java#L49-L94
59,762
spotbugs/spotbugs
eclipsePlugin/src/de/tobject/findbugs/reporter/JdtUtils.java
JdtUtils.collectAllAnonymous
private static void collectAllAnonymous(List<IType> list, IParent parent, boolean allowNested) throws JavaModelException { IJavaElement[] children = parent.getChildren(); for (int i = 0; i < children.length; i++) { IJavaElement childElem = children[i]; if (isAnonymousType(childEl...
java
private static void collectAllAnonymous(List<IType> list, IParent parent, boolean allowNested) throws JavaModelException { IJavaElement[] children = parent.getChildren(); for (int i = 0; i < children.length; i++) { IJavaElement childElem = children[i]; if (isAnonymousType(childEl...
[ "private", "static", "void", "collectAllAnonymous", "(", "List", "<", "IType", ">", "list", ",", "IParent", "parent", ",", "boolean", "allowNested", ")", "throws", "JavaModelException", "{", "IJavaElement", "[", "]", "children", "=", "parent", ".", "getChildren"...
Traverses down the children tree of this parent and collect all child anon. classes @param list @param parent @param allowNested true to search in IType child elements too @throws JavaModelException
[ "Traverses", "down", "the", "children", "tree", "of", "this", "parent", "and", "collect", "all", "child", "anon", ".", "classes" ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/reporter/JdtUtils.java#L312-L325
59,763
spotbugs/spotbugs
eclipsePlugin/src/de/tobject/findbugs/reporter/JdtUtils.java
JdtUtils.sortAnonymous
private static void sortAnonymous(List<IType> anonymous, IType anonType) { SourceOffsetComparator sourceComparator = new SourceOffsetComparator(); final AnonymClassComparator classComparator = new AnonymClassComparator(anonType, sourceComparator); Collections.sort(anonymous, classComparator); ...
java
private static void sortAnonymous(List<IType> anonymous, IType anonType) { SourceOffsetComparator sourceComparator = new SourceOffsetComparator(); final AnonymClassComparator classComparator = new AnonymClassComparator(anonType, sourceComparator); Collections.sort(anonymous, classComparator); ...
[ "private", "static", "void", "sortAnonymous", "(", "List", "<", "IType", ">", "anonymous", ",", "IType", "anonType", ")", "{", "SourceOffsetComparator", "sourceComparator", "=", "new", "SourceOffsetComparator", "(", ")", ";", "final", "AnonymClassComparator", "class...
Sort given anonymous classes in order like java compiler would generate output classes, in context of given anonymous type @param anonymous
[ "Sort", "given", "anonymous", "classes", "in", "order", "like", "java", "compiler", "would", "generate", "output", "classes", "in", "context", "of", "given", "anonymous", "type" ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/reporter/JdtUtils.java#L333-L342
59,764
spotbugs/spotbugs
eclipsePlugin/src/de/tobject/findbugs/util/ProjectUtilities.java
ProjectUtilities.addFindBugsNature
public static void addFindBugsNature(IProject project, IProgressMonitor monitor) throws CoreException { if (hasFindBugsNature(project)) { return; } IProjectDescription description = project.getDescription(); String[] prevNatures = description.getNatureIds(); for (int ...
java
public static void addFindBugsNature(IProject project, IProgressMonitor monitor) throws CoreException { if (hasFindBugsNature(project)) { return; } IProjectDescription description = project.getDescription(); String[] prevNatures = description.getNatureIds(); for (int ...
[ "public", "static", "void", "addFindBugsNature", "(", "IProject", "project", ",", "IProgressMonitor", "monitor", ")", "throws", "CoreException", "{", "if", "(", "hasFindBugsNature", "(", "project", ")", ")", "{", "return", ";", "}", "IProjectDescription", "descrip...
Adds a FindBugs nature to a project. @param project The project the nature will be applied to. @param monitor A progress monitor. Must not be null. @throws CoreException
[ "Adds", "a", "FindBugs", "nature", "to", "a", "project", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/util/ProjectUtilities.java#L56-L79
59,765
spotbugs/spotbugs
eclipsePlugin/src/de/tobject/findbugs/util/ProjectUtilities.java
ProjectUtilities.hasFindBugsNature
public static boolean hasFindBugsNature(IProject project) { try { return ProjectUtilities.isJavaProject(project) && project.hasNature(FindbugsPlugin.NATURE_ID); } catch (CoreException e) { FindbugsPlugin.getDefault().logException(e, "Error while testing SpotBugs nature for projec...
java
public static boolean hasFindBugsNature(IProject project) { try { return ProjectUtilities.isJavaProject(project) && project.hasNature(FindbugsPlugin.NATURE_ID); } catch (CoreException e) { FindbugsPlugin.getDefault().logException(e, "Error while testing SpotBugs nature for projec...
[ "public", "static", "boolean", "hasFindBugsNature", "(", "IProject", "project", ")", "{", "try", "{", "return", "ProjectUtilities", ".", "isJavaProject", "(", "project", ")", "&&", "project", ".", "hasNature", "(", "FindbugsPlugin", ".", "NATURE_ID", ")", ";", ...
Using the natures name, check whether the current project has FindBugs nature. @return boolean <code>true</code>, if the FindBugs nature is assigned to the project, <code>false</code> otherwise.
[ "Using", "the", "natures", "name", "check", "whether", "the", "current", "project", "has", "FindBugs", "nature", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/util/ProjectUtilities.java#L88-L95
59,766
spotbugs/spotbugs
eclipsePlugin/src/de/tobject/findbugs/util/ProjectUtilities.java
ProjectUtilities.removeFindBugsNature
public static void removeFindBugsNature(IProject project, IProgressMonitor monitor) throws CoreException { if (!hasFindBugsNature(project)) { return; } IProjectDescription description = project.getDescription(); String[] prevNatures = description.getNatureIds(); Array...
java
public static void removeFindBugsNature(IProject project, IProgressMonitor monitor) throws CoreException { if (!hasFindBugsNature(project)) { return; } IProjectDescription description = project.getDescription(); String[] prevNatures = description.getNatureIds(); Array...
[ "public", "static", "void", "removeFindBugsNature", "(", "IProject", "project", ",", "IProgressMonitor", "monitor", ")", "throws", "CoreException", "{", "if", "(", "!", "hasFindBugsNature", "(", "project", ")", ")", "{", "return", ";", "}", "IProjectDescription", ...
Removes the FindBugs nature from a project. @param project The project the nature will be removed from. @param monitor A progress monitor. Must not be null. @throws CoreException
[ "Removes", "the", "FindBugs", "nature", "from", "a", "project", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/util/ProjectUtilities.java#L121-L136
59,767
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/SelfCalls.java
SelfCalls.execute
public void execute() throws CFGBuilderException { JavaClass jclass = classContext.getJavaClass(); Method[] methods = jclass.getMethods(); LOG.debug("Class has {} methods", methods.length); // Add call graph nodes for all methods for (Method method : methods) { call...
java
public void execute() throws CFGBuilderException { JavaClass jclass = classContext.getJavaClass(); Method[] methods = jclass.getMethods(); LOG.debug("Class has {} methods", methods.length); // Add call graph nodes for all methods for (Method method : methods) { call...
[ "public", "void", "execute", "(", ")", "throws", "CFGBuilderException", "{", "JavaClass", "jclass", "=", "classContext", ".", "getJavaClass", "(", ")", ";", "Method", "[", "]", "methods", "=", "jclass", ".", "getMethods", "(", ")", ";", "LOG", ".", "debug"...
Find the self calls.
[ "Find", "the", "self", "calls", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/SelfCalls.java#L73-L96
59,768
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/SelfCalls.java
SelfCalls.callSiteIterator
public Iterator<CallSite> callSiteIterator() { return new Iterator<CallSite>() { private final Iterator<CallGraphEdge> iter = callGraph.edgeIterator(); @Override public boolean hasNext() { return iter.hasNext(); } @Override ...
java
public Iterator<CallSite> callSiteIterator() { return new Iterator<CallSite>() { private final Iterator<CallGraphEdge> iter = callGraph.edgeIterator(); @Override public boolean hasNext() { return iter.hasNext(); } @Override ...
[ "public", "Iterator", "<", "CallSite", ">", "callSiteIterator", "(", ")", "{", "return", "new", "Iterator", "<", "CallSite", ">", "(", ")", "{", "private", "final", "Iterator", "<", "CallGraphEdge", ">", "iter", "=", "callGraph", ".", "edgeIterator", "(", ...
Get an Iterator over all self call sites.
[ "Get", "an", "Iterator", "over", "all", "self", "call", "sites", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/SelfCalls.java#L128-L147
59,769
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/SelfCalls.java
SelfCalls.scan
private void scan(CallGraphNode node) throws CFGBuilderException { Method method = node.getMethod(); CFG cfg = classContext.getCFG(method); if (method.isSynchronized()) { hasSynchronization = true; } Iterator<BasicBlock> i = cfg.blockIterator(); while (i.has...
java
private void scan(CallGraphNode node) throws CFGBuilderException { Method method = node.getMethod(); CFG cfg = classContext.getCFG(method); if (method.isSynchronized()) { hasSynchronization = true; } Iterator<BasicBlock> i = cfg.blockIterator(); while (i.has...
[ "private", "void", "scan", "(", "CallGraphNode", "node", ")", "throws", "CFGBuilderException", "{", "Method", "method", "=", "node", ".", "getMethod", "(", ")", ";", "CFG", "cfg", "=", "classContext", ".", "getCFG", "(", "method", ")", ";", "if", "(", "m...
Scan a method for self call sites. @param node the CallGraphNode for the method to be scanned
[ "Scan", "a", "method", "for", "self", "call", "sites", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/SelfCalls.java#L162-L194
59,770
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/SelfCalls.java
SelfCalls.isSelfCall
private Method isSelfCall(InvokeInstruction inv) { ConstantPoolGen cpg = classContext.getConstantPoolGen(); JavaClass jclass = classContext.getJavaClass(); String calledClassName = inv.getClassName(cpg); // FIXME: is it possible we would see a superclass name here? // Not a big...
java
private Method isSelfCall(InvokeInstruction inv) { ConstantPoolGen cpg = classContext.getConstantPoolGen(); JavaClass jclass = classContext.getJavaClass(); String calledClassName = inv.getClassName(cpg); // FIXME: is it possible we would see a superclass name here? // Not a big...
[ "private", "Method", "isSelfCall", "(", "InvokeInstruction", "inv", ")", "{", "ConstantPoolGen", "cpg", "=", "classContext", ".", "getConstantPoolGen", "(", ")", ";", "JavaClass", "jclass", "=", "classContext", ".", "getJavaClass", "(", ")", ";", "String", "call...
Is the given instruction a self-call?
[ "Is", "the", "given", "instruction", "a", "self", "-", "call?" ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/SelfCalls.java#L199-L235
59,771
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/DetectorFactory.java
DetectorFactory.isEnabledForCurrentJRE
public boolean isEnabledForCurrentJRE() { if ("".equals(requireJRE)) { return true; } try { JavaVersion requiredVersion = new JavaVersion(requireJRE); JavaVersion runtimeVersion = JavaVersion.getRuntimeVersion(); if (DEBUG_JAVA_VERSION) { ...
java
public boolean isEnabledForCurrentJRE() { if ("".equals(requireJRE)) { return true; } try { JavaVersion requiredVersion = new JavaVersion(requireJRE); JavaVersion runtimeVersion = JavaVersion.getRuntimeVersion(); if (DEBUG_JAVA_VERSION) { ...
[ "public", "boolean", "isEnabledForCurrentJRE", "(", ")", "{", "if", "(", "\"\"", ".", "equals", "(", "requireJRE", ")", ")", "{", "return", "true", ";", "}", "try", "{", "JavaVersion", "requiredVersion", "=", "new", "JavaVersion", "(", "requireJRE", ")", "...
Check to see if we are running on a recent-enough JRE for this detector to be enabled. @return true if the current JRE is recent enough to run the Detector, false if it is too old
[ "Check", "to", "see", "if", "we", "are", "running", "on", "a", "recent", "-", "enough", "JRE", "for", "this", "detector", "to", "be", "enabled", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/DetectorFactory.java#L246-L271
59,772
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/DetectorFactory.java
DetectorFactory.getReportedBugPatterns
public Set<BugPattern> getReportedBugPatterns() { Set<BugPattern> result = new TreeSet<>(); StringTokenizer tok = new StringTokenizer(reports, ","); while (tok.hasMoreTokens()) { String type = tok.nextToken(); BugPattern bugPattern = DetectorFactoryCollection.instance().l...
java
public Set<BugPattern> getReportedBugPatterns() { Set<BugPattern> result = new TreeSet<>(); StringTokenizer tok = new StringTokenizer(reports, ","); while (tok.hasMoreTokens()) { String type = tok.nextToken(); BugPattern bugPattern = DetectorFactoryCollection.instance().l...
[ "public", "Set", "<", "BugPattern", ">", "getReportedBugPatterns", "(", ")", "{", "Set", "<", "BugPattern", ">", "result", "=", "new", "TreeSet", "<>", "(", ")", ";", "StringTokenizer", "tok", "=", "new", "StringTokenizer", "(", "reports", ",", "\",\"", ")...
Get set of all BugPatterns this detector reports. An empty set means that we don't know what kind of bug patterns might be reported.
[ "Get", "set", "of", "all", "BugPatterns", "this", "detector", "reports", ".", "An", "empty", "set", "means", "that", "we", "don", "t", "know", "what", "kind", "of", "bug", "patterns", "might", "be", "reported", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/DetectorFactory.java#L345-L356
59,773
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/DetectorFactory.java
DetectorFactory.getShortName
public String getShortName() { int endOfPkg = className.lastIndexOf('.'); if (endOfPkg >= 0) { return className.substring(endOfPkg + 1); } return className; }
java
public String getShortName() { int endOfPkg = className.lastIndexOf('.'); if (endOfPkg >= 0) { return className.substring(endOfPkg + 1); } return className; }
[ "public", "String", "getShortName", "(", ")", "{", "int", "endOfPkg", "=", "className", ".", "lastIndexOf", "(", "'", "'", ")", ";", "if", "(", "endOfPkg", ">=", "0", ")", "{", "return", "className", ".", "substring", "(", "endOfPkg", "+", "1", ")", ...
Get the short name of the Detector. This is the name of the detector class without the package qualification.
[ "Get", "the", "short", "name", "of", "the", "Detector", ".", "This", "is", "the", "name", "of", "the", "detector", "class", "without", "the", "package", "qualification", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/DetectorFactory.java#L403-L409
59,774
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/vna/LoadedFieldSet.java
LoadedFieldSet.getLoadStoreCount
public LoadStoreCount getLoadStoreCount(XField field) { LoadStoreCount loadStoreCount = loadStoreCountMap.get(field); if (loadStoreCount == null) { loadStoreCount = new LoadStoreCount(); loadStoreCountMap.put(field, loadStoreCount); } return loadStoreCount; }
java
public LoadStoreCount getLoadStoreCount(XField field) { LoadStoreCount loadStoreCount = loadStoreCountMap.get(field); if (loadStoreCount == null) { loadStoreCount = new LoadStoreCount(); loadStoreCountMap.put(field, loadStoreCount); } return loadStoreCount; }
[ "public", "LoadStoreCount", "getLoadStoreCount", "(", "XField", "field", ")", "{", "LoadStoreCount", "loadStoreCount", "=", "loadStoreCountMap", ".", "get", "(", "field", ")", ";", "if", "(", "loadStoreCount", "==", "null", ")", "{", "loadStoreCount", "=", "new"...
Get the number of times given field is loaded and stored within the method. @param field the field @return the load/store count object
[ "Get", "the", "number", "of", "times", "given", "field", "is", "loaded", "and", "stored", "within", "the", "method", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/vna/LoadedFieldSet.java#L87-L94
59,775
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/vna/LoadedFieldSet.java
LoadedFieldSet.addLoad
public void addLoad(InstructionHandle handle, XField field) { getLoadStoreCount(field).loadCount++; handleToFieldMap.put(handle, field); loadHandleSet.set(handle.getPosition()); }
java
public void addLoad(InstructionHandle handle, XField field) { getLoadStoreCount(field).loadCount++; handleToFieldMap.put(handle, field); loadHandleSet.set(handle.getPosition()); }
[ "public", "void", "addLoad", "(", "InstructionHandle", "handle", ",", "XField", "field", ")", "{", "getLoadStoreCount", "(", "field", ")", ".", "loadCount", "++", ";", "handleToFieldMap", ".", "put", "(", "handle", ",", "field", ")", ";", "loadHandleSet", "....
Add a load of given field at given instruction. @param handle the instruction @param field the field
[ "Add", "a", "load", "of", "given", "field", "at", "given", "instruction", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/vna/LoadedFieldSet.java#L104-L108
59,776
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/vna/LoadedFieldSet.java
LoadedFieldSet.addStore
public void addStore(InstructionHandle handle, XField field) { getLoadStoreCount(field).storeCount++; handleToFieldMap.put(handle, field); }
java
public void addStore(InstructionHandle handle, XField field) { getLoadStoreCount(field).storeCount++; handleToFieldMap.put(handle, field); }
[ "public", "void", "addStore", "(", "InstructionHandle", "handle", ",", "XField", "field", ")", "{", "getLoadStoreCount", "(", "field", ")", ".", "storeCount", "++", ";", "handleToFieldMap", ".", "put", "(", "handle", ",", "field", ")", ";", "}" ]
Add a store of given field at given instruction. @param handle the instruction @param field the field
[ "Add", "a", "store", "of", "given", "field", "at", "given", "instruction", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/vna/LoadedFieldSet.java#L118-L121
59,777
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/SourceLineAnnotation.java
SourceLineAnnotation.forFirstLineOfMethod
public static SourceLineAnnotation forFirstLineOfMethod(MethodDescriptor methodDescriptor) { SourceLineAnnotation result = null; try { Method m = Global.getAnalysisCache().getMethodAnalysis(Method.class, methodDescriptor); XClass xclass = Global.getAnalysisCache().getClassAnalys...
java
public static SourceLineAnnotation forFirstLineOfMethod(MethodDescriptor methodDescriptor) { SourceLineAnnotation result = null; try { Method m = Global.getAnalysisCache().getMethodAnalysis(Method.class, methodDescriptor); XClass xclass = Global.getAnalysisCache().getClassAnalys...
[ "public", "static", "SourceLineAnnotation", "forFirstLineOfMethod", "(", "MethodDescriptor", "methodDescriptor", ")", "{", "SourceLineAnnotation", "result", "=", "null", ";", "try", "{", "Method", "m", "=", "Global", ".", "getAnalysisCache", "(", ")", ".", "getMetho...
Make a best-effort attempt to create a SourceLineAnnotation for the first line of a method. @param methodDescriptor a method @return SourceLineAnnotation describing the first line of the method (insofar as we can actually figure that out from the bytecode)
[ "Make", "a", "best", "-", "effort", "attempt", "to", "create", "a", "SourceLineAnnotation", "for", "the", "first", "line", "of", "a", "method", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/SourceLineAnnotation.java#L322-L354
59,778
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/SourceLineAnnotation.java
SourceLineAnnotation.fromVisitedInstruction
public static SourceLineAnnotation fromVisitedInstruction(ClassContext classContext, Method method, Location loc) { return fromVisitedInstruction(classContext, method, loc.getHandle()); }
java
public static SourceLineAnnotation fromVisitedInstruction(ClassContext classContext, Method method, Location loc) { return fromVisitedInstruction(classContext, method, loc.getHandle()); }
[ "public", "static", "SourceLineAnnotation", "fromVisitedInstruction", "(", "ClassContext", "classContext", ",", "Method", "method", ",", "Location", "loc", ")", "{", "return", "fromVisitedInstruction", "(", "classContext", ",", "method", ",", "loc", ".", "getHandle", ...
Create from Method and Location in a visited class. @param classContext ClassContext of visited class @param method Method in visited class @param loc Location in visited class @return SourceLineAnnotation describing visited Location
[ "Create", "from", "Method", "and", "Location", "in", "a", "visited", "class", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/SourceLineAnnotation.java#L399-L401
59,779
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/SourceLineAnnotation.java
SourceLineAnnotation.fromVisitedInstruction
public static SourceLineAnnotation fromVisitedInstruction(ClassContext classContext, Method method, InstructionHandle handle) { return fromVisitedInstruction(classContext, method, handle.getPosition()); }
java
public static SourceLineAnnotation fromVisitedInstruction(ClassContext classContext, Method method, InstructionHandle handle) { return fromVisitedInstruction(classContext, method, handle.getPosition()); }
[ "public", "static", "SourceLineAnnotation", "fromVisitedInstruction", "(", "ClassContext", "classContext", ",", "Method", "method", ",", "InstructionHandle", "handle", ")", "{", "return", "fromVisitedInstruction", "(", "classContext", ",", "method", ",", "handle", ".", ...
Create from Method and InstructionHandle in a visited class. @param classContext ClassContext of visited class @param method Method in visited class @param handle InstructionHandle in visited class @return SourceLineAnnotation describing visited instruction
[ "Create", "from", "Method", "and", "InstructionHandle", "in", "a", "visited", "class", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/SourceLineAnnotation.java#L414-L416
59,780
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/SourceLineAnnotation.java
SourceLineAnnotation.fromVisitedInstruction
public static SourceLineAnnotation fromVisitedInstruction(MethodDescriptor methodDescriptor, Location location) { return fromVisitedInstruction(methodDescriptor, location.getHandle().getPosition()); }
java
public static SourceLineAnnotation fromVisitedInstruction(MethodDescriptor methodDescriptor, Location location) { return fromVisitedInstruction(methodDescriptor, location.getHandle().getPosition()); }
[ "public", "static", "SourceLineAnnotation", "fromVisitedInstruction", "(", "MethodDescriptor", "methodDescriptor", ",", "Location", "location", ")", "{", "return", "fromVisitedInstruction", "(", "methodDescriptor", ",", "location", ".", "getHandle", "(", ")", ".", "getP...
Create from MethodDescriptor and Location of visited instruction. @param methodDescriptor MethodDescriptor identifying analyzed method @param location Location of instruction within analyed method @return SourceLineAnnotation describing visited instruction
[ "Create", "from", "MethodDescriptor", "and", "Location", "of", "visited", "instruction", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/SourceLineAnnotation.java#L427-L429
59,781
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/SourceLineAnnotation.java
SourceLineAnnotation.fromVisitedInstructionRange
public static SourceLineAnnotation fromVisitedInstructionRange(ClassContext classContext, MethodGen methodGen, String sourceFile, InstructionHandle start, InstructionHandle end) { LineNumberTable lineNumberTable = methodGen.getLineNumberTable(methodGen.getConstantPool()); String className = ...
java
public static SourceLineAnnotation fromVisitedInstructionRange(ClassContext classContext, MethodGen methodGen, String sourceFile, InstructionHandle start, InstructionHandle end) { LineNumberTable lineNumberTable = methodGen.getLineNumberTable(methodGen.getConstantPool()); String className = ...
[ "public", "static", "SourceLineAnnotation", "fromVisitedInstructionRange", "(", "ClassContext", "classContext", ",", "MethodGen", "methodGen", ",", "String", "sourceFile", ",", "InstructionHandle", "start", ",", "InstructionHandle", "end", ")", "{", "LineNumberTable", "li...
Factory method for creating a source line annotation describing the source line numbers for a range of instruction in a method. @param classContext theClassContext @param methodGen the method @param start the start instruction @param end the end instruction (inclusive)
[ "Factory", "method", "for", "creating", "a", "source", "line", "annotation", "describing", "the", "source", "line", "numbers", "for", "a", "range", "of", "instruction", "in", "a", "method", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/SourceLineAnnotation.java#L607-L619
59,782
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/AssertionMethods.java
AssertionMethods.isAssertionInstruction
public boolean isAssertionInstruction(Instruction ins, ConstantPoolGen cpg) { if (ins instanceof InvokeInstruction) { return isAssertionCall((InvokeInstruction) ins); } if (ins instanceof GETSTATIC) { GETSTATIC getStatic = (GETSTATIC) ins; String className = ...
java
public boolean isAssertionInstruction(Instruction ins, ConstantPoolGen cpg) { if (ins instanceof InvokeInstruction) { return isAssertionCall((InvokeInstruction) ins); } if (ins instanceof GETSTATIC) { GETSTATIC getStatic = (GETSTATIC) ins; String className = ...
[ "public", "boolean", "isAssertionInstruction", "(", "Instruction", "ins", ",", "ConstantPoolGen", "cpg", ")", "{", "if", "(", "ins", "instanceof", "InvokeInstruction", ")", "{", "return", "isAssertionCall", "(", "(", "InvokeInstruction", ")", "ins", ")", ";", "}...
Does the given instruction refer to a likely assertion method? @param ins the instruction @return true if the instruction likely refers to an assertion, false if not
[ "Does", "the", "given", "instruction", "refer", "to", "a", "likely", "assertion", "method?" ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/AssertionMethods.java#L209-L225
59,783
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/BytecodeScanner.java
BytecodeScanner.unsignedValueOf
private static short unsignedValueOf(byte value) { short result; if ((value & 0x80) != 0) { result = (short) (value & 0x7F); result |= 0x80; } else { result = value; } return result; }
java
private static short unsignedValueOf(byte value) { short result; if ((value & 0x80) != 0) { result = (short) (value & 0x7F); result |= 0x80; } else { result = value; } return result; }
[ "private", "static", "short", "unsignedValueOf", "(", "byte", "value", ")", "{", "short", "result", ";", "if", "(", "(", "value", "&", "0x80", ")", "!=", "0", ")", "{", "result", "=", "(", "short", ")", "(", "value", "&", "0x7F", ")", ";", "result"...
Convert the unsigned value of a byte into a short. @param value the byte @return the byte's unsigned value as a short
[ "Convert", "the", "unsigned", "value", "of", "a", "byte", "into", "a", "short", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/BytecodeScanner.java#L57-L66
59,784
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/BytecodeScanner.java
BytecodeScanner.extractInt
private static int extractInt(byte[] arr, int offset) { return ((arr[offset] & 0xFF) << 24) | ((arr[offset + 1] & 0xFF) << 16) | ((arr[offset + 2] & 0xFF) << 8) | (arr[offset + 3] & 0xFF); }
java
private static int extractInt(byte[] arr, int offset) { return ((arr[offset] & 0xFF) << 24) | ((arr[offset + 1] & 0xFF) << 16) | ((arr[offset + 2] & 0xFF) << 8) | (arr[offset + 3] & 0xFF); }
[ "private", "static", "int", "extractInt", "(", "byte", "[", "]", "arr", ",", "int", "offset", ")", "{", "return", "(", "(", "arr", "[", "offset", "]", "&", "0xFF", ")", "<<", "24", ")", "|", "(", "(", "arr", "[", "offset", "+", "1", "]", "&", ...
Extract an int from bytes at the given offset in the array. @param arr the array @param offset the offset in the array
[ "Extract", "an", "int", "from", "bytes", "at", "the", "given", "offset", "in", "the", "array", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/BytecodeScanner.java#L76-L79
59,785
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/deref/UnconditionalValueDerefSet.java
UnconditionalValueDerefSet.makeSameAs
public void makeSameAs(UnconditionalValueDerefSet source) { // Copy value numbers valueNumbersUnconditionallyDereferenced.clear(); valueNumbersUnconditionallyDereferenced.or(source.valueNumbersUnconditionallyDereferenced); lastUpdateTimestamp = source.lastUpdateTimestamp; // Copy...
java
public void makeSameAs(UnconditionalValueDerefSet source) { // Copy value numbers valueNumbersUnconditionallyDereferenced.clear(); valueNumbersUnconditionallyDereferenced.or(source.valueNumbersUnconditionallyDereferenced); lastUpdateTimestamp = source.lastUpdateTimestamp; // Copy...
[ "public", "void", "makeSameAs", "(", "UnconditionalValueDerefSet", "source", ")", "{", "// Copy value numbers", "valueNumbersUnconditionallyDereferenced", ".", "clear", "(", ")", ";", "valueNumbersUnconditionallyDereferenced", ".", "or", "(", "source", ".", "valueNumbersUnc...
Make this dataflow fact the same as the given one. @param source another dataflow fact
[ "Make", "this", "dataflow", "fact", "the", "same", "as", "the", "given", "one", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/deref/UnconditionalValueDerefSet.java#L124-L137
59,786
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/deref/UnconditionalValueDerefSet.java
UnconditionalValueDerefSet.isSameAs
public boolean isSameAs(UnconditionalValueDerefSet otherFact) { return valueNumbersUnconditionallyDereferenced.equals(otherFact.valueNumbersUnconditionallyDereferenced) && derefLocationSetMap.equals(otherFact.derefLocationSetMap); }
java
public boolean isSameAs(UnconditionalValueDerefSet otherFact) { return valueNumbersUnconditionallyDereferenced.equals(otherFact.valueNumbersUnconditionallyDereferenced) && derefLocationSetMap.equals(otherFact.derefLocationSetMap); }
[ "public", "boolean", "isSameAs", "(", "UnconditionalValueDerefSet", "otherFact", ")", "{", "return", "valueNumbersUnconditionallyDereferenced", ".", "equals", "(", "otherFact", ".", "valueNumbersUnconditionallyDereferenced", ")", "&&", "derefLocationSetMap", ".", "equals", ...
Return whether or not this dataflow fact is identical to the one given. @param otherFact another dataflow fact @return true if the other dataflow fact is identical to this one, false otherwise
[ "Return", "whether", "or", "not", "this", "dataflow", "fact", "is", "identical", "to", "the", "one", "given", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/deref/UnconditionalValueDerefSet.java#L147-L150
59,787
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/deref/UnconditionalValueDerefSet.java
UnconditionalValueDerefSet.addDeref
public void addDeref(ValueNumber vn, Location location) { if (UnconditionalValueDerefAnalysis.DEBUG) { System.out.println("Adding dereference of " + vn + " to # " + System.identityHashCode(this) + " @ " + location); } valueNumbersUnconditionallyDereferenced.set(vn.getNumber()); ...
java
public void addDeref(ValueNumber vn, Location location) { if (UnconditionalValueDerefAnalysis.DEBUG) { System.out.println("Adding dereference of " + vn + " to # " + System.identityHashCode(this) + " @ " + location); } valueNumbersUnconditionallyDereferenced.set(vn.getNumber()); ...
[ "public", "void", "addDeref", "(", "ValueNumber", "vn", ",", "Location", "location", ")", "{", "if", "(", "UnconditionalValueDerefAnalysis", ".", "DEBUG", ")", "{", "System", ".", "out", ".", "println", "(", "\"Adding dereference of \"", "+", "vn", "+", "\" to...
Mark a value as being dereferenced at given Location. @param vn the value @param location the Location
[ "Mark", "a", "value", "as", "being", "dereferenced", "at", "given", "Location", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/deref/UnconditionalValueDerefSet.java#L244-L252
59,788
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/deref/UnconditionalValueDerefSet.java
UnconditionalValueDerefSet.setDerefSet
public void setDerefSet(ValueNumber vn, Set<Location> derefSet) { if (UnconditionalValueDerefAnalysis.DEBUG) { System.out.println("Adding dereference of " + vn + " for # " + System.identityHashCode(this) + " to " + derefSet); } valueNumbersUnconditionallyDereferenced.set(vn.getNumber...
java
public void setDerefSet(ValueNumber vn, Set<Location> derefSet) { if (UnconditionalValueDerefAnalysis.DEBUG) { System.out.println("Adding dereference of " + vn + " for # " + System.identityHashCode(this) + " to " + derefSet); } valueNumbersUnconditionallyDereferenced.set(vn.getNumber...
[ "public", "void", "setDerefSet", "(", "ValueNumber", "vn", ",", "Set", "<", "Location", ">", "derefSet", ")", "{", "if", "(", "UnconditionalValueDerefAnalysis", ".", "DEBUG", ")", "{", "System", ".", "out", ".", "println", "(", "\"Adding dereference of \"", "+...
Set a value as being unconditionally dereferenced at the given set of locations. @param vn the value @param derefSet the Set of dereference Locations
[ "Set", "a", "value", "as", "being", "unconditionally", "dereferenced", "at", "the", "given", "set", "of", "locations", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/deref/UnconditionalValueDerefSet.java#L263-L272
59,789
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/deref/UnconditionalValueDerefSet.java
UnconditionalValueDerefSet.clearDerefSet
public void clearDerefSet(ValueNumber value) { if (UnconditionalValueDerefAnalysis.DEBUG) { System.out.println("Clearing dereference of " + value + " for # " + System.identityHashCode(this)); } valueNumbersUnconditionallyDereferenced.clear(value.getNumber()); derefLocationSet...
java
public void clearDerefSet(ValueNumber value) { if (UnconditionalValueDerefAnalysis.DEBUG) { System.out.println("Clearing dereference of " + value + " for # " + System.identityHashCode(this)); } valueNumbersUnconditionallyDereferenced.clear(value.getNumber()); derefLocationSet...
[ "public", "void", "clearDerefSet", "(", "ValueNumber", "value", ")", "{", "if", "(", "UnconditionalValueDerefAnalysis", ".", "DEBUG", ")", "{", "System", ".", "out", ".", "println", "(", "\"Clearing dereference of \"", "+", "value", "+", "\" for # \"", "+", "Sys...
Clear the set of dereferences for given ValueNumber @param value the ValueNumber
[ "Clear", "the", "set", "of", "dereferences", "for", "given", "ValueNumber" ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/deref/UnconditionalValueDerefSet.java#L280-L286
59,790
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/deref/UnconditionalValueDerefSet.java
UnconditionalValueDerefSet.getDerefLocationSet
public Set<Location> getDerefLocationSet(ValueNumber vn) { Set<Location> derefLocationSet = derefLocationSetMap.get(vn); if (derefLocationSet == null) { derefLocationSet = new HashSet<>(); derefLocationSetMap.put(vn, derefLocationSet); } return derefLocationSet; ...
java
public Set<Location> getDerefLocationSet(ValueNumber vn) { Set<Location> derefLocationSet = derefLocationSetMap.get(vn); if (derefLocationSet == null) { derefLocationSet = new HashSet<>(); derefLocationSetMap.put(vn, derefLocationSet); } return derefLocationSet; ...
[ "public", "Set", "<", "Location", ">", "getDerefLocationSet", "(", "ValueNumber", "vn", ")", "{", "Set", "<", "Location", ">", "derefLocationSet", "=", "derefLocationSetMap", ".", "get", "(", "vn", ")", ";", "if", "(", "derefLocationSet", "==", "null", ")", ...
Get the set of dereference Locations for given value number. @param vn the value number @return the set of dereference Locations
[ "Get", "the", "set", "of", "dereference", "Locations", "for", "given", "value", "number", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/deref/UnconditionalValueDerefSet.java#L295-L302
59,791
spotbugs/spotbugs
eclipsePlugin/src/de/tobject/findbugs/actions/LoadXmlAction.java
LoadXmlAction.work
private void work(final IProject project, final String fileName) { FindBugsJob runFindBugs = new FindBugsJob("Loading XML data from " + fileName + "...", project) { @Override protected void runWithProgress(IProgressMonitor monitor) throws CoreException { FindBugsWorker wo...
java
private void work(final IProject project, final String fileName) { FindBugsJob runFindBugs = new FindBugsJob("Loading XML data from " + fileName + "...", project) { @Override protected void runWithProgress(IProgressMonitor monitor) throws CoreException { FindBugsWorker wo...
[ "private", "void", "work", "(", "final", "IProject", "project", ",", "final", "String", "fileName", ")", "{", "FindBugsJob", "runFindBugs", "=", "new", "FindBugsJob", "(", "\"Loading XML data from \"", "+", "fileName", "+", "\"...\"", ",", "project", ")", "{", ...
Run a FindBugs import on the given project, displaying a progress monitor. @param project The resource to load XMl to.
[ "Run", "a", "FindBugs", "import", "on", "the", "given", "project", "displaying", "a", "progress", "monitor", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/actions/LoadXmlAction.java#L115-L125
59,792
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/detect/BuildObligationPolicyDatabase.java
BuildObligationPolicyDatabase.handleWillCloseWhenClosed
private void handleWillCloseWhenClosed(XMethod xmethod, Obligation deletedObligation) { if (deletedObligation == null) { if (DEBUG_ANNOTATIONS) { System.out.println("Method " + xmethod.toString() + " is marked @WillCloseWhenClosed, " + "but its parameter is no...
java
private void handleWillCloseWhenClosed(XMethod xmethod, Obligation deletedObligation) { if (deletedObligation == null) { if (DEBUG_ANNOTATIONS) { System.out.println("Method " + xmethod.toString() + " is marked @WillCloseWhenClosed, " + "but its parameter is no...
[ "private", "void", "handleWillCloseWhenClosed", "(", "XMethod", "xmethod", ",", "Obligation", "deletedObligation", ")", "{", "if", "(", "deletedObligation", "==", "null", ")", "{", "if", "(", "DEBUG_ANNOTATIONS", ")", "{", "System", ".", "out", ".", "println", ...
Handle a method with a WillCloseWhenClosed parameter annotation.
[ "Handle", "a", "method", "with", "a", "WillCloseWhenClosed", "parameter", "annotation", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/detect/BuildObligationPolicyDatabase.java#L381-L424
59,793
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/npe/IsNullValue.java
IsNullValue.toExceptionValue
public IsNullValue toExceptionValue() { if (getBaseKind() == NO_KABOOM_NN) { return new IsNullValue(kind | EXCEPTION, locationOfKaBoom); } return instanceByFlagsList[(getFlags() | EXCEPTION) >> FLAG_SHIFT][getBaseKind()]; }
java
public IsNullValue toExceptionValue() { if (getBaseKind() == NO_KABOOM_NN) { return new IsNullValue(kind | EXCEPTION, locationOfKaBoom); } return instanceByFlagsList[(getFlags() | EXCEPTION) >> FLAG_SHIFT][getBaseKind()]; }
[ "public", "IsNullValue", "toExceptionValue", "(", ")", "{", "if", "(", "getBaseKind", "(", ")", "==", "NO_KABOOM_NN", ")", "{", "return", "new", "IsNullValue", "(", "kind", "|", "EXCEPTION", ",", "locationOfKaBoom", ")", ";", "}", "return", "instanceByFlagsLis...
Convert to an exception path value.
[ "Convert", "to", "an", "exception", "path", "value", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/npe/IsNullValue.java#L250-L255
59,794
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/npe/IsNullValue.java
IsNullValue.merge
public static IsNullValue merge(IsNullValue a, IsNullValue b) { if (a == b) { return a; } if (a.equals(b)) { return a; } int aKind = a.kind & 0xff; int bKind = b.kind & 0xff; int aFlags = a.getFlags(); int bFlags = b.getFlags(); ...
java
public static IsNullValue merge(IsNullValue a, IsNullValue b) { if (a == b) { return a; } if (a.equals(b)) { return a; } int aKind = a.kind & 0xff; int bKind = b.kind & 0xff; int aFlags = a.getFlags(); int bFlags = b.getFlags(); ...
[ "public", "static", "IsNullValue", "merge", "(", "IsNullValue", "a", ",", "IsNullValue", "b", ")", "{", "if", "(", "a", "==", "b", ")", "{", "return", "a", ";", "}", "if", "(", "a", ".", "equals", "(", "b", ")", ")", "{", "return", "a", ";", "}...
Merge two values.
[ "Merge", "two", "values", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/npe/IsNullValue.java#L400-L434
59,795
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/npe/IsNullValue.java
IsNullValue.isNullOnSomePath
public boolean isNullOnSomePath() { int baseKind = getBaseKind(); if (NCP_EXTRA_BRANCH) { // Note: NCP_EXTRA_BRANCH is an experimental feature // to see how many false warnings we get when we allow // two branches between an explicit null and a // a derefe...
java
public boolean isNullOnSomePath() { int baseKind = getBaseKind(); if (NCP_EXTRA_BRANCH) { // Note: NCP_EXTRA_BRANCH is an experimental feature // to see how many false warnings we get when we allow // two branches between an explicit null and a // a derefe...
[ "public", "boolean", "isNullOnSomePath", "(", ")", "{", "int", "baseKind", "=", "getBaseKind", "(", ")", ";", "if", "(", "NCP_EXTRA_BRANCH", ")", "{", "// Note: NCP_EXTRA_BRANCH is an experimental feature", "// to see how many false warnings we get when we allow", "// two bra...
Is this value null on some path?
[ "Is", "this", "value", "null", "on", "some", "path?" ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/npe/IsNullValue.java#L447-L458
59,796
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/ch/Subtypes2.java
Subtypes2.isContainer
static public boolean isContainer(ReferenceType target) throws ClassNotFoundException { Subtypes2 subtypes2 = AnalysisContext.currentAnalysisContext().getSubtypes2(); return subtypes2.isSubtype(target, COLLECTION_TYPE) || subtypes2.isSubtype(target, MAP_TYPE); }
java
static public boolean isContainer(ReferenceType target) throws ClassNotFoundException { Subtypes2 subtypes2 = AnalysisContext.currentAnalysisContext().getSubtypes2(); return subtypes2.isSubtype(target, COLLECTION_TYPE) || subtypes2.isSubtype(target, MAP_TYPE); }
[ "static", "public", "boolean", "isContainer", "(", "ReferenceType", "target", ")", "throws", "ClassNotFoundException", "{", "Subtypes2", "subtypes2", "=", "AnalysisContext", ".", "currentAnalysisContext", "(", ")", ".", "getSubtypes2", "(", ")", ";", "return", "subt...
A collection, a map, or some other container
[ "A", "collection", "a", "map", "or", "some", "other", "container" ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/ch/Subtypes2.java#L143-L147
59,797
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/ch/Subtypes2.java
Subtypes2.addApplicationClass
public void addApplicationClass(XClass appXClass) { for (XMethod m : appXClass.getXMethods()) { if (m.isStub()) { return; } } ClassVertex vertex = addClassAndGetClassVertex(appXClass); vertex.markAsApplicationClass(); }
java
public void addApplicationClass(XClass appXClass) { for (XMethod m : appXClass.getXMethods()) { if (m.isStub()) { return; } } ClassVertex vertex = addClassAndGetClassVertex(appXClass); vertex.markAsApplicationClass(); }
[ "public", "void", "addApplicationClass", "(", "XClass", "appXClass", ")", "{", "for", "(", "XMethod", "m", ":", "appXClass", ".", "getXMethods", "(", ")", ")", "{", "if", "(", "m", ".", "isStub", "(", ")", ")", "{", "return", ";", "}", "}", "ClassVer...
Add an application class, and its transitive supertypes, to the inheritance graph. @param appXClass application XClass to add to the inheritance graph
[ "Add", "an", "application", "class", "and", "its", "transitive", "supertypes", "to", "the", "inheritance", "graph", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/ch/Subtypes2.java#L224-L233
59,798
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/ch/Subtypes2.java
Subtypes2.addClassAndGetClassVertex
private ClassVertex addClassAndGetClassVertex(XClass xclass) { if (xclass == null) { throw new IllegalStateException(); } LinkedList<XClass> workList = new LinkedList<>(); workList.add(xclass); while (!workList.isEmpty()) { XClass work = workList.removeF...
java
private ClassVertex addClassAndGetClassVertex(XClass xclass) { if (xclass == null) { throw new IllegalStateException(); } LinkedList<XClass> workList = new LinkedList<>(); workList.add(xclass); while (!workList.isEmpty()) { XClass work = workList.removeF...
[ "private", "ClassVertex", "addClassAndGetClassVertex", "(", "XClass", "xclass", ")", "{", "if", "(", "xclass", "==", "null", ")", "{", "throw", "new", "IllegalStateException", "(", ")", ";", "}", "LinkedList", "<", "XClass", ">", "workList", "=", "new", "Lin...
Add an XClass and all of its supertypes to the InheritanceGraph. @param xclass an XClass @return the ClassVertex representing the class in the InheritanceGraph
[ "Add", "an", "XClass", "and", "all", "of", "its", "supertypes", "to", "the", "InheritanceGraph", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/ch/Subtypes2.java#L263-L290
59,799
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/ch/Subtypes2.java
Subtypes2.isSubtype
public boolean isSubtype(ReferenceType type, ReferenceType possibleSupertype) throws ClassNotFoundException { // Eliminate some easy cases if (type.equals(possibleSupertype)) { return true; } if (possibleSupertype.equals(Type.OBJECT)) { return true; } ...
java
public boolean isSubtype(ReferenceType type, ReferenceType possibleSupertype) throws ClassNotFoundException { // Eliminate some easy cases if (type.equals(possibleSupertype)) { return true; } if (possibleSupertype.equals(Type.OBJECT)) { return true; } ...
[ "public", "boolean", "isSubtype", "(", "ReferenceType", "type", ",", "ReferenceType", "possibleSupertype", ")", "throws", "ClassNotFoundException", "{", "// Eliminate some easy cases", "if", "(", "type", ".", "equals", "(", "possibleSupertype", ")", ")", "{", "return"...
Determine whether or not a given ReferenceType is a subtype of another. Throws ClassNotFoundException if the question cannot be answered definitively due to a missing class. @param type a ReferenceType @param possibleSupertype another Reference type @return true if <code>type</code> is a subtype of <code>possibleSuper...
[ "Determine", "whether", "or", "not", "a", "given", "ReferenceType", "is", "a", "subtype", "of", "another", ".", "Throws", "ClassNotFoundException", "if", "the", "question", "cannot", "be", "answered", "definitively", "due", "to", "a", "missing", "class", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/ch/Subtypes2.java#L327-L400