id
int32
0
165k
repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
59,900
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/FindBugs2.java
FindBugs2.logRecoverableException
private void logRecoverableException(ClassDescriptor classDescriptor, Detector2 detector, Throwable e) { bugReporter.logError( "Exception analyzing " + classDescriptor.toDottedClassName() + " using detector " + detector.getDetectorClassName(), e); }
java
private void logRecoverableException(ClassDescriptor classDescriptor, Detector2 detector, Throwable e) { bugReporter.logError( "Exception analyzing " + classDescriptor.toDottedClassName() + " using detector " + detector.getDetectorClassName(), e); }
[ "private", "void", "logRecoverableException", "(", "ClassDescriptor", "classDescriptor", ",", "Detector2", "detector", ",", "Throwable", "e", ")", "{", "bugReporter", ".", "logError", "(", "\"Exception analyzing \"", "+", "classDescriptor", ".", "toDottedClassName", "("...
Report an exception that occurred while analyzing a class with a detector. @param classDescriptor class being analyzed @param detector detector doing the analysis @param e the exception
[ "Report", "an", "exception", "that", "occurred", "while", "analyzing", "a", "class", "with", "a", "detector", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/FindBugs2.java#L1159-L1163
59,901
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/util/Util.java
Util.newSetFromMap
public static <E> Set<E> newSetFromMap(Map<E, Boolean> m) { return new SetFromMap<>(m); }
java
public static <E> Set<E> newSetFromMap(Map<E, Boolean> m) { return new SetFromMap<>(m); }
[ "public", "static", "<", "E", ">", "Set", "<", "E", ">", "newSetFromMap", "(", "Map", "<", "E", ",", "Boolean", ">", "m", ")", "{", "return", "new", "SetFromMap", "<>", "(", "m", ")", ";", "}" ]
Duplication 1.6 functionality of Collections.newSetFromMap
[ "Duplication", "1", ".", "6", "functionality", "of", "Collections", ".", "newSetFromMap" ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/util/Util.java#L474-L476
59,902
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/graph/AbstractDepthFirstSearch.java
AbstractDepthFirstSearch.getNextSearchTreeRoot
protected VertexType getNextSearchTreeRoot() { // FIXME: slow linear search, should improve for (Iterator<VertexType> i = graph.vertexIterator(); i.hasNext();) { VertexType vertex = i.next(); if (visitMe(vertex)) { return vertex; } } re...
java
protected VertexType getNextSearchTreeRoot() { // FIXME: slow linear search, should improve for (Iterator<VertexType> i = graph.vertexIterator(); i.hasNext();) { VertexType vertex = i.next(); if (visitMe(vertex)) { return vertex; } } re...
[ "protected", "VertexType", "getNextSearchTreeRoot", "(", ")", "{", "// FIXME: slow linear search, should improve", "for", "(", "Iterator", "<", "VertexType", ">", "i", "=", "graph", ".", "vertexIterator", "(", ")", ";", "i", ".", "hasNext", "(", ")", ";", ")", ...
Choose the next search tree root. By default, this method just scans for a WHITE vertex. Subclasses may override this method in order to choose which vertices are used as search tree roots. @return the next search tree root
[ "Choose", "the", "next", "search", "tree", "root", ".", "By", "default", "this", "method", "just", "scans", "for", "a", "WHITE", "vertex", ".", "Subclasses", "may", "override", "this", "method", "in", "order", "to", "choose", "which", "vertices", "are", "u...
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/graph/AbstractDepthFirstSearch.java#L137-L146
59,903
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/graph/AbstractDepthFirstSearch.java
AbstractDepthFirstSearch.classifyUnknownEdges
private void classifyUnknownEdges() { Iterator<EdgeType> edgeIter = graph.edgeIterator(); while (edgeIter.hasNext()) { EdgeType edge = edgeIter.next(); int dfsEdgeType = getDFSEdgeType(edge); if (dfsEdgeType == UNKNOWN_EDGE) { int srcDiscoveryTime = ge...
java
private void classifyUnknownEdges() { Iterator<EdgeType> edgeIter = graph.edgeIterator(); while (edgeIter.hasNext()) { EdgeType edge = edgeIter.next(); int dfsEdgeType = getDFSEdgeType(edge); if (dfsEdgeType == UNKNOWN_EDGE) { int srcDiscoveryTime = ge...
[ "private", "void", "classifyUnknownEdges", "(", ")", "{", "Iterator", "<", "EdgeType", ">", "edgeIter", "=", "graph", ".", "edgeIterator", "(", ")", ";", "while", "(", "edgeIter", ".", "hasNext", "(", ")", ")", "{", "EdgeType", "edge", "=", "edgeIter", "...
Classify CROSS and FORWARD edges
[ "Classify", "CROSS", "and", "FORWARD", "edges" ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/graph/AbstractDepthFirstSearch.java#L364-L386
59,904
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/type/TypeFrameModelingVisitor.java
TypeFrameModelingVisitor.consumeStack
protected void consumeStack(Instruction ins) { ConstantPoolGen cpg = getCPG(); TypeFrame frame = getFrame(); int numWordsConsumed = ins.consumeStack(cpg); if (numWordsConsumed == Const.UNPREDICTABLE) { throw new InvalidBytecodeException("Unpredictable stack consumption for "...
java
protected void consumeStack(Instruction ins) { ConstantPoolGen cpg = getCPG(); TypeFrame frame = getFrame(); int numWordsConsumed = ins.consumeStack(cpg); if (numWordsConsumed == Const.UNPREDICTABLE) { throw new InvalidBytecodeException("Unpredictable stack consumption for "...
[ "protected", "void", "consumeStack", "(", "Instruction", "ins", ")", "{", "ConstantPoolGen", "cpg", "=", "getCPG", "(", ")", ";", "TypeFrame", "frame", "=", "getFrame", "(", ")", ";", "int", "numWordsConsumed", "=", "ins", ".", "consumeStack", "(", "cpg", ...
Consume stack. This is a convenience method for instructions where the types of popped operands can be ignored.
[ "Consume", "stack", ".", "This", "is", "a", "convenience", "method", "for", "instructions", "where", "the", "types", "of", "popped", "operands", "can", "be", "ignored", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/type/TypeFrameModelingVisitor.java#L214-L232
59,905
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/type/TypeFrameModelingVisitor.java
TypeFrameModelingVisitor.pushReturnType
protected void pushReturnType(InvokeInstruction ins) { ConstantPoolGen cpg = getCPG(); Type type = ins.getType(cpg); if (type.getType() != Const.T_VOID) { pushValue(type); } }
java
protected void pushReturnType(InvokeInstruction ins) { ConstantPoolGen cpg = getCPG(); Type type = ins.getType(cpg); if (type.getType() != Const.T_VOID) { pushValue(type); } }
[ "protected", "void", "pushReturnType", "(", "InvokeInstruction", "ins", ")", "{", "ConstantPoolGen", "cpg", "=", "getCPG", "(", ")", ";", "Type", "type", "=", "ins", ".", "getType", "(", "cpg", ")", ";", "if", "(", "type", ".", "getType", "(", ")", "!=...
Helper for pushing the return type of an invoke instruction.
[ "Helper", "for", "pushing", "the", "return", "type", "of", "an", "invoke", "instruction", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/type/TypeFrameModelingVisitor.java#L258-L264
59,906
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/type/TypeFrameModelingVisitor.java
TypeFrameModelingVisitor.modelNormalInstruction
@Override public void modelNormalInstruction(Instruction ins, int numWordsConsumed, int numWordsProduced) { if (VERIFY_INTEGRITY) { if (numWordsProduced > 0) { throw new InvalidBytecodeException("missing visitor method for " + ins); } } super.modelNorm...
java
@Override public void modelNormalInstruction(Instruction ins, int numWordsConsumed, int numWordsProduced) { if (VERIFY_INTEGRITY) { if (numWordsProduced > 0) { throw new InvalidBytecodeException("missing visitor method for " + ins); } } super.modelNorm...
[ "@", "Override", "public", "void", "modelNormalInstruction", "(", "Instruction", "ins", ",", "int", "numWordsConsumed", ",", "int", "numWordsProduced", ")", "{", "if", "(", "VERIFY_INTEGRITY", ")", "{", "if", "(", "numWordsProduced", ">", "0", ")", "{", "throw...
This is overridden only to ensure that we don't rely on the base class to handle instructions that produce stack operands.
[ "This", "is", "overridden", "only", "to", "ensure", "that", "we", "don", "t", "rely", "on", "the", "base", "class", "to", "handle", "instructions", "that", "produce", "stack", "operands", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/type/TypeFrameModelingVisitor.java#L270-L278
59,907
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/Dataflow.java
Dataflow.logicalPredecessorEdgeIterator
private Iterator<Edge> logicalPredecessorEdgeIterator(BasicBlock block) { return isForwards ? cfg.incomingEdgeIterator(block) : cfg.outgoingEdgeIterator(block); }
java
private Iterator<Edge> logicalPredecessorEdgeIterator(BasicBlock block) { return isForwards ? cfg.incomingEdgeIterator(block) : cfg.outgoingEdgeIterator(block); }
[ "private", "Iterator", "<", "Edge", ">", "logicalPredecessorEdgeIterator", "(", "BasicBlock", "block", ")", "{", "return", "isForwards", "?", "cfg", ".", "incomingEdgeIterator", "(", "block", ")", ":", "cfg", ".", "outgoingEdgeIterator", "(", "block", ")", ";", ...
Return an Iterator over edges that connect given block to its logical predecessors. For forward analyses, this is the incoming edges. For backward analyses, this is the outgoing edges.
[ "Return", "an", "Iterator", "over", "edges", "that", "connect", "given", "block", "to", "its", "logical", "predecessors", ".", "For", "forward", "analyses", "this", "is", "the", "incoming", "edges", ".", "For", "backward", "analyses", "this", "is", "the", "o...
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/Dataflow.java#L549-L551
59,908
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/detect/DumbMethods.java
DumbMethods.stackEntryThatMustBeNonnegative
private int stackEntryThatMustBeNonnegative(int seen) { switch (seen) { case Const.INVOKEINTERFACE: if ("java/util/List".equals(getClassConstantOperand())) { return getStackEntryOfListCallThatMustBeNonnegative(); } break; case Const.INVOKEVIRTU...
java
private int stackEntryThatMustBeNonnegative(int seen) { switch (seen) { case Const.INVOKEINTERFACE: if ("java/util/List".equals(getClassConstantOperand())) { return getStackEntryOfListCallThatMustBeNonnegative(); } break; case Const.INVOKEVIRTU...
[ "private", "int", "stackEntryThatMustBeNonnegative", "(", "int", "seen", ")", "{", "switch", "(", "seen", ")", "{", "case", "Const", ".", "INVOKEINTERFACE", ":", "if", "(", "\"java/util/List\"", ".", "equals", "(", "getClassConstantOperand", "(", ")", ")", ")"...
Return index of stack entry that must be nonnegative. Return -1 if no stack entry is required to be nonnegative.
[ "Return", "index", "of", "stack", "entry", "that", "must", "be", "nonnegative", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/detect/DumbMethods.java#L1427-L1461
59,909
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/detect/DumbMethods.java
DumbMethods.flush
private void flush() { if (pendingAbsoluteValueBug != null) { absoluteValueAccumulator.accumulateBug(pendingAbsoluteValueBug, pendingAbsoluteValueBugSourceLine); pendingAbsoluteValueBug = null; pendingAbsoluteValueBugSourceLine = null; } accumulator.reportAcc...
java
private void flush() { if (pendingAbsoluteValueBug != null) { absoluteValueAccumulator.accumulateBug(pendingAbsoluteValueBug, pendingAbsoluteValueBugSourceLine); pendingAbsoluteValueBug = null; pendingAbsoluteValueBugSourceLine = null; } accumulator.reportAcc...
[ "private", "void", "flush", "(", ")", "{", "if", "(", "pendingAbsoluteValueBug", "!=", "null", ")", "{", "absoluteValueAccumulator", ".", "accumulateBug", "(", "pendingAbsoluteValueBug", ",", "pendingAbsoluteValueBugSourceLine", ")", ";", "pendingAbsoluteValueBug", "=",...
Flush out cached state at the end of a method.
[ "Flush", "out", "cached", "state", "at", "the", "end", "of", "a", "method", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/detect/DumbMethods.java#L1519-L1563
59,910
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/BasicBlock.java
BasicBlock.isNullCheck
public boolean isNullCheck() { // Null check blocks must be exception throwers, // and are always empty. (The only kind of non-empty // exception throwing block is one terminated by an ATHROW). if (!isExceptionThrower() || getFirstInstruction() != null) { return false; ...
java
public boolean isNullCheck() { // Null check blocks must be exception throwers, // and are always empty. (The only kind of non-empty // exception throwing block is one terminated by an ATHROW). if (!isExceptionThrower() || getFirstInstruction() != null) { return false; ...
[ "public", "boolean", "isNullCheck", "(", ")", "{", "// Null check blocks must be exception throwers,", "// and are always empty. (The only kind of non-empty", "// exception throwing block is one terminated by an ATHROW).", "if", "(", "!", "isExceptionThrower", "(", ")", "||", "getFir...
Return whether or not this block is a null check.
[ "Return", "whether", "or", "not", "this", "block", "is", "a", "null", "check", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/BasicBlock.java#L177-L186
59,911
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/BasicBlock.java
BasicBlock.getSuccessorOf
public @CheckForNull InstructionHandle getSuccessorOf(InstructionHandle handle) { if (VERIFY_INTEGRITY && !containsInstruction(handle)) { throw new IllegalStateException(); } return handle == lastInstruction ? null : handle.getNext(); }
java
public @CheckForNull InstructionHandle getSuccessorOf(InstructionHandle handle) { if (VERIFY_INTEGRITY && !containsInstruction(handle)) { throw new IllegalStateException(); } return handle == lastInstruction ? null : handle.getNext(); }
[ "public", "@", "CheckForNull", "InstructionHandle", "getSuccessorOf", "(", "InstructionHandle", "handle", ")", "{", "if", "(", "VERIFY_INTEGRITY", "&&", "!", "containsInstruction", "(", "handle", ")", ")", "{", "throw", "new", "IllegalStateException", "(", ")", ";...
Get the successor of given instruction within the basic block. @param handle the instruction @return the instruction's successor, or null if the instruction is the last in the basic block
[ "Get", "the", "successor", "of", "given", "instruction", "within", "the", "basic", "block", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/BasicBlock.java#L210-L216
59,912
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/BasicBlock.java
BasicBlock.getPredecessorOf
public InstructionHandle getPredecessorOf(InstructionHandle handle) { if (VERIFY_INTEGRITY && !containsInstruction(handle)) { throw new IllegalStateException(); } return handle == firstInstruction ? null : handle.getPrev(); }
java
public InstructionHandle getPredecessorOf(InstructionHandle handle) { if (VERIFY_INTEGRITY && !containsInstruction(handle)) { throw new IllegalStateException(); } return handle == firstInstruction ? null : handle.getPrev(); }
[ "public", "InstructionHandle", "getPredecessorOf", "(", "InstructionHandle", "handle", ")", "{", "if", "(", "VERIFY_INTEGRITY", "&&", "!", "containsInstruction", "(", "handle", ")", ")", "{", "throw", "new", "IllegalStateException", "(", ")", ";", "}", "return", ...
Get the predecessor of given instruction within the basic block. @param handle the instruction @return the instruction's predecessor, or null if the instruction is the first in the basic block
[ "Get", "the", "predecessor", "of", "given", "instruction", "within", "the", "basic", "block", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/BasicBlock.java#L226-L231
59,913
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/BasicBlock.java
BasicBlock.addInstruction
public void addInstruction(InstructionHandle handle) { if (firstInstruction == null) { firstInstruction = lastInstruction = handle; } else { if (VERIFY_INTEGRITY && handle != lastInstruction.getNext()) { throw new IllegalStateException("Adding non-consecutive inst...
java
public void addInstruction(InstructionHandle handle) { if (firstInstruction == null) { firstInstruction = lastInstruction = handle; } else { if (VERIFY_INTEGRITY && handle != lastInstruction.getNext()) { throw new IllegalStateException("Adding non-consecutive inst...
[ "public", "void", "addInstruction", "(", "InstructionHandle", "handle", ")", "{", "if", "(", "firstInstruction", "==", "null", ")", "{", "firstInstruction", "=", "lastInstruction", "=", "handle", ";", "}", "else", "{", "if", "(", "VERIFY_INTEGRITY", "&&", "han...
Add an InstructionHandle to the basic block. @param handle the InstructionHandle
[ "Add", "an", "InstructionHandle", "to", "the", "basic", "block", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/BasicBlock.java#L239-L248
59,914
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/BasicBlock.java
BasicBlock.containsInstruction
public boolean containsInstruction(InstructionHandle handle) { Iterator<InstructionHandle> i = instructionIterator(); while (i.hasNext()) { if (i.next() == handle) { return true; } } return false; }
java
public boolean containsInstruction(InstructionHandle handle) { Iterator<InstructionHandle> i = instructionIterator(); while (i.hasNext()) { if (i.next() == handle) { return true; } } return false; }
[ "public", "boolean", "containsInstruction", "(", "InstructionHandle", "handle", ")", "{", "Iterator", "<", "InstructionHandle", ">", "i", "=", "instructionIterator", "(", ")", ";", "while", "(", "i", ".", "hasNext", "(", ")", ")", "{", "if", "(", "i", ".",...
Return whether or not the basic block contains the given instruction. @param handle the instruction @return true if the block contains the instruction, false otherwise
[ "Return", "whether", "or", "not", "the", "basic", "block", "contains", "the", "given", "instruction", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/BasicBlock.java#L430-L438
59,915
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/BasicBlock.java
BasicBlock.containsInstructionWithOffset
public boolean containsInstructionWithOffset(int offset) { Iterator<InstructionHandle> i = instructionIterator(); while (i.hasNext()) { if (i.next().getPosition() == offset) { return true; } } return false; }
java
public boolean containsInstructionWithOffset(int offset) { Iterator<InstructionHandle> i = instructionIterator(); while (i.hasNext()) { if (i.next().getPosition() == offset) { return true; } } return false; }
[ "public", "boolean", "containsInstructionWithOffset", "(", "int", "offset", ")", "{", "Iterator", "<", "InstructionHandle", ">", "i", "=", "instructionIterator", "(", ")", ";", "while", "(", "i", ".", "hasNext", "(", ")", ")", "{", "if", "(", "i", ".", "...
Return whether or not the basic block contains the instruction with the given bytecode offset. @param offset the bytecode offset @return true if the block contains an instruction with the given offset, false if it does not
[ "Return", "whether", "or", "not", "the", "basic", "block", "contains", "the", "instruction", "with", "the", "given", "bytecode", "offset", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/BasicBlock.java#L449-L457
59,916
spotbugs/spotbugs
eclipsePlugin/src/de/tobject/findbugs/io/IO.java
IO.writeFile
public static void writeFile(IFile file, final FileOutput output, IProgressMonitor monitor) throws CoreException { try { ByteArrayOutputStream bos = new ByteArrayOutputStream(); output.writeFile(bos); ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray()); ...
java
public static void writeFile(IFile file, final FileOutput output, IProgressMonitor monitor) throws CoreException { try { ByteArrayOutputStream bos = new ByteArrayOutputStream(); output.writeFile(bos); ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray()); ...
[ "public", "static", "void", "writeFile", "(", "IFile", "file", ",", "final", "FileOutput", "output", ",", "IProgressMonitor", "monitor", ")", "throws", "CoreException", "{", "try", "{", "ByteArrayOutputStream", "bos", "=", "new", "ByteArrayOutputStream", "(", ")",...
Write the contents of a file in the Eclipse workspace. @param file the file to write to @param output the FileOutput object responsible for generating the data @param monitor a progress monitor (or null if none) @throws CoreException
[ "Write", "the", "contents", "of", "a", "file", "in", "the", "Eclipse", "workspace", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/io/IO.java#L58-L74
59,917
spotbugs/spotbugs
eclipsePlugin/src/de/tobject/findbugs/io/IO.java
IO.writeFile
public static void writeFile(final File file, final FileOutput output, final IProgressMonitor monitor) throws CoreException { try (FileOutputStream fout = new FileOutputStream(file); BufferedOutputStream bout = new BufferedOutputStream(fout)) { if (monitor != null) { ...
java
public static void writeFile(final File file, final FileOutput output, final IProgressMonitor monitor) throws CoreException { try (FileOutputStream fout = new FileOutputStream(file); BufferedOutputStream bout = new BufferedOutputStream(fout)) { if (monitor != null) { ...
[ "public", "static", "void", "writeFile", "(", "final", "File", "file", ",", "final", "FileOutput", "output", ",", "final", "IProgressMonitor", "monitor", ")", "throws", "CoreException", "{", "try", "(", "FileOutputStream", "fout", "=", "new", "FileOutputStream", ...
Write the contents of a java.io.File @param file the file to write to @param output the FileOutput object responsible for generating the data
[ "Write", "the", "contents", "of", "a", "java", ".", "io", ".", "File" ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/io/IO.java#L104-L116
59,918
spotbugs/spotbugs
eclipsePlugin/src/de/tobject/findbugs/reporter/MarkerUtil.java
MarkerUtil.createMarkers
public static void createMarkers(final IJavaProject javaProject, final SortedBugCollection theCollection, final ISchedulingRule rule, IProgressMonitor monitor) { if (monitor.isCanceled()) { return; } final List<MarkerParameter> bugParameters = createBugParameters(javaProject, theColl...
java
public static void createMarkers(final IJavaProject javaProject, final SortedBugCollection theCollection, final ISchedulingRule rule, IProgressMonitor monitor) { if (monitor.isCanceled()) { return; } final List<MarkerParameter> bugParameters = createBugParameters(javaProject, theColl...
[ "public", "static", "void", "createMarkers", "(", "final", "IJavaProject", "javaProject", ",", "final", "SortedBugCollection", "theCollection", ",", "final", "ISchedulingRule", "rule", ",", "IProgressMonitor", "monitor", ")", "{", "if", "(", "monitor", ".", "isCance...
Create an Eclipse marker for given BugInstance. @param javaProject the project @param monitor
[ "Create", "an", "Eclipse", "marker", "for", "given", "BugInstance", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/reporter/MarkerUtil.java#L119-L145
59,919
spotbugs/spotbugs
eclipsePlugin/src/de/tobject/findbugs/reporter/MarkerUtil.java
MarkerUtil.createBugParameters
public static List<MarkerParameter> createBugParameters(IJavaProject project, BugCollection theCollection, IProgressMonitor monitor) { List<MarkerParameter> bugParameters = new ArrayList<>(); if (project == null) { FindbugsPlugin.getDefault().logException(new NullPointerException...
java
public static List<MarkerParameter> createBugParameters(IJavaProject project, BugCollection theCollection, IProgressMonitor monitor) { List<MarkerParameter> bugParameters = new ArrayList<>(); if (project == null) { FindbugsPlugin.getDefault().logException(new NullPointerException...
[ "public", "static", "List", "<", "MarkerParameter", ">", "createBugParameters", "(", "IJavaProject", "project", ",", "BugCollection", "theCollection", ",", "IProgressMonitor", "monitor", ")", "{", "List", "<", "MarkerParameter", ">", "bugParameters", "=", "new", "Ar...
As a side-effect this method updates missing line information for some bugs stored in the given bug collection @param project @param theCollection @return never null
[ "As", "a", "side", "-", "effect", "this", "method", "updates", "missing", "line", "information", "for", "some", "bugs", "stored", "in", "the", "given", "bug", "collection" ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/reporter/MarkerUtil.java#L155-L175
59,920
spotbugs/spotbugs
eclipsePlugin/src/de/tobject/findbugs/reporter/MarkerUtil.java
MarkerUtil.removeMarkers
public static void removeMarkers(IResource res) throws CoreException { // remove any markers added by our builder // This triggers resource update on IResourceChangeListener's // (BugTreeView) res.deleteMarkers(FindBugsMarker.NAME, true, IResource.DEPTH_INFINITE); if (res instanc...
java
public static void removeMarkers(IResource res) throws CoreException { // remove any markers added by our builder // This triggers resource update on IResourceChangeListener's // (BugTreeView) res.deleteMarkers(FindBugsMarker.NAME, true, IResource.DEPTH_INFINITE); if (res instanc...
[ "public", "static", "void", "removeMarkers", "(", "IResource", "res", ")", "throws", "CoreException", "{", "// remove any markers added by our builder", "// This triggers resource update on IResourceChangeListener's", "// (BugTreeView)", "res", ".", "deleteMarkers", "(", "FindBug...
Remove all FindBugs problem markers for given resource. If the given resource is project, will also clear bug collection. @param res the resource
[ "Remove", "all", "FindBugs", "problem", "markers", "for", "given", "resource", ".", "If", "the", "given", "resource", "is", "project", "will", "also", "clear", "bug", "collection", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/reporter/MarkerUtil.java#L520-L529
59,921
spotbugs/spotbugs
eclipsePlugin/src/de/tobject/findbugs/reporter/MarkerUtil.java
MarkerUtil.redisplayMarkers
public static void redisplayMarkers(final IJavaProject javaProject) { final IProject project = javaProject.getProject(); FindBugsJob job = new FindBugsJob("Refreshing SpotBugs markers", project) { @Override protected void runWithProgress(IProgressMonitor monitor) throws CoreExcep...
java
public static void redisplayMarkers(final IJavaProject javaProject) { final IProject project = javaProject.getProject(); FindBugsJob job = new FindBugsJob("Refreshing SpotBugs markers", project) { @Override protected void runWithProgress(IProgressMonitor monitor) throws CoreExcep...
[ "public", "static", "void", "redisplayMarkers", "(", "final", "IJavaProject", "javaProject", ")", "{", "final", "IProject", "project", "=", "javaProject", ".", "getProject", "(", ")", ";", "FindBugsJob", "job", "=", "new", "FindBugsJob", "(", "\"Refreshing SpotBug...
Attempt to redisplay FindBugs problem markers for given project. @param javaProject the project
[ "Attempt", "to", "redisplay", "FindBugs", "problem", "markers", "for", "given", "project", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/reporter/MarkerUtil.java#L552-L571
59,922
spotbugs/spotbugs
eclipsePlugin/src/de/tobject/findbugs/reporter/MarkerUtil.java
MarkerUtil.findBugInstanceForMarker
public static @CheckForNull BugInstance findBugInstanceForMarker(IMarker marker) { BugCollectionAndInstance bci = findBugCollectionAndInstanceForMarker(marker); if (bci == null) { return null; } return bci.bugInstance; }
java
public static @CheckForNull BugInstance findBugInstanceForMarker(IMarker marker) { BugCollectionAndInstance bci = findBugCollectionAndInstanceForMarker(marker); if (bci == null) { return null; } return bci.bugInstance; }
[ "public", "static", "@", "CheckForNull", "BugInstance", "findBugInstanceForMarker", "(", "IMarker", "marker", ")", "{", "BugCollectionAndInstance", "bci", "=", "findBugCollectionAndInstanceForMarker", "(", "marker", ")", ";", "if", "(", "bci", "==", "null", ")", "{"...
Find the BugInstance associated with given FindBugs marker. @param marker a FindBugs marker @return the BugInstance associated with the marker, or null if we can't find the BugInstance
[ "Find", "the", "BugInstance", "associated", "with", "given", "FindBugs", "marker", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/reporter/MarkerUtil.java#L734-L741
59,923
spotbugs/spotbugs
eclipsePlugin/src/de/tobject/findbugs/reporter/MarkerUtil.java
MarkerUtil.findBugCollectionAndInstanceForMarker
public static @CheckForNull BugCollectionAndInstance findBugCollectionAndInstanceForMarker(IMarker marker) { IResource resource = marker.getResource(); IProject project = resource.getProject(); if (project == null) { // Also shouldn't happen. FindbugsPlugin.getDefaul...
java
public static @CheckForNull BugCollectionAndInstance findBugCollectionAndInstanceForMarker(IMarker marker) { IResource resource = marker.getResource(); IProject project = resource.getProject(); if (project == null) { // Also shouldn't happen. FindbugsPlugin.getDefaul...
[ "public", "static", "@", "CheckForNull", "BugCollectionAndInstance", "findBugCollectionAndInstanceForMarker", "(", "IMarker", "marker", ")", "{", "IResource", "resource", "=", "marker", ".", "getResource", "(", ")", ";", "IProject", "project", "=", "resource", ".", ...
Find the BugCollectionAndInstance associated with given FindBugs marker. @param marker a FindBugs marker @return the BugInstance associated with the marker, or null if we can't find the BugInstance
[ "Find", "the", "BugCollectionAndInstance", "associated", "with", "given", "FindBugs", "marker", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/reporter/MarkerUtil.java#L751-L809
59,924
spotbugs/spotbugs
eclipsePlugin/src/de/tobject/findbugs/reporter/MarkerUtil.java
MarkerUtil.getMarkerFromSelection
public static Set<IMarker> getMarkerFromSelection(ISelection selection) { Set<IMarker> markers = new HashSet<>(); if (!(selection instanceof IStructuredSelection)) { return markers; } IStructuredSelection sSelection = (IStructuredSelection) selection; for (Iterator<?>...
java
public static Set<IMarker> getMarkerFromSelection(ISelection selection) { Set<IMarker> markers = new HashSet<>(); if (!(selection instanceof IStructuredSelection)) { return markers; } IStructuredSelection sSelection = (IStructuredSelection) selection; for (Iterator<?>...
[ "public", "static", "Set", "<", "IMarker", ">", "getMarkerFromSelection", "(", "ISelection", "selection", ")", "{", "Set", "<", "IMarker", ">", "markers", "=", "new", "HashSet", "<>", "(", ")", ";", "if", "(", "!", "(", "selection", "instanceof", "IStructu...
Fish an IMarker out of given selection. @param selection the selection @return the selected IMarker, or null if we can't find an IMarker in the selection
[ "Fish", "an", "IMarker", "out", "of", "given", "selection", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/reporter/MarkerUtil.java#L823-L834
59,925
spotbugs/spotbugs
eclipsePlugin/src/de/tobject/findbugs/reporter/MarkerUtil.java
MarkerUtil.getMarkerFromEditor
public static IMarker getMarkerFromEditor(ITextSelection selection, IEditorPart editor) { IResource resource = (IResource) editor.getEditorInput().getAdapter(IFile.class); IMarker[] allMarkers; if (resource != null) { allMarkers = getMarkers(resource, IResource.DEPTH_ZERO); }...
java
public static IMarker getMarkerFromEditor(ITextSelection selection, IEditorPart editor) { IResource resource = (IResource) editor.getEditorInput().getAdapter(IFile.class); IMarker[] allMarkers; if (resource != null) { allMarkers = getMarkers(resource, IResource.DEPTH_ZERO); }...
[ "public", "static", "IMarker", "getMarkerFromEditor", "(", "ITextSelection", "selection", ",", "IEditorPart", "editor", ")", "{", "IResource", "resource", "=", "(", "IResource", ")", "editor", ".", "getEditorInput", "(", ")", ".", "getAdapter", "(", "IFile", "."...
Tries to retrieve right bug marker for given selection. If there are many markers for given editor, and text selection doesn't match any of them, return null. If there is only one marker for given editor, returns this marker in any case. @param selection @param editor @return may return null
[ "Tries", "to", "retrieve", "right", "bug", "marker", "for", "given", "selection", ".", "If", "there", "are", "many", "markers", "for", "given", "editor", "and", "text", "selection", "doesn", "t", "match", "any", "of", "them", "return", "null", ".", "If", ...
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/reporter/MarkerUtil.java#L881-L908
59,926
spotbugs/spotbugs
eclipsePlugin/src/de/tobject/findbugs/reporter/MarkerUtil.java
MarkerUtil.getMarkers
@Nonnull public static IMarker[] getMarkers(IResource fileOrFolder, int depth) { if(fileOrFolder.getType() == IResource.PROJECT) { if(!fileOrFolder.isAccessible()) { // user just closed the project decorator is working on, avoid exception here return EMPTY; ...
java
@Nonnull public static IMarker[] getMarkers(IResource fileOrFolder, int depth) { if(fileOrFolder.getType() == IResource.PROJECT) { if(!fileOrFolder.isAccessible()) { // user just closed the project decorator is working on, avoid exception here return EMPTY; ...
[ "@", "Nonnull", "public", "static", "IMarker", "[", "]", "getMarkers", "(", "IResource", "fileOrFolder", ",", "int", "depth", ")", "{", "if", "(", "fileOrFolder", ".", "getType", "(", ")", "==", "IResource", ".", "PROJECT", ")", "{", "if", "(", "!", "f...
Retrieves all the FB markers from given resource and all its descendants @param fileOrFolder @return never null (empty array if nothing there or exception happens). Exception will be logged
[ "Retrieves", "all", "the", "FB", "markers", "from", "given", "resource", "and", "all", "its", "descendants" ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/reporter/MarkerUtil.java#L992-L1006
59,927
spotbugs/spotbugs
eclipsePlugin/src/de/tobject/findbugs/classify/SeverityClassificationPulldownAction.java
SeverityClassificationPulldownAction.syncMenu
private void syncMenu() { if (bugInstance != null) { BugProperty severityProperty = bugInstance.lookupProperty(BugProperty.SEVERITY); if (severityProperty != null) { try { int severity = severityProperty.getValueAsInt(); if (severit...
java
private void syncMenu() { if (bugInstance != null) { BugProperty severityProperty = bugInstance.lookupProperty(BugProperty.SEVERITY); if (severityProperty != null) { try { int severity = severityProperty.getValueAsInt(); if (severit...
[ "private", "void", "syncMenu", "(", ")", "{", "if", "(", "bugInstance", "!=", "null", ")", "{", "BugProperty", "severityProperty", "=", "bugInstance", ".", "lookupProperty", "(", "BugProperty", ".", "SEVERITY", ")", ";", "if", "(", "severityProperty", "!=", ...
Synchronize the menu with the current BugInstance.
[ "Synchronize", "the", "menu", "with", "the", "current", "BugInstance", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/classify/SeverityClassificationPulldownAction.java#L130-L153
59,928
spotbugs/spotbugs
eclipsePlugin/src/de/tobject/findbugs/classify/SeverityClassificationPulldownAction.java
SeverityClassificationPulldownAction.selectSeverity
private void selectSeverity(int severity) { // Severity is 1-based, but the menu item list is 0-based int index = severity - 1; for (int i = 0; i < severityItemList.length; ++i) { MenuItem menuItem = severityItemList[i]; menuItem.setEnabled(true); menuItem.se...
java
private void selectSeverity(int severity) { // Severity is 1-based, but the menu item list is 0-based int index = severity - 1; for (int i = 0; i < severityItemList.length; ++i) { MenuItem menuItem = severityItemList[i]; menuItem.setEnabled(true); menuItem.se...
[ "private", "void", "selectSeverity", "(", "int", "severity", ")", "{", "// Severity is 1-based, but the menu item list is 0-based", "int", "index", "=", "severity", "-", "1", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "severityItemList", ".", "length"...
Set the menu to given severity level. @param severity the severity level (1..5)
[ "Set", "the", "menu", "to", "given", "severity", "level", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/classify/SeverityClassificationPulldownAction.java#L161-L170
59,929
spotbugs/spotbugs
eclipsePlugin/src/de/tobject/findbugs/classify/SeverityClassificationPulldownAction.java
SeverityClassificationPulldownAction.resetMenuItems
private void resetMenuItems(boolean enable) { for (int i = 0; i < severityItemList.length; ++i) { MenuItem menuItem = severityItemList[i]; menuItem.setEnabled(enable); menuItem.setSelection(false); } }
java
private void resetMenuItems(boolean enable) { for (int i = 0; i < severityItemList.length; ++i) { MenuItem menuItem = severityItemList[i]; menuItem.setEnabled(enable); menuItem.setSelection(false); } }
[ "private", "void", "resetMenuItems", "(", "boolean", "enable", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "severityItemList", ".", "length", ";", "++", "i", ")", "{", "MenuItem", "menuItem", "=", "severityItemList", "[", "i", "]", ";", ...
Reset menu items so they are unchecked. @param enable true if menu items should be enabled, false if they should be disabled
[ "Reset", "menu", "items", "so", "they", "are", "unchecked", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/classify/SeverityClassificationPulldownAction.java#L179-L185
59,930
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/vna/ValueNumberCache.java
ValueNumberCache.lookupOutputValues
public ValueNumber[] lookupOutputValues(Entry entry) { if (DEBUG) { System.out.println("VN cache lookup: " + entry); } ValueNumber[] result = entryToOutputMap.get(entry); if (DEBUG) { System.out.println(" result ==> " + Arrays.toString(result)); } ...
java
public ValueNumber[] lookupOutputValues(Entry entry) { if (DEBUG) { System.out.println("VN cache lookup: " + entry); } ValueNumber[] result = entryToOutputMap.get(entry); if (DEBUG) { System.out.println(" result ==> " + Arrays.toString(result)); } ...
[ "public", "ValueNumber", "[", "]", "lookupOutputValues", "(", "Entry", "entry", ")", "{", "if", "(", "DEBUG", ")", "{", "System", ".", "out", ".", "println", "(", "\"VN cache lookup: \"", "+", "entry", ")", ";", "}", "ValueNumber", "[", "]", "result", "=...
Look up cached output values for given entry. @param entry the entry @return the list of output values, or null if there is no matching entry in the cache
[ "Look", "up", "cached", "output", "values", "for", "given", "entry", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/vna/ValueNumberCache.java#L120-L129
59,931
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/bcp/BindingSet.java
BindingSet.lookup
public Binding lookup(String varName) { if (varName.equals(binding.getVarName())) { return binding; } return parent != null ? parent.lookup(varName) : null; }
java
public Binding lookup(String varName) { if (varName.equals(binding.getVarName())) { return binding; } return parent != null ? parent.lookup(varName) : null; }
[ "public", "Binding", "lookup", "(", "String", "varName", ")", "{", "if", "(", "varName", ".", "equals", "(", "binding", ".", "getVarName", "(", ")", ")", ")", "{", "return", "binding", ";", "}", "return", "parent", "!=", "null", "?", "parent", ".", "...
Look for a Binding for given variable. @param varName name of the variable @return the Binding, or null if no such Binding is present in the set
[ "Look", "for", "a", "Binding", "for", "given", "variable", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/bcp/BindingSet.java#L55-L60
59,932
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/npe/IsNullValueAnalysis.java
IsNullValueAnalysis.replaceValues
private IsNullValueFrame replaceValues(IsNullValueFrame origFrame, IsNullValueFrame frame, ValueNumber replaceMe, ValueNumberFrame prevVnaFrame, ValueNumberFrame targetVnaFrame, IsNullValue replacementValue) { if (!targetVnaFrame.isValid()) { throw new IllegalArgumentException("Invalid ...
java
private IsNullValueFrame replaceValues(IsNullValueFrame origFrame, IsNullValueFrame frame, ValueNumber replaceMe, ValueNumberFrame prevVnaFrame, ValueNumberFrame targetVnaFrame, IsNullValue replacementValue) { if (!targetVnaFrame.isValid()) { throw new IllegalArgumentException("Invalid ...
[ "private", "IsNullValueFrame", "replaceValues", "(", "IsNullValueFrame", "origFrame", ",", "IsNullValueFrame", "frame", ",", "ValueNumber", "replaceMe", ",", "ValueNumberFrame", "prevVnaFrame", ",", "ValueNumberFrame", "targetVnaFrame", ",", "IsNullValue", "replacementValue",...
Update is-null information at a branch target based on information gained at a null comparison branch. @param origFrame the original is-null frame at entry to basic block @param frame the modified version of the is-null entry frame; null if the entry frame has not been modified yet @param replaceMe the ValueNumber in ...
[ "Update", "is", "-", "null", "information", "at", "a", "branch", "target", "based", "on", "information", "gained", "at", "a", "null", "comparison", "branch", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/npe/IsNullValueAnalysis.java#L841-L913
59,933
spotbugs/spotbugs
eclipsePlugin/src/de/tobject/findbugs/actions/MarkerRulerAction.java
MarkerRulerAction.obtainFindBugsMarkers
protected void obtainFindBugsMarkers() { // Delete old markers markers.clear(); if (editor == null || ruler == null) { return; } // Obtain all markers in the editor IResource resource = (IResource) editor.getEditorInput().getAdapter(IFile.class); if(r...
java
protected void obtainFindBugsMarkers() { // Delete old markers markers.clear(); if (editor == null || ruler == null) { return; } // Obtain all markers in the editor IResource resource = (IResource) editor.getEditorInput().getAdapter(IFile.class); if(r...
[ "protected", "void", "obtainFindBugsMarkers", "(", ")", "{", "// Delete old markers", "markers", ".", "clear", "(", ")", ";", "if", "(", "editor", "==", "null", "||", "ruler", "==", "null", ")", "{", "return", ";", "}", "// Obtain all markers in the editor", "...
Fills markers field with all of the FindBugs markers associated with the current line in the text editor's ruler marign.
[ "Fills", "markers", "field", "with", "all", "of", "the", "FindBugs", "markers", "associated", "with", "the", "current", "line", "in", "the", "text", "editor", "s", "ruler", "marign", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/actions/MarkerRulerAction.java#L142-L168
59,934
spotbugs/spotbugs
eclipsePlugin/src/de/tobject/findbugs/actions/MarkerRulerAction.java
MarkerRulerAction.includesRulerLine
protected boolean includesRulerLine(Position position, IDocument document) { if (position != null && ruler != null) { try { int markerLine = document.getLineOfOffset(position.getOffset()); int line = ruler.getLineOfLastMouseButtonActivity(); if (line =...
java
protected boolean includesRulerLine(Position position, IDocument document) { if (position != null && ruler != null) { try { int markerLine = document.getLineOfOffset(position.getOffset()); int line = ruler.getLineOfLastMouseButtonActivity(); if (line =...
[ "protected", "boolean", "includesRulerLine", "(", "Position", "position", ",", "IDocument", "document", ")", "{", "if", "(", "position", "!=", "null", "&&", "ruler", "!=", "null", ")", "{", "try", "{", "int", "markerLine", "=", "document", ".", "getLineOfOff...
Checks a Position in a document to see whether the line of last mouse activity falls within this region. @param position Position of the marker @param document the Document the marker resides in @return true if the last mouse click falls on the same line as the marker
[ "Checks", "a", "Position", "in", "a", "document", "to", "see", "whether", "the", "line", "of", "last", "mouse", "activity", "falls", "within", "this", "region", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/actions/MarkerRulerAction.java#L194-L207
59,935
spotbugs/spotbugs
eclipsePlugin/src/de/tobject/findbugs/actions/MarkerRulerAction.java
MarkerRulerAction.getModel
@CheckForNull protected AbstractMarkerAnnotationModel getModel() { if(editor == null) { return null; } IDocumentProvider provider = editor.getDocumentProvider(); IAnnotationModel model = provider.getAnnotationModel(editor.getEditorInput()); if (model instanceof Ab...
java
@CheckForNull protected AbstractMarkerAnnotationModel getModel() { if(editor == null) { return null; } IDocumentProvider provider = editor.getDocumentProvider(); IAnnotationModel model = provider.getAnnotationModel(editor.getEditorInput()); if (model instanceof Ab...
[ "@", "CheckForNull", "protected", "AbstractMarkerAnnotationModel", "getModel", "(", ")", "{", "if", "(", "editor", "==", "null", ")", "{", "return", "null", ";", "}", "IDocumentProvider", "provider", "=", "editor", ".", "getDocumentProvider", "(", ")", ";", "I...
Retrieves the AbstractMarkerAnnontationsModel from the editor. @return AbstractMarkerAnnotatiosnModel from the editor
[ "Retrieves", "the", "AbstractMarkerAnnontationsModel", "from", "the", "editor", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/actions/MarkerRulerAction.java#L214-L225
59,936
spotbugs/spotbugs
eclipsePlugin/src/de/tobject/findbugs/actions/MarkerRulerAction.java
MarkerRulerAction.getDocument
protected IDocument getDocument() { Assert.isNotNull(editor); IDocumentProvider provider = editor.getDocumentProvider(); return provider.getDocument(editor.getEditorInput()); }
java
protected IDocument getDocument() { Assert.isNotNull(editor); IDocumentProvider provider = editor.getDocumentProvider(); return provider.getDocument(editor.getEditorInput()); }
[ "protected", "IDocument", "getDocument", "(", ")", "{", "Assert", ".", "isNotNull", "(", "editor", ")", ";", "IDocumentProvider", "provider", "=", "editor", ".", "getDocumentProvider", "(", ")", ";", "return", "provider", ".", "getDocument", "(", "editor", "."...
Retrieves the document from the editor. @return the document from the editor
[ "Retrieves", "the", "document", "from", "the", "editor", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/actions/MarkerRulerAction.java#L232-L236
59,937
spotbugs/spotbugs
spotbugs/src/gui/main/edu/umd/cs/findbugs/gui2/MainFrame.java
MainFrame.setProjectChanged
public void setProjectChanged(boolean b) { if (curProject == null) { return; } if (projectChanged == b) { return; } projectChanged = b; mainFrameMenu.setSaveMenu(this); getRootPane().putClientProperty(WINDOW_MODIFIED, b); }
java
public void setProjectChanged(boolean b) { if (curProject == null) { return; } if (projectChanged == b) { return; } projectChanged = b; mainFrameMenu.setSaveMenu(this); getRootPane().putClientProperty(WINDOW_MODIFIED, b); }
[ "public", "void", "setProjectChanged", "(", "boolean", "b", ")", "{", "if", "(", "curProject", "==", "null", ")", "{", "return", ";", "}", "if", "(", "projectChanged", "==", "b", ")", "{", "return", ";", "}", "projectChanged", "=", "b", ";", "mainFrame...
Called when something in the project is changed and the change needs to be saved. This method should be called instead of using projectChanged = b.
[ "Called", "when", "something", "in", "the", "project", "is", "changed", "and", "the", "change", "needs", "to", "be", "saved", ".", "This", "method", "should", "be", "called", "instead", "of", "using", "projectChanged", "=", "b", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/gui/main/edu/umd/cs/findbugs/gui2/MainFrame.java#L254-L268
59,938
spotbugs/spotbugs
spotbugs/src/gui/main/edu/umd/cs/findbugs/gui2/MainFrame.java
MainFrame.callOnClose
void callOnClose() { if (projectChanged && !SystemProperties.getBoolean("findbugs.skipSaveChangesWarning")) { Object[] options = { L10N.getLocalString("dlg.save_btn", "Save"), L10N.getLocalString("dlg.dontsave_btn", "Don't Save"), L10N.getL...
java
void callOnClose() { if (projectChanged && !SystemProperties.getBoolean("findbugs.skipSaveChangesWarning")) { Object[] options = { L10N.getLocalString("dlg.save_btn", "Save"), L10N.getLocalString("dlg.dontsave_btn", "Don't Save"), L10N.getL...
[ "void", "callOnClose", "(", ")", "{", "if", "(", "projectChanged", "&&", "!", "SystemProperties", ".", "getBoolean", "(", "\"findbugs.skipSaveChangesWarning\"", ")", ")", "{", "Object", "[", "]", "options", "=", "{", "L10N", ".", "getLocalString", "(", "\"dlg....
This method is called when the application is closing. This is either by the exit menuItem or by clicking on the window's system menu.
[ "This", "method", "is", "called", "when", "the", "application", "is", "closing", ".", "This", "is", "either", "by", "the", "exit", "menuItem", "or", "by", "clicking", "on", "the", "window", "s", "system", "menu", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/gui/main/edu/umd/cs/findbugs/gui2/MainFrame.java#L345-L376
59,939
spotbugs/spotbugs
spotbugs/src/gui/main/edu/umd/cs/findbugs/gui2/MainFrame.java
MainFrame.openAnalysis
public boolean openAnalysis(File f, SaveType saveType) { if (!f.exists() || !f.canRead()) { throw new IllegalArgumentException("Can't read " + f.getPath()); } mainFrameLoadSaveHelper.prepareForFileLoad(f, saveType); mainFrameLoadSaveHelper.loadAnalysis(f); return tr...
java
public boolean openAnalysis(File f, SaveType saveType) { if (!f.exists() || !f.canRead()) { throw new IllegalArgumentException("Can't read " + f.getPath()); } mainFrameLoadSaveHelper.prepareForFileLoad(f, saveType); mainFrameLoadSaveHelper.loadAnalysis(f); return tr...
[ "public", "boolean", "openAnalysis", "(", "File", "f", ",", "SaveType", "saveType", ")", "{", "if", "(", "!", "f", ".", "exists", "(", ")", "||", "!", "f", ".", "canRead", "(", ")", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Can't re...
Opens the analysis. Also clears the source and summary panes. Makes comments enabled false. Sets the saveType and adds the file to the recent menu. @param f @return whether the operation was successful
[ "Opens", "the", "analysis", ".", "Also", "clears", "the", "source", "and", "summary", "panes", ".", "Makes", "comments", "enabled", "false", ".", "Sets", "the", "saveType", "and", "adds", "the", "file", "to", "the", "recent", "menu", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/gui/main/edu/umd/cs/findbugs/gui2/MainFrame.java#L392-L401
59,940
spotbugs/spotbugs
spotbugs/src/gui/main/edu/umd/cs/findbugs/gui2/MainFrame.java
MainFrame.updateTitle
public void updateTitle() { Project project = getProject(); String name = project.getProjectName(); if ((name == null || "".equals(name.trim())) && saveFile != null) { name = saveFile.getAbsolutePath(); } if (name == null) { name = "";//Project.UNNAMED_PRO...
java
public void updateTitle() { Project project = getProject(); String name = project.getProjectName(); if ((name == null || "".equals(name.trim())) && saveFile != null) { name = saveFile.getAbsolutePath(); } if (name == null) { name = "";//Project.UNNAMED_PRO...
[ "public", "void", "updateTitle", "(", ")", "{", "Project", "project", "=", "getProject", "(", ")", ";", "String", "name", "=", "project", ".", "getProjectName", "(", ")", ";", "if", "(", "(", "name", "==", "null", "||", "\"\"", ".", "equals", "(", "n...
Changes the title based on curProject and saveFile.
[ "Changes", "the", "title", "based", "on", "curProject", "and", "saveFile", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/gui/main/edu/umd/cs/findbugs/gui2/MainFrame.java#L642-L657
59,941
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/FindBugsCommandLine.java
FindBugsCommandLine.loadProject
public void loadProject(String arg) throws IOException { Project newProject = Project.readProject(arg); newProject.setConfiguration(project.getConfiguration()); project = newProject; projectLoadedFromFile = true; }
java
public void loadProject(String arg) throws IOException { Project newProject = Project.readProject(arg); newProject.setConfiguration(project.getConfiguration()); project = newProject; projectLoadedFromFile = true; }
[ "public", "void", "loadProject", "(", "String", "arg", ")", "throws", "IOException", "{", "Project", "newProject", "=", "Project", ".", "readProject", "(", "arg", ")", ";", "newProject", ".", "setConfiguration", "(", "project", ".", "getConfiguration", "(", ")...
Load given project file. @param arg name of project file @throws java.io.IOException
[ "Load", "given", "project", "file", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/FindBugsCommandLine.java#L169-L174
59,942
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/AddMessages.java
AddMessages.execute
public void execute() { Iterator<?> elementIter = XMLUtil.selectNodes(document, "/BugCollection/BugInstance").iterator(); Iterator<BugInstance> bugInstanceIter = bugCollection.iterator(); Set<String> bugTypeSet = new HashSet<>(); Set<String> bugCategorySet = new HashSet<>(); Set...
java
public void execute() { Iterator<?> elementIter = XMLUtil.selectNodes(document, "/BugCollection/BugInstance").iterator(); Iterator<BugInstance> bugInstanceIter = bugCollection.iterator(); Set<String> bugTypeSet = new HashSet<>(); Set<String> bugCategorySet = new HashSet<>(); Set...
[ "public", "void", "execute", "(", ")", "{", "Iterator", "<", "?", ">", "elementIter", "=", "XMLUtil", ".", "selectNodes", "(", "document", ",", "\"/BugCollection/BugInstance\"", ")", ".", "iterator", "(", ")", ";", "Iterator", "<", "BugInstance", ">", "bugIn...
Add messages to the dom4j tree.
[ "Add", "messages", "to", "the", "dom4j", "tree", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/AddMessages.java#L65-L106
59,943
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/AddMessages.java
AddMessages.addBugCategories
private void addBugCategories(Set<String> bugCategorySet) { Element root = document.getRootElement(); for (String category : bugCategorySet) { Element element = root.addElement("BugCategory"); element.addAttribute("category", category); Element description = element.a...
java
private void addBugCategories(Set<String> bugCategorySet) { Element root = document.getRootElement(); for (String category : bugCategorySet) { Element element = root.addElement("BugCategory"); element.addAttribute("category", category); Element description = element.a...
[ "private", "void", "addBugCategories", "(", "Set", "<", "String", ">", "bugCategorySet", ")", "{", "Element", "root", "=", "document", ".", "getRootElement", "(", ")", ";", "for", "(", "String", "category", ":", "bugCategorySet", ")", "{", "Element", "elemen...
Add BugCategory elements. @param bugCategorySet all bug categories referenced in the BugCollection
[ "Add", "BugCategory", "elements", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/AddMessages.java#L114-L136
59,944
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/AddMessages.java
AddMessages.addBugCodes
private void addBugCodes(Set<String> bugCodeSet) { Element root = document.getRootElement(); for (String bugCode : bugCodeSet) { Element element = root.addElement("BugCode"); element.addAttribute("abbrev", bugCode); Element description = element.addElement("Descriptio...
java
private void addBugCodes(Set<String> bugCodeSet) { Element root = document.getRootElement(); for (String bugCode : bugCodeSet) { Element element = root.addElement("BugCode"); element.addAttribute("abbrev", bugCode); Element description = element.addElement("Descriptio...
[ "private", "void", "addBugCodes", "(", "Set", "<", "String", ">", "bugCodeSet", ")", "{", "Element", "root", "=", "document", ".", "getRootElement", "(", ")", ";", "for", "(", "String", "bugCode", ":", "bugCodeSet", ")", "{", "Element", "element", "=", "...
Add BugCode elements. @param bugCodeSet all bug codes (abbrevs) referenced in the BugCollection
[ "Add", "BugCode", "elements", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/AddMessages.java#L144-L152
59,945
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/constant/Constant.java
Constant.merge
public static Constant merge(Constant a, Constant b) { if (!a.isConstant() || !b.isConstant()) { return NOT_CONSTANT; } if (a.value.getClass() != b.value.getClass() || !a.value.equals(b.value)) { return NOT_CONSTANT; } return a; }
java
public static Constant merge(Constant a, Constant b) { if (!a.isConstant() || !b.isConstant()) { return NOT_CONSTANT; } if (a.value.getClass() != b.value.getClass() || !a.value.equals(b.value)) { return NOT_CONSTANT; } return a; }
[ "public", "static", "Constant", "merge", "(", "Constant", "a", ",", "Constant", "b", ")", "{", "if", "(", "!", "a", ".", "isConstant", "(", ")", "||", "!", "b", ".", "isConstant", "(", ")", ")", "{", "return", "NOT_CONSTANT", ";", "}", "if", "(", ...
Merge two Constnts. @param a a StaticConstant @param b another StaticConstant @return the merge (dataflow meet) of the two Constants
[ "Merge", "two", "Constnts", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/constant/Constant.java#L105-L113
59,946
spotbugs/spotbugs
eclipsePlugin/src/de/tobject/findbugs/properties/ReportConfigurationTab.java
ReportConfigurationTab.createBugCategoriesGroup
private void createBugCategoriesGroup(Composite parent, final IProject project) { Group checkBoxGroup = new Group(parent, SWT.SHADOW_ETCHED_OUT); checkBoxGroup.setText(getMessage("property.categoriesGroup")); checkBoxGroup.setLayout(new GridLayout(1, true)); checkBoxGroup.setLayoutData(n...
java
private void createBugCategoriesGroup(Composite parent, final IProject project) { Group checkBoxGroup = new Group(parent, SWT.SHADOW_ETCHED_OUT); checkBoxGroup.setText(getMessage("property.categoriesGroup")); checkBoxGroup.setLayout(new GridLayout(1, true)); checkBoxGroup.setLayoutData(n...
[ "private", "void", "createBugCategoriesGroup", "(", "Composite", "parent", ",", "final", "IProject", "project", ")", "{", "Group", "checkBoxGroup", "=", "new", "Group", "(", "parent", ",", "SWT", ".", "SHADOW_ETCHED_OUT", ")", ";", "checkBoxGroup", ".", "setText...
Build list of bug categories to be enabled or disabled. Populates chkEnableBugCategoryList and bugCategoryList fields. @param parent control checkboxes should be added to @param project the project being configured
[ "Build", "list", "of", "bug", "categories", "to", "be", "enabled", "or", "disabled", ".", "Populates", "chkEnableBugCategoryList", "and", "bugCategoryList", "fields", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/properties/ReportConfigurationTab.java#L244-L273
59,947
spotbugs/spotbugs
eclipsePlugin/src/de/tobject/findbugs/properties/ReportConfigurationTab.java
ReportConfigurationTab.syncSelectedCategories
protected void syncSelectedCategories() { ProjectFilterSettings filterSettings = getCurrentProps().getFilterSettings(); for (Button checkBox : chkEnableBugCategoryList) { String category = (String) checkBox.getData(); if (checkBox.getSelection()) { filterSettings....
java
protected void syncSelectedCategories() { ProjectFilterSettings filterSettings = getCurrentProps().getFilterSettings(); for (Button checkBox : chkEnableBugCategoryList) { String category = (String) checkBox.getData(); if (checkBox.getSelection()) { filterSettings....
[ "protected", "void", "syncSelectedCategories", "(", ")", "{", "ProjectFilterSettings", "filterSettings", "=", "getCurrentProps", "(", ")", ".", "getFilterSettings", "(", ")", ";", "for", "(", "Button", "checkBox", ":", "chkEnableBugCategoryList", ")", "{", "String",...
Synchronize selected bug category checkboxes with the current user preferences.
[ "Synchronize", "selected", "bug", "category", "checkboxes", "with", "the", "current", "user", "preferences", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/properties/ReportConfigurationTab.java#L279-L290
59,948
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/util/ClassName.java
ClassName.toSlashedClassName
@SlashedClassName @SuppressFBWarnings("TQ_EXPLICIT_UNKNOWN_SOURCE_VALUE_REACHES_ALWAYS_SINK") public static String toSlashedClassName(@SlashedClassName(when = When.UNKNOWN) String className) { if (className.indexOf('.') >= 0) { return className.replace('.', '/'); } return cla...
java
@SlashedClassName @SuppressFBWarnings("TQ_EXPLICIT_UNKNOWN_SOURCE_VALUE_REACHES_ALWAYS_SINK") public static String toSlashedClassName(@SlashedClassName(when = When.UNKNOWN) String className) { if (className.indexOf('.') >= 0) { return className.replace('.', '/'); } return cla...
[ "@", "SlashedClassName", "@", "SuppressFBWarnings", "(", "\"TQ_EXPLICIT_UNKNOWN_SOURCE_VALUE_REACHES_ALWAYS_SINK\"", ")", "public", "static", "String", "toSlashedClassName", "(", "@", "SlashedClassName", "(", "when", "=", "When", ".", "UNKNOWN", ")", "String", "className"...
Convert class name to slashed format. If the class name is already in slashed format, it is returned unmodified. @param className a class name @return the same class name in slashed format
[ "Convert", "class", "name", "to", "slashed", "format", ".", "If", "the", "class", "name", "is", "already", "in", "slashed", "format", "it", "is", "returned", "unmodified", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/util/ClassName.java#L113-L120
59,949
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/util/ClassName.java
ClassName.toDottedClassName
@DottedClassName @SuppressFBWarnings("TQ_EXPLICIT_UNKNOWN_SOURCE_VALUE_REACHES_NEVER_SINK") public static String toDottedClassName(@SlashedClassName(when = When.UNKNOWN) String className) { if (className.indexOf('/') >= 0) { return className.replace('/', '.'); } return classN...
java
@DottedClassName @SuppressFBWarnings("TQ_EXPLICIT_UNKNOWN_SOURCE_VALUE_REACHES_NEVER_SINK") public static String toDottedClassName(@SlashedClassName(when = When.UNKNOWN) String className) { if (className.indexOf('/') >= 0) { return className.replace('/', '.'); } return classN...
[ "@", "DottedClassName", "@", "SuppressFBWarnings", "(", "\"TQ_EXPLICIT_UNKNOWN_SOURCE_VALUE_REACHES_NEVER_SINK\"", ")", "public", "static", "String", "toDottedClassName", "(", "@", "SlashedClassName", "(", "when", "=", "When", ".", "UNKNOWN", ")", "String", "className", ...
Convert class name to dotted format. If the class name is already in dotted format, it is returned unmodified. @param className a class name @return the same class name in dotted format
[ "Convert", "class", "name", "to", "dotted", "format", ".", "If", "the", "class", "name", "is", "already", "in", "dotted", "format", "it", "is", "returned", "unmodified", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/util/ClassName.java#L130-L137
59,950
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/util/ClassName.java
ClassName.isAnonymous
public static boolean isAnonymous(String className) { int i = className.lastIndexOf('$'); if (i >= 0 && ++i < className.length()) { while(i < className.length()) { if(!Character.isDigit(className.charAt(i))) { return false; } ...
java
public static boolean isAnonymous(String className) { int i = className.lastIndexOf('$'); if (i >= 0 && ++i < className.length()) { while(i < className.length()) { if(!Character.isDigit(className.charAt(i))) { return false; } ...
[ "public", "static", "boolean", "isAnonymous", "(", "String", "className", ")", "{", "int", "i", "=", "className", ".", "lastIndexOf", "(", "'", "'", ")", ";", "if", "(", "i", ">=", "0", "&&", "++", "i", "<", "className", ".", "length", "(", ")", ")...
Does a class name appear to designate an anonymous class? Only the name is analyzed. No classes are loaded or looked up. @param className class name, slashed or dotted, fully qualified or unqualified @return true if className is the name of an anonymous class
[ "Does", "a", "class", "name", "appear", "to", "designate", "an", "anonymous", "class?", "Only", "the", "name", "is", "analyzed", ".", "No", "classes", "are", "loaded", "or", "looked", "up", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/util/ClassName.java#L209-L221
59,951
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/util/ClassName.java
ClassName.extractClassName
public static @SlashedClassName String extractClassName(String originalName) { String name = originalName; if (name.charAt(0) != '[' && name.charAt(name.length() - 1) != ';') { return name; } while (name.charAt(0) == '[') { name = name.substring(1); } ...
java
public static @SlashedClassName String extractClassName(String originalName) { String name = originalName; if (name.charAt(0) != '[' && name.charAt(name.length() - 1) != ';') { return name; } while (name.charAt(0) == '[') { name = name.substring(1); } ...
[ "public", "static", "@", "SlashedClassName", "String", "extractClassName", "(", "String", "originalName", ")", "{", "String", "name", "=", "originalName", ";", "if", "(", "name", ".", "charAt", "(", "0", ")", "!=", "'", "'", "&&", "name", ".", "charAt", ...
Extract a slashed classname from a JVM classname or signature. @param originalName JVM classname or signature @return a slashed classname
[ "Extract", "a", "slashed", "classname", "from", "a", "JVM", "classname", "or", "signature", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/util/ClassName.java#L230-L246
59,952
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/jsr305/TypeQualifierAnnotation.java
TypeQualifierAnnotation.combineReturnTypeAnnotations
public static @CheckForNull TypeQualifierAnnotation combineReturnTypeAnnotations(TypeQualifierAnnotation a, TypeQualifierAnnotation b) { return combineAnnotations(a, b, combineReturnValueMatrix); }
java
public static @CheckForNull TypeQualifierAnnotation combineReturnTypeAnnotations(TypeQualifierAnnotation a, TypeQualifierAnnotation b) { return combineAnnotations(a, b, combineReturnValueMatrix); }
[ "public", "static", "@", "CheckForNull", "TypeQualifierAnnotation", "combineReturnTypeAnnotations", "(", "TypeQualifierAnnotation", "a", ",", "TypeQualifierAnnotation", "b", ")", "{", "return", "combineAnnotations", "(", "a", ",", "b", ",", "combineReturnValueMatrix", ")"...
Combine return type annotations. @param a a TypeQualifierAnnotation used on a return value @param b another TypeQualifierAnnotation used on a return value @return combined return type annotation that is at least as narrow as both <code>a</code> or <code>b</code>, or null if no such TypeQualifierAnnotation exists
[ "Combine", "return", "type", "annotations", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/jsr305/TypeQualifierAnnotation.java#L120-L123
59,953
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/PackageMemberAnnotation.java
PackageMemberAnnotation.getPackageName
public final @DottedClassName String getPackageName() { int lastDot = className.lastIndexOf('.'); if (lastDot < 0) { return ""; } else { return className.substring(0, lastDot); } }
java
public final @DottedClassName String getPackageName() { int lastDot = className.lastIndexOf('.'); if (lastDot < 0) { return ""; } else { return className.substring(0, lastDot); } }
[ "public", "final", "@", "DottedClassName", "String", "getPackageName", "(", ")", "{", "int", "lastDot", "=", "className", ".", "lastIndexOf", "(", "'", "'", ")", ";", "if", "(", "lastDot", "<", "0", ")", "{", "return", "\"\"", ";", "}", "else", "{", ...
Get the package name.
[ "Get", "the", "package", "name", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/PackageMemberAnnotation.java#L117-L125
59,954
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/PackageMemberAnnotation.java
PackageMemberAnnotation.removePackageName
protected static String removePackageName(String typeName) { int index = typeName.lastIndexOf('.'); if (index >= 0) { typeName = typeName.substring(index + 1); } return typeName; }
java
protected static String removePackageName(String typeName) { int index = typeName.lastIndexOf('.'); if (index >= 0) { typeName = typeName.substring(index + 1); } return typeName; }
[ "protected", "static", "String", "removePackageName", "(", "String", "typeName", ")", "{", "int", "index", "=", "typeName", ".", "lastIndexOf", "(", "'", "'", ")", ";", "if", "(", "index", ">=", "0", ")", "{", "typeName", "=", "typeName", ".", "substring...
Shorten a type name by removing the package name
[ "Shorten", "a", "type", "name", "by", "removing", "the", "package", "name" ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/PackageMemberAnnotation.java#L193-L199
59,955
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/npe/IsNullValueFrame.java
IsNullValueFrame.downgradeOnControlSplit
public void downgradeOnControlSplit() { final int numSlots = getNumSlots(); for (int i = 0; i < numSlots; ++i) { IsNullValue value = getValue(i); value = value.downgradeOnControlSplit(); setValue(i, value); } if (knownValueMap != null) { f...
java
public void downgradeOnControlSplit() { final int numSlots = getNumSlots(); for (int i = 0; i < numSlots; ++i) { IsNullValue value = getValue(i); value = value.downgradeOnControlSplit(); setValue(i, value); } if (knownValueMap != null) { f...
[ "public", "void", "downgradeOnControlSplit", "(", ")", "{", "final", "int", "numSlots", "=", "getNumSlots", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "numSlots", ";", "++", "i", ")", "{", "IsNullValue", "value", "=", "getValue", ...
Downgrade all NSP values in frame. Should be called when a non-exception control split occurs.
[ "Downgrade", "all", "NSP", "values", "in", "frame", ".", "Should", "be", "called", "when", "a", "non", "-", "exception", "control", "split", "occurs", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/npe/IsNullValueFrame.java#L294-L307
59,956
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/visitclass/PrintClass.java
PrintClass.printCode
public static void printCode(Method[] methods) { for (Method m : methods) { System.out.println(m); Code code = m.getCode(); if (code != null) { System.out.println(code); } } }
java
public static void printCode(Method[] methods) { for (Method m : methods) { System.out.println(m); Code code = m.getCode(); if (code != null) { System.out.println(code); } } }
[ "public", "static", "void", "printCode", "(", "Method", "[", "]", "methods", ")", "{", "for", "(", "Method", "m", ":", "methods", ")", "{", "System", ".", "out", ".", "println", "(", "m", ")", ";", "Code", "code", "=", "m", ".", "getCode", "(", "...
Dump the disassembled code of all methods in the class.
[ "Dump", "the", "disassembled", "code", "of", "all", "methods", "in", "the", "class", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/visitclass/PrintClass.java#L173-L182
59,957
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/type/StandardTypeMerger.java
StandardTypeMerger.isReferenceType
protected boolean isReferenceType(byte type) { return type == Const.T_OBJECT || type == Const.T_ARRAY || type == T_NULL || type == T_EXCEPTION; }
java
protected boolean isReferenceType(byte type) { return type == Const.T_OBJECT || type == Const.T_ARRAY || type == T_NULL || type == T_EXCEPTION; }
[ "protected", "boolean", "isReferenceType", "(", "byte", "type", ")", "{", "return", "type", "==", "Const", ".", "T_OBJECT", "||", "type", "==", "Const", ".", "T_ARRAY", "||", "type", "==", "T_NULL", "||", "type", "==", "T_EXCEPTION", ";", "}" ]
Determine if the given typecode refers to a reference type. This implementation just checks that the type code is T_OBJECT, T_ARRAY, T_NULL, or T_EXCEPTION. Subclasses should override this if they have defined new object types with different type codes.
[ "Determine", "if", "the", "given", "typecode", "refers", "to", "a", "reference", "type", ".", "This", "implementation", "just", "checks", "that", "the", "type", "code", "is", "T_OBJECT", "T_ARRAY", "T_NULL", "or", "T_EXCEPTION", ".", "Subclasses", "should", "o...
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/type/StandardTypeMerger.java#L119-L121
59,958
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/type/StandardTypeMerger.java
StandardTypeMerger.mergeReferenceTypes
protected ReferenceType mergeReferenceTypes(ReferenceType aRef, ReferenceType bRef) throws DataflowAnalysisException { if (aRef.equals(bRef)) { return aRef; } byte aType = aRef.getType(); byte bType = bRef.getType(); try { // Special case: ExceptionObjectT...
java
protected ReferenceType mergeReferenceTypes(ReferenceType aRef, ReferenceType bRef) throws DataflowAnalysisException { if (aRef.equals(bRef)) { return aRef; } byte aType = aRef.getType(); byte bType = bRef.getType(); try { // Special case: ExceptionObjectT...
[ "protected", "ReferenceType", "mergeReferenceTypes", "(", "ReferenceType", "aRef", ",", "ReferenceType", "bRef", ")", "throws", "DataflowAnalysisException", "{", "if", "(", "aRef", ".", "equals", "(", "bRef", ")", ")", "{", "return", "aRef", ";", "}", "byte", ...
Default implementation of merging reference types. This just returns the first common superclass, which is compliant with the JVM Spec. Subclasses may override this method in order to implement extended type rules. @param aRef a ReferenceType @param bRef a ReferenceType @return the merged Type
[ "Default", "implementation", "of", "merging", "reference", "types", ".", "This", "just", "returns", "the", "first", "common", "superclass", "which", "is", "compliant", "with", "the", "JVM", "Spec", ".", "Subclasses", "may", "override", "this", "method", "in", ...
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/type/StandardTypeMerger.java#L160-L232
59,959
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/config/UserPreferences.java
UserPreferences.read
public void read() { File prefFile = new File(SystemProperties.getProperty("user.home"), PREF_FILE_NAME); if (!prefFile.exists() || !prefFile.isFile()) { return; } try { read(new FileInputStream(prefFile)); } catch (IOException e) { // Ignore -...
java
public void read() { File prefFile = new File(SystemProperties.getProperty("user.home"), PREF_FILE_NAME); if (!prefFile.exists() || !prefFile.isFile()) { return; } try { read(new FileInputStream(prefFile)); } catch (IOException e) { // Ignore -...
[ "public", "void", "read", "(", ")", "{", "File", "prefFile", "=", "new", "File", "(", "SystemProperties", ".", "getProperty", "(", "\"user.home\"", ")", ",", "PREF_FILE_NAME", ")", ";", "if", "(", "!", "prefFile", ".", "exists", "(", ")", "||", "!", "p...
Read persistent global UserPreferences from file in the user's home directory.
[ "Read", "persistent", "global", "UserPreferences", "from", "file", "in", "the", "user", "s", "home", "directory", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/config/UserPreferences.java#L157-L167
59,960
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/config/UserPreferences.java
UserPreferences.write
public void write() { try { File prefFile = new File(SystemProperties.getProperty("user.home"), PREF_FILE_NAME); write(new FileOutputStream(prefFile)); } catch (IOException e) { if (FindBugs.DEBUG) { e.printStackTrace(); // Ignore } ...
java
public void write() { try { File prefFile = new File(SystemProperties.getProperty("user.home"), PREF_FILE_NAME); write(new FileOutputStream(prefFile)); } catch (IOException e) { if (FindBugs.DEBUG) { e.printStackTrace(); // Ignore } ...
[ "public", "void", "write", "(", ")", "{", "try", "{", "File", "prefFile", "=", "new", "File", "(", "SystemProperties", ".", "getProperty", "(", "\"user.home\"", ")", ",", "PREF_FILE_NAME", ")", ";", "write", "(", "new", "FileOutputStream", "(", "prefFile", ...
Write persistent global UserPreferences to file in user's home directory.
[ "Write", "persistent", "global", "UserPreferences", "to", "file", "in", "user", "s", "home", "directory", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/config/UserPreferences.java#L269-L278
59,961
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/config/UserPreferences.java
UserPreferences.useProject
public void useProject(String projectName) { removeProject(projectName); recentProjectsList.addFirst(projectName); while (recentProjectsList.size() > MAX_RECENT_FILES) { recentProjectsList.removeLast(); } }
java
public void useProject(String projectName) { removeProject(projectName); recentProjectsList.addFirst(projectName); while (recentProjectsList.size() > MAX_RECENT_FILES) { recentProjectsList.removeLast(); } }
[ "public", "void", "useProject", "(", "String", "projectName", ")", "{", "removeProject", "(", "projectName", ")", ";", "recentProjectsList", ".", "addFirst", "(", "projectName", ")", ";", "while", "(", "recentProjectsList", ".", "size", "(", ")", ">", "MAX_REC...
Add given project filename to the front of the recently-used project list. @param projectName project filename
[ "Add", "given", "project", "filename", "to", "the", "front", "of", "the", "recently", "-", "used", "project", "list", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/config/UserPreferences.java#L350-L356
59,962
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/config/UserPreferences.java
UserPreferences.removeProject
public void removeProject(String projectName) { // It should only be in list once (usually in slot 0) but check entire // list... Iterator<String> it = recentProjectsList.iterator(); while (it.hasNext()) { // LinkedList, so remove() via iterator is faster than // ...
java
public void removeProject(String projectName) { // It should only be in list once (usually in slot 0) but check entire // list... Iterator<String> it = recentProjectsList.iterator(); while (it.hasNext()) { // LinkedList, so remove() via iterator is faster than // ...
[ "public", "void", "removeProject", "(", "String", "projectName", ")", "{", "// It should only be in list once (usually in slot 0) but check entire", "// list...", "Iterator", "<", "String", ">", "it", "=", "recentProjectsList", ".", "iterator", "(", ")", ";", "while", "...
Remove project filename from the recently-used project list. @param projectName project filename
[ "Remove", "project", "filename", "from", "the", "recently", "-", "used", "project", "list", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/config/UserPreferences.java#L364-L375
59,963
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/config/UserPreferences.java
UserPreferences.enableAllDetectors
public void enableAllDetectors(boolean enable) { detectorEnablementMap.clear(); Collection<Plugin> allPlugins = Plugin.getAllPlugins(); for (Plugin plugin : allPlugins) { for (DetectorFactory factory : plugin.getDetectorFactories()) { detectorEnablementMap.put(factor...
java
public void enableAllDetectors(boolean enable) { detectorEnablementMap.clear(); Collection<Plugin> allPlugins = Plugin.getAllPlugins(); for (Plugin plugin : allPlugins) { for (DetectorFactory factory : plugin.getDetectorFactories()) { detectorEnablementMap.put(factor...
[ "public", "void", "enableAllDetectors", "(", "boolean", "enable", ")", "{", "detectorEnablementMap", ".", "clear", "(", ")", ";", "Collection", "<", "Plugin", ">", "allPlugins", "=", "Plugin", ".", "getAllPlugins", "(", ")", ";", "for", "(", "Plugin", "plugi...
Enable or disable all known Detectors. @param enable true if all detectors should be enabled, false if they should all be disabled
[ "Enable", "or", "disable", "all", "known", "Detectors", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/config/UserPreferences.java#L417-L426
59,964
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/config/UserPreferences.java
UserPreferences.readProperties
private static Map<String, Boolean> readProperties(Properties props, String keyPrefix) { Map<String, Boolean> filters = new TreeMap<>(); int counter = 0; boolean keyFound = true; while (keyFound) { String property = props.getProperty(keyPrefix + counter); if (prop...
java
private static Map<String, Boolean> readProperties(Properties props, String keyPrefix) { Map<String, Boolean> filters = new TreeMap<>(); int counter = 0; boolean keyFound = true; while (keyFound) { String property = props.getProperty(keyPrefix + counter); if (prop...
[ "private", "static", "Map", "<", "String", ",", "Boolean", ">", "readProperties", "(", "Properties", "props", ",", "String", "keyPrefix", ")", "{", "Map", "<", "String", ",", "Boolean", ">", "filters", "=", "new", "TreeMap", "<>", "(", ")", ";", "int", ...
Helper method to read array of strings out of the properties file, using a Findbugs style format. @param props The properties file to read the array from. @param keyPrefix The key prefix of the array. @return The array of Strings, or an empty array if no values exist.
[ "Helper", "method", "to", "read", "array", "of", "strings", "out", "of", "the", "properties", "file", "using", "a", "Findbugs", "style", "format", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/config/UserPreferences.java#L659-L681
59,965
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/config/UserPreferences.java
UserPreferences.writeProperties
private static void writeProperties(Properties props, String keyPrefix, Map<String, Boolean> filters) { int counter = 0; Set<Entry<String, Boolean>> entrySet = filters.entrySet(); for (Entry<String, Boolean> entry : entrySet) { props.setProperty(keyPrefix + counter, entry.getKey() + ...
java
private static void writeProperties(Properties props, String keyPrefix, Map<String, Boolean> filters) { int counter = 0; Set<Entry<String, Boolean>> entrySet = filters.entrySet(); for (Entry<String, Boolean> entry : entrySet) { props.setProperty(keyPrefix + counter, entry.getKey() + ...
[ "private", "static", "void", "writeProperties", "(", "Properties", "props", ",", "String", "keyPrefix", ",", "Map", "<", "String", ",", "Boolean", ">", "filters", ")", "{", "int", "counter", "=", "0", ";", "Set", "<", "Entry", "<", "String", ",", "Boolea...
Helper method to write array of strings out of the properties file, using a Findbugs style format. @param props The properties file to write the array to. @param keyPrefix The key prefix of the array. @param filters The filters array to write to the properties.
[ "Helper", "method", "to", "write", "array", "of", "strings", "out", "of", "the", "properties", "file", "using", "a", "Findbugs", "style", "format", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/config/UserPreferences.java#L694-L712
59,966
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/config/UserPreferences.java
UserPreferences.getAnalysisFeatureSettings
public AnalysisFeatureSetting[] getAnalysisFeatureSettings() { if (EFFORT_DEFAULT.equals(effort)) { return FindBugs.DEFAULT_EFFORT; } else if (EFFORT_MIN.equals(effort)) { return FindBugs.MIN_EFFORT; } return FindBugs.MAX_EFFORT; }
java
public AnalysisFeatureSetting[] getAnalysisFeatureSettings() { if (EFFORT_DEFAULT.equals(effort)) { return FindBugs.DEFAULT_EFFORT; } else if (EFFORT_MIN.equals(effort)) { return FindBugs.MIN_EFFORT; } return FindBugs.MAX_EFFORT; }
[ "public", "AnalysisFeatureSetting", "[", "]", "getAnalysisFeatureSettings", "(", ")", "{", "if", "(", "EFFORT_DEFAULT", ".", "equals", "(", "effort", ")", ")", "{", "return", "FindBugs", ".", "DEFAULT_EFFORT", ";", "}", "else", "if", "(", "EFFORT_MIN", ".", ...
Returns the effort level as an array of feature settings as expected by FindBugs. @return The array of feature settings corresponding to the current effort setting.
[ "Returns", "the", "effort", "level", "as", "an", "array", "of", "feature", "settings", "as", "expected", "by", "FindBugs", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/config/UserPreferences.java#L721-L728
59,967
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/RepositoryClassParser.java
RepositoryClassParser.parse
public JavaClass parse() throws IOException { JavaClass jclass = classParser.parse(); Repository.addClass(jclass); return jclass; }
java
public JavaClass parse() throws IOException { JavaClass jclass = classParser.parse(); Repository.addClass(jclass); return jclass; }
[ "public", "JavaClass", "parse", "(", ")", "throws", "IOException", "{", "JavaClass", "jclass", "=", "classParser", ".", "parse", "(", ")", ";", "Repository", ".", "addClass", "(", "jclass", ")", ";", "return", "jclass", ";", "}" ]
Parse the class file into a JavaClass object. If successful, the new JavaClass is entered into the Repository. @return the parsed JavaClass @throws IOException if the class cannot be parsed
[ "Parse", "the", "class", "file", "into", "a", "JavaClass", "object", ".", "If", "successful", "the", "new", "JavaClass", "is", "entered", "into", "the", "Repository", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/RepositoryClassParser.java#L79-L83
59,968
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/SourceFinder.java
SourceFinder.setSourceBaseList
void setSourceBaseList(Iterable<String> sourceBaseList) { for (String repos : sourceBaseList) { if (repos.endsWith(".zip") || repos.endsWith(".jar") || repos.endsWith(".z0p.gz")) { // Zip or jar archive try { if (repos.startsWith("http:") || repos....
java
void setSourceBaseList(Iterable<String> sourceBaseList) { for (String repos : sourceBaseList) { if (repos.endsWith(".zip") || repos.endsWith(".jar") || repos.endsWith(".z0p.gz")) { // Zip or jar archive try { if (repos.startsWith("http:") || repos....
[ "void", "setSourceBaseList", "(", "Iterable", "<", "String", ">", "sourceBaseList", ")", "{", "for", "(", "String", "repos", ":", "sourceBaseList", ")", "{", "if", "(", "repos", ".", "endsWith", "(", "\".zip\"", ")", "||", "repos", ".", "endsWith", "(", ...
Set the list of source directories.
[ "Set", "the", "list", "of", "source", "directories", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/SourceFinder.java#L403-L428
59,969
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/SourceFinder.java
SourceFinder.openSource
public InputStream openSource(String packageName, String fileName) throws IOException { SourceFile sourceFile = findSourceFile(packageName, fileName); return sourceFile.getInputStream(); }
java
public InputStream openSource(String packageName, String fileName) throws IOException { SourceFile sourceFile = findSourceFile(packageName, fileName); return sourceFile.getInputStream(); }
[ "public", "InputStream", "openSource", "(", "String", "packageName", ",", "String", "fileName", ")", "throws", "IOException", "{", "SourceFile", "sourceFile", "=", "findSourceFile", "(", "packageName", ",", "fileName", ")", ";", "return", "sourceFile", ".", "getIn...
Open an input stream on a source file in given package. @param packageName the name of the package containing the class whose source file is given @param fileName the unqualified name of the source file @return an InputStream on the source file @throws IOException if a matching source file cannot be found
[ "Open", "an", "input", "stream", "on", "a", "source", "file", "in", "given", "package", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/SourceFinder.java#L442-L445
59,970
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/SourceFinder.java
SourceFinder.findSourceFile
public SourceFile findSourceFile(String packageName, String fileName) throws IOException { // On windows the fileName specification is different between a file in // a directory tree, and a // file in a zip file. In a directory tree the separator used is '\', // while in a zip it's '/' ...
java
public SourceFile findSourceFile(String packageName, String fileName) throws IOException { // On windows the fileName specification is different between a file in // a directory tree, and a // file in a zip file. In a directory tree the separator used is '\', // while in a zip it's '/' ...
[ "public", "SourceFile", "findSourceFile", "(", "String", "packageName", ",", "String", "fileName", ")", "throws", "IOException", "{", "// On windows the fileName specification is different between a file in", "// a directory tree, and a", "// file in a zip file. In a directory tree the...
Open a source file in given package. @param packageName the name of the package containing the class whose source file is given @param fileName the unqualified name of the source file @return the source file @throws IOException if a matching source file cannot be found
[ "Open", "a", "source", "file", "in", "given", "package", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/SourceFinder.java#L468-L516
59,971
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/FuzzyBugComparator.java
FuzzyBugComparator.compareSourceLines
public int compareSourceLines(BugCollection lhsCollection, BugCollection rhsCollection, SourceLineAnnotation lhs, SourceLineAnnotation rhs) { if (lhs == null || rhs == null) { return compareNullElements(lhs, rhs); } // Classes must match fuzzily. int cmp = compar...
java
public int compareSourceLines(BugCollection lhsCollection, BugCollection rhsCollection, SourceLineAnnotation lhs, SourceLineAnnotation rhs) { if (lhs == null || rhs == null) { return compareNullElements(lhs, rhs); } // Classes must match fuzzily. int cmp = compar...
[ "public", "int", "compareSourceLines", "(", "BugCollection", "lhsCollection", ",", "BugCollection", "rhsCollection", ",", "SourceLineAnnotation", "lhs", ",", "SourceLineAnnotation", "rhs", ")", "{", "if", "(", "lhs", "==", "null", "||", "rhs", "==", "null", ")", ...
Compare source line annotations. @param rhsCollection lhs BugCollection @param lhsCollection rhs BugCollection @param lhs a SourceLineAnnotation @param rhs another SourceLineAnnotation @return comparison of lhs and rhs
[ "Compare", "source", "line", "annotations", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/FuzzyBugComparator.java#L298-L311
59,972
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/xml/QuoteMetaCharacters.java
QuoteMetaCharacters.process
public void process() throws IOException { int pos = 0; do { int meta = findNextMeta(text, pos); if (meta >= 0) { emitLiteral(text.substring(pos, meta)); emitLiteral(map.getReplacement(text.substring(meta, meta + 1))); pos = meta + ...
java
public void process() throws IOException { int pos = 0; do { int meta = findNextMeta(text, pos); if (meta >= 0) { emitLiteral(text.substring(pos, meta)); emitLiteral(map.getReplacement(text.substring(meta, meta + 1))); pos = meta + ...
[ "public", "void", "process", "(", ")", "throws", "IOException", "{", "int", "pos", "=", "0", ";", "do", "{", "int", "meta", "=", "findNextMeta", "(", "text", ",", "pos", ")", ";", "if", "(", "meta", ">=", "0", ")", "{", "emitLiteral", "(", "text", ...
Quote metacharacters in the text.
[ "Quote", "metacharacters", "in", "the", "text", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/xml/QuoteMetaCharacters.java#L60-L73
59,973
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/classfile/ReflectionDatabaseFactory.java
ReflectionDatabaseFactory.createUsingConstructor
private E createUsingConstructor() throws CheckedAnalysisException { Constructor<E> constructor; try { constructor = databaseClass.getConstructor(new Class[0]); } catch (NoSuchMethodException e) { return null; } try { return constructor.newIns...
java
private E createUsingConstructor() throws CheckedAnalysisException { Constructor<E> constructor; try { constructor = databaseClass.getConstructor(new Class[0]); } catch (NoSuchMethodException e) { return null; } try { return constructor.newIns...
[ "private", "E", "createUsingConstructor", "(", ")", "throws", "CheckedAnalysisException", "{", "Constructor", "<", "E", ">", "constructor", ";", "try", "{", "constructor", "=", "databaseClass", ".", "getConstructor", "(", "new", "Class", "[", "0", "]", ")", ";...
Try to create the database using a no-arg constructor. @return the database, or null if there is no no-arg constructor @throws CheckedAnalysisException
[ "Try", "to", "create", "the", "database", "using", "a", "no", "-", "arg", "constructor", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/classfile/ReflectionDatabaseFactory.java#L104-L121
59,974
spotbugs/spotbugs
eclipsePlugin/src/de/tobject/findbugs/actions/ClearMarkersAction.java
ClearMarkersAction.work
@Override protected void work(final IWorkbenchPart part, IResource resource, final List<WorkItem> resources) { FindBugsJob clearMarkersJob = new ClearMarkersJob(resource, resources); clearMarkersJob.addJobChangeListener(new JobChangeAdapter() { @Override public void done(IJob...
java
@Override protected void work(final IWorkbenchPart part, IResource resource, final List<WorkItem> resources) { FindBugsJob clearMarkersJob = new ClearMarkersJob(resource, resources); clearMarkersJob.addJobChangeListener(new JobChangeAdapter() { @Override public void done(IJob...
[ "@", "Override", "protected", "void", "work", "(", "final", "IWorkbenchPart", "part", ",", "IResource", "resource", ",", "final", "List", "<", "WorkItem", ">", "resources", ")", "{", "FindBugsJob", "clearMarkersJob", "=", "new", "ClearMarkersJob", "(", "resource...
Clear the FindBugs markers on each project in the given selection, displaying a progress monitor.
[ "Clear", "the", "FindBugs", "markers", "on", "each", "project", "in", "the", "given", "selection", "displaying", "a", "progress", "monitor", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/actions/ClearMarkersAction.java#L49-L59
59,975
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/Frame.java
Frame.pushValue
public void pushValue(ValueType value) { if (VERIFY_INTEGRITY && value == null) { throw new IllegalArgumentException(); } if (!isValid()) { throw new IllegalStateException("accessing top or bottom frame"); } slotList.add(value); }
java
public void pushValue(ValueType value) { if (VERIFY_INTEGRITY && value == null) { throw new IllegalArgumentException(); } if (!isValid()) { throw new IllegalStateException("accessing top or bottom frame"); } slotList.add(value); }
[ "public", "void", "pushValue", "(", "ValueType", "value", ")", "{", "if", "(", "VERIFY_INTEGRITY", "&&", "value", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", ")", ";", "}", "if", "(", "!", "isValid", "(", ")", ")", "{", "th...
Push a value onto the Java operand stack. @param value the ValueType to push
[ "Push", "a", "value", "onto", "the", "Java", "operand", "stack", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/Frame.java#L174-L182
59,976
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/Frame.java
Frame.popValue
public ValueType popValue() throws DataflowAnalysisException { if (!isValid()) { throw new DataflowAnalysisException("accessing top or bottom frame"); } if (slotList.size() == numLocals) { throw new DataflowAnalysisException("operand stack empty"); } retur...
java
public ValueType popValue() throws DataflowAnalysisException { if (!isValid()) { throw new DataflowAnalysisException("accessing top or bottom frame"); } if (slotList.size() == numLocals) { throw new DataflowAnalysisException("operand stack empty"); } retur...
[ "public", "ValueType", "popValue", "(", ")", "throws", "DataflowAnalysisException", "{", "if", "(", "!", "isValid", "(", ")", ")", "{", "throw", "new", "DataflowAnalysisException", "(", "\"accessing top or bottom frame\"", ")", ";", "}", "if", "(", "slotList", "...
Pop a value off of the Java operand stack. @return the value that was popped @throws DataflowAnalysisException if the Java operand stack is empty
[ "Pop", "a", "value", "off", "of", "the", "Java", "operand", "stack", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/Frame.java#L191-L199
59,977
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/Frame.java
Frame.getTopValue
public ValueType getTopValue() throws DataflowAnalysisException { if (!isValid()) { throw new DataflowAnalysisException("accessing top or bottom frame"); } assert slotList.size() >= numLocals; if (slotList.size() == numLocals) { throw new DataflowAnalysisException...
java
public ValueType getTopValue() throws DataflowAnalysisException { if (!isValid()) { throw new DataflowAnalysisException("accessing top or bottom frame"); } assert slotList.size() >= numLocals; if (slotList.size() == numLocals) { throw new DataflowAnalysisException...
[ "public", "ValueType", "getTopValue", "(", ")", "throws", "DataflowAnalysisException", "{", "if", "(", "!", "isValid", "(", ")", ")", "{", "throw", "new", "DataflowAnalysisException", "(", "\"accessing top or bottom frame\"", ")", ";", "}", "assert", "slotList", "...
Get the value on the top of the Java operand stack. @throws DataflowAnalysisException if the Java operand stack is empty
[ "Get", "the", "value", "on", "the", "top", "of", "the", "Java", "operand", "stack", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/Frame.java#L207-L216
59,978
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/Frame.java
Frame.getTopStackWords
public void getTopStackWords(ValueType[] valueList) throws DataflowAnalysisException { int stackDepth = getStackDepth(); if (valueList.length > stackDepth) { throw new DataflowAnalysisException("not enough values on stack"); } int numSlots = slotList.size(); for (int ...
java
public void getTopStackWords(ValueType[] valueList) throws DataflowAnalysisException { int stackDepth = getStackDepth(); if (valueList.length > stackDepth) { throw new DataflowAnalysisException("not enough values on stack"); } int numSlots = slotList.size(); for (int ...
[ "public", "void", "getTopStackWords", "(", "ValueType", "[", "]", "valueList", ")", "throws", "DataflowAnalysisException", "{", "int", "stackDepth", "=", "getStackDepth", "(", ")", ";", "if", "(", "valueList", ".", "length", ">", "stackDepth", ")", "{", "throw...
Get the values on the top of the Java operand stack. The top stack item is placed at the end of the array, so that to restore the values to the stack, you would push them in the order they appear in the array.
[ "Get", "the", "values", "on", "the", "top", "of", "the", "Java", "operand", "stack", ".", "The", "top", "stack", "item", "is", "placed", "at", "the", "end", "of", "the", "array", "so", "that", "to", "restore", "the", "values", "to", "the", "stack", "...
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/Frame.java#L223-L232
59,979
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/Frame.java
Frame.getStackValue
public ValueType getStackValue(int loc) throws DataflowAnalysisException { if (!isValid()) { throw new DataflowAnalysisException("Accessing TOP or BOTTOM frame!"); } int stackDepth = getStackDepth(); if (loc >= stackDepth) { throw new DataflowAnalysisException("no...
java
public ValueType getStackValue(int loc) throws DataflowAnalysisException { if (!isValid()) { throw new DataflowAnalysisException("Accessing TOP or BOTTOM frame!"); } int stackDepth = getStackDepth(); if (loc >= stackDepth) { throw new DataflowAnalysisException("no...
[ "public", "ValueType", "getStackValue", "(", "int", "loc", ")", "throws", "DataflowAnalysisException", "{", "if", "(", "!", "isValid", "(", ")", ")", "{", "throw", "new", "DataflowAnalysisException", "(", "\"Accessing TOP or BOTTOM frame!\"", ")", ";", "}", "int",...
Get a value on the operand stack. @param loc the stack location, counting downwards from the top (location 0)
[ "Get", "a", "value", "on", "the", "operand", "stack", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/Frame.java#L241-L254
59,980
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/Frame.java
Frame.getStackLocation
public int getStackLocation(int loc) throws DataflowAnalysisException { int stackDepth = getStackDepth(); if (loc >= stackDepth) { throw new DataflowAnalysisException("not enough values on stack: access=" + loc + ", avail=" + stackDepth); } return slotList.size() - (loc + 1);...
java
public int getStackLocation(int loc) throws DataflowAnalysisException { int stackDepth = getStackDepth(); if (loc >= stackDepth) { throw new DataflowAnalysisException("not enough values on stack: access=" + loc + ", avail=" + stackDepth); } return slotList.size() - (loc + 1);...
[ "public", "int", "getStackLocation", "(", "int", "loc", ")", "throws", "DataflowAnalysisException", "{", "int", "stackDepth", "=", "getStackDepth", "(", ")", ";", "if", "(", "loc", ">=", "stackDepth", ")", "{", "throw", "new", "DataflowAnalysisException", "(", ...
Get a the location in the frame of a value on the operand stack. @param loc the stack location, counting downwards from the top (location 0)
[ "Get", "a", "the", "location", "in", "the", "frame", "of", "a", "value", "on", "the", "operand", "stack", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/Frame.java#L263-L269
59,981
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/Frame.java
Frame.getInstanceSlot
public int getInstanceSlot(Instruction ins, ConstantPoolGen cpg) throws DataflowAnalysisException { if (!isValid()) { throw new DataflowAnalysisException("Accessing invalid frame at " + ins); } int numConsumed = ins.consumeStack(cpg); if (numConsumed == Const.UNPREDICTABLE) {...
java
public int getInstanceSlot(Instruction ins, ConstantPoolGen cpg) throws DataflowAnalysisException { if (!isValid()) { throw new DataflowAnalysisException("Accessing invalid frame at " + ins); } int numConsumed = ins.consumeStack(cpg); if (numConsumed == Const.UNPREDICTABLE) {...
[ "public", "int", "getInstanceSlot", "(", "Instruction", "ins", ",", "ConstantPoolGen", "cpg", ")", "throws", "DataflowAnalysisException", "{", "if", "(", "!", "isValid", "(", ")", ")", "{", "throw", "new", "DataflowAnalysisException", "(", "\"Accessing invalid frame...
Get the slot the object instance referred to by given instruction is located in. @param ins the Instruction @param cpg the ConstantPoolGen for the method @return stack slot the object instance is in @throws DataflowAnalysisException
[ "Get", "the", "slot", "the", "object", "instance", "referred", "to", "by", "given", "instruction", "is", "located", "in", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/Frame.java#L324-L336
59,982
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/Frame.java
Frame.getNumArguments
public int getNumArguments(InvokeInstruction ins, ConstantPoolGen cpg) { SignatureParser parser = new SignatureParser(ins.getSignature(cpg)); return parser.getNumParameters(); }
java
public int getNumArguments(InvokeInstruction ins, ConstantPoolGen cpg) { SignatureParser parser = new SignatureParser(ins.getSignature(cpg)); return parser.getNumParameters(); }
[ "public", "int", "getNumArguments", "(", "InvokeInstruction", "ins", ",", "ConstantPoolGen", "cpg", ")", "{", "SignatureParser", "parser", "=", "new", "SignatureParser", "(", "ins", ".", "getSignature", "(", "cpg", ")", ")", ";", "return", "parser", ".", "getN...
Get the number of arguments passed to given method invocation. @param ins the method invocation instruction @param cpg the ConstantPoolGen for the class containing the method @return number of arguments; note that this excludes the object instance for instance methods
[ "Get", "the", "number", "of", "arguments", "passed", "to", "given", "method", "invocation", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/Frame.java#L348-L351
59,983
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/Frame.java
Frame.getNumArgumentsIncludingObjectInstance
public int getNumArgumentsIncludingObjectInstance(InvokeInstruction ins, ConstantPoolGen cpg) throws DataflowAnalysisException { int numConsumed = ins.consumeStack(cpg); if (numConsumed == Const.UNPREDICTABLE) { throw new DataflowAnalysisException("Unpredictable stack consumption...
java
public int getNumArgumentsIncludingObjectInstance(InvokeInstruction ins, ConstantPoolGen cpg) throws DataflowAnalysisException { int numConsumed = ins.consumeStack(cpg); if (numConsumed == Const.UNPREDICTABLE) { throw new DataflowAnalysisException("Unpredictable stack consumption...
[ "public", "int", "getNumArgumentsIncludingObjectInstance", "(", "InvokeInstruction", "ins", ",", "ConstantPoolGen", "cpg", ")", "throws", "DataflowAnalysisException", "{", "int", "numConsumed", "=", "ins", ".", "consumeStack", "(", "cpg", ")", ";", "if", "(", "numCo...
Get the number of arguments passed to given method invocation, including the object instance if the call is to an instance method. @param ins the method invocation instruction @param cpg the ConstantPoolGen for the class containing the method @return number of arguments, including object instance if appropriate @throw...
[ "Get", "the", "number", "of", "arguments", "passed", "to", "given", "method", "invocation", "including", "the", "object", "instance", "if", "the", "call", "is", "to", "an", "instance", "method", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/Frame.java#L364-L371
59,984
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/Frame.java
Frame.getArgumentSet
public BitSet getArgumentSet(InvokeInstruction invokeInstruction, ConstantPoolGen cpg, DataflowValueChooser<ValueType> chooser) throws DataflowAnalysisException { BitSet chosenArgSet = new BitSet(); SignatureParser sigParser = new SignatureParser(invokeInstruction.getSignature(cpg)); ...
java
public BitSet getArgumentSet(InvokeInstruction invokeInstruction, ConstantPoolGen cpg, DataflowValueChooser<ValueType> chooser) throws DataflowAnalysisException { BitSet chosenArgSet = new BitSet(); SignatureParser sigParser = new SignatureParser(invokeInstruction.getSignature(cpg)); ...
[ "public", "BitSet", "getArgumentSet", "(", "InvokeInstruction", "invokeInstruction", ",", "ConstantPoolGen", "cpg", ",", "DataflowValueChooser", "<", "ValueType", ">", "chooser", ")", "throws", "DataflowAnalysisException", "{", "BitSet", "chosenArgSet", "=", "new", "Bit...
Get set of arguments passed to a method invocation which match given predicate. @param invokeInstruction the InvokeInstruction @param cpg the ConstantPoolGen @param chooser predicate to choose which argument values should be in the returned set @return BitSet specifying which arguments match the predicate, indexed by ...
[ "Get", "set", "of", "arguments", "passed", "to", "a", "method", "invocation", "which", "match", "given", "predicate", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/Frame.java#L468-L481
59,985
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/Frame.java
Frame.clearStack
public void clearStack() { if (!isValid()) { throw new IllegalStateException("accessing top or bottom frame"); } assert slotList.size() >= numLocals; if (slotList.size() > numLocals) { slotList.subList(numLocals, slotList.size()).clear(); } }
java
public void clearStack() { if (!isValid()) { throw new IllegalStateException("accessing top or bottom frame"); } assert slotList.size() >= numLocals; if (slotList.size() > numLocals) { slotList.subList(numLocals, slotList.size()).clear(); } }
[ "public", "void", "clearStack", "(", ")", "{", "if", "(", "!", "isValid", "(", ")", ")", "{", "throw", "new", "IllegalStateException", "(", "\"accessing top or bottom frame\"", ")", ";", "}", "assert", "slotList", ".", "size", "(", ")", ">=", "numLocals", ...
Clear the Java operand stack. Only local variable slots will remain in the frame.
[ "Clear", "the", "Java", "operand", "stack", ".", "Only", "local", "variable", "slots", "will", "remain", "in", "the", "frame", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/Frame.java#L487-L495
59,986
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/Frame.java
Frame.sameAs
public boolean sameAs(Frame<ValueType> other) { if (isTop != other.isTop) { return false; } if (isTop && other.isTop) { return true; } if (isBottom != other.isBottom) { return false; } if (isBottom && other.isBottom) { ...
java
public boolean sameAs(Frame<ValueType> other) { if (isTop != other.isTop) { return false; } if (isTop && other.isTop) { return true; } if (isBottom != other.isBottom) { return false; } if (isBottom && other.isBottom) { ...
[ "public", "boolean", "sameAs", "(", "Frame", "<", "ValueType", ">", "other", ")", "{", "if", "(", "isTop", "!=", "other", ".", "isTop", ")", "{", "return", "false", ";", "}", "if", "(", "isTop", "&&", "other", ".", "isTop", ")", "{", "return", "tru...
Return true if this stack frame is the same as the one given as a parameter. @param other the other Frame @return true if the frames are the same, false otherwise
[ "Return", "true", "if", "this", "stack", "frame", "is", "the", "same", "as", "the", "one", "given", "as", "a", "parameter", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/Frame.java#L570-L598
59,987
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/Frame.java
Frame.copyFrom
public void copyFrom(Frame<ValueType> other) { lastUpdateTimestamp = other.lastUpdateTimestamp; slotList = new ArrayList<>(other.slotList); isTop = other.isTop; isBottom = other.isBottom; }
java
public void copyFrom(Frame<ValueType> other) { lastUpdateTimestamp = other.lastUpdateTimestamp; slotList = new ArrayList<>(other.slotList); isTop = other.isTop; isBottom = other.isBottom; }
[ "public", "void", "copyFrom", "(", "Frame", "<", "ValueType", ">", "other", ")", "{", "lastUpdateTimestamp", "=", "other", ".", "lastUpdateTimestamp", ";", "slotList", "=", "new", "ArrayList", "<>", "(", "other", ".", "slotList", ")", ";", "isTop", "=", "o...
Make this Frame exactly the same as the one given as a parameter. @param other the Frame to make this object the same as
[ "Make", "this", "Frame", "exactly", "the", "same", "as", "the", "one", "given", "as", "a", "parameter", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/Frame.java#L606-L611
59,988
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/classfile/analysis/ClassInfo.java
ClassInfo.addAnnotation
public void addAnnotation(AnnotationValue annotationValue) { HashMap<ClassDescriptor, AnnotationValue> updatedMap = new HashMap<>(classAnnotations); updatedMap.put(annotationValue.getAnnotationClass(), annotationValue); classAnnotations = Util.immutableMap(updatedMap); }
java
public void addAnnotation(AnnotationValue annotationValue) { HashMap<ClassDescriptor, AnnotationValue> updatedMap = new HashMap<>(classAnnotations); updatedMap.put(annotationValue.getAnnotationClass(), annotationValue); classAnnotations = Util.immutableMap(updatedMap); }
[ "public", "void", "addAnnotation", "(", "AnnotationValue", "annotationValue", ")", "{", "HashMap", "<", "ClassDescriptor", ",", "AnnotationValue", ">", "updatedMap", "=", "new", "HashMap", "<>", "(", "classAnnotations", ")", ";", "updatedMap", ".", "put", "(", "...
Destructively add an annotation to the object. In general, this is not a great idea, since it could cause the same class to appear to have different annotations at different times. However, this method is necessary for "built-in" annotations that FindBugs adds to system classes. As long as we add such annotations early...
[ "Destructively", "add", "an", "annotation", "to", "the", "object", ".", "In", "general", "this", "is", "not", "a", "great", "idea", "since", "it", "could", "cause", "the", "same", "class", "to", "appear", "to", "have", "different", "annotations", "at", "di...
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/classfile/analysis/ClassInfo.java#L440-L444
59,989
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/classfile/impl/DirectoryCodeBase.java
DirectoryCodeBase.getResourceName
String getResourceName(String fileName) { // FIXME: there is probably a more robust way to do this // Strip off the directory part. String dirPath = directory.getPath(); if (!fileName.startsWith(dirPath)) { throw new IllegalStateException("Filename " + fileName + " not insid...
java
String getResourceName(String fileName) { // FIXME: there is probably a more robust way to do this // Strip off the directory part. String dirPath = directory.getPath(); if (!fileName.startsWith(dirPath)) { throw new IllegalStateException("Filename " + fileName + " not insid...
[ "String", "getResourceName", "(", "String", "fileName", ")", "{", "// FIXME: there is probably a more robust way to do this", "// Strip off the directory part.", "String", "dirPath", "=", "directory", ".", "getPath", "(", ")", ";", "if", "(", "!", "fileName", ".", "star...
Get the resource name given a full filename. @param fileName the full filename (which must be inside the directory) @return the resource name (i.e., the filename with the directory stripped off)
[ "Get", "the", "resource", "name", "given", "a", "full", "filename", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/classfile/impl/DirectoryCodeBase.java#L172-L204
59,990
spotbugs/spotbugs
eclipsePlugin/src/de/tobject/findbugs/actions/SaveXmlAction.java
SaveXmlAction.work
private void work(final IProject project, final String fileName) { FindBugsJob runFindBugs = new FindBugsJob("Saving SpotBugs XML data to " + fileName + "...", project) { @Override protected void runWithProgress(IProgressMonitor monitor) throws CoreException { BugCollecti...
java
private void work(final IProject project, final String fileName) { FindBugsJob runFindBugs = new FindBugsJob("Saving SpotBugs XML data to " + fileName + "...", project) { @Override protected void runWithProgress(IProgressMonitor monitor) throws CoreException { BugCollecti...
[ "private", "void", "work", "(", "final", "IProject", "project", ",", "final", "String", "fileName", ")", "{", "FindBugsJob", "runFindBugs", "=", "new", "FindBugsJob", "(", "\"Saving SpotBugs XML data to \"", "+", "fileName", "+", "\"...\"", ",", "project", ")", ...
Save the XML result of a FindBugs analysis on the given project, displaying a progress monitor. @param project The selected project. @param fileName The file name to store the XML to.
[ "Save", "the", "XML", "result", "of", "a", "FindBugs", "analysis", "on", "the", "given", "project", "displaying", "a", "progress", "monitor", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/actions/SaveXmlAction.java#L126-L142
59,991
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/TextUIBugReporter.java
TextUIBugReporter.printBug
protected void printBug(BugInstance bugInstance) { if (showRank) { int rank = BugRanker.findRank(bugInstance); outputStream.printf("%2d ", rank); } switch (bugInstance.getPriority()) { case Priorities.EXP_PRIORITY: outputStream.print("E "); ...
java
protected void printBug(BugInstance bugInstance) { if (showRank) { int rank = BugRanker.findRank(bugInstance); outputStream.printf("%2d ", rank); } switch (bugInstance.getPriority()) { case Priorities.EXP_PRIORITY: outputStream.print("E "); ...
[ "protected", "void", "printBug", "(", "BugInstance", "bugInstance", ")", "{", "if", "(", "showRank", ")", "{", "int", "rank", "=", "BugRanker", ".", "findRank", "(", "bugInstance", ")", ";", "outputStream", ".", "printf", "(", "\"%2d \"", ",", "rank", ")",...
Print bug in one-line format. @param bugInstance the bug to print
[ "Print", "bug", "in", "one", "-", "line", "format", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/TextUIBugReporter.java#L88-L139
59,992
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/model/ClassFeatureSet.java
ClassFeatureSet.initialize
public ClassFeatureSet initialize(JavaClass javaClass) { this.className = javaClass.getClassName(); this.isInterface = javaClass.isInterface(); addFeature(CLASS_NAME_KEY + transformClassName(javaClass.getClassName())); for (Method method : javaClass.getMethods()) { if (!isS...
java
public ClassFeatureSet initialize(JavaClass javaClass) { this.className = javaClass.getClassName(); this.isInterface = javaClass.isInterface(); addFeature(CLASS_NAME_KEY + transformClassName(javaClass.getClassName())); for (Method method : javaClass.getMethods()) { if (!isS...
[ "public", "ClassFeatureSet", "initialize", "(", "JavaClass", "javaClass", ")", "{", "this", ".", "className", "=", "javaClass", ".", "getClassName", "(", ")", ";", "this", ".", "isInterface", "=", "javaClass", ".", "isInterface", "(", ")", ";", "addFeature", ...
Initialize from given JavaClass. @param javaClass the JavaClass @return this object
[ "Initialize", "from", "given", "JavaClass", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/model/ClassFeatureSet.java#L82-L111
59,993
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/model/ClassFeatureSet.java
ClassFeatureSet.overridesSuperclassMethod
private boolean overridesSuperclassMethod(JavaClass javaClass, Method method) { if (method.isStatic()) { return false; } try { JavaClass[] superclassList = javaClass.getSuperClasses(); if (superclassList != null) { JavaClassAndMethod match = H...
java
private boolean overridesSuperclassMethod(JavaClass javaClass, Method method) { if (method.isStatic()) { return false; } try { JavaClass[] superclassList = javaClass.getSuperClasses(); if (superclassList != null) { JavaClassAndMethod match = H...
[ "private", "boolean", "overridesSuperclassMethod", "(", "JavaClass", "javaClass", ",", "Method", "method", ")", "{", "if", "(", "method", ".", "isStatic", "(", ")", ")", "{", "return", "false", ";", "}", "try", "{", "JavaClass", "[", "]", "superclassList", ...
Determine if given method overrides a superclass or superinterface method. @param javaClass class defining the method @param method the method @return true if the method overrides a superclass/superinterface method, false if not
[ "Determine", "if", "given", "method", "overrides", "a", "superclass", "or", "superinterface", "method", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/model/ClassFeatureSet.java#L124-L152
59,994
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/model/ClassFeatureSet.java
ClassFeatureSet.transformClassName
public static String transformClassName(String className) { int lastDot = className.lastIndexOf('.'); if (lastDot >= 0) { String pkg = className.substring(0, lastDot); if (!isUnlikelyToBeRenamed(pkg)) { className = className.substring(lastDot + 1); } ...
java
public static String transformClassName(String className) { int lastDot = className.lastIndexOf('.'); if (lastDot >= 0) { String pkg = className.substring(0, lastDot); if (!isUnlikelyToBeRenamed(pkg)) { className = className.substring(lastDot + 1); } ...
[ "public", "static", "String", "transformClassName", "(", "String", "className", ")", "{", "int", "lastDot", "=", "className", ".", "lastIndexOf", "(", "'", "'", ")", ";", "if", "(", "lastDot", ">=", "0", ")", "{", "String", "pkg", "=", "className", ".", ...
Transform a class name by stripping its package name. @param className a class name @return the transformed class name
[ "Transform", "a", "class", "name", "by", "stripping", "its", "package", "name", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/model/ClassFeatureSet.java#L224-L233
59,995
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/model/ClassFeatureSet.java
ClassFeatureSet.transformMethodSignature
public static String transformMethodSignature(String signature) { StringBuilder buf = new StringBuilder(); buf.append('('); SignatureParser parser = new SignatureParser(signature); for (Iterator<String> i = parser.parameterSignatureIterator(); i.hasNext();) { String param =...
java
public static String transformMethodSignature(String signature) { StringBuilder buf = new StringBuilder(); buf.append('('); SignatureParser parser = new SignatureParser(signature); for (Iterator<String> i = parser.parameterSignatureIterator(); i.hasNext();) { String param =...
[ "public", "static", "String", "transformMethodSignature", "(", "String", "signature", ")", "{", "StringBuilder", "buf", "=", "new", "StringBuilder", "(", ")", ";", "buf", ".", "append", "(", "'", "'", ")", ";", "SignatureParser", "parser", "=", "new", "Signa...
Transform a method signature to allow it to be compared even if any of its parameter types are moved to another package. @param signature a method signature @return the transformed signature
[ "Transform", "a", "method", "signature", "to", "allow", "it", "to", "be", "compared", "even", "if", "any", "of", "its", "parameter", "types", "are", "moved", "to", "another", "package", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/model/ClassFeatureSet.java#L255-L270
59,996
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/model/ClassFeatureSet.java
ClassFeatureSet.transformSignature
public static String transformSignature(String signature) { StringBuilder buf = new StringBuilder(); int lastBracket = signature.lastIndexOf('['); if (lastBracket > 0) { buf.append(signature.substring(0, lastBracket + 1)); signature = signature.substring(lastBracket + 1)...
java
public static String transformSignature(String signature) { StringBuilder buf = new StringBuilder(); int lastBracket = signature.lastIndexOf('['); if (lastBracket > 0) { buf.append(signature.substring(0, lastBracket + 1)); signature = signature.substring(lastBracket + 1)...
[ "public", "static", "String", "transformSignature", "(", "String", "signature", ")", "{", "StringBuilder", "buf", "=", "new", "StringBuilder", "(", ")", ";", "int", "lastBracket", "=", "signature", ".", "lastIndexOf", "(", "'", "'", ")", ";", "if", "(", "l...
Transform a field or method parameter signature to allow it to be compared even if it is moved to another package. @param signature the signature @return the transformed signature
[ "Transform", "a", "field", "or", "method", "parameter", "signature", "to", "allow", "it", "to", "be", "compared", "even", "if", "it", "is", "moved", "to", "another", "package", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/model/ClassFeatureSet.java#L280-L297
59,997
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/BetterCFGBuilder2.java
BetterCFGBuilder2.handleExceptions
private void handleExceptions(Subroutine subroutine, InstructionHandle pei, BasicBlock etb) { etb.setExceptionThrower(pei); // Remember whether or not a universal exception handler // is reachable. If so, then we know that exceptions raised // at this instruction cannot propagate out of...
java
private void handleExceptions(Subroutine subroutine, InstructionHandle pei, BasicBlock etb) { etb.setExceptionThrower(pei); // Remember whether or not a universal exception handler // is reachable. If so, then we know that exceptions raised // at this instruction cannot propagate out of...
[ "private", "void", "handleExceptions", "(", "Subroutine", "subroutine", ",", "InstructionHandle", "pei", ",", "BasicBlock", "etb", ")", "{", "etb", ".", "setExceptionThrower", "(", "pei", ")", ";", "// Remember whether or not a universal exception handler", "// is reachab...
Add exception edges for given instruction. @param subroutine the subroutine containing the instruction @param pei the instruction which throws an exception @param etb the exception thrower block (ETB) for the instruction
[ "Add", "exception", "edges", "for", "given", "instruction", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/BetterCFGBuilder2.java#L941-L971
59,998
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/BetterCFGBuilder2.java
BetterCFGBuilder2.isPEI
private boolean isPEI(InstructionHandle handle) throws CFGBuilderException { Instruction ins = handle.getInstruction(); if (!(ins instanceof ExceptionThrower)) { return false; } if (ins instanceof NEW) { return false; } // if (ins instanceof ATHR...
java
private boolean isPEI(InstructionHandle handle) throws CFGBuilderException { Instruction ins = handle.getInstruction(); if (!(ins instanceof ExceptionThrower)) { return false; } if (ins instanceof NEW) { return false; } // if (ins instanceof ATHR...
[ "private", "boolean", "isPEI", "(", "InstructionHandle", "handle", ")", "throws", "CFGBuilderException", "{", "Instruction", "ins", "=", "handle", ".", "getInstruction", "(", ")", ";", "if", "(", "!", "(", "ins", "instanceof", "ExceptionThrower", ")", ")", "{"...
Return whether or not the given instruction can throw exceptions. @param handle the instruction @return true if the instruction can throw an exception, false otherwise @throws CFGBuilderException
[ "Return", "whether", "or", "not", "the", "given", "instruction", "can", "throw", "exceptions", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/BetterCFGBuilder2.java#L981-L1048
59,999
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/BetterCFGBuilder2.java
BetterCFGBuilder2.isMerge
private static boolean isMerge(InstructionHandle handle) { if (handle.hasTargeters()) { // Check all targeters of this handle to see if any // of them are branches. If so, the instruction is a merge. InstructionTargeter[] targeterList = handle.getTargeters(); for ...
java
private static boolean isMerge(InstructionHandle handle) { if (handle.hasTargeters()) { // Check all targeters of this handle to see if any // of them are branches. If so, the instruction is a merge. InstructionTargeter[] targeterList = handle.getTargeters(); for ...
[ "private", "static", "boolean", "isMerge", "(", "InstructionHandle", "handle", ")", "{", "if", "(", "handle", ".", "hasTargeters", "(", ")", ")", "{", "// Check all targeters of this handle to see if any", "// of them are branches. If so, the instruction is a merge.", "Instru...
Determine whether or not the given instruction is a control flow merge. @param handle the instruction @return true if the instruction is a control merge, false otherwise
[ "Determine", "whether", "or", "not", "the", "given", "instruction", "is", "a", "control", "flow", "merge", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/BetterCFGBuilder2.java#L1077-L1089