idx int64 0 165k | question stringlengths 73 4.15k | target stringlengths 5 918 | len_question int64 21 890 | len_target int64 3 255 |
|---|---|---|---|---|
139,700 | @ Override public synchronized Logger getLogger ( String name ) { SoftReference < EnvironmentLogger > envLoggerRef = _envLoggers . get ( name ) ; EnvironmentLogger envLogger = null ; if ( envLoggerRef != null ) envLogger = envLoggerRef . get ( ) ; if ( envLogger == null ) envLogger = addLogger ( name , null ) ; Logger customLogger = envLogger . getLogger ( ) ; if ( customLogger != null ) return customLogger ; else return envLogger ; } | Returns the named logger . | 125 | 5 |
139,701 | public static JavacConfig getLocalConfig ( ) { JavacConfig config ; config = _localJavac . get ( ) ; if ( config != null ) return config ; else return new JavacConfig ( ) ; } | Returns the environment configuration . | 47 | 5 |
139,702 | public ArrayList < InetAddress > getLocalAddresses ( ) { synchronized ( _addressCache ) { ArrayList < InetAddress > localAddresses = _addressCache . get ( "addresses" ) ; if ( localAddresses == null ) { localAddresses = new ArrayList < InetAddress > ( ) ; try { for ( NetworkInterfaceBase iface : getNetworkInterfaces ( ) ) { for ( InetAddress addr : iface . getInetAddresses ( ) ) { localAddresses . add ( addr ) ; } } Collections . sort ( localAddresses , new LocalIpCompare ( ) ) ; _addressCache . put ( "addresses" , localAddresses ) ; } catch ( Exception e ) { log . log ( Level . WARNING , e . toString ( ) , e ) ; } finally { _addressCache . put ( "addresses" , localAddresses ) ; } } return new ArrayList <> ( localAddresses ) ; } } | Returns the InetAddresses for the local machine . | 210 | 11 |
139,703 | public byte [ ] getHardwareAddress ( ) { if ( CurrentTime . isTest ( ) || System . getProperty ( "test.mac" ) != null ) { return new byte [ ] { 10 , 0 , 0 , 0 , 0 , 10 } ; } for ( NetworkInterfaceBase nic : getNetworkInterfaces ( ) ) { if ( ! nic . isLoopback ( ) ) { return nic . getHardwareAddress ( ) ; } } try { InetAddress localHost = InetAddress . getLocalHost ( ) ; return localHost . getAddress ( ) ; } catch ( Exception e ) { log . log ( Level . FINER , e . toString ( ) , e ) ; } return new byte [ 0 ] ; } | Returns a unique identifying byte array for the server generally the mac address . | 155 | 14 |
139,704 | public void waitForExit ( ) throws IOException { Thread thread = Thread . currentThread ( ) ; ClassLoader oldLoader = thread . getContextClassLoader ( ) ; try { thread . setContextClassLoader ( _systemManager . getClassLoader ( ) ) ; _waitForExitService = new WaitForExitService3 ( this , _systemManager ) ; _waitForExitService . waitForExit ( ) ; } finally { thread . setContextClassLoader ( oldLoader ) ; } } | Thread to wait until Baratine should be stopped . | 103 | 11 |
139,705 | public boolean compareAndPut ( V testValue , K key , V value ) { V result = compareAndPut ( testValue , key , value , true ) ; return testValue == result ; } | Puts a new item in the cache if the current value matches oldValue . | 41 | 16 |
139,706 | private void updateLru ( CacheItem < K , V > item ) { long lruCounter = _lruCounter ; long itemCounter = item . _lruCounter ; long delta = ( lruCounter - itemCounter ) & 0x3fffffff ; if ( _lruTimeout < delta || delta < 0 ) { // update LRU only if not used recently updateLruImpl ( item ) ; } } | Put item at the head of the used - twice lru list . This is always called while synchronized . | 88 | 21 |
139,707 | public boolean removeTail ( ) { CacheItem < K , V > tail = null ; if ( _capacity1 <= _size1 ) tail = _tail1 ; if ( tail == null ) { tail = _tail2 ; if ( tail == null ) { tail = _tail1 ; if ( tail == null ) return false ; } } V oldValue = tail . _value ; if ( oldValue instanceof LruListener ) { ( ( LruListener ) oldValue ) . lruEvent ( ) ; } V value = remove ( tail . _key ) ; return true ; } | Remove the last item in the LRU | 124 | 8 |
139,708 | public Iterator < K > keys ( ) { KeyIterator < K , V > iter = new KeyIterator < K , V > ( this ) ; iter . init ( this ) ; return iter ; } | Returns the keys stored in the cache | 42 | 7 |
139,709 | public Iterator < K > keys ( Iterator < K > oldIter ) { KeyIterator < K , V > iter = ( KeyIterator < K , V > ) oldIter ; iter . init ( this ) ; return oldIter ; } | Returns keys stored in the cache using an old iterator | 50 | 10 |
139,710 | public Iterator < V > values ( ) { ValueIterator < K , V > iter = new ValueIterator < K , V > ( this ) ; iter . init ( this ) ; return iter ; } | Returns the values in the cache | 42 | 6 |
139,711 | @ Override public void ssl ( SSLFactory sslFactory ) { try { Objects . requireNonNull ( sslFactory ) ; SocketChannel channel = _channel ; Objects . requireNonNull ( channel ) ; _sslSocket = sslFactory . ssl ( channel ) ; _sslSocket . startHandshake ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; throw new RuntimeException ( e ) ; } } | Initialize the ssl | 95 | 5 |
139,712 | @ Override public int portRemote ( ) { if ( _channel != null ) { try { SocketAddress addr = _channel . getRemoteAddress ( ) ; return 0 ; } catch ( Exception e ) { e . printStackTrace ( ) ; return 0 ; } } else return 0 ; } | Returns the remote client s port . | 62 | 7 |
139,713 | public Map < IGuaranteeTerm , GuaranteeTermEvaluationResult > evaluate ( IAgreement agreement , Map < IGuaranteeTerm , List < IMonitoringMetric > > metricsMap ) { checkInitialized ( false ) ; Map < IGuaranteeTerm , GuaranteeTermEvaluationResult > result = new HashMap < IGuaranteeTerm , GuaranteeTermEvaluationResult > ( ) ; Date now = new Date ( ) ; for ( IGuaranteeTerm term : metricsMap . keySet ( ) ) { List < IMonitoringMetric > metrics = metricsMap . get ( term ) ; if ( metrics . size ( ) > 0 ) { GuaranteeTermEvaluationResult aux = termEval . evaluate ( agreement , term , metrics , now ) ; result . put ( term , aux ) ; } } return result ; } | Evaluate if the metrics fulfill the agreement s service levels . | 186 | 13 |
139,714 | public Map < IGuaranteeTerm , GuaranteeTermEvaluationResult > evaluateBusiness ( IAgreement agreement , Map < IGuaranteeTerm , List < IViolation > > violationsMap ) { checkInitialized ( false ) ; Map < IGuaranteeTerm , GuaranteeTermEvaluationResult > result = new HashMap < IGuaranteeTerm , GuaranteeTermEvaluationResult > ( ) ; Date now = new Date ( ) ; for ( IGuaranteeTerm term : violationsMap . keySet ( ) ) { List < IViolation > violations = violationsMap . get ( term ) ; if ( violations . size ( ) > 0 ) { GuaranteeTermEvaluationResult aux = termEval . evaluateBusiness ( agreement , term , violations , now ) ; result . put ( term , aux ) ; } } return result ; } | Evaluate if the detected violations imply any compensation . | 182 | 11 |
139,715 | @ Override public Auction createAuction ( String userId , long durationMs , long startPrice , String title , String description ) { ResourceManager manager = getResourceManager ( ) ; ServiceRef ref = manager . create ( userId , durationMs , startPrice , title , description ) ; Auction auction = ref . as ( Auction . class ) ; Auction copy = new Auction ( auction ) ; return copy ; } | private ResourceManager _manager ; | 85 | 6 |
139,716 | public void read ( ) { StateInPipe stateOld ; StateInPipe stateNew ; do { stateOld = _stateInRef . get ( ) ; stateNew = stateOld . toActive ( ) ; } while ( ! _stateInRef . compareAndSet ( stateOld , stateNew ) ) ; while ( stateNew . isActive ( ) ) { readPipe ( ) ; wakeOut ( ) ; do { stateOld = _stateInRef . get ( ) ; stateNew = stateOld . toIdle ( ) ; } while ( ! _stateInRef . compareAndSet ( stateOld , stateNew ) ) ; } if ( _stateInRef . get ( ) . isClosed ( ) ) { StateOutPipe outStateOld = _stateOutRef . getAndSet ( StateOutPipe . CLOSE ) ; if ( ! outStateOld . isClosed ( ) ) { _outFlow . cancel ( ) ; } } } | Reads data from the pipe . | 205 | 7 |
139,717 | private void wakeIn ( ) { StateInPipe stateOld ; StateInPipe stateNew ; do { stateOld = _stateInRef . get ( ) ; if ( stateOld . isActive ( ) ) { return ; } stateNew = stateOld . toWake ( ) ; } while ( ! _stateInRef . compareAndSet ( stateOld , stateNew ) ) ; if ( stateOld == StateInPipe . IDLE ) { try ( OutboxAmp outbox = OutboxAmp . currentOrCreate ( _services ) ) { Objects . requireNonNull ( outbox ) ; PipeWakeInMessage < T > msg = new PipeWakeInMessage <> ( outbox , _inRef , this ) ; outbox . offer ( msg ) ; } } } | Notify the reader of available data in the pipe . If the writer is asleep wake it . | 169 | 19 |
139,718 | void wakeOut ( ) { OnAvailable outFlow = _outFlow ; if ( outFlow == null ) { return ; } if ( _creditsIn <= _queue . head ( ) ) { return ; } StateOutPipe stateOld ; StateOutPipe stateNew ; do { stateOld = _stateOutRef . get ( ) ; if ( ! stateOld . isFull ( ) ) { return ; } stateNew = stateOld . toWake ( ) ; } while ( ! _stateOutRef . compareAndSet ( stateOld , stateNew ) ) ; try ( OutboxAmp outbox = OutboxAmp . currentOrCreate ( _outRef . services ( ) ) ) { Objects . requireNonNull ( outbox ) ; PipeWakeOutMessage < T > msg = new PipeWakeOutMessage <> ( outbox , _outRef , this , outFlow ) ; outbox . offer ( msg ) ; } } | Notify the reader of available space in the pipe . If the writer is asleep wake it . | 200 | 19 |
139,719 | public void flush ( ) { int level = getLevel ( ) . intValue ( ) ; for ( int i = 0 ; i < _handlers . length ; i ++ ) { Handler handler = _handlers [ i ] ; if ( level <= handler . getLevel ( ) . intValue ( ) ) handler . flush ( ) ; } } | Flush the handler . | 72 | 5 |
139,720 | public void checkpointStart ( ) { if ( _isWhileCheckpoint ) { throw new IllegalStateException ( ) ; } _isWhileCheckpoint = true ; long sequence = ++ _sequence ; setSequence ( sequence ) ; byte [ ] headerBuffer = _headerBuffer ; BitsUtil . writeInt16 ( headerBuffer , 0 , CHECKPOINT_START ) ; writeImpl ( headerBuffer , 0 , 2 ) ; _lastCheckpointStart = _index - _startAddress ; } | Starts checkpoint processing . A checkpoint start changes the epoch ID for new journal entries but does not yet close the previous epoch . | 104 | 25 |
139,721 | public void checkpointEnd ( ) { if ( ! _isWhileCheckpoint ) { throw new IllegalStateException ( ) ; } _isWhileCheckpoint = false ; byte [ ] headerBuffer = _headerBuffer ; BitsUtil . writeInt16 ( headerBuffer , 0 , CHECKPOINT_END ) ; writeImpl ( headerBuffer , 0 , 2 ) ; flush ( ) ; _lastCheckpointEnd = _index - _startAddress ; writeTail ( _os ) ; } | Closes the previous epoch . Journal entries in a closed epoch will not be replayed on a journal restore . | 102 | 22 |
139,722 | public void replay ( ReplayCallback replayCallback ) { TempBuffer tReadBuffer = TempBuffer . createLarge ( ) ; byte [ ] readBuffer = tReadBuffer . buffer ( ) ; int bufferLength = readBuffer . length ; try ( InStore jIn = _blockStore . openRead ( _startAddress , getSegmentSize ( ) ) ) { Replay replay = readReplay ( jIn ) ; if ( replay == null ) { return ; } long address = replay . getCheckpointStart ( ) ; long next ; setSequence ( replay . getSequence ( ) ) ; TempBuffer tBuffer = TempBuffer . create ( ) ; byte [ ] tempBuffer = tBuffer . buffer ( ) ; jIn . read ( getBlockAddress ( address ) , readBuffer , 0 , bufferLength ) ; ReadStream is = new ReadStream ( ) ; while ( address < _tailAddress && ( next = scanItem ( jIn , address , readBuffer , tempBuffer ) ) > 0 ) { boolean isOverflow = getBlockAddress ( address ) != getBlockAddress ( next ) ; // if scanning has passed the buffer boundary, need to re-read // the initial buffer if ( isOverflow ) { jIn . read ( getBlockAddress ( address ) , readBuffer , 0 , bufferLength ) ; } ReplayInputStream rIn = new ReplayInputStream ( jIn , readBuffer , address ) ; is . init ( rIn ) ; try { replayCallback . onItem ( is ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; log . log ( Level . FINER , e . toString ( ) , e ) ; } address = next ; if ( isOverflow ) { jIn . read ( getBlockAddress ( address ) , readBuffer , 0 , bufferLength ) ; } _index = address ; _flushIndex = address ; } } } | Replays all open journal entries . The journal entry will call into the callback listener with an open InputStream to read the entry . | 397 | 26 |
139,723 | private long scanItem ( InStore is , long address , byte [ ] readBuffer , byte [ ] tempBuffer ) { startRead ( ) ; byte [ ] headerBuffer = _headerBuffer ; while ( address + 2 < _tailAddress ) { readImpl ( is , address , readBuffer , headerBuffer , 0 , 2 ) ; address += 2 ; int len = BitsUtil . readInt16 ( headerBuffer , 0 ) ; if ( ( len & 0x8000 ) != 0 ) { if ( len == CHECKPOINT_START ) { setSequence ( _sequence + 1 ) ; } startRead ( ) ; continue ; } if ( len == 0 ) { readImpl ( is , address , readBuffer , headerBuffer , 0 , 4 ) ; address += 4 ; int crc = BitsUtil . readInt ( headerBuffer , 0 ) ; int digest = ( int ) _crc . getValue ( ) ; if ( crc == digest ) { return address ; } else { return - 1 ; } } if ( _tailAddress < address + len ) { return - 1 ; } int readLen = len ; while ( readLen > 0 ) { int sublen = Math . min ( readLen , tempBuffer . length ) ; readImpl ( is , address , readBuffer , tempBuffer , 0 , sublen ) ; _crc . update ( tempBuffer , 0 , sublen ) ; address += sublen ; readLen -= sublen ; } } return - 1 ; } | Validates that the item is complete and correct . | 315 | 10 |
139,724 | public static void main ( String [ ] argv ) { EnvLoader . init ( ) ; ArgsServerBase args = new ArgsServerBaratine ( argv ) ; args . doMain ( ) ; } | The main start of the web server . | 46 | 8 |
139,725 | public int getLine ( ) { if ( _line >= 0 ) return _line ; Attribute attr = getAttribute ( "LineNumberTable" ) ; if ( attr == null ) { _line = 0 ; return _line ; } _line = 0 ; return _line ; } | Returns the line number . | 61 | 5 |
139,726 | public JClass getReturnType ( ) { String descriptor = getDescriptor ( ) ; int i = descriptor . lastIndexOf ( ' ' ) ; return getClassLoader ( ) . descriptorToClass ( descriptor , i + 1 ) ; } | Returns the return types . | 51 | 5 |
139,727 | public Attribute removeAttribute ( String name ) { for ( int i = _attributes . size ( ) - 1 ; i >= 0 ; i -- ) { Attribute attr = _attributes . get ( i ) ; if ( attr . getName ( ) . equals ( name ) ) { _attributes . remove ( i ) ; return attr ; } } return null ; } | Removes an attribute . | 82 | 5 |
139,728 | public CodeAttribute getCode ( ) { for ( int i = 0 ; i < _attributes . size ( ) ; i ++ ) { Attribute attr = _attributes . get ( i ) ; if ( attr instanceof CodeAttribute ) return ( CodeAttribute ) attr ; } return null ; } | Returns the code attribute . | 65 | 5 |
139,729 | public CodeAttribute createCode ( ) { CodeAttribute code = new CodeAttribute ( ) ; for ( int i = 0 ; i < _attributes . size ( ) ; i ++ ) { Attribute attr = _attributes . get ( i ) ; if ( attr instanceof CodeAttribute ) return ( CodeAttribute ) attr ; } return null ; } | Create the code attribute . | 75 | 5 |
139,730 | public JavaMethod export ( JavaClass source , JavaClass target ) { JavaMethod method = new JavaMethod ( _loader ) ; method . setName ( _name ) ; method . setDescriptor ( _descriptor ) ; method . setAccessFlags ( _accessFlags ) ; target . getConstantPool ( ) . addUTF8 ( _name ) ; target . getConstantPool ( ) . addUTF8 ( _descriptor ) ; for ( int i = 0 ; i < _attributes . size ( ) ; i ++ ) { Attribute attr = _attributes . get ( i ) ; method . addAttribute ( attr . export ( source , target ) ) ; } return method ; } | exports the method . | 151 | 5 |
139,731 | public void concatenate ( JavaMethod tail ) { CodeAttribute codeAttr = getCode ( ) ; CodeAttribute tailCodeAttr = tail . getCode ( ) ; byte [ ] code = codeAttr . getCode ( ) ; byte [ ] tailCode = tailCodeAttr . getCode ( ) ; int codeLength = code . length ; if ( ( code [ codeLength - 1 ] & 0xff ) == CodeVisitor . RETURN ) codeLength = codeLength - 1 ; byte [ ] newCode = new byte [ codeLength + tailCode . length ] ; System . arraycopy ( code , 0 , newCode , 0 , codeLength ) ; System . arraycopy ( tailCode , 0 , newCode , codeLength , tailCode . length ) ; codeAttr . setCode ( newCode ) ; if ( codeAttr . getMaxStack ( ) < tailCodeAttr . getMaxStack ( ) ) codeAttr . setMaxStack ( tailCodeAttr . getMaxStack ( ) ) ; if ( codeAttr . getMaxLocals ( ) < tailCodeAttr . getMaxLocals ( ) ) codeAttr . setMaxLocals ( tailCodeAttr . getMaxLocals ( ) ) ; ArrayList < CodeAttribute . ExceptionItem > exns = tailCodeAttr . getExceptions ( ) ; for ( int i = 0 ; i < exns . size ( ) ; i ++ ) { CodeAttribute . ExceptionItem exn = exns . get ( i ) ; CodeAttribute . ExceptionItem newExn = new CodeAttribute . ExceptionItem ( ) ; newExn . setType ( exn . getType ( ) ) ; newExn . setStart ( exn . getStart ( ) + codeLength ) ; newExn . setEnd ( exn . getEnd ( ) + codeLength ) ; newExn . setHandler ( exn . getHandler ( ) + codeLength ) ; } } | Concatenates the method . | 415 | 7 |
139,732 | public PodAppHandle getPodAppHandle ( String id ) { PodAppHandle handle = _podAppHandleMap . get ( id ) ; if ( handle == null ) { // handle = _podsDeployService.getPodAppHandle(id); _podAppHandleMap . putIfAbsent ( id , handle ) ; } return handle ; } | Returns a handle to the PodApp service specified by the pod - app id . | 73 | 16 |
139,733 | public boolean stop ( ShutdownModeAmp mode ) { Objects . requireNonNull ( mode ) ; if ( ! _lifecycle . toStop ( ) ) { return false ; } _shutdownMode = mode ; /* if (_podBuilder != null) { ServiceRefAmp.toServiceRef(_podBuilder).shutdown(mode); ServiceRefAmp.toServiceRef(_podsDeployService).shutdown(mode); ServiceRefAmp.toServiceRef(_podsConfigService).shutdown(mode); } */ return true ; } | Closes the container . | 114 | 5 |
139,734 | @ SuppressWarnings ( "unchecked" ) public final E remove ( ) { Thread thread = Thread . currentThread ( ) ; ClassLoader loader = thread . getContextClassLoader ( ) ; for ( ; loader != null ; loader = loader . getParent ( ) ) { if ( loader instanceof EnvironmentClassLoader ) { EnvironmentClassLoader envLoader = ( EnvironmentClassLoader ) loader ; return ( E ) envLoader . removeAttribute ( _varName ) ; } } return setGlobal ( null ) ; } | Removes this variable | 107 | 4 |
139,735 | @ SuppressWarnings ( "unchecked" ) public final E remove ( ClassLoader loader ) { for ( ; loader != null ; loader = loader . getParent ( ) ) { if ( loader instanceof EnvironmentClassLoader ) { EnvironmentClassLoader envLoader = ( EnvironmentClassLoader ) loader ; return ( E ) envLoader . removeAttribute ( _varName ) ; } } return setGlobal ( null ) ; } | Removes the variable for the context classloader . | 87 | 10 |
139,736 | public E setGlobal ( E value ) { E oldValue = _globalValue ; _globalValue = value ; ClassLoader systemLoader = getSystemClassLoader ( ) ; if ( systemLoader instanceof EnvironmentClassLoader ) ( ( EnvironmentClassLoader ) systemLoader ) . setAttribute ( _varName , value ) ; else _globalValue = value ; return oldValue ; } | Sets the global value . | 77 | 6 |
139,737 | @ SuppressWarnings ( "unchecked" ) public E getGlobal ( ) { ClassLoader systemLoader = getSystemClassLoader ( ) ; if ( systemLoader instanceof EnvironmentClassLoader ) return ( E ) ( ( EnvironmentClassLoader ) systemLoader ) . getAttribute ( _varName ) ; else return _globalValue ; } | Returns the global value . | 70 | 5 |
139,738 | public String getSimpleName ( ) { String name = getName ( ) ; int p = name . lastIndexOf ( ' ' ) ; return name . substring ( p + 1 ) ; } | Returns the class name . | 41 | 5 |
139,739 | public Class getJavaClass ( ) { try { ClassLoader loader = Thread . currentThread ( ) . getContextClassLoader ( ) ; return Class . forName ( getName ( ) , false , loader ) ; } catch ( Exception e ) { throw new RuntimeException ( e ) ; } } | Returns the Java class . | 61 | 5 |
139,740 | public JMethod getConstructor ( JClass [ ] param ) { JMethod [ ] ctors = getConstructors ( ) ; loop : for ( int i = 0 ; i < ctors . length ; i ++ ) { JClass [ ] args = ctors [ i ] . getParameterTypes ( ) ; if ( args . length != param . length ) continue loop ; for ( int j = 0 ; j < args . length ; j ++ ) if ( ! args [ i ] . equals ( param [ j ] ) ) continue loop ; return ctors [ i ] ; } return null ; } | Returns a matching constructor . | 129 | 5 |
139,741 | public String getShortName ( ) { if ( isArray ( ) ) return getComponentType ( ) . getShortName ( ) + "[]" ; else { String name = getName ( ) . replace ( ' ' , ' ' ) ; int p = name . lastIndexOf ( ' ' ) ; if ( p >= 0 ) return name . substring ( p + 1 ) ; else return name ; } } | Returns a printable version of a class . | 86 | 9 |
139,742 | @ Override public void dispatch ( ) { Result < InputStreamClient > result = _result ; if ( result != null ) { result . ok ( _is ) ; } } | dispatch a request after the headers are read . | 37 | 10 |
139,743 | public void init ( boolean isSecure , CharSequence host , int port , byte [ ] uri , int uriLength ) { _isSecure = isSecure ; _host = host ; _port = port ; _uri = uri ; _uriLength = uriLength ; } | Initialize the InvocationKey with a new triple . | 60 | 11 |
139,744 | public HashMap < String , Object > getValueMap ( ) { try { if ( _values == null ) { _values = new HashMap < String , Object > ( ) ; Method [ ] methods = _ann . annotationType ( ) . getMethods ( ) ; for ( int i = 0 ; i < methods . length ; i ++ ) { Method method = methods [ i ] ; if ( method . getDeclaringClass ( ) . equals ( Class . class ) ) continue ; if ( method . getDeclaringClass ( ) . equals ( Object . class ) ) continue ; if ( method . getParameterTypes ( ) . length != 0 ) continue ; _values . put ( method . getName ( ) , method . invoke ( _ann ) ) ; } } return _values ; } catch ( Exception e ) { throw new RuntimeException ( e ) ; } } | Returns the annotation values . | 181 | 5 |
139,745 | public JavaClass parse ( InputStream is ) throws IOException { _is = is ; if ( _loader == null ) _loader = new JavaClassLoader ( ) ; if ( _class == null ) _class = new JavaClass ( _loader ) ; _cp = _class . getConstantPool ( ) ; parseClass ( ) ; return _class ; } | Parses the . class file . | 76 | 8 |
139,746 | private void parseClass ( ) throws IOException { int magic = readInt ( ) ; if ( magic != JavaClass . MAGIC ) throw error ( L . l ( "bad magic number in class file" ) ) ; int minor = readShort ( ) ; int major = readShort ( ) ; _class . setMajor ( major ) ; _class . setMinor ( minor ) ; parseConstantPool ( ) ; int accessFlags = readShort ( ) ; _class . setAccessFlags ( accessFlags ) ; int thisClassIndex = readShort ( ) ; _class . setThisClass ( _cp . getClass ( thisClassIndex ) . getName ( ) ) ; int superClassIndex = readShort ( ) ; if ( superClassIndex > 0 ) _class . setSuperClass ( _cp . getClass ( superClassIndex ) . getName ( ) ) ; int interfaceCount = readShort ( ) ; for ( int i = 0 ; i < interfaceCount ; i ++ ) { int classIndex = readShort ( ) ; _class . addInterface ( _cp . getClass ( classIndex ) . getName ( ) ) ; } int fieldCount = readShort ( ) ; for ( int i = 0 ; i < fieldCount ; i ++ ) { parseField ( ) ; } int methodCount = readShort ( ) ; for ( int i = 0 ; i < methodCount ; i ++ ) parseMethod ( ) ; int attrCount = readShort ( ) ; for ( int i = 0 ; i < attrCount ; i ++ ) { Attribute attr = parseAttribute ( ) ; _class . addAttribute ( attr ) ; } } | Parses the ClassFile construct | 349 | 7 |
139,747 | private ConstantPoolEntry parseConstantPoolEntry ( int index ) throws IOException { int tag = read ( ) ; switch ( tag ) { case CP_CLASS : return parseClassConstant ( index ) ; case CP_FIELD_REF : return parseFieldRefConstant ( index ) ; case CP_METHOD_REF : return parseMethodRefConstant ( index ) ; case CP_INTERFACE_METHOD_REF : return parseInterfaceMethodRefConstant ( index ) ; case CP_STRING : return parseStringConstant ( index ) ; case CP_INTEGER : return parseIntegerConstant ( index ) ; case CP_FLOAT : return parseFloatConstant ( index ) ; case CP_LONG : return parseLongConstant ( index ) ; case CP_DOUBLE : return parseDoubleConstant ( index ) ; case CP_NAME_AND_TYPE : return parseNameAndTypeConstant ( index ) ; case CP_UTF8 : return parseUtf8Constant ( index ) ; default : throw error ( L . l ( "'{0}' is an unknown constant pool type." , tag ) ) ; } } | Parses a constant pool entry . | 241 | 8 |
139,748 | private ClassConstant parseClassConstant ( int index ) throws IOException { int nameIndex = readShort ( ) ; return new ClassConstant ( _class . getConstantPool ( ) , index , nameIndex ) ; } | Parses a class constant pool entry . | 48 | 9 |
139,749 | private FieldRefConstant parseFieldRefConstant ( int index ) throws IOException { int classIndex = readShort ( ) ; int nameAndTypeIndex = readShort ( ) ; return new FieldRefConstant ( _class . getConstantPool ( ) , index , classIndex , nameAndTypeIndex ) ; } | Parses a field ref constant pool entry . | 67 | 10 |
139,750 | private MethodRefConstant parseMethodRefConstant ( int index ) throws IOException { int classIndex = readShort ( ) ; int nameAndTypeIndex = readShort ( ) ; return new MethodRefConstant ( _class . getConstantPool ( ) , index , classIndex , nameAndTypeIndex ) ; } | Parses a method ref constant pool entry . | 67 | 10 |
139,751 | private InterfaceMethodRefConstant parseInterfaceMethodRefConstant ( int index ) throws IOException { int classIndex = readShort ( ) ; int nameAndTypeIndex = readShort ( ) ; return new InterfaceMethodRefConstant ( _class . getConstantPool ( ) , index , classIndex , nameAndTypeIndex ) ; } | Parses an interface method ref constant pool entry . | 70 | 11 |
139,752 | private StringConstant parseStringConstant ( int index ) throws IOException { int stringIndex = readShort ( ) ; return new StringConstant ( _class . getConstantPool ( ) , index , stringIndex ) ; } | Parses a string constant pool entry . | 48 | 9 |
139,753 | private IntegerConstant parseIntegerConstant ( int index ) throws IOException { int value = readInt ( ) ; return new IntegerConstant ( _class . getConstantPool ( ) , index , value ) ; } | Parses an integer constant pool entry . | 46 | 9 |
139,754 | private FloatConstant parseFloatConstant ( int index ) throws IOException { int bits = readInt ( ) ; float value = Float . intBitsToFloat ( bits ) ; return new FloatConstant ( _class . getConstantPool ( ) , index , value ) ; } | Parses a float constant pool entry . | 60 | 9 |
139,755 | private LongConstant parseLongConstant ( int index ) throws IOException { long value = readLong ( ) ; return new LongConstant ( _class . getConstantPool ( ) , index , value ) ; } | Parses a long constant pool entry . | 46 | 9 |
139,756 | private DoubleConstant parseDoubleConstant ( int index ) throws IOException { long bits = readLong ( ) ; double value = Double . longBitsToDouble ( bits ) ; return new DoubleConstant ( _class . getConstantPool ( ) , index , value ) ; } | Parses a double constant pool entry . | 60 | 9 |
139,757 | private NameAndTypeConstant parseNameAndTypeConstant ( int index ) throws IOException { int nameIndex = readShort ( ) ; int descriptorIndex = readShort ( ) ; return new NameAndTypeConstant ( _class . getConstantPool ( ) , index , nameIndex , descriptorIndex ) ; } | Parses a name and type pool entry . | 66 | 10 |
139,758 | private Utf8Constant parseUtf8Constant ( int index ) throws IOException { int length = readShort ( ) ; StringBuilder cb = new StringBuilder ( ) ; for ( int i = 0 ; i < length ; i ++ ) { int ch = read ( ) ; if ( ch < 0x80 ) { cb . append ( ( char ) ch ) ; } else if ( ( ch & 0xe0 ) == 0xc0 ) { int ch2 = read ( ) ; i ++ ; cb . append ( ( char ) ( ( ( ch & 0x1f ) << 6 ) + ( ch2 & 0x3f ) ) ) ; } else { int ch2 = read ( ) ; int ch3 = read ( ) ; i += 2 ; cb . append ( ( char ) ( ( ( ch & 0xf ) << 12 ) + ( ( ch2 & 0x3f ) << 6 ) + ( ( ch3 & 0x3f ) ) ) ) ; } } return new Utf8Constant ( _class . getConstantPool ( ) , index , cb . toString ( ) ) ; } | Parses a utf - 8 constant pool entry . | 246 | 12 |
139,759 | private void parseMethod ( ) throws IOException { int accessFlags = readShort ( ) ; int nameIndex = readShort ( ) ; int descriptorIndex = readShort ( ) ; JavaMethod method = new JavaMethod ( _loader ) ; method . setJavaClass ( _class ) ; method . setName ( _cp . getUtf8 ( nameIndex ) . getValue ( ) ) ; method . setDescriptor ( _cp . getUtf8 ( descriptorIndex ) . getValue ( ) ) ; method . setAccessFlags ( accessFlags ) ; int attributesCount = readShort ( ) ; for ( int i = 0 ; i < attributesCount ; i ++ ) { Attribute attr = parseAttribute ( ) ; method . addAttribute ( attr ) ; if ( attr instanceof ExceptionsAttribute ) { ExceptionsAttribute exn = ( ExceptionsAttribute ) attr ; ArrayList < String > exnNames = exn . getExceptionList ( ) ; if ( exnNames . size ( ) > 0 ) { JClass [ ] exnClasses = new JClass [ exnNames . size ( ) ] ; for ( int j = 0 ; j < exnNames . size ( ) ; j ++ ) { String exnName = exnNames . get ( j ) . replace ( ' ' , ' ' ) ; exnClasses [ j ] = _loader . forName ( exnName ) ; } method . setExceptionTypes ( exnClasses ) ; } } } _class . addMethod ( method ) ; } | Parses a method entry . | 328 | 7 |
139,760 | public Attribute parseAttribute ( ) throws IOException { int nameIndex = readShort ( ) ; String name = _cp . getUtf8 ( nameIndex ) . getValue ( ) ; if ( name . equals ( "Code" ) ) { CodeAttribute code = new CodeAttribute ( name ) ; code . read ( this ) ; return code ; } else if ( name . equals ( "Exceptions" ) ) { ExceptionsAttribute code = new ExceptionsAttribute ( name ) ; code . read ( this ) ; return code ; } else if ( name . equals ( "Signature" ) ) { SignatureAttribute attr = new SignatureAttribute ( ) ; attr . read ( this ) ; return attr ; } else if ( name . equals ( "BootstrapMethods" ) ) { BootstrapMethodAttribute attr = new BootstrapMethodAttribute ( ) ; attr . read ( this ) ; return attr ; } OpaqueAttribute attr = new OpaqueAttribute ( name ) ; int length = readInt ( ) ; byte [ ] bytes = new byte [ length ] ; read ( bytes , 0 , bytes . length ) ; attr . setValue ( bytes ) ; return attr ; } | Parses an attribute . | 251 | 6 |
139,761 | long readLong ( ) throws IOException { return ( ( ( long ) _is . read ( ) << 56 ) | ( ( long ) _is . read ( ) << 48 ) | ( ( long ) _is . read ( ) << 40 ) | ( ( long ) _is . read ( ) << 32 ) | ( ( long ) _is . read ( ) << 24 ) | ( ( long ) _is . read ( ) << 16 ) | ( ( long ) _is . read ( ) << 8 ) | ( ( long ) _is . read ( ) ) ) ; } | Parses a 64 - bit int . | 123 | 9 |
139,762 | public int readInt ( ) throws IOException { return ( ( _is . read ( ) << 24 ) | ( _is . read ( ) << 16 ) | ( _is . read ( ) << 8 ) | ( _is . read ( ) ) ) ; } | Parses a 32 - bit int . | 56 | 9 |
139,763 | public int read ( byte [ ] buffer , int offset , int length ) throws IOException { int readLength = 0 ; while ( length > 0 ) { int sublen = _is . read ( buffer , offset , length ) ; if ( sublen < 0 ) return readLength == 0 ? - 1 : readLength ; offset += sublen ; length -= sublen ; readLength += sublen ; } return readLength ; } | Reads a chunk | 89 | 4 |
139,764 | @ Override public void start ( ) { try { JournalClientEndpoint endpoint = connect ( ) ; if ( endpoint != null ) { OutputStream os ; _os = os = endpoint . startMessage ( ) ; if ( os != null ) { os . write ( ' ' ) ; } } } catch ( Exception e ) { log . finer ( e . toString ( ) ) ; //e.printStackTrace(); // // throw new RuntimeException(e); } } | Start a journalled message . | 99 | 7 |
139,765 | @ Override public void write ( byte [ ] buffer , int offset , int length ) { try { OutputStream os = _os ; if ( os != null ) { os . write ( buffer , offset , length ) ; } } catch ( Exception e ) { log . log ( Level . FINER , e . toString ( ) , e ) ; } } | write the contents of a journal message . | 75 | 8 |
139,766 | @ Override public boolean complete ( ) { OutputStream os = _os ; _os = null ; IoUtil . close ( os ) ; return true ; } | Complete a journaled message . | 34 | 6 |
139,767 | private static void printStackTraceElement ( StackTraceElement trace , PrintWriter out , ClassLoader loader ) { try { LineMap map = getScriptLineMap ( trace . getClassName ( ) , loader ) ; if ( map != null ) { LineMap . Line line = map . getLine ( trace . getLineNumber ( ) ) ; if ( line != null ) { out . print ( trace . getClassName ( ) + "." + trace . getMethodName ( ) ) ; out . print ( "(" + line . getSourceFilename ( ) + ":" ) ; out . println ( line . getSourceLine ( trace . getLineNumber ( ) ) + ")" ) ; return ; } } } catch ( Throwable e ) { } out . println ( trace ) ; } | Prints a single stack trace element . | 167 | 8 |
139,768 | public static LineMap getScriptLineMap ( String className , ClassLoader loader ) { try { Class cl = loader . loadClass ( className ) ; LineMap map = _scriptMap . get ( cl ) ; if ( map == null ) { map = loadScriptMap ( cl ) ; _scriptMap . put ( cl , map ) ; } return map ; } catch ( Throwable e ) { return null ; } } | Loads the local line map for a class . | 89 | 10 |
139,769 | private static LineMap loadScriptMap ( Class cl ) { ClassLoader loader = cl . getClassLoader ( ) ; if ( loader == null ) return new LineMap ( ) ; // null map try { String pathName = cl . getName ( ) . replace ( ' ' , ' ' ) + ".class" ; InputStream is = loader . getResourceAsStream ( pathName ) ; if ( is == null ) return null ; try { JavaClass jClass = new ByteCodeParser ( ) . parse ( is ) ; Attribute attr = jClass . getAttribute ( "SourceDebugExtension" ) ; if ( attr == null ) { int p = cl . getName ( ) . indexOf ( ' ' ) ; if ( p > 0 ) { String className = cl . getName ( ) . substring ( 0 , p ) ; return loadScriptMap ( loader . loadClass ( className ) ) ; } return new LineMap ( ) ; } else if ( attr instanceof OpaqueAttribute ) { byte [ ] value = ( ( OpaqueAttribute ) attr ) . getValue ( ) ; ByteArrayInputStream bis = new ByteArrayInputStream ( value ) ; ReadStreamOld rs = VfsOld . openRead ( bis ) ; rs . setEncoding ( "UTF-8" ) ; try { return parseSmap ( rs ) ; } finally { rs . close ( ) ; } } else throw new IllegalStateException ( L . l ( "Expected opaque attribute at '{0}'" , attr ) ) ; } finally { if ( is != null ) is . close ( ) ; } } catch ( Throwable e ) { log . finer ( e . toString ( ) ) ; log . log ( Level . FINEST , e . toString ( ) , e ) ; return new LineMap ( ) ; // null map } } | Loads the script map for a class | 394 | 8 |
139,770 | private List < IPolicy > getPoliciesOrDefault ( final IGuaranteeTerm term ) { if ( term . getPolicies ( ) != null && term . getPolicies ( ) . size ( ) > 0 ) { return term . getPolicies ( ) ; } return Collections . singletonList ( defaultPolicy ) ; } | Return policies of the term if any or the default policy . | 74 | 12 |
139,771 | protected final void doStart ( Collection < ? extends Location > locations ) { ServiceStateLogic . setExpectedState ( this , Lifecycle . STARTING ) ; try { preStart ( ) ; driver . start ( ) ; log . info ( "Entity {} was started with driver {}" , new Object [ ] { this , driver } ) ; postDriverStart ( ) ; connectSensors ( ) ; postStart ( ) ; ServiceStateLogic . setExpectedState ( this , Lifecycle . RUNNING ) ; } catch ( Throwable t ) { ServiceStateLogic . setExpectedState ( this , Lifecycle . ON_FIRE ) ; log . error ( "Error error starting entity {}" , this ) ; throw Exceptions . propagate ( t ) ; } } | It is a temporal method . It will be contains the start effector body . It will be moved to LifeCycle class based on Task . It is the first approach . It does not start the entity children . | 164 | 43 |
139,772 | private DNode findFrontendNode ( ) { DNode frontend = getNode ( requirements . getFrontend ( ) ) ; if ( frontend == DNode . NOT_FOUND ) { frontend = searchFrontendNode ( ) ; if ( frontend == DNode . NOT_FOUND ) { frontend = calculateSourceNode ( ) ; } } return frontend ; } | Assigns a frontend node to the graph according to the rules in the class header | 81 | 18 |
139,773 | private DNode searchFrontendNode ( ) { DNode result = DNode . NOT_FOUND ; for ( DNode node : nodes ) { if ( node . getFrontend ( ) ) { result = node ; break ; } } return result ; } | Searches the first node with frontend property set to true | 54 | 13 |
139,774 | private DNode calculateSourceNode ( ) { DNode result = DNode . NOT_FOUND ; for ( DNode node : nodes ) { List < DLink > links = getLinksTo ( node ) ; if ( links . size ( ) == 0 ) { result = node ; break ; } } return result ; } | Finds the first node with no incoming links . | 67 | 10 |
139,775 | public Reader create ( InputStream is ) throws UnsupportedEncodingException { Reader reader = create ( is , getJavaEncoding ( ) ) ; if ( reader != null ) return reader ; else return new ISO8859_1Reader ( is ) ; } | Returns a new encoding reader for the given stream and javaEncoding . | 53 | 14 |
139,776 | @ Override protected void initRequest ( ) { super . initRequest ( ) ; _uri . clear ( ) ; _host . clear ( ) ; _headerSize = 0 ; _remoteHost . clear ( ) ; _remoteAddr . clear ( ) ; _serverName . clear ( ) ; _serverPort . clear ( ) ; _remotePort . clear ( ) ; _clientCert . clear ( ) ; // _isSecure = getConnection().isSecure(); } | Clears variables at the start of a new request . | 98 | 11 |
139,777 | @ Override protected CharBuffer getHost ( ) { if ( _host . length ( ) > 0 ) { return _host ; } _host . append ( _serverName ) ; _host . toLowerCase ( ) ; return _host ; } | Returns a char buffer containing the host . | 52 | 8 |
139,778 | @ ConfigArg ( 0 ) public void setPath ( PathImpl path ) { if ( path . getPath ( ) . endsWith ( ".jar" ) || path . getPath ( ) . endsWith ( ".zip" ) ) { path = JarPath . create ( path ) ; } _path = path ; } | Sets the resource directory . | 66 | 6 |
139,779 | public void setPrefix ( String prefix ) { _prefix = prefix ; if ( prefix != null ) _pathPrefix = prefix . replace ( ' ' , ' ' ) ; } | Sets the resource prefix | 38 | 5 |
139,780 | @ PostConstruct @ Override public void init ( ) throws ConfigException { try { _codeSource = new CodeSource ( new URL ( _path . getURL ( ) ) , ( Certificate [ ] ) null ) ; } catch ( Exception e ) { log . log ( Level . FINE , e . toString ( ) , e ) ; } super . init ( ) ; getClassLoader ( ) . addURL ( _path , _isScanned ) ; } | Initializes the loader . | 97 | 5 |
139,781 | @ Override protected void buildClassPath ( ArrayList < String > pathList ) { String path = null ; if ( _path instanceof JarPath ) path = ( ( JarPath ) _path ) . getContainer ( ) . getNativePath ( ) ; else if ( _path . isDirectory ( ) ) path = _path . getNativePath ( ) ; if ( path != null && ! pathList . contains ( path ) ) pathList . add ( path ) ; } | Adds the class of this resource . | 100 | 7 |
139,782 | @ PostConstruct public void init ( ) throws Exception { if ( _encoding == null ) throw new ConfigException ( L . l ( "character-encoding requires a 'value' attribute with the character encoding." ) ) ; _localEncoding . set ( _encoding ) ; } | Initialize the resource . | 60 | 5 |
139,783 | @ Override public PathImpl schemeWalk ( String userPath , Map < String , Object > newAttributes , String uri , int offset ) { int length = uri . length ( ) ; if ( length < 2 + offset || uri . charAt ( offset ) != ' ' || uri . charAt ( 1 + offset ) != ' ' ) throw new RuntimeException ( "bad scheme" ) ; CharBuffer buf = new CharBuffer ( ) ; int i = 2 + offset ; int ch = 0 ; boolean isIpv6 = false ; for ( ; ( i < length && ( ch = uri . charAt ( i ) ) != ' ' && ch != ' ' && ! ( ch == ' ' && ! isIpv6 ) ) ; i ++ ) { if ( ch == ' ' ) isIpv6 = true ; else if ( ch == ' ' ) isIpv6 = false ; buf . append ( ( char ) ch ) ; } String host = buf . toString ( ) ; if ( host . length ( ) == 0 ) throw new RuntimeException ( "bad host" ) ; int port = 0 ; if ( ch == ' ' ) { for ( i ++ ; i < length && ( ch = uri . charAt ( i ) ) >= ' ' && ch <= ' ' ; i ++ ) { port = 10 * port + uri . charAt ( i ) - ' ' ; } } return create ( this , userPath , newAttributes , host , port ) ; } | Lookup the new path assuming we re the scheme root . | 322 | 12 |
139,784 | public int read ( byte [ ] buf , int offset , int length ) throws IOException { if ( _is == null ) return - 1 ; int len = _is . read ( buf , offset , length ) ; return len ; } | Reads bytes from the file . | 49 | 7 |
139,785 | public void close ( ) throws IOException { unlock ( ) ; _fileChannel = null ; InputStream is = _is ; _is = null ; if ( is != null ) is . close ( ) ; } | Closes the underlying stream . | 44 | 6 |
139,786 | public static OutboxAmp getOutboxCurrent ( ) { OutboxAmp outbox = OutboxAmp . current ( ) ; if ( outbox != null ) { // OutboxAmp outbox = (OutboxAmp) outboxDeliver; return outbox ; } else { return OutboxAmpNull . NULL ; } } | Returns the calling outbox from the current context if available . | 74 | 12 |
139,787 | public void write ( ByteAppendable os , char ch ) throws IOException { os . write ( ch >> 8 ) ; os . write ( ch ) ; } | Writes the character using the correct encoding . | 34 | 9 |
139,788 | static JClassLoader getSystemClassLoader ( ) { if ( _staticClassLoader == null ) _staticClassLoader = JClassLoaderWrapper . create ( ClassLoader . getSystemClassLoader ( ) ) ; return _staticClassLoader ; } | Returns the wrapped system class loader . | 51 | 7 |
139,789 | public Offering fetchOffer ( String cloudOfferingId ) { if ( cloudOfferingId == null ) return null ; return offeringManager . getOffering ( cloudOfferingId ) ; } | Reads an offering from the local repository . | 41 | 9 |
139,790 | public String addOffering ( Offering newOffering ) { if ( newOffering == null ) return null ; String offeringName = newOffering . getName ( ) ; /* if the offering was already present in the repository it is removed */ if ( offeringManager . getOffering ( offeringName ) != null ) { offeringManager . removeOffering ( offeringName ) ; } offeringManager . addOffering ( newOffering ) ; /* updates the list of all node templates */ this . offeringNodeTemplates . add ( newOffering . getNodeTemplate ( ) ) ; totalCrawledOfferings ++ ; return offeringName ; } | Inserts or eventually updates an offering in the local repository | 133 | 11 |
139,791 | public void print ( int i ) { if ( i == 0x80000000 ) { print ( "-2147483648" ) ; return ; } if ( i < 0 ) { write ( ' ' ) ; i = - i ; } else if ( i < 9 ) { write ( ' ' + i ) ; return ; } int length = 0 ; int exp = 10 ; if ( i >= 1000000000 ) length = 9 ; else { for ( ; i >= exp ; length ++ ) exp = 10 * exp ; } int j = 31 ; while ( i > 0 ) { _tempCharBuffer [ -- j ] = ( char ) ( ( i % 10 ) + ' ' ) ; i /= 10 ; } write ( _tempCharBuffer , j , 31 - j ) ; } | Prints an integer value . | 166 | 6 |
139,792 | public void print ( long v ) { if ( v == 0x8000000000000000 L ) { print ( "-9223372036854775808" ) ; return ; } if ( v < 0 ) { write ( ' ' ) ; v = - v ; } else if ( v == 0 ) { write ( ' ' ) ; return ; } int j = 31 ; while ( v > 0 ) { _tempCharBuffer [ -- j ] = ( char ) ( ( v % 10 ) + ' ' ) ; v /= 10 ; } write ( _tempCharBuffer , j , 31 - j ) ; } | Prints a long value . | 130 | 6 |
139,793 | final public void print ( Object v ) { if ( v == null ) write ( _nullChars , 0 , _nullChars . length ) ; else { String s = v . toString ( ) ; write ( s , 0 , s . length ( ) ) ; } } | Prints the value of the object . | 59 | 8 |
139,794 | final public void println ( float v ) { String s = String . valueOf ( v ) ; write ( s , 0 , s . length ( ) ) ; println ( ) ; } | Prints a float followed by a newline . | 38 | 10 |
139,795 | final public void println ( String s ) { if ( s == null ) write ( _nullChars , 0 , _nullChars . length ) ; else write ( s , 0 , s . length ( ) ) ; println ( ) ; } | Writes a string followed by a newline . | 51 | 10 |
139,796 | private void configureServer ( ServerBartender server ) { // XXX: mixing server/client ServerNetwork serverNet = _serverMap . get ( server . getId ( ) ) ; if ( serverNet == null ) { serverNet = new ServerNetwork ( _system , server ) ; configServer ( serverNet , server ) ; serverNet . init ( ) ; _serverMap . put ( server . getId ( ) , serverNet ) ; } } | Configures the server . | 94 | 5 |
139,797 | public JType [ ] getActualTypeArguments ( ) { Type [ ] rawArgs = _type . getActualTypeArguments ( ) ; JType [ ] args = new JType [ rawArgs . length ] ; for ( int i = 0 ; i < args . length ; i ++ ) { Type type = rawArgs [ i ] ; if ( type instanceof Class ) { args [ i ] = _loader . forName ( ( ( Class ) type ) . getName ( ) ) ; } else if ( type instanceof ParameterizedType ) args [ i ] = new JTypeWrapper ( _loader , ( ParameterizedType ) type ) ; else { args [ i ] = _loader . forName ( "java.lang.Object" ) ; // jpa/0gg0 // throw new IllegalStateException(type.toString()); } } return args ; } | Returns the actual type arguments . | 188 | 6 |
139,798 | public void close ( ) { if ( _isClosed ) { return ; } _isClosed = true ; KelpManager backing = _kelpBacking ; // _localBacking = null; if ( backing != null ) { backing . close ( ) ; } } | Closes the manager . | 58 | 5 |
139,799 | public void map ( MethodRef method , String sql , Object [ ] args ) { QueryBuilderKraken builder = QueryParserKraken . parse ( this , sql ) ; if ( builder . isTableLoaded ( ) ) { QueryKraken query = builder . build ( ) ; query . map ( method , args ) ; } else { String tableName = builder . getTableName ( ) ; _tableService . loadTable ( tableName , Result . of ( t -> builder . build ( ) . map ( method , args ) ) ) ; } } | Maps results to a method callback . | 118 | 7 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.