signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class RejoinTaskBuffer { /** * Expand the underlying byte buffer to contain the specified delta * @ param delta amount needed to accommodate the next buffer append */ private void ensureCapacity ( int delta ) { } }
ByteBuffer bb = m_container . b ( ) ; int bufferDelta = ( bb . position ( ) + delta ) - bb . capacity ( ) ; if ( bufferDelta > 0 ) { BBContainer ncntnr = DBBPool . allocateUnsafeByteBuffer ( bb . capacity ( ) + bufferDelta ) ; ByteBuffer newbb = ncntnr . b ( ) ; bb . flip ( ) ; newbb . put ( bb ) ; m_container . discard ( ) ; m_container = ncntnr ; }
public class RecurrenceUtility { /** * Maps a duration unit value from a recurring task record in an MPX file * to a TimeUnit instance . Defaults to days if any problems are encountered . * @ param value integer duration units value * @ return TimeUnit instance */ private static TimeUnit getDurationUnits ( Integer value ) { } }
TimeUnit result = null ; if ( value != null ) { int index = value . intValue ( ) ; if ( index >= 0 && index < DURATION_UNITS . length ) { result = DURATION_UNITS [ index ] ; } } if ( result == null ) { result = TimeUnit . DAYS ; } return ( result ) ;
public class Debug { /** * Returns a string representation of all elements from a * collection , in increasing lexicographic order of their string * representations . */ public static < T > String stringImg ( Collection < T > coll ) { } }
StringBuffer buffer = new StringBuffer ( ) ; buffer . append ( "[ " ) ; for ( T t : sortedCollection ( coll ) ) { buffer . append ( t ) ; buffer . append ( " " ) ; } buffer . append ( "]" ) ; return buffer . toString ( ) ;
public class DataTree { /** * this method traverses the quota path and update the path trie and sets * @ param path */ private void traverseNode ( String path ) { } }
DataNode node = getNode ( path ) ; String children [ ] = null ; synchronized ( node ) { Set < String > childs = node . getChildren ( ) ; if ( childs != null ) { children = childs . toArray ( new String [ childs . size ( ) ] ) ; } } if ( children != null ) { if ( children . length == 0 ) { // this node does not have a child // is the leaf node // check if its the leaf node String endString = "/" + Quotas . limitNode ; if ( path . endsWith ( endString ) ) { // ok this is the limit node // get the real node and update // the count and the bytes String realPath = path . substring ( Quotas . quotaZookeeper . length ( ) , path . indexOf ( endString ) ) ; updateQuotaForPath ( realPath ) ; this . pTrie . addPath ( realPath ) ; } return ; } for ( String child : children ) { traverseNode ( path + "/" + child ) ; } }
public class TextRetinaApiImpl { /** * { @ inheritDoc } */ @ Override public List < Fingerprint > getFingerprintBulk ( Double sparsity , Text ... texts ) throws JsonProcessingException , ApiException { } }
validateRequiredModels ( texts ) ; LOG . debug ( "Retrieve representation for the bulk Text: " + toJson ( texts ) + " sparsity: " + sparsity ) ; return this . api . getRepresentationsForBulkText ( toJson ( texts ) , retinaName , sparsity ) ;
public class Data { /** * Create a new { @ code Data } object with the given parameters . * @ param name the name of the data object * @ param samples the sample list of the data object * @ throws NullPointerException if one of the parameters is { @ code null } * @ return a new { @ code Data } object with the given parameters */ public static Data of ( final String name , final List < Sample > samples ) { } }
return new Data ( name , samples ) ;
public class Utils { /** * Print time difference in minutes , seconds and milliseconds */ public static String printTiming ( long start , long end ) { } }
long totalMillis = end - start ; long mins = TimeUnit . MILLISECONDS . toMinutes ( totalMillis ) ; long secs = TimeUnit . MILLISECONDS . toSeconds ( totalMillis ) - TimeUnit . MINUTES . toSeconds ( mins ) ; long millis = TimeUnit . MILLISECONDS . toMillis ( totalMillis ) - TimeUnit . MINUTES . toMillis ( mins ) - TimeUnit . SECONDS . toMillis ( secs ) ; return String . format ( "%d min, %d sec, %d millis" , mins , secs , millis ) ;
public class FastTSPFitness { /** * Default fitness for FastTSP algorithm . * Returns positive number if configuration { @ link TSP # isSolution ( cz . cvut . felk . cig . jcop . problem . Configuration ) is * solution } , number equals - tourDistance . * If configuration is not solution , returns negative infinity . * @ param configuration attributes to compute fitness * @ return fitness of attributes */ public double getValue ( Configuration configuration ) { } }
double cost = this . problem . pathLength ( configuration ) ; if ( this . problem . isSolution ( configuration ) ) return - cost ; return Double . NEGATIVE_INFINITY ; // if ( this . problem . isSolution ( configuration ) ) // return this . maxDistance - cost ; // return - cost ;
public class bit { /** * Copies the specified range of the specified array into a new array . * @ param data the bits from which a range is to be copied * @ param start the initial index of the range to be copied , inclusive * @ param end the final index of the range to be copied , exclusive . * @ return a new array containing the specified range from the original array * @ throws ArrayIndexOutOfBoundsException if start & lt ; 0 or * start & gt ; data . length * 8 * @ throws IllegalArgumentException if start & gt ; end * @ throws NullPointerException if the { @ code data } array is * { @ code null } . */ public static byte [ ] copy ( final byte [ ] data , final int start , final int end ) { } }
if ( start > end ) { throw new IllegalArgumentException ( String . format ( "start > end: %d > %d" , start , end ) ) ; } if ( start < 0 || start > data . length << 3 ) { throw new ArrayIndexOutOfBoundsException ( String . format ( "%d < 0 || %d > %d" , start , start , data . length * 8 ) ) ; } final int to = min ( data . length << 3 , end ) ; final int byteStart = start >>> 3 ; final int bitStart = start & 7 ; final int bitLength = to - start ; final byte [ ] copy = new byte [ toByteLength ( to - start ) ] ; if ( copy . length > 0 ) { // Perform the byte wise right shift . System . arraycopy ( data , byteStart , copy , 0 , copy . length ) ; // Do the remaining bit wise right shift . shiftRight ( copy , bitStart ) ; // Add the ' lost ' bits from the next byte , if available . if ( data . length > copy . length + byteStart ) { copy [ copy . length - 1 ] |= ( byte ) ( data [ byteStart + copy . length ] << ( Byte . SIZE - bitStart ) ) ; } // Trim ( delete ) the overhanging bits . copy [ copy . length - 1 ] &= 0xFF >>> ( ( copy . length << 3 ) - bitLength ) ; } return copy ;
public class FIMTDDNumericAttributeClassObserver { /** * Implementation of the FindBestSplit algorithm from E . Ikonomovska et al . */ protected AttributeSplitSuggestion searchForBestSplitOption ( Node currentNode , AttributeSplitSuggestion currentBestOption , SplitCriterion criterion , int attIndex ) { } }
// Return null if the current node is null or we have finished looking through all the possible splits if ( currentNode == null || countRightTotal == 0.0 ) { return currentBestOption ; } if ( currentNode . left != null ) { currentBestOption = searchForBestSplitOption ( currentNode . left , currentBestOption , criterion , attIndex ) ; } sumTotalLeft += currentNode . leftStatistics . getValue ( 1 ) ; sumTotalRight -= currentNode . leftStatistics . getValue ( 1 ) ; sumSqTotalLeft += currentNode . leftStatistics . getValue ( 2 ) ; sumSqTotalRight -= currentNode . leftStatistics . getValue ( 2 ) ; countLeftTotal += currentNode . leftStatistics . getValue ( 0 ) ; countRightTotal -= currentNode . leftStatistics . getValue ( 0 ) ; double [ ] [ ] postSplitDists = new double [ ] [ ] { { countLeftTotal , sumTotalLeft , sumSqTotalLeft } , { countRightTotal , sumTotalRight , sumSqTotalRight } } ; double [ ] preSplitDist = new double [ ] { ( countLeftTotal + countRightTotal ) , ( sumTotalLeft + sumTotalRight ) , ( sumSqTotalLeft + sumSqTotalRight ) } ; double merit = criterion . getMeritOfSplit ( preSplitDist , postSplitDists ) ; if ( ( currentBestOption == null ) || ( merit > currentBestOption . merit ) ) { currentBestOption = new AttributeSplitSuggestion ( new NumericAttributeBinaryTest ( attIndex , currentNode . cut_point , true ) , postSplitDists , merit ) ; } if ( currentNode . right != null ) { currentBestOption = searchForBestSplitOption ( currentNode . right , currentBestOption , criterion , attIndex ) ; } sumTotalLeft -= currentNode . leftStatistics . getValue ( 1 ) ; sumTotalRight += currentNode . leftStatistics . getValue ( 1 ) ; sumSqTotalLeft -= currentNode . leftStatistics . getValue ( 2 ) ; sumSqTotalRight += currentNode . leftStatistics . getValue ( 2 ) ; countLeftTotal -= currentNode . leftStatistics . getValue ( 0 ) ; countRightTotal += currentNode . leftStatistics . getValue ( 0 ) ; return currentBestOption ;
public class Field { /** * Is this field not displayed in the given target mode . If not explicitly * set in the definition following defaults apply : * < ul > * < li > ModeConnect : false < / li > * < li > ModeCreate : true < / li > * < li > ModeView : false < / li > * < li > ModeEdit : false < / li > * < li > ModeSearch : true < / li > * < li > ModePrint : false < / li > * < / ul > * @ param _ mode target mode * @ return true if editable in the given mode , else false */ public boolean isNoneDisplay ( final TargetMode _mode ) { } }
boolean ret = false ; if ( this . mode2display . containsKey ( _mode ) ) { ret = this . mode2display . get ( _mode ) . equals ( Field . Display . NONE ) ; } else if ( _mode . equals ( TargetMode . CREATE ) || _mode . equals ( TargetMode . SEARCH ) ) { ret = true ; } return ret ;
public class ErrorPagePool { /** * returns the error page * @ param pe Page Exception * @ return */ public ErrorPage getErrorPage ( PageException pe , short type ) { } }
for ( int i = pages . size ( ) - 1 ; i >= 0 ; i -- ) { ErrorPageImpl ep = ( ErrorPageImpl ) pages . get ( i ) ; if ( ep . getType ( ) == type ) { if ( type == ErrorPage . TYPE_EXCEPTION ) { if ( pe . typeEqual ( ep . getTypeAsString ( ) ) ) return ep ; } else return ep ; } } return null ;
public class UrlValidator { /** * Checks one character , throws IOException if invalid . * @ see java . net . URLEncoder * @ return < code > true < / code > if found the first ' ? ' . */ public static boolean checkCharacter ( int c , boolean foundQuestionMark ) throws IOException { } }
if ( foundQuestionMark ) { switch ( c ) { case '.' : case '-' : case '*' : case '_' : case '+' : // converted space case '%' : // encoded value // Other characters used outside the URL data // case ' : ' : // case ' / ' : // case ' @ ' : // case ' ; ' : // case ' ? ' : // Parameter separators case '=' : case '&' : // Anchor separator case '#' : return true ; default : if ( ( c < 'a' || c > 'z' ) && ( c < 'A' || c > 'Z' ) && ( c < '0' || c > '9' ) ) throw new IOException ( ApplicationResources . accessor . getMessage ( "UrlValidator.invalidCharacter" , Integer . toHexString ( c ) ) ) ; return true ; } } else { return c == '?' ; }
public class ItemDeletion { /** * Checks if the supplied { @ link Item } or any of its { @ link Item # getParent ( ) } are being deleted . * @ param item the item . * @ return { @ code true } if the { @ link Item } or any of its { @ link Item # getParent ( ) } are being deleted . */ public static boolean contains ( @ Nonnull Item item ) { } }
ItemDeletion instance = instance ( ) ; if ( instance == null ) { return false ; } instance . lock . readLock ( ) . lock ( ) ; try { return instance . _contains ( item ) ; } finally { instance . lock . readLock ( ) . unlock ( ) ; }
public class StreamingCinchContext { /** * Executes your streaming job from the spring context . */ public void executeJob ( ) { } }
AbstractApplicationContext springContext = SpringContext . getContext ( getSpringConfigurationClass ( ) ) ; StreamingCinchJob cinchJob = springContext . getBean ( StreamingCinchJob . class ) ; cinchJob . execute ( this ) ;
public class ValidationChangedEvent { /** * Fire the event . * @ param source the source * @ param valid the valid */ public static void fire ( HasHandlers source , boolean valid ) { } }
ValidationChangedEvent eventInstance = new ValidationChangedEvent ( valid ) ; source . fireEvent ( eventInstance ) ;
public class DatabaseManager { /** * Adjust this method for large strings . . . ie multi megabtypes . */ void execute ( ) { } }
String sCmd = null ; if ( 4096 <= ifHuge . length ( ) ) { sCmd = ifHuge ; } else { sCmd = txtCommand . getText ( ) ; } if ( sCmd . startsWith ( "-->>>TEST<<<--" ) ) { testPerformance ( ) ; return ; } String [ ] g = new String [ 1 ] ; lTime = System . currentTimeMillis ( ) ; try { if ( sStatement == null ) { return ; } sStatement . execute ( sCmd ) ; lTime = System . currentTimeMillis ( ) - lTime ; int r = sStatement . getUpdateCount ( ) ; if ( r == - 1 ) { formatResultSet ( sStatement . getResultSet ( ) ) ; } else { g [ 0 ] = "update count" ; gResult . setHead ( g ) ; g [ 0 ] = String . valueOf ( r ) ; gResult . addRow ( g ) ; } addToRecent ( txtCommand . getText ( ) ) ; } catch ( SQLException e ) { lTime = System . currentTimeMillis ( ) - lTime ; g [ 0 ] = "SQL Error" ; gResult . setHead ( g ) ; String s = e . getMessage ( ) ; s += " / Error Code: " + e . getErrorCode ( ) ; s += " / State: " + e . getSQLState ( ) ; g [ 0 ] = s ; gResult . addRow ( g ) ; } updateResult ( ) ; System . gc ( ) ;
public class AfplibPackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EEnum getBeginSegmentCommandLENGTH ( ) { } }
if ( beginSegmentCommandLENGTHEEnum == null ) { beginSegmentCommandLENGTHEEnum = ( EEnum ) EPackage . Registry . INSTANCE . getEPackage ( AfplibPackage . eNS_URI ) . getEClassifiers ( ) . get ( 131 ) ; } return beginSegmentCommandLENGTHEEnum ;
public class PersistentState { /** * cluster _ config files . */ void cleanupClusterConfigFiles ( ) throws IOException { } }
Zxid latestZxid = getLatestZxid ( ) ; List < File > files = getFilesWithPrefix ( this . rootDir , "cluster_config" ) ; if ( files . isEmpty ( ) ) { LOG . error ( "There's no cluster_config files in log directory." ) ; throw new RuntimeException ( "There's no cluster_config files!" ) ; } Iterator < File > iter = files . iterator ( ) ; while ( iter . hasNext ( ) ) { File file = iter . next ( ) ; String fileName = file . getName ( ) ; String strZxid = fileName . substring ( fileName . indexOf ( '.' ) + 1 ) ; Zxid zxid = Zxid . fromSimpleString ( strZxid ) ; if ( zxid . compareTo ( latestZxid ) > 0 ) { // Deletes the config file if its zxid is larger than the latest zxid on // disk . file . delete ( ) ; iter . remove ( ) ; } } if ( files . isEmpty ( ) ) { LOG . error ( "There's no cluster_config files after cleaning up." ) ; throw new RuntimeException ( "There's no cluster_config files!" ) ; } // Persists changes . fsyncDirectory ( ) ;
public class SerializerBase { /** * Tell if two strings are equal , without worry if the first string is null . * @ param p String reference , which may be null . * @ param t String reference , which may be null . * @ return true if strings are equal . */ private static final boolean subPartMatch ( String p , String t ) { } }
return ( p == t ) || ( ( null != p ) && ( p . equals ( t ) ) ) ;
public class ExtensionEdit { /** * This method initializes popupMenuFind * @ return org . parosproxy . paros . extension . ExtensionPopupMenu */ private PopupFindMenu getPopupMenuFind ( ) { } }
if ( popupFindMenu == null ) { popupFindMenu = new PopupFindMenu ( ) ; popupFindMenu . setText ( Constant . messages . getString ( "edit.find.popup" ) ) ; // ZAP : i18n popupFindMenu . addActionListener ( new java . awt . event . ActionListener ( ) { @ Override public void actionPerformed ( java . awt . event . ActionEvent e ) { JTextComponent component = popupFindMenu . getLastInvoker ( ) ; Window window = getWindowAncestor ( component ) ; if ( window != null ) { showFindDialog ( window , component ) ; } } } ) ; } return popupFindMenu ;
public class InstructionView { /** * Use this method inside a { @ link ProgressChangeListener } to update this view with all other information * that is not updated by the { @ link InstructionView # updateBannerInstructionsWith ( Milestone ) } . * This includes the distance remaining , instruction list , turn lanes , and next step information . * @ param routeProgress for route data used to populate the views * @ since 0.20.0 */ public void updateDistanceWith ( RouteProgress routeProgress ) { } }
if ( routeProgress != null && ! isRerouting ) { InstructionModel model = new InstructionModel ( distanceFormatter , routeProgress ) ; updateDataFromInstruction ( model ) ; }
public class EventSubscription { /** * A list of source IDs for the event notification subscription . * @ param sourceIdsList * A list of source IDs for the event notification subscription . */ public void setSourceIdsList ( java . util . Collection < String > sourceIdsList ) { } }
if ( sourceIdsList == null ) { this . sourceIdsList = null ; return ; } this . sourceIdsList = new java . util . ArrayList < String > ( sourceIdsList ) ;
public class LabelOperationMetadata { /** * < code > * . google . cloud . datalabeling . v1beta1 . LabelVideoObjectTrackingOperationMetadata video _ object _ tracking _ details = 7; * < / code > */ public com . google . cloud . datalabeling . v1beta1 . LabelVideoObjectTrackingOperationMetadataOrBuilder getVideoObjectTrackingDetailsOrBuilder ( ) { } }
if ( detailsCase_ == 7 ) { return ( com . google . cloud . datalabeling . v1beta1 . LabelVideoObjectTrackingOperationMetadata ) details_ ; } return com . google . cloud . datalabeling . v1beta1 . LabelVideoObjectTrackingOperationMetadata . getDefaultInstance ( ) ;
public class Parser { /** * When this is called , the identifier token has already been read . */ private AssignmentStatement parseAssignmentStatement ( Token token ) throws IOException { } }
// TODO : allow lvalue to support dot notations // ie : field = x ( store local variable ) // obj . field = x ( obj . setField ) // obj . field . field = x ( obj . getField ( ) . setField ) // array [ idx ] = x ( array [ idx ] ) // list [ idx ] = x ( list . set ( idx , x ) ) // map [ key ] = x ( map . put ( key , x ) ) // map [ obj . name ] = x ( map . put ( obj . getName ( ) , x ) SourceInfo info = token . getSourceInfo ( ) ; VariableRef lvalue = parseLValue ( token ) ; if ( peek ( ) . getID ( ) == Token . ASSIGN ) { read ( ) ; } else { error ( "assignment.equals.expected" , peek ( ) ) ; } Expression rvalue = parseExpression ( ) ; info = info . setEndPosition ( rvalue . getSourceInfo ( ) ) ; // Start mod for ' as ' keyword for declarative typing if ( peek ( ) . getID ( ) == Token . AS ) { read ( ) ; TypeName typeName = parseTypeName ( ) ; SourceInfo info2 = peek ( ) . getSourceInfo ( ) ; lvalue . setVariable ( new Variable ( info2 , lvalue . getName ( ) , typeName , true ) ) ; } // End mod return new AssignmentStatement ( info , lvalue , rvalue ) ;
public class MapUtils { /** * Extract a date value from the map . If the extracted value is * a string , parse it as a { @ link Date } using the specified date - time format . * @ param map * @ param key * @ param dateTimeFormat * @ return * @ since 0.6.3.1 */ public static Date getDate ( Map < String , Object > map , String key , String dateTimeFormat ) { } }
Object obj = map . get ( key ) ; return obj instanceof Number ? new Date ( ( ( Number ) obj ) . longValue ( ) ) : ( obj instanceof String ? DateFormatUtils . fromString ( obj . toString ( ) , dateTimeFormat ) : ( obj instanceof Date ? ( Date ) obj : null ) ) ;
public class ProjectsInner { /** * Delete project . * The project resource is a nested resource representing a stored migration project . The DELETE method deletes a project . * @ param groupName Name of the resource group * @ param serviceName Name of the service * @ param projectName Name of the project * @ 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 < Void > deleteAsync ( String groupName , String serviceName , String projectName , final ServiceCallback < Void > serviceCallback ) { } }
return ServiceFuture . fromResponse ( deleteWithServiceResponseAsync ( groupName , serviceName , projectName ) , serviceCallback ) ;
public class RequestUtil { /** * getBodyAsMultiValuedMap . * @ param request * a { @ link com . cloudcontrolled . api . request . Request } object . * @ param < T > * a T object . * @ return a { @ link javax . ws . rs . core . MultivaluedMap } object . */ public static < T > MultivaluedMap < String , String > getBodyAsMultiValuedMap ( Request < T > request ) { } }
MultivaluedMap < String , String > map = new BodyMultivaluedMap ( ) ; Class < ? > referenceClazz = request . getClass ( ) ; List < Field > fields = ClassUtil . getAnnotatedFields ( referenceClazz , Body . class ) ; for ( Field field : fields ) { Body body = field . getAnnotation ( Body . class ) ; String parameter = body . value ( ) ; // in case the value ( ) is null or empty if ( parameter == null || ( parameter != null && parameter . isEmpty ( ) ) ) { parameter = field . getName ( ) ; } String value = ClassUtil . getValueOf ( field , request , referenceClazz , String . class ) ; map . putSingle ( parameter , value ) ; } return map ;
public class GIUtils { /** * Computes which fraction of the time series is covered by the rules set . * @ param seriesLength the time series length . * @ param rules the grammar rules set . * @ return a fraction covered by the rules . */ public static double getCoverAsFraction ( int seriesLength , GrammarRules rules ) { } }
boolean [ ] coverageArray = new boolean [ seriesLength ] ; for ( GrammarRuleRecord rule : rules ) { if ( 0 == rule . ruleNumber ( ) ) { continue ; } ArrayList < RuleInterval > arrPos = rule . getRuleIntervals ( ) ; for ( RuleInterval saxPos : arrPos ) { int startPos = saxPos . getStart ( ) ; int endPos = saxPos . getEnd ( ) ; for ( int j = startPos ; j < endPos ; j ++ ) { coverageArray [ j ] = true ; } } } int coverSum = 0 ; for ( int i = 0 ; i < seriesLength ; i ++ ) { if ( coverageArray [ i ] ) { coverSum ++ ; } } return ( double ) coverSum / ( double ) seriesLength ;
public class DaySchedule { /** * Sleeps till a future time . */ private final void sleepTill ( long future ) throws InterruptedException { } }
long milliseconds = future - logicalClockMillis ( ) ; if ( milliseconds > 0 ) { Thread . sleep ( milliseconds ) ; }
public class CliPrinter { /** * Print suggestions . * @ param suggestions Suggestions to print . */ public void printSuggestions ( Suggestions suggestions ) { } }
final PrintContext context = new PrintContext ( ) ; context . append ( "Suggestions:" ) . println ( ) ; context . incIndent ( ) ; printSuggestions0 ( context , suggestions . getDirectorySuggestions ( ) , "Directories" ) ; printSuggestions0 ( context , suggestions . getCommandSuggestions ( ) , "Commands" ) ; printSuggestions0 ( context , suggestions . getParamNameSuggestions ( ) , "Parameter names" ) ; printSuggestions0 ( context , suggestions . getParamValueSuggestions ( ) , "Parameter values" ) ; context . decIndent ( ) ;
public class DescribeDeliveryStreamRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( DescribeDeliveryStreamRequest describeDeliveryStreamRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( describeDeliveryStreamRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( describeDeliveryStreamRequest . getDeliveryStreamName ( ) , DELIVERYSTREAMNAME_BINDING ) ; protocolMarshaller . marshall ( describeDeliveryStreamRequest . getLimit ( ) , LIMIT_BINDING ) ; protocolMarshaller . marshall ( describeDeliveryStreamRequest . getExclusiveStartDestinationId ( ) , EXCLUSIVESTARTDESTINATIONID_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class Sql { /** * Performs a stored procedure call with the given parameters . The closure * is called once with all the out parameters . * Example usage - suppose we create a stored procedure ( ignore its simplistic implementation ) : * < pre > * / / Tested with MySql 5.0.75 * sql . execute " " " * CREATE PROCEDURE Hemisphere ( * IN p _ firstname VARCHAR ( 50 ) , * IN p _ lastname VARCHAR ( 50 ) , * OUT ans VARCHAR ( 50 ) ) * BEGIN * DECLARE loc INT ; * SELECT location _ id into loc FROM PERSON where firstname = p _ firstname and lastname = p _ lastname ; * CASE loc * WHEN 40 THEN * SET ans = ' Southern Hemisphere ' ; * ELSE * SET ans = ' Northern Hemisphere ' ; * END CASE ; * END ; * < / pre > * we can now call the stored procedure as follows : * < pre > * sql . call ' { call Hemisphere ( ? , ? , ? ) } ' , [ ' Guillaume ' , ' Laforge ' , Sql . VARCHAR ] , { dwells { @ code - > } * println dwells * < / pre > * which will output ' < code > Northern Hemisphere < / code > ' . * We can also access stored functions with scalar return values where the return value * will be treated as an OUT parameter . Here are examples for various databases for * creating such a procedure : * < pre > * / / Tested with MySql 5.0.75 * sql . execute " " " * create function FullName ( p _ firstname VARCHAR ( 40 ) ) returns VARCHAR ( 80) * begin * declare ans VARCHAR ( 80 ) ; * SELECT CONCAT ( firstname , ' ' , lastname ) INTO ans FROM PERSON WHERE firstname = p _ firstname ; * return ans ; * end * / / Tested with MS SQLServer Express 2008 * sql . execute " " " * { @ code create function FullName ( @ firstname VARCHAR ( 40 ) ) returns VARCHAR ( 80 ) } * begin * declare { @ code @ ans } VARCHAR ( 80) * { @ code SET @ ans = ( SELECT firstname + ' ' + lastname FROM PERSON WHERE firstname = @ firstname ) } * return { @ code @ ans } * end * / / Tested with Oracle XE 10g * sql . execute " " " * create function FullName ( p _ firstname VARCHAR ) return VARCHAR is * ans VARCHAR ( 80 ) ; * begin * SELECT CONCAT ( CONCAT ( firstname , ' ' ) , lastname ) INTO ans FROM PERSON WHERE firstname = p _ firstname ; * return ans ; * end ; * < / pre > * and here is how you access the stored function for all databases : * < pre > * sql . call ( " { ? = call FullName ( ? ) } " , [ Sql . VARCHAR , ' Sam ' ] ) { name { @ code - > } * assert name = = ' Sam Pullara ' * < / pre > * Resource handling is performed automatically where appropriate . * @ param sql the sql statement * @ param params a list of parameters * @ param closure called for each row with a GroovyResultSet * @ throws SQLException if a database access error occurs */ public void call ( String sql , List < Object > params , Closure closure ) throws Exception { } }
callWithRows ( sql , params , NO_RESULT_SETS , closure ) ;
public class DefaultGroovyMethods { /** * Selects the maximum value found from the Iterator using the given comparator . * @ param self an Iterator * @ param comparator a Comparator * @ return the maximum value * @ since 1.5.5 */ public static < T > T max ( Iterator < T > self , Comparator < T > comparator ) { } }
return max ( ( Iterable < T > ) toList ( self ) , comparator ) ;
public class ParosTableHistory { /** * Returns all the history record IDs of the given session except the ones with the given history types . * @ param sessionId the ID of session of the history records * @ param histTypes the history types of the history records that should be excluded * @ return a { @ code List } with all the history IDs of the given session and history types , never { @ code null } * @ throws DatabaseException if an error occurred while getting the history IDs * @ since 2.3.0 * @ see # getHistoryIdsOfHistType ( long , int . . . ) */ @ Override public List < Integer > getHistoryIdsExceptOfHistType ( long sessionId , int ... histTypes ) throws DatabaseException { } }
return getHistoryIdsByParams ( sessionId , 0 , false , histTypes ) ;
public class GenomicsFactory { /** * Create a new genomics stub from the given service account ID and private key { @ link File } . * @ param serviceAccountId The service account ID ( typically an email address ) * @ param p12File The file on disk containing the private key * @ return The new { @ code Genomics } stub * @ throws GeneralSecurityException * @ throws IOException */ public Genomics fromServiceAccount ( String serviceAccountId , File p12File ) throws GeneralSecurityException , IOException { } }
Preconditions . checkNotNull ( serviceAccountId ) ; Preconditions . checkNotNull ( p12File ) ; return fromServiceAccount ( getGenomicsBuilder ( ) , serviceAccountId , p12File ) . build ( ) ;
public class Matrices { /** * Creates a const function that evaluates it ' s argument to given { @ code value } . * @ param arg a const value * @ return a closure object that does { @ code _ } */ public static MatrixFunction asConstFunction ( final double arg ) { } }
return new MatrixFunction ( ) { @ Override public double evaluate ( int i , int j , double value ) { return arg ; } } ;
public class JedisUtils { /** * Create a new { @ link JedisCluster } . * @ param poolConfig * format { @ code host1 : port1 , host2 : port2 , . . . } , default Redis port is used if not * specified * @ param password * @ param timeoutMs * @ param maxAttempts * @ return */ public static JedisCluster newJedisCluster ( JedisPoolConfig poolConfig , String hostsAndPorts , String password , int timeoutMs , int maxAttempts ) { } }
Set < HostAndPort > clusterNodes = new HashSet < > ( ) ; String [ ] hapList = hostsAndPorts . split ( "[,;\\s]+" ) ; for ( String hostAndPort : hapList ) { String [ ] tokens = hostAndPort . split ( ":" ) ; String host = tokens . length > 0 ? tokens [ 0 ] : Protocol . DEFAULT_HOST ; int port = tokens . length > 1 ? Integer . parseInt ( tokens [ 1 ] ) : Protocol . DEFAULT_PORT ; clusterNodes . add ( new HostAndPort ( host , port ) ) ; } JedisCluster jedisCluster = new JedisCluster ( clusterNodes , timeoutMs , timeoutMs , maxAttempts , StringUtils . isBlank ( password ) ? null : password , poolConfig != null ? poolConfig : defaultJedisPoolConfig ( ) ) ; return jedisCluster ;
public class FileUtils { /** * Resolve file path against a base directory path . Normalize the input file path , by replacing all the ' \ \ ' , ' / ' with * File . seperator , and removing ' . . ' from the directory . * < p > Note : the substring behind " # " will be removed . < / p > * @ param basedir base dir , may be { @ code null } * @ param filepath file path * @ return normalized path */ @ Deprecated public static File resolve ( final String basedir , final String filepath ) { } }
final File pathname = new File ( normalizePath ( stripFragment ( filepath ) , File . separator ) ) ; if ( basedir == null || basedir . length ( ) == 0 ) { return pathname ; } final String normilizedPath = new File ( basedir , pathname . getPath ( ) ) . getPath ( ) ; return new File ( normalizePath ( normilizedPath , File . separator ) ) ;
public class AbstractDecimal { /** * Wraps BigDecimal ' s divide method to enforce the default rounding * behavior * @ param divisor the value to divide by * @ return result of dividing this value by the given divisor * @ throws IllegalArgumentException if the given divisor is null */ public T divide ( T divisor ) { } }
if ( divisor == null ) { throw new IllegalArgumentException ( "invalid (null) divisor" ) ; } BigDecimal quotient = this . value . divide ( divisor . value , ROUND_BEHAVIOR ) ; return newInstance ( quotient , this . value . scale ( ) ) ;
public class WebClientConfigurer { /** * Return a set of { @ link ExchangeStrategies } driven by registered { @ link HypermediaType } s . * @ return a collection of { @ link Encoder } s and { @ link Decoder } assembled into a { @ link ExchangeStrategies } . */ public ExchangeStrategies hypermediaExchangeStrategies ( ) { } }
List < Encoder < ? > > encoders = new ArrayList < > ( ) ; List < Decoder < ? > > decoders = new ArrayList < > ( ) ; this . hypermediaTypes . forEach ( hypermedia -> { ObjectMapper objectMapper = hypermedia . configureObjectMapper ( this . mapper . copy ( ) ) ; MimeType [ ] mimeTypes = hypermedia . getMediaTypes ( ) . toArray ( new MimeType [ 0 ] ) ; encoders . add ( new Jackson2JsonEncoder ( objectMapper , mimeTypes ) ) ; decoders . add ( new Jackson2JsonDecoder ( objectMapper , mimeTypes ) ) ; } ) ; return ExchangeStrategies . builder ( ) . codecs ( clientCodecConfigurer -> { encoders . forEach ( encoder -> clientCodecConfigurer . customCodecs ( ) . encoder ( encoder ) ) ; decoders . forEach ( decoder -> clientCodecConfigurer . customCodecs ( ) . decoder ( decoder ) ) ; } ) . build ( ) ;
public class JarURLConnection { /** * Returns the main Attributes for the JAR file for this * connection . * @ return the main Attributes for the JAR file for this * connection . * @ exception IOException if getting the manifest causes an * IOException to be thrown . * @ see # getJarFile * @ see # getManifest */ public Attributes getMainAttributes ( ) throws IOException { } }
Manifest man = getManifest ( ) ; return man != null ? man . getMainAttributes ( ) : null ;
public class DoubleArray { /** * Returns the corresponding value if the key is found . Otherwise returns - 1. * @ param key search key * @ return found value */ public int exactMatchSearch ( byte [ ] key ) { } }
int unit = _array [ 0 ] ; int nodePos = 0 ; for ( byte b : key ) { // nodePos ^ = unit . offset ( ) ^ b nodePos ^= ( ( unit >>> 10 ) << ( ( unit & ( 1 << 9 ) ) >>> 6 ) ) ^ ( b & 0xFF ) ; unit = _array [ nodePos ] ; // if ( unit . label ( ) ! = b ) if ( ( unit & ( ( 1 << 31 ) | 0xFF ) ) != ( b & 0xff ) ) { return - 1 ; } } // if ( ! unit . has _ leaf ( ) ) { if ( ( ( unit >>> 8 ) & 1 ) != 1 ) { return - 1 ; } // unit = _ array [ nodePos ^ unit . offset ( ) ] ; unit = _array [ nodePos ^ ( ( unit >>> 10 ) << ( ( unit & ( 1 << 9 ) ) >>> 6 ) ) ] ; // return unit . value ( ) ; return unit & ( ( 1 << 31 ) - 1 ) ;
public class JsHdrsImpl { /** * Set the value of the ExceptionReason in the message header . * Javadoc description supplied by JsMessage interface . */ public final void setExceptionReason ( int value ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "setExceptionReason" , Integer . valueOf ( value ) ) ; boolean wasEmpty = ( getHdr2 ( ) . getChoiceField ( JsHdr2Access . EXCEPTION ) == JsHdr2Access . IS_EXCEPTION_EMPTY ) ; getHdr2 ( ) . setIntField ( JsHdr2Access . EXCEPTION_DETAIL_REASON , value ) ; if ( wasEmpty ) { // Need to mark the optional exception fields as empty getHdr2 ( ) . setChoiceField ( JsHdr2Access . EXCEPTION_DETAIL_PROBLEMDESTINATION , JsHdr2Access . IS_EXCEPTION_DETAIL_PROBLEMDESTINATION_EMPTY ) ; getHdr2 ( ) . setChoiceField ( JsHdr2Access . EXCEPTION_DETAIL_PROBLEMSUBSCRIPTION , JsHdr2Access . IS_EXCEPTION_DETAIL_PROBLEMSUBSCRIPTION_EMPTY ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "setExceptionReason" ) ;
public class LinkedIOSubchannel { /** * The { @ link # toString ( ) } method of { @ link LinkedIOSubchannel } s * shows the channel together with the upstream channel that it * is linked to . If there are several levels of upstream links , * this can become a very long sequence . * This method creates the representation of the linked upstream * channel ( an arrow followed by the representation of the channel ) , * but only up to one level . If more levels exist , it returns * an arrow followed by an ellipses . This method is used by * { @ link LinkedIOSubchannel # toString ( ) } . Other implementations * of { @ link IOSubchannel } should use this method in their * { @ link Object # toString ( ) } method as well to keep the result * consistent . * @ param upstream the upstream channel * @ return the string */ public static String upstreamToString ( Channel upstream ) { } }
if ( upstream == null ) { linkedRemaining . set ( null ) ; return "" ; } if ( linkedRemaining . get ( ) == null ) { linkedRemaining . set ( 1 ) ; } if ( linkedRemaining . get ( ) <= 0 ) { linkedRemaining . set ( null ) ; return "↔…" ; } linkedRemaining . set ( linkedRemaining . get ( ) - 1 ) ; // Build continuation . StringBuilder builder = new StringBuilder ( ) ; builder . append ( '↔' ) . append ( Channel . toString ( upstream ) ) ; linkedRemaining . set ( null ) ; return builder . toString ( ) ;
public class XmlUtil { /** * Loads XML from string and uses referenced XSD to validate the content . * This method will use { @ link XmlErrorHandlerQuiet } to suppress all errors / warnings when validating . * @ param _ xmlStr string to validate * @ param _ namespaceAware take care of namespace * @ return Document * @ throws IOException on error */ public static Document parseXmlStringWithXsdValidation ( String _xmlStr , boolean _namespaceAware ) throws IOException { } }
return parseXmlStringWithXsdValidation ( _xmlStr , _namespaceAware , null ) ;
public class MapBindTransformation { /** * Generate parse on jackson internal . * @ param context the context * @ param methodBuilder the method builder * @ param parserName the parser name * @ param beanClass the bean class * @ param beanName the bean name * @ param property the property * @ param onString the on string */ public void generateParseOnJacksonInternal ( BindTypeContext context , Builder methodBuilder , String parserName , TypeName beanClass , String beanName , BindProperty property , boolean onString ) { } }
// define key and value type ParameterizedTypeName mapTypeName = ( ParameterizedTypeName ) property . getPropertyType ( ) . getTypeName ( ) ; TypeName keyTypeName = mapTypeName . typeArguments . get ( 0 ) ; TypeName valueTypeName = mapTypeName . typeArguments . get ( 1 ) ; // @ formatter : off methodBuilder . beginControlFlow ( "if ($L.currentToken()==$T.START_ARRAY)" , parserName , JsonToken . class ) ; methodBuilder . addStatement ( "$T<$T, $T> collection=new $T<>()" , defineMapClass ( mapTypeName ) , keyTypeName , valueTypeName , defineMapClass ( mapTypeName ) ) ; BindTransform transformKey = BindTransformer . lookup ( keyTypeName ) ; BindProperty elementKeyProperty = BindProperty . builder ( keyTypeName , property ) . inCollection ( false ) . xmlType ( property . xmlInfo . mapEntryType . toXmlType ( ) ) . elementName ( property . mapKeyName ) . nullable ( false ) . build ( ) ; BindTransform transformValue = BindTransformer . lookup ( valueTypeName ) ; BindProperty elementValueProperty = BindProperty . builder ( valueTypeName , property ) . inCollection ( false ) . xmlType ( property . xmlInfo . mapEntryType . toXmlType ( ) ) . elementName ( property . mapValueName ) . nullable ( true ) . build ( ) ; methodBuilder . addStatement ( "$T key=$L" , elementKeyProperty . getPropertyType ( ) . getTypeName ( ) , DEFAULT_VALUE ) ; methodBuilder . addStatement ( "$T value=$L" , elementValueProperty . getPropertyType ( ) . getTypeName ( ) , DEFAULT_VALUE ) ; if ( onString ) { methodBuilder . addStatement ( "$T current" , JsonToken . class ) ; methodBuilder . addStatement ( "String tempValue=null" ) ; } methodBuilder . beginControlFlow ( "while ($L.nextToken() != $T.END_ARRAY)" , parserName , JsonToken . class ) ; if ( onString ) { // on string methodBuilder . addStatement ( "current=$L.currentToken()" , parserName ) ; methodBuilder . beginControlFlow ( "for (int i=0; i<2 ;i++)" ) ; methodBuilder . beginControlFlow ( "while (current != $T.FIELD_NAME)" , JsonToken . class ) ; methodBuilder . addStatement ( "current=$L.nextToken()" , parserName ) ; methodBuilder . endControlFlow ( ) ; methodBuilder . addStatement ( "$L.nextValue()" , parserName ) ; methodBuilder . addCode ( "switch(jacksonParser.getCurrentName()) {\n" ) ; methodBuilder . addCode ( "case $S:$>\n" , property . mapKeyName ) ; transformKey . generateParseOnJacksonAsString ( context , methodBuilder , parserName , null , "key" , elementKeyProperty ) ; methodBuilder . addStatement ( "$<break" ) ; methodBuilder . addCode ( "case $S:$>\n" , property . mapValueName ) ; methodBuilder . addStatement ( "tempValue=$L.getValueAsString()" , parserName ) ; methodBuilder . beginControlFlow ( "if ($L.currentToken()==$T.VALUE_STRING && \"null\".equals(tempValue))" , parserName , JsonToken . class ) ; methodBuilder . addStatement ( "value=$L" , DEFAULT_VALUE ) ; methodBuilder . nextControlFlow ( "else" ) ; transformValue . generateParseOnJacksonAsString ( context , methodBuilder , parserName , null , "value" , elementValueProperty ) ; methodBuilder . endControlFlow ( ) ; methodBuilder . addStatement ( "$<break" ) ; methodBuilder . addCode ( "}\n" ) ; methodBuilder . endControlFlow ( ) ; } else { // key methodBuilder . addStatement ( "$L.nextValue()" , parserName ) ; transformKey . generateParseOnJackson ( context , methodBuilder , parserName , null , "key" , elementKeyProperty ) ; // value methodBuilder . addStatement ( "$L.nextValue()" , parserName ) ; transformValue . generateParseOnJackson ( context , methodBuilder , parserName , null , "value" , elementValueProperty ) ; } methodBuilder . addStatement ( "collection.put(key, value)" ) ; methodBuilder . addStatement ( "key=$L" , DEFAULT_VALUE ) ; methodBuilder . addStatement ( "value=$L" , DEFAULT_VALUE ) ; methodBuilder . addStatement ( "$L.nextToken()" , parserName ) ; methodBuilder . endControlFlow ( ) ; methodBuilder . addStatement ( setter ( beanClass , beanName , property , "collection" ) ) ; methodBuilder . endControlFlow ( ) ; // @ formatter : on
public class NewJFrame { /** * Validate and set the datetime field on the screen given a datetime string . * @ param dateTime The datetime string */ public void setDate ( String dateString ) { } }
Date date = null ; try { if ( ( dateString != null ) && ( dateString . length ( ) > 0 ) ) date = dateFormat . parse ( dateString ) ; } catch ( Exception e ) { date = null ; } this . setDate ( date ) ;
public class MessageStack { /** * Free all the resources belonging to this applet . If all applet screens are closed , shut down the applet . */ public void free ( ) { } }
if ( m_messageStackOwner != null ) // Always m_messageStackOwner . setMessageStack ( null ) ; m_messageStackOwner = null ; if ( m_bWaiting ) { synchronized ( m_thread ) { if ( m_bWaiting ) // Inside the sync block m_stack . removeAllElements ( ) ; m_bWaiting = false ; if ( m_thread != null ) { m_stack = null ; m_thread . interrupt ( ) ; } m_thread = null ; } } m_stack = null ; m_thread = null ;
public class AppEngineDatastoreService { /** * Gets App Engine Datastore entity corresponding to the specified * { @ code Key } within the specified { @ code Transaction } . * @ param transaction The transaction to get the entity . * @ param key The key to get the entity . * @ return The entity corresponding to the specified { @ code Key } . */ public Entity get ( Transaction transaction , Key key ) { } }
try { return datastore . get ( transaction , key ) ; } catch ( EntityNotFoundException e ) { return null ; }
public class WebAppDescriptorImpl { /** * Returns all < code > error - page < / code > elements * @ return list of < code > error - page < / code > */ public List < ErrorPageType < WebAppDescriptor > > getAllErrorPage ( ) { } }
List < ErrorPageType < WebAppDescriptor > > list = new ArrayList < ErrorPageType < WebAppDescriptor > > ( ) ; List < Node > nodeList = model . get ( "error-page" ) ; for ( Node node : nodeList ) { ErrorPageType < WebAppDescriptor > type = new ErrorPageTypeImpl < WebAppDescriptor > ( this , "error-page" , model , node ) ; list . add ( type ) ; } return list ;
public class JsonPropertyMeta { /** * Gets a new instance of property builder for the given coder router . * @ param router * @ return a new property builder instance * @ author vvakame */ public JsonPropertyBuilder < T , P > router ( JsonCoderRouter < P > router ) { } }
return new JsonPropertyBuilder < T , P > ( coderClass , name , null , router ) ;
public class AccessLogSource { /** * { @ inheritDoc } */ @ Override public void setBufferManager ( BufferManager bufferMgr ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( tc , "Setting buffer manager " + this ) ; } this . bufferMgr = bufferMgr ; startSource ( ) ;
public class CmsVfsService { /** * Internal version of getResourceHistory . < p > * @ param structureId the structure id of the resource * @ return the resource history * @ throws CmsException if something goes wrong */ public CmsHistoryResourceCollection getResourceHistoryInternal ( CmsUUID structureId ) throws CmsException { } }
CmsHistoryResourceCollection result = new CmsHistoryResourceCollection ( ) ; CmsObject cms = getCmsObject ( ) ; CmsResource resource = cms . readResource ( structureId , CmsResourceFilter . ALL ) ; List < I_CmsHistoryResource > versions = cms . readAllAvailableVersions ( resource ) ; if ( ! resource . getState ( ) . isUnchanged ( ) ) { result . add ( createHistoryResourceBean ( cms , resource , true , - 1 ) ) ; } int maxVersion = 0 ; if ( versions . isEmpty ( ) ) { try { CmsProject online = cms . readProject ( CmsProject . ONLINE_PROJECT_ID ) ; CmsObject onlineCms = OpenCms . initCmsObject ( cms ) ; onlineCms . getRequestContext ( ) . setCurrentProject ( online ) ; CmsResource onlineResource = onlineCms . readResource ( structureId , CmsResourceFilter . ALL ) ; CmsHistoryResourceBean onlineResBean = createHistoryResourceBean ( onlineCms , onlineResource , false , 0 ) ; result . add ( onlineResBean ) ; } catch ( CmsVfsResourceNotFoundException e ) { LOG . info ( e . getLocalizedMessage ( ) , e ) ; } catch ( Exception e ) { LOG . error ( e . getLocalizedMessage ( ) , e ) ; } } else { for ( I_CmsHistoryResource historyRes : versions ) { maxVersion = Math . max ( maxVersion , historyRes . getVersion ( ) ) ; } for ( I_CmsHistoryResource historyRes : versions ) { CmsHistoryResourceBean historyBean = createHistoryResourceBean ( cms , ( CmsResource ) historyRes , false , maxVersion ) ; result . add ( historyBean ) ; } } return result ;
public class BaseMessageManager { /** * Send this message to the appropriate queue . * The message ' s message header has the queue name and type . * @ param The message to send . * @ return An error code . */ public int sendMessage ( Message message ) { } }
BaseMessageHeader messageHeader = ( ( BaseMessage ) message ) . getMessageHeader ( ) ; String strQueueType = messageHeader . getQueueType ( ) ; String strQueueName = messageHeader . getQueueName ( ) ; MessageSender sender = this . getMessageQueue ( strQueueName , strQueueType ) . getMessageSender ( ) ; if ( sender != null ) sender . sendMessage ( message ) ; else return Constant . ERROR_RETURN ; // Queue doesn ' t exist return Constant . NORMAL_RETURN ;
public class ReconciliationLineItemReport { /** * Gets the netBillableRevenue value for this ReconciliationLineItemReport . * @ return netBillableRevenue * The net billable revenue . If this reconciliation data is for * a { @ link ProposalLineItem } , * this is calculated from the { @ link # netRate } , { @ link * # billableVolume } , and the proposal line * item ' s billing settings . This may be { @ code null } * for certain billing settings . * Otherwise , this is calculated from the { @ link # netRate } * and { @ link # billableVolume } . * This value is read - only . */ public com . google . api . ads . admanager . axis . v201811 . Money getNetBillableRevenue ( ) { } }
return netBillableRevenue ;
public class BasePool { /** * Set the { @ link StackTraceElement } for the given { @ link Throwable } , using the { @ link Class } and method name . */ static < T extends Throwable > T unknownStackTrace ( T cause , Class < ? > clazz , String method ) { } }
cause . setStackTrace ( new StackTraceElement [ ] { new StackTraceElement ( clazz . getName ( ) , method , null , - 1 ) } ) ; return cause ;
public class NioSocketAcceptor { /** * but also allow explicit setting of the Netty property ( for internal testing purposes ) */ static void initSelectTimeout ( ) { } }
String currentTimeout = System . getProperty ( PROPERTY_NETTY_SELECT_TIMEOUT ) ; if ( currentTimeout == null || "" . equals ( currentTimeout ) ) { try { System . setProperty ( PROPERTY_NETTY_SELECT_TIMEOUT , Long . toString ( DEFAULT_SELECT_TIMEOUT_MILLIS ) ) ; } catch ( SecurityException e ) { if ( logger . isWarnEnabled ( ) ) { logger . warn ( String . format ( "Unable to set System property \"%s\" to %d due to %s, Gateway performance may be reduced" , PROPERTY_NETTY_SELECT_TIMEOUT , DEFAULT_SELECT_TIMEOUT_MILLIS , e ) ) ; } } }
public class RedundentExprEliminator { /** * Find the previous occurance of a xsl : variable . Stop * the search when a xsl : for - each , xsl : template , or xsl : stylesheet is * encountered . * @ param elem Should be non - null template element . * @ return The first previous occurance of an xsl : variable or xsl : param , * or null if none is found . */ protected ElemVariable getPrevVariableElem ( ElemTemplateElement elem ) { } }
// This could be somewhat optimized . since getPreviousSiblingElem is a // fairly expensive operation . while ( null != ( elem = getPrevElementWithinContext ( elem ) ) ) { int type = elem . getXSLToken ( ) ; if ( ( Constants . ELEMNAME_VARIABLE == type ) || ( Constants . ELEMNAME_PARAMVARIABLE == type ) ) { return ( ElemVariable ) elem ; } } return null ;
public class IOUtils { /** * Write object to a file with the specified name . * @ param o * object to be written to file * @ param filename * name of the temp file * @ return File containing the object , or null if an exception was caught */ public static File writeObjectToFileNoExceptions ( Object o , String filename ) { } }
File file = null ; ObjectOutputStream oos = null ; try { file = new File ( filename ) ; // file . createNewFile ( ) ; / / cdm may 2005 : does nothing needed oos = new ObjectOutputStream ( new BufferedOutputStream ( new GZIPOutputStream ( new FileOutputStream ( file ) ) ) ) ; oos . writeObject ( o ) ; oos . close ( ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } finally { closeIgnoringExceptions ( oos ) ; } return file ;
public class SloppyClassReflection { /** * overrides the visitor to collect all class references * @ param classContext * the class context of the currently visited class */ @ Override public void visitClassContext ( ClassContext classContext ) { } }
try { refClasses = new HashSet < > ( ) ; refClasses . add ( classContext . getJavaClass ( ) . getClassName ( ) ) ; state = State . COLLECT ; super . visitClassContext ( classContext ) ; state = State . SEEN_NOTHING ; super . visitClassContext ( classContext ) ; } finally { refClasses = null ; }
public class MetricDataResult { /** * The timestamps for the data points , formatted in Unix timestamp format . The number of timestamps always matches * the number of values and the value for Timestamps [ x ] is Values [ x ] . * @ param timestamps * The timestamps for the data points , formatted in Unix timestamp format . The number of timestamps always * matches the number of values and the value for Timestamps [ x ] is Values [ x ] . */ public void setTimestamps ( java . util . Collection < java . util . Date > timestamps ) { } }
if ( timestamps == null ) { this . timestamps = null ; return ; } this . timestamps = new com . amazonaws . internal . SdkInternalList < java . util . Date > ( timestamps ) ;
public class LuceneUtil { /** * Get the generation ( N ) of the current segments _ N file in the directory . * @ param directory - - directory to search for the latest segments _ N file */ public static long getCurrentSegmentGeneration ( Directory directory ) throws IOException { } }
String [ ] files = directory . list ( ) ; if ( files == null ) throw new IOException ( "cannot read directory " + directory + ": list() returned null" ) ; return getCurrentSegmentGeneration ( files ) ;
public class RowDataSet { private void convertColumnType ( final int columnIndex , final Class < ? > targetType ) { } }
final List < Object > column = _columnList . get ( columnIndex ) ; Object newValue = null ; for ( int i = 0 , len = size ( ) ; i < len ; i ++ ) { newValue = N . convert ( column . get ( i ) , targetType ) ; column . set ( i , newValue ) ; } modCount ++ ;
public class ResourceMarshaller { /** * Marshall the given parameter object . */ public void marshall ( Resource resource , ProtocolMarshaller protocolMarshaller ) { } }
if ( resource == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( resource . getType ( ) , TYPE_BINDING ) ; protocolMarshaller . marshall ( resource . getName ( ) , NAME_BINDING ) ; protocolMarshaller . marshall ( resource . getArn ( ) , ARN_BINDING ) ; protocolMarshaller . marshall ( resource . getFeature ( ) , FEATURE_BINDING ) ; protocolMarshaller . marshall ( resource . getAttributes ( ) , ATTRIBUTES_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class JsonStringToJsonIntermediateConverter { /** * Take in an input schema of type string , the schema must be in JSON format * @ return a JsonArray representation of the schema */ @ Override public JsonArray convertSchema ( String inputSchema , WorkUnitState workUnit ) throws SchemaConversionException { } }
this . unpackComplexSchemas = workUnit . getPropAsBoolean ( UNPACK_COMPLEX_SCHEMAS_KEY , DEFAULT_UNPACK_COMPLEX_SCHEMAS_KEY ) ; JsonParser jsonParser = new JsonParser ( ) ; log . info ( "Schema: " + inputSchema ) ; JsonElement jsonSchema = jsonParser . parse ( inputSchema ) ; return jsonSchema . getAsJsonArray ( ) ;
public class SequenceModelResource { /** * Serialize this model into the overall Sequence model . * @ param out * the output stream * @ throws IOException * io exception */ public void serialize ( final OutputStream out ) throws IOException { } }
final Writer writer = new BufferedWriter ( new OutputStreamWriter ( out ) ) ; this . seqModel . serialize ( out ) ; writer . flush ( ) ;
public class CmsStreamReportWidget { /** * Writes data to delegate stream if it has been set . * @ param data the data to write */ private void writeToDelegate ( byte [ ] data ) { } }
if ( m_delegateStream != null ) { try { m_delegateStream . write ( data ) ; } catch ( IOException e ) { throw new RuntimeException ( e ) ; } }
public class JsonConverter { /** * Converts JSON string into map object or returns null when conversion is not * possible . * @ param value the JSON string to convert . * @ return Map object value or null when conversion is not supported . * @ see MapConverter # toNullableMap ( Object ) */ public static Map < String , Object > toNullableMap ( String value ) { } }
if ( value == null ) return null ; try { Map < String , Object > map = _mapper . readValue ( ( String ) value , typeRef ) ; return RecursiveMapConverter . toNullableMap ( map ) ; } catch ( Exception ex ) { return null ; }
public class UtlJsp { /** * < p > Escape HTML character to UTF - 8 for given string . < / p > * @ param pSource string * @ return String escaped */ public final String escapeHtml ( final String pSource ) { } }
StringBuffer sb = new StringBuffer ( ) ; for ( int i = 0 ; i < pSource . length ( ) ; i ++ ) { char ch = pSource . charAt ( i ) ; sb . append ( htmlEscape ( ch ) ) ; } return sb . toString ( ) ;
public class EventClient { /** * Records a user - action - on - item event . * @ param action name of the action performed * @ param uid ID of the user * @ param iid ID of the item * @ param properties a map of properties associated with this action * @ param eventTime timestamp of the event * @ return ID of this event */ public String userActionItem ( String action , String uid , String iid , Map < String , Object > properties , DateTime eventTime ) throws ExecutionException , InterruptedException , IOException { } }
return createEvent ( userActionItemAsFuture ( action , uid , iid , properties , eventTime ) ) ;
public class FineGrainedWatermarkTracker { /** * Schedule the sweeper and stability checkers */ public synchronized void start ( ) { } }
if ( ! _started . get ( ) ) { _executorService = new ScheduledThreadPoolExecutor ( 1 , ExecutorsUtils . newThreadFactory ( Optional . of ( LoggerFactory . getLogger ( FineGrainedWatermarkTracker . class ) ) ) ) ; _executorService . scheduleAtFixedRate ( _sweeper , 0 , _sweepIntervalMillis , TimeUnit . MILLISECONDS ) ; _executorService . scheduleAtFixedRate ( _stabilityChecker , 0 , _stabilityCheckIntervalMillis , TimeUnit . MILLISECONDS ) ; } _started . set ( true ) ;
public class ProgressInputStream { /** * Returns an input stream for response progress tracking purposes . If * request / response progress tracking is not enabled , this method simply * return the given input stream as is . * @ param is the response content input stream */ public static InputStream inputStreamForResponse ( InputStream is , AmazonWebServiceRequest req ) { } }
return req == null ? is : new ResponseProgressInputStream ( is , req . getGeneralProgressListener ( ) ) ;
public class GlideHelper { /** * Loads thumbnail and then replaces it with full image . */ public static void loadFull ( ImageView image , int imageId , int thumbId ) { } }
// We don ' t want Glide to crop or resize our image final RequestOptions options = new RequestOptions ( ) . diskCacheStrategy ( DiskCacheStrategy . NONE ) . override ( Target . SIZE_ORIGINAL ) . dontTransform ( ) ; final RequestBuilder < Drawable > thumbRequest = Glide . with ( image ) . load ( thumbId ) . apply ( options ) ; Glide . with ( image ) . load ( imageId ) . apply ( options ) . thumbnail ( thumbRequest ) . into ( image ) ;
public class VoiceRecorderDialog { /** * 开始录制 */ public void recording ( ) { } }
if ( null != dialog && dialog . isShowing ( ) ) { mImageView . setImageResource ( R . drawable . hlklib_record_animate_01 ) ; mWarningText . setText ( R . string . hlklib_voice_recorder_warning_text_cancel ) ; }
public class DOTranslatorModule { /** * { @ inheritDoc } */ public void serialize ( DigitalObject in , OutputStream out , String format , String encoding , int transContext ) throws ObjectIntegrityException , StreamIOException , UnsupportedTranslationException , ServerException { } }
m_wrappedTranslator . serialize ( in , out , format , encoding , transContext ) ;
public class MapDataDao { /** * Note that if not logged in , the Changeset for each returned element will be null * @ param relationIds a collection of relation ids to return * @ throws OsmNotFoundException if < b > any < / b > one of the given relations does not exist * @ return a list of relations . */ public List < Relation > getRelations ( Collection < Long > relationIds ) { } }
if ( relationIds . isEmpty ( ) ) return Collections . emptyList ( ) ; return getSomeElements ( RELATION + "s?" + RELATION + "s=" + toCommaList ( relationIds ) , Relation . class ) ;
public class PriorityConverterMap { /** * Add a converter to the map if : * - there is no existing converter for that type * - there is an existing converter of equal priority * - there is an existing converter of lower priority * @ param converter the new converter * @ return the new converter if it was added or the existing converter if it was not */ @ Trivial public PriorityConverter addConverter ( PriorityConverter converter ) { } }
PriorityConverter existing = _addConverter ( converter ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Converter added to map @ priority {0}: {1}={2}" , existing . getPriority ( ) , existing . getType ( ) , existing ) ; } return existing ;
public class AfplibPackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EClass getCMRFidelity ( ) { } }
if ( cmrFidelityEClass == null ) { cmrFidelityEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( AfplibPackage . eNS_URI ) . getEClassifiers ( ) . get ( 508 ) ; } return cmrFidelityEClass ;
public class DomUtils { /** * < p > Retutns the value of the named attribute of the given * element . If there is no such attribute , returns null . < / p > * @ param element element * @ param name name * @ return value */ static String getAttributeValue ( Element element , String name ) { } }
Attr attribute = element . getAttributeNode ( name ) ; if ( attribute == null ) { return null ; } else { return attribute . getValue ( ) ; }
public class XMonitoredInputStream { /** * This method is called by the actual input stream method * to provide feedback about the number of read bytes . * Notifies the attached progress listener if appropriate . * @ param readBytes The number of read bytes in this call . */ protected void update ( long readBytes ) throws IOException { } }
if ( progressListener . isAborted ( ) ) { throw new IOException ( "Reading Cancelled by ProgressListener" ) ; } this . bytesRead += readBytes ; int step = ( int ) ( bytesRead / stepSize ) ; if ( step > lastStep ) { lastStep = step ; progressListener . updateProgress ( step , stepNumber ) ; }
public class Configuration { /** * Get the value of the < code > name < / code > property as a < code > boolean < / code > . * If no such property is specified , or if the specified value is not a valid * < code > boolean < / code > , then < code > defaultValue < / code > is returned . * @ param name property name . * @ param defaultValue default value . * @ return property value as a < code > boolean < / code > , * or < code > defaultValue < / code > . */ public boolean getBoolean ( String name , boolean defaultValue ) { } }
String valueString = get ( name ) ; if ( valueString == null ) { return defaultValue ; } valueString = valueString . toLowerCase ( ) ; if ( "true" . equals ( valueString ) ) { return true ; } else if ( "false" . equals ( valueString ) ) { return false ; } throw new IllegalArgumentException ( "Invalid value of boolean conf option " + name + ": " + valueString ) ;
public class TrackSourceSettingsMarshaller { /** * Marshall the given parameter object . */ public void marshall ( TrackSourceSettings trackSourceSettings , ProtocolMarshaller protocolMarshaller ) { } }
if ( trackSourceSettings == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( trackSourceSettings . getTrackNumber ( ) , TRACKNUMBER_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class StringManager { /** * Get the StringManager for a particular package and Locale . If a manager * for a package / Locale combination already exists , it will be reused , else * a new StringManager will be created and returned . * @ param packageName The package name * @ param locale The Locale */ public static final synchronized StringManager getManager ( String packageName , Locale locale ) { } }
Map < Locale , StringManager > map = managers . get ( packageName ) ; if ( map == null ) { /* * Don ' t want the HashMap to be expanded beyond LOCALE _ CACHE _ SIZE . * Expansion occurs when size ( ) exceeds capacity . Therefore keep * size at or below capacity . * removeEldestEntry ( ) executes after insertion therefore the test * for removal needs to use one less than the maximum desired size */ map = new LinkedHashMap < Locale , StringManager > ( LOCALE_CACHE_SIZE , 1 , true ) { private static final long serialVersionUID = 1L ; @ Override protected boolean removeEldestEntry ( Map . Entry < Locale , StringManager > eldest ) { if ( size ( ) > ( LOCALE_CACHE_SIZE - 1 ) ) { return true ; } return false ; } } ; managers . put ( packageName , map ) ; } StringManager mgr = map . get ( locale ) ; if ( mgr == null ) { mgr = new StringManager ( packageName , locale ) ; map . put ( locale , mgr ) ; } return mgr ;
public class OAuth2Bootstrapper { /** * Gets users Credentials * @ param codeOrUrl code or redirect URL provided by the browser * @ throws IOException */ public void getUserCredentials ( String codeOrUrl ) throws IOException { } }
if ( state == null ) { // should not occur if this class is used properly throw new IllegalStateException ( "No anti CSRF state defined" ) ; } String code ; if ( codeOrUrl . startsWith ( "http://" ) || codeOrUrl . startsWith ( "https://" ) ) { // It ' s a URL : extract code and check state String url = codeOrUrl ; LOGGER . debug ( "redirect URL: {}" , url ) ; URI uri = URI . create ( url ) ; String error = URIUtil . getQueryParameter ( uri , "error" ) ; String errorDescription = URIUtil . getQueryParameter ( uri , "error_description" ) ; if ( error != null ) { String msg = "User authorization failed : " + error ; if ( errorDescription != null ) { msg += " (" + errorDescription + ")" ; } throw new CStorageException ( msg ) ; } String stateToTest = URIUtil . getQueryParameter ( uri , "state" ) ; if ( ! state . equals ( stateToTest ) ) { throw new CStorageException ( "State received (" + stateToTest + ") is not state expected (" + state + ")" ) ; } code = URIUtil . getQueryParameter ( uri , "code" ) ; if ( code == null ) { throw new CStorageException ( "Can't find code in redirected URL: " + url ) ; } } else { // It ' s a code code = codeOrUrl ; } UserCredentials userCredentials = sessionManager . fetchUserCredentials ( code ) ; // From access token we can get user id . . . String userId = storageProvider . getUserId ( ) ; LOGGER . debug ( "User identifier retrieved: {}" , userId ) ; // . . . so that by now we can persist tokens : userCredentials . setUserId ( userId ) ; sessionManager . getUserCredentialsRepository ( ) . save ( userCredentials ) ;
public class Ifc2x3tc1FactoryImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public IfcElementAssemblyTypeEnum createIfcElementAssemblyTypeEnumFromString ( EDataType eDataType , String initialValue ) { } }
IfcElementAssemblyTypeEnum result = IfcElementAssemblyTypeEnum . get ( initialValue ) ; if ( result == null ) throw new IllegalArgumentException ( "The value '" + initialValue + "' is not a valid enumerator of '" + eDataType . getName ( ) + "'" ) ; return result ;
public class BlockIterator { /** * Repositions the iterator so the key of the next BlockElement returned greater than or equal to the specified targetKey . */ @ Override public void seek ( Slice targetKey ) { } }
if ( restartCount == 0 ) { return ; } int left = 0 ; int right = restartCount - 1 ; // binary search restart positions to find the restart position immediately before the targetKey while ( left < right ) { int mid = ( left + right + 1 ) / 2 ; seekToRestartPosition ( mid ) ; if ( comparator . compare ( nextEntry . getKey ( ) , targetKey ) < 0 ) { // key at mid is smaller than targetKey . Therefore all restart // blocks before mid are uninteresting . left = mid ; } else { // key at mid is greater than or equal to targetKey . Therefore // all restart blocks at or after mid are uninteresting . right = mid - 1 ; } } // linear search ( within restart block ) for first key greater than or equal to targetKey for ( seekToRestartPosition ( left ) ; nextEntry != null ; next ( ) ) { if ( comparator . compare ( peek ( ) . getKey ( ) , targetKey ) >= 0 ) { break ; } }
public class TCPPort { /** * Destroys the server socket associated with this end point . */ protected synchronized void destroyServerSocket ( ) { } }
if ( null == this . serverSocket ) { // already closed return ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "ServerSocket being closed for port " + this . listenPort ) ; } closeServerSocket ( ) ; this . serverSocket = null ;
public class PrequentialSourceProcessor { private void initStreamSource ( InstanceStream stream ) { } }
if ( stream instanceof AbstractOptionHandler ) { ( ( AbstractOptionHandler ) ( stream ) ) . prepareForUse ( ) ; } this . streamSource = new StreamSource ( stream ) ; firstInstance = streamSource . nextInstance ( ) . getData ( ) ;
public class S3Manager { /** * Downloads an AWS CloudTrail log from the specified source . * @ param ctLog The { @ link CloudTrailLog } to download * @ param source The { @ link CloudTrailSource } to download the log from . * @ return A byte array containing the log data . */ public byte [ ] downloadLog ( CloudTrailLog ctLog , CloudTrailSource source ) { } }
boolean success = false ; ProgressStatus downloadLogStatus = new ProgressStatus ( ProgressState . downloadLog , new BasicProcessLogInfo ( source , ctLog , success ) ) ; final Object downloadSourceReportObject = progressReporter . reportStart ( downloadLogStatus ) ; byte [ ] s3ObjectBytes = null ; // start to download CloudTrail log try { S3Object s3Object = this . getObject ( ctLog . getS3Bucket ( ) , ctLog . getS3ObjectKey ( ) ) ; try ( S3ObjectInputStream s3InputStream = s3Object . getObjectContent ( ) ) { s3ObjectBytes = LibraryUtils . toByteArray ( s3InputStream ) ; } ctLog . setLogFileSize ( s3Object . getObjectMetadata ( ) . getContentLength ( ) ) ; success = true ; logger . info ( "Downloaded log file " + ctLog . getS3ObjectKey ( ) + " from " + ctLog . getS3Bucket ( ) ) ; } catch ( AmazonServiceException | IOException e ) { String exceptionMessage = String . format ( "Fail to download log file %s/%s." , ctLog . getS3Bucket ( ) , ctLog . getS3ObjectKey ( ) ) ; LibraryUtils . handleException ( exceptionHandler , downloadLogStatus , e , exceptionMessage ) ; } finally { LibraryUtils . endToProcess ( progressReporter , success , downloadLogStatus , downloadSourceReportObject ) ; } return s3ObjectBytes ;
public class RestController { /** * Adds an object to the request . If a page will be renderer and it needs some objects * to work , with this method a developer can add objects to the request , so the page can * obtain them . * @ param name Parameter name * @ param object Object to put in the request */ protected void putParam ( String name , Object object ) { } }
this . response . getRequest ( ) . setAttribute ( name , object ) ;
public class AgentSerializer { /** * Serialize java object * @ param unwrapper structure of agent class * @ param agent the agent object * @ return List of variables */ @ SuppressWarnings ( { } }
"unchecked" , "rawtypes" } ) public List serialize ( ClassUnwrapper unwrapper , Object agent ) { List variables = new ArrayList < > ( ) ; List < GetterMethodCover > methods = unwrapper . getMethods ( ) ; for ( GetterMethodCover method : methods ) { Object value = method . invoke ( agent ) ; if ( value == null ) continue ; variables . add ( newVariable ( method . getKey ( ) , getValue ( method , value ) , method . isHidden ( ) ) ) ; } return variables ;
public class ObjectManagerByteArrayOutputStream { /** * Writes an < code > int < / code > to the byte array as four * bytes , high byte first . If no exception is thrown , the counter * < code > written < / code > is incremented by < code > 4 < / code > . * @ param value to be written . * @ see java . io . DataOutput # writeInt ( int ) */ final void writeInt ( int value ) { } }
byte writeBuffer [ ] = new byte [ 4 ] ; writeBuffer [ 0 ] = ( byte ) ( value >>> 24 ) ; writeBuffer [ 1 ] = ( byte ) ( value >>> 16 ) ; writeBuffer [ 2 ] = ( byte ) ( value >>> 8 ) ; writeBuffer [ 3 ] = ( byte ) ( value >>> 0 ) ; write ( writeBuffer , 0 , 4 ) ;
public class MonitorEndpointHelper { /** * Verify access to a HTTPS endpoint by performing a HTTP - get operation and assures that a proper http - return code ( e . g . 200 ) is returned . * NOTE : This method is aimed for external http - endpoionts and not internal http - endpoints , e . g . servlet - endpoints . * TODO : What return codes should be handled as ok here ? Simpl 2xx codes or som other codes as well ? * TODO : Needs to be implemented . . . */ public static String pingHttpsEndpoint ( String url , String truststorePath , String truststorePassword , String privateKeyPassword ) { } }
return OK_PREFIX ;
public class CommonOps_DDF4 { /** * Returns the absolute value of the element in the matrix that has the largest absolute value . < br > * < br > * Max { | a < sub > ij < / sub > | } for all i and j < br > * @ param a A matrix . Not modified . * @ return The max abs element value of the matrix . */ public static double elementMaxAbs ( DMatrix4x4 a ) { } }
double max = Math . abs ( a . a11 ) ; double tmp = Math . abs ( a . a12 ) ; if ( tmp > max ) max = tmp ; tmp = Math . abs ( a . a13 ) ; if ( tmp > max ) max = tmp ; tmp = Math . abs ( a . a14 ) ; if ( tmp > max ) max = tmp ; tmp = Math . abs ( a . a21 ) ; if ( tmp > max ) max = tmp ; tmp = Math . abs ( a . a22 ) ; if ( tmp > max ) max = tmp ; tmp = Math . abs ( a . a23 ) ; if ( tmp > max ) max = tmp ; tmp = Math . abs ( a . a24 ) ; if ( tmp > max ) max = tmp ; tmp = Math . abs ( a . a31 ) ; if ( tmp > max ) max = tmp ; tmp = Math . abs ( a . a32 ) ; if ( tmp > max ) max = tmp ; tmp = Math . abs ( a . a33 ) ; if ( tmp > max ) max = tmp ; tmp = Math . abs ( a . a34 ) ; if ( tmp > max ) max = tmp ; tmp = Math . abs ( a . a41 ) ; if ( tmp > max ) max = tmp ; tmp = Math . abs ( a . a42 ) ; if ( tmp > max ) max = tmp ; tmp = Math . abs ( a . a43 ) ; if ( tmp > max ) max = tmp ; tmp = Math . abs ( a . a44 ) ; if ( tmp > max ) max = tmp ; return max ;
public class ImmutableSetJsonDeserializer { /** * @ param deserializer { @ link JsonDeserializer } used to deserialize the objects inside the { @ link ImmutableSet } . * @ param < T > Type of the elements inside the { @ link ImmutableSet } * @ return a new instance of { @ link ImmutableSetJsonDeserializer } */ public static < T > ImmutableSetJsonDeserializer < T > newInstance ( JsonDeserializer < T > deserializer ) { } }
return new ImmutableSetJsonDeserializer < T > ( deserializer ) ;
public class DatePickerDialog { /** * Set the selected date of this DatePickerDialog . * @ param day The day value of selected date . * @ param month The month value of selected date . * @ param year The year value of selected date . * @ return The DatePickerDialog for chaining methods . */ public DatePickerDialog date ( int day , int month , int year ) { } }
mDatePickerLayout . setDate ( day , month , year ) ; return this ;
public class AggregationPipelineImpl { /** * Converts a Projection to a DBObject for use by the Java driver . * @ param projection the project to apply * @ return the DBObject */ private DBObject toDBObject ( final Projection projection ) { } }
String target ; if ( firstStage ) { MappedField field = mapper . getMappedClass ( source ) . getMappedField ( projection . getTarget ( ) ) ; target = field != null ? field . getNameToStore ( ) : projection . getTarget ( ) ; } else { target = projection . getTarget ( ) ; } if ( projection . getProjections ( ) != null ) { List < Projection > list = projection . getProjections ( ) ; DBObject projections = new BasicDBObject ( ) ; for ( Projection subProjection : list ) { projections . putAll ( toDBObject ( subProjection ) ) ; } return new BasicDBObject ( target , projections ) ; } else if ( projection . getSource ( ) != null ) { return new BasicDBObject ( target , projection . getSource ( ) ) ; } else if ( projection . getArguments ( ) != null ) { DBObject args = toExpressionArgs ( projection . getArguments ( ) ) ; if ( target == null ) { // Unwrap for single - argument expressions if ( args instanceof List < ? > && ( ( List < ? > ) args ) . size ( ) == 1 ) { Object firstArg = ( ( List < ? > ) args ) . get ( 0 ) ; if ( firstArg instanceof DBObject ) { return ( DBObject ) firstArg ; } } return args ; } else { // Unwrap for single - argument expressions if ( args instanceof List < ? > && ( ( List < ? > ) args ) . size ( ) == 1 ) { return new BasicDBObject ( target , ( ( List < ? > ) args ) . get ( 0 ) ) ; } return new BasicDBObject ( target , args ) ; } } else { return new BasicDBObject ( target , projection . isSuppressed ( ) ? 0 : 1 ) ; }
public class CmsNewLinkFunctionTable { /** * Triggers creation and editing of a new element for the given collector , identified by its context id . < p > * @ param contextId the context id of the collector */ public void createAndEditNewElement ( String contextId ) { } }
Runnable action = m_createFunctions . get ( contextId ) ; if ( action != null ) { action . run ( ) ; } else { log ( "Could not execute create action for context id '" + contextId + "'" ) ; }
public class AbstractProxyCollection { /** * Creates an a data collection which has no entity inside it */ private void createEmptyDataCollection ( ) { } }
Class < ? > collectionClass = getRelation ( ) . getProperty ( ) . getType ( ) ; if ( collectionClass . isAssignableFrom ( Set . class ) ) { dataCollection = new HashSet ( ) ; } else if ( collectionClass . isAssignableFrom ( List . class ) ) { dataCollection = new ArrayList ( ) ; }