signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class MessageTimeoutProcess { /** * Run Method . */ public void run ( ) { } }
MessageLog recMessageLog = ( MessageLog ) this . getMainRecord ( ) ; try { Date timeTimeout = null ; while ( recMessageLog . hasNext ( ) ) { recMessageLog . next ( ) ; timeTimeout = ( ( DateTimeField ) recMessageLog . getField ( MessageLog . TIMEOUT_TIME ) ) . getDateTime ( ) ; if ( timeTimeout == null ) continue ; // Never if ( timeTimeout . getTime ( ) > System . currentTimeMillis ( ) ) break ; String strTrxID = recMessageLog . getCounterField ( ) . toString ( ) ; recMessageLog . edit ( ) ; int iErrorStatus = ( ( ReferenceField ) recMessageLog . getField ( MessageLog . MESSAGE_STATUS_ID ) ) . getIDFromCode ( MessageStatus . ERROR ) ; recMessageLog . getField ( MessageLog . MESSAGE_STATUS_ID ) . setValue ( iErrorStatus ) ; recMessageLog . set ( ) ; this . processMessageTimeout ( strTrxID ) ; } if ( recMessageLog . getEditMode ( ) == DBConstants . EDIT_CURRENT ) if ( timeTimeout != null ) // Always { // More to process , schedule it for later MessageManager messageManager = ( ( Application ) getTask ( ) . getApplication ( ) ) . getMessageManager ( ) ; Map < String , Object > properties = new Hashtable < String , Object > ( ) ; properties . put ( PrivateTaskScheduler . TIME_TO_RUN , timeTimeout ) ; properties . put ( PrivateTaskScheduler . NO_DUPLICATE , Constants . TRUE ) ; properties . put ( DBParams . PROCESS , MessageTimeoutProcess . class . getName ( ) ) ; if ( messageManager != null ) messageManager . sendMessage ( new MapMessage ( new BaseMessageHeader ( MessageTimeoutProcess . TIMEOUT_QUEUE_NAME , MessageConstants . INTRANET_QUEUE , this , null ) , properties ) ) ; } } catch ( DBException ex ) { ex . printStackTrace ( ) ; }
public class InternalPureXbaseParser { /** * InternalPureXbase . g : 2188:1 : ruleXPostfixOperation returns [ EObject current = null ] : ( this _ XMemberFeatureCall _ 0 = ruleXMemberFeatureCall ( ( ( ( ) ( ( ruleOpPostfix ) ) ) ) = > ( ( ) ( ( ruleOpPostfix ) ) ) ) ? ) ; */ public final EObject ruleXPostfixOperation ( ) throws RecognitionException { } }
EObject current = null ; EObject this_XMemberFeatureCall_0 = null ; enterRule ( ) ; try { // InternalPureXbase . g : 2194:2 : ( ( this _ XMemberFeatureCall _ 0 = ruleXMemberFeatureCall ( ( ( ( ) ( ( ruleOpPostfix ) ) ) ) = > ( ( ) ( ( ruleOpPostfix ) ) ) ) ? ) ) // InternalPureXbase . g : 2195:2 : ( this _ XMemberFeatureCall _ 0 = ruleXMemberFeatureCall ( ( ( ( ) ( ( ruleOpPostfix ) ) ) ) = > ( ( ) ( ( ruleOpPostfix ) ) ) ) ? ) { // InternalPureXbase . g : 2195:2 : ( this _ XMemberFeatureCall _ 0 = ruleXMemberFeatureCall ( ( ( ( ) ( ( ruleOpPostfix ) ) ) ) = > ( ( ) ( ( ruleOpPostfix ) ) ) ) ? ) // InternalPureXbase . g : 2196:3 : this _ XMemberFeatureCall _ 0 = ruleXMemberFeatureCall ( ( ( ( ) ( ( ruleOpPostfix ) ) ) ) = > ( ( ) ( ( ruleOpPostfix ) ) ) ) ? { if ( state . backtracking == 0 ) { newCompositeNode ( grammarAccess . getXPostfixOperationAccess ( ) . getXMemberFeatureCallParserRuleCall_0 ( ) ) ; } pushFollow ( FOLLOW_31 ) ; this_XMemberFeatureCall_0 = ruleXMemberFeatureCall ( ) ; state . _fsp -- ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { current = this_XMemberFeatureCall_0 ; afterParserOrEnumRuleCall ( ) ; } // InternalPureXbase . g : 2204:3 : ( ( ( ( ) ( ( ruleOpPostfix ) ) ) ) = > ( ( ) ( ( ruleOpPostfix ) ) ) ) ? int alt39 = 2 ; int LA39_0 = input . LA ( 1 ) ; if ( ( LA39_0 == 52 ) ) { int LA39_1 = input . LA ( 2 ) ; if ( ( synpred21_InternalPureXbase ( ) ) ) { alt39 = 1 ; } } else if ( ( LA39_0 == 53 ) ) { int LA39_2 = input . LA ( 2 ) ; if ( ( synpred21_InternalPureXbase ( ) ) ) { alt39 = 1 ; } } switch ( alt39 ) { case 1 : // InternalPureXbase . g : 2205:4 : ( ( ( ) ( ( ruleOpPostfix ) ) ) ) = > ( ( ) ( ( ruleOpPostfix ) ) ) { // InternalPureXbase . g : 2215:4 : ( ( ) ( ( ruleOpPostfix ) ) ) // InternalPureXbase . g : 2216:5 : ( ) ( ( ruleOpPostfix ) ) { // InternalPureXbase . g : 2216:5 : ( ) // InternalPureXbase . g : 2217:6: { if ( state . backtracking == 0 ) { current = forceCreateModelElementAndSet ( grammarAccess . getXPostfixOperationAccess ( ) . getXPostfixOperationOperandAction_1_0_0 ( ) , current ) ; } } // InternalPureXbase . g : 2223:5 : ( ( ruleOpPostfix ) ) // InternalPureXbase . g : 2224:6 : ( ruleOpPostfix ) { // InternalPureXbase . g : 2224:6 : ( ruleOpPostfix ) // InternalPureXbase . g : 2225:7 : ruleOpPostfix { if ( state . backtracking == 0 ) { if ( current == null ) { current = createModelElement ( grammarAccess . getXPostfixOperationRule ( ) ) ; } } if ( state . backtracking == 0 ) { newCompositeNode ( grammarAccess . getXPostfixOperationAccess ( ) . getFeatureJvmIdentifiableElementCrossReference_1_0_1_0 ( ) ) ; } pushFollow ( FOLLOW_2 ) ; ruleOpPostfix ( ) ; state . _fsp -- ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { afterParserOrEnumRuleCall ( ) ; } } } } } break ; } } } if ( state . backtracking == 0 ) { leaveRule ( ) ; } } catch ( RecognitionException re ) { recover ( input , re ) ; appendSkippedTokens ( ) ; } finally { } return current ;
public class ExifGpsWriter { /** * Private method - adds gps information to the exif data * @ param pos a GPSPosition object containing the information to encode * @ param exif the exif metadata to add the position to */ private IIOMetadata insertGPSCoords ( IIOMetadata exif ) { } }
IIOMetadata outExif = null ; try { TIFFDirectory ifd = TIFFDirectory . createFromMetadata ( exif ) ; TIFFField gpsInfoPointer = null ; // first get the pointer from the directory if it ' s not there create a new one if ( ifd . containsTIFFField ( EXIFParentTIFFTagSet . TAG_GPS_INFO_IFD_POINTER ) ) { gpsInfoPointer = ifd . getTIFFField ( EXIFParentTIFFTagSet . TAG_GPS_INFO_IFD_POINTER ) ; System . out . println ( "Already has GPS Metadata" ) ; return exif ; } else { // this assumes that the EXIFParentTIFFTagSet is allowed on the tiff image reader // first construct the directory to hold the GPS data TIFFDirectory gpsData = createDirectory ( ) ; // Create the pointer with the data EXIFParentTIFFTagSet parentSet = EXIFParentTIFFTagSet . getInstance ( ) ; gpsInfoPointer = new TIFFField ( parentSet . getTag ( EXIFParentTIFFTagSet . TAG_GPS_INFO_IFD_POINTER ) , TIFFTag . TIFF_LONG , 1 , gpsData ) ; System . out . println ( "is pointer =" + gpsInfoPointer . getTag ( ) . isIFDPointer ( ) + " data type is ok=" + gpsInfoPointer . getTag ( ) . isDataTypeOK ( TIFFTag . TIFF_LONG ) ) ; } ifd . addTIFFField ( gpsInfoPointer ) ; outExif = ifd . getAsMetadata ( ) ; } catch ( IIOInvalidTreeException e ) { e . printStackTrace ( ) ; } return outExif ;
public class RamlTypeHelper { /** * Safely get description from a type with null checks * @ param type * The RAML TypeDeclaration to check * @ return The description if defined or null if empty */ public static String getDescription ( TypeDeclaration type ) { } }
if ( type == null || type . description ( ) == null ) { return null ; } else { return type . description ( ) . value ( ) ; }
public class QueueListener { /** * Setup subscriptions when the Observable subscription is set up . * @ param subscriber the subscriber */ @ Override public void call ( Subscriber < ? super Job < K , V > > subscriber ) { } }
log . debug ( "onSubscribe()" ) ; if ( subscriber . isUnsubscribed ( ) ) { return ; } String subscriberId = getClass ( ) . getSimpleName ( ) + "-" + id + "-" + subscriberIds . incrementAndGet ( ) ; subscriber . onStart ( ) ; try { Scheduler . Worker worker = scheduler . createWorker ( ) ; GetJobsAction < K , V > getJobsAction = new GetJobsAction < K , V > ( disqueConnectionSupplier , subscriberId , subscriber , jobLocalityTracking , getJobsArgs ) ; actions . add ( getJobsAction ) ; Subscription subscription = worker . schedulePeriodically ( getJobsAction , 0 , 10 , TimeUnit . MILLISECONDS ) ; getJobsAction . setSelfSubscription ( subscription ) ; if ( improveLocalityTimeUnit != null && improveLocalityInterval > 0 && reconnectTrigger == null ) { reconnectTrigger = worker . schedulePeriodically ( new Action0 ( ) { @ Override public void call ( ) { switchNodes ( ) ; } } , improveLocalityInterval , improveLocalityInterval , improveLocalityTimeUnit ) ; } } catch ( Exception e ) { if ( log . isDebugEnabled ( ) ) { log . debug ( "QueueListener.call caught an exception: {}" , e . getMessage ( ) , e ) ; } subscriber . onError ( e ) ; }
public class CancelResizeResult { /** * The names of tables that are being currently imported . * Valid Values : List of table names . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setImportTablesInProgress ( java . util . Collection ) } or * { @ link # withImportTablesInProgress ( java . util . Collection ) } if you want to override the existing values . * @ param importTablesInProgress * The names of tables that are being currently imported . < / p > * Valid Values : List of table names . * @ return Returns a reference to this object so that method calls can be chained together . */ public CancelResizeResult withImportTablesInProgress ( String ... importTablesInProgress ) { } }
if ( this . importTablesInProgress == null ) { setImportTablesInProgress ( new com . amazonaws . internal . SdkInternalList < String > ( importTablesInProgress . length ) ) ; } for ( String ele : importTablesInProgress ) { this . importTablesInProgress . add ( ele ) ; } return this ;
public class Tracy { /** * Facilitate annotating annotations received from the Client in the X - Tracy - Annotations HTTP header < br > * Currently only supporting string annotations in CSV format . Example usage below : * e . g . * < code > < pre > * public void doGet ( HttpServletRequest request , HttpServletResponse response ) { * throws ServletException , IOException * String httpRequestTracyAnnotations = request . getHeader ( Tracy . HTTP _ HEADER _ X _ TRACY _ ANNOTATIONS ) ; * Tracy . annotateFromHttpRequestAnnotations ( httpRequestTracyAnnotations ) * < / pre > < / code > * @ param csvAnnotations contains the annotations in CSV format e . g . key1 , val1 , key2 , val2 < br > */ public static void annotateFromHttpRequestAnnotations ( String csvAnnotations ) { } }
if ( null != csvAnnotations ) { String [ ] split = csvAnnotations . split ( "," ) ; if ( split . length % 2 == 0 ) { String value = "null" ; for ( int i = 0 ; i < split . length / 2 ; i ++ ) { String key = split [ 2 * i ] . toString ( ) ; if ( null != split [ 2 * i + 1 ] ) { value = split [ 2 * i + 1 ] . toString ( ) ; } Tracy . annotate ( key , value ) ; } } }
public class ParserDescription { /** * Returns whether this parser is in the specified group . * @ param other * the name of the group * @ return < code > true < / code > if this parser is in the specified group */ public boolean isInGroup ( final String other ) { } }
return ParserRegistry . getParser ( group ) . getGroup ( ) . equals ( ParserRegistry . getParser ( other ) . getGroup ( ) ) ;
public class ZScreenField { /** * Display this screen ' s hidden params . * @ param out The html out stream . * @ exception DBException File exception . */ public void addHiddenParams ( PrintWriter out , Map < String , Object > mapParams ) { } }
for ( String key : mapParams . keySet ( ) ) { if ( mapParams . get ( key ) != null ) this . addHiddenParam ( out , key , mapParams . get ( key ) . toString ( ) ) ; }
public class JmxManagementService { /** * NotificationListener support for connection open and closed notifications */ @ Override public void handleNotification ( Notification notification , Object handback ) { } }
String notificationType = notification . getType ( ) ; if ( notificationType . equals ( JMXConnectionNotification . OPENED ) ) { managementContext . incrementManagementSessionCount ( ) ; } else if ( notificationType . equals ( JMXConnectionNotification . CLOSED ) ) { managementContext . decrementManagementSessionCount ( ) ; }
public class BaasDocument { /** * Asynchronously retrieves the number of documents readable to the user that match the < code > filter < / code > * in < code > collection < / code > * @ param collection the collection to doCount not < code > null < / code > * @ param filter a { @ link BaasQuery . Criteria } to apply to the request . May be < code > null < / code > * @ param handler a callback to be invoked with the result of the request * @ return a { @ link com . baasbox . android . RequestToken } to handle the asynchronous request */ private static RequestToken doCount ( String collection , BaasQuery . Criteria filter , int flags , final BaasHandler < Long > handler ) { } }
BaasBox box = BaasBox . getDefaultChecked ( ) ; filter = filter == null ? BaasQuery . builder ( ) . count ( true ) . criteria ( ) : filter . buildUpon ( ) . count ( true ) . criteria ( ) ; if ( collection == null ) throw new IllegalArgumentException ( "collection cannot be null" ) ; Count count = new Count ( box , collection , filter , flags , handler ) ; return box . submitAsync ( count ) ;
public class PropertyLookup { /** * given a file reads in its properties * @ param propFile File to read * @ return a Properties object with data filled from propFile * @ throws PropertyLookupException thrown if error loading property file */ public static Properties fetchProperties ( final File propFile ) { } }
final Properties properties = new Properties ( ) ; try { FileInputStream fis = new FileInputStream ( propFile ) ; try { properties . load ( fis ) ; } finally { if ( null != fis ) { fis . close ( ) ; } } } catch ( IOException e ) { throw new PropertyLookupException ( "failed loading properties from file: " + propFile , e ) ; } return properties ;
public class spilloverpolicy_gslbvserver_binding { /** * Use this API to fetch spilloverpolicy _ gslbvserver _ binding resources of given name . */ public static spilloverpolicy_gslbvserver_binding [ ] get ( nitro_service service , String name ) throws Exception { } }
spilloverpolicy_gslbvserver_binding obj = new spilloverpolicy_gslbvserver_binding ( ) ; obj . set_name ( name ) ; spilloverpolicy_gslbvserver_binding response [ ] = ( spilloverpolicy_gslbvserver_binding [ ] ) obj . get_resources ( service ) ; return response ;
public class JsonConfigReader { /** * Reads configuration and parameterize it with given values . * @ param correlationId ( optional ) transaction id to trace execution through * call chain . * @ param parameters values to parameters the configuration * @ return ConfigParams configuration . * @ throws ApplicationException when error occured . */ @ Override public ConfigParams readConfig ( String correlationId , ConfigParams parameters ) throws ApplicationException { } }
Object value = readObject ( correlationId , parameters ) ; return ConfigParams . fromValue ( value ) ;
public class StatementParameter { /** * 获取参数类型数组 . * @ return */ protected int [ ] getArgTypes ( ) { } }
// { Types . CHAR , Types . VARCHAR , Types . TIMESTAMP , Types . VARCHAR } ; int [ ] valuesTypes = new int [ type . size ( ) ] ; Object [ ] types = type . toArray ( ) ; for ( int i = 0 ; i < types . length ; i ++ ) { valuesTypes [ i ] = this . getIntType ( i ) ; } return valuesTypes ;
public class SiteProperties { /** * Returns the list of additional fields that navigation items should extract from the item descriptor . */ public static String [ ] getNavigationAdditionalFields ( ) { } }
Configuration config = ConfigUtils . getCurrentConfig ( ) ; if ( config != null && config . containsKey ( NAVIGATION_ADDITIONAL_FIELDS_CONFIG_KEY ) ) { return config . getStringArray ( NAVIGATION_ADDITIONAL_FIELDS_CONFIG_KEY ) ; } else { return new String [ ] { } ; }
public class CodaHaleMetricsTracker { /** * { @ inheritDoc } */ @ Override public void close ( ) { } }
registry . remove ( MetricRegistry . name ( poolName , METRIC_CATEGORY , METRIC_NAME_WAIT ) ) ; registry . remove ( MetricRegistry . name ( poolName , METRIC_CATEGORY , METRIC_NAME_USAGE ) ) ; registry . remove ( MetricRegistry . name ( poolName , METRIC_CATEGORY , METRIC_NAME_CONNECT ) ) ; registry . remove ( MetricRegistry . name ( poolName , METRIC_CATEGORY , METRIC_NAME_TIMEOUT_RATE ) ) ; registry . remove ( MetricRegistry . name ( poolName , METRIC_CATEGORY , METRIC_NAME_TOTAL_CONNECTIONS ) ) ; registry . remove ( MetricRegistry . name ( poolName , METRIC_CATEGORY , METRIC_NAME_IDLE_CONNECTIONS ) ) ; registry . remove ( MetricRegistry . name ( poolName , METRIC_CATEGORY , METRIC_NAME_ACTIVE_CONNECTIONS ) ) ; registry . remove ( MetricRegistry . name ( poolName , METRIC_CATEGORY , METRIC_NAME_PENDING_CONNECTIONS ) ) ; registry . remove ( MetricRegistry . name ( poolName , METRIC_CATEGORY , METRIC_NAME_MAX_CONNECTIONS ) ) ; registry . remove ( MetricRegistry . name ( poolName , METRIC_CATEGORY , METRIC_NAME_MIN_CONNECTIONS ) ) ;
public class GenericHibernateDao { /** * Helper method : Creates a criteria for the { @ link # entityClass } of this dao . * The query results will be handled with a * { @ link DistinctRootEntityResultTransformer } . The criteria will contain * all passed criterions . * @ return */ protected Criteria createDistinctRootEntityCriteria ( Criterion ... criterion ) { } }
Criteria criteria = getSession ( ) . createCriteria ( entityClass ) ; addCriterionsToCriteria ( criteria , criterion ) ; criteria . setResultTransformer ( Criteria . DISTINCT_ROOT_ENTITY ) ; criteria . setCacheable ( this . useQueryCache ) ; return criteria ;
public class GetSecretValueResult { /** * A list of all of the staging labels currently attached to this version of the secret . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setVersionStages ( java . util . Collection ) } or { @ link # withVersionStages ( java . util . Collection ) } if you want * to override the existing values . * @ param versionStages * A list of all of the staging labels currently attached to this version of the secret . * @ return Returns a reference to this object so that method calls can be chained together . */ public GetSecretValueResult withVersionStages ( String ... versionStages ) { } }
if ( this . versionStages == null ) { setVersionStages ( new java . util . ArrayList < String > ( versionStages . length ) ) ; } for ( String ele : versionStages ) { this . versionStages . add ( ele ) ; } return this ;
public class Matrix4d { /** * / * ( non - Javadoc ) * @ see org . joml . Matrix4dc # perspectiveFov ( ) */ public double perspectiveFov ( ) { } }
/* * Compute the angle between the bottom and top frustum plane normals . */ double n1x , n1y , n1z , n2x , n2y , n2z ; n1x = m03 + m01 ; n1y = m13 + m11 ; n1z = m23 + m21 ; // bottom n2x = m01 - m03 ; n2y = m11 - m13 ; n2z = m21 - m23 ; // top double n1len = Math . sqrt ( n1x * n1x + n1y * n1y + n1z * n1z ) ; double n2len = Math . sqrt ( n2x * n2x + n2y * n2y + n2z * n2z ) ; return Math . acos ( ( n1x * n2x + n1y * n2y + n1z * n2z ) / ( n1len * n2len ) ) ;
public class DoubleDistributionSummary { /** * Updates the statistics kept by the summary with the specified amount . * @ param amount * Amount for an event being measured . For example , if the size in bytes of responses * from a server . If the amount is less than 0 the value will be dropped . */ public void record ( double amount ) { } }
if ( amount >= 0.0 ) { add ( totalAmount , amount ) ; add ( totalOfSquares , amount * amount ) ; max ( max , amount ) ; count . incrementAndGet ( ) ; lastUpdateTime . set ( clock . wallTime ( ) ) ; }
public class DataType { /** * When a data type is multi - valued , this method is called to convert raw data into a * collection of values matching this data type . If the raw value is a string , this * method assumes that the string represents a comma - delimited , multi - value * attribute . * @ param src the raw source value * @ return the converted value */ @ SuppressWarnings ( "unchecked" ) public Collection < V > getValues ( Object src ) { } }
ArrayList < V > values = new ArrayList < V > ( ) ; if ( src instanceof String ) { String [ ] words = ( ( String ) src ) . split ( "," ) ; if ( words . length < 1 ) { values . add ( getValue ( src ) ) ; } else { for ( String word : words ) { values . add ( getValue ( word ) ) ; } } return values ; } else if ( src instanceof Collection ) { for ( Object ob : ( Collection < Object > ) src ) { values . add ( getValue ( ob ) ) ; } return values ; } throw new InvalidAttributeException ( "Invalid attribute: " + src ) ;
public class StringUtils { /** * < p > Checks if the CharSequence contains only Unicode letters or digits . < / p > * < p > { @ code null } will return { @ code false } . * An empty CharSequence ( length ( ) = 0 ) will return { @ code false } . < / p > * < pre > * StringUtils . isAlphanumeric ( null ) = false * StringUtils . isAlphanumeric ( " " ) = false * StringUtils . isAlphanumeric ( " " ) = false * StringUtils . isAlphanumeric ( " abc " ) = true * StringUtils . isAlphanumeric ( " ab c " ) = false * StringUtils . isAlphanumeric ( " ab2c " ) = true * StringUtils . isAlphanumeric ( " ab - c " ) = false * < / pre > * @ param cs the CharSequence to check , may be null * @ return { @ code true } if only contains letters or digits , * and is non - null * @ since 3.0 Changed signature from isAlphanumeric ( String ) to isAlphanumeric ( CharSequence ) * @ since 3.0 Changed " " to return false and not true */ public static boolean isAlphanumeric ( final CharSequence cs ) { } }
if ( isEmpty ( cs ) ) { return false ; } final int sz = cs . length ( ) ; for ( int i = 0 ; i < sz ; i ++ ) { if ( ! Character . isLetterOrDigit ( cs . charAt ( i ) ) ) { return false ; } } return true ;
public class VTimeZone { /** * Convert RFC2445 utc - offset string to milliseconds */ private static int offsetStrToMillis ( String str ) { } }
boolean isValid = false ; int sign = 0 , hour = 0 , min = 0 , sec = 0 ; do { if ( str == null ) { break ; } int length = str . length ( ) ; if ( length != 5 && length != 7 ) { // utf - offset must be 5 or 7 characters break ; } // sign char s = str . charAt ( 0 ) ; if ( s == '+' ) { sign = 1 ; } else if ( s == '-' ) { sign = - 1 ; } else { // utf - offset must start with " + " or " - " break ; } try { hour = Integer . parseInt ( str . substring ( 1 , 3 ) ) ; min = Integer . parseInt ( str . substring ( 3 , 5 ) ) ; if ( length == 7 ) { sec = Integer . parseInt ( str . substring ( 5 , 7 ) ) ; } } catch ( NumberFormatException nfe ) { break ; } isValid = true ; } while ( false ) ; if ( ! isValid ) { throw new IllegalArgumentException ( "Bad offset string" ) ; } int millis = sign * ( ( hour * 60 + min ) * 60 + sec ) * 1000 ; return millis ;
public class ConcurrentConveyor { /** * Offers an item to the given queue . No check is performed that the queue * actually belongs to this conveyor . * @ return whether the item was accepted by the queue * @ throws ConcurrentConveyorException if the draining thread has already left */ public final boolean offer ( Queue < E > queue , E item ) throws ConcurrentConveyorException { } }
if ( queue . offer ( item ) ) { return true ; } else { checkDrainerGone ( ) ; unparkDrainer ( ) ; return false ; }
public class AreaSizeConversions { /** * Convert an area size . * @ param a The area size * @ param < S > A phantom type parameter indicating the coordinate space of the * area size * @ return An area size */ public static < S > PAreaSizeI < S > toPAreaSizeI ( final AreaSizeI a ) { } }
Objects . requireNonNull ( a , "area size" ) ; return PAreaSizeI . of ( a . sizeX ( ) , a . sizeY ( ) ) ;
public class CpnlElFunctions { /** * Builds an external ( full qualified ) URL for a repository path using the LinkUtil . getURL ( ) method . * @ param request the current request ( domain host hint ) * @ param path the repository path * @ return the URL built in the context of the requested domain host */ public static String externalUrl ( SlingHttpServletRequest request , String path ) { } }
return LinkUtil . getAbsoluteUrl ( request , LinkUtil . getUrl ( request , path ) ) ;
public class VCard { /** * Load VCard information for a given user . XMPPConnection should be authenticated and not anonymous . * @ param connection connection . * @ param user user whos information we want to load . * @ throws XMPPErrorException * @ throws NoResponseException if there was no response from the server . * @ throws NotConnectedException * @ throws InterruptedException * @ deprecated use { @ link VCardManager # loadVCard ( EntityBareJid ) } instead . */ @ Deprecated public void load ( XMPPConnection connection , EntityBareJid user ) throws NoResponseException , XMPPErrorException , NotConnectedException , InterruptedException { } }
VCard result = VCardManager . getInstanceFor ( connection ) . loadVCard ( user ) ; copyFieldsFrom ( result ) ;
public class CmsSiteDetailDialog { /** * Build select options for the position . < p > * @ param currSite the current selected site * @ return the select options */ private List < CmsSelectWidgetOption > createNavOpts ( CmsSiteBean currSite ) { } }
List < CmsSite > sites = new ArrayList < CmsSite > ( ) ; for ( CmsSite site : OpenCms . getSiteManager ( ) . getAvailableSites ( getCms ( ) , true ) ) { if ( site . getSiteMatcher ( ) != null ) { sites . add ( site ) ; } } float maxValue = 0 ; float nextPos = 0 ; // calculate value for the first navigation position float firstValue = 1 ; if ( sites . size ( ) > 0 ) { try { maxValue = sites . get ( 0 ) . getPosition ( ) ; } catch ( Exception e ) { // should usually never happen } } if ( maxValue != 0 ) { firstValue = maxValue / 2 ; } List < String > options = new ArrayList < String > ( sites . size ( ) + 1 ) ; List < String > values = new ArrayList < String > ( sites . size ( ) + 1 ) ; // add the first entry : before first element options . add ( getMessages ( ) . key ( org . opencms . workplace . commons . Messages . GUI_CHNAV_POS_FIRST_0 ) ) ; values . add ( firstValue + "" ) ; // show all present navigation elements in box for ( int i = 0 ; i < sites . size ( ) ; i ++ ) { String navText = sites . get ( i ) . getTitle ( ) ; float navPos = sites . get ( i ) . getPosition ( ) ; String siteRoot = sites . get ( i ) . getSiteRoot ( ) ; // get position of next nav element nextPos = navPos + 2 ; if ( ( i + 1 ) < sites . size ( ) ) { nextPos = sites . get ( i + 1 ) . getPosition ( ) ; } // calculate new position of current nav element float newPos ; if ( ( nextPos - navPos ) > 1 ) { newPos = navPos + 1 ; } else { newPos = ( navPos + nextPos ) / 2 ; } // check new maxValue of positions and increase it if ( navPos > maxValue ) { maxValue = navPos ; } // if the element is the current file , mark it in select box if ( ( currSite != null ) && ( currSite . getSiteRoot ( ) != null ) && currSite . getSiteRoot ( ) . equals ( siteRoot ) ) { options . add ( CmsEncoder . escapeHtml ( getMessages ( ) . key ( org . opencms . workplace . commons . Messages . GUI_CHNAV_POS_CURRENT_1 , new Object [ ] { sites . get ( i ) . getSiteRoot ( ) } ) ) ) ; values . add ( "-1" ) ; } else { options . add ( CmsEncoder . escapeHtml ( navText + " [" + sites . get ( i ) . getSiteRoot ( ) + "/]" ) ) ; values . add ( newPos + "" ) ; } } // add the entry : at the last position options . add ( getMessages ( ) . key ( org . opencms . workplace . commons . Messages . GUI_CHNAV_POS_LAST_0 ) ) ; values . add ( ( maxValue + 1 ) + "" ) ; // add the entry : no change options . add ( getMessages ( ) . key ( org . opencms . workplace . commons . Messages . GUI_CHNAV_NO_CHANGE_0 ) ) ; if ( ( currSite != null ) && ( currSite . getPosition ( ) == Float . MAX_VALUE ) ) { // current resource has no valid position , use " last position " values . add ( ( maxValue + 1 ) + "" ) ; } else { // current resource has valid position , use " - 1 " for no change values . add ( "-1" ) ; } List < CmsSelectWidgetOption > result = new ArrayList < CmsSelectWidgetOption > ( ) ; for ( int i = 0 ; i < values . size ( ) ; i ++ ) { String val = values . get ( i ) ; String opt = options . get ( i ) ; result . add ( new CmsSelectWidgetOption ( val , false , opt ) ) ; } return result ;
public class KeyVaultClientBaseImpl { /** * Deletes a SAS definition from a specified storage account . This operation requires the storage / deletesas permission . * @ param vaultBaseUrl The vault name , for example https : / / myvault . vault . azure . net . * @ param storageAccountName The name of the storage account . * @ param sasDefinitionName The name of the SAS definition . * @ 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 < DeletedSasDefinitionBundle > deleteSasDefinitionAsync ( String vaultBaseUrl , String storageAccountName , String sasDefinitionName , final ServiceCallback < DeletedSasDefinitionBundle > serviceCallback ) { } }
return ServiceFuture . fromResponse ( deleteSasDefinitionWithServiceResponseAsync ( vaultBaseUrl , storageAccountName , sasDefinitionName ) , serviceCallback ) ;
public class ArrayIterate { /** * Searches for the first occurrence of the given argument , testing * for equality using the < tt > equals < / tt > method . */ public static < T > int indexOf ( T [ ] objectArray , T elem ) { } }
return InternalArrayIterate . indexOf ( objectArray , objectArray . length , elem ) ;
public class ConstantPool { /** * Get or create a constant from the constant pool representing a field in * any class . */ public ConstantFieldInfo addConstantField ( String className , String fieldName , TypeDesc type ) { } }
return ConstantFieldInfo . make ( this , ConstantClassInfo . make ( this , className ) , ConstantNameAndTypeInfo . make ( this , fieldName , type ) ) ;
public class BatchGetTriggersRequest { /** * A list of trigger names , which may be the names returned from the < code > ListTriggers < / code > operation . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setTriggerNames ( java . util . Collection ) } or { @ link # withTriggerNames ( java . util . Collection ) } if you want to * override the existing values . * @ param triggerNames * A list of trigger names , which may be the names returned from the < code > ListTriggers < / code > operation . * @ return Returns a reference to this object so that method calls can be chained together . */ public BatchGetTriggersRequest withTriggerNames ( String ... triggerNames ) { } }
if ( this . triggerNames == null ) { setTriggerNames ( new java . util . ArrayList < String > ( triggerNames . length ) ) ; } for ( String ele : triggerNames ) { this . triggerNames . add ( ele ) ; } return this ;
public class Math { /** * Given a list of numbers , returns their avg as double * any value in the list that is not a valid number is ignored * avg ( 2 , " 2 " , " abc " ) = = Optional . of ( 2.0) */ public static Optional < Double > avg ( List < Object > args ) { } }
double sum = 0d ; int count = 0 ; for ( Object arg : args ) { Optional < ? extends Number > numberOptional = Objects . toNumber ( arg ) ; if ( numberOptional . isPresent ( ) ) { sum = sum + numberOptional . get ( ) . doubleValue ( ) ; count = count + 1 ; } } return count == 0 ? Optional . < Double > empty ( ) : Optional . of ( sum / count ) ;
public class VonNeumannIntTupleIterator { /** * Update the minimum / maximum value based on the current * tuple , for the given index * @ param index The index */ private void updateMinMax ( int index ) { } }
if ( index >= min . getSize ( ) ) { return ; } int sum = 0 ; for ( int i = 0 ; i < index ; i ++ ) { sum += Math . abs ( current . get ( i ) ) ; } int m = radius - sum ; min . set ( index , - m ) ; max . set ( index , m ) ;
public class AbstractFunction { /** * Allows to find a function handler instance for its class * @ param < E > the class of the needed function handler extends the * AbstractFunction class * @ param functionClass the class of the needed handler , must not be null * @ return an instance of the needed handler or null if there is not any such * one */ @ Nullable public static < E extends AbstractFunction > E findForClass ( @ Nonnull final Class < E > functionClass ) { } }
E result = null ; for ( final AbstractFunction function : getAllFunctions ( ) ) { if ( function . getClass ( ) == functionClass ) { result = functionClass . cast ( function ) ; break ; } } return result ;
public class StandardResourceDescriptionResolver { /** * { @ inheritDoc } */ @ Override public String getResourceAttributeDeprecatedDescription ( String attributeName , Locale locale , ResourceBundle bundle ) { } }
return bundle . getString ( getBundleKey ( attributeName , DEPRECATED ) ) ;
public class PropertyTypeImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public void eSet ( int featureID , Object newValue ) { } }
switch ( featureID ) { case BpsimPackage . PROPERTY_TYPE__NAME : setName ( ( String ) newValue ) ; return ; } super . eSet ( featureID , newValue ) ;
public class IdentityFactoryImpl { /** * This method orders the specified field values based on the * specified { @ link org . apache . ojb . broker . metadata . FieldDescriptor } . * @ param flds The { @ link org . apache . ojb . broker . metadata . FieldDescriptor } array . * @ param fieldNames The field names . * @ param fieldValues The field values . * @ return The ordered field values . */ private Object [ ] reorderFieldValues ( FieldDescriptor [ ] flds , String [ ] fieldNames , Object [ ] fieldValues ) { } }
String fieldName ; Object [ ] orderedValues = new Object [ flds . length ] ; for ( int i = 0 ; i < flds . length ; i ++ ) { fieldName = flds [ i ] . getPersistentField ( ) . getName ( ) ; int realPosition = findIndexForName ( fieldNames , fieldName ) ; orderedValues [ i ] = fieldValues [ realPosition ] ; } return orderedValues ;
public class DialogControl { /** * Returns the last saved response for this dialog . * @ return The response , or null if none found . */ public DialogResponse < T > getLastResponse ( ) { } }
String saved = saveResponseId == null ? null : PropertyUtil . getValue ( SAVED_RESPONSE_PROP_NAME , saveResponseId ) ; int i = NumberUtils . toInt ( saved , - 1 ) ; DialogResponse < T > response = i < 0 || i >= responses . size ( ) ? null : responses . get ( i ) ; return response == null || response . isExcluded ( ) ? null : response ;
public class AuthorizationImpl { /** * Removes < code > IPermissions < / code > from the cache . * @ param permissions IPermission [ ] */ private void removeFromPermissionsCache ( IPermission [ ] permissions ) throws AuthorizationException { } }
IAuthorizationPrincipal [ ] principals = getPrincipalsFromPermissions ( permissions ) ; removeFromPermissionsCache ( principals ) ;
public class MapFixture { /** * Stores double value in map . * @ param value value to be passed . * @ param name name to use this value for . * @ param map map to store value in . */ public void setDoubleValueForIn ( double value , String name , Map < String , Object > map ) { } }
setValueForIn ( Double . valueOf ( value ) , name , map ) ;
public class ListAssociatedFleetsRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( ListAssociatedFleetsRequest listAssociatedFleetsRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( listAssociatedFleetsRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( listAssociatedFleetsRequest . getStackName ( ) , STACKNAME_BINDING ) ; protocolMarshaller . marshall ( listAssociatedFleetsRequest . getNextToken ( ) , NEXTTOKEN_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class BatchHelper { /** * Flush our buffer if we are not already in a flush operation and we have data to flush . */ private void flushIfPossible ( boolean flushAll ) throws IOException { } }
if ( flushAll ) { flushLock . lock ( ) ; } else if ( pendingRequests . isEmpty ( ) || ! flushLock . tryLock ( ) ) { return ; } try { do { flushPendingRequests ( ) ; if ( flushAll ) { awaitRequestsCompletion ( ) ; } } while ( flushAll && ( ! pendingRequests . isEmpty ( ) || ! responseFutures . isEmpty ( ) ) ) ; } finally { flushLock . unlock ( ) ; }
public class NoteRef { /** * If this note is linked , then it loads the corresponding notebook for the linked notebook . Use * { @ link # loadLinkedNotebook ( ) } to get the linked notebook . * @ return The note ' s notebook from server . * @ see # isLinked ( ) * @ see EvernoteLinkedNotebookHelper # getCorrespondingNotebook ( ) */ public Notebook loadNotebook ( ) throws EDAMUserException , EDAMSystemException , TException , EDAMNotFoundException { } }
if ( mNotebookGuid == null ) { return null ; } if ( mLinked ) { LinkedNotebook linkedNotebook = NoteRefHelper . getLinkedNotebook ( mNotebookGuid ) ; return NoteRefHelper . getSession ( ) . getEvernoteClientFactory ( ) . getLinkedNotebookHelper ( linkedNotebook ) . getCorrespondingNotebook ( ) ; } EvernoteNoteStoreClient noteStore = NoteRefHelper . getNoteStore ( this ) ; if ( noteStore == null ) { return null ; } return noteStore . getNotebook ( mNotebookGuid ) ;
public class PaxLoggingServiceImpl { /** * Configure Java Util Logging according to the provided configuration . * Convert the log4j configuration to JUL config . * It ' s necessary to do that , because with pax logging , JUL loggers are not replaced . * So we need to configure JUL loggers in order that log messages goes correctly to log Handlers . * @ param configuration Properties coming from the configuration . */ private static void setLevelToJavaLogging ( final Dictionary < String , ? > configuration ) { } }
for ( Enumeration enum_ = java . util . logging . LogManager . getLogManager ( ) . getLoggerNames ( ) ; enum_ . hasMoreElements ( ) ; ) { String name = ( String ) enum_ . nextElement ( ) ; java . util . logging . Logger . getLogger ( name ) . setLevel ( null ) ; } for ( Enumeration < String > keys = configuration . keys ( ) ; keys . hasMoreElements ( ) ; ) { String name = keys . nextElement ( ) ; if ( name . equals ( LOG4J2_ROOT_LOGGER_LEVEL_PROPERTY ) ) { String value = ( String ) configuration . get ( LOG4J2_ROOT_LOGGER_LEVEL_PROPERTY ) ; setJULLevel ( java . util . logging . Logger . getLogger ( "" ) , value ) ; // " global " comes from java . util . logging . Logger . GLOBAL _ LOGGER _ NAME , but that constant wasn ' t added until Java 1.6 setJULLevel ( java . util . logging . Logger . getLogger ( "global" ) , value ) ; } if ( name . startsWith ( LOG4J2_LOGGER_PROPERTY_PREFIX ) && name . endsWith ( ".name" ) ) { String value = ( String ) configuration . get ( name . replaceFirst ( "\\.name$" , ".level" ) ) ; String packageName = ( String ) configuration . get ( name ) ; java . util . logging . Logger logger = java . util . logging . Logger . getLogger ( packageName ) ; setJULLevel ( logger , value ) ; } }
public class CmsResourceHistoryTable { /** * Adds a table column . < p > */ private void addRevertColumn ( ) { } }
CmsButtonCell < CmsHistoryResourceBean > replaceCell = new CmsButtonCell < CmsHistoryResourceBean > ( CmsHistoryMessages . titleRevert ( ) , I_CmsButton . ICON_FONT + " " + I_CmsButton . RESET , new ActionCell . Delegate < CmsHistoryResourceBean > ( ) { @ SuppressWarnings ( "synthetic-access" ) public void execute ( CmsHistoryResourceBean historyRes ) { m_handler . revert ( historyRes ) ; } } , new Predicate < CmsHistoryResourceBean > ( ) { public boolean apply ( CmsHistoryResourceBean bean ) { return bean . getVersion ( ) . getVersionNumber ( ) != null ; } } ) ; addColumn ( CmsHistoryMessages . columnReplace ( ) , 30 , new IdentityColumn < CmsHistoryResourceBean > ( replaceCell ) ) ;
public class XMLAssert { /** * Assert that two XML documents are similar * @ param err Message to be displayed on assertion failure * @ param control XML to be compared against * @ param test XML to be tested * @ throws SAXException * @ throws IOException */ public static void assertXMLEqual ( String err , Reader control , Reader test ) throws SAXException , IOException { } }
Diff diff = new Diff ( control , test ) ; assertXMLEqual ( err , diff , true ) ;
public class AppServicePlansInner { /** * Retrieve all Hybrid Connections in use in an App Service plan . * Retrieve all Hybrid Connections in use in an App Service plan . * ServiceResponse < PageImpl < HybridConnectionInner > > * @ param resourceGroupName Name of the resource group to which the resource belongs . * ServiceResponse < PageImpl < HybridConnectionInner > > * @ param name Name of the App Service plan . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the PagedList & lt ; HybridConnectionInner & gt ; object wrapped in { @ link ServiceResponse } if successful . */ public Observable < ServiceResponse < Page < HybridConnectionInner > > > listHybridConnectionsSinglePageAsync ( final String resourceGroupName , final String name ) { } }
if ( resourceGroupName == null ) { throw new IllegalArgumentException ( "Parameter resourceGroupName is required and cannot be null." ) ; } if ( name == null ) { throw new IllegalArgumentException ( "Parameter name is required and cannot be null." ) ; } if ( this . client . subscriptionId ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.subscriptionId() is required and cannot be null." ) ; } if ( this . client . apiVersion ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.apiVersion() is required and cannot be null." ) ; } return service . listHybridConnections ( resourceGroupName , name , this . client . subscriptionId ( ) , this . client . apiVersion ( ) , this . client . acceptLanguage ( ) , this . client . userAgent ( ) ) . flatMap ( new Func1 < Response < ResponseBody > , Observable < ServiceResponse < Page < HybridConnectionInner > > > > ( ) { @ Override public Observable < ServiceResponse < Page < HybridConnectionInner > > > call ( Response < ResponseBody > response ) { try { ServiceResponse < PageImpl < HybridConnectionInner > > result = listHybridConnectionsDelegate ( response ) ; return Observable . just ( new ServiceResponse < Page < HybridConnectionInner > > ( result . body ( ) , result . response ( ) ) ) ; } catch ( Throwable t ) { return Observable . error ( t ) ; } } } ) ;
public class VodClient { /** * Delete the specific media resource managed by VOD service . * The caller < i > must < / i > authenticate with a valid BCE Access Key / Private Key pair . * @ param request The request object containing all the options on how to * @ return empty response will be returned */ public GenerateMediaDeliveryInfoResponse generateMediaDeliveryInfo ( GenerateMediaDeliveryInfoRequest request ) { } }
checkStringNotEmpty ( request . getMediaId ( ) , "Media ID should not be null or empty!" ) ; InternalRequest internalRequest = createRequest ( HttpMethodName . GET , request , PATH_MEDIA , request . getMediaId ( ) , PARA_GENDELIVERY ) ; internalRequest . addParameter ( PARAM_TRANSCODING_PRESET_NAME , request . getTranscodingPresetName ( ) ) ; return invokeHttpClient ( internalRequest , GenerateMediaDeliveryInfoResponse . class ) ;
public class MutableClock { /** * Alters the specified field of this clock . * Atomically updates this clock to the value of the following expression : * < pre > * ZonedDateTime . now ( thisClock ) * . with ( field , newValue ) * . toInstant ( ) * < / pre > * @ param field the field to set , not null * @ param newValue the new value of the field * @ throws DateTimeException if the field cannot be set * @ throws UnsupportedTemporalTypeException if the field is not supported * @ throws ArithmeticException if numeric overflow occurs * @ see ZonedDateTime # with ( TemporalField , long ) */ public void set ( TemporalField field , long newValue ) { } }
Objects . requireNonNull ( field , "field" ) ; synchronized ( instantHolder ) { ZonedDateTime current = ZonedDateTime . ofInstant ( instantHolder . get ( ) , zone ) ; ZonedDateTime result = current . with ( field , newValue ) ; instantHolder . set ( result . toInstant ( ) ) ; }
public class MathFunctions { /** * < div color = ' red ' style = " font - size : 24px ; color : red " > < b > < i > < u > JCYPHER < / u > < / i > < / b > < / div > * < div color = ' red ' style = " font - size : 18px ; color : red " > < i > return the the half versine of a number . < / i > < / div > * < div color = ' red ' style = " font - size : 18px ; color : red " > < i > The number argument is the one to which this function is appended , < / i > < / div > * < div color = ' red ' style = " font - size : 18px ; color : red " > < i > in accordance to a post - fix notation . < / i > < / div > * < div color = ' red ' style = " font - size : 18px ; color : red " > < i > Please have a look at the Neo4j manual for a description on how to use * the haversin function to compute the distance between two points on the surface of a sphere . < / i > < / div > * < div color = ' red ' style = " font - size : 18px ; color : red " > < i > e . g . < b > n . numberProperty ( " number " ) . math ( ) . haversin ( ) < / b > < / i > < / div > * < br / > */ public JcNumber haversin ( ) { } }
JcNumber ret = new JcNumber ( null , this . argument , new FunctionInstance ( FUNCTION . Math . HAVERSIN , 1 ) ) ; QueryRecorder . recordInvocationConditional ( this , "haversin" , ret ) ; return ret ;
public class Assert { /** * Asserts that two { @ link Object objects } are the same { @ link Object } as determined by the identity comparison . * The assertion holds if and only if the two { @ link Object objects } are the same { @ link Object } in memory . * @ param obj1 { @ link Object left operand } in the identity comparison . * @ param obj2 { @ link Object right operand } in the identity comparison . * @ param message { @ link String } containing the message used in the { @ link IdentityException } thrown * if the assertion fails . * @ param arguments array of { @ link Object arguments } used as placeholder values * when formatting the { @ link String message } . * @ throws org . cp . elements . lang . IdentityException if the two { @ link Object objects } are not the same . * @ see # same ( Object , Object , RuntimeException ) * @ see java . lang . Object */ public static void same ( Object obj1 , Object obj2 , String message , Object ... arguments ) { } }
same ( obj1 , obj2 , new IdentityException ( format ( message , arguments ) ) ) ;
public class BasePanel { /** * Process the " Help " toolbar command . * @ param bUseSameWindow Use the same window ? * @ retrun true if successful . */ public boolean onHelp ( int iOptions ) { } }
String strPrevAction = this . getScreenURL ( ) ; if ( ( strPrevAction == null ) || ( strPrevAction . length ( ) == 0 ) ) return false ; // Can ' t handle help if I ' m not the target screen . // Note : The following is a hack to make the demo screen stop displaying after the first help is pressed if ( this . getProperty ( "displayInitialHelp" ) != null ) if ( ( this . getProperty ( "helplanguage" ) != null ) && ( this . getProperty ( "helplanguage" ) . length ( ) > 0 ) ) if ( this . getTask ( ) != null ) if ( this . getTask ( ) . getApplication ( ) != null ) this . getTask ( ) . getApplication ( ) . setProperty ( "helplanguage" , this . getTask ( ) . getApplication ( ) . getLanguage ( true ) ) ; strPrevAction = Utility . fixDisplayURL ( strPrevAction , true , true , true , this ) ; BaseAppletReference applet = null ; if ( this . getAppletScreen ( ) != null ) if ( this . getAppletScreen ( ) . getScreenFieldView ( ) != null ) applet = ( BaseAppletReference ) this . getAppletScreen ( ) . getScreenFieldView ( ) . getControl ( ) ; if ( applet != null ) iOptions = applet . getHelpPageOptions ( iOptions ) ; if ( ( MenuConstants . HELP_WEB_OPTION & iOptions ) == MenuConstants . HELP_WEB_OPTION ) return this . getScreenFieldView ( ) . showDocument ( strPrevAction , iOptions & 1 ) ; // Not standalone else return this . getAppletScreen ( ) . showHelpScreen ( strPrevAction , iOptions ) ;
public class KuberntesServiceUrlResourceProvider { /** * @ param qualifiers * The qualifiers * @ return true if qualifiers contain the ` PortForward ` qualifier . */ private static boolean isPortForwardingEnabled ( Annotation ... qualifiers ) { } }
for ( Annotation q : qualifiers ) { if ( q instanceof PortForward ) { return true ; } } return false ;
public class Descriptives { /** * Calculates Maximum absolute value . * @ param flatDataCollection * @ return */ public static double maxAbsolute ( FlatDataCollection flatDataCollection ) { } }
double maxAbs = 0.0 ; Iterator < Double > it = flatDataCollection . iteratorDouble ( ) ; while ( it . hasNext ( ) ) { Double v = it . next ( ) ; if ( v != null ) { maxAbs = Math . max ( maxAbs , Math . abs ( v ) ) ; } } return maxAbs ;
public class StickyGridHeadersGridView { /** * Gets the header at an item position . However , the position must be that * of a HeaderFiller . * @ param position Position of HeaderFiller . * @ return Header View wrapped in HeaderFiller or null if no header was * found . */ public View getHeaderAt ( int position ) { } }
if ( position == MATCHED_STICKIED_HEADER ) { return mStickiedHeader ; } try { return ( View ) getChildAt ( position ) . getTag ( ) ; } catch ( Exception e ) { } return null ;
public class StructureTools { /** * Count how many Atoms are contained within a Structure object . * @ param s * the structure object * @ return the number of Atoms in this Structure */ public static final int getNrAtoms ( Structure s ) { } }
int nrAtoms = 0 ; Iterator < Group > iter = new GroupIterator ( s ) ; while ( iter . hasNext ( ) ) { Group g = iter . next ( ) ; nrAtoms += g . size ( ) ; } return nrAtoms ;
public class TimerNpImpl { /** * Returns a collection of all active Timers associated with the specified * BeanId . ( It does not look for timers queued to start or on a cancelled queue ) < p > * @ param beanId Bean identity for which active Timers will be returned . * @ return a collection of Timers associated with the specified bean Id . */ public static Collection < Timer > findTimersByBeanId ( BeanId beanId , ContainerTx tx ) // F743-425 . CodRev { } }
final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "findTimersByBeanId: " + beanId ) ; int numActive = 0 ; ArrayList < Timer > timers = new ArrayList < Timer > ( ) ; // Search the active timers for all timer taskIDs associated with the given beanId . synchronized ( svActiveTimers ) // F743-425 . CodRev { for ( TimerNpImpl npTimer : svActiveTimers . values ( ) ) { if ( npTimer . ivBeanId . equals ( beanId ) ) { timers . add ( npTimer ) ; } } numActive = svActiveTimers . size ( ) ; // for trace } if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "findTimersByBeanId: " + timers . size ( ) + "(of " + numActive + " active)" ) ; return timers ;
public class MergePolicyValidator { /** * Checks if a { @ link SplitBrainMergeTypeProvider } provides all required types of a given { @ link SplitBrainMergePolicy } . * @ param mergeTypeProvider the { @ link SplitBrainMergeTypeProvider } to retrieve the provided merge types * @ param mergePolicyInstance the { @ link SplitBrainMergePolicy } instance * @ return a list of the required merge types */ private static List < Class > checkSplitBrainMergePolicy ( SplitBrainMergeTypeProvider mergeTypeProvider , SplitBrainMergePolicy mergePolicyInstance ) { } }
List < Class > requiredMergeTypes = new ArrayList < Class > ( ) ; Class providedMergeTypes = mergeTypeProvider . getProvidedMergeTypes ( ) ; Class < ? > mergePolicyClass = mergePolicyInstance . getClass ( ) ; String mergePolicyClassName = mergePolicyClass . getName ( ) ; // iterate over the complete class hierarchy of a merge policy , to check all its generics do { checkSplitBrainMergePolicyGenerics ( requiredMergeTypes , providedMergeTypes , mergePolicyClassName , mergePolicyClass ) ; mergePolicyClass = mergePolicyClass . getSuperclass ( ) ; } while ( mergePolicyClass != null ) ; return requiredMergeTypes ;
public class FormSectionController { /** * Removes the form element with the specified name from this section . * @ param name the name of the form element to remove * @ return the removed form element instance , or null of no such element was found . */ public FormElementController removeElement ( String name ) { } }
FormElementController element = elements . remove ( name ) ; orderedElements . remove ( element ) ; return element ;
public class StartRemediationExecutionRequest { /** * A list of resource keys to be processed with the current request . Each element in the list consists of the * resource type and resource ID . * @ return A list of resource keys to be processed with the current request . Each element in the list consists of * the resource type and resource ID . */ public java . util . List < ResourceKey > getResourceKeys ( ) { } }
if ( resourceKeys == null ) { resourceKeys = new com . amazonaws . internal . SdkInternalList < ResourceKey > ( ) ; } return resourceKeys ;
public class BoxRetentionPolicy { /** * Returns iterable with all assignments of given type of this retention policy . * @ param type the type of the retention policy assignment to retrieve . Can either be " folder " or " enterprise " . * @ param limit the limit of entries per response . The default value is 100. * @ param fields the fields to retrieve . * @ return an iterable containing all assignments of given type . */ private Iterable < BoxRetentionPolicyAssignment . Info > getAssignments ( String type , int limit , String ... fields ) { } }
QueryStringBuilder queryString = new QueryStringBuilder ( ) ; if ( type != null ) { queryString . appendParam ( "type" , type ) ; } if ( fields . length > 0 ) { queryString . appendParam ( "fields" , fields ) ; } URL url = ASSIGNMENTS_URL_TEMPLATE . buildWithQuery ( getAPI ( ) . getBaseURL ( ) , queryString . toString ( ) , getID ( ) ) ; return new BoxResourceIterable < BoxRetentionPolicyAssignment . Info > ( getAPI ( ) , url , limit ) { @ Override protected BoxRetentionPolicyAssignment . Info factory ( JsonObject jsonObject ) { BoxRetentionPolicyAssignment assignment = new BoxRetentionPolicyAssignment ( getAPI ( ) , jsonObject . get ( "id" ) . asString ( ) ) ; return assignment . new Info ( jsonObject ) ; } } ;
public class MODCAInterchangeSetImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public boolean eIsSet ( int featureID ) { } }
switch ( featureID ) { case AfplibPackage . MODCA_INTERCHANGE_SET__ISTYPE : return ISTYPE_EDEFAULT == null ? iStype != null : ! ISTYPE_EDEFAULT . equals ( iStype ) ; case AfplibPackage . MODCA_INTERCHANGE_SET__ISID : return ISID_EDEFAULT == null ? iSid != null : ! ISID_EDEFAULT . equals ( iSid ) ; } return super . eIsSet ( featureID ) ;
public class NotificationManager { /** * Create a changes object from a delete operation . * @ param schemaName schemaName of deleted instances * @ param instanceIds id of deleted instances * @ return changes object */ public final ConfigChanges deleted ( String schemaName , Collection < String > instanceIds ) { } }
ConfigChanges changes = new ConfigChanges ( ) ; for ( String instanceId : instanceIds ) { BeanId id = BeanId . create ( instanceId , schemaName ) ; Optional < Bean > before = beanManager . getEager ( id ) ; if ( ! before . isPresent ( ) ) { throw Events . CFG304_BEAN_DOESNT_EXIST ( id ) ; } Bean bean = before . get ( ) ; schemaManager . setSchema ( Arrays . asList ( bean ) ) ; changes . add ( ConfigChange . deleted ( bean ) ) ; } return changes ;
public class Selection { /** * Sort the double array in ascending order using this algorithm . * @ param doubleArray the array of double that we want to sort */ public static void sort ( double [ ] doubleArray ) { } }
int index = 0 ; double value = 0.0 ; for ( int i = 1 ; i < doubleArray . length ; i ++ ) { index = i ; value = doubleArray [ index ] ; while ( index > 0 && value < doubleArray [ index - 1 ] ) { doubleArray [ index ] = doubleArray [ index - 1 ] ; index -- ; } doubleArray [ index ] = value ; }
public class AsciiSet { /** * Returns true if all characters in the string are contained within the set . */ public boolean containsAll ( CharSequence str ) { } }
final int n = str . length ( ) ; for ( int i = 0 ; i < n ; ++ i ) { if ( ! contains ( str . charAt ( i ) ) ) { return false ; } } return true ;
public class AddMetadataAction { /** * Validates if parent node type is { @ link Constants # NT _ RESOURCE } . */ private NodeImpl getAndValidateParent ( PropertyImpl property ) throws Exception { } }
NodeImpl parent = property . getParent ( ) ; if ( ! parent . isNodeType ( "nt:resource" ) ) { throw new Exception ( "Incoming node is not nt:resource type" ) ; } return parent ;
public class AbstractReady { /** * { @ inheritDoc } */ @ Override public final < S extends Service > List < S > getServices ( final UniqueKey < S > serviceKey ) { } }
localFacade ( ) . globalFacade ( ) . trackEvent ( JRebirthEventType . ACCESS_SERVICE , this . getClass ( ) , serviceKey . classField ( ) ) ; return localFacade ( ) . globalFacade ( ) . serviceFacade ( ) . retrieveMany ( serviceKey ) ;
public class ParallelExecutor { /** * Run a task on all available CPUs . * @ param ids IDs to process * @ param procs Processors to run */ public static void run ( DBIDs ids , Processor ... procs ) { } }
ParallelCore core = ParallelCore . getCore ( ) ; core . connect ( ) ; try { // TODO : try different strategies anyway ! ArrayDBIDs aids = DBIDUtil . ensureArray ( ids ) ; final int size = aids . size ( ) ; int numparts = core . getParallelism ( ) ; // TODO : are there better heuristics for choosing this ? numparts = ( size > numparts * numparts * 16 ) ? numparts * Math . max ( 1 , numparts - 1 ) : numparts ; final int blocksize = ( size + ( numparts - 1 ) ) / numparts ; List < Future < ArrayDBIDs > > parts = new ArrayList < > ( numparts ) ; for ( int i = 0 ; i < numparts ; i ++ ) { final int start = i * blocksize ; final int end = Math . min ( start + blocksize , size ) ; Callable < ArrayDBIDs > run = new BlockArrayRunner ( aids , start , end , procs ) ; parts . add ( core . submit ( run ) ) ; } for ( Future < ArrayDBIDs > fut : parts ) { fut . get ( ) ; } } catch ( ExecutionException e ) { throw new RuntimeException ( "Processor execution failed." , e ) ; } catch ( InterruptedException e ) { throw new RuntimeException ( "Parallel execution interrupted." ) ; } finally { core . disconnect ( ) ; }
public class ExpressionResolverImpl { /** * Perform a standard { @ link org . jboss . dmr . ModelNode # resolve ( ) } on the given { @ code unresolved } node . * @ param unresolved the unresolved node , which should be of type { @ link org . jboss . dmr . ModelType # EXPRESSION } * @ return a node of type { @ link ModelType # STRING } * @ throws OperationFailedException if { @ code ignoreFailures } is { @ code false } and the expression cannot be resolved */ private static String resolveStandardExpression ( final ModelNode unresolved ) throws OperationFailedException { } }
try { return unresolved . resolve ( ) . asString ( ) ; } catch ( SecurityException e ) { // A security exception should propagate no matter what the value of ignoreUnresolvable is . The first call to // this method for any expression will have ignoreUnresolvable set to ' false ' which means a basic test of // ability to read system properties will have already passed . So a failure with ignoreUnresolvable set to // true means a specific property caused the failure , and that should not be ignored throw new OperationFailedException ( ControllerLogger . ROOT_LOGGER . noPermissionToResolveExpression ( unresolved , e ) ) ; } catch ( IllegalStateException e ) { return unresolved . asString ( ) ; }
public class ActionMapping { /** * Support four types of url * 1 : http : / / abc . com / controllerKey - - - > 00 * 2 : http : / / abc . com / controllerKey / para - - - > 01 * 3 : http : / / abc . com / controllerKey / method - - - > 10 * 4 : http : / / abc . com / controllerKey / method / para - - - > 11 * The controllerKey can also contains " / " * Example : http : / / abc . com / uvw / xyz / method / para */ public Action getAction ( String url , String [ ] urlPara ) { } }
Action action = mapping . get ( url ) ; if ( action != null ) { return action ; } int i = url . lastIndexOf ( '/' ) ; if ( i != - 1 ) { action = mapping . get ( url . substring ( 0 , i ) ) ; if ( action != null ) { urlPara [ 0 ] = url . substring ( i + 1 ) ; } } return action ;
public class PersistentStreamBase { /** * Method to calculate number of splits and merges . * Principle to calculate the number of splits and merges : * 1 - An event has occurred if a reference range is present ( overlaps ) in at least two consecutive target ranges . * 2 - If the direction of the check in 1 is forward , then it is a split , otherwise it is a merge . * @ param referenceSegmentsList Reference segment list . * @ param targetSegmentsList Target segment list . * @ return Number of splits / merges . */ private long findSegmentSplitsMerges ( List < StreamSegmentRecord > referenceSegmentsList , List < StreamSegmentRecord > targetSegmentsList ) { } }
return referenceSegmentsList . stream ( ) . filter ( segment -> targetSegmentsList . stream ( ) . filter ( target -> target . overlaps ( segment ) ) . count ( ) > 1 ) . count ( ) ;
public class ClassUtils { /** * Copy the given Collection into a Class array . * The Collection must contain Class elements only . * @ param collection the Collection to copy * @ return the Class array ( { @ code null } if the passed - in * Collection was { @ code null } ) */ public static Class < ? > [ ] toClassArray ( Collection < Class < ? > > collection ) { } }
if ( collection == null ) { return null ; } return collection . toArray ( new Class < ? > [ collection . size ( ) ] ) ;
public class Referenceable { /** * Matches traits , values associated with this Referenceable and skips the id match * @ param o The Referenceable which needs to be matched with * @ return */ public boolean equalsContents ( Object o ) { } }
if ( this == o ) { return true ; } if ( o == null ) { return false ; } if ( o . getClass ( ) != getClass ( ) ) { return false ; } if ( ! super . equalsContents ( o ) ) { return false ; } Referenceable obj = ( Referenceable ) o ; if ( ! traitNames . equals ( obj . getTraits ( ) ) ) { return false ; } return true ;
public class AbstractDatabaseEngine { /** * Gets the result set of the specified prepared statement . * @ param name The prepared statement name . * @ return The result . * @ throws DatabaseEngineException If something occurs getting the result . */ @ Override public synchronized List < Map < String , ResultColumn > > getPSResultSet ( final String name ) throws DatabaseEngineException { } }
return processResultIterator ( getPSIterator ( name ) ) ;
public class DescribeEgressOnlyInternetGatewaysRequest { /** * One or more egress - only internet gateway IDs . * @ return One or more egress - only internet gateway IDs . */ public java . util . List < String > getEgressOnlyInternetGatewayIds ( ) { } }
if ( egressOnlyInternetGatewayIds == null ) { egressOnlyInternetGatewayIds = new com . amazonaws . internal . SdkInternalList < String > ( ) ; } return egressOnlyInternetGatewayIds ;
public class StringHelper { /** * Take a concatenated String and return the passed String array of all elements * in the passed string , using specified separator char . * @ param cSep * The separator to use . * @ param sElements * The concatenated String to convert . May be < code > null < / code > or empty . * @ param nMaxItems * The maximum number of items to explode . If the passed value is & le ; 0 * all items are used . If max items is 1 , than the result string is * returned as is . If max items is larger than the number of elements * found , it has no effect . * @ return The passed collection and never < code > null < / code > . */ @ Nonnull public static String [ ] getExplodedArray ( final char cSep , @ Nullable final String sElements , @ CheckForSigned final int nMaxItems ) { } }
if ( nMaxItems == 1 ) return new String [ ] { sElements } ; if ( hasNoText ( sElements ) ) return ArrayHelper . EMPTY_STRING_ARRAY ; final int nMaxResultElements = 1 + getCharCount ( sElements , cSep ) ; if ( nMaxResultElements == 1 ) { // Separator not found return new String [ ] { sElements } ; } final String [ ] ret = new String [ nMaxItems < 1 ? nMaxResultElements : Math . min ( nMaxResultElements , nMaxItems ) ] ; // Do not use RegExCache . stringReplacePattern because of package // dependencies // Do not use String . split because it trims empty tokens from the end int nStartIndex = 0 ; int nItemsAdded = 0 ; while ( true ) { final int nMatchIndex = sElements . indexOf ( cSep , nStartIndex ) ; if ( nMatchIndex < 0 ) break ; ret [ nItemsAdded ++ ] = sElements . substring ( nStartIndex , nMatchIndex ) ; // 1 = = length of separator char nStartIndex = nMatchIndex + 1 ; if ( nMaxItems > 0 && nItemsAdded == nMaxItems - 1 ) { // We have exactly one item the left : the rest of the string break ; } } ret [ nItemsAdded ++ ] = sElements . substring ( nStartIndex ) ; if ( nItemsAdded != ret . length ) throw new IllegalStateException ( "Added " + nItemsAdded + " but expected " + ret . length ) ; return ret ;
public class Graph { /** * Returns true if there exists a path from u to v in this graph . * If includeAdjacent is false , it returns true if there exists * another path from u to v of distance > 1 */ private boolean pathExists ( T u , T v , boolean includeAdjacent ) { } }
if ( ! nodes . contains ( u ) || ! nodes . contains ( v ) ) { return false ; } if ( includeAdjacent && isAdjacent ( u , v ) ) { return true ; } Deque < T > stack = new LinkedList < > ( ) ; Set < T > visited = new HashSet < > ( ) ; stack . push ( u ) ; while ( ! stack . isEmpty ( ) ) { T node = stack . pop ( ) ; if ( node . equals ( v ) ) { return true ; } if ( ! visited . contains ( node ) ) { visited . add ( node ) ; edges . get ( node ) . stream ( ) . filter ( e -> includeAdjacent || ! node . equals ( u ) || ! e . equals ( v ) ) . forEach ( stack :: push ) ; } } assert ! visited . contains ( v ) ; return false ;
public class JdbcCpoXaAdapter { /** * This method is called to determine if the resource manager instance represented by the target object is the same as the resouce manager * instance represented by the parameter xares . * @ param xaResource - An XAResource object whose resource manager instance is to be compared with the resource manager instance of the target object . * @ return - true if it ' s the same RM instance ; otherwise false . * @ throws XAException - An error has occurred . Possible exception values are XAER _ RMERR and XAER _ RMFAIL . */ @ Override public boolean isSameRM ( XAResource xaResource ) throws XAException { } }
if ( xaResource == null ) throw CpoXaError . createXAException ( CpoXaError . XAER_INVAL , "Invalid parameter. xaResource cannot be null." ) ; return xaResource instanceof JdbcCpoXaAdapter ;
public class WebSocketServerHandshakerFactory { /** * Return that we need cannot not support the web socket version */ public static ChannelFuture sendUnsupportedVersionResponse ( Channel channel , ChannelPromise promise ) { } }
HttpResponse res = new DefaultFullHttpResponse ( HttpVersion . HTTP_1_1 , HttpResponseStatus . UPGRADE_REQUIRED ) ; res . headers ( ) . set ( HttpHeaderNames . SEC_WEBSOCKET_VERSION , WebSocketVersion . V13 . toHttpHeaderValue ( ) ) ; HttpUtil . setContentLength ( res , 0 ) ; return channel . writeAndFlush ( res , promise ) ;
public class DeviceProxyFactory { public static DeviceProxy get ( String deviceName , String tangoHost ) throws DevFailed { } }
// Get full device name ( with tango host ) to manage multi tango _ host String fullDeviceName ; if ( deviceName . startsWith ( "tango://" ) || deviceName . startsWith ( "//" ) ) fullDeviceName = deviceName ; else fullDeviceName = "tango://" + tangoHost + "/" + deviceName ; // Get it if already exists DeviceProxy dev = proxy_table . get ( fullDeviceName ) ; if ( dev == null ) { try { // Else create it . dev = new DeviceProxy ( deviceName ) ; proxy_table . put ( fullDeviceName , dev ) ; } catch ( DevFailed e ) { e . printStackTrace ( ) ; throw e ; } } return dev ;
public class JdiInitiator { /** * / * launch child target vm */ private VirtualMachine launchTarget ( ) { } }
LaunchingConnector launcher = ( LaunchingConnector ) connector ; try { VirtualMachine new_vm = timedVirtualMachineCreation ( ( ) -> launcher . launch ( connectorArgs ) , null ) ; process = new_vm . process ( ) ; return new_vm ; } catch ( Throwable ex ) { throw reportLaunchFail ( ex , "launch" ) ; }
public class CmsSecurityManager { /** * Subscribes the user or group to the resource . < p > * @ param context the request context * @ param poolName the name of the database pool to use * @ param principal the principal that subscribes to the resource * @ param resource the resource to subscribe to * @ throws CmsException if something goes wrong */ public void subscribeResourceFor ( CmsRequestContext context , String poolName , CmsPrincipal principal , CmsResource resource ) throws CmsException { } }
CmsDbContext dbc = m_dbContextFactory . getDbContext ( context ) ; try { m_driverManager . subscribeResourceFor ( dbc , poolName , principal , resource ) ; } catch ( Exception e ) { if ( principal instanceof CmsUser ) { dbc . report ( null , Messages . get ( ) . container ( Messages . ERR_SUBSCRIBE_RESOURCE_FOR_USER_2 , context . getSitePath ( resource ) , principal . getName ( ) ) , e ) ; } else { dbc . report ( null , Messages . get ( ) . container ( Messages . ERR_SUBSCRIBE_RESOURCE_FOR_GROUP_2 , context . getSitePath ( resource ) , principal . getName ( ) ) , e ) ; } } finally { dbc . clear ( ) ; }
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link CustomFieldDefinition } { @ code > } } */ @ XmlElementDecl ( namespace = "http://schema.intuit.com/finance/v3" , name = "CustomFieldDefinition" , substitutionHeadNamespace = "http://schema.intuit.com/finance/v3" , substitutionHeadName = "IntuitObject" ) public JAXBElement < CustomFieldDefinition > createCustomFieldDefinition ( CustomFieldDefinition value ) { } }
return new JAXBElement < CustomFieldDefinition > ( _CustomFieldDefinition_QNAME , CustomFieldDefinition . class , null , value ) ;
public class KieModuleModelImpl { /** * / * ( non - Javadoc ) * @ see org . kie . kModule . KieProject # addKBase ( org . kie . kModule . KieBaseModelImpl ) */ public KieBaseModel newKieBaseModel ( String name ) { } }
KieBaseModel kbase = new KieBaseModelImpl ( this , name ) ; Map < String , KieBaseModel > newMap = new HashMap < String , KieBaseModel > ( ) ; newMap . putAll ( this . kBases ) ; newMap . put ( kbase . getName ( ) , kbase ) ; setKBases ( newMap ) ; return kbase ;
public class StringColumn { /** * Added for naming consistency with all other columns */ public StringColumn append ( String value ) { } }
try { lookupTable . append ( value ) ; } catch ( NoKeysAvailableException ex ) { lookupTable = lookupTable . promoteYourself ( ) ; try { lookupTable . append ( value ) ; } catch ( NoKeysAvailableException e ) { // this can ' t happen throw new IllegalStateException ( e ) ; } } return this ;
public class ExtensionHookView { /** * Adds the given { @ link AbstractPanel } to the view hook , to be later added to the * { @ link org . parosproxy . paros . view . WorkbenchPanel WorkbenchPanel } as a * { @ link org . parosproxy . paros . view . WorkbenchPanel . PanelType # SELECT select } panel . * @ param panel the panel that will be added to the { @ code WorkbenchPanel } . * @ see org . parosproxy . paros . view . View # getWorkbench ( ) */ public void addSelectPanel ( AbstractPanel panel ) { } }
if ( selectPanelList == null ) { selectPanelList = createList ( ) ; } selectPanelList . add ( panel ) ;
public class FileStorageModule { /** * { @ inheritDoc } */ @ Override public int checkBounds ( long logicalBlockAddress , int transferLengthInBlocks ) { } }
// Checking if the logical block address is out of bounds if ( logicalBlockAddress < 0 || logicalBlockAddress >= getSizeInBlocks ( ) ) { return 1 ; } else // if the logical block address is in bounds but the transferlength // either exceeds // the device size or is faulty return 2 if ( transferLengthInBlocks < 0 || logicalBlockAddress + transferLengthInBlocks > getSizeInBlocks ( ) ) { return 2 ; } else { return 0 ; }
public class FieldTable { /** * Constructor . * @ param record The initial record for this table . */ public void init ( Rec record ) { } }
m_dataSource = null ; this . setRecord ( record ) ; if ( record != null ) { Object owner = record . getOwner ( ) ; record . setOwner ( null ) ; // Make sure I don ' t create a new table when I call getTable ( ) . if ( record . getTable ( ) == null ) record . setTable ( this ) ; // Just being careful ( Note : Thick model does create a table before calling this method ) record . setOwner ( owner ) ; // Restore }
public class RepeaterExampleWithEditableRows { /** * Add all the required UI artefacts for this example . */ private void createExampleUi ( ) { } }
add ( new WHeading ( HeadingLevel . H2 , "Contacts" ) ) ; add ( repeater ) ; WButton addBtn = new WButton ( "Add" ) ; addBtn . setAction ( new Action ( ) { @ Override public void execute ( final ActionEvent event ) { addNewContact ( ) ; } } ) ; newNameField . setDefaultSubmitButton ( addBtn ) ; WButton printBtn = new WButton ( "Print" ) ; printBtn . setAction ( new Action ( ) { @ Override public void execute ( final ActionEvent event ) { printEditedDetails ( ) ; } } ) ; WFieldLayout layout = new WFieldLayout ( ) ; add ( layout ) ; layout . addField ( "New contact name" , newNameField ) ; layout . addField ( ( WLabel ) null , addBtn ) ; layout . addField ( "Print output" , console ) ; layout . addField ( ( WLabel ) null , printBtn ) ; // Ajax controls to make things zippier add ( new WAjaxControl ( addBtn , new AjaxTarget [ ] { repeater , newNameField } ) ) ; add ( new WAjaxControl ( printBtn , console ) ) ;
public class Grantee { /** * Checks if this object can modify schema objects or grant access rights * to them . */ public boolean hasSchemaUpdateOrGrantRights ( String schemaName ) { } }
// If a DBA if ( isAdmin ( ) ) { return true ; } Grantee schemaOwner = granteeManager . database . schemaManager . toSchemaOwner ( schemaName ) ; // If owner of Schema if ( schemaOwner == this ) { return true ; } // If a member of Schema authorization role if ( hasRole ( schemaOwner ) ) { return true ; } return false ;
public class SparseTensor { /** * Eliminates { @ code dimensionsToEliminate } , either by summing or * maximizing . * @ param dimensionsToEliminate * @ param useSum * @ return */ private SparseTensor reduceDimensions ( Set < Integer > dimensionsToEliminate , boolean useSum , Backpointers backpointers ) { } }
// TODO ( jayantk ) : This method can be generalized to support a // generic reduce // operation ( as a function ) , but it ' s unclear what the effect on // performance will be . // Rotate all of the dimensions which are being eliminated to the // end of the keyNums array . int [ ] newLabels = new int [ numDimensions ( ) ] ; int [ ] inversionPermutation = new int [ numDimensions ( ) ] ; int [ ] newDimensions = new int [ numDimensions ( ) ] ; int [ ] newDimensionSizes = new int [ numDimensions ( ) ] ; int numEliminated = 0 ; int [ ] dimensionNums = getDimensionNumbers ( ) ; int [ ] dimensionSizes = getDimensionSizes ( ) ; for ( int i = 0 ; i < dimensionNums . length ; i ++ ) { if ( dimensionsToEliminate . contains ( dimensionNums [ i ] ) ) { // Dimension labels must be unique , hence numEliminated . newLabels [ i ] = Integer . MAX_VALUE - numEliminated ; inversionPermutation [ dimensionNums . length - ( numEliminated + 1 ) ] = i ; numEliminated ++ ; } else { newLabels [ i ] = dimensionNums [ i ] ; inversionPermutation [ i - numEliminated ] = i ; newDimensions [ i - numEliminated ] = dimensionNums [ i ] ; newDimensionSizes [ i - numEliminated ] = dimensionSizes [ i ] ; } } if ( numEliminated == 0 ) { // If none of the dimensions being eliminated are actually part of // this tensor , then there ' s no need to do any more work . if ( backpointers != null ) { backpointers . setBackpointers ( keyNums , keyNums , keyNums . length , this ) ; } return this ; } else if ( numEliminated == dimensionNums . length && backpointers == null && useSum ) { // Faster implementation for summing up all values in the tensor , // a common operation . return sumOutAllDimensions ( ) ; } SparseTensor relabeled = relabelDimensions ( newLabels ) ; int resultNumDimensions = dimensionNums . length - numEliminated ; // Get a number which we can divide each key by to map it to a key // in the reduced dimensional tensor . long keyNumDenominator = ( resultNumDimensions > 0 ) ? relabeled . indexOffsets [ resultNumDimensions - 1 ] : relabeled . indexOffsets [ 0 ] * relabeled . getDimensionSizes ( ) [ 0 ] ; long [ ] resultKeyInts = new long [ relabeled . values . length ] ; long [ ] backpointerKeyInts = new long [ relabeled . values . length ] ; double [ ] resultValues = new double [ relabeled . values . length ] ; int resultInd = 0 ; long [ ] relabeledKeyNums = relabeled . keyNums ; double [ ] relabeledValues = relabeled . values ; int relabeledValuesLength = relabeled . values . length ; for ( int i = 0 ; i < relabeledValuesLength ; i ++ ) { long relabeledKeyNumI = relabeledKeyNums [ i ] ; if ( i != 0 && resultInd > 0 && ( relabeledKeyNumI / keyNumDenominator ) == resultKeyInts [ resultInd - 1 ] ) { // This key maps to the same entry as the previous key . if ( useSum ) { resultValues [ resultInd - 1 ] += relabeledValues [ i ] ; } else { double resultVal = resultValues [ resultInd - 1 ] ; double relabeledVal = relabeledValues [ i ] ; if ( relabeledVal > resultVal ) { resultValues [ resultInd - 1 ] = relabeledVal ; backpointerKeyInts [ resultInd - 1 ] = relabeledKeyNumI ; } } } else { if ( resultInd > 0 && resultValues [ resultInd - 1 ] == 0.0 ) { // Make sure the result tensor contains no zero - valued // entries . resultInd -- ; } resultKeyInts [ resultInd ] = relabeledKeyNumI / keyNumDenominator ; backpointerKeyInts [ resultInd ] = relabeledKeyNumI ; resultValues [ resultInd ] = relabeledValues [ i ] ; resultInd ++ ; } int prevIndex = resultInd - 1 ; if ( ! useSum && resultValues [ prevIndex ] < 0.0 ) { // Ensure that , if values is negative , we include missing keys // in the maximization . long prevKeyNum = relabeledKeyNumI - 1 ; long nextKeyNum = relabeledKeyNumI + 1 ; if ( i > 0 && relabeledKeyNums [ i - 1 ] != prevKeyNum && prevKeyNum / keyNumDenominator == resultKeyInts [ prevIndex ] ) { // prevKeyNum is not in relabeled , but has a higher value // than the current key . resultValues [ prevIndex ] = 0.0 ; backpointerKeyInts [ prevIndex ] = prevKeyNum ; } else if ( i + 1 < relabeledValuesLength && relabeledKeyNums [ i + 1 ] != nextKeyNum && nextKeyNum / keyNumDenominator == resultKeyInts [ prevIndex ] ) { // nextKeyNum is not in relabeled , but has a higher value // than the current key . Delete the current key from the tensor . resultValues [ prevIndex ] = 0.0 ; backpointerKeyInts [ prevIndex ] = nextKeyNum ; } } } if ( backpointers != null ) { // backpointerKeyInts needs to have the inverse dimension // relabeling applied to it . long [ ] transformedBackpointers = transformKeyNums ( backpointerKeyInts , relabeled . indexOffsets , this . indexOffsets , inversionPermutation ) ; backpointers . setBackpointers ( resultKeyInts , transformedBackpointers , resultInd , this ) ; } return resizeIntoTable ( ArrayUtils . copyOf ( newDimensions , resultNumDimensions ) , ArrayUtils . copyOf ( newDimensionSizes , resultNumDimensions ) , resultKeyInts , resultValues , resultInd ) ;
public class ForLoopRepository { /** * { @ inheritDoc } */ @ Override public Data get ( Interest interest ) throws DataNotFoundException { } }
Name . Component selectedComponent = null ; Data selectedData = null ; for ( Record record : storage ) { if ( interest . matchesName ( record . data . getName ( ) ) ) { if ( hasNoChildSelector ( interest ) && hasAcceptableFreshness ( interest , record ) ) { selectedData = record . data ; } else { Name . Component component = getNextComponentAfterLastInterestComponent ( record . data , interest ) ; boolean gotBetterMatch = false ; if ( selectedData == null ) { // Save the first match . gotBetterMatch = true ; } else { if ( interest . getChildSelector ( ) == Interest . CHILD_SELECTOR_LEFT ) { // Leftmost child . if ( component . compare ( selectedComponent ) < 0 ) { gotBetterMatch = true ; } } else { // Rightmost child . if ( component . compare ( selectedComponent ) > 0 ) { gotBetterMatch = true ; } } } if ( gotBetterMatch && hasAcceptableFreshness ( interest , record ) ) { selectedComponent = component ; selectedData = record . data ; } } } } if ( selectedData != null ) { // We found the leftmost or rightmost child . return selectedData ; } else { throw new DataNotFoundException ( ) ; }
public class Batch { /** * / * ( non - Javadoc ) * @ see com . googlecode . batchfb . Batcher # queryFirst ( java . lang . String ) */ @ Override public Later < JsonNode > queryFirst ( String fql ) { } }
Later < ArrayNode > q = this . query ( fql ) ; return new FirstNodeLater ( q ) ;
public class JavacHandlerUtil { /** * Given a list of field names and a node referring to a type , finds each name in the list that does not match a field within the type . */ public static List < Integer > createListOfNonExistentFields ( List < String > list , JavacNode type , boolean excludeStandard , boolean excludeTransient ) { } }
boolean [ ] matched = new boolean [ list . size ( ) ] ; for ( JavacNode child : type . down ( ) ) { if ( list . isEmpty ( ) ) break ; if ( child . getKind ( ) != Kind . FIELD ) continue ; JCVariableDecl field = ( JCVariableDecl ) child . get ( ) ; if ( excludeStandard ) { if ( ( field . mods . flags & Flags . STATIC ) != 0 ) continue ; if ( field . name . toString ( ) . startsWith ( "$" ) ) continue ; } if ( excludeTransient && ( field . mods . flags & Flags . TRANSIENT ) != 0 ) continue ; int idx = list . indexOf ( child . getName ( ) ) ; if ( idx > - 1 ) matched [ idx ] = true ; } ListBuffer < Integer > problematic = new ListBuffer < Integer > ( ) ; for ( int i = 0 ; i < list . size ( ) ; i ++ ) { if ( ! matched [ i ] ) problematic . append ( i ) ; } return problematic . toList ( ) ;
public class CommandFaceDescriptor { /** * Configures the given action with the information contained in this descriptor . * @ param action The action to be configured . Must not be null . * @ throws IllegalArgumentException if { @ code action } is null . */ public void configure ( Action action ) { } }
Assert . notNull ( action , "The swing action to configure is required" ) ; action . putValue ( Action . NAME , getText ( ) ) ; action . putValue ( Action . MNEMONIC_KEY , new Integer ( getMnemonic ( ) ) ) ; action . putValue ( Action . SMALL_ICON , getIcon ( ) ) ; action . putValue ( "LargeIcon" , getLargeIcon ( ) ) ; action . putValue ( Action . ACCELERATOR_KEY , getAccelerator ( ) ) ; action . putValue ( Action . SHORT_DESCRIPTION , caption ) ; action . putValue ( Action . LONG_DESCRIPTION , description ) ;
public class SlotManager { /** * Free the given slot from the given allocation . If the slot is still allocated by the given * allocation id , then the slot will be marked as free and will be subject to new slot requests . * @ param slotId identifying the slot to free * @ param allocationId with which the slot is presumably allocated */ public void freeSlot ( SlotID slotId , AllocationID allocationId ) { } }
checkInit ( ) ; TaskManagerSlot slot = slots . get ( slotId ) ; if ( null != slot ) { if ( slot . getState ( ) == TaskManagerSlot . State . ALLOCATED ) { if ( Objects . equals ( allocationId , slot . getAllocationId ( ) ) ) { TaskManagerRegistration taskManagerRegistration = taskManagerRegistrations . get ( slot . getInstanceId ( ) ) ; if ( taskManagerRegistration == null ) { throw new IllegalStateException ( "Trying to free a slot from a TaskManager " + slot . getInstanceId ( ) + " which has not been registered." ) ; } updateSlotState ( slot , taskManagerRegistration , null , null ) ; } else { LOG . debug ( "Received request to free slot {} with expected allocation id {}, " + "but actual allocation id {} differs. Ignoring the request." , slotId , allocationId , slot . getAllocationId ( ) ) ; } } else { LOG . debug ( "Slot {} has not been allocated." , allocationId ) ; } } else { LOG . debug ( "Trying to free a slot {} which has not been registered. Ignoring this message." , slotId ) ; }
public class HttpURLConnectionImpl { /** * Splits and validates a comma - separated string of protocols . * When append = = false , we require that the transport list contains " http / 1.1 " . * Throws { @ link IllegalStateException } when one of the protocols isn ' t * defined in { @ link Protocol OkHttp ' s protocol enumeration } . */ private void setProtocols ( String protocolsString , boolean append ) { } }
List < Protocol > protocolsList = new ArrayList < > ( ) ; if ( append ) { protocolsList . addAll ( client . getProtocols ( ) ) ; } for ( String protocol : protocolsString . split ( "," , - 1 ) ) { try { protocolsList . add ( Protocol . get ( protocol ) ) ; } catch ( IOException e ) { throw new IllegalStateException ( e ) ; } } client . setProtocols ( protocolsList ) ;
public class IntervalTree { /** * Removes the Interval . * @ param i the interval to remove */ public boolean remove ( Interval < K > i ) { } }
checkValidInterval ( i ) ; return remove ( root . left , i ) ;