signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class ExampleTaggableEntities { @ MemberOrder ( sequence = "2" ) public ExampleTaggableEntity create ( final @ ParameterLayout ( named = "Name" ) String name , final @ ParameterLayout ( named = "Brand" ) String brand , final @ ParameterLayout ( named = "Sector" ) String sector ) { } }
final ExampleTaggableEntity obj = container . newTransientInstance ( ExampleTaggableEntity . class ) ; obj . setName ( name ) ; obj . setBrand ( brand ) ; obj . setSector ( sector ) ; container . persistIfNotAlready ( obj ) ; return obj ;
public class CreateResolverRuleRequest { /** * The IPs that you want Resolver to forward DNS queries to . You can specify only IPv4 addresses . Separate IP * addresses with a comma . * @ param targetIps * The IPs that you want Resolver to forward DNS queries to . You can specify only IPv4 addresses . Separate IP * addresses with a comma . */ public void setTargetIps ( java . util . Collection < TargetAddress > targetIps ) { } }
if ( targetIps == null ) { this . targetIps = null ; return ; } this . targetIps = new java . util . ArrayList < TargetAddress > ( targetIps ) ;
public class BasePartial { /** * Sets the values of all fields . * In version 2.0 and later , this method copies the array into the original . * This is because the instance variable has been changed to be final to satisfy the Java Memory Model . * This only impacts subclasses that are mutable . * @ param values the array of values */ protected void setValues ( int [ ] values ) { } }
getChronology ( ) . validate ( this , values ) ; System . arraycopy ( values , 0 , iValues , 0 , iValues . length ) ;
public class InMemoryLinkedDataStore { /** * ( non - Javadoc ) * @ see net . timewalker . ffmq4 . utils . store . LinkedObjectStore # retrieve ( int ) */ @ Override public Object retrieve ( int handle ) throws DataStoreException { } }
if ( SAFE_MODE ) checkHandle ( handle ) ; return data [ handle ] ;
public class HadoopStoreBuilder { /** * Persists a * . metadata file to a specific directory in HDFS . * @ param directoryPath where to write the metadata file . * @ param outputFs { @ link org . apache . hadoop . fs . FileSystem } where to write the file * @ param metadataFileName name of the file ( including extension ) * @ param metadata { @ link voldemort . store . readonly . ReadOnlyStorageMetadata } to persist on HDFS * @ throws IOException if the FileSystem operations fail */ private void writeMetadataFile ( Path directoryPath , FileSystem outputFs , String metadataFileName , ReadOnlyStorageMetadata metadata ) throws IOException { } }
Path metadataPath = new Path ( directoryPath , metadataFileName ) ; FSDataOutputStream metadataStream = outputFs . create ( metadataPath ) ; outputFs . setPermission ( metadataPath , new FsPermission ( HADOOP_FILE_PERMISSION ) ) ; metadataStream . write ( metadata . toJsonString ( ) . getBytes ( ) ) ; metadataStream . flush ( ) ; metadataStream . close ( ) ;
public class PasswordUtil { /** * Encode the provided string with the specified algorithm and the crypto key * If the decoded _ string is already encoded , the string will be decoded and then encoded by using the specified crypto algorithm . * Use this method for encoding the string by using the AES encryption with the specific crypto key . * Note that this method is only avaiable for the Liberty profile . * @ param decoded _ string the string to be encoded . * @ param crypto _ algorithm the algorithm to be used for encoding . * @ param crypto _ key the key for the encryption . This value is only valid for aes algorithm . * @ return The encoded string . * @ throws InvalidPasswordEncodingException If the decoded _ string is null or invalid . Or the encoded _ string is null . * @ throws UnsupportedCryptoAlgorithmException If the algorithm is not supported . */ public static String encode ( String decoded_string , String crypto_algorithm , String crypto_key ) throws InvalidPasswordEncodingException , UnsupportedCryptoAlgorithmException { } }
HashMap < String , String > props = new HashMap < String , String > ( ) ; if ( crypto_key != null ) { props . put ( PROPERTY_CRYPTO_KEY , crypto_key ) ; } return encode ( decoded_string , crypto_algorithm , props ) ;
public class SteeringBehavior { /** * If this behavior is enabled calculates the steering acceleration and writes it to the given steering output . If it is * disabled the steering output is set to zero . * @ param steering the steering acceleration to be calculated . * @ return the calculated steering acceleration for chaining . */ public SteeringAcceleration < T > calculateSteering ( SteeringAcceleration < T > steering ) { } }
return isEnabled ( ) ? calculateRealSteering ( steering ) : steering . setZero ( ) ;
public class JNvrtc { /** * Compiles the given program . See the * < a href = " http : / / docs . nvidia . com / cuda / nvrtc / index . html # group _ _ options " * target = " _ blank " > Supported Compile Options ( external site ) < / a > * @ param prog CUDA Runtime Compilation program . * @ param numOptions The number of options * @ param options The options * @ return An error code */ public static int nvrtcCompileProgram ( nvrtcProgram prog , int numOptions , String options [ ] ) { } }
return checkResult ( nvrtcCompileProgramNative ( prog , numOptions , options ) ) ;
public class ResponseWritePerformer { protected PrintWriter createPrintWriter ( HttpServletResponse response , String encoding ) throws IOException { } }
return newPrintWriter ( createOutputStreamWriter ( response , encoding ) ) ;
public class ListEndpointsResult { /** * An array or endpoint objects . * @ param endpoints * An array or endpoint objects . */ public void setEndpoints ( java . util . Collection < EndpointSummary > endpoints ) { } }
if ( endpoints == null ) { this . endpoints = null ; return ; } this . endpoints = new java . util . ArrayList < EndpointSummary > ( endpoints ) ;
public class CommerceNotificationTemplatePersistenceImpl { /** * Returns an ordered range of all the commerce notification templates that the user has permissions to view where groupId = & # 63 ; and type = & # 63 ; and enabled = & # 63 ; . * Useful when paginating results . Returns a maximum of < code > end - start < / code > instances . < code > start < / code > and < code > end < / code > are not primary keys , they are indexes in the result set . Thus , < code > 0 < / code > refers to the first result in the set . Setting both < code > start < / code > and < code > end < / code > to { @ link QueryUtil # ALL _ POS } will return the full result set . If < code > orderByComparator < / code > is specified , then the query will include the given ORDER BY logic . If < code > orderByComparator < / code > is absent and pagination is required ( < code > start < / code > and < code > end < / code > are not { @ link QueryUtil # ALL _ POS } ) , then the query will include the default ORDER BY logic from { @ link CommerceNotificationTemplateModelImpl } . If both < code > orderByComparator < / code > and pagination are absent , for performance reasons , the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order . * @ param groupId the group ID * @ param type the type * @ param enabled the enabled * @ param start the lower bound of the range of commerce notification templates * @ param end the upper bound of the range of commerce notification templates ( not inclusive ) * @ param orderByComparator the comparator to order the results by ( optionally < code > null < / code > ) * @ return the ordered range of matching commerce notification templates that the user has permission to view */ @ Override public List < CommerceNotificationTemplate > filterFindByG_T_E ( long groupId , String type , boolean enabled , int start , int end , OrderByComparator < CommerceNotificationTemplate > orderByComparator ) { } }
if ( ! InlineSQLHelperUtil . isEnabled ( groupId ) ) { return findByG_T_E ( groupId , type , enabled , start , end , orderByComparator ) ; } StringBundler query = null ; if ( orderByComparator != null ) { query = new StringBundler ( 5 + ( orderByComparator . getOrderByFields ( ) . length * 2 ) ) ; } else { query = new StringBundler ( 6 ) ; } if ( getDB ( ) . isSupportsInlineDistinct ( ) ) { query . append ( _FILTER_SQL_SELECT_COMMERCENOTIFICATIONTEMPLATE_WHERE ) ; } else { query . append ( _FILTER_SQL_SELECT_COMMERCENOTIFICATIONTEMPLATE_NO_INLINE_DISTINCT_WHERE_1 ) ; } query . append ( _FINDER_COLUMN_G_T_E_GROUPID_2 ) ; boolean bindType = false ; if ( type == null ) { query . append ( _FINDER_COLUMN_G_T_E_TYPE_1_SQL ) ; } else if ( type . equals ( "" ) ) { query . append ( _FINDER_COLUMN_G_T_E_TYPE_3_SQL ) ; } else { bindType = true ; query . append ( _FINDER_COLUMN_G_T_E_TYPE_2_SQL ) ; } query . append ( _FINDER_COLUMN_G_T_E_ENABLED_2 ) ; if ( ! getDB ( ) . isSupportsInlineDistinct ( ) ) { query . append ( _FILTER_SQL_SELECT_COMMERCENOTIFICATIONTEMPLATE_NO_INLINE_DISTINCT_WHERE_2 ) ; } if ( orderByComparator != null ) { if ( getDB ( ) . isSupportsInlineDistinct ( ) ) { appendOrderByComparator ( query , _ORDER_BY_ENTITY_ALIAS , orderByComparator , true ) ; } else { appendOrderByComparator ( query , _ORDER_BY_ENTITY_TABLE , orderByComparator , true ) ; } } else { if ( getDB ( ) . isSupportsInlineDistinct ( ) ) { query . append ( CommerceNotificationTemplateModelImpl . ORDER_BY_JPQL ) ; } else { query . append ( CommerceNotificationTemplateModelImpl . ORDER_BY_SQL ) ; } } String sql = InlineSQLHelperUtil . replacePermissionCheck ( query . toString ( ) , CommerceNotificationTemplate . class . getName ( ) , _FILTER_ENTITY_TABLE_FILTER_PK_COLUMN , groupId ) ; Session session = null ; try { session = openSession ( ) ; SQLQuery q = session . createSynchronizedSQLQuery ( sql ) ; if ( getDB ( ) . isSupportsInlineDistinct ( ) ) { q . addEntity ( _FILTER_ENTITY_ALIAS , CommerceNotificationTemplateImpl . class ) ; } else { q . addEntity ( _FILTER_ENTITY_TABLE , CommerceNotificationTemplateImpl . class ) ; } QueryPos qPos = QueryPos . getInstance ( q ) ; qPos . add ( groupId ) ; if ( bindType ) { qPos . add ( type ) ; } qPos . add ( enabled ) ; return ( List < CommerceNotificationTemplate > ) QueryUtil . list ( q , getDialect ( ) , start , end ) ; } catch ( Exception e ) { throw processException ( e ) ; } finally { closeSession ( session ) ; }
public class Period { /** * Set the unit ' s internal value , converting from float to int . */ private Period setTimeUnitValue ( TimeUnit unit , float value ) { } }
if ( value < 0 ) { throw new IllegalArgumentException ( "value: " + value ) ; } return setTimeUnitInternalValue ( unit , ( int ) ( value * 1000 ) + 1 ) ;
public class EditText { /** * < p > Converts the selected item from the drop down list into a sequence * of character that can be used in the edit box . < / p > * @ param selectedItem the item selected by the user for completion * @ return a sequence of characters representing the selected suggestion */ protected CharSequence convertSelectionToString ( Object selectedItem ) { } }
switch ( mAutoCompleteMode ) { case AUTOCOMPLETE_MODE_SINGLE : return ( ( InternalAutoCompleteTextView ) mInputView ) . superConvertSelectionToString ( selectedItem ) ; case AUTOCOMPLETE_MODE_MULTI : return ( ( InternalMultiAutoCompleteTextView ) mInputView ) . superConvertSelectionToString ( selectedItem ) ; default : return null ; }
public class ScriptMarshaller { /** * Marshall the given parameter object . */ public void marshall ( Script script , ProtocolMarshaller protocolMarshaller ) { } }
if ( script == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( script . getScriptId ( ) , SCRIPTID_BINDING ) ; protocolMarshaller . marshall ( script . getName ( ) , NAME_BINDING ) ; protocolMarshaller . marshall ( script . getVersion ( ) , VERSION_BINDING ) ; protocolMarshaller . marshall ( script . getSizeOnDisk ( ) , SIZEONDISK_BINDING ) ; protocolMarshaller . marshall ( script . getCreationTime ( ) , CREATIONTIME_BINDING ) ; protocolMarshaller . marshall ( script . getStorageLocation ( ) , STORAGELOCATION_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class ActiveConnectTask { /** * Override this to implement authentication */ protected SocketBox openSocket ( ) throws Exception { } }
SocketBox sBox = new SimpleSocketBox ( ) ; SocketFactory factory = SocketFactory . getDefault ( ) ; Socket mySocket = factory . createSocket ( this . hostPort . getHost ( ) , this . hostPort . getPort ( ) ) ; sBox . setSocket ( mySocket ) ; return sBox ;
public class Engine { /** * Configures the engine with the given operators * @ param conjunction is a TNorm registered in the TNormFactory * @ param disjunction is an SNorm registered in the SNormFactory * @ param implication is an TNorm registered in the TNormFactory * @ param aggregation is an SNorm registered in the SNormFactory * @ param defuzzifier is a defuzzifier registered in the DefuzzifierFactory * @ param activation is an activation method registered in the * ActivationFactory */ public void configure ( String conjunction , String disjunction , String implication , String aggregation , String defuzzifier , String activation ) { } }
TNormFactory tnormFactory = FactoryManager . instance ( ) . tnorm ( ) ; SNormFactory snormFactory = FactoryManager . instance ( ) . snorm ( ) ; TNorm conjunctionObject = tnormFactory . constructObject ( conjunction ) ; SNorm disjunctionObject = snormFactory . constructObject ( disjunction ) ; TNorm implicationObject = tnormFactory . constructObject ( implication ) ; SNorm aggregationObject = snormFactory . constructObject ( aggregation ) ; Defuzzifier defuzzifierObject = FactoryManager . instance ( ) . defuzzifier ( ) . constructObject ( defuzzifier ) ; Activation activationObject = FactoryManager . instance ( ) . activation ( ) . constructObject ( activation ) ; configure ( conjunctionObject , disjunctionObject , implicationObject , aggregationObject , defuzzifierObject , activationObject ) ;
public class Parse { /** * Designates that the specified punctuation follows this parse . * @ param punct * The punctuation set . */ public void addNextPunctuation ( final Parse punct ) { } }
if ( this . nextPunctSet == null ) { this . nextPunctSet = new TreeSet < Parse > ( ) ; } this . nextPunctSet . add ( punct ) ;
public class BladeTemplate { /** * in this case it is obtained by calling recursively the methods on the last obtained object */ private void appendParamValue ( StringBuilder param , StringBuilder result ) { } }
if ( param == null ) throw UncheckedTemplateException . invalidArgumentName ( param ) ; // Object name is the parameter that should be found in the map . // If it ' s followed by points , the points remain in the " param " buffer . final String objectName = takeUntilDotOrEnd ( param ) ; final Object objectValue = arguments . get ( objectName ) ; Object toAppend ; if ( param . length ( ) != 0 ) { // If this is a chain object . method1 . method2 . method3 // we recurse toAppend = valueInChain ( objectValue , param ) ; } else { // We evaluate if the obejct is an array // If it ' s an array we print it nicely toAppend = evaluateIfArray ( objectValue ) ; } if ( null != toAppend ) { result . append ( toAppend ) ; }
public class DateCaster { /** * converts a Object to a DateTime Object ( Advanced but slower ) * @ param str String to Convert * @ param timezone * @ return Date Time Object * @ throws PageException */ public static DateTime toDateAdvanced ( String str , TimeZone timezone ) throws PageException { } }
DateTime dt = toDateAdvanced ( str , timezone , null ) ; if ( dt == null ) throw new ExpressionException ( "can't cast [" + str + "] to date value" ) ; return dt ;
public class CPMeasurementUnitPersistenceImpl { /** * Returns the first cp measurement unit in the ordered set where groupId = & # 63 ; and primary = & # 63 ; and type = & # 63 ; . * @ param groupId the group ID * @ param primary the primary * @ param type the type * @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > ) * @ return the first matching cp measurement unit * @ throws NoSuchCPMeasurementUnitException if a matching cp measurement unit could not be found */ @ Override public CPMeasurementUnit findByG_P_T_First ( long groupId , boolean primary , int type , OrderByComparator < CPMeasurementUnit > orderByComparator ) throws NoSuchCPMeasurementUnitException { } }
CPMeasurementUnit cpMeasurementUnit = fetchByG_P_T_First ( groupId , primary , type , orderByComparator ) ; if ( cpMeasurementUnit != null ) { return cpMeasurementUnit ; } StringBundler msg = new StringBundler ( 8 ) ; msg . append ( _NO_SUCH_ENTITY_WITH_KEY ) ; msg . append ( "groupId=" ) ; msg . append ( groupId ) ; msg . append ( ", primary=" ) ; msg . append ( primary ) ; msg . append ( ", type=" ) ; msg . append ( type ) ; msg . append ( "}" ) ; throw new NoSuchCPMeasurementUnitException ( msg . toString ( ) ) ;
public class CuckooFilter { /** * Puts an element into this { @ code CuckooFilter } . Ensures that subsequent * invocations of { @ link # mightContain ( Object ) } with the same element will * always return { @ code true } . * Note that the filter should be considered full after insertion failure . * Further inserts < i > may < / i > fail , although deleting items can also make * the filter usable again . * Also note that inserting the same item more than 8 times will cause an * insertion failure . * @ param item * item to insert into the filter * @ return { @ code true } if the cuckoo filter inserts this item successfully . * Returns { @ code false } if insertion failed . */ public boolean put ( T item ) { } }
BucketAndTag pos = hasher . generate ( item ) ; long curTag = pos . tag ; long curIndex = pos . index ; long altIndex = hasher . altIndex ( curIndex , curTag ) ; bucketLocker . lockBucketsWrite ( curIndex , altIndex ) ; try { if ( table . insertToBucket ( curIndex , curTag ) || table . insertToBucket ( altIndex , curTag ) ) { count . incrementAndGet ( ) ; return true ; } } finally { bucketLocker . unlockBucketsWrite ( curIndex , altIndex ) ; } // don ' t do insertion loop if victim slot is already filled long victimLockStamp = writeLockVictimIfClear ( ) ; if ( victimLockStamp == 0L ) // victim was set . . . can ' t insert return false ; try { // fill victim slot and run fun insert method below victim . setTag ( curTag ) ; victim . setI1 ( curIndex ) ; victim . setI2 ( altIndex ) ; hasVictim = true ; for ( int i = 0 ; i <= INSERT_ATTEMPTS ; i ++ ) { if ( trySwapVictimIntoEmptySpot ( ) ) break ; } /* * count is incremented here because we should never increase count * when not locking buckets or victim . Reason is because otherwise * count may be inconsistent across threads when doing operations * that lock the whole table like hashcode ( ) or equals ( ) */ count . getAndIncrement ( ) ; } finally { victimLock . unlock ( victimLockStamp ) ; } // if we get here , we either managed to insert victim using retries or // it ' s in victim slot from another thread . Either way , it ' s in the // table . return true ;
public class Protocols { /** * Return a new , empty single - use { @ code Protocol . Builder } with * the given name . * @ param name not null . * @ param < F > the type of the returned Builder * @ return an empty { @ code Protocol . Builder } , never null . */ public static < F > Protocol . Builder < F > builder ( final String name ) { } }
return new ProtocolImpl < F > ( name ) ;
public class Tokenizer { /** * Gets the next token from a tokenizer and decodes it as hex . * @ return The byte array containing the decoded string . * @ throws TextParseException The input was invalid . * @ throws IOException An I / O error occurred . */ public byte [ ] getHexString ( ) throws IOException { } }
String next = _getIdentifier ( "a hex string" ) ; byte [ ] array = base16 . fromString ( next ) ; if ( array == null ) throw exception ( "invalid hex encoding" ) ; return array ;
public class OperationBuilder { /** * Associate a file with the operation . This will create a { @ code FileInputStream } * and add it as attachment . * @ param file the file * @ return the operation builder */ public OperationBuilder addFileAsAttachment ( final File file ) { } }
Assert . checkNotNullParam ( "file" , file ) ; try { FileStreamEntry entry = new FileStreamEntry ( file ) ; if ( inputStreams == null ) { inputStreams = new ArrayList < InputStream > ( ) ; } inputStreams . add ( entry ) ; } catch ( IOException e ) { throw new RuntimeException ( e ) ; } return this ;
public class CommerceAvailabilityEstimateLocalServiceWrapper { /** * Returns a range of all the commerce availability estimates . * Useful when paginating results . Returns a maximum of < code > end - start < / code > instances . < code > start < / code > and < code > end < / code > are not primary keys , they are indexes in the result set . Thus , < code > 0 < / code > refers to the first result in the set . Setting both < code > start < / code > and < code > end < / code > to { @ link com . liferay . portal . kernel . dao . orm . QueryUtil # ALL _ POS } will return the full result set . If < code > orderByComparator < / code > is specified , then the query will include the given ORDER BY logic . If < code > orderByComparator < / code > is absent and pagination is required ( < code > start < / code > and < code > end < / code > are not { @ link com . liferay . portal . kernel . dao . orm . QueryUtil # ALL _ POS } ) , then the query will include the default ORDER BY logic from { @ link com . liferay . commerce . model . impl . CommerceAvailabilityEstimateModelImpl } . If both < code > orderByComparator < / code > and pagination are absent , for performance reasons , the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order . * @ param start the lower bound of the range of commerce availability estimates * @ param end the upper bound of the range of commerce availability estimates ( not inclusive ) * @ return the range of commerce availability estimates */ @ Override public java . util . List < com . liferay . commerce . model . CommerceAvailabilityEstimate > getCommerceAvailabilityEstimates ( int start , int end ) { } }
return _commerceAvailabilityEstimateLocalService . getCommerceAvailabilityEstimates ( start , end ) ;
public class DataPointParser { /** * Takes a string that is a delimited list of values all of a particular type ( integer , long , * float , double , or string ) and parses them into a List of DataPoints all with the same * timestamp . * @ param points Delimited string containing points to be parsed . * @ param splitRegex Delimiter to split the string on ( e . g . , a comma ( , ) for csv ) . * @ param type Data type of the points , either Integer / Long , Float / Double , or String . * @ param ts The timestamp to apply to all the points . * @ return A DataPoint List of all parseable points . */ public static List < DataPoint > parse ( String points , String splitRegex , Class < ? > type , long ts ) { } }
String [ ] items = points . split ( splitRegex ) ; List < DataPoint > ret = new ArrayList < DataPoint > ( ) ; for ( String i : items ) { if ( i . length ( ) == 0 ) { continue ; } if ( type == Long . class || type == Integer . class ) { ret . add ( new DataPoint ( ts , Long . parseLong ( i ) ) ) ; } else if ( type == Float . class || type == Double . class ) { ret . add ( new DataPoint ( ts , Double . parseDouble ( i ) ) ) ; } else if ( type == String . class ) { ret . add ( new DataPoint ( ts , i ) ) ; } } return ret ;
public class DeleteServiceActionRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( DeleteServiceActionRequest deleteServiceActionRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( deleteServiceActionRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( deleteServiceActionRequest . getId ( ) , ID_BINDING ) ; protocolMarshaller . marshall ( deleteServiceActionRequest . getAcceptLanguage ( ) , ACCEPTLANGUAGE_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class SqsManager { /** * Given a list of raw SQS message parse each of them , and return a list of CloudTrailSource . * @ param sqsMessages list of SQS messages . * @ return list of CloudTrailSource . */ public List < CloudTrailSource > parseMessage ( List < Message > sqsMessages ) { } }
List < CloudTrailSource > sources = new ArrayList < > ( ) ; for ( Message sqsMessage : sqsMessages ) { boolean parseMessageSuccess = false ; ProgressStatus parseMessageStatus = new ProgressStatus ( ProgressState . parseMessage , new BasicParseMessageInfo ( sqsMessage , parseMessageSuccess ) ) ; final Object reportObject = progressReporter . reportStart ( parseMessageStatus ) ; CloudTrailSource ctSource = null ; try { ctSource = sourceSerializer . getSource ( sqsMessage ) ; if ( containsCloudTrailLogs ( ctSource ) ) { sources . add ( ctSource ) ; parseMessageSuccess = true ; } } catch ( Exception e ) { LibraryUtils . handleException ( exceptionHandler , parseMessageStatus , e , "Failed to parse sqs message." ) ; } finally { if ( containsCloudTrailValidationMessage ( ctSource ) || shouldDeleteMessageUponFailure ( parseMessageSuccess ) ) { deleteMessageFromQueue ( sqsMessage , new ProgressStatus ( ProgressState . deleteMessage , new BasicParseMessageInfo ( sqsMessage , false ) ) ) ; } LibraryUtils . endToProcess ( progressReporter , parseMessageSuccess , parseMessageStatus , reportObject ) ; } } return sources ;
public class BasicFilter { /** * make sure that state is stored in the session , * delete it from session - should be used only once * @ param session * @ param state * @ throws Exception */ private StateData validateState ( HttpSession session , String state ) throws Exception { } }
if ( StringUtils . isNotEmpty ( state ) ) { StateData stateDataInSession = removeStateFromSession ( session , state ) ; if ( stateDataInSession != null ) { return stateDataInSession ; } } throw new Exception ( FAILED_TO_VALIDATE_MESSAGE + "could not validate state" ) ;
public class ArrayEquals { /** * Suggests replacing with Arrays . equals ( a , b ) . Also adds the necessary import statement for * java . util . Arrays . */ @ Override public Description matchMethodInvocation ( MethodInvocationTree t , VisitorState state ) { } }
String arg1 ; String arg2 ; if ( instanceEqualsMatcher . matches ( t , state ) ) { arg1 = state . getSourceForNode ( ( ( JCFieldAccess ) t . getMethodSelect ( ) ) . getExpression ( ) ) ; arg2 = state . getSourceForNode ( t . getArguments ( ) . get ( 0 ) ) ; } else if ( staticEqualsMatcher . matches ( t , state ) ) { arg1 = state . getSourceForNode ( t . getArguments ( ) . get ( 0 ) ) ; arg2 = state . getSourceForNode ( t . getArguments ( ) . get ( 1 ) ) ; } else { return NO_MATCH ; } Fix fix = SuggestedFix . builder ( ) . replace ( t , "Arrays.equals(" + arg1 + ", " + arg2 + ")" ) . addImport ( "java.util.Arrays" ) . build ( ) ; return describeMatch ( t , fix ) ;
public class RequestPathParamAnalyzer { protected String urlDecode ( String value ) { } }
final String encoding = requestManager . getCharacterEncoding ( ) . get ( ) ; // should be already set try { return URLDecoder . decode ( value , encoding ) ; } catch ( UnsupportedEncodingException e ) { String msg = "Unsupported encoding: value=" + value + ", encoding=" + encoding ; throw new IllegalStateException ( msg , e ) ; }
public class SourceModel { /** * Package output */ public void writePackage ( OutputStream output , String group , String name , String version ) throws IOException , RepositoryException { } }
String root = "jcr_root" ; ZipOutputStream zipStream = new ZipOutputStream ( output ) ; writeProperties ( zipStream , group , name , version ) ; writeFilter ( zipStream ) ; writeParents ( zipStream , root , resource . getParent ( ) ) ; writeZip ( zipStream , root , true ) ; zipStream . flush ( ) ; zipStream . close ( ) ;
public class RuleBasedNumberFormat { /** * Adjust capitalization of formatted result for display context */ private String adjustForContext ( String result ) { } }
if ( result != null && result . length ( ) > 0 && UCharacter . isLowerCase ( result . codePointAt ( 0 ) ) ) { DisplayContext capitalization = getContext ( DisplayContext . Type . CAPITALIZATION ) ; if ( capitalization == DisplayContext . CAPITALIZATION_FOR_BEGINNING_OF_SENTENCE || ( capitalization == DisplayContext . CAPITALIZATION_FOR_UI_LIST_OR_MENU && capitalizationForListOrMenu ) || ( capitalization == DisplayContext . CAPITALIZATION_FOR_STANDALONE && capitalizationForStandAlone ) ) { if ( capitalizationBrkIter == null ) { // should only happen when deserializing , etc . capitalizationBrkIter = BreakIterator . getSentenceInstance ( locale ) ; } return UCharacter . toTitleCase ( locale , result , capitalizationBrkIter , UCharacter . TITLECASE_NO_LOWERCASE | UCharacter . TITLECASE_NO_BREAK_ADJUSTMENT ) ; } } return result ;
public class CpoStatementFactory { /** * Called by the CPO Framework . Binds all the attibutes from the class for the CPO meta parameters and the parameters * from the dynamic where . */ public void setBindValues ( Collection < BindAttribute > bindValues ) throws CpoException { } }
if ( bindValues != null ) { int index = getStartingIndex ( ) ; // runs through the bind attributes and binds them to the prepared statement // They must be in correct order . for ( BindAttribute bindAttr : bindValues ) { Object bindObject = bindAttr . getBindObject ( ) ; CpoAttribute cpoAttribute = bindAttr . getCpoAttribute ( ) ; // check to see if we are getting a cpo value object or an object that // can be put directly in the statement ( String , BigDecimal , etc ) MethodMapEntry < ? , ? > jsm = ( ( MethodMapper < ? > ) getMethodMapper ( ) ) . getDataMethodMapEntry ( bindObject . getClass ( ) ) ; if ( jsm != null ) { try { if ( cpoAttribute == null ) { localLogger . debug ( bindAttr . getName ( ) + "=" + bindObject ) ; } else { localLogger . debug ( cpoAttribute . getDataName ( ) + "=" + bindObject ) ; } jsm . getBsSetter ( ) . invoke ( this . getBindableStatement ( ) , index ++ , bindObject ) ; } catch ( IllegalAccessException iae ) { localLogger . error ( "Error Accessing Prepared Statement Setter: " + ExceptionHelper . getLocalizedMessage ( iae ) ) ; throw new CpoException ( iae ) ; } catch ( InvocationTargetException ite ) { localLogger . error ( "Error Invoking Prepared Statement Setter: " + ExceptionHelper . getLocalizedMessage ( ite ) ) ; throw new CpoException ( ite . getCause ( ) ) ; } } else { CpoData cpoData = getCpoData ( cpoAttribute , index ++ ) ; cpoData . invokeSetter ( bindObject ) ; } } }
public class Hash { /** * Keccak - 256 hash function . * @ param hexInput hex encoded input data with optional 0x prefix * @ return hash value as hex encoded string */ public static String sha3 ( String hexInput ) { } }
byte [ ] bytes = Numeric . hexStringToByteArray ( hexInput ) ; byte [ ] result = sha3 ( bytes ) ; return Numeric . toHexString ( result ) ;
public class UnicodeSet { /** * Make this object represent the same set as < code > other < / code > . * @ param other a < code > UnicodeSet < / code > whose value will be * copied to this object */ public UnicodeSet set ( UnicodeSet other ) { } }
checkFrozen ( ) ; list = other . list . clone ( ) ; len = other . len ; pat = other . pat ; strings = new TreeSet < String > ( other . strings ) ; return this ;
public class BindingConverter { /** * { @ inheritDoc } */ public boolean matches ( TypeDescriptor sourceType , TypeDescriptor targetType ) { } }
try { BINDING . findConverter ( sourceType . getObjectType ( ) , targetType . getObjectType ( ) , matchAnnotationToScope ( targetType . getAnnotations ( ) ) ) ; return true ; } catch ( IllegalStateException e ) { return false ; }
public class DeleteDocumentationPartRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( DeleteDocumentationPartRequest deleteDocumentationPartRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( deleteDocumentationPartRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( deleteDocumentationPartRequest . getRestApiId ( ) , RESTAPIID_BINDING ) ; protocolMarshaller . marshall ( deleteDocumentationPartRequest . getDocumentationPartId ( ) , DOCUMENTATIONPARTID_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class xen_health_resource_sw { /** * Use this API to fetch filtered set of xen _ health _ resource _ sw resources . * filter string should be in JSON format . eg : " vm _ state : DOWN , name : [ a - z ] + " */ public static xen_health_resource_sw [ ] get_filtered ( nitro_service service , String filter ) throws Exception { } }
xen_health_resource_sw obj = new xen_health_resource_sw ( ) ; options option = new options ( ) ; option . set_filter ( filter ) ; xen_health_resource_sw [ ] response = ( xen_health_resource_sw [ ] ) obj . getfiltered ( service , option ) ; return response ;
public class Expressions { /** * Create a new Path expression * @ param type type of expression * @ param variable variable name * @ return path expression */ public static < T extends Number & Comparable < ? > > NumberPath < T > numberPath ( Class < ? extends T > type , String variable ) { } }
return new NumberPath < T > ( type , PathMetadataFactory . forVariable ( variable ) ) ;
public class GroupTemplate { /** * 判断是否加载过模板 * @ param key * @ return */ public boolean hasTemplate ( String key ) { } }
Program program = ( Program ) this . programCache . get ( key ) ; return program != null ;
public class SyncGroupsInner { /** * Gets a collection of sync database ids . * @ param nextPageLink The NextLink from the previous successful call to List operation . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ throws CloudException thrown if the request is rejected by server * @ throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @ return the PagedList & lt ; SyncDatabaseIdPropertiesInner & gt ; object if successful . */ public PagedList < SyncDatabaseIdPropertiesInner > listSyncDatabaseIdsNext ( final String nextPageLink ) { } }
ServiceResponse < Page < SyncDatabaseIdPropertiesInner > > response = listSyncDatabaseIdsNextSinglePageAsync ( nextPageLink ) . toBlocking ( ) . single ( ) ; return new PagedList < SyncDatabaseIdPropertiesInner > ( response . body ( ) ) { @ Override public Page < SyncDatabaseIdPropertiesInner > nextPage ( String nextPageLink ) { return listSyncDatabaseIdsNextSinglePageAsync ( nextPageLink ) . toBlocking ( ) . single ( ) . body ( ) ; } } ;
public class Dictionary { /** * Gets a property ' s value as a Blob . * Returns null if the value doesn ' t exist , or its value is not a Blob . * @ param key the key * @ return the Blob value or null . */ @ Override public Blob getBlob ( @ NonNull String key ) { } }
if ( key == null ) { throw new IllegalArgumentException ( "key cannot be null." ) ; } synchronized ( lock ) { final Object obj = getMValue ( internalDict , key ) . asNative ( internalDict ) ; return obj instanceof Blob ? ( Blob ) obj : null ; }
public class WebappConfigs { /** * Config loaded from a file located at * { @ code [ path ] / [ servlet context path ] } . * < ul > * < li > { @ code [ path ] } is determined by a { @ link PathSpecification } < / li > * < li > { @ code [ servlet context path ] } is the * { @ link ServletContextPath } from the { @ link ConfigFactory } ' s * { @ link Bindings } . < / li > * < / ul > * < p > The config will be empty if any of the following are true : < / p > * < ul > * < li > If { @ link PathSpecification # path ( Bindings ) } * . { @ link OptionalPath # isPresent ( ) isPresent ( ) } * is { @ code false } < / li > * < li > If no { @ link ServletContextPath } is bound < / li > * < li > If no config file exists at * { @ code [ path ] / [ servlet context path ] } < / li > * < / ul > */ public static FileConfigSourceStep servletContextDirectory ( ) { } }
return new BaseFileConfigSourceStep ( ) { @ Override public NamedConfigSource by ( PathSpecification pathSpecification ) { checkNotNull ( pathSpecification ) ; return new ServletContextDirectoryConfigSource ( pathSpecification ) . named ( String . format ( "servlet context directory %s" , pathSpecification . name ( ) ) ) ; } } ;
public class CommerceNotificationTemplateLocalServiceBaseImpl { /** * Returns a range of commerce notification templates matching the UUID and company . * @ param uuid the UUID of the commerce notification templates * @ param companyId the primary key of the company * @ param start the lower bound of the range of commerce notification templates * @ param end the upper bound of the range of commerce notification templates ( not inclusive ) * @ param orderByComparator the comparator to order the results by ( optionally < code > null < / code > ) * @ return the range of matching commerce notification templates , or an empty list if no matches were found */ @ Override public List < CommerceNotificationTemplate > getCommerceNotificationTemplatesByUuidAndCompanyId ( String uuid , long companyId , int start , int end , OrderByComparator < CommerceNotificationTemplate > orderByComparator ) { } }
return commerceNotificationTemplatePersistence . findByUuid_C ( uuid , companyId , start , end , orderByComparator ) ;
public class RedBlackTree { /** * Returns the smallest key in the symbol table greater than or equal to * < code > key < / code > . * @ param key * the key * @ return the smallest key in the symbol table greater than or equal to * < code > key < / code > * @ throws NoSuchElementException * if there is no such key */ public RedBlackTreeNode < Key , Value > ceilingNode ( Key key ) { } }
if ( isEmpty ( ) ) { return null ; } RedBlackTreeNode < Key , Value > x = ceiling ( root , key ) ; if ( x == null ) { return null ; } else { return x ; }
public class ServerSideEncryption { /** * Create a new server - side - encryption object for encryption with customer * provided keys ( a . k . a . SSE - C ) . * @ param key The secret AES - 256 key . * @ return An instance of ServerSideEncryption implementing SSE - C . * @ throws InvalidKeyException if the provided secret key is not a 256 bit AES key . * @ throws NoSuchAlgorithmException if the crypto provider does not implement MD5. */ public static ServerSideEncryption withCustomerKey ( SecretKey key ) throws InvalidKeyException , NoSuchAlgorithmException { } }
if ( ! isCustomerKeyValid ( key ) ) { throw new InvalidKeyException ( "The secret key is not a 256 bit AES key" ) ; } return new ServerSideEncryptionWithCustomerKey ( key , MessageDigest . getInstance ( ( "MD5" ) ) ) ;
public class Roster { /** * Reloads the entire roster from the server . This is an asynchronous operation , * which means the method will return immediately , and the roster will be * reloaded at a later point when the server responds to the reload request . * @ throws NotLoggedInException If not logged in . * @ throws NotConnectedException * @ throws InterruptedException */ public void reload ( ) throws NotLoggedInException , NotConnectedException , InterruptedException { } }
final XMPPConnection connection = getAuthenticatedConnectionOrThrow ( ) ; RosterPacket packet = new RosterPacket ( ) ; if ( rosterStore != null && isRosterVersioningSupported ( ) ) { packet . setVersion ( rosterStore . getRosterVersion ( ) ) ; } rosterState = RosterState . loading ; SmackFuture < IQ , Exception > future = connection . sendIqRequestAsync ( packet ) ; future . onSuccess ( new RosterResultListener ( ) ) . onError ( new ExceptionCallback < Exception > ( ) { @ Override public void processException ( Exception exception ) { rosterState = RosterState . uninitialized ; Level logLevel ; if ( exception instanceof NotConnectedException ) { logLevel = Level . FINE ; } else { logLevel = Level . SEVERE ; } LOGGER . log ( logLevel , "Exception reloading roster" , exception ) ; for ( RosterLoadedListener listener : rosterLoadedListeners ) { listener . onRosterLoadingFailed ( exception ) ; } } } ) ;
public class IfcFillAreaStyleTilesImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ SuppressWarnings ( "unchecked" ) public EList < IfcFillAreaStyleTileShapeSelect > getTiles ( ) { } }
return ( EList < IfcFillAreaStyleTileShapeSelect > ) eGet ( Ifc2x3tc1Package . Literals . IFC_FILL_AREA_STYLE_TILES__TILES , true ) ;
public class Bytes { /** * Iterate over keys within the passed range , splitting at an [ a , b ) boundary . */ public static Iterable < byte [ ] > iterateOnSplits ( final byte [ ] a , final byte [ ] b , final int num ) { } }
return iterateOnSplits ( a , b , false , num ) ;
public class MavenUtil { /** * Uses the aether to resolve a plugin dependency and returns the file for further processing . * @ param d the dependency to resolve . * @ param pluginRepos the plugin repositories to use for dependency resolution . * @ param resolver the resolver for aether access . * @ param repoSystemSession the session for the resolver . * @ return optionally a file which is the resolved dependency . */ public static Optional < File > resolvePluginDependency ( Dependency d , List < RemoteRepository > pluginRepos , ArtifactResolver resolver , RepositorySystemSession repoSystemSession ) { } }
Artifact a = new DefaultArtifact ( d . getGroupId ( ) , d . getArtifactId ( ) , d . getClassifier ( ) , d . getType ( ) , d . getVersion ( ) ) ; ArtifactRequest artifactRequest = new ArtifactRequest ( ) ; artifactRequest . setArtifact ( a ) ; artifactRequest . setRepositories ( pluginRepos ) ; try { ArtifactResult artifactResult = resolver . resolveArtifact ( repoSystemSession , artifactRequest ) ; if ( artifactResult . getArtifact ( ) != null ) { return Optional . fromNullable ( artifactResult . getArtifact ( ) . getFile ( ) ) ; } return Optional . absent ( ) ; } catch ( ArtifactResolutionException e ) { return Optional . absent ( ) ; }
public class JobCatalogBase { /** * { @ inheritDoc } */ @ Override public synchronized void addListener ( JobCatalogListener jobListener ) { } }
Preconditions . checkNotNull ( jobListener ) ; this . listeners . addListener ( jobListener ) ; if ( state ( ) == State . RUNNING ) { Iterator < JobSpec > jobSpecItr = getJobSpecsWithTimeUpdate ( ) ; while ( jobSpecItr . hasNext ( ) ) { JobSpec jobSpec = jobSpecItr . next ( ) ; if ( jobSpec != null ) { JobCatalogListener . AddJobCallback addJobCallback = new JobCatalogListener . AddJobCallback ( jobSpec ) ; this . listeners . callbackOneListener ( addJobCallback , jobListener ) ; } } }
public class BaasDocument { /** * Synchronously fetches a document from the server * @ param collection the collection to retrieve the document from . Not < code > null < / code > * @ param id the id of the document to retrieve . Not < code > null < / code > * @ param withAcl if true will fetch acl * @ return the result of the request */ public static BaasResult < BaasDocument > fetchSync ( String collection , String id , boolean withAcl ) { } }
if ( collection == null ) throw new IllegalArgumentException ( "collection cannot be null" ) ; if ( id == null ) throw new IllegalArgumentException ( "id cannot be null" ) ; BaasDocument doc = new BaasDocument ( collection ) ; doc . id = id ; return doc . refreshSync ( withAcl ) ;
public class ColumnListOutputHandler { /** * Converts specified ( via constructor ) column into List * @ param outputList Query output * @ return Query output column as List * @ throws org . midao . jdbc . core . exception . MjdbcException */ public List < T > handle ( List < QueryParameters > outputList ) throws MjdbcException { } }
List < T > result = new ArrayList < T > ( ) ; String parameterName = null ; Object parameterValue = null ; for ( int i = 1 ; i < outputList . size ( ) ; i ++ ) { if ( this . columnName == null ) { parameterName = outputList . get ( i ) . getNameByPosition ( this . columnIndex ) ; parameterValue = outputList . get ( i ) . getValue ( parameterName ) ; result . add ( ( T ) parameterValue ) ; } else { parameterValue = outputList . get ( i ) . getValue ( this . columnName ) ; result . add ( ( T ) parameterValue ) ; } } return result ;
public class EndpointServices { /** * dump parameter map for trace . */ @ Trivial private String dumpMap ( Map < String , String [ ] > m ) { } }
StringBuffer sb = new StringBuffer ( ) ; sb . append ( " --- request parameters: ---\n" ) ; Iterator < String > it = m . keySet ( ) . iterator ( ) ; while ( it . hasNext ( ) ) { String key = it . next ( ) ; String [ ] values = m . get ( key ) ; sb . append ( key + ": " ) ; for ( String s : values ) { sb . append ( "[" + s + "] " ) ; } sb . append ( "\n" ) ; } return sb . toString ( ) ;
public class AbstractStaticSourceCompiler { /** * Recursive method that searches the SuperSource for the current Instance * identified by the oid . * @ param _ instance Instance the Super Instance will be searched * @ return List of SuperSources in reverse order * @ throws EFapsException error */ protected List < Instance > getSuper ( final Instance _instance ) throws EFapsException { } }
final List < Instance > ret = new ArrayList < > ( ) ; final QueryBuilder queryBldr = new QueryBuilder ( getClassName4Type2Type ( ) ) ; queryBldr . addWhereAttrEqValue ( CIAdminProgram . Program2Program . From , _instance . getId ( ) ) ; final MultiPrintQuery multi = queryBldr . getPrint ( ) ; multi . addAttribute ( CIAdminProgram . Program2Program . To ) ; multi . execute ( ) ; if ( multi . next ( ) ) { final Instance instance = Instance . get ( getClassName4Type ( ) . getType ( ) , multi . < Long > getAttribute ( CIAdminProgram . Program2Program . To ) ) ; ret . add ( instance ) ; ret . addAll ( getSuper ( instance ) ) ; } return ret ;
public class DateTimePatternGenerator { /** * { @ inheritDoc } */ @ Override public DateTimePatternGenerator cloneAsThawed ( ) { } }
DateTimePatternGenerator result = ( DateTimePatternGenerator ) ( this . clone ( ) ) ; frozen = false ; return result ;
public class UsagePlanMarshaller { /** * Marshall the given parameter object . */ public void marshall ( UsagePlan usagePlan , ProtocolMarshaller protocolMarshaller ) { } }
if ( usagePlan == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( usagePlan . getId ( ) , ID_BINDING ) ; protocolMarshaller . marshall ( usagePlan . getName ( ) , NAME_BINDING ) ; protocolMarshaller . marshall ( usagePlan . getDescription ( ) , DESCRIPTION_BINDING ) ; protocolMarshaller . marshall ( usagePlan . getApiStages ( ) , APISTAGES_BINDING ) ; protocolMarshaller . marshall ( usagePlan . getThrottle ( ) , THROTTLE_BINDING ) ; protocolMarshaller . marshall ( usagePlan . getQuota ( ) , QUOTA_BINDING ) ; protocolMarshaller . marshall ( usagePlan . getProductCode ( ) , PRODUCTCODE_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class GeometryConverter { /** * Takes in a DTO geometry , and converts it into a GWT geometry . * @ param geometry * The DTO geometry to convert into a GWT geometry . * @ return Returns a GWT geometry . */ public static org . geomajas . gwt . client . spatial . geometry . Geometry toGwt ( Geometry geometry ) { } }
if ( geometry == null ) { return null ; } GeometryFactory factory = new GeometryFactory ( geometry . getSrid ( ) , geometry . getPrecision ( ) ) ; org . geomajas . gwt . client . spatial . geometry . Geometry gwt ; String geometryType = geometry . getGeometryType ( ) ; if ( Geometry . POINT . equals ( geometryType ) ) { if ( geometry . getCoordinates ( ) != null ) { gwt = factory . createPoint ( geometry . getCoordinates ( ) [ 0 ] ) ; } else { gwt = factory . createPoint ( null ) ; } } else if ( Geometry . LINEAR_RING . equals ( geometryType ) ) { gwt = factory . createLinearRing ( geometry . getCoordinates ( ) ) ; } else if ( Geometry . LINE_STRING . equals ( geometryType ) ) { gwt = factory . createLineString ( geometry . getCoordinates ( ) ) ; } else if ( Geometry . POLYGON . equals ( geometryType ) ) { if ( geometry . getGeometries ( ) == null ) { gwt = factory . createPolygon ( null , null ) ; } else { LinearRing exteriorRing = ( LinearRing ) toGwt ( geometry . getGeometries ( ) [ 0 ] ) ; LinearRing [ ] interiorRings = new LinearRing [ geometry . getGeometries ( ) . length - 1 ] ; for ( int i = 0 ; i < interiorRings . length ; i ++ ) { interiorRings [ i ] = ( LinearRing ) toGwt ( geometry . getGeometries ( ) [ i + 1 ] ) ; } gwt = factory . createPolygon ( exteriorRing , interiorRings ) ; } } else if ( Geometry . MULTI_POINT . equals ( geometryType ) ) { if ( geometry . getGeometries ( ) == null ) { gwt = factory . createMultiPoint ( null ) ; } else { Point [ ] points = new Point [ geometry . getGeometries ( ) . length ] ; gwt = factory . createMultiPoint ( ( Point [ ] ) convertGeometries ( geometry , points ) ) ; } } else if ( Geometry . MULTI_LINE_STRING . equals ( geometryType ) ) { if ( geometry . getGeometries ( ) == null ) { gwt = factory . createMultiLineString ( null ) ; } else { LineString [ ] lineStrings = new LineString [ geometry . getGeometries ( ) . length ] ; gwt = factory . createMultiLineString ( ( LineString [ ] ) convertGeometries ( geometry , lineStrings ) ) ; } } else if ( Geometry . MULTI_POLYGON . equals ( geometryType ) ) { if ( geometry . getGeometries ( ) == null ) { gwt = factory . createMultiPolygon ( null ) ; } else { Polygon [ ] polygons = new Polygon [ geometry . getGeometries ( ) . length ] ; gwt = factory . createMultiPolygon ( ( Polygon [ ] ) convertGeometries ( geometry , polygons ) ) ; } } else { String msg = "GeometryConverter.toGwt() unrecognized geometry type " + geometryType ; Log . logServer ( Log . LEVEL_ERROR , msg ) ; throw new IllegalStateException ( msg ) ; } return gwt ;
public class DetailedStatistics { /** * Return the histogram of the { @ link # getValues ( ) values } . This method is capable of creating two kinds of histograms . The * first kind is a histogram where all of the buckets are distributed normally and all have the same width . In this case , the * ' numSigmas ' should be set to 0 . See { @ link # getHistogram ( ) } . * The second kind of histogram is more useful when most of the data that is clustered near one value . This histogram is * focused around the values that are up to ' numSigmas ' above and below the { @ link # getMedian ( ) median } , and all values * outside of this range are placed in the first and last bucket . * @ param numSigmas the number of standard deviations from the { @ link # getMedian ( ) median } , or 0 if the buckets of the * histogram should be evenly distributed * @ return the histogram * @ see # getHistogram ( ) */ public Histogram < T > getHistogram ( int numSigmas ) { } }
Lock lock = this . getLock ( ) . writeLock ( ) ; lock . lock ( ) ; try { Histogram < T > hist = new Histogram < T > ( this . math , this . values ) ; if ( numSigmas > 0 ) { // The ' getMediaValue ( ) ' method will reset the current histogram , so don ' t set it . . . hist . setStrategy ( this . getMedianValue ( ) , this . getStandardDeviation ( ) , numSigmas ) ; } this . histogram = hist ; return this . histogram ; } finally { lock . unlock ( ) ; }
public class SyncStage { /** * Invokes the handler for the event . * @ param value the event */ @ Override @ SuppressWarnings ( "checkstyle:illegalcatch" ) public void onNext ( final T value ) { } }
beforeOnNext ( ) ; try { handler . onNext ( value ) ; } catch ( final Throwable t ) { if ( errorHandler != null ) { errorHandler . onNext ( t ) ; } else { LOG . log ( Level . SEVERE , name + " Exception from event handler" , t ) ; throw t ; } } afterOnNext ( ) ;
public class Help { /** * / * ( non - Javadoc ) * @ see org . eiichiro . ash . Command # run ( org . eiichiro . ash . Line ) */ @ Override public void run ( Line line ) { } }
List < String > args = line . args ( ) ; if ( args . isEmpty ( ) ) { shell . console ( ) . println ( usage ( ) . toString ( ) ) ; return ; } String command = line . args ( ) . get ( 0 ) ; Command c = shell . commands ( ) . get ( command ) ; if ( c == null ) { shell . console ( ) . println ( "no help topic for '" + command + "'" ) ; return ; } shell . console ( ) . println ( c . usage ( ) . toString ( ) ) ;
public class EndpointService { /** * { @ inheritDoc } */ public void start ( final StartContext context ) throws StartException { } }
final Endpoint endpoint ; final EndpointBuilder builder = Endpoint . builder ( ) ; builder . setEndpointName ( endpointName ) ; builder . setXnioWorker ( worker . getValue ( ) ) ; try { endpoint = builder . build ( ) ; } catch ( IOException e ) { throw RemotingLogger . ROOT_LOGGER . couldNotStart ( e ) ; } // Reuse the options for the remote connection factory for now this . endpoint = endpoint ;
public class CommerceWishListUtil { /** * Returns the first commerce wish list in the ordered set where userId = & # 63 ; and createDate & lt ; & # 63 ; . * @ param userId the user ID * @ param createDate the create date * @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > ) * @ return the first matching commerce wish list * @ throws NoSuchWishListException if a matching commerce wish list could not be found */ public static CommerceWishList findByU_LtC_First ( long userId , Date createDate , OrderByComparator < CommerceWishList > orderByComparator ) throws com . liferay . commerce . wish . list . exception . NoSuchWishListException { } }
return getPersistence ( ) . findByU_LtC_First ( userId , createDate , orderByComparator ) ;
public class LambdaIterators { /** * Creates an { @ link java . util . Iterator } checked has an internal count of how many times it has been called . * The current index1 is passed to the lambda expressions . * @ param hasNext used to implement { @ link java . util . Iterator # hasNext ( ) } * @ param next used to implement { @ link java . util . Iterator # next ( ) } * @ param < E > the generic type * @ return a new instance */ public static < E > Iterator < E > indexIterator ( IntPredicate hasNext , IntFunction < E > next ) { } }
Objects . requireNonNull ( hasNext , "hasNext" ) ; Objects . requireNonNull ( next , "next" ) ; class IndexIterator extends BaseIterator < E > { private int index ; @ Override public boolean hasNext ( ) { return hasNext . test ( index ) ; } @ Override protected E nextElement ( ) { return next . apply ( index ++ ) ; } } return new IndexIterator ( ) ;
public class ListApplicationVersionsResult { /** * An array of version summaries for the application . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setVersions ( java . util . Collection ) } or { @ link # withVersions ( java . util . Collection ) } if you want to override * the existing values . * @ param versions * An array of version summaries for the application . * @ return Returns a reference to this object so that method calls can be chained together . */ public ListApplicationVersionsResult withVersions ( VersionSummary ... versions ) { } }
if ( this . versions == null ) { setVersions ( new java . util . ArrayList < VersionSummary > ( versions . length ) ) ; } for ( VersionSummary ele : versions ) { this . versions . add ( ele ) ; } return this ;
public class ReadabilityStatistics { /** * Returns the Flesch - Kincaid Reading Ease of text entered rounded to one digit . * @ param strText Text to be checked * @ return */ public static double fleschKincaidReadingEase ( String strText ) { } }
strText = cleanText ( strText ) ; return PHPMethods . round ( ( 206.835 - ( 1.015 * averageWordsPerSentence ( strText ) ) - ( 84.6 * averageSyllablesPerWord ( strText ) ) ) , 1 ) ;
public class SetupWizard { /** * Indicates a generated password should be used - e . g . this is a new install , no security realm set up */ @ SuppressWarnings ( "unused" ) // used by jelly public boolean isUsingSecurityToken ( ) { } }
try { return ! Jenkins . get ( ) . getInstallState ( ) . isSetupComplete ( ) && isUsingSecurityDefaults ( ) ; } catch ( Exception e ) { // ignore } return false ;
public class AbstractPathElement3F { /** * Create an instance of path element . * @ param type is the type of the new element . * @ param lastX is the coordinate of the last point . * @ param lastY is the coordinate of the last point . * @ param lastZ is the coordinate of the last point . * @ param coords are the coordinates . * @ return the instance of path element . */ @ Pure public static AbstractPathElement3F newInstance ( PathElementType type , double lastX , double lastY , double lastZ , double [ ] coords ) { } }
switch ( type ) { case MOVE_TO : return new MovePathElement3f ( coords [ 0 ] , coords [ 1 ] , coords [ 2 ] ) ; case LINE_TO : return new LinePathElement3f ( lastX , lastY , lastZ , coords [ 0 ] , coords [ 1 ] , coords [ 2 ] ) ; case QUAD_TO : return new QuadPathElement3f ( lastX , lastY , lastZ , coords [ 0 ] , coords [ 1 ] , coords [ 2 ] , coords [ 3 ] , coords [ 4 ] , coords [ 5 ] ) ; case CURVE_TO : return new CurvePathElement3f ( lastX , lastY , lastZ , coords [ 0 ] , coords [ 1 ] , coords [ 2 ] , coords [ 3 ] , coords [ 4 ] , coords [ 5 ] , coords [ 6 ] , coords [ 7 ] , coords [ 8 ] ) ; case CLOSE : return new ClosePathElement3f ( lastX , lastY , lastZ , coords [ 0 ] , coords [ 1 ] , coords [ 2 ] ) ; default : } throw new IllegalArgumentException ( ) ;
public class BaseMonetaryRoundingsSingletonSpi { /** * Access a { @ link javax . money . MonetaryRounding } for rounding { @ link javax . money . MonetaryAmount } * instances given a currency . * @ param currencyUnit The currency , which determines the required precision . As * { @ link java . math . RoundingMode } , by default , { @ link java . math . RoundingMode # HALF _ UP } * is sued . * @ param providers the optional provider list and ordering to be used * @ return a new instance { @ link javax . money . MonetaryOperator } implementing the * rounding , never { @ code null } . * @ throws javax . money . MonetaryException if no such rounding could be provided . */ public MonetaryRounding getRounding ( CurrencyUnit currencyUnit , String ... providers ) { } }
MonetaryRounding op = getRounding ( RoundingQueryBuilder . of ( ) . setProviderNames ( providers ) . setCurrency ( currencyUnit ) . build ( ) ) ; if ( op == null ) { throw new MonetaryException ( "No rounding provided for CurrencyUnit: " + currencyUnit . getCurrencyCode ( ) ) ; } return op ;
public class TerminalTextUtils { /** * This method will calculate word wrappings given a number of lines of text and how wide the text can be printed . * The result is a list of new rows where word - wrapping was applied . * @ param maxWidth Maximum number of columns that can be used before word - wrapping is applied , if & lt ; = 0 then the * lines will be returned unchanged * @ param lines Input text * @ return The input text word - wrapped at { @ code maxWidth } ; this may contain more rows than the input text */ public static List < String > getWordWrappedText ( int maxWidth , String ... lines ) { } }
// Bounds checking if ( maxWidth <= 0 ) { return Arrays . asList ( lines ) ; } List < String > result = new ArrayList < String > ( ) ; LinkedList < String > linesToBeWrapped = new LinkedList < String > ( Arrays . asList ( lines ) ) ; while ( ! linesToBeWrapped . isEmpty ( ) ) { String row = linesToBeWrapped . removeFirst ( ) ; int rowWidth = getColumnWidth ( row ) ; if ( rowWidth <= maxWidth ) { result . add ( row ) ; } else { // Now search in reverse and find the first possible line - break final int characterIndexMax = getStringCharacterIndex ( row , maxWidth ) ; int characterIndex = characterIndexMax ; while ( characterIndex >= 0 && ! Character . isSpaceChar ( row . charAt ( characterIndex ) ) && ! isCharCJK ( row . charAt ( characterIndex ) ) ) { characterIndex -- ; } // right * after * a CJK is also a " nice " spot to break the line ! if ( characterIndex >= 0 && characterIndex < characterIndexMax && isCharCJK ( row . charAt ( characterIndex ) ) ) { characterIndex ++ ; // with these conditions it fits ! } if ( characterIndex < 0 ) { // Failed ! There was no ' nice ' place to cut so just cut it at maxWidth characterIndex = Math . max ( characterIndexMax , 1 ) ; // at least 1 char result . add ( row . substring ( 0 , characterIndex ) ) ; linesToBeWrapped . addFirst ( row . substring ( characterIndex ) ) ; } else { // characterIndex = = 0 only happens , if either // - first char is CJK and maxWidth = = 1 or // - first char is whitespace // either way : put it in row before break to prevent infinite loop . characterIndex = Math . max ( characterIndex , 1 ) ; // at least 1 char // Ok , split the row , add it to the result and continue processing the second half on a new line result . add ( row . substring ( 0 , characterIndex ) ) ; while ( characterIndex < row . length ( ) && Character . isSpaceChar ( row . charAt ( characterIndex ) ) ) { characterIndex ++ ; } if ( characterIndex < row . length ( ) ) { // only if rest contains non - whitespace linesToBeWrapped . addFirst ( row . substring ( characterIndex ) ) ; } } } } return result ;
public class CLISmartHandler { /** * Publish a log record . */ @ Override public void publish ( final LogRecord record ) { } }
// determine destination final Writer destination ; if ( record . getLevel ( ) . intValue ( ) >= Level . WARNING . intValue ( ) ) { destination = this . err ; } else { destination = this . out ; } // format final String m ; // Progress records are handled specially . if ( record instanceof ProgressLogRecord ) { ProgressLogRecord prec = ( ProgressLogRecord ) record ; ptrack . addProgress ( prec . getProgress ( ) ) ; Collection < Progress > completed = ptrack . removeCompleted ( ) ; Collection < Progress > progresses = ptrack . getProgresses ( ) ; StringBuilder buf = new StringBuilder ( ) ; if ( ! completed . isEmpty ( ) ) { buf . append ( OutputStreamLogger . CARRIAGE_RETURN ) ; for ( Progress prog : completed ) { // TODO : use formatter , somehow ? prog . appendToBuffer ( buf ) ; buf . append ( OutputStreamLogger . NEWLINE ) ; } } if ( ! progresses . isEmpty ( ) ) { boolean first = true ; buf . append ( OutputStreamLogger . CARRIAGE_RETURN ) ; for ( Progress prog : progresses ) { if ( first ) { first = false ; } else { buf . append ( ' ' ) ; } // TODO : use formatter , somehow ? prog . appendToBuffer ( buf ) ; } } m = buf . toString ( ) ; } else { // choose an appropriate formatter final Formatter fmt ; // always format progress messages using the progress formatter . if ( record . getLevel ( ) . intValue ( ) >= Level . WARNING . intValue ( ) ) { // format errors using the error formatter fmt = errformat ; } else if ( record . getLevel ( ) . intValue ( ) <= Level . FINE . intValue ( ) ) { // format debug statements using the debug formatter . fmt = debugformat ; } else { // default to the message formatter . fmt = msgformat ; } try { m = fmt . format ( record ) ; } catch ( Exception ex ) { reportError ( null , ex , ErrorManager . FORMAT_FAILURE ) ; return ; } } // write try { destination . write ( m ) ; // always flush ( although the streams should auto - flush already ) destination . flush ( ) ; } catch ( Exception ex ) { reportError ( null , ex , ErrorManager . WRITE_FAILURE ) ; return ; }
public class Logger { /** * Log a message at the WARN level . * @ param marker The marker specific to this log statement * @ param message the message string to be logged * @ since 1.0.0 */ public void warn ( final Marker marker , final String message ) { } }
log . warn ( marker , sanitize ( message ) ) ;
public class TangramEngine { /** * { @ inheritDoc } */ @ Override public void topPosition ( Card card ) { } }
List < BaseCell > cells = card . getCells ( ) ; if ( cells . size ( ) > 0 ) { BaseCell cell = cells . get ( 0 ) ; int pos = mGroupBasicAdapter . getComponents ( ) . indexOf ( cell ) ; if ( pos > 0 ) { VirtualLayoutManager lm = getLayoutManager ( ) ; View view = lm . findViewByPosition ( pos ) ; if ( view != null ) { int top = lm . getDecoratedTop ( view ) ; RecyclerView recyclerView = getContentView ( ) ; if ( recyclerView != null ) { recyclerView . scrollBy ( 0 , top ) ; } } else { RecyclerView recyclerView = getContentView ( ) ; if ( recyclerView != null ) { recyclerView . scrollToPosition ( pos ) ; } } } }
public class Color { /** * Scale the components of the colour by the given value * @ param value The value to scale by */ public void scale ( float value ) { } }
r *= value ; g *= value ; b *= value ; a *= value ;
public class I18n { /** * copied from http : / / stackoverflow . com / questions / 309424 / read - convert - an - inputstream - to - a - string * @ param is file to be read * @ param bufferSize size of the buffer used to read the file * @ return file content as String */ public static String slurp ( final InputStream is , final int bufferSize ) { } }
final char [ ] buffer = new char [ bufferSize ] ; final StringBuilder out = new StringBuilder ( ) ; try { final Reader in = new InputStreamReader ( is , "UTF-8" ) ; try { for ( ; ; ) { int rsz = in . read ( buffer , 0 , buffer . length ) ; if ( rsz < 0 ) break ; out . append ( buffer , 0 , rsz ) ; } } finally { in . close ( ) ; } } catch ( UnsupportedEncodingException ex ) { } catch ( IOException ex ) { } return out . toString ( ) ;
public class Key { /** * Gets the for instance . * @ param _ instance the instance * @ return the for instance * @ throws EFapsException on error */ public static Key get4Instance ( final Instance _instance ) throws EFapsException { } }
Key . LOG . debug ( "Retrieving Key for {}" , _instance ) ; final Key ret = new Key ( ) ; ret . setPersonId ( Context . getThreadContext ( ) . getPersonId ( ) ) ; final Type type = _instance . getType ( ) ; ret . setTypeId ( type . getId ( ) ) ; if ( type . isCompanyDependent ( ) ) { ret . setCompanyId ( Context . getThreadContext ( ) . getCompany ( ) . getId ( ) ) ; } Key . LOG . debug ( "Retrieved Key {}" , ret ) ; return ret ;
public class BuildStepsInner { /** * Updates a build step in a build task . * @ param resourceGroupName The name of the resource group to which the container registry belongs . * @ param registryName The name of the container registry . * @ param buildTaskName The name of the container registry build task . * @ param stepName The name of a build step for a container registry build task . * @ param buildStepUpdateParameters The parameters for updating a build step . * @ param serviceCallback the async ServiceCallback to handle successful and failed responses . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the { @ link ServiceFuture } object */ public ServiceFuture < BuildStepInner > updateAsync ( String resourceGroupName , String registryName , String buildTaskName , String stepName , BuildStepUpdateParameters buildStepUpdateParameters , final ServiceCallback < BuildStepInner > serviceCallback ) { } }
return ServiceFuture . fromResponse ( updateWithServiceResponseAsync ( resourceGroupName , registryName , buildTaskName , stepName , buildStepUpdateParameters ) , serviceCallback ) ;
public class PasswordCipherUtil { public static EncryptedInfo encipher_internal ( byte [ ] decrypted_bytes , String crypto_algorithm , String cryptoKey ) throws InvalidPasswordCipherException , UnsupportedCryptoAlgorithmException { } }
HashMap < String , String > props = new HashMap < String , String > ( ) ; if ( cryptoKey != null ) { props . put ( PasswordUtil . PROPERTY_CRYPTO_KEY , cryptoKey ) ; } return encipher_internal ( decrypted_bytes , crypto_algorithm , props ) ;
public class Ids { /** * Returns a new { @ link Id } which represents the { @ code type } qualified by * the { @ code annotation } instance . * @ param type the type to which the new id has to be associated . * @ param annotation the qualifying annotation . * @ return an new { @ code Id } based on the given type and annotation . */ public static Id < ? > newId ( final Type type , final Annotation annotation ) { } }
return IdImpl . newId ( type , annotation ) ;
public class AbstractBigtableTable { /** * { @ inheritDoc } */ @ Override public boolean exists ( Get get ) throws IOException { } }
try ( Scope scope = TRACER . spanBuilder ( "BigtableTable.exists" ) . startScopedSpan ( ) ) { LOG . trace ( "exists(Get)" ) ; return ! convertToResult ( getResults ( GetAdapter . setCheckExistenceOnly ( get ) , "exists" ) ) . isEmpty ( ) ; }
public class Graph { /** * Adds a node to this graph . * @ param node the node */ public void addNode ( NodeT node ) { } }
node . setOwner ( this ) ; nodeTable . put ( node . key ( ) , node ) ;
public class A_CmsListAction { /** * Generates html for the confirmation message when having one confirmation message * for several actions . < p > * @ param confId the id of the confirmation message * @ param confText the confirmation message * @ return html code */ public static String defaultConfirmationHtml ( String confId , String confText ) { } }
StringBuffer html = new StringBuffer ( 1024 ) ; html . append ( "<div class='hide' id='conf" ) ; html . append ( confId ) ; html . append ( "'>" ) ; html . append ( CmsStringUtil . isEmptyOrWhitespaceOnly ( confText ) ? "null" : confText ) ; html . append ( "</div>\n" ) ; return html . toString ( ) ;
public class IntArrayList { /** * Index of the last element with this value . * @ param value for the element . * @ return the index if found otherwise - 1. */ public @ DoNotSub int lastIndexOf ( final int value ) { } }
for ( @ DoNotSub int i = size - 1 ; i >= 0 ; i -- ) { if ( value == elements [ i ] ) { return i ; } } return - 1 ;
public class DeleteUserTeamAssociations { /** * Runs the example . * @ param adManagerServices the services factory . * @ param session the session . * @ param userId the ID of the user to delete user team associations for . * @ throws ApiException if the API request failed with one or more service errors . * @ throws RemoteException if the API request failed due to other errors . */ public static void runExample ( AdManagerServices adManagerServices , AdManagerSession session , long userId ) throws RemoteException { } }
// Get the UserTeamAssociationService . UserTeamAssociationServiceInterface userTeamAssociationService = adManagerServices . get ( session , UserTeamAssociationServiceInterface . class ) ; // Create a statement to get all user team associations for a user . StatementBuilder statementBuilder = new StatementBuilder ( ) . where ( "WHERE userId = :userId " ) . orderBy ( "userId ASC, teamid ASC" ) . limit ( StatementBuilder . SUGGESTED_PAGE_LIMIT ) . withBindVariableValue ( "userId" , userId ) ; // Default for total result set size . int totalResultSetSize = 0 ; do { // Get user team associations by statement . UserTeamAssociationPage page = userTeamAssociationService . getUserTeamAssociationsByStatement ( statementBuilder . toStatement ( ) ) ; if ( page . getResults ( ) != null ) { totalResultSetSize = page . getTotalResultSetSize ( ) ; int i = page . getStartIndex ( ) ; for ( UserTeamAssociation userTeamAssociation : page . getResults ( ) ) { System . out . printf ( "%d) User team association with user ID %d and " + "team ID %d will be deleted.%n" , i ++ , userTeamAssociation . getUserId ( ) , userTeamAssociation . getTeamId ( ) ) ; } } statementBuilder . increaseOffsetBy ( StatementBuilder . SUGGESTED_PAGE_LIMIT ) ; } while ( statementBuilder . getOffset ( ) < totalResultSetSize ) ; System . out . printf ( "Number of user team associations to be deleted: %d%n" , totalResultSetSize ) ; if ( totalResultSetSize > 0 ) { // Remove limit and offset from statement . statementBuilder . removeLimitAndOffset ( ) ; // Create action . com . google . api . ads . admanager . axis . v201811 . DeleteUserTeamAssociations action = new com . google . api . ads . admanager . axis . v201811 . DeleteUserTeamAssociations ( ) ; // Perform action . UpdateResult result = userTeamAssociationService . performUserTeamAssociationAction ( action , statementBuilder . toStatement ( ) ) ; if ( result != null && result . getNumChanges ( ) > 0 ) { System . out . printf ( "Number of user team associations deleted: %d%n" , result . getNumChanges ( ) ) ; } else { System . out . println ( "No user team associations were deleted." ) ; } }
public class Kafka { /** * Adds a configuration properties for the Kafka consumer . * @ param key property key for the Kafka consumer * @ param value property value for the Kafka consumer */ public Kafka property ( String key , String value ) { } }
Preconditions . checkNotNull ( key ) ; Preconditions . checkNotNull ( value ) ; if ( this . kafkaProperties == null ) { this . kafkaProperties = new HashMap < > ( ) ; } kafkaProperties . put ( key , value ) ; return this ;
public class AdminWhitelistRule { /** * Approves all the currently rejected subjects */ @ RequirePOST public HttpResponse doApproveAll ( ) throws IOException { } }
StringBuilder buf = new StringBuilder ( ) ; for ( Class c : rejected . get ( ) ) { buf . append ( c . getName ( ) ) . append ( '\n' ) ; } whitelisted . append ( buf . toString ( ) ) ; return HttpResponses . ok ( ) ;
public class EmbeddableAttributesImpl { /** * If not already created , a new < code > transient < / code > element will be created and returned . * Otherwise , the first existing < code > transient < / code > element will be returned . * @ return the instance defined for the element < code > transient < / code > */ public Transient < EmbeddableAttributes < T > > getOrCreateTransient ( ) { } }
List < Node > nodeList = childNode . get ( "transient" ) ; if ( nodeList != null && nodeList . size ( ) > 0 ) { return new TransientImpl < EmbeddableAttributes < T > > ( this , "transient" , childNode , nodeList . get ( 0 ) ) ; } return createTransient ( ) ;
public class RecurrencePickerDialog { /** * Update the " Repeat for N events " end option with the proper string values * based on the value that has been entered for N . */ private void updateEndCountText ( ) { } }
final String END_COUNT_MARKER = "%d" ; String endString = mResources . getQuantityString ( R . plurals . recurrence_end_count , mModel . endCount ) ; int markerStart = endString . indexOf ( END_COUNT_MARKER ) ; if ( markerStart != - 1 ) { if ( markerStart == 0 ) { Log . e ( TAG , "No text to put in to recurrence's end spinner." ) ; } else { int postTextStart = markerStart + END_COUNT_MARKER . length ( ) ; mPostEndCount . setText ( endString . substring ( postTextStart , endString . length ( ) ) . trim ( ) ) ; } }
public class Client { /** * Returns virtual host shovels . * @ param vhost Virtual host from where search shovels . * @ return Shovels . */ public List < ShovelInfo > getShovels ( String vhost ) { } }
final URI uri = uriWithPath ( "./parameters/shovel/" + encodePathSegment ( vhost ) ) ; final ShovelInfo [ ] result = this . getForObjectReturningNullOn404 ( uri , ShovelInfo [ ] . class ) ; return asListOrNull ( result ) ;
public class GetBotVersionsResult { /** * An array of < code > BotMetadata < / code > objects , one for each numbered version of the bot plus one for the * < code > $ LATEST < / code > version . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setBots ( java . util . Collection ) } or { @ link # withBots ( java . util . Collection ) } if you want to override the * existing values . * @ param bots * An array of < code > BotMetadata < / code > objects , one for each numbered version of the bot plus one for the * < code > $ LATEST < / code > version . * @ return Returns a reference to this object so that method calls can be chained together . */ public GetBotVersionsResult withBots ( BotMetadata ... bots ) { } }
if ( this . bots == null ) { setBots ( new java . util . ArrayList < BotMetadata > ( bots . length ) ) ; } for ( BotMetadata ele : bots ) { this . bots . add ( ele ) ; } return this ;
public class LinearLayout { /** * Compute the offset for the item in the layout based on the offsets of neighbors * in the layout . The other offsets are not patched . If neighbors offsets have not * been computed the offset of the item will not be set . * @ return true if the item fits the container , false otherwise */ protected boolean computeOffset ( CacheDataSet cache ) { } }
// offset computation : update offset for all items in the cache float startDataOffset = getStartingOffset ( ( cache . getTotalSizeWithPadding ( ) ) ) ; float layoutOffset = getLayoutOffset ( ) ; boolean inBounds = startDataOffset < - layoutOffset ; for ( int pos = 0 ; pos < cache . count ( ) ; ++ pos ) { int id = cache . getId ( pos ) ; if ( id != - 1 ) { float endDataOffset = cache . setDataAfter ( id , startDataOffset ) ; inBounds = inBounds && endDataOffset > layoutOffset && startDataOffset < - layoutOffset ; startDataOffset = endDataOffset ; Log . d ( LAYOUT , TAG , "computeOffset [%d] = %f" , id , cache . getDataOffset ( id ) ) ; } } return inBounds ;
public class F23NoncontinuousRotatedHybridComposition3 { /** * Function body */ public double f ( double [ ] x ) throws JMetalException { } }
double result = 0.0 ; for ( int i = 0 ; i < mDimension ; i ++ ) { x [ i ] = Benchmark . myXRound ( x [ i ] , m_o [ 0 ] [ i ] ) ; } result = Benchmark . hybrid_composition ( x , theJob ) ; result += mBias ; return ( result ) ;
public class AuthenticationFilterImpl { /** * { @ inheritDoc } */ @ Override public boolean isAccepted ( HttpServletRequest request ) { } }
if ( commonFilter != null ) { return commonFilter . isAccepted ( new RealRequestInfo ( request ) ) ; } return true ;
public class XMLServiceDocumentWriter { /** * This writes all entity sets in entity data model as collection of elements . * @ param writer which writes to stream . * @ throws XMLStreamException in case of any xml errors * @ throws ODataRenderException if entity container is null . */ private void writeEntitySets ( XMLStreamWriter writer ) throws XMLStreamException , ODataRenderException { } }
List < EntitySet > entitySets = getEntityContainer ( ) . getEntitySets ( ) ; LOG . debug ( "Number of entity sets to be written in service document are {}" , entitySets . size ( ) ) ; for ( EntitySet entitySet : entitySets ) { if ( entitySet . isIncludedInServiceDocument ( ) ) { writeElement ( writer , null , SERVICE_COLLECTION , null , entitySet . getName ( ) , entitySet . getName ( ) ) ; } }
public class RandomDateUtils { /** * Returns a random { @ link ZoneOffset } ( - 18:00 to + 18:00 ) . * @ return the random { @ link ZoneOffset } */ public static ZoneOffset randomZoneOffset ( ) { } }
int totalSeconds = MAX_ZONE_OFFSET_SECONDS - RandomUtils . nextInt ( 0 , MAX_ZONE_OFFSET_SECONDS * 2 + 1 ) ; return ZoneOffset . ofTotalSeconds ( totalSeconds ) ;
public class Account { /** * Sets if a account should ignore his ACL . Only works on Bank accounts . * @ param ignore If the ACL is ignored or not */ public void setIgnoreACL ( boolean ignore ) { } }
Common . getInstance ( ) . getStorageHandler ( ) . getStorageEngine ( ) . setIgnoreACL ( this , ignore ) ; ignoreACL = ignore ;
public class CommonMatchers { public static Matcher < JsonElement > isItemValid ( final Validator validator , final int itemPos ) { } }
return new TypeSafeDiagnosingMatcher < JsonElement > ( ) { @ Override protected boolean matchesSafely ( JsonElement item , Description mismatchDescription ) { // we do not care for the properties if parent item is not JsonArray if ( ! item . isJsonArray ( ) ) return true ; // we also dont care if the item at position is not actually there // if it is needed it will be handled by another matcher if ( item . asJsonArray ( ) . opt ( itemPos ) == null ) return true ; StringBuilder sb = new StringBuilder ( ) ; if ( ! validator . validate ( item . asJsonArray ( ) . opt ( itemPos ) , sb ) ) { mismatchDescription . appendText ( "item at pos: " + itemPos + ", does not validate by validator " + validator . getTitle ( ) ) . appendText ( "\nDetails: " ) . appendText ( sb . toString ( ) ) ; return false ; } return true ; } @ Override public void describeTo ( Description description ) { description . appendText ( "is array item valid" ) ; } } ;
public class ApiOvhVps { /** * List available softwares for this template Id * REST : GET / vps / { serviceName } / distribution / software * @ param serviceName [ required ] The internal name of your VPS offer */ public ArrayList < Long > serviceName_distribution_software_GET ( String serviceName ) throws IOException { } }
String qPath = "/vps/{serviceName}/distribution/software" ; StringBuilder sb = path ( qPath , serviceName ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , t4 ) ;
public class Literal { /** * Checks whether the value represents a complete substring from the from index . * @ param from The start index of the potential substring * @ return < code > true < / code > If the arguments represent a valid substring , < code > false < / code > otherwise . */ boolean matches ( final char [ ] value , final int from ) { } }
// Check the bounds final int len = myCharacters . length ; if ( len + from > value . length || from < 0 ) { return false ; } // Bounds are ok , check all characters . // Allow question marks to match any character for ( int i = 0 ; i < len ; i ++ ) { if ( myCharacters [ i ] != value [ i + from ] && myCharacters [ i ] != '?' ) { return false ; } } // All characters match return true ;