signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class DefaultSpeciesNewStrategy { /** * Creates a new instance of a collection based on the class type of collection , not on the type of objects the collections contains . * e . g . CollectionFactory . < Integer > speciesNew ( hashSetOfString ) returns a new HashSet < Integer > ( ) ; * e . g . CollectionFactory . < Date > speciesNew ( linkedListOfWombles ) returns a new LinkedList < Date > ( ) ; */ public < T > Collection < T > speciesNew ( Collection < ? > collection ) { } }
if ( collection instanceof MutableCollection ) { return ( ( MutableCollection < T > ) collection ) . newEmpty ( ) ; } if ( collection instanceof Proxy ) { return DefaultSpeciesNewStrategy . createNewInstanceForCollectionType ( collection ) ; } if ( ReflectionHelper . hasDefaultConstructor ( collection . getClass ( ) ) ) { return ( Collection < T > ) ReflectionHelper . newInstance ( collection . getClass ( ) ) ; } return DefaultSpeciesNewStrategy . createNewInstanceForCollectionType ( collection ) ;
public class CMISObjectWrapper { /** * - - - - - public static methods - - - - - */ public static String translateIdToUsername ( final String id ) throws FrameworkException { } }
if ( Principal . SUPERUSER_ID . equals ( id ) ) { return Settings . SuperUserName . getValue ( ) ; } final Principal principal = StructrApp . getInstance ( ) . get ( Principal . class , id ) ; if ( principal != null ) { return principal . getName ( ) ; } return Principal . ANONYMOUS ;
public class Async { /** * Convert a synchronous action call into an asynchronous function call through an Observable . * < img width = " 640 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / toAsync . ans . png " alt = " " > * @ param < T1 > the first parameter type * @ param < T2 > the second parameter type * @ param < T3 > the third parameter type * @ param < T4 > the fourth parameter type * @ param < T5 > the fifth parameter type * @ param < T6 > the sixth parameter type * @ param < T7 > the seventh parameter type * @ param < T8 > the eighth parameter type * @ param < T9 > the ninth parameter type * @ param action the action to convert * @ param scheduler the Scheduler used to execute the { @ code action } * @ return a function that returns an Observable that executes the { @ code action } and emits { @ code null } * @ 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 / hh229662 . aspx " > MSDN : Observable . ToAsync < / a > */ public static < T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 > Func9 < T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , Observable < Void > > toAsync ( final Action9 < ? super T1 , ? super T2 , ? super T3 , ? super T4 , ? super T5 , ? super T6 , ? super T7 , ? super T8 , ? super T9 > action , final Scheduler scheduler ) { } }
return toAsync ( Actions . toFunc ( action ) , scheduler ) ;
public class XmlWriter { /** * Method called to handle invalid character in textual content requested * to be output . Content may be part of textual events ( CHARACTER , CDATA ) , * attribute value , COMMENT content or PROCESSING _ INSTRUCTION data . * The default behavior is to just throw an exception , but this can * be configured via property { @ link WstxOutputProperties # P _ OUTPUT _ INVALID _ CHAR _ HANDLER } . */ protected char handleInvalidChar ( int c ) throws IOException { } }
// First , let ' s flush any output we may have , to make debugging easier flush ( ) ; InvalidCharHandler h = mConfig . getInvalidCharHandler ( ) ; if ( h == null ) { h = InvalidCharHandler . FailingHandler . getInstance ( ) ; } return h . convertInvalidChar ( c ) ;
public class UberLinkDiscoverer { /** * Deserialize the entire document to find links . * @ param json * @ return */ private Links getLinks ( String json ) { } }
try { return this . mapper . readValue ( json , UberDocument . class ) . getUber ( ) . getLinks ( ) ; } catch ( IOException e ) { throw new RuntimeException ( e ) ; }
public class StreamSegmentContainer { /** * Attempts to seal a Segment that may already be sealed . * @ param metadata The SegmentMetadata for the Segment to Seal . * @ param timeout Timeout for the operation . * @ return A CompletableFuture that will indicate when the operation completes . If the given segment is already sealed , * this future will already be completed , otherwise it will complete once the seal is performed . */ private CompletableFuture < Void > trySealStreamSegment ( SegmentMetadata metadata , Duration timeout ) { } }
if ( metadata . isSealed ( ) ) { return CompletableFuture . completedFuture ( null ) ; } else { // It is OK to ignore StreamSegmentSealedException as the segment may have already been sealed by a concurrent // call to this or via some other operation . return Futures . exceptionallyExpecting ( this . durableLog . add ( new StreamSegmentSealOperation ( metadata . getId ( ) ) , timeout ) , ex -> ex instanceof StreamSegmentSealedException , null ) ; }
public class TargetTableHeader { /** * Validation for drag event . * @ param dragEvent * @ return */ private Boolean doValidations ( final DragAndDropEvent dragEvent ) { } }
final Component compsource = dragEvent . getTransferable ( ) . getSourceComponent ( ) ; Boolean isValid = Boolean . TRUE ; if ( compsource instanceof Table && ! isComplexFilterViewDisplayed ) { final TableTransferable transferable = ( TableTransferable ) dragEvent . getTransferable ( ) ; final Table source = transferable . getSourceComponent ( ) ; if ( ! source . getId ( ) . equals ( UIComponentIdProvider . DIST_TABLE_ID ) ) { notification . displayValidationError ( i18n . getMessage ( UIMessageIdProvider . MESSAGE_ACTION_NOT_ALLOWED ) ) ; isValid = Boolean . FALSE ; } else { if ( getDropppedDistributionDetails ( transferable ) . size ( ) > 1 ) { notification . displayValidationError ( i18n . getMessage ( "message.onlyone.distribution.dropallowed" ) ) ; isValid = Boolean . FALSE ; } } } else { notification . displayValidationError ( i18n . getMessage ( UIMessageIdProvider . MESSAGE_ACTION_NOT_ALLOWED ) ) ; isValid = Boolean . FALSE ; } return isValid ;
public class RolesEndpoint { /** * This endpoint requires a role that is mapped to the group1 role * @ return principal name */ @ GET @ Path ( "/needsGroup1Mapping" ) @ RolesAllowed ( "Group1MappedRole" ) public String needsGroup1Mapping ( @ Context SecurityContext sec ) { } }
Principal user = sec . getUserPrincipal ( ) ; sec . isUserInRole ( "group1" ) ; return user . getName ( ) ;
public class ByteUtil { /** * 将一个4位字节数组转换为4整数 。 < br > * 注意 , 函数中不会对字节数组长度进行判断 , 请自行保证传入参数的正确性 。 * @ param b 字节数组 * @ return 整数 */ public static int bytesToInt ( byte [ ] b ) { } }
int i = ( b [ 0 ] << 24 ) & 0xFF000000 ; i |= ( b [ 1 ] << 16 ) & 0xFF0000 ; i |= ( b [ 2 ] << 8 ) & 0xFF00 ; i |= b [ 3 ] & 0xFF ; return i ;
public class RemoteSuiteRunner { /** * { @ inheritDoc } */ public void run ( String source , String destination ) { } }
try { SystemUnderTest sut = SystemUnderTest . newInstance ( systemUnderTest ) ; sut . setProject ( Project . newInstance ( project ) ) ; Repository repository = Repository . newInstance ( repositoryId ) ; DocumentNode documentNode = xmlRpcRemoteRunner . getSpecificationHierarchy ( repository , sut ) ; List < DocumentNode > executableSpecs = extractExecutableSpecifications ( documentNode ) ; if ( executableSpecs . isEmpty ( ) ) { monitor . testRunning ( getLocation ( source , '/' ) ) ; monitor . testDone ( 0 , 0 , 0 , 0 ) ; } else { for ( DocumentNode spec : executableSpecs ) { documentRunner . run ( spec . getTitle ( ) , destination ) ; } } } catch ( Throwable t ) { monitor . exceptionOccured ( t ) ; }
public class Dim { /** * Interrupts script execution . */ private void interrupted ( Context cx , final StackFrame frame , Throwable scriptException ) { } }
ContextData contextData = frame . contextData ( ) ; boolean eventThreadFlag = callback . isGuiEventThread ( ) ; contextData . eventThreadFlag = eventThreadFlag ; boolean recursiveEventThreadCall = false ; interruptedCheck : synchronized ( eventThreadMonitor ) { if ( eventThreadFlag ) { if ( interruptedContextData != null ) { recursiveEventThreadCall = true ; break interruptedCheck ; } } else { while ( interruptedContextData != null ) { try { eventThreadMonitor . wait ( ) ; } catch ( InterruptedException exc ) { return ; } } } interruptedContextData = contextData ; } if ( recursiveEventThreadCall ) { // XXX : For now the following is commented out as on Linux // too deep recursion of dispatchNextGuiEvent causes GUI lockout . // Note : it can make GUI unresponsive if long - running script // will be called on GUI thread while processing another interrupt if ( false ) { // Run event dispatch until gui sets a flag to exit the initial // call to interrupted . while ( this . returnValue == - 1 ) { try { callback . dispatchNextGuiEvent ( ) ; } catch ( InterruptedException exc ) { } } } return ; } if ( interruptedContextData == null ) Kit . codeBug ( ) ; try { do { int frameCount = contextData . frameCount ( ) ; this . frameIndex = frameCount - 1 ; final String threadTitle = Thread . currentThread ( ) . toString ( ) ; final String alertMessage ; if ( scriptException == null ) { alertMessage = null ; } else { alertMessage = scriptException . toString ( ) ; } int returnValue = - 1 ; if ( ! eventThreadFlag ) { synchronized ( monitor ) { if ( insideInterruptLoop ) Kit . codeBug ( ) ; this . insideInterruptLoop = true ; this . evalRequest = null ; this . returnValue = - 1 ; callback . enterInterrupt ( frame , threadTitle , alertMessage ) ; try { for ( ; ; ) { try { monitor . wait ( ) ; } catch ( InterruptedException exc ) { Thread . currentThread ( ) . interrupt ( ) ; break ; } if ( evalRequest != null ) { this . evalResult = null ; try { evalResult = do_eval ( cx , evalFrame , evalRequest ) ; } finally { evalRequest = null ; evalFrame = null ; monitor . notify ( ) ; } continue ; } if ( this . returnValue != - 1 ) { returnValue = this . returnValue ; break ; } } } finally { insideInterruptLoop = false ; } } } else { this . returnValue = - 1 ; callback . enterInterrupt ( frame , threadTitle , alertMessage ) ; while ( this . returnValue == - 1 ) { try { callback . dispatchNextGuiEvent ( ) ; } catch ( InterruptedException exc ) { } } returnValue = this . returnValue ; } switch ( returnValue ) { case STEP_OVER : contextData . breakNextLine = true ; contextData . stopAtFrameDepth = contextData . frameCount ( ) ; break ; case STEP_INTO : contextData . breakNextLine = true ; contextData . stopAtFrameDepth = - 1 ; break ; case STEP_OUT : if ( contextData . frameCount ( ) > 1 ) { contextData . breakNextLine = true ; contextData . stopAtFrameDepth = contextData . frameCount ( ) - 1 ; } break ; } } while ( false ) ; } finally { synchronized ( eventThreadMonitor ) { interruptedContextData = null ; eventThreadMonitor . notifyAll ( ) ; } }
public class AmazonEC2Client { /** * Associates a target network with a Client VPN endpoint . A target network is a subnet in a VPC . You can associate * multiple subnets from the same VPC with a Client VPN endpoint . You can associate only one subnet in each * Availability Zone . We recommend that you associate at least two subnets to provide Availability Zone redundancy . * @ param associateClientVpnTargetNetworkRequest * @ return Result of the AssociateClientVpnTargetNetwork operation returned by the service . * @ sample AmazonEC2 . AssociateClientVpnTargetNetwork * @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / ec2-2016-11-15 / AssociateClientVpnTargetNetwork " * target = " _ top " > AWS API Documentation < / a > */ @ Override public AssociateClientVpnTargetNetworkResult associateClientVpnTargetNetwork ( AssociateClientVpnTargetNetworkRequest request ) { } }
request = beforeClientExecution ( request ) ; return executeAssociateClientVpnTargetNetwork ( request ) ;
public class Dart { /** * Inject fields annotated with { @ link BindExtra } in the specified { @ code target } using the { @ code * source } { @ link android . app . Fragment } . * @ param target Target class for field binding . * @ param source Activity on which IDs will be looked up . * @ throws Dart . UnableToInjectException if binding could not be performed . * @ see android . content . Intent # getExtras ( ) */ public static void bindNavigationModel ( Object target , Fragment source ) { } }
bindNavigationModel ( target , source , Finder . FRAGMENT ) ;
public class Operation { /** * Get the " generic type " of this { @ link Operation } , which parameterizes the narrowest type with the runtime * bindings of its declared type variables , if any . * @ return Type * @ see Types # resolveAt ( Object , TypeVariable ) */ private final Type getGenericType ( ) { } }
final Class < ? > raw = getClass ( ) ; final TypeVariable < ? > [ ] typeParameters = raw . getTypeParameters ( ) ; if ( ArrayUtils . isEmpty ( typeParameters ) ) { return raw ; } final Type [ ] parameters = new Type [ typeParameters . length ] ; // use empty type variable map because we ' re relying on @ BindTypeVariable functionality : final Map < TypeVariable < ? > , Type > typeVariableMap = Collections . emptyMap ( ) ; for ( int i = 0 ; i < parameters . length ; i ++ ) { parameters [ i ] = Types . resolveAt ( this , typeParameters [ i ] , typeVariableMap ) ; } return TypeUtils . parameterize ( raw , parameters ) ;
public class FreemarkerTemplateEngine { /** * Load template in hierarchical path * @ param templateName * @ throws Exception */ private Template getTemplate ( String templateName ) throws ParseException { } }
try { return config . getTemplate ( templateName , "UTF-8" ) ; } catch ( ParseException e ) { throw e ; } catch ( IOException e ) { logger . error ( "Couldn't load template '{}',loader is {}" , templateName , config . getTemplateLoader ( ) . getClass ( ) ) ; throw Throwables . propagate ( e ) ; }
public class ImageLoader { /** * Convert a matrix in to a buffereed image * @ param matrix the * @ return { @ link java . awt . image . BufferedImage } */ public static BufferedImage toImage ( INDArray matrix ) { } }
BufferedImage img = new BufferedImage ( matrix . rows ( ) , matrix . columns ( ) , BufferedImage . TYPE_INT_ARGB ) ; WritableRaster r = img . getRaster ( ) ; int [ ] equiv = new int [ ( int ) matrix . length ( ) ] ; for ( int i = 0 ; i < equiv . length ; i ++ ) { equiv [ i ] = ( int ) matrix . getDouble ( i ) ; } r . setDataElements ( 0 , 0 , matrix . rows ( ) , matrix . columns ( ) , equiv ) ; return img ;
public class ReadableWrappersImpl { /** * Converts Observable of list to Observable of Inner . * @ param innerList list to be converted . * @ param < InnerT > type of inner . * @ return Observable for list of inner . */ public static < InnerT > Observable < InnerT > convertListToInnerAsync ( Observable < List < InnerT > > innerList ) { } }
return innerList . flatMap ( new Func1 < List < InnerT > , Observable < InnerT > > ( ) { @ Override public Observable < InnerT > call ( List < InnerT > inners ) { return Observable . from ( inners ) ; } } ) ;
public class SubCommandMetaCheck { /** * Parses command - line and checks if metadata is consistent across all * nodes . * @ param args Command - line input * @ param printHelp Tells whether to print help only or execute command * actually * @ throws IOException */ @ SuppressWarnings ( "unchecked" ) public static void executeCommand ( String [ ] args ) throws IOException { } }
OptionParser parser = getParser ( ) ; // declare parameters List < String > metaKeys = null ; String url = null ; // parse command - line input args = AdminToolUtils . copyArrayAddFirst ( args , "--" + OPT_HEAD_META_CHECK ) ; OptionSet options = parser . parse ( args ) ; if ( options . has ( AdminParserUtils . OPT_HELP ) ) { printHelp ( System . out ) ; return ; } // check required options and / or conflicting options AdminParserUtils . checkRequired ( options , OPT_HEAD_META_CHECK ) ; AdminParserUtils . checkRequired ( options , AdminParserUtils . OPT_URL ) ; // load parameters metaKeys = ( List < String > ) options . valuesOf ( OPT_HEAD_META_CHECK ) ; url = ( String ) options . valueOf ( AdminParserUtils . OPT_URL ) ; // execute command if ( metaKeys . size ( ) == 0 || ( metaKeys . size ( ) == 1 && metaKeys . get ( 0 ) . equals ( METAKEY_ALL ) ) ) { metaKeys = Lists . newArrayList ( ) ; metaKeys . add ( MetadataStore . CLUSTER_KEY ) ; metaKeys . add ( MetadataStore . STORES_KEY ) ; metaKeys . add ( MetadataStore . SERVER_STATE_KEY ) ; } AdminClient adminClient = AdminToolUtils . getAdminClient ( url ) ; doMetaCheck ( adminClient , metaKeys ) ;
public class SimpleFormatterImpl { /** * Formats the not - compiled pattern with the given values . * Equivalent to compileToStringMinMaxArguments ( ) followed by formatCompiledPattern ( ) . * The number of arguments checked against the given limits is the * highest argument number plus one , not the number of occurrences of arguments . * @ param pattern Not - compiled form of a pattern string . * @ param min The pattern must have at least this many arguments . * @ param max The pattern must have at most this many arguments . * @ return The compiled - pattern string . * @ throws IllegalArgumentException for bad argument syntax and too few or too many arguments . */ public static String formatRawPattern ( String pattern , int min , int max , CharSequence ... values ) { } }
StringBuilder sb = new StringBuilder ( ) ; String compiledPattern = compileToStringMinMaxArguments ( pattern , sb , min , max ) ; sb . setLength ( 0 ) ; return formatAndAppend ( compiledPattern , sb , null , values ) . toString ( ) ;
public class InternalSARLParser { /** * InternalSARL . g : 11039:1 : ruleInternalRichString returns [ EObject current = null ] : ( ( ) ( ( ( lv _ expressions _ 1_0 = ruleRichStringLiteralInbetween ) ) ( ( ( lv _ expressions _ 2_0 = ruleRichStringPart ) ) ? ( ( lv _ expressions _ 3_0 = ruleRichStringLiteralInbetween ) ) ) * ) ) ; */ public final EObject ruleInternalRichString ( ) throws RecognitionException { } }
EObject current = null ; EObject lv_expressions_1_0 = null ; EObject lv_expressions_2_0 = null ; EObject lv_expressions_3_0 = null ; enterRule ( ) ; try { // InternalSARL . g : 11045:2 : ( ( ( ) ( ( ( lv _ expressions _ 1_0 = ruleRichStringLiteralInbetween ) ) ( ( ( lv _ expressions _ 2_0 = ruleRichStringPart ) ) ? ( ( lv _ expressions _ 3_0 = ruleRichStringLiteralInbetween ) ) ) * ) ) ) // InternalSARL . g : 11046:2 : ( ( ) ( ( ( lv _ expressions _ 1_0 = ruleRichStringLiteralInbetween ) ) ( ( ( lv _ expressions _ 2_0 = ruleRichStringPart ) ) ? ( ( lv _ expressions _ 3_0 = ruleRichStringLiteralInbetween ) ) ) * ) ) { // InternalSARL . g : 11046:2 : ( ( ) ( ( ( lv _ expressions _ 1_0 = ruleRichStringLiteralInbetween ) ) ( ( ( lv _ expressions _ 2_0 = ruleRichStringPart ) ) ? ( ( lv _ expressions _ 3_0 = ruleRichStringLiteralInbetween ) ) ) * ) ) // InternalSARL . g : 11047:3 : ( ) ( ( ( lv _ expressions _ 1_0 = ruleRichStringLiteralInbetween ) ) ( ( ( lv _ expressions _ 2_0 = ruleRichStringPart ) ) ? ( ( lv _ expressions _ 3_0 = ruleRichStringLiteralInbetween ) ) ) * ) { // InternalSARL . g : 11047:3 : ( ) // InternalSARL . g : 11048:4: { if ( state . backtracking == 0 ) { current = forceCreateModelElement ( grammarAccess . getInternalRichStringAccess ( ) . getRichStringAction_0 ( ) , current ) ; } } // InternalSARL . g : 11054:3 : ( ( ( lv _ expressions _ 1_0 = ruleRichStringLiteralInbetween ) ) ( ( ( lv _ expressions _ 2_0 = ruleRichStringPart ) ) ? ( ( lv _ expressions _ 3_0 = ruleRichStringLiteralInbetween ) ) ) * ) // InternalSARL . g : 11055:4 : ( ( lv _ expressions _ 1_0 = ruleRichStringLiteralInbetween ) ) ( ( ( lv _ expressions _ 2_0 = ruleRichStringPart ) ) ? ( ( lv _ expressions _ 3_0 = ruleRichStringLiteralInbetween ) ) ) * { // InternalSARL . g : 11055:4 : ( ( lv _ expressions _ 1_0 = ruleRichStringLiteralInbetween ) ) // InternalSARL . g : 11056:5 : ( lv _ expressions _ 1_0 = ruleRichStringLiteralInbetween ) { // InternalSARL . g : 11056:5 : ( lv _ expressions _ 1_0 = ruleRichStringLiteralInbetween ) // InternalSARL . g : 11057:6 : lv _ expressions _ 1_0 = ruleRichStringLiteralInbetween { if ( state . backtracking == 0 ) { newCompositeNode ( grammarAccess . getInternalRichStringAccess ( ) . getExpressionsRichStringLiteralInbetweenParserRuleCall_1_0_0 ( ) ) ; } pushFollow ( FOLLOW_102 ) ; lv_expressions_1_0 = ruleRichStringLiteralInbetween ( ) ; state . _fsp -- ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { if ( current == null ) { current = createModelElementForParent ( grammarAccess . getInternalRichStringRule ( ) ) ; } add ( current , "expressions" , lv_expressions_1_0 , "org.eclipse.xtend.core.Xtend.RichStringLiteralInbetween" ) ; afterParserOrEnumRuleCall ( ) ; } } } // InternalSARL . g : 11074:4 : ( ( ( lv _ expressions _ 2_0 = ruleRichStringPart ) ) ? ( ( lv _ expressions _ 3_0 = ruleRichStringLiteralInbetween ) ) ) * loop279 : do { int alt279 = 2 ; int LA279_0 = input . LA ( 1 ) ; if ( ( ( LA279_0 >= RULE_STRING && LA279_0 <= RULE_COMMENT_RICH_TEXT_INBETWEEN ) || ( LA279_0 >= RULE_HEX && LA279_0 <= RULE_DECIMAL ) || LA279_0 == 25 || ( LA279_0 >= 28 && LA279_0 <= 29 ) || LA279_0 == 36 || ( LA279_0 >= 39 && LA279_0 <= 40 ) || ( LA279_0 >= 42 && LA279_0 <= 45 ) || ( LA279_0 >= 48 && LA279_0 <= 49 ) || LA279_0 == 51 || LA279_0 == 55 || ( LA279_0 >= 60 && LA279_0 <= 63 ) || ( LA279_0 >= 65 && LA279_0 <= 68 ) || ( LA279_0 >= 73 && LA279_0 <= 75 ) || ( LA279_0 >= 78 && LA279_0 <= 96 ) || LA279_0 == 99 || LA279_0 == 101 || LA279_0 == 106 || LA279_0 == 129 || ( LA279_0 >= 131 && LA279_0 <= 140 ) ) ) { alt279 = 1 ; } switch ( alt279 ) { case 1 : // InternalSARL . g : 11075:5 : ( ( lv _ expressions _ 2_0 = ruleRichStringPart ) ) ? ( ( lv _ expressions _ 3_0 = ruleRichStringLiteralInbetween ) ) { // InternalSARL . g : 11075:5 : ( ( lv _ expressions _ 2_0 = ruleRichStringPart ) ) ? int alt278 = 2 ; int LA278_0 = input . LA ( 1 ) ; if ( ( ( LA278_0 >= RULE_STRING && LA278_0 <= RULE_RICH_TEXT_START ) || ( LA278_0 >= RULE_HEX && LA278_0 <= RULE_DECIMAL ) || LA278_0 == 25 || ( LA278_0 >= 28 && LA278_0 <= 29 ) || LA278_0 == 36 || ( LA278_0 >= 39 && LA278_0 <= 40 ) || ( LA278_0 >= 42 && LA278_0 <= 45 ) || ( LA278_0 >= 48 && LA278_0 <= 49 ) || LA278_0 == 51 || LA278_0 == 55 || ( LA278_0 >= 60 && LA278_0 <= 63 ) || ( LA278_0 >= 65 && LA278_0 <= 68 ) || ( LA278_0 >= 73 && LA278_0 <= 75 ) || ( LA278_0 >= 78 && LA278_0 <= 96 ) || LA278_0 == 99 || LA278_0 == 101 || LA278_0 == 106 || LA278_0 == 129 || ( LA278_0 >= 131 && LA278_0 <= 140 ) ) ) { alt278 = 1 ; } switch ( alt278 ) { case 1 : // InternalSARL . g : 11076:6 : ( lv _ expressions _ 2_0 = ruleRichStringPart ) { // InternalSARL . g : 11076:6 : ( lv _ expressions _ 2_0 = ruleRichStringPart ) // InternalSARL . g : 11077:7 : lv _ expressions _ 2_0 = ruleRichStringPart { if ( state . backtracking == 0 ) { newCompositeNode ( grammarAccess . getInternalRichStringAccess ( ) . getExpressionsRichStringPartParserRuleCall_1_1_0_0 ( ) ) ; } pushFollow ( FOLLOW_103 ) ; lv_expressions_2_0 = ruleRichStringPart ( ) ; state . _fsp -- ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { if ( current == null ) { current = createModelElementForParent ( grammarAccess . getInternalRichStringRule ( ) ) ; } add ( current , "expressions" , lv_expressions_2_0 , "org.eclipse.xtend.core.Xtend.RichStringPart" ) ; afterParserOrEnumRuleCall ( ) ; } } } break ; } // InternalSARL . g : 11094:5 : ( ( lv _ expressions _ 3_0 = ruleRichStringLiteralInbetween ) ) // InternalSARL . g : 11095:6 : ( lv _ expressions _ 3_0 = ruleRichStringLiteralInbetween ) { // InternalSARL . g : 11095:6 : ( lv _ expressions _ 3_0 = ruleRichStringLiteralInbetween ) // InternalSARL . g : 11096:7 : lv _ expressions _ 3_0 = ruleRichStringLiteralInbetween { if ( state . backtracking == 0 ) { newCompositeNode ( grammarAccess . getInternalRichStringAccess ( ) . getExpressionsRichStringLiteralInbetweenParserRuleCall_1_1_1_0 ( ) ) ; } pushFollow ( FOLLOW_102 ) ; lv_expressions_3_0 = ruleRichStringLiteralInbetween ( ) ; state . _fsp -- ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { if ( current == null ) { current = createModelElementForParent ( grammarAccess . getInternalRichStringRule ( ) ) ; } add ( current , "expressions" , lv_expressions_3_0 , "org.eclipse.xtend.core.Xtend.RichStringLiteralInbetween" ) ; afterParserOrEnumRuleCall ( ) ; } } } } break ; default : break loop279 ; } } while ( true ) ; } } } if ( state . backtracking == 0 ) { leaveRule ( ) ; } } catch ( RecognitionException re ) { recover ( input , re ) ; appendSkippedTokens ( ) ; } finally { } return current ;
public class ValueEnforcer { /** * Check if * < code > nValue & ge ; nLowerBoundInclusive & amp ; & amp ; nValue & le ; nUpperBoundInclusive < / code > * @ param aValue * Value * @ param aName * Name * @ param aLowerBoundInclusive * Lower bound * @ param aUpperBoundInclusive * Upper bound * @ return The value */ public static BigDecimal isBetweenInclusive ( final BigDecimal aValue , @ Nonnull final Supplier < ? extends String > aName , @ Nonnull final BigDecimal aLowerBoundInclusive , @ Nonnull final BigDecimal aUpperBoundInclusive ) { } }
notNull ( aValue , aName ) ; notNull ( aLowerBoundInclusive , "LowerBoundInclusive" ) ; notNull ( aUpperBoundInclusive , "UpperBoundInclusive" ) ; if ( isEnabled ( ) ) if ( aValue . compareTo ( aLowerBoundInclusive ) < 0 || aValue . compareTo ( aUpperBoundInclusive ) > 0 ) throw new IllegalArgumentException ( "The value of '" + aName . get ( ) + "' must be >= " + aLowerBoundInclusive + " and <= " + aUpperBoundInclusive + "! The current value is: " + aValue ) ; return aValue ;
public class SeaGlassTabbedPaneUI { /** * Create a SynthContext for the component and state . Use the default * region . * @ param c the component . * @ param state the state . * @ return the newly created SynthContext . */ public SeaGlassContext getContext ( JComponent c , int state ) { } }
return SeaGlassContext . getContext ( SeaGlassContext . class , c , SeaGlassLookAndFeel . getRegion ( c ) , style , state ) ;
public class Link { /** * Default XML output . * @ param buffer * @ throws IOException */ public void xmlWriteOn ( FormattedWriter writer ) throws IOException { } }
String name = "link" ; writer . write ( "<" ) ; writer . write ( name ) ; xmlWriteAttributesOn ( writer ) ; writer . write ( " />" ) ;
public class ExpressionToSoyValueProviderCompiler { /** * Create an expression compiler that can implement complex detaching logic with the given { @ link * ExpressionDetacher . Factory } */ static ExpressionToSoyValueProviderCompiler create ( TemplateVariableManager varManager , ExpressionCompiler exprCompiler , TemplateParameterLookup variables ) { } }
return new ExpressionToSoyValueProviderCompiler ( varManager , exprCompiler , variables ) ;
public class CompileTask { /** * Compile one or more WhileyFiles into a given WyilFile * @ param source The source file being compiled . * @ param target The target file being generated . * @ return * @ throws IOException */ private static WyilFile compile ( List < Path . Entry < WhileyFile > > sources , Path . Entry < WyilFile > target ) throws IOException { } }
// Read target WyilFile . This may have already been compiled in a previous run // and , in such case , we are invalidating some or all of the existing file . WyilFile wyil = target . read ( ) ; // Parse all modules for ( int i = 0 ; i != sources . size ( ) ; ++ i ) { Path . Entry < WhileyFile > source = sources . get ( i ) ; WhileyFileParser wyp = new WhileyFileParser ( wyil , source . read ( ) ) ; // FIXME : what to do with module added to heap ? The problem is that this might // be replaced a module , for example . wyil . getModule ( ) . putUnit ( wyp . read ( ) ) ; } return wyil ;
public class XMLUpdateShredder { /** * Initialize variables needed for the main algorithm . */ private void initializeVars ( ) { } }
mNodeKey = mWtx . getNode ( ) . getDataKey ( ) ; mFound = false ; mIsRightSibling = false ; mKeyMatches = - 1 ;
public class Follow { /** * This method ass the finish construction to the start symbol . If a start * symbol is defined by StartProduction this construction is used . If the there * is no such production , the fist production is used . * This is rule 1 from Dragon book : * 1 ) Platzieren Sie $ in FOLLOW ( S ) , wobei S das Startsymbol und $ die rechte * Endmarkierung fuer die Eingabe sind . */ private void addFinishToStart ( ) { } }
follow . get ( grammar . getProductions ( ) . get ( 0 ) . getName ( ) ) . add ( FinishTerminal . getInstance ( ) ) ;
public class PolicyCheckReport { /** * / * - - - Private methods - - - */ private Collection < LicenseHistogramDataPoint > createLicenseHistogram ( BaseCheckPoliciesResult result ) { } }
Collection < LicenseHistogramDataPoint > dataPoints = new ArrayList < LicenseHistogramDataPoint > ( ) ; // create distribution histogram Map < String , Integer > licenseHistogram = new HashMap < String , Integer > ( ) ; for ( Map . Entry < String , Collection < ResourceInfo > > entry : result . getProjectNewResources ( ) . entrySet ( ) ) { for ( ResourceInfo resource : entry . getValue ( ) ) { for ( String license : resource . getLicenses ( ) ) { licenseHistogram . put ( license , MapUtils . getInteger ( licenseHistogram , license , 0 ) + 1 ) ; } } } // sort by count descending List < Map . Entry < String , Integer > > licenses = new ArrayList < Map . Entry < String , Integer > > ( licenseHistogram . entrySet ( ) ) ; Collections . sort ( licenses , new ValueComparator ( ) ) ; // create data points if ( ! licenses . isEmpty ( ) ) { // first licenses for ( Map . Entry < String , Integer > entry : licenses . subList ( 0 , Math . min ( LICENSE_LIMIT , licenses . size ( ) ) ) ) { dataPoints . add ( new LicenseHistogramDataPoint ( entry . getKey ( ) , entry . getValue ( ) ) ) ; } // aggregation of histogram tail int tailSize = licenses . size ( ) - LICENSE_LIMIT ; int tailSum = 0 ; if ( tailSize > 0 ) { for ( Map . Entry < String , Integer > entry : licenses . subList ( LICENSE_LIMIT , licenses . size ( ) ) ) { tailSum += entry . getValue ( ) ; } dataPoints . add ( new LicenseHistogramDataPoint ( OTHER_LICENSE + " (" + tailSize + ")" , tailSum ) ) ; } // normalize bar height float factor = MAX_BAR_HEIGHT / ( float ) Math . max ( tailSum , licenses . get ( 0 ) . getValue ( ) ) ; for ( LicenseHistogramDataPoint dataPoint : dataPoints ) { dataPoint . setHeight ( ( int ) ( factor * dataPoint . getOccurrences ( ) ) ) ; } } return dataPoints ;
public class FNNImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public void eUnset ( int featureID ) { } }
switch ( featureID ) { case AfplibPackage . FNN__FNN_DATA : setFNNData ( FNN_DATA_EDEFAULT ) ; return ; } super . eUnset ( featureID ) ;
public class MaterialPushpin { /** * Apply the pushpin feature into the target widget */ public void apply ( ) { } }
Scheduler . get ( ) . scheduleDeferred ( ( ) -> { if ( widget != null ) { $ ( widget . getElement ( ) ) . pushpin ( options ) ; } else { GWT . log ( "Please set your widget before applying the pushpin" , new IllegalStateException ( ) ) ; } } ) ;
public class LambdaFunctionStartFailedEventDetailsMarshaller { /** * Marshall the given parameter object . */ public void marshall ( LambdaFunctionStartFailedEventDetails lambdaFunctionStartFailedEventDetails , ProtocolMarshaller protocolMarshaller ) { } }
if ( lambdaFunctionStartFailedEventDetails == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( lambdaFunctionStartFailedEventDetails . getError ( ) , ERROR_BINDING ) ; protocolMarshaller . marshall ( lambdaFunctionStartFailedEventDetails . getCause ( ) , CAUSE_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class KunderaJTAUserTransaction { /** * ( non - Javadoc ) * @ see javax . transaction . UserTransaction # getStatus ( ) */ @ Override public int getStatus ( ) throws SystemException { } }
Transaction tx = threadLocal . get ( ) ; if ( tx == null ) { return Status . STATUS_NO_TRANSACTION ; } return tx . getStatus ( ) ;
public class DefaultPageBook { /** * A simple utility method that reads the String value attribute of any annotation * instance . */ static String readAnnotationValue ( Annotation annotation ) { } }
try { Method m = annotation . getClass ( ) . getMethod ( "value" ) ; return ( String ) m . invoke ( annotation ) ; } catch ( NoSuchMethodException e ) { throw new IllegalStateException ( "Encountered a configured annotation that " + "has no value parameter. This should never happen. " + annotation , e ) ; } catch ( InvocationTargetException e ) { throw new IllegalStateException ( "Encountered a configured annotation that " + "could not be read." + annotation , e ) ; } catch ( IllegalAccessException e ) { throw new IllegalStateException ( "Encountered a configured annotation that " + "could not be read." + annotation , e ) ; }
public class AstBuilder { /** * @ Override * public Expression visitEnhancedExpression ( EnhancedExpressionContext ctx ) { * Expression expression ; * if ( asBoolean ( ctx . expression ( ) ) ) { * expression = ( Expression ) this . visit ( ctx . expression ( ) ) ; * } else if ( asBoolean ( ctx . standardLambdaExpression ( ) ) ) { * expression = this . visitStandardLambdaExpression ( ctx . standardLambdaExpression ( ) ) ; * } else { * throw createParsingFailedException ( " Unsupported enhanced expression : " + ctx . getText ( ) , ctx ) ; * return configureAST ( expression , ctx ) ; */ @ Override public ExpressionStatement visitCommandExprAlt ( CommandExprAltContext ctx ) { } }
return configureAST ( new ExpressionStatement ( this . visitCommandExpression ( ctx . commandExpression ( ) ) ) , ctx ) ;
public class Optimizer { /** * If a character class is empty , then it will not match anything and can be treated * as false . */ static Matcher convertEmptyCharClassToFalse ( Matcher matcher ) { } }
if ( matcher instanceof CharClassMatcher ) { return matcher . < CharClassMatcher > as ( ) . set ( ) . isEmpty ( ) ? FalseMatcher . INSTANCE : matcher ; } return matcher ;
public class MtasPayloadDecoder { /** * Inits the . * @ param startPosition the start position * @ param payload the payload * @ throws IOException Signals that an I / O exception has occurred . */ public void init ( int startPosition , byte [ ] payload ) throws IOException { } }
byteStream = new MtasBitInputStream ( payload ) ; mtasStartPosition = startPosition ; // analyse initial bits - position Boolean getOffset ; Boolean getRealOffset ; if ( byteStream . readBit ( ) == 1 ) { if ( byteStream . readBit ( ) == 1 ) { mtasPositionType = null ; } else { mtasPositionType = MtasPosition . POSITION_RANGE ; } } else { if ( byteStream . readBit ( ) == 1 ) { mtasPositionType = MtasPosition . POSITION_SET ; } else { mtasPositionType = MtasPosition . POSITION_SINGLE ; } } // analyze initial bits - offset if ( byteStream . readBit ( ) == 1 ) { getOffset = true ; } else { getOffset = false ; } // analyze initial bits - realOffset if ( byteStream . readBit ( ) == 1 ) { getRealOffset = true ; } else { getRealOffset = false ; } // analyze initial bits - parent if ( byteStream . readBit ( ) == 1 ) { mtasParent = true ; } else { mtasParent = false ; } // analyse initial bits - payload if ( byteStream . readBit ( ) == 1 ) { mtasPayload = true ; } else { mtasPayload = false ; } if ( byteStream . readBit ( ) == 0 ) { // string } else { // other } // get id mtasId = byteStream . readEliasGammaCodingNonNegativeInteger ( ) ; // get position info if ( mtasPositionType != null && mtasPositionType . equals ( MtasPosition . POSITION_SINGLE ) ) { mtasPosition = new MtasPosition ( mtasStartPosition ) ; } else if ( mtasPositionType != null && mtasPositionType . equals ( MtasPosition . POSITION_RANGE ) ) { mtasPosition = new MtasPosition ( mtasStartPosition , ( mtasStartPosition + byteStream . readEliasGammaCodingPositiveInteger ( ) - 1 ) ) ; } else if ( mtasPositionType != null && mtasPositionType . equals ( MtasPosition . POSITION_SET ) ) { mtasPositions = new TreeSet < > ( ) ; mtasPositions . add ( mtasStartPosition ) ; int numberOfPoints = byteStream . readEliasGammaCodingPositiveInteger ( ) ; int [ ] positionList = new int [ numberOfPoints ] ; positionList [ 0 ] = mtasStartPosition ; int previousPosition = 0 ; int currentPosition = mtasStartPosition ; for ( int i = 1 ; i < numberOfPoints ; i ++ ) { previousPosition = currentPosition ; currentPosition = previousPosition + byteStream . readEliasGammaCodingPositiveInteger ( ) ; positionList [ i ] = currentPosition ; } mtasPosition = new MtasPosition ( positionList ) ; } else { mtasPosition = null ; } // get offset and realOffset info if ( getOffset ) { int offsetStart = byteStream . readEliasGammaCodingNonNegativeInteger ( ) ; int offsetEnd = offsetStart + byteStream . readEliasGammaCodingPositiveInteger ( ) - 1 ; mtasOffset = new MtasOffset ( offsetStart , offsetEnd ) ; if ( getRealOffset ) { int realOffsetStart = byteStream . readEliasGammaCodingInteger ( ) + offsetStart ; int realOffsetEnd = realOffsetStart + byteStream . readEliasGammaCodingPositiveInteger ( ) - 1 ; mtasRealOffset = new MtasOffset ( realOffsetStart , realOffsetEnd ) ; } } else if ( getRealOffset ) { int realOffsetStart = byteStream . readEliasGammaCodingNonNegativeInteger ( ) ; int realOffsetEnd = realOffsetStart + byteStream . readEliasGammaCodingPositiveInteger ( ) - 1 ; mtasRealOffset = new MtasOffset ( realOffsetStart , realOffsetEnd ) ; } if ( mtasParent ) { mtasParentId = byteStream . readEliasGammaCodingInteger ( ) + mtasId ; } if ( mtasPayload ) { mtasPayloadValue = byteStream . readRemainingBytes ( ) ; }
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EClass getIfcFastenerType ( ) { } }
if ( ifcFastenerTypeEClass == null ) { ifcFastenerTypeEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 264 ) ; } return ifcFastenerTypeEClass ;
public class TarArchive { /** * Get a path for a temporary file for a given File . The temporary file is NOT created . The algorithm attempts to * handle filename collisions so that the name is unique . * @ return The temporary file ' s path . */ private String getTempFilePath ( File eFile ) { } }
String pathStr = this . tempPath + File . separator + eFile . getName ( ) + ".tmp" ; for ( int i = 1 ; i < 5 ; ++ i ) { File f = new File ( pathStr ) ; if ( ! f . exists ( ) ) { break ; } pathStr = this . tempPath + File . separator + eFile . getName ( ) + "-" + i + ".tmp" ; } return pathStr ;
public class Ifc2x3tc1PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EClass getIfcRelConnects ( ) { } }
if ( ifcRelConnectsEClass == null ) { ifcRelConnectsEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc2x3tc1Package . eNS_URI ) . getEClassifiers ( ) . get ( 456 ) ; } return ifcRelConnectsEClass ;
public class LazySocket { /** * Option 4. */ public void setReceiveBufferSize ( int size ) throws SocketException { } }
if ( mSocket != null ) { mSocket . setReceiveBufferSize ( size ) ; } else { setOption ( 4 , new Integer ( size ) ) ; }
public class Bills { /** * 查询交易成功账单 * @ param deviceInfo 微信支付分配的终端设备号 , 填写此字段 , 只下载该设备号的对账单 * @ param date 账单的日期 * @ return 账单明细 */ public BillDetail < Bill > querySuccess ( String deviceInfo , String date ) { } }
String data = query ( deviceInfo , date , BillType . SUCCESS ) ; return renderBillDetail ( data , BillFields . SUCCESS , Bill . class ) ;
public class AudioFormats { /** * and a AudioFormat . Encoding . matches method . */ public static boolean matches ( AudioFormat format1 , AudioFormat format2 ) { } }
// $ $ fb 19 Dec 99 : endian must be checked , too . // we do have a problem with redundant elements : // e . g . // encoding = ALAW | | ULAW - > bigEndian and samplesizeinbits don ' t matter // sample size in bits = = 8 - > bigEndian doesn ' t matter // sample size in bits > 8 - > PCM is always signed . // This is an overall issue in JavaSound , I think . // At present , it is not consistently implemented to support these // redundancies and implicit definitions // As a workaround of this issue I return in the converters // all combinations , e . g . for ULAW I return bigEndian and ! bigEndian formats . /* old version */ // as proposed by florian return format1 . getEncoding ( ) . equals ( format2 . getEncoding ( ) ) && ( format2 . getSampleSizeInBits ( ) <= 8 || format1 . getSampleSizeInBits ( ) == AudioSystem . NOT_SPECIFIED || format2 . getSampleSizeInBits ( ) == AudioSystem . NOT_SPECIFIED || format1 . isBigEndian ( ) == format2 . isBigEndian ( ) ) && doMatch ( format1 . getChannels ( ) , format2 . getChannels ( ) ) && doMatch ( format1 . getSampleSizeInBits ( ) , format2 . getSampleSizeInBits ( ) ) && doMatch ( format1 . getFrameSize ( ) , format2 . getFrameSize ( ) ) && doMatch ( format1 . getSampleRate ( ) , format2 . getSampleRate ( ) ) && doMatch ( format1 . getFrameRate ( ) , format2 . getFrameRate ( ) ) ;
public class GraphicalModel { /** * Set a training value for this variable in the graphical model . * @ param variable The variable to set . * @ param value The value to set on the variable . */ public void setTrainingLabel ( int variable , int value ) { } }
getVariableMetaDataByReference ( variable ) . put ( LogLikelihoodDifferentiableFunction . VARIABLE_TRAINING_VALUE , Integer . toString ( value ) ) ;
public class HostVsanSystem { /** * Evacuate this host from VSAN cluster . * The task is cancellable . * @ param maintenanceSpec - * Specifies the data evacuation mode . See { @ link com . vmware . vim25 . HostMaintenanceSpec HostMaintenanceSpec } . * If unspecified , the default mode chosen will be ensureObjectAccessibility . * @ param timeout - * Time to wait for the task to complete in seconds . If the value is less than or equal to zero , * there is no timeout . The operation fails with a Timedout exception if it timed out . * @ return This method returns a Task object with which to monitor the operation . * @ throws InvalidState * @ throws RequestCanceled * @ throws RuntimeFault * @ throws Timedout * @ throws VsanFault * @ throws RemoteException * @ since 6.0 */ public Task evacuateVsanNode_Task ( HostMaintenanceSpec maintenanceSpec , int timeout ) throws InvalidState , RequestCanceled , RuntimeFault , Timedout , VsanFault , RemoteException { } }
return new Task ( getServerConnection ( ) , getVimService ( ) . evacuateVsanNode_Task ( getMOR ( ) , maintenanceSpec , timeout ) ) ;
public class FileTag { /** * set the value charset Character set name for the file contents . * @ param charset value to set */ public void setCharset ( String charset ) { } }
if ( StringUtil . isEmpty ( charset ) ) return ; this . charset = CharsetUtil . toCharSet ( charset . trim ( ) ) ;
public class XPathParser { /** * Parses the the rule ComparisionExpr according to the following production * rule : * [ 10 ] ComparisonExpr : : = RangeExpr ( ( ValueComp | GeneralComp | NodeComp ) RangeExpr ) ? . * @ throws TTXPathException */ private void parseComparisionExpr ( ) throws TTXPathException { } }
parseRangeExpr ( ) ; final String mComp = mToken . getContent ( ) ; if ( isComp ( ) ) { // parse second operator axis mPipeBuilder . addExpressionSingle ( ) ; parseRangeExpr ( ) ; mPipeBuilder . addCompExpression ( getTransaction ( ) , mComp ) ; }
public class ChannelServerImpl { /** * Called when the link is closing . */ @ Override public void shutdown ( ShutdownModeAmp mode ) { } }
// jamp / 3210 // getReadMailbox ( ) . close ( ) ; for ( int i = _serviceCloseList . size ( ) - 1 ; i >= 0 ; i -- ) { ServiceRefAmp service = _serviceCloseList . get ( i ) ; service . shutdown ( mode ) ; } for ( GatewayResultStream result : _gatewayResultMap . values ( ) ) { result . cancel ( ) ; } _serviceRefOut . close ( Result . ignore ( ) ) ;
public class EntityStatisticsProcessor { /** * Count the statements and property uses of an item or property document . * @ param usageStatistics * statistics object to store counters in * @ param statementDocument * document to count the statements of */ protected void countStatements ( UsageStatistics usageStatistics , StatementDocument statementDocument ) { } }
// Count Statement data : for ( StatementGroup sg : statementDocument . getStatementGroups ( ) ) { // Count Statements : usageStatistics . countStatements += sg . size ( ) ; // Count uses of properties in Statements : countPropertyMain ( usageStatistics , sg . getProperty ( ) , sg . size ( ) ) ; for ( Statement s : sg ) { for ( SnakGroup q : s . getQualifiers ( ) ) { countPropertyQualifier ( usageStatistics , q . getProperty ( ) , q . size ( ) ) ; } for ( Reference r : s . getReferences ( ) ) { usageStatistics . countReferencedStatements ++ ; for ( SnakGroup snakGroup : r . getSnakGroups ( ) ) { countPropertyReference ( usageStatistics , snakGroup . getProperty ( ) , snakGroup . size ( ) ) ; } } } }
public class XMLConfigAdmin { /** * update a security manager that match the given id * @ param id * @ param setting * @ param file * @ param fileAccess * @ param directJavaAccess * @ param mail * @ param datasource * @ param mapping * @ param customTag * @ param cfxSetting * @ param cfxUsage * @ param debugging * @ param search * @ param scheduledTasks * @ param tagExecute * @ param tagImport * @ param tagObject * @ param tagRegistry * @ throws SecurityException * @ throws ApplicationException */ public void updateSecurity ( String id , short setting , short file , Resource [ ] fileAccess , short directJavaAccess , short mail , short datasource , short mapping , short remote , short customTag , short cfxSetting , short cfxUsage , short debugging , short search , short scheduledTasks , short tagExecute , short tagImport , short tagObject , short tagRegistry , short cache , short gateway , short orm , short accessRead , short accessWrite ) throws SecurityException , ApplicationException { } }
checkWriteAccess ( ) ; if ( ! ( config instanceof ConfigServer ) ) throw new SecurityException ( "can't change security settings from this context" ) ; Element security = _getRootElement ( "security" ) ; Element [ ] children = XMLConfigWebFactory . getChildren ( security , "accessor" ) ; Element accessor = null ; for ( int i = 0 ; i < children . length ; i ++ ) { if ( id . equals ( children [ i ] . getAttribute ( "id" ) ) ) { accessor = children [ i ] ; } } if ( accessor == null ) throw new ApplicationException ( "there is noc Security Manager for id [" + id + "]" ) ; updateSecurityFileAccess ( accessor , fileAccess , file ) ; accessor . setAttribute ( "setting" , SecurityManagerImpl . toStringAccessValue ( setting ) ) ; accessor . setAttribute ( "file" , SecurityManagerImpl . toStringAccessValue ( file ) ) ; accessor . setAttribute ( "direct_java_access" , SecurityManagerImpl . toStringAccessValue ( directJavaAccess ) ) ; accessor . setAttribute ( "mail" , SecurityManagerImpl . toStringAccessValue ( mail ) ) ; accessor . setAttribute ( "datasource" , SecurityManagerImpl . toStringAccessValue ( datasource ) ) ; accessor . setAttribute ( "mapping" , SecurityManagerImpl . toStringAccessValue ( mapping ) ) ; accessor . setAttribute ( "remote" , SecurityManagerImpl . toStringAccessValue ( remote ) ) ; accessor . setAttribute ( "custom_tag" , SecurityManagerImpl . toStringAccessValue ( customTag ) ) ; accessor . setAttribute ( "cfx_setting" , SecurityManagerImpl . toStringAccessValue ( cfxSetting ) ) ; accessor . setAttribute ( "cfx_usage" , SecurityManagerImpl . toStringAccessValue ( cfxUsage ) ) ; accessor . setAttribute ( "debugging" , SecurityManagerImpl . toStringAccessValue ( debugging ) ) ; accessor . setAttribute ( "search" , SecurityManagerImpl . toStringAccessValue ( search ) ) ; accessor . setAttribute ( "scheduled_task" , SecurityManagerImpl . toStringAccessValue ( scheduledTasks ) ) ; accessor . setAttribute ( "cache" , SecurityManagerImpl . toStringAccessValue ( cache ) ) ; accessor . setAttribute ( "gateway" , SecurityManagerImpl . toStringAccessValue ( gateway ) ) ; accessor . setAttribute ( "orm" , SecurityManagerImpl . toStringAccessValue ( orm ) ) ; accessor . setAttribute ( "tag_execute" , SecurityManagerImpl . toStringAccessValue ( tagExecute ) ) ; accessor . setAttribute ( "tag_import" , SecurityManagerImpl . toStringAccessValue ( tagImport ) ) ; accessor . setAttribute ( "tag_object" , SecurityManagerImpl . toStringAccessValue ( tagObject ) ) ; accessor . setAttribute ( "tag_registry" , SecurityManagerImpl . toStringAccessValue ( tagRegistry ) ) ; accessor . setAttribute ( "access_read" , SecurityManagerImpl . toStringAccessRWValue ( accessRead ) ) ; accessor . setAttribute ( "access_write" , SecurityManagerImpl . toStringAccessRWValue ( accessWrite ) ) ;
public class RetrieveTokenApi { /** * Build form parameters * @ param scope The scope of the access request . The Authentication API supports only the & # x60 ; * & # x60 ; value . ( optional ) * @ return a map of form parameters */ public static Map < String , Object > createFormParamClientCredentialsGrantType ( String scope ) { } }
Map < String , Object > formParams = new HashMap < > ( ) ; formParams . put ( "grant_type" , "client_credentials" ) ; if ( scope != null ) { formParams . put ( "scope" , scope ) ; } return formParams ;
public class LoggingHelper { /** * Enable logging using String . format internally only if debug level is * enabled . * @ param logger * the logger that will be used to log the message * @ param format * the format string ( the template string ) * @ param throwable * a throwable object that holds the throable information * @ param params * the parameters to be formatted into it the string format */ public static void debug ( final Logger logger , final String format , final Throwable throwable , final AbstractLoggingHelperConverter converter , final Object ... params ) { } }
if ( logger . isDebugEnabled ( ) ) { Object [ ] formatParams = params ; if ( converter != null ) { formatParams = converter . convert ( params ) ; } final String message = String . format ( format , formatParams ) ; logger . debug ( message , throwable ) ; }
public class MPP8Reader { /** * This method extracts and collates resource assignment data . * @ throws IOException */ private void processAssignmentData ( ) throws IOException { } }
DirectoryEntry assnDir = ( DirectoryEntry ) m_projectDir . getEntry ( "TBkndAssn" ) ; FixFix assnFixedData = new FixFix ( 204 , new DocumentInputStream ( ( ( DocumentEntry ) assnDir . getEntry ( "FixFix 0" ) ) ) ) ; if ( assnFixedData . getDiff ( ) != 0 || ( assnFixedData . getSize ( ) % 238 == 0 && testAssignmentTasks ( assnFixedData ) == false ) ) { assnFixedData = new FixFix ( 238 , new DocumentInputStream ( ( ( DocumentEntry ) assnDir . getEntry ( "FixFix 0" ) ) ) ) ; } int count = assnFixedData . getItemCount ( ) ; FixDeferFix assnVarData = null ; for ( int loop = 0 ; loop < count ; loop ++ ) { if ( assnVarData == null ) { assnVarData = new FixDeferFix ( new DocumentInputStream ( ( ( DocumentEntry ) assnDir . getEntry ( "FixDeferFix 0" ) ) ) ) ; } byte [ ] data = assnFixedData . getByteArrayValue ( loop ) ; // Check that the deleted flag isn ' t set if ( MPPUtility . getByte ( data , 168 ) != 0x02 ) { Task task = m_file . getTaskByUniqueID ( Integer . valueOf ( MPPUtility . getInt ( data , 16 ) ) ) ; Resource resource = m_file . getResourceByUniqueID ( Integer . valueOf ( MPPUtility . getInt ( data , 20 ) ) ) ; if ( task != null && resource != null ) { ResourceAssignment assignment = task . addResourceAssignment ( resource ) ; assignment . setActualCost ( NumberHelper . getDouble ( ( ( double ) MPPUtility . getLong6 ( data , 138 ) ) / 100 ) ) ; assignment . setActualWork ( MPPUtility . getDuration ( ( ( double ) MPPUtility . getLong6 ( data , 96 ) ) / 100 , TimeUnit . HOURS ) ) ; assignment . setCost ( NumberHelper . getDouble ( ( ( double ) MPPUtility . getLong6 ( data , 132 ) ) / 100 ) ) ; // assignment . setDelay ( ) ; / / Not sure what this field maps on to in MSP assignment . setFinish ( MPPUtility . getTimestamp ( data , 28 ) ) ; assignment . setOvertimeWork ( MPPUtility . getDuration ( ( ( double ) MPPUtility . getLong6 ( data , 90 ) ) / 100 , TimeUnit . HOURS ) ) ; // assignment . setPlannedCost ( ) ; / / Not sure what this field maps on to in MSP // assignment . setPlannedWork ( ) ; / / Not sure what this field maps on to in MSP assignment . setRemainingWork ( MPPUtility . getDuration ( ( ( double ) MPPUtility . getLong6 ( data , 114 ) ) / 100 , TimeUnit . HOURS ) ) ; assignment . setStart ( MPPUtility . getTimestamp ( data , 24 ) ) ; assignment . setUniqueID ( Integer . valueOf ( MPPUtility . getInt ( data , 0 ) ) ) ; assignment . setUnits ( Double . valueOf ( ( ( double ) MPPUtility . getShort ( data , 80 ) ) / 100 ) ) ; assignment . setWork ( MPPUtility . getDuration ( ( ( double ) MPPUtility . getLong6 ( data , 84 ) ) / 100 , TimeUnit . HOURS ) ) ; m_eventManager . fireAssignmentReadEvent ( assignment ) ; } } }
public class Person { /** * Returns for given parameter < i > _ uuid < / i > the instance of class * { @ link Person } . * @ param _ uuid UUID to search in the cache * @ throws EFapsException on error * @ return instance of class { @ link Person } * @ see # getFromDB */ public static Person get ( final UUID _uuid ) throws EFapsException { } }
final Cache < UUID , Person > cache = InfinispanCache . get ( ) . < UUID , Person > getCache ( Person . UUIDCACHE ) ; if ( ! cache . containsKey ( _uuid ) ) { Person . getPersonFromDB ( Person . SQL_UUID , _uuid . toString ( ) ) ; } return cache . get ( _uuid ) ;
public class MessageResponseParser { /** * Create a { @ code MessageResponse } object from a serialized JSON representation . */ @ Override public MessageResponse deserialize ( JsonElement element , Type alsoIgnored , JsonDeserializationContext ignored ) { } }
List < String > results = new ArrayList < String > ( ) ; String reason = "" ; String details = "" ; JsonObject body = element . getAsJsonObject ( ) ; boolean succeeded = body . get ( "outcome" ) . getAsString ( ) . equals ( "SUCCESS" ) ; if ( succeeded ) { if ( body . get ( "results" ) != null ) { for ( JsonElement result : body . get ( "results" ) . getAsJsonArray ( ) ) { if ( result . isJsonNull ( ) ) results . add ( null ) ; else if ( result . isJsonObject ( ) ) results . add ( result . toString ( ) ) ; else results . add ( result . getAsString ( ) ) ; } } } else { reason = body . get ( "reason" ) . getAsString ( ) ; details = body . get ( "details" ) . getAsString ( ) ; } return new MessageResponse ( succeeded , results , reason , details ) ;
public class AbstractIoConnector { /** * { @ inheritDoc } */ @ Override public ConnectFuture connect ( IoSessionInitializer < ? extends ConnectFuture > sessionInitializer ) { } }
SocketAddress defaultRemoteAddress = getDefaultRemoteAddress ( ) ; if ( defaultRemoteAddress == null ) { throw new IllegalStateException ( "defaultRemoteAddress is not set." ) ; } return connect ( defaultRemoteAddress , null , sessionInitializer ) ;
public class TagletManager { /** * Utility method for converting a search path string to an array * of directory and JAR file URLs . * @ param path the search path string * @ return the resulting array of directory and JAR file URLs */ private URL [ ] pathToURLs ( String path ) { } }
Set < URL > urls = new LinkedHashSet < URL > ( ) ; for ( String s : path . split ( File . pathSeparator ) ) { if ( s . isEmpty ( ) ) continue ; try { urls . add ( new File ( s ) . getAbsoluteFile ( ) . toURI ( ) . toURL ( ) ) ; } catch ( MalformedURLException e ) { message . error ( "doclet.MalformedURL" , s ) ; } } return urls . toArray ( new URL [ urls . size ( ) ] ) ;
public class BasicSebConfiguration { /** * Basic log level . Override this for different value . * @ return The log level . */ protected Level getDefaultLogLevel ( ) { } }
String levelStr = getProperty ( LOG_LEVEL ) ; Level level = null ; if ( levelStr != null ) { level = Level . parse ( levelStr ) ; } if ( level == null ) level = Level . INFO ; return level ;
public class Sql2o { /** * Begins a transaction with the given isolation level . Every statement executed on the return { @ link Connection } * instance , will be executed in the transaction . It is very important to always call either the { @ link org . sql2o . Connection # commit ( ) } * method or the { @ link org . sql2o . Connection # rollback ( ) } method to close the transaction . Use proper try - catch logic . * @ param connectionSource the { @ link ConnectionSource } implementation substitution , * that will be used instead of one from { @ link Sql2o } instance . * @ param isolationLevel the isolation level of the transaction * @ return the { @ link Connection } instance to use to run statements in the transaction . */ public Connection beginTransaction ( ConnectionSource connectionSource , int isolationLevel ) { } }
Connection connection = new Connection ( this , connectionSource , false ) ; boolean success = false ; try { connection . getJdbcConnection ( ) . setAutoCommit ( false ) ; connection . getJdbcConnection ( ) . setTransactionIsolation ( isolationLevel ) ; success = true ; } catch ( SQLException e ) { throw new Sql2oException ( "Could not start the transaction - " + e . getMessage ( ) , e ) ; } finally { if ( ! success ) { connection . close ( ) ; } } return connection ;
public class ObrClassFinderService { /** * Deploy this resource . * @ param resource * @ param options */ public void deployResource ( Resource resource , int options ) { } }
String name = resource . getSymbolicName ( ) + "/" + resource . getVersion ( ) ; Lock lock = this . getLock ( name ) ; try { boolean acquired = lock . tryLock ( ) ; if ( acquired ) { // Good , deploy this resource try { Resolver resolver = repositoryAdmin . resolver ( ) ; resolver . add ( resource ) ; int resolveAttempt = 5 ; while ( resolveAttempt -- > 0 ) { try { if ( resolver . resolve ( options ) ) { resolver . deploy ( options ) ; break ; // Resolve successful , exception thrown on previous instruction if not } else { Reason [ ] reqs = resolver . getUnsatisfiedRequirements ( ) ; for ( int i = 0 ; i < reqs . length ; i ++ ) { ClassServiceUtility . log ( bundleContext , LogService . LOG_ERROR , "Unable to resolve: " + reqs [ i ] ) ; } break ; // Resolve unsuccessful , but it did finish } } catch ( IllegalStateException e ) { // If resolve unsuccessful , try again if ( resolveAttempt == 0 ) e . printStackTrace ( ) ; } } } finally { lock . unlock ( ) ; } } else { // Lock was not acquired , wait until it is unlocked and return ( resource should be deployed by then ) acquired = lock . tryLock ( secondsToWait , TimeUnit . SECONDS ) ; if ( acquired ) { try { // Success } finally { lock . unlock ( ) ; } } else { // failure code here } } } catch ( InterruptedException e ) { e . printStackTrace ( ) ; } finally { this . removeLock ( name ) ; }
public class StreamSegmentContainer { /** * region AbstractService Implementation */ @ Override protected void doStart ( ) { } }
log . info ( "{}: Starting." , this . traceObjectId ) ; Services . startAsync ( this . durableLog , this . executor ) . thenComposeAsync ( v -> startWhenDurableLogOnline ( ) , this . executor ) . whenComplete ( ( v , ex ) -> { if ( ex == null ) { // We are started and ready to accept requests when DurableLog starts . All other ( secondary ) services // are not required for accepting new operations and can still start in the background . notifyStarted ( ) ; } else { doStop ( ex ) ; } } ) ;
public class ApiOvhDedicatedserver { /** * IPMI access method * REST : GET / dedicated / server / { serviceName } / features / ipmi / access * @ param type [ required ] IPMI console access * @ param serviceName [ required ] The internal name of your dedicated server */ public OvhIpmiAccessValue serviceName_features_ipmi_access_GET ( String serviceName , OvhIpmiAccessTypeEnum type ) throws IOException { } }
String qPath = "/dedicated/server/{serviceName}/features/ipmi/access" ; StringBuilder sb = path ( qPath , serviceName ) ; query ( sb , "type" , type ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , OvhIpmiAccessValue . class ) ;
public class AbstractQueuedSynchronizer { /** * Version of getFirstQueuedThread called when fastpath fails . */ private Thread fullGetFirstQueuedThread ( ) { } }
/* * The first node is normally head . next . Try to get its * thread field , ensuring consistent reads : If thread * field is nulled out or s . prev is no longer head , then * some other thread ( s ) concurrently performed setHead in * between some of our reads . We try this twice before * resorting to traversal . */ Node h , s ; Thread st ; if ( ( ( h = head ) != null && ( s = h . next ) != null && s . prev == head && ( st = s . thread ) != null ) || ( ( h = head ) != null && ( s = h . next ) != null && s . prev == head && ( st = s . thread ) != null ) ) return st ; /* * Head ' s next field might not have been set yet , or may have * been unset after setHead . So we must check to see if tail * is actually first node . If not , we continue on , safely * traversing from tail back to head to find first , * guaranteeing termination . */ Thread firstThread = null ; for ( Node p = tail ; p != null && p != head ; p = p . prev ) { Thread t = p . thread ; if ( t != null ) firstThread = t ; } return firstThread ;
public class BeanMetaData { /** * LI3408 */ public static long convertDDAbsoluteReloadToMillis ( int ddInterval , int reloadType ) { } }
long millis = 0 ; if ( ddInterval >= 0 ) { switch ( reloadType ) { case CACHE_RELOAD_WEEKLY : if ( ddInterval >= 10000 ) { millis = millis + ( ( ddInterval / 10000 ) - 1 ) * 24 * 60 * 60 * 1000 ; ddInterval = ddInterval % 10000 ; } case CACHE_RELOAD_DAILY : if ( ddInterval <= 2359 ) { millis = millis + ( ( ( ddInterval / 100 ) * 60 ) + ( ddInterval % 100 ) ) * 60 * 1000 ; } break ; default : throw new IllegalArgumentException ( ) ; } } return millis ;
public class ServicePropertiesUtils { /** * Utility method to extract the httpContextID from the service reference . * This can either be included with the " old " Pax - Web style or the new OSGi R6 Whiteboard style . * @ param serviceReference - service reference where the httpContextID needs to be extracted from . * @ return the http context id */ public static String extractHttpContextId ( final ServiceReference < ? > serviceReference ) { } }
String httpContextId = getStringProperty ( serviceReference , ExtenderConstants . PROPERTY_HTTP_CONTEXT_ID ) ; // TODO : Make sure the current HttpContextSelect works together with R6 if ( httpContextId == null ) { String httpContextSelector = getStringProperty ( serviceReference , HttpWhiteboardConstants . HTTP_WHITEBOARD_CONTEXT_SELECT ) ; if ( httpContextSelector != null ) { httpContextSelector = httpContextSelector . substring ( 1 , httpContextSelector . length ( ) ) ; httpContextId = httpContextSelector . substring ( HttpWhiteboardConstants . HTTP_WHITEBOARD_CONTEXT_NAME . length ( ) + 1 ) ; httpContextId = httpContextId . substring ( 0 , httpContextId . length ( ) - 1 ) ; } } return httpContextId ;
public class Utils { /** * Calculates the maximum text height which is possible based on the used Paint and its settings . * @ param _ Paint Paint object which will be used to display a text . * @ param _ Text The text which should be measured . If null , a default text is chosen , which * has a maximum possible height * @ return Maximum text height in px . */ public static float calculateMaxTextHeight ( Paint _Paint , String _Text ) { } }
Rect height = new Rect ( ) ; String text = _Text == null ? "MgHITasger" : _Text ; _Paint . getTextBounds ( text , 0 , text . length ( ) , height ) ; return height . height ( ) ;
public class CpuEventViewer { /** * Threads */ public void drawThreadSwapOut ( GenericTabItem tab , TraceCPU cpu , TraceThread currentThread , TraceThread swappedThread ) { } }
TraceObject obj = swappedThread . getCurrentObject ( ) ; updateObject ( tab , obj ) ; Long x1 = obj . getX ( ) ; Long x2 = x1 ; Long y1 = tab . getYMax ( ) ; Long y2 = y1 + ELEMENT_SIZE ; drawMarker ( tab , x1 , y1 , x2 , y2 , ColorConstants . gray ) ; drawSwapImage ( tab , x1 , y1 , SWAP_DIRECTION . EAST ) ; obj . setY ( y2 ) ;
public class LabelParameterVersionRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( LabelParameterVersionRequest labelParameterVersionRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( labelParameterVersionRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( labelParameterVersionRequest . getName ( ) , NAME_BINDING ) ; protocolMarshaller . marshall ( labelParameterVersionRequest . getParameterVersion ( ) , PARAMETERVERSION_BINDING ) ; protocolMarshaller . marshall ( labelParameterVersionRequest . getLabels ( ) , LABELS_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class ReplaceMessages { /** * Constructs a node representing a message ' s value , or , if possible , just * modifies { @ code origValueNode } so that it accurately represents the * message ' s value . * @ param message a message * @ param origValueNode the message ' s original value node * @ return a Node that can replace { @ code origValueNode } * @ throws MalformedException if the passed node ' s subtree structure is * not as expected */ private Node getNewValueNode ( JsMessage message , Node origValueNode ) throws MalformedException { } }
switch ( origValueNode . getToken ( ) ) { case FUNCTION : // The message is a function . Modify the function node . updateFunctionNode ( message , origValueNode ) ; return origValueNode ; case STRING : // The message is a simple string . Modify the string node . String newString = message . toString ( ) ; if ( ! origValueNode . getString ( ) . equals ( newString ) ) { origValueNode . setString ( newString ) ; compiler . reportChangeToEnclosingScope ( origValueNode ) ; } return origValueNode ; case ADD : // The message is a simple string . Create a string node . return IR . string ( message . toString ( ) ) ; case CALL : // The message is a function call . Replace it with a string expression . return replaceCallNode ( message , origValueNode ) ; default : throw new MalformedException ( "Expected FUNCTION, STRING, or ADD node; found: " + origValueNode . getToken ( ) , origValueNode ) ; }
public class LollipopDrawablesCompat { /** * Applies the specified theme to this Drawable and its children . */ public static void applyTheme ( Drawable d , Resources . Theme t ) { } }
IMPL . applyTheme ( d , t ) ;
public class AfplibPackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EClass getLNC ( ) { } }
if ( lncEClass == null ) { lncEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( AfplibPackage . eNS_URI ) . getEClassifiers ( ) . get ( 285 ) ; } return lncEClass ;
public class CmsGroupTable { /** * Sets all groups . < p > * @ param directs the direct groups * @ throws CmsException if something goes wrong */ private void setAllGroups ( List < CmsGroup > directs ) throws CmsException { } }
m_fullLoaded = true ; m_groups = m_app . readGroupsForOu ( m_cms , m_ou , m_type , true ) ; m_indirects . clear ( ) ; for ( CmsGroup group : m_groups ) { if ( ! directs . contains ( group ) ) { m_indirects . add ( group ) ; } }
public class SidecarStatusMapper { /** * Replaces status strings in search query with their number representations , * e . g . < code > status : running < / code > will be transformed into < code > status : 0 < / code > . * @ param query Search query that may contain one or more status strings * @ return Search query with all status strings replaced with status codes */ public String replaceStringStatusSearchQuery ( String query ) { } }
final Matcher matcher = searchQueryStatusRegex . matcher ( query ) ; final StringBuffer stringBuffer = new StringBuffer ( ) ; while ( matcher . find ( ) ) { final String status = matcher . group ( 1 ) ; matcher . appendReplacement ( stringBuffer , "status:" + Sidecar . Status . fromString ( status ) . getStatusCode ( ) ) ; } matcher . appendTail ( stringBuffer ) ; return stringBuffer . toString ( ) ;
public class BaseResourceMessage { /** * Sets an attribute stored in this message . * Attributes are just a spot for user data of any kind to be * added to the message for passing along the subscription processing * pipeline ( typically by interceptors ) . Values will be carried from the beginning to the end . * Note that messages are designed to be passed into queueing systems * and serialized as JSON . As a result , only strings are currently allowed * as values . * @ param theKey The key ( must not be null or blank ) * @ param theValue The value ( must not be null ) */ public void setAttribute ( String theKey , String theValue ) { } }
Validate . notBlank ( theKey ) ; Validate . notNull ( theValue ) ; if ( myAttributes == null ) { myAttributes = new HashMap < > ( ) ; } myAttributes . put ( theKey , theValue ) ;
public class TokenStream { /** * Determine if the current token matches the expected value . * The { @ link # ANY _ VALUE ANY _ VALUE } constant can be used as a wildcard . * @ param expected the expected value of the current token token * @ return true if the current token did match , or false if the current token did not match * @ throws IllegalStateException if this method was called before the stream was { @ link # start ( ) started } */ public boolean matches ( String expected ) throws IllegalStateException { } }
return ! completed && ( expected == ANY_VALUE || currentToken ( ) . matches ( expected ) ) ;
public class HttpServlets { /** * 获取 BigDecimal 参数 。 * @ param request * 请求 * @ param name * 参数名 * @ return 参数内容 */ public static BigDecimal getBigDecimalParameter ( final HttpServletRequest request , final String name ) { } }
String value = request . getParameter ( name ) ; if ( StringUtils . isBlank ( value ) ) { return null ; } return new BigDecimal ( value ) ;
public class MakeAttachmentEvent { /** * Write attachment from event using * { @ link ru . yandex . qatools . allure . utils . AllureResultsUtils # writeAttachmentSafely ( byte [ ] , String , String ) } * Then add attachment to step attachments . * @ param step to change */ @ Override public void process ( Step step ) { } }
Attachment attachment = writeAttachmentSafely ( getAttachment ( ) , getTitle ( ) , getType ( ) ) ; step . getAttachments ( ) . add ( attachment ) ;
public class GitlabAPI { /** * Cherry picks a commit . * @ param projectId The id of the project * @ param sha The sha of the commit * @ param targetBranchName The branch on which the commit must be cherry - picked * @ return the commit of the cherry - pick . * @ throws IOException on gitlab api call error */ public GitlabCommit cherryPick ( Serializable projectId , String sha , String targetBranchName ) throws IOException { } }
String tailUrl = GitlabProject . URL + "/" + sanitizeProjectId ( projectId ) + "/repository/commits/" + sha + "/cherry_pick" ; return retrieve ( ) . with ( "branch" , targetBranchName ) . to ( tailUrl , GitlabCommit . class ) ;
public class ProfilePictureView { /** * Overriding onMeasure to handle the case where WRAP _ CONTENT might be * specified in the layout . Since we don ' t know the dimensions of the profile * photo , we need to handle this case specifically . * The approach is to default to a NORMAL sized amount of space in the case that * a preset size is not specified . This logic is applied to both width and height */ @ Override protected void onMeasure ( int widthMeasureSpec , int heightMeasureSpec ) { } }
ViewGroup . LayoutParams params = getLayoutParams ( ) ; boolean customMeasure = false ; int newHeight = MeasureSpec . getSize ( heightMeasureSpec ) ; int newWidth = MeasureSpec . getSize ( widthMeasureSpec ) ; if ( MeasureSpec . getMode ( heightMeasureSpec ) != MeasureSpec . EXACTLY && params . height == ViewGroup . LayoutParams . WRAP_CONTENT ) { newHeight = getPresetSizeInPixels ( true ) ; // Default to a preset size heightMeasureSpec = MeasureSpec . makeMeasureSpec ( newHeight , MeasureSpec . EXACTLY ) ; customMeasure = true ; } if ( MeasureSpec . getMode ( widthMeasureSpec ) != MeasureSpec . EXACTLY && params . width == ViewGroup . LayoutParams . WRAP_CONTENT ) { newWidth = getPresetSizeInPixels ( true ) ; // Default to a preset size widthMeasureSpec = MeasureSpec . makeMeasureSpec ( newWidth , MeasureSpec . EXACTLY ) ; customMeasure = true ; } if ( customMeasure ) { // Since we are providing custom dimensions , we need to handle the measure // phase from here setMeasuredDimension ( newWidth , newHeight ) ; measureChildren ( widthMeasureSpec , heightMeasureSpec ) ; } else { // Rely on FrameLayout to do the right thing super . onMeasure ( widthMeasureSpec , heightMeasureSpec ) ; }
public class GenJsCodeVisitor { /** * Example : * < pre > * { let $ boo } * Hello { $ name } * { / let } * < / pre > * might generate * < pre > * var boo35 = ' Hello ' + opt _ data . name ; * < / pre > */ @ Override protected void visitLetContentNode ( LetContentNode node ) { } }
String generatedVarName = node . getUniqueVarName ( ) ; Expression generatedVar = id ( generatedVarName ) ; // Generate code to define the local var . jsCodeBuilder . pushOutputVar ( generatedVarName ) ; visitChildren ( node ) ; jsCodeBuilder . popOutputVar ( ) ; if ( node . getContentKind ( ) != null ) { // If the let node had a content kind specified , it was autoescaped in the corresponding // context . Hence the result of evaluating the let block is wrapped in a SanitizedContent // instance of the appropriate kind . // The expression for the constructor of SanitizedContent of the appropriate kind ( e . g . , // " soydata . VERY _ UNSAFE . ordainSanitizedHtml " ) , or null if the node has no ' kind ' attribute . // Introduce a new variable for this value since it has a different type from the output // variable ( SanitizedContent vs String ) and this will enable optimizations in the jscompiler String wrappedVarName = node . getVarName ( ) + "__wrapped" + node . getId ( ) ; jsCodeBuilder . append ( VariableDeclaration . builder ( wrappedVarName ) . setRhs ( sanitizedContentOrdainerFunctionForInternalBlocks ( node . getContentKind ( ) ) . call ( generatedVar ) ) . build ( ) ) ; generatedVar = id ( wrappedVarName ) ; } // Add a mapping for generating future references to this local var . templateTranslationContext . soyToJsVariableMappings ( ) . put ( node . getVarName ( ) , generatedVar ) ;
public class DefaultIOUtil { /** * { @ inheritDoc } */ public void copyDirectoryStructure ( File sourceDirectory , File targetDirectory ) throws MojoExecutionException { } }
makeDirectoryIfNecessary ( targetDirectory ) ; // hopefully available from FileUtils 1.0.5 - SNAPSHOT try { FileUtils . copyDirectoryStructure ( sourceDirectory , targetDirectory ) ; } catch ( IOException e ) { throw new MojoExecutionException ( "Could not copy directory structure from " + sourceDirectory + " to " + targetDirectory , e ) ; }
public class CssSmartSpritesGlobalPreprocessor { /** * Returns the list of all CSS files defined in the bundles . * @ param bundles * the list of bundle * @ return the list of all CSS files defined in the bundles . */ private Set < String > getResourcePaths ( List < JoinableResourceBundle > bundles ) { } }
Set < String > resourcePaths = new HashSet < > ( ) ; for ( JoinableResourceBundle bundle : bundles ) { for ( BundlePath bundlePath : bundle . getItemPathList ( ) ) { resourcePaths . add ( bundlePath . getPath ( ) ) ; } } return resourcePaths ;
public class DefaultTree { /** * The returned value might be null . * The point of this structure is to enforce the use of a TreeNode as argument . */ private TreeNode getParentTreeNode ( TreeNode child ) { } }
TreeNode parentTreeNode = parentIndex . get ( child ) ; if ( parentTreeNode == null ) return null ; // Makes sure the parent node is still present in the tree else if ( contains ( parentTreeNode . getQueryNode ( ) ) ) return parentTreeNode ; else throw new RuntimeException ( "Internal error: points to a parent that is not (anymore) in the tree" ) ;
public class Num { /** * Return new instance of Num with floor value e . g . for 3.5 - > 3.0 * @ return */ public Num floor ( ) { } }
Num floor = new Num ( ) ; BigDecimal c = this . toBigDecimal ( ) ; floor . setValue ( c . setScale ( 0 , BigDecimal . ROUND_FLOOR ) , null , null ) ; return floor ;
public class PresentationManager { /** * Return the list of weak entities of the given entity . * @ param e The strong entity * @ return The list of weak entities */ public List < Entity > weakEntities ( Entity e ) { } }
final List < Entity > res = new ArrayList < Entity > ( ) ; for ( Entity entity : getEntities ( ) . values ( ) ) { if ( entity . getOwner ( ) != null && entity . getOwner ( ) . getEntityId ( ) . compareTo ( e . getId ( ) ) == 0 ) { res . add ( entity ) ; } } if ( res . isEmpty ( ) ) { return null ; } else { return res ; }
public class Deposit { /** * Return the deposit rate implied by the given model ' s curve . * @ param model The given model containing the curve of name < code > discountCurveName < / code > . * @ return The value of the deposit rate implied by the given model ' s curve . */ public RandomVariable getRate ( AnalyticModel model ) { } }
if ( model == null ) { throw new IllegalArgumentException ( "model==null" ) ; } DiscountCurveInterface discountCurve = model . getDiscountCurve ( discountCurveName ) ; if ( discountCurve == null ) { throw new IllegalArgumentException ( "No discount curve with name '" + discountCurveName + "' was found in the model:\n" + model . toString ( ) ) ; } double payoutDate = schedule . getPeriodStart ( 0 ) ; double maturity = schedule . getPayment ( 0 ) ; double periodLength = schedule . getPeriodLength ( 0 ) ; RandomVariable discountFactor = discountCurve . getDiscountFactor ( model , maturity ) ; RandomVariable discountFactorPayout = discountCurve . getDiscountFactor ( model , payoutDate ) ; return discountFactorPayout . div ( discountFactor ) . sub ( 1 ) . div ( periodLength ) ;
public class QueryImpl { /** * { @ inheritDoc } */ @ Override public Object execute ( Object p1 , Object p2 ) { } }
return executeWithArray ( p1 , p2 ) ;
public class SQLMultiScopeRecoveryLog { /** * closes the connection and resets the isolation level if required */ private void closeConnectionAfterBatch ( Connection conn , int initialIsolation ) throws SQLException { } }
if ( _isDB2 ) { if ( Connection . TRANSACTION_REPEATABLE_READ != initialIsolation && Connection . TRANSACTION_SERIALIZABLE != initialIsolation ) try { conn . setTransactionIsolation ( initialIsolation ) ; } catch ( Exception e ) { if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "setTransactionIsolation threw Exception. Specified transaction isolation level was " + initialIsolation + " " , e ) ; FFDCFilter . processException ( e , "com.ibm.ws.recoverylog.spi.SQLMultiScopeRecoveryLog.closeConnectionAfterBatch" , "3696" , this ) ; if ( ! isolationFailureReported ) { isolationFailureReported = true ; Tr . warning ( tc , "CWRLS0024_EXC_DURING_RECOVERY" , e ) ; } } } conn . close ( ) ;
public class SystemIDResolver { /** * Return true if the local path is an absolute path . * @ param systemId The path string * @ return true if the path is absolute */ public static boolean isAbsolutePath ( String systemId ) { } }
if ( systemId == null ) return false ; final File file = new File ( systemId ) ; return file . isAbsolute ( ) ;
public class ScopedServletUtils { /** * Get the cached wrapper servlet response . If none exists , creates one and caches it . * @ param realResponse the " real " ( outer ) ServletResponse , which will be wrapped . * @ param scopedRequest the ScopedRequest returned from { @ link # getScopedRequest } . * @ return the cached ( or newly - created ) ScopedResponse . */ public static ScopedResponse getScopedResponse ( HttpServletResponse realResponse , ScopedRequest scopedRequest ) { } }
assert ! ( realResponse instanceof ScopedResponse ) ; String responseAttr = getScopedName ( OVERRIDE_RESPONSE_ATTR , scopedRequest . getScopeKey ( ) ) ; HttpServletRequest outerRequest = scopedRequest . getOuterRequest ( ) ; ScopedResponse scopedResponse = ( ScopedResponse ) outerRequest . getAttribute ( responseAttr ) ; // If it doesn ' t exist , create it and cache it . if ( scopedResponse == null ) { scopedResponse = new ScopedResponseImpl ( realResponse ) ; outerRequest . setAttribute ( responseAttr , scopedResponse ) ; } return scopedResponse ;
public class PreferencesFxModel { /** * Sets up a binding of the TranslationService on the model , so that the Category ' s title gets * translated properly according to the TranslationService used . */ private void initializeCategoryTranslation ( ) { } }
flatCategoriesLst . forEach ( category -> { translationServiceProperty ( ) . addListener ( ( observable , oldValue , newValue ) -> { category . translate ( newValue ) ; // listen for i18n changes in the TranslationService for this Category newValue . addListener ( ( ) -> category . translate ( newValue ) ) ; } ) ; } ) ;
public class ComponentMaximiserMouseListener { /** * Confirms , by asking the user , if the maximisation should be done . * After positive confirmation this method returns always { @ code true } . * @ return { @ code true } if the maximisation should be done , { @ code false } otherwise . * @ see # triggerMaximisation ( Component ) * @ see OptionsParamView # getWarnOnTabDoubleClick ( ) */ private boolean confirmMaximisation ( ) { } }
if ( ! viewOptions . getWarnOnTabDoubleClick ( ) ) { return true ; } if ( View . getSingleton ( ) . showConfirmDialog ( DOUBLE_CLICK_WARN_MESSAGE ) != JOptionPane . OK_OPTION ) { return false ; } viewOptions . setWarnOnTabDoubleClick ( false ) ; try { viewOptions . getConfig ( ) . save ( ) ; } catch ( ConfigurationException e ) { LOGGER . error ( e . getMessage ( ) , e ) ; } return true ;
public class TokenExpression { /** * Returns the value of an activity ' s request parameter as a { @ code Set } , * or { @ code null } if the parameter does not exist . * @ param name a { @ code String } specifying the name of the parameter * @ return a { @ code Set } objects containing the parameter ' s values */ private Set < String > getParameterAsSet ( String name ) { } }
String [ ] values = getParameterValues ( name ) ; if ( values == null ) { return null ; } Set < String > valueSet = new LinkedHashSet < > ( values . length ) ; Collections . addAll ( valueSet , values ) ; return valueSet ;
public class SuggestedAdUnit { /** * Gets the targetWindow value for this SuggestedAdUnit . * @ return targetWindow * The { @ code target } attribute of the underlying ad tag , as defined * in the { @ link AdUnit } . This * attribute is read - only and is populated by Google . */ public com . google . api . ads . admanager . axis . v201808 . AdUnitTargetWindow getTargetWindow ( ) { } }
return targetWindow ;
public class StringParser { /** * Parse the given { @ link Object } as int with the specified radix . * @ param aObject * The object to parse . May be < code > null < / code > . * @ param nRadix * The radix to use . Must be & ge ; { @ link Character # MIN _ RADIX } and & le ; * { @ link Character # MAX _ RADIX } . * @ param nDefault * The default value to be returned if the passed object could not be * converted to a valid value . * @ return The default value if the string does not represent a valid value . */ public static int parseInt ( @ Nullable final Object aObject , @ Nonnegative final int nRadix , final int nDefault ) { } }
if ( aObject == null ) return nDefault ; if ( aObject instanceof Number ) return ( ( Number ) aObject ) . intValue ( ) ; return parseInt ( aObject . toString ( ) , nRadix , nDefault ) ;
public class JavaTokenizer { /** * Read longest possible sequence of special characters and convert * to token . */ private void scanOperator ( ) { } }
while ( true ) { reader . putChar ( false ) ; Name newname = reader . name ( ) ; TokenKind tk1 = tokens . lookupKind ( newname ) ; if ( tk1 == TokenKind . IDENTIFIER ) { reader . sp -- ; break ; } tk = tk1 ; reader . scanChar ( ) ; if ( ! isSpecial ( reader . ch ) ) break ; }
public class BounceProxyControllerUrl { /** * Returns the URL including query parameters to report bounce proxy * startup . * @ param controlledBounceProxyUrl * the URL of the bounce proxy * @ return the url including encoded query parameters * @ throws UnsupportedEncodingException * if urls passed as query parameters could not be encoded * correctly . */ public String buildReportStartupUrl ( ControlledBounceProxyUrl controlledBounceProxyUrl ) throws UnsupportedEncodingException { } }
String url4cc = URLEncoder . encode ( controlledBounceProxyUrl . getOwnUrlForClusterControllers ( ) , "UTF-8" ) ; String url4bpc = URLEncoder . encode ( controlledBounceProxyUrl . getOwnUrlForBounceProxyController ( ) , "UTF-8" ) ; return baseUrl + "?bpid=" + this . bounceProxyId + "&url4cc=" + url4cc + "&url4bpc=" + url4bpc ;
public class KAFDocument { /** * Deprecated */ public Term createTerm ( String id , String type , String lemma , String pos , List < WF > wfs ) { } }
return this . newTerm ( id , type , lemma , pos , this . < WF > list2Span ( wfs ) ) ;
public class Box { /** * Obtains the containing block absolute bounds . * @ return the containing block absolute bounds . */ public Rectangle getAbsoluteContainingBlock ( ) { } }
if ( cbox instanceof Viewport ) // initial containing block { Rectangle ab = cbox . getAbsoluteBounds ( ) ; // normally positioned at 0,0 ; other value for nested viewports ( e . g . objects ) Rectangle visible = ( ( Viewport ) cbox ) . getVisibleRect ( ) ; return new Rectangle ( ab . x , ab . y , visible . width , visible . height ) ; } else // static or relative position return cbox . getAbsoluteContentBounds ( ) ;
public class IndexProvider { /** * Get the managed index with the given name and applicable for the given workspace . * @ param indexName the name of the index in this provider ; never null * @ param workspaceName the name of the workspace ; never null * @ return the managed index , or null if there is no such index */ public final ManagedIndex getManagedIndex ( String indexName , String workspaceName ) { } }
logger ( ) . trace ( "Looking for managed index '{0}' in '{1}' provider in workspace '{2}'" , indexName , getName ( ) , workspaceName ) ; Map < String , AtomicIndex > byWorkspaceNames = providedIndexesByWorkspaceNameByIndexName . get ( indexName ) ; if ( byWorkspaceNames == null ) { return null ; } AtomicIndex atomicIndex = byWorkspaceNames . get ( workspaceName ) ; return atomicIndex == null ? null : atomicIndex . managed ( ) ;
public class CmsResourceTypeXmlContent { /** * Gets the locale which should be used for creating an empty content . < p > * @ param cms the current CMS context * @ param securityManager the security manager * @ param resourcename the name of the resource to create * @ param properties the properties for the resource to create * @ return the locale to use */ protected Locale getLocaleForNewContent ( CmsObject cms , CmsSecurityManager securityManager , String resourcename , List < CmsProperty > properties ) { } }
Locale locale = ( Locale ) ( cms . getRequestContext ( ) . getAttribute ( CmsRequestContext . ATTRIBUTE_NEW_RESOURCE_LOCALE ) ) ; if ( locale != null ) { return locale ; } List < Locale > locales = OpenCms . getLocaleManager ( ) . getDefaultLocales ( cms , CmsResource . getParentFolder ( resourcename ) ) ; return locales . get ( 0 ) ;