idx
int64
0
41.2k
question
stringlengths
83
4.15k
target
stringlengths
5
715
17,000
public static RePairGrammar buildGrammar ( SAXRecords saxRecords ) { RePairGrammar grammar = NewRepair . parse ( saxRecords . getSAXString ( SPACE ) ) ; return grammar ; }
Builds a repair grammar given a set of SAX records .
17,001
public static RePairGrammar buildGrammar ( String inputString ) { RePairGrammar grammar = NewRepair . parse ( inputString ) ; return grammar ; }
Builds a grammar given a string of terminals delimeted by space .
17,002
public String getValue ( String name ) { String result = null ; for ( InitParam initParam : initParams ) { if ( initParam . getName ( ) . equals ( name ) ) { result = initParam . getValue ( ) ; break ; } } return result ; }
Returns the value of the first instance of the named init - param or null if the init - param is not found .
17,003
public Collection < String > getNames ( ) { Collection < String > names = new HashSet < String > ( ) ; for ( InitParam initParam : initParams ) { names . add ( initParam . getName ( ) ) ; } return names ; }
Returns a collection of the init - param names or an empty collection if there are no init - params
17,004
public void setRefreshDelayInSeconds ( int refreshDelayInSeconds ) { ValueOutOfRangeException . checkRange ( Integer . valueOf ( refreshDelayInSeconds ) , MIN_DELAY , Integer . valueOf ( Integer . MAX_VALUE ) , getClass ( ) . getSimpleName ( ) + ".refreshDelayInSeconds" ) ; this . refreshDelayInSeconds = refreshDelayIn...
This method sets the refresh - delay in seconds . A reasonable value should be at least 5 seconds but better in the range of minutes .
17,005
public void register ( ModelViewConverter < ? extends ModelView > c ) { java2json . put ( c . getSupportedView ( ) , c ) ; json2java . put ( c . getJSONId ( ) , c ) ; }
Register a converter for a specific view .
17,006
public ModelView fromJSON ( Model mo , JSONObject in ) throws JSONConverterException { checkKeys ( in , ModelViewConverter . IDENTIFIER ) ; Object id = in . get ( ModelViewConverter . IDENTIFIER ) ; ModelViewConverter < ? extends ModelView > c = json2java . get ( id . toString ( ) ) ; if ( c == null ) { throw new JSONC...
Convert a json - encoded view .
17,007
public JSONObject toJSON ( ModelView o ) throws JSONConverterException { ModelViewConverter c = java2json . get ( o . getClass ( ) ) ; if ( c == null ) { throw new JSONConverterException ( "No converter available for a view with the '" + o . getClass ( ) + "' className" ) ; } return c . toJSON ( o ) ; }
Serialise a view .
17,008
public DistanceElement getElement ( long id ) { if ( ! vector . containsKey ( id ) ) vector . put ( id , new DistanceElement ( id ) ) ; return vector . get ( id ) ; }
Gets an element of the distance vector based on the given node id . If a DistanceElement object with the given id does not exist in the vector a new object with the id is added to it . Then the element with the given id as key is returned in the end .
17,009
public void printPathTo ( long targetId ) { System . out . println ( getPath ( targetId ) . stream ( ) . map ( String :: valueOf ) . reduce ( ( s1 , s2 ) -> s1 + " -> " + s2 ) . get ( ) ) ; }
Prints the path between a source node and a target node if it exists . If it does not exist a message indicating this is shown . Is a path does exist a sequence of nodes is printed to show the path that the nodes share .
17,010
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 .
17,011
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 .
17,012
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 .
17,013
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 .
17,014
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 .
17,015
public static < T > Predicate < T > TRUE ( ) { return new Predicate < T > ( ) { public boolean check ( T obj ) { return true ; } } ; }
Returns an always - true predicate .
17,016
public static < T > Predicate < T > FALSE ( ) { return Predicate . < T > NOT ( Predicate . < T > TRUE ( ) ) ; }
Returns an always - false predicate .
17,017
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 .
17,018
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 .
17,019
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 .
17,020
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
17,021
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 .
17,022
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 .
17,023
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 .
17,024
public void setMinMaxLength ( int [ ] lengths ) { Arrays . sort ( lengths ) ; this . minLength = lengths [ 0 ] ; this . maxLength = lengths [ lengths . length - 1 ] ; }
Set min and max lengths .
17,025
@ 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 .
17,026
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 .
17,027
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
17,028
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 .
17,029
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 .
17,030
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 .
17,031
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 .
17,032
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 .
17,033
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
17,034
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 .
17,035
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 .
17,036
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 .
17,037
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 .
17,038
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 .
17,039
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 .
17,040
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 .
17,041
public static LabelledInstance instance ( File f ) { String path = f . getAbsolutePath ( ) ; return new LabelledInstance ( path , JSON . readInstance ( f ) ) ; }
Make an instance .
17,042
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 .
17,043
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 .
17,044
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 .
17,045
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 .
17,046
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
17,047
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 .
17,048
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 .
17,049
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 .
17,050
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 .
17,051
public boolean applyAction ( Model c ) { Mapping map = c . getMapping ( ) ; return ! map . isOffline ( node ) && map . addOfflineNode ( node ) ; }
Put the node offline on a model
17,052
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 .
17,053
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 .
17,054
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 .
17,055
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 .
17,056
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
17,057
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
17,058
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
17,059
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 .
17,060
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 .
17,061
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 .
17,062
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 .
17,063
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 .
17,064
@ 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 .
17,065
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 .
17,066
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
17,067
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 .
17,068
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
17,069
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 .
17,070
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
17,071
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 .
17,072
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 .
17,073
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 .
17,074
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 .
17,075
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 .
17,076
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 .
17,077
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 .
17,078
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 .
17,079
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 .
17,080
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 .
17,081
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 .
17,082
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 .
17,083
public BtrpOperand go ( BtrPlaceTree parent ) { append ( token , "Unhandled token " + token . getText ( ) + " (type=" + token . getType ( ) + ")" ) ; return IgnorableOperand . getInstance ( ) ; }
Parse the root of the tree .
17,084
public IgnorableOperand ignoreError ( Exception e ) { append ( token , e . getMessage ( ) ) ; return IgnorableOperand . getInstance ( ) ; }
Report an error from an exception for the current token
17,085
public IgnorableOperand ignoreErrors ( ErrorReporter err ) { errors . getErrors ( ) . addAll ( err . getErrors ( ) ) ; return IgnorableOperand . getInstance ( ) ; }
Add all the error messages included in a reporter .
17,086
public IgnorableOperand ignoreError ( Token t , String msg ) { append ( t , msg ) ; return IgnorableOperand . getInstance ( ) ; }
Add an error message to a given error
17,087
public void append ( Token t , String msg ) { errors . append ( t . getLine ( ) , t . getCharPositionInLine ( ) , msg ) ; }
Add an error message related to a given token
17,088
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 .
17,089
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
17,090
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 .
17,091
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 .
17,092
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 .
17,093
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
17,094
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 .
17,095
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 .
17,096
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 .
17,097
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 .
17,098
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
17,099
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 .