signature:
public class Frame { /** * Returns the abstract type stored at the given local variable index in the output frame .
 * @ param localIndex the index of the local variable whose value must be returned .
 * @ return the abstract type stored at the given local variable index in the output frame . */
private int getLocal ( final int localIndex ) { } }

implementation:
if ( outputLocals == null || localIndex >= outputLocals . length ) { // If this local has never been assigned in this basic block , it is still equal to its value
// in the input frame .
return LOCAL_KIND | localIndex ; } else { int abstractType = outputLocals [ localIndex ] ; if ( abstractType == 0 ) { // If this local has never been assigned in this basic block , so it is still equal to its
// value in the input frame .
abstractType = outputLocals [ localIndex ] = LOCAL_KIND | localIndex ; } return abstractType ; }


signature:
public class Frame { /** * Replaces the abstract type stored at the given local variable index in the output frame .
 * @ param localIndex the index of the output frame local variable that must be set .
 * @ param abstractType the value that must be set . */
private void setLocal ( final int localIndex , final int abstractType ) { } }

implementation:
// Create and / or resize the output local variables array if necessary .
if ( outputLocals == null ) { outputLocals = new int [ 10 ] ; } int outputLocalsLength = outputLocals . length ; if ( localIndex >= outputLocalsLength ) { int [ ] newOutputLocals = new int [ Math . max ( localIndex + 1 , 2 * outputLocalsLength ) ] ; System . arraycopy ( outputLocals , 0 , newOutputLocals , 0 , outputLocalsLength ) ; outputLocals = newOutputLocals ; } // Set the local variable .
outputLocals [ localIndex ] = abstractType ;


signature:
public class Frame { /** * Pushes the given abstract type on the output frame stack .
 * @ param abstractType an abstract type . */
private void push ( final int abstractType ) { } }

implementation:
// Create and / or resize the output stack array if necessary .
if ( outputStack == null ) { outputStack = new int [ 10 ] ; } int outputStackLength = outputStack . length ; if ( outputStackTop >= outputStackLength ) { int [ ] newOutputStack = new int [ Math . max ( outputStackTop + 1 , 2 * outputStackLength ) ] ; System . arraycopy ( outputStack , 0 , newOutputStack , 0 , outputStackLength ) ; outputStack = newOutputStack ; } // Pushes the abstract type on the output stack .
outputStack [ outputStackTop ++ ] = abstractType ; // Updates the maximum size reached by the output stack , if needed ( note that this size is
// relative to the input stack size , which is not known yet ) .
short outputStackSize = ( short ) ( outputStackStart + outputStackTop ) ; if ( outputStackSize > owner . outputStackMax ) { owner . outputStackMax = outputStackSize ; }


signature:
public class Frame { /** * Pushes the abstract type corresponding to the given descriptor on the output frame stack .
 * @ param symbolTable the type table to use to lookup and store type { @ link Symbol } .
 * @ param descriptor a type or method descriptor ( in which case its return type is pushed ) . */
private void push ( final SymbolTable symbolTable , final String descriptor ) { } }

implementation: int typeDescriptorOffset = descriptor . charAt ( 0 ) == '(' ? descriptor . indexOf ( ')' ) + 1 : 0 ; int abstractType = getAbstractTypeFromDescriptor ( symbolTable , descriptor , typeDescriptorOffset ) ; if ( abstractType != 0 ) { push ( abstractType ) ; if ( abstractType == LONG || abstractType == DOUBLE ) { push ( TOP ) ; } }


signature:
public class Frame { /** * Pops the given number of abstract types from the output frame stack .
 * @ param elements the number of abstract types that must be popped . */
private void pop ( final int elements ) { } }

implementation:
if ( outputStackTop >= elements ) { outputStackTop -= elements ; } else { // If the number of elements to be popped is greater than the number of elements in the output
// stack , clear it , and pop the remaining elements from the input stack .
outputStackStart -= elements - outputStackTop ; outputStackTop = 0 ; }


signature:
public class Frame { /** * Pops as many abstract types from the output frame stack as described by the given descriptor .
 * @ param descriptor a type or method descriptor ( in which case its argument types are popped ) . */
private void pop ( final String descriptor ) { } }

implementation: char firstDescriptorChar = descriptor . charAt ( 0 ) ; if ( firstDescriptorChar == '(' ) { pop ( ( Type . getArgumentsAndReturnSizes ( descriptor ) >> 2 ) - 1 ) ; } else if ( firstDescriptorChar == 'J' || firstDescriptorChar == 'D' ) { pop ( 2 ) ; } else { pop ( 1 ) ; }


signature:
public class Frame { /** * Adds an abstract type to the list of types on which a constructor is invoked in the basic
 * block .
 * @ param abstractType an abstract type on a which a constructor is invoked . */
private void addInitializedType ( final int abstractType ) { } }

implementation:
// Create and / or resize the initializations array if necessary .
if ( initializations == null ) { initializations = new int [ 2 ] ; } int initializationsLength = initializations . length ; if ( initializationCount >= initializationsLength ) { int [ ] newInitializations = new int [ Math . max ( initializationCount + 1 , 2 * initializationsLength ) ] ; System . arraycopy ( initializations , 0 , newInitializations , 0 , initializationsLength ) ; initializations = newInitializations ; } // Store the abstract type .
initializations [ initializationCount ++ ] = abstractType ;


signature:
public class Frame { /** * Returns the " initialized " abstract type corresponding to the given abstract type .
 * @ param symbolTable the type table to use to lookup and store type { @ link Symbol } .
 * @ param abstractType an abstract type .
 * @ return the REFERENCE _ KIND abstract type corresponding to abstractType if it is
 * UNINITIALIZED _ THIS or an UNINITIALIZED _ KIND abstract type for one of the types on which a
 * constructor is invoked in the basic block . Otherwise returns abstractType . */
private int getInitializedType ( final SymbolTable symbolTable , final int abstractType ) { } }

implementation: if ( abstractType == UNINITIALIZED_THIS || ( abstractType & ( DIM_MASK | KIND_MASK ) ) == UNINITIALIZED_KIND ) { for ( int i = 0 ; i < initializationCount ; ++ i ) { int initializedType = initializations [ i ] ; int dim = initializedType & DIM_MASK ; int kind = initializedType & KIND_MASK ; int value = initializedType & VALUE_MASK ; if ( kind == LOCAL_KIND ) { initializedType = dim + inputLocals [ value ] ; } else if ( kind == STACK_KIND ) { initializedType = dim + inputStack [ inputStack . length - value ] ; } if ( abstractType == initializedType ) { if ( abstractType == UNINITIALIZED_THIS ) { return REFERENCE_KIND | symbolTable . addType ( symbolTable . getClassName ( ) ) ; } else { return REFERENCE_KIND | symbolTable . addType ( symbolTable . getType ( abstractType & VALUE_MASK ) . value ) ; } } } } return abstractType ;


signature:
public class Frame { /** * Simulates the action of the given instruction on the output stack frame .
 * @ param opcode the opcode of the instruction .
 * @ param arg the numeric operand of the instruction , if any .
 * @ param argSymbol the Symbol operand of the instruction , if any .
 * @ param symbolTable the type table to use to lookup and store type { @ link Symbol } . */
void execute ( final int opcode , final int arg , final Symbol argSymbol , final SymbolTable symbolTable ) { } }

implementation:
// Abstract types popped from the stack or read from local variables .
int abstractType1 ; int abstractType2 ; int abstractType3 ; int abstractType4 ; switch ( opcode ) { case Opcodes . NOP : case Opcodes . INEG : case Opcodes . LNEG : case Opcodes . FNEG : case Opcodes . DNEG : case Opcodes . I2B : case Opcodes . I2C : case Opcodes . I2S : case Opcodes . GOTO : case Opcodes . RETURN : break ; case Opcodes . ACONST_NULL : push ( NULL ) ; break ; case Opcodes . ICONST_M1 : case Opcodes . ICONST_0 : case Opcodes . ICONST_1 : case Opcodes . ICONST_2 : case Opcodes . ICONST_3 : case Opcodes . ICONST_4 : case Opcodes . ICONST_5 : case Opcodes . BIPUSH : case Opcodes . SIPUSH : case Opcodes . ILOAD : push ( INTEGER ) ; break ; case Opcodes . LCONST_0 : case Opcodes . LCONST_1 : case Opcodes . LLOAD : push ( LONG ) ; push ( TOP ) ; break ; case Opcodes . FCONST_0 : case Opcodes . FCONST_1 : case Opcodes . FCONST_2 : case Opcodes . FLOAD : push ( FLOAT ) ; break ; case Opcodes . DCONST_0 : case Opcodes . DCONST_1 : case Opcodes . DLOAD : push ( DOUBLE ) ; push ( TOP ) ; break ; case Opcodes . LDC : switch ( argSymbol . tag ) { case Symbol . CONSTANT_INTEGER_TAG : push ( INTEGER ) ; break ; case Symbol . CONSTANT_LONG_TAG : push ( LONG ) ; push ( TOP ) ; break ; case Symbol . CONSTANT_FLOAT_TAG : push ( FLOAT ) ; break ; case Symbol . CONSTANT_DOUBLE_TAG : push ( DOUBLE ) ; push ( TOP ) ; break ; case Symbol . CONSTANT_CLASS_TAG : push ( REFERENCE_KIND | symbolTable . addType ( "java/lang/Class" ) ) ; break ; case Symbol . CONSTANT_STRING_TAG : push ( REFERENCE_KIND | symbolTable . addType ( "java/lang/String" ) ) ; break ; case Symbol . CONSTANT_METHOD_TYPE_TAG : push ( REFERENCE_KIND | symbolTable . addType ( "java/lang/invoke/MethodType" ) ) ; break ; case Symbol . CONSTANT_METHOD_HANDLE_TAG : push ( REFERENCE_KIND | symbolTable . addType ( "java/lang/invoke/MethodHandle" ) ) ; break ; case Symbol . CONSTANT_DYNAMIC_TAG : push ( symbolTable , argSymbol . value ) ; break ; default : throw new AssertionError ( ) ; } break ; case Opcodes . ALOAD : push ( getLocal ( arg ) ) ; break ; case Opcodes . LALOAD : case Opcodes . D2L : pop ( 2 ) ; push ( LONG ) ; push ( TOP ) ; break ; case Opcodes . DALOAD : case Opcodes . L2D : pop ( 2 ) ; push ( DOUBLE ) ; push ( TOP ) ; break ; case Opcodes . AALOAD : pop ( 1 ) ; abstractType1 = pop ( ) ; push ( abstractType1 == NULL ? abstractType1 : ELEMENT_OF + abstractType1 ) ; break ; case Opcodes . ISTORE : case Opcodes . FSTORE : case Opcodes . ASTORE : abstractType1 = pop ( ) ; setLocal ( arg , abstractType1 ) ; if ( arg > 0 ) { int previousLocalType = getLocal ( arg - 1 ) ; if ( previousLocalType == LONG || previousLocalType == DOUBLE ) { setLocal ( arg - 1 , TOP ) ; } else if ( ( previousLocalType & KIND_MASK ) == LOCAL_KIND || ( previousLocalType & KIND_MASK ) == STACK_KIND ) { // The type of the previous local variable is not known yet , but if it later appears
// to be LONG or DOUBLE , we should then use TOP instead .
setLocal ( arg - 1 , previousLocalType | TOP_IF_LONG_OR_DOUBLE_FLAG ) ; } } break ; case Opcodes . LSTORE : case Opcodes . DSTORE : pop ( 1 ) ; abstractType1 = pop ( ) ; setLocal ( arg , abstractType1 ) ; setLocal ( arg + 1 , TOP ) ; if ( arg > 0 ) { int previousLocalType = getLocal ( arg - 1 ) ; if ( previousLocalType == LONG || previousLocalType == DOUBLE ) { setLocal ( arg - 1 , TOP ) ; } else if ( ( previousLocalType & KIND_MASK ) == LOCAL_KIND || ( previousLocalType & KIND_MASK ) == STACK_KIND ) { // The type of the previous local variable is not known yet , but if it later appears
// to be LONG or DOUBLE , we should then use TOP instead .
setLocal ( arg - 1 , previousLocalType | TOP_IF_LONG_OR_DOUBLE_FLAG ) ; } } break ; case Opcodes . IASTORE : case Opcodes . BASTORE : case Opcodes . CASTORE : case Opcodes . SASTORE : case Opcodes . FASTORE : case Opcodes . AASTORE : pop ( 3 ) ; break ; case Opcodes . LASTORE : case Opcodes . DASTORE : pop ( 4 ) ; break ; case Opcodes . POP : case Opcodes . IFEQ : case Opcodes . IFNE : case Opcodes . IFLT : case Opcodes . IFGE : case Opcodes . IFGT : case Opcodes . IFLE : case Opcodes . IRETURN : case Opcodes . FRETURN : case Opcodes . ARETURN : case Opcodes . TABLESWITCH : case Opcodes . LOOKUPSWITCH : case Opcodes . ATHROW : case Opcodes . MONITORENTER : case Opcodes . MONITOREXIT : case Opcodes . IFNULL : case Opcodes . IFNONNULL : pop ( 1 ) ; break ; case Opcodes . POP2 : case Opcodes . IF_ICMPEQ : case Opcodes . IF_ICMPNE : case Opcodes . IF_ICMPLT : case Opcodes . IF_ICMPGE : case Opcodes . IF_ICMPGT : case Opcodes . IF_ICMPLE : case Opcodes . IF_ACMPEQ : case Opcodes . IF_ACMPNE : case Opcodes . LRETURN : case Opcodes . DRETURN : pop ( 2 ) ; break ; case Opcodes . DUP : abstractType1 = pop ( ) ; push ( abstractType1 ) ; push ( abstractType1 ) ; break ; case Opcodes . DUP_X1 : abstractType1 = pop ( ) ; abstractType2 = pop ( ) ; push ( abstractType1 ) ; push ( abstractType2 ) ; push ( abstractType1 ) ; break ; case Opcodes . DUP_X2 : abstractType1 = pop ( ) ; abstractType2 = pop ( ) ; abstractType3 = pop ( ) ; push ( abstractType1 ) ; push ( abstractType3 ) ; push ( abstractType2 ) ; push ( abstractType1 ) ; break ; case Opcodes . DUP2 : abstractType1 = pop ( ) ; abstractType2 = pop ( ) ; push ( abstractType2 ) ; push ( abstractType1 ) ; push ( abstractType2 ) ; push ( abstractType1 ) ; break ; case Opcodes . DUP2_X1 : abstractType1 = pop ( ) ; abstractType2 = pop ( ) ; abstractType3 = pop ( ) ; push ( abstractType2 ) ; push ( abstractType1 ) ; push ( abstractType3 ) ; push ( abstractType2 ) ; push ( abstractType1 ) ; break ; case Opcodes . DUP2_X2 : abstractType1 = pop ( ) ; abstractType2 = pop ( ) ; abstractType3 = pop ( ) ; abstractType4 = pop ( ) ; push ( abstractType2 ) ; push ( abstractType1 ) ; push ( abstractType4 ) ; push ( abstractType3 ) ; push ( abstractType2 ) ; push ( abstractType1 ) ; break ; case Opcodes . SWAP : abstractType1 = pop ( ) ; abstractType2 = pop ( ) ; push ( abstractType1 ) ; push ( abstractType2 ) ; break ; case Opcodes . IALOAD : case Opcodes . BALOAD : case Opcodes . CALOAD : case Opcodes . SALOAD : case Opcodes . IADD : case Opcodes . ISUB : case Opcodes . IMUL : case Opcodes . IDIV : case Opcodes . IREM : case Opcodes . IAND : case Opcodes . IOR : case Opcodes . IXOR : case Opcodes . ISHL : case Opcodes . ISHR : case Opcodes . IUSHR : case Opcodes . L2I : case Opcodes . D2I : case Opcodes . FCMPL : case Opcodes . FCMPG : pop ( 2 ) ; push ( INTEGER ) ; break ; case Opcodes . LADD : case Opcodes . LSUB : case Opcodes . LMUL : case Opcodes . LDIV : case Opcodes . LREM : case Opcodes . LAND : case Opcodes . LOR : case Opcodes . LXOR : pop ( 4 ) ; push ( LONG ) ; push ( TOP ) ; break ; case Opcodes . FALOAD : case Opcodes . FADD : case Opcodes . FSUB : case Opcodes . FMUL : case Opcodes . FDIV : case Opcodes . FREM : case Opcodes . L2F : case Opcodes . D2F : pop ( 2 ) ; push ( FLOAT ) ; break ; case Opcodes . DADD : case Opcodes . DSUB : case Opcodes . DMUL : case Opcodes . DDIV : case Opcodes . DREM : pop ( 4 ) ; push ( DOUBLE ) ; push ( TOP ) ; break ; case Opcodes . LSHL : case Opcodes . LSHR : case Opcodes . LUSHR : pop ( 3 ) ; push ( LONG ) ; push ( TOP ) ; break ; case Opcodes . IINC : setLocal ( arg , INTEGER ) ; break ; case Opcodes . I2L : case Opcodes . F2L : pop ( 1 ) ; push ( LONG ) ; push ( TOP ) ; break ; case Opcodes . I2F : pop ( 1 ) ; push ( FLOAT ) ; break ; case Opcodes . I2D : case Opcodes . F2D : pop ( 1 ) ; push ( DOUBLE ) ; push ( TOP ) ; break ; case Opcodes . F2I : case Opcodes . ARRAYLENGTH : case Opcodes . INSTANCEOF : pop ( 1 ) ; push ( INTEGER ) ; break ; case Opcodes . LCMP : case Opcodes . DCMPL : case Opcodes . DCMPG : pop ( 4 ) ; push ( INTEGER ) ; break ; case Opcodes . JSR : case Opcodes . RET : throw new IllegalArgumentException ( "JSR/RET are not supported with computeFrames option" ) ; case Opcodes . GETSTATIC : push ( symbolTable , argSymbol . value ) ; break ; case Opcodes . PUTSTATIC : pop ( argSymbol . value ) ; break ; case Opcodes . GETFIELD : pop ( 1 ) ; push ( symbolTable , argSymbol . value ) ; break ; case Opcodes . PUTFIELD : pop ( argSymbol . value ) ; pop ( ) ; break ; case Opcodes . INVOKEVIRTUAL : case Opcodes . INVOKESPECIAL : case Opcodes . INVOKESTATIC : case Opcodes . INVOKEINTERFACE : pop ( argSymbol . value ) ; if ( opcode != Opcodes . INVOKESTATIC ) { abstractType1 = pop ( ) ; if ( opcode == Opcodes . INVOKESPECIAL && argSymbol . name . charAt ( 0 ) == '<' ) { addInitializedType ( abstractType1 ) ; } } push ( symbolTable , argSymbol . value ) ; break ; case Opcodes . INVOKEDYNAMIC : pop ( argSymbol . value ) ; push ( symbolTable , argSymbol . value ) ; break ; case Opcodes . NEW : push ( UNINITIALIZED_KIND | symbolTable . addUninitializedType ( argSymbol . value , arg ) ) ; break ; case Opcodes . NEWARRAY : pop ( ) ; switch ( arg ) { case Opcodes . T_BOOLEAN : push ( ARRAY_OF | BOOLEAN ) ; break ; case Opcodes . T_CHAR : push ( ARRAY_OF | CHAR ) ; break ; case Opcodes . T_BYTE : push ( ARRAY_OF | BYTE ) ; break ; case Opcodes . T_SHORT : push ( ARRAY_OF | SHORT ) ; break ; case Opcodes . T_INT : push ( ARRAY_OF | INTEGER ) ; break ; case Opcodes . T_FLOAT : push ( ARRAY_OF | FLOAT ) ; break ; case Opcodes . T_DOUBLE : push ( ARRAY_OF | DOUBLE ) ; break ; case Opcodes . T_LONG : push ( ARRAY_OF | LONG ) ; break ; default : throw new IllegalArgumentException ( ) ; } break ; case Opcodes . ANEWARRAY : String arrayElementType = argSymbol . value ; pop ( ) ; if ( arrayElementType . charAt ( 0 ) == '[' ) { push ( symbolTable , '[' + arrayElementType ) ; } else { push ( ARRAY_OF | REFERENCE_KIND | symbolTable . addType ( arrayElementType ) ) ; } break ; case Opcodes . CHECKCAST : String castType = argSymbol . value ; pop ( ) ; if ( castType . charAt ( 0 ) == '[' ) { push ( symbolTable , castType ) ; } else { push ( REFERENCE_KIND | symbolTable . addType ( castType ) ) ; } break ; case Opcodes . MULTIANEWARRAY : pop ( arg ) ; push ( symbolTable , argSymbol . value ) ; break ; default : throw new IllegalArgumentException ( ) ; }


signature:
public class Frame { /** * Merges the type at the given index in the given abstract type array with the given type .
 * Returns { @ literal true } if the type array has been modified by this operation .
 * @ param symbolTable the type table to use to lookup and store type { @ link Symbol } .
 * @ param sourceType the abstract type with which the abstract type array element must be merged .
 * This type should be of { @ link # CONSTANT _ KIND } , { @ link # REFERENCE _ KIND } or { @ link
 * # UNINITIALIZED _ KIND } kind , with positive or null array dimensions .
 * @ param dstTypes an array of abstract types . These types should be of { @ link # CONSTANT _ KIND } ,
 * { @ link # REFERENCE _ KIND } or { @ link # UNINITIALIZED _ KIND } kind , with positive or null array
 * dimensions .
 * @ param dstIndex the index of the type that must be merged in dstTypes .
 * @ return { @ literal true } if the type array has been modified by this operation . */
private static boolean merge ( final SymbolTable symbolTable , final int sourceType , final int [ ] dstTypes , final int dstIndex ) { } }

implementation:
int dstType = dstTypes [ dstIndex ] ; if ( dstType == sourceType ) { // If the types are equal , merge ( sourceType , dstType ) = dstType , so there is no change .
return false ; } int srcType = sourceType ; if ( ( sourceType & ~ DIM_MASK ) == NULL ) { if ( dstType == NULL ) { return false ; } srcType = NULL ; } if ( dstType == 0 ) { // If dstTypes [ dstIndex ] has never been assigned , merge ( srcType , dstType ) = srcType .
dstTypes [ dstIndex ] = srcType ; return true ; } int mergedType ; if ( ( dstType & DIM_MASK ) != 0 || ( dstType & KIND_MASK ) == REFERENCE_KIND ) { // If dstType is a reference type of any array dimension .
if ( srcType == NULL ) { // If srcType is the NULL type , merge ( srcType , dstType ) = dstType , so there is no change .
return false ; } else if ( ( srcType & ( DIM_MASK | KIND_MASK ) ) == ( dstType & ( DIM_MASK | KIND_MASK ) ) ) { // If srcType has the same array dimension and the same kind as dstType .
if ( ( dstType & KIND_MASK ) == REFERENCE_KIND ) { // If srcType and dstType are reference types with the same array dimension ,
// merge ( srcType , dstType ) = dim ( srcType ) | common super class of srcType and dstType .
mergedType = ( srcType & DIM_MASK ) | REFERENCE_KIND | symbolTable . addMergedType ( srcType & VALUE_MASK , dstType & VALUE_MASK ) ; } else { // If srcType and dstType are array types of equal dimension but different element types ,
// merge ( srcType , dstType ) = dim ( srcType ) - 1 | java / lang / Object .
int mergedDim = ELEMENT_OF + ( srcType & DIM_MASK ) ; mergedType = mergedDim | REFERENCE_KIND | symbolTable . addType ( "java/lang/Object" ) ; } } else if ( ( srcType & DIM_MASK ) != 0 || ( srcType & KIND_MASK ) == REFERENCE_KIND ) { // If srcType is any other reference or array type ,
// merge ( srcType , dstType ) = min ( srcDdim , dstDim ) | java / lang / Object
// where srcDim is the array dimension of srcType , minus 1 if srcType is an array type
// with a non reference element type ( and similarly for dstDim ) .
int srcDim = srcType & DIM_MASK ; if ( srcDim != 0 && ( srcType & KIND_MASK ) != REFERENCE_KIND ) { srcDim = ELEMENT_OF + srcDim ; } int dstDim = dstType & DIM_MASK ; if ( dstDim != 0 && ( dstType & KIND_MASK ) != REFERENCE_KIND ) { dstDim = ELEMENT_OF + dstDim ; } mergedType = Math . min ( srcDim , dstDim ) | REFERENCE_KIND | symbolTable . addType ( "java/lang/Object" ) ; } else { // If srcType is any other type , merge ( srcType , dstType ) = TOP .
mergedType = TOP ; } } else if ( dstType == NULL ) { // If dstType is the NULL type , merge ( srcType , dstType ) = srcType , or TOP if srcType is not a
// an array type or a reference type .
mergedType = ( srcType & DIM_MASK ) != 0 || ( srcType & KIND_MASK ) == REFERENCE_KIND ? srcType : TOP ; } else { // If dstType is any other type , merge ( srcType , dstType ) = TOP whatever srcType .
mergedType = TOP ; } if ( mergedType != dstType ) { dstTypes [ dstIndex ] = mergedType ; return true ; } return false ;


signature:
public class Frame { /** * Makes the given { @ link MethodWriter } visit the input frame of this { @ link Frame } . The visit is
 * done with the { @ link MethodWriter # visitFrameStart } , { @ link MethodWriter # visitAbstractType } and
 * { @ link MethodWriter # visitFrameEnd } methods .
 * @ param methodWriter the { @ link MethodWriter } that should visit the input frame of this { @ link
 * Frame } . */
final void accept ( final MethodWriter methodWriter ) { } }

implementation:
// Compute the number of locals , ignoring TOP types that are just after a LONG or a DOUBLE , and
// all trailing TOP types .
int [ ] localTypes = inputLocals ; int numLocal = 0 ; int numTrailingTop = 0 ; int i = 0 ; while ( i < localTypes . length ) { int localType = localTypes [ i ] ; i += ( localType == LONG || localType == DOUBLE ) ? 2 : 1 ; if ( localType == TOP ) { numTrailingTop ++ ; } else { numLocal += numTrailingTop + 1 ; numTrailingTop = 0 ; } } // Compute the stack size , ignoring TOP types that are just after a LONG or a DOUBLE .
int [ ] stackTypes = inputStack ; int numStack = 0 ; i = 0 ; while ( i < stackTypes . length ) { int stackType = stackTypes [ i ] ; i += ( stackType == LONG || stackType == DOUBLE ) ? 2 : 1 ; numStack ++ ; } // Visit the frame and its content .
int frameIndex = methodWriter . visitFrameStart ( owner . bytecodeOffset , numLocal , numStack ) ; i = 0 ; while ( numLocal -- > 0 ) { int localType = localTypes [ i ] ; i += ( localType == LONG || localType == DOUBLE ) ? 2 : 1 ; methodWriter . visitAbstractType ( frameIndex ++ , localType ) ; } i = 0 ; while ( numStack -- > 0 ) { int stackType = stackTypes [ i ] ; i += ( stackType == LONG || stackType == DOUBLE ) ? 2 : 1 ; methodWriter . visitAbstractType ( frameIndex ++ , stackType ) ; } methodWriter . visitFrameEnd ( ) ;


signature:
public class Frame { /** * Put the given abstract type in the given ByteVector , using the JVMS verification _ type _ info
 * format used in StackMapTable attributes .
 * @ param symbolTable the type table to use to lookup and store type { @ link Symbol } .
 * @ param abstractType an abstract type , restricted to { @ link Frame # CONSTANT _ KIND } , { @ link
 * Frame # REFERENCE _ KIND } or { @ link Frame # UNINITIALIZED _ KIND } types .
 * @ param output where the abstract type must be put .
 * @ see < a href = " https : / / docs . oracle . com / javase / specs / jvms / se9 / html / jvms - 4 . html # jvms - 4.7.4 " > JVMS
 * 4.7.4 < / a > */
static void putAbstractType ( final SymbolTable symbolTable , final int abstractType , final ByteVector output ) { } }

implementation:
int arrayDimensions = ( abstractType & Frame . DIM_MASK ) >> DIM_SHIFT ; if ( arrayDimensions == 0 ) { int typeValue = abstractType & VALUE_MASK ; switch ( abstractType & KIND_MASK ) { case CONSTANT_KIND : output . putByte ( typeValue ) ; break ; case REFERENCE_KIND : output . putByte ( ITEM_OBJECT ) . putShort ( symbolTable . addConstantClass ( symbolTable . getType ( typeValue ) . value ) . index ) ; break ; case UNINITIALIZED_KIND : output . putByte ( ITEM_UNINITIALIZED ) . putShort ( ( int ) symbolTable . getType ( typeValue ) . data ) ; break ; default : throw new AssertionError ( ) ; } } else { // Case of an array type , we need to build its descriptor first .
StringBuilder typeDescriptor = new StringBuilder ( ) ; while ( arrayDimensions -- > 0 ) { typeDescriptor . append ( '[' ) ; } if ( ( abstractType & KIND_MASK ) == REFERENCE_KIND ) { typeDescriptor . append ( 'L' ) . append ( symbolTable . getType ( abstractType & VALUE_MASK ) . value ) . append ( ';' ) ; } else { switch ( abstractType & VALUE_MASK ) { case Frame . ITEM_ASM_BOOLEAN : typeDescriptor . append ( 'Z' ) ; break ; case Frame . ITEM_ASM_BYTE : typeDescriptor . append ( 'B' ) ; break ; case Frame . ITEM_ASM_CHAR : typeDescriptor . append ( 'C' ) ; break ; case Frame . ITEM_ASM_SHORT : typeDescriptor . append ( 'S' ) ; break ; case Frame . ITEM_INTEGER : typeDescriptor . append ( 'I' ) ; break ; case Frame . ITEM_FLOAT : typeDescriptor . append ( 'F' ) ; break ; case Frame . ITEM_LONG : typeDescriptor . append ( 'J' ) ; break ; case Frame . ITEM_DOUBLE : typeDescriptor . append ( 'D' ) ; break ; default : throw new AssertionError ( ) ; } } output . putByte ( ITEM_OBJECT ) . putShort ( symbolTable . addConstantClass ( typeDescriptor . toString ( ) ) . index ) ; }


signature:
public class TimedCache { /** * Prunes expired elements from the cache . Returns the number of removed objects . */
@ Override protected int pruneCache ( ) { } }

implementation: int count = 0 ; Iterator < CacheObject < K , V > > values = cacheMap . values ( ) . iterator ( ) ; while ( values . hasNext ( ) ) { CacheObject co = values . next ( ) ; if ( co . isExpired ( ) ) { values . remove ( ) ; count ++ ; } } return count ;


signature:
public class TimedCache { /** * Schedules prune . */
public void schedulePrune ( final long delay ) { } }

implementation: if ( pruneTimer != null ) { pruneTimer . cancel ( ) ; } pruneTimer = new Timer ( ) ; pruneTimer . schedule ( new TimerTask ( ) { @ Override public void run ( ) { prune ( ) ; } } , delay , delay ) ;


signature:
public class ClassVisitor { /** * Visit the module corresponding to the class .
 * @ param name the fully qualified name ( using dots ) of the module .
 * @ param access the module access flags , among { @ code ACC _ OPEN } , { @ code ACC _ SYNTHETIC } and { @ code
 * ACC _ MANDATED } .
 * @ param version the module version , or { @ literal null } .
 * @ return a visitor to visit the module values , or { @ literal null } if this visitor is not
 * interested in visiting this module . */
public ModuleVisitor visitModule ( final String name , final int access , final String version ) { } }

implementation: if ( api < Opcodes . ASM6 ) { throw new UnsupportedOperationException ( "This feature requires ASM6" ) ; } if ( cv != null ) { return cv . visitModule ( name , access , version ) ; } return null ;


signature:
public class ClassVisitor { /** * Visits the nest host class of the class . A nest is a set of classes of the same package that
 * share access to their private members . One of these classes , called the host , lists the other
 * members of the nest , which in turn should link to the host of their nest . This method must be
 * called only once and only if the visited class is a non - host member of a nest . A class is
 * implicitly its own nest , so it ' s invalid to call this method with the visited class name as
 * argument .
 * @ param nestHost the internal name of the host class of the nest . */
public void visitNestHost ( final String nestHost ) { } }

implementation: if ( api < Opcodes . ASM7 ) { throw new UnsupportedOperationException ( "This feature requires ASM7" ) ; } if ( cv != null ) { cv . visitNestHost ( nestHost ) ; }


signature:
public class ClassVisitor { /** * Visits the enclosing class of the class . This method must be called only if the class has an
 * enclosing class .
 * @ param owner internal name of the enclosing class of the class .
 * @ param name the name of the method that contains the class , or { @ literal null } if the class is
 * not enclosed in a method of its enclosing class .
 * @ param descriptor the descriptor of the method that contains the class , or { @ literal null } if
 * the class is not enclosed in a method of its enclosing class . */
public void visitOuterClass ( final String owner , final String name , final String descriptor ) { } }

implementation: if ( cv != null ) { cv . visitOuterClass ( owner , name , descriptor ) ; }


signature:
public class ClassVisitor { /** * Visits an annotation of the class .
 * @ param descriptor the class descriptor of the annotation class .
 * @ param visible { @ literal true } if the annotation is visible at runtime .
 * @ return a visitor to visit the annotation values , or { @ literal null } if this visitor is not
 * interested in visiting this annotation . */
public AnnotationVisitor visitAnnotation ( final String descriptor , final boolean visible ) { } }

implementation: if ( cv != null ) { return cv . visitAnnotation ( descriptor , visible ) ; } return null ;


signature:
public class ClassVisitor { /** * Visits a member of the nest . A nest is a set of classes of the same package that share access
 * to their private members . One of these classes , called the host , lists the other members of the
 * nest , which in turn should link to the host of their nest . This method must be called only if
 * the visited class is the host of a nest . A nest host is implicitly a member of its own nest , so
 * it ' s invalid to call this method with the visited class name as argument .
 * @ param nestMember the internal name of a nest member . */
public void visitNestMember ( final String nestMember ) { } }

implementation: if ( api < Opcodes . ASM7 ) { throw new UnsupportedOperationException ( "This feature requires ASM7" ) ; } if ( cv != null ) { cv . visitNestMember ( nestMember ) ; }


signature:
public class ClassVisitor { /** * Visits information about an inner class . This inner class is not necessarily a member of the
 * class being visited .
 * @ param name the internal name of an inner class ( see { @ link Type # getInternalName ( ) } ) .
 * @ param outerName the internal name of the class to which the inner class belongs ( see { @ link
 * Type # getInternalName ( ) } ) . May be { @ literal null } for not member classes .
 * @ param innerName the ( simple ) name of the inner class inside its enclosing class . May be
 * { @ literal null } for anonymous inner classes .
 * @ param access the access flags of the inner class as originally declared in the enclosing
 * class . */
public void visitInnerClass ( final String name , final String outerName , final String innerName , final int access ) { } }

implementation: if ( cv != null ) { cv . visitInnerClass ( name , outerName , innerName , access ) ; }


signature:
public class ClassVisitor { /** * Visits a field of the class .
 * @ param access the field ' s access flags ( see { @ link Opcodes } ) . This parameter also indicates if
 * the field is synthetic and / or deprecated .
 * @ param name the field ' s name .
 * @ param descriptor the field ' s descriptor ( see { @ link Type } ) .
 * @ param signature the field ' s signature . May be { @ literal null } if the field ' s type does not use
 * generic types .
 * @ param value the field ' s initial value . This parameter , which may be { @ literal null } if the
 * field does not have an initial value , must be an { @ link Integer } , a { @ link Float } , a { @ link
 * Long } , a { @ link Double } or a { @ link String } ( for { @ code int } , { @ code float } , { @ code long }
 * or { @ code String } fields respectively ) . < i > This parameter is only used for static
 * fields < / i > . Its value is ignored for non static fields , which must be initialized through
 * bytecode instructions in constructors or methods .
 * @ return a visitor to visit field annotations and attributes , or { @ literal null } if this class
 * visitor is not interested in visiting these annotations and attributes . */
public FieldVisitor visitField ( final int access , final String name , final String descriptor , final String signature , final Object value ) { } }

implementation: if ( cv != null ) { return cv . visitField ( access , name , descriptor , signature , value ) ; } return null ;


signature:
public class DriverManagerConnectionProvider { /** * - - - - - provider */
@ Override public synchronized void init ( ) { } }

implementation: try { Class . forName ( driverClass ) ; } catch ( ClassNotFoundException cnfex ) { throw new DbSqlException ( "JDBC driver not found: " + driverClass , cnfex ) ; }


signature:
public class DbThreadSession { /** * Returns existing thread session , or new one if already not exist . If session doesn ' t exist , it will be created
 * using default connection provider . */
public static DbThreadSession getThreadSession ( ) { } }

implementation: DbThreadSession session = ( DbThreadSession ) ThreadDbSessionHolder . get ( ) ; if ( session == null ) { session = new DbThreadSession ( ) ; } return session ;


signature:
public class DbThreadSession { /** * Closes thread session . */
public static void closeThreadSession ( ) { } }

implementation: DbThreadSession session = ( DbThreadSession ) ThreadDbSessionHolder . get ( ) ; if ( session != null ) { session . closeSession ( ) ; }


signature:
public class ActionRequest { /** * Creates execution array that will invoke all filters , actions and results
 * in correct order . */
protected ActionWrapper [ ] createExecutionArray ( ) { } }

implementation:
int totalInterceptors = ( this . actionRuntime . getInterceptors ( ) != null ? this . actionRuntime . getInterceptors ( ) . length : 0 ) ; int totalFilters = ( this . actionRuntime . getFilters ( ) != null ? this . actionRuntime . getFilters ( ) . length : 0 ) ; ActionWrapper [ ] executionArray = new ActionWrapper [ totalFilters + 1 + totalInterceptors + 1 ] ; // filters
int index = 0 ; if ( totalFilters > 0 ) { System . arraycopy ( actionRuntime . getFilters ( ) , 0 , executionArray , index , totalFilters ) ; index += totalFilters ; } // result is executed AFTER the action AND interceptors
executionArray [ index ++ ] = actionRequest -> { Object actionResult = actionRequest . invoke ( ) ; ActionRequest . this . madvocController . render ( ActionRequest . this , actionResult ) ; return actionResult ; } ; // interceptors
if ( totalInterceptors > 0 ) { System . arraycopy ( actionRuntime . getInterceptors ( ) , 0 , executionArray , index , totalInterceptors ) ; index += totalInterceptors ; } // action
executionArray [ index ] = actionRequest -> { actionResult = invokeActionMethod ( ) ; return actionResult ; } ; return executionArray ;


signature:
public class ActionRequest { /** * Invokes action method after starting all interceptors .
 * After method invocation , all interceptors will finish , in opposite order . */
protected Object invokeActionMethod ( ) throws Exception { } }

implementation: if ( actionRuntime . isActionHandlerDefined ( ) ) { actionRuntime . getActionHandler ( ) . handle ( this ) ; return null ; } final Object [ ] params = targets . extractParametersValues ( ) ; try { return actionRuntime . getActionClassMethod ( ) . invoke ( action , params ) ; } catch ( InvocationTargetException itex ) { throw wrapToException ( unwrapThrowable ( itex ) ) ; }


signature:
public class ActionRequest { /** * Reads request body only once and returns it to user . */
public String readRequestBody ( ) { } }

implementation: if ( requestBody == null ) { try { requestBody = ServletUtil . readRequestBodyFromStream ( getHttpServletRequest ( ) ) ; } catch ( IOException ioex ) { requestBody = StringPool . EMPTY ; } } return requestBody ;


signature:
public class PageData { /** * Calculates the first item index of requested page . */
public static int calcFirstItemIndexOfPage ( int page , final int pageSize , final int total ) { } }

implementation:
if ( total == 0 ) { return 0 ; } if ( page < 1 ) { page = 1 ; } int first = ( page - 1 ) * pageSize ; if ( first >= total ) { first = ( ( total - 1 ) / pageSize ) * pageSize ; // first item on the last page
} return first ;


signature:
public class PageData { /** * Calculates first item index of the page . */
public static int calcFirstItemIndexOfPage ( final PageRequest pageRequest , final int total ) { } }

implementation: return calcFirstItemIndexOfPage ( pageRequest . getPage ( ) , pageRequest . getSize ( ) , total ) ;


signature:
public class PseudoFunctionExpression { /** * Parses int value or throws < code > CSSellyException < / code > on failure . */
protected int parseInt ( final String value ) { } }

implementation: try { return Integer . parseInt ( value ) ; } catch ( NumberFormatException nfex ) { throw new CSSellyException ( nfex ) ; }


signature:
public class PseudoFunctionExpression { /** * Matches expression with the value . */
public boolean match ( final int value ) { } }

implementation: if ( a == 0 ) { return value == b ; } if ( a > 0 ) { if ( value < b ) { return false ; } return ( value - b ) % a == 0 ; } if ( value > b ) { return false ; } return ( b - value ) % ( - a ) == 0 ;


signature:
public class CharUtil { /** * Converts char array into byte array by replacing each character with two bytes . */
public static byte [ ] toRawByteArray ( final char [ ] carr ) { } }

implementation: byte [ ] barr = new byte [ carr . length << 1 ] ; for ( int i = 0 , bpos = 0 ; i < carr . length ; i ++ ) { char c = carr [ i ] ; barr [ bpos ++ ] = ( byte ) ( ( c & 0xFF00 ) >> 8 ) ; barr [ bpos ++ ] = ( byte ) ( c & 0x00FF ) ; } return barr ;


signature:
public class CharUtil { /** * Finds index of the first character in given array the differs from the
 * given set of characters .
 * @ return index of matched character or - 1 */
public static int findFirstDiff ( final char [ ] source , final int index , final char [ ] match ) { } }

implementation: for ( int i = index ; i < source . length ; i ++ ) { if ( ! equalsOne ( source [ i ] , match ) ) { return i ; } } return - 1 ;


signature:
public class LagartoHtmlRendererNodeVisitor { /** * Renders node name . */
protected String resolveNodeName ( final Node node ) { } }

implementation: switch ( tagCase ) { case DEFAULT : return node . getNodeName ( ) ; case RAW : return node . getNodeRawName ( ) ; case LOWERCASE : return node . getNodeRawName ( ) . toLowerCase ( ) ; case UPPERCASE : return node . getNodeRawName ( ) . toUpperCase ( ) ; } return null ;


signature:
public class LagartoHtmlRendererNodeVisitor { /** * Renders attribute name . */
protected String resolveAttributeName ( final Node node , final Attribute attribute ) { } }

implementation: switch ( attributeCase ) { case DEFAULT : return attribute . getName ( ) ; case RAW : return attribute . getRawName ( ) ; case LOWERCASE : return attribute . getRawName ( ) . toLowerCase ( ) ; case UPPERCASE : return attribute . getRawName ( ) . toUpperCase ( ) ; } return null ;


signature:
public class LagartoHtmlRendererNodeVisitor { /** * Renders attribute . */
protected void renderAttribute ( final Node node , final Attribute attribute , final Appendable appendable ) throws IOException { } }

implementation: String name = resolveAttributeName ( node , attribute ) ; String value = attribute . getValue ( ) ; appendable . append ( name ) ; if ( value != null ) { appendable . append ( '=' ) ; appendable . append ( '\"' ) ; appendable . append ( HtmlEncoder . attributeDoubleQuoted ( value ) ) ; appendable . append ( '\"' ) ; }


signature:
public class Props { /** * Loads props from the file . Assumes UTF8 encoding unless
 * the file ends with ' . properties ' , than it uses ISO 8859-1. */
public Props load ( final File file ) throws IOException { } }

implementation: final String extension = FileNameUtil . getExtension ( file . getAbsolutePath ( ) ) ; final String data ; if ( extension . equalsIgnoreCase ( "properties" ) ) { data = FileUtil . readString ( file , StringPool . ISO_8859_1 ) ; } else { data = FileUtil . readString ( file ) ; } parse ( data ) ; return this ;


signature:
public class Props { /** * Loads properties from the file in provided encoding . */
public Props load ( final File file , final String encoding ) throws IOException { } }

implementation: parse ( FileUtil . readString ( file , encoding ) ) ; return this ;


signature:
public class Props { /** * Loads properties from input stream . Stream is not closed at the end . */
public Props load ( final InputStream in ) throws IOException { } }

implementation: final Writer out = new FastCharArrayWriter ( ) ; StreamUtil . copy ( in , out ) ; parse ( out . toString ( ) ) ; return this ;


signature:
public class Props { /** * Loads base properties from the provided java properties .
 * Null values are ignored . */
public Props load ( final Map < ? , ? > p ) { } }

implementation: for ( final Map . Entry < ? , ? > entry : p . entrySet ( ) ) { final String name = entry . getKey ( ) . toString ( ) ; final Object value = entry . getValue ( ) ; if ( value == null ) { continue ; } data . putBaseProperty ( name , value . toString ( ) , false ) ; } return this ;


signature:
public class Props { /** * Loads base properties from java Map using provided prefix .
 * Null values are ignored . */
@ SuppressWarnings ( "unchecked" ) public Props load ( final Map < ? , ? > map , final String prefix ) { } }

implementation: String realPrefix = prefix ; realPrefix += '.' ; for ( final Map . Entry entry : map . entrySet ( ) ) { final String name = entry . getKey ( ) . toString ( ) ; final Object value = entry . getValue ( ) ; if ( value == null ) { continue ; } data . putBaseProperty ( realPrefix + name , value . toString ( ) , false ) ; } return this ;


signature:
public class Props { /** * Loads system properties with given prefix .
 * If prefix is < code > null < / code > it will not be ignored . */
public Props loadSystemProperties ( final String prefix ) { } }

implementation: final Properties environmentProperties = System . getProperties ( ) ; load ( environmentProperties , prefix ) ; return this ;


signature:
public class Props { /** * Loads environment properties with given prefix .
 * If prefix is < code > null < / code > it will not be used . */
public Props loadEnvironment ( final String prefix ) { } }

implementation: final Map < String , String > environmentMap = System . getenv ( ) ; load ( environmentMap , prefix ) ; return this ;


signature:
public class Props { /** * Loads props and properties from the classpath . */
public Props loadFromClasspath ( final String ... patterns ) { } }

implementation: ClassScanner . create ( ) . registerEntryConsumer ( entryData -> { String usedEncoding = JoddCore . encoding ; if ( StringUtil . endsWithIgnoreCase ( entryData . name ( ) , ".properties" ) ) { usedEncoding = StringPool . ISO_8859_1 ; } final String encoding = usedEncoding ; UncheckedException . runAndWrapException ( ( ) -> load ( entryData . openInputStream ( ) , encoding ) ) ; } ) . includeResources ( true ) . ignoreException ( true ) . excludeCommonJars ( ) . excludeAllEntries ( true ) . includeEntries ( patterns ) . scanDefaultClasspath ( ) . start ( ) ; return this ;


signature:
public class Props { /** * Returns value of property , using active profiles or default value if not found . */
public String getValueOrDefault ( final String key , final String defaultValue ) { } }

implementation: initialize ( ) ; final String value = data . lookupValue ( key , activeProfiles ) ; if ( value == null ) { return defaultValue ; } return value ;


signature:
public class Props { /** * Returns double value of given property or { @ code null } if property not found . */
public Double getDoubleValue ( final String key ) { } }

implementation: final String value = getValue ( key ) ; if ( value == null ) { return null ; } return Double . valueOf ( value ) ;


signature:
public class Props { /** * Returns < code > string < / code > value of given profiles . If key is not
 * found under listed profiles , base properties will be searched .
 * Returns < code > null < / code > if property doesn ' t exist . */
public String getValue ( final String key , final String ... profiles ) { } }

implementation: initialize ( ) ; return data . lookupValue ( key , profiles ) ;


signature:
public class Props { /** * Sets value on some profile . */
public void setValue ( final String key , final String value , final String profile ) { } }

implementation: if ( profile == null ) { data . putBaseProperty ( key , value , false ) ; } else { data . putProfileProperty ( key , value , profile , false ) ; } initialized = false ;


signature:
public class Props { /** * Extracts props belonging to active profiles . */
public void extractProps ( final Map target ) { } }

implementation: initialize ( ) ; data . extract ( target , activeProfiles , null , null ) ;


signature:
public class Props { /** * Extract props of given profiles . */
public void extractProps ( final Map target , final String ... profiles ) { } }

implementation: initialize ( ) ; data . extract ( target , profiles , null , null ) ;


signature:
public class Props { /** * Extracts subset of properties that matches given wildcards . */
public void extractSubProps ( final Map target , final String ... wildcardPatterns ) { } }

implementation: initialize ( ) ; data . extract ( target , activeProfiles , wildcardPatterns , null ) ;


signature:
public class Props { /** * Returns inner map from the props with given prefix . Keys in returned map
 * will not have the prefix . */
@ SuppressWarnings ( "unchecked" ) public Map < String , Object > innerMap ( final String prefix ) { } }

implementation: initialize ( ) ; return data . extract ( null , activeProfiles , null , prefix ) ;


signature:
public class Props { /** * Adds child map to the props on given prefix . */
public void addInnerMap ( String prefix , final Map < ? , ? > map , final String profile ) { } }

implementation: if ( ! StringUtil . endsWithChar ( prefix , '.' ) ) { prefix += StringPool . DOT ; } for ( Map . Entry < ? , ? > entry : map . entrySet ( ) ) { String key = entry . getKey ( ) . toString ( ) ; key = prefix + key ; setValue ( key , entry . getValue ( ) . toString ( ) , profile ) ; }


signature:
public class Props { /** * Resolves active profiles from special property .
 * This property can be only a base property !
 * If default active property is not defined , nothing happens .
 * Otherwise , it will replace currently active profiles . */
protected void resolveActiveProfiles ( ) { } }

implementation:
if ( activeProfilesProp == null ) { activeProfiles = null ; return ; } final PropsEntry pv = data . getBaseProperty ( activeProfilesProp ) ; if ( pv == null ) { // no active profile set as the property , exit
return ; } final String value = pv . getValue ( ) ; if ( StringUtil . isBlank ( value ) ) { activeProfiles = null ; return ; } activeProfiles = StringUtil . splitc ( value , ',' ) ; StringUtil . trimAll ( activeProfiles ) ;


signature:
public class Props { /** * Returns all profiles names . */
public String [ ] getAllProfiles ( ) { } }

implementation: String [ ] profiles = new String [ data . profileProperties . size ( ) ] ; int index = 0 ; for ( String profileName : data . profileProperties . keySet ( ) ) { profiles [ index ] = profileName ; index ++ ; } return profiles ;


signature:
public class Props { /** * Returns all the profiles that define certain prop ' s key name .
 * Key name is given as a wildcard , or it can be matched fully . */
public String [ ] getProfilesFor ( final String propKeyNameWildcard ) { } }

implementation: HashSet < String > profiles = new HashSet < > ( ) ; profile : for ( Map . Entry < String , Map < String , PropsEntry > > entries : data . profileProperties . entrySet ( ) ) { String profileName = entries . getKey ( ) ; Map < String , PropsEntry > value = entries . getValue ( ) ; for ( String propKeyName : value . keySet ( ) ) { if ( Wildcard . equalsOrMatch ( propKeyName , propKeyNameWildcard ) ) { profiles . add ( profileName ) ; continue profile ; } } } return profiles . toArray ( new String [ 0 ] ) ;


signature:
public class BeanDefinition { /** * Adds property injection point . */
protected void addPropertyInjectionPoint ( final PropertyInjectionPoint pip ) { } }

implementation: if ( properties == null ) { properties = new PropertyInjectionPoint [ 1 ] ; properties [ 0 ] = pip ; } else { properties = ArraysUtil . append ( properties , pip ) ; }


signature:
public class BeanDefinition { /** * Adds set injection point . */
protected void addSetInjectionPoint ( final SetInjectionPoint sip ) { } }

implementation: if ( sets == null ) { sets = new SetInjectionPoint [ 1 ] ; sets [ 0 ] = sip ; } else { sets = ArraysUtil . append ( sets , sip ) ; }


signature:
public class BeanDefinition { /** * Adds method injection point . */
protected void addMethodInjectionPoint ( final MethodInjectionPoint mip ) { } }

implementation: if ( methods == null ) { methods = new MethodInjectionPoint [ 1 ] ; methods [ 0 ] = mip ; } else { methods = ArraysUtil . append ( methods , mip ) ; }


signature:
public class BeanDefinition { /** * Adds init methods . */
protected void addInitMethodPoints ( final InitMethodPoint [ ] methods ) { } }

implementation: if ( initMethods == null ) { initMethods = methods ; } else { initMethods = ArraysUtil . join ( initMethods , methods ) ; }


signature:
public class BeanDefinition { /** * Adds destroy methods . */
protected void addDestroyMethodPoints ( final DestroyMethodPoint [ ] methods ) { } }

implementation: if ( destroyMethods == null ) { destroyMethods = methods ; } else { destroyMethods = ArraysUtil . join ( destroyMethods , methods ) ; }


signature:
public class ProxettaUtil { /** * Returns target class if proxetta applied on given class .
 * If not , returns given class as result . */
public static Class resolveTargetClass ( final Class proxy ) { } }

implementation: final String name = proxy . getName ( ) ; if ( name . endsWith ( ProxettaNames . proxyClassNameSuffix ) ) { return proxy . getSuperclass ( ) ; } if ( name . endsWith ( ProxettaNames . wrapperClassNameSuffix ) ) { return getTargetWrapperType ( proxy ) ; } return proxy ;


signature:
public class ProxettaUtil { /** * Injects some target instance into { @ link jodd . proxetta . impl . WrapperProxetta wrapper } proxy
 * in given { @ link WrapperProxettaFactory # setTargetFieldName ( String ) target field name } . */
public static void injectTargetIntoWrapper ( final Object target , final Object wrapper , final String targetFieldName ) { } }

implementation: try { final Field field = wrapper . getClass ( ) . getField ( targetFieldName ) ; field . setAccessible ( true ) ; field . set ( wrapper , target ) ; } catch ( Exception ex ) { throw new ProxettaException ( ex ) ; }


signature:
public class ProxettaUtil { /** * Injects target instance into proxy using default target field name .
 * @ see # injectTargetIntoWrapper ( Object , Object , String ) */
public static void injectTargetIntoWrapper ( final Object target , final Object wrapper ) { } }

implementation: injectTargetIntoWrapper ( target , wrapper , ProxettaNames . wrapperTargetFieldName ) ;


signature:
public class ProxettaUtil { /** * Returns wrapper target type . */
public static Class getTargetWrapperType ( final Class wrapperClass ) { } }

implementation: try { final Field field = wrapperClass . getDeclaredField ( ProxettaNames . wrapperTargetFieldName ) ; return field . getType ( ) ; } catch ( NoSuchFieldException nsfex ) { throw new ProxettaException ( nsfex ) ; }


signature:
public class LFUCache { /** * Prunes expired and , if cache is still full , the LFU element ( s ) from the cache .
 * On LFU removal , access count is normalized to value which had removed object .
 * Returns the number of removed objects . */
@ Override protected int pruneCache ( ) { } }

implementation:
int count = 0 ; CacheObject < K , V > comin = null ; // remove expired items and find cached object with minimal access count
Iterator < CacheObject < K , V > > values = cacheMap . values ( ) . iterator ( ) ; while ( values . hasNext ( ) ) { CacheObject < K , V > co = values . next ( ) ; if ( co . isExpired ( ) ) { values . remove ( ) ; onRemove ( co . key , co . cachedObject ) ; count ++ ; continue ; } if ( comin == null ) { comin = co ; } else { if ( co . accessCount < comin . accessCount ) { comin = co ; } } } if ( ! isFull ( ) ) { return count ; } // decrease access count to all cached objects
if ( comin != null ) { long minAccessCount = comin . accessCount ; values = cacheMap . values ( ) . iterator ( ) ; while ( values . hasNext ( ) ) { CacheObject < K , V > co = values . next ( ) ; co . accessCount -= minAccessCount ; if ( co . accessCount <= 0 ) { values . remove ( ) ; onRemove ( co . key , co . cachedObject ) ; count ++ ; } } } return count ;


signature:
public class PropertyDescriptor { /** * Locates property field . Field is being searched also in all
 * superclasses of current class . */
protected FieldDescriptor findField ( final String fieldName ) { } }

implementation:
FieldDescriptor fieldDescriptor = classDescriptor . getFieldDescriptor ( fieldName , true ) ; if ( fieldDescriptor != null ) { return fieldDescriptor ; } // field descriptor not found in this class
// try to locate it in the superclasses
Class [ ] superclasses = classDescriptor . getAllSuperclasses ( ) ; for ( Class superclass : superclasses ) { ClassDescriptor classDescriptor = ClassIntrospector . get ( ) . lookup ( superclass ) ; fieldDescriptor = classDescriptor . getFieldDescriptor ( fieldName , true ) ; if ( fieldDescriptor != null ) { return fieldDescriptor ; } } // nothing found
return null ;


signature:
public class PropertyDescriptor { /** * Returns property type . Raw types are detected . */
public Class getType ( ) { } }

implementation:
if ( type == null ) { if ( fieldDescriptor != null ) { type = fieldDescriptor . getRawType ( ) ; } else if ( readMethodDescriptor != null ) { type = getGetter ( true ) . getGetterRawType ( ) ; // type = readMethodDescriptor . getGetterRawType ( ) ;
} else if ( writeMethodDescriptor != null ) { type = getSetter ( true ) . getSetterRawType ( ) ; // type = writeMethodDescriptor . getSetterRawType ( ) ;
} } return type ;


signature:
public class PropertyDescriptor { /** * Returns { @ link Getter } . May return < code > null < / code >
 * if no matched getter is found . */
public Getter getGetter ( final boolean declared ) { } }

implementation: if ( getters == null ) { getters = new Getter [ ] { createGetter ( false ) , createGetter ( true ) , } ; } return getters [ declared ? 1 : 0 ] ;


signature:
public class PropertyDescriptor { /** * Creates a { @ link Getter } . */
protected Getter createGetter ( final boolean declared ) { } }

implementation: if ( readMethodDescriptor != null ) { if ( readMethodDescriptor . matchDeclared ( declared ) ) { return Getter . of ( readMethodDescriptor ) ; } } if ( fieldDescriptor != null ) { if ( fieldDescriptor . matchDeclared ( declared ) ) { return Getter . of ( fieldDescriptor ) ; } } return null ;


signature:
public class PropertyDescriptor { /** * Returns { @ link Setter } . May return < code > null < / code >
 * if no matched setter is found . */
public Setter getSetter ( final boolean declared ) { } }

implementation: if ( setters == null ) { setters = new Setter [ ] { createSetter ( false ) , createSetter ( true ) , } ; } return setters [ declared ? 1 : 0 ] ;


signature:
public class PropertyDescriptor { /** * Creates a { @ link Setter } . */
protected Setter createSetter ( final boolean declared ) { } }

implementation: if ( writeMethodDescriptor != null ) { if ( writeMethodDescriptor . matchDeclared ( declared ) ) { return Setter . of ( writeMethodDescriptor ) ; } } if ( fieldDescriptor != null ) { if ( fieldDescriptor . matchDeclared ( declared ) ) { return Setter . of ( fieldDescriptor ) ; } } return null ;


signature:
public class PropertyDescriptor { /** * Resolves key type for given property descriptor . */
public Class resolveKeyType ( final boolean declared ) { } }

implementation: Class keyType = null ; Getter getter = getGetter ( declared ) ; if ( getter != null ) { keyType = getter . getGetterRawKeyComponentType ( ) ; } if ( keyType == null ) { FieldDescriptor fieldDescriptor = getFieldDescriptor ( ) ; if ( fieldDescriptor != null ) { keyType = fieldDescriptor . getRawKeyComponentType ( ) ; } } return keyType ;


signature:
public class PropertyDescriptor { /** * Resolves component type for given property descriptor . */
public Class resolveComponentType ( final boolean declared ) { } }

implementation: Class componentType = null ; Getter getter = getGetter ( declared ) ; if ( getter != null ) { componentType = getter . getGetterRawComponentType ( ) ; } if ( componentType == null ) { FieldDescriptor fieldDescriptor = getFieldDescriptor ( ) ; if ( fieldDescriptor != null ) { componentType = fieldDescriptor . getRawComponentType ( ) ; } } return componentType ;


signature:
public class HostInfo { /** * - - - - - util */
protected String nosep ( final String in ) { } }

implementation: if ( in . endsWith ( File . separator ) ) { return in . substring ( 0 , in . length ( ) - 1 ) ; } return in ;


signature:
public class JsonResult { /** * Creates JSON result from given object . The object will be serialized to JSON . */
public static JsonResult of ( final Object object ) { } }

implementation: final String json = JsonSerializer . create ( ) . deep ( true ) . serialize ( object ) ; return new JsonResult ( json ) ;


signature:
public class JsonResult { /** * Creates a JSON response from an exception . Response body will have information about the
 * exception and response status will be set to 500. */
public static JsonResult of ( final Exception exception ) { } }

implementation: final HashMap < String , Object > errorMap = new HashMap < > ( ) ; errorMap . put ( "message" , ExceptionUtil . message ( exception ) ) ; errorMap . put ( "error" , exception . getClass ( ) . getName ( ) ) ; errorMap . put ( "cause" , exception . getCause ( ) != null ? exception . getCause ( ) . getClass ( ) . getName ( ) : null ) ; final ArrayList < String > details = new ArrayList < > ( ) ; final StackTraceElement [ ] ste = ExceptionUtil . getStackTrace ( exception , null , null ) ; for ( StackTraceElement stackTraceElement : ste ) { details . add ( stackTraceElement . toString ( ) ) ; } errorMap . put ( "details" , details ) ; final String json = JsonSerializer . create ( ) . deep ( true ) . serialize ( errorMap ) ; return new JsonResult ( json ) . status ( HttpStatus . error500 ( ) . internalError ( ) ) ;


signature:
public class RestActionNamingStrategy { /** * Resolves HTTP method name from method name .
 * If method name or first camel - case word of a method equals to
 * a HTTP method , it will be used as that HTTP methods . */
protected String resolveHttpMethodFromMethodName ( final String methodName ) { } }

implementation: int i = 0 ; while ( i < methodName . length ( ) ) { if ( CharUtil . isUppercaseAlpha ( methodName . charAt ( i ) ) ) { break ; } i ++ ; } final String name = methodName . substring ( 0 , i ) . toUpperCase ( ) ; for ( final HttpMethod httpMethod : HttpMethod . values ( ) ) { if ( httpMethod . equalsName ( name ) ) { return httpMethod . name ( ) ; } } return null ;


signature:
public class Wildcard { /** * Checks if two strings are equals or if they { @ link # match ( CharSequence , CharSequence ) } .
 * Useful for cases when matching a lot of equal strings and speed is important . */
public static boolean equalsOrMatch ( final CharSequence string , final CharSequence pattern ) { } }

implementation: if ( string . equals ( pattern ) ) { return true ; } return match ( string , pattern , 0 , 0 ) ;


signature:
public class Wildcard { /** * Internal matching recursive function . */
private static boolean match ( final CharSequence string , final CharSequence pattern , int sNdx , int pNdx ) { } }

implementation:
int pLen = pattern . length ( ) ; if ( pLen == 1 ) { if ( pattern . charAt ( 0 ) == '*' ) { // speed - up
return true ; } } int sLen = string . length ( ) ; boolean nextIsNotWildcard = false ; while ( true ) { // check if end of string and / or pattern occurred
if ( ( sNdx >= sLen ) ) { // end of string still may have pending ' * ' in pattern
while ( ( pNdx < pLen ) && ( pattern . charAt ( pNdx ) == '*' ) ) { pNdx ++ ; } return pNdx >= pLen ; } if ( pNdx >= pLen ) { // end of pattern , but not end of the string
return false ; } char p = pattern . charAt ( pNdx ) ; // pattern char
// perform logic
if ( ! nextIsNotWildcard ) { if ( p == '\\' ) { pNdx ++ ; nextIsNotWildcard = true ; continue ; } if ( p == '?' ) { sNdx ++ ; pNdx ++ ; continue ; } if ( p == '*' ) { char pNext = 0 ; // next pattern char
if ( pNdx + 1 < pLen ) { pNext = pattern . charAt ( pNdx + 1 ) ; } if ( pNext == '*' ) { // double ' * ' have the same effect as one ' * '
pNdx ++ ; continue ; } int i ; pNdx ++ ; // find recursively if there is any substring from the end of the
// line that matches the rest of the pattern ! ! !
for ( i = string . length ( ) ; i >= sNdx ; i -- ) { if ( match ( string , pattern , i , pNdx ) ) { return true ; } } return false ; } } else { nextIsNotWildcard = false ; } // check if pattern char and string char are equals
if ( p != string . charAt ( sNdx ) ) { return false ; } // everything matches for now , continue
sNdx ++ ; pNdx ++ ; }


signature:
public class Wildcard { /** * Matches string to at least one pattern .
 * Returns index of matched pattern , or < code > - 1 < / code > otherwise .
 * @ see # match ( CharSequence , CharSequence ) */
public static int matchOne ( final String src , final String ... patterns ) { } }

implementation: for ( int i = 0 ; i < patterns . length ; i ++ ) { if ( match ( src , patterns [ i ] ) ) { return i ; } } return - 1 ;


signature:
public class Wildcard { /** * Matches path against pattern using * , ? and * * wildcards .
 * Both path and the pattern are tokenized on path separators ( both \ and / ) .
 * ' * * ' represents deep tree wildcard , as in Ant . */
public static boolean matchPath ( final String path , final String pattern ) { } }

implementation: String [ ] pathElements = StringUtil . splitc ( path , PATH_SEPARATORS ) ; String [ ] patternElements = StringUtil . splitc ( pattern , PATH_SEPARATORS ) ; return matchTokens ( pathElements , patternElements ) ;


signature:
public class ExtendedURLClassLoader { /** * Returns < code > true < / code > if class or resource name matches
 * at least one package rule from the list . */
protected boolean isMatchingRules ( final String name , final String ... rules ) { } }

implementation: for ( String rule : rules ) { if ( Wildcard . equalsOrMatch ( name , rule ) ) { return true ; } } return false ;


signature:
public class ExtendedURLClassLoader { /** * Resolves loading rules . */
protected Loading resolveLoading ( final boolean parentFirstStrategy , final String className ) { } }

implementation: boolean withParent = true ; boolean withLoader = true ; if ( parentFirstStrategy ) { if ( isMatchingRules ( className , loaderOnlyRules ) ) { withParent = false ; } else if ( isMatchingRules ( className , parentOnlyRules ) ) { withLoader = false ; } } else { if ( isMatchingRules ( className , parentOnlyRules ) ) { withLoader = false ; } else if ( isMatchingRules ( className , loaderOnlyRules ) ) { withParent = false ; } } return new Loading ( withParent , withLoader ) ;


signature:
public class ExtendedURLClassLoader { /** * Resolves resources . */
protected Loading resolveResourceLoading ( final boolean parentFirstStrategy , String resourceName ) { } }

implementation: if ( matchResourcesAsPackages ) { resourceName = StringUtil . replaceChar ( resourceName , '/' , '.' ) ; } return resolveLoading ( parentFirstStrategy , resourceName ) ;


signature:
public class ExtendedURLClassLoader { /** * Loads class using parent - first or parent - last strategy . */
@ Override protected synchronized Class < ? > loadClass ( final String className , final boolean resolve ) throws ClassNotFoundException { } }

implementation:
// check first if the class has already been loaded
Class < ? > c = findLoadedClass ( className ) ; if ( c != null ) { if ( resolve ) { resolveClass ( c ) ; } return c ; } // class not loaded yet
Loading loading = resolveLoading ( parentFirst , className ) ; if ( parentFirst ) { // PARENT FIRST
if ( loading . withParent ) { try { c = parentClassLoader . loadClass ( className ) ; } catch ( ClassNotFoundException ignore ) { } } if ( c == null ) { if ( loading . withLoader ) { c = this . findClass ( className ) ; } else { throw new ClassNotFoundException ( "Class not found: " + className ) ; } } } else { // THIS FIRST
if ( loading . withLoader ) { try { c = this . findClass ( className ) ; } catch ( ClassNotFoundException ignore ) { } } if ( c == null ) { if ( loading . withParent ) { c = parentClassLoader . loadClass ( className ) ; } else { throw new ClassNotFoundException ( "Class not found: " + className ) ; } } } if ( resolve ) { resolveClass ( c ) ; } return c ;


signature:
public class ExtendedURLClassLoader { /** * Returns a resource using parent - first or parent - last strategy . */
@ Override public URL getResource ( final String resourceName ) { } }

implementation:
URL url = null ; Loading loading = resolveResourceLoading ( parentFirst , resourceName ) ; if ( parentFirst ) { // PARENT FIRST
if ( loading . withParent ) { url = parentClassLoader . getResource ( resourceName ) ; } if ( url == null ) { if ( loading . withLoader ) { url = this . findResource ( resourceName ) ; } } } else { // THIS FIRST
if ( loading . withLoader ) { url = this . findResource ( resourceName ) ; } if ( url == null ) { if ( loading . withParent ) { url = parentClassLoader . getResource ( resourceName ) ; } } } return url ;


signature:
public class StreamGobbler { /** * Waits for gobbler to end . */
public void waitFor ( ) { } }

implementation: try { synchronized ( lock ) { if ( ! end ) { lock . wait ( ) ; } } } catch ( InterruptedException ignore ) { Thread . currentThread ( ) . interrupt ( ) ; }


signature:
public class ScopeDataInspector { /** * Scans annotation and returns type of Madvoc annotations . */
public Class < ? extends Annotation > detectAnnotationType ( final Annotation [ ] annotations ) { } }

implementation: for ( final Annotation annotation : annotations ) { if ( annotation instanceof In ) { return annotation . annotationType ( ) ; } else if ( annotation instanceof Out ) { return annotation . annotationType ( ) ; } } return null ;


signature:
public class ScopeDataInspector { /** * Inspects { @ link ScopeData } parameters for given method parameter information . */
public ScopeData inspectMethodParameterScopes ( final String name , final Class type , final Annotation [ ] annotations ) { } }

implementation: In in = null ; Out out = null ; for ( final Annotation annotation : annotations ) { if ( annotation instanceof In ) { in = ( In ) annotation ; } else if ( annotation instanceof Out ) { out = ( Out ) annotation ; } } final Class < ? extends MadvocScope > scope = resolveScopeClassFromAnnotations ( annotations ) ; int count = 0 ; InjectionPoint [ ] ins = null ; InjectionPoint [ ] outs = null ; if ( in != null ) { final InjectionPoint scopeDataIn = buildInjectionPoint ( in . value ( ) , name , type , scope ) ; if ( scopeDataIn != null ) { count ++ ; ins = new InjectionPoint [ ] { scopeDataIn } ; } } if ( out != null ) { final InjectionPoint scopeDataOut = buildInjectionPoint ( out . value ( ) , name , type , scope ) ; if ( scopeDataOut != null ) { count ++ ; outs = new InjectionPoint [ ] { scopeDataOut } ; } } if ( count == 0 ) { return NO_SCOPE_DATA ; } return new ScopeData ( this , ins , outs ) ;


signature:
public class ScopeDataInspector { /** * Builds injection point . */
protected InjectionPoint buildInjectionPoint ( final String annotationValue , final String propertyName , final Class propertyType , final Class < ? extends MadvocScope > scope ) { } }

implementation: final String value = annotationValue . trim ( ) ; final String name , targetName ; if ( StringUtil . isNotBlank ( value ) ) { name = value ; targetName = propertyName ; } else { name = propertyName ; targetName = null ; } return new InjectionPoint ( propertyType , name , targetName , scopeResolver . defaultOrScopeType ( scope ) ) ;


signature:
public class ScopeDataInspector { /** * Inspects { @ link ScopeData } for given class . The results are not cached , so it should
 * be used only dyring configuration - time .
 * For cached version , use { @ link # inspectClassScopesWithCache ( Class ) } . */
public ScopeData inspectClassScopes ( final Class actionClass ) { } }

implementation:
ClassDescriptor cd = ClassIntrospector . get ( ) . lookup ( actionClass ) ; PropertyDescriptor [ ] allProperties = cd . getAllPropertyDescriptors ( ) ; List < InjectionPoint > listIn = new ArrayList < > ( allProperties . length ) ; List < InjectionPoint > listOut = new ArrayList < > ( allProperties . length ) ; for ( PropertyDescriptor pd : allProperties ) { // collect annotations
Class < ? extends MadvocScope > scope = null ; In in = null ; Out out = null ; if ( pd . getFieldDescriptor ( ) != null ) { Field field = pd . getFieldDescriptor ( ) . getField ( ) ; in = field . getAnnotation ( In . class ) ; out = field . getAnnotation ( Out . class ) ; scope = resolveScopeClassFromAnnotations ( field . getAnnotations ( ) ) ; } if ( pd . getWriteMethodDescriptor ( ) != null ) { Method method = pd . getWriteMethodDescriptor ( ) . getMethod ( ) ; if ( in == null ) { in = method . getAnnotation ( In . class ) ; } if ( out == null ) { out = method . getAnnotation ( Out . class ) ; } if ( scope == null ) { scope = resolveScopeClassFromAnnotations ( method . getAnnotations ( ) ) ; } } if ( pd . getReadMethodDescriptor ( ) != null ) { Method method = pd . getReadMethodDescriptor ( ) . getMethod ( ) ; if ( in == null ) { in = method . getAnnotation ( In . class ) ; } if ( out == null ) { out = method . getAnnotation ( Out . class ) ; } if ( scope == null ) { scope = resolveScopeClassFromAnnotations ( method . getAnnotations ( ) ) ; } } // inspect all
final InjectionPoint ii = in == null ? null : buildInjectionPoint ( in . value ( ) , pd . getName ( ) , pd . getType ( ) , scope ) ; if ( ii != null ) { listIn . add ( ii ) ; } final InjectionPoint oi = out == null ? null : buildInjectionPoint ( out . value ( ) , pd . getName ( ) , pd . getType ( ) , scope ) ; if ( oi != null ) { listOut . add ( oi ) ; } } if ( ( listIn . isEmpty ( ) ) && ( listOut . isEmpty ( ) ) ) { return NO_SCOPE_DATA ; } InjectionPoint [ ] in = null ; InjectionPoint [ ] out = null ; if ( ! listIn . isEmpty ( ) ) { in = listIn . toArray ( new InjectionPoint [ 0 ] ) ; } if ( ! listOut . isEmpty ( ) ) { out = listOut . toArray ( new InjectionPoint [ 0 ] ) ; } return new ScopeData ( this , in , out ) ;


signature:
public class TypeJsonVisitor { /** * Visits a type . */
public void visit ( ) { } }

implementation:
ClassDescriptor classDescriptor = ClassIntrospector . get ( ) . lookup ( type ) ; if ( classMetadataName != null ) { // process first ' meta ' fields ' class '
onProperty ( classMetadataName , null , false ) ; } PropertyDescriptor [ ] propertyDescriptors = classDescriptor . getAllPropertyDescriptors ( ) ; for ( PropertyDescriptor propertyDescriptor : propertyDescriptors ) { Getter getter = propertyDescriptor . getGetter ( declared ) ; if ( getter != null ) { String propertyName = propertyDescriptor . getName ( ) ; boolean isTransient = false ; // check for transient flag
FieldDescriptor fieldDescriptor = propertyDescriptor . getFieldDescriptor ( ) ; if ( fieldDescriptor != null ) { isTransient = Modifier . isTransient ( fieldDescriptor . getField ( ) . getModifiers ( ) ) ; } onProperty ( propertyName , propertyDescriptor , isTransient ) ; } }


signature:
public class TypeJsonVisitor { /** * Invoked on each property . Properties are getting matched against the rules .
 * If property passes all the rules , it will be processed in
 * { @ link # onSerializableProperty ( String , jodd . introspector . PropertyDescriptor ) } . */
protected void onProperty ( String propertyName , final PropertyDescriptor propertyDescriptor , final boolean isTransient ) { } }

implementation:
Class propertyType = propertyDescriptor == null ? null : propertyDescriptor . getType ( ) ; Path currentPath = jsonContext . path ; currentPath . push ( propertyName ) ; // change name for properties
if ( propertyType != null ) { propertyName = typeData . resolveJsonName ( propertyName ) ; } // determine if name should be included / excluded
boolean include = ! typeData . strict ; // + don ' t include transient fields
if ( isTransient ) { include = false ; } // + all collections are not serialized by default
include = jsonContext . matchIgnoredPropertyTypes ( propertyType , true , include ) ; // + annotations
include = typeData . rules . apply ( propertyName , true , include ) ; // + path queries : excludes / includes
include = jsonContext . matchPathToQueries ( include ) ; // done
if ( ! include ) { currentPath . pop ( ) ; return ; } onSerializableProperty ( propertyName , propertyDescriptor ) ; currentPath . pop ( ) ;


signature:
public class ClassPathURLs { /** * Returns urls for the classloader
 * @ param classLoader classloader in which to find urls
 * @ return list of urls or { @ code null } if not found */
public static URL [ ] of ( ClassLoader classLoader , Class clazz ) { } }

implementation: if ( clazz == null ) { clazz = ClassPathURLs . class ; } if ( classLoader == null ) { classLoader = clazz . getClassLoader ( ) ; } final Set < URL > urls = new LinkedHashSet < > ( ) ; while ( classLoader != null ) { if ( classLoader instanceof URLClassLoader ) { final URLClassLoader urlClassLoader = ( URLClassLoader ) classLoader ; return urlClassLoader . getURLs ( ) ; } final URL url = classModuleUrl ( classLoader , clazz ) ; if ( url != null ) { urls . add ( url ) ; } classLoader = classLoader . getParent ( ) ; } return urls . toArray ( new URL [ 0 ] ) ;


signature:
public class BeanProperty { /** * Sets new bean instance . */
private void setBean ( final Object bean ) { } }

implementation: this . bean = bean ; this . cd = ( bean == null ? null : introspector . lookup ( bean . getClass ( ) ) ) ; this . first = false ; this . updateProperty = true ;


signature:
public class BeanProperty { /** * Updates the bean . Detects special case of suppliers . */
public void updateBean ( final Object bean ) { } }

implementation: this . setBean ( bean ) ; if ( this . cd != null && this . cd . isSupplier ( ) ) { final Object newBean = ( ( Supplier ) this . bean ) . get ( ) ; setBean ( newBean ) ; }


signature:
public class BeanProperty { /** * Loads property descriptor , if property was updated . */
private void loadPropertyDescriptor ( ) { } }

implementation: if ( updateProperty ) { if ( cd == null ) { propertyDescriptor = null ; } else { propertyDescriptor = cd . getPropertyDescriptor ( name , true ) ; } updateProperty = false ; }


signature:
public class BeanProperty { /** * Returns getter . */
public Getter getGetter ( final boolean declared ) { } }

implementation: loadPropertyDescriptor ( ) ; return propertyDescriptor != null ? propertyDescriptor . getGetter ( declared ) : null ;


signature:
public class BeanProperty { /** * Returns setter . */
public Setter getSetter ( final boolean declared ) { } }

implementation: loadPropertyDescriptor ( ) ; return propertyDescriptor != null ? propertyDescriptor . getSetter ( declared ) : null ;


signature:
public class DbOom { /** * Initializes the DbOom by connecting to the database . Database will be detected
 * and DbOom will be configured to match it . */
public DbOom connect ( ) { } }

implementation: connectionProvider . init ( ) ; final DbDetector dbDetector = new DbDetector ( ) ; dbDetector . detectDatabaseAndConfigureDbOom ( connectionProvider , dbOomConfig ) ; return this ;


signature:
public class CompositeIterator { /** * Adds an iterator to this composite . */
public void add ( final Iterator < T > iterator ) { } }

implementation: if ( allIterators . contains ( iterator ) ) { throw new IllegalArgumentException ( "Duplicate iterator" ) ; } allIterators . add ( iterator ) ;


signature:
public class CompositeIterator { /** * Returns < code > true < / code > if next element is available . */
@ Override public boolean hasNext ( ) { } }

implementation: if ( currentIterator == - 1 ) { currentIterator = 0 ; } for ( int i = currentIterator ; i < allIterators . size ( ) ; i ++ ) { Iterator iterator = allIterators . get ( i ) ; if ( iterator . hasNext ( ) ) { currentIterator = i ; return true ; } } return false ;


signature:
public class NullAwareSqlType { /** * Detects if there was a < code > null < / code > reading and returns < code > null < / code > if it was .
 * Result set returns default value ( e . g . 0 ) for many getters , therefore it detects if it was
 * a null reading or it is a real value . */
@ Override public < E > E readValue ( final ResultSet rs , final int index , final Class < E > destinationType , final int dbSqlType ) throws SQLException { } }

implementation: T t = get ( rs , index , dbSqlType ) ; if ( ( t == null ) || ( rs . wasNull ( ) ) ) { return null ; } return prepareGetValue ( t , destinationType ) ;


signature:
public class NullAwareSqlType { /** * Detects < code > null < / code > before storing the value into the database . */
@ Override public void storeValue ( final PreparedStatement st , final int index , final Object value , final int dbSqlType ) throws SQLException { } }

implementation: if ( value == null ) { st . setNull ( index , dbSqlType ) ; return ; } super . storeValue ( st , index , value , dbSqlType ) ;


signature:
public class JoddJoy { /** * Starts the Joy . Returns the { @ link JoddJoyRuntime runtime } , set of running
 * Joy components . */
public JoddJoyRuntime start ( final ServletContext servletContext ) { } }

implementation:
LoggerProvider loggerProvider = null ; if ( loggerProviderSupplier != null ) { loggerProvider = loggerProviderSupplier . get ( ) ; } if ( loggerProvider == null ) { loggerProvider = SimpleLogger . PROVIDER ; } LoggerFactory . setLoggerProvider ( loggerProvider ) ; log = LoggerFactory . getLogger ( JoddJoy . class ) ; printLogo ( ) ; log . info ( "Ah, Joy!" ) ; log . info ( "Logging using: " + loggerProvider . getClass ( ) . getSimpleName ( ) ) ; joyPropsConsumers . accept ( joyProps ) ; joyProxettaConsumers . accept ( joyProxetta ) ; joyDbConsumers . accept ( joyDb ) ; joyPetiteConsumers . accept ( joyPetite ) ; try { joyPaths . start ( ) ; joyProps . start ( ) ; joyProxetta . start ( ) ; joyScanner . start ( ) ; joyPetite . start ( ) ; joyPetite . getPetiteContainer ( ) . addBean ( appName + ".core" , this ) ; joyPetite . getPetiteContainer ( ) . addBean ( appName + ".scanner" , joyScanner ) ; joyDb . start ( ) ; joyMadvoc . setServletContext ( servletContext ) ; joyMadvoc . start ( ) ; runJoyInitBeans ( ) ; // cleanup things we will not use
joyScanner . stop ( ) ; } catch ( Exception ex ) { if ( log != null ) { log . error ( ex . toString ( ) , ex ) ; } else { System . out . println ( ex . toString ( ) ) ; ex . printStackTrace ( ) ; } stop ( ) ; throw ex ; } joyPetite . printBeans ( 100 ) ; joyDb . printEntities ( 100 ) ; joyMadvoc . printRoutes ( 100 ) ; System . out . println ( Chalk256 . chalk ( ) . yellow ( ) . on ( "Joy" ) + " is up. Enjoy!" ) ; log . info ( "Joy is up. Enjoy!" ) ; if ( joyDb . isDatabaseEnabled ( ) ) { return new JoddJoyRuntime ( appName , joyPaths . getAppDir ( ) , joyProps . getProps ( ) , joyProxetta . getProxetta ( ) , joyPetite . getPetiteContainer ( ) , joyMadvoc . getWebApp ( ) , joyDb . isDatabaseEnabled ( ) , joyDb . getConnectionProvider ( ) , joyDb . getJtxManager ( ) ) ; } else { return new JoddJoyRuntime ( appName , joyPaths . getAppDir ( ) , joyProps . getProps ( ) , joyProxetta . getProxetta ( ) , joyPetite . getPetiteContainer ( ) , joyMadvoc . getWebApp ( ) ) ; }


signature:
public class JoddJoy { /** * Prints a logo . */
private void printLogo ( ) { } }

implementation: System . out . println ( Chalk256 . chalk ( ) . yellow ( ) . on ( Jodd . JODD ) ) ;


signature:
public class JoddJoy { /** * Stops the Joy . */
public void stop ( ) { } }

implementation: joyProps . stop ( ) ; try { joyDb . stop ( ) ; joyPetite . stop ( ) ; } catch ( Exception ignore ) { } if ( log != null ) { log . info ( "Joy is down. Bye, bye!" ) ; }


signature:
public class SocketHttpConnectionProvider { /** * Creates new connection from current { @ link jodd . http . HttpRequest request } .
 * @ see # createSocket ( String , int , int ) */
@ Override public HttpConnection createHttpConnection ( final HttpRequest httpRequest ) throws IOException { } }

implementation:
final SocketHttpConnection httpConnection ; final boolean https = httpRequest . protocol ( ) . equalsIgnoreCase ( "https" ) ; if ( https ) { SSLSocket sslSocket = createSSLSocket ( httpRequest . host ( ) , httpRequest . port ( ) , httpRequest . connectionTimeout ( ) , httpRequest . trustAllCertificates ( ) , httpRequest . verifyHttpsHost ( ) ) ; httpConnection = new SocketHttpSecureConnection ( sslSocket ) ; } else { Socket socket = createSocket ( httpRequest . host ( ) , httpRequest . port ( ) , httpRequest . connectionTimeout ( ) ) ; httpConnection = new SocketHttpConnection ( socket ) ; } // prepare connection config
httpConnection . setTimeout ( httpRequest . timeout ( ) ) ; try { // additional socket initialization
httpConnection . init ( ) ; } catch ( Throwable throwable ) { // @ wjw _ add
httpConnection . close ( ) ; throw new HttpException ( throwable ) ; } return httpConnection ;


signature:
public class SocketHttpConnectionProvider { /** * Creates a socket using socket factory . */
protected Socket createSocket ( final String host , final int port , final int connectionTimeout ) throws IOException { } }

implementation:
final SocketFactory socketFactory = getSocketFactory ( proxy , false , false , connectionTimeout ) ; if ( connectionTimeout < 0 ) { return socketFactory . createSocket ( host , port ) ; } else { // creates unconnected socket
Socket socket = socketFactory . createSocket ( ) ; socket . connect ( new InetSocketAddress ( host , port ) , connectionTimeout ) ; return socket ; }


signature:
public class SocketHttpConnectionProvider { /** * Creates a SSL socket . Enables default secure enabled protocols if specified . */
protected SSLSocket createSSLSocket ( final String host , final int port , final int connectionTimeout , final boolean trustAll , final boolean verifyHttpsHost ) throws IOException { } }

implementation:
final SocketFactory socketFactory = getSocketFactory ( proxy , true , trustAll , connectionTimeout ) ; final Socket socket ; if ( connectionTimeout < 0 ) { socket = socketFactory . createSocket ( host , port ) ; } else { // creates unconnected socket
// unfortunately , this does not work always
// sslSocket = ( SSLSocket ) socketFactory . createSocket ( ) ;
// sslSocket . connect ( new InetSocketAddress ( host , port ) , connectionTimeout ) ;
// Note : SSLSocketFactory has several create ( ) methods .
// Those that take arguments all connect immediately
// and have no options for specifying a connection timeout .
// So , we have to create a socket and connect it ( with a
// connection timeout ) , then have the SSLSocketFactory wrap
// the already - connected socket .
socket = Sockets . connect ( host , port , connectionTimeout ) ; // sock . setSoTimeout ( readTimeout ) ;
// socket . connect ( new InetSocketAddress ( host , port ) , connectionTimeout ) ;
// continue to wrap this plain socket with ssl socket . . .
} // wrap plain socket in an SSL socket
SSLSocket sslSocket ; if ( socket instanceof SSLSocket ) { sslSocket = ( SSLSocket ) socket ; } else { if ( socketFactory instanceof SSLSocketFactory ) { sslSocket = ( SSLSocket ) ( ( SSLSocketFactory ) socketFactory ) . createSocket ( socket , host , port , true ) ; } else { sslSocket = ( SSLSocket ) ( getDefaultSSLSocketFactory ( trustAll ) ) . createSocket ( socket , host , port , true ) ; } } // sslSocket is now ready
if ( secureEnabledProtocols != null ) { final String [ ] values = StringUtil . splitc ( secureEnabledProtocols , ',' ) ; StringUtil . trimAll ( values ) ; sslSocket . setEnabledProtocols ( values ) ; } // set SSL parameters to allow host name verifier
if ( verifyHttpsHost ) { final SSLParameters sslParams = new SSLParameters ( ) ; sslParams . setEndpointIdentificationAlgorithm ( "HTTPS" ) ; sslSocket . setSSLParameters ( sslParams ) ; } return sslSocket ;


signature:
public class SocketHttpConnectionProvider { /** * Returns default SSL socket factory allowing setting trust managers . */
protected SSLSocketFactory getDefaultSSLSocketFactory ( final boolean trustAllCertificates ) throws IOException { } }

implementation: if ( trustAllCertificates ) { try { SSLContext sc = SSLContext . getInstance ( sslProtocol ) ; sc . init ( null , TrustManagers . TRUST_ALL_CERTS , new java . security . SecureRandom ( ) ) ; return sc . getSocketFactory ( ) ; } catch ( NoSuchAlgorithmException | KeyManagementException e ) { throw new IOException ( e ) ; } } else { return ( SSLSocketFactory ) SSLSocketFactory . getDefault ( ) ; }


signature:
public class SocketHttpConnectionProvider { /** * Returns socket factory based on proxy type and SSL requirements . */
protected SocketFactory getSocketFactory ( final ProxyInfo proxy , final boolean ssl , final boolean trustAllCertificates , final int connectionTimeout ) throws IOException { } }

implementation: switch ( proxy . getProxyType ( ) ) { case NONE : if ( ssl ) { return getDefaultSSLSocketFactory ( trustAllCertificates ) ; } else { return SocketFactory . getDefault ( ) ; } case HTTP : return new HTTPProxySocketFactory ( proxy , connectionTimeout ) ; case SOCKS4 : return new Socks4ProxySocketFactory ( proxy , connectionTimeout ) ; case SOCKS5 : return new Socks5ProxySocketFactory ( proxy , connectionTimeout ) ; default : return null ; }


signature:
public class RandomString { /** * Creates random string whose length is the number of characters specified .
 * Characters are chosen from the set of characters specified . */
public String random ( int count , final char [ ] chars ) { } }

implementation: if ( count == 0 ) { return StringPool . EMPTY ; } final char [ ] result = new char [ count ] ; while ( count -- > 0 ) { result [ count ] = chars [ rnd . nextInt ( chars . length ) ] ; } return new String ( result ) ;


signature:
public class RandomString { /** * Creates random string whose length is the number of characters specified .
 * Characters are chosen from the provided range . */
public String random ( int count , final char start , final char end ) { } }

implementation: if ( count == 0 ) { return StringPool . EMPTY ; } final char [ ] result = new char [ count ] ; final int len = end - start + 1 ; while ( count -- > 0 ) { result [ count ] = ( char ) ( rnd . nextInt ( len ) + start ) ; } return new String ( result ) ;


signature:
public class RandomString { /** * Creates random string whose length is the number of characters specified .
 * Characters are chosen from the multiple sets defined by range pairs .
 * All ranges must be in acceding order . */
public String randomRanges ( int count , final char ... ranges ) { } }

implementation: if ( count == 0 ) { return StringPool . EMPTY ; } int i = 0 ; int len = 0 ; final int [ ] lens = new int [ ranges . length ] ; while ( i < ranges . length ) { int gap = ranges [ i + 1 ] - ranges [ i ] + 1 ; len += gap ; lens [ i ] = len ; i += 2 ; } final char [ ] result = new char [ count ] ; while ( count -- > 0 ) { char c = 0 ; int r = rnd . nextInt ( len ) ; for ( i = 0 ; i < ranges . length ; i += 2 ) { if ( r < lens [ i ] ) { r += ranges [ i ] ; if ( i != 0 ) { r -= lens [ i - 2 ] ; } c = ( char ) r ; break ; } } result [ count ] = c ; } return new String ( result ) ;


signature:
public class EMLParser { /** * Parses EML with provided EML content .
 * @ param emlContent { @ link String } with EML content .
 * @ param charset String with charset .
 * @ return { @ link ReceivedEmail } .
 * @ throws UnsupportedEncodingException if the named charset is not supported .
 * @ throws MessagingException if { @ link MimeMessage } cannot be created .
 * @ see # parse ( byte [ ] ) */
public ReceivedEmail parse ( final String emlContent , final String charset ) throws UnsupportedEncodingException , MessagingException { } }

implementation: final byte [ ] bytes = emlContent . getBytes ( charset ) ; return parse ( bytes ) ;


signature:
public class EMLParser { /** * Parses EML with provided EML content .
 * @ param emlContent { @ link String } with EML content .
 * @ return { @ link ReceivedEmail } .
 * @ throws MessagingException if { @ link MimeMessage } cannot be created .
 * @ see # parse ( String , String ) */
public ReceivedEmail parse ( final String emlContent ) throws MessagingException { } }

implementation: try { return parse ( emlContent , JoddCore . encoding ) ; } catch ( final UnsupportedEncodingException ignore ) { return null ; }


signature:
public class EMLParser { /** * Starts EML parsing with provided EML { @ link File } .
 * @ param emlFile { @ link File } with EML content .
 * @ return { @ link ReceivedEmail } .
 * @ throws FileNotFoundException if emlFile cannot be found
 * @ throws MessagingException if { @ link MimeMessage } cannot be created .
 * @ see # parse ( InputStream ) */
public ReceivedEmail parse ( final File emlFile ) throws FileNotFoundException , MessagingException { } }

implementation: final FileInputStream fileInputStream = new FileInputStream ( emlFile ) ; try { return parse ( fileInputStream ) ; } finally { StreamUtil . close ( fileInputStream ) ; }


signature:
public class EMLParser { /** * Parses the EML content . If { @ link Session } is not created , default one will be used .
 * @ param emlContentInputStream { @ link InputStream } containing the EML content .
 * @ return { @ link ReceivedEmail } .
 * @ throws MessagingException if { @ link MimeMessage } cannot be created . */
protected ReceivedEmail parse ( final InputStream emlContentInputStream ) throws MessagingException { } }

implementation: if ( getSession ( ) == null ) { createSession ( getProperties ( ) ) ; } try { final MimeMessage message = new MimeMessage ( getSession ( ) , emlContentInputStream ) ; return new ReceivedEmail ( message , false , null ) ; } finally { StreamUtil . close ( emlContentInputStream ) ; }


signature:
public class JsonParserBase { /** * Creates new type for JSON array objects .
 * It returns a collection .
 * Later , the collection will be converted into the target type . */
@ SuppressWarnings ( "unchecked" ) protected Collection < Object > newArrayInstance ( final Class targetType ) { } }

implementation: if ( targetType == null || targetType == List . class || targetType == Collection . class || targetType . isArray ( ) ) { return listSupplier . get ( ) ; } if ( targetType == Set . class ) { return new HashSet < > ( ) ; } try { return ( Collection < Object > ) targetType . getDeclaredConstructor ( ) . newInstance ( ) ; } catch ( Exception e ) { throw new JsonException ( e ) ; }


signature:
public class JsonParserBase { /** * Creates new object or a < code > HashMap < / code > if type is not specified . */
protected Object newObjectInstance ( final Class targetType ) { } }

implementation:
if ( targetType == null || targetType == Map . class ) { return mapSupplier . get ( ) ; } final ClassDescriptor cd = ClassIntrospector . get ( ) . lookup ( targetType ) ; final CtorDescriptor ctorDescriptor = cd . getDefaultCtorDescriptor ( true ) ; if ( ctorDescriptor == null ) { throw new JsonException ( "Default ctor not found for: " + targetType . getName ( ) ) ; } try { // return ClassUtil . newInstance ( targetType ) ;
return ctorDescriptor . getConstructor ( ) . newInstance ( ) ; } catch ( Exception e ) { throw new JsonException ( e ) ; }


signature:
public class JsonParserBase { /** * Injects value into the targets property . */
protected void injectValueIntoObject ( final Object target , final PropertyDescriptor pd , final Object value ) { } }

implementation: Object convertedValue = value ; if ( value != null ) { Class targetClass = pd . getType ( ) ; convertedValue = convertType ( value , targetClass ) ; } try { Setter setter = pd . getSetter ( true ) ; if ( setter != null ) { setter . invokeSetter ( target , convertedValue ) ; } } catch ( Exception ex ) { throw new JsonException ( ex ) ; }


signature:
public class JsonParserBase { /** * Converts type of the given value . */
protected Object convertType ( final Object value , final Class targetType ) { } }

implementation: final Class valueClass = value . getClass ( ) ; if ( valueClass == targetType ) { return value ; } try { return TypeConverterManager . get ( ) . convertType ( value , targetType ) ; } catch ( Exception ex ) { if ( ! strictTypes ) { return null ; } throw new JsonException ( "Type conversion failed" , ex ) ; }


signature:
public class ModuleVisitor { /** * Visit an implementation of a service .
 * @ param service the internal name of the service .
 * @ param providers the internal names of the implementations of the service ( there is at least
 * one provider ) . */
public void visitProvide ( final String service , final String ... providers ) { } }

implementation: if ( mv != null ) { mv . visitProvide ( service , providers ) ; }


signature:
public class ShortSqlType { /** * { @ inheritDoc } */
@ Override public Short get ( final ResultSet rs , final int index , final int dbSqlType ) throws SQLException { } }

implementation: return Short . valueOf ( rs . getShort ( index ) ) ;


signature:
public class ShortSqlType { /** * { @ inheritDoc } */
@ Override public void set ( final PreparedStatement st , final int index , final Short value , final int dbSqlType ) throws SQLException { } }

implementation: st . setShort ( index , value . shortValue ( ) ) ;


signature:
public class InvokeClassBuilder { /** * - - - - - header */
@ Override public void visit ( final int version , final int access , final String name , final String signature , final String superName , final String [ ] interfaces ) { } }

implementation:
wd . init ( name , superName , suffix , reqProxyClassName ) ; // write destination class
final int v = ProxettaAsmUtil . resolveJavaVersion ( version ) ; super . visit ( v , access , wd . thisReference , signature , wd . superName , interfaces ) ;


signature:
public class TypeCache { /** * Creates default implementation of the type cache . */
@ SuppressWarnings ( "unchecked" ) public static < A > TypeCache < A > createDefault ( ) { } }

implementation: return ( TypeCache < A > ) Defaults . implementation . get ( ) ;


signature:
public class TypeCache { /** * Add values to the map . */
public T put ( final Class < ? > type , final T value ) { } }

implementation: return map . put ( type , value ) ;


signature:
public class TypeCache { /** * Returns existing value or add default supplied one .
 * Use this method instead of { @ code get - nullcheck - put } block when
 * thread - safety is of importance . */
public T get ( final Class < ? > key , final Supplier < T > valueSupplier ) { } }

implementation: return map . computeIfAbsent ( key , aClass -> valueSupplier . get ( ) ) ;


signature:
public class LongSqlType { /** * { @ inheritDoc } */
@ Override public Long get ( final ResultSet rs , final int index , final int dbSqlType ) throws SQLException { } }

implementation: return Long . valueOf ( rs . getLong ( index ) ) ;


signature:
public class LongSqlType { /** * { @ inheritDoc } */
@ Override public void set ( final PreparedStatement st , final int index , final Long value , final int dbSqlType ) throws SQLException { } }

implementation: st . setLong ( index , value . longValue ( ) ) ;


signature:
public class Methods { /** * Inspects types methods and return map of { @ link MethodDescriptor method descriptors } . */
protected HashMap < String , MethodDescriptor [ ] > inspectMethods ( ) { } }

implementation: boolean scanAccessible = classDescriptor . isScanAccessible ( ) ; if ( classDescriptor . isSystemClass ( ) ) { scanAccessible = false ; } final Class type = classDescriptor . getType ( ) ; final Method [ ] methods = scanAccessible ? ClassUtil . getAccessibleMethods ( type ) : ClassUtil . getSupportedMethods ( type ) ; final HashMap < String , MethodDescriptor [ ] > map = new HashMap < > ( methods . length ) ; for ( final Method method : methods ) { final String methodName = method . getName ( ) ; MethodDescriptor [ ] mds = map . get ( methodName ) ; if ( mds == null ) { mds = new MethodDescriptor [ 1 ] ; } else { mds = ArraysUtil . resize ( mds , mds . length + 1 ) ; } map . put ( methodName , mds ) ; mds [ mds . length - 1 ] = createMethodDescriptor ( method ) ; } return map ;


signature:
public class Methods { /** * Returns a method that matches given name and parameter types .
 * Returns < code > null < / code > if method is not found . */
public MethodDescriptor getMethodDescriptor ( final String name , final Class [ ] paramTypes ) { } }

implementation: final MethodDescriptor [ ] methodDescriptors = methodsMap . get ( name ) ; if ( methodDescriptors == null ) { return null ; } for ( MethodDescriptor methodDescriptor : methodDescriptors ) { final Method m = methodDescriptor . getMethod ( ) ; if ( ClassUtil . compareParameters ( m . getParameterTypes ( ) , paramTypes ) ) { return methodDescriptor ; } } return null ;


signature:
public class Methods { /** * Returns method descriptor for given name . If more then one methods with
 * the same name exists , one method will be returned ( not determined which one ) .
 * Returns < code > null < / code > if no method exist in this collection by given name .
 * @ see # getMethodDescriptor ( String , Class [ ] ) */
public MethodDescriptor getMethodDescriptor ( final String name ) { } }

implementation: final MethodDescriptor [ ] methodDescriptors = methodsMap . get ( name ) ; if ( methodDescriptors == null ) { return null ; } if ( methodDescriptors . length != 1 ) { throw new IllegalArgumentException ( "Method name not unique: " + name ) ; } return methodDescriptors [ 0 ] ;