idx
int64
0
165k
question
stringlengths
73
5.81k
target
stringlengths
5
918
140,700
public String evaluate ( Features features , Set < String > discovered , boolean coerceUndefinedToFalse ) { if ( feature != null && discovered != null ) { discovered . add ( feature ) ; } if ( feature == null ) { return nodeName ; } else if ( ! coerceUndefinedToFalse && ! features . contains ( feature ) ) { return null...
Evaluate the has plugin for the given set of features .
140,701
public void replaceWith ( HasNode node ) { feature = node . feature ; nodeName = node . nodeName ; trueNode = node . trueNode ; falseNode = node . falseNode ; }
Replaces the properties of the current node with the properties of the specified node .
140,702
public void replaceWith ( String nodeName ) { feature = null ; this . nodeName = nodeName ; trueNode = falseNode = null ; }
Replaces the properties of the current node with the specified node name making this node into an end point node .
140,703
protected String invoke ( CommandProvider provider , CommandInterpreterWrapper interpreter ) throws Exception { Method method = provider . getClass ( ) . getMethod ( "_aggregator" , new Class [ ] { CommandInterpreter . class } ) ; method . invoke ( provider , new Object [ ] { interpreter } ) ; return interpreter . getO...
Invokes the aggregator command processor using reflection in order avoid framework dependencies on the aggregator classes .
140,704
public static final void setWriter ( String format , TreeWriter writer ) { String key = format . toLowerCase ( ) ; writers . put ( key , writer ) ; if ( JSON . equals ( key ) ) { cachedJsonWriter = writer ; } }
Binds the given TreeWriter instance to the specified data format .
140,705
public static < T > Predicate < T > TRUE ( ) { return new Predicate < T > ( ) { public boolean check ( T obj ) { return true ; } } ; }
Returns an always - true predicate .
140,706
public static < T > Predicate < T > FALSE ( ) { return Predicate . < T > NOT ( Predicate . < T > TRUE ( ) ) ; }
Returns an always - false predicate .
140,707
public static < T > Predicate < T > NOT ( final Predicate < T > pred ) { return new Predicate < T > ( ) { public boolean check ( T obj ) { return ! pred . check ( obj ) ; } } ; }
Predicate negation .
140,708
public static < T > Predicate < T > AND ( final Predicate < T > a , final Predicate < T > b ) { return new Predicate < T > ( ) { public boolean check ( T obj ) { return a . check ( obj ) && b . check ( obj ) ; } } ; }
Short - circuited AND operation .
140,709
public static < T > Predicate < T > OR ( final Predicate < T > a , final Predicate < T > b ) { return new Predicate < T > ( ) { public boolean check ( T obj ) { return a . check ( obj ) || b . check ( obj ) ; } } ; }
Short - circuited OR operation .
140,710
public void fillVMIndex ( TIntIntHashMap index , int p ) { for ( Node n : scope ) { for ( VM v : parent . getRunningVMs ( n ) ) { index . put ( v . id ( ) , p ) ; } for ( VM v : parent . getSleepingVMs ( n ) ) { index . put ( v . id ( ) , p ) ; } } for ( VM v : ready ) { index . put ( v . id ( ) , p ) ; } }
Fill an index with the VM presents in this mapping
140,711
public Boolean getIncludeStatus ( ) { if ( formula . isTrue ( ) ) { return Boolean . TRUE ; } else if ( formula . isFalse ( ) ) { return Boolean . FALSE ; } return null ; }
Returns a Boolean value indicating the value of the formula expression or null if the formula expression contains undefined features . The formula is NOT simplified prior to returning the result for performance reasons so some expressions that may simplify to TRUE can return a null value .
140,712
public ModuleDepInfo andWith ( ModuleDepInfo other ) { if ( other == null ) { return this ; } formula . andWith ( other . formula ) ; if ( ! isPluginNameDeclared && other . isPluginNameDeclared ) { pluginName = other . pluginName ; isPluginNameDeclared = true ; } else if ( pluginName == null ) { pluginName = other . pl...
logically ands the provided terms with the formula belonging to this object updating this object with the result .
140,713
public boolean add ( ModuleDepInfo other ) { Boolean modified = false ; if ( formula . isTrue ( ) ) { return false ; } if ( other . formula . isTrue ( ) ) { modified = ! formula . isTrue ( ) ; formula = new BooleanFormula ( true ) ; if ( modified && other . comment != null && other . commentTermSize < commentTermSize )...
Adds the terms and comments from the specified object to this object .
140,714
public void setMinMaxLength ( int [ ] lengths ) { Arrays . sort ( lengths ) ; this . minLength = lengths [ 0 ] ; this . maxLength = lengths [ lengths . length - 1 ] ; }
Set min and max lengths .
140,715
@ SuppressWarnings ( { "rawtypes" , "unchecked" } ) protected AbstractGenericType < T > create ( Type genericType , GenericType < ? > genericDefiningType ) { return new GenericTypeImpl ( genericType , genericDefiningType ) ; }
This method creates a new instance of this class . It may be overridden to create the appropriate sub - type .
140,716
public static < T > void inOrder ( T root , BinTreeNavigator < T > binTreeNav , Action < T > action ) { for ( Iterator < T > it = inOrder ( root , binTreeNav ) ; it . hasNext ( ) ; ) { T treeVertex = it . next ( ) ; action . action ( treeVertex ) ; } }
Executes an action on all nodes from a tree in inorder . For trees with sharing the same tree node object will be visited multiple times .
140,717
private Map < Link , Boolean > getFirstPhysicalPath ( Map < Link , Boolean > currentPath , Switch sw , Node dst ) { for ( Link l : net . getConnectedLinks ( sw ) ) { if ( currentPath . containsKey ( l ) ) { continue ; } currentPath . put ( l , ! l . getSwitch ( ) . equals ( sw ) ) ; if ( l . getElement ( ) instanceof N...
Recursive method to get the first physical path found from a switch to a destination node
140,718
public Bundle getBundle ( String symbolicName ) { final String sourceMethod = "getBundle" ; boolean isTraceLogging = log . isLoggable ( Level . FINER ) ; if ( isTraceLogging ) { log . entering ( FrameworkWiringBundleResolver . class . getName ( ) , sourceMethod , new Object [ ] { symbolicName } ) ; } Bundle [ ] candida...
Returns the bundle with the requested symbolic name that is wired to the contributing bundle or the bundle with the latest version if unable to determine wiring .
140,719
protected String getSourcesMappingEpilogue ( ) { String root = "" ; String contextPath = request . getRequestURI ( ) ; if ( contextPath != null ) { if ( contextPath . endsWith ( ILayer . SOURCEMAP_RESOURCE_PATH ) ) { contextPath = contextPath . substring ( 0 , contextPath . length ( ) - ( ILayer . SOURCEMAP_RESOURCE_PA...
Returns the source mapping epilogue for the layer that gets added to the end of the response .
140,720
protected List < ModuleBuildFuture > collectFutures ( ModuleList moduleList , HttpServletRequest request ) throws IOException { final String sourceMethod = "collectFutures" ; final boolean isTraceLogging = log . isLoggable ( Level . FINER ) ; if ( isTraceLogging ) { log . entering ( sourceClass , sourceMethod , new Obj...
Dispatch the modules specified in the request to the module builders and collect the build futures returned by the builders into the returned list .
140,721
protected String notifyLayerListeners ( ILayerListener . EventType type , HttpServletRequest request , IModule module ) throws IOException { StringBuffer sb = new StringBuffer ( ) ; List < IServiceReference > refs = null ; if ( aggr . getPlatformServices ( ) != null ) { try { IServiceReference [ ] ary = aggr . getPlatf...
Calls the registered layer listeners .
140,722
public static String getModuleName ( URI uri ) { String name = uri . getPath ( ) ; if ( name . endsWith ( "/" ) ) { name = name . substring ( 0 , name . length ( ) - 1 ) ; } int idx = name . lastIndexOf ( "/" ) ; if ( idx != - 1 ) { name = name . substring ( idx + 1 ) ; } if ( name . endsWith ( ".js" ) ) { name = name ...
Returns the module name for the specified URI . This is the name part of the URI with path information removed and with the . js extension removed if present .
140,723
public static String getExtension ( String path ) { int idx = path . lastIndexOf ( "/" ) ; String filename = idx == - 1 ? path : path . substring ( idx + 1 ) ; idx = filename . lastIndexOf ( "." ) ; return idx == - 1 ? "" : filename . substring ( idx + 1 ) ; }
Returns the file extension part of the specified path
140,724
private boolean tryAddModule ( IAggregator aggregator , List < String > list , String bundleRoot , IResource bundleRootRes , String locale , String resource , Collection < String > availableLocales ) throws IOException { if ( availableLocales != null && ! availableLocales . contains ( locale ) ) { return false ; } bool...
Adds the source for the locale specific i18n resource if it exists .
140,725
private static < A > ForwardNavigator < RegExp < A > > unionNav ( ) { return new ForwardNavigator < RegExp < A > > ( ) { private Visitor < A , List < RegExp < A > > > unionVis = new Visitor < A , List < RegExp < A > > > ( ) { public List < RegExp < A > > visit ( Union < A > ure ) { return Arrays . < RegExp < A > > asLi...
forward navigator through the sons of Union nodes .
140,726
private static < A > ForwardNavigator < RegExp < A > > concatNav ( ) { return new ForwardNavigator < RegExp < A > > ( ) { private Visitor < A , List < RegExp < A > > > concatVis = new Visitor < A , List < RegExp < A > > > ( ) { public List < RegExp < A > > visit ( Concat < A > ure ) { return Arrays . < RegExp < A > > a...
forward navigator through the sons of Concat nodes .
140,727
private Transformer createTransformer ( boolean indent ) { try { Transformer result = this . transformerFactory . newTransformer ( ) ; if ( indent ) { result . setOutputProperty ( OutputKeys . INDENT , "yes" ) ; } return result ; } catch ( TransformerConfigurationException e ) { throw new IllegalStateException ( "XML T...
This method creates a new transformer .
140,728
public Parameters parameters ( ) { Parameters ps = new DefaultParameters ( ) . setTimeLimit ( timeout ) . doRepair ( repair ) . doOptimize ( optimize ) ; if ( single ( ) ) { ps . setVerbosity ( verbosity ) ; } if ( chunk ) { ps . setEnvironmentFactory ( mo -> new EnvironmentBuilder ( ) . fromChunk ( ) . build ( ) ) ; }...
Get the parameters from the options .
140,729
public Stream < LabelledInstance > instances ( ) throws IOException { if ( single ( ) ) { return Collections . singletonList ( instance ( new File ( instance ) ) ) . stream ( ) ; } @ SuppressWarnings ( "resource" ) Stream < String > s = Files . lines ( Paths . get ( instances ) , StandardCharsets . UTF_8 ) ; return s ....
List all the instances to solve .
140,730
public File output ( ) throws IOException { File o = new File ( output ) ; if ( ! o . exists ( ) && ! o . mkdirs ( ) ) { throw new IOException ( "Unable to create output folder '" + output + "'" ) ; } return o ; }
Get the output directory .
140,731
public static LabelledInstance instance ( File f ) { String path = f . getAbsolutePath ( ) ; return new LabelledInstance ( path , JSON . readInstance ( f ) ) ; }
Make an instance .
140,732
public static < T1 , T2 , T3 > Function < T1 , T3 > comp ( final Function < T2 , T3 > func1 , final Function < T1 , T2 > func2 ) { return new Function < T1 , T3 > ( ) { public T3 f ( T1 x ) { return func1 . f ( func2 . f ( x ) ) ; } } ; }
Computes the composition of two functions .
140,733
public Collection < VM > getAssociatedVGroup ( VM u ) { for ( Collection < VM > vGrp : sets ) { if ( vGrp . contains ( u ) ) { return vGrp ; } } return Collections . emptySet ( ) ; }
Get the group of VMs that contains the given VM .
140,734
protected Properties loadProps ( Properties props ) { File file = getPropsFile ( ) ; if ( file != null ) { if ( file . exists ( ) ) { try { URL url = file . toURI ( ) . toURL ( ) ; loadFromUrl ( props , url ) ; } catch ( MalformedURLException ex ) { if ( log . isLoggable ( Level . WARNING ) ) { log . log ( Level . WARN...
Loads the Options properties from the aggregator properties file into the specified properties object . If the properties file does not exist then try to load from the bundle .
140,735
protected void saveProps ( Properties props ) throws IOException { if ( loadFromPropertiesFile ) { File file = getPropsFile ( ) ; if ( file != null ) { FileWriter writer = new FileWriter ( file ) ; try { props . store ( writer , null ) ; } finally { writer . close ( ) ; } } } }
Saves the specified Options properties to the properties file for the aggregator .
140,736
protected void updateNotify ( long sequence ) { IServiceReference [ ] refs = null ; try { if ( aggregator != null && aggregator . getPlatformServices ( ) != null ) { refs = aggregator . getPlatformServices ( ) . getServiceReferences ( IOptionsListener . class . getName ( ) , "(name=" + registrationName + ")" ) ; if ( r...
Notify options change listeners that Options have been updated
140,737
protected void propertiesFileUpdated ( Properties updated , long sequence ) { Properties newProps = new Properties ( getDefaultOptions ( ) ) ; Enumeration < ? > propsEnum = updated . propertyNames ( ) ; while ( propsEnum . hasMoreElements ( ) ) { String name = ( String ) propsEnum . nextElement ( ) ; newProps . setProp...
Listener method for being informed of changes to the properties file by another instance of this class . Called by other instances of this class for instances that use the same properties file when properties are saved .
140,738
protected void propsFileUpdateNotify ( Properties updatedProps , long sequence ) { if ( aggregator == null || aggregator . getPlatformServices ( ) == null || ! loadFromPropertiesFile ) return ; IPlatformServices platformServices = aggregator . getPlatformServices ( ) ; try { IServiceReference [ ] refs = platformService...
Notify implementations of this class that are listening for properties file updates on the same properties file that the properties file has been updated .
140,739
protected Properties initDefaultOptions ( ) { Properties defaultValues = new Properties ( ) ; defaultValues . putAll ( defaults ) ; ClassLoader cl = OptionsImpl . class . getClassLoader ( ) ; URL url = cl . getResource ( getPropsFilename ( ) ) ; if ( url != null ) { loadFromUrl ( defaultValues , url ) ; } if ( aggregat...
Returns the default options for this the aggregator service .
140,740
void setFromFractions ( final double latFraction , final double lonFraction , final double latFractionDelta , final double lonFractionDelta ) { assert ( lonFractionDelta >= 0.0 ) ; assert ( latFractionDelta != 0.0 ) ; lonFractionMin = lonFraction ; lonFractionMax = lonFraction + lonFractionDelta ; if ( latFractionDelta...
Generate upper and lower limits based on x and y and delta s .
140,741
public boolean applyAction ( Model c ) { Mapping map = c . getMapping ( ) ; return ! map . isOffline ( node ) && map . addOfflineNode ( node ) ; }
Put the node offline on a model
140,742
public static void join ( SAXSymbol left , SAXSymbol right ) { if ( left . n != null ) { left . deleteDigram ( ) ; } left . n = right ; right . p = left ; }
Links left and right symbols together i . e . removes this symbol from the string also removing any old digram from the hash table .
140,743
public void substitute ( SAXRule r ) { r . addIndex ( this . originalPosition ) ; this . cleanUp ( ) ; this . n . cleanUp ( ) ; SAXNonTerminal nt = new SAXNonTerminal ( r ) ; nt . originalPosition = this . originalPosition ; this . p . insertAfter ( nt ) ; if ( ! p . check ( ) ) { p . n . check ( ) ; } }
Replace a digram with a non - terminal .
140,744
public void match ( SAXSymbol theDigram , SAXSymbol matchingDigram ) { SAXRule rule ; SAXSymbol first , second ; if ( matchingDigram . p . isGuard ( ) && matchingDigram . n . n . isGuard ( ) ) { rule = ( ( SAXGuard ) matchingDigram . p ) . r ; theDigram . substitute ( rule ) ; } else { rule = new SAXRule ( ) ; try { fi...
Deals with a matching digram .
140,745
protected static String getPayload ( SAXSymbol symbol ) { if ( symbol . isGuard ( ) ) { return "guard of the rule " + ( ( SAXGuard ) symbol ) . r . ruleIndex ; } else if ( symbol . isNonTerminal ( ) ) { return "nonterminal " + ( ( SAXNonTerminal ) symbol ) . value ; } return "symbol " + symbol . value ; }
This routine is used for the debugging .
140,746
public List < String > getExtraModules ( ) { return extraModules == null ? Collections . < String > emptyList ( ) : Collections . unmodifiableList ( extraModules ) ; }
Returns the list of additional modules that should be included ahead of this module build in the layer
140,747
public DefaultReconfigurationProblemBuilder setNextVMsStates ( Set < VM > ready , Set < VM > running , Set < VM > sleeping , Set < VM > killed ) { runs = running ; waits = ready ; sleep = sleeping ; over = killed ; return this ; }
Set the next state of the VMs . Sets must be disjoint
140,748
public DefaultReconfigurationProblem build ( ) throws SchedulerException { if ( runs == null ) { Mapping map = model . getMapping ( ) ; runs = new HashSet < > ( ) ; sleep = new HashSet < > ( ) ; for ( Node n : map . getOnlineNodes ( ) ) { runs . addAll ( map . getRunningVMs ( n ) ) ; sleep . addAll ( map . getSleepingV...
Build the problem
140,749
public static String inputStreamToString ( InputStream in ) throws Exception { BufferedReader br = new BufferedReader ( new InputStreamReader ( in ) ) ; StringBuffer buffer = new StringBuffer ( ) ; String line ; while ( ( line = br . readLine ( ) ) != null ) { buffer . append ( line ) ; } return buffer . toString ( ) ;...
read a String from an InputStream object .
140,750
public int compareTo ( RepairDigramRecord o ) { if ( this . freq > o . freq ) { return 1 ; } else if ( this . freq < o . freq ) { return - 1 ; } return 0 ; }
A comparator built upon occurrence frequency only .
140,751
protected Class < ? > getNIOFileResourceClass ( ) { final String method = "getNIOFileResourceClass" ; if ( tryNIO && nioFileResourceClass == null ) { try { nioFileResourceClass = classLoader . loadClass ( "com.ibm.jaggr.core.impl.resource.NIOFileResource" ) ; } catch ( ClassNotFoundException e ) { tryNIO = false ; if (...
Utility method for acquiring a reference to the NIOFileResource class without asking the class loader every single time after we know it s not there .
140,752
protected Constructor < ? > getNIOFileResourceConstructor ( Class < ? > ... args ) { final String method = "getNIOFileResourceConstructor" ; if ( tryNIO && nioFileResourceConstructor == null ) { try { Class < ? > clazz = getNIOFileResourceClass ( ) ; if ( clazz != null ) nioFileResourceConstructor = clazz . getConstruc...
Utility method for acquiring a reference to the NIOFileResource class constructor without asking the class loader every single time after we know it s not there .
140,753
protected Object getNIOInstance ( Constructor < ? > constructor , Object ... args ) throws InstantiationException , IllegalAccessException , IllegalArgumentException , InvocationTargetException { final String method = "getInstance" ; Object ret = null ; if ( tryNIO ) { if ( constructor != null ) { try { ret = ( IResour...
Utility method to catch class loading issues and prevent repeated attempts to use reflection .
140,754
@ SuppressWarnings ( { "rawtypes" , "unchecked" } ) void complete ( ) { if ( this . range != null ) { AbstractValidatorRange validator = null ; if ( this . valueType != null ) { Class < ? > valueClass = this . valueType . getAssignmentClass ( ) ; if ( this . valueType . isCollection ( ) ) { validator = new ValidatorCol...
Has to be called at the end to complete the processing .
140,755
protected void handleNoGetterForSetter ( PojoPropertyAccessorOneArg setter , Class < ? > targetClass , Object sourceObject , Class < ? > sourceClass ) { throw new PojoPropertyNotFoundException ( sourceClass , setter . getName ( ) ) ; }
Called if the target object of the conversion has a setter that has no corresponding getter in the source object to convert .
140,756
private void appendConsoleLogging ( Node root ) { if ( logDebug && consoleDebugOutput . size ( ) > 0 ) { Node node = root ; if ( node . getType ( ) == Token . BLOCK ) { node = node . getFirstChild ( ) ; } if ( node . getType ( ) == Token . SCRIPT ) { if ( source == null ) { Node firstNode = node . getFirstChild ( ) ; f...
Appends the console log output if any to the end of the module
140,757
public void close ( ) throws IOException { if ( dataStream != null ) dataStream . close ( ) ; byteStream = null ; dataStream = null ; }
Closes the file . No more reading is possible after the file has been closed .
140,758
protected Collection < String > getRequestedLocales ( HttpServletRequest request ) { final String sourceMethod = "getRequestedLocales" ; boolean isTraceLogging = log . isLoggable ( Level . FINER ) ; if ( isTraceLogging ) { log . entering ( sourceClass , sourceMethod , new Object [ ] { request . getQueryString ( ) } ) ;...
Returns the requested locales as a collection of locale strings
140,759
protected String getHasConditionsFromRequest ( HttpServletRequest request ) throws IOException { final String sourceMethod = "getHasConditionsFromRequest" ; boolean isTraceLogging = log . isLoggable ( Level . FINER ) ; if ( isTraceLogging ) { log . entering ( sourceClass , sourceMethod , new Object [ ] { request } ) ; ...
This method checks the request for the has conditions which may either be contained in URL query arguments or in a cookie sent from the client .
140,760
protected static String getParameter ( HttpServletRequest request , String [ ] aliases ) { final String sourceMethod = "getParameter" ; boolean isTraceLogging = log . isLoggable ( Level . FINER ) ; if ( isTraceLogging ) { log . entering ( sourceClass , sourceMethod , new Object [ ] { request . getQueryString ( ) , Arra...
Returns the value of the requested parameter from the request or null
140,761
protected OptimizationLevel getOptimizationLevelFromRequest ( HttpServletRequest request ) { final String sourceMethod = "getOptimizationLevelFromRequest" ; boolean isTraceLogging = log . isLoggable ( Level . FINER ) ; if ( isTraceLogging ) { log . entering ( sourceClass , sourceMethod , new Object [ ] { request . getQ...
Returns the requested optimization level from the request .
140,762
protected String getDynamicLoaderExtensionJavaScript ( HttpServletRequest request ) { final String sourceMethod = "getDynamicLoaderExtensionJavaScript" ; boolean isTraceLogging = log . isLoggable ( Level . FINER ) ; if ( isTraceLogging ) { log . entering ( sourceClass , sourceMethod ) ; } StringBuffer sb = new StringBu...
Returns the dynamic portion of the loader extension javascript for this transport . This includes all registered extension contributions .
140,763
protected FeatureListResourceFactory newFeatureListResourceFactory ( URI resourceUri ) { final String methodName = "newFeatureMapJSResourceFactory" ; boolean traceLogging = log . isLoggable ( Level . FINER ) ; if ( traceLogging ) { log . entering ( sourceClass , methodName , new Object [ ] { resourceUri } ) ; } Feature...
Returns an instance of a FeatureMapJSResourceFactory .
140,764
protected String clientRegisterSyntheticModules ( ) { final String methodName = "clientRegisterSyntheticModules" ; boolean traceLogging = log . isLoggable ( Level . FINER ) ; if ( traceLogging ) { log . entering ( sourceClass , methodName ) ; } StringBuffer sb = new StringBuffer ( ) ; Map < String , Integer > map = get...
Returns the JavaScript code for calling the client - side module name id registration function to register name ids for the transport synthetic modules .
140,765
public static void main ( String [ ] args ) { System . out . println ( LONG_NAME + " - Release " + RELEASE ) ; System . out . println ( ) ; System . out . println ( " " + CREDO ) ; System . out . println ( ) ; System . out . println ( "Project maintainer: " + MAINTAINER ) ; System . out . println ( "Javadoc accessible...
Prints a small informative message about the current release .
140,766
private static int [ ] toBoundaries ( String str ) { int [ ] res = new int [ 9 ] ; String [ ] split = str . split ( "\\s+" ) ; for ( int i = 0 ; i < 9 ; i ++ ) { res [ i ] = Integer . valueOf ( split [ i ] ) . intValue ( ) ; } return res ; }
Converts a param string to boundaries array .
140,767
public Slice build ( ) throws SchedulerException { if ( hoster == null ) { hoster = rp . makeHostVariable ( lblPrefix , "_hoster" ) ; } if ( start == null ) { start = rp . getStart ( ) ; } if ( end == null ) { end = rp . getEnd ( ) ; } if ( duration == null ) { duration = makeDuration ( ) ; } if ( ! start . isInstantia...
Build the slice .
140,768
private IntVar makeDuration ( ) throws SchedulerException { if ( start . isInstantiated ( ) && end . isInstantiated ( ) ) { int d = end . getValue ( ) - start . getValue ( ) ; return rp . makeDuration ( d , d , lblPrefix , "_duration" ) ; } else if ( start . isInstantiated ( ) ) { if ( start . isInstantiatedTo ( 0 ) ) ...
Make the duration variable depending on the others .
140,769
public String generateSourceMap ( ) throws IOException { final String sourceMethod = "generateSourceMap" ; final boolean isTraceLogging = log . isLoggable ( Level . FINER ) ; if ( isTraceLogging ) { log . entering ( sourceClass , sourceMethod , new Object [ ] { name } ) ; } String result = null ; lineLengths = getLineL...
Generate the identity source map and return the result .
140,770
private void processNode ( Node node ) throws IOException { for ( Node cursor = node . getFirstChild ( ) ; cursor != null ; cursor = cursor . getNext ( ) ) { int lineno = cursor . getLineno ( ) - 1 ; int charno = cursor . getCharno ( ) ; if ( lineno > currentLine || lineno == currentLine && charno > currentChar ) { cur...
Recursively processes the input node adding a mapping for the node to the source map generator .
140,771
protected void dispatchEvents ( ) { while ( true ) { Object event = this . eventQueue . poll ( ) ; if ( event == null ) { return ; } Collection < Throwable > errors = new LinkedList < > ( ) ; dispatchEvent ( event , errors ) ; if ( ! errors . isEmpty ( ) ) { handleErrors ( errors , event ) ; } } }
Dispatches all events in the event queue .
140,772
protected void handleErrors ( Collection < Throwable > errors , Object event ) { if ( this . globalExceptionHandler == null ) { for ( Throwable error : errors ) { LOG . error ( "Failed to dispatch event {}" , event , error ) ; } } else { this . globalExceptionHandler . handleErrors ( event , errors . toArray ( new Thro...
This method is called if errors occurred while dispatching events .
140,773
public BtrpOperand go ( BtrPlaceTree parent ) { append ( token , "Unhandled token " + token . getText ( ) + " (type=" + token . getType ( ) + ")" ) ; return IgnorableOperand . getInstance ( ) ; }
Parse the root of the tree .
140,774
public IgnorableOperand ignoreError ( Exception e ) { append ( token , e . getMessage ( ) ) ; return IgnorableOperand . getInstance ( ) ; }
Report an error from an exception for the current token
140,775
public IgnorableOperand ignoreErrors ( ErrorReporter err ) { errors . getErrors ( ) . addAll ( err . getErrors ( ) ) ; return IgnorableOperand . getInstance ( ) ; }
Add all the error messages included in a reporter .
140,776
public IgnorableOperand ignoreError ( Token t , String msg ) { append ( t , msg ) ; return IgnorableOperand . getInstance ( ) ; }
Add an error message to a given error
140,777
public void append ( Token t , String msg ) { errors . append ( t . getLine ( ) , t . getCharPositionInLine ( ) , msg ) ; }
Add an error message related to a given token
140,778
public T execute ( ) { if ( isWindows ( ) ) { return onWindows ( ) ; } else if ( isMac ( ) ) { return onMac ( ) ; } else if ( isUnix ( ) ) { return onUnix ( ) ; } else if ( isSolaris ( ) ) { return onSolaris ( ) ; } else { throw new IllegalStateException ( "Invalid operating system " + os ) ; } }
Main method that should be executed . This will return the proper result depending on your platform .
140,779
public BtrpOperand expand ( ) { String head = getChild ( 0 ) . getText ( ) . substring ( 0 , getChild ( 0 ) . getText ( ) . length ( ) - 1 ) ; String tail = getChild ( getChildCount ( ) - 1 ) . getText ( ) . substring ( 1 ) ; BtrpSet res = new BtrpSet ( 1 , BtrpOperand . Type . STRING ) ; for ( int i = 1 ; i < getChild...
Expand the enumeration . Variables are not evaluated nor checked
140,780
public void add ( DepTreeNode child ) { if ( children == null ) { children = new HashMap < String , DepTreeNode > ( ) ; } children . put ( child . getName ( ) , child ) ; child . setParent ( this ) ; }
Add the specified node to this node s children .
140,781
public void overlay ( DepTreeNode node ) { if ( node . defineDependencies != null || node . requireDependencies != null ) { setDependencies ( node . defineDependencies , node . requireDependencies , node . dependentFeatures , node . lastModified ( ) , node . lastModifiedDep ( ) ) ; } node . uri = uri ; if ( node . getC...
Overlay the specified node and its descendants over this node . The specified node will be merged with this node with the dependencies of any nodes from the specified node replacing the dependencies of the corresponding node in this node s tree .
140,782
public DepTreeNode createOrGet ( String path , URI uri ) { if ( path . startsWith ( "/" ) ) { throw new IllegalArgumentException ( path ) ; } if ( path . length ( ) == 0 ) return this ; String [ ] pathComps = path . split ( "/" ) ; DepTreeNode node = this ; int i = 0 ; for ( String comp : pathComps ) { DepTreeNode chil...
Returns the node at the specified path location within the tree or creates it if it is not already in the tree . Will create any required parent nodes .
140,783
public void remove ( DepTreeNode child ) { if ( children != null ) { DepTreeNode node = children . get ( child . getName ( ) ) ; if ( node == child ) { children . remove ( child . getName ( ) ) ; } } child . setParent ( null ) ; }
Removes the specified child node
140,784
public void prune ( ) { if ( children != null ) { List < String > removeList = new ArrayList < String > ( ) ; for ( Entry < String , DepTreeNode > entry : children . entrySet ( ) ) { DepTreeNode child = entry . getValue ( ) ; child . prune ( ) ; if ( ( child . defineDependencies == null && child . requireDependencies =...
Recursively walks the node tree removing folder nodes that have not children .
140,785
public void setDependencies ( String [ ] defineDependencies , String [ ] requireDependencies , String [ ] dependentFeatures , long lastModifiedFile , long lastModifiedDep ) { this . defineDependencies = defineDependencies ; this . requireDependencies = requireDependencies ; this . dependentFeatures = dependentFeatures ...
Specifies the dependency list of modules for the module named by this node along with the last modified date of the javascript file that the dependency list was obtained from .
140,786
private long lastModifiedDepTree ( long lm ) { long result = ( defineDependencies == null && requireDependencies == null ) ? lm : Math . max ( lm , this . lastModifiedDep ) ; if ( children != null ) { for ( Entry < String , DepTreeNode > entry : this . children . entrySet ( ) ) { result = entry . getValue ( ) . lastMod...
Returns the most recent last modified date for all the dependencies that are descendants of this node including this node .
140,787
void populateDepMap ( Map < String , DependencyInfo > depMap ) { if ( uri != null ) { depMap . put ( getFullPathName ( ) , new DependencyInfo ( defineDependencies , requireDependencies , dependentFeatures , uri ) ) ; } if ( children != null ) { for ( Entry < String , DepTreeNode > entry : children . entrySet ( ) ) { en...
Populates the provided map with the dependencies keyed by full path name . This is done to facilitate more efficient lookups of the dependencies .
140,788
private void readObject ( ObjectInputStream in ) throws IOException , ClassNotFoundException { in . defaultReadObject ( ) ; parent = new WeakReference < DepTreeNode > ( null ) ; if ( children != null ) { for ( Entry < String , DepTreeNode > entry : children . entrySet ( ) ) { entry . getValue ( ) . setParent ( this ) ;...
Method called when this object is de - serialized
140,789
protected ServiceTracker < IOptions , ? > getOptionsServiceTracker ( BundleContext bundleContext ) throws InvalidSyntaxException { ServiceTracker < IOptions , ? > tracker = new ServiceTracker < IOptions , Object > ( bundleContext , bundleContext . createFilter ( "(&(" + Constants . OBJECTCLASS + "=" + IOptions . class ...
Returns an opened ServiceTracker for the Aggregator options . Aggregator options are created by the bundle activator and are shared by all Aggregator instances created from the same bundle .
140,790
protected ServiceTracker < IExecutors , ? > getExecutorsServiceTracker ( BundleContext bundleContext ) throws InvalidSyntaxException { ServiceTracker < IExecutors , ? > tracker = new ServiceTracker < IExecutors , Object > ( bundleContext , bundleContext . createFilter ( "(&(" + Constants . OBJECTCLASS + "=" + IExecutor...
Returns an opened ServiceTracker for the Aggregator exectors provider . The executors provider is are created by the bundle activator and is shared by all Aggregator instances created from the same bundle .
140,791
public String createCacheBundle ( String bundleSymbolicName , String bundleFileName ) throws IOException { final String sourceMethod = "createCacheBundle" ; final boolean isTraceLogging = log . isLoggable ( Level . FINER ) ; if ( isTraceLogging ) { log . entering ( sourceClass , sourceMethod , new Object [ ] { bundleSy...
Command handler to create a cache primer bundle containing the contents of the cache directory .
140,792
public String processRequestUrl ( String requestUrl ) throws IOException , ServletException { ConsoleHttpServletRequest req = new ConsoleHttpServletRequest ( getServletConfig ( ) . getServletContext ( ) , requestUrl ) ; OutputStream nulOutputStream = new OutputStream ( ) { public void write ( int b ) throws IOException...
Implementation of eponymous console command . Provided to allow cache priming requests to be issued via the server console by automation scripts .
140,793
public void add ( VMTransitionBuilder b ) { Map < VMState , VMTransitionBuilder > m = vmAMB2 . get ( b . getDestinationState ( ) ) ; for ( VMState src : b . getSourceStates ( ) ) { m . put ( src , b ) ; } }
Add a builder for a VM . Every builder that supports the same transition will be replaced .
140,794
public boolean remove ( VMTransitionBuilder b ) { Map < VMState , VMTransitionBuilder > m = vmAMB2 . get ( b . getDestinationState ( ) ) ; for ( VMState src : b . getSourceStates ( ) ) { m . remove ( src ) ; } return true ; }
Remove a builder for an action on a VM .
140,795
public VMTransitionBuilder getBuilder ( VMState srcState , VMState dstState ) { Map < VMState , VMTransitionBuilder > dstCompliant = vmAMB2 . get ( dstState ) ; if ( dstCompliant == null ) { return null ; } return dstCompliant . get ( srcState ) ; }
Get the model builder for a given transition
140,796
public static TransitionFactory newBundle ( ) { TransitionFactory f = new TransitionFactory ( ) ; f . add ( new BootVM . Builder ( ) ) ; f . add ( new ShutdownVM . Builder ( ) ) ; f . add ( new SuspendVM . Builder ( ) ) ; f . add ( new ResumeVM . Builder ( ) ) ; f . add ( new KillVM . Builder ( ) ) ; f . add ( new Relo...
a new factory that embeds the default builders .
140,797
public int getMaxBW ( Node n1 , Node n2 ) { int max = Integer . MAX_VALUE ; for ( Link inf : getPath ( n1 , n2 ) ) { if ( inf . getCapacity ( ) < max ) { max = inf . getCapacity ( ) ; } Switch sw = inf . getSwitch ( ) ; if ( sw . getCapacity ( ) >= 0 && sw . getCapacity ( ) < max ) { max = sw . getCapacity ( ) ; } } re...
Get the maximal bandwidth available between two nodes .
140,798
protected List < Link > getFirstPhysicalPath ( List < Link > currentPath , Switch sw , Node dst ) { for ( Link l : net . getConnectedLinks ( sw ) ) { if ( currentPath . contains ( l ) ) { continue ; } currentPath . add ( l ) ; if ( l . getElement ( ) instanceof Node ) { if ( l . getElement ( ) . equals ( dst ) ) { retu...
Recursive method to get the first physical path found from a switch to a destination node .
140,799
private int loadSlack ( int dim , int bin ) { return p . loads [ dim ] [ bin ] . getUB ( ) - p . loads [ dim ] [ bin ] . getLB ( ) ; }
compute the load slack of a bin