repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
partition
stringclasses
1 value
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/InnerClassAccessMap.java
InnerClassAccessMap.getInnerClassAccess
public InnerClassAccess getInnerClassAccess(INVOKESTATIC inv, ConstantPoolGen cpg) throws ClassNotFoundException { String methodName = inv.getMethodName(cpg); if (methodName.startsWith("access$")) { String className = inv.getClassName(cpg); return getInnerClassAccess(className, ...
java
public InnerClassAccess getInnerClassAccess(INVOKESTATIC inv, ConstantPoolGen cpg) throws ClassNotFoundException { String methodName = inv.getMethodName(cpg); if (methodName.startsWith("access$")) { String className = inv.getClassName(cpg); return getInnerClassAccess(className, ...
[ "public", "InnerClassAccess", "getInnerClassAccess", "(", "INVOKESTATIC", "inv", ",", "ConstantPoolGen", "cpg", ")", "throws", "ClassNotFoundException", "{", "String", "methodName", "=", "inv", ".", "getMethodName", "(", "cpg", ")", ";", "if", "(", "methodName", "...
Get the inner class access object for given invokestatic instruction. Returns null if the called method is not an inner class access. @param inv the invokestatic instruction @param cpg the ConstantPoolGen for the method @return the InnerClassAccess, or null if the call is not an inner class access
[ "Get", "the", "inner", "class", "access", "object", "for", "given", "invokestatic", "instruction", ".", "Returns", "null", "if", "the", "called", "method", "is", "not", "an", "inner", "class", "access", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/InnerClassAccessMap.java#L109-L117
train
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/InnerClassAccessMap.java
InnerClassAccessMap.getAccessMapForClass
private Map<String, InnerClassAccess> getAccessMapForClass(String className) throws ClassNotFoundException { Map<String, InnerClassAccess> map = classToAccessMap.get(className); if (map == null) { map = new HashMap<>(3); if (!className.startsWith("[")) { JavaCla...
java
private Map<String, InnerClassAccess> getAccessMapForClass(String className) throws ClassNotFoundException { Map<String, InnerClassAccess> map = classToAccessMap.get(className); if (map == null) { map = new HashMap<>(3); if (!className.startsWith("[")) { JavaCla...
[ "private", "Map", "<", "String", ",", "InnerClassAccess", ">", "getAccessMapForClass", "(", "String", "className", ")", "throws", "ClassNotFoundException", "{", "Map", "<", "String", ",", "InnerClassAccess", ">", "map", "=", "classToAccessMap", ".", "get", "(", ...
Return a map of inner-class member access method names to the fields that they access for given class name. @param className the name of the class @return map of access method names to the fields they access
[ "Return", "a", "map", "of", "inner", "-", "class", "member", "access", "method", "names", "to", "the", "fields", "that", "they", "access", "for", "given", "class", "name", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/InnerClassAccessMap.java#L341-L395
train
spotbugs/spotbugs
spotbugs/src/gui/main/edu/umd/cs/findbugs/gui/AnnotatedString.java
AnnotatedString.getMnemonic
public int getMnemonic() { int mnemonic = KeyEvent.VK_UNDEFINED; if (!MAC_OS_X) { int index = getMnemonicIndex(); if ((index >= 0) && ((index + 1) < myAnnotatedString.length())) { mnemonic = Character.toUpperCase(myAnnotatedString.charAt(index + 1)); }...
java
public int getMnemonic() { int mnemonic = KeyEvent.VK_UNDEFINED; if (!MAC_OS_X) { int index = getMnemonicIndex(); if ((index >= 0) && ((index + 1) < myAnnotatedString.length())) { mnemonic = Character.toUpperCase(myAnnotatedString.charAt(index + 1)); }...
[ "public", "int", "getMnemonic", "(", ")", "{", "int", "mnemonic", "=", "KeyEvent", ".", "VK_UNDEFINED", ";", "if", "(", "!", "MAC_OS_X", ")", "{", "int", "index", "=", "getMnemonicIndex", "(", ")", ";", "if", "(", "(", "index", ">=", "0", ")", "&&", ...
Return the appropriate mnemonic character for this string. If no mnemonic should be displayed, KeyEvent.VK_UNDEFINED is returned. @return the Mnemonic character, or VK_UNDEFINED if no mnemonic should be set
[ "Return", "the", "appropriate", "mnemonic", "character", "for", "this", "string", ".", "If", "no", "mnemonic", "should", "be", "displayed", "KeyEvent", ".", "VK_UNDEFINED", "is", "returned", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/gui/main/edu/umd/cs/findbugs/gui/AnnotatedString.java#L88-L97
train
spotbugs/spotbugs
spotbugs/src/gui/main/edu/umd/cs/findbugs/gui/AnnotatedString.java
AnnotatedString.localiseButton
public static void localiseButton(AbstractButton button, String key, String defaultString, boolean setMnemonic) { AnnotatedString as = new AnnotatedString(L10N.getLocalString(key, defaultString)); button.setText(as.toString()); int mnemonic; if (setMnemonic && (mnemonic = as.getMnemonic(...
java
public static void localiseButton(AbstractButton button, String key, String defaultString, boolean setMnemonic) { AnnotatedString as = new AnnotatedString(L10N.getLocalString(key, defaultString)); button.setText(as.toString()); int mnemonic; if (setMnemonic && (mnemonic = as.getMnemonic(...
[ "public", "static", "void", "localiseButton", "(", "AbstractButton", "button", ",", "String", "key", ",", "String", "defaultString", ",", "boolean", "setMnemonic", ")", "{", "AnnotatedString", "as", "=", "new", "AnnotatedString", "(", "L10N", ".", "getLocalString"...
Localise the given AbstractButton, setting the text and optionally mnemonic Note that AbstractButton includes menus and menu items. @param button The button to localise @param key The key to look up in resource bundle @param defaultString default String to use if key not found @param setMnemonic whether or not to set ...
[ "Localise", "the", "given", "AbstractButton", "setting", "the", "text", "and", "optionally", "mnemonic", "Note", "that", "AbstractButton", "includes", "menus", "and", "menu", "items", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/gui/main/edu/umd/cs/findbugs/gui/AnnotatedString.java#L168-L176
train
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/MethodHash.java
MethodHash.computeHash
public MethodHash computeHash(Method method) { final MessageDigest digest = Util.getMD5Digest(); byte[] code; if (method.getCode() == null || method.getCode().getCode() == null) { code = new byte[0]; } else { code = method.getCode().getCode(); } ...
java
public MethodHash computeHash(Method method) { final MessageDigest digest = Util.getMD5Digest(); byte[] code; if (method.getCode() == null || method.getCode().getCode() == null) { code = new byte[0]; } else { code = method.getCode().getCode(); } ...
[ "public", "MethodHash", "computeHash", "(", "Method", "method", ")", "{", "final", "MessageDigest", "digest", "=", "Util", ".", "getMD5Digest", "(", ")", ";", "byte", "[", "]", "code", ";", "if", "(", "method", ".", "getCode", "(", ")", "==", "null", "...
Compute hash on given method. @param method the method @return this object
[ "Compute", "hash", "on", "given", "method", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/MethodHash.java#L109-L127
train
spotbugs/spotbugs
eclipsePlugin/src/de/tobject/findbugs/view/explorer/BugPrioritySorter.java
BugPrioritySorter.compareGroups
static int compareGroups(BugGroup m1, BugGroup m2) { int result = m1.compareTo(m2); if (result == 0) { return m1.getShortDescription().compareToIgnoreCase(m2.getShortDescription()); } return result; }
java
static int compareGroups(BugGroup m1, BugGroup m2) { int result = m1.compareTo(m2); if (result == 0) { return m1.getShortDescription().compareToIgnoreCase(m2.getShortDescription()); } return result; }
[ "static", "int", "compareGroups", "(", "BugGroup", "m1", ",", "BugGroup", "m2", ")", "{", "int", "result", "=", "m1", ".", "compareTo", "(", "m2", ")", ";", "if", "(", "result", "==", "0", ")", "{", "return", "m1", ".", "getShortDescription", "(", ")...
Sorts bug groups on severity first, then on bug pattern name.
[ "Sorts", "bug", "groups", "on", "severity", "first", "then", "on", "bug", "pattern", "name", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/view/explorer/BugPrioritySorter.java#L74-L80
train
spotbugs/spotbugs
eclipsePlugin/src/de/tobject/findbugs/view/explorer/BugPrioritySorter.java
BugPrioritySorter.compareMarkers
static int compareMarkers(IMarker m1, IMarker m2) { if (m1 == null || m2 == null || !m1.exists() || !m2.exists()) { return 0; } int rank1 = MarkerUtil.findBugRankForMarker(m1); int rank2 = MarkerUtil.findBugRankForMarker(m2); int result = rank1 - rank2; if (re...
java
static int compareMarkers(IMarker m1, IMarker m2) { if (m1 == null || m2 == null || !m1.exists() || !m2.exists()) { return 0; } int rank1 = MarkerUtil.findBugRankForMarker(m1); int rank2 = MarkerUtil.findBugRankForMarker(m2); int result = rank1 - rank2; if (re...
[ "static", "int", "compareMarkers", "(", "IMarker", "m1", ",", "IMarker", "m2", ")", "{", "if", "(", "m1", "==", "null", "||", "m2", "==", "null", "||", "!", "m1", ".", "exists", "(", ")", "||", "!", "m2", ".", "exists", "(", ")", ")", "{", "ret...
Sorts markers on rank, then priority, and then on name if requested @param m1 @param m2 @return
[ "Sorts", "markers", "on", "rank", "then", "priority", "and", "then", "on", "name", "if", "requested" ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/view/explorer/BugPrioritySorter.java#L89-L108
train
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/interproc/ParameterProperty.java
ParameterProperty.setParamsWithProperty
public void setParamsWithProperty(BitSet nonNullSet) { for (int i = 0; i < 32; ++i) { setParamWithProperty(i, nonNullSet.get(i)); } }
java
public void setParamsWithProperty(BitSet nonNullSet) { for (int i = 0; i < 32; ++i) { setParamWithProperty(i, nonNullSet.get(i)); } }
[ "public", "void", "setParamsWithProperty", "(", "BitSet", "nonNullSet", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "32", ";", "++", "i", ")", "{", "setParamWithProperty", "(", "i", ",", "nonNullSet", ".", "get", "(", "i", ")", ")", ...
Set the non-null param set from given BitSet. @param nonNullSet BitSet indicating which parameters are non-null
[ "Set", "the", "non", "-", "null", "param", "set", "from", "given", "BitSet", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/interproc/ParameterProperty.java#L115-L119
train
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/interproc/ParameterProperty.java
ParameterProperty.setParamWithProperty
public void setParamWithProperty(int param, boolean hasProperty) { if (param < 0 || param > 31) { return; } if (hasProperty) { bits |= (1 << param); } else { bits &= ~(1 << param); } }
java
public void setParamWithProperty(int param, boolean hasProperty) { if (param < 0 || param > 31) { return; } if (hasProperty) { bits |= (1 << param); } else { bits &= ~(1 << param); } }
[ "public", "void", "setParamWithProperty", "(", "int", "param", ",", "boolean", "hasProperty", ")", "{", "if", "(", "param", "<", "0", "||", "param", ">", "31", ")", "{", "return", ";", "}", "if", "(", "hasProperty", ")", "{", "bits", "|=", "(", "1", ...
Set whether or not a parameter might be non-null. @param param the parameter index @param hasProperty true if the parameter might be non-null, false otherwise
[ "Set", "whether", "or", "not", "a", "parameter", "might", "be", "non", "-", "null", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/interproc/ParameterProperty.java#L129-L138
train
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/interproc/ParameterProperty.java
ParameterProperty.getMatchingParameters
public BitSet getMatchingParameters(BitSet nullArgSet) { BitSet result = new BitSet(); for (int i = 0; i < 32; ++i) { result.set(i, nullArgSet.get(i) && hasProperty(i)); } return result; }
java
public BitSet getMatchingParameters(BitSet nullArgSet) { BitSet result = new BitSet(); for (int i = 0; i < 32; ++i) { result.set(i, nullArgSet.get(i) && hasProperty(i)); } return result; }
[ "public", "BitSet", "getMatchingParameters", "(", "BitSet", "nullArgSet", ")", "{", "BitSet", "result", "=", "new", "BitSet", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "32", ";", "++", "i", ")", "{", "result", ".", "set", "(",...
Given a bitset of null arguments passed to the method represented by this property, return a bitset indicating which null arguments correspond to an non-null param. @param nullArgSet bitset of null arguments @return bitset intersecting null arguments and non-null params
[ "Given", "a", "bitset", "of", "null", "arguments", "passed", "to", "the", "method", "represented", "by", "this", "property", "return", "a", "bitset", "indicating", "which", "null", "arguments", "correspond", "to", "an", "non", "-", "null", "param", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/interproc/ParameterProperty.java#L164-L170
train
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/SignatureParser.java
SignatureParser.getNumParametersForInvocation
public static int getNumParametersForInvocation(InvokeInstruction inv, ConstantPoolGen cpg) { SignatureParser sigParser = new SignatureParser(inv.getSignature(cpg)); return sigParser.getNumParameters(); }
java
public static int getNumParametersForInvocation(InvokeInstruction inv, ConstantPoolGen cpg) { SignatureParser sigParser = new SignatureParser(inv.getSignature(cpg)); return sigParser.getNumParameters(); }
[ "public", "static", "int", "getNumParametersForInvocation", "(", "InvokeInstruction", "inv", ",", "ConstantPoolGen", "cpg", ")", "{", "SignatureParser", "sigParser", "=", "new", "SignatureParser", "(", "inv", ".", "getSignature", "(", "cpg", ")", ")", ";", "return...
Get the number of parameters passed to method invocation. @param inv @param cpg @return int number of parameters
[ "Get", "the", "number", "of", "parameters", "passed", "to", "method", "invocation", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/SignatureParser.java#L249-L252
train
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/LineNumberMap.java
LineNumberMap.build
public void build() { int numGood = 0, numBytecodes = 0; if (DEBUG) { System.out.println("Method: " + methodGen.getName() + " - " + methodGen.getSignature() + "in class " + methodGen.getClassName()); } // Associate line number information with each Instr...
java
public void build() { int numGood = 0, numBytecodes = 0; if (DEBUG) { System.out.println("Method: " + methodGen.getName() + " - " + methodGen.getSignature() + "in class " + methodGen.getClassName()); } // Associate line number information with each Instr...
[ "public", "void", "build", "(", ")", "{", "int", "numGood", "=", "0", ",", "numBytecodes", "=", "0", ";", "if", "(", "DEBUG", ")", "{", "System", ".", "out", ".", "println", "(", "\"Method: \"", "+", "methodGen", ".", "getName", "(", ")", "+", "\" ...
Build the line number information. Should be called before any other methods.
[ "Build", "the", "line", "number", "information", ".", "Should", "be", "called", "before", "any", "other", "methods", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/LineNumberMap.java#L68-L113
train
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/jsr305/TypeQualifierDatabase.java
TypeQualifierDatabase.setReturnValue
public void setReturnValue(MethodDescriptor methodDesc, TypeQualifierValue<?> tqv, TypeQualifierAnnotation tqa) { Map<TypeQualifierValue<?>, TypeQualifierAnnotation> map = returnValueMap.get(methodDesc); if (map == null) { map = new HashMap<>(); returnValueMap.put(methodDesc, map...
java
public void setReturnValue(MethodDescriptor methodDesc, TypeQualifierValue<?> tqv, TypeQualifierAnnotation tqa) { Map<TypeQualifierValue<?>, TypeQualifierAnnotation> map = returnValueMap.get(methodDesc); if (map == null) { map = new HashMap<>(); returnValueMap.put(methodDesc, map...
[ "public", "void", "setReturnValue", "(", "MethodDescriptor", "methodDesc", ",", "TypeQualifierValue", "<", "?", ">", "tqv", ",", "TypeQualifierAnnotation", "tqa", ")", "{", "Map", "<", "TypeQualifierValue", "<", "?", ">", ",", "TypeQualifierAnnotation", ">", "map"...
Set a TypeQualifierAnnotation on a method return value. @param methodDesc the method @param tqv the type qualifier @param tqa the type qualifier annotation
[ "Set", "a", "TypeQualifierAnnotation", "on", "a", "method", "return", "value", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/jsr305/TypeQualifierDatabase.java#L65-L76
train
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/jsr305/TypeQualifierDatabase.java
TypeQualifierDatabase.getReturnValue
public TypeQualifierAnnotation getReturnValue(MethodDescriptor methodDesc, TypeQualifierValue<?> tqv) { // // TODO: handling of overridden methods? // Map<TypeQualifierValue<?>, TypeQualifierAnnotation> map = returnValueMap.get(methodDesc); if (map == null) { return n...
java
public TypeQualifierAnnotation getReturnValue(MethodDescriptor methodDesc, TypeQualifierValue<?> tqv) { // // TODO: handling of overridden methods? // Map<TypeQualifierValue<?>, TypeQualifierAnnotation> map = returnValueMap.get(methodDesc); if (map == null) { return n...
[ "public", "TypeQualifierAnnotation", "getReturnValue", "(", "MethodDescriptor", "methodDesc", ",", "TypeQualifierValue", "<", "?", ">", "tqv", ")", "{", "//", "// TODO: handling of overridden methods?", "//", "Map", "<", "TypeQualifierValue", "<", "?", ">", ",", "Type...
Get the TypeQualifierAnnotation on a method return value. @param methodDesc the method @param tqv the type qualifier @return the type qualifier annotation on the method return value, or null if no (interesting) type qualifier annotation was computed for this method
[ "Get", "the", "TypeQualifierAnnotation", "on", "a", "method", "return", "value", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/jsr305/TypeQualifierDatabase.java#L89-L98
train
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/jsr305/TypeQualifierDatabase.java
TypeQualifierDatabase.setParameter
public void setParameter(MethodDescriptor methodDesc, int param, TypeQualifierValue<?> tqv, TypeQualifierAnnotation tqa) { Map<TypeQualifierValue<?>, TypeQualifierAnnotation> map = parameterMap.get(methodDesc, param); if (map == null) { map = new HashMap<>(); parameterMap.put(met...
java
public void setParameter(MethodDescriptor methodDesc, int param, TypeQualifierValue<?> tqv, TypeQualifierAnnotation tqa) { Map<TypeQualifierValue<?>, TypeQualifierAnnotation> map = parameterMap.get(methodDesc, param); if (map == null) { map = new HashMap<>(); parameterMap.put(met...
[ "public", "void", "setParameter", "(", "MethodDescriptor", "methodDesc", ",", "int", "param", ",", "TypeQualifierValue", "<", "?", ">", "tqv", ",", "TypeQualifierAnnotation", "tqa", ")", "{", "Map", "<", "TypeQualifierValue", "<", "?", ">", ",", "TypeQualifierAn...
Set a TypeQualifierAnnotation on a method parameter. @param methodDesc the method @param param the parameter (0 == first parameter) @param tqv the type qualifier @param tqa the type qualifier annotation
[ "Set", "a", "TypeQualifierAnnotation", "on", "a", "method", "parameter", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/jsr305/TypeQualifierDatabase.java#L112-L123
train
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/jsr305/TypeQualifierDatabase.java
TypeQualifierDatabase.getParameter
public TypeQualifierAnnotation getParameter(MethodDescriptor methodDesc, int param, TypeQualifierValue<?> tqv) { // // TODO: handling of overridden methods? // Map<TypeQualifierValue<?>, TypeQualifierAnnotation> map = parameterMap.get(methodDesc, param); if (map == null) { ...
java
public TypeQualifierAnnotation getParameter(MethodDescriptor methodDesc, int param, TypeQualifierValue<?> tqv) { // // TODO: handling of overridden methods? // Map<TypeQualifierValue<?>, TypeQualifierAnnotation> map = parameterMap.get(methodDesc, param); if (map == null) { ...
[ "public", "TypeQualifierAnnotation", "getParameter", "(", "MethodDescriptor", "methodDesc", ",", "int", "param", ",", "TypeQualifierValue", "<", "?", ">", "tqv", ")", "{", "//", "// TODO: handling of overridden methods?", "//", "Map", "<", "TypeQualifierValue", "<", "...
Get the TypeQualifierAnnotation on a parameter. @param methodDesc the method @param param the parameter (0 == first parameter) @param tqv the type qualifier @return the type qualifier annotation on the method return value, or null if no (interesting) type qualifier annotation was computed for this method
[ "Get", "the", "TypeQualifierAnnotation", "on", "a", "parameter", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/jsr305/TypeQualifierDatabase.java#L138-L147
train
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/bcp/FieldAccess.java
FieldAccess.isLongOrDouble
protected static boolean isLongOrDouble(FieldInstruction fieldIns, ConstantPoolGen cpg) { Type type = fieldIns.getFieldType(cpg); int code = type.getType(); return code == Const.T_LONG || code == Const.T_DOUBLE; }
java
protected static boolean isLongOrDouble(FieldInstruction fieldIns, ConstantPoolGen cpg) { Type type = fieldIns.getFieldType(cpg); int code = type.getType(); return code == Const.T_LONG || code == Const.T_DOUBLE; }
[ "protected", "static", "boolean", "isLongOrDouble", "(", "FieldInstruction", "fieldIns", ",", "ConstantPoolGen", "cpg", ")", "{", "Type", "type", "=", "fieldIns", ".", "getFieldType", "(", "cpg", ")", ";", "int", "code", "=", "type", ".", "getType", "(", ")"...
Return whether the given FieldInstruction accesses a long or double field. @param fieldIns the FieldInstruction @param cpg the ConstantPoolGen for the method
[ "Return", "whether", "the", "given", "FieldInstruction", "accesses", "a", "long", "or", "double", "field", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/bcp/FieldAccess.java#L94-L98
train
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/bcp/FieldAccess.java
FieldAccess.snarfFieldValue
protected static Variable snarfFieldValue(FieldInstruction fieldIns, ConstantPoolGen cpg, ValueNumberFrame frame) throws DataflowAnalysisException { if (isLongOrDouble(fieldIns, cpg)) { int numSlots = frame.getNumSlots(); ValueNumber topValue = frame.getValue(numSlots - 1); ...
java
protected static Variable snarfFieldValue(FieldInstruction fieldIns, ConstantPoolGen cpg, ValueNumberFrame frame) throws DataflowAnalysisException { if (isLongOrDouble(fieldIns, cpg)) { int numSlots = frame.getNumSlots(); ValueNumber topValue = frame.getValue(numSlots - 1); ...
[ "protected", "static", "Variable", "snarfFieldValue", "(", "FieldInstruction", "fieldIns", ",", "ConstantPoolGen", "cpg", ",", "ValueNumberFrame", "frame", ")", "throws", "DataflowAnalysisException", "{", "if", "(", "isLongOrDouble", "(", "fieldIns", ",", "cpg", ")", ...
Get a Variable representing the stack value which will either be stored into or loaded from a field. @param fieldIns the FieldInstruction accessing the field @param cpg the ConstantPoolGen for the method @param frame the ValueNumberFrame containing the value to be stored or the value loaded
[ "Get", "a", "Variable", "representing", "the", "stack", "value", "which", "will", "either", "be", "stored", "into", "or", "loaded", "from", "a", "field", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/bcp/FieldAccess.java#L112-L124
train
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/jsr305/Analysis.java
Analysis.getRelevantTypeQualifiers
public static Collection<TypeQualifierValue<?>> getRelevantTypeQualifiers(MethodDescriptor methodDescriptor, CFG cfg) throws CheckedAnalysisException { final HashSet<TypeQualifierValue<?>> result = new HashSet<>(); XMethod xmethod = XFactory.createXMethod(methodDescriptor); if (FI...
java
public static Collection<TypeQualifierValue<?>> getRelevantTypeQualifiers(MethodDescriptor methodDescriptor, CFG cfg) throws CheckedAnalysisException { final HashSet<TypeQualifierValue<?>> result = new HashSet<>(); XMethod xmethod = XFactory.createXMethod(methodDescriptor); if (FI...
[ "public", "static", "Collection", "<", "TypeQualifierValue", "<", "?", ">", ">", "getRelevantTypeQualifiers", "(", "MethodDescriptor", "methodDescriptor", ",", "CFG", "cfg", ")", "throws", "CheckedAnalysisException", "{", "final", "HashSet", "<", "TypeQualifierValue", ...
Find relevant type qualifiers needing to be checked for a given method. @param methodDescriptor a method @return Collection of relevant type qualifiers needing to be checked @throws CheckedAnalysisException
[ "Find", "relevant", "type", "qualifiers", "needing", "to", "be", "checked", "for", "a", "given", "method", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/jsr305/Analysis.java#L77-L161
train
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/classfile/DescriptorFactory.java
DescriptorFactory.createClassDescriptorFromResourceName
public static ClassDescriptor createClassDescriptorFromResourceName(String resourceName) { if (!isClassResource(resourceName)) { throw new IllegalArgumentException("Resource " + resourceName + " is not a class"); } return createClassDescriptor(resourceName.substring(0, resourceName.l...
java
public static ClassDescriptor createClassDescriptorFromResourceName(String resourceName) { if (!isClassResource(resourceName)) { throw new IllegalArgumentException("Resource " + resourceName + " is not a class"); } return createClassDescriptor(resourceName.substring(0, resourceName.l...
[ "public", "static", "ClassDescriptor", "createClassDescriptorFromResourceName", "(", "String", "resourceName", ")", "{", "if", "(", "!", "isClassResource", "(", "resourceName", ")", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Resource \"", "+", "reso...
Create a class descriptor from a resource name. @param resourceName the resource name @return the class descriptor
[ "Create", "a", "class", "descriptor", "from", "a", "resource", "name", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/classfile/DescriptorFactory.java#L281-L286
train
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/classfile/DescriptorFactory.java
DescriptorFactory.createClassDescriptorFromFieldSignature
public static @CheckForNull ClassDescriptor createClassDescriptorFromFieldSignature(String signature) { int start = signature.indexOf('L'); if (start < 0) { return null; } int end = signature.indexOf(';', start); if (end < 0) { return null; } ...
java
public static @CheckForNull ClassDescriptor createClassDescriptorFromFieldSignature(String signature) { int start = signature.indexOf('L'); if (start < 0) { return null; } int end = signature.indexOf(';', start); if (end < 0) { return null; } ...
[ "public", "static", "@", "CheckForNull", "ClassDescriptor", "createClassDescriptorFromFieldSignature", "(", "String", "signature", ")", "{", "int", "start", "=", "signature", ".", "indexOf", "(", "'", "'", ")", ";", "if", "(", "start", "<", "0", ")", "{", "r...
Create a class descriptor from a field signature
[ "Create", "a", "class", "descriptor", "from", "a", "field", "signature" ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/classfile/DescriptorFactory.java#L292-L303
train
spotbugs/spotbugs
spotbugs-ant/src/main/java/edu/umd/cs/findbugs/anttask/FindBugsViewerTask.java
FindBugsViewerTask.setPluginList
public void setPluginList(Path src) { if (pluginList == null) { pluginList = src; } else { pluginList.append(src); } }
java
public void setPluginList(Path src) { if (pluginList == null) { pluginList = src; } else { pluginList.append(src); } }
[ "public", "void", "setPluginList", "(", "Path", "src", ")", "{", "if", "(", "pluginList", "==", "null", ")", "{", "pluginList", "=", "src", ";", "}", "else", "{", "pluginList", ".", "append", "(", "src", ")", ";", "}", "}" ]
the plugin list to use. @param src plugin list to use
[ "the", "plugin", "list", "to", "use", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs-ant/src/main/java/edu/umd/cs/findbugs/anttask/FindBugsViewerTask.java#L182-L188
train
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ClassScreener.java
ClassScreener.addAllowedClass
public void addAllowedClass(String className) { String classRegex = START + dotsToRegex(className) + ".class$"; LOG.debug("Class regex: {}", classRegex); patternList.add(Pattern.compile(classRegex).matcher("")); }
java
public void addAllowedClass(String className) { String classRegex = START + dotsToRegex(className) + ".class$"; LOG.debug("Class regex: {}", classRegex); patternList.add(Pattern.compile(classRegex).matcher("")); }
[ "public", "void", "addAllowedClass", "(", "String", "className", ")", "{", "String", "classRegex", "=", "START", "+", "dotsToRegex", "(", "className", ")", "+", "\".class$\"", ";", "LOG", ".", "debug", "(", "\"Class regex: {}\"", ",", "classRegex", ")", ";", ...
Add the name of a class to be matched by the screener. @param className name of a class to be matched
[ "Add", "the", "name", "of", "a", "class", "to", "be", "matched", "by", "the", "screener", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ClassScreener.java#L106-L110
train
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ClassScreener.java
ClassScreener.addAllowedPackage
public void addAllowedPackage(String packageName) { if (packageName.endsWith(".")) { packageName = packageName.substring(0, packageName.length() - 1); } String packageRegex = START + dotsToRegex(packageName) + SEP + JAVA_IDENTIFIER_PART + "+.class$"; LOG.debug("Package regex...
java
public void addAllowedPackage(String packageName) { if (packageName.endsWith(".")) { packageName = packageName.substring(0, packageName.length() - 1); } String packageRegex = START + dotsToRegex(packageName) + SEP + JAVA_IDENTIFIER_PART + "+.class$"; LOG.debug("Package regex...
[ "public", "void", "addAllowedPackage", "(", "String", "packageName", ")", "{", "if", "(", "packageName", ".", "endsWith", "(", "\".\"", ")", ")", "{", "packageName", "=", "packageName", ".", "substring", "(", "0", ",", "packageName", ".", "length", "(", ")...
Add the name of a package to be matched by the screener. All class files that appear to be in the package should be matched. @param packageName name of the package to be matched
[ "Add", "the", "name", "of", "a", "package", "to", "be", "matched", "by", "the", "screener", ".", "All", "class", "files", "that", "appear", "to", "be", "in", "the", "package", "should", "be", "matched", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ClassScreener.java#L119-L127
train
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ClassScreener.java
ClassScreener.addAllowedPrefix
public void addAllowedPrefix(String prefix) { if (prefix.endsWith(".")) { prefix = prefix.substring(0, prefix.length() - 1); } LOG.debug("Allowed prefix: {}", prefix); String packageRegex = START + dotsToRegex(prefix) + SEP; LOG.debug("Prefix regex: {}", packageRegex)...
java
public void addAllowedPrefix(String prefix) { if (prefix.endsWith(".")) { prefix = prefix.substring(0, prefix.length() - 1); } LOG.debug("Allowed prefix: {}", prefix); String packageRegex = START + dotsToRegex(prefix) + SEP; LOG.debug("Prefix regex: {}", packageRegex)...
[ "public", "void", "addAllowedPrefix", "(", "String", "prefix", ")", "{", "if", "(", "prefix", ".", "endsWith", "(", "\".\"", ")", ")", "{", "prefix", "=", "prefix", ".", "substring", "(", "0", ",", "prefix", ".", "length", "(", ")", "-", "1", ")", ...
Add the name of a prefix to be matched by the screener. All class files that appear to be in the package specified by the prefix, or a more deeply nested package, should be matched. @param prefix name of the prefix to be matched
[ "Add", "the", "name", "of", "a", "prefix", "to", "be", "matched", "by", "the", "screener", ".", "All", "class", "files", "that", "appear", "to", "be", "in", "the", "package", "specified", "by", "the", "prefix", "or", "a", "more", "deeply", "nested", "p...
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ClassScreener.java#L137-L145
train
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/I18N.java
I18N.getMessage
@Deprecated public @Nonnull String getMessage(String key) { BugPattern bugPattern = DetectorFactoryCollection.instance().lookupBugPattern(key); if (bugPattern == null) { return L10N.getLocalString("err.missing_pattern", "Error: missing bug pattern for key") + " " + key; } ...
java
@Deprecated public @Nonnull String getMessage(String key) { BugPattern bugPattern = DetectorFactoryCollection.instance().lookupBugPattern(key); if (bugPattern == null) { return L10N.getLocalString("err.missing_pattern", "Error: missing bug pattern for key") + " " + key; } ...
[ "@", "Deprecated", "public", "@", "Nonnull", "String", "getMessage", "(", "String", "key", ")", "{", "BugPattern", "bugPattern", "=", "DetectorFactoryCollection", ".", "instance", "(", ")", ".", "lookupBugPattern", "(", "key", ")", ";", "if", "(", "bugPattern"...
Get a message string. This is a format pattern for describing an entire bug instance in a single line. @param key which message to retrieve
[ "Get", "a", "message", "string", ".", "This", "is", "a", "format", "pattern", "for", "describing", "an", "entire", "bug", "instance", "in", "a", "single", "line", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/I18N.java#L71-L79
train
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/I18N.java
I18N.getDetailHTML
public @Nonnull String getDetailHTML(String key) { BugPattern bugPattern = DetectorFactoryCollection.instance().lookupBugPattern(key); if (bugPattern == null) { return L10N.getLocalString("err.missing_pattern", "Error: missing bug pattern for key") + " " + key; } return b...
java
public @Nonnull String getDetailHTML(String key) { BugPattern bugPattern = DetectorFactoryCollection.instance().lookupBugPattern(key); if (bugPattern == null) { return L10N.getLocalString("err.missing_pattern", "Error: missing bug pattern for key") + " " + key; } return b...
[ "public", "@", "Nonnull", "String", "getDetailHTML", "(", "String", "key", ")", "{", "BugPattern", "bugPattern", "=", "DetectorFactoryCollection", ".", "instance", "(", ")", ".", "lookupBugPattern", "(", "key", ")", ";", "if", "(", "bugPattern", "==", "null", ...
Get an HTML document describing the bug pattern for given key in detail. @param key which HTML details for retrieve
[ "Get", "an", "HTML", "document", "describing", "the", "bug", "pattern", "for", "given", "key", "in", "detail", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/I18N.java#L113-L120
train
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/I18N.java
I18N.getAnnotationDescription
public String getAnnotationDescription(String key) { try { return annotationDescriptionBundle.getString(key); } catch (MissingResourceException mre) { if (DEBUG) { return "TRANSLATE(" + key + ") (param={0}}"; } else { try { ...
java
public String getAnnotationDescription(String key) { try { return annotationDescriptionBundle.getString(key); } catch (MissingResourceException mre) { if (DEBUG) { return "TRANSLATE(" + key + ") (param={0}}"; } else { try { ...
[ "public", "String", "getAnnotationDescription", "(", "String", "key", ")", "{", "try", "{", "return", "annotationDescriptionBundle", ".", "getString", "(", "key", ")", ";", "}", "catch", "(", "MissingResourceException", "mre", ")", "{", "if", "(", "DEBUG", ")"...
Get an annotation description string. This is a format pattern which will describe a BugAnnotation in the context of a particular bug instance. Its single format argument is the BugAnnotation. @param key the annotation description to retrieve
[ "Get", "an", "annotation", "description", "string", ".", "This", "is", "a", "format", "pattern", "which", "will", "describe", "a", "BugAnnotation", "in", "the", "context", "of", "a", "particular", "bug", "instance", ".", "Its", "single", "format", "argument", ...
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/I18N.java#L130-L144
train
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/I18N.java
I18N.getBugCategoryDescription
public String getBugCategoryDescription(String category) { BugCategory bc = DetectorFactoryCollection.instance().getBugCategory(category); return (bc != null ? bc.getShortDescription() : category); }
java
public String getBugCategoryDescription(String category) { BugCategory bc = DetectorFactoryCollection.instance().getBugCategory(category); return (bc != null ? bc.getShortDescription() : category); }
[ "public", "String", "getBugCategoryDescription", "(", "String", "category", ")", "{", "BugCategory", "bc", "=", "DetectorFactoryCollection", ".", "instance", "(", ")", ".", "getBugCategory", "(", "category", ")", ";", "return", "(", "bc", "!=", "null", "?", "b...
Get the description of a bug category. Returns the category if no description can be found. @param category the category @return the description of the category
[ "Get", "the", "description", "of", "a", "bug", "category", ".", "Returns", "the", "category", "if", "no", "description", "can", "be", "found", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/I18N.java#L173-L176
train
spotbugs/spotbugs
spotbugs/src/gui/main/edu/umd/cs/findbugs/gui2/MainFrameComponentFactory.java
MainFrameComponentFactory.createSourceCodePanel
JPanel createSourceCodePanel() { Font sourceFont = new Font("Monospaced", Font.PLAIN, (int) Driver.getFontSize()); mainFrame.getSourceCodeTextPane().setFont(sourceFont); mainFrame.getSourceCodeTextPane().setEditable(false); mainFrame.getSourceCodeTextPane().getCaret().setSelectionVisible...
java
JPanel createSourceCodePanel() { Font sourceFont = new Font("Monospaced", Font.PLAIN, (int) Driver.getFontSize()); mainFrame.getSourceCodeTextPane().setFont(sourceFont); mainFrame.getSourceCodeTextPane().setEditable(false); mainFrame.getSourceCodeTextPane().getCaret().setSelectionVisible...
[ "JPanel", "createSourceCodePanel", "(", ")", "{", "Font", "sourceFont", "=", "new", "Font", "(", "\"Monospaced\"", ",", "Font", ".", "PLAIN", ",", "(", "int", ")", "Driver", ".", "getFontSize", "(", ")", ")", ";", "mainFrame", ".", "getSourceCodeTextPane", ...
Creates the source code panel, but does not put anything in it.
[ "Creates", "the", "source", "code", "panel", "but", "does", "not", "put", "anything", "in", "it", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/gui/main/edu/umd/cs/findbugs/gui2/MainFrameComponentFactory.java#L137-L155
train
spotbugs/spotbugs
spotbugs/src/gui/main/edu/umd/cs/findbugs/sourceViewer/NavigableTextPane.java
NavigableTextPane.scrollLineToVisible
public void scrollLineToVisible(int line, int margin) { int maxMargin = (parentHeight() - 20) / 2; if (margin > maxMargin) { margin = Math.max(0, maxMargin); } scrollLineToVisibleImpl(line, margin); }
java
public void scrollLineToVisible(int line, int margin) { int maxMargin = (parentHeight() - 20) / 2; if (margin > maxMargin) { margin = Math.max(0, maxMargin); } scrollLineToVisibleImpl(line, margin); }
[ "public", "void", "scrollLineToVisible", "(", "int", "line", ",", "int", "margin", ")", "{", "int", "maxMargin", "=", "(", "parentHeight", "(", ")", "-", "20", ")", "/", "2", ";", "if", "(", "margin", ">", "maxMargin", ")", "{", "margin", "=", "Math"...
scroll the specified line into view, with a margin of 'margin' pixels above and below
[ "scroll", "the", "specified", "line", "into", "view", "with", "a", "margin", "of", "margin", "pixels", "above", "and", "below" ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/gui/main/edu/umd/cs/findbugs/sourceViewer/NavigableTextPane.java#L111-L117
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train