idx int64 0 41.2k | question stringlengths 74 4.21k | target stringlengths 5 888 |
|---|---|---|
18,600 | public boolean containsCursor ( long cursorId ) { if ( cursorId < getData ( ) . firstCursorIndex ) { return false ; } return cursorId < ( getData ( ) . firstCursorIndex + getData ( ) . cursorCount ) ; } | Contains cursor boolean . |
18,601 | public Bits bitsTo ( TrieNode toNode ) { if ( index == toNode . index ) return Bits . NULL ; return intervalTo ( toNode ) . toBits ( ) ; } | Bits to bits . |
18,602 | public Interval intervalTo ( TrieNode toNode ) { return new Interval ( toNode . getCursorIndex ( ) - this . getCursorIndex ( ) , toNode . getCursorCount ( ) , this . getCursorCount ( ) ) ; } | Interval to interval . |
18,603 | NodeData update ( Function < NodeData , NodeData > update ) { data = trie . nodes . update ( index , update ) ; return data ; } | Update node data . |
18,604 | public boolean isStringTerminal ( ) { if ( getChar ( ) == NodewalkerCodec . END_OF_STRING ) return true ; if ( getChar ( ) == NodewalkerCodec . FALLBACK && null != getParent ( ) ) return getParent ( ) . isStringTerminal ( ) ; return false ; } | Is string terminal boolean . |
18,605 | public Stream < ? extends TrieNode > streamDecendents ( int level ) { assert ( level > 0 ) ; if ( level == 1 ) { return getChildren ( ) ; } else { return getChildren ( ) . flatMap ( child -> child . streamDecendents ( level - 1 ) ) ; } } | Stream decendents stream . |
18,606 | void writeChildren ( TreeMap < Character , Long > counts ) { int firstIndex = trie . nodes . length ( ) ; counts . forEach ( ( k , v ) -> { if ( v > 0 ) trie . nodes . add ( new NodeData ( k , ( short ) - 1 , - 1 , v , - 1 ) ) ; } ) ; short length = ( short ) ( trie . nodes . length ( ) - firstIndex ) ; trie . ensureParentIndexCapacity ( firstIndex , length , index ) ; update ( n -> n . setFirstChildIndex ( firstIndex ) . setNumberOfChildren ( length ) ) ; data = null ; } | Write children . |
18,607 | public TreeMap < Character , ? extends TrieNode > getChildrenMap ( ) { TreeMap < Character , TrieNode > map = new TreeMap < > ( ) ; getChildren ( ) . forEach ( x -> map . put ( x . getChar ( ) , x ) ) ; return map ; } | Gets children map . |
18,608 | public Map < Character , TrieNode > getGodChildren ( ) { String postContext = this . getString ( ) . substring ( 1 ) ; return trie . tokens ( ) . stream ( ) . collect ( Collectors . toMap ( x -> x , token -> { TrieNode traverse = trie . traverse ( token + postContext ) ; return traverse . getString ( ) . equals ( token + postContext ) ? traverse : null ; } ) ) . entrySet ( ) . stream ( ) . filter ( e -> null != e . getValue ( ) ) . collect ( Collectors . toMap ( e -> e . getKey ( ) , e -> e . getValue ( ) ) ) ; } | Gets god children . |
18,609 | public TrieNode getParent ( ) { if ( 0 == index ) return null ; if ( null == parent && - 1 == depth ) { synchronized ( this ) { if ( null == parent ) { parent = newNode ( trie . parentIndex [ index ] ) ; assert ( parent . index < index ) ; } } } return parent ; } | Gets parent . |
18,610 | public TrieNode getContinuation ( char c ) { return ( ( Optional < TrieNode > ) getChild ( c ) ) . orElseGet ( ( ) -> { TrieNode godparent = godparent ( ) ; if ( null == godparent ) return null ; return godparent . getContinuation ( c ) ; } ) ; } | Gets continuation . |
18,611 | public static String mapToPtPath ( final String aID ) { Objects . requireNonNull ( aID ) ; final String encodedID = encodeID ( aID ) ; final List < String > shorties = new ArrayList < > ( ) ; int start = 0 ; while ( start < encodedID . length ( ) ) { int end = start + myShortyLength ; if ( end > encodedID . length ( ) ) { end = encodedID . length ( ) ; } shorties . add ( encodedID . substring ( start , end ) ) ; start = end ; } return concat ( shorties . toArray ( new String [ 0 ] ) ) ; } | Maps the supplied ID to a Pairtree path . |
18,612 | public static String mapToID ( final String aBasePath , final String aPtPath ) throws InvalidPathException { return mapToID ( removeBasePath ( aBasePath , aPtPath ) ) ; } | Maps the supplied base path to an ID using the supplied Pairtree path . |
18,613 | public static String mapToID ( final String aPtPath ) throws InvalidPathException { final String encapsulatingDir = getEncapsulatingDir ( aPtPath ) ; String id = aPtPath ; if ( id . endsWith ( Character . toString ( mySeparator ) ) ) { id = id . substring ( 0 , id . length ( ) - 1 ) ; } if ( encapsulatingDir != null ) { id = id . substring ( 0 , id . length ( ) - encapsulatingDir . length ( ) ) ; } id = id . replace ( Character . toString ( mySeparator ) , "" ) ; id = decodeID ( id ) ; return id ; } | Maps the supplied base path to an ID . |
18,614 | public static String getEncapsulatingDir ( final String aBasePath , final String aPtPath ) throws InvalidPathException { return getEncapsulatingDir ( removeBasePath ( aBasePath , aPtPath ) ) ; } | Extracts the encapsulating directory from the supplied Pairtree path using the supplied base path . |
18,615 | public static String getEncapsulatingDir ( final String aPtPath ) throws InvalidPathException { Objects . requireNonNull ( aPtPath , LOGGER . getMessage ( MessageCodes . PT_003 ) ) ; final String [ ] pPathParts = aPtPath . split ( "\\" + mySeparator ) ; if ( pPathParts . length == SINGLE_PART ) { if ( pPathParts [ 0 ] . length ( ) <= myShortyLength ) { return null ; } else { throw new InvalidPathException ( MessageCodes . PT_001 , aPtPath ) ; } } for ( int index = 0 ; index < pPathParts . length - 2 ; index ++ ) { if ( pPathParts [ index ] . length ( ) != myShortyLength ) { throw new InvalidPathException ( MessageCodes . PT_002 , myShortyLength , pPathParts [ index ] . length ( ) , aPtPath ) ; } } final String nextToLastPart = pPathParts [ pPathParts . length - 2 ] ; if ( nextToLastPart . length ( ) > myShortyLength ) { throw new InvalidPathException ( MessageCodes . PT_005 , aPtPath ) ; } String lastPart = pPathParts [ pPathParts . length - 1 ] ; if ( nextToLastPart . length ( ) == myShortyLength ) { if ( lastPart . length ( ) > myShortyLength ) { lastPart = decodeID ( lastPart ) ; } else { lastPart = null ; } } return lastPart == null ? null : decodeID ( lastPart ) ; } | Extracts the encapsulating directory from the supplied Pairtree path . |
18,616 | private static String concat ( final String ... aPathsVarargs ) { final String path ; Objects . requireNonNull ( aPathsVarargs ) ; if ( aPathsVarargs . length == 0 ) { path = "" ; } else { final StringBuffer pathBuf = new StringBuffer ( ) ; Character lastChar = null ; for ( final String aPathsVararg : aPathsVarargs ) { if ( aPathsVararg != null ) { final int length ; if ( lastChar != null && ! mySeparator . equals ( lastChar ) ) { pathBuf . append ( mySeparator ) ; } pathBuf . append ( aPathsVararg ) ; length = aPathsVararg . length ( ) ; lastChar = aPathsVararg . charAt ( length - 1 ) ; } } path = pathBuf . toString ( ) ; } return path ; } | Concatenates the Pairtree paths varargs . |
18,617 | public static String removePrefix ( final String aPrefix , final String aID ) { Objects . requireNonNull ( aPrefix , LOGGER . getMessage ( MessageCodes . PT_006 ) ) ; Objects . requireNonNull ( aID , LOGGER . getMessage ( MessageCodes . PT_004 ) ) ; final String id ; if ( aID . indexOf ( aPrefix ) == 0 ) { id = aID . substring ( aPrefix . length ( ) ) ; } else { id = aID ; } return id ; } | Removes the supplied Pairtree prefix from the supplied ID . |
18,618 | public static String removeBasePath ( final String aBasePath , final String aPtPath ) { Objects . requireNonNull ( aBasePath , LOGGER . getMessage ( MessageCodes . PT_007 ) ) ; Objects . requireNonNull ( aPtPath , LOGGER . getMessage ( MessageCodes . PT_003 ) ) ; String newPath = aPtPath ; if ( aPtPath . startsWith ( aBasePath ) ) { newPath = newPath . substring ( aBasePath . length ( ) ) ; if ( newPath . startsWith ( Character . toString ( mySeparator ) ) ) { newPath = newPath . substring ( 1 ) ; } } return newPath ; } | Removes the base path from the supplied Pairtree path . |
18,619 | @ SuppressWarnings ( "checkstyle:BooleanExpressionComplexity" ) public static String encodeID ( final String aID ) { Objects . requireNonNull ( aID , LOGGER . getMessage ( MessageCodes . PT_004 ) ) ; final byte [ ] bytes ; try { bytes = aID . getBytes ( "utf-8" ) ; } catch ( final UnsupportedEncodingException details ) { throw new PairtreeRuntimeException ( MessageCodes . PT_008 , details ) ; } final StringBuffer idBuffer = new StringBuffer ( ) ; for ( final byte b : bytes ) { final int i = b & 0xff ; if ( i < 0x21 || i > 0x7e || i == 0x22 || i == 0x2a || i == 0x2b || i == 0x2c || i == 0x3c || i == 0x3d || i == 0x3e || i == 0x3f || i == 0x5c || i == 0x5e || i == 0x7c ) { idBuffer . append ( HEX_INDICATOR ) ; idBuffer . append ( Integer . toHexString ( i ) ) ; } else { final char [ ] chars = Character . toChars ( i ) ; assert chars . length == 1 ; idBuffer . append ( chars [ 0 ] ) ; } } for ( int index = 0 ; index < idBuffer . length ( ) ; index ++ ) { final char character = idBuffer . charAt ( index ) ; if ( character == PATH_SEP ) { idBuffer . setCharAt ( index , EQUALS_SIGN ) ; } else if ( character == COLON ) { idBuffer . setCharAt ( index , PLUS_SIGN ) ; } else if ( character == PERIOD ) { idBuffer . setCharAt ( index , COMMA ) ; } } return idBuffer . toString ( ) ; } | Cleans an ID for use in a Pairtree path . |
18,620 | public static String decodeID ( final String aID ) { Objects . requireNonNull ( aID , LOGGER . getMessage ( MessageCodes . PT_004 ) ) ; final StringBuilder idBuf = new StringBuilder ( ) ; for ( int index = 0 ; index < aID . length ( ) ; index ++ ) { final char character = aID . charAt ( index ) ; if ( character == EQUALS_SIGN ) { idBuf . append ( PATH_SEP ) ; } else if ( character == PLUS_SIGN ) { idBuf . append ( COLON ) ; } else if ( character == COMMA ) { idBuf . append ( PERIOD ) ; } else if ( character == HEX_INDICATOR ) { final String hex = aID . substring ( index + 1 , index + 3 ) ; final char [ ] chars = Character . toChars ( Integer . parseInt ( hex , 16 ) ) ; assert chars . length == 1 ; idBuf . append ( chars [ 0 ] ) ; index = index + 2 ; } else { idBuf . append ( character ) ; } } return idBuf . toString ( ) ; } | Unclean the ID from the Pairtree path . |
18,621 | private final void reset ( ) { backtrackStack . clear ( ) ; actionStack . clear ( ) ; stateStack . clear ( ) ; parserErrors . clear ( ) ; streamPosition = 0 ; stepCounter = 0 ; stateStack . push ( 0 ) ; maxPosition = 0 ; shiftIgnoredTokens ( ) ; } | This method is called just before running the parser to reset all internal values and to clean all stacks . |
18,622 | private final void shiftIgnoredTokens ( ) { if ( streamPosition == getTokenStream ( ) . size ( ) ) { return ; } Token token = getTokenStream ( ) . get ( streamPosition ) ; while ( token . getVisibility ( ) == Visibility . IGNORED ) { streamPosition ++ ; if ( streamPosition == getTokenStream ( ) . size ( ) ) { break ; } token = getTokenStream ( ) . get ( streamPosition ) ; } } | This method treats all ignored tokens during a shift . The ignored tokens are just skipped by moving the stream position variable forward . |
18,623 | private final ParseTreeNode parse ( ) throws ParserException { try { createActionStack ( ) ; return LRTokenStreamConverter . convert ( getTokenStream ( ) , getGrammar ( ) , actionStack ) ; } catch ( GrammarException e ) { logger . error ( e . getMessage ( ) , e ) ; throw new ParserException ( e . getMessage ( ) ) ; } } | This method does the actual parsing . |
18,624 | private void checkTimeout ( ) throws ParserException { if ( timeout > 0 ) { if ( System . currentTimeMillis ( ) - startTime > timeout * 1000 ) { throw new ParserException ( "Timeout after " + timeout + " seconds near '" + getTokenStream ( ) . getCodeSample ( maxPosition ) + "'!" ) ; } } } | This method checks for the timeout . If the time ran out an ParserException is thrown and the parser process is finished . |
18,625 | private final ParserAction getAction ( ParserActionSet actionSet ) throws GrammarException { if ( actionSet . getActionNumber ( ) == 1 ) { return actionSet . getAction ( ) ; } if ( ! backtrackEnabled ) { logger . trace ( "Action set '" + actionSet + "' is ambiguous and back tracking is disabled!" ) ; throw new GrammarException ( "Grammar is ambiguous!" ) ; } if ( ( ! backtrackStack . isEmpty ( ) ) && ( backtrackStack . peek ( ) . getStepCounter ( ) == stepCounter ) ) { if ( logger . isTraceEnabled ( ) ) { logger . trace ( "Action set '" + actionSet + "' is ambiguous and back tracking was performed already. Trying new alternative..." ) ; } BacktrackLocation location = backtrackStack . pop ( ) ; int stepAhead = 1 ; if ( location . getLastAlternative ( ) + stepAhead >= actionSet . getActionNumber ( ) ) { logger . trace ( "No alternative left. Abort." ) ; return new ParserAction ( ActionType . ERROR , - 1 ) ; } addBacktrackLocation ( location . getLastAlternative ( ) + stepAhead ) ; return actionSet . getAction ( location . getLastAlternative ( ) + stepAhead ) ; } if ( logger . isTraceEnabled ( ) ) { logger . trace ( "Action set '" + actionSet + "' is ambiguous. Installing back tracking location in stack..." ) ; } addBacktrackLocation ( 0 ) ; return actionSet . getAction ( 0 ) ; } | This mehtod returns the currently to be processed action . This method also takes care for ambiguous grammars and backtracking . |
18,626 | @ SuppressWarnings ( "unchecked" ) private final void addBacktrackLocation ( int usedAlternative ) { backtrackStack . push ( new BacktrackLocation ( ( Stack < Integer > ) stateStack . clone ( ) , actionStack . size ( ) , streamPosition , stepCounter , usedAlternative ) ) ; if ( backtrackDepth > 0 ) { while ( backtrackStack . size ( ) > backtrackDepth ) { backtrackStack . remove ( 0 ) ; } } } | This method adds the backtracking information for the current step . |
18,627 | private final void shift ( ParserAction action ) { stateStack . push ( action . getParameter ( ) ) ; actionStack . add ( action ) ; streamPosition ++ ; shiftIgnoredTokens ( ) ; } | This method is called for shift actions . |
18,628 | private final void reduce ( ParserAction action ) throws ParserException { try { Production production = getGrammar ( ) . getProduction ( action . getParameter ( ) ) ; for ( int i = 0 ; i < production . getConstructions ( ) . size ( ) ; i ++ ) { stateStack . pop ( ) ; } actionStack . add ( action ) ; ParserAction gotoAction = parserTable . getAction ( stateStack . peek ( ) , new NonTerminal ( production . getName ( ) ) ) ; if ( gotoAction . getAction ( ) == ActionType . ERROR ) { error ( ) ; return ; } stateStack . push ( gotoAction . getParameter ( ) ) ; } catch ( GrammarException e ) { logger . error ( e . getMessage ( ) , e ) ; throw new ParserException ( e . getMessage ( ) ) ; } } | This method is called for reduce actions . |
18,629 | private final void error ( ) throws ParserException { Integer currentState = stateStack . peek ( ) ; parserErrors . addError ( currentState ) ; if ( backtrackEnabled && ! backtrackStack . isEmpty ( ) ) { trackBack ( ) ; return ; } if ( ! backtrackEnabled ) { logger . trace ( "No valid action available and back tracking is disabled. Aborting near '" + getTokenStream ( ) . getCodeSample ( maxPosition ) + "'..." ) ; } else { logger . trace ( "No valid action available and back tracking stack is empty. Aborting near '" + getTokenStream ( ) . getCodeSample ( maxPosition ) + "'..." ) ; } throw new ParserException ( "Error! Could not parse the token stream near '" + getTokenStream ( ) . getCodeSample ( maxPosition ) + "'!" ) ; } | This method is called for an error action . |
18,630 | private final void trackBack ( ) { logger . trace ( "No valid action available. Perform back tracking..." ) ; BacktrackLocation backtrackLocation = backtrackStack . peek ( ) ; streamPosition = backtrackLocation . getStreamPosition ( ) ; stepCounter = backtrackLocation . getStepCounter ( ) ; while ( actionStack . size ( ) > backtrackLocation . getActionStackSize ( ) ) { actionStack . remove ( actionStack . size ( ) - 1 ) ; } stateStack = backtrackLocation . getStateStack ( ) ; stepCounter -- ; } | This method perform the back tracking by popping all relevant information from the stacks . |
18,631 | private ServiceDirectoryCache < String , ModelService > getCache ( ) { if ( cache == null ) { synchronized ( this ) { if ( this . cache == null ) { this . cache = new ServiceDirectoryCache < String , ModelService > ( ) ; } } } return this . cache ; } | Get the ServiceDirectoryCache that caches Services it is lazy initialized . |
18,632 | public Token getNextToken ( ) { if ( nextToken == null ) { try { if ( ! lex ( ) ) { throw new NoSuchElementException ( ) ; } } catch ( IOException e ) { errorMessage = e . getMessage ( ) ; hasErrors_ = true ; throw new NoSuchElementException ( ) ; } } return nextToken ; } | Returns the next token without consuming it . |
18,633 | public String getStateAsString ( ) { Integer state = getState ( ) ; if ( STOPPED . equals ( state ) ) { return "Stopped" ; } if ( STARTING . equals ( state ) ) { return "Starting" ; } if ( RUNNING . equals ( state ) ) { return "Running" ; } if ( STOPPING . equals ( state ) ) { return "Stopping" ; } throw new IllegalStateException ( "Unknown state: " + state ) ; } | Get the name of current state |
18,634 | public ObjectSchema withProperty ( PropertySchema schema ) { _properties = _properties != null ? _properties : new ArrayList < PropertySchema > ( ) ; _properties . add ( schema ) ; return this ; } | Adds a validation schema for an object property . |
18,635 | public ObjectSchema withRequiredProperty ( String name , Object type , IValidationRule ... rules ) { _properties = _properties != null ? _properties : new ArrayList < PropertySchema > ( ) ; PropertySchema schema = new PropertySchema ( name , type ) ; schema . setRules ( Arrays . asList ( rules ) ) ; schema . makeRequired ( ) ; return withProperty ( schema ) ; } | Adds a validation schema for a required object property . |
18,636 | public void createSampleDatas ( ) throws NamingException { final Context ctx = new InitialContext ( ) ; final BeanManager beanManager = ( BeanManager ) ctx . lookup ( "java:comp/env/BeanManager" ) ; final EntityManagerFactory entityManagerFactory = BeanManagerUtils . getOrCreateInstance ( beanManager , EntityManagerFactory . class ) ; final EntityManager entityManager = entityManagerFactory . createEntityManager ( ) ; entityManager . getTransaction ( ) . begin ( ) ; entityManager . createQuery ( "delete from User" ) . executeUpdate ( ) ; entityManager . createQuery ( "delete from Profile" ) . executeUpdate ( ) ; final Profile adminProfile = new Profile ( "Administrator" , "admin" ) ; entityManager . persist ( adminProfile ) ; final Profile userProfile = new Profile ( "User" , "user" ) ; entityManager . persist ( userProfile ) ; entityManager . persist ( new User ( "user" , UserService . digestPassword ( "user" , "user" ) , "User" , "user" , userProfile ) ) ; entityManager . persist ( new User ( "admin" , UserService . digestPassword ( "admin" , "admin" ) , "Admin" , "admin" , adminProfile ) ) ; for ( int i = 1 ; i <= MAX_ORDER ; i ++ ) { final Profile profile = new Profile ( "User" + i , "user" + i ) ; entityManager . persist ( profile ) ; for ( int j = 1 ; j <= MAX_ORDER ; j ++ ) { final int id = i * MAX_ORDER + j ; entityManager . persist ( new User ( "user" + id , UserService . digestPassword ( "user" + id , "user" + id ) , "User" + id , "user" + id , profile ) ) ; } } entityManager . getTransaction ( ) . commit ( ) ; } | private UserService userService ; |
18,637 | public static void setSystemPropertyIfIsNull ( String key , Object value ) { if ( ! System . getProperties ( ) . containsKey ( key ) ) System . setProperty ( key , value . toString ( ) ) ; } | Sets system property if is null . |
18,638 | public static URL getURL ( String classpathOrFilePath ) { try { return getURI ( classpathOrFilePath ) . toURL ( ) ; } catch ( MalformedURLException e ) { return JMExceptionManager . handleExceptionAndReturnNull ( log , e , "getURL" , classpathOrFilePath ) ; } } | Gets url . |
18,639 | public static URI getResourceURI ( String classpath ) { try { return getResourceURL ( classpath ) . toURI ( ) ; } catch ( Exception e ) { return JMExceptionManager . handleExceptionAndReturnNull ( log , e , "getResourceURI" , classpath ) ; } } | Gets resource uri . |
18,640 | public static URI getURI ( String classpathOrFilePath ) { return Optional . ofNullable ( getResourceURI ( classpathOrFilePath ) ) . orElseGet ( ( ) -> new File ( classpathOrFilePath ) . toURI ( ) ) ; } | Gets uri . |
18,641 | public static boolean saveProperties ( Properties inProperties , File saveFile , String comment ) { try { if ( ! saveFile . exists ( ) ) JMFiles . createEmptyFile ( saveFile ) ; BufferedWriter writer = new BufferedWriter ( new FileWriter ( saveFile ) ) ; inProperties . store ( writer , comment ) ; writer . close ( ) ; return true ; } catch ( IOException e ) { return JMExceptionManager . handleExceptionAndReturnFalse ( log , e , "saveProperties" , inProperties , saveFile , comment ) ; } } | Save properties boolean . |
18,642 | public static String readStringForZip ( String zipFilePathOrClasspath , String entryName , String charsetName ) { return JMInputStream . toString ( getResourceInputStreamForZip ( zipFilePathOrClasspath , entryName ) , charsetName ) ; } | Read string for zip string . |
18,643 | public static List < String > readLinesForZip ( String zipFilePathOrClasspath , String entryName ) { return JMInputStream . readLines ( getResourceInputStreamForZip ( zipFilePathOrClasspath , entryName ) ) ; } | Read lines for zip list . |
18,644 | public static String getStringWithClasspathOrFilePath ( String classpathOrFilePath , String charsetName ) { return getStringAsOptWithClasspath ( classpathOrFilePath , charsetName ) . orElseGet ( ( ) -> getStringAsOptWithFilePath ( classpathOrFilePath , charsetName ) . orElse ( null ) ) ; } | Gets string with classpath or file path . |
18,645 | public static List < String > readLinesWithClasspathOrFilePath ( String classpathOrFilePath ) { return getStringListAsOptWithClasspath ( classpathOrFilePath ) . filter ( JMPredicate . getGreaterSize ( 0 ) ) . orElseGet ( ( ) -> JMFiles . readLines ( classpathOrFilePath ) ) ; } | Read lines with classpath or file path list . |
18,646 | public static Optional < List < String > > getStringListAsOptWithClasspath ( String classpathOrFilePath ) { return getResourceInputStreamAsOpt ( classpathOrFilePath ) . map ( JMInputStream :: readLines ) ; } | Gets string list as opt with classpath . |
18,647 | public static List < String > readLinesWithFilePathOrClasspath ( String filePathOrClasspath ) { return JMOptional . getOptional ( JMFiles . readLines ( filePathOrClasspath ) ) . orElseGet ( ( ) -> getStringListAsOptWithClasspath ( filePathOrClasspath ) . orElseGet ( Collections :: emptyList ) ) ; } | Read lines with file path or classpath list . |
18,648 | public static String getStringWithFilePathOrClasspath ( String filePathOrClasspath , String charsetName ) { return getStringAsOptWithFilePath ( filePathOrClasspath , charsetName ) . orElseGet ( ( ) -> getStringAsOptWithClasspath ( filePathOrClasspath , charsetName ) . orElse ( null ) ) ; } | Gets string with file path or classpath . |
18,649 | public static Optional < String > getStringAsOptWithFilePath ( String filePath , String charsetName ) { return JMOptional . getOptional ( JMFiles . readString ( filePath , charsetName ) ) ; } | Gets string as opt with file path . |
18,650 | public static Optional < String > getStringAsOptWithClasspath ( String classpath , String charsetName ) { return getResourceInputStreamAsOpt ( classpath ) . map ( resourceInputStream -> JMInputStream . toString ( resourceInputStream , charsetName ) ) ; } | Gets string as opt with classpath . |
18,651 | public static ResourceBundle getResourceBundle ( String baseName , Locale targetLocale ) { Locale . setDefault ( targetLocale ) ; return ResourceBundle . getBundle ( baseName ) ; } | Gets resource bundle . |
18,652 | public int getSourceLineNumberForOffset ( final int offset ) { int lineNumber = - 1 ; lineNumber = 0 ; for ( ; lineNumber < this . lineStartOffsets . length - 1 ; lineNumber ++ ) { if ( this . lineStartOffsets [ lineNumber + 1 ] > offset ) { break ; } } if ( offset > lineStartOffsets [ lineStartOffsets . length - 1 ] ) { lineNumber = lineStartOffsets . length - 1 ; } return lineNumber + 1 ; } | 1st character of the line it was usually returning the following line |
18,653 | public void addChild ( Command cmd ) { if ( cmd != null ) { cmd . setContext ( this ) ; commands . add ( cmd ) ; } } | add child command |
18,654 | public void removeChild ( Command cmd ) { if ( ( cmd != null ) && commands . remove ( cmd ) ) { cmd . setContext ( null ) ; } } | remove child command |
18,655 | private boolean isResolved ( ) { if ( getStatus ( ) < Command . CHILDREN_PROCESSED ) { return false ; } for ( int i = 0 ; i < arguments . size ( ) ; ++ i ) { Command arg = arguments . elementAt ( i ) ; if ( ! arg . isResolved ( ) ) { return false ; } } for ( int j = 0 ; j < operations . size ( ) ; ++ j ) { Command opr = operations . elementAt ( j ) ; if ( ! opr . isResolved ( ) ) { return false ; } } return true ; } | check if one of arguments or operations is unresolved |
18,656 | public int exec ( Map < String , Command > references ) throws Exception { if ( status < Command . CHILDREN_PROCESSED ) { if ( status < Command . COMMAND_EXECUTED ) { if ( status < Command . CHILDREN_FILTERED ) { status = doBeforeRun ( references ) ; } if ( status == Command . CHILDREN_FILTERED ) { status = doRun ( references ) ; } } if ( status == Command . COMMAND_EXECUTED ) { status = doAfterRun ( references ) ; } } return status ; } | execute command and return execution flags |
18,657 | public boolean backtrack ( Map < String , Command > references ) throws Exception { for ( int i = 0 ; i < arguments . size ( ) ; ++ i ) { Command arg = arguments . elementAt ( i ) ; arg . backtrack ( references ) ; } for ( int i = 0 ; i < operations . size ( ) ; ++ i ) { Command opr = operations . elementAt ( i ) ; opr . backtrack ( references ) ; } if ( status == Command . CHILDREN_FILTERED ) { status = doRun ( references ) ; } if ( status == Command . COMMAND_EXECUTED ) { status = doAfterRun ( references ) ; return ( getStatus ( ) == Command . CHILDREN_PROCESSED ) ; } return false ; } | execute commands in backtrack order |
18,658 | private int doBeforeRun ( Map < String , Command > references ) throws Exception { if ( status == Command . INITIALIZED ) { for ( int i = 0 ; i < commands . size ( ) ; ++ i ) { Command cmd = commands . elementAt ( i ) ; if ( cmd . isExecutable ( ) ) { arguments . add ( cmd ) ; } else { operations . add ( cmd ) ; } } return Command . CHILDREN_FILTERED ; } return status ; } | put command in one of two collections - arguments or operations |
18,659 | private int doAfterRun ( Map < String , Command > references ) throws Exception { if ( status == Command . COMMAND_EXECUTED ) { Vector < Command > toBeRemoved = new Vector < Command > ( ) ; try { Statement [ ] statements = null ; for ( int i = 0 ; i < operations . size ( ) ; ++ i ) { Command cmd = operations . elementAt ( i ) ; if ( cmd . isArrayElement ( ) ) { if ( cmd . isResolved ( ) ) { if ( statements == null ) { statements = new Statement [ operations . size ( ) ] ; } statements [ i ] = new Statement ( getResultValue ( ) , "set" , new Object [ ] { Integer . valueOf ( i ) , cmd . getResultValue ( ) } ) ; if ( ( i + 1 ) == operations . size ( ) ) { for ( int j = 0 ; j < operations . size ( ) ; ++ j ) { statements [ j ] . execute ( ) ; } toBeRemoved . addAll ( operations ) ; } } else { break ; } } else { if ( ! isArray ( ) ) { cmd . setTarget ( getResultValue ( ) ) ; } cmd . exec ( references ) ; if ( cmd . isResolved ( ) ) { toBeRemoved . add ( cmd ) ; } else { break ; } } } } catch ( Exception e ) { throw new Exception ( e ) ; } finally { operations . removeAll ( toBeRemoved ) ; } return ( operations . size ( ) == 0 ) ? Command . CHILDREN_PROCESSED : status ; } return status ; } | run child commands |
18,660 | public boolean isExecutable ( ) { boolean result = isTag ( "object" ) || isTag ( "void" ) && hasAttr ( "class" ) && hasAttr ( "method" ) || isTag ( "array" ) || isPrimitive ( ) || isTag ( "class" ) || isTag ( "null" ) ; return result ; } | Checks if the command could generate object |
18,661 | private Object getTarget ( Map < String , Command > references ) throws Exception { if ( target == null ) { if ( isReference ( ) ) { Command cmd = references . get ( getAttr ( "idref" ) ) ; target = ( cmd != null ) ? cmd . getResultValue ( ) : null ; } else if ( isExecutable ( ) ) { String className = null ; if ( isPrimitive ( ) ) { className = getPrimitiveClassName ( tagName ) ; } else if ( isTag ( "class" ) ) { className = getPrimitiveClassName ( tagName ) ; } else if ( isConstructor ( ) || isStaticMethod ( ) || isField ( ) ) { className = getAttr ( "class" ) ; } else if ( isArray ( ) ) { className = getAttr ( "class" ) ; Class < ? > componentType = isPrimitiveClassName ( className ) ? getPrimitiveClass ( className ) : Class . forName ( className , true , Thread . currentThread ( ) . getContextClassLoader ( ) ) ; className = Array . newInstance ( componentType , 0 ) . getClass ( ) . getName ( ) ; } if ( className != null ) { try { target = Class . forName ( className , true , Thread . currentThread ( ) . getContextClassLoader ( ) ) ; } catch ( ClassNotFoundException e ) { target = Class . forName ( className ) ; } if ( isField ( ) ) { String fieldName = getAttr ( "field" ) ; target = ( ( Class < ? > ) target ) . getField ( fieldName ) ; } } else { throw new Exception ( Messages . getString ( "beans.42" , className ) ) ; } } else if ( ctx . isArray ( ) ) { target = Class . forName ( "java.lang.reflect.Array" ) ; } } return target ; } | get a target through tag and attrs analysis |
18,662 | private Argument [ ] getArguments ( ) { Argument [ ] args = new Argument [ auxArguments . size ( ) + arguments . size ( ) ] ; for ( int i = 0 ; i < auxArguments . size ( ) ; ++ i ) { args [ i ] = auxArguments . elementAt ( i ) ; } for ( int j = 0 ; j < arguments . size ( ) ; ++ j ) { Command cmd = arguments . elementAt ( j ) ; if ( cmd . getStatus ( ) >= Command . COMMAND_EXECUTED ) { args [ auxArguments . size ( ) + j ] = cmd . getResult ( ) ; } else { args = null ; break ; } } return args ; } | return a list of arguments as of Argument type |
18,663 | private Object [ ] getArgumentsValues ( ) { Argument [ ] args = getArguments ( ) ; Object [ ] result = new Object [ args . length ] ; for ( int i = 0 ; i < args . length ; ++ i ) { result [ i ] = args [ i ] . getValue ( ) ; } return result ; } | return argument values |
18,664 | private void copyArgumentsToCommands ( ) { Iterator < Command > i = arguments . iterator ( ) ; while ( i . hasNext ( ) ) { Command cmd = i . next ( ) ; cmd . status = Command . CHILDREN_FILTERED ; operations . add ( cmd ) ; } arguments . clear ( ) ; } | copy arguments to treat as commands |
18,665 | public static boolean isPrimitiveClassName ( String className ) { return className . equalsIgnoreCase ( "boolean" ) || className . equalsIgnoreCase ( "byte" ) || className . equalsIgnoreCase ( "char" ) || className . equalsIgnoreCase ( "short" ) || className . equalsIgnoreCase ( "int" ) || className . equalsIgnoreCase ( "long" ) || className . equalsIgnoreCase ( "float" ) || className . equalsIgnoreCase ( "double" ) || className . equalsIgnoreCase ( "string" ) ; } | Check if the name of class is primitive |
18,666 | private String getPrimitiveClassName ( String data ) { String shortClassName = null ; if ( data . equals ( "int" ) ) { shortClassName = "Integer" ; } else if ( data . equals ( "char" ) ) { shortClassName = "Character" ; } else { shortClassName = data . substring ( 0 , 1 ) . toUpperCase ( ) + data . substring ( 1 , data . length ( ) ) ; } return "java.lang." + shortClassName ; } | Transforms a primitive class name |
18,667 | public static long toLongWithDefault ( Object value , long defaultValue ) { Long result = toNullableLong ( value ) ; return result != null ? ( long ) result : defaultValue ; } | Converts value into integer or returns default when conversion is not possible . |
18,668 | public Char read ( ) throws IOException { int cp = in . read ( ) ; if ( cp < 0 ) { return null ; } if ( cp == '\033' ) { if ( ! in . ready ( ) ) { return new Unicode ( cp ) ; } int c2 = in . read ( ) ; if ( c2 < 0 ) { return new Unicode ( cp ) ; } StringBuilder charBuilder = new StringBuilder ( ) ; charBuilder . append ( ( char ) cp ) ; charBuilder . append ( ( char ) c2 ) ; if ( c2 == '\033' ) { return new Unicode ( cp ) ; } else if ( c2 == '[' ) { char c3 = expect ( ) ; charBuilder . append ( c3 ) ; if ( 'A' <= c3 && c3 <= 'Z' ) { return new Control ( charBuilder . toString ( ) ) ; } while ( ( '0' <= c3 && c3 <= '9' ) || c3 == ';' ) { c3 = expect ( ) ; charBuilder . append ( c3 ) ; } if ( c3 == '~' || ( 'a' <= c3 && c3 <= 'z' ) || ( 'A' <= c3 && c3 <= 'Z' ) ) { if ( c3 == 'm' ) { try { return new Color ( charBuilder . toString ( ) ) ; } catch ( IllegalArgumentException e ) { throw new IOException ( e . getMessage ( ) , e ) ; } } return new Control ( charBuilder . toString ( ) ) ; } } else if ( c2 == 'O' ) { char c3 = expect ( ) ; charBuilder . append ( c3 ) ; if ( 'A' <= c3 && c3 <= 'Z' ) { return new Control ( charBuilder . toString ( ) ) ; } } else if ( ( 'a' <= c2 && c2 <= 'z' ) || ( '0' <= c2 && c2 <= '9' ) || ( 'A' <= c2 && c2 <= 'Z' ) ) { return new Control ( charBuilder . toString ( ) ) ; } throw new IOException ( "Invalid escape sequence: \"" + Strings . escape ( charBuilder . toString ( ) ) + "\"" ) ; } else { if ( Character . isHighSurrogate ( ( char ) cp ) ) { cp = Character . toCodePoint ( ( char ) cp , expect ( ) ) ; } return new Unicode ( cp ) ; } } | Read the next char . |
18,669 | protected void reset ( ) { writer . flush ( ) ; stack . clear ( ) ; context = new JsonContext ( JsonContext . Mode . VALUE ) ; } | Reset the state of the writer and flush already written content . |
18,670 | public JsonWriter object ( ) { startValue ( ) ; stack . push ( context ) ; context = new JsonContext ( JsonContext . Mode . MAP ) ; writer . write ( '{' ) ; return this ; } | Start an object value . |
18,671 | public JsonWriter array ( ) { startValue ( ) ; stack . push ( context ) ; context = new JsonContext ( JsonContext . Mode . LIST ) ; writer . write ( '[' ) ; return this ; } | Start an array value . |
18,672 | public JsonWriter endObject ( ) { if ( ! context . map ( ) ) { throw new IllegalStateException ( "Unexpected end, not in object." ) ; } if ( context . value ( ) ) { throw new IllegalStateException ( "Expected map value but got end." ) ; } writer . write ( '}' ) ; context = stack . pop ( ) ; return this ; } | The the ongoing object . |
18,673 | public JsonWriter endArray ( ) { if ( ! context . list ( ) ) { throw new IllegalStateException ( "Unexpected end, not in list." ) ; } writer . write ( ']' ) ; context = stack . pop ( ) ; return this ; } | End the ongoing array . |
18,674 | public JsonWriter key ( int key ) { startKey ( ) ; writer . write ( '\"' ) ; writer . print ( key ) ; writer . write ( '\"' ) ; writer . write ( ':' ) ; return this ; } | Write the int as object key . |
18,675 | public JsonWriter key ( double key ) { startKey ( ) ; writer . write ( '\"' ) ; final long i = ( long ) key ; if ( key == ( double ) i ) { writer . print ( i ) ; } else { writer . print ( key ) ; } writer . write ( '\"' ) ; writer . write ( ':' ) ; return this ; } | Write the double as object key . |
18,676 | public JsonWriter key ( CharSequence key ) { startKey ( ) ; if ( key == null ) { throw new IllegalArgumentException ( "Expected map key, but got null." ) ; } writeQuotedAndEscaped ( key ) ; writer . write ( ':' ) ; return this ; } | Write the string as object key . |
18,677 | public JsonWriter keyUnescaped ( CharSequence key ) { startKey ( ) ; if ( key == null ) { throw new IllegalArgumentException ( "Expected map key, but got null." ) ; } writer . write ( '\"' ) ; writer . write ( key . toString ( ) ) ; writer . write ( '\"' ) ; writer . write ( ':' ) ; return this ; } | Write the string as object key without escaping . |
18,678 | public JsonWriter key ( Binary key ) { startKey ( ) ; if ( key == null ) { throw new IllegalArgumentException ( "Expected map key, but got null." ) ; } writer . write ( '\"' ) ; writer . write ( key . toBase64 ( ) ) ; writer . write ( '\"' ) ; writer . write ( ':' ) ; return this ; } | Write the binary as object key . |
18,679 | public JsonWriter keyLiteral ( CharSequence key ) { startKey ( ) ; if ( key == null ) { throw new IllegalArgumentException ( "Expected map key, but got null." ) ; } writer . write ( key . toString ( ) ) ; writer . write ( ':' ) ; return this ; } | Write the string key without quoting or escaping . |
18,680 | public JsonWriter value ( double value ) { startValue ( ) ; final long i = ( long ) value ; if ( value == ( double ) i ) { writer . print ( i ) ; } else { writer . print ( value ) ; } return this ; } | Write double value . |
18,681 | public JsonWriter value ( CharSequence value ) { startValue ( ) ; if ( value == null ) { writer . write ( kNull ) ; } else { writeQuotedAndEscaped ( value ) ; } return this ; } | Write unicode string value . |
18,682 | public JsonWriter valueUnescaped ( CharSequence value ) { startValue ( ) ; if ( value == null ) { writer . write ( kNull ) ; } else { writer . write ( '\"' ) ; writer . write ( value . toString ( ) ) ; writer . write ( '\"' ) ; } return this ; } | Write a string unescaped value . |
18,683 | public JsonWriter value ( Binary value ) { startValue ( ) ; if ( value == null ) { writer . write ( kNull ) ; } else { writer . write ( '\"' ) ; writer . write ( value . toBase64 ( ) ) ; writer . write ( '\"' ) ; } return this ; } | Write binary value . |
18,684 | public JsonWriter valueLiteral ( CharSequence value ) { startValue ( ) ; if ( value == null ) { writer . write ( kNull ) ; } else { writer . write ( value . toString ( ) ) ; } return this ; } | Write a literal string as value . Not quoted and not escaped . |
18,685 | private void writeQuotedAndEscaped ( CharSequence string ) { if ( string != null && string . length ( ) != 0 ) { int len = string . length ( ) ; writer . write ( '\"' ) ; for ( int i = 0 ; i < len ; ++ i ) { char cp = string . charAt ( i ) ; if ( ( cp < 0x7f && cp >= 0x20 && cp != '\"' && cp != '\\' ) || ( cp > 0x7f && isConsolePrintable ( cp ) && ! isSurrogate ( cp ) ) ) { writer . write ( cp ) ; } else { switch ( cp ) { case '\b' : writer . write ( "\\b" ) ; break ; case '\t' : writer . write ( "\\t" ) ; break ; case '\n' : writer . write ( "\\n" ) ; break ; case '\f' : writer . write ( "\\f" ) ; break ; case '\r' : writer . write ( "\\r" ) ; break ; case '\"' : case '\\' : writer . write ( '\\' ) ; writer . write ( cp ) ; break ; default : if ( isSurrogate ( cp ) && ( i + 1 ) < len ) { char c2 = string . charAt ( i + 1 ) ; writer . format ( "\\u%04x" , ( int ) cp ) ; writer . format ( "\\u%04x" , ( int ) c2 ) ; ++ i ; } else { writer . format ( "\\u%04x" , ( int ) cp ) ; } break ; } } } writer . write ( '\"' ) ; } else { writer . write ( "\"\"" ) ; } } | Ported from org . json JSONObject . quote and modified for local use . |
18,686 | @ Requires ( "modifier != null" ) @ Ensures ( "getModifiers().contains(modifier)" ) public void addModifier ( ElementModifier modifier ) { switch ( modifier ) { case PRIVATE : case PACKAGE_PRIVATE : case PROTECTED : case PUBLIC : modifiers . remove ( ElementModifier . PRIVATE ) ; modifiers . remove ( ElementModifier . PACKAGE_PRIVATE ) ; modifiers . remove ( ElementModifier . PROTECTED ) ; modifiers . remove ( ElementModifier . PUBLIC ) ; } modifiers . add ( modifier ) ; } | Adds a modifier to this element . This method ensures that exactly one visibility modifier is set . |
18,687 | @ Requires ( "modifier != null" ) @ Ensures ( "!getModifiers().contains(modifier)" ) public void removeModifier ( ElementModifier modifier ) { modifiers . remove ( modifier ) ; switch ( modifier ) { case PRIVATE : case PACKAGE_PRIVATE : case PROTECTED : case PUBLIC : modifiers . add ( ElementModifier . PACKAGE_PRIVATE ) ; } } | Removes a modifier from this element . This method ensures that exactly one visibility modifier is set . It defaults to package - private if no other visibility is set . |
18,688 | public Response < R > processResponse ( final int httpResponseCode , final String httpResponseStatusString , final S freesoundResponse ) { final Response < R > response = new Response < > ( httpResponseCode , httpResponseStatusString ) ; if ( response . isErrorResponse ( ) ) { response . setErrorDetails ( extractErrorMessage ( freesoundResponse ) ) ; } else { response . setResults ( resultsMapper . map ( freesoundResponse ) ) ; } return response ; } | Set the raw response received from the HTTP call . Contents are passed on to sub - classes for mapping to DTOs . |
18,689 | public Optional < E > get ( int index ) { return getOptional ( linkedList ) . filter ( getGreaterSize ( 0 ) . and ( getGreaterSize ( index ) ) ) . map ( l -> l . get ( index ) ) ; } | Get optional . |
18,690 | public Optional < E > getPrevious ( ) { return Optional . of ( currentIndex ) . filter ( getGreater ( 0 ) ) . map ( i -> linkedList . get ( -- currentIndex ) ) ; } | Gets previous . |
18,691 | public Optional < E > getNext ( ) { return Optional . of ( currentIndex ) . filter ( getLess ( linkedList . size ( ) - 1 ) ) . map ( i -> linkedList . get ( ++ currentIndex ) ) ; } | Gets next . |
18,692 | @ Requires ( { "elements != null" , "!elements.contains(null)" , "clazz != null" , "kinds != null" } ) @ SuppressWarnings ( "unchecked" ) public static < T extends ElementModel > List < ? extends T > filter ( List < ? extends ElementModel > elements , Class < T > clazz , ElementKind ... kinds ) { ArrayList < T > result = new ArrayList < T > ( ) ; List < ElementKind > list = Arrays . asList ( kinds ) ; for ( ElementModel element : elements ) { if ( list . contains ( element . getKind ( ) ) && clazz . isAssignableFrom ( element . getClass ( ) ) ) { result . add ( ( T ) element ) ; } } return Collections . unmodifiableList ( result ) ; } | Returns the sublist of all elements of the specified kinds . |
18,693 | @ Requires ( { "element != null" , "clazz != null" , "kinds != null" } ) @ SuppressWarnings ( "unchecked" ) public static < T extends ElementModel > T findEnclosingElement ( ElementModel element , Class < T > clazz , ElementKind ... kinds ) { List < ElementKind > list = Arrays . asList ( kinds ) ; for ( ; ; ) { element = element . getEnclosingElement ( ) ; if ( element == null ) { return null ; } if ( list . contains ( element . getKind ( ) ) && clazz . isAssignableFrom ( element . getClass ( ) ) ) { return ( T ) element ; } } } | Returns the closest enclosing element of the specified kind . |
18,694 | @ Requires ( "element != null" ) public static TypeModel getTypeOf ( ElementModel element ) { return findEnclosingElement ( element , TypeModel . class , ElementKind . CLASS , ElementKind . ENUM , ElementKind . INTERFACE ) ; } | Returns the closest enclosing type of the specified element . |
18,695 | @ Requires ( { "name != null" , "!name.isEmpty()" , "kind != null" } ) public static URI getUriForClass ( String name , Kind kind ) { try { return new URI ( "com.google.java.contract://com.google.java.contract/" + name + kind . extension ) ; } catch ( URISyntaxException e ) { throw new IllegalArgumentException ( ) ; } } | Returns a Contracts for Java private URI for the specified class name and kind . |
18,696 | public ServiceRRLoadBalancer getServiceRRLoadBalancer ( String serviceName ) { for ( ServiceRRLoadBalancer lb : svcLBList ) { if ( lb . getServiceName ( ) . equals ( serviceName ) ) { return lb ; } } ServiceRRLoadBalancer lb = new ServiceRRLoadBalancer ( lookupService , serviceName ) ; svcLBList . add ( lb ) ; return lb ; } | Get the ServiceRRLoadBalancer . |
18,697 | public MetadataQueryRRLoadBalancer getMetadataQueryRRLoadBalancer ( ServiceInstanceQuery query ) { for ( MetadataQueryRRLoadBalancer lb : metaQueryLBList ) { if ( lb . getServiceInstanceQuery ( ) . equals ( query ) ) { return lb ; } } MetadataQueryRRLoadBalancer lb = new MetadataQueryRRLoadBalancer ( lookupService , query ) ; metaQueryLBList . add ( lb ) ; return lb ; } | Get the MetadataQueryRRLoadBalancer . |
18,698 | public ServiceQueryRRLoadBalancer getServiceQueryRRLoadBalancer ( String serviceName , ServiceInstanceQuery query ) { for ( ServiceQueryRRLoadBalancer lb : svcQueryLBList ) { if ( lb . getServiceName ( ) . equals ( serviceName ) && lb . getServiceInstanceQuery ( ) . equals ( query ) ) { return lb ; } } ServiceQueryRRLoadBalancer lb = new ServiceQueryRRLoadBalancer ( lookupService , serviceName , query ) ; svcQueryLBList . add ( lb ) ; return lb ; } | Get the ServiceQueryRRLoadBalancer . |
18,699 | protected void onMethodEnter ( ) { if ( withPreconditions || withPostconditions || withInvariants ) { enterContractedMethod ( ) ; if ( withPostconditions ) { allocateOldValues ( ContractKind . OLD , oldValueLocals ) ; allocateOldValues ( ContractKind . SIGNAL_OLD , signalOldValueLocals ) ; } mark ( methodStart ) ; Label skip = enterBusySection ( ) ; if ( withInvariants && ! statik && ! isConstructor && ! isStaticInit ) { invokeInvariants ( ) ; } if ( withPreconditions ) { invokePreconditions ( ) ; } if ( withPostconditions ) { invokeOldValues ( ContractKind . OLD , oldValueLocals ) ; invokeOldValues ( ContractKind . SIGNAL_OLD , signalOldValueLocals ) ; } leaveBusySection ( skip ) ; } } | Advises the method by injecting invariants precondition assertions and old value computations before the original code . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.