signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class ClassTypeUtils { /** * String转Class * @ param typeStr 对象描述 * @ return Class [ ] */ public static Class getClass ( String typeStr ) { } }
Class clazz = ReflectCache . getClassCache ( typeStr ) ; if ( clazz == null ) { if ( "void" . equals ( typeStr ) ) { clazz = void . class ; } else if ( "boolean" . equals ( typeStr ) ) { clazz = boolean . class ; } else if ( "byte" . equals ( typeStr ) ) { clazz = byte . class ; } else if ( "char" . equals ( typeStr ) ) { clazz = char . class ; } else if ( "double" . equals ( typeStr ) ) { clazz = double . class ; } else if ( "float" . equals ( typeStr ) ) { clazz = float . class ; } else if ( "int" . equals ( typeStr ) ) { clazz = int . class ; } else if ( "long" . equals ( typeStr ) ) { clazz = long . class ; } else if ( "short" . equals ( typeStr ) ) { clazz = short . class ; } else { String jvmName = canonicalNameToJvmName ( typeStr ) ; clazz = ClassUtils . forName ( jvmName ) ; } ReflectCache . putClassCache ( typeStr , clazz ) ; } return clazz ;
public class Tsne { /** * Computes a gaussian kernel * given a vector of squared distance distances * @ param d the data * @ param beta * @ return */ public Pair < Double , INDArray > hBeta ( INDArray d , double beta ) { } }
INDArray P = exp ( d . neg ( ) . muli ( beta ) ) ; double sumP = P . sumNumber ( ) . doubleValue ( ) ; double logSumP = FastMath . log ( sumP ) ; Double H = logSumP + ( ( beta * ( d . mul ( P ) . sumNumber ( ) . doubleValue ( ) ) ) / sumP ) ; P . divi ( sumP ) ; return new Pair < > ( H , P ) ;
public class BpmnParse { /** * Sets the value for " camunda : errorMessageVariable " on the passed definition if * it ' s present . * @ param errorEventDefinition * the XML errorEventDefinition tag * @ param definition * the errorEventDefintion that can get the errorMessageVariable value */ protected void setErrorMessageVariableOnErrorEventDefinition ( Element errorEventDefinition , ErrorEventDefinition definition ) { } }
String errorMessageVariable = errorEventDefinition . attributeNS ( CAMUNDA_BPMN_EXTENSIONS_NS , "errorMessageVariable" ) ; if ( errorMessageVariable != null ) { definition . setErrorMessageVariable ( errorMessageVariable ) ; }
public class WASCDIAnnotationInjectionProvider { /** * { @ inheritDoc } */ @ Override public Object inject ( Class Klass , boolean doPostConstruct , ExternalContext eContext ) throws InjectionProviderException { } }
if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { logger . logp ( Level . FINE , CLASS_NAME , "inject(Class<?> Klass,boolean,econtext)" , "Klass =" + Klass . getName ( ) , ", doPostConstruct = " + doPostConstruct + ", eContext = " + eContext ) ; } ManagedObject mo = null ; if ( isAvailable ) { try { // boolean passed to runtimeAnnotationHelper indicates whether or not to delay postConstruct // so need the opposite value to doPostConstruct mo = runtimeAnnotationHelper . inject ( Klass , ! doPostConstruct ) ; if ( eContext != null ) { List < BeanEntry > injectedBeanStorage = ( List < BeanEntry > ) eContext . getApplicationMap ( ) . get ( FacesConfigurator . INJECTED_BEAN_STORAGE_KEY ) ; injectedBeanStorage . add ( new BeanEntry ( mo . getObject ( ) , mo . getContextData ( CreationalContext . class ) ) ) ; } } catch ( RuntimeException exc ) { throw new InjectionProviderException ( exc ) ; } } return mo ;
public class Ix { /** * Buffer until an item is encountered for which the predicate returns true , * triggering a new buffer . * < p > Neither the previous nor the next buffer will contain the item that caused the * split * @ param predicate the predicate called with each item and should return false * to trigger a new buffer * @ return the new Ix instance * @ see # bufferUntil ( IxPredicate ) * @ see # bufferWhile ( IxPredicate ) * @ since 1.0 */ public final Ix < List < T > > bufferSplit ( IxPredicate < ? super T > predicate ) { } }
return new IxBufferSplit < T > ( this , nullCheck ( predicate , "predicate is null" ) ) ;
public class TrueTypeFont { /** * Get the width of a given String * @ param whatchars * The characters to get the width of * @ return The width of the characters */ public int getWidth ( String whatchars ) { } }
int totalwidth = 0 ; IntObject intObject = null ; int currentChar = 0 ; for ( int i = 0 ; i < whatchars . length ( ) ; i ++ ) { currentChar = whatchars . charAt ( i ) ; if ( currentChar < 256 ) { intObject = charArray [ currentChar ] ; } else { intObject = ( IntObject ) customChars . get ( new Character ( ( char ) currentChar ) ) ; } if ( intObject != null ) totalwidth += intObject . width ; } return totalwidth ;
public class AppServiceCertificateOrdersInner { /** * Creates or updates a certificate and associates with key vault secret . * Creates or updates a certificate and associates with key vault secret . * @ param resourceGroupName Name of the resource group to which the resource belongs . * @ param certificateOrderName Name of the certificate order . * @ param name Name of the certificate . * @ param keyVaultCertificate Key vault certificate resource Id . * @ 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 < AppServiceCertificateResourceInner > beginCreateOrUpdateCertificateAsync ( String resourceGroupName , String certificateOrderName , String name , AppServiceCertificateResourceInner keyVaultCertificate , final ServiceCallback < AppServiceCertificateResourceInner > serviceCallback ) { } }
return ServiceFuture . fromResponse ( beginCreateOrUpdateCertificateWithServiceResponseAsync ( resourceGroupName , certificateOrderName , name , keyVaultCertificate ) , serviceCallback ) ;
public class EndpointActivationService { /** * Determines whether or not an activation spec is RRS transactional . * @ param activationSpec activation spec * @ return true if the activation spec is RRS transactional . False if not . */ @ FFDCIgnore ( NoSuchMethodException . class ) private static boolean isRRSTransactional ( Object activationSpec ) { } }
try { return ( Boolean ) activationSpec . getClass ( ) . getMethod ( "getRRSTransactional" ) . invoke ( activationSpec ) ; } catch ( NoSuchMethodException x ) { return false ; } catch ( Exception x ) { return false ; }
public class CommerceOrderPaymentLocalServiceUtil { /** * Updates the commerce order payment in the database or adds it if it does not yet exist . Also notifies the appropriate model listeners . * @ param commerceOrderPayment the commerce order payment * @ return the commerce order payment that was updated */ public static com . liferay . commerce . model . CommerceOrderPayment updateCommerceOrderPayment ( com . liferay . commerce . model . CommerceOrderPayment commerceOrderPayment ) { } }
return getService ( ) . updateCommerceOrderPayment ( commerceOrderPayment ) ;
public class MultiHashMap { /** * Returns the value to which this map maps the specified key and subKey . Returns null if the map contains no mapping * for this key and subKey . A return value of null does not necessarily indicate that the map contains no mapping * for the key and subKey ; it ' s also possible that the map explicitly maps the key to null . * The containsKey operation may be used to distinguish these two cases . * @ param key whose associated value is to be returned . * @ param subKey whose associated value is to be returned * @ return the value to which this map maps the specified key . */ public Object get ( Object key , Object subKey ) { } }
HashMap a = ( HashMap ) super . get ( key ) ; if ( a != null ) { Object b = a . get ( subKey ) ; return b ; } return null ;
public class MediathekSwr { @ Override public synchronized void addToList ( ) { } }
meldungStart ( ) ; // Theman suchen listeThemen . clear ( ) ; addToList__ ( ) ; if ( CrawlerTool . loadLongMax ( ) ) { addToList_verpasst ( ) ; // brauchst eigentlich nicht und dauer zu lange } if ( Config . getStop ( ) ) { meldungThreadUndFertig ( ) ; } else if ( listeThemen . isEmpty ( ) ) { meldungThreadUndFertig ( ) ; } else { meldungAddMax ( listeThemen . size ( ) ) ; for ( int t = 0 ; t < getMaxThreadLaufen ( ) ; ++ t ) { Thread th = new ThemaLaden ( ) ; th . setName ( SENDERNAME + t ) ; th . start ( ) ; } }
public class xen_panwvpx_image { /** * < pre > * Use this operation to delete panw XVA file . * < / pre > */ public static xen_panwvpx_image delete ( nitro_service client , xen_panwvpx_image resource ) throws Exception { } }
resource . validate ( "delete" ) ; return ( ( xen_panwvpx_image [ ] ) resource . delete_resource ( client ) ) [ 0 ] ;
public class ClassUtils { /** * < p > Gets the package name from the canonical name of a { @ code Class } . < / p > * @ param cls the class to get the package name for , may be { @ code null } . * @ return the package name or an empty string * @ since 2.4 */ public static String getPackageCanonicalName ( final Class < ? > cls ) { } }
if ( cls == null ) { return StringUtils . EMPTY ; } return getPackageCanonicalName ( cls . getName ( ) ) ;
public class HttpUtils { /** * Check whether an LDP type is a sort of container . * @ param ldpType the LDP type to test * @ return true if it is a type of LDP container */ public static boolean isContainer ( final IRI ldpType ) { } }
return LDP . Container . equals ( ldpType ) || LDP . BasicContainer . equals ( ldpType ) || LDP . DirectContainer . equals ( ldpType ) || LDP . IndirectContainer . equals ( ldpType ) ;
public class CSSDeclaration { /** * Check if this declaration has the specified property . The comparison is * case insensitive ! * @ param eProperty * The property to check . May not be < code > null < / code > . * @ return < code > true < / code > if this declaration has the specified property . * @ see # hasProperty ( String ) * @ since 6.0.0 */ public boolean hasProperty ( @ Nonnull final ECSSProperty eProperty ) { } }
ValueEnforcer . notNull ( eProperty , "Property" ) ; return hasProperty ( eProperty . getName ( ) ) ;
public class FuncLast { /** * Execute the function . The function must return * a valid object . * @ param xctxt The current execution context . * @ return A valid XObject . * @ throws javax . xml . transform . TransformerException */ public XObject execute ( XPathContext xctxt ) throws javax . xml . transform . TransformerException { } }
XNumber xnum = new XNumber ( ( double ) getCountOfContextNodeList ( xctxt ) ) ; // System . out . println ( " last : " + xnum . num ( ) ) ; return xnum ;
public class RequestSecurityFilter { /** * Returns a new { @ link RequestContext } , using the specified { @ link HttpServletRequest } and { @ link * HttpServletResponse } . */ protected RequestContext createRequestContext ( HttpServletRequest request , HttpServletResponse response ) { } }
return new RequestContext ( request , response , getServletContext ( ) ) ;
public class Collections { /** * Get an Iterator that returns the same elements returned by the supplied Iterator , but in the * order dictated by the supplied Comparator . */ public static < T > Iterator < T > getSortedIterator ( Iterator < T > itr , Comparator < T > comparator ) { } }
SortableArrayList < T > list = new SortableArrayList < T > ( ) ; CollectionUtil . addAll ( list , itr ) ; list . sort ( comparator ) ; return getUnmodifiableIterator ( list ) ;
public class JDBCDatabaseMetaData { /** * The main SQL statement executor . All SQL destined for execution * ultimately goes through this method . < p > * The sqlStatement field for the result is set autoClose to comply with * ResultSet . getStatement ( ) semantics for result sets that are not from * a user supplied Statement object . ( fredt ) < p > * @ param sql SQL statement to execute * @ return the result of issuing the statement * @ throws SQLException is a database error occurs */ private ResultSet execute ( String sql ) throws SQLException { } }
// NOTE : // Need to create a JDBCStatement here so JDBCResultSet can return // its Statement object on call to getStatement ( ) . // The native JDBCConnection . execute ( ) method does not // automatically assign a Statement object for the ResultSet , but // JDBCStatement does . That is , without this , there is no way for the // JDBCResultSet to find its way back to its Connection ( or Statement ) // Also , cannot use single , shared JDBCStatement object , as each // fetchResult ( ) closes any old JDBCResultSet before fetching the // next , causing the JDBCResultSet ' s Result object to be nullified final int scroll = JDBCResultSet . TYPE_SCROLL_INSENSITIVE ; final int concur = JDBCResultSet . CONCUR_READ_ONLY ; ResultSet r = connection . createStatement ( scroll , concur ) . executeQuery ( sql ) ; ( ( JDBCResultSet ) r ) . autoClose = true ; return r ;
public class DescribeHsmClientCertificatesResult { /** * A list of the identifiers for one or more HSM client certificates used by Amazon Redshift clusters to store and * retrieve database encryption keys in an HSM . * @ param hsmClientCertificates * A list of the identifiers for one or more HSM client certificates used by Amazon Redshift clusters to * store and retrieve database encryption keys in an HSM . */ public void setHsmClientCertificates ( java . util . Collection < HsmClientCertificate > hsmClientCertificates ) { } }
if ( hsmClientCertificates == null ) { this . hsmClientCertificates = null ; return ; } this . hsmClientCertificates = new com . amazonaws . internal . SdkInternalList < HsmClientCertificate > ( hsmClientCertificates ) ;
public class Reader { /** * Scans a single class for Swagger annotations - does not invoke ReaderListeners */ public Swagger read ( Class < ? > cls ) { } }
SwaggerDefinition swaggerDefinition = cls . getAnnotation ( SwaggerDefinition . class ) ; if ( swaggerDefinition != null ) { readSwaggerConfig ( cls , swaggerDefinition ) ; } return read ( cls , "" , null , false , new String [ 0 ] , new String [ 0 ] , new LinkedHashMap < > ( ) , new ArrayList < > ( ) , new HashSet < > ( ) ) ;
public class AmazonRoute53ResolverClient { /** * Updates the name of an inbound or an outbound resolver endpoint . * @ param updateResolverEndpointRequest * @ return Result of the UpdateResolverEndpoint operation returned by the service . * @ throws ResourceNotFoundException * The specified resource doesn ' t exist . * @ throws InvalidParameterException * One or more parameters in this request are not valid . * @ throws InvalidRequestException * The request is invalid . * @ throws InternalServiceErrorException * We encountered an unknown error . Try again in a few minutes . * @ throws ThrottlingException * The request was throttled . Try again in a few minutes . * @ sample AmazonRoute53Resolver . UpdateResolverEndpoint * @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / route53resolver - 2018-04-01 / UpdateResolverEndpoint " * target = " _ top " > AWS API Documentation < / a > */ @ Override public UpdateResolverEndpointResult updateResolverEndpoint ( UpdateResolverEndpointRequest request ) { } }
request = beforeClientExecution ( request ) ; return executeUpdateResolverEndpoint ( request ) ;
public class ModelsImpl { /** * Get one entity role for a given entity . * @ param appId The application ID . * @ param versionId The version ID . * @ param entityId entity ID . * @ param roleId entity role ID . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the EntityRole object */ public Observable < ServiceResponse < EntityRole > > getEntityRoleWithServiceResponseAsync ( UUID appId , String versionId , UUID entityId , UUID roleId ) { } }
if ( this . client . endpoint ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.endpoint() is required and cannot be null." ) ; } if ( appId == null ) { throw new IllegalArgumentException ( "Parameter appId is required and cannot be null." ) ; } if ( versionId == null ) { throw new IllegalArgumentException ( "Parameter versionId is required and cannot be null." ) ; } if ( entityId == null ) { throw new IllegalArgumentException ( "Parameter entityId is required and cannot be null." ) ; } if ( roleId == null ) { throw new IllegalArgumentException ( "Parameter roleId is required and cannot be null." ) ; } String parameterizedHost = Joiner . on ( ", " ) . join ( "{Endpoint}" , this . client . endpoint ( ) ) ; return service . getEntityRole ( appId , versionId , entityId , roleId , this . client . acceptLanguage ( ) , parameterizedHost , this . client . userAgent ( ) ) . flatMap ( new Func1 < Response < ResponseBody > , Observable < ServiceResponse < EntityRole > > > ( ) { @ Override public Observable < ServiceResponse < EntityRole > > call ( Response < ResponseBody > response ) { try { ServiceResponse < EntityRole > clientResponse = getEntityRoleDelegate ( response ) ; return Observable . just ( clientResponse ) ; } catch ( Throwable t ) { return Observable . error ( t ) ; } } } ) ;
public class ProposalLineItem { /** * Gets the reservationStatus value for this ProposalLineItem . * @ return reservationStatus * The reservation status of the { @ link ProposalLineItem } . * This attribute is read - only . */ public com . google . api . ads . admanager . axis . v201808 . ReservationStatus getReservationStatus ( ) { } }
return reservationStatus ;
public class ResponseBody { /** * @ see java . io . OutputStream # write ( byte [ ] ) */ @ Override public void write ( @ Sensitive byte [ ] b ) throws IOException { } }
// note : an NPE is appropriate here if input was null this . output . write ( b , 0 , b . length ) ;
public class WCheckBoxSelectExample { /** * Simple interactive - state WCheckBoxSelect examples . */ private void addInteractiveExamples ( ) { } }
add ( new WHeading ( HeadingLevel . H2 , "Simple WCheckBoxSelect examples" ) ) ; addExampleUsingLookupTable ( ) ; addExampleUsingArrayList ( ) ; addExampleUsingStringArray ( ) ; addInsideAFieldLayoutExamples ( ) ; add ( new WHeading ( HeadingLevel . H2 , "Examples showing LAYOUT properties" ) ) ; addFlatSelectExample ( ) ; addColumnSelectExample ( ) ; addSingleColumnSelectExample ( ) ; add ( new WHeading ( HeadingLevel . H2 , "WCheckBoxSelect showing the frameless state" ) ) ; add ( new WHeading ( HeadingLevel . H3 , "Normal (with frame)" ) ) ; WCheckBoxSelect select = new WCheckBoxSelect ( "australian_state" ) ; add ( select ) ; select . setToolTip ( "Make a selection" ) ; add ( new WHeading ( HeadingLevel . H3 , "Without frame" ) ) ; select = new WCheckBoxSelect ( "australian_state" ) ; add ( select ) ; select . setFrameless ( true ) ; select . setToolTip ( "Make a selection (no frame)" ) ;
public class ChatApi { /** * Accept a chat * Accept the specified chat interaction . * @ param id The ID of the chat interaction . ( required ) * @ param acceptData Request parameters . ( optional ) * @ return ApiResponse & lt ; ApiSuccessResponse & gt ; * @ throws ApiException If fail to call the API , e . g . server error or cannot deserialize the response body */ public ApiResponse < ApiSuccessResponse > acceptChatWithHttpInfo ( String id , AcceptData acceptData ) throws ApiException { } }
com . squareup . okhttp . Call call = acceptChatValidateBeforeCall ( id , acceptData , null , null ) ; Type localVarReturnType = new TypeToken < ApiSuccessResponse > ( ) { } . getType ( ) ; return apiClient . execute ( call , localVarReturnType ) ;
public class PurchaseProvisionedCapacityRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( PurchaseProvisionedCapacityRequest purchaseProvisionedCapacityRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( purchaseProvisionedCapacityRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( purchaseProvisionedCapacityRequest . getAccountId ( ) , ACCOUNTID_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class TemplateDataTenantOperationsListener { /** * Imports the specified entities in the proper order . */ private void importQueue ( final ITenant tenant , final Map < PortalDataKey , Set < BucketTuple > > queue , final StringBuilder importReport ) throws Exception { } }
final StandardEvaluationContext ctx = new StandardEvaluationContext ( ) ; ctx . setRootObject ( new RootObjectImpl ( tenant ) ) ; IDataTemplatingStrategy templating = new SpELDataTemplatingStrategy ( portalSpELService , ctx ) ; Document doc = null ; try { for ( PortalDataKey pdk : dataKeyImportOrder ) { Set < BucketTuple > bucket = queue . get ( pdk ) ; if ( bucket != null ) { log . debug ( "Importing the specified PortalDataKey tenant '{}': {}" , tenant . getName ( ) , pdk . getName ( ) ) ; for ( BucketTuple tuple : bucket ) { doc = tuple . getDocument ( ) ; Source data = templating . processTemplates ( doc , tuple . getResource ( ) . getURL ( ) . toString ( ) ) ; dataHandlerService . importData ( data , pdk ) ; importReport . append ( createImportReportLineItem ( pdk , tuple ) ) ; } } } } catch ( Exception e ) { log . error ( "Failed to process the specified template document:\n{}" , ( doc != null ? doc . asXML ( ) : "null" ) , e ) ; throw e ; }
public class ModelManagerImp { /** * get the model instance from the cache */ public Object getCache ( Object key , String className ) { } }
return modelCacheManager . getCache ( key , className ) ;
public class ForwardingClient { /** * Returns the currently active remote forwarding listeners . * @ return String [ ] */ public String [ ] getRemoteForwardings ( ) { } }
String [ ] r = new String [ remoteforwardings . size ( ) - ( remoteforwardings . containsKey ( X11_KEY ) ? 1 : 0 ) ] ; int index = 0 ; for ( Enumeration < String > e = remoteforwardings . keys ( ) ; e . hasMoreElements ( ) ; ) { String key = e . nextElement ( ) ; if ( ! key . equals ( X11_KEY ) ) r [ index ++ ] = key ; } return r ;
public class ConnectionImpl { /** * ( non - Javadoc ) * @ see com . ibm . wsspi . sib . core . SICoreConnection # registerConsumerSetMonitor ( SIDestinationAddress destinationAddress , String discriminatorExpression , ConsumerSetChangeCallback * callback ) */ @ Override public boolean registerConsumerSetMonitor ( SIDestinationAddress destinationAddress , String discriminatorExpression , ConsumerSetChangeCallback callback ) throws SIResourceException , SINotPossibleInCurrentConfigurationException , SIConnectionUnavailableException , SIConnectionDroppedException , SIIncorrectCallException , SICommandInvocationFailedException { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "registerConsumerSetMonitor" , new Object [ ] { destinationAddress , discriminatorExpression , callback } ) ; // Check that a listener has been specified if ( callback == null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "registerConsumerSetMonitor" , "SIIncorrectCallException" ) ; // Parameter is null , throw an excepiton throw new SIIncorrectCallException ( nls . getFormattedMessage ( "NULL_CONSUMERSETCHANGECALLBACK_CWSIP0667" , null , null ) ) ; } else if ( destinationAddress == null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "registerConsumerSetMonitor" , "SIIncorrectCallException" ) ; // Parameter is null , throw an excepiton throw new SIIncorrectCallException ( nls . getFormattedMessage ( "NULL_DESTINATIONADDRESS_CWSIP0668" , null , null ) ) ; } else if ( discriminatorExpression == null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "registerConsumerSetMonitor" , "SIIncorrectCallException" ) ; // Parameter is null , throw an excepiton throw new SIIncorrectCallException ( nls . getFormattedMessage ( "NULL_DISCRIMINATOREXPRESSION_CWSIP0669" , null , null ) ) ; } boolean areConsumers = false ; try { DestinationHandler topicSpace = _destinationManager . getDestination ( ( JsDestinationAddress ) destinationAddress , false ) ; areConsumers = _messageProcessor . getMessageProcessorMatching ( ) . registerConsumerSetMonitor ( topicSpace , discriminatorExpression , this , callback ) ; } catch ( Exception e ) { // FFDC FFDCFilter . processException ( e , "com.ibm.ws.sib.processor.impl.ConnectionImpl.registerConsumerSetMonitor" , "1:7378:1.347.1.25" , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . exception ( tc , e ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "registerConsumerSetMonitor" , "SIErrorException" ) ; // SIErrorException is RuntimeExcetion hence catching this exception in StaticCATConnection throw new SIErrorException ( e ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "registerConsumerSetMonitor" , Boolean . valueOf ( areConsumers ) ) ; return areConsumers ;
public class Geldbetrag { /** * Liefert einen Geldbetrag mit der neuen gewuenschten Waehrung zurueck . * Dabei findet < b > keine < / b > Umrechnung statt . * Anmerkung : Der Prefix " with " kommt von der Namenskonvention in Scala * fuer immutable Objekte . * @ param waehrung Waehrung * @ return Geldbetrag mit neuer Waehrung */ public Geldbetrag withCurrency ( String waehrung ) { } }
String normalized = waehrung . toUpperCase ( ) . trim ( ) ; if ( "DM" . equalsIgnoreCase ( normalized ) ) { normalized = "DEM" ; } return withCurrency ( Currency . getInstance ( normalized ) ) ;
public class ProviderSignInUtils { /** * Get the connection to the provider user the client attempted to sign - in as . * Using this connection you may fetch a { @ link Connection # fetchUserProfile ( ) provider user profile } and use that to pre - populate a local user registration / signup form . * You can also lookup the id of the provider and use that to display a provider - specific user - sign - in - attempt flash message e . g . " Your Facebook Account is not connected to a Local account . Please sign up . " * Must be called before handlePostSignUp ( ) or else the sign - in attempt will have been cleared from the session . * Returns null if no provider sign - in has been attempted for the current user session . * @ param request the current request attributes , used to extract sign - in attempt information from the current user session * @ return the connection */ public Connection < ? > getConnectionFromSession ( RequestAttributes request ) { } }
ProviderSignInAttempt signInAttempt = getProviderUserSignInAttempt ( request ) ; return signInAttempt != null ? signInAttempt . getConnection ( connectionFactoryLocator ) : null ;
public class LynxView { /** * Hack to change EditText cursor color even if the API level is lower than 12 . Please , don ' t do * this at home . */ private void configureCursorColor ( ) { } }
try { Field f = TextView . class . getDeclaredField ( "mCursorDrawableRes" ) ; f . setAccessible ( true ) ; f . set ( et_filter , R . drawable . edit_text_cursor_color ) ; } catch ( Exception e ) { Log . e ( LOGTAG , "Error trying to change cursor color text cursor drawable to null." ) ; }
public class ClassCacheManager { /** * Finds command by FQCN and if not found loads the class and store the instance in * the cache . * @ param name - fully qualified class name of the command * @ return initialized class instance */ public Command findCommand ( String name , ClassLoader cl ) { } }
synchronized ( commandCache ) { if ( ! commandCache . containsKey ( name ) ) { try { Command commandInstance = ( Command ) Class . forName ( name , true , cl ) . newInstance ( ) ; commandCache . put ( name , commandInstance ) ; } catch ( Exception ex ) { throw new IllegalArgumentException ( "Unknown Command implementation with name '" + name + "'" ) ; } } else { Command cmd = commandCache . get ( name ) ; if ( ! cmd . getClass ( ) . getClassLoader ( ) . equals ( cl ) ) { commandCache . remove ( name ) ; try { Command commandInstance = ( Command ) Class . forName ( name , true , cl ) . newInstance ( ) ; commandCache . put ( name , commandInstance ) ; } catch ( Exception ex ) { throw new IllegalArgumentException ( "Unknown Command implementation with name '" + name + "'" ) ; } } } } return commandCache . get ( name ) ;
public class IntHashMap { /** * Maps the specified key to the specified value . * @ param key the key . * @ param value the value . * @ return the value of any previous mapping with the specified key or { @ code null } if there was no such * mapping . */ public V put ( final int key , final V value ) { } }
int index = ( key & 0x7FFFFFFF ) % elementData . length ; IntEntry < V > entry = elementData [ index ] ; while ( entry != null && key != entry . key ) { entry = entry . nextInSlot ; } if ( entry == null ) { if ( ++ elementCount > threshold ) { rehash ( ) ; index = ( key & 0x7FFFFFFF ) % elementData . length ; } entry = createHashedEntry ( key , index ) ; } V result = entry . value ; entry . value = value ; return result ;
public class PaxWicketAppFactoryTracker { /** * < p > addingService . < / p > * @ param reference a { @ link org . osgi . framework . ServiceReference } object . * @ param service a { @ link org . ops4j . pax . wicket . api . WebApplicationFactory } object . */ public void addingService ( ServiceReference < WebApplicationFactory < ? > > reference , WebApplicationFactory < ? > service ) { } }
PaxWicketApplicationFactory internalFactory = PaxWicketApplicationFactory . createPaxWicketApplicationFactory ( context , service , reference ) ; addApplication ( reference , internalFactory ) ;
public class AmazonEC2Client { /** * Describes the specified attribute of the specified volume . You can specify only one attribute at a time . * For more information about EBS volumes , see < a * href = " https : / / docs . aws . amazon . com / AWSEC2 / latest / UserGuide / EBSVolumes . html " > Amazon EBS Volumes < / a > in the * < i > Amazon Elastic Compute Cloud User Guide < / i > . * @ param describeVolumeAttributeRequest * Contains the parameters for DescribeVolumeAttribute . * @ return Result of the DescribeVolumeAttribute operation returned by the service . * @ sample AmazonEC2 . DescribeVolumeAttribute * @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / ec2-2016-11-15 / DescribeVolumeAttribute " target = " _ top " > AWS * API Documentation < / a > */ @ Override public DescribeVolumeAttributeResult describeVolumeAttribute ( DescribeVolumeAttributeRequest request ) { } }
request = beforeClientExecution ( request ) ; return executeDescribeVolumeAttribute ( request ) ;
public class aaaglobal_binding { /** * Use this API to fetch a aaaglobal _ binding resource . */ public static aaaglobal_binding get ( nitro_service service ) throws Exception { } }
aaaglobal_binding obj = new aaaglobal_binding ( ) ; aaaglobal_binding response = ( aaaglobal_binding ) obj . get_resource ( service ) ; return response ;
public class Joiner { /** * Appends the string representation of each of { @ code parts } , using the previously configured * separator between each , to { @ code appendable } . */ public < A extends Appendable > A appendTo ( A appendable , Iterable < ? > parts ) throws IOException { } }
return appendTo ( appendable , parts . iterator ( ) ) ;
public class FilePath { /** * Gets the parent file . * @ return parent FilePath or null if there is no parent */ public FilePath getParent ( ) { } }
int i = remote . length ( ) - 2 ; for ( ; i >= 0 ; i -- ) { char ch = remote . charAt ( i ) ; if ( ch == '\\' || ch == '/' ) break ; } return i >= 0 ? new FilePath ( channel , remote . substring ( 0 , i + 1 ) ) : null ;
public class ScriptableObject { /** * Sets the value of the named const property , creating it if need be . * If the property was created using defineProperty , the * appropriate setter method is called . < p > * If the property ' s attributes include READONLY , no action is * taken . * This method will actually set the property in the start * object . * @ param name the name of the property * @ param start the object whose property is being set * @ param value value to set the property to */ @ Override public void putConst ( String name , Scriptable start , Object value ) { } }
if ( putConstImpl ( name , 0 , start , value , READONLY ) ) return ; if ( start == this ) throw Kit . codeBug ( ) ; if ( start instanceof ConstProperties ) ( ( ConstProperties ) start ) . putConst ( name , start , value ) ; else start . put ( name , start , value ) ;
public class AsmClassGenerator { /** * Visits a bare ( unqualified ) variable expression . */ public void visitVariableExpression ( VariableExpression expression ) { } }
String variableName = expression . getName ( ) ; // SPECIAL CASES // " this " for static methods is the Class instance ClassNode classNode = controller . getClassNode ( ) ; // if ( controller . isInClosure ( ) ) classNode = controller . getOutermostClass ( ) ; if ( variableName . equals ( "this" ) ) { if ( controller . isStaticMethod ( ) || ( ! controller . getCompileStack ( ) . isImplicitThis ( ) && controller . isStaticContext ( ) ) ) { if ( controller . isInClosure ( ) ) classNode = controller . getOutermostClass ( ) ; visitClassExpression ( new ClassExpression ( classNode ) ) ; } else { loadThis ( expression ) ; } return ; } // " super " also requires special handling if ( variableName . equals ( "super" ) ) { if ( controller . isStaticMethod ( ) ) { visitClassExpression ( new ClassExpression ( classNode . getSuperClass ( ) ) ) ; } else { loadThis ( expression ) ; } return ; } BytecodeVariable variable = controller . getCompileStack ( ) . getVariable ( variableName , false ) ; if ( variable == null ) { processClassVariable ( variableName ) ; } else { controller . getOperandStack ( ) . loadOrStoreVariable ( variable , expression . isUseReferenceDirectly ( ) ) ; } if ( ! controller . getCompileStack ( ) . isLHS ( ) ) controller . getAssertionWriter ( ) . record ( expression ) ;
public class PresenterManager { /** * Get the ViewState ( see mosby viestate modlue ) for the View with the given ( Mosby - internal ) * view Id or < code > null < / code > * if no viewstate for the given view exists . * @ param activity The Activity ( used for scoping ) * @ param viewId The mosby internal View Id ( unique among all { @ link MvpView } * @ param < VS > The type of the ViewState type * @ return The Presenter or < code > null < / code > */ @ Nullable public static < VS > VS getViewState ( @ NonNull Activity activity , @ NonNull String viewId ) { } }
if ( activity == null ) { throw new NullPointerException ( "Activity is null" ) ; } if ( viewId == null ) { throw new NullPointerException ( "View id is null" ) ; } ActivityScopedCache scopedCache = getActivityScope ( activity ) ; return scopedCache == null ? null : ( VS ) scopedCache . getViewState ( viewId ) ;
public class PropertyBundle { /** * / * [ deutsch ] * < p > Ermittelt , ob zum angegebenen Schl & uuml ; ssel ein Eigenschaftenwert vorhanden ist . < / p > * @ param key the key of property resource * @ return { @ code true } if the property for given key exists else { @ code false } */ public boolean containsKey ( String key ) { } }
if ( key == null ) { throw new NullPointerException ( "Missing resource key." ) ; } PropertyBundle p = this ; do { String value = p . key2values . get ( key ) ; if ( value != null ) { return true ; } } while ( ( p = p . parent ) != null ) ; return false ;
public class JsonModelGenerator { /** * Decamelize string . < br > * example , " fooBar " to " foo _ bar " . * @ param str * @ return decamelized string * @ author vvakame */ String decamelize ( String str ) { } }
StringBuilder builder = new StringBuilder ( ) ; int len = str . length ( ) ; for ( int i = 0 ; i < len ; i ++ ) { char c = str . charAt ( i ) ; if ( 'A' <= c && c <= 'Z' ) { builder . append ( '_' ) . append ( Character . toLowerCase ( c ) ) ; } else { builder . append ( c ) ; } } return builder . toString ( ) ;
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EClass getIfcSurfaceStyleRefraction ( ) { } }
if ( ifcSurfaceStyleRefractionEClass == null ) { ifcSurfaceStyleRefractionEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 680 ) ; } return ifcSurfaceStyleRefractionEClass ;
public class ReferenceBuilder { /** * Adds a { @ link SomeValueSnak } with the given property to the constructed * reference . * Note that it might not be meaningful to use { @ link SomeValueSnak } in a * reference , depending on the policies of the wiki . * @ param propertyIdValue * the property of the snak * @ return builder object to continue construction */ public ReferenceBuilder withSomeValue ( PropertyIdValue propertyIdValue ) { } }
getSnakList ( propertyIdValue ) . add ( factory . getSomeValueSnak ( propertyIdValue ) ) ; return getThis ( ) ;
public class WebContainer { /** * Deactivate the web container as a DS component . * Post a stopped event . Deactivate all child services . Clear the * web container singleton . * @ param componentContext The component context of the deactivation . */ @ FFDCIgnore ( Exception . class ) public void deactivate ( ComponentContext componentContext ) { } }
String methodName = "deactivate" ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( tc , "Deactivating the WebContainer bundle" ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , methodName , "Posting STOPPED_EVENT" ) ; } Event event = this . eventService . createEvent ( WebContainerConstants . STOPPED_EVENT ) ; this . eventService . postEvent ( event ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , methodName , "Posted STOPPED_EVENT" ) ; } this . classLoadingSRRef . deactivate ( componentContext ) ; this . sessionHelperSRRef . deactivate ( componentContext ) ; this . cacheManagerSRRef . deactivate ( componentContext ) ; this . injectionEngineSRRef . deactivate ( componentContext ) ; this . managedObjectServiceSRRef . deactivate ( context ) ; this . servletContainerInitializers . deactivate ( componentContext ) ; this . transferContextServiceRef . deactivate ( componentContext ) ; this . webMBeanRuntimeServiceRef . deactivate ( componentContext ) ; // will now purge each host as it becomes redundant rather than all here . // this . vhostManager . purge ( ) ; / / Clear / purge all maps . WebContainer . instance . compareAndSet ( this , null ) ; extensionFactories . clear ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , methodName , "Deactivating the WebContainer bundle: Complete" ) ; }
public class JAXBMarshallerHelper { /** * Set the standard property for marshalling a fragment only . * @ param aMarshaller * The marshaller to set the property . May not be < code > null < / code > . * @ param bFragment * the value to be set */ public static void setFragment ( @ Nonnull final Marshaller aMarshaller , final boolean bFragment ) { } }
_setProperty ( aMarshaller , Marshaller . JAXB_FRAGMENT , Boolean . valueOf ( bFragment ) ) ;
public class CSIv2SubsystemFactory { /** * { @ inheritDoc } */ @ Override protected Set < String > extractSslRefs ( Map < String , Object > properties , List < IIOPEndpoint > endpoints ) { } }
Set < String > result = new HashSet < String > ( ) ; for ( IIOPEndpoint endpoint : endpoints ) { for ( Map < String , Object > iiopsOptions : endpoint . getIiopsOptions ( ) ) { String sslAliasName = ( String ) iiopsOptions . get ( "sslRef" ) ; if ( sslAliasName == null ) sslAliasName = defaultAlias ; result . add ( sslAliasName ) ; } } result . addAll ( new ClientConfigHelper ( null , null , defaultAlias ) . extractSslRefs ( properties ) ) ; result . addAll ( new ServerConfigHelper ( null , null , null , null , defaultAlias ) . extractSslRefs ( properties ) ) ; return result ;
public class EasyAdapterUtil { /** * Parses the layout ID annotation form the itemViewHolderClass */ public static Integer parseItemLayoutId ( Class < ? extends ItemViewHolder > itemViewHolderClass ) { } }
Integer itemLayoutId = ClassAnnotationParser . getLayoutId ( itemViewHolderClass ) ; if ( itemLayoutId == null ) { throw new LayoutIdMissingException ( ) ; } return itemLayoutId ;
public class PairCounter { /** * Returns the concatenated index of the two elements . */ private long getIndex ( T x , T y ) { } }
int i = elementIndices . index ( x ) ; int j = elementIndices . index ( y ) ; long index = ( ( ( long ) i ) << 32 ) | j ; return index ;
public class SegmentMetadataUpdateTransaction { /** * Accepts a StreamSegmentAppendOperation in the metadata . * @ param operation The operation to accept . * @ throws MetadataUpdateException If the operation SegmentOffset is different from the current Segment Length . * @ throws IllegalArgumentException If the operation is for a different Segment . */ void acceptOperation ( StreamSegmentAppendOperation operation ) throws MetadataUpdateException { } }
ensureSegmentId ( operation ) ; if ( operation . getStreamSegmentOffset ( ) != this . length ) { throw new MetadataUpdateException ( this . containerId , String . format ( "SegmentAppendOperation offset mismatch. Expected %d, actual %d." , this . length , operation . getStreamSegmentOffset ( ) ) ) ; } this . length += operation . getData ( ) . length ; acceptAttributes ( operation . getAttributeUpdates ( ) ) ; this . isChanged = true ;
public class PackageInfo { /** * Add annotations found in a package descriptor classfile . * @ param packageAnnotations * the package annotations */ void addAnnotations ( final AnnotationInfoList packageAnnotations ) { } }
// Currently only class annotations are used in the package - info . class file if ( packageAnnotations != null && ! packageAnnotations . isEmpty ( ) ) { if ( this . annotationInfo == null ) { this . annotationInfo = new AnnotationInfoList ( packageAnnotations ) ; } else { this . annotationInfo . addAll ( packageAnnotations ) ; } }
public class FeatureTableCoreIndex { /** * Get the table index * @ return table index */ public TableIndex getTableIndex ( ) { } }
TableIndex tableIndex = null ; try { if ( tableIndexDao . isTableExists ( ) ) { tableIndex = tableIndexDao . queryForId ( tableName ) ; } } catch ( SQLException e ) { throw new GeoPackageException ( "Failed to query for Table Index for GeoPackage: " + geoPackage . getName ( ) + ", Table Name: " + tableName + ", Column Name: " + columnName , e ) ; } return tableIndex ;
public class TypeLibInfo { /** * Locates the type library file from the LIBID ( a GUID ) and an optional version number . * @ param libid * String of the form " xxxxx - xxxx - xxxx - xxxx - xxxxx " * @ param version * Optional version number . If null , the function searches for the latest version . * @ throws ComException * If it fails to find the type library . */ public static TypeLibInfo locate ( GUID libid , String version ) throws BindingException { } }
// make sure to load the com4j . dll COM4J . IID_IUnknown . toString ( ) ; // check if libid is correct if ( libid == null ) throw new IllegalArgumentException ( ) ; String libKey = "TypeLib\\" + libid ; try { Native . readRegKey ( libKey ) ; } catch ( ComException e ) { throw new BindingException ( Messages . INVALID_LIBID . format ( libid ) , e ) ; } if ( version == null ) { // find the latest version List < Version > versions = new ArrayList < Version > ( ) ; for ( String v : Native . enumRegKeys ( libKey ) ) { versions . add ( new Version ( v ) ) ; } Collections . sort ( versions ) ; if ( versions . size ( ) == 0 ) throw new BindingException ( Messages . NO_VERSION_AVAILABLE . format ( ) ) ; version = versions . get ( versions . size ( ) - 1 ) . toString ( ) ; } String verKey = "TypeLib\\" + libid + "\\" + version ; String libName ; try { libName = Native . readRegKey ( verKey ) ; } catch ( ComException e ) { throw new BindingException ( Messages . INVALID_VERSION . format ( version ) , e ) ; } Set < Integer > lcids = new HashSet < Integer > ( ) ; for ( String lcid : Native . enumRegKeys ( verKey ) ) { try { lcids . add ( Integer . valueOf ( lcid ) ) ; } catch ( NumberFormatException e ) { ; // ignore " FLAGS " and " HELPDIR " } } int lcid ; if ( lcids . contains ( 0 ) ) lcid = 0 ; else lcid = lcids . iterator ( ) . next ( ) ; String fileName ; try { fileName = Native . readRegKey ( verKey + "\\" + lcid + "\\win32" ) ; } catch ( ComException e ) { throw new BindingException ( Messages . NO_WIN32_TYPELIB . format ( libid , version ) , e ) ; } return new TypeLibInfo ( libName , new File ( fileName ) , new Version ( version ) , lcid ) ;
public class ProcBase { /** * Throws a ProcError exception if { @ code args . length ! = count } * @ param args * @ param count */ protected void assertArgCount ( Object [ ] args , int count ) { } }
if ( args . length != count ) { throw illegalArgumentException ( String . format ( "Wrong number of arguments, expected %d got %d" , count , args . length ) ) ; }
public class LocalSegmentContainerManager { /** * region Helpers */ private void unregisterHandle ( ContainerHandle handle ) { } }
synchronized ( this . handles ) { assert this . handles . containsKey ( handle . getContainerId ( ) ) : "found unregistered handle " + handle . getContainerId ( ) ; this . handles . remove ( handle . getContainerId ( ) ) ; } log . info ( "Container {} has been unregistered." , handle . getContainerId ( ) ) ;
public class WebSiteManagementClientImpl { /** * Gets a list of meters for a given location . * Gets a list of meters for a given location . * @ param billingLocation Azure Location of billable resource * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the PagedList & lt ; BillingMeterInner & gt ; object */ public Observable < ServiceResponse < Page < BillingMeterInner > > > listBillingMetersWithServiceResponseAsync ( final String billingLocation ) { } }
return listBillingMetersSinglePageAsync ( billingLocation ) . concatMap ( new Func1 < ServiceResponse < Page < BillingMeterInner > > , Observable < ServiceResponse < Page < BillingMeterInner > > > > ( ) { @ Override public Observable < ServiceResponse < Page < BillingMeterInner > > > call ( ServiceResponse < Page < BillingMeterInner > > page ) { String nextPageLink = page . body ( ) . nextPageLink ( ) ; if ( nextPageLink == null ) { return Observable . just ( page ) ; } return Observable . just ( page ) . concatWith ( listBillingMetersNextWithServiceResponseAsync ( nextPageLink ) ) ; } } ) ;
public class HighTideNode { /** * Full sync of specified policy */ void doFullSync ( PolicyInfo pinfo ) throws IOException { } }
Path srcPath = pinfo . getSrcPath ( ) ; LOG . info ( "Starting fullsync of srcPath " + srcPath ) ; FileSystem srcFs = srcPath . getFileSystem ( pinfo . getConf ( ) ) ; int srcRepl = Integer . parseInt ( pinfo . getProperty ( "replication" ) ) ; long modTimePeriod = Long . parseLong ( pinfo . getProperty ( "modTimePeriod" ) ) ; long now = HighTideNode . now ( ) ; // traverse all files inside the subtree rooted at srcPath List < FileStatus > slist = new ArrayList < FileStatus > ( ) ; slist . add ( srcFs . getFileStatus ( srcPath ) ) ; DirectoryTraversal traverse = new DirectoryTraversal ( srcFs , slist ) ; while ( true ) { FileStatus sstat = traverse . getNextFile ( ) ; if ( sstat == null ) { break ; // done checking all files } // we always follow the order of first changing the replication // on the destination files before we update the repl factor of // the source file . So , it is safe to make the following check // and avoid checking the destination files if the source file // already is at the specified replication factor . if ( sstat . getReplication ( ) == srcRepl ) { continue ; } // if the file has been updated recently , then do not // do anything to it if ( sstat . getModificationTime ( ) + modTimePeriod > now ) { continue ; } // find the suffix in the srcPath that is mapped to the destination srcPath = sstat . getPath ( ) ; String [ ] splits = srcPath . toString ( ) . split ( pinfo . getSrcPath ( ) . toString ( ) ) ; String suffix = splits [ 1 ] ; // match each pair of src and destination paths boolean match = true ; for ( PathInfo destPathInfo : pinfo . getDestPaths ( ) ) { Path destPath = new Path ( destPathInfo . getPath ( ) . toString ( ) + suffix ) ; LOG . debug ( "Comparing " + srcPath + " with " + destPath ) ; int destRepl = Integer . parseInt ( destPathInfo . getProperty ( "replication" ) ) ; FileSystem destFs = destPath . getFileSystem ( pinfo . getConf ( ) ) ; FileStatus dstat = null ; try { dstat = destFs . getFileStatus ( destPath ) ; } catch ( java . io . FileNotFoundException e ) { match = false ; continue ; // ok if the destination does not exist } catch ( IOException e ) { match = false ; LOG . info ( "Unable to locate matching file in destination " + destPath + StringUtils . stringifyException ( e ) + ". Ignoring..." ) ; } LOG . info ( "Matching " + srcPath + " with " + destPath ) ; HighTideNode . getMetrics ( ) . filesMatched . inc ( ) ; if ( dstat . getModificationTime ( ) == sstat . getModificationTime ( ) && dstat . getBlockSize ( ) == sstat . getBlockSize ( ) && dstat . getLen ( ) == sstat . getLen ( ) ) { // first reduce the intended replication on the destination path if ( dstat . getReplication ( ) > destRepl ) { HighTideNode . getMetrics ( ) . filesChanged . inc ( ) ; long saved = dstat . getLen ( ) * ( dstat . getReplication ( ) - destRepl ) ; LOG . info ( "Changing replication of dest " + destPath + " from " + dstat . getReplication ( ) + " to " + destRepl ) ; destFs . setReplication ( dstat . getPath ( ) , ( short ) destRepl ) ; saved += HighTideNode . getMetrics ( ) . savedSize . get ( ) ; HighTideNode . getMetrics ( ) . savedSize . set ( saved ) ; } } else { // one destination path does not match the source match = false ; break ; } } // if the all the destination paths matched the source , then // reduce repl factor of the source if ( match && sstat . getReplication ( ) > srcRepl ) { LOG . info ( "Changing replication of source " + srcPath + " from " + sstat . getReplication ( ) + " to " + srcRepl ) ; HighTideNode . getMetrics ( ) . filesChanged . inc ( ) ; long saved = sstat . getLen ( ) * ( sstat . getReplication ( ) - srcRepl ) ; srcFs . setReplication ( sstat . getPath ( ) , ( short ) srcRepl ) ; saved += HighTideNode . getMetrics ( ) . savedSize . get ( ) ; HighTideNode . getMetrics ( ) . savedSize . set ( saved ) ; } } LOG . info ( "Completed fullsync of srcPath " + srcPath ) ;
public class LinerLogFormatter { /** * 2015-10-23 01:59:12,746 [ main ] INFO ( AbstractProtocol @ start ( ) ) - . . . */ @ Override public synchronized String format ( LogRecord record ) { } }
cachedDate . setTime ( record . getMillis ( ) ) ; final StringBuilder sb = new StringBuilder ( ) ; sb . append ( cachedFormat . format ( cachedDate ) ) ; sb . append ( " [" ) . append ( Thread . currentThread ( ) . getName ( ) ) . append ( "]" ) ; sb . append ( " " ) . append ( record . getLevel ( ) . getName ( ) ) ; sb . append ( " (" ) ; final String className = record . getSourceClassName ( ) ; if ( className != null ) { if ( className . contains ( "." ) ) { sb . append ( className . substring ( className . lastIndexOf ( "." ) + "." . length ( ) ) ) ; } else { sb . append ( className ) ; } final String methodName = record . getSourceMethodName ( ) ; if ( methodName != null ) { sb . append ( "@" ) . append ( methodName ) . append ( "()" ) ; } } else { sb . append ( record . getLoggerName ( ) ) ; } sb . append ( ") - " ) . append ( formatMessage ( record ) ) ; final Throwable thrown = record . getThrown ( ) ; if ( thrown != null ) { final StringWriter stringWriter = new StringWriter ( ) ; final PrintWriter printWriter = new PrintWriter ( stringWriter ) ; try { printWriter . println ( ) ; thrown . printStackTrace ( printWriter ) ; } finally { printWriter . close ( ) ; } sb . append ( stringWriter . toString ( ) ) ; } sb . append ( "\n" ) ; return sb . toString ( ) ;
public class Cron4jNow { @ Override public List < LaJobHistory > searchJobHistoryList ( ) { } }
final Supplier < List < LaJobHistory > > nativeSearcher = ( ) -> Cron4jJobHistory . list ( ) ; return jobRunner . getHistoryHook ( ) . map ( hook -> { return hook . hookList ( nativeSearcher ) ; } ) . orElseGet ( ( ) -> { return nativeSearcher . get ( ) ; } ) ;
public class JsfFaceletScannerPlugin { /** * Normalize file paths like the jqassistant core ( e . g . replace backslashs , * add leading slash ) . * @ param path * the path to normalize * @ return the normalized path */ private String normalizeFilePath ( final String path ) { } }
String normalizedPath = path . replace ( '\\' , '/' ) ; if ( ! normalizedPath . startsWith ( "/" ) ) { normalizedPath = "/" + normalizedPath ; } return normalizedPath ;
public class CmsShellCommands { /** * Creates a new folder in the given target folder . < p > * @ param targetFolder the target folder * @ param folderName the new folder to create in the target folder * @ return the created folder * @ throws Exception if somthing goes wrong */ @ SuppressWarnings ( "deprecation" ) public CmsResource createFolder ( String targetFolder , String folderName ) throws Exception { } }
if ( m_cms . existsResource ( targetFolder + folderName ) ) { m_shell . getOut ( ) . println ( getMessages ( ) . key ( Messages . GUI_SHELL_FOLDER_ALREADY_EXISTS_1 , targetFolder + folderName ) ) ; return null ; } return m_cms . createResource ( targetFolder + folderName , CmsResourceTypeFolder . getStaticTypeId ( ) ) ;
public class URIUtils { /** * Parse the URI and get all the parameters in map form . Query name - & gt ; List of Query values . * @ param rawQuery query portion of the uri to analyze . */ public static Multimap < String , String > getParameters ( final String rawQuery ) { } }
Multimap < String , String > result = HashMultimap . create ( ) ; if ( rawQuery == null ) { return result ; } StringTokenizer tokens = new StringTokenizer ( rawQuery , "&" ) ; while ( tokens . hasMoreTokens ( ) ) { String pair = tokens . nextToken ( ) ; int pos = pair . indexOf ( '=' ) ; String key ; String value ; if ( pos == - 1 ) { key = pair ; value = "" ; } else { try { key = URLDecoder . decode ( pair . substring ( 0 , pos ) , "UTF-8" ) ; value = URLDecoder . decode ( pair . substring ( pos + 1 ) , "UTF-8" ) ; } catch ( UnsupportedEncodingException e ) { throw ExceptionUtils . getRuntimeException ( e ) ; } } result . put ( key , value ) ; } return result ;
public class SimpleZeroSwap { /** * This method returns the value random variable of the product within the specified model , evaluated at a given evalutationTime . * Note : For a lattice this is often the value conditional to evalutationTime , for a Monte - Carlo simulation this is the ( sum of ) value discounted to evaluation time . * Cashflows prior evaluationTime are not considered . * @ param evaluationTime The time on which this products value should be observed . * @ param model The model used to price the product . * @ return The random variable representing the value of the product discounted to evaluation time * @ throws net . finmath . exception . CalculationException Thrown if the valuation fails , specific cause may be available via the < code > cause ( ) < / code > method . */ @ Override public RandomVariableInterface getValue ( double evaluationTime , LIBORModelMonteCarloSimulationInterface model ) throws CalculationException { } }
RandomVariableInterface values = model . getRandomVariableForConstant ( 0.0 ) ; RandomVariableInterface notional = model . getRandomVariableForConstant ( 1.0 ) ; for ( int period = 0 ; period < fixingDates . length ; period ++ ) { double fixingDate = fixingDates [ period ] ; double paymentDate = paymentDates [ period ] ; double swaprate = swaprates [ period ] ; double periodLength = paymentDate - fixingDate ; if ( paymentDate < evaluationTime ) { continue ; } // Get random variables RandomVariableInterface index = floatIndex != null ? floatIndex . getValue ( fixingDate , model ) : model . getLIBOR ( fixingDate , fixingDate , paymentDate ) ; RandomVariableInterface payoff = index . sub ( swaprate ) . mult ( periodLength ) . mult ( notional ) ; if ( ! isPayFix ) { payoff = payoff . mult ( - 1.0 ) ; } RandomVariableInterface numeraire = model . getNumeraire ( paymentDate ) ; RandomVariableInterface monteCarloProbabilities = model . getMonteCarloWeights ( paymentDate ) ; payoff = payoff . div ( numeraire ) . mult ( monteCarloProbabilities ) ; values = values . add ( payoff ) ; notional = notional . mult ( swaprate * periodLength ) ; } RandomVariableInterface numeraireAtEvalTime = model . getNumeraire ( evaluationTime ) ; RandomVariableInterface monteCarloProbabilitiesAtEvalTime = model . getMonteCarloWeights ( evaluationTime ) ; values = values . mult ( numeraireAtEvalTime ) . div ( monteCarloProbabilitiesAtEvalTime ) ; return values ;
public class TouchActions { /** * Allows the view to be scrolled by an x and y offset . * @ param xOffset The horizontal offset relative to the viewport * @ param yOffset The vertical offset relative to the viewport * @ return self */ public TouchActions scroll ( int xOffset , int yOffset ) { } }
if ( touchScreen != null ) { action . addAction ( new ScrollAction ( touchScreen , xOffset , yOffset ) ) ; } return this ;
public class Parser { /** * Scans the given token global token stream for a list of sub - token * streams representing those portions of the global stream that * may contain date time information * @ param stream * @ return */ private List < TokenStream > collectTokenStreams ( TokenStream stream ) { } }
// walk through the token stream and build a collection // of sub token streams that represent possible date locations List < Token > currentGroup = null ; List < List < Token > > groups = new ArrayList < List < Token > > ( ) ; Token currentToken ; int currentTokenType ; StringBuilder tokenString = new StringBuilder ( ) ; while ( ( currentToken = stream . getTokenSource ( ) . nextToken ( ) ) . getType ( ) != DateLexer . EOF ) { currentTokenType = currentToken . getType ( ) ; tokenString . append ( DateParser . tokenNames [ currentTokenType ] ) . append ( " " ) ; // we ' re currently NOT collecting for a possible date group if ( currentGroup == null ) { // skip over white space and known tokens that cannot be the start of a date if ( currentTokenType != DateLexer . WHITE_SPACE && DateParser . FOLLOW_empty_in_parse186 . member ( currentTokenType ) ) { currentGroup = new ArrayList < Token > ( ) ; currentGroup . add ( currentToken ) ; } } // we ' re currently collecting else { // preserve white space if ( currentTokenType == DateLexer . WHITE_SPACE ) { currentGroup . add ( currentToken ) ; } else { // if this is an unknown token , we ' ll close out the current group if ( currentTokenType == DateLexer . UNKNOWN ) { addGroup ( currentGroup , groups ) ; currentGroup = null ; } // otherwise , the token is known and we ' re currently collecting for // a group , so we ' ll add it to the current group else { currentGroup . add ( currentToken ) ; } } } } if ( currentGroup != null ) { addGroup ( currentGroup , groups ) ; } _logger . info ( "STREAM: " + tokenString . toString ( ) ) ; List < TokenStream > streams = new ArrayList < TokenStream > ( ) ; for ( List < Token > group : groups ) { if ( ! group . isEmpty ( ) ) { StringBuilder builder = new StringBuilder ( ) ; builder . append ( "GROUP: " ) ; for ( Token token : group ) { builder . append ( DateParser . tokenNames [ token . getType ( ) ] ) . append ( " " ) ; } _logger . info ( builder . toString ( ) ) ; streams . add ( new CommonTokenStream ( new NattyTokenSource ( group ) ) ) ; } } return streams ;
public class ConsentDecisionCouchDbRepository { /** * Find the first consent decision for a given principal , service pair . Should only be one of them anyway . * @ param principal User to search for . * @ param service Service name to search for . * @ return Consent decision matching the given principal and service names . */ public CouchDbConsentDecision findFirstConsentDecision ( final String principal , final String service ) { } }
val view = createQuery ( "by_consent_decision" ) . key ( ComplexKey . of ( principal , service ) ) . limit ( 1 ) . includeDocs ( true ) ; return db . queryView ( view , CouchDbConsentDecision . class ) . stream ( ) . findFirst ( ) . orElse ( null ) ;
public class OrmDescriptorImpl { /** * Returns all < code > sequence - generator < / code > elements * @ return list of < code > sequence - generator < / code > */ public List < SequenceGenerator < OrmDescriptor > > getAllSequenceGenerator ( ) { } }
List < SequenceGenerator < OrmDescriptor > > list = new ArrayList < SequenceGenerator < OrmDescriptor > > ( ) ; List < Node > nodeList = model . get ( "sequence-generator" ) ; for ( Node node : nodeList ) { SequenceGenerator < OrmDescriptor > type = new SequenceGeneratorImpl < OrmDescriptor > ( this , "sequence-generator" , model , node ) ; list . add ( type ) ; } return list ;
public class ArtifactoryController { /** * Creating a configuration */ @ RequestMapping ( value = "configurations/create" , method = RequestMethod . POST ) public ArtifactoryConfiguration newConfiguration ( @ RequestBody ArtifactoryConfiguration configuration ) { } }
return configurationService . newConfiguration ( configuration ) ;
public class SecurityAcl { /** * ( non - Javadoc ) * @ see * nyla . solutions . core . security . data . Acl # addEntry ( java . security . Principal , * java . security . Principal , java . lang . String ) */ @ Override public synchronized boolean addEntry ( Principal caller , Principal principal , String permission ) { } }
return addEntry ( caller , new SecurityAccessControl ( principal , permission ) ) ;
public class LdapUtils { /** * New search executor search executor . * @ param baseDn the base dn * @ param filterQuery the filter query * @ return the search executor */ public static SearchExecutor newLdaptiveSearchExecutor ( final String baseDn , final String filterQuery ) { } }
return newLdaptiveSearchExecutor ( baseDn , filterQuery , new ArrayList < > ( 0 ) ) ;
public class Channel { @ Override public long getEstimatedOutputSize ( ) { } }
long estimate = this . source . template . getEstimatedOutputSize ( ) ; return estimate < 0 ? estimate : estimate * this . replicationFactor ;
public class AbstractMavenScroogeMojo { /** * Walk project references recursively , building up a list of thrift files they provide , starting * with an empty file list . */ protected List < File > getRecursiveThriftFiles ( MavenProject project , String outputDirectory ) throws IOException { } }
return getRecursiveThriftFiles ( project , outputDirectory , new ArrayList < File > ( ) ) ;
public class GenericGenerators { /** * Generates instructions to pop { @ code count } items off the stack . * @ param count number of items to pop * @ return instructions for a pop * @ throws IllegalArgumentException if any numeric argument is negative */ public static InsnList pop ( int count ) { } }
Validate . isTrue ( count >= 0 ) ; InsnList ret = new InsnList ( ) ; for ( int i = 0 ; i < count ; i ++ ) { ret . add ( new InsnNode ( Opcodes . POP ) ) ; } return ret ;
public class ReloadableResourceBundleMessageSource { /** * Resolves the given message code as key in the retrieved bundle files , * returning the value found in the bundle as - is ( without MessageFormat parsing ) . */ @ Override protected String resolveCodeWithoutArguments ( String code , Locale locale ) { } }
if ( this . cacheMillis < 0 ) { PropertiesHolder propHolder = getMergedProperties ( locale ) ; String result = propHolder . getProperty ( code ) ; if ( result != null ) { return result ; } } else { for ( String basename : this . basenames ) { List < Pair < String , Resource > > filenamesAndResources = calculateAllFilenames ( basename , locale ) ; for ( Pair < String , Resource > filenameAndResource : filenamesAndResources ) { if ( filenameAndResource . getbValue ( ) != null ) { PropertiesHolder propHolder = getProperties ( filenameAndResource . getaValue ( ) , filenameAndResource . getbValue ( ) ) ; String result = propHolder . getProperty ( code ) ; if ( result != null ) { return result ; } } } } } return null ;
public class FileFinder { /** * Looks up files whose name matches the given pattern under the given set * of directories ( and , if specified , their sub - directories in a recursive way ) . * @ param pattern * the name of the file , as a regular expression . * @ param recurse * whether the finder should recurse to sub - directories . * @ param roots * a set of one or more directories to scan . * @ return * a list of < code > File < / code > object representing the found files . */ public static List < File > findFile ( String pattern , boolean recurse , String ... roots ) { } }
List < File > files = new ArrayList < > ( ) ; if ( roots != null ) { for ( String root : roots ) { try { Path path = FileSystems . getDefault ( ) . getPath ( root ) ; logger . trace ( "scanning directory {}" , path . getFileName ( ) ) ; Files . walkFileTree ( path , new FileFinderVisitor ( pattern , files ) ) ; } catch ( IOException e ) { logger . trace ( "error walking directory tree" , e ) ; } } } return files ;
public class SharedDataContextUtils { /** * Copies the source file to a file , replacing the @ key . X @ tokens with the values from the data * context * @ param script source file path * @ param dataContext input data context * @ param style line ending style * @ param destination destination file , or null to create a temp file * @ throws java . io . IOException on io error */ public static void replaceTokensInScript ( final String script , final MultiDataContext < ContextView , DataContext > dataContext , final ScriptfileUtils . LineEndingStyle style , final File destination , final String nodeName ) throws IOException { } }
if ( null == script ) { throw new NullPointerException ( "script cannot be null" ) ; } replaceTokensInReader ( new StringReader ( script ) , dataContext , style , destination , nodeName ) ;
public class AbstractCachedGenerator { /** * Serialize the cache file mapping */ protected synchronized void serializeCacheMapping ( ) { } }
for ( Map . Entry < String , List < FilePathMapping > > entry : linkedResourceMap . entrySet ( ) ) { StringBuilder strb = new StringBuilder ( ) ; Iterator < FilePathMapping > iter = entry . getValue ( ) . iterator ( ) ; if ( iter . hasNext ( ) ) { for ( ; iter . hasNext ( ) ; ) { FilePathMapping fMapping = iter . next ( ) ; strb . append ( fMapping . getPath ( ) ) . append ( MAPPING_TIMESTAMP_SEPARATOR ) . append ( fMapping . getLastModified ( ) ) ; if ( iter . hasNext ( ) ) { strb . append ( SEMICOLON ) ; } } cacheProperties . put ( JAWR_MAPPING_PREFIX + entry . getKey ( ) , strb . toString ( ) ) ; } } File f = new File ( getCacheFilePath ( ) ) ; if ( ! f . getParentFile ( ) . exists ( ) ) { f . getParentFile ( ) . mkdirs ( ) ; } FileWriter fw = null ; try { fw = new FileWriter ( f ) ; cacheProperties . store ( fw , "Cache properties of " + getName ( ) + " generator" ) ; } catch ( IOException e ) { throw new BundlingProcessException ( "Unable to save cache file mapping " , e ) ; } finally { IOUtils . close ( fw ) ; }
public class JDBC4PreparedStatement { /** * Executes the SQL statement in this PreparedStatement object , which must be an SQL Data Manipulation Language ( DML ) statement , such as INSERT , UPDATE or DELETE ; or an SQL statement that returns nothing , such as a DDL statement . */ @ Override public int executeUpdate ( ) throws SQLException { } }
checkClosed ( ) ; if ( ! this . Query . isOfType ( VoltSQL . TYPE_EXEC , VoltSQL . TYPE_UPDATE ) ) { throw SQLError . get ( SQLError . ILLEGAL_STATEMENT , this . Query . toSqlString ( ) ) ; } int result = this . executeUpdate ( this . Query . getExecutableQuery ( this . parameters ) ) ; this . parameters = this . Query . getParameterArray ( ) ; return result ;
public class Utils { /** * Return an InputStream of the specified resource , failing if it can ' t be found . * @ param clzz * @ param location * Location of resource */ public static InputStream getRequiredResourceAsStream ( Class < ? > clzz , String location ) { } }
InputStream resourceStream = clzz . getResourceAsStream ( location ) ; if ( resourceStream == null ) { // Try with a leading " / " if ( ! location . startsWith ( "/" ) ) { resourceStream = clzz . getResourceAsStream ( "/" + location ) ; } if ( resourceStream == null ) { throw new RuntimeException ( "Resource file was not found at location " + location ) ; } } return resourceStream ;
public class Transaction { /** * Gets the transaction weight as defined in BIP141. */ public int getWeight ( ) { } }
if ( ! hasWitnesses ( ) ) return getMessageSize ( ) * 4 ; try ( final ByteArrayOutputStream stream = new UnsafeByteArrayOutputStream ( length ) ) { bitcoinSerializeToStream ( stream , false ) ; final int baseSize = stream . size ( ) ; stream . reset ( ) ; bitcoinSerializeToStream ( stream , true ) ; final int totalSize = stream . size ( ) ; return baseSize * 3 + totalSize ; } catch ( IOException e ) { throw new RuntimeException ( e ) ; // cannot happen }
public class PatchSchedulesInner { /** * Gets all patch schedules in the specified redis cache ( there is only one ) . * ServiceResponse < PageImpl < RedisPatchScheduleInner > > * @ param nextPageLink The NextLink from the previous successful call to List operation . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the PagedList & lt ; RedisPatchScheduleInner & gt ; object wrapped in { @ link ServiceResponse } if successful . */ public Observable < ServiceResponse < Page < RedisPatchScheduleInner > > > listByRedisResourceNextSinglePageAsync ( final String nextPageLink ) { } }
if ( nextPageLink == null ) { throw new IllegalArgumentException ( "Parameter nextPageLink is required and cannot be null." ) ; } String nextUrl = String . format ( "%s" , nextPageLink ) ; return service . listByRedisResourceNext ( nextUrl , this . client . acceptLanguage ( ) , this . client . userAgent ( ) ) . flatMap ( new Func1 < Response < ResponseBody > , Observable < ServiceResponse < Page < RedisPatchScheduleInner > > > > ( ) { @ Override public Observable < ServiceResponse < Page < RedisPatchScheduleInner > > > call ( Response < ResponseBody > response ) { try { ServiceResponse < PageImpl < RedisPatchScheduleInner > > result = listByRedisResourceNextDelegate ( response ) ; return Observable . just ( new ServiceResponse < Page < RedisPatchScheduleInner > > ( result . body ( ) , result . response ( ) ) ) ; } catch ( Throwable t ) { return Observable . error ( t ) ; } } } ) ;
public class RuntimeEnvironmentPropertyPage { /** * Save the flag that indicates if the specific project options must be * used . * @ param project the project . * @ param useSpecificOptions indicates if the specific options must be used . * @ return < code > true < / code > if the property was saved successfully . */ @ SuppressWarnings ( "static-method" ) protected boolean saveProjectSpecificOptions ( IProject project , boolean useSpecificOptions ) { } }
if ( project != null ) { try { project . setPersistentProperty ( qualify ( PROPERTY_NAME_HAS_PROJECT_SPECIFIC ) , Boolean . toString ( useSpecificOptions ) ) ; return true ; } catch ( CoreException e ) { SARLEclipsePlugin . getDefault ( ) . log ( e ) ; } } return false ;
public class PluginRepositoryUtil { /** * Returns < code > true < / code > if the class contains plugin annotations . * @ param clazz * The plugin class * @ return < code > true < / code > if the class contains plugin */ @ SuppressWarnings ( { } }
"rawtypes" , "unchecked" } ) private static boolean isAnnotated ( final Class clazz ) { Plugin plugin = ( Plugin ) clazz . getAnnotation ( Plugin . class ) ; return plugin != null ;
public class JSONConverter { /** * serialize a Array * @ param array Array to serialize * @ param sb * @ param serializeQueryByColumns * @ param done * @ throws ConverterException */ private void _serializeArray ( PageContext pc , Set test , Array array , StringBuilder sb , boolean serializeQueryByColumns , Set < Object > done ) throws ConverterException { } }
_serializeList ( pc , test , array . toList ( ) , sb , serializeQueryByColumns , done ) ;
public class MapKeyLoader { /** * Calculates and returns the role for the map key loader on this partition */ private Role calculateRole ( ) { } }
boolean isPartitionOwner = partitionService . isPartitionOwner ( partitionId ) ; boolean isMapNamePartition = partitionId == mapNamePartition ; boolean isMapNamePartitionFirstReplica = false ; if ( hasBackup && isMapNamePartition ) { IPartition partition = partitionService . getPartition ( partitionId ) ; Address firstReplicaAddress = partition . getReplicaAddress ( 1 ) ; Member member = clusterService . getMember ( firstReplicaAddress ) ; if ( member != null ) { isMapNamePartitionFirstReplica = member . localMember ( ) ; } } return assignRole ( isPartitionOwner , isMapNamePartition , isMapNamePartitionFirstReplica ) ;
public class CitrusBackend { /** * Gets the object factory instance that is configured in environment . * @ return */ private ObjectFactory getObjectFactory ( ) throws IllegalAccessException { } }
if ( Env . INSTANCE . get ( ObjectFactory . class . getName ( ) ) . equals ( CitrusObjectFactory . class . getName ( ) ) ) { return CitrusObjectFactory . instance ( ) ; } else if ( Env . INSTANCE . get ( ObjectFactory . class . getName ( ) ) . equals ( CitrusSpringObjectFactory . class . getName ( ) ) ) { return CitrusSpringObjectFactory . instance ( ) ; } return ObjectFactoryLoader . loadObjectFactory ( new ResourceLoaderClassFinder ( resourceLoader , Thread . currentThread ( ) . getContextClassLoader ( ) ) , Env . INSTANCE . get ( ObjectFactory . class . getName ( ) ) ) ;
public class CommonOps_DSCC { /** * Checks for duplicate elements . A is sorted * @ param A Matrix to be tested . * @ return true if duplicates or false if false duplicates */ public static boolean checkDuplicateElements ( DMatrixSparseCSC A ) { } }
A = A . copy ( ) ; // create a copy so that it doesn ' t modify A A . sortIndices ( null ) ; return ! checkSortedFlag ( A ) ;
public class QueryUtil { /** * Get a linear scan query for the given distance query . * @ param < O > Object type * @ param distanceQuery distance query * @ return Range query */ @ SuppressWarnings ( "unchecked" ) public static < O > RangeQuery < O > getLinearScanRangeQuery ( DistanceQuery < O > distanceQuery ) { } }
// Slight optimizations of linear scans if ( distanceQuery instanceof PrimitiveDistanceQuery ) { final PrimitiveDistanceQuery < O > pdq = ( PrimitiveDistanceQuery < O > ) distanceQuery ; if ( EuclideanDistanceFunction . STATIC . equals ( pdq . getDistanceFunction ( ) ) ) { final PrimitiveDistanceQuery < NumberVector > ndq = ( PrimitiveDistanceQuery < NumberVector > ) pdq ; return ( RangeQuery < O > ) new LinearScanEuclideanDistanceRangeQuery < > ( ndq ) ; } return new LinearScanPrimitiveDistanceRangeQuery < > ( pdq ) ; } return new LinearScanDistanceRangeQuery < > ( distanceQuery ) ;
public class OkapiUI { /** * GEN - LAST : event _ chkReaderInitActionPerformed */ private void txtBorderWidthFocusLost ( java . awt . event . FocusEvent evt ) { } }
// GEN - FIRST : event _ txtBorderWidthFocusLost // TODO : the name ( and label ? ) of this text box no longer matches its purpose if ( txtBorderWidth . getText ( ) . matches ( "[0-9]+" ) ) { quietZoneHorizontal = Integer . parseInt ( txtBorderWidth . getText ( ) ) ; encodeData ( ) ; } else { txtBorderWidth . setText ( String . valueOf ( quietZoneHorizontal ) ) ; }
public class BufferedEncoder { /** * Writes the suffix and clears the buffer for reuse . */ @ Override final public void writeSuffixTo ( Appendable out ) throws IOException { } }
writeSuffix ( buffer , out ) ; buffer . setLength ( 0 ) ;
public class TaskClient { /** * Ack for the task poll . * @ param taskId Id of the task to be polled * @ param workerId user identified worker . * @ return true if the task was found with the given ID and acknowledged . False otherwise . If the server returns false , the client should NOT attempt to ack again . */ public boolean ack ( String taskId , @ Nullable String workerId ) { } }
Preconditions . checkArgument ( StringUtils . isNotBlank ( taskId ) , "Task id cannot be blank" ) ; TaskServicePb . AckTaskRequest . Builder request = TaskServicePb . AckTaskRequest . newBuilder ( ) ; request . setTaskId ( taskId ) ; if ( workerId != null ) { request . setWorkerId ( workerId ) ; } return stub . ackTask ( request . build ( ) ) . getAck ( ) ;
public class DocumentConventions { /** * Gets the collection name for a given type . * @ param clazz Class * @ return collection name */ public String getCollectionName ( Class clazz ) { } }
String collectionName = _findCollectionName . apply ( clazz ) ; if ( collectionName != null ) { return collectionName ; } return defaultGetCollectionName ( clazz ) ;
public class Config { /** * Set configuration object attribute . If attribute already exists overwrite old value . Empty value is not accepted * but null is considered indication to remove attribute . So that , an existing attribute cannot be either null or * empty . * @ param name attribute name , * @ param value attribute value , null ignored . * @ throws IllegalArgumentException if < code > name < / code > argument is null or empty . * @ throws IllegalArgumentException if < code > value < / code > argument is empty . */ public void setAttribute ( String name , String value ) { } }
Params . notNullOrEmpty ( name , "Attribute name" ) ; Params . notEmpty ( value , "Attribute value" ) ; if ( value != null ) { attributes . put ( name , value ) ; } else { attributes . remove ( name ) ; }
public class ExtensionsConfigFileReader { /** * This method corresponds to an iteration of the loop at line 2212 Notes : * 1 . [ general ] and [ globals ] are allowed to be a context here if they * contain only configvariables 2 . switch and ignorepat are treated like * regular ConfigVariable . */ @ Override protected ConfigElement processTextLine ( String configfile , int lineno , String line ) throws ConfigParseException { } }
ConfigElement configElement ; if ( ( line . trim ( ) . startsWith ( "exten" ) || line . trim ( ) . startsWith ( "include" ) ) && currentCategory != null && ( currentCategory . getName ( ) . equals ( "general" ) || currentCategory . getName ( ) . equals ( "globals" ) ) ) throw new ConfigParseException ( configfile , lineno , "cannot have 'exten' or 'include' in global or general sections" ) ; /* * Goal here is to break out anything unique that we might want to look * at and parse separately . For now , only exten and include fit that * criteria . Eventually , I could see parsing sections for things from * macros , contexts to differentiate them from categories , switch for * realtime , and more . */ if ( line . trim ( ) . startsWith ( "exten" ) ) { configElement = parseExtension ( configfile , lineno , line ) ; currentCategory . addElement ( configElement ) ; return configElement ; } else if ( line . trim ( ) . startsWith ( "include" ) ) { // use parseVariable since we have access to it ConfigVariable configvar = parseVariable ( configfile , lineno , line ) ; configElement = new ConfigInclude ( configfile , lineno , configvar . getValue ( ) ) ; currentCategory . addElement ( configElement ) ; return configElement ; } // leave everything else the same configElement = super . processTextLine ( configfile , lineno , line ) ; return configElement ;
public class PactDslRootValue { /** * Value that must be encoded as an UUID * @ param uuid example UUID to use for generated bodies */ public static PactDslRootValue uuid ( String uuid ) { } }
if ( ! uuid . matches ( UUID_REGEX ) ) { throw new InvalidMatcherException ( EXAMPLE + uuid + "\" is not an UUID" ) ; } PactDslRootValue value = new PactDslRootValue ( ) ; value . setValue ( uuid ) ; value . setMatcher ( value . regexp ( UUID_REGEX ) ) ; return value ;