idx int64 0 41.2k | question stringlengths 74 4.04k | target stringlengths 7 750 |
|---|---|---|
35,200 | protected void updateActivation ( Activation value , String xmlTag , Counter counter , Element element ) { boolean shouldExist = value != null ; Element root = updateElement ( counter , element , xmlTag , shouldExist ) ; if ( shouldExist ) { Counter innerCount = new Counter ( counter . getDepth ( ) + 1 ) ; findAndRepla... | Method updateActivation . |
35,201 | protected void updateActivationFile ( ActivationFile value , String xmlTag , Counter counter , Element element ) { boolean shouldExist = value != null ; Element root = updateElement ( counter , element , xmlTag , shouldExist ) ; if ( shouldExist ) { Counter innerCount = new Counter ( counter . getDepth ( ) + 1 ) ; find... | Method updateActivationFile . |
35,202 | protected void updateActivationOS ( ActivationOS value , String xmlTag , Counter counter , Element element ) { boolean shouldExist = value != null ; Element root = updateElement ( counter , element , xmlTag , shouldExist ) ; if ( shouldExist ) { Counter innerCount = new Counter ( counter . getDepth ( ) + 1 ) ; findAndR... | Method updateActivationOS . |
35,203 | protected void updateActivationProperty ( ActivationProperty value , String xmlTag , Counter counter , Element element ) { boolean shouldExist = value != null ; Element root = updateElement ( counter , element , xmlTag , shouldExist ) ; if ( shouldExist ) { Counter innerCount = new Counter ( counter . getDepth ( ) + 1 ... | Method updateActivationProperty . |
35,204 | protected void updateBuild ( Build value , String xmlTag , Counter counter , Element element ) { boolean shouldExist = value != null ; Element root = updateElement ( counter , element , xmlTag , shouldExist ) ; if ( shouldExist ) { Counter innerCount = new Counter ( counter . getDepth ( ) + 1 ) ; findAndReplaceSimpleEl... | Method updateBuild . |
35,205 | protected void updateBuildBase ( BuildBase value , String xmlTag , Counter counter , Element element ) { boolean shouldExist = value != null ; Element root = updateElement ( counter , element , xmlTag , shouldExist ) ; if ( shouldExist ) { Counter innerCount = new Counter ( counter . getDepth ( ) + 1 ) ; findAndReplace... | Method updateBuildBase . |
35,206 | protected void updateCiManagement ( CiManagement value , String xmlTag , Counter counter , Element element ) { boolean shouldExist = value != null ; Element root = updateElement ( counter , element , xmlTag , shouldExist ) ; if ( shouldExist ) { Counter innerCount = new Counter ( counter . getDepth ( ) + 1 ) ; findAndR... | Method updateCiManagement . |
35,207 | protected void updateConfigurationContainer ( ConfigurationContainer value , String xmlTag , Counter counter , Element element ) { boolean shouldExist = value != null ; Element root = updateElement ( counter , element , xmlTag , shouldExist ) ; if ( shouldExist ) { Counter innerCount = new Counter ( counter . getDepth ... | Method updateConfigurationContainer . |
35,208 | protected void updateContributor ( Contributor value , String xmlTag , Counter counter , Element element ) { Element root = element ; Counter innerCount = new Counter ( counter . getDepth ( ) + 1 ) ; findAndReplaceSimpleElement ( innerCount , root , "name" , value . getName ( ) , null ) ; findAndReplaceSimpleElement ( ... | Method updateContributor . |
35,209 | protected void updateDependency ( Dependency value , String xmlTag , Counter counter , Element element ) { Element root = element ; Counter innerCount = new Counter ( counter . getDepth ( ) + 1 ) ; findAndReplaceSimpleElement ( innerCount , root , "groupId" , value . getGroupId ( ) , null ) ; findAndReplaceSimpleElemen... | Method updateDependency . |
35,210 | protected void updateDependencyManagement ( DependencyManagement value , String xmlTag , Counter counter , Element element ) { boolean shouldExist = value != null ; Element root = updateElement ( counter , element , xmlTag , shouldExist ) ; if ( shouldExist ) { Counter innerCount = new Counter ( counter . getDepth ( ) ... | Method updateDependencyManagement . |
35,211 | protected void updateDeploymentRepository ( DeploymentRepository value , String xmlTag , Counter counter , Element element ) { boolean shouldExist = value != null ; Element root = updateElement ( counter , element , xmlTag , shouldExist ) ; if ( shouldExist ) { Counter innerCount = new Counter ( counter . getDepth ( ) ... | Method updateDeploymentRepository . |
35,212 | protected void updateDistributionManagement ( DistributionManagement value , String xmlTag , Counter counter , Element element ) { boolean shouldExist = value != null ; Element root = updateElement ( counter , element , xmlTag , shouldExist ) ; if ( shouldExist ) { Counter innerCount = new Counter ( counter . getDepth ... | Method updateDistributionManagement . |
35,213 | protected Element updateElement ( Counter counter , Element parent , String name , boolean shouldExist ) { Element element = parent . getChild ( name , parent . getNamespace ( ) ) ; if ( ( element != null ) && shouldExist ) { counter . increaseCount ( ) ; } if ( ( element == null ) && shouldExist ) { element = factory ... | Method updateElement . |
35,214 | protected void updateExclusion ( Exclusion value , String xmlTag , Counter counter , Element element ) { Element root = element ; Counter innerCount = new Counter ( counter . getDepth ( ) + 1 ) ; findAndReplaceSimpleElement ( innerCount , root , "artifactId" , value . getArtifactId ( ) , null ) ; findAndReplaceSimpleEl... | Method updateExclusion . |
35,215 | protected void updateExtension ( Extension value , String xmlTag , Counter counter , Element element ) { Element root = element ; Counter innerCount = new Counter ( counter . getDepth ( ) + 1 ) ; findAndReplaceSimpleElement ( innerCount , root , "groupId" , value . getGroupId ( ) , null ) ; findAndReplaceSimpleElement ... | Method updateExtension . |
35,216 | protected void updateFileSet ( FileSet value , String xmlTag , Counter counter , Element element ) { boolean shouldExist = value != null ; Element root = updateElement ( counter , element , xmlTag , shouldExist ) ; if ( shouldExist ) { Counter innerCount = new Counter ( counter . getDepth ( ) + 1 ) ; findAndReplaceSimp... | Method updateFileSet . |
35,217 | protected void updateIssueManagement ( IssueManagement value , String xmlTag , Counter counter , Element element ) { boolean shouldExist = value != null ; Element root = updateElement ( counter , element , xmlTag , shouldExist ) ; if ( shouldExist ) { Counter innerCount = new Counter ( counter . getDepth ( ) + 1 ) ; fi... | Method updateIssueManagement . |
35,218 | protected void updateLicense ( License value , String xmlTag , Counter counter , Element element ) { Element root = element ; Counter innerCount = new Counter ( counter . getDepth ( ) + 1 ) ; findAndReplaceSimpleElement ( innerCount , root , "name" , value . getName ( ) , null ) ; findAndReplaceSimpleElement ( innerCou... | Method updateLicense . |
35,219 | protected void updateMailingList ( MailingList value , String xmlTag , Counter counter , Element element ) { Element root = element ; Counter innerCount = new Counter ( counter . getDepth ( ) + 1 ) ; findAndReplaceSimpleElement ( innerCount , root , "name" , value . getName ( ) , null ) ; findAndReplaceSimpleElement ( ... | Method updateMailingList . |
35,220 | protected void updateModelBase ( ModelBase value , String xmlTag , Counter counter , Element element ) { boolean shouldExist = value != null ; Element root = updateElement ( counter , element , xmlTag , shouldExist ) ; if ( shouldExist ) { Counter innerCount = new Counter ( counter . getDepth ( ) + 1 ) ; findAndReplace... | Method updateModelBase . |
35,221 | protected void updateNotifier ( Notifier value , String xmlTag , Counter counter , Element element ) { Element root = element ; Counter innerCount = new Counter ( counter . getDepth ( ) + 1 ) ; findAndReplaceSimpleElement ( innerCount , root , "type" , value . getType ( ) , "mail" ) ; findAndReplaceSimpleElement ( inne... | Method updateNotifier . |
35,222 | protected void updateOrganization ( Organization value , String xmlTag , Counter counter , Element element ) { boolean shouldExist = value != null ; Element root = updateElement ( counter , element , xmlTag , shouldExist ) ; if ( shouldExist ) { Counter innerCount = new Counter ( counter . getDepth ( ) + 1 ) ; findAndR... | Method updateOrganization . |
35,223 | protected void updateParent ( Parent value , String xmlTag , Counter counter , Element element ) { boolean shouldExist = value != null ; Element root = updateElement ( counter , element , xmlTag , shouldExist ) ; if ( shouldExist ) { Counter innerCount = new Counter ( counter . getDepth ( ) + 1 ) ; findAndReplaceSimple... | Method updateParent . |
35,224 | protected void updatePatternSet ( PatternSet value , String xmlTag , Counter counter , Element element ) { boolean shouldExist = value != null ; Element root = updateElement ( counter , element , xmlTag , shouldExist ) ; if ( shouldExist ) { Counter innerCount = new Counter ( counter . getDepth ( ) + 1 ) ; findAndRepla... | Method updatePatternSet . |
35,225 | protected void updatePlugin ( Plugin value , String xmlTag , Counter counter , Element element ) { Element root = element ; Counter innerCount = new Counter ( counter . getDepth ( ) + 1 ) ; findAndReplaceSimpleElement ( innerCount , root , "groupId" , value . getGroupId ( ) , "org.apache.maven.plugins" ) ; findAndRepla... | Method updatePlugin . |
35,226 | protected void updatePluginConfiguration ( PluginConfiguration value , String xmlTag , Counter counter , Element element ) { boolean shouldExist = value != null ; Element root = updateElement ( counter , element , xmlTag , shouldExist ) ; if ( shouldExist ) { Counter innerCount = new Counter ( counter . getDepth ( ) + ... | Method updatePluginConfiguration . |
35,227 | protected void updatePluginContainer ( PluginContainer value , String xmlTag , Counter counter , Element element ) { boolean shouldExist = value != null ; Element root = updateElement ( counter , element , xmlTag , shouldExist ) ; if ( shouldExist ) { Counter innerCount = new Counter ( counter . getDepth ( ) + 1 ) ; it... | Method updatePluginContainer . |
35,228 | protected void updatePluginExecution ( PluginExecution value , String xmlTag , Counter counter , Element element ) { Element root = element ; Counter innerCount = new Counter ( counter . getDepth ( ) + 1 ) ; findAndReplaceSimpleElement ( innerCount , root , "id" , value . getId ( ) , "default" ) ; findAndReplaceSimpleE... | Method updatePluginExecution . |
35,229 | protected void updatePrerequisites ( Prerequisites value , String xmlTag , Counter counter , Element element ) { boolean shouldExist = value != null ; Element root = updateElement ( counter , element , xmlTag , shouldExist ) ; if ( shouldExist ) { Counter innerCount = new Counter ( counter . getDepth ( ) + 1 ) ; findAn... | Method updatePrerequisites . |
35,230 | protected void updateProfile ( Profile value , String xmlTag , Counter counter , Element element ) { Element root = element ; Counter innerCount = new Counter ( counter . getDepth ( ) + 1 ) ; findAndReplaceSimpleElement ( innerCount , root , "id" , value . getId ( ) , null ) ; updateActivation ( value . getActivation (... | Method updateProfile . |
35,231 | protected void updateRelocation ( Relocation value , String xmlTag , Counter counter , Element element ) { boolean shouldExist = value != null ; Element root = updateElement ( counter , element , xmlTag , shouldExist ) ; if ( shouldExist ) { Counter innerCount = new Counter ( counter . getDepth ( ) + 1 ) ; findAndRepla... | Method updateRelocation . |
35,232 | protected void updateReporting ( Reporting value , String xmlTag , Counter counter , Element element ) { boolean shouldExist = value != null ; Element root = updateElement ( counter , element , xmlTag , shouldExist ) ; if ( shouldExist ) { Counter innerCount = new Counter ( counter . getDepth ( ) + 1 ) ; findAndReplace... | Method updateReporting . |
35,233 | protected void updateReportPlugin ( ReportPlugin value , String xmlTag , Counter counter , Element element ) { Element root = element ; Counter innerCount = new Counter ( counter . getDepth ( ) + 1 ) ; findAndReplaceSimpleElement ( innerCount , root , "groupId" , value . getGroupId ( ) , "org.apache.maven.plugins" ) ; ... | Method updateReportPlugin . |
35,234 | protected void updateReportSet ( ReportSet value , String xmlTag , Counter counter , Element element ) { Element root = element ; Counter innerCount = new Counter ( counter . getDepth ( ) + 1 ) ; findAndReplaceSimpleElement ( innerCount , root , "id" , value . getId ( ) , "default" ) ; findAndReplaceXpp3DOM ( innerCoun... | Method updateReportSet . |
35,235 | protected void updateRepository ( Repository value , String xmlTag , Counter counter , Element element ) { Element root = element ; Counter innerCount = new Counter ( counter . getDepth ( ) + 1 ) ; updateRepositoryPolicy ( value . getReleases ( ) , "releases" , innerCount , root ) ; updateRepositoryPolicy ( value . get... | Method updateRepository . |
35,236 | protected void updateRepositoryBase ( RepositoryBase value , String xmlTag , Counter counter , Element element ) { boolean shouldExist = value != null ; Element root = updateElement ( counter , element , xmlTag , shouldExist ) ; if ( shouldExist ) { Counter innerCount = new Counter ( counter . getDepth ( ) + 1 ) ; find... | Method updateRepositoryBase . |
35,237 | protected void updateRepositoryPolicy ( RepositoryPolicy value , String xmlTag , Counter counter , Element element ) { boolean shouldExist = value != null ; Element root = updateElement ( counter , element , xmlTag , shouldExist ) ; if ( shouldExist ) { Counter innerCount = new Counter ( counter . getDepth ( ) + 1 ) ; ... | Method updateRepositoryPolicy . |
35,238 | protected void updateResource ( Resource value , String xmlTag , Counter counter , Element element ) { Element root = element ; Counter innerCount = new Counter ( counter . getDepth ( ) + 1 ) ; findAndReplaceSimpleElement ( innerCount , root , "targetPath" , value . getTargetPath ( ) , null ) ; findAndReplaceSimpleElem... | Method updateResource . |
35,239 | protected void updateScm ( Scm value , String xmlTag , Counter counter , Element element ) { boolean shouldExist = value != null ; Element root = updateElement ( counter , element , xmlTag , shouldExist ) ; if ( shouldExist ) { Counter innerCount = new Counter ( counter . getDepth ( ) + 1 ) ; findAndReplaceSimpleElemen... | Method updateScm . |
35,240 | protected void updateSite ( Site value , String xmlTag , Counter counter , Element element ) { boolean shouldExist = value != null ; Element root = updateElement ( counter , element , xmlTag , shouldExist ) ; if ( shouldExist ) { Counter innerCount = new Counter ( counter . getDepth ( ) + 1 ) ; findAndReplaceSimpleElem... | Method updateSite . |
35,241 | public static String validateRequired ( final InputComponent < ? , ? > input ) { String requiredMessage = null ; if ( input . isEnabled ( ) && input . isRequired ( ) && ! InputComponents . hasValue ( input ) ) { requiredMessage = input . getRequiredMessage ( ) ; if ( Strings . isNullOrEmpty ( requiredMessage ) ) { Stri... | Validate if an required and enabled input has a value . If not return the error message . |
35,242 | public static String getLabelFor ( InputComponent < ? , ? > input , boolean addColon ) { String label = input . getLabel ( ) ; if ( label == null ) { label = input . getName ( ) ; } if ( addColon && ! label . endsWith ( COLON ) ) { label += COLON ; } return label ; } | Returns the label for this component |
35,243 | private synchronized void refreshFlow ( ) { try { initialize ( ) ; } catch ( Exception e ) { throw new IllegalStateException ( "Error while initializing wizard" , e ) ; } int currentFlowPointer = this . flowPointer ; try { this . flowPointer = 0 ; while ( canMoveToNextStep ( ) ) { try { next ( ) . initialize ( ) ; } ca... | Refreshes the current flow so it s possible to eagerly fetch all the steps |
35,244 | private synchronized void cleanSubsequentStalePages ( ) { if ( flowPointer == 0 ) { flow . subList ( 1 , flow . size ( ) ) . clear ( ) ; subflow . clear ( ) ; } else { Iterator < WizardStepEntry > it = flow . listIterator ( flowPointer + 1 ) ; int subflowIdx = 0 ; while ( it . hasNext ( ) ) { WizardStepEntry entry = it... | Remove stale pages in case of navigational changes |
35,245 | private List < Resource < ? > > allDirectoriesOnPath ( Resource < ? > startingDir ) { List < Resource < ? > > result = new ArrayList < > ( ) ; while ( startingDir != null ) { result . add ( startingDir ) ; startingDir = startingDir . getParent ( ) ; } return result ; } | Returns all directories on path starting from given directory up to the root . |
35,246 | private Project findProjectInDirectory ( Resource < ? > target , ProjectProvider projectProvider , Predicate < Project > filter ) { Project result = null ; Imported < ProjectCache > caches = getCaches ( ) ; if ( projectProvider . containsProject ( target ) ) { boolean cached = false ; for ( ProjectCache cache : caches ... | Returns project residing in given directory if no such is found then null is returned . |
35,247 | public static NavigationResultBuilder create ( NavigationResult result ) { NavigationResultBuilder builder = new NavigationResultBuilder ( ) ; if ( result != null && result . getNext ( ) != null ) { builder . entries . addAll ( Arrays . asList ( result . getNext ( ) ) ) ; } return builder ; } | Create a new instance of a NavigationResultBuilder using the provided NavigationResult instance as a base . |
35,248 | public NavigationResultBuilder add ( NavigationResult result ) { if ( result != null && result . getNext ( ) != null ) { entries . addAll ( Arrays . asList ( result . getNext ( ) ) ) ; } return this ; } | Add a UICommand instance to create a single navigation entry . |
35,249 | public NavigationResultBuilder add ( UICommandMetadata metadata , Iterable < Class < ? extends UICommand > > types ) { List < NavigationResultEntry > internalEntries = new ArrayList < > ( ) ; for ( Class < ? extends UICommand > type : types ) { if ( UIWizard . class . isAssignableFrom ( type ) ) { throw new IllegalArgu... | Add multiple UICommand types to create a single navigation entry . Every invocation of this method creates a separate navigation entry . UIWizard types must not be provided as arguments since wizards and wizard steps cannot be combined with other UICommand types in the same navigation entry . |
35,250 | public List < Resource < ? > > search ( ) { return match ( path . split ( Pattern . quote ( File . separator ) ) , 0 , res , new LinkedList < Resource < ? > > ( ) ) ; } | Perform a search by doing a breadth - first traversal of the resource tree for resources that match the path string . |
35,251 | public Resource < ? > getChild ( final String name ) { return getResourceFactory ( ) . create ( new File ( getUnderlyingResourceObject ( ) . getAbsolutePath ( ) , name ) ) ; } | Obtain a reference to the child resource . |
35,252 | public boolean isEJB ( JavaType < ? > javaType ) { return javaType . hasAnnotation ( Stateless . class ) || javaType . hasAnnotation ( Stateful . class ) || javaType . hasAnnotation ( Singleton . class ) || javaType . hasAnnotation ( MessageDriven . class ) ; } | Given a JavaType this method checks if it s an EJB or not |
35,253 | private static Prompt createPrompt ( Resource < ? > currentResource ) { if ( OperatingSystemUtils . isWindows ( ) ) { List < TerminalCharacter > prompt = new LinkedList < > ( ) ; prompt . add ( new TerminalCharacter ( '[' ) ) ; for ( char c : currentResource . getName ( ) . toCharArray ( ) ) { prompt . add ( new Termin... | Creates an initial prompt |
35,254 | VersionRangeResult getVersions ( DependencyQuery query ) { Coordinate dep = query . getCoordinate ( ) ; try { String version = dep . getVersion ( ) ; if ( version == null || version . isEmpty ( ) ) { dep = CoordinateBuilder . create ( dep ) . setVersion ( "[,)" ) ; } else if ( ! version . matches ( "(\\(|\\[).*?(\\)|\\... | Returns the versions of a specific artifact |
35,255 | public static File getContextFile ( Resource < ? > r ) { do { Object o = r . getUnderlyingResourceObject ( ) ; if ( o instanceof File ) { return ( File ) r . getUnderlyingResourceObject ( ) ; } } while ( ( r = r . getParent ( ) ) != null ) ; return null ; } | A simple utility method to locate the outermost contextual File reference for the specified resource . |
35,256 | CliRequest createCliRequest ( String [ ] params , String workingDirectory ) { CliRequest cliRequest = null ; try { Constructor < CliRequest > constructor = CliRequest . class . getDeclaredConstructor ( String [ ] . class , ClassWorld . class ) ; constructor . setAccessible ( true ) ; cliRequest = constructor . newInsta... | Horrible hack . Bad Maven API |
35,257 | protected void implementInterface ( InterfaceCapableSource < ? > source , Iterable < String > value , JavaSourceFacet facet ) { for ( String type : value ) { source . addInterface ( type ) ; } } | Interfaces don t require overriding method declarations |
35,258 | public static boolean isEnabled ( UICommand command , UIContext context ) { return ( command . isEnabled ( context ) && ! ( command instanceof UIWizardStep ) ) ; } | Returns true if this command can be invoked |
35,259 | public static String shellifyOptionValue ( String value ) { return COLONS . matcher ( WHITESPACES . matcher ( value . trim ( ) ) . replaceAll ( "_" ) ) . replaceAll ( "" ) . toUpperCase ( ) ; } | Shellifies an option value |
35,260 | public static String shellifyOptionNameDashed ( String name ) { String shellName = shellifyName ( name ) ; StringBuilder sb = new StringBuilder ( ) ; for ( int i = 0 ; i < shellName . length ( ) ; i ++ ) { char c = shellName . charAt ( i ) ; if ( Character . isUpperCase ( c ) ) { if ( i > 0 ) { char previousChar = shel... | Shellifies an option name using the provided style |
35,261 | public static int execFromPath ( final String command , final String [ ] parms , final OutputStream out , final DirectoryResource path ) throws IOException { Assert . notNull ( command , "Command must not be null." ) ; Assert . notNull ( path , "Directory path must not be null." ) ; Assert . notNull ( out , "OutputStre... | Execute a native system command as if it were run from the given path . |
35,262 | public static void exec ( final boolean wait , final String command , final String ... parms ) throws IOException { String [ ] commandTokens = parms == null ? new String [ 1 ] : new String [ parms . length + 1 ] ; commandTokens [ 0 ] = command ; if ( commandTokens . length > 1 ) { System . arraycopy ( parms , 0 , comma... | Execute the given system command |
35,263 | private String readInput ( PrintStream out , boolean echo ) throws InterruptedException { StringBuilder sb = new StringBuilder ( ) ; Key inputKey ; do { CommandOperation input = commandInvocation . getInput ( ) ; inputKey = input . getInputKey ( ) ; if ( inputKey == Key . CTRL_C || inputKey == Key . CTRL_D ) { throw ne... | Performs the hard work |
35,264 | public void preconfigureInput ( InputComponent < ? , ? > input , WithAttributes atts ) { if ( atts != null ) { input . setEnabled ( atts . enabled ( ) ) ; input . setLabel ( atts . label ( ) ) ; input . setRequired ( atts . required ( ) ) ; input . setRequiredMessage ( atts . requiredMessage ( ) ) ; input . setDescript... | Pre - configure input based on WithAttributes info if annotation exists |
35,265 | public DTOCollection from ( Project project , JavaClass < ? > entity , String dtoPackage ) { DTOCollection dtoCollection = new DTOCollection ( ) ; if ( entity == null ) { throw new IllegalArgumentException ( "The argument entity was null." ) ; } generatedDTOGraphForEntity ( project , entity , dtoPackage , true , false ... | Creates a collection of DTOs for the provided JPA entity and any JPA entities referenced in the JPA entity . |
35,266 | public void start ( ) { synchronized ( this . lifecycleMonitor ) { if ( ! isRunning ( ) ) { log . info ( "start: Starting ConnectorManager" ) ; try { connector . start ( ) ; } catch ( ConfigError | RuntimeError ex ) { throw new ConfigurationException ( ex . getMessage ( ) , ex ) ; } catch ( Throwable ex ) { throw new I... | Start the connector accepting new connections |
35,267 | public void stop ( ) { synchronized ( this . lifecycleMonitor ) { if ( isRunning ( ) ) { log . info ( "stop: Stopping ConnectorManager" ) ; try { connector . stop ( ) ; } finally { running = false ; } } } } | Stop this connector logging out existing sessions closing their connections and stopping to accept new connections . |
35,268 | public void visitBracketedExpression ( Expr expr , Integer indent ) { boolean needsBrackets = needsBrackets ( expr ) ; if ( needsBrackets ) { out . print ( "(" ) ; } visitExpression ( expr , indent ) ; if ( needsBrackets ) { out . print ( ")" ) ; } } | Write a bracketed operand if necessary . Any operand whose human - readable representation can contain whitespace must have brackets around it . |
35,269 | public < T extends Type > T selectCandidate ( T candidate , T next , T actual , Environment environment ) { boolean left = subtypeOperator . isSubtype ( candidate , next , environment ) ; boolean right = subtypeOperator . isSubtype ( next , candidate , environment ) ; if ( left && ! right ) { return next ; } else if ( ... | Given two candidates return the more precise one . If no viable candidate return null ; |
35,270 | public static Type . Callable substitute ( Type . Callable fmp , Tuple < Template . Variable > templateParameters , Tuple < SyntacticItem > templateArguments ) { Function < Identifier , SyntacticItem > binding = WyilFile . bindingFunction ( templateParameters , templateArguments ) ; Tuple < Type > parameters = WyilFile... | Apply an explicit binding to a given function method or property declaration via substitution . Observe we cannot just use the existing Type . substitute method as this accounts for lifetime captures . Therefore we first build the binding and then apply it to each of the parameters and returns . |
35,271 | public static < T extends SyntacticItem > java . util . function . Function < Identifier , SyntacticItem > bindingFunction ( Tuple < Template . Variable > variables , Tuple < T > arguments ) { return ( Identifier var ) -> { for ( int i = 0 ; i != variables . size ( ) ; ++ i ) { if ( var . equals ( variables . get ( i )... | Create a simple binding function from two tuples representing the key set and value set respectively . |
35,272 | public static java . util . function . Function < Identifier , SyntacticItem > removeFromBinding ( java . util . function . Function < Identifier , SyntacticItem > binding , Tuple < Identifier > variables ) { return ( Identifier var ) -> { for ( int i = 0 ; i != variables . size ( ) ; ++ i ) { if ( var . equals ( varia... | Construct a binding function from another binding where a given set of variables are removed . This is necessary in situations where the given variables are captured . |
35,273 | protected < T extends SemanticType . Atom > T construct ( Disjunct type , LifetimeRelation lifetimes , Combinator < T > kind ) { T result = null ; Conjunct [ ] conjuncts = type . conjuncts ; for ( int i = 0 ; i != conjuncts . length ; ++ i ) { Conjunct conjunct = conjuncts [ i ] ; if ( ! isVoid ( conjunct , lifetimes )... | Construct a given target type from a given type in DisjunctiveNormalForm . |
35,274 | protected static int countMatchingFields ( Tuple < ? extends SemanticType . Field > lhsFields , Tuple < ? extends SemanticType . Field > rhsFields ) { int count = 0 ; for ( int i = 0 ; i != lhsFields . size ( ) ; ++ i ) { for ( int j = 0 ; j != rhsFields . size ( ) ; ++ j ) { SemanticType . Field lhsField = lhsFields .... | Count the number of matching fields . That is fields with the same name . |
35,275 | private Stmt parseHeadlessStatement ( EnclosingScope scope ) { int start = index ; Identifier blockName = parseOptionalIdentifier ( scope ) ; if ( blockName != null ) { if ( tryAndMatch ( true , Colon ) != null && isAtEOL ( ) ) { int end = index ; matchEndLine ( ) ; scope = scope . newEnclosingScope ( ) ; scope . decla... | A headless statement is one which has no identifying keyword . The set of headless statements include assignments invocations variable declarations and named blocks . |
35,276 | public Tuple < Expr > parseExpressions ( EnclosingScope scope , boolean terminated ) { ArrayList < Expr > returns = new ArrayList < > ( ) ; int next = skipLineSpace ( index ) ; returns . add ( parseExpression ( scope , terminated ) ) ; while ( tryAndMatch ( false , Comma ) != null ) { returns . add ( parseExpression ( ... | Parse a multi - expression ; that is a sequence of one or more expressions separated by comma s |
35,277 | private Expr parseBitwiseOrExpression ( EnclosingScope scope , boolean terminated ) { int start = index ; Expr lhs = parseBitwiseXorExpression ( scope , terminated ) ; if ( tryAndMatch ( terminated , VerticalBar ) != null ) { Expr rhs = parseExpression ( scope , terminated ) ; return annotateSourceLocation ( new Expr .... | Parse an bitwise inclusive or expression |
35,278 | private Expr parseBitwiseXorExpression ( EnclosingScope scope , boolean terminated ) { int start = index ; Expr lhs = parseBitwiseAndExpression ( scope , terminated ) ; if ( tryAndMatch ( terminated , Caret ) != null ) { Expr rhs = parseExpression ( scope , terminated ) ; return annotateSourceLocation ( new Expr . Bitw... | Parse an bitwise exclusive or expression |
35,279 | private Expr parseBitwiseAndExpression ( EnclosingScope scope , boolean terminated ) { int start = index ; Expr lhs = parseConditionExpression ( scope , terminated ) ; if ( tryAndMatch ( terminated , Ampersand ) != null ) { Expr rhs = parseExpression ( scope , terminated ) ; return annotateSourceLocation ( new Expr . B... | Parse an bitwise and expression |
35,280 | private Expr parseConditionExpression ( EnclosingScope scope , boolean terminated ) { int start = index ; Token lookahead ; if ( ( lookahead = tryAndMatch ( terminated , Some , All ) ) != null ) { return parseQuantifierExpression ( lookahead , scope , terminated ) ; } Expr lhs = parseShiftExpression ( scope , terminate... | Parse a condition expression . |
35,281 | private Expr parseAdditiveExpression ( EnclosingScope scope , boolean terminated ) { int start = index ; Expr lhs = parseMultiplicativeExpression ( scope , terminated ) ; Token lookahead ; while ( ( lookahead = tryAndMatch ( terminated , Plus , Minus ) ) != null ) { Expr rhs = parseMultiplicativeExpression ( scope , te... | Parse an additive expression . |
35,282 | private Expr parseMultiplicativeExpression ( EnclosingScope scope , boolean terminated ) { int start = index ; Expr lhs = parseAccessExpression ( scope , terminated ) ; Token lookahead = tryAndMatch ( terminated , Star , RightSlash , Percent ) ; if ( lookahead != null ) { Expr rhs = parseAccessExpression ( scope , term... | Parse a multiplicative expression . |
35,283 | private Expr parseQualifiedAccess ( EnclosingScope scope , boolean terminated ) { int start = index ; Name name = parseName ( scope ) ; Decl . Link link = new Decl . Link < > ( name ) ; int mid = index ; Expr expr ; if ( skipTemplate ( scope ) && tryAndMatch ( terminated , LeftBrace ) != null ) { index = mid ; Tuple < ... | Attempt to parse a possible module identifier . This will reflect a true module identifier only if the root variable is not in the given environment . |
35,284 | public boolean skipTemplate ( EnclosingScope scope ) { int start = index ; if ( tryAndMatch ( false , LeftAngle ) == null ) { return true ; } else { boolean firstTime = true ; while ( tryAndMatch ( false , RightAngle ) == null ) { if ( ! firstTime && tryAndMatch ( false , Comma ) == null ) { index = start ; return fals... | Decide whether we have a template argument list ahead . This actually requires infinite lookahead but in practice is pretty minimal work . |
35,285 | private Identifier parseLifetime ( EnclosingScope scope , boolean terminated ) { Identifier id = parseOptionalLifetimeIdentifier ( scope , terminated ) ; if ( id != null ) { return id ; } else { syntaxError ( "expecting lifetime identifier" , tokens . get ( index ) ) ; } throw new RuntimeException ( "deadcode" ) ; } | Parse a currently declared lifetime . |
35,286 | private Token match ( Token . Kind kind ) { checkNotEof ( ) ; Token token = tokens . get ( index ++ ) ; if ( token . kind != kind ) { syntaxError ( "expecting \"" + kind + "\" here" , token ) ; } return token ; } | Match a given token kind whilst moving passed any whitespace encountered inbetween . In the case that meet the end of the stream or we don t match the expected token then an error is thrown . |
35,287 | private Token [ ] match ( Token . Kind ... kinds ) { Token [ ] result = new Token [ kinds . length ] ; for ( int i = 0 ; i != result . length ; ++ i ) { checkNotEof ( ) ; Token token = tokens . get ( index ++ ) ; if ( token . kind == kinds [ i ] ) { result [ i ] = token ; } else { syntaxError ( "Expected \"" + kinds [ ... | Match a given sequence of tokens whilst moving passed any whitespace encountered inbetween . In the case that meet the end of the stream or we don t match the expected tokens in the expected order then an error is thrown . |
35,288 | private boolean lookaheadSequence ( boolean terminated , Token . Kind ... kinds ) { int next = index ; for ( Token . Kind k : kinds ) { next = terminated ? skipWhiteSpace ( next ) : skipLineSpace ( next ) ; if ( next >= tokens . size ( ) || tokens . get ( next ++ ) . kind != k ) { return false ; } } return true ; } | Attempt to match a given sequence of tokens in the given order whilst ignoring any whitespace in between . Note that in any case the index will be unchanged! |
35,289 | private boolean isAtEOL ( ) { int next = skipLineSpace ( index ) ; return next >= tokens . size ( ) || tokens . get ( next ) . kind == NewLine ; } | Check whether the current index is after skipping all line spaces at the end of a line . This method does not change the state! |
35,290 | private void matchEndLine ( ) { index = skipLineSpace ( index ) ; if ( index >= tokens . size ( ) ) { return ; } else if ( tokens . get ( index ) . kind != NewLine ) { syntaxError ( "expected end-of-line" , tokens . get ( index ) ) ; } else { index = index + 1 ; } } | Match a the end of a line . This is required to signal for example the end of the current statement . |
35,291 | private int skipWhiteSpace ( int index ) { while ( index < tokens . size ( ) && isWhiteSpace ( tokens . get ( index ) ) ) { index ++ ; } return index ; } | Skip over any whitespace characters starting from a given index and returning the first index passed any whitespace encountered . |
35,292 | private void skipEmptyLines ( ) { int tmp = index ; do { tmp = skipLineSpace ( tmp ) ; if ( tmp < tokens . size ( ) && tokens . get ( tmp ) . kind != Token . Kind . NewLine ) { return ; } else if ( tmp >= tokens . size ( ) ) { index = tmp ; return ; } tmp = tmp + 1 ; index = tmp ; } while ( true ) ; } | Skip over any empty lines . That is lines which contain only whitespace and comments . |
35,293 | private boolean isWhiteSpace ( Token token ) { return token . kind == Token . Kind . NewLine || isLineSpace ( token ) ; } | Define what is considered to be whitespace . |
35,294 | private BigInteger parseCharacter ( String input ) { int pos = 1 ; char c = input . charAt ( pos ++ ) ; if ( c == '\\' ) { switch ( input . charAt ( pos ++ ) ) { case 'b' : c = '\b' ; break ; case 't' : c = '\t' ; break ; case 'n' : c = '\n' ; break ; case 'f' : c = '\f' ; break ; case 'r' : c = '\r' ; break ; case '"'... | Parse a character from a string of the form c or \ c . |
35,295 | protected byte [ ] parseUnicodeString ( Token token ) { String v = token . text ; v = v . substring ( 1 , v . length ( ) - 1 ) ; StringBuffer result = new StringBuffer ( ) ; for ( int i = 0 ; i < v . length ( ) ; i ++ ) { if ( v . charAt ( i ) == '\\' ) { if ( v . length ( ) <= i + 1 ) { throw new RuntimeException ( "u... | Parse a string constant whilst interpreting all escape characters . |
35,296 | private byte parseBinaryLiteral ( Token input ) { String text = input . text ; if ( text . length ( ) > 11 ) { syntaxError ( "invalid binary literal (too long)" , input ) ; } int val = 0 ; for ( int i = 2 ; i != text . length ( ) ; ++ i ) { char c = text . charAt ( i ) ; if ( c == '_' ) { continue ; } val = val << 1 ; ... | Parse a token representing a binary literal such as 0b0110 0b1111_0101 etc . |
35,297 | private BigInteger parseHexLiteral ( Token input ) { String text = input . text ; for ( int i = 2 ; i != text . length ( ) ; ++ i ) { char c = text . charAt ( i ) ; if ( c != '_' && ! isHexDigit ( c ) ) { syntaxError ( "invalid hex literal (invalid characters)" , input ) ; } } text = input . text . substring ( 2 ) . re... | Parse a token representing a hex literal such as 0x |
35,298 | public static Environment declareThisWithin ( Decl . FunctionOrMethod decl , Environment environment ) { if ( decl instanceof Decl . Method ) { Decl . Method method = ( Decl . Method ) decl ; environment = environment . declareWithin ( "this" , method . getLifetimes ( ) ) ; } return environment ; } | Update the environment to reflect the fact that the special this lifetime is contained within all declared lifetime parameters . Observe that this only makes sense if the enclosing declaration is for a method . |
35,299 | public static Tuple < Decl . Variable > determineModifiedVariables ( Stmt . Block block ) { HashSet < Decl . Variable > modified = new HashSet < > ( ) ; determineModifiedVariables ( block , modified ) ; return new Tuple < > ( modified ) ; } | Determine the set of modifier variables for a given statement block . A modified variable is one which is assigned . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.