signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class LineItemCreativeAssociation { /** * Gets the sizes value for this LineItemCreativeAssociation .
* @ return sizes * Overrides the value set for { @ link Creative # size } , which allows
* the
* creative to be served to ad units that would otherwise
* not be compatible
* for its actual size . This value is optional . */
public com . google . api . ads . admanager . axis . v201805 . Size [ ] getSizes ( ) { } } | return sizes ; |
public class ResourceLocator { /** * 将指定类的类名中所有 . 替换为 / , 并在后面补上 . class */
static String getClassPathName ( Class < ? > c ) { } } | String strClassFullName = c . getName ( ) ; StringTokenizer st = new StringTokenizer ( strClassFullName , "." ) ; StringBuffer sb = new StringBuffer ( ) ; sb . append ( st . nextToken ( ) ) ; while ( st . hasMoreTokens ( ) ) { sb . append ( "/" ) ; sb . append ( st . nextToken ( ) ) ; } sb . append ( ".class" ) ; return sb . toString ( ) ; |
public class PeriodicTable { /** * Get the phase of the element .
* @ param symbol the symbol of the element
* @ return the phase of the element */
public static String getPhase ( String symbol ) { } } | Elements e = Elements . ofString ( symbol ) ; for ( Phase p : Phase . values ( ) ) if ( p . contains ( e ) ) return p . name ( ) ; return null ; |
public class ParameterUtils { /** * 将字符串转换成Long
* @ param param number string
* @ return long or null if parameter is null or empty . */
public static Long parseLong ( String param ) { } } | try { if ( ! StringUtils . isBlank ( param ) ) { return Long . valueOf ( param ) ; } } catch ( Exception e ) { throw new IllegalArgumentException ( "Parameter " + param + " is not a number." ) ; } return null ; |
public class InternalQueries { /** * Converts array of something to non - null set .
* @ param firstItem the first required source item .
* @ param otherItems other source items to convert , can be { @ code null } .
* @ return non - null , set of something . */
@ SuppressWarnings ( "unchecked" ) @ NonNull public static Set < String > nonNullSet ( @ NonNull String firstItem , @ Nullable String [ ] otherItems ) { } } | final HashSet < String > set = new HashSet < String > ( ) ; set . add ( firstItem ) ; if ( otherItems != null ) { set . addAll ( asList ( otherItems ) ) ; } return set ; |
public class Base64Coder { /** * Encodes a byte array into Base 64 format and breaks the output into lines .
* @ param in An array containing the data bytes to be encoded .
* @ param iOff Offset of the first byte in < code > in < / code > to be processed .
* @ param iLen Number of bytes to be processed in < code > in < / code > , starting at < code > iOff < / code > .
* @ param lineLen Line length for the output data . Should be a multiple of 4.
* @ param lineSeparator The line separator to be used to separate the output lines .
* @ return A String containing the Base64 encoded data , broken into lines . */
public static String encodeLines ( byte [ ] in , int iOff , int iLen , int lineLen , String lineSeparator ) { } } | final int blockLen = lineLen * 3 / 4 ; if ( blockLen <= 0 ) { throw new IllegalArgumentException ( ) ; } final int lines = ( iLen + blockLen - 1 ) / blockLen ; final int bufLen = ( iLen + 2 ) / 3 * 4 + lines * lineSeparator . length ( ) ; final StringBuilder buf = new StringBuilder ( bufLen ) ; int ip = 0 ; while ( ip < iLen ) { final int l = Math . min ( iLen - ip , blockLen ) ; buf . append ( encode ( in , iOff + ip , l ) ) ; buf . append ( lineSeparator ) ; ip += l ; } return buf . toString ( ) ; |
public class DriversView { /** * This method is called from within the constructor to initialize the form .
* WARNING : Do NOT modify this code . The content of this method is always
* regenerated by the Form Editor . */
private void initComponents ( ) { } } | fileLabel = new JLabel ( ) ; fileTextField = new ZapTextField ( ) ; browseButton = new JButton ( ) ; nameLabel = new JLabel ( ) ; nameTextField = new ZapTextField ( ) ; slotLabel = new JLabel ( ) ; slotTextField = new ZapTextField ( ) ; slotListIndexLabel = new JLabel ( ) ; slotListIndexTextField = new ZapTextField ( ) ; addButton = new JButton ( ) ; deleteButton = new JButton ( ) ; closeButton = new JButton ( ) ; driverScrollPane = new JScrollPane ( ) ; driverTable = new JTable ( ) ; setTitle ( Constant . messages . getString ( "certificates.pkcs11.drivers.title" ) ) ; fileLabel . setText ( Constant . messages . getString ( "certificates.pkcs11.drivers.label.path" ) ) ; browseButton . setText ( Constant . messages . getString ( "certificates.pkcs11.drivers.button.browse" ) ) ; browseButton . addActionListener ( new ActionListener ( ) { @ Override public void actionPerformed ( ActionEvent evt ) { browseButtonActionPerformed ( evt ) ; } } ) ; nameLabel . setText ( Constant . messages . getString ( "certificates.pkcs11.drivers.label.name" ) ) ; slotLabel . setText ( Constant . messages . getString ( "certificates.pkcs11.drivers.label.slot" ) ) ; slotListIndexLabel . setText ( Constant . messages . getString ( "certificates.pkcs11.drivers.label.slotIndex" ) ) ; addButton . setText ( Constant . messages . getString ( "certificates.pkcs11.drivers.button.add" ) ) ; addButton . addActionListener ( new ActionListener ( ) { @ Override public void actionPerformed ( ActionEvent evt ) { addButtonActionPerformed ( evt ) ; } } ) ; deleteButton . setText ( Constant . messages . getString ( "certificates.pkcs11.drivers.button.delete" ) ) ; deleteButton . addActionListener ( new ActionListener ( ) { @ Override public void actionPerformed ( ActionEvent evt ) { deleteButtonActionPerformed ( evt ) ; } } ) ; closeButton . setText ( Constant . messages . getString ( "certificates.pkcs11.drivers.button.close" ) ) ; closeButton . addActionListener ( new ActionListener ( ) { @ Override public void actionPerformed ( ActionEvent evt ) { closeButtonActionPerformed ( evt ) ; } } ) ; driverTable . setModel ( driverTableModel ) ; driverScrollPane . setViewportView ( driverTable ) ; // When experimental SlotListIndex support is used , the slotTextField is disabled ( and vice versa ) ,
// as only one of these parameters is actually used .
if ( ! Model . getSingleton ( ) . getOptionsParam ( ) . getExperimentalFeaturesParam ( ) . isExerimentalSliSupportEnabled ( ) ) { slotTextField . setEnabled ( false ) ; } final GroupLayout layout = new GroupLayout ( getContentPane ( ) ) ; getContentPane ( ) . setLayout ( layout ) ; layout . setHorizontalGroup ( layout . createParallelGroup ( GroupLayout . Alignment . LEADING ) . addGroup ( layout . createSequentialGroup ( ) . addContainerGap ( ) . addGroup ( layout . createParallelGroup ( GroupLayout . Alignment . LEADING ) . addComponent ( fileLabel ) . addComponent ( nameLabel ) . addComponent ( slotLabel ) . addComponent ( slotListIndexLabel ) . addGroup ( layout . createSequentialGroup ( ) . addGroup ( layout . createParallelGroup ( GroupLayout . Alignment . TRAILING , false ) . addComponent ( nameTextField , GroupLayout . Alignment . LEADING ) . addComponent ( slotTextField , GroupLayout . Alignment . LEADING ) . addComponent ( slotListIndexTextField , GroupLayout . Alignment . LEADING ) . addComponent ( fileTextField , GroupLayout . Alignment . LEADING , GroupLayout . DEFAULT_SIZE , 322 , Short . MAX_VALUE ) ) . addPreferredGap ( LayoutStyle . ComponentPlacement . RELATED ) . addGroup ( layout . createParallelGroup ( GroupLayout . Alignment . LEADING ) . addComponent ( addButton , GroupLayout . DEFAULT_SIZE , 80 , Short . MAX_VALUE ) . addComponent ( browseButton ) ) ) ) . addContainerGap ( 165 , Short . MAX_VALUE ) ) . addGroup ( GroupLayout . Alignment . TRAILING , layout . createSequentialGroup ( ) . addGap ( 499 , 499 , 499 ) . addComponent ( closeButton , GroupLayout . DEFAULT_SIZE , 74 , Short . MAX_VALUE ) . addContainerGap ( ) ) . addGroup ( layout . createSequentialGroup ( ) . addContainerGap ( ) . addComponent ( driverScrollPane , GroupLayout . DEFAULT_SIZE , 561 , Short . MAX_VALUE ) . addContainerGap ( ) ) . addGroup ( GroupLayout . Alignment . TRAILING , layout . createSequentialGroup ( ) . addContainerGap ( 499 , Short . MAX_VALUE ) . addComponent ( deleteButton ) . addContainerGap ( ) ) ) ; layout . setVerticalGroup ( layout . createParallelGroup ( GroupLayout . Alignment . LEADING ) . addGroup ( GroupLayout . Alignment . TRAILING , layout . createSequentialGroup ( ) . addContainerGap ( ) . addComponent ( fileLabel ) . addPreferredGap ( LayoutStyle . ComponentPlacement . RELATED ) . addGroup ( layout . createParallelGroup ( GroupLayout . Alignment . LEADING , false ) . addComponent ( browseButton , 0 , 0 , Short . MAX_VALUE ) . addComponent ( fileTextField ) ) . addPreferredGap ( LayoutStyle . ComponentPlacement . RELATED ) . addComponent ( nameLabel ) . addPreferredGap ( LayoutStyle . ComponentPlacement . RELATED ) . addGroup ( layout . createParallelGroup ( GroupLayout . Alignment . BASELINE ) . addComponent ( nameTextField , GroupLayout . PREFERRED_SIZE , GroupLayout . DEFAULT_SIZE , GroupLayout . PREFERRED_SIZE ) ) . addPreferredGap ( LayoutStyle . ComponentPlacement . RELATED ) . addComponent ( slotLabel ) . addPreferredGap ( LayoutStyle . ComponentPlacement . RELATED ) . addGroup ( layout . createParallelGroup ( GroupLayout . Alignment . BASELINE ) . addComponent ( slotTextField , GroupLayout . PREFERRED_SIZE , GroupLayout . DEFAULT_SIZE , GroupLayout . PREFERRED_SIZE ) ) . addGap ( 28 , 28 , 28 ) . addComponent ( slotListIndexLabel ) . addPreferredGap ( LayoutStyle . ComponentPlacement . RELATED ) . addGroup ( layout . createParallelGroup ( GroupLayout . Alignment . BASELINE ) . addComponent ( slotListIndexTextField , GroupLayout . PREFERRED_SIZE , GroupLayout . DEFAULT_SIZE , GroupLayout . PREFERRED_SIZE ) . addComponent ( addButton , GroupLayout . PREFERRED_SIZE , 19 , GroupLayout . PREFERRED_SIZE ) ) . addGap ( 28 , 28 , 28 ) . addComponent ( driverScrollPane , GroupLayout . PREFERRED_SIZE , 195 , GroupLayout . PREFERRED_SIZE ) . addPreferredGap ( LayoutStyle . ComponentPlacement . RELATED ) . addComponent ( deleteButton ) . addPreferredGap ( LayoutStyle . ComponentPlacement . RELATED , 9 , Short . MAX_VALUE ) . addComponent ( closeButton , GroupLayout . PREFERRED_SIZE , 10 , GroupLayout . PREFERRED_SIZE ) . addContainerGap ( ) ) ) ; layout . linkSize ( SwingConstants . VERTICAL , new Component [ ] { addButton , browseButton , closeButton , deleteButton , fileTextField , nameTextField } ) ; for ( int i = 0 ; i < driverTableModel . getColumnCount ( ) ; i ++ ) { driverTable . getColumnModel ( ) . getColumn ( i ) . setPreferredWidth ( driverTableModel . getPreferredWith ( i ) ) ; } pack ( ) ; |
public class GlobalJarUploader { /** * Creates the JAR file with the global files on the driver and then uploads it to the job folder on
* ( H ) DFS .
* @ return the map to be used as the " global " resources when submitting Evaluators .
* @ throws IOException if the creation of the JAR or the upload fails */
@ Override public synchronized Map < String , LocalResource > call ( ) throws IOException { } } | final Map < String , LocalResource > globalResources = new HashMap < > ( 1 ) ; if ( ! this . isUploaded ) { this . pathToGlobalJar = this . uploader . uploadToJobFolder ( makeGlobalJar ( ) ) ; this . isUploaded = true ; } final LocalResource updatedGlobalJarResource = this . uploader . makeLocalResourceForJarFile ( this . pathToGlobalJar ) ; if ( this . globalJarResource != null && this . globalJarResource . getTimestamp ( ) != updatedGlobalJarResource . getTimestamp ( ) ) { LOG . log ( Level . WARNING , "The global JAR LocalResource timestamp has been changed from " + this . globalJarResource . getTimestamp ( ) + " to " + updatedGlobalJarResource . getTimestamp ( ) ) ; } this . globalJarResource = updatedGlobalJarResource ; // For now , always rewrite the information due to REEF - 348
globalResources . put ( this . fileNames . getGlobalFolderPath ( ) , updatedGlobalJarResource ) ; return globalResources ; |
public class AbstractSaml20ObjectBuilder { /** * Gets name id .
* @ param nameIdFormat the name id format
* @ param nameIdValue the name id value
* @ return the name iD */
public NameID getNameID ( final String nameIdFormat , final String nameIdValue ) { } } | val nameId = newSamlObject ( NameID . class ) ; nameId . setFormat ( nameIdFormat ) ; nameId . setValue ( nameIdValue ) ; return nameId ; |
public class SREConfigurationBlock { /** * Replies the selected SARL runtime environment .
* @ return the SARL runtime environment or < code > null < / code > if
* there is no selected SRE .
* @ see # isSystemWideDefaultSRE ( ) */
public ISREInstall getSelectedSRE ( ) { } } | if ( this . enableSystemWideSelector && this . systemSREButton . getSelection ( ) ) { return SARLRuntime . getDefaultSREInstall ( ) ; } if ( ! this . projectProviderFactories . isEmpty ( ) && this . projectSREButton . getSelection ( ) ) { return retreiveProjectSRE ( ) ; } return getSpecificSRE ( ) ; |
public class HtmlSelectManyListbox { /** * < p > Return the value of the < code > enabledClass < / code > property . < / p >
* < p > Contents : CSS style class to apply to the rendered label
* on enabled options . */
public java . lang . String getEnabledClass ( ) { } } | return ( java . lang . String ) getStateHelper ( ) . eval ( PropertyKeys . enabledClass ) ; |
public class TcpProxyBuffer { /** * This method try to write data from buffer to channel .
* Buffer changes state to READY _ TO _ READ only if all data were wrote to channel ,
* in other case you should call this method again
* @ param channel - channel
* @ throws IOException */
public void writeTo ( SocketChannel channel ) throws IOException { } } | channel . write ( buffer ) ; // only if buffer is empty
if ( buffer . remaining ( ) == 0 ) { buffer . clear ( ) ; state = BufferState . READY_TO_WRITE ; } |
public class Default { private int getInitInt ( String name ) { } } | String value = getInitParameter ( name ) ; if ( value != null && value . length ( ) > 0 ) return Integer . parseInt ( value ) ; return - 1 ; |
public class Caster { /** * cast a Object to a Float Object ( reference type )
* @ param o Object to cast
* @ return casted Float Object
* @ throws PageException */
public static Float toFloat ( Object o ) throws PageException { } } | if ( o instanceof Float ) return ( Float ) o ; return new Float ( toFloatValue ( o ) ) ; |
public class Text { @ Override public < P , E extends Exception > void accept ( ComponentVisitor < P , E > visitor , P parameter ) throws E { } } | visitor . visit ( this , parameter ) ; |
public class ScreenshotTaker { /** * Gets the proper view to use for a screenshot . */
private View getScreenshotView ( ) { } } | View decorView = viewFetcher . getRecentDecorView ( viewFetcher . getWindowDecorViews ( ) ) ; final long endTime = SystemClock . uptimeMillis ( ) + Timeout . getSmallTimeout ( ) ; while ( decorView == null ) { final boolean timedOut = SystemClock . uptimeMillis ( ) > endTime ; if ( timedOut ) { return null ; } sleeper . sleepMini ( ) ; decorView = viewFetcher . getRecentDecorView ( viewFetcher . getWindowDecorViews ( ) ) ; } wrapAllGLViews ( decorView ) ; return decorView ; |
public class ControllersInner { /** * Lists the Azure Dev Spaces Controllers in a resource group .
* Lists all the Azure Dev Spaces Controllers with their properties in the specified resource group and subscription .
* @ param resourceGroupName Resource group to which the resource belongs .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to the PagedList & lt ; ControllerInner & gt ; object */
public Observable < Page < ControllerInner > > listByResourceGroupAsync ( final String resourceGroupName ) { } } | return listByResourceGroupWithServiceResponseAsync ( resourceGroupName ) . map ( new Func1 < ServiceResponse < Page < ControllerInner > > , Page < ControllerInner > > ( ) { @ Override public Page < ControllerInner > call ( ServiceResponse < Page < ControllerInner > > response ) { return response . body ( ) ; } } ) ; |
public class Search { /** * Returns the Lucene { @ link org . apache . lucene . search . SortField } s represented by this using the specified schema .
* @ param schema the indexing schema to be used
* @ return the Lucene sort fields represented by this using { @ code schema } */
public List < org . apache . lucene . search . SortField > sortFields ( Schema schema ) { } } | return sort . stream ( ) . map ( s -> s . sortField ( schema ) ) . collect ( Collectors . toList ( ) ) ; |
public class LocalProperties { /** * Adds a combination of fields that are unique in these data properties .
* @ param uniqueFields The fields that are unique in these data properties . */
public void addUniqueFields ( FieldSet uniqueFields ) { } } | if ( this . uniqueFields == null ) { this . uniqueFields = new HashSet < FieldSet > ( ) ; } this . uniqueFields . add ( uniqueFields ) ; |
public class RegularExpression { /** * Converts a token to an operation . */
private Op compile ( Token tok , Op next , boolean reverse ) { } } | Op ret ; switch ( tok . type ) { case Token . DOT : ret = Op . createDot ( ) ; ret . next = next ; break ; case Token . CHAR : ret = Op . createChar ( tok . getChar ( ) ) ; ret . next = next ; break ; case Token . ANCHOR : ret = Op . createAnchor ( tok . getChar ( ) ) ; ret . next = next ; break ; case Token . RANGE : case Token . NRANGE : ret = Op . createRange ( tok ) ; ret . next = next ; break ; case Token . CONCAT : ret = next ; if ( ! reverse ) { for ( int i = tok . size ( ) - 1 ; i >= 0 ; i -- ) { ret = compile ( tok . getChild ( i ) , ret , false ) ; } } else { for ( int i = 0 ; i < tok . size ( ) ; i ++ ) { ret = compile ( tok . getChild ( i ) , ret , true ) ; } } break ; case Token . UNION : Op . UnionOp uni = Op . createUnion ( tok . size ( ) ) ; for ( int i = 0 ; i < tok . size ( ) ; i ++ ) { uni . addElement ( compile ( tok . getChild ( i ) , next , reverse ) ) ; } ret = uni ; // ret . next is null .
break ; case Token . CLOSURE : case Token . NONGREEDYCLOSURE : Token child = tok . getChild ( 0 ) ; int min = tok . getMin ( ) ; int max = tok . getMax ( ) ; if ( min >= 0 && min == max ) { ret = next ; for ( int i = 0 ; i < min ; i ++ ) { ret = compile ( child , ret , reverse ) ; } break ; } if ( min > 0 && max > 0 ) max -= min ; if ( max > 0 ) { // X { 2,6 } - > XX ( X ( X ( XX ? ) ? ) ? ) ?
ret = next ; for ( int i = 0 ; i < max ; i ++ ) { Op . ChildOp q = Op . createQuestion ( tok . type == Token . NONGREEDYCLOSURE ) ; q . next = next ; q . setChild ( compile ( child , ret , reverse ) ) ; ret = q ; } } else { Op . ChildOp op ; if ( tok . type == Token . NONGREEDYCLOSURE ) { op = Op . createNonGreedyClosure ( ) ; } else { // Token . CLOSURE
op = Op . createClosure ( this . numberOfClosures ++ ) ; } op . next = next ; op . setChild ( compile ( child , op , reverse ) ) ; ret = op ; } if ( min > 0 ) { for ( int i = 0 ; i < min ; i ++ ) { ret = compile ( child , ret , reverse ) ; } } break ; case Token . EMPTY : ret = next ; break ; case Token . STRING : ret = Op . createString ( tok . getString ( ) ) ; ret . next = next ; break ; case Token . BACKREFERENCE : ret = Op . createBackReference ( tok . getReferenceNumber ( ) ) ; ret . next = next ; break ; case Token . PAREN : if ( tok . getParenNumber ( ) == 0 ) { ret = compile ( tok . getChild ( 0 ) , next , reverse ) ; } else if ( reverse ) { next = Op . createCapture ( tok . getParenNumber ( ) , next ) ; next = compile ( tok . getChild ( 0 ) , next , reverse ) ; ret = Op . createCapture ( - tok . getParenNumber ( ) , next ) ; } else { next = Op . createCapture ( - tok . getParenNumber ( ) , next ) ; next = compile ( tok . getChild ( 0 ) , next , reverse ) ; ret = Op . createCapture ( tok . getParenNumber ( ) , next ) ; } break ; case Token . LOOKAHEAD : ret = Op . createLook ( Op . LOOKAHEAD , next , compile ( tok . getChild ( 0 ) , null , false ) ) ; break ; case Token . NEGATIVELOOKAHEAD : ret = Op . createLook ( Op . NEGATIVELOOKAHEAD , next , compile ( tok . getChild ( 0 ) , null , false ) ) ; break ; case Token . LOOKBEHIND : ret = Op . createLook ( Op . LOOKBEHIND , next , compile ( tok . getChild ( 0 ) , null , true ) ) ; break ; case Token . NEGATIVELOOKBEHIND : ret = Op . createLook ( Op . NEGATIVELOOKBEHIND , next , compile ( tok . getChild ( 0 ) , null , true ) ) ; break ; case Token . INDEPENDENT : ret = Op . createIndependent ( next , compile ( tok . getChild ( 0 ) , null , reverse ) ) ; break ; case Token . MODIFIERGROUP : ret = Op . createModifier ( next , compile ( tok . getChild ( 0 ) , null , reverse ) , ( ( Token . ModifierToken ) tok ) . getOptions ( ) , ( ( Token . ModifierToken ) tok ) . getOptionsMask ( ) ) ; break ; case Token . CONDITION : Token . ConditionToken ctok = ( Token . ConditionToken ) tok ; int ref = ctok . refNumber ; Op condition = ctok . condition == null ? null : compile ( ctok . condition , null , reverse ) ; Op yes = compile ( ctok . yes , next , reverse ) ; Op no = ctok . no == null ? null : compile ( ctok . no , next , reverse ) ; ret = Op . createCondition ( next , ref , condition , yes , no ) ; break ; default : throw new RuntimeException ( "Unknown token type: " + tok . type ) ; } // switch ( tok . type )
return ret ; |
public class DatabaseDAODefaultImpl { public void delete_device_attribute ( Database database , String deviceName , String attname ) throws DevFailed { } } | if ( ! database . isAccess_checked ( ) ) checkAccess ( database ) ; String [ ] array = new String [ 2 ] ; array [ 0 ] = deviceName ; array [ 1 ] = attname ; DeviceData argIn = new DeviceData ( ) ; argIn . insert ( array ) ; command_inout ( database , "DbDeleteDeviceAttribute" , argIn ) ; |
public class SpringApplication { /** * Run the Spring application , creating and refreshing a new
* { @ link ApplicationContext } .
* @ param args the application arguments ( usually passed from a Java main method )
* @ return a running { @ link ApplicationContext } */
public ConfigurableApplicationContext run ( String ... args ) { } } | StopWatch stopWatch = new StopWatch ( ) ; stopWatch . start ( ) ; ConfigurableApplicationContext context = null ; Collection < SpringBootExceptionReporter > exceptionReporters = new ArrayList < > ( ) ; configureHeadlessProperty ( ) ; SpringApplicationRunListeners listeners = getRunListeners ( args ) ; listeners . starting ( ) ; try { ApplicationArguments applicationArguments = new DefaultApplicationArguments ( args ) ; ConfigurableEnvironment environment = prepareEnvironment ( listeners , applicationArguments ) ; configureIgnoreBeanInfo ( environment ) ; Banner printedBanner = printBanner ( environment ) ; context = createApplicationContext ( ) ; exceptionReporters = getSpringFactoriesInstances ( SpringBootExceptionReporter . class , new Class [ ] { ConfigurableApplicationContext . class } , context ) ; prepareContext ( context , environment , listeners , applicationArguments , printedBanner ) ; refreshContext ( context ) ; afterRefresh ( context , applicationArguments ) ; stopWatch . stop ( ) ; if ( this . logStartupInfo ) { new StartupInfoLogger ( this . mainApplicationClass ) . logStarted ( getApplicationLog ( ) , stopWatch ) ; } listeners . started ( context ) ; callRunners ( context , applicationArguments ) ; } catch ( Throwable ex ) { handleRunFailure ( context , ex , exceptionReporters , listeners ) ; throw new IllegalStateException ( ex ) ; } try { listeners . running ( context ) ; } catch ( Throwable ex ) { handleRunFailure ( context , ex , exceptionReporters , null ) ; throw new IllegalStateException ( ex ) ; } return context ; |
public class RadialMenuItem { /** * Trainsit the button to " Visible " state . */
public void show ( ) { } } | if ( isVisible ( ) ) { return ; } resetToInitialState ( ) ; setVisible ( true ) ; final Timeline phaseOne = new Timeline ( ) ; phaseOne . getKeyFrames ( ) . addAll ( new KeyFrame ( Duration . ZERO , new KeyValue ( transformRadius , fromRadius ) , new KeyValue ( transformOpacity , 0 ) ) , new KeyFrame ( new Duration ( 120 ) , new KeyValue ( transformRadius , parentSection . getNominalRadius ( ) ) , new KeyValue ( transformOpacity , 1 ) ) ) ; final Timeline phaseTwo = new Timeline ( ) ; phaseTwo . getKeyFrames ( ) . addAll ( new KeyFrame ( Duration . ZERO , new KeyValue ( transformAngle , parentSection . getAngularAxisDeg ( ) ) ) , new KeyFrame ( new Duration ( 80 ) , new KeyValue ( transformAngle , angle ) ) ) ; phaseOne . setOnFinished ( event -> phaseTwo . play ( ) ) ; phaseTwo . setOnFinished ( event -> setMouseTransparent ( false ) ) ; phaseOne . play ( ) ; |
public class AstFactory { /** * Returns a new { @ code yield } expression .
* @ param jsType Type we expect to get back after the yield
* @ param value value to yield */
Node createYield ( JSType jsType , Node value ) { } } | Node result = IR . yield ( value ) ; if ( isAddingTypes ( ) ) { result . setJSType ( checkNotNull ( jsType ) ) ; } return result ; |
public class MerkleTree { /** * TODO : This function could be optimized into a depth first traversal of
* the two trees in parallel .
* Takes two trees and a range for which they have hashes , but are inconsistent .
* @ return FULLY _ INCONSISTENT if active is inconsistent , PARTIALLY _ INCONSISTENT if only a subrange is inconsistent . */
static int differenceHelper ( MerkleTree ltree , MerkleTree rtree , List < TreeRange > diff , TreeRange active ) { } } | if ( active . depth == Byte . MAX_VALUE ) return CONSISTENT ; Token midpoint = ltree . partitioner ( ) . midpoint ( active . left , active . right ) ; TreeDifference left = new TreeDifference ( active . left , midpoint , inc ( active . depth ) ) ; TreeDifference right = new TreeDifference ( midpoint , active . right , inc ( active . depth ) ) ; byte [ ] lhash , rhash ; Hashable lnode , rnode ; // see if we should recurse left
lnode = ltree . find ( left ) ; rnode = rtree . find ( left ) ; lhash = lnode . hash ( ) ; rhash = rnode . hash ( ) ; left . setSize ( lnode . sizeOfRange ( ) , rnode . sizeOfRange ( ) ) ; left . setRows ( lnode . rowsInRange ( ) , rnode . rowsInRange ( ) ) ; int ldiff = CONSISTENT ; boolean lreso = lhash != null && rhash != null ; if ( lreso && ! Arrays . equals ( lhash , rhash ) ) ldiff = differenceHelper ( ltree , rtree , diff , left ) ; else if ( ! lreso ) ldiff = FULLY_INCONSISTENT ; // see if we should recurse right
lnode = ltree . find ( right ) ; rnode = rtree . find ( right ) ; lhash = lnode . hash ( ) ; rhash = rnode . hash ( ) ; right . setSize ( lnode . sizeOfRange ( ) , rnode . sizeOfRange ( ) ) ; right . setRows ( lnode . rowsInRange ( ) , rnode . rowsInRange ( ) ) ; int rdiff = CONSISTENT ; boolean rreso = lhash != null && rhash != null ; if ( rreso && ! Arrays . equals ( lhash , rhash ) ) rdiff = differenceHelper ( ltree , rtree , diff , right ) ; else if ( ! rreso ) rdiff = FULLY_INCONSISTENT ; if ( ldiff == FULLY_INCONSISTENT && rdiff == FULLY_INCONSISTENT ) { // both children are fully inconsistent
return FULLY_INCONSISTENT ; } else if ( ldiff == FULLY_INCONSISTENT ) { diff . add ( left ) ; return PARTIALLY_INCONSISTENT ; } else if ( rdiff == FULLY_INCONSISTENT ) { diff . add ( right ) ; return PARTIALLY_INCONSISTENT ; } return PARTIALLY_INCONSISTENT ; |
public class JaxWsExtensionFactory { /** * { @ inheritDoc } */
@ Override public ExtensionProcessor createExtensionProcessor ( IServletContext servletContext ) throws Exception { } } | WebModuleMetaData moduleMetaData = ( ( WebAppConfigExtended ) ( servletContext . getWebAppConfig ( ) ) ) . getMetaData ( ) ; JaxWsModuleMetaData jaxWsModuleMetaData = JaxWsMetaDataManager . getJaxWsModuleMetaData ( moduleMetaData ) ; // If jaxws - 2.2 feature is enabled while the server is on the running status , WebContainer service may receive the JaxWsExtensionFactory registration
// service before the started applications are removed , at this time , no JaxWsModuleMeta was stored in the application metadata
// So , now we just return null , as the application will be restarted as it is configured in the jaxws feature file
if ( jaxWsModuleMetaData == null ) { return null ; } // Add WebAppInjectionInterceptor to JaxWsInstanceManager
jaxWsModuleMetaData . getJaxWsInstanceManager ( ) . addInterceptor ( new WebAppInjectionInstanceInterceptor ( servletContext ) ) ; // Get JaxWsModuleInfo
JaxWsModuleInfo jaxWsModuleInfo = servletContext . getModuleContainer ( ) . adapt ( JaxWsModuleInfo . class ) ; // No WebService Implementation is found and just return null to indicate no interest on the request processing
if ( jaxWsModuleInfo == null || jaxWsModuleInfo . endpointInfoSize ( ) == 0 ) { if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "No web service implementation bean is found in the web module, will not create web service processor" ) ; } return null ; } Container publisherModuleContainer = servletContext . getModuleContainer ( ) ; JaxWsPublisherContext publisherContext = new JaxWsPublisherContext ( jaxWsModuleMetaData , publisherModuleContainer , JaxWsUtils . getWebModuleInfo ( publisherModuleContainer ) ) ; publisherContext . setAttribute ( JaxWsWebContainerConstants . SERVLET_CONTEXT , servletContext ) ; WebApp webApp = ( WebApp ) servletContext ; publisherContext . setAttribute ( JaxWsWebContainerConstants . NAMESPACE_COLLABORATOR , webApp . getCollaboratorHelper ( ) . getWebAppNameSpaceCollaborator ( ) ) ; publisherContext . setAttribute ( JaxWsConstants . ENDPOINT_INFO_BUILDER_CONTEXT , new EndpointInfoBuilderContext ( servletContext . getModuleContainer ( ) . adapt ( WebAnnotations . class ) . getInfoStore ( ) , servletContext . getModuleContainer ( ) ) ) ; // get endpoint publisher and do publish
EndpointPublisher endpointPublisher = endpointPublisherManagerRef . getServiceWithException ( ) . getEndpointPublisher ( JaxWsConstants . WEB_ENDPOINT_PUBLISHER_TYPE ) ; for ( EndpointInfo endpointInfo : jaxWsModuleInfo . getEndpointInfos ( ) ) { endpointPublisher . publish ( endpointInfo , publisherContext ) ; } for ( JaxWsWebAppConfigurator jaxWsWebAppConfigurator : jaxWsWebAppConfigurators ) { jaxWsWebAppConfigurator . configure ( jaxWsModuleInfo , servletContext . getWebAppConfig ( ) ) ; } return new JaxWsExtensionProcessor ( servletContext ) ; |
public class AmazonCloudFormationClient { /** * Returns the description of the specified stack set .
* @ param describeStackSetRequest
* @ return Result of the DescribeStackSet operation returned by the service .
* @ throws StackSetNotFoundException
* The specified stack set doesn ' t exist .
* @ sample AmazonCloudFormation . DescribeStackSet
* @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / cloudformation - 2010-05-15 / DescribeStackSet "
* target = " _ top " > AWS API Documentation < / a > */
@ Override public DescribeStackSetResult describeStackSet ( DescribeStackSetRequest request ) { } } | request = beforeClientExecution ( request ) ; return executeDescribeStackSet ( request ) ; |
public class CanvasOverlay { /** * Get a { @ link DashedHorizontalLine } instance
* @ return DashedHorizontalLine */
public DashedHorizontalLine dashedHorizontalLineInstance ( ) { } } | LineObject lineObject = new LineObject ( ) ; DashedHorizontalLine dashedHorizontalLine = lineObject . dashedHorizontalLineInstance ( ) ; objectsInstance ( ) . add ( lineObject ) ; return dashedHorizontalLine ; |
public class DebugChemObject { /** * { @ inheritDoc } */
@ Override public void setProperties ( Map < Object , Object > properties ) { } } | logger . debug ( "Setting properties: " , properties ) ; super . setProperties ( properties ) ; |
public class RepositoryApi { /** * Get an archive of the complete repository by SHA ( optional ) .
* < pre > < code > GitLab Endpoint : GET / projects / : id / repository / archive < / code > < / pre >
* @ param projectIdOrPath the project in the form of an Integer ( ID ) , String ( path ) , or Project instance
* @ param sha the SHA of the archive to get
* @ param format The archive format , defaults to " tar . gz " if null
* @ return an input stream that can be used to save as a file or to read the content of the archive
* @ throws GitLabApiException if format is not a valid archive format or any exception occurs */
public InputStream getRepositoryArchive ( Object projectIdOrPath , String sha , String format ) throws GitLabApiException { } } | ArchiveFormat archiveFormat = ArchiveFormat . forValue ( format ) ; return ( getRepositoryArchive ( projectIdOrPath , sha , archiveFormat ) ) ; |
public class Async { /** * Convert a synchronous function call into an asynchronous function call through an Observable .
* < img width = " 640 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / toAsync . png " alt = " " >
* @ param < R > the result value type
* @ param func the function to convert
* @ return a function that returns an Observable that executes the { @ code func } and emits its returned value
* @ see < a href = " https : / / github . com / ReactiveX / RxJava / wiki / Async - Operators # wiki - toasync - or - asyncaction - or - asyncfunc " > RxJava Wiki : toAsync ( ) < / a >
* @ see < a href = " http : / / msdn . microsoft . com / en - us / library / hh229182 . aspx " > MSDN : Observable . ToAsync < / a > */
public static < R > Func0 < Observable < R > > toAsync ( Func0 < ? extends R > func ) { } } | return toAsync ( func , Schedulers . computation ( ) ) ; |
public class Jmx { /** * Add meters for the standard MXBeans provided by the jvm . This method will use
* { @ link java . lang . management . ManagementFactory # getPlatformMXBeans ( Class ) } to get the set of
* mbeans from the local jvm . */
public static void registerStandardMXBeans ( Registry registry ) { } } | for ( MemoryPoolMXBean mbean : ManagementFactory . getPlatformMXBeans ( MemoryPoolMXBean . class ) ) { registry . register ( new MemoryPoolMeter ( registry , mbean ) ) ; } for ( BufferPoolMXBean mbean : ManagementFactory . getPlatformMXBeans ( BufferPoolMXBean . class ) ) { registry . register ( new BufferPoolMeter ( registry , mbean ) ) ; } |
public class FindIndexesVisitor { /** * ( non - Javadoc )
* @ see
* javax . lang . model . util . SimpleAnnotationValueVisitor6 # visitAnnotation ( javax
* . lang . model . element . AnnotationMirror , java . lang . Object ) */
@ Override public Void visitAnnotation ( AnnotationMirror a , String p ) { } } | if ( AnnotationAttributeType . INDEXES . getValue ( ) . equals ( p ) ) { inTasks = true ; } if ( inTasks ) { currentValue = new Pair < List < String > , Boolean > ( new ArrayList < String > ( ) , false ) ; for ( Map . Entry < ? extends ExecutableElement , ? extends AnnotationValue > entry : a . getElementValues ( ) . entrySet ( ) ) { String key = entry . getKey ( ) . getSimpleName ( ) . toString ( ) ; entry . getValue ( ) . accept ( this , key ) ; } indexes . add ( currentValue ) ; } if ( AnnotationAttributeType . INDEXES . getValue ( ) . equals ( p ) ) { inTasks = false ; } return null ; |
public class Maze2D { /** * Check if the provided point is in the maze bounds or outside .
* @ param loc point to be tested .
* @ return true if the point is in the maze . */
public boolean pointInBounds ( Point loc ) { } } | return loc . x >= 0 && loc . x < this . columns && loc . y >= 0 && loc . y < this . rows ; |
public class PropertiesUtils { /** * Load a file from an URL .
* @ param fileURL
* Property file URL - Cannot be < code > null < / code > .
* @ return Properties . */
public static Properties loadProperties ( final URL fileURL ) { } } | checkNotNull ( "fileURL" , fileURL ) ; final Properties props = new Properties ( ) ; try ( final InputStream inStream = fileURL . openStream ( ) ) { props . load ( inStream ) ; } catch ( final IOException ex ) { throw new RuntimeException ( ex ) ; } return props ; |
public class QPath { /** * Tell if the path is absolute .
* @ return boolean */
public boolean isAbsolute ( ) { } } | if ( names [ 0 ] . getIndex ( ) == 1 && names [ 0 ] . getName ( ) . length ( ) == 0 && names [ 0 ] . getNamespace ( ) . length ( ) == 0 ) return true ; else return false ; |
public class Setting { /** * 默认分组 ( 空分组 ) 中是否包含指定值
* @ param value 值
* @ return 默认分组中是否包含指定值 */
@ Override public boolean containsValue ( Object value ) { } } | return this . groupedMap . containsValue ( DEFAULT_GROUP , Convert . toStr ( value ) ) ; |
public class Diff { /** * Analyzes the start and end state and creates for every object that is different an objectdiff entry */
private void createObjectDiffs ( ) throws EDBException { } } | diff = new HashMap < String , EDBObjectDiff > ( ) ; List < EDBObject > tempList = new ArrayList < EDBObject > ( ) ; for ( EDBObject o : this . endState ) { tempList . add ( o ) ; } addModifiedOrDeletedObjects ( tempList ) ; addNewObjects ( tempList ) ; |
public class CaptchaPanel { /** * Factory method for creating a new { @ link Image } . This method is invoked in the constructor
* from the derived classes and can be overridden so users can provide their own version of a
* Button .
* @ param id
* the wicket id
* @ param imageResource
* the image resource .
* @ return the new { @ link Image } */
protected Image newImage ( final String id , final IResource imageResource ) { } } | return ComponentFactory . newImage ( id , imageResource ) ; |
public class DBIDUtil { /** * Compute the set intersection of two sets .
* @ param first First set
* @ param second Second set
* @ return intersection */
public static ModifiableDBIDs intersection ( DBIDs first , DBIDs second ) { } } | // If exactly one is a Set , use it as second parameter .
if ( second instanceof SetDBIDs ) { if ( ! ( first instanceof SetDBIDs ) ) { return internalIntersection ( first , second ) ; } } else if ( first instanceof SetDBIDs ) { return internalIntersection ( second , first ) ; } // Both are the same type : both set or both non set .
// Smaller goes first .
return first . size ( ) <= second . size ( ) ? internalIntersection ( first , second ) : internalIntersection ( second , first ) ; |
public class SystemHooksApi { /** * Get a Pager of all system hooks . This method requires admin access .
* < pre > < code > GitLab Endpoint : GET / hooks < / code > < / pre >
* @ param itemsPerPage the number of SystemHookEvent instances that will be fetched per page
* @ return a Pager of SystemHookEvent
* @ throws GitLabApiException if any exception occurs */
public Pager < SystemHook > getSystemHooks ( int itemsPerPage ) throws GitLabApiException { } } | return ( new Pager < SystemHook > ( this , SystemHook . class , itemsPerPage , null , "hooks" ) ) ; |
public class EmnistDataSetIterator { /** * Get the label assignments for the given set as a character array .
* @ param dataSet DataSet to get the label assignment for
* @ return Label assignment and given dataset */
public static char [ ] getLabelsArray ( Set dataSet ) { } } | switch ( dataSet ) { case COMPLETE : return LABELS_COMPLETE ; case MERGE : return LABELS_MERGE ; case BALANCED : return LABELS_BALANCED ; case LETTERS : return LABELS_LETTERS ; case DIGITS : case MNIST : return LABELS_DIGITS ; default : throw new UnsupportedOperationException ( "Unknown Set: " + dataSet ) ; } |
public class JCuda { /** * Copies data between host and device .
* < pre >
* cudaError _ t cudaMemcpyFromArray (
* void * dst ,
* cudaArray _ const _ t src ,
* size _ t wOffset ,
* size _ t hOffset ,
* size _ t count ,
* cudaMemcpyKind kind )
* < / pre >
* < div >
* < p > Copies data between host and device .
* Copies < tt > count < / tt > bytes from the CUDA array < tt > src < / tt > starting
* at the upper left corner ( < tt > wOffset < / tt > , hOffset ) to the memory
* area pointed to by < tt > dst < / tt > , where < tt > kind < / tt > is one of
* cudaMemcpyHostToHost , cudaMemcpyHostToDevice , cudaMemcpyDeviceToHost ,
* or cudaMemcpyDeviceToDevice , and specifies the direction of the copy .
* < div >
* < span > Note : < / span >
* < ul >
* < li >
* < p > Note that this function may
* also return error codes from previous , asynchronous launches .
* < / li >
* < li >
* < p > This function exhibits
* synchronous behavior for most use cases .
* < / li >
* < / ul >
* < / div >
* < / div >
* @ param dst Destination memory address
* @ param src Source memory address
* @ param wOffset Source starting X offset
* @ param hOffset Source starting Y offset
* @ param count Size in bytes to copy
* @ param kind Type of transfer
* @ return cudaSuccess , cudaErrorInvalidValue , cudaErrorInvalidDevicePointer ,
* cudaErrorInvalidMemcpyDirection
* @ see JCuda # cudaMemcpy
* @ see JCuda # cudaMemcpy2D
* @ see JCuda # cudaMemcpyToArray
* @ see JCuda # cudaMemcpy2DToArray
* @ see JCuda # cudaMemcpy2DFromArray
* @ see JCuda # cudaMemcpyArrayToArray
* @ see JCuda # cudaMemcpy2DArrayToArray
* @ see JCuda # cudaMemcpyToSymbol
* @ see JCuda # cudaMemcpyFromSymbol
* @ see JCuda # cudaMemcpyAsync
* @ see JCuda # cudaMemcpy2DAsync
* @ see JCuda # cudaMemcpyToArrayAsync
* @ see JCuda # cudaMemcpy2DToArrayAsync
* @ see JCuda # cudaMemcpyFromArrayAsync
* @ see JCuda # cudaMemcpy2DFromArrayAsync
* @ see JCuda # cudaMemcpyToSymbolAsync
* @ see JCuda # cudaMemcpyFromSymbolAsync */
public static int cudaMemcpyFromArray ( Pointer dst , cudaArray src , long wOffset , long hOffset , long count , int cudaMemcpyKind_kind ) { } } | return checkResult ( cudaMemcpyFromArrayNative ( dst , src , wOffset , hOffset , count , cudaMemcpyKind_kind ) ) ; |
public class DB { /** * Updates the excerpt for a post .
* @ param postId The post to update .
* @ param excerpt The new excerpt .
* @ return Was the post modified ?
* @ throws SQLException on database error or missing post id . */
public boolean updatePostExcerpt ( long postId , final String excerpt ) throws SQLException { } } | Connection conn = null ; PreparedStatement stmt = null ; Timer . Context ctx = metrics . updatePostTimer . time ( ) ; try { conn = connectionSupplier . getConnection ( ) ; stmt = conn . prepareStatement ( updatePostExcerptSQL ) ; stmt . setString ( 1 , excerpt ) ; stmt . setLong ( 2 , postId ) ; return stmt . executeUpdate ( ) > 0 ; } finally { ctx . stop ( ) ; SQLUtil . closeQuietly ( conn , stmt ) ; } |
public class Element { /** * wait for timeout amount of time
* @ param callback
* @ param timeout
* @ throws WidgetTimeoutException */
protected void waitForCommand ( ITimerCallback callback , long timeout ) throws WidgetTimeoutException { } } | WaitForConditionTimer t = new WaitForConditionTimer ( getByLocator ( ) , callback ) ; t . waitUntil ( timeout ) ; |
public class SemiTransactionalHiveMetastore { /** * TODO : Allow updating statistics for 2 tables in the same transaction */
public synchronized void setTableStatistics ( Table table , PartitionStatistics tableStatistics ) { } } | setExclusive ( ( delegate , hdfsEnvironment ) -> delegate . updateTableStatistics ( table . getDatabaseName ( ) , table . getTableName ( ) , statistics -> updatePartitionStatistics ( statistics , tableStatistics ) ) ) ; |
public class DatabaseDAODefaultImpl { public void put_server_info ( Database database , DbServInfo info ) throws DevFailed { } } | if ( ! database . isAccess_checked ( ) ) checkAccess ( database ) ; String [ ] array ; array = new String [ 4 ] ; array [ 0 ] = info . name ; array [ 1 ] = info . host ; array [ 2 ] = ( info . controlled ) ? "1" : "0" ; array [ 3 ] = Integer . toString ( info . startup_level ) ; /* System . out . println ( " DbPutServerInfo : " ) ;
for ( int i = 0 ; i < array . length ; i + + )
System . out . println ( " " + array [ i ] ) ; */
// Query info from database
DeviceData argIn = new DeviceData ( ) ; argIn . insert ( array ) ; command_inout ( database , "DbPutServerInfo" , argIn ) ; |
public class InternalPureXbaseParser { /** * InternalPureXbase . g : 3075:1 : ruleXListLiteral returns [ EObject current = null ] : ( ( ) otherlv _ 1 = ' # ' otherlv _ 2 = ' [ ' ( ( ( lv _ elements _ 3_0 = ruleXExpression ) ) ( otherlv _ 4 = ' , ' ( ( lv _ elements _ 5_0 = ruleXExpression ) ) ) * ) ? otherlv _ 6 = ' ] ' ) ; */
public final EObject ruleXListLiteral ( ) throws RecognitionException { } } | EObject current = null ; Token otherlv_1 = null ; Token otherlv_2 = null ; Token otherlv_4 = null ; Token otherlv_6 = null ; EObject lv_elements_3_0 = null ; EObject lv_elements_5_0 = null ; enterRule ( ) ; try { // InternalPureXbase . g : 3081:2 : ( ( ( ) otherlv _ 1 = ' # ' otherlv _ 2 = ' [ ' ( ( ( lv _ elements _ 3_0 = ruleXExpression ) ) ( otherlv _ 4 = ' , ' ( ( lv _ elements _ 5_0 = ruleXExpression ) ) ) * ) ? otherlv _ 6 = ' ] ' ) )
// InternalPureXbase . g : 3082:2 : ( ( ) otherlv _ 1 = ' # ' otherlv _ 2 = ' [ ' ( ( ( lv _ elements _ 3_0 = ruleXExpression ) ) ( otherlv _ 4 = ' , ' ( ( lv _ elements _ 5_0 = ruleXExpression ) ) ) * ) ? otherlv _ 6 = ' ] ' )
{ // InternalPureXbase . g : 3082:2 : ( ( ) otherlv _ 1 = ' # ' otherlv _ 2 = ' [ ' ( ( ( lv _ elements _ 3_0 = ruleXExpression ) ) ( otherlv _ 4 = ' , ' ( ( lv _ elements _ 5_0 = ruleXExpression ) ) ) * ) ? otherlv _ 6 = ' ] ' )
// InternalPureXbase . g : 3083:3 : ( ) otherlv _ 1 = ' # ' otherlv _ 2 = ' [ ' ( ( ( lv _ elements _ 3_0 = ruleXExpression ) ) ( otherlv _ 4 = ' , ' ( ( lv _ elements _ 5_0 = ruleXExpression ) ) ) * ) ? otherlv _ 6 = ' ] '
{ // InternalPureXbase . g : 3083:3 : ( )
// InternalPureXbase . g : 3084:4:
{ if ( state . backtracking == 0 ) { current = forceCreateModelElement ( grammarAccess . getXListLiteralAccess ( ) . getXListLiteralAction_0 ( ) , current ) ; } } otherlv_1 = ( Token ) match ( input , 58 , FOLLOW_43 ) ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { newLeafNode ( otherlv_1 , grammarAccess . getXListLiteralAccess ( ) . getNumberSignKeyword_1 ( ) ) ; } otherlv_2 = ( Token ) match ( input , 61 , FOLLOW_44 ) ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { newLeafNode ( otherlv_2 , grammarAccess . getXListLiteralAccess ( ) . getLeftSquareBracketKeyword_2 ( ) ) ; } // InternalPureXbase . g : 3098:3 : ( ( ( lv _ elements _ 3_0 = ruleXExpression ) ) ( otherlv _ 4 = ' , ' ( ( lv _ elements _ 5_0 = ruleXExpression ) ) ) * ) ?
int alt56 = 2 ; int LA56_0 = input . LA ( 1 ) ; if ( ( ( LA56_0 >= RULE_STRING && LA56_0 <= RULE_ID ) || ( LA56_0 >= 14 && LA56_0 <= 15 ) || LA56_0 == 28 || ( LA56_0 >= 44 && LA56_0 <= 45 ) || LA56_0 == 50 || ( LA56_0 >= 58 && LA56_0 <= 59 ) || LA56_0 == 61 || LA56_0 == 64 || LA56_0 == 66 || ( LA56_0 >= 69 && LA56_0 <= 80 ) ) ) { alt56 = 1 ; } switch ( alt56 ) { case 1 : // InternalPureXbase . g : 3099:4 : ( ( lv _ elements _ 3_0 = ruleXExpression ) ) ( otherlv _ 4 = ' , ' ( ( lv _ elements _ 5_0 = ruleXExpression ) ) ) *
{ // InternalPureXbase . g : 3099:4 : ( ( lv _ elements _ 3_0 = ruleXExpression ) )
// InternalPureXbase . g : 3100:5 : ( lv _ elements _ 3_0 = ruleXExpression )
{ // InternalPureXbase . g : 3100:5 : ( lv _ elements _ 3_0 = ruleXExpression )
// InternalPureXbase . g : 3101:6 : lv _ elements _ 3_0 = ruleXExpression
{ if ( state . backtracking == 0 ) { newCompositeNode ( grammarAccess . getXListLiteralAccess ( ) . getElementsXExpressionParserRuleCall_3_0_0 ( ) ) ; } pushFollow ( FOLLOW_45 ) ; lv_elements_3_0 = ruleXExpression ( ) ; state . _fsp -- ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { if ( current == null ) { current = createModelElementForParent ( grammarAccess . getXListLiteralRule ( ) ) ; } add ( current , "elements" , lv_elements_3_0 , "org.eclipse.xtext.xbase.Xbase.XExpression" ) ; afterParserOrEnumRuleCall ( ) ; } } } // InternalPureXbase . g : 3118:4 : ( otherlv _ 4 = ' , ' ( ( lv _ elements _ 5_0 = ruleXExpression ) ) ) *
loop55 : do { int alt55 = 2 ; int LA55_0 = input . LA ( 1 ) ; if ( ( LA55_0 == 57 ) ) { alt55 = 1 ; } switch ( alt55 ) { case 1 : // InternalPureXbase . g : 3119:5 : otherlv _ 4 = ' , ' ( ( lv _ elements _ 5_0 = ruleXExpression ) )
{ otherlv_4 = ( Token ) match ( input , 57 , FOLLOW_3 ) ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { newLeafNode ( otherlv_4 , grammarAccess . getXListLiteralAccess ( ) . getCommaKeyword_3_1_0 ( ) ) ; } // InternalPureXbase . g : 3123:5 : ( ( lv _ elements _ 5_0 = ruleXExpression ) )
// InternalPureXbase . g : 3124:6 : ( lv _ elements _ 5_0 = ruleXExpression )
{ // InternalPureXbase . g : 3124:6 : ( lv _ elements _ 5_0 = ruleXExpression )
// InternalPureXbase . g : 3125:7 : lv _ elements _ 5_0 = ruleXExpression
{ if ( state . backtracking == 0 ) { newCompositeNode ( grammarAccess . getXListLiteralAccess ( ) . getElementsXExpressionParserRuleCall_3_1_1_0 ( ) ) ; } pushFollow ( FOLLOW_45 ) ; lv_elements_5_0 = ruleXExpression ( ) ; state . _fsp -- ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { if ( current == null ) { current = createModelElementForParent ( grammarAccess . getXListLiteralRule ( ) ) ; } add ( current , "elements" , lv_elements_5_0 , "org.eclipse.xtext.xbase.Xbase.XExpression" ) ; afterParserOrEnumRuleCall ( ) ; } } } } break ; default : break loop55 ; } } while ( true ) ; } break ; } otherlv_6 = ( Token ) match ( input , 62 , FOLLOW_2 ) ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { newLeafNode ( otherlv_6 , grammarAccess . getXListLiteralAccess ( ) . getRightSquareBracketKeyword_4 ( ) ) ; } } } if ( state . backtracking == 0 ) { leaveRule ( ) ; } } catch ( RecognitionException re ) { recover ( input , re ) ; appendSkippedTokens ( ) ; } finally { } return current ; |
public class SpScheduler { /** * site leaders also forward the message to its replicas . */
@ Override public void cleanupTransactionBacklogOnRepair ( ) { } } | if ( m_isLeader && m_sendToHSIds . length > 0 ) { m_mailbox . send ( m_sendToHSIds , new MPBacklogFlushMessage ( ) ) ; } Iterator < Entry < Long , TransactionState > > iter = m_outstandingTxns . entrySet ( ) . iterator ( ) ; while ( iter . hasNext ( ) ) { Entry < Long , TransactionState > entry = iter . next ( ) ; TransactionState txnState = entry . getValue ( ) ; if ( TxnEgo . getPartitionId ( entry . getKey ( ) ) == MpInitiator . MP_INIT_PID ) { if ( txnState . isReadOnly ( ) ) { txnState . setDone ( ) ; m_duplicateCounters . entrySet ( ) . removeIf ( ( e ) -> e . getKey ( ) . m_txnId == entry . getKey ( ) ) ; iter . remove ( ) ; } } } // flush all RO transactions out of backlog
m_pendingTasks . removeMPReadTransactions ( ) ; |
public class SparseTensorBuilder { /** * Gets a { @ code TensorFactory } which creates { @ code SparseTensorBuilder } s .
* @ return */
public static TensorFactory getFactory ( ) { } } | return new TensorFactory ( ) { @ Override public TensorBuilder getBuilder ( int [ ] dimNums , int [ ] dimSizes ) { return new SparseTensorBuilder ( dimNums , dimSizes ) ; } } ; |
public class HibernateQueryModelDAO { private Criteria buildCriteria ( QueryModel queryModel ) { } } | Criteria criteria = getCurrentSession ( ) . createCriteria ( persistentClass ) ; if ( queryModel . getConditions ( ) != null ) { for ( Condition condition : queryModel . getConditions ( ) ) { criteria . add ( ( Criterion ) condition . getConstraint ( ) ) ; } } for ( Map . Entry < String , List < Condition > > associationCriteriaEntry : queryModel . getAssociationConditions ( ) . entrySet ( ) ) { Criteria associationCriteria = criteria . createCriteria ( associationCriteriaEntry . getKey ( ) ) ; criteria . setResultTransformer ( Criteria . DISTINCT_ROOT_ENTITY ) ; for ( Condition condition : associationCriteriaEntry . getValue ( ) ) { associationCriteria . add ( ( Criterion ) condition . getConstraint ( ) ) ; } } if ( queryModel . getProjection ( ) != null ) { ProjectionList projectionList = Projections . projectionList ( ) ; projectionList . add ( ( org . hibernate . criterion . Projection ) queryModel . getProjection ( ) . getDetails ( ) ) ; criteria . setProjection ( projectionList ) ; } return criteria ; |
public class SVGScoreBar { /** * Set the fill of the score bar .
* @ param val Value
* @ param min Minimum value
* @ param max Maximum value */
public void setFill ( double val , double min , double max ) { } } | this . val = val ; this . min = min ; this . max = max ; |
public class AbstractGeneratedSQLTransform { /** * / * ( non - Javadoc )
* @ see com . abubusoft . kripton . processor . sqlite . transform . SQLTransform # generateWriteProperty2ContentValues ( com . squareup . javapoet . MethodSpec . Builder , java . lang . String , com . squareup . javapoet . TypeName , com . abubusoft . kripton . processor . core . ModelProperty ) */
@ Override public void generateWriteProperty2ContentValues ( Builder methodBuilder , String beanName , TypeName beanClass , ModelProperty property ) { } } | methodBuilder . addCode ( "$T.serialize$L($L)" , TypeUtility . mergeTypeNameWithSuffix ( beanClass , "Table" ) , formatter . convert ( property . getName ( ) ) , getter ( beanName , beanClass , property ) ) ; |
public class GoogleNetHttpTransport { /** * Returns a new instance of { @ link NetHttpTransport } that uses
* { @ link GoogleUtils # getCertificateTrustStore ( ) } for the trusted certificates using
* { @ link com . google . api . client . http . javanet . NetHttpTransport . Builder # trustCertificates ( KeyStore ) }
* This helper method doesn ' t provide for customization of the { @ link NetHttpTransport } , such as
* the ability to specify a proxy . To do use , use
* { @ link com . google . api . client . http . javanet . NetHttpTransport . Builder } , for example :
* < pre >
* static HttpTransport newProxyTransport ( ) throws GeneralSecurityException , IOException {
* NetHttpTransport . Builder builder = new NetHttpTransport . Builder ( ) ;
* builder . trustCertificates ( GoogleUtils . getCertificateTrustStore ( ) ) ;
* builder . setProxy ( new Proxy ( Proxy . Type . HTTP , new InetSocketAddress ( " 127.0.0.1 " , 3128 ) ) ) ;
* return builder . build ( ) ;
* < / pre > */
public static NetHttpTransport newTrustedTransport ( ) throws GeneralSecurityException , IOException { } } | return new NetHttpTransport . Builder ( ) . trustCertificates ( GoogleUtils . getCertificateTrustStore ( ) ) . build ( ) ; |
public class PayUtil { /** * ( MCH ) 生成Native支付请求URL
* @ param appid
* appid
* @ param mch _ id
* mch _ id
* @ param productid
* productid
* @ param key
* key
* @ return url */
public static String generateMchPayNativeRequestURL ( String appid , String mch_id , String productid , String key ) { } } | Map < String , String > map = new LinkedHashMap < String , String > ( ) ; map . put ( "appid" , appid ) ; map . put ( "mch_id" , mch_id ) ; map . put ( "time_stamp" , System . currentTimeMillis ( ) / 1000 + "" ) ; map . put ( "nonce_str" , UUID . randomUUID ( ) . toString ( ) . replace ( "-" , "" ) ) ; map . put ( "product_id" , productid ) ; String sign = SignatureUtil . generateSign ( map , key ) ; map . put ( "sign" , sign ) ; return "weixin://wxpay/bizpayurl?" + MapUtil . mapJoin ( map , false , false ) ; |
public class DataGridConfigFactory { /** * Create an instance of a { @ link DataGridConfig } object given a { @ link Class } object .
* The given class must extend the { @ link DataGridConfig } base class .
* @ param clazz the class to instantiate
* @ return the new { @ link DataGridConfig } instance */
public static final DataGridConfig getInstance ( Class clazz ) { } } | DataGridConfig config = ( DataGridConfig ) ExtensionUtil . instantiateClass ( clazz , DataGridConfig . class ) ; return config ; |
public class UnicodeSet { /** * Parses the given pattern , starting at the given position . The character
* at pattern . charAt ( pos . getIndex ( ) ) must be ' [ ' , or the parse fails .
* Parsing continues until the corresponding closing ' ] ' . If a syntax error
* is encountered between the opening and closing brace , the parse fails .
* Upon return from a successful parse , the ParsePosition is updated to
* point to the character following the closing ' ] ' , and an inversion
* list for the parsed pattern is returned . This method
* calls itself recursively to parse embedded subpatterns .
* @ param pattern the string containing the pattern to be parsed . The
* portion of the string from pos . getIndex ( ) , which must be a ' [ ' , to the
* corresponding closing ' ] ' , is parsed .
* @ param pos upon entry , the position at which to being parsing . The
* character at pattern . charAt ( pos . getIndex ( ) ) must be a ' [ ' . Upon return
* from a successful parse , pos . getIndex ( ) is either the character after the
* closing ' ] ' of the parsed pattern , or pattern . length ( ) if the closing ' ] '
* is the last character of the pattern string .
* @ return an inversion list for the parsed substring
* of < code > pattern < / code >
* @ exception java . lang . IllegalArgumentException if the parse fails .
* @ deprecated This API is ICU internal only .
* @ hide original deprecated declaration
* @ hide draft / provisional / internal are hidden on Android */
@ Deprecated public UnicodeSet applyPattern ( String pattern , ParsePosition pos , SymbolTable symbols , int options ) { } } | // Need to build the pattern in a temporary string because
// _ applyPattern calls add ( ) etc . , which set pat to empty .
boolean parsePositionWasNull = pos == null ; if ( parsePositionWasNull ) { pos = new ParsePosition ( 0 ) ; } StringBuilder rebuiltPat = new StringBuilder ( ) ; RuleCharacterIterator chars = new RuleCharacterIterator ( pattern , symbols , pos ) ; applyPattern ( chars , symbols , rebuiltPat , options ) ; if ( chars . inVariable ( ) ) { syntaxError ( chars , "Extra chars in variable value" ) ; } pat = rebuiltPat . toString ( ) ; if ( parsePositionWasNull ) { int i = pos . getIndex ( ) ; // Skip over trailing whitespace
if ( ( options & IGNORE_SPACE ) != 0 ) { i = PatternProps . skipWhiteSpace ( pattern , i ) ; } if ( i != pattern . length ( ) ) { throw new IllegalArgumentException ( "Parse of \"" + pattern + "\" failed at " + i ) ; } } return this ; |
public class BugInstance { /** * Add a field annotation for an XField .
* @ param xfield
* the XField
* @ return this object */
@ Nonnull public BugInstance addField ( XField xfield ) { } } | return addField ( xfield . getClassName ( ) , xfield . getName ( ) , xfield . getSignature ( ) , xfield . isStatic ( ) ) ; |
public class GibbsSampler { /** * Set the assignment variable to an arbitrary initial value . */
private Assignment initializeAssignment ( FactorGraph factorGraph ) { } } | // Select the initial assignment .
// TODO : Perform a search to find an outcome with nonzero probability .
Variable [ ] variables = factorGraph . getVariables ( ) . getVariablesArray ( ) ; int [ ] varNums = factorGraph . getVariables ( ) . getVariableNumsArray ( ) ; Object [ ] values = new Object [ variables . length ] ; for ( int i = 0 ; i < variables . length ; i ++ ) { values [ i ] = variables [ i ] . getArbitraryValue ( ) ; } return Assignment . fromSortedArrays ( varNums , values ) ; |
public class SecurityIsOffMonitor { /** * Depending on whether the user said " yes " or " no " , send him to the right place . */
@ RequirePOST public void doAct ( StaplerRequest req , StaplerResponse rsp ) throws IOException { } } | if ( req . hasParameter ( "no" ) ) { disable ( true ) ; rsp . sendRedirect ( req . getContextPath ( ) + "/manage" ) ; } else { rsp . sendRedirect ( req . getContextPath ( ) + "/configureSecurity" ) ; } |
public class CharEscapeUtil { /** * / * Output method implementations , textual */
public void writeString ( String text , boolean flush ) { } } | try { _writeString ( text ) ; if ( flush ) this . _flushBuffer ( ) ; } catch ( IOException e ) { throw new ElasticSearchException ( e ) ; } |
public class GetResponse { /** * / * ( non - Javadoc )
* @ see net . timewalker . ffmq4 . network . packet . AbstractResponsePacket # unserializeFrom ( net . timewalker . ffmq4 . utils . RawDataInputStream ) */
@ Override protected void unserializeFrom ( RawDataBuffer in ) { } } | super . unserializeFrom ( in ) ; boolean hasMessage = in . readBoolean ( ) ; if ( hasMessage ) { message = MessageSerializer . unserializeFrom ( in , false ) ; } |
public class SparseGrid { @ Override public SortedSet < Cell < V > > cells ( ) { } } | return new ForwardingSortedSet < Cell < V > > ( ) { @ Override protected SortedSet < Cell < V > > delegate ( ) { return cells ; } @ Override public boolean add ( Cell < V > element ) { return super . add ( ImmutableCell . copyOf ( element ) ) ; } @ Override public boolean addAll ( Collection < ? extends Cell < V > > collection ) { return super . standardAddAll ( collection ) ; } } ; |
public class Functions { /** * Fluent flatMap operation using primitive types
* e . g .
* < pre >
* { @ code
* import static cyclops . ReactiveSeq . flatMapLongs ;
* ReactiveSeq . ofLongs ( 1,2,3)
* . to ( flatMapLongs ( i - > LongStream . of ( i * 2 ) ) ) ;
* / / [ 2l , 4l , 6l ]
* < / pre > */
public static Function < ? super ReactiveSeq < Long > , ? extends ReactiveSeq < Long > > flatMapLongs ( LongFunction < ? extends LongStream > b ) { } } | return a -> a . longs ( i -> i , s -> s . flatMap ( b ) ) ; |
public class CiLin { /** * 找出同义的词对 , 建造hashset ;
* @ return 同义词集合 */
public static HashSet buildSynonymSet ( String fileName ) { } } | try { InputStreamReader read = new InputStreamReader ( new FileInputStream ( fileName ) , "utf-8" ) ; BufferedReader bin = new BufferedReader ( read ) ; HashSet < String > synSet = new HashSet < String > ( ) ; int c = 0 ; String str = bin . readLine ( ) ; while ( str != null && str . length ( ) == 0 ) { String [ ] strs = str . trim ( ) . split ( " " ) ; if ( strs [ 0 ] . endsWith ( "=" ) ) { // System . out . println ( strs [ 0 ] ) ;
int wordNum = Integer . parseInt ( strs [ 1 ] ) ; for ( int i = 2 ; i < 2 + wordNum - 1 ; i ++ ) { for ( int j = i + 1 ; j < 2 + wordNum ; j ++ ) { String combine1 = strs [ i ] + "|" + strs [ j ] ; System . out . println ( combine1 + c ) ; synSet . add ( combine1 ) ; String combine2 = strs [ j ] + "|" + strs [ i ] ; synSet . add ( combine2 ) ; c ++ ; } } } else { } str = bin . readLine ( ) ; } return synSet ; } catch ( Exception e ) { return null ; } |
public class DSConfig { /** * Remove properties up to and including the specified property . Return the property if found .
* @ param name name of the property .
* @ param defaultValue default value to use if not found .
* @ param min minimum permitted value
* @ param units units for duration type . Null if not a duration .
* @ param range range of permitted values , in ascending order . If unspecified , then the range is min . . Integer . MAX _ VALUE
* @ return value of the property if found . Otherwise the default value . */
private Integer remove ( String name , Integer defaultValue , int min , TimeUnit units , int ... range ) throws Exception { } } | Object value = null ; for ( int diff ; value == null && entry != null && ( diff = entry . getKey ( ) . compareTo ( name ) ) <= 0 ; entry = entries . pollFirstEntry ( ) ) { if ( diff == 0 ) // matched
value = entry . getValue ( ) ; else { // TODO : when we have a stricter variant of onError , apply it to unrecognized attributes
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "unrecognized attribute: " + entry . getKey ( ) ) ; // SQLException ex = AdapterUtil . ignoreWarnOrFail ( tc , null , SQLException . class , " PROP _ NOT _ FOUND " , jndiName = = null ? id : jndiName , entry . getKey ( ) ) ;
// if ( ex ! = null )
// throw ex ;
} } long l ; if ( value == null ) return defaultValue ; else if ( value instanceof Number ) l = ( ( Number ) value ) . longValue ( ) ; else try { l = units == null ? Integer . parseInt ( ( String ) value ) : MetatypeUtils . evaluateDuration ( ( String ) value , units ) ; } catch ( Exception x ) { x = connectorSvc . ignoreWarnOrFail ( null , x , x . getClass ( ) , "UNSUPPORTED_VALUE_J2CA8011" , value , name , jndiName == null ? id : jndiName ) ; if ( x == null ) return defaultValue ; else throw x ; } if ( l < min || l > Integer . MAX_VALUE || range . length > 0 && Arrays . binarySearch ( range , ( int ) l ) < 0 ) { SQLNonTransientException x = connectorSvc . ignoreWarnOrFail ( null , null , SQLNonTransientException . class , "UNSUPPORTED_VALUE_J2CA8011" , value , name , jndiName == null ? id : jndiName ) ; if ( x == null ) return defaultValue ; else throw x ; } return ( int ) l ; |
public class AWSSimpleSystemsManagementClient { /** * Returns detailed information about command execution for an invocation or plugin .
* @ param getCommandInvocationRequest
* @ return Result of the GetCommandInvocation operation returned by the service .
* @ throws InternalServerErrorException
* An error occurred on the server side .
* @ throws InvalidCommandIdException
* @ throws InvalidInstanceIdException
* The following problems can cause this exception : < / p >
* You do not have permission to access the instance .
* SSM Agent is not running . On managed instances and Linux instances , verify that the SSM Agent is running .
* On EC2 Windows instances , verify that the EC2Config service is running .
* SSM Agent or EC2Config service is not registered to the SSM endpoint . Try reinstalling SSM Agent or
* EC2Config service .
* The instance is not in valid state . Valid states are : Running , Pending , Stopped , Stopping . Invalid states
* are : Shutting - down and Terminated .
* @ throws InvalidPluginNameException
* The plugin name is not valid .
* @ throws InvocationDoesNotExistException
* The command ID and instance ID you specified did not match any invocations . Verify the command ID adn the
* instance ID and try again .
* @ sample AWSSimpleSystemsManagement . GetCommandInvocation
* @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / ssm - 2014-11-06 / GetCommandInvocation " target = " _ top " > AWS API
* Documentation < / a > */
@ Override public GetCommandInvocationResult getCommandInvocation ( GetCommandInvocationRequest request ) { } } | request = beforeClientExecution ( request ) ; return executeGetCommandInvocation ( request ) ; |
public class DefaultGeometryIndexShapeFactory { private Shape createVertex ( GeometryEditService editService , GeometryIndex index ) throws GeometryIndexNotFoundException { } } | Geometry geometry = editService . getGeometry ( ) ; Coordinate v = editService . getIndexService ( ) . getVertex ( geometry , index ) ; if ( ! targetSpace . equals ( RenderSpace . WORLD ) ) { v = mapPresenter . getViewPort ( ) . getTransformationService ( ) . transform ( v , RenderSpace . WORLD , targetSpace ) ; } return new Rectangle ( v . getX ( ) - VERTEX_HALF_SIZE , v . getY ( ) - VERTEX_HALF_SIZE , VERTEX_SIZE , VERTEX_SIZE ) ; |
public class TemplateMethodsBuilder { /** * Add Template methods to @ { @ link IsVueComponent } ExposedType based on the result of the template
* parser .
* @ param exposedTypeGenerator Class generating the ExposedType
* @ param templateParserResult The result of the HTML template parsed by { @ link TemplateParser } */
public void addTemplateMethodsToComponentExposedType ( ComponentExposedTypeGenerator exposedTypeGenerator , TemplateParserResult templateParserResult ) { } } | // Compile the resulting HTML template String
compileTemplateString ( exposedTypeGenerator , templateParserResult ) ; // Process the java expressions from the template
processTemplateExpressions ( exposedTypeGenerator , templateParserResult ) ; |
public class CmsLinkManager { /** * Returns the link for the given resource in the current project , with full server prefix . < p >
* The input link must already have been processed according to the link substitution rules .
* This method does just append the server prefix in case this is requires . < p >
* @ param cms the current OpenCms user context
* @ param link the resource to generate the online link for
* @ param pathWithOptionalParameters the resource name
* @ param workplaceLink if this is set , use the workplace server prefix even if we are in the Online project
* @ return the link for the given resource in the current project , with full server prefix */
private String appendServerPrefix ( CmsObject cms , String link , String pathWithOptionalParameters , boolean workplaceLink ) { } } | int paramPos = pathWithOptionalParameters . indexOf ( "?" ) ; String resourceName = paramPos > - 1 ? pathWithOptionalParameters . substring ( 0 , paramPos ) : pathWithOptionalParameters ; if ( isAbsoluteUri ( link ) && ! hasScheme ( link ) ) { // URI is absolute and contains no schema
// this indicates source and target link are in the same site
String serverPrefix ; if ( cms . getRequestContext ( ) . getCurrentProject ( ) . isOnlineProject ( ) && ! workplaceLink ) { String overrideSiteRoot = ( String ) ( cms . getRequestContext ( ) . getAttribute ( CmsDefaultLinkSubstitutionHandler . OVERRIDE_SITEROOT_PREFIX + link ) ) ; // on online project , get the real site name from the site manager
CmsSite currentSite = OpenCms . getSiteManager ( ) . getSite ( overrideSiteRoot != null ? overrideSiteRoot : resourceName , cms . getRequestContext ( ) . getSiteRoot ( ) ) ; serverPrefix = currentSite . getServerPrefix ( cms , resourceName ) ; } else { // in offline mode , source must be the workplace
// so append the workplace server so links can still be clicked
serverPrefix = OpenCms . getSiteManager ( ) . getWorkplaceServer ( ) ; } link = serverPrefix + link ; } return link ; |
public class appfwprofile { /** * Use this API to fetch all the appfwprofile resources that are configured on netscaler . */
public static appfwprofile [ ] get ( nitro_service service ) throws Exception { } } | appfwprofile obj = new appfwprofile ( ) ; appfwprofile [ ] response = ( appfwprofile [ ] ) obj . get_resources ( service ) ; return response ; |
public class RealTimeDaemon { /** * It runs in a loop that tries to wake every timeInterval .
* If it gets behind due to an overload , the subclass ' implementation
* of the wakeUp method is responsible for resynching itself based
* on the startDaemonTime and startWakeUpTime . */
public void alarm ( final Object context ) { } } | long sleepInterval = 0 ; do { long startWakeUpTime = System . currentTimeMillis ( ) ; try { wakeUp ( startDaemonTime , startWakeUpTime ) ; } catch ( Exception ex ) { com . ibm . ws . ffdc . FFDCFilter . processException ( ex , "com.ibm.ws.cache.RealTimeDaemon.alarm" , "83" , this ) ; if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "exception during wakeUp" , ex ) ; } sleepInterval = timeInterval - ( System . currentTimeMillis ( ) - startWakeUpTime ) ; // keep looping while we are behind . . . ( i . e . execution time is greater than the time interval )
} while ( sleepInterval <= 0 ) ; if ( false == stopDaemon ) { Scheduler . createNonDeferrable ( sleepInterval , context , new Runnable ( ) { @ Override public void run ( ) { alarm ( context ) ; } } ) ; } |
public class AVIMConversationsQuery { /** * 增加一个基于地理位置的近似查询 , 当conversation的属性中有对应的地址位置与指定的地理位置间距不超过指定距离时返回
* 地球半径为6371.0 千米
* @ param key
* @ param point 指定的地理位置
* @ param maxDistance 距离 , 以千米计算
* @ return */
public AVIMConversationsQuery whereWithinKilometers ( String key , AVGeoPoint point , double maxDistance ) { } } | conditions . whereWithinKilometers ( key , point , maxDistance ) ; return this ; |
public class AWSOpsWorksClient { /** * Describes a user ' s SSH information .
* < b > Required Permissions < / b > : To use this action , an IAM user must have self - management enabled or an attached
* policy that explicitly grants permissions . For more information about user permissions , see < a
* href = " http : / / docs . aws . amazon . com / opsworks / latest / userguide / opsworks - security - users . html " > Managing User
* Permissions < / a > .
* @ param describeMyUserProfileRequest
* @ return Result of the DescribeMyUserProfile operation returned by the service .
* @ sample AWSOpsWorks . DescribeMyUserProfile
* @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / opsworks - 2013-02-18 / DescribeMyUserProfile " target = " _ top " > AWS
* API Documentation < / a > */
@ Override public DescribeMyUserProfileResult describeMyUserProfile ( DescribeMyUserProfileRequest request ) { } } | request = beforeClientExecution ( request ) ; return executeDescribeMyUserProfile ( request ) ; |
public class ExpectedRecall { /** * Backward pass : dG / db ( x _ i ) = dG / dy dy / db ( x _ i ) = - dG / dy , \ forall x _ i \ in x * . */
public void backward ( ) { } } | double expectedRecallAdj = yAdj . getValue ( 0 ) ; VarTensor [ ] varBeliefsAdjs = inf . getOutputAdj ( ) . varBeliefs ; // Fill in the non - zero adjoints with the adjoint of the expected recall .
for ( Var var : vc . getVars ( ) ) { if ( var . getType ( ) == VarType . PREDICTED ) { varBeliefsAdjs [ var . getId ( ) ] . subtractValue ( vc . getState ( var ) , expectedRecallAdj ) ; } } |
public class HTODDynacache { /** * getTemplatesSize ( )
* This method is used by CacheMonitor to get the number of templates from the disk . */
public int getTemplatesSize ( ) { } } | int length = 0 ; if ( ! this . disableTemplatesSupport ) { try { rwLock . readLock ( ) . lock ( ) ; length = template_cache . size ( ) ; } finally { rwLock . readLock ( ) . unlock ( ) ; } if ( length < 0 ) { length = 0 ; } } return length ; |
public class MamManager { /** * Check if this MamManager ' s archive address supports MAM .
* @ return true if MAM is supported , < code > false < / code > otherwise .
* @ throws NoResponseException
* @ throws XMPPErrorException
* @ throws NotConnectedException
* @ throws InterruptedException
* @ since 4.2.1
* @ see < a href = " https : / / xmpp . org / extensions / xep - 0313 . html # support " > XEP - 0313 § 7 . Determining support < / a > */
public boolean isSupported ( ) throws NoResponseException , XMPPErrorException , NotConnectedException , InterruptedException { } } | // Note that this may return ' null ' but SDM ' s supportsFeature ( ) does the right thingTM then .
Jid archiveAddress = getArchiveAddress ( ) ; return serviceDiscoveryManager . supportsFeature ( archiveAddress , MamElements . NAMESPACE ) ; |
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link RelationsType } { @ code > } } */
@ XmlElementDecl ( namespace = "http://www.w3.org/1998/Math/MathML" , name = "approx" ) public JAXBElement < RelationsType > createApprox ( RelationsType value ) { } } | return new JAXBElement < RelationsType > ( _Approx_QNAME , RelationsType . class , null , value ) ; |
public class WTableRenderer { /** * Paints the sort details .
* @ param table the table being rendered
* @ param xml the string builder in use */
private void paintSortDetails ( final WTable table , final XmlStringBuilder xml ) { } } | int col = table . getSortColumnIndex ( ) ; boolean ascending = table . isSortAscending ( ) ; xml . appendTagOpen ( "ui:sort" ) ; if ( col >= 0 ) { // Allow for column order
int [ ] cols = table . getColumnOrder ( ) ; if ( cols != null ) { for ( int i = 0 ; i < cols . length ; i ++ ) { if ( cols [ i ] == col ) { col = i ; break ; } } } xml . appendAttribute ( "col" , col ) ; xml . appendOptionalAttribute ( "descending" , ! ascending , "true" ) ; } switch ( table . getSortMode ( ) ) { case DYNAMIC : xml . appendAttribute ( "mode" , "dynamic" ) ; break ; default : throw new SystemException ( "Unknown sort mode: " + table . getSortMode ( ) ) ; } xml . appendEnd ( ) ; |
public class CommonUtils { /** * 将一个日期的日 , 时 , 分 , 秒 , 毫秒调整为最大值
* @ param date 一个日期
* @ return 被转化后的日期
* @ see # dateReservedMonth999 ( Calendar ) */
public static Date dateReservedMonth999 ( Date date ) { } } | Calendar calendar = Calendar . getInstance ( ) ; calendar . setTime ( date ) ; return dateReservedMonth999 ( calendar ) ; |
public class AbstractSQLQuery { /** * Create an alias for the expression
* @ param alias alias
* @ return this as alias */
@ SuppressWarnings ( "unchecked" ) public SimpleExpression < T > as ( Path < ? > alias ) { } } | return Expressions . as ( this , ( Path ) alias ) ; |
public class Locale { /** * Replies the text that corresponds to the specified resource .
* @ param resource is the name of the resource file
* @ param key is the name of the resource into the specified file
* @ param defaultValue is the default value to replies if the resource does not contain the specified key .
* @ param params is the the list of parameters which will
* replaces the < code > # 1 < / code > , < code > # 2 < / code > . . . into the string .
* @ return the text that corresponds to the specified resource */
@ Pure public static String getStringWithDefault ( Class < ? > resource , String key , String defaultValue , Object ... params ) { } } | return getStringWithDefault ( ClassLoaderFinder . findClassLoader ( ) , detectResourceClass ( resource ) , key , defaultValue , params ) ; |
public class Snapshot { /** * A list of the cache nodes in the source cluster .
* @ return A list of the cache nodes in the source cluster . */
public java . util . List < NodeSnapshot > getNodeSnapshots ( ) { } } | if ( nodeSnapshots == null ) { nodeSnapshots = new com . amazonaws . internal . SdkInternalList < NodeSnapshot > ( ) ; } return nodeSnapshots ; |
public class Annotation { /** * Syncs the local object with the stored object for atomic writes ,
* overwriting the stored data if the user issued a PUT request
* < b > Note : < / b > This method also resets the { @ code changed } map to false
* for every field
* @ param meta The stored object to sync from
* @ param overwrite Whether or not all user mutable data in storage should be
* replaced by the local object */
private void syncNote ( final Annotation note , final boolean overwrite ) { } } | if ( note . start_time > 0 && ( note . start_time < start_time || start_time == 0 ) ) { start_time = note . start_time ; } // handle user - accessible stuff
if ( ! overwrite && ! changed . get ( "end_time" ) ) { end_time = note . end_time ; } if ( ! overwrite && ! changed . get ( "description" ) ) { description = note . description ; } if ( ! overwrite && ! changed . get ( "notes" ) ) { notes = note . notes ; } if ( ! overwrite && ! changed . get ( "custom" ) ) { custom = note . custom ; } // reset changed flags
initializeChangedMap ( ) ; |
public class CommercePriceEntryPersistenceImpl { /** * Returns the last commerce price entry in the ordered set where uuid = & # 63 ; and companyId = & # 63 ; .
* @ param uuid the uuid
* @ param companyId the company ID
* @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > )
* @ return the last matching commerce price entry
* @ throws NoSuchPriceEntryException if a matching commerce price entry could not be found */
@ Override public CommercePriceEntry findByUuid_C_Last ( String uuid , long companyId , OrderByComparator < CommercePriceEntry > orderByComparator ) throws NoSuchPriceEntryException { } } | CommercePriceEntry commercePriceEntry = fetchByUuid_C_Last ( uuid , companyId , orderByComparator ) ; if ( commercePriceEntry != null ) { return commercePriceEntry ; } StringBundler msg = new StringBundler ( 6 ) ; msg . append ( _NO_SUCH_ENTITY_WITH_KEY ) ; msg . append ( "uuid=" ) ; msg . append ( uuid ) ; msg . append ( ", companyId=" ) ; msg . append ( companyId ) ; msg . append ( "}" ) ; throw new NoSuchPriceEntryException ( msg . toString ( ) ) ; |
public class DoubleConstantField { /** * Loads this constant ' s settings from the Properties . If they don ' t exist this will do nothing . */
@ Override public void loadFromProperties ( Properties props ) { } } | String strValue = props . getProperty ( container . getSimpleName ( ) + "." + name ) ; if ( strValue == null ) return ; try { double doubleValue = Double . parseDouble ( strValue ) ; set ( doubleValue ) ; } catch ( NumberFormatException nfe ) { } |
public class StringVar { /** * Appends the given char .
* If this instance is currently uninitialized the given char is used for initialization .
* @ param c the char to append
* @ return true */
public boolean append ( char c ) { } } | return set ( get ( ) == null ? String . valueOf ( c ) : get ( ) + c ) ; |
public class CmsResourceRelationView { /** * Gets the relation beans to display . < p >
* @ return the list of relation beans to display */
private ArrayList < CmsResourceStatusRelationBean > getRelationBeans ( ) { } } | switch ( m_mode ) { case targets : return m_statusBean . getRelationTargets ( ) ; case sources : return m_statusBean . getRelationSources ( ) ; case siblings : default : return m_statusBean . getSiblings ( ) ; } |
public class ScriptPluginProviderLoader { /** * Remove any cache dir for the file */
private synchronized boolean removeScriptPluginCache ( ) { } } | if ( null != fileExpandedDir && fileExpandedDir . exists ( ) ) { debug ( "removeScriptPluginCache: " + fileExpandedDir ) ; return FileUtils . deleteDir ( fileExpandedDir ) ; } return true ; |
public class ContainerBase { /** * { @ inheritDoc }
* @ see org . jboss . shrinkwrap . api . container . ManifestContainer # addAsManifestResource ( java . lang . String ,
* java . lang . String ) */
@ Override public T addAsManifestResource ( String resourceName , String target ) throws IllegalArgumentException { } } | Validate . notNull ( resourceName , "ResourceName should be specified" ) ; Validate . notNull ( target , "Target should be specified" ) ; return addAsManifestResource ( fileFromResource ( resourceName ) , target ) ; |
public class TypeHelper { /** * Replaces the types in the callSiteType parameter if more specific types
* given through the arguments . This is in general the case , unless
* the argument is null . */
protected static MethodType replaceWithMoreSpecificType ( Object [ ] args , MethodType callSiteType ) { } } | for ( int i = 0 ; i < args . length ; i ++ ) { // if argument null , take the static type
if ( args [ i ] == null ) continue ; if ( callSiteType . parameterType ( i ) . isPrimitive ( ) ) continue ; Class argClass = args [ i ] . getClass ( ) ; callSiteType = callSiteType . changeParameterType ( i , argClass ) ; } return callSiteType ; |
public class PatternMap { /** * Returns { @ code true } if { @ code pattern } is a valid pattern . */
public static boolean isValidPattern ( String pattern ) { } } | if ( pattern == null ) { return false ; } String canon = pattern . replace ( '/' , '.' ) ; return ClassName . isQualifiedName ( canon ) || ClassName . isStarQualifiedName ( canon ) ; |
public class CmsAreaSelectPanel { /** * Shows or hides the select area . < p >
* @ param show if < code > true < / code > the select area will be shown */
private void showSelect ( boolean show ) { } } | if ( show ) { m_main . addStyleName ( I_CmsLayoutBundle . INSTANCE . selectAreaCss ( ) . showSelect ( ) ) ; return ; } m_main . removeStyleName ( I_CmsLayoutBundle . INSTANCE . selectAreaCss ( ) . showSelect ( ) ) ; |
public class ApiOvhDedicatedCloud { /** * Get this object properties
* REST : GET / dedicatedCloud / { serviceName } / vrack / { vrack }
* @ param serviceName [ required ] Domain of the service
* @ param vrack [ required ] vrack name */
public OvhDedicatedCloud serviceName_vrack_vrack_GET ( String serviceName , String vrack ) throws IOException { } } | String qPath = "/dedicatedCloud/{serviceName}/vrack/{vrack}" ; StringBuilder sb = path ( qPath , serviceName , vrack ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , OvhDedicatedCloud . class ) ; |
public class ExpressionVisitor { /** * If the function is an extension function , register the namespace .
* @ param owner The current XPath object that owns the expression .
* @ param func The function currently being visited .
* @ return true to continue the visit in the subtree , if any . */
public boolean visitFunction ( ExpressionOwner owner , Function func ) { } } | if ( func instanceof FuncExtFunction ) { String namespace = ( ( FuncExtFunction ) func ) . getNamespace ( ) ; m_sroot . getExtensionNamespacesManager ( ) . registerExtension ( namespace ) ; } else if ( func instanceof FuncExtFunctionAvailable ) { String arg = ( ( FuncExtFunctionAvailable ) func ) . getArg0 ( ) . toString ( ) ; if ( arg . indexOf ( ":" ) > 0 ) { String prefix = arg . substring ( 0 , arg . indexOf ( ":" ) ) ; String namespace = this . m_sroot . getNamespaceForPrefix ( prefix ) ; m_sroot . getExtensionNamespacesManager ( ) . registerExtension ( namespace ) ; } } return true ; |
public class IovArray { /** * Add a { @ link ByteBuf } to this { @ link IovArray } .
* @ param buf The { @ link ByteBuf } to add .
* @ return { @ code true } if the entire { @ link ByteBuf } has been added to this { @ link IovArray } . Note in the event
* that { @ link ByteBuf } is a { @ link CompositeByteBuf } { @ code false } may be returned even if some of the components
* have been added . */
public boolean add ( ByteBuf buf ) { } } | if ( count == IOV_MAX ) { // No more room !
return false ; } else if ( buf . nioBufferCount ( ) == 1 ) { final int len = buf . readableBytes ( ) ; if ( len == 0 ) { return true ; } if ( buf . hasMemoryAddress ( ) ) { return add ( buf . memoryAddress ( ) , buf . readerIndex ( ) , len ) ; } else { ByteBuffer nioBuffer = buf . internalNioBuffer ( buf . readerIndex ( ) , len ) ; return add ( Buffer . memoryAddress ( nioBuffer ) , nioBuffer . position ( ) , len ) ; } } else { ByteBuffer [ ] buffers = buf . nioBuffers ( ) ; for ( ByteBuffer nioBuffer : buffers ) { final int len = nioBuffer . remaining ( ) ; if ( len != 0 && ( ! add ( Buffer . memoryAddress ( nioBuffer ) , nioBuffer . position ( ) , len ) || count == IOV_MAX ) ) { return false ; } } return true ; } |
public class ByteBuddy { /** * Creates a new builder for subclassing the provided type . If the provided type is an interface , a new class implementing
* this interface type is created .
* When extending a class , Byte Buddy imitates all visible constructors of the subclassed type . Any constructor is implemented
* to only invoke its super type constructor of equal signature . Another behavior can be specified by supplying an explicit
* { @ link ConstructorStrategy } by { @ link ByteBuddy # subclass ( Class , ConstructorStrategy ) } .
* < b > Note < / b > : This methods implements the supplied types in a generified state if they declare type variables or an owner type .
* < b > Note < / b > : Byte Buddy does not cache previous subclasses but will attempt the generation of a new subclass . For caching
* types , a external cache or { @ link TypeCache } should be used .
* @ param superType The super class or interface type to extend .
* @ param < T > A loaded type that the generated class is guaranteed to inherit .
* @ return A type builder for creating a new class extending the provided class or interface . */
@ SuppressWarnings ( "unchecked" ) public < T > DynamicType . Builder < T > subclass ( Class < T > superType ) { } } | return ( DynamicType . Builder < T > ) subclass ( TypeDescription . ForLoadedType . of ( superType ) ) ; |
public class JDBCBlob { /** * Retrieves all or part of the < code > BLOB < / code >
* value that this < code > Blob < / code > object represents , as an array of
* bytes . This < code > byte < / code > array contains up to < code > length < / code >
* consecutive bytes starting at position < code > pos < / code > .
* < ! - - start release - specific documentation - - >
* < div class = " ReleaseSpecificDocumentation " >
* < h3 > HSQLDB - Specific Information : < / h3 > < p >
* The official specification above is ambiguous in that it does not
* precisely indicate the policy to be observed when
* pos > this . length ( ) - length . One policy would be to retrieve the
* octets from pos to this . length ( ) . Another would be to throw an
* exception . HSQLDB observes the second policy .
* < / div > < ! - - end release - specific documentation - - >
* @ param pos the ordinal position of the first byte in the
* < code > BLOB < / code > value to be extracted ; the first byte is at
* position 1
* @ param length the number of consecutive bytes to be copied
* @ return a byte array containing up to < code > length < / code >
* consecutive bytes from the < code > BLOB < / code > value designated
* by this < code > Blob < / code > object , starting with the
* byte at position < code > pos < / code >
* @ exception SQLException if there is an error accessing the BLOB value ;
* if < code > pos < / code > is less than 1 or < code > length < / code > is
* less than 0.
* @ exception SQLFeatureNotSupportedException if the JDBC driver does not support
* this method
* @ see # setBytes
* @ since JDK 1.2 , HSQLDB 1.7.2 */
public byte [ ] getBytes ( long pos , final int length ) throws SQLException { } } | final byte [ ] ldata = data ; checkValid ( ldata ) ; final int dlen = ldata . length ; if ( pos < MIN_POS || pos > MIN_POS + dlen ) { throw Util . outOfRangeArgument ( "pos: " + pos ) ; } pos -- ; if ( length < 0 || length > dlen - pos ) { throw Util . outOfRangeArgument ( "length: " + length ) ; } final byte [ ] out = new byte [ length ] ; System . arraycopy ( ldata , ( int ) pos , out , 0 , length ) ; return out ; |
public class XmlConfiguration { /** * Create a new value object .
* @ param obj @ param node @ return @ exception NoSuchMethodException @ exception
* ClassNotFoundException @ exception InvocationTargetException */
private Object newObj ( Object obj , XmlParser . Node node ) throws NoSuchMethodException , ClassNotFoundException , InvocationTargetException , IllegalAccessException { } } | Class oClass = nodeClass ( node ) ; String id = node . getAttribute ( "id" ) ; int size = 0 ; int argi = node . size ( ) ; for ( int i = 0 ; i < node . size ( ) ; i ++ ) { Object o = node . get ( i ) ; if ( o instanceof String ) continue ; if ( ! ( ( XmlParser . Node ) o ) . getTag ( ) . equals ( "Arg" ) ) { argi = i ; break ; } size ++ ; } Object [ ] arg = new Object [ size ] ; for ( int i = 0 , j = 0 ; j < size ; i ++ ) { Object o = node . get ( i ) ; if ( o instanceof String ) continue ; arg [ j ++ ] = value ( obj , ( XmlParser . Node ) o ) ; } if ( log . isDebugEnabled ( ) ) log . debug ( "new " + oClass ) ; // Lets just try all constructors for now
Constructor [ ] constructors = oClass . getConstructors ( ) ; for ( int c = 0 ; constructors != null && c < constructors . length ; c ++ ) { if ( constructors [ c ] . getParameterTypes ( ) . length != size ) continue ; Object n = null ; boolean called = false ; try { n = constructors [ c ] . newInstance ( arg ) ; called = true ; } catch ( IllegalAccessException e ) { LogSupport . ignore ( log , e ) ; } catch ( InstantiationException e ) { LogSupport . ignore ( log , e ) ; } catch ( IllegalArgumentException e ) { LogSupport . ignore ( log , e ) ; } if ( called ) { if ( id != null ) _idMap . put ( id , n ) ; configure ( n , node , argi ) ; return n ; } } throw new IllegalStateException ( "No Constructor: " + node + " on " + obj ) ; |
public class AllureThreadContext { /** * Returns last ( most recent ) uuid . */
public Optional < String > getCurrent ( ) { } } | final LinkedList < String > uuids = context . get ( ) ; return uuids . isEmpty ( ) ? Optional . empty ( ) : Optional . of ( uuids . getFirst ( ) ) ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.