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
104,800
mebigfatguy/fb-contrib
src/main/java/com/mebigfatguy/fbcontrib/detect/NeedlessMemberCollectionSynchronization.java
NeedlessMemberCollectionSynchronization.isSyncCollectionCreation
private boolean isSyncCollectionCreation(int seen) { if (seen == Const.INVOKESPECIAL) { if (Values.CONSTRUCTOR.equals(getNameConstantOperand())) { return (syncCollections.contains(getClassConstantOperand())); } } else if ((seen == Const.INVOKESTATIC) && "java/util...
java
private boolean isSyncCollectionCreation(int seen) { if (seen == Const.INVOKESPECIAL) { if (Values.CONSTRUCTOR.equals(getNameConstantOperand())) { return (syncCollections.contains(getClassConstantOperand())); } } else if ((seen == Const.INVOKESTATIC) && "java/util...
[ "private", "boolean", "isSyncCollectionCreation", "(", "int", "seen", ")", "{", "if", "(", "seen", "==", "Const", ".", "INVOKESPECIAL", ")", "{", "if", "(", "Values", ".", "CONSTRUCTOR", ".", "equals", "(", "getNameConstantOperand", "(", ")", ")", ")", "{"...
returns whether this instruction is creating a synchronized collection @param seen the opcode of the currently parsed instruction @return whether a synchronized collection has just been created
[ "returns", "whether", "this", "instruction", "is", "creating", "a", "synchronized", "collection" ]
3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8
https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/detect/NeedlessMemberCollectionSynchronization.java#L341-L351
104,801
mebigfatguy/fb-contrib
src/main/java/com/mebigfatguy/fbcontrib/detect/NeedlessMemberCollectionSynchronization.java
NeedlessMemberCollectionSynchronization.processCollectionStore
private void processCollectionStore() { String fieldClassName = getDottedClassConstantOperand(); if (fieldClassName.equals(className) && (stack.getStackDepth() > 0)) { OpcodeStack.Item item = stack.getStackItem(0); if (item.getUserValue() != null) { String fieldNa...
java
private void processCollectionStore() { String fieldClassName = getDottedClassConstantOperand(); if (fieldClassName.equals(className) && (stack.getStackDepth() > 0)) { OpcodeStack.Item item = stack.getStackItem(0); if (item.getUserValue() != null) { String fieldNa...
[ "private", "void", "processCollectionStore", "(", ")", "{", "String", "fieldClassName", "=", "getDottedClassConstantOperand", "(", ")", ";", "if", "(", "fieldClassName", ".", "equals", "(", "className", ")", "&&", "(", "stack", ".", "getStackDepth", "(", ")", ...
sets the source line annotation of a store to a collection if that collection is synchronized.
[ "sets", "the", "source", "line", "annotation", "of", "a", "store", "to", "a", "collection", "if", "that", "collection", "is", "synchronized", "." ]
3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8
https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/detect/NeedlessMemberCollectionSynchronization.java#L356-L371
104,802
mebigfatguy/fb-contrib
src/main/java/com/mebigfatguy/fbcontrib/detect/NeedlessMemberCollectionSynchronization.java
NeedlessMemberCollectionSynchronization.removeCollectionParameters
private void removeCollectionParameters() { int parmCount = SignatureUtils.getNumParameters(getSigConstantOperand()); if (stack.getStackDepth() >= parmCount) { for (int i = 0; i < parmCount; i++) { OpcodeStack.Item item = stack.getStackItem(i); XField field = ...
java
private void removeCollectionParameters() { int parmCount = SignatureUtils.getNumParameters(getSigConstantOperand()); if (stack.getStackDepth() >= parmCount) { for (int i = 0; i < parmCount; i++) { OpcodeStack.Item item = stack.getStackItem(i); XField field = ...
[ "private", "void", "removeCollectionParameters", "(", ")", "{", "int", "parmCount", "=", "SignatureUtils", ".", "getNumParameters", "(", "getSigConstantOperand", "(", ")", ")", ";", "if", "(", "stack", ".", "getStackDepth", "(", ")", ">=", "parmCount", ")", "{...
removes collection fields that are passed to other methods as arguments
[ "removes", "collection", "fields", "that", "are", "passed", "to", "other", "methods", "as", "arguments" ]
3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8
https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/detect/NeedlessMemberCollectionSynchronization.java#L376-L387
104,803
mebigfatguy/fb-contrib
src/main/java/com/mebigfatguy/fbcontrib/detect/PossibleMemoryBloat.java
PossibleMemoryBloat.visitClassContext
@Override public void visitClassContext(ClassContext classContext) { try { bloatableCandidates = new HashMap<>(); bloatableFields = new HashMap<>(); threadLocalNonStaticFields = new HashSet<>(); userValues = new HashMap<>(); jaxbContextRegs = new H...
java
@Override public void visitClassContext(ClassContext classContext) { try { bloatableCandidates = new HashMap<>(); bloatableFields = new HashMap<>(); threadLocalNonStaticFields = new HashSet<>(); userValues = new HashMap<>(); jaxbContextRegs = new H...
[ "@", "Override", "public", "void", "visitClassContext", "(", "ClassContext", "classContext", ")", "{", "try", "{", "bloatableCandidates", "=", "new", "HashMap", "<>", "(", ")", ";", "bloatableFields", "=", "new", "HashMap", "<>", "(", ")", ";", "threadLocalNon...
collects static fields that are likely bloatable objects and if found allows the visitor to proceed, at the end report all leftover fields @param classContext the class context object of the currently parsed java class
[ "collects", "static", "fields", "that", "are", "likely", "bloatable", "objects", "and", "if", "found", "allows", "the", "visitor", "to", "proceed", "at", "the", "end", "report", "all", "leftover", "fields" ]
3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8
https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/detect/PossibleMemoryBloat.java#L106-L130
104,804
mebigfatguy/fb-contrib
src/main/java/com/mebigfatguy/fbcontrib/detect/SuboptimalExpressionOrder.java
SuboptimalExpressionOrder.visitClassContext
@Override public void visitClassContext(ClassContext clsContext) { try { stack = new OpcodeStack(); super.visitClassContext(clsContext); } finally { stack = null; } }
java
@Override public void visitClassContext(ClassContext clsContext) { try { stack = new OpcodeStack(); super.visitClassContext(clsContext); } finally { stack = null; } }
[ "@", "Override", "public", "void", "visitClassContext", "(", "ClassContext", "clsContext", ")", "{", "try", "{", "stack", "=", "new", "OpcodeStack", "(", ")", ";", "super", ".", "visitClassContext", "(", "clsContext", ")", ";", "}", "finally", "{", "stack", ...
overrides the visitor to setup the opcode stack @param clsContext the context object of the currently parse class
[ "overrides", "the", "visitor", "to", "setup", "the", "opcode", "stack" ]
3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8
https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/detect/SuboptimalExpressionOrder.java#L68-L76
104,805
mebigfatguy/fb-contrib
src/main/java/com/mebigfatguy/fbcontrib/detect/SuboptimalExpressionOrder.java
SuboptimalExpressionOrder.visitCode
@Override public void visitCode(Code obj) { stack.resetForMethodEntry(this); conditionalTarget = -1; sawMethodWeight = 0; super.visitCode(obj); }
java
@Override public void visitCode(Code obj) { stack.resetForMethodEntry(this); conditionalTarget = -1; sawMethodWeight = 0; super.visitCode(obj); }
[ "@", "Override", "public", "void", "visitCode", "(", "Code", "obj", ")", "{", "stack", ".", "resetForMethodEntry", "(", "this", ")", ";", "conditionalTarget", "=", "-", "1", ";", "sawMethodWeight", "=", "0", ";", "super", ".", "visitCode", "(", "obj", ")...
overrides the visitor to reset the opcode stack, and initialize vars @param obj the code object of the currently parsed method
[ "overrides", "the", "visitor", "to", "reset", "the", "opcode", "stack", "and", "initialize", "vars" ]
3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8
https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/detect/SuboptimalExpressionOrder.java#L84-L90
104,806
mebigfatguy/fb-contrib
src/main/java/com/mebigfatguy/fbcontrib/detect/PossibleIncompleteSerialization.java
PossibleIncompleteSerialization.visitClassContext
@Override public void visitClassContext(ClassContext classContext) { try { JavaClass cls = classContext.getJavaClass(); if (isSerializable(cls)) { JavaClass superCls = cls.getSuperClass(); if (!isSerializable(superCls) && hasSerializableFields(superCls...
java
@Override public void visitClassContext(ClassContext classContext) { try { JavaClass cls = classContext.getJavaClass(); if (isSerializable(cls)) { JavaClass superCls = cls.getSuperClass(); if (!isSerializable(superCls) && hasSerializableFields(superCls...
[ "@", "Override", "public", "void", "visitClassContext", "(", "ClassContext", "classContext", ")", "{", "try", "{", "JavaClass", "cls", "=", "classContext", ".", "getJavaClass", "(", ")", ";", "if", "(", "isSerializable", "(", "cls", ")", ")", "{", "JavaClass...
implements the visitor to look for classes that are serializable, and are derived from non serializable classes and don't either implement methods in Externalizable or Serializable to save parent class fields. @param classContext the context object of the currently parsed class
[ "implements", "the", "visitor", "to", "look", "for", "classes", "that", "are", "serializable", "and", "are", "derived", "from", "non", "serializable", "classes", "and", "don", "t", "either", "implement", "methods", "in", "Externalizable", "or", "Serializable", "...
3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8
https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/detect/PossibleIncompleteSerialization.java#L62-L75
104,807
mebigfatguy/fb-contrib
src/main/java/com/mebigfatguy/fbcontrib/detect/PossibleIncompleteSerialization.java
PossibleIncompleteSerialization.isSerializable
private static boolean isSerializable(JavaClass cls) throws ClassNotFoundException { JavaClass[] infs = cls.getAllInterfaces(); for (JavaClass inf : infs) { String clsName = inf.getClassName(); if ("java.io.Serializable".equals(clsName) || "java.io.Externalizable".equals(clsName)...
java
private static boolean isSerializable(JavaClass cls) throws ClassNotFoundException { JavaClass[] infs = cls.getAllInterfaces(); for (JavaClass inf : infs) { String clsName = inf.getClassName(); if ("java.io.Serializable".equals(clsName) || "java.io.Externalizable".equals(clsName)...
[ "private", "static", "boolean", "isSerializable", "(", "JavaClass", "cls", ")", "throws", "ClassNotFoundException", "{", "JavaClass", "[", "]", "infs", "=", "cls", ".", "getAllInterfaces", "(", ")", ";", "for", "(", "JavaClass", "inf", ":", "infs", ")", "{",...
returns if the class implements Serializable or Externalizable @param cls the class to check for interfaces @return if the class implements Serializable or Externalizable @throws ClassNotFoundException if a super class or super interfaces can't be found
[ "returns", "if", "the", "class", "implements", "Serializable", "or", "Externalizable" ]
3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8
https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/detect/PossibleIncompleteSerialization.java#L88-L97
104,808
mebigfatguy/fb-contrib
src/main/java/com/mebigfatguy/fbcontrib/detect/PossibleIncompleteSerialization.java
PossibleIncompleteSerialization.hasSerializableFields
private static boolean hasSerializableFields(JavaClass cls) { Field[] fields = cls.getFields(); for (Field f : fields) { if (!f.isStatic() && !f.isTransient() && !f.isSynthetic()) { return true; } } return false; }
java
private static boolean hasSerializableFields(JavaClass cls) { Field[] fields = cls.getFields(); for (Field f : fields) { if (!f.isStatic() && !f.isTransient() && !f.isSynthetic()) { return true; } } return false; }
[ "private", "static", "boolean", "hasSerializableFields", "(", "JavaClass", "cls", ")", "{", "Field", "[", "]", "fields", "=", "cls", ".", "getFields", "(", ")", ";", "for", "(", "Field", "f", ":", "fields", ")", "{", "if", "(", "!", "f", ".", "isStat...
looks for fields that are candidates for serialization @param cls the class to look for fields @return if their is a field that looks like it should be serialized
[ "looks", "for", "fields", "that", "are", "candidates", "for", "serialization" ]
3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8
https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/detect/PossibleIncompleteSerialization.java#L106-L114
104,809
mebigfatguy/fb-contrib
src/main/java/com/mebigfatguy/fbcontrib/detect/PossibleIncompleteSerialization.java
PossibleIncompleteSerialization.hasSerializingMethods
private static boolean hasSerializingMethods(JavaClass cls) { Method[] methods = cls.getMethods(); for (Method m : methods) { if (!m.isStatic()) { String methodName = m.getName(); String methodSig = m.getSignature(); if ("writeObject".equals(me...
java
private static boolean hasSerializingMethods(JavaClass cls) { Method[] methods = cls.getMethods(); for (Method m : methods) { if (!m.isStatic()) { String methodName = m.getName(); String methodSig = m.getSignature(); if ("writeObject".equals(me...
[ "private", "static", "boolean", "hasSerializingMethods", "(", "JavaClass", "cls", ")", "{", "Method", "[", "]", "methods", "=", "cls", ".", "getMethods", "(", ")", ";", "for", "(", "Method", "m", ":", "methods", ")", "{", "if", "(", "!", "m", ".", "i...
looks to see if this class implements method described by Serializable or Externalizable @param cls the class to examine for serializing methods @return whether the class handles it's own serializing/externalizing
[ "looks", "to", "see", "if", "this", "class", "implements", "method", "described", "by", "Serializable", "or", "Externalizable" ]
3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8
https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/detect/PossibleIncompleteSerialization.java#L123-L138
104,810
mebigfatguy/fb-contrib
src/main/java/com/mebigfatguy/fbcontrib/detect/ConfusingArrayAsList.java
ConfusingArrayAsList.sawOpcode
@Override public void sawOpcode(int seen) { try { stack.precomputation(this); if (seen == Const.INVOKESTATIC) { String clsName = getClassConstantOperand(); if ("java/util/Arrays".equals(clsName)) { String methodName = getNameConsta...
java
@Override public void sawOpcode(int seen) { try { stack.precomputation(this); if (seen == Const.INVOKESTATIC) { String clsName = getClassConstantOperand(); if ("java/util/Arrays".equals(clsName)) { String methodName = getNameConsta...
[ "@", "Override", "public", "void", "sawOpcode", "(", "int", "seen", ")", "{", "try", "{", "stack", ".", "precomputation", "(", "this", ")", ";", "if", "(", "seen", "==", "Const", ".", "INVOKESTATIC", ")", "{", "String", "clsName", "=", "getClassConstantO...
implements the visitor to find calls to Arrays.asList with a primitive array @param seen the currently visitor opcode
[ "implements", "the", "visitor", "to", "find", "calls", "to", "Arrays", ".", "asList", "with", "a", "primitive", "array" ]
3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8
https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/detect/ConfusingArrayAsList.java#L97-L122
104,811
mebigfatguy/fb-contrib
src/main/java/com/mebigfatguy/fbcontrib/detect/SuspiciousGetterSetterUse.java
SuspiciousGetterSetterUse.visitCode
@Override public void visitCode(Code obj) { state = State.SEEN_NOTHING; beanReference1 = null; beanReference2 = null; propName = null; propType = null; sawField = false; super.visitCode(obj); }
java
@Override public void visitCode(Code obj) { state = State.SEEN_NOTHING; beanReference1 = null; beanReference2 = null; propName = null; propType = null; sawField = false; super.visitCode(obj); }
[ "@", "Override", "public", "void", "visitCode", "(", "Code", "obj", ")", "{", "state", "=", "State", ".", "SEEN_NOTHING", ";", "beanReference1", "=", "null", ";", "beanReference2", "=", "null", ";", "propName", "=", "null", ";", "propType", "=", "null", ...
overrides the visitor to reset the state to SEEN_NOTHING, and clear the beanReference, propName and propType @param obj the context object of the currently parsed code block
[ "overrides", "the", "visitor", "to", "reset", "the", "state", "to", "SEEN_NOTHING", "and", "clear", "the", "beanReference", "propName", "and", "propType" ]
3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8
https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/detect/SuspiciousGetterSetterUse.java#L66-L75
104,812
mebigfatguy/fb-contrib
src/main/java/com/mebigfatguy/fbcontrib/detect/SuspiciousGetterSetterUse.java
SuspiciousGetterSetterUse.sawOpcode
@Override public void sawOpcode(int seen) { boolean reset = true; switch (state) { // TODO: Refactor this to use state pattern, not nested // switches case SEEN_NOTHING: reset = sawOpcodeAfterNothing(seen); break; case SEE...
java
@Override public void sawOpcode(int seen) { boolean reset = true; switch (state) { // TODO: Refactor this to use state pattern, not nested // switches case SEEN_NOTHING: reset = sawOpcodeAfterNothing(seen); break; case SEE...
[ "@", "Override", "public", "void", "sawOpcode", "(", "int", "seen", ")", "{", "boolean", "reset", "=", "true", ";", "switch", "(", "state", ")", "{", "// TODO: Refactor this to use state pattern, not nested", "// switches", "case", "SEEN_NOTHING", ":", "reset", "=...
overrides the visitor to look for a setXXX with the value returned from a getXXX using the same base object. @param seen the currently parsed opcode
[ "overrides", "the", "visitor", "to", "look", "for", "a", "setXXX", "with", "the", "value", "returned", "from", "a", "getXXX", "using", "the", "same", "base", "object", "." ]
3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8
https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/detect/SuspiciousGetterSetterUse.java#L83-L119
104,813
mebigfatguy/fb-contrib
src/main/java/com/mebigfatguy/fbcontrib/detect/ConstantListIndex.java
ConstantListIndex.visitClassContext
@Override public void visitClassContext(ClassContext classContext) { try { if ((invocationHandlerClass != null) && classContext.getJavaClass().implementationOf(invocationHandlerClass)) { return; } iConst0Looped = new BitSet(); stack = new Opcod...
java
@Override public void visitClassContext(ClassContext classContext) { try { if ((invocationHandlerClass != null) && classContext.getJavaClass().implementationOf(invocationHandlerClass)) { return; } iConst0Looped = new BitSet(); stack = new Opcod...
[ "@", "Override", "public", "void", "visitClassContext", "(", "ClassContext", "classContext", ")", "{", "try", "{", "if", "(", "(", "invocationHandlerClass", "!=", "null", ")", "&&", "classContext", ".", "getJavaClass", "(", ")", ".", "implementationOf", "(", "...
implements the visitor to create and clear the const0loop set @param classContext the context object of the currently parsed class
[ "implements", "the", "visitor", "to", "create", "and", "clear", "the", "const0loop", "set" ]
3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8
https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/detect/ConstantListIndex.java#L120-L135
104,814
mebigfatguy/fb-contrib
src/main/java/com/mebigfatguy/fbcontrib/detect/ConstantListIndex.java
ConstantListIndex.isArrayFromUbiquitousMethod
private static boolean isArrayFromUbiquitousMethod(OpcodeStack.Item item) { XMethod method = item.getReturnValueOf(); if (method == null) { return false; } FQMethod methodDesc = new FQMethod(method.getClassName().replace('.', '/'), method.getName(), method.getSignature()); ...
java
private static boolean isArrayFromUbiquitousMethod(OpcodeStack.Item item) { XMethod method = item.getReturnValueOf(); if (method == null) { return false; } FQMethod methodDesc = new FQMethod(method.getClassName().replace('.', '/'), method.getName(), method.getSignature()); ...
[ "private", "static", "boolean", "isArrayFromUbiquitousMethod", "(", "OpcodeStack", ".", "Item", "item", ")", "{", "XMethod", "method", "=", "item", ".", "getReturnValueOf", "(", ")", ";", "if", "(", "method", "==", "null", ")", "{", "return", "false", ";", ...
returns whether the array item was returned from a common method that the user can't do anything about and so don't report CLI in this case. @param item the stack item representing the array @return if the array was returned from a common method
[ "returns", "whether", "the", "array", "item", "was", "returned", "from", "a", "common", "method", "that", "the", "user", "can", "t", "do", "anything", "about", "and", "so", "don", "t", "report", "CLI", "in", "this", "case", "." ]
3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8
https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/detect/ConstantListIndex.java#L247-L255
104,815
mebigfatguy/fb-contrib
src/main/java/com/mebigfatguy/fbcontrib/detect/UnusedParameter.java
UnusedParameter.visitClassContext
@Override public void visitClassContext(ClassContext classContext) { try { unusedParms = new BitSet(); regToParm = new HashMap<>(); stack = new OpcodeStack(); super.visitClassContext(classContext); } finally { stack = null; regT...
java
@Override public void visitClassContext(ClassContext classContext) { try { unusedParms = new BitSet(); regToParm = new HashMap<>(); stack = new OpcodeStack(); super.visitClassContext(classContext); } finally { stack = null; regT...
[ "@", "Override", "public", "void", "visitClassContext", "(", "ClassContext", "classContext", ")", "{", "try", "{", "unusedParms", "=", "new", "BitSet", "(", ")", ";", "regToParm", "=", "new", "HashMap", "<>", "(", ")", ";", "stack", "=", "new", "OpcodeStac...
implements the visitor to create parm bitset @param classContext the context object of the currently parsed class
[ "implements", "the", "visitor", "to", "create", "parm", "bitset" ]
3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8
https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/detect/UnusedParameter.java#L78-L90
104,816
mebigfatguy/fb-contrib
src/main/java/com/mebigfatguy/fbcontrib/detect/UnusedParameter.java
UnusedParameter.visitCode
@Override public void visitCode(Code obj) { unusedParms.clear(); regToParm.clear(); stack.resetForMethodEntry(this); Method m = getMethod(); String methodName = m.getName(); if (IGNORE_METHODS.contains(methodName)) { return; } int accessFl...
java
@Override public void visitCode(Code obj) { unusedParms.clear(); regToParm.clear(); stack.resetForMethodEntry(this); Method m = getMethod(); String methodName = m.getName(); if (IGNORE_METHODS.contains(methodName)) { return; } int accessFl...
[ "@", "Override", "public", "void", "visitCode", "(", "Code", "obj", ")", "{", "unusedParms", ".", "clear", "(", ")", ";", "regToParm", ".", "clear", "(", ")", ";", "stack", ".", "resetForMethodEntry", "(", "this", ")", ";", "Method", "m", "=", "getMeth...
implements the visitor to clear the parm set, and check for potential methods @param obj the context object of the currently parsed code block
[ "implements", "the", "visitor", "to", "clear", "the", "parm", "set", "and", "check", "for", "potential", "methods" ]
3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8
https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/detect/UnusedParameter.java#L98-L152
104,817
mebigfatguy/fb-contrib
src/main/java/com/mebigfatguy/fbcontrib/detect/UnusedParameter.java
UnusedParameter.sawOpcode
@Override public void sawOpcode(int seen) { try { stack.precomputation(this); if (OpcodeUtils.isStore(seen) || OpcodeUtils.isLoad(seen)) { int reg = getRegisterOperand(); unusedParms.clear(reg); } else if (OpcodeUtils.isReturn(seen) && (st...
java
@Override public void sawOpcode(int seen) { try { stack.precomputation(this); if (OpcodeUtils.isStore(seen) || OpcodeUtils.isLoad(seen)) { int reg = getRegisterOperand(); unusedParms.clear(reg); } else if (OpcodeUtils.isReturn(seen) && (st...
[ "@", "Override", "public", "void", "sawOpcode", "(", "int", "seen", ")", "{", "try", "{", "stack", ".", "precomputation", "(", "this", ")", ";", "if", "(", "OpcodeUtils", ".", "isStore", "(", "seen", ")", "||", "OpcodeUtils", ".", "isLoad", "(", "seen"...
implements the visitor to look for usage of parmeter registers. @param seen the opcode of the currently parsed instruction
[ "implements", "the", "visitor", "to", "look", "for", "usage", "of", "parmeter", "registers", "." ]
3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8
https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/detect/UnusedParameter.java#L160-L181
104,818
mebigfatguy/fb-contrib
src/main/java/com/mebigfatguy/fbcontrib/utils/SignatureUtils.java
SignatureUtils.getPackageName
public static String getPackageName(final String className) { int dotPos = className.lastIndexOf('.'); if (dotPos < 0) { return ""; } return className.substring(0, dotPos); }
java
public static String getPackageName(final String className) { int dotPos = className.lastIndexOf('.'); if (dotPos < 0) { return ""; } return className.substring(0, dotPos); }
[ "public", "static", "String", "getPackageName", "(", "final", "String", "className", ")", "{", "int", "dotPos", "=", "className", ".", "lastIndexOf", "(", "'", "'", ")", ";", "if", "(", "dotPos", "<", "0", ")", "{", "return", "\"\"", ";", "}", "return"...
parses the package name from a fully qualified class name @param className the class in question @return the package of the class
[ "parses", "the", "package", "name", "from", "a", "fully", "qualified", "class", "name" ]
3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8
https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/utils/SignatureUtils.java#L97-L103
104,819
mebigfatguy/fb-contrib
src/main/java/com/mebigfatguy/fbcontrib/utils/SignatureUtils.java
SignatureUtils.similarPackages
public static boolean similarPackages(String packName1, String packName2, int depth) { if (depth == 0) { return true; } String dottedPackName1 = packName1.replace('/', '.'); String dottedPackName2 = packName2.replace('/', '.'); int dot1 = dottedPackName1.indexOf('.'...
java
public static boolean similarPackages(String packName1, String packName2, int depth) { if (depth == 0) { return true; } String dottedPackName1 = packName1.replace('/', '.'); String dottedPackName2 = packName2.replace('/', '.'); int dot1 = dottedPackName1.indexOf('.'...
[ "public", "static", "boolean", "similarPackages", "(", "String", "packName1", ",", "String", "packName2", ",", "int", "depth", ")", "{", "if", "(", "depth", "==", "0", ")", "{", "return", "true", ";", "}", "String", "dottedPackName1", "=", "packName1", "."...
returns whether or not the two packages have the same first 'depth' parts, if they exist @param packName1 the first package to check @param packName2 the second package to check @param depth the number of package parts to check @return if they are similar
[ "returns", "whether", "or", "not", "the", "two", "packages", "have", "the", "same", "first", "depth", "parts", "if", "they", "exist" ]
3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8
https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/utils/SignatureUtils.java#L117-L141
104,820
mebigfatguy/fb-contrib
src/main/java/com/mebigfatguy/fbcontrib/utils/SignatureUtils.java
SignatureUtils.getTypeCodeSignature
public static String getTypeCodeSignature(int typeCode) { String signature = Values.PRIMITIVE_TYPE_CODE_SIGS.get((byte) typeCode); return signature == null ? Values.SIG_JAVA_LANG_OBJECT : signature; }
java
public static String getTypeCodeSignature(int typeCode) { String signature = Values.PRIMITIVE_TYPE_CODE_SIGS.get((byte) typeCode); return signature == null ? Values.SIG_JAVA_LANG_OBJECT : signature; }
[ "public", "static", "String", "getTypeCodeSignature", "(", "int", "typeCode", ")", "{", "String", "signature", "=", "Values", ".", "PRIMITIVE_TYPE_CODE_SIGS", ".", "get", "(", "(", "byte", ")", "typeCode", ")", ";", "return", "signature", "==", "null", "?", ...
converts a primitive type code to a signature @param typeCode the raw JVM type value @return the signature of the type
[ "converts", "a", "primitive", "type", "code", "to", "a", "signature" ]
3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8
https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/utils/SignatureUtils.java#L150-L153
104,821
mebigfatguy/fb-contrib
src/main/java/com/mebigfatguy/fbcontrib/utils/SignatureUtils.java
SignatureUtils.getParameterSlotAndSignatures
public static Map<Integer, String> getParameterSlotAndSignatures(boolean methodIsStatic, String methodSignature) { int start = methodSignature.indexOf('(') + 1; int limit = methodSignature.lastIndexOf(')'); if ((limit - start) == 0) { return Collections.emptyMap(); } ...
java
public static Map<Integer, String> getParameterSlotAndSignatures(boolean methodIsStatic, String methodSignature) { int start = methodSignature.indexOf('(') + 1; int limit = methodSignature.lastIndexOf(')'); if ((limit - start) == 0) { return Collections.emptyMap(); } ...
[ "public", "static", "Map", "<", "Integer", ",", "String", ">", "getParameterSlotAndSignatures", "(", "boolean", "methodIsStatic", ",", "String", "methodSignature", ")", "{", "int", "start", "=", "methodSignature", ".", "indexOf", "(", "'", "'", ")", "+", "1", ...
returns a Map that represents the type of the parameter in slot x @param methodIsStatic if the method is static, causes where to start counting from, slot 0 or 1 @param methodSignature the signature of the method to parse @return a map of parameter types (expect empty slots when doubles/longs are used
[ "returns", "a", "Map", "that", "represents", "the", "type", "of", "the", "parameter", "in", "slot", "x" ]
3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8
https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/utils/SignatureUtils.java#L179-L212
104,822
mebigfatguy/fb-contrib
src/main/java/com/mebigfatguy/fbcontrib/utils/SignatureUtils.java
SignatureUtils.getParameterSignatures
public static List<String> getParameterSignatures(String methodSignature) { int start = methodSignature.indexOf('(') + 1; int limit = methodSignature.lastIndexOf(')'); if ((limit - start) == 0) { return Collections.emptyList(); } List<String> parmSignatures = new A...
java
public static List<String> getParameterSignatures(String methodSignature) { int start = methodSignature.indexOf('(') + 1; int limit = methodSignature.lastIndexOf(')'); if ((limit - start) == 0) { return Collections.emptyList(); } List<String> parmSignatures = new A...
[ "public", "static", "List", "<", "String", ">", "getParameterSignatures", "(", "String", "methodSignature", ")", "{", "int", "start", "=", "methodSignature", ".", "indexOf", "(", "'", "'", ")", "+", "1", ";", "int", "limit", "=", "methodSignature", ".", "l...
returns a List of parameter signatures @param methodSignature the signature of the method to parse @return a list of parameter signatures
[ "returns", "a", "List", "of", "parameter", "signatures" ]
3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8
https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/utils/SignatureUtils.java#L221-L246
104,823
mebigfatguy/fb-contrib
src/main/java/com/mebigfatguy/fbcontrib/utils/SignatureUtils.java
SignatureUtils.getReturnSignature
public static String getReturnSignature(String methodSig) { int parenPos = methodSig.indexOf(')'); if (parenPos < 0) { return "?"; } return methodSig.substring(parenPos + 1); }
java
public static String getReturnSignature(String methodSig) { int parenPos = methodSig.indexOf(')'); if (parenPos < 0) { return "?"; } return methodSig.substring(parenPos + 1); }
[ "public", "static", "String", "getReturnSignature", "(", "String", "methodSig", ")", "{", "int", "parenPos", "=", "methodSig", ".", "indexOf", "(", "'", "'", ")", ";", "if", "(", "parenPos", "<", "0", ")", "{", "return", "\"?\"", ";", "}", "return", "m...
gets the return type signature from a method signature @param methodSig the signature of the method @return the signature of the return type, or ? if a bogus method signature is given
[ "gets", "the", "return", "type", "signature", "from", "a", "method", "signature" ]
3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8
https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/utils/SignatureUtils.java#L257-L264
104,824
mebigfatguy/fb-contrib
src/main/java/com/mebigfatguy/fbcontrib/utils/SignatureUtils.java
SignatureUtils.getNumParameters
public static int getNumParameters(String methodSignature) { int start = methodSignature.indexOf('(') + 1; int limit = methodSignature.lastIndexOf(')'); if ((limit - start) == 0) { return 0; } int numParms = 0; for (int i = start; i < limit; i++) { ...
java
public static int getNumParameters(String methodSignature) { int start = methodSignature.indexOf('(') + 1; int limit = methodSignature.lastIndexOf(')'); if ((limit - start) == 0) { return 0; } int numParms = 0; for (int i = start; i < limit; i++) { ...
[ "public", "static", "int", "getNumParameters", "(", "String", "methodSignature", ")", "{", "int", "start", "=", "methodSignature", ".", "indexOf", "(", "'", "'", ")", "+", "1", ";", "int", "limit", "=", "methodSignature", ".", "lastIndexOf", "(", "'", "'",...
returns the number of parameters in this method signature @param methodSignature the method signature to parse @return the number of parameters
[ "returns", "the", "number", "of", "parameters", "in", "this", "method", "signature" ]
3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8
https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/utils/SignatureUtils.java#L273-L294
104,825
mebigfatguy/fb-contrib
src/main/java/com/mebigfatguy/fbcontrib/utils/SignatureUtils.java
SignatureUtils.getFirstRegisterSlot
public static int getFirstRegisterSlot(Method m) { Type[] parms = m.getArgumentTypes(); int first = m.isStatic() ? 0 : 1; for (Type t : parms) { first += getSignatureSize(t.getSignature()); } return first; }
java
public static int getFirstRegisterSlot(Method m) { Type[] parms = m.getArgumentTypes(); int first = m.isStatic() ? 0 : 1; for (Type t : parms) { first += getSignatureSize(t.getSignature()); } return first; }
[ "public", "static", "int", "getFirstRegisterSlot", "(", "Method", "m", ")", "{", "Type", "[", "]", "parms", "=", "m", ".", "getArgumentTypes", "(", ")", ";", "int", "first", "=", "m", ".", "isStatic", "(", ")", "?", "0", ":", "1", ";", "for", "(", ...
returns the first open register slot after parameters @param m the method for which you want the parameters @return the first available register slot
[ "returns", "the", "first", "open", "register", "slot", "after", "parameters" ]
3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8
https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/utils/SignatureUtils.java#L303-L312
104,826
mebigfatguy/fb-contrib
src/main/java/com/mebigfatguy/fbcontrib/utils/SignatureUtils.java
SignatureUtils.toArraySignature
@Nullable public static String toArraySignature(String typeName) { String sig = classToSignature(typeName); if ((sig == null) || (sig.length() == 0)) { return sig; } return Values.SIG_ARRAY_PREFIX + sig; }
java
@Nullable public static String toArraySignature(String typeName) { String sig = classToSignature(typeName); if ((sig == null) || (sig.length() == 0)) { return sig; } return Values.SIG_ARRAY_PREFIX + sig; }
[ "@", "Nullable", "public", "static", "String", "toArraySignature", "(", "String", "typeName", ")", "{", "String", "sig", "=", "classToSignature", "(", "typeName", ")", ";", "if", "(", "(", "sig", "==", "null", ")", "||", "(", "sig", ".", "length", "(", ...
Converts a type name into an array signature. Accepts slashed or dotted classnames, or type signatures. @param typeName the class name to generate an array signature from @return the array signature
[ "Converts", "a", "type", "name", "into", "an", "array", "signature", ".", "Accepts", "slashed", "or", "dotted", "classnames", "or", "type", "signatures", "." ]
3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8
https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/utils/SignatureUtils.java#L416-L423
104,827
mebigfatguy/fb-contrib
src/main/java/com/mebigfatguy/fbcontrib/utils/SignatureUtils.java
SignatureUtils.isWonkyEclipseSignature
private static boolean isWonkyEclipseSignature(String sig, int startIndex) { return (sig.length() > startIndex) && (ECLIPSE_WEIRD_SIG_CHARS.indexOf(sig.charAt(startIndex)) >= 0); }
java
private static boolean isWonkyEclipseSignature(String sig, int startIndex) { return (sig.length() > startIndex) && (ECLIPSE_WEIRD_SIG_CHARS.indexOf(sig.charAt(startIndex)) >= 0); }
[ "private", "static", "boolean", "isWonkyEclipseSignature", "(", "String", "sig", ",", "int", "startIndex", ")", "{", "return", "(", "sig", ".", "length", "(", ")", ">", "startIndex", ")", "&&", "(", "ECLIPSE_WEIRD_SIG_CHARS", ".", "indexOf", "(", "sig", ".",...
Eclipse makes weird class signatures. @param sig the signature in type table @param startIndex the index into the signature where the wonkyness begins @return if this signature has eclipse meta chars
[ "Eclipse", "makes", "weird", "class", "signatures", "." ]
3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8
https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/utils/SignatureUtils.java#L455-L457
104,828
mebigfatguy/fb-contrib
src/main/java/com/mebigfatguy/fbcontrib/detect/SuspiciousWaitOnConcurrentObject.java
SuspiciousWaitOnConcurrentObject.visitClassContext
@Override public void visitClassContext(ClassContext classContext) { try { JavaClass cls = classContext.getJavaClass(); int major = cls.getMajor(); if (major >= Const.MAJOR_1_5) { stack = new OpcodeStack(); super.visitClassContext(classCont...
java
@Override public void visitClassContext(ClassContext classContext) { try { JavaClass cls = classContext.getJavaClass(); int major = cls.getMajor(); if (major >= Const.MAJOR_1_5) { stack = new OpcodeStack(); super.visitClassContext(classCont...
[ "@", "Override", "public", "void", "visitClassContext", "(", "ClassContext", "classContext", ")", "{", "try", "{", "JavaClass", "cls", "=", "classContext", ".", "getJavaClass", "(", ")", ";", "int", "major", "=", "cls", ".", "getMajor", "(", ")", ";", "if"...
implements the visitor to check for class file version 1.5 or better @param classContext the context object of the currently parsed class
[ "implements", "the", "visitor", "to", "check", "for", "class", "file", "version", "1", ".", "5", "or", "better" ]
3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8
https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/detect/SuspiciousWaitOnConcurrentObject.java#L62-L74
104,829
mebigfatguy/fb-contrib
src/main/java/com/mebigfatguy/fbcontrib/detect/SuspiciousWaitOnConcurrentObject.java
SuspiciousWaitOnConcurrentObject.sawOpcode
@Override public void sawOpcode(int seen) { try { stack.precomputation(this); if ((seen != Const.INVOKEVIRTUAL) || !"wait".equals(getNameConstantOperand()) || stack.getStackDepth() == 0) { return; } JavaClass cls = stack.getStackItem(0).getJav...
java
@Override public void sawOpcode(int seen) { try { stack.precomputation(this); if ((seen != Const.INVOKEVIRTUAL) || !"wait".equals(getNameConstantOperand()) || stack.getStackDepth() == 0) { return; } JavaClass cls = stack.getStackItem(0).getJav...
[ "@", "Override", "public", "void", "sawOpcode", "(", "int", "seen", ")", "{", "try", "{", "stack", ".", "precomputation", "(", "this", ")", ";", "if", "(", "(", "seen", "!=", "Const", ".", "INVOKEVIRTUAL", ")", "||", "!", "\"wait\"", ".", "equals", "...
implements the visitor to look for calls to wait, on java.util.concurrent classes that define await. @param seen the opcode of the currently visited instruction
[ "implements", "the", "visitor", "to", "look", "for", "calls", "to", "wait", "on", "java", ".", "util", ".", "concurrent", "classes", "that", "define", "await", "." ]
3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8
https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/detect/SuspiciousWaitOnConcurrentObject.java#L93-L114
104,830
mebigfatguy/fb-contrib
src/main/java/com/mebigfatguy/fbcontrib/detect/CustomBuiltXML.java
CustomBuiltXML.sawOpcode
@Override public void sawOpcode(int seen) { String strCon = null; try { stack.precomputation(this); if (seen == Const.INVOKESPECIAL) { String clsName = getClassConstantOperand(); if (SignatureUtils.isPlainStringConvertableClass(clsName)) { ...
java
@Override public void sawOpcode(int seen) { String strCon = null; try { stack.precomputation(this); if (seen == Const.INVOKESPECIAL) { String clsName = getClassConstantOperand(); if (SignatureUtils.isPlainStringConvertableClass(clsName)) { ...
[ "@", "Override", "public", "void", "sawOpcode", "(", "int", "seen", ")", "{", "String", "strCon", "=", "null", ";", "try", "{", "stack", ".", "precomputation", "(", "this", ")", ";", "if", "(", "seen", "==", "Const", ".", "INVOKESPECIAL", ")", "{", "...
overrides the visitor to find String concatenations including xml strings @param seen the opcode that is being visited
[ "overrides", "the", "visitor", "to", "find", "String", "concatenations", "including", "xml", "strings" ]
3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8
https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/detect/CustomBuiltXML.java#L133-L185
104,831
mebigfatguy/fb-contrib
src/main/java/com/mebigfatguy/fbcontrib/detect/SuspiciousLoopSearch.java
SuspiciousLoopSearch.sawOpcode
@Override public void sawOpcode(int seen) { try { switch (state) { case SAW_NOTHING: sawOpcodeAfterNothing(seen); break; case SAW_EQUALS: sawOpcodeAfterEquals(seen); break; c...
java
@Override public void sawOpcode(int seen) { try { switch (state) { case SAW_NOTHING: sawOpcodeAfterNothing(seen); break; case SAW_EQUALS: sawOpcodeAfterEquals(seen); break; c...
[ "@", "Override", "public", "void", "sawOpcode", "(", "int", "seen", ")", "{", "try", "{", "switch", "(", "state", ")", "{", "case", "SAW_NOTHING", ":", "sawOpcodeAfterNothing", "(", "seen", ")", ";", "break", ";", "case", "SAW_EQUALS", ":", "sawOpcodeAfter...
implements the visitor to find continuations after finding a search result in a loop. @param seen the currently visitor opcode
[ "implements", "the", "visitor", "to", "find", "continuations", "after", "finding", "a", "search", "result", "in", "a", "loop", "." ]
3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8
https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/detect/SuspiciousLoopSearch.java#L121-L144
104,832
mebigfatguy/fb-contrib
src/main/java/com/mebigfatguy/fbcontrib/detect/LingeringGraphicsObjects.java
LingeringGraphicsObjects.visitClassContext
@Override public void visitClassContext(ClassContext classContext) { try { stack = new OpcodeStack(); graphicsRegs = new HashMap<Integer, Integer>(5); super.visitClassContext(classContext); } finally { stack = null; graphicsRegs = null; ...
java
@Override public void visitClassContext(ClassContext classContext) { try { stack = new OpcodeStack(); graphicsRegs = new HashMap<Integer, Integer>(5); super.visitClassContext(classContext); } finally { stack = null; graphicsRegs = null; ...
[ "@", "Override", "public", "void", "visitClassContext", "(", "ClassContext", "classContext", ")", "{", "try", "{", "stack", "=", "new", "OpcodeStack", "(", ")", ";", "graphicsRegs", "=", "new", "HashMap", "<", "Integer", ",", "Integer", ">", "(", "5", ")",...
overrides the visitor to set up the opcode stack @param classContext the context object of the currently parsed class
[ "overrides", "the", "visitor", "to", "set", "up", "the", "opcode", "stack" ]
3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8
https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/detect/LingeringGraphicsObjects.java#L80-L90
104,833
mebigfatguy/fb-contrib
src/main/java/com/mebigfatguy/fbcontrib/detect/PoorlyDefinedParameter.java
PoorlyDefinedParameter.visitCode
@Override public void visitCode(Code obj) { try { Method m = getMethod(); if (m.isSynthetic()) { return; } if (m.isStatic() || m.isPrivate() || Values.CONSTRUCTOR.equals(m.getName())) { parmSigs = SignatureUtils.getParameterSlo...
java
@Override public void visitCode(Code obj) { try { Method m = getMethod(); if (m.isSynthetic()) { return; } if (m.isStatic() || m.isPrivate() || Values.CONSTRUCTOR.equals(m.getName())) { parmSigs = SignatureUtils.getParameterSlo...
[ "@", "Override", "public", "void", "visitCode", "(", "Code", "obj", ")", "{", "try", "{", "Method", "m", "=", "getMethod", "(", ")", ";", "if", "(", "m", ".", "isSynthetic", "(", ")", ")", "{", "return", ";", "}", "if", "(", "m", ".", "isStatic",...
implements the visitor to see if the method has parameters @param obj the context object of the currently parsed code block
[ "implements", "the", "visitor", "to", "see", "if", "the", "method", "has", "parameters" ]
3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8
https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/detect/PoorlyDefinedParameter.java#L75-L98
104,834
mebigfatguy/fb-contrib
src/main/java/com/mebigfatguy/fbcontrib/detect/PoorlyDefinedParameter.java
PoorlyDefinedParameter.sawOpcode
@Override public void sawOpcode(int seen) { if (downwardBranchTarget == -1) { switch (state) { case SAW_NOTHING: sawOpcodeAfterNothing(seen); break; case SAW_LOAD: sawOpcodeAfterLoad(seen); b...
java
@Override public void sawOpcode(int seen) { if (downwardBranchTarget == -1) { switch (state) { case SAW_NOTHING: sawOpcodeAfterNothing(seen); break; case SAW_LOAD: sawOpcodeAfterLoad(seen); b...
[ "@", "Override", "public", "void", "sawOpcode", "(", "int", "seen", ")", "{", "if", "(", "downwardBranchTarget", "==", "-", "1", ")", "{", "switch", "(", "state", ")", "{", "case", "SAW_NOTHING", ":", "sawOpcodeAfterNothing", "(", "seen", ")", ";", "brea...
implements the visitor to look for check casts of parameters to more specific types
[ "implements", "the", "visitor", "to", "look", "for", "check", "casts", "of", "parameters", "to", "more", "specific", "types" ]
3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8
https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/detect/PoorlyDefinedParameter.java#L115-L151
104,835
mebigfatguy/fb-contrib
src/main/java/com/mebigfatguy/fbcontrib/detect/UnrelatedReturnValues.java
UnrelatedReturnValues.visitClassContext
@Override public void visitClassContext(ClassContext classContext) { try { currentClass = classContext.getJavaClass(); stack = new OpcodeStack(); returnTypes = new HashMap<>(); super.visitClassContext(classContext); } finally { currentClass...
java
@Override public void visitClassContext(ClassContext classContext) { try { currentClass = classContext.getJavaClass(); stack = new OpcodeStack(); returnTypes = new HashMap<>(); super.visitClassContext(classContext); } finally { currentClass...
[ "@", "Override", "public", "void", "visitClassContext", "(", "ClassContext", "classContext", ")", "{", "try", "{", "currentClass", "=", "classContext", ".", "getJavaClass", "(", ")", ";", "stack", "=", "new", "OpcodeStack", "(", ")", ";", "returnTypes", "=", ...
implements the visitor to create and destroy the stack and return types @param classContext the context object of the currently parsed class
[ "implements", "the", "visitor", "to", "create", "and", "destroy", "the", "stack", "and", "return", "types" ]
3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8
https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/detect/UnrelatedReturnValues.java#L70-L82
104,836
mebigfatguy/fb-contrib
src/main/java/com/mebigfatguy/fbcontrib/detect/UnrelatedReturnValues.java
UnrelatedReturnValues.visitCode
@Override public void visitCode(Code obj) { Method m = getMethod(); if (m.isSynthetic()) { return; } String signature = m.getSignature(); if (!signature.endsWith(")Ljava/lang/Object;")) { return; } stack.resetForMethodEntry(this); ...
java
@Override public void visitCode(Code obj) { Method m = getMethod(); if (m.isSynthetic()) { return; } String signature = m.getSignature(); if (!signature.endsWith(")Ljava/lang/Object;")) { return; } stack.resetForMethodEntry(this); ...
[ "@", "Override", "public", "void", "visitCode", "(", "Code", "obj", ")", "{", "Method", "m", "=", "getMethod", "(", ")", ";", "if", "(", "m", ".", "isSynthetic", "(", ")", ")", "{", "return", ";", "}", "String", "signature", "=", "m", ".", "getSign...
implements the visitor to see if the method returns Object, and if the method is defined in a superclass, or interface. @param obj the context object of the currently parsed code block
[ "implements", "the", "visitor", "to", "see", "if", "the", "method", "returns", "Object", "and", "if", "the", "method", "is", "defined", "in", "a", "superclass", "or", "interface", "." ]
3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8
https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/detect/UnrelatedReturnValues.java#L90-L140
104,837
mebigfatguy/fb-contrib
src/main/java/com/mebigfatguy/fbcontrib/detect/UnrelatedReturnValues.java
UnrelatedReturnValues.sawOpcode
@Override public void sawOpcode(int seen) { try { stack.precomputation(this); if ((seen == Const.ARETURN) && (stack.getStackDepth() > 0)) { OpcodeStack.Item itm = stack.getStackItem(0); if (!itm.isNull()) { returnTypes.put(itm.getJ...
java
@Override public void sawOpcode(int seen) { try { stack.precomputation(this); if ((seen == Const.ARETURN) && (stack.getStackDepth() > 0)) { OpcodeStack.Item itm = stack.getStackItem(0); if (!itm.isNull()) { returnTypes.put(itm.getJ...
[ "@", "Override", "public", "void", "sawOpcode", "(", "int", "seen", ")", "{", "try", "{", "stack", ".", "precomputation", "(", "this", ")", ";", "if", "(", "(", "seen", "==", "Const", ".", "ARETURN", ")", "&&", "(", "stack", ".", "getStackDepth", "("...
implements the visitor to find return values where the types of objects returned from the method are related only by object. @param seen the opcode of the currently parsed instruction
[ "implements", "the", "visitor", "to", "find", "return", "values", "where", "the", "types", "of", "objects", "returned", "from", "the", "method", "are", "related", "only", "by", "object", "." ]
3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8
https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/detect/UnrelatedReturnValues.java#L148-L164
104,838
mebigfatguy/fb-contrib
src/main/java/com/mebigfatguy/fbcontrib/detect/UnrelatedReturnValues.java
UnrelatedReturnValues.findCommonType
@Nullable private static JavaClass findCommonType(Set<JavaClass> classes) throws ClassNotFoundException { Set<JavaClass> possibleCommonTypes = new HashSet<>(); boolean populate = true; for (JavaClass cls : classes) { if (cls == null) { return null; } ...
java
@Nullable private static JavaClass findCommonType(Set<JavaClass> classes) throws ClassNotFoundException { Set<JavaClass> possibleCommonTypes = new HashSet<>(); boolean populate = true; for (JavaClass cls : classes) { if (cls == null) { return null; } ...
[ "@", "Nullable", "private", "static", "JavaClass", "findCommonType", "(", "Set", "<", "JavaClass", ">", "classes", ")", "throws", "ClassNotFoundException", "{", "Set", "<", "JavaClass", ">", "possibleCommonTypes", "=", "new", "HashSet", "<>", "(", ")", ";", "b...
looks for a common superclass or interface for all the passed in types @param classes the set of classes to look for a common super class or interface @return the type that is the common interface or superclass (not Object, tho). @throws ClassNotFoundException if a superclass or superinterface of one of the class is ...
[ "looks", "for", "a", "common", "superclass", "or", "interface", "for", "all", "the", "passed", "in", "types" ]
3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8
https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/detect/UnrelatedReturnValues.java#L176-L215
104,839
mebigfatguy/fb-contrib
src/main/java/com/mebigfatguy/fbcontrib/detect/SideEffectConstructor.java
SideEffectConstructor.visitCode
@Override public void visitCode(Code obj) { state = State.SAW_NOTHING; stack.resetForMethodEntry(this); super.visitCode(obj); }
java
@Override public void visitCode(Code obj) { state = State.SAW_NOTHING; stack.resetForMethodEntry(this); super.visitCode(obj); }
[ "@", "Override", "public", "void", "visitCode", "(", "Code", "obj", ")", "{", "state", "=", "State", ".", "SAW_NOTHING", ";", "stack", ".", "resetForMethodEntry", "(", "this", ")", ";", "super", ".", "visitCode", "(", "obj", ")", ";", "}" ]
overrides the visitor to reset the state and reset the opcode stack @param obj the context object of the currently parsed code
[ "overrides", "the", "visitor", "to", "reset", "the", "state", "and", "reset", "the", "opcode", "stack" ]
3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8
https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/detect/SideEffectConstructor.java#L82-L87
104,840
mebigfatguy/fb-contrib
src/main/java/com/mebigfatguy/fbcontrib/detect/SideEffectConstructor.java
SideEffectConstructor.sawOpcode
@Override public void sawOpcode(int seen) { int pc = 0; try { stack.precomputation(this); switch (state) { case SAW_NOTHING: pc = sawOpcodeAfterNothing(seen); break; case SAW_CTOR: if ((...
java
@Override public void sawOpcode(int seen) { int pc = 0; try { stack.precomputation(this); switch (state) { case SAW_NOTHING: pc = sawOpcodeAfterNothing(seen); break; case SAW_CTOR: if ((...
[ "@", "Override", "public", "void", "sawOpcode", "(", "int", "seen", ")", "{", "int", "pc", "=", "0", ";", "try", "{", "stack", ".", "precomputation", "(", "this", ")", ";", "switch", "(", "state", ")", "{", "case", "SAW_NOTHING", ":", "pc", "=", "s...
overrides the visitor to look for constructors who's value is popped off the stack, and not assigned before the pop of the value, or if a return is issued with that object still on the stack. @param seen the opcode of the currently parse opcode
[ "overrides", "the", "visitor", "to", "look", "for", "constructors", "who", "s", "value", "is", "popped", "off", "the", "stack", "and", "not", "assigned", "before", "the", "pop", "of", "the", "value", "or", "if", "a", "return", "is", "issued", "with", "th...
3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8
https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/detect/SideEffectConstructor.java#L96-L124
104,841
mebigfatguy/fb-contrib
src/main/java/com/mebigfatguy/fbcontrib/detect/ClassEnvy.java
ClassEnvy.visitClassContext
@Override public void visitClassContext(final ClassContext classContext) { try { JavaClass cls = classContext.getJavaClass(); packageName = cls.getPackageName(); clsName = cls.getClassName(); parentClassName = cls.getSuperclassName(); stack = new O...
java
@Override public void visitClassContext(final ClassContext classContext) { try { JavaClass cls = classContext.getJavaClass(); packageName = cls.getPackageName(); clsName = cls.getClassName(); parentClassName = cls.getSuperclassName(); stack = new O...
[ "@", "Override", "public", "void", "visitClassContext", "(", "final", "ClassContext", "classContext", ")", "{", "try", "{", "JavaClass", "cls", "=", "classContext", ".", "getJavaClass", "(", ")", ";", "packageName", "=", "cls", ".", "getPackageName", "(", ")",...
overrides the visitor to collect package and class names @param classContext the context object that holds the JavaClass being parsed
[ "overrides", "the", "visitor", "to", "collect", "package", "and", "class", "names" ]
3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8
https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/detect/ClassEnvy.java#L110-L126
104,842
mebigfatguy/fb-contrib
src/main/java/com/mebigfatguy/fbcontrib/detect/ClassEnvy.java
ClassEnvy.visitMethod
@Override public void visitMethod(final Method obj) { methodName = obj.getName(); methodIsStatic = obj.isStatic(); }
java
@Override public void visitMethod(final Method obj) { methodName = obj.getName(); methodIsStatic = obj.isStatic(); }
[ "@", "Override", "public", "void", "visitMethod", "(", "final", "Method", "obj", ")", "{", "methodName", "=", "obj", ".", "getName", "(", ")", ";", "methodIsStatic", "=", "obj", ".", "isStatic", "(", ")", ";", "}" ]
overrides the visitor to check whether the method is static @param obj the method currently being parsed
[ "overrides", "the", "visitor", "to", "check", "whether", "the", "method", "is", "static" ]
3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8
https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/detect/ClassEnvy.java#L134-L138
104,843
mebigfatguy/fb-contrib
src/main/java/com/mebigfatguy/fbcontrib/detect/ClassEnvy.java
ClassEnvy.visitCode
@Override @SuppressWarnings("unchecked") public void visitCode(final Code obj) { stack.resetForMethodEntry(this); thisClsAccessCount = 0; if (Values.STATIC_INITIALIZER.equals(methodName)) { return; } clsAccessCount = new HashMap<>(); super.visitCode(o...
java
@Override @SuppressWarnings("unchecked") public void visitCode(final Code obj) { stack.resetForMethodEntry(this); thisClsAccessCount = 0; if (Values.STATIC_INITIALIZER.equals(methodName)) { return; } clsAccessCount = new HashMap<>(); super.visitCode(o...
[ "@", "Override", "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "void", "visitCode", "(", "final", "Code", "obj", ")", "{", "stack", ".", "resetForMethodEntry", "(", "this", ")", ";", "thisClsAccessCount", "=", "0", ";", "if", "(", "Values", ...
overrides the visitor to look for the method that uses another class the most, and if it exceeds the threshold reports it @param obj the code that is currently being parsed
[ "overrides", "the", "visitor", "to", "look", "for", "the", "method", "that", "uses", "another", "class", "the", "most", "and", "if", "it", "exceeds", "the", "threshold", "reports", "it" ]
3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8
https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/detect/ClassEnvy.java#L146-L191
104,844
mebigfatguy/fb-contrib
src/main/java/com/mebigfatguy/fbcontrib/detect/ClassEnvy.java
ClassEnvy.sawOpcode
@Override public void sawOpcode(final int seen) { try { stack.precomputation(this); if (OpcodeUtils.isStandardInvoke(seen)) { String calledClass = getDottedClassConstantOperand(); if (seen == Const.INVOKEINTERFACE) { int parmCount...
java
@Override public void sawOpcode(final int seen) { try { stack.precomputation(this); if (OpcodeUtils.isStandardInvoke(seen)) { String calledClass = getDottedClassConstantOperand(); if (seen == Const.INVOKEINTERFACE) { int parmCount...
[ "@", "Override", "public", "void", "sawOpcode", "(", "final", "int", "seen", ")", "{", "try", "{", "stack", ".", "precomputation", "(", "this", ")", ";", "if", "(", "OpcodeUtils", ".", "isStandardInvoke", "(", "seen", ")", ")", "{", "String", "calledClas...
overrides the visitor to look for method calls, and populate a class access count map based on the owning class of methods called. @param seen the opcode currently being parsed
[ "overrides", "the", "visitor", "to", "look", "for", "method", "calls", "and", "populate", "a", "class", "access", "count", "map", "based", "on", "the", "owning", "class", "of", "methods", "called", "." ]
3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8
https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/detect/ClassEnvy.java#L199-L227
104,845
mebigfatguy/fb-contrib
src/main/java/com/mebigfatguy/fbcontrib/detect/ClassEnvy.java
ClassEnvy.implementsCommonInterface
private boolean implementsCommonInterface(String name) { try { JavaClass cls = Repository.lookupClass(name); JavaClass[] infs = cls.getAllInterfaces(); for (JavaClass inf : infs) { String infName = inf.getClassName(); if (ignorableInterfaces.c...
java
private boolean implementsCommonInterface(String name) { try { JavaClass cls = Repository.lookupClass(name); JavaClass[] infs = cls.getAllInterfaces(); for (JavaClass inf : infs) { String infName = inf.getClassName(); if (ignorableInterfaces.c...
[ "private", "boolean", "implementsCommonInterface", "(", "String", "name", ")", "{", "try", "{", "JavaClass", "cls", "=", "Repository", ".", "lookupClass", "(", "name", ")", ";", "JavaClass", "[", "]", "infs", "=", "cls", ".", "getAllInterfaces", "(", ")", ...
return whether or not a class implements a common or marker interface @param name the class name to check @return if this class implements a common or marker interface
[ "return", "whether", "or", "not", "a", "class", "implements", "a", "common", "or", "marker", "interface" ]
3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8
https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/detect/ClassEnvy.java#L237-L257
104,846
mebigfatguy/fb-contrib
src/main/java/com/mebigfatguy/fbcontrib/detect/ClassEnvy.java
ClassEnvy.countClassAccess
private boolean countClassAccess(final int classAtStackIndex) { String calledClass; try { if (stack.getStackDepth() > classAtStackIndex) { OpcodeStack.Item itm = stack.getStackItem(classAtStackIndex); JavaClass cls = itm.getJavaClass(); if (cl...
java
private boolean countClassAccess(final int classAtStackIndex) { String calledClass; try { if (stack.getStackDepth() > classAtStackIndex) { OpcodeStack.Item itm = stack.getStackItem(classAtStackIndex); JavaClass cls = itm.getJavaClass(); if (cl...
[ "private", "boolean", "countClassAccess", "(", "final", "int", "classAtStackIndex", ")", "{", "String", "calledClass", ";", "try", "{", "if", "(", "stack", ".", "getStackDepth", "(", ")", ">", "classAtStackIndex", ")", "{", "OpcodeStack", ".", "Item", "itm", ...
increment the count of class access of the class on the stack @param classAtStackIndex the position on the stack of the class in question @return true if the class is counted
[ "increment", "the", "count", "of", "class", "access", "of", "the", "class", "on", "the", "stack" ]
3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8
https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/detect/ClassEnvy.java#L267-L285
104,847
mebigfatguy/fb-contrib
src/main/java/com/mebigfatguy/fbcontrib/detect/ClassEnvy.java
ClassEnvy.countClassAccess
private void countClassAccess(final @DottedClassName String calledClass) { if (calledClass.equals(clsName) || isAssociatedClass(calledClass)) { if (getPrevOpcode(1) != Const.ALOAD_0) { thisClsAccessCount++; } } else { String calledPackage = SignatureUt...
java
private void countClassAccess(final @DottedClassName String calledClass) { if (calledClass.equals(clsName) || isAssociatedClass(calledClass)) { if (getPrevOpcode(1) != Const.ALOAD_0) { thisClsAccessCount++; } } else { String calledPackage = SignatureUt...
[ "private", "void", "countClassAccess", "(", "final", "@", "DottedClassName", "String", "calledClass", ")", "{", "if", "(", "calledClass", ".", "equals", "(", "clsName", ")", "||", "isAssociatedClass", "(", "calledClass", ")", ")", "{", "if", "(", "getPrevOpcod...
increment the count of class access of the specified class if it is in a similar package to the caller, and is not general purpose @param calledClass the class to check
[ "increment", "the", "count", "of", "class", "access", "of", "the", "specified", "class", "if", "it", "is", "in", "a", "similar", "package", "to", "the", "caller", "and", "is", "not", "general", "purpose" ]
3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8
https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/detect/ClassEnvy.java#L293-L311
104,848
mebigfatguy/fb-contrib
src/main/java/com/mebigfatguy/fbcontrib/detect/ClassEnvy.java
ClassEnvy.addLineNumber
private void addLineNumber(BitSet lineNumbers) { LineNumberTable lnt = getCode().getLineNumberTable(); if (lnt == null) { lineNumbers.set(0); } else { int line = lnt.getSourceLine(getPC()); if (line < 0) { lineNumbers.set(lineNumbers.size()); ...
java
private void addLineNumber(BitSet lineNumbers) { LineNumberTable lnt = getCode().getLineNumberTable(); if (lnt == null) { lineNumbers.set(0); } else { int line = lnt.getSourceLine(getPC()); if (line < 0) { lineNumbers.set(lineNumbers.size()); ...
[ "private", "void", "addLineNumber", "(", "BitSet", "lineNumbers", ")", "{", "LineNumberTable", "lnt", "=", "getCode", "(", ")", ".", "getLineNumberTable", "(", ")", ";", "if", "(", "lnt", "==", "null", ")", "{", "lineNumbers", ".", "set", "(", "0", ")", ...
add the current line number to a set of line numbers @param lineNumbers the current set of line numbers
[ "add", "the", "current", "line", "number", "to", "a", "set", "of", "line", "numbers" ]
3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8
https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/detect/ClassEnvy.java#L346-L358
104,849
mebigfatguy/fb-contrib
src/main/java/com/mebigfatguy/fbcontrib/detect/ClassEnvy.java
ClassEnvy.generalPurpose
@edu.umd.cs.findbugs.annotations.SuppressFBWarnings(value = "EXS_EXCEPTION_SOFTENING_RETURN_FALSE", justification = "No other simple way to determine whether class exists") private boolean generalPurpose(final String className) { if (className.startsWith("java.") || className.startsWith("javax.")) { ...
java
@edu.umd.cs.findbugs.annotations.SuppressFBWarnings(value = "EXS_EXCEPTION_SOFTENING_RETURN_FALSE", justification = "No other simple way to determine whether class exists") private boolean generalPurpose(final String className) { if (className.startsWith("java.") || className.startsWith("javax.")) { ...
[ "@", "edu", ".", "umd", ".", "cs", ".", "findbugs", ".", "annotations", ".", "SuppressFBWarnings", "(", "value", "=", "\"EXS_EXCEPTION_SOFTENING_RETURN_FALSE\"", ",", "justification", "=", "\"No other simple way to determine whether class exists\"", ")", "private", "boole...
checks to see if the specified class is a built in class, or implements a simple interface @param className the class in question @return whether or not the class is general purpose
[ "checks", "to", "see", "if", "the", "specified", "class", "is", "a", "built", "in", "class", "or", "implements", "a", "simple", "interface" ]
3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8
https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/detect/ClassEnvy.java#L368-L405
104,850
mebigfatguy/fb-contrib
src/main/java/com/mebigfatguy/fbcontrib/detect/ReflectionOnObjectMethods.java
ReflectionOnObjectMethods.visitClassContext
@Override public void visitClassContext(ClassContext classContext) { try { stack = new OpcodeStack(); localClassTypes = new HashMap<>(); fieldClassTypes = new HashMap<>(); JavaClass cls = classContext.getJavaClass(); Method staticInit = findStaticI...
java
@Override public void visitClassContext(ClassContext classContext) { try { stack = new OpcodeStack(); localClassTypes = new HashMap<>(); fieldClassTypes = new HashMap<>(); JavaClass cls = classContext.getJavaClass(); Method staticInit = findStaticI...
[ "@", "Override", "public", "void", "visitClassContext", "(", "ClassContext", "classContext", ")", "{", "try", "{", "stack", "=", "new", "OpcodeStack", "(", ")", ";", "localClassTypes", "=", "new", "HashMap", "<>", "(", ")", ";", "fieldClassTypes", "=", "new"...
implements the visitor to create the stack and local and field maps for Class arrays to be used for getting the reflection method @param classContext the context object of the currently parse class
[ "implements", "the", "visitor", "to", "create", "the", "stack", "and", "local", "and", "field", "maps", "for", "Class", "arrays", "to", "be", "used", "for", "getting", "the", "reflection", "method" ]
3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8
https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/detect/ReflectionOnObjectMethods.java#L86-L105
104,851
mebigfatguy/fb-contrib
src/main/java/com/mebigfatguy/fbcontrib/detect/ReflectionOnObjectMethods.java
ReflectionOnObjectMethods.findStaticInitializer
@Nullable private static Method findStaticInitializer(JavaClass cls) { Method[] methods = cls.getMethods(); for (Method m : methods) { if (Values.STATIC_INITIALIZER.equals(m.getName())) { return m; } } return null; }
java
@Nullable private static Method findStaticInitializer(JavaClass cls) { Method[] methods = cls.getMethods(); for (Method m : methods) { if (Values.STATIC_INITIALIZER.equals(m.getName())) { return m; } } return null; }
[ "@", "Nullable", "private", "static", "Method", "findStaticInitializer", "(", "JavaClass", "cls", ")", "{", "Method", "[", "]", "methods", "=", "cls", ".", "getMethods", "(", ")", ";", "for", "(", "Method", "m", ":", "methods", ")", "{", "if", "(", "Va...
finds the method that is the static initializer for the class @param cls the class to find the initializer for @return the Method of the static initializer or null if this class has none
[ "finds", "the", "method", "that", "is", "the", "static", "initializer", "for", "the", "class" ]
3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8
https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/detect/ReflectionOnObjectMethods.java#L275-L285
104,852
mebigfatguy/fb-contrib
src/main/java/com/mebigfatguy/fbcontrib/detect/BuryingLogic.java
BuryingLogic.visitClassContext
@Override public void visitClassContext(ClassContext classContext) { try { stack = new OpcodeStack(); ifBlocks = new IfBlocks(); gotoBranchPCs = new BitSet(); casePositions = new BitSet(); super.visitClassContext(classContext); } finally { ...
java
@Override public void visitClassContext(ClassContext classContext) { try { stack = new OpcodeStack(); ifBlocks = new IfBlocks(); gotoBranchPCs = new BitSet(); casePositions = new BitSet(); super.visitClassContext(classContext); } finally { ...
[ "@", "Override", "public", "void", "visitClassContext", "(", "ClassContext", "classContext", ")", "{", "try", "{", "stack", "=", "new", "OpcodeStack", "(", ")", ";", "ifBlocks", "=", "new", "IfBlocks", "(", ")", ";", "gotoBranchPCs", "=", "new", "BitSet", ...
implements the visitor to reset the opcode stack, and initialize if tracking collections @param classContext the currently parsed java class
[ "implements", "the", "visitor", "to", "reset", "the", "opcode", "stack", "and", "initialize", "if", "tracking", "collections" ]
3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8
https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/detect/BuryingLogic.java#L132-L147
104,853
mebigfatguy/fb-contrib
src/main/java/com/mebigfatguy/fbcontrib/detect/BuryingLogic.java
BuryingLogic.isResetOp
private boolean isResetOp(int seen) { return resetOps.get(seen) || OpcodeUtils.isStore(seen) || OpcodeUtils.isReturn(seen) || ((OpcodeUtils.isInvoke(seen) && getSigConstantOperand().endsWith(")V")) || (isBranch(seen) && (getBranchOffset() < 0))); }
java
private boolean isResetOp(int seen) { return resetOps.get(seen) || OpcodeUtils.isStore(seen) || OpcodeUtils.isReturn(seen) || ((OpcodeUtils.isInvoke(seen) && getSigConstantOperand().endsWith(")V")) || (isBranch(seen) && (getBranchOffset() < 0))); }
[ "private", "boolean", "isResetOp", "(", "int", "seen", ")", "{", "return", "resetOps", ".", "get", "(", "seen", ")", "||", "OpcodeUtils", ".", "isStore", "(", "seen", ")", "||", "OpcodeUtils", ".", "isReturn", "(", "seen", ")", "||", "(", "(", "OpcodeU...
determines if this opcode couldn't be part of a conditional expression or at least is very unlikely to be so. @param seen the currently parse opcode @return if this operation resets the looking for conditionals
[ "determines", "if", "this", "opcode", "couldn", "t", "be", "part", "of", "a", "conditional", "expression", "or", "at", "least", "is", "very", "unlikely", "to", "be", "so", "." ]
3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8
https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/detect/BuryingLogic.java#L282-L285
104,854
mebigfatguy/fb-contrib
src/main/java/com/mebigfatguy/fbcontrib/detect/ModifyingUnmodifiableCollection.java
ModifyingUnmodifiableCollection.visitCode
@Override public void visitCode(Code obj) { try { stack.resetForMethodEntry(this); reportedType = ImmutabilityType.UNKNOWN; super.visitCode(obj); } catch (StopOpcodeParsingException e) { // report type is immutable } }
java
@Override public void visitCode(Code obj) { try { stack.resetForMethodEntry(this); reportedType = ImmutabilityType.UNKNOWN; super.visitCode(obj); } catch (StopOpcodeParsingException e) { // report type is immutable } }
[ "@", "Override", "public", "void", "visitCode", "(", "Code", "obj", ")", "{", "try", "{", "stack", ".", "resetForMethodEntry", "(", "this", ")", ";", "reportedType", "=", "ImmutabilityType", ".", "UNKNOWN", ";", "super", ".", "visitCode", "(", "obj", ")", ...
overrides the visitor to reset the opcode stack, and reset the reported immutability of the method @param obj the context object of the currently parse code block
[ "overrides", "the", "visitor", "to", "reset", "the", "opcode", "stack", "and", "reset", "the", "reported", "immutability", "of", "the", "method" ]
3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8
https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/detect/ModifyingUnmodifiableCollection.java#L102-L111
104,855
mebigfatguy/fb-contrib
src/main/java/com/mebigfatguy/fbcontrib/detect/ModifyingUnmodifiableCollection.java
ModifyingUnmodifiableCollection.sawOpcode
@Override public void sawOpcode(int seen) { ImmutabilityType imType = null; try { stack.precomputation(this); switch (seen) { case Const.INVOKESTATIC: case Const.INVOKEINTERFACE: case Const.INVOKESPECIAL: case ...
java
@Override public void sawOpcode(int seen) { ImmutabilityType imType = null; try { stack.precomputation(this); switch (seen) { case Const.INVOKESTATIC: case Const.INVOKEINTERFACE: case Const.INVOKESPECIAL: case ...
[ "@", "Override", "public", "void", "sawOpcode", "(", "int", "seen", ")", "{", "ImmutabilityType", "imType", "=", "null", ";", "try", "{", "stack", ".", "precomputation", "(", "this", ")", ";", "switch", "(", "seen", ")", "{", "case", "Const", ".", "INV...
overrides the visitor to find method mutations on collections that have previously been determined to have been created as immutable collections @param seen the currently parsed opcode
[ "overrides", "the", "visitor", "to", "find", "method", "mutations", "on", "collections", "that", "have", "previously", "been", "determined", "to", "have", "been", "created", "as", "immutable", "collections" ]
3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8
https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/detect/ModifyingUnmodifiableCollection.java#L119-L172
104,856
simbiose/Encryption
Encryption/main/se/simbio/encryption/Encryption.java
Encryption.encrypt
public String encrypt(String data) throws UnsupportedEncodingException, NoSuchAlgorithmException, NoSuchPaddingException, InvalidAlgorithmParameterException, InvalidKeyException, InvalidKeySpecException, BadPaddingException, IllegalBlockSizeException { if (data == null) return null; SecretKey secretKey ...
java
public String encrypt(String data) throws UnsupportedEncodingException, NoSuchAlgorithmException, NoSuchPaddingException, InvalidAlgorithmParameterException, InvalidKeyException, InvalidKeySpecException, BadPaddingException, IllegalBlockSizeException { if (data == null) return null; SecretKey secretKey ...
[ "public", "String", "encrypt", "(", "String", "data", ")", "throws", "UnsupportedEncodingException", ",", "NoSuchAlgorithmException", ",", "NoSuchPaddingException", ",", "InvalidAlgorithmParameterException", ",", "InvalidKeyException", ",", "InvalidKeySpecException", ",", "Ba...
Encrypt a String @param data the String to be encrypted @return the encrypted String or {@code null} if you send the data as {@code null} @throws UnsupportedEncodingException if the Builder charset name is not supported or if the Builder charset name is not supported @throws NoSuchAlgorithmException ...
[ "Encrypt", "a", "String" ]
a344761a10add131cbe9962f895b416e5217d0e9
https://github.com/simbiose/Encryption/blob/a344761a10add131cbe9962f895b416e5217d0e9/Encryption/main/se/simbio/encryption/Encryption.java#L88-L95
104,857
simbiose/Encryption
Encryption/main/se/simbio/encryption/Encryption.java
Encryption.encryptAsync
public void encryptAsync(final String data, final Callback callback) { if (callback == null) return; new Thread(new Runnable() { @Override public void run() { try { String encrypt = encrypt(data); if (encrypt == null) { ...
java
public void encryptAsync(final String data, final Callback callback) { if (callback == null) return; new Thread(new Runnable() { @Override public void run() { try { String encrypt = encrypt(data); if (encrypt == null) { ...
[ "public", "void", "encryptAsync", "(", "final", "String", "data", ",", "final", "Callback", "callback", ")", "{", "if", "(", "callback", "==", "null", ")", "return", ";", "new", "Thread", "(", "new", "Runnable", "(", ")", "{", "@", "Override", "public", ...
This is a sugar method that calls encrypt method in background, it is a good idea to use this one instead the default method because encryption can take several time and with this method the process occurs in a AsyncTask, other advantage is the Callback with separated methods, one for success and other for the exceptio...
[ "This", "is", "a", "sugar", "method", "that", "calls", "encrypt", "method", "in", "background", "it", "is", "a", "good", "idea", "to", "use", "this", "one", "instead", "the", "default", "method", "because", "encryption", "can", "take", "several", "time", "...
a344761a10add131cbe9962f895b416e5217d0e9
https://github.com/simbiose/Encryption/blob/a344761a10add131cbe9962f895b416e5217d0e9/Encryption/main/se/simbio/encryption/Encryption.java#L123-L139
104,858
simbiose/Encryption
Encryption/main/se/simbio/encryption/Encryption.java
Encryption.decrypt
public String decrypt(String data) throws UnsupportedEncodingException, NoSuchAlgorithmException, InvalidKeySpecException, NoSuchPaddingException, InvalidAlgorithmParameterException, InvalidKeyException, BadPaddingException, IllegalBlockSizeException { if (data == null) return null; byte[] dataBytes = B...
java
public String decrypt(String data) throws UnsupportedEncodingException, NoSuchAlgorithmException, InvalidKeySpecException, NoSuchPaddingException, InvalidAlgorithmParameterException, InvalidKeyException, BadPaddingException, IllegalBlockSizeException { if (data == null) return null; byte[] dataBytes = B...
[ "public", "String", "decrypt", "(", "String", "data", ")", "throws", "UnsupportedEncodingException", ",", "NoSuchAlgorithmException", ",", "InvalidKeySpecException", ",", "NoSuchPaddingException", ",", "InvalidAlgorithmParameterException", ",", "InvalidKeyException", ",", "Ba...
Decrypt a String @param data the String to be decrypted @return the decrypted String or {@code null} if you send the data as {@code null} @throws UnsupportedEncodingException if the Builder charset name is not supported or if the Builder charset name is not supported @throws NoSuchAlgorithmException ...
[ "Decrypt", "a", "String" ]
a344761a10add131cbe9962f895b416e5217d0e9
https://github.com/simbiose/Encryption/blob/a344761a10add131cbe9962f895b416e5217d0e9/Encryption/main/se/simbio/encryption/Encryption.java#L173-L181
104,859
simbiose/Encryption
Encryption/main/se/simbio/encryption/Encryption.java
Encryption.decryptAsync
public void decryptAsync(final String data, final Callback callback) { if (callback == null) return; new Thread(new Runnable() { @Override public void run() { try { String decrypt = decrypt(data); if (decrypt == null) { ...
java
public void decryptAsync(final String data, final Callback callback) { if (callback == null) return; new Thread(new Runnable() { @Override public void run() { try { String decrypt = decrypt(data); if (decrypt == null) { ...
[ "public", "void", "decryptAsync", "(", "final", "String", "data", ",", "final", "Callback", "callback", ")", "{", "if", "(", "callback", "==", "null", ")", "return", ";", "new", "Thread", "(", "new", "Runnable", "(", ")", "{", "@", "Override", "public", ...
This is a sugar method that calls decrypt method in background, it is a good idea to use this one instead the default method because decryption can take several time and with this method the process occurs in a AsyncTask, other advantage is the Callback with separated methods, one for success and other for the exceptio...
[ "This", "is", "a", "sugar", "method", "that", "calls", "decrypt", "method", "in", "background", "it", "is", "a", "good", "idea", "to", "use", "this", "one", "instead", "the", "default", "method", "because", "decryption", "can", "take", "several", "time", "...
a344761a10add131cbe9962f895b416e5217d0e9
https://github.com/simbiose/Encryption/blob/a344761a10add131cbe9962f895b416e5217d0e9/Encryption/main/se/simbio/encryption/Encryption.java#L209-L225
104,860
simbiose/Encryption
Encryption/main/se/simbio/encryption/Encryption.java
Encryption.getSecretKey
private SecretKey getSecretKey(char[] key) throws NoSuchAlgorithmException, UnsupportedEncodingException, InvalidKeySpecException { SecretKeyFactory factory = SecretKeyFactory.getInstance(mBuilder.getSecretKeyType()); KeySpec spec = new PBEKeySpec(key, mBuilder.getSalt().getBytes(mBuilder.getCharsetName...
java
private SecretKey getSecretKey(char[] key) throws NoSuchAlgorithmException, UnsupportedEncodingException, InvalidKeySpecException { SecretKeyFactory factory = SecretKeyFactory.getInstance(mBuilder.getSecretKeyType()); KeySpec spec = new PBEKeySpec(key, mBuilder.getSalt().getBytes(mBuilder.getCharsetName...
[ "private", "SecretKey", "getSecretKey", "(", "char", "[", "]", "key", ")", "throws", "NoSuchAlgorithmException", ",", "UnsupportedEncodingException", ",", "InvalidKeySpecException", "{", "SecretKeyFactory", "factory", "=", "SecretKeyFactory", ".", "getInstance", "(", "m...
creates a 128bit salted aes key @param key encoded input key @return aes 128 bit salted key @throws NoSuchAlgorithmException if no installed provider that can provide the requested by the Builder secret key type @throws UnsupportedEncodingException if the Builder charset name is not supported @throws InvalidKeyS...
[ "creates", "a", "128bit", "salted", "aes", "key" ]
a344761a10add131cbe9962f895b416e5217d0e9
https://github.com/simbiose/Encryption/blob/a344761a10add131cbe9962f895b416e5217d0e9/Encryption/main/se/simbio/encryption/Encryption.java#L241-L246
104,861
simbiose/Encryption
Encryption/main/se/simbio/encryption/Encryption.java
Encryption.hashTheKey
private char[] hashTheKey(String key) throws UnsupportedEncodingException, NoSuchAlgorithmException { MessageDigest messageDigest = MessageDigest.getInstance(mBuilder.getDigestAlgorithm()); messageDigest.update(key.getBytes(mBuilder.getCharsetName())); return Base64.encodeToString(messageDigest....
java
private char[] hashTheKey(String key) throws UnsupportedEncodingException, NoSuchAlgorithmException { MessageDigest messageDigest = MessageDigest.getInstance(mBuilder.getDigestAlgorithm()); messageDigest.update(key.getBytes(mBuilder.getCharsetName())); return Base64.encodeToString(messageDigest....
[ "private", "char", "[", "]", "hashTheKey", "(", "String", "key", ")", "throws", "UnsupportedEncodingException", ",", "NoSuchAlgorithmException", "{", "MessageDigest", "messageDigest", "=", "MessageDigest", ".", "getInstance", "(", "mBuilder", ".", "getDigestAlgorithm", ...
takes in a simple string and performs an sha1 hash that is 128 bits long...we then base64 encode it and return the char array @param key simple inputted string @return sha1 base64 encoded representation @throws UnsupportedEncodingException if the Builder charset name is not supported @throws NoSuchAlgorithmException...
[ "takes", "in", "a", "simple", "string", "and", "performs", "an", "sha1", "hash", "that", "is", "128", "bits", "long", "...", "we", "then", "base64", "encode", "it", "and", "return", "the", "char", "array" ]
a344761a10add131cbe9962f895b416e5217d0e9
https://github.com/simbiose/Encryption/blob/a344761a10add131cbe9962f895b416e5217d0e9/Encryption/main/se/simbio/encryption/Encryption.java#L261-L265
104,862
asciidoctor/asciidoclet
src/main/java/org/asciidoctor/asciidoclet/AsciidoctorRenderer.java
AsciidoctorRenderer.renderTag
private void renderTag(Tag tag, StringBuilder buffer) { buffer.append(tag.name()).append(' '); // Special handling for @param <T> tags // See http://docs.oracle.com/javase/1.5.0/docs/tooldocs/windows/javadoc.html#@param if ((tag instanceof ParamTag) && ((ParamTag) tag).isTypeParameter())...
java
private void renderTag(Tag tag, StringBuilder buffer) { buffer.append(tag.name()).append(' '); // Special handling for @param <T> tags // See http://docs.oracle.com/javase/1.5.0/docs/tooldocs/windows/javadoc.html#@param if ((tag instanceof ParamTag) && ((ParamTag) tag).isTypeParameter())...
[ "private", "void", "renderTag", "(", "Tag", "tag", ",", "StringBuilder", "buffer", ")", "{", "buffer", ".", "append", "(", "tag", ".", "name", "(", ")", ")", ".", "append", "(", "'", "'", ")", ";", "// Special handling for @param <T> tags", "// See http://do...
Renders a document tag in the standard way. @param tag input @param buffer output buffer
[ "Renders", "a", "document", "tag", "in", "the", "standard", "way", "." ]
6c43ce214e48797d2b5e8d59c31b65304279717b
https://github.com/asciidoctor/asciidoclet/blob/6c43ce214e48797d2b5e8d59c31b65304279717b/src/main/java/org/asciidoctor/asciidoclet/AsciidoctorRenderer.java#L129-L143
104,863
asciidoctor/asciidoclet
src/main/java/org/asciidoctor/asciidoclet/AsciidoctorRenderer.java
AsciidoctorRenderer.render
private String render(String input, boolean inline) { if (input.trim().isEmpty()) { return ""; } options.setDocType(inline ? INLINE_DOCTYPE : null); return asciidoctor.render(cleanJavadocInput(input), options); }
java
private String render(String input, boolean inline) { if (input.trim().isEmpty()) { return ""; } options.setDocType(inline ? INLINE_DOCTYPE : null); return asciidoctor.render(cleanJavadocInput(input), options); }
[ "private", "String", "render", "(", "String", "input", ",", "boolean", "inline", ")", "{", "if", "(", "input", ".", "trim", "(", ")", ".", "isEmpty", "(", ")", ")", "{", "return", "\"\"", ";", "}", "options", ".", "setDocType", "(", "inline", "?", ...
Renders the input using Asciidoctor. The source is first cleaned by stripping any trailing space after an end line (e.g., `"\n "`), which gets left behind by the Javadoc processor. @param input AsciiDoc source @return content rendered by Asciidoctor
[ "Renders", "the", "input", "using", "Asciidoctor", "." ]
6c43ce214e48797d2b5e8d59c31b65304279717b
https://github.com/asciidoctor/asciidoclet/blob/6c43ce214e48797d2b5e8d59c31b65304279717b/src/main/java/org/asciidoctor/asciidoclet/AsciidoctorRenderer.java#L155-L161
104,864
asciidoctor/asciidoclet
src/main/java/org/asciidoctor/Asciidoclet.java
Asciidoclet.validOptions
@SuppressWarnings("UnusedDeclaration") public static boolean validOptions(String[][] options, DocErrorReporter errorReporter) { return validOptions(options, errorReporter, new StandardAdapter()); }
java
@SuppressWarnings("UnusedDeclaration") public static boolean validOptions(String[][] options, DocErrorReporter errorReporter) { return validOptions(options, errorReporter, new StandardAdapter()); }
[ "@", "SuppressWarnings", "(", "\"UnusedDeclaration\"", ")", "public", "static", "boolean", "validOptions", "(", "String", "[", "]", "[", "]", "options", ",", "DocErrorReporter", "errorReporter", ")", "{", "return", "validOptions", "(", "options", ",", "errorReport...
Processes the input options by delegating to the standard handler. _Javadoc spec requirement._ @param options input option array @param errorReporter error handling @return success
[ "Processes", "the", "input", "options", "by", "delegating", "to", "the", "standard", "handler", "." ]
6c43ce214e48797d2b5e8d59c31b65304279717b
https://github.com/asciidoctor/asciidoclet/blob/6c43ce214e48797d2b5e8d59c31b65304279717b/src/main/java/org/asciidoctor/Asciidoclet.java#L254-L257
104,865
asciidoctor/asciidoclet
src/main/java/org/asciidoctor/asciidoclet/DocletIterator.java
DocletIterator.render
public boolean render(RootDoc rootDoc, DocletRenderer renderer) { if (!processOverview(rootDoc, renderer)) { return false; } Set<PackageDoc> packages = new HashSet<PackageDoc>(); for (ClassDoc doc : rootDoc.classes()) { packages.add(doc.containingPackage()); ...
java
public boolean render(RootDoc rootDoc, DocletRenderer renderer) { if (!processOverview(rootDoc, renderer)) { return false; } Set<PackageDoc> packages = new HashSet<PackageDoc>(); for (ClassDoc doc : rootDoc.classes()) { packages.add(doc.containingPackage()); ...
[ "public", "boolean", "render", "(", "RootDoc", "rootDoc", ",", "DocletRenderer", "renderer", ")", "{", "if", "(", "!", "processOverview", "(", "rootDoc", ",", "renderer", ")", ")", "{", "return", "false", ";", "}", "Set", "<", "PackageDoc", ">", "packages"...
Renders a RootDoc's contents. @param rootDoc @param renderer
[ "Renders", "a", "RootDoc", "s", "contents", "." ]
6c43ce214e48797d2b5e8d59c31b65304279717b
https://github.com/asciidoctor/asciidoclet/blob/6c43ce214e48797d2b5e8d59c31b65304279717b/src/main/java/org/asciidoctor/asciidoclet/DocletIterator.java#L49-L62
104,866
asciidoctor/asciidoclet
src/main/java/org/asciidoctor/asciidoclet/DocletIterator.java
DocletIterator.renderClass
private void renderClass(ClassDoc doc, DocletRenderer renderer) { //handle the various parts of the Class doc renderer.renderDoc(doc); for (MemberDoc member : doc.fields()) { renderer.renderDoc(member); } for (MemberDoc member : doc.constructors()) { rende...
java
private void renderClass(ClassDoc doc, DocletRenderer renderer) { //handle the various parts of the Class doc renderer.renderDoc(doc); for (MemberDoc member : doc.fields()) { renderer.renderDoc(member); } for (MemberDoc member : doc.constructors()) { rende...
[ "private", "void", "renderClass", "(", "ClassDoc", "doc", ",", "DocletRenderer", "renderer", ")", "{", "//handle the various parts of the Class doc", "renderer", ".", "renderDoc", "(", "doc", ")", ";", "for", "(", "MemberDoc", "member", ":", "doc", ".", "fields", ...
Renders an individual class. @param doc input
[ "Renders", "an", "individual", "class", "." ]
6c43ce214e48797d2b5e8d59c31b65304279717b
https://github.com/asciidoctor/asciidoclet/blob/6c43ce214e48797d2b5e8d59c31b65304279717b/src/main/java/org/asciidoctor/asciidoclet/DocletIterator.java#L69-L89
104,867
javafxports/javafxmobile-plugin
src/main/java/org/javafxports/jfxmobile/plugin/android/task/SignedJarBuilder.java
SignedJarBuilder.close
public void close() throws IOException, GeneralSecurityException { if (mManifest != null) { // write the manifest to the jar file mOutputJar.putNextEntry(new JarEntry(JarFile.MANIFEST_NAME)); mManifest.write(mOutputJar); // CERT.SF Signature signature...
java
public void close() throws IOException, GeneralSecurityException { if (mManifest != null) { // write the manifest to the jar file mOutputJar.putNextEntry(new JarEntry(JarFile.MANIFEST_NAME)); mManifest.write(mOutputJar); // CERT.SF Signature signature...
[ "public", "void", "close", "(", ")", "throws", "IOException", ",", "GeneralSecurityException", "{", "if", "(", "mManifest", "!=", "null", ")", "{", "// write the manifest to the jar file", "mOutputJar", ".", "putNextEntry", "(", "new", "JarEntry", "(", "JarFile", ...
Closes the Jar archive by creating the manifest, and signing the archive. @throws IOException @throws GeneralSecurityException
[ "Closes", "the", "Jar", "archive", "by", "creating", "the", "manifest", "and", "signing", "the", "archive", "." ]
a9bef513b7e1bfa85f9a668226e6943c6d9f847f
https://github.com/javafxports/javafxmobile-plugin/blob/a9bef513b7e1bfa85f9a668226e6943c6d9f847f/src/main/java/org/javafxports/jfxmobile/plugin/android/task/SignedJarBuilder.java#L242-L267
104,868
javafxports/javafxmobile-plugin
src/main/java/org/javafxports/jfxmobile/plugin/android/task/SignedJarBuilder.java
SignedJarBuilder.writeSignatureBlock
private void writeSignatureBlock(Signature signature, X509Certificate publicKey, PrivateKey privateKey) throws IOException, GeneralSecurityException { SignerInfo signerInfo = new SignerInfo( new X500Name(publicKey.getIssuerX500Principal().getName()), publi...
java
private void writeSignatureBlock(Signature signature, X509Certificate publicKey, PrivateKey privateKey) throws IOException, GeneralSecurityException { SignerInfo signerInfo = new SignerInfo( new X500Name(publicKey.getIssuerX500Principal().getName()), publi...
[ "private", "void", "writeSignatureBlock", "(", "Signature", "signature", ",", "X509Certificate", "publicKey", ",", "PrivateKey", "privateKey", ")", "throws", "IOException", ",", "GeneralSecurityException", "{", "SignerInfo", "signerInfo", "=", "new", "SignerInfo", "(", ...
Write the certificate file with a digital signature.
[ "Write", "the", "certificate", "file", "with", "a", "digital", "signature", "." ]
a9bef513b7e1bfa85f9a668226e6943c6d9f847f
https://github.com/javafxports/javafxmobile-plugin/blob/a9bef513b7e1bfa85f9a668226e6943c6d9f847f/src/main/java/org/javafxports/jfxmobile/plugin/android/task/SignedJarBuilder.java#L365-L382
104,869
javafxports/javafxmobile-plugin
src/main/java/org/javafxports/jfxmobile/plugin/android/AndroidExtension.java
AndroidExtension.validate
public void validate() { // check if android build tool version is at least minimal required version Revision revBuildToolsVersion = Revision.parseRevision(buildToolsVersion); if (minimalBuildToolsVersion.compareTo(revBuildToolsVersion) > 0) { throw new GradleException("Android build...
java
public void validate() { // check if android build tool version is at least minimal required version Revision revBuildToolsVersion = Revision.parseRevision(buildToolsVersion); if (minimalBuildToolsVersion.compareTo(revBuildToolsVersion) > 0) { throw new GradleException("Android build...
[ "public", "void", "validate", "(", ")", "{", "// check if android build tool version is at least minimal required version", "Revision", "revBuildToolsVersion", "=", "Revision", ".", "parseRevision", "(", "buildToolsVersion", ")", ";", "if", "(", "minimalBuildToolsVersion", "....
Checks whether the properties on the android extension are valid after everything was configured.
[ "Checks", "whether", "the", "properties", "on", "the", "android", "extension", "are", "valid", "after", "everything", "was", "configured", "." ]
a9bef513b7e1bfa85f9a668226e6943c6d9f847f
https://github.com/javafxports/javafxmobile-plugin/blob/a9bef513b7e1bfa85f9a668226e6943c6d9f847f/src/main/java/org/javafxports/jfxmobile/plugin/android/AndroidExtension.java#L404-L426
104,870
javafxports/javafxmobile-plugin
src/main/java/org/javafxports/jfxmobile/plugin/android/task/ApkBuilder.java
ApkBuilder.getDebugKey
public static SigningInfo getDebugKey(String storeOsPath, final PrintStream verboseStream) throws ApkCreationException { try { if (storeOsPath != null) { File storeFile = new File(storeOsPath); try { checkInputFile(storeFile); ...
java
public static SigningInfo getDebugKey(String storeOsPath, final PrintStream verboseStream) throws ApkCreationException { try { if (storeOsPath != null) { File storeFile = new File(storeOsPath); try { checkInputFile(storeFile); ...
[ "public", "static", "SigningInfo", "getDebugKey", "(", "String", "storeOsPath", ",", "final", "PrintStream", "verboseStream", ")", "throws", "ApkCreationException", "{", "try", "{", "if", "(", "storeOsPath", "!=", "null", ")", "{", "File", "storeFile", "=", "new...
Returns the key and certificate from a given debug store. It is expected that the store password is 'android' and the key alias and password are 'androiddebugkey' and 'android' respectively. @param storeOsPath the OS path to the debug store. @param verboseStream an option {@link PrintStream} to display verbose inform...
[ "Returns", "the", "key", "and", "certificate", "from", "a", "given", "debug", "store", "." ]
a9bef513b7e1bfa85f9a668226e6943c6d9f847f
https://github.com/javafxports/javafxmobile-plugin/blob/a9bef513b7e1bfa85f9a668226e6943c6d9f847f/src/main/java/org/javafxports/jfxmobile/plugin/android/task/ApkBuilder.java#L288-L357
104,871
javafxports/javafxmobile-plugin
src/main/java/org/javafxports/jfxmobile/plugin/android/task/ApkBuilder.java
ApkBuilder.init
private void init(File apkFile, File resFile, File dexFile, PrivateKey key, X509Certificate certificate, PrintStream verboseStream) throws ApkCreationException { try { checkOutputFile(mApkFile = apkFile); checkInputFile(mResFile = resFile); if (dexFile != null) {...
java
private void init(File apkFile, File resFile, File dexFile, PrivateKey key, X509Certificate certificate, PrintStream verboseStream) throws ApkCreationException { try { checkOutputFile(mApkFile = apkFile); checkInputFile(mResFile = resFile); if (dexFile != null) {...
[ "private", "void", "init", "(", "File", "apkFile", ",", "File", "resFile", ",", "File", "dexFile", ",", "PrivateKey", "key", ",", "X509Certificate", "certificate", ",", "PrintStream", "verboseStream", ")", "throws", "ApkCreationException", "{", "try", "{", "chec...
Constructor init method. @see #ApkBuilder(File, File, File, String, PackagingOptions, PrintStream) @see #ApkBuilder(String, String, String, String, PackagingOptions, PrintStream) @see #ApkBuilder(File, File, File, PrivateKey, X509Certificate, PackagingOptions, PrintStream)
[ "Constructor", "init", "method", "." ]
a9bef513b7e1bfa85f9a668226e6943c6d9f847f
https://github.com/javafxports/javafxmobile-plugin/blob/a9bef513b7e1bfa85f9a668226e6943c6d9f847f/src/main/java/org/javafxports/jfxmobile/plugin/android/task/ApkBuilder.java#L486-L524
104,872
javafxports/javafxmobile-plugin
src/main/java/org/javafxports/jfxmobile/plugin/android/task/ApkBuilder.java
ApkBuilder.addFile
@Override public void addFile(File file, String archivePath) throws ApkCreationException, SealedApkException, DuplicateFileException { if (mIsSealed) { throw new SealedApkException("APK is already sealed"); } try { doAddFile(file, archivePath); } ...
java
@Override public void addFile(File file, String archivePath) throws ApkCreationException, SealedApkException, DuplicateFileException { if (mIsSealed) { throw new SealedApkException("APK is already sealed"); } try { doAddFile(file, archivePath); } ...
[ "@", "Override", "public", "void", "addFile", "(", "File", "file", ",", "String", "archivePath", ")", "throws", "ApkCreationException", ",", "SealedApkException", ",", "DuplicateFileException", "{", "if", "(", "mIsSealed", ")", "{", "throw", "new", "SealedApkExcep...
Adds a file to the APK at a given path @param file the file to add @param archivePath the path of the file inside the APK archive. @throws ApkCreationException if an error occurred @throws SealedApkException if the APK is already sealed. @throws DuplicateFileException if a file conflicts with another already added to t...
[ "Adds", "a", "file", "to", "the", "APK", "at", "a", "given", "path" ]
a9bef513b7e1bfa85f9a668226e6943c6d9f847f
https://github.com/javafxports/javafxmobile-plugin/blob/a9bef513b7e1bfa85f9a668226e6943c6d9f847f/src/main/java/org/javafxports/jfxmobile/plugin/android/task/ApkBuilder.java#L552-L568
104,873
javafxports/javafxmobile-plugin
src/main/java/org/javafxports/jfxmobile/plugin/android/task/ApkBuilder.java
ApkBuilder.addZipFile
public void addZipFile(File zipFile) throws ApkCreationException, SealedApkException, DuplicateFileException { if (mIsSealed) { throw new SealedApkException("APK is already sealed"); } try { verbosePrintln("%s:", zipFile); // reset the filter wit...
java
public void addZipFile(File zipFile) throws ApkCreationException, SealedApkException, DuplicateFileException { if (mIsSealed) { throw new SealedApkException("APK is already sealed"); } try { verbosePrintln("%s:", zipFile); // reset the filter wit...
[ "public", "void", "addZipFile", "(", "File", "zipFile", ")", "throws", "ApkCreationException", ",", "SealedApkException", ",", "DuplicateFileException", "{", "if", "(", "mIsSealed", ")", "{", "throw", "new", "SealedApkException", "(", "\"APK is already sealed\"", ")",...
Adds the content from a zip file. All file keep the same path inside the archive. @param zipFile the zip File. @throws ApkCreationException if an error occurred @throws SealedApkException if the APK is already sealed. @throws DuplicateFileException if a file conflicts with another already added to the APK at the same l...
[ "Adds", "the", "content", "from", "a", "zip", "file", ".", "All", "file", "keep", "the", "same", "path", "inside", "the", "archive", "." ]
a9bef513b7e1bfa85f9a668226e6943c6d9f847f
https://github.com/javafxports/javafxmobile-plugin/blob/a9bef513b7e1bfa85f9a668226e6943c6d9f847f/src/main/java/org/javafxports/jfxmobile/plugin/android/task/ApkBuilder.java#L579-L602
104,874
javafxports/javafxmobile-plugin
src/main/java/org/javafxports/jfxmobile/plugin/android/task/ApkBuilder.java
ApkBuilder.addResourcesFromJar
public JarStatus addResourcesFromJar(File jarFile) throws ApkCreationException, SealedApkException, DuplicateFileException { if (mIsSealed) { throw new SealedApkException("APK is already sealed"); } try { verbosePrintln("%s:", jarFile); // reset ...
java
public JarStatus addResourcesFromJar(File jarFile) throws ApkCreationException, SealedApkException, DuplicateFileException { if (mIsSealed) { throw new SealedApkException("APK is already sealed"); } try { verbosePrintln("%s:", jarFile); // reset ...
[ "public", "JarStatus", "addResourcesFromJar", "(", "File", "jarFile", ")", "throws", "ApkCreationException", ",", "SealedApkException", ",", "DuplicateFileException", "{", "if", "(", "mIsSealed", ")", "{", "throw", "new", "SealedApkException", "(", "\"APK is already sea...
Adds the resources from a jar file. @param jarFile the jar File. @return a {@link JarStatus} object indicating if native libraries where found in the jar file. @throws ApkCreationException if an error occurred @throws SealedApkException if the APK is already sealed. @throws DuplicateFileException if a file conflicts wi...
[ "Adds", "the", "resources", "from", "a", "jar", "file", "." ]
a9bef513b7e1bfa85f9a668226e6943c6d9f847f
https://github.com/javafxports/javafxmobile-plugin/blob/a9bef513b7e1bfa85f9a668226e6943c6d9f847f/src/main/java/org/javafxports/jfxmobile/plugin/android/task/ApkBuilder.java#L614-L642
104,875
javafxports/javafxmobile-plugin
src/main/java/org/javafxports/jfxmobile/plugin/android/task/ApkBuilder.java
ApkBuilder.addSourceFolder
public void addSourceFolder(File sourceFolder) throws ApkCreationException, SealedApkException, DuplicateFileException { if (mIsSealed) { throw new SealedApkException("APK is already sealed"); } addSourceFolder(this, sourceFolder); }
java
public void addSourceFolder(File sourceFolder) throws ApkCreationException, SealedApkException, DuplicateFileException { if (mIsSealed) { throw new SealedApkException("APK is already sealed"); } addSourceFolder(this, sourceFolder); }
[ "public", "void", "addSourceFolder", "(", "File", "sourceFolder", ")", "throws", "ApkCreationException", ",", "SealedApkException", ",", "DuplicateFileException", "{", "if", "(", "mIsSealed", ")", "{", "throw", "new", "SealedApkException", "(", "\"APK is already sealed\...
Adds the resources from a source folder. @param sourceFolder the source folder. @throws ApkCreationException if an error occurred @throws SealedApkException if the APK is already sealed. @throws DuplicateFileException if a file conflicts with another already added to the APK at the same location inside the APK archive.
[ "Adds", "the", "resources", "from", "a", "source", "folder", "." ]
a9bef513b7e1bfa85f9a668226e6943c6d9f847f
https://github.com/javafxports/javafxmobile-plugin/blob/a9bef513b7e1bfa85f9a668226e6943c6d9f847f/src/main/java/org/javafxports/jfxmobile/plugin/android/task/ApkBuilder.java#L652-L659
104,876
javafxports/javafxmobile-plugin
src/main/java/org/javafxports/jfxmobile/plugin/android/task/ApkBuilder.java
ApkBuilder.addNativeLibraries
public void addNativeLibraries(File nativeFolder) throws ApkCreationException, SealedApkException, DuplicateFileException { if (mIsSealed) { throw new SealedApkException("APK is already sealed"); } if (!nativeFolder.isDirectory()) { // not a directory? check ...
java
public void addNativeLibraries(File nativeFolder) throws ApkCreationException, SealedApkException, DuplicateFileException { if (mIsSealed) { throw new SealedApkException("APK is already sealed"); } if (!nativeFolder.isDirectory()) { // not a directory? check ...
[ "public", "void", "addNativeLibraries", "(", "File", "nativeFolder", ")", "throws", "ApkCreationException", ",", "SealedApkException", ",", "DuplicateFileException", "{", "if", "(", "mIsSealed", ")", "{", "throw", "new", "SealedApkException", "(", "\"APK is already seal...
Adds the native libraries from the top native folder. The content of this folder must be the various ABI folders. This may or may not copy gdbserver into the apk based on whether the debug mode is set. @param nativeFolder the native folder. @throws ApkCreationException if an error occurred @throws SealedApkException...
[ "Adds", "the", "native", "libraries", "from", "the", "top", "native", "folder", ".", "The", "content", "of", "this", "folder", "must", "be", "the", "various", "ABI", "folders", "." ]
a9bef513b7e1bfa85f9a668226e6943c6d9f847f
https://github.com/javafxports/javafxmobile-plugin/blob/a9bef513b7e1bfa85f9a668226e6943c6d9f847f/src/main/java/org/javafxports/jfxmobile/plugin/android/task/ApkBuilder.java#L709-L759
104,877
javafxports/javafxmobile-plugin
src/main/java/org/javafxports/jfxmobile/plugin/android/task/ApkBuilder.java
ApkBuilder.sealApk
public void sealApk() throws ApkCreationException, SealedApkException { if (mIsSealed) { throw new SealedApkException("APK is already sealed"); } // close and sign the application package. try { mBuilder.close(); mIsSealed = true; } catch (Exc...
java
public void sealApk() throws ApkCreationException, SealedApkException { if (mIsSealed) { throw new SealedApkException("APK is already sealed"); } // close and sign the application package. try { mBuilder.close(); mIsSealed = true; } catch (Exc...
[ "public", "void", "sealApk", "(", ")", "throws", "ApkCreationException", ",", "SealedApkException", "{", "if", "(", "mIsSealed", ")", "{", "throw", "new", "SealedApkException", "(", "\"APK is already sealed\"", ")", ";", "}", "// close and sign the application package."...
Seals the APK, and signs it if necessary. @throws ApkCreationException @throws ApkCreationException if an error occurred @throws SealedApkException if the APK is already sealed.
[ "Seals", "the", "APK", "and", "signs", "it", "if", "necessary", "." ]
a9bef513b7e1bfa85f9a668226e6943c6d9f847f
https://github.com/javafxports/javafxmobile-plugin/blob/a9bef513b7e1bfa85f9a668226e6943c6d9f847f/src/main/java/org/javafxports/jfxmobile/plugin/android/task/ApkBuilder.java#L841-L855
104,878
javafxports/javafxmobile-plugin
src/main/java/org/javafxports/jfxmobile/plugin/android/task/ApkBuilder.java
ApkBuilder.verbosePrintln
private void verbosePrintln(String format, Object... args) { if (mVerboseStream != null) { mVerboseStream.println(String.format(format, args)); } }
java
private void verbosePrintln(String format, Object... args) { if (mVerboseStream != null) { mVerboseStream.println(String.format(format, args)); } }
[ "private", "void", "verbosePrintln", "(", "String", "format", ",", "Object", "...", "args", ")", "{", "if", "(", "mVerboseStream", "!=", "null", ")", "{", "mVerboseStream", ".", "println", "(", "String", ".", "format", "(", "format", ",", "args", ")", ")...
Output a given message if the verbose mode is enabled. @param format the format string for {@link String#format(String, Object...)} @param args the string arguments
[ "Output", "a", "given", "message", "if", "the", "verbose", "mode", "is", "enabled", "." ]
a9bef513b7e1bfa85f9a668226e6943c6d9f847f
https://github.com/javafxports/javafxmobile-plugin/blob/a9bef513b7e1bfa85f9a668226e6943c6d9f847f/src/main/java/org/javafxports/jfxmobile/plugin/android/task/ApkBuilder.java#L862-L866
104,879
javafxports/javafxmobile-plugin
src/main/java/org/javafxports/jfxmobile/plugin/android/task/ApkBuilder.java
ApkBuilder.checkFolderForPackaging
public static boolean checkFolderForPackaging(String folderName) { return !folderName.equalsIgnoreCase("CVS") && !folderName.equalsIgnoreCase(".svn") && !folderName.equalsIgnoreCase("SCCS") && !folderName.startsWith("_"); }
java
public static boolean checkFolderForPackaging(String folderName) { return !folderName.equalsIgnoreCase("CVS") && !folderName.equalsIgnoreCase(".svn") && !folderName.equalsIgnoreCase("SCCS") && !folderName.startsWith("_"); }
[ "public", "static", "boolean", "checkFolderForPackaging", "(", "String", "folderName", ")", "{", "return", "!", "folderName", ".", "equalsIgnoreCase", "(", "\"CVS\"", ")", "&&", "!", "folderName", ".", "equalsIgnoreCase", "(", "\".svn\"", ")", "&&", "!", "folder...
Checks whether a folder and its content is valid for packaging into the .apk as standard Java resource. @param folderName the name of the folder.
[ "Checks", "whether", "a", "folder", "and", "its", "content", "is", "valid", "for", "packaging", "into", "the", ".", "apk", "as", "standard", "Java", "resource", "." ]
a9bef513b7e1bfa85f9a668226e6943c6d9f847f
https://github.com/javafxports/javafxmobile-plugin/blob/a9bef513b7e1bfa85f9a668226e6943c6d9f847f/src/main/java/org/javafxports/jfxmobile/plugin/android/task/ApkBuilder.java#L1008-L1013
104,880
javafxports/javafxmobile-plugin
src/main/java/org/javafxports/jfxmobile/plugin/DownConfiguration.java
DownConfiguration.applyConfiguration
public void applyConfiguration(Configuration configuration) { if (plugins != null) { plugins.stream() .filter(pluginDefinition -> pluginDefinition.isConfigurationSupported(configuration)) .forEach(pluginDefinition -> project.getDependencies().add(configuration...
java
public void applyConfiguration(Configuration configuration) { if (plugins != null) { plugins.stream() .filter(pluginDefinition -> pluginDefinition.isConfigurationSupported(configuration)) .forEach(pluginDefinition -> project.getDependencies().add(configuration...
[ "public", "void", "applyConfiguration", "(", "Configuration", "configuration", ")", "{", "if", "(", "plugins", "!=", "null", ")", "{", "plugins", ".", "stream", "(", ")", ".", "filter", "(", "pluginDefinition", "->", "pluginDefinition", ".", "isConfigurationSupp...
Add dependencies to the specified configuration. Only dependencies to plugins that support the provided configuration will be included. @param configuration the configuration where the plugin dependencies are added to
[ "Add", "dependencies", "to", "the", "specified", "configuration", ".", "Only", "dependencies", "to", "plugins", "that", "support", "the", "provided", "configuration", "will", "be", "included", "." ]
a9bef513b7e1bfa85f9a668226e6943c6d9f847f
https://github.com/javafxports/javafxmobile-plugin/blob/a9bef513b7e1bfa85f9a668226e6943c6d9f847f/src/main/java/org/javafxports/jfxmobile/plugin/DownConfiguration.java#L108-L114
104,881
javafxports/javafxmobile-plugin
src/main/java/org/javafxports/jfxmobile/plugin/android/task/MergeResources.java
MergeResources.computeResourceSetList
List<ResourceSet> computeResourceSetList() { List<ResourceSet> sourceFolderSets = resSetSupplier.get(); int size = sourceFolderSets.size() + 4; if (libraries != null) { size += libraries.getArtifacts().size(); } List<ResourceSet> resourceSetList = Lists.newArrayListW...
java
List<ResourceSet> computeResourceSetList() { List<ResourceSet> sourceFolderSets = resSetSupplier.get(); int size = sourceFolderSets.size() + 4; if (libraries != null) { size += libraries.getArtifacts().size(); } List<ResourceSet> resourceSetList = Lists.newArrayListW...
[ "List", "<", "ResourceSet", ">", "computeResourceSetList", "(", ")", "{", "List", "<", "ResourceSet", ">", "sourceFolderSets", "=", "resSetSupplier", ".", "get", "(", ")", ";", "int", "size", "=", "sourceFolderSets", ".", "size", "(", ")", "+", "4", ";", ...
Compute the list of resource set to be used during execution based all the inputs.
[ "Compute", "the", "list", "of", "resource", "set", "to", "be", "used", "during", "execution", "based", "all", "the", "inputs", "." ]
a9bef513b7e1bfa85f9a668226e6943c6d9f847f
https://github.com/javafxports/javafxmobile-plugin/blob/a9bef513b7e1bfa85f9a668226e6943c6d9f847f/src/main/java/org/javafxports/jfxmobile/plugin/android/task/MergeResources.java#L536-L581
104,882
before/uadetector
modules/uadetector-core/src/main/java/net/sf/uadetector/parser/AbstractUserAgentStringParser.java
AbstractUserAgentStringParser.examineAsBrowser
private static void examineAsBrowser(final UserAgent.Builder builder, final Data data) { Matcher matcher; VersionNumber version = VersionNumber.UNKNOWN; for (final Entry<BrowserPattern, Browser> entry : data.getPatternToBrowserMap().entrySet()) { matcher = entry.getKey().getPattern().matcher(builder.getUserAge...
java
private static void examineAsBrowser(final UserAgent.Builder builder, final Data data) { Matcher matcher; VersionNumber version = VersionNumber.UNKNOWN; for (final Entry<BrowserPattern, Browser> entry : data.getPatternToBrowserMap().entrySet()) { matcher = entry.getKey().getPattern().matcher(builder.getUserAge...
[ "private", "static", "void", "examineAsBrowser", "(", "final", "UserAgent", ".", "Builder", "builder", ",", "final", "Data", "data", ")", "{", "Matcher", "matcher", ";", "VersionNumber", "version", "=", "VersionNumber", ".", "UNKNOWN", ";", "for", "(", "final"...
Examines the user agent string whether it is a browser. @param userAgent String of an user agent @param builder Builder for an user agent information
[ "Examines", "the", "user", "agent", "string", "whether", "it", "is", "a", "browser", "." ]
215fb652723c52866572cff885f52a3fe67b9db5
https://github.com/before/uadetector/blob/215fb652723c52866572cff885f52a3fe67b9db5/modules/uadetector-core/src/main/java/net/sf/uadetector/parser/AbstractUserAgentStringParser.java#L54-L72
104,883
before/uadetector
modules/uadetector-core/src/main/java/net/sf/uadetector/parser/AbstractUserAgentStringParser.java
AbstractUserAgentStringParser.examineAsRobot
private static boolean examineAsRobot(final UserAgent.Builder builder, final Data data) { boolean isRobot = false; VersionNumber version; for (final Robot robot : data.getRobots()) { if (robot.getUserAgentString().equals(builder.getUserAgentString())) { isRobot = true; robot.copyTo(builder); // tr...
java
private static boolean examineAsRobot(final UserAgent.Builder builder, final Data data) { boolean isRobot = false; VersionNumber version; for (final Robot robot : data.getRobots()) { if (robot.getUserAgentString().equals(builder.getUserAgentString())) { isRobot = true; robot.copyTo(builder); // tr...
[ "private", "static", "boolean", "examineAsRobot", "(", "final", "UserAgent", ".", "Builder", "builder", ",", "final", "Data", "data", ")", "{", "boolean", "isRobot", "=", "false", ";", "VersionNumber", "version", ";", "for", "(", "final", "Robot", "robot", "...
Examines the user agent string whether it is a robot. @param userAgent String of an user agent @param builder Builder for an user agent information @return {@code true} if it is a robot, otherwise {@code false}
[ "Examines", "the", "user", "agent", "string", "whether", "it", "is", "a", "robot", "." ]
215fb652723c52866572cff885f52a3fe67b9db5
https://github.com/before/uadetector/blob/215fb652723c52866572cff885f52a3fe67b9db5/modules/uadetector-core/src/main/java/net/sf/uadetector/parser/AbstractUserAgentStringParser.java#L83-L99
104,884
before/uadetector
modules/uadetector-core/src/main/java/net/sf/uadetector/parser/AbstractUserAgentStringParser.java
AbstractUserAgentStringParser.examineDeviceCategory
private static void examineDeviceCategory(final UserAgent.Builder builder, final Data data) { // a robot will be classified as 'Other' if (UserAgentType.ROBOT == builder.getType()) { final DeviceCategory category = findDeviceCategoryByValue(Category.OTHER, data); builder.setDeviceCategory(category); retur...
java
private static void examineDeviceCategory(final UserAgent.Builder builder, final Data data) { // a robot will be classified as 'Other' if (UserAgentType.ROBOT == builder.getType()) { final DeviceCategory category = findDeviceCategoryByValue(Category.OTHER, data); builder.setDeviceCategory(category); retur...
[ "private", "static", "void", "examineDeviceCategory", "(", "final", "UserAgent", ".", "Builder", "builder", ",", "final", "Data", "data", ")", "{", "// a robot will be classified as 'Other'", "if", "(", "UserAgentType", ".", "ROBOT", "==", "builder", ".", "getType",...
Examines the user agent string whether has a specific device category. @param userAgent String of an user agent @param builder Builder for an user agent information
[ "Examines", "the", "user", "agent", "string", "whether", "has", "a", "specific", "device", "category", "." ]
215fb652723c52866572cff885f52a3fe67b9db5
https://github.com/before/uadetector/blob/215fb652723c52866572cff885f52a3fe67b9db5/modules/uadetector-core/src/main/java/net/sf/uadetector/parser/AbstractUserAgentStringParser.java#L109-L153
104,885
before/uadetector
modules/uadetector-core/src/main/java/net/sf/uadetector/parser/AbstractUserAgentStringParser.java
AbstractUserAgentStringParser.examineOperatingSystem
private static void examineOperatingSystem(final UserAgent.Builder builder, final Data data) { if (net.sf.uadetector.OperatingSystem.EMPTY.equals(builder.getOperatingSystem())) { for (final Entry<OperatingSystemPattern, OperatingSystem> entry : data.getPatternToOperatingSystemMap().entrySet()) { final Matcher ...
java
private static void examineOperatingSystem(final UserAgent.Builder builder, final Data data) { if (net.sf.uadetector.OperatingSystem.EMPTY.equals(builder.getOperatingSystem())) { for (final Entry<OperatingSystemPattern, OperatingSystem> entry : data.getPatternToOperatingSystemMap().entrySet()) { final Matcher ...
[ "private", "static", "void", "examineOperatingSystem", "(", "final", "UserAgent", ".", "Builder", "builder", ",", "final", "Data", "data", ")", "{", "if", "(", "net", ".", "sf", ".", "uadetector", ".", "OperatingSystem", ".", "EMPTY", ".", "equals", "(", "...
Examines the operating system of the user agent string, if not available. @param userAgent String of an user agent @param builder Builder for an user agent information
[ "Examines", "the", "operating", "system", "of", "the", "user", "agent", "string", "if", "not", "available", "." ]
215fb652723c52866572cff885f52a3fe67b9db5
https://github.com/before/uadetector/blob/215fb652723c52866572cff885f52a3fe67b9db5/modules/uadetector-core/src/main/java/net/sf/uadetector/parser/AbstractUserAgentStringParser.java#L163-L173
104,886
before/uadetector
modules/uadetector-core/src/main/java/net/sf/uadetector/internal/util/CompareNullSafe.java
CompareNullSafe.compare
@Override public int compare(final T o1, final T o2) { int result = 0; if (o1 == null) { if (o2 != null) { result = -1; } } else if (o2 == null) { result = 1; } else { result = compareType(o1, o2); } return result; }
java
@Override public int compare(final T o1, final T o2) { int result = 0; if (o1 == null) { if (o2 != null) { result = -1; } } else if (o2 == null) { result = 1; } else { result = compareType(o1, o2); } return result; }
[ "@", "Override", "public", "int", "compare", "(", "final", "T", "o1", ",", "final", "T", "o2", ")", "{", "int", "result", "=", "0", ";", "if", "(", "o1", "==", "null", ")", "{", "if", "(", "o2", "!=", "null", ")", "{", "result", "=", "-", "1"...
Compares two objects null safe to each other. @param o1 the first reference @param o2 the second reference @return a negative value if o1 < o2, zero if o1 = o2 and a positive value if o1 > o2
[ "Compares", "two", "objects", "null", "safe", "to", "each", "other", "." ]
215fb652723c52866572cff885f52a3fe67b9db5
https://github.com/before/uadetector/blob/215fb652723c52866572cff885f52a3fe67b9db5/modules/uadetector-core/src/main/java/net/sf/uadetector/internal/util/CompareNullSafe.java#L53-L66
104,887
before/uadetector
modules/uadetector-core/src/main/java/net/sf/uadetector/internal/data/domain/BrowserPattern.java
BrowserPattern.compareInt
private static int compareInt(final int a, final int b) { int result = 0; if (a > b) { result = 1; } else if (a < b) { result = -1; } return result; }
java
private static int compareInt(final int a, final int b) { int result = 0; if (a > b) { result = 1; } else if (a < b) { result = -1; } return result; }
[ "private", "static", "int", "compareInt", "(", "final", "int", "a", ",", "final", "int", "b", ")", "{", "int", "result", "=", "0", ";", "if", "(", "a", ">", "b", ")", "{", "result", "=", "1", ";", "}", "else", "if", "(", "a", "<", "b", ")", ...
Compares to integers. @param a first integer @param b second integer @return {@code -1} if {@code a} is less, {@code 0} if equal, or {@code 1} if greater than {@code b}
[ "Compares", "to", "integers", "." ]
215fb652723c52866572cff885f52a3fe67b9db5
https://github.com/before/uadetector/blob/215fb652723c52866572cff885f52a3fe67b9db5/modules/uadetector-core/src/main/java/net/sf/uadetector/internal/data/domain/BrowserPattern.java#L198-L206
104,888
before/uadetector
modules/uadetector-core/src/main/java/net/sf/uadetector/datastore/AbstractUpdateOperation.java
AbstractUpdateOperation.hasUpdate
static boolean hasUpdate(final String newer, final String older) { return VERSION_PATTERN.matcher(newer).matches() && VERSION_PATTERN.matcher(older).matches() ? newer.compareTo(older) > 0 : false; }
java
static boolean hasUpdate(final String newer, final String older) { return VERSION_PATTERN.matcher(newer).matches() && VERSION_PATTERN.matcher(older).matches() ? newer.compareTo(older) > 0 : false; }
[ "static", "boolean", "hasUpdate", "(", "final", "String", "newer", ",", "final", "String", "older", ")", "{", "return", "VERSION_PATTERN", ".", "matcher", "(", "newer", ")", ".", "matches", "(", ")", "&&", "VERSION_PATTERN", ".", "matcher", "(", "older", "...
Checks a given newer version against an older one. @param newer possible newer version @param older possible older version @return {@code true} if the first argument is newer than the second argument, otherwise {@code false}
[ "Checks", "a", "given", "newer", "version", "against", "an", "older", "one", "." ]
215fb652723c52866572cff885f52a3fe67b9db5
https://github.com/before/uadetector/blob/215fb652723c52866572cff885f52a3fe67b9db5/modules/uadetector-core/src/main/java/net/sf/uadetector/datastore/AbstractUpdateOperation.java#L103-L105
104,889
before/uadetector
modules/uadetector-core/src/main/java/net/sf/uadetector/datastore/AbstractUpdateOperation.java
AbstractUpdateOperation.isUpdateAvailable
protected boolean isUpdateAvailable() { boolean result = false; String version = EMPTY_VERSION; try { version = retrieveRemoteVersion(store.getVersionUrl(), store.getCharset()); } catch (final IOException e) { LOG.info(MSG_NO_UPDATE_CHECK_POSSIBLE); LOG.debug(String.format(MSG_NO_UPDATE_CHECK_POSSIBLE_...
java
protected boolean isUpdateAvailable() { boolean result = false; String version = EMPTY_VERSION; try { version = retrieveRemoteVersion(store.getVersionUrl(), store.getCharset()); } catch (final IOException e) { LOG.info(MSG_NO_UPDATE_CHECK_POSSIBLE); LOG.debug(String.format(MSG_NO_UPDATE_CHECK_POSSIBLE_...
[ "protected", "boolean", "isUpdateAvailable", "(", ")", "{", "boolean", "result", "=", "false", ";", "String", "version", "=", "EMPTY_VERSION", ";", "try", "{", "version", "=", "retrieveRemoteVersion", "(", "store", ".", "getVersionUrl", "(", ")", ",", "store",...
Fetches the current version information over HTTP and compares it with the last version of the most recently imported data. @return {@code true} if an update exists, otherwise {@code false}
[ "Fetches", "the", "current", "version", "information", "over", "HTTP", "and", "compares", "it", "with", "the", "last", "version", "of", "the", "most", "recently", "imported", "data", "." ]
215fb652723c52866572cff885f52a3fe67b9db5
https://github.com/before/uadetector/blob/215fb652723c52866572cff885f52a3fe67b9db5/modules/uadetector-core/src/main/java/net/sf/uadetector/datastore/AbstractUpdateOperation.java#L175-L192
104,890
before/uadetector
modules/uadetector-core/src/main/java/net/sf/uadetector/internal/data/DataBuilder.java
DataBuilder.appendBrowserPattern
@Nonnull public DataBuilder appendBrowserPattern(@Nonnull final BrowserPattern pattern) { Check.notNull(pattern, "pattern"); if (!browserPatterns.containsKey(pattern.getId())) { browserPatterns.put(pattern.getId(), new TreeSet<BrowserPattern>(BROWSER_PATTERN_COMPARATOR)); } browserPatterns.get(pattern.getI...
java
@Nonnull public DataBuilder appendBrowserPattern(@Nonnull final BrowserPattern pattern) { Check.notNull(pattern, "pattern"); if (!browserPatterns.containsKey(pattern.getId())) { browserPatterns.put(pattern.getId(), new TreeSet<BrowserPattern>(BROWSER_PATTERN_COMPARATOR)); } browserPatterns.get(pattern.getI...
[ "@", "Nonnull", "public", "DataBuilder", "appendBrowserPattern", "(", "@", "Nonnull", "final", "BrowserPattern", "pattern", ")", "{", "Check", ".", "notNull", "(", "pattern", ",", "\"pattern\"", ")", ";", "if", "(", "!", "browserPatterns", ".", "containsKey", ...
Appends a browser pattern to the map of pattern sorted by ID. @param pattern a pattern for a browser @return itself @throws net.sf.qualitycheck.exception.IllegalNullArgumentException if the given argument is {@code null}
[ "Appends", "a", "browser", "pattern", "to", "the", "map", "of", "pattern", "sorted", "by", "ID", "." ]
215fb652723c52866572cff885f52a3fe67b9db5
https://github.com/before/uadetector/blob/215fb652723c52866572cff885f52a3fe67b9db5/modules/uadetector-core/src/main/java/net/sf/uadetector/internal/data/DataBuilder.java#L303-L312
104,891
before/uadetector
modules/uadetector-core/src/main/java/net/sf/uadetector/internal/data/DataBuilder.java
DataBuilder.appendDevicePattern
@Nonnull public DataBuilder appendDevicePattern(@Nonnull final DevicePattern pattern) { Check.notNull(pattern, "pattern"); if (!devicePatterns.containsKey(pattern.getId())) { devicePatterns.put(pattern.getId(), new TreeSet<DevicePattern>(DEVICE_PATTERN_COMPARATOR)); } devicePatterns.get(pattern.getId()).ad...
java
@Nonnull public DataBuilder appendDevicePattern(@Nonnull final DevicePattern pattern) { Check.notNull(pattern, "pattern"); if (!devicePatterns.containsKey(pattern.getId())) { devicePatterns.put(pattern.getId(), new TreeSet<DevicePattern>(DEVICE_PATTERN_COMPARATOR)); } devicePatterns.get(pattern.getId()).ad...
[ "@", "Nonnull", "public", "DataBuilder", "appendDevicePattern", "(", "@", "Nonnull", "final", "DevicePattern", "pattern", ")", "{", "Check", ".", "notNull", "(", "pattern", ",", "\"pattern\"", ")", ";", "if", "(", "!", "devicePatterns", ".", "containsKey", "("...
Appends a device pattern to the map of pattern sorted by ID. @param pattern a pattern for a device @return itself @throws net.sf.qualitycheck.exception.IllegalNullArgumentException if the given argument is {@code null}
[ "Appends", "a", "device", "pattern", "to", "the", "map", "of", "pattern", "sorted", "by", "ID", "." ]
215fb652723c52866572cff885f52a3fe67b9db5
https://github.com/before/uadetector/blob/215fb652723c52866572cff885f52a3fe67b9db5/modules/uadetector-core/src/main/java/net/sf/uadetector/internal/data/DataBuilder.java#L364-L373
104,892
before/uadetector
modules/uadetector-core/src/main/java/net/sf/uadetector/internal/data/DataBuilder.java
DataBuilder.appendOperatingSystemPattern
@Nonnull public DataBuilder appendOperatingSystemPattern(@Nonnull final OperatingSystemPattern pattern) { Check.notNull(pattern, "pattern"); if (!operatingSystemPatterns.containsKey(pattern.getId())) { operatingSystemPatterns.put(pattern.getId(), new TreeSet<OperatingSystemPattern>(OS_PATTERN_COMPARATOR)); }...
java
@Nonnull public DataBuilder appendOperatingSystemPattern(@Nonnull final OperatingSystemPattern pattern) { Check.notNull(pattern, "pattern"); if (!operatingSystemPatterns.containsKey(pattern.getId())) { operatingSystemPatterns.put(pattern.getId(), new TreeSet<OperatingSystemPattern>(OS_PATTERN_COMPARATOR)); }...
[ "@", "Nonnull", "public", "DataBuilder", "appendOperatingSystemPattern", "(", "@", "Nonnull", "final", "OperatingSystemPattern", "pattern", ")", "{", "Check", ".", "notNull", "(", "pattern", ",", "\"pattern\"", ")", ";", "if", "(", "!", "operatingSystemPatterns", ...
Appends an operating system pattern to the map of pattern sorted by ID. @param pattern a pattern for a browser @throws net.sf.qualitycheck.exception.IllegalNullArgumentException if the pattern is {@code null} @return itself
[ "Appends", "an", "operating", "system", "pattern", "to", "the", "map", "of", "pattern", "sorted", "by", "ID", "." ]
215fb652723c52866572cff885f52a3fe67b9db5
https://github.com/before/uadetector/blob/215fb652723c52866572cff885f52a3fe67b9db5/modules/uadetector-core/src/main/java/net/sf/uadetector/internal/data/DataBuilder.java#L417-L427
104,893
before/uadetector
modules/uadetector-core/src/main/java/net/sf/uadetector/parser/UpdatingUserAgentStringParserImpl.java
UpdatingUserAgentStringParserImpl.setUpUpdateService
private void setUpUpdateService() { if (currentUpdateTask != null) { currentUpdateTask.cancel(false); } currentUpdateTask = scheduler.scheduleWithFixedDelay(getDataStore().getUpdateOperation(), 0, updateInterval, MILLISECONDS); }
java
private void setUpUpdateService() { if (currentUpdateTask != null) { currentUpdateTask.cancel(false); } currentUpdateTask = scheduler.scheduleWithFixedDelay(getDataStore().getUpdateOperation(), 0, updateInterval, MILLISECONDS); }
[ "private", "void", "setUpUpdateService", "(", ")", "{", "if", "(", "currentUpdateTask", "!=", "null", ")", "{", "currentUpdateTask", ".", "cancel", "(", "false", ")", ";", "}", "currentUpdateTask", "=", "scheduler", ".", "scheduleWithFixedDelay", "(", "getDataSt...
Set up a new update service to get newer UAS data
[ "Set", "up", "a", "new", "update", "service", "to", "get", "newer", "UAS", "data" ]
215fb652723c52866572cff885f52a3fe67b9db5
https://github.com/before/uadetector/blob/215fb652723c52866572cff885f52a3fe67b9db5/modules/uadetector-core/src/main/java/net/sf/uadetector/parser/UpdatingUserAgentStringParserImpl.java#L102-L107
104,894
before/uadetector
modules/uadetector-core/src/main/java/net/sf/uadetector/internal/data/domain/OperatingSystem.java
OperatingSystem.copyTo
public void copyTo(@Nonnull final UserAgent.Builder builder) { final OperatingSystemFamily f = OperatingSystemFamily.evaluate(family); final VersionNumber version = VersionNumber.parseOperatingSystemVersion(f, builder.getUserAgentString()); builder.setOperatingSystem(new net.sf.uadetector.OperatingSystem(f, famil...
java
public void copyTo(@Nonnull final UserAgent.Builder builder) { final OperatingSystemFamily f = OperatingSystemFamily.evaluate(family); final VersionNumber version = VersionNumber.parseOperatingSystemVersion(f, builder.getUserAgentString()); builder.setOperatingSystem(new net.sf.uadetector.OperatingSystem(f, famil...
[ "public", "void", "copyTo", "(", "@", "Nonnull", "final", "UserAgent", ".", "Builder", "builder", ")", "{", "final", "OperatingSystemFamily", "f", "=", "OperatingSystemFamily", ".", "evaluate", "(", "family", ")", ";", "final", "VersionNumber", "version", "=", ...
Copies all information of the current operating system entry to the given user agent builder. @param builder user agent builder
[ "Copies", "all", "information", "of", "the", "current", "operating", "system", "entry", "to", "the", "given", "user", "agent", "builder", "." ]
215fb652723c52866572cff885f52a3fe67b9db5
https://github.com/before/uadetector/blob/215fb652723c52866572cff885f52a3fe67b9db5/modules/uadetector-core/src/main/java/net/sf/uadetector/internal/data/domain/OperatingSystem.java#L305-L309
104,895
before/uadetector
modules/uadetector-core/src/main/java/net/sf/uadetector/datastore/UpdateOperationWithCacheFileTask.java
UpdateOperationWithCacheFileTask.createTemporaryFile
protected static File createTemporaryFile(@Nonnull final File file) { Check.notNull(file, "file"); final File tempFile = new File(file.getParent(), file.getName() + ".temp"); // remove orphaned temporary file deleteFile(tempFile); return tempFile; }
java
protected static File createTemporaryFile(@Nonnull final File file) { Check.notNull(file, "file"); final File tempFile = new File(file.getParent(), file.getName() + ".temp"); // remove orphaned temporary file deleteFile(tempFile); return tempFile; }
[ "protected", "static", "File", "createTemporaryFile", "(", "@", "Nonnull", "final", "File", "file", ")", "{", "Check", ".", "notNull", "(", "file", ",", "\"file\"", ")", ";", "final", "File", "tempFile", "=", "new", "File", "(", "file", ".", "getParent", ...
Creates a temporary file near the passed file. The name of the given one will be used and the suffix ".temp" will be added. @param file file in which the entire contents from the given URL can be saved @throws IllegalStateException if the file can not be deleted
[ "Creates", "a", "temporary", "file", "near", "the", "passed", "file", ".", "The", "name", "of", "the", "given", "one", "will", "be", "used", "and", "the", "suffix", ".", "temp", "will", "be", "added", "." ]
215fb652723c52866572cff885f52a3fe67b9db5
https://github.com/before/uadetector/blob/215fb652723c52866572cff885f52a3fe67b9db5/modules/uadetector-core/src/main/java/net/sf/uadetector/datastore/UpdateOperationWithCacheFileTask.java#L62-L71
104,896
before/uadetector
modules/uadetector-core/src/main/java/net/sf/uadetector/datastore/UpdateOperationWithCacheFileTask.java
UpdateOperationWithCacheFileTask.deleteFile
protected static void deleteFile(@Nonnull final File file) { Check.notNull(file, "file"); Check.stateIsTrue(!file.exists() || file.delete(), "Cannot delete file '%s'.", file.getPath()); }
java
protected static void deleteFile(@Nonnull final File file) { Check.notNull(file, "file"); Check.stateIsTrue(!file.exists() || file.delete(), "Cannot delete file '%s'.", file.getPath()); }
[ "protected", "static", "void", "deleteFile", "(", "@", "Nonnull", "final", "File", "file", ")", "{", "Check", ".", "notNull", "(", "file", ",", "\"file\"", ")", ";", "Check", ".", "stateIsTrue", "(", "!", "file", ".", "exists", "(", ")", "||", "file", ...
Removes the given file. @param file a file which should be deleted @throws net.sf.qualitycheck.exception.IllegalNullArgumentException if the given argument is {@code null} @throws net.sf.qualitycheck.exception.IllegalStateOfArgumentException if the file can not be deleted
[ "Removes", "the", "given", "file", "." ]
215fb652723c52866572cff885f52a3fe67b9db5
https://github.com/before/uadetector/blob/215fb652723c52866572cff885f52a3fe67b9db5/modules/uadetector-core/src/main/java/net/sf/uadetector/datastore/UpdateOperationWithCacheFileTask.java#L84-L87
104,897
before/uadetector
modules/uadetector-core/src/main/java/net/sf/uadetector/VersionNumber.java
VersionNumber.toVersionString
private static String toVersionString(@Nonnull final List<String> groups) { final StringBuilder builder = new StringBuilder(6); int count = 0; for (final String segment : groups) { if (EMPTY_GROUP.equals(segment)) { break; } else { if (count > 0) { builder.append(SEPARATOR); } builder.a...
java
private static String toVersionString(@Nonnull final List<String> groups) { final StringBuilder builder = new StringBuilder(6); int count = 0; for (final String segment : groups) { if (EMPTY_GROUP.equals(segment)) { break; } else { if (count > 0) { builder.append(SEPARATOR); } builder.a...
[ "private", "static", "String", "toVersionString", "(", "@", "Nonnull", "final", "List", "<", "String", ">", "groups", ")", "{", "final", "StringBuilder", "builder", "=", "new", "StringBuilder", "(", "6", ")", ";", "int", "count", "=", "0", ";", "for", "(...
Converts the given list of numbers in a version string. The groups of the version number will be separated by a dot. @param groups list of numbers of a version number @return a formated version string
[ "Converts", "the", "given", "list", "of", "numbers", "in", "a", "version", "string", ".", "The", "groups", "of", "the", "version", "number", "will", "be", "separated", "by", "a", "dot", "." ]
215fb652723c52866572cff885f52a3fe67b9db5
https://github.com/before/uadetector/blob/215fb652723c52866572cff885f52a3fe67b9db5/modules/uadetector-core/src/main/java/net/sf/uadetector/VersionNumber.java#L158-L173
104,898
before/uadetector
modules/uadetector-core/src/main/java/net/sf/uadetector/VersionNumber.java
VersionNumber.compareTo
@Override public int compareTo(@Nullable final ReadableVersionNumber other) { int result = 0; if (other == null) { result = -1; } else { Check.notNull(other.getGroups(), "other.getGroups()"); final int length = groups.size() < other.getGroups().size() ? groups.size() : other.getGroups().size(); final...
java
@Override public int compareTo(@Nullable final ReadableVersionNumber other) { int result = 0; if (other == null) { result = -1; } else { Check.notNull(other.getGroups(), "other.getGroups()"); final int length = groups.size() < other.getGroups().size() ? groups.size() : other.getGroups().size(); final...
[ "@", "Override", "public", "int", "compareTo", "(", "@", "Nullable", "final", "ReadableVersionNumber", "other", ")", "{", "int", "result", "=", "0", ";", "if", "(", "other", "==", "null", ")", "{", "result", "=", "-", "1", ";", "}", "else", "{", "Che...
Compares this version number with the specified version number for order. Returns a negative integer, zero, or a positive integer as this version number is less than, equal to, or greater than the specified version number. @return a negative integer, zero, or a positive integer as this version number is less than, equ...
[ "Compares", "this", "version", "number", "with", "the", "specified", "version", "number", "for", "order", ".", "Returns", "a", "negative", "integer", "zero", "or", "a", "positive", "integer", "as", "this", "version", "number", "is", "less", "than", "equal", ...
215fb652723c52866572cff885f52a3fe67b9db5
https://github.com/before/uadetector/blob/215fb652723c52866572cff885f52a3fe67b9db5/modules/uadetector-core/src/main/java/net/sf/uadetector/VersionNumber.java#L308-L329
104,899
before/uadetector
modules/uadetector-core/src/main/java/net/sf/uadetector/internal/data/XmlDataHandler.java
XmlDataHandler.logParsingIssue
protected static void logParsingIssue(final String prefix, final SAXParseException e) { final StringBuilder buffer = new StringBuilder(); buffer.append(prefix); buffer.append(" while reading UAS data: "); buffer.append(e.getMessage()); buffer.append(" (line: "); buffer.append(e.getLineNumber()); if (e.get...
java
protected static void logParsingIssue(final String prefix, final SAXParseException e) { final StringBuilder buffer = new StringBuilder(); buffer.append(prefix); buffer.append(" while reading UAS data: "); buffer.append(e.getMessage()); buffer.append(" (line: "); buffer.append(e.getLineNumber()); if (e.get...
[ "protected", "static", "void", "logParsingIssue", "(", "final", "String", "prefix", ",", "final", "SAXParseException", "e", ")", "{", "final", "StringBuilder", "buffer", "=", "new", "StringBuilder", "(", ")", ";", "buffer", ".", "append", "(", "prefix", ")", ...
Logs an issue while parsing XML. @param prefix log level as string to add at the beginning of the message @param e exception to log
[ "Logs", "an", "issue", "while", "parsing", "XML", "." ]
215fb652723c52866572cff885f52a3fe67b9db5
https://github.com/before/uadetector/blob/215fb652723c52866572cff885f52a3fe67b9db5/modules/uadetector-core/src/main/java/net/sf/uadetector/internal/data/XmlDataHandler.java#L292-L305