signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class TaskSlotTable { /** * Check whether the timeout with ticket is valid for the given allocation id . * @ param allocationId to check against * @ param ticket of the timeout * @ return True if the timeout is valid ; otherwise false */ public boolean isValidTimeout ( AllocationID allocationId , UUID ticket ) { } }
checkInit ( ) ; return timerService . isValid ( allocationId , ticket ) ;
public class CmsSqlConsoleResultsForm { /** * Builds the table for the database results . * @ param results the database results * @ return the table */ private Table buildTable ( CmsSqlConsoleResults results ) { } }
IndexedContainer container = new IndexedContainer ( ) ; int numCols = results . getColumns ( ) . size ( ) ; for ( int c = 0 ; c < numCols ; c ++ ) { container . addContainerProperty ( Integer . valueOf ( c ) , results . getColumnType ( c ) , null ) ; } int r = 0 ; for ( List < Object > row : results . getData ( ) ) { Item item = container . addItem ( Integer . valueOf ( r ) ) ; for ( int c = 0 ; c < numCols ; c ++ ) { item . getItemProperty ( Integer . valueOf ( c ) ) . setValue ( row . get ( c ) ) ; } r += 1 ; } Table table = new Table ( ) ; table . setContainerDataSource ( container ) ; for ( int c = 0 ; c < numCols ; c ++ ) { String col = ( results . getColumns ( ) . get ( c ) ) ; table . setColumnHeader ( Integer . valueOf ( c ) , col ) ; } table . setWidth ( "100%" ) ; table . setHeight ( "100%" ) ; table . setColumnCollapsingAllowed ( true ) ; return table ;
public class Inferences { /** * The escaping modes for the print command with the given ID in the order in which they should be * applied . * @ param node a node instance */ public ImmutableList < EscapingMode > getEscapingModesForNode ( SoyNode node ) { } }
ImmutableList < EscapingMode > modes = nodeToEscapingModes . get ( node ) ; if ( modes == null ) { modes = ImmutableList . of ( ) ; } return modes ;
public class JMString { /** * Joining with delimiter string . * @ param delimiter the delimiter * @ param stringList the string list * @ return the string */ public static String joiningWithDelimiter ( CharSequence delimiter , List < String > stringList ) { } }
return joiningWith ( stringList . stream ( ) , delimiter ) ;
public class MRCompactor { /** * Submit an event when completeness verification is successful */ private void submitVerificationSuccessSlaEvent ( Results . Result result ) { } }
try { CompactionSlaEventHelper . getEventSubmitterBuilder ( result . dataset ( ) , Optional . < Job > absent ( ) , this . fs ) . eventSubmitter ( this . eventSubmitter ) . eventName ( CompactionSlaEventHelper . COMPLETION_VERIFICATION_SUCCESS_EVENT_NAME ) . additionalMetadata ( Maps . transformValues ( result . verificationContext ( ) , Functions . toStringFunction ( ) ) ) . build ( ) . submit ( ) ; } catch ( Throwable t ) { LOG . warn ( "Failed to submit verification success event:" + t , t ) ; }
public class ClassHierarchyManager { /** * Utility method to sort declared beans . Linearizes the hierarchy , * i . e . generates a sequence of declaration such that , if Sub is subclass of * Sup , then the index of Sub will be > than the index of Sup in the * resulting collection . This ensures that superclasses are processed before * their subclasses */ protected List < AbstractClassTypeDeclarationDescr > sortByHierarchy ( Collection < AbstractClassTypeDeclarationDescr > unsortedDescrs , KnowledgeBuilderImpl kbuilder ) { } }
taxonomy = new HashMap < QualifiedName , Collection < QualifiedName > > ( ) ; Map < QualifiedName , AbstractClassTypeDeclarationDescr > cache = new HashMap < QualifiedName , AbstractClassTypeDeclarationDescr > ( ) ; for ( AbstractClassTypeDeclarationDescr tdescr : unsortedDescrs ) { cache . put ( tdescr . getType ( ) , tdescr ) ; } for ( AbstractClassTypeDeclarationDescr tdescr : unsortedDescrs ) { QualifiedName name = tdescr . getType ( ) ; Collection < QualifiedName > supers = taxonomy . get ( name ) ; if ( supers == null ) { supers = new ArrayList < QualifiedName > ( ) ; taxonomy . put ( name , supers ) ; } else { kbuilder . addBuilderResult ( new TypeDeclarationError ( tdescr , "Found duplicate declaration for type " + tdescr . getType ( ) ) ) ; } boolean circular = false ; for ( QualifiedName sup : tdescr . getSuperTypes ( ) ) { if ( ! Object . class . getName ( ) . equals ( name . getFullName ( ) ) ) { if ( ! hasCircularDependency ( tdescr . getType ( ) , sup , taxonomy ) ) { if ( cache . containsKey ( sup ) ) { supers . add ( sup ) ; } } else { circular = true ; kbuilder . addBuilderResult ( new TypeDeclarationError ( tdescr , "Found circular dependency for type " + tdescr . getTypeName ( ) ) ) ; break ; } } } if ( circular ) { tdescr . getSuperTypes ( ) . clear ( ) ; } } for ( AbstractClassTypeDeclarationDescr tdescr : unsortedDescrs ) { for ( TypeFieldDescr field : tdescr . getFields ( ) . values ( ) ) { QualifiedName name = tdescr . getType ( ) ; QualifiedName typeName = new QualifiedName ( field . getPattern ( ) . getObjectType ( ) ) ; if ( ! hasCircularDependency ( name , typeName , taxonomy ) ) { if ( cache . containsKey ( typeName ) ) { taxonomy . get ( name ) . add ( typeName ) ; } } else { field . setRecursive ( true ) ; } } } List < QualifiedName > sorted = new HierarchySorter < QualifiedName > ( ) . sort ( taxonomy ) ; ArrayList list = new ArrayList ( sorted . size ( ) ) ; for ( QualifiedName name : sorted ) { list . add ( cache . get ( name ) ) ; } return list ;
public class ParameterUtil { /** * Get used parameters map where the key is the parameter name and the value is the parameter * Not all the report parameters have to be used , some may only be defined for further usage . * The result will contain also the hidden parameters and all parameters used just inside other parameters . * @ param query query object * @ param allParameters parameters map * @ return used parameters map */ public static Map < String , QueryParameter > getUsedParametersMap ( Query query , Map < String , QueryParameter > allParameters ) { } }
Set < String > paramNames = new HashSet < String > ( Arrays . asList ( query . getParameterNames ( ) ) ) ; for ( QueryParameter p : allParameters . values ( ) ) { paramNames . addAll ( p . getDependentParameterNames ( ) ) ; } LinkedHashMap < String , QueryParameter > params = new LinkedHashMap < String , QueryParameter > ( ) ; for ( String name : allParameters . keySet ( ) ) { boolean found = false ; for ( String pName : paramNames ) { if ( pName . equals ( name ) ) { found = true ; break ; } } QueryParameter qp = allParameters . get ( name ) ; if ( found || qp . isHidden ( ) ) { params . put ( name , qp ) ; } } return params ;
public class CmsSearchUtil { /** * Slightly modified from org . apache . commons . httpclient . util . DateUtil . parseDate * Parses the date value using the given date formats . * @ param dateValue the date value to parse * @ param dateFormats the date formats to use * @ param startDate During parsing , two digit years will be placed in the range * < code > startDate < / code > to < code > startDate + 100 years < / code > . This value may * be < code > null < / code > . When < code > null < / code > is given as a parameter , year * < code > 2000 < / code > will be used . * @ return the parsed date * @ throws ParseException if none of the dataFormats could parse the dateValue */ public static Date parseDate ( String dateValue , Collection < String > dateFormats , Date startDate ) throws ParseException { } }
if ( dateValue == null ) { throw new IllegalArgumentException ( "dateValue is null" ) ; } if ( dateFormats == null ) { dateFormats = DEFAULT_HTTP_CLIENT_PATTERNS ; } if ( startDate == null ) { startDate = DEFAULT_TWO_DIGIT_YEAR_START ; } // trim single quotes around date if present // see issue # 5279 if ( ( dateValue . length ( ) > 1 ) && dateValue . startsWith ( "'" ) && dateValue . endsWith ( "'" ) ) { dateValue = dateValue . substring ( 1 , dateValue . length ( ) - 1 ) ; } SimpleDateFormat dateParser = null ; Iterator formatIter = dateFormats . iterator ( ) ; while ( formatIter . hasNext ( ) ) { String format = ( String ) formatIter . next ( ) ; if ( dateParser == null ) { dateParser = new SimpleDateFormat ( format , Locale . ENGLISH ) ; dateParser . setTimeZone ( TIMEZONE_GMT ) ; dateParser . set2DigitYearStart ( startDate ) ; } else { dateParser . applyPattern ( format ) ; } try { return dateParser . parse ( dateValue ) ; } catch ( ParseException pe ) { // ignore this exception , we will try the next format } } // we were unable to parse the date throw new ParseException ( "Unable to parse the date " + dateValue , 0 ) ;
public class CliParser { /** * Returns the symbolic link depth ( how deeply symbolic links will be * followed ) . * @ return the symbolic link depth */ public int getSymLinkDepth ( ) { } }
int value = 0 ; try { value = Integer . parseInt ( line . getOptionValue ( ARGUMENT . SYM_LINK_DEPTH , "0" ) ) ; if ( value < 0 ) { value = 0 ; } } catch ( NumberFormatException ex ) { LOGGER . debug ( "Symbolic link was not a number" ) ; } return value ;
public class ParadataManager { /** * Return all stats from other submitters for the resource * @ param resourceUrl * @ return * @ throws Exception */ public List < ISubmission > getExternalStats ( String resourceUrl ) throws Exception { } }
return getExternalSubmissions ( resourceUrl , IStats . VERB ) ;
public class SoftwareSystem { /** * Gets the container with the specified ID . * @ param id the { @ link Container # getId ( ) } of the container * @ return the Container instance with the specified ID , or null if it doesn ' t exist * @ throws IllegalArgumentException if the ID is null or empty */ @ Nullable public Container getContainerWithId ( @ Nonnull String id ) { } }
if ( id == null || id . trim ( ) . length ( ) == 0 ) { throw new IllegalArgumentException ( "A container ID must be provided." ) ; } for ( Container container : getContainers ( ) ) { if ( container . getId ( ) . equals ( id ) ) { return container ; } } return null ;
public class AbstractContextGenerator { /** * Creates punctuation feature for the specified punctuation at the specified * index based on the punctuation mark . * @ param punct * The punctuation which is in context . * @ param i * The index of the punctuation with relative to the parse . * @ return Punctuation feature for the specified parse and the specified * punctuation at the specfied index . */ protected String punct ( final Parse punct , final int i ) { } }
final StringBuilder feat = new StringBuilder ( 5 ) ; feat . append ( i ) . append ( "=" ) ; feat . append ( punct . getCoveredText ( ) ) ; return feat . toString ( ) ;
public class BaseMatchMethodPermutationBuilder { /** * Returns a list of type variables for a given type . * < p > There are several cases for what the returned type variables will be : * < ul > * < li > If { @ code t } is a type variable itself , and has no bounds , then a singleton list * containing only { @ code t } will be returned . < / li > * < li > If { @ code t } is a type variable with bounds , then the returned list will first contain * { @ code t } followed by the type variables for the bounds < / li > * < li > If { @ code t } is a parameterized type , then the returned list will contain the type * variables of the parameterized type arguments < / li > * < li > Otherwise an empty list is returned < / li > * < / ul > */ protected List < TypeVariableName > getTypeVariables ( TypeName t ) { } }
return match ( t ) . when ( typeOf ( TypeVariableName . class ) ) . get ( v -> { if ( v . bounds . isEmpty ( ) ) { return ImmutableList . of ( v ) ; } else { return Stream . concat ( Stream . of ( v ) , v . bounds . stream ( ) . map ( b -> getTypeVariables ( b ) ) . flatMap ( b -> b . stream ( ) ) ) . collect ( Collectors . toList ( ) ) ; } } ) . when ( typeOf ( ParameterizedTypeName . class ) ) . get ( p -> p . typeArguments . stream ( ) . map ( v -> getTypeVariables ( v ) ) . flatMap ( l -> l . stream ( ) ) . collect ( Collectors . toList ( ) ) ) . orElse ( Collections . emptyList ( ) ) . getMatch ( ) ;
public class AWSGlueClient { /** * Gets all the triggers associated with a job . * @ param getTriggersRequest * @ return Result of the GetTriggers operation returned by the service . * @ throws EntityNotFoundException * A specified entity does not exist * @ throws InvalidInputException * The input provided was not valid . * @ throws InternalServiceException * An internal service error occurred . * @ throws OperationTimeoutException * The operation timed out . * @ sample AWSGlue . GetTriggers * @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / glue - 2017-03-31 / GetTriggers " target = " _ top " > AWS API * Documentation < / a > */ @ Override public GetTriggersResult getTriggers ( GetTriggersRequest request ) { } }
request = beforeClientExecution ( request ) ; return executeGetTriggers ( request ) ;
public class StorageAccountsInner { /** * Lists all the storage accounts available under the subscription . Note that storage keys are not returned ; use the ListKeys operation for this . * @ return the PagedList < StorageAccountInner > object if successful . */ public PagedList < StorageAccountInner > list ( ) { } }
PageImpl < StorageAccountInner > page = new PageImpl < > ( ) ; page . setItems ( listWithServiceResponseAsync ( ) . toBlocking ( ) . single ( ) . body ( ) ) ; page . setNextPageLink ( null ) ; return new PagedList < StorageAccountInner > ( page ) { @ Override public Page < StorageAccountInner > nextPage ( String nextPageLink ) { return null ; } } ;
public class Tuple15 { /** * Split this tuple into two tuples of degree 13 and 2. */ public final Tuple2 < Tuple13 < T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 > , Tuple2 < T14 , T15 > > split13 ( ) { } }
return new Tuple2 < > ( limit13 ( ) , skip13 ( ) ) ;
public class MultistepUtil { /** * Adds a step to the given { @ link OperationContext } for each operation included in the given { @ code operations } list , either * using for each step a response node provided in the { @ code responses } list , or if the { @ code responses } list is empty , * creating them and storing them in the { @ code responses } list . The response objects are not tied into the overall response * to the operation associated with { @ code context } . It is the responsibility of the caller to do that . * @ param context the { @ code OperationContext } . Cannot be { @ code null } * @ param operations the list of operations , each element of which must be a proper OBJECT type model node with a structure describing an operation * @ param responses a list of response nodes to use for each operation , each element of which corresponds to the operation in the equivalent position * in the { @ code operations } list . Cannot be { @ code null } but may be empty in which case this method will * create the response nodes and add them to this list . * @ throws OperationFailedException if there is a problem registering a step for any of the operations * @ deprecated Do not use . Will be removed . */ @ Deprecated public static void recordOperationSteps ( final OperationContext context , final List < ModelNode > operations , final List < ModelNode > responses ) throws OperationFailedException { } }
assert responses . isEmpty ( ) || operations . size ( ) == responses . size ( ) ; boolean responsesProvided = ! responses . isEmpty ( ) ; LinkedHashMap < Integer , ModelNode > operationMap = new LinkedHashMap < > ( ) ; Map < Integer , ModelNode > responseMap = new LinkedHashMap < > ( ) ; int i = 0 ; for ( ModelNode op : operations ) { operationMap . put ( i , op ) ; if ( responsesProvided ) { ModelNode response = responses . get ( i ) ; assert response != null : "No response provided for " + i ; responseMap . put ( i , response ) ; } i ++ ; } recordOperationSteps ( context , operationMap , responseMap , OperationHandlerResolver . DEFAULT , false , true ) ; if ( ! responsesProvided ) { responses . addAll ( responseMap . values ( ) ) ; }
public class CeCPMain { /** * TODO dmyersturnbull : This should probably be in structure - gui */ @ SuppressWarnings ( "unused" ) private static void displayAlignment ( AFPChain afpChain , Atom [ ] ca1 , Atom [ ] ca2 ) throws ClassNotFoundException , NoSuchMethodException , InvocationTargetException , IllegalAccessException , StructureException { } }
Atom [ ] ca1clone = StructureTools . cloneAtomArray ( ca1 ) ; Atom [ ] ca2clone = StructureTools . cloneAtomArray ( ca2 ) ; if ( ! GuiWrapper . isGuiModuleInstalled ( ) ) { System . err . println ( "The biojava-structure-gui and/or JmolApplet modules are not installed. Please install!" ) ; // display alignment in console System . out . println ( afpChain . toCE ( ca1clone , ca2clone ) ) ; } else { Object jmol = GuiWrapper . display ( afpChain , ca1clone , ca2clone ) ; GuiWrapper . showAlignmentImage ( afpChain , ca1clone , ca2clone , jmol ) ; }
public class AWSServerMigrationClient { /** * Deletes the specified replication job . * After you delete a replication job , there are no further replication runs . AWS deletes the contents of the Amazon * S3 bucket used to store AWS SMS artifacts . The AMIs created by the replication runs are not deleted . * @ param deleteReplicationJobRequest * @ return Result of the DeleteReplicationJob operation returned by the service . * @ throws InvalidParameterException * A specified parameter is not valid . * @ throws MissingRequiredParameterException * A required parameter is missing . * @ throws UnauthorizedOperationException * You lack permissions needed to perform this operation . Check your IAM policies , and ensure that you are * using the correct access keys . * @ throws OperationNotPermittedException * This operation is not allowed . * @ throws ReplicationJobNotFoundException * The specified replication job does not exist . * @ sample AWSServerMigration . DeleteReplicationJob * @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / sms - 2016-10-24 / DeleteReplicationJob " target = " _ top " > AWS API * Documentation < / a > */ @ Override public DeleteReplicationJobResult deleteReplicationJob ( DeleteReplicationJobRequest request ) { } }
request = beforeClientExecution ( request ) ; return executeDeleteReplicationJob ( request ) ;
public class Reflection { /** * Returns a consumer that sets the value of a selected field . * @ param newValue the value to set * @ return a consumer that sets the value of a selected field . */ public static Consumer < Selection < Field > > setValue ( Object newValue ) { } }
return selection -> factory . createHandler ( selection . result ( ) ) . on ( selection . target ( ) ) . setValue ( newValue ) ;
public class AWSWAFRegionalClient { /** * Inserts or deletes < a > SqlInjectionMatchTuple < / a > objects ( filters ) in a < a > SqlInjectionMatchSet < / a > . For each * < code > SqlInjectionMatchTuple < / code > object , you specify the following values : * < ul > * < li > * < code > Action < / code > : Whether to insert the object into or delete the object from the array . To change a * < code > SqlInjectionMatchTuple < / code > , you delete the existing object and add a new one . * < / li > * < li > * < code > FieldToMatch < / code > : The part of web requests that you want AWS WAF to inspect and , if you want AWS WAF to * inspect a header or custom query parameter , the name of the header or parameter . * < / li > * < li > * < code > TextTransformation < / code > : Which text transformation , if any , to perform on the web request before * inspecting the request for snippets of malicious SQL code . * You can only specify a single type of TextTransformation . * < / li > * < / ul > * You use < code > SqlInjectionMatchSet < / code > objects to specify which CloudFront requests that you want to allow , * block , or count . For example , if you ' re receiving requests that contain snippets of SQL code in the query string * and you want to block the requests , you can create a < code > SqlInjectionMatchSet < / code > with the applicable * settings , and then configure AWS WAF to block the requests . * To create and configure a < code > SqlInjectionMatchSet < / code > , perform the following steps : * < ol > * < li > * Submit a < a > CreateSqlInjectionMatchSet < / a > request . * < / li > * < li > * Use < a > GetChangeToken < / a > to get the change token that you provide in the < code > ChangeToken < / code > parameter of * an < a > UpdateIPSet < / a > request . * < / li > * < li > * Submit an < code > UpdateSqlInjectionMatchSet < / code > request to specify the parts of web requests that you want AWS * WAF to inspect for snippets of SQL code . * < / li > * < / ol > * For more information about how to use the AWS WAF API to allow or block HTTP requests , see the < a * href = " https : / / docs . aws . amazon . com / waf / latest / developerguide / " > AWS WAF Developer Guide < / a > . * @ param updateSqlInjectionMatchSetRequest * A request to update a < a > SqlInjectionMatchSet < / a > . * @ return Result of the UpdateSqlInjectionMatchSet operation returned by the service . * @ throws WAFInternalErrorException * The operation failed because of a system problem , even though the request was valid . Retry your request . * @ throws WAFInvalidAccountException * The operation failed because you tried to create , update , or delete an object by using an invalid account * identifier . * @ throws WAFInvalidOperationException * The operation failed because there was nothing to do . For example : < / p > * < ul > * < li > * You tried to remove a < code > Rule < / code > from a < code > WebACL < / code > , but the < code > Rule < / code > isn ' t in * the specified < code > WebACL < / code > . * < / li > * < li > * You tried to remove an IP address from an < code > IPSet < / code > , but the IP address isn ' t in the specified * < code > IPSet < / code > . * < / li > * < li > * You tried to remove a < code > ByteMatchTuple < / code > from a < code > ByteMatchSet < / code > , but the * < code > ByteMatchTuple < / code > isn ' t in the specified < code > WebACL < / code > . * < / li > * < li > * You tried to add a < code > Rule < / code > to a < code > WebACL < / code > , but the < code > Rule < / code > already exists * in the specified < code > WebACL < / code > . * < / li > * < li > * You tried to add a < code > ByteMatchTuple < / code > to a < code > ByteMatchSet < / code > , but the * < code > ByteMatchTuple < / code > already exists in the specified < code > WebACL < / code > . * < / li > * @ throws WAFInvalidParameterException * The operation failed because AWS WAF didn ' t recognize a parameter in the request . For example : < / p > * < ul > * < li > * You specified an invalid parameter name . * < / li > * < li > * You specified an invalid value . * < / li > * < li > * You tried to update an object ( < code > ByteMatchSet < / code > , < code > IPSet < / code > , < code > Rule < / code > , or * < code > WebACL < / code > ) using an action other than < code > INSERT < / code > or < code > DELETE < / code > . * < / li > * < li > * You tried to create a < code > WebACL < / code > with a < code > DefaultAction < / code > < code > Type < / code > other than * < code > ALLOW < / code > , < code > BLOCK < / code > , or < code > COUNT < / code > . * < / li > * < li > * You tried to create a < code > RateBasedRule < / code > with a < code > RateKey < / code > value other than * < code > IP < / code > . * < / li > * < li > * You tried to update a < code > WebACL < / code > with a < code > WafAction < / code > < code > Type < / code > other than * < code > ALLOW < / code > , < code > BLOCK < / code > , or < code > COUNT < / code > . * < / li > * < li > * You tried to update a < code > ByteMatchSet < / code > with a < code > FieldToMatch < / code > < code > Type < / code > other * than HEADER , METHOD , QUERY _ STRING , URI , or BODY . * < / li > * < li > * You tried to update a < code > ByteMatchSet < / code > with a < code > Field < / code > of < code > HEADER < / code > but no * value for < code > Data < / code > . * < / li > * < li > * Your request references an ARN that is malformed , or corresponds to a resource with which a web ACL * cannot be associated . * < / li > * @ throws WAFNonexistentContainerException * The operation failed because you tried to add an object to or delete an object from another object that * doesn ' t exist . For example : < / p > * < ul > * < li > * You tried to add a < code > Rule < / code > to or delete a < code > Rule < / code > from a < code > WebACL < / code > that * doesn ' t exist . * < / li > * < li > * You tried to add a < code > ByteMatchSet < / code > to or delete a < code > ByteMatchSet < / code > from a * < code > Rule < / code > that doesn ' t exist . * < / li > * < li > * You tried to add an IP address to or delete an IP address from an < code > IPSet < / code > that doesn ' t exist . * < / li > * < li > * You tried to add a < code > ByteMatchTuple < / code > to or delete a < code > ByteMatchTuple < / code > from a * < code > ByteMatchSet < / code > that doesn ' t exist . * < / li > * @ throws WAFNonexistentItemException * The operation failed because the referenced object doesn ' t exist . * @ throws WAFStaleDataException * The operation failed because you tried to create , update , or delete an object by using a change token * that has already been used . * @ throws WAFLimitsExceededException * The operation exceeds a resource limit , for example , the maximum number of < code > WebACL < / code > objects * that you can create for an AWS account . For more information , see < a * href = " https : / / docs . aws . amazon . com / waf / latest / developerguide / limits . html " > Limits < / a > in the < i > AWS WAF * Developer Guide < / i > . * @ sample AWSWAFRegional . UpdateSqlInjectionMatchSet * @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / waf - regional - 2016-11-28 / UpdateSqlInjectionMatchSet " * target = " _ top " > AWS API Documentation < / a > */ @ Override public UpdateSqlInjectionMatchSetResult updateSqlInjectionMatchSet ( UpdateSqlInjectionMatchSetRequest request ) { } }
request = beforeClientExecution ( request ) ; return executeUpdateSqlInjectionMatchSet ( request ) ;
public class BshArray { /** * Slice the supplied list for range and step . * @ param list to slice * @ param from start index inclusive * @ param to to index exclusive * @ param step size of step or 0 if no step * @ return a sliced view of the supplied list */ public static Object slice ( List < Object > list , int from , int to , int step ) { } }
int length = list . size ( ) ; if ( to > length ) to = length ; if ( 0 > from ) from = 0 ; length = to - from ; if ( 0 >= length ) return list . subList ( 0 , 0 ) ; if ( step == 0 || step == 1 ) return list . subList ( from , to ) ; List < Integer > slices = new ArrayList < > ( ) ; for ( int i = 0 ; i < length ; i ++ ) if ( i % step == 0 ) slices . add ( step < 0 ? length - 1 - i : i + from ) ; return new SteppedSubList ( list , slices ) ;
public class AptUtils { /** * Get the attribute with the name { @ code name } of the annotation * { @ code anno } . The result is expected to have type { @ code expectedType } . * < em > Note 1 < / em > : The method does not work well for attributes of an array * type ( as it would return a list of { @ link AnnotationValue } s ) . Use * { @ code getElementValueArray } instead . * < em > Note 2 < / em > : The method does not work for attributes of an enum type , * as the AnnotationValue is a VarSymbol and would be cast to the enum type , * which doesn ' t work . Use { @ code getElementValueEnum } instead . * @ param anno the annotation to disassemble * @ param name the name of the attribute to access * @ param expectedType the expected type used to cast the return type * @ param useDefaults whether to apply default values to the attribute . * @ return the value of the attribute with the given name */ public static < T > T getElementValue ( AnnotationMirror anno , CharSequence name , Class < T > expectedType , boolean useDefaults ) { } }
Map < ? extends ExecutableElement , ? extends AnnotationValue > valmap = useDefaults ? getElementValuesWithDefaults ( anno ) : anno . getElementValues ( ) ; for ( ExecutableElement elem : valmap . keySet ( ) ) { if ( elem . getSimpleName ( ) . contentEquals ( name ) ) { AnnotationValue val = valmap . get ( elem ) ; return expectedType . cast ( val . getValue ( ) ) ; } } return null ;
public class SegPrepare { /** * 在FNLPDATA生成 . seg文件 , 然后合并 * @ param args * @ throws Exception */ public static void main ( String [ ] args ) throws Exception { } }
String datapath = "../data" ; String allfile = datapath + "/FNLPDATA/all.seg" ; String testfile = datapath + "/FNLPDATA/test.seg" ; String trainfile = datapath + "/FNLPDATA/train.seg" ; MyFiles . delete ( testfile ) ; MyFiles . delete ( trainfile ) ; MyFiles . delete ( allfile ) ; String dictfile = datapath + "/FNLPDATA/dict.seg" ; String segfile = datapath + "/FNLPDATA/temp.seg" ; // 清理 MyFiles . delete ( dictfile ) ; MyFiles . delete ( segfile ) ; FNLPCorpus corpus = new FNLPCorpus ( ) ; // 读自有数据 corpus . readOurCorpus ( datapath + "/ourdata" , ".txt" , "UTF8" ) ; // 读分词文件 corpus . readCWS ( datapath + "/FNLPDATA/seg" , ".txt" , "UTF8" ) ; // 读分词 + 词性文件 corpus . readPOS ( datapath + "/FNLPDATA/pos" , ".txt" , "UTF8" ) ; // 读FNLP数据 corpus . read ( datapath + "/FNLPDATA/ctb7.dat" , null ) ; corpus . read ( datapath + "/FNLPDATA/WeiboFTB(v1.0)-train.dat" , null ) ; FNLP2BMES . w2BMES ( corpus , segfile ) ; // FNLP2BMES . w2BMES ( corpus , segfile _ w ) ; / / ? // 词典转BMES // 搜狗词典 DICT dict = new DICT ( ) ; String sougou = datapath + "/FNLPDATA/dict/SogouLabDic.dic.raw" ; // dict . readSougou ( sougou , 2,3 , " sougou " ) ; // 互动词典 String hudong = datapath + "/FNLPDATA/dict/hudong.dic.all" ; // dict . readSougou ( hudong , 2,3 , " " ) ; // 添加其他词典 dict . readDictionary ( datapath + "/FNLPDATA/dict" , ".dic" ) ; // 添加其他词典 // dict . readDictionaryWithFrequency ( datapath + " / FNLPDATA / dict " , " . dic . freq " ) ; // 添加词性字典 dict . readPOSDICT ( datapath + "/FNLPDATA/词性字典" , ".txt" ) ; dict . readPOSDICT ( datapath + "/FNLPDATA/dict-sogou-input/txt" , ".txt" ) ; dict . toBMES ( dictfile , 3 ) ; new File ( dictfile ) . deleteOnExit ( ) ; // 合并训练文件 List < File > files = MyFiles . getAllFiles ( datapath + "/FNLPDATA/" , ".seg" ) ; MyFiles . combine ( trainfile , files . toArray ( new File [ files . size ( ) ] ) ) ; // 生成新字典 String dicfile = datapath + "/FNLPDATA/train.dict" ; DICT . BMES2DICT ( trainfile , dicfile ) ; // 处理测试数据 FNLPCorpus corpust = new FNLPCorpus ( ) ; // 读自有数据 corpust . read ( datapath + "/FNLPDATA/WeiboFTB(v1.0)-test.dat" , null ) ; FNLP2BMES . w2BMES ( corpust , testfile ) ; System . out . println ( new Date ( ) . toString ( ) ) ; System . out . println ( "Done!" ) ;
public class RrdNioBackend { /** * Closes the underlying RRD file . * @ throws IOException Thrown in case of I / O error */ @ Override public synchronized void close ( ) throws IOException { } }
// cancel synchronization try { if ( syncTask != null ) { syncTask . cancel ( ) ; } sync ( ) ; unmapFile ( ) ; } finally { super . close ( ) ; }
public class InterceptionModelInitializer { /** * Constructor - level EJB - style interceptors */ public void initConstructorDeclaredEjbInterceptors ( ) { } }
Class < ? > [ ] constructorDeclaredInterceptors = interceptorsApi . extractInterceptorClasses ( constructor ) ; if ( constructorDeclaredInterceptors != null ) { for ( Class < ? > clazz : constructorDeclaredInterceptors ) { builder . interceptGlobal ( InterceptionType . AROUND_CONSTRUCT , null , Collections . < InterceptorClassMetadata < ? > > singleton ( reader . getPlainInterceptorMetadata ( clazz ) ) , null ) ; } }
public class Ellipsoid { /** * Create a new earth ellipsoid with the given parameters . * @ param name the name of the earth ellipsoid model * @ param a the equatorial radius , in meter * @ param b the polar radius , in meter * @ param f the inverse flattening * @ return a new earth ellipsoid with the given parameters */ public static Ellipsoid of ( final String name , final double a , final double b , final double f ) { } }
return new Ellipsoid ( name , a , b , f ) ;
public class ForkJoinPool { /** * Performs the given task , returning its result upon completion . * If the computation encounters an unchecked Exception or Error , * it is rethrown as the outcome of this invocation . Rethrown * exceptions behave in the same way as regular exceptions , but , * when possible , contain stack traces ( as displayed for example * using { @ code ex . printStackTrace ( ) } ) of both the current thread * as well as the thread actually encountering the exception ; * minimally only the latter . * @ param task the task * @ param < T > the type of the task ' s result * @ return the task ' s result * @ throws NullPointerException if the task is null * @ throws RejectedExecutionException if the task cannot be * scheduled for execution */ public < T > T invoke ( ForkJoinTask < T > task ) { } }
if ( task == null ) throw new NullPointerException ( ) ; externalSubmit ( task ) ; return task . join ( ) ;
public class InstancePatchStateMarshaller { /** * Marshall the given parameter object . */ public void marshall ( InstancePatchState instancePatchState , ProtocolMarshaller protocolMarshaller ) { } }
if ( instancePatchState == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( instancePatchState . getInstanceId ( ) , INSTANCEID_BINDING ) ; protocolMarshaller . marshall ( instancePatchState . getPatchGroup ( ) , PATCHGROUP_BINDING ) ; protocolMarshaller . marshall ( instancePatchState . getBaselineId ( ) , BASELINEID_BINDING ) ; protocolMarshaller . marshall ( instancePatchState . getSnapshotId ( ) , SNAPSHOTID_BINDING ) ; protocolMarshaller . marshall ( instancePatchState . getInstallOverrideList ( ) , INSTALLOVERRIDELIST_BINDING ) ; protocolMarshaller . marshall ( instancePatchState . getOwnerInformation ( ) , OWNERINFORMATION_BINDING ) ; protocolMarshaller . marshall ( instancePatchState . getInstalledCount ( ) , INSTALLEDCOUNT_BINDING ) ; protocolMarshaller . marshall ( instancePatchState . getInstalledOtherCount ( ) , INSTALLEDOTHERCOUNT_BINDING ) ; protocolMarshaller . marshall ( instancePatchState . getInstalledRejectedCount ( ) , INSTALLEDREJECTEDCOUNT_BINDING ) ; protocolMarshaller . marshall ( instancePatchState . getMissingCount ( ) , MISSINGCOUNT_BINDING ) ; protocolMarshaller . marshall ( instancePatchState . getFailedCount ( ) , FAILEDCOUNT_BINDING ) ; protocolMarshaller . marshall ( instancePatchState . getNotApplicableCount ( ) , NOTAPPLICABLECOUNT_BINDING ) ; protocolMarshaller . marshall ( instancePatchState . getOperationStartTime ( ) , OPERATIONSTARTTIME_BINDING ) ; protocolMarshaller . marshall ( instancePatchState . getOperationEndTime ( ) , OPERATIONENDTIME_BINDING ) ; protocolMarshaller . marshall ( instancePatchState . getOperation ( ) , OPERATION_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class GeneralTimestamp { /** * / * [ deutsch ] * < p > Erzeugt einen neuen Zeitstempel , der aus einer Kalendervariante und einer Uhrzeitkomponente besteht . < / p > * @ param < C > generic type of date component * @ param calendarVariant date component * @ param time time component * @ return general timestamp * @ since 3.8/4.5 */ public static < C extends CalendarVariant < C > > GeneralTimestamp < C > of ( C calendarVariant , PlainTime time ) { } }
if ( calendarVariant == null ) { throw new NullPointerException ( "Missing date component." ) ; } return new GeneralTimestamp < > ( calendarVariant , null , time ) ;
public class BindableASTTransformation { /** * Creates a statement body similar to : * < code > this . firePropertyChange ( " field " , field , field = value ) < / code > * @ param propertyNode the field node for the property * @ param fieldExpression a field expression for setting the property value * @ return the created statement */ protected Statement createBindableStatement ( PropertyNode propertyNode , Expression fieldExpression ) { } }
// create statementBody return stmt ( callThisX ( "firePropertyChange" , args ( constX ( propertyNode . getName ( ) ) , fieldExpression , assignX ( fieldExpression , varX ( "value" ) ) ) ) ) ;
public class ReminderDatePicker { /** * Sets the Spinners ' date selection as integers considering only day . */ public void setSelectedDate ( int year , int month , int day ) { } }
dateSpinner . setSelectedDate ( new GregorianCalendar ( year , month , day ) ) ; // a custom selection has been set , don ' t select the default date : shouldSelectDefault = false ;
public class TmsClient { /** * Create a map with a local profile and specified crs , bounds and number of zoom levels . The resolution at level 0 * is based on mapping the bounds to a rectangular tile width minimum width and height of minTileSize pixels . * @ param crs * @ param type * @ param bounds * @ param minTileSize * @ param nrOfZoomLevels * @ return */ protected MapConfiguration createTmsMap ( String crs , CrsType type , Bbox bounds , int minTileSize , int nrOfZoomLevels ) { } }
MapConfigurationImpl mapConfiguration ; mapConfiguration = new MapConfigurationImpl ( ) ; mapConfiguration . setCrs ( crs , type ) ; double minSize = bounds . getWidth ( ) >= bounds . getHeight ( ) ? bounds . getHeight ( ) : bounds . getWidth ( ) ; List < Double > resolutions = new ArrayList < Double > ( ) ; for ( int i = 0 ; i < nrOfZoomLevels ; i ++ ) { resolutions . add ( minSize / ( minTileSize * Math . pow ( 2 , i ) ) ) ; } mapConfiguration . setResolutions ( resolutions ) ; mapConfiguration . setMaxBounds ( Bbox . ALL ) ; mapConfiguration . setHintValue ( MapConfiguration . INITIAL_BOUNDS , bounds ) ; return mapConfiguration ;
public class CorpusLoader { /** * 读取整个目录中的人民日报格式语料 * @ param folderPath 路径 * @ param verbose * @ return */ public static List < Document > convert2DocumentList ( String folderPath , boolean verbose ) { } }
long start = System . currentTimeMillis ( ) ; List < File > fileList = IOUtil . fileList ( folderPath ) ; List < Document > documentList = new LinkedList < Document > ( ) ; int i = 0 ; for ( File file : fileList ) { if ( verbose ) System . out . print ( file ) ; Document document = convert2Document ( file ) ; documentList . add ( document ) ; if ( verbose ) System . out . println ( " " + ++ i + " / " + fileList . size ( ) ) ; } if ( verbose ) { System . out . println ( documentList . size ( ) ) ; System . out . printf ( "花费时间%d ms\n" , System . currentTimeMillis ( ) - start ) ; } return documentList ;
public class InternalXtypeParser { /** * InternalXtype . g : 75:1 : ruleJvmTypeReference returns [ EObject current = null ] : ( ( this _ JvmParameterizedTypeReference _ 0 = ruleJvmParameterizedTypeReference ( ( ( ( ) ruleArrayBrackets ) ) = > ( ( ) ruleArrayBrackets ) ) * ) | this _ XFunctionTypeRef _ 3 = ruleXFunctionTypeRef ) ; */ public final EObject ruleJvmTypeReference ( ) throws RecognitionException { } }
EObject current = null ; EObject this_JvmParameterizedTypeReference_0 = null ; EObject this_XFunctionTypeRef_3 = null ; enterRule ( ) ; try { // InternalXtype . g : 81:2 : ( ( ( this _ JvmParameterizedTypeReference _ 0 = ruleJvmParameterizedTypeReference ( ( ( ( ) ruleArrayBrackets ) ) = > ( ( ) ruleArrayBrackets ) ) * ) | this _ XFunctionTypeRef _ 3 = ruleXFunctionTypeRef ) ) // InternalXtype . g : 82:2 : ( ( this _ JvmParameterizedTypeReference _ 0 = ruleJvmParameterizedTypeReference ( ( ( ( ) ruleArrayBrackets ) ) = > ( ( ) ruleArrayBrackets ) ) * ) | this _ XFunctionTypeRef _ 3 = ruleXFunctionTypeRef ) { // InternalXtype . g : 82:2 : ( ( this _ JvmParameterizedTypeReference _ 0 = ruleJvmParameterizedTypeReference ( ( ( ( ) ruleArrayBrackets ) ) = > ( ( ) ruleArrayBrackets ) ) * ) | this _ XFunctionTypeRef _ 3 = ruleXFunctionTypeRef ) int alt2 = 2 ; int LA2_0 = input . LA ( 1 ) ; if ( ( LA2_0 == RULE_ID ) ) { alt2 = 1 ; } else if ( ( LA2_0 == 12 || LA2_0 == 15 ) ) { alt2 = 2 ; } else { if ( state . backtracking > 0 ) { state . failed = true ; return current ; } NoViableAltException nvae = new NoViableAltException ( "" , 2 , 0 , input ) ; throw nvae ; } switch ( alt2 ) { case 1 : // InternalXtype . g : 83:3 : ( this _ JvmParameterizedTypeReference _ 0 = ruleJvmParameterizedTypeReference ( ( ( ( ) ruleArrayBrackets ) ) = > ( ( ) ruleArrayBrackets ) ) * ) { // InternalXtype . g : 83:3 : ( this _ JvmParameterizedTypeReference _ 0 = ruleJvmParameterizedTypeReference ( ( ( ( ) ruleArrayBrackets ) ) = > ( ( ) ruleArrayBrackets ) ) * ) // InternalXtype . g : 84:4 : this _ JvmParameterizedTypeReference _ 0 = ruleJvmParameterizedTypeReference ( ( ( ( ) ruleArrayBrackets ) ) = > ( ( ) ruleArrayBrackets ) ) * { if ( state . backtracking == 0 ) { newCompositeNode ( grammarAccess . getJvmTypeReferenceAccess ( ) . getJvmParameterizedTypeReferenceParserRuleCall_0_0 ( ) ) ; } pushFollow ( FOLLOW_3 ) ; this_JvmParameterizedTypeReference_0 = ruleJvmParameterizedTypeReference ( ) ; state . _fsp -- ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { current = this_JvmParameterizedTypeReference_0 ; afterParserOrEnumRuleCall ( ) ; } // InternalXtype . g : 92:4 : ( ( ( ( ) ruleArrayBrackets ) ) = > ( ( ) ruleArrayBrackets ) ) * loop1 : do { int alt1 = 2 ; int LA1_0 = input . LA ( 1 ) ; if ( ( LA1_0 == 10 ) && ( synpred1_InternalXtype ( ) ) ) { alt1 = 1 ; } switch ( alt1 ) { case 1 : // InternalXtype . g : 93:5 : ( ( ( ) ruleArrayBrackets ) ) = > ( ( ) ruleArrayBrackets ) { // InternalXtype . g : 99:5 : ( ( ) ruleArrayBrackets ) // InternalXtype . g : 100:6 : ( ) ruleArrayBrackets { // InternalXtype . g : 100:6 : ( ) // InternalXtype . g : 101:7: { if ( state . backtracking == 0 ) { current = forceCreateModelElementAndSet ( grammarAccess . getJvmTypeReferenceAccess ( ) . getJvmGenericArrayTypeReferenceComponentTypeAction_0_1_0_0 ( ) , current ) ; } } if ( state . backtracking == 0 ) { newCompositeNode ( grammarAccess . getJvmTypeReferenceAccess ( ) . getArrayBracketsParserRuleCall_0_1_0_1 ( ) ) ; } pushFollow ( FOLLOW_3 ) ; ruleArrayBrackets ( ) ; state . _fsp -- ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { afterParserOrEnumRuleCall ( ) ; } } } break ; default : break loop1 ; } } while ( true ) ; } } break ; case 2 : // InternalXtype . g : 118:3 : this _ XFunctionTypeRef _ 3 = ruleXFunctionTypeRef { if ( state . backtracking == 0 ) { newCompositeNode ( grammarAccess . getJvmTypeReferenceAccess ( ) . getXFunctionTypeRefParserRuleCall_1 ( ) ) ; } pushFollow ( FOLLOW_2 ) ; this_XFunctionTypeRef_3 = ruleXFunctionTypeRef ( ) ; state . _fsp -- ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { current = this_XFunctionTypeRef_3 ; afterParserOrEnumRuleCall ( ) ; } } break ; } } if ( state . backtracking == 0 ) { leaveRule ( ) ; } } catch ( RecognitionException re ) { recover ( input , re ) ; appendSkippedTokens ( ) ; } finally { } return current ;
public class Record { /** * Get the field that references this record ( from another record ) . * The field returned must be a ReferenceField , in a key area , and must override getReferenceRecordName ( ) . * @ param record The record to check . * @ return The field which is used to reference this record or null if none . */ public ReferenceField getReferringField ( ) { } }
ClearFieldReferenceOnCloseHandler listener = ( ClearFieldReferenceOnCloseHandler ) this . getListener ( ClearFieldReferenceOnCloseHandler . class , true ) ; while ( listener != null ) { BaseField field = listener . getField ( ) ; if ( field instanceof ReferenceField ) if ( ( ( ReferenceField ) field ) . getReferenceRecord ( null , false ) == this ) return ( ReferenceField ) field ; } return null ;
public class AllocatedEvaluatorImpl { /** * Submit Task with configuration strings . * This method should be called from bridge and the configuration strings are * serialized at . Net side . * @ param evaluatorConfiguration * @ param taskConfiguration */ public void submitTask ( final String evaluatorConfiguration , final String taskConfiguration ) { } }
final Configuration contextConfiguration = ContextConfiguration . CONF . set ( ContextConfiguration . IDENTIFIER , "RootContext_" + this . getId ( ) ) . build ( ) ; final String contextConfigurationString = this . configurationSerializer . toString ( contextConfiguration ) ; this . launchWithConfigurationString ( evaluatorConfiguration , contextConfigurationString , Optional . < String > empty ( ) , Optional . of ( taskConfiguration ) ) ;
public class SQLRebuilder { /** * Adds a new object . */ private void registerObject ( DigitalObject obj ) throws StorageDeviceException { } }
String pid = obj . getPid ( ) ; String userId = "the userID field is no longer used" ; String label = "the label field is no longer used" ; Connection conn = null ; PreparedStatement s1 = null ; try { String query = "INSERT INTO doRegistry (doPID, ownerId, label) VALUES (?, ?, ?)" ; conn = m_connectionPool . getReadWriteConnection ( ) ; s1 = conn . prepareStatement ( query ) ; s1 . setString ( 1 , pid ) ; s1 . setString ( 2 , userId ) ; s1 . setString ( 3 , label ) ; s1 . executeUpdate ( ) ; if ( obj . hasContentModel ( Models . SERVICE_DEPLOYMENT_3_0 ) ) { updateDeploymentMap ( obj , conn ) ; } } catch ( SQLException sqle ) { throw new StorageDeviceException ( "Unexpected error from SQL database while registering object: " + sqle . getMessage ( ) , sqle ) ; } finally { try { if ( s1 != null ) { s1 . close ( ) ; } } catch ( Exception sqle ) { throw new StorageDeviceException ( "Unexpected error from SQL database while registering object: " + sqle . getMessage ( ) , sqle ) ; } finally { s1 = null ; } } PreparedStatement s2 = null ; ResultSet results = null ; try { // REGISTRY : // update systemVersion in doRegistry ( add one ) logger . debug ( "COMMIT: Updating registry..." ) ; String query = "SELECT systemVersion FROM doRegistry WHERE doPID=?" ; s2 = conn . prepareStatement ( query ) ; s2 . setString ( 1 , pid ) ; results = s2 . executeQuery ( ) ; if ( ! results . next ( ) ) { throw new ObjectNotFoundException ( "Error creating replication job: The requested object doesn't exist in the registry." ) ; } int systemVersion = results . getInt ( "systemVersion" ) ; systemVersion ++ ; query = "UPDATE doRegistry SET systemVersion=? WHERE doPID=?" ; s2 . close ( ) ; s2 = conn . prepareStatement ( query ) ; s2 . setInt ( 1 , systemVersion ) ; s2 . setString ( 2 , pid ) ; s2 . executeUpdate ( ) ; } catch ( SQLException sqle ) { throw new StorageDeviceException ( "Error creating replication job: " + sqle . getMessage ( ) ) ; } catch ( ObjectNotFoundException e ) { // TODO Auto - generated catch block e . printStackTrace ( ) ; } finally { try { if ( results != null ) { results . close ( ) ; } if ( s2 != null ) { s2 . close ( ) ; } if ( conn != null ) { m_connectionPool . free ( conn ) ; } } catch ( SQLException sqle ) { throw new StorageDeviceException ( "Unexpected error from SQL database: " + sqle . getMessage ( ) ) ; } finally { results = null ; s2 = null ; } }
public class ExecHandler { /** * { @ inheritDoc } */ @ Override protected void checkForRestriction ( JmxExecRequest pRequest ) { } }
if ( ! getRestrictor ( ) . isOperationAllowed ( pRequest . getObjectName ( ) , pRequest . getOperation ( ) ) ) { throw new SecurityException ( "Operation " + pRequest . getOperation ( ) + " forbidden for MBean " + pRequest . getObjectNameAsString ( ) ) ; }
public class DropwizardMeterRegistries { /** * Returns a newly - created { @ link DropwizardMeterRegistry } instance with the specified * { @ link MetricRegistry } and { @ link HierarchicalNameMapper } . */ public static DropwizardMeterRegistry newRegistry ( MetricRegistry registry , HierarchicalNameMapper nameMapper ) { } }
return newRegistry ( registry , nameMapper , Clock . SYSTEM ) ;
public class BayesInstance { /** * private static void project ( BayesVariable [ ] sepVars , JunctionTreeNode node , JunctionTreeSeparator sep ) { */ private static void project ( BayesVariable [ ] sepVars , CliqueState clique , SeparatorState separator ) { } }
// JunctionTreeNode node , JunctionTreeSeparator sep BayesVariable [ ] vars = clique . getJunctionTreeClique ( ) . getValues ( ) . toArray ( new BayesVariable [ clique . getJunctionTreeClique ( ) . getValues ( ) . size ( ) ] ) ; int [ ] sepVarPos = PotentialMultiplier . createSubsetVarPos ( vars , sepVars ) ; int sepVarNumberOfStates = PotentialMultiplier . createNumberOfStates ( sepVars ) ; int [ ] sepVarMultipliers = PotentialMultiplier . createIndexMultipliers ( sepVars , sepVarNumberOfStates ) ; BayesProjection p = new BayesProjection ( vars , clique . getPotentials ( ) , sepVarPos , sepVarMultipliers , separator . getPotentials ( ) ) ; p . project ( ) ;
public class ReportUtil { /** * Get sql string from report object with parameters values * @ param report * report * @ param parameterValues * parameter values map * @ return sql string from report object with parameters values */ public static String getSql ( Report report , Map < String , Object > parameterValues ) { } }
SimpleDateFormat timeFormat = new SimpleDateFormat ( "dd/MM/yyyy HH:mm:ss" ) ; SimpleDateFormat dayFormat = new SimpleDateFormat ( "dd/MM/yyyy" ) ; String sql = getSql ( report ) ; if ( parameterValues != null ) { for ( String pName : parameterValues . keySet ( ) ) { Object value = parameterValues . get ( pName ) ; StringBuilder text = new StringBuilder ( ) ; if ( value == null ) { text . append ( "null" ) ; continue ; } if ( value instanceof Object [ ] ) { Object [ ] values = ( Object [ ] ) value ; text . append ( "(" ) ; for ( int i = 0 , size = values . length ; i < size ; i ++ ) { Object obj = values [ i ] ; if ( obj instanceof IdName ) { text . append ( ( ( IdName ) obj ) . getId ( ) ) ; } else if ( obj instanceof Date ) { text . append ( dayFormat . format ( ( Date ) obj ) ) ; } else if ( obj instanceof Timestamp ) { Date date = new Date ( ( ( Timestamp ) obj ) . getTime ( ) ) ; text . append ( timeFormat . format ( date ) ) ; } else { text . append ( obj ) ; } if ( i < size - 1 ) { text . append ( "," ) ; } } text . append ( ")" ) ; } else if ( value instanceof IdName ) { Object idName = ( ( IdName ) value ) . getId ( ) ; if ( idName instanceof String ) { text . append ( "'" ) ; text . append ( value ) ; text . append ( "'" ) ; } else { text . append ( value ) ; } } else if ( value instanceof Date ) { text . append ( "'" ) ; text . append ( dayFormat . format ( ( Date ) value ) ) ; text . append ( "'" ) ; } else if ( value instanceof Timestamp ) { text . append ( "'" ) ; Date date = new Date ( ( ( Timestamp ) value ) . getTime ( ) ) ; text . append ( timeFormat . format ( date ) ) ; text . append ( "'" ) ; } else if ( value instanceof String ) { text . append ( "'" ) ; text . append ( value ) ; text . append ( "'" ) ; } else { text . append ( value ) ; } String tag = "${" + pName + "}" ; while ( sql . indexOf ( tag ) != - 1 ) { int index = sql . indexOf ( tag ) ; sql = sql . substring ( 0 , index ) + text . toString ( ) + sql . substring ( index + tag . length ( ) ) ; } } } return sql ;
public class OpenstackIaasHandler { /** * Validates the target properties , including storage ones . * @ param targetProperties * @ param appName * @ param instanceName * @ throws TargetException */ static void validateAll ( Map < String , String > targetProperties , String appName , String instanceName ) throws TargetException { } }
// Basic checks validate ( targetProperties ) ; // Storage checks Set < String > mountPoints = new HashSet < > ( ) ; Set < String > volumeNames = new HashSet < > ( ) ; for ( String s : findStorageIds ( targetProperties ) ) { // Unit tests should guarantee there is a default value for the " mount point " . String mountPoint = findStorageProperty ( targetProperties , s , VOLUME_MOUNT_POINT_PREFIX ) ; if ( mountPoints . contains ( mountPoint ) ) throw new TargetException ( "Mount point '" + mountPoint + "' is already used by another volume for this VM." ) ; mountPoints . add ( mountPoint ) ; // Same thing for the volume name String volumeName = findStorageProperty ( targetProperties , s , VOLUME_NAME_PREFIX ) ; volumeName = expandVolumeName ( volumeName , appName , instanceName ) ; if ( volumeNames . contains ( volumeName ) ) throw new TargetException ( "Volume name '" + volumeName + "' is already used by another volume for this VM." ) ; volumeNames . add ( volumeName ) ; // Validate volume size String volumesize = findStorageProperty ( targetProperties , s , VOLUME_SIZE_GB_PREFIX ) ; try { Integer . valueOf ( volumesize ) ; } catch ( NumberFormatException e ) { throw new TargetException ( "The volume size must be a valid integer." , e ) ; } }
public class SimpleDocTreeVisitor { /** * { @ inheritDoc } This implementation calls { @ code defaultAction } . * @ param node { @ inheritDoc } * @ param p { @ inheritDoc } * @ return the result of { @ code defaultAction } */ @ Override public R visitSerialData ( SerialDataTree node , P p ) { } }
return defaultAction ( node , p ) ;
public class AllWindowedStream { /** * Applies the given window function to each window . The window function is called for each * evaluation of the window for each key individually . The output of the window function is * interpreted as a regular non - windowed stream . * < p > Arriving data is incrementally aggregated using the given reducer . * @ param reduceFunction The reduce function that is used for incremental aggregation . * @ param function The window function . * @ return The data stream that is the result of applying the window function to the window . * @ deprecated Use { @ link # reduce ( ReduceFunction , AllWindowFunction ) } instead . */ @ Deprecated public < R > SingleOutputStreamOperator < R > apply ( ReduceFunction < T > reduceFunction , AllWindowFunction < T , R , W > function ) { } }
TypeInformation < T > inType = input . getType ( ) ; TypeInformation < R > resultType = getAllWindowFunctionReturnType ( function , inType ) ; return apply ( reduceFunction , function , resultType ) ;
public class ProcedurePartitionData { /** * For Testing usage ONLY . * From a partition information string to @ ProcedurePartitionData * string format : * 1 ) String . format ( " % s . % s : % s " , tableName , columnName , parameterNo ) * 1 ) String . format ( " % s . % s : % s , % s . % s : % s " , tableName , columnName , parameterNo , tableName2 , columnName2 , parameterNo2) * @ return */ public static ProcedurePartitionData fromPartitionInfoString ( String partitionInfoString ) { } }
if ( partitionInfoString == null || partitionInfoString . trim ( ) . isEmpty ( ) ) { return new ProcedurePartitionData ( ) ; } String [ ] partitionInfoParts = new String [ 0 ] ; partitionInfoParts = partitionInfoString . split ( "," ) ; assert ( partitionInfoParts . length <= 2 ) ; if ( partitionInfoParts . length == 2 ) { ProcedurePartitionData partitionInfo = fromPartitionInfoString ( partitionInfoParts [ 0 ] ) ; ProcedurePartitionData partitionInfo2 = fromPartitionInfoString ( partitionInfoParts [ 1 ] ) ; partitionInfo . addSecondPartitionInfo ( partitionInfo2 ) ; return partitionInfo ; } String subClause = partitionInfoParts [ 0 ] ; // split on the colon String [ ] parts = subClause . split ( ":" ) ; assert ( parts . length == 2 ) ; // relabel the parts for code readability String columnInfo = parts [ 0 ] . trim ( ) ; String paramIndex = parts [ 1 ] . trim ( ) ; // split the columninfo parts = columnInfo . split ( "\\." ) ; assert ( parts . length == 2 ) ; // relabel the parts for code readability String tableName = parts [ 0 ] . trim ( ) ; String columnName = parts [ 1 ] . trim ( ) ; return new ProcedurePartitionData ( tableName , columnName , paramIndex ) ;
public class FluentMatching { /** * Specifies an match on a decomposing matcher with 1 extracted fields and then returns a fluent * interface for specifying the action to take if the value matches this case . */ public < U extends T , A > InitialMatching1 < T , U , A > when ( DecomposableMatchBuilder1 < U , A > decomposableMatchBuilder ) { } }
return new InitialMatching1 < > ( decomposableMatchBuilder . build ( ) , value ) ;
public class BottomSheet { /** * Replaces the item at a specific index with another item . * @ param index * The index of the item , which should be replaced , as an { @ link Integer } value * @ param id * The id of the item , which should be added , as an { @ link Integer } value . The id must * be at least 0 * @ param titleId * The resource id of the title of the item , which should be added , as an { @ link * Integer } value . The resource id must correspond to a valid string resource */ public final void setItem ( final int index , final int id , @ StringRes final int titleId ) { } }
Item item = new Item ( getContext ( ) , id , titleId ) ; adapter . set ( index , item ) ; adaptGridViewHeight ( ) ;
public class ConnectionFilter { /** * Wraps sent data , from the application side to the network side */ @ Override public void send ( byte [ ] b , int off , int len ) { } }
handler . send ( b , off , len ) ;
public class ModelDescriptorBuilder { /** * Builds the final instance of { @ link ModelDescriptor } , using information provided by the serialized model and * which corresponding implementations of { @ link hex . genmodel . ModelMojoReader } are able to provide . * @ return A new instance of { @ link ModelDescriptor } */ public ModelDescriptor build ( ) { } }
return new ModelDescriptor ( ) { @ Override public String [ ] [ ] scoringDomains ( ) { return _domains ; } @ Override public String projectVersion ( ) { return _h2oVersion ; } @ Override public String algoName ( ) { return _algoName ; } @ Override public String algoFullName ( ) { return _algoName ; } @ Override public String offsetColumn ( ) { return _offsetColumn ; } @ Override public String weightsColumn ( ) { return null ; } @ Override public String foldColumn ( ) { return null ; } @ Override public ModelCategory getModelCategory ( ) { return _category ; } @ Override public boolean isSupervised ( ) { return _supervised ; } @ Override public int nfeatures ( ) { return _nfeatures ; } @ Override public String [ ] features ( ) { return Arrays . copyOf ( columnNames ( ) , nfeatures ( ) ) ; } @ Override public int nclasses ( ) { return _nclasses ; } @ Override public String [ ] columnNames ( ) { return _names ; } @ Override public boolean balanceClasses ( ) { return _balanceClasses ; } @ Override public double defaultThreshold ( ) { return _defaultThreshold ; } @ Override public double [ ] priorClassDist ( ) { return _priorClassDistrib ; } @ Override public double [ ] modelClassDist ( ) { return _modelClassDistrib ; } @ Override public String uuid ( ) { return _uuid ; } @ Override public String timestamp ( ) { return null ; } @ Override public VariableImportances variableImportances ( ) { return _variableImportances ; } @ Override public Table modelSummary ( ) { return _modelSummary ; } } ;
public class ReleasableInputStream { /** * Wraps the given input stream into a { @ link ReleasableInputStream } if * necessary . Note if the given input stream is a { @ link FileInputStream } , a * { @ link ResettableInputStream } which is a specific subclass of * { @ link ReleasableInputStream } will be returned . */ public static ReleasableInputStream wrap ( InputStream is ) { } }
if ( is instanceof ReleasableInputStream ) return ( ReleasableInputStream ) is ; // already wrapped if ( is instanceof FileInputStream ) return ResettableInputStream . newResettableInputStream ( ( FileInputStream ) is ) ; return new ReleasableInputStream ( is ) ;
public class EventMethodsHelper { /** * Retrieves cache provider instance for method */ private static CacheProvider getCacheProvider ( Method javaMethod ) { } }
if ( ! javaMethod . isAnnotationPresent ( Cache . class ) ) { return null ; } Cache an = javaMethod . getAnnotation ( Cache . class ) ; Class < ? extends CacheProvider > cacheClazz = an . value ( ) ; try { Constructor < ? extends CacheProvider > constructor = cacheClazz . getDeclaredConstructor ( ) ; constructor . setAccessible ( true ) ; return constructor . newInstance ( ) ; } catch ( Exception e ) { throw new EventsException ( "Cannot instantiate cache provider " + cacheClazz . getSimpleName ( ) + " for method " + Utils . methodToString ( javaMethod ) , e ) ; }
public class GetReplicationRunsRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( GetReplicationRunsRequest getReplicationRunsRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( getReplicationRunsRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( getReplicationRunsRequest . getReplicationJobId ( ) , REPLICATIONJOBID_BINDING ) ; protocolMarshaller . marshall ( getReplicationRunsRequest . getNextToken ( ) , NEXTTOKEN_BINDING ) ; protocolMarshaller . marshall ( getReplicationRunsRequest . getMaxResults ( ) , MAXRESULTS_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class ArrayUtils { /** * Transfer a String List to String array */ public static String [ ] strListToArray ( List < String > list ) { } }
if ( list == null ) return new String [ 0 ] ; return list . toArray ( new String [ list . size ( ) ] ) ;
public class SarlDocumentationParser { /** * Replies the fenced code block formatter . * < p > This code block formatter is usually used by Github . * @ return the formatter . */ public static Function2 < String , String , String > getFencedCodeBlockFormatter ( ) { } }
return ( languageName , content ) -> { /* final StringBuilder result = new StringBuilder ( ) ; result . append ( " < div class = \ \ \ " highlight " ) ; / / $ NON - NLS - 1 $ if ( ! Strings . isNullOrEmpty ( languageName ) ) { result . append ( " highlight - " ) . append ( languageName ) ; / / $ NON - NLS - 1 $ result . append ( " \ " > < pre > \ n " ) . append ( content ) . append ( " < / pre > < / div > \ n " ) ; / / $ NON - NLS - 1 $ / / $ NON - NLS - 2 $ return result . toString ( ) ; */ return "```" + Strings . nullToEmpty ( languageName ) . toLowerCase ( ) + "\n" // $ NON - NLS - 1 $ / / $ NON - NLS - 2 $ + content + "```\n" ; // $ NON - NLS - 1 $ } ;
public class Logger { /** * < p > fatal < / p > * @ see Log # fatal * @ param message a { @ link java . lang . String } object . * @ param args a { @ link java . lang . Object } object . */ public void fatal ( String message , Object ... args ) { } }
if ( log . isFatalEnabled ( ) ) { log . fatal ( String . format ( message , args ) ) ; }
public class LoggingDecoratorFactoryFunction { /** * Creates a new decorator with the specified { @ code parameter } . */ @ Override public Function < Service < HttpRequest , HttpResponse > , ? extends Service < HttpRequest , HttpResponse > > newDecorator ( LoggingDecorator parameter ) { } }
return new LoggingServiceBuilder ( ) . requestLogLevel ( parameter . requestLogLevel ( ) ) . successfulResponseLogLevel ( parameter . successfulResponseLogLevel ( ) ) . failureResponseLogLevel ( parameter . failureResponseLogLevel ( ) ) . samplingRate ( parameter . samplingRate ( ) ) . newDecorator ( ) ;
public class CircularList { /** * Removes the first ( inserted ) element of the collection . * @ return Removed element or null if any */ public T removeFirst ( ) { } }
if ( isEmpty ( ) ) { return null ; } T firstElement = elements [ firstIndex ] ; elements [ firstIndex ] = null ; firstIndex = incrementIndex ( firstIndex , 0 ) ; return firstElement ;
public class EmbeddedPostgreSQLController { /** * Each schema set has its own database cluster . The template1 database has the schema preloaded so that * each test case need only create a new database and not re - invoke Migratory . */ private synchronized static Cluster getCluster ( URI baseUrl , String [ ] personalities ) throws IOException { } }
final Entry < URI , Set < String > > key = Maps . immutableEntry ( baseUrl , ( Set < String > ) ImmutableSet . copyOf ( personalities ) ) ; Cluster result = CLUSTERS . get ( key ) ; if ( result != null ) { return result ; } result = new Cluster ( EmbeddedPostgreSQL . start ( ) ) ; final DBI dbi = new DBI ( result . getPg ( ) . getTemplateDatabase ( ) ) ; final Migratory migratory = new Migratory ( new MigratoryConfig ( ) { } , dbi , dbi ) ; migratory . addLocator ( new DatabasePreparerLocator ( migratory , baseUrl ) ) ; final MigrationPlan plan = new MigrationPlan ( ) ; int priority = 100 ; for ( final String personality : personalities ) { plan . addMigration ( personality , Integer . MAX_VALUE , priority -- ) ; } migratory . dbMigrate ( plan ) ; result . start ( ) ; CLUSTERS . put ( key , result ) ; return result ;
public class PropertiesAdapter { /** * Filters the properties from this adapter by name . * @ param filter the { @ link Filter } used to filter the properties of this adapter . * @ return a newly constructed instance of the { @ link PropertiesAdapter } containing only the filtered properties . * @ see org . cp . elements . lang . Filter * @ see java . util . Properties * @ see # from ( Properties ) */ public PropertiesAdapter filter ( Filter < String > filter ) { } }
Properties properties = new Properties ( ) ; for ( String propertyName : this ) { if ( filter . accept ( propertyName ) ) { properties . setProperty ( propertyName , get ( propertyName ) ) ; } } return from ( properties ) ;
public class JobInitializationPoller { /** * Test method used only for testing purposes . */ JobInProgress getInitializingJob ( String queue ) { } }
JobInitializationThread t = threadsToQueueMap . get ( queue ) ; if ( t == null ) { return null ; } else { return t . getInitializingJob ( ) ; }
public class InterceptingServer { /** * New { @ link ConnectionHandler } that echoes all data received . * @ return Connection handler . */ private static ConnectionHandler < ByteBuf , ByteBuf > echoHandler ( ) { } }
return conn -> conn . writeStringAndFlushOnEach ( conn . getInput ( ) . map ( msg -> "echo => " + msg . toString ( Charset . defaultCharset ( ) ) + "\n" ) ) ;
public class IfcPersonImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ SuppressWarnings ( "unchecked" ) @ Override public EList < String > getPrefixTitles ( ) { } }
return ( EList < String > ) eGet ( Ifc4Package . Literals . IFC_PERSON__PREFIX_TITLES , true ) ;
public class AbstractSettings { /** * Perform post de - serialization modification of the Settings . */ protected final void initialize ( ) { } }
// Enabling development mode forces these settings . This is somewhat inelegant , because to configure one of // these values differently will require disabling development mode and manually configure the remaining values . if ( development ) { loggingSettings . getLoggers ( ) . put ( "org.hibernate.SQL" , Level . DEBUG ) ; loggingSettings . getLoggers ( ) . put ( "com.metrink.croquet" , Level . DEBUG ) ; } // call the class ' s init method init ( ) ;
public class PluralRanges { /** * Internal method for building . If the start or end are null , it means everything of that type . * @ param rangeStart * plural category for the start of the range * @ param rangeEnd * plural category for the end of the range * @ param result * the resulting plural category * @ deprecated This API is ICU internal only . * @ hide draft / provisional / internal are hidden on Android */ @ Deprecated public void add ( StandardPlural rangeStart , StandardPlural rangeEnd , StandardPlural result ) { } }
if ( isFrozen ) { throw new UnsupportedOperationException ( ) ; } explicit [ result . ordinal ( ) ] = true ; if ( rangeStart == null ) { for ( StandardPlural rs : StandardPlural . values ( ) ) { if ( rangeEnd == null ) { for ( StandardPlural re : StandardPlural . values ( ) ) { matrix . setIfNew ( rs , re , result ) ; } } else { explicit [ rangeEnd . ordinal ( ) ] = true ; matrix . setIfNew ( rs , rangeEnd , result ) ; } } } else if ( rangeEnd == null ) { explicit [ rangeStart . ordinal ( ) ] = true ; for ( StandardPlural re : StandardPlural . values ( ) ) { matrix . setIfNew ( rangeStart , re , result ) ; } } else { explicit [ rangeStart . ordinal ( ) ] = true ; explicit [ rangeEnd . ordinal ( ) ] = true ; matrix . setIfNew ( rangeStart , rangeEnd , result ) ; }
public class MavenDependenciesRecorder { /** * Mojos perform different dependency resolution , so we add dependencies for each mojo . */ @ Override public boolean postExecute ( MavenBuildProxy build , MavenProject pom , MojoInfo mojo , BuildListener listener , Throwable error ) { } }
// listener . getLogger ( ) . println ( " [ MavenDependenciesRecorder ] mojo : " + mojo . getClass ( ) + " : " + mojo . getGoal ( ) ) ; // listener . getLogger ( ) . println ( " [ MavenDependenciesRecorder ] dependencies : " + pom . getArtifacts ( ) ) ; recordMavenDependencies ( pom . getArtifacts ( ) ) ; return true ;
public class Ifc4FactoryImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public String convertIfcGridTypeEnumToString ( EDataType eDataType , Object instanceValue ) { } }
return instanceValue == null ? null : instanceValue . toString ( ) ;
public class EventRecord { /** * Initializes an event record or updates it with a subsequent event . * @ param timestamp The timestamp in seconds at which and Event occurred . * @ param versionName The Android versionName of the app when the event occurred . * @ param versionCode The Android versionCode of the app when the event occurred . */ public void update ( double timestamp , String versionName , Integer versionCode ) { } }
last = timestamp ; total ++ ; Long countForVersionName = versionNames . get ( versionName ) ; if ( countForVersionName == null ) { countForVersionName = 0L ; } Long countForVersionCode = versionCodes . get ( versionCode ) ; if ( countForVersionCode == null ) { countForVersionCode = 0L ; } versionNames . put ( versionName , countForVersionName + 1 ) ; versionCodes . put ( versionCode , countForVersionCode + 1 ) ;
public class JobOperations { /** * Disables the specified job . Disabled jobs do not run new tasks , but may be re - enabled later . * @ param jobId The ID of the job . * @ param disableJobOption Specifies what to do with running tasks associated with the job . * @ throws BatchErrorException Exception thrown when an error response is received from the Batch service . * @ throws IOException Exception thrown when there is an error in serialization / deserialization of data sent to / received from the Batch service . */ public void disableJob ( String jobId , DisableJobOption disableJobOption ) throws BatchErrorException , IOException { } }
disableJob ( jobId , disableJobOption , null ) ;
public class SeleniumActionBuilder { /** * Dropdown select single option action . */ public ElementActionBuilder select ( String option ) { } }
DropDownSelectAction action = new DropDownSelectAction ( ) ; action . setOption ( option ) ; action ( action ) ; return new ElementActionBuilder ( action ) ;
public class XMLSerializer { /** * Sets the prefix . * @ param prefix the prefix * @ param namespace the namespace * @ throws IOException Signals that an I / O exception has occurred . */ @ SuppressWarnings ( "unused" ) public void setPrefix ( String prefix , String namespace ) throws IOException { } }
if ( startTagIncomplete ) closeStartTag ( ) ; // assert prefix ! = null ; // assert namespace ! = null ; if ( prefix == null ) { prefix = "" ; } if ( ! namesInterned ) { prefix = prefix . intern ( ) ; // will throw NPE if prefix = = null } else if ( checkNamesInterned ) { checkInterning ( prefix ) ; } else if ( prefix == null ) { throw new IllegalArgumentException ( "prefix must be not null" + getLocation ( ) ) ; } // check that prefix is not duplicated . . . for ( int i = elNamespaceCount [ depth ] ; i < namespaceEnd ; i ++ ) { if ( prefix == namespacePrefix [ i ] ) { throw new IllegalStateException ( "duplicated prefix " + printable ( prefix ) + getLocation ( ) ) ; } } if ( ! namesInterned ) { namespace = namespace . intern ( ) ; } else if ( checkNamesInterned ) { checkInterning ( namespace ) ; } else if ( namespace == null ) { throw new IllegalArgumentException ( "namespace must be not null" + getLocation ( ) ) ; } if ( namespaceEnd >= namespacePrefix . length ) { ensureNamespacesCapacity ( ) ; } namespacePrefix [ namespaceEnd ] = prefix ; namespaceUri [ namespaceEnd ] = namespace ; ++ namespaceEnd ; setPrefixCalled = true ;
public class AbstractPendingLinkingCandidate { /** * Returns the unresolved string representation of the unresolved type parameters of the feature . The simple names of * the type bounds are used . The string representation includes the angle brackets . */ protected String getFeatureTypeParametersAsString ( boolean showBounds ) { } }
List < JvmTypeParameter > typeParameters = getDeclaredTypeParameters ( ) ; if ( ! typeParameters . isEmpty ( ) ) { StringBuilder b = new StringBuilder ( ) ; b . append ( "<" ) ; for ( int i = 0 ; i < typeParameters . size ( ) ; ++ i ) { JvmTypeParameter typeParameter = typeParameters . get ( i ) ; if ( showBounds ) b . append ( getTypeParameterAsString ( typeParameter ) ) ; else b . append ( typeParameter . getSimpleName ( ) ) ; if ( i < typeParameters . size ( ) - 1 ) b . append ( ", " ) ; } b . append ( ">" ) ; return b . toString ( ) ; } return "" ;
public class FileSetType { /** * Returns the set of files . */ public boolean isMatch ( PathImpl path , String prefix ) { } }
String suffix = "" ; String fullPath = path . getPath ( ) ; if ( prefix . length ( ) < fullPath . length ( ) ) { suffix = fullPath . substring ( prefix . length ( ) ) ; } for ( int i = 0 ; i < _excludeList . size ( ) ; i ++ ) { PathPatternType pattern = _excludeList . get ( i ) ; if ( pattern . isMatch ( suffix ) ) return false ; } if ( _includeList == null ) return true ; for ( int i = 0 ; i < _includeList . size ( ) ; i ++ ) { PathPatternType pattern = _includeList . get ( i ) ; if ( pattern . isMatch ( suffix ) ) { return true ; } } return false ;
public class MtasSpanFullyAlignedWithSpans { /** * ( non - Javadoc ) * @ see org . apache . lucene . search . DocIdSetIterator # advance ( int ) */ @ Override public int advance ( int target ) throws IOException { } }
reset ( ) ; if ( docId == NO_MORE_DOCS ) { return docId ; } else if ( target < docId ) { // should not happen docId = NO_MORE_DOCS ; return docId ; } else { // advance 1 int spans1DocId = spans1 . spans . docID ( ) ; int newTarget = target ; if ( spans1DocId < newTarget ) { spans1DocId = spans1 . spans . advance ( target ) ; if ( spans1DocId == NO_MORE_DOCS ) { docId = NO_MORE_DOCS ; return docId ; } newTarget = Math . max ( newTarget , spans1DocId ) ; } int spans2DocId = spans2 . spans . docID ( ) ; // advance 2 if ( spans2DocId < newTarget ) { spans2DocId = spans2 . spans . advance ( newTarget ) ; if ( spans2DocId == NO_MORE_DOCS ) { docId = NO_MORE_DOCS ; return docId ; } } // check equal docId , otherwise next if ( spans1DocId == spans2DocId ) { docId = spans1DocId ; // check match if ( goToNextStartPosition ( ) ) { return docId ; } else { return nextDoc ( ) ; } } else { return nextDoc ( ) ; } }
public class JDBC4PreparedStatement { /** * Sets the designated parameter to the given Java byte value . */ @ Override public void setByte ( int parameterIndex , byte x ) throws SQLException { } }
checkParameterBounds ( parameterIndex ) ; this . parameters [ parameterIndex - 1 ] = x ;
public class ShareActionProviders { /** * Copies a private raw resource content to a publicly readable * file such that the latter can be shared with other applications . */ private void copyPrivateRawResourceToPubliclyAccessibleFile ( ) { } }
InputStream inputStream = null ; FileOutputStream outputStream = null ; try { inputStream = getResources ( ) . openRawResource ( R . raw . robot ) ; outputStream = openFileOutput ( SHARED_FILE_NAME , Context . MODE_WORLD_READABLE | Context . MODE_APPEND ) ; byte [ ] buffer = new byte [ 1024 ] ; int length = 0 ; try { while ( ( length = inputStream . read ( buffer ) ) > 0 ) { outputStream . write ( buffer , 0 , length ) ; } } catch ( IOException ioe ) { /* ignore */ } } catch ( FileNotFoundException fnfe ) { /* ignore */ } finally { try { inputStream . close ( ) ; } catch ( IOException ioe ) { /* ignore */ } try { outputStream . close ( ) ; } catch ( IOException ioe ) { /* ignore */ } }
public class LoganSquare { /** * Serialize an object to a JSON String . * @ param object The object to serialize . */ @ SuppressWarnings ( "unchecked" ) public static < E > String serialize ( E object ) throws IOException { } }
return mapperFor ( ( Class < E > ) object . getClass ( ) ) . serialize ( object ) ;
public class AstUtil { /** * Return true if the expression is a constructor call on any of the named classes , with any number of parameters . * @ param expression - the expression * @ param classNames - the possible List of class names * @ return as described */ public static boolean isConstructorCall ( Expression expression , List < String > classNames ) { } }
return expression instanceof ConstructorCallExpression && classNames . contains ( expression . getType ( ) . getName ( ) ) ;
public class AuthenticationHelper { /** * Create a copy of the specified byte array . * @ param credToken * @ return A copy of the specified byte array , or null if the input was null . */ public static byte [ ] copyCredToken ( byte [ ] credToken ) { } }
if ( credToken == null ) { return null ; } final int LEN = credToken . length ; if ( LEN == 0 ) { return new byte [ LEN ] ; } byte [ ] newCredToken = new byte [ LEN ] ; System . arraycopy ( credToken , 0 , newCredToken , 0 , LEN ) ; return newCredToken ;
public class WeatherForeCastWSImpl { /** * Parser for forecast * @ param feed * @ return */ private List < String > parseRssFeedForeCast ( String feed ) { } }
String [ ] result = feed . split ( "<br />" ) ; List < String > returnList = new ArrayList < String > ( ) ; String [ ] result2 = result [ 2 ] . split ( "<BR />" ) ; returnList . add ( result2 [ 3 ] + "\n" ) ; returnList . add ( result [ 3 ] + "\n" ) ; returnList . add ( result [ 4 ] + "\n" ) ; returnList . add ( result [ 5 ] + "\n" ) ; returnList . add ( result [ 6 ] + "\n" ) ; return returnList ;
public class Context { /** * Determines the correct URI part if two branches are joined . */ private static UriPart unionUriParts ( UriPart a , UriPart b ) { } }
Preconditions . checkArgument ( a != b ) ; if ( a == UriPart . DANGEROUS_SCHEME || b == UriPart . DANGEROUS_SCHEME ) { // Dangerous schemes ( like javascript : ) are poison - - if either side is dangerous , the whole // thing is . return UriPart . DANGEROUS_SCHEME ; } else if ( a == UriPart . FRAGMENT || b == UriPart . FRAGMENT || a == UriPart . UNKNOWN || b == UriPart . UNKNOWN ) { // UNKNOWN means one part is in the # fragment and one is not . This is the case if one is // FRAGMENT and the other is not , or if one of the branches was UNKNOWN to begin with . return UriPart . UNKNOWN ; } else if ( ( a == UriPart . MAYBE_VARIABLE_SCHEME || b == UriPart . MAYBE_VARIABLE_SCHEME ) && a != UriPart . UNKNOWN_PRE_FRAGMENT && b != UriPart . UNKNOWN_PRE_FRAGMENT ) { // This is the case you might see on a URL that starts with a print statement , and one // branch has a slash or ampersand but the other doesn ' t . Re - entering // MAYBE _ VARIABLE _ SCHEME allows us to pretend that the last branch was just part of the // leading print statement , which leaves us in a relatively - unknown state , but no more // unknown had it just been completely opaque . // Good Example 1 : { $ urlWithQuery } { if $ a } & a = { $ a } { / if } { if $ b } & b = { $ b } { / if } // In this example , the first " if " statement has two branches : // - " true " : { $ urlWithQuery } & a = { $ a } looks like a QUERY due to hueristics // - " false " : { $ urlWithQuery } only , which Soy doesn ' t know at compile - time to actually // have a query , and it remains in MAYBE _ VARIABLE _ SCHEME . // Instead of yielding UNKNOWN , this yields MAYBE _ VARIABLE _ SCHEME , which the second // { if $ b } can safely deal with . // Good Example 2 : { $ base } { if $ a } / a { / if } { if $ b } / b { / if } // In this , one branch transitions definitely into an authority or path , but the other // might not . However , we can remain in MAYBE _ VARIABLE _ SCHEME safely . return UriPart . MAYBE_VARIABLE_SCHEME ; } else { // The part is unknown , but we think it ' s before the fragment . In this case , it ' s clearly // ambiguous at compile - time that it ' s not clear what to do . Examples : // / foo / { if $ cond } ? a = { / if } // { $ base } { if $ cond } ? a = { $ a } { else } / b { / if } // { if $ cond } { $ base } { else } / a { if $ cond2 } ? b = 1 { / if } { / if } // Unlike MAYBE _ VARIABLE _ SCHEME , we don ' t need to try to gracefully recover here , because // the template author can easily disambiguate this . return UriPart . UNKNOWN_PRE_FRAGMENT ; }
public class BinTreeUtil { /** * Executes an action on all nodes from a tree , in inorder . For * trees with sharing , the same tree node object will be visited * multiple times . * @ param root Binary tree root . * @ param binTreeNav Binary tree navigator . * @ param action Action to execute on each tree node . */ public static < T > void inOrder ( T root , BinTreeNavigator < T > binTreeNav , Action < T > action ) { } }
for ( Iterator < T > it = inOrder ( root , binTreeNav ) ; it . hasNext ( ) ; ) { T treeVertex = it . next ( ) ; action . action ( treeVertex ) ; }
public class RepositoryApplicationConfiguration { /** * { @ link EventEntityManager } bean . * @ param aware * the tenant aware * @ param entityManager * the entitymanager * @ return a new { @ link EventEntityManager } */ @ Bean @ ConditionalOnMissingBean EventEntityManager eventEntityManager ( final TenantAware aware , final EntityManager entityManager ) { } }
return new JpaEventEntityManager ( aware , entityManager ) ;
public class OptimizedGetImpl { /** * Add a new GetOperation to get . */ public void addOperation ( GetOperation o ) { } }
getKeys ( ) . addAll ( o . getKeys ( ) ) ; pcb . addCallbacks ( o ) ;
public class DataTracker { /** * that they have been replaced by the provided sstables , which must have been performed by an earlier replaceReaders ( ) call */ public void markCompactedSSTablesReplaced ( Collection < SSTableReader > oldSSTables , Collection < SSTableReader > allReplacements , OperationType compactionType ) { } }
removeSSTablesFromTracker ( oldSSTables ) ; releaseReferences ( oldSSTables , false ) ; notifySSTablesChanged ( oldSSTables , allReplacements , compactionType ) ; addNewSSTablesSize ( allReplacements ) ;
public class BruteForceInferencer { /** * Gets this factor as a VarTensor . This will always return a new object . See also safeGetVarTensor ( ) . */ public static VarTensor safeNewVarTensor ( Algebra s , Factor f ) { } }
VarTensor factor ; // Create a VarTensor which the values of this non - explicitly represented factor . factor = new VarTensor ( s , f . getVars ( ) ) ; for ( int c = 0 ; c < factor . size ( ) ; c ++ ) { factor . setValue ( c , s . fromLogProb ( f . getLogUnormalizedScore ( c ) ) ) ; } return factor ;
public class DynamoDBReflector { /** * Returns the setter corresponding to the getter given , or null if no such * setter exists . */ Method getSetter ( Method getter ) { } }
synchronized ( setterCache ) { if ( ! setterCache . containsKey ( getter ) ) { String fieldName = ReflectionUtils . getFieldNameByGetter ( getter , false ) ; String setterName = "set" + fieldName ; Method setter = null ; try { setter = getter . getDeclaringClass ( ) . getMethod ( setterName , getter . getReturnType ( ) ) ; } catch ( NoSuchMethodException e ) { throw new DynamoDBMappingException ( "Expected a public, one-argument method called " + setterName + " on " + getter . getDeclaringClass ( ) , e ) ; } catch ( SecurityException e ) { throw new DynamoDBMappingException ( "No access to public, one-argument method called " + setterName + " on " + getter . getDeclaringClass ( ) , e ) ; } setterCache . put ( getter , setter ) ; } return setterCache . get ( getter ) ; }
public class UppercaseTransliterator { /** * System registration hook . */ static void register ( ) { } }
Transliterator . registerFactory ( _ID , new Transliterator . Factory ( ) { @ Override public Transliterator getInstance ( String ID ) { return new UppercaseTransliterator ( ULocale . US ) ; } } ) ;
public class CDKRGraph { /** * Projects a CDKRGraph bitset on the source graph G1. * @ param set CDKRGraph BitSet to project * @ return The associate BitSet in G1 */ public BitSet projectG1 ( BitSet set ) { } }
BitSet projection = new BitSet ( getFirstGraphSize ( ) ) ; CDKRNode xNode = null ; for ( int x = set . nextSetBit ( 0 ) ; x >= 0 ; x = set . nextSetBit ( x + 1 ) ) { xNode = getGraph ( ) . get ( x ) ; projection . set ( xNode . getRMap ( ) . getId1 ( ) ) ; } return projection ;
public class MultiDraweeHolder { /** * Convenience method to draw all the top - level drawables in this holder . */ public void draw ( Canvas canvas ) { } }
for ( int i = 0 ; i < mHolders . size ( ) ; ++ i ) { Drawable drawable = get ( i ) . getTopLevelDrawable ( ) ; if ( drawable != null ) { drawable . draw ( canvas ) ; } }
public class TypeConverters { /** * Create a { @ link InternalType } from a { @ link TypeInformation } . * < p > Note : Information may be lost . For example , after Pojo is converted to InternalType , * we no longer know that it is a Pojo and only think it is a Row . * < p > Eg : * { @ link BasicTypeInfo # STRING _ TYPE _ INFO } = > { @ link InternalTypes # STRING } . * { @ link BasicTypeInfo # BIG _ DEC _ TYPE _ INFO } = > { @ link DecimalType } . * { @ link RowTypeInfo } = > { @ link RowType } . * { @ link PojoTypeInfo } ( CompositeType ) = > { @ link RowType } . * { @ link TupleTypeInfo } ( CompositeType ) = > { @ link RowType } . */ public static InternalType createInternalTypeFromTypeInfo ( TypeInformation typeInfo ) { } }
InternalType type = TYPE_INFO_TO_INTERNAL_TYPE . get ( typeInfo ) ; if ( type != null ) { return type ; } if ( typeInfo instanceof CompositeType ) { CompositeType compositeType = ( CompositeType ) typeInfo ; return InternalTypes . createRowType ( Stream . iterate ( 0 , x -> x + 1 ) . limit ( compositeType . getArity ( ) ) . map ( ( Function < Integer , TypeInformation > ) compositeType :: getTypeAt ) . map ( TypeConverters :: createInternalTypeFromTypeInfo ) . toArray ( InternalType [ ] :: new ) , compositeType . getFieldNames ( ) ) ; } else if ( typeInfo instanceof DecimalTypeInfo ) { DecimalTypeInfo decimalType = ( DecimalTypeInfo ) typeInfo ; return InternalTypes . createDecimalType ( decimalType . precision ( ) , decimalType . scale ( ) ) ; } else if ( typeInfo instanceof PrimitiveArrayTypeInfo ) { PrimitiveArrayTypeInfo arrayType = ( PrimitiveArrayTypeInfo ) typeInfo ; return InternalTypes . createArrayType ( createInternalTypeFromTypeInfo ( arrayType . getComponentType ( ) ) ) ; } else if ( typeInfo instanceof BasicArrayTypeInfo ) { BasicArrayTypeInfo arrayType = ( BasicArrayTypeInfo ) typeInfo ; return InternalTypes . createArrayType ( createInternalTypeFromTypeInfo ( arrayType . getComponentInfo ( ) ) ) ; } else if ( typeInfo instanceof ObjectArrayTypeInfo ) { ObjectArrayTypeInfo arrayType = ( ObjectArrayTypeInfo ) typeInfo ; return InternalTypes . createArrayType ( createInternalTypeFromTypeInfo ( arrayType . getComponentInfo ( ) ) ) ; } else if ( typeInfo instanceof MapTypeInfo ) { MapTypeInfo mapType = ( MapTypeInfo ) typeInfo ; return InternalTypes . createMapType ( createInternalTypeFromTypeInfo ( mapType . getKeyTypeInfo ( ) ) , createInternalTypeFromTypeInfo ( mapType . getValueTypeInfo ( ) ) ) ; } else if ( typeInfo instanceof BinaryMapTypeInfo ) { BinaryMapTypeInfo mapType = ( BinaryMapTypeInfo ) typeInfo ; return InternalTypes . createMapType ( mapType . getKeyType ( ) , mapType . getValueType ( ) ) ; } else if ( typeInfo instanceof BinaryArrayTypeInfo ) { BinaryArrayTypeInfo arrayType = ( BinaryArrayTypeInfo ) typeInfo ; return InternalTypes . createArrayType ( arrayType . getElementType ( ) ) ; } else if ( typeInfo instanceof BigDecimalTypeInfo ) { BigDecimalTypeInfo decimalType = ( BigDecimalTypeInfo ) typeInfo ; return new DecimalType ( decimalType . precision ( ) , decimalType . scale ( ) ) ; } else { return InternalTypes . createGenericType ( typeInfo ) ; }
public class CmsSubscriptionManager { /** * Sets the maximum number of visited resources to store per user . < p > * @ param maxVisitedCount the maximum number of visited resources to store per user */ public void setMaxVisitedCount ( String maxVisitedCount ) { } }
if ( m_frozen ) { throw new CmsRuntimeException ( Messages . get ( ) . container ( Messages . ERR_CONFIG_SUBSCRIPTIONMANAGER_FROZEN_0 ) ) ; } try { int intValue = Integer . parseInt ( maxVisitedCount ) ; m_maxVisitedCount = ( intValue > 0 ) ? intValue : DEFAULT_MAX_VISITEDCOUNT ; } catch ( NumberFormatException e ) { // use default value m_maxVisitedCount = DEFAULT_MAX_VISITEDCOUNT ; }
public class CommerceCurrencyServiceBaseImpl { /** * Sets the commerce currency local service . * @ param commerceCurrencyLocalService the commerce currency local service */ public void setCommerceCurrencyLocalService ( com . liferay . commerce . currency . service . CommerceCurrencyLocalService commerceCurrencyLocalService ) { } }
this . commerceCurrencyLocalService = commerceCurrencyLocalService ;
public class ModificationDate { /** * Finds the most recent modification date from a { @ link ModificationDateProvider } and multiple additional resources * @ param dateProviders Multiple modification date providers * @ return the most recent modification date ( or null if none of the objects has a modification date ) */ public static @ Nullable Date mostRecent ( @ NotNull ModificationDateProvider @ NotNull . . . dateProviders ) { } }
Date [ ] dates = new Date [ dateProviders . length ] ; for ( int i = 0 ; i < dateProviders . length ; i ++ ) { dates [ i ] = dateProviders [ i ] . getModificationDate ( ) ; } return mostRecent ( dates ) ;
public class RSMonitorDecorator { /** * set timing * @ param monitor * @ param t0 * @ param mtc */ protected void setTiming ( boolean monitor , long t0 , MessageToClient mtc ) { } }
if ( monitor ) { long t1 = System . currentTimeMillis ( ) ; mtc . setTime ( t1 - t0 ) ; }
public class MatchAllDocsQuery { /** * { @ inheritDoc } */ public QueryHits execute ( JcrIndexSearcher searcher , SessionImpl session , Sort sort ) throws IOException { } }
if ( sort . getSort ( ) . length == 0 ) { try { return new NodeTraversingQueryHits ( session . getRootNode ( ) , true , indexConfig ) ; } catch ( RepositoryException e ) { throw Util . createIOException ( e ) ; } } else { return null ; }
public class BaseXMLBuilder { /** * Serialize the XML document to the given writer using the default * { @ link TransformerFactory } and { @ link Transformer } classes . If output * options are provided , these options are provided to the * { @ link Transformer } serializer . * @ param writer * a writer to which the serialized document is written . * @ param outputProperties * settings for the { @ link Transformer } serializer . This parameter may be * null or an empty Properties object , in which case the default output * properties will be applied . * @ throws TransformerException */ public void toWriter ( Writer writer , Properties outputProperties ) throws TransformerException { } }
this . toWriter ( true , writer , outputProperties ) ;
public class MethodParameter { /** * Return the nested generic type of the method / constructor parameter . * @ return the parameter type ( never { @ code null } ) * @ see # getNestingLevel ( ) */ public Type getNestedGenericParameterType ( ) { } }
if ( this . nestingLevel > 1 ) { Type type = getGenericParameterType ( ) ; for ( int i = 2 ; i <= this . nestingLevel ; i ++ ) { if ( type instanceof ParameterizedType ) { Type [ ] args = ( ( ParameterizedType ) type ) . getActualTypeArguments ( ) ; Integer index = getTypeIndexForLevel ( i ) ; type = args [ index != null ? index : args . length - 1 ] ; } } return type ; } else { return getGenericParameterType ( ) ; }
public class PoolsImpl { /** * Gets basic properties of a pool . * @ param poolId The ID of the pool to get . * @ param poolExistsOptions Additional parameters for the operation * @ throws IllegalArgumentException thrown if parameters fail the validation * @ throws BatchErrorException thrown if the request is rejected by server * @ throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @ return the boolean object if successful . */ public boolean exists ( String poolId , PoolExistsOptions poolExistsOptions ) { } }
return existsWithServiceResponseAsync ( poolId , poolExistsOptions ) . toBlocking ( ) . single ( ) . body ( ) ;
public class CmsDefaultUsers { /** * Checks if a given group name is the name of one of the OpenCms default groups . < p > * @ param groupName the group name to check * @ return < code > true < / code > if group name is one of OpenCms default groups , < code > false < / code > if it is not * or if < code > groupName < / code > is < code > null < / code > or an empty string ( no trim ) * @ see # getGroupAdministrators ( ) * @ see # getGroupUsers ( ) * @ see # getGroupGuests ( ) */ public boolean isDefaultGroup ( String groupName ) { } }
if ( CmsStringUtil . isEmptyOrWhitespaceOnly ( groupName ) ) { return false ; } // first check without ou prefix , to stay backwards compatible boolean isDefault = m_groupAdministrators . equals ( groupName ) ; isDefault = isDefault || m_groupGuests . equals ( groupName ) ; isDefault = isDefault || m_groupUsers . equals ( groupName ) ; // now check with ou prefix isDefault = isDefault || groupName . endsWith ( CmsOrganizationalUnit . SEPARATOR + m_groupAdministrators ) ; isDefault = isDefault || groupName . endsWith ( CmsOrganizationalUnit . SEPARATOR + m_groupGuests ) ; isDefault = isDefault || groupName . endsWith ( CmsOrganizationalUnit . SEPARATOR + m_groupUsers ) ; return isDefault ;