signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class BatchGetDevEndpointsResult { /** * A list of DevEndpoint definitions . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setDevEndpoints ( java . util . Collection ) } or { @ link # withDevEndpoints ( java . util . Collection ) } if you want to *...
if ( this . devEndpoints == null ) { setDevEndpoints ( new java . util . ArrayList < DevEndpoint > ( devEndpoints . length ) ) ; } for ( DevEndpoint ele : devEndpoints ) { this . devEndpoints . add ( ele ) ; } return this ;
public class LiferayWarPackagingProcessor { /** * ( non - Javadoc ) * @ see * org . jboss . shrinkwrap . resolver . spi . maven . archive . packaging . PackagingProcessor * # importBuildOutput ( org . jboss . shrinkwrap . resolver . api . maven . strategy . * MavenResolutionStrategy ) */ @ Override public Lifer...
log . debug ( "Building Liferay Plugin Archive" ) ; ParsedPomFile pomFile = session . getParsedPomFile ( ) ; // Compile and add Java classes if ( Validate . isReadable ( pomFile . getSourceDirectory ( ) ) ) { compile ( pomFile . getSourceDirectory ( ) , pomFile . getBuildOutputDirectory ( ) , ScopeType . COMPILE , Scop...
public class OSecurityHelper { /** * Transform name to { @ link ORule . ResourceGeneric } * @ param name name to transform * @ return { @ link ORule . ResourceGeneric } or null */ public static ORule . ResourceGeneric getResourceGeneric ( String name ) { } }
String shortName = Strings . beforeFirst ( name , '.' ) ; if ( Strings . isEmpty ( shortName ) ) shortName = name ; ORule . ResourceGeneric value = ORule . ResourceGeneric . valueOf ( shortName ) ; if ( value == null ) value = ORule . mapLegacyResourceToGenericResource ( name ) ; return value ;
public class URL { /** * Sets the fields of the URL . This is not a public method so that only URLStreamHandlers can * modify URL fields . URLs are otherwise constant . * @ param protocol the name of the protocol to use * @ param host the name of the host * @ param port the port number on the host * @ param f...
this . protocol = protocol ; this . host = host ; this . authority = port == - 1 ? host : host + ":" + port ; this . port = port ; this . file = file ; this . ref = ref ; /* * This is very important . We must recompute this after the URL has been changed . */ this . hashCodeValue = - 1 ; final int q = file . lastIndexO...
public class OrderItemUrl { /** * Get Resource Url for GetQuoteItemsByQuoteName * @ param customerAccountId The unique identifier of the customer account for which to retrieve wish lists . * @ param filter A set of filter expressions representing the search parameters for a query . This parameter is optional . Refe...
UrlFormatter formatter = new UrlFormatter ( "/api/commerce/quotes/customers/{customerAccountId}/{quoteName}/items?startIndex={startIndex}&pageSize={pageSize}&sortBy={sortBy}&filter={filter}&responseFields={responseFields}" ) ; formatter . formatUrl ( "customerAccountId" , customerAccountId ) ; formatter . formatUrl ( "...
public class X509CRLEntryImpl { /** * Gets a Set of the extension ( s ) marked CRITICAL in this * X509CRLEntry . In the returned set , each extension is * represented by its OID string . * @ return a set of the extension oid strings in the * Object that are marked critical . */ public Set < String > getCritical...
if ( extensions == null ) { return null ; } Set < String > extSet = new TreeSet < > ( ) ; for ( Extension ex : extensions . getAllExtensions ( ) ) { if ( ex . isCritical ( ) ) { extSet . add ( ex . getExtensionId ( ) . toString ( ) ) ; } } return extSet ;
public class SimonInterceptor { /** * Around invoke method that measures the split for one method invocation . * @ param context invocation context * @ return return value from the invocation * @ throws Exception exception thrown from the invocation */ @ AroundInvoke public Object monitor ( InvocationContext cont...
if ( isMonitored ( context ) ) { String simonName = getSimonName ( context ) ; try ( Split ignored = SimonManager . getStopwatch ( simonName ) . start ( ) ) { return context . proceed ( ) ; } } else { return context . proceed ( ) ; }
public class HtmlTree { /** * This method adds a string content to the htmltree . If the last content member * added is a StringContent , append the string to that StringContent or else * create a new StringContent and add it to the html tree . * @ param stringContent string content that needs to be added */ publ...
if ( ! content . isEmpty ( ) ) { Content lastContent = content . get ( content . size ( ) - 1 ) ; if ( lastContent instanceof StringContent ) lastContent . addContent ( stringContent ) ; else addContent ( new StringContent ( stringContent ) ) ; } else addContent ( new StringContent ( stringContent ) ) ;
public class ClassLocator { /** * Checks whether the " otherclass " is a subclass of the given " superclass " . * @ param superclass the superclass to check against * @ param otherclass this class is checked whether it is a subclass * of the the superclass * @ return TRUE if " otherclass " is a true subclass */...
Class currentclass ; boolean result ; String key ; key = superclass . getName ( ) + "-" + otherclass . getName ( ) ; if ( m_CheckSubClass . containsKey ( key ) ) return m_CheckSubClass . get ( key ) ; currentclass = otherclass ; do { result = currentclass . equals ( superclass ) ; // topmost class reached ? if ( curren...
public class SortableArrayList { /** * Performs a binary search , attempting to locate the specified * object . The array must be in the sort order defined by the supplied * { @ link Comparator } for this to operate correctly . * @ return the index of the object in question or * < code > ( - ( < i > insertion p...
return ArrayUtil . binarySearch ( _elements , 0 , _size , key , comp ) ;
public class JobDeleteOptions { /** * Set the time the request was issued . Client libraries typically set this to the current system clock time ; set it explicitly if you are calling the REST API directly . * @ param ocpDate the ocpDate value to set * @ return the JobDeleteOptions object itself . */ public JobDele...
if ( ocpDate == null ) { this . ocpDate = null ; } else { this . ocpDate = new DateTimeRfc1123 ( ocpDate ) ; } return this ;
public class XAnnotationInvocationHandler { /** * Implementation of dynamicProxy . hashCode ( ) */ private int hashCodeImpl ( ) { } }
int result = 0 ; for ( Map . Entry < String , Object > e : memberValues . entrySet ( ) ) { result += ( 127 * e . getKey ( ) . hashCode ( ) ) ^ memberValueHashCode ( e . getValue ( ) ) ; } return result ;
public class AmazonECSClient { /** * Stops a running task . Any tags associated with the task will be deleted . * When < a > StopTask < / a > is called on a task , the equivalent of < code > docker stop < / code > is issued to the containers * running in the task . This results in a < code > SIGTERM < / code > valu...
request = beforeClientExecution ( request ) ; return executeStopTask ( request ) ;
public class GuiUtilities { /** * Create an image to make a color picker button . * @ param button the button . * @ param color the color to set . * @ param size the optional size of the image . */ public static void colorButton ( JButton button , Color color , Integer size ) { } }
if ( size == null ) size = 15 ; BufferedImage bi = new BufferedImage ( size , size , BufferedImage . TYPE_INT_RGB ) ; Graphics2D gr = ( Graphics2D ) bi . getGraphics ( ) ; gr . setColor ( color ) ; gr . fillRect ( 0 , 0 , size , size ) ; gr . dispose ( ) ; button . setIcon ( new ImageIcon ( bi ) ) ;
public class KeysDAORedisImpl { /** * { @ inheritDoc } */ @ Override public KeyInfo getKeyInfo ( final String key ) { } }
return PoolUtils . doWorkInPoolNicely ( this . jedisPool , new KeyDAOPoolWork ( key ) ) ;
public class AttributeProxy { public void put_property ( DbDatum property ) throws DevFailed { } }
DbAttribute db_att = new DbAttribute ( deviceName ) ; db_att . add ( property ) ; dev . put_attribute_property ( db_att ) ;
public class CqlBulkRecordWriter { /** * The column values must correspond to the order in which * they appear in the insert stored procedure . * Key is not used , so it can be null or any object . * @ param key * any object or null . * @ param values * the values to write . * @ throws IOException */ @ Ov...
prepareWriter ( ) ; try { ( ( CQLSSTableWriter ) writer ) . rawAddRow ( values ) ; if ( null != progress ) progress . progress ( ) ; if ( null != context ) HadoopCompat . progress ( context ) ; } catch ( InvalidRequestException e ) { throw new IOException ( "Error adding row with key: " + key , e ) ; }
public class MemoryFileItem { /** * A convenience method to write an uploaded item to disk . The client code * is not concerned with whether or not the item is stored in memory , or on * disk in a temporary location . They just want to write the uploaded item * to a file . * This implementation first attempts t...
try ( FileOutputStream fout = new FileOutputStream ( file ) ) { fout . write ( get ( ) ) ; }
public class PartitionIDRange { /** * = = = = = Helper methods to generate PartitionIDRanges = = = = = */ public static List < PartitionIDRange > getGlobalRange ( final int partitionBits ) { } }
Preconditions . checkArgument ( partitionBits >= 0 && partitionBits < ( Integer . SIZE - 1 ) , "Invalid partition bits: %s" , partitionBits ) ; final int partitionIdBound = ( 1 << ( partitionBits ) ) ; return ImmutableList . of ( new PartitionIDRange ( 0 , partitionIdBound , partitionIdBound ) ) ;
public class Evaluation { /** * Calculate the average recall for all classes - can specify whether macro or micro averaging should be used * NOTE : if any classes have tp = 0 and fn = 0 , ( recall = 0/0 ) these are excluded from the average * @ param averaging Averaging method - macro or micro * @ return Average ...
if ( getNumRowCounter ( ) == 0.0 ) { return 0.0 ; // No data } int nClasses = confusion ( ) . getClasses ( ) . size ( ) ; if ( averaging == EvaluationAveraging . Macro ) { double macroRecall = 0.0 ; int count = 0 ; for ( int i = 0 ; i < nClasses ; i ++ ) { double thisClassRecall = recall ( i , - 1 ) ; if ( thisClassRec...
public class PeerTableImpl { /** * Life cycle */ @ Override public void start ( ) throws IllegalDiameterStateException , IOException { } }
logger . debug ( "Starting PeerTable. Going to call connect on all peers in the peerTable" ) ; for ( Peer peer : peerTable . values ( ) ) { try { peer . connect ( ) ; } catch ( Exception e ) { logger . warn ( "Can not start connect procedure to peer [" + peer + "]" , e ) ; } } logger . debug ( "Calling start on the rou...
public class SslCodec { /** * Creates a new downstream connection as { @ link LinkedIOSubchannel } * of the network connection together with an { @ link SSLEngine } . * @ param event * the accepted event */ @ Handler ( channels = EncryptedChannel . class ) public void onConnected ( Connected event , IOSubchannel ...
new PlainChannel ( event , encryptedChannel ) ;
public class ModelsImpl { /** * Create an entity role for an entity in the application . * @ param appId The application ID . * @ param versionId The version ID . * @ param hEntityId The hierarchical entity extractor ID . * @ param createHierarchicalEntityRoleOptionalParameter the object representing the option...
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 IllegalArgu...
public class UriUtils { /** * Creates an URI as a String . * @ param scheme * the scheme * @ param host * the host * @ param port * the port * @ param path * the path * @ param query * the query * @ param fragment * the fragment * @ return the uri */ public static String createURI ( final Stri...
StringBuilder buffer = new StringBuilder ( Parameters . SMALL_BUFFER_SIZE ) ; if ( host != null ) { if ( scheme != null ) { buffer . append ( scheme ) ; buffer . append ( "://" ) ; } buffer . append ( host ) ; if ( port > 0 ) { buffer . append ( ':' ) ; buffer . append ( port ) ; } } if ( path == null || ! path . start...
public class SearchUrl { /** * Get Resource Url for DeleteSearchTuningRule * @ param searchTuningRuleCode The unique identifier of the search tuning rule . * @ return String Resource Url */ public static MozuUrl deleteSearchTuningRuleUrl ( String searchTuningRuleCode ) { } }
UrlFormatter formatter = new UrlFormatter ( "/api/commerce/catalog/admin/search/searchtuningrules/{searchTuningRuleCode}" ) ; formatter . formatUrl ( "searchTuningRuleCode" , searchTuningRuleCode ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ;
public class FSFlowTemplateCatalog { /** * Determine if an URI of a jobTemplate or a FlowTemplate is valid . * @ param flowURI The given job / flow template * @ return true if the URI is valid . */ private boolean validateTemplateURI ( URI flowURI ) { } }
if ( ! this . sysConfig . hasPath ( ServiceConfigKeys . TEMPLATE_CATALOGS_FULLY_QUALIFIED_PATH_KEY ) ) { log . error ( "Missing config " + ServiceConfigKeys . TEMPLATE_CATALOGS_FULLY_QUALIFIED_PATH_KEY ) ; return false ; } if ( ! flowURI . getScheme ( ) . equals ( FS_SCHEME ) ) { log . error ( "Expected scheme " + FS_S...
public class PlainTime { /** * / * [ deutsch ] * < p > Erzeugt eine neue Uhrzeit mit Stunde , Minute , Sekunde und * Nanosekunde . < / p > * @ param hour hour in the range { @ code 0-23 } or { @ code 24} * if the other argumenta equal to { @ code 0} * @ param minute minute in the range { @ code 0-59} * @ pa...
return PlainTime . of ( hour , minute , second , nanosecond , true ) ;
public class gslbsite_binding { /** * Use this API to fetch gslbsite _ binding resource of given name . */ public static gslbsite_binding get ( nitro_service service , String sitename ) throws Exception { } }
gslbsite_binding obj = new gslbsite_binding ( ) ; obj . set_sitename ( sitename ) ; gslbsite_binding response = ( gslbsite_binding ) obj . get_resource ( service ) ; return response ;
public class FeatureGen { /** * Write features . * @ param fout the fout * @ throws IOException Signals that an I / O exception has occurred . */ public void writeFeatures ( PrintWriter fout ) throws IOException { } }
// write the number of features fout . println ( Integer . toString ( features . size ( ) ) ) ; for ( int i = 0 ; i < features . size ( ) ; i ++ ) { Feature f = ( Feature ) features . get ( i ) ; fout . println ( f . toString ( data . cpInt2Str , data . lbInt2Str ) ) ; } // wirte the line # # # . . . fout . println ( O...
public class DiagnosticsInner { /** * Get Detector . * Get Detector . * @ param resourceGroupName Name of the resource group to which the resource belongs . * @ param siteName Site Name * @ param diagnosticCategory Diagnostic Category * @ param detectorName Detector Name * @ throws IllegalArgumentException ...
return getSiteDetectorSinglePageAsync ( resourceGroupName , siteName , diagnosticCategory , detectorName ) . concatMap ( new Func1 < ServiceResponse < Page < DetectorDefinitionInner > > , Observable < ServiceResponse < Page < DetectorDefinitionInner > > > > ( ) { @ Override public Observable < ServiceResponse < Page < ...
public class UtilConversion { /** * Convert binary array to number representation . * @ param binary The binary to convert ( must not be < code > null < / code > ) . * @ return The number representation . * @ throws LionEngineException If invalid arguments . */ public static int fromBinary ( boolean [ ] binary ) ...
Check . notNull ( binary ) ; int number = 0 ; for ( final boolean current : binary ) { number = number << 1 | boolToInt ( current ) ; } return number ;
public class BulkheadAspect { /** * handle the asynchronous completable future flow * @ param proceedingJoinPoint AOPJoinPoint * @ param bulkhead configured bulkhead * @ return CompletionStage */ private Object handleJoinPointCompletableFuture ( ProceedingJoinPoint proceedingJoinPoint , io . github . resilience4j...
return bulkhead . executeCompletionStage ( ( ) -> { try { return ( CompletionStage < ? > ) proceedingJoinPoint . proceed ( ) ; } catch ( Throwable throwable ) { throw new CompletionException ( throwable ) ; } } ) ;
public class Introspector { /** * Gets the < code > BeanInfo < / code > object which contains the information of the properties , events and methods of the specified bean class . * < ol > * < li > If < code > flag = = IGNORE _ ALL _ BEANINFO < / code > , the < code > Introspector < / code > will ignore all < code >...
if ( flags == USE_ALL_BEANINFO ) { // try to use cache return getBeanInfo ( beanClass ) ; } return getBeanInfoImplAndInit ( beanClass , null , flags ) ;
public class DefaultParameterNameProvider { /** * Add the parameter types to a list of names . * @ param parameterTypes parameterTypes * @ return list of strings */ protected List < String > defaultParameterTypes ( Class < ? > [ ] parameterTypes ) { } }
List < String > names = new ArrayList < > ( ) ; for ( int i = 0 ; i < parameterTypes . length ; i ++ ) { names . add ( "arg" + i ) ; } return names ;
public class StandardFieldsDialog { /** * Sets the given pop up menu to the field with the given label . * The pop up menu is only set to { @ link JComponent } fields . * @ param fieldLabel the label of the field . * @ param popup the pop up menu . * @ since TODO add version * @ see JComponent # setComponentP...
Component c = this . fieldMap . get ( fieldLabel ) ; if ( c != null ) { if ( c instanceof JComponent ) { ( ( JComponent ) c ) . setComponentPopupMenu ( popup ) ; } else { handleUnexpectedFieldClass ( fieldLabel , c ) ; } }
public class CSSDataURL { /** * Get the data content of this Data URL as String . If no String * representation was provided in the constructor , than it is lazily created * inside this method in which case instances of this class are not * thread - safe . If a non - < code > null < / code > String was provided i...
if ( m_sContent == null ) m_sContent = new String ( m_aContent , m_aCharset ) ; return m_sContent ;
public class FilterableTableExample { /** * Helper to create the table column heading ' s WDecoratedLabel . * @ param text The readable text content of the column header * @ param menu The WMenu we want in this column header . * @ return WDecoratedLabel used to create a column heading . */ private WDecoratedLabel...
WDecoratedLabel label = new WDecoratedLabel ( null , new WText ( text ) , menu ) ; return label ;
public class PeerAwareInstanceRegistryImpl { /** * Replicate the < em > ASG status < / em > updates to peer eureka nodes . If this * event is a replication from other nodes , then it is not replicated to * other nodes . * @ param asgName the asg name for which the status needs to be replicated . * @ param newSt...
// If this is replicated from an other node , do not try to replicate again . if ( isReplication ) { return ; } for ( final PeerEurekaNode node : peerEurekaNodes . getPeerEurekaNodes ( ) ) { replicateASGInfoToReplicaNodes ( asgName , newStatus , node ) ; }
public class MethodInfo { /** * Get a list of annotations on this method , along with any annotation parameter values . * @ return a list of annotations on this method , along with any annotation parameter values , wrapped in * { @ link AnnotationInfo } objects , or the empty list if none . */ public AnnotationInfo...
if ( ! scanResult . scanSpec . enableAnnotationInfo ) { throw new IllegalArgumentException ( "Please call ClassGraph#enableAnnotationInfo() before #scan()" ) ; } return annotationInfo == null ? AnnotationInfoList . EMPTY_LIST : AnnotationInfoList . getIndirectAnnotations ( annotationInfo , /* annotatedClass = */ null )...
public class RLogin { /** * Disconnect the rlogin client from the remote host . */ public void disconnect ( ) { } }
try { if ( client . isConnected ( ) ) { client . disconnect ( ) ; } if ( standardInputReaderThread != null ) { standardInputReaderThread = null ; } if ( outputReaderThread != null ) { outputReaderThread . join ( ) ; outputReaderThread = null ; } writer = null ; } catch ( InterruptedException ex ) { } catch ( IOExceptio...
public class Group { /** * read _ attribute _ asynch _ i - access limited to package Group */ @ Override int read_attribute_asynch_i ( final String a , final boolean fwd , final int rid ) throws DevFailed { } }
synchronized ( this ) { final Iterator it = elements . iterator ( ) ; while ( it . hasNext ( ) ) { final GroupElement e = ( GroupElement ) it . next ( ) ; if ( e instanceof GroupDeviceElement || fwd ) { e . read_attribute_asynch_i ( a , fwd , rid ) ; } } return rid ; }
public class IntegerStringBinding { /** * { @ inheritDoc } */ @ Override public Integer unmarshal ( String object ) { } }
return Integer . valueOf ( Integer . parseInt ( object ) ) ;
public class ApnsPayloadBuilder { /** * < p > Sets the key of the subtitle string in the receiving app ' s localized string list to be shown for the push * notification . Clears any previously - set literal subtitle . The message in the app ' s string list may optionally * have placeholders , which will be populate...
this . localizedAlertSubtitleKey = localizedAlertSubtitleKey ; this . localizedAlertSubtitleArguments = ( alertSubtitleArguments != null && alertSubtitleArguments . length > 0 ) ? alertSubtitleArguments : null ; this . alertSubtitle = null ; return this ;
public class Ifc2x3tc1FactoryImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public String convertIfcTimeSeriesScheduleTypeEnumToString ( EDataType eDataType , Object instanceValue ) { } }
return instanceValue == null ? null : instanceValue . toString ( ) ;
public class InstanceClient { /** * Retrieves aggregated list of all of the instances in your project across all regions and zones . * < p > Sample code : * < pre > < code > * try ( InstanceClient instanceClient = InstanceClient . create ( ) ) { * ProjectName project = ProjectName . of ( " [ PROJECT ] " ) ; *...
AggregatedListInstancesHttpRequest request = AggregatedListInstancesHttpRequest . newBuilder ( ) . setProject ( project == null ? null : project . toString ( ) ) . build ( ) ; return aggregatedListInstances ( request ) ;
public class IRI_CustomFieldSerializer { /** * Deserializes the content of the object from the * { @ link com . google . gwt . user . client . rpc . SerializationStreamReader } . * @ param streamReader the { @ link com . google . gwt . user . client . rpc . SerializationStreamReader } to read the * object ' s con...
deserialize ( streamReader , instance ) ;
public class JdbcCpoXaAdapter { /** * Update the Object in the datasource . The CpoAdapter will check to see if the object exists in the datasource . If it * exists then the object will be updated . If it does not exist , an exception will be thrown * < pre > Example : * < code > * class SomeObject so = new Som...
return getCurrentResource ( ) . updateObject ( name , obj ) ;
public class LdapDirectory { /** * If the named property is present and has a value use that . * Otherwise , set the value to the given default and use that . * @ param pr * @ param name * @ param defaultVal * @ return String */ public String checkProp ( final Properties pr , final String name , final String ...
String val = pr . getProperty ( name ) ; if ( val == null ) { pr . put ( name , defaultVal ) ; val = defaultVal ; } return val ;
public class LightblueHttpClient { /** * ( non - Javadoc ) * @ see com . redhat . lightblue . client . LightblueClient # data ( com . redhat . lightblue . client . request . LightblueRequest ) */ @ Override public DefaultLightblueDataResponse data ( LightblueDataRequest lightblueRequest ) throws LightblueParseExcepti...
if ( ! lightblueRequest . hasExecution ( ) ) { lightblueRequest . execution ( configuration . getExecution ( ) ) ; } HttpResponse response = callService ( lightblueRequest , configuration . getDataServiceURI ( ) ) ; return new DefaultLightblueDataResponse ( response . getBody ( ) , response . getHeaders ( ) , mapper ) ...
public class NumberConverter { /** * STATE SAVE / RESTORE */ public void restoreState ( FacesContext facesContext , Object state ) { } }
if ( state != null ) { Object values [ ] = ( Object [ ] ) state ; _currencyCode = ( String ) values [ 0 ] ; _currencySymbol = ( String ) values [ 1 ] ; _locale = ( Locale ) values [ 2 ] ; Integer value = ( Integer ) values [ 3 ] ; _maxFractionDigits = value != null ? value . intValue ( ) : 0 ; value = ( Integer ) value...
public class TreeInfo { /** * Skip parens and return the enclosed expression */ public static JCTree skipParens ( JCTree tree ) { } }
if ( tree . hasTag ( PARENS ) ) return skipParens ( ( JCParens ) tree ) ; else return tree ;
public class ClientProxyImpl { /** * CHECKSTYLE : OFF */ private Object doChainedInvocation ( URI uri , MultivaluedMap < String , String > headers , OperationResourceInfo ori , Object [ ] methodParams , Object body , int bodyIndex , Exchange exchange , Map < String , Object > invocationContext ) throws Throwable { } }
// CHECKSTYLE : ON Bus configuredBus = getConfiguration ( ) . getBus ( ) ; Bus origBus = BusFactory . getAndSetThreadDefaultBus ( configuredBus ) ; ClassLoaderHolder origLoader = null ; try { ClassLoader loader = configuredBus . getExtension ( ClassLoader . class ) ; if ( loader != null ) { origLoader = ClassLoaderUtil...
public class VersionRegEx { /** * Compares two Versions with additionally considering the build meta data field if * all other parts are equal . Note : This is < em > not < / em > part of the semantic version * specification . * Comparison of the build meta data parts happens exactly as for pre release * identi...
// throw NPE to comply with Comparable specification if ( v1 == null ) { throw new NullPointerException ( "v1 is null" ) ; } else if ( v2 == null ) { throw new NullPointerException ( "v2 is null" ) ; } return compare ( v1 , v2 , true ) ;
public class GetBuiltinIntentResult { /** * An array of < code > BuiltinIntentSlot < / code > objects , one entry for each slot type in the intent . * @ param slots * An array of < code > BuiltinIntentSlot < / code > objects , one entry for each slot type in the intent . */ public void setSlots ( java . util . Coll...
if ( slots == null ) { this . slots = null ; return ; } this . slots = new java . util . ArrayList < BuiltinIntentSlot > ( slots ) ;
public class GenerateAsyncMojo { /** * Determine if a client service method is deprecated . * @ see MGWT - 352 */ private boolean isDeprecated ( JavaMethod method ) { } }
if ( method == null ) return false ; for ( Annotation annotation : method . getAnnotations ( ) ) { if ( "java.lang.Deprecated" . equals ( annotation . getType ( ) . getFullyQualifiedName ( ) ) ) { return true ; } } return method . getTagByName ( "deprecated" ) != null ;
public class Matth { /** * Returns the smallest power of two greater than or equal to { @ code x } . This is equivalent to * { @ code checkedPow ( 2 , log2 ( x , CEILING ) ) } . * @ throws IllegalArgumentException if { @ code x < = 0} * @ throws ArithmeticException of the next - higher power of two is not represe...
checkPositive ( "x" , x ) ; if ( x > MAX_SIGNED_POWER_OF_TWO ) { throw new ArithmeticException ( "ceilingPowerOfTwo(" + x + ") is not representable as a long" ) ; } return 1L << - Long . numberOfLeadingZeros ( x - 1 ) ;
public class NewConnectionInitialReadCallback { /** * invoke discrimination process . * @ param inVC * @ param req * @ param errorOnRead */ private void sendToDiscriminators ( VirtualConnection inVC , TCPReadRequestContext req , boolean errorOnRead ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "sendToDiscriminators" ) ; } boolean doAgain ; req . setJITAllocateSize ( 0 ) ; // JIT Allocate was on for the initial read , // reset it TCPConnLink conn = ( ( TCPReadRequestContextImpl ) req ) . getTCPConnLink ( ) ; Virtual...
public class HelpFormatter { /** * Prints the usage statement for the specified application . * @ param pw The PrintWriter to print the usage statement * @ param width The number of characters to display per line * @ param app The application name * @ param options The command line Options */ public void printU...
// initialise the string buffer StringBuffer buff = new StringBuffer ( getSyntaxPrefix ( ) ) . append ( app ) . append ( " " ) ; // create a list for processed option groups Collection < OptionGroup > processedGroups = new ArrayList < OptionGroup > ( ) ; List < Option > optList = new ArrayList < Option > ( options . ge...
public class UriUtil { /** * Get the path of a file from the Uri . * @ param contentResolver the content resolver which will query for the source file * @ param srcUri The source uri * @ return The Path for the file or null if doesn ' t exists */ @ Nullable public static String getRealPathFromUri ( ContentResolve...
String result = null ; if ( isLocalContentUri ( srcUri ) ) { Cursor cursor = null ; try { cursor = contentResolver . query ( srcUri , null , null , null , null ) ; if ( cursor != null && cursor . moveToFirst ( ) ) { int idx = cursor . getColumnIndex ( MediaStore . Images . ImageColumns . DATA ) ; if ( idx != - 1 ) { re...
public class AfplibFactoryImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public String convertWindowSpecificationCFORMATToString ( EDataType eDataType , Object instanceValue ) { } }
return instanceValue == null ? null : instanceValue . toString ( ) ;
public class GenericLogicDiscoverer { /** * Generic implementation for finding all the Services or Operations that have one specific type as input or output . * @ param entityType the MSM URI of the type of entity we are looking for . Only supports Service and Operation . * @ param relationship the MSM URI of the r...
Set < URI > entities = ImmutableSet . of ( ) ; // Deal with services if ( entityType . toASCIIString ( ) . equals ( MSM . Service . getURI ( ) ) ) { // Get the adequate type if ( relationship . toASCIIString ( ) . equals ( MSM . hasInput . getURI ( ) ) ) { entities = this . serviceManager . listServicesWithInputType ( ...
public class Job { /** * Perform log rotation . */ public void logRotate ( ) throws IOException , InterruptedException { } }
BuildDiscarder bd = getBuildDiscarder ( ) ; if ( bd != null ) bd . perform ( this ) ;
public class CmisConnector { /** * Converts binary content into JCR node . * @ param id the id of the CMIS document . * @ return JCR node representation . */ private Document cmisContent ( String id ) { } }
DocumentWriter writer = newDocument ( ObjectId . toString ( ObjectId . Type . CONTENT , id ) ) ; org . apache . chemistry . opencmis . client . api . Document doc = ( org . apache . chemistry . opencmis . client . api . Document ) session . getObject ( id ) ; writer . setPrimaryType ( NodeType . NT_RESOURCE ) ; writer ...
public class MetaClassImpl { /** * Invoke a missing method on the given object with the given arguments . * @ param instance The object the method should be invoked on . * @ param methodName The name of the method to invoke . * @ param arguments The arguments to the invoked method . * @ return The result of the...
return invokeMissingMethod ( instance , methodName , arguments , null , false ) ;
public class CollapseSpliterator { /** * l + < first | acc | ? > */ private R pushLeft ( T first , R acc ) { } }
synchronized ( root ) { Connector < T , R > l = left ; if ( l == null ) return acc ; left = null ; l . rhs = null ; T laright = l . right ; l . right = none ( ) ; if ( l . acc == NONE ) { l . acc = acc ; l . left = first ; return none ( ) ; } if ( this . mergeable . test ( laright , first ) ) { l . acc = this . combine...
public class Model { /** * Sets attribute value as < code > java . sql . Date < / code > . * If there is a { @ link Converter } registered for the attribute that converts from Class < code > S < / code > to Class * < code > java . sql . Date < / code > , given the value is an instance of < code > S < / code > , the...
Converter < Object , java . sql . Date > converter = modelRegistryLocal . converterForValue ( attributeName , value , java . sql . Date . class ) ; return setRaw ( attributeName , converter != null ? converter . convert ( value ) : Convert . toSqlDate ( value ) ) ;
public class Strings { /** * Fixes case of a word : Str becomes str , but URL stays URL . * @ param s Word to be fixed * @ return all - lowercase or all - uppercase word . */ public static String fixCase ( String s ) { } }
if ( s == null || s . length ( ) == 0 ) { return s ; } if ( Character . isUpperCase ( s . charAt ( 0 ) ) && ( s . length ( ) == 1 || Character . isLowerCase ( s . charAt ( 1 ) ) ) ) { s = s . toLowerCase ( ) ; } return s ;
public class MetricAggregator { /** * Retrieves the specified metric for the current minute * @ param metric The metric identity * @ return The metric aggregate for the metric at the current minute */ private MetricAggregate getAggregate ( final MetricIdentity identity ) { } }
// get the map from utc minute to aggregate for this metric if ( ! aggregates . containsKey ( identity ) ) { aggregates . put ( identity , new HashMap < Long , MetricAggregate > ( ) ) ; } Map < Long , MetricAggregate > metricAggregates = aggregates . get ( identity ) ; // get the aggregate for this minute if ( ! metric...
public class CassandraJavaPairRDD { /** * Returns a copy of this RDD with connector changed to the specified one . */ @ SuppressWarnings ( "unchecked" ) public CassandraJavaPairRDD < K , V > withConnector ( CassandraConnector connector ) { } }
CassandraRDD < Tuple2 < K , V > > newRDD = rdd ( ) . withConnector ( connector ) ; return wrap ( newRDD ) ;
public class XmlInputStream { /** * Keep track of what we ' ve given them . * @ param s the sequence of characters given * @ param wanted the number of characters wanted * @ param got the number of characters given */ private void given ( CharSequence s , int wanted , int got ) { } }
red . append ( s ) ; given += got ; LOGGER . trace ( "Given: [" + wanted + "," + got + "]-" + s ) ;
public class HandlablesImpl { /** * Remove the object from its type list . * @ param type The type reference . * @ param object The object reference . */ private void remove ( Class < ? > type , Object object ) { } }
final Set < ? > set = items . get ( type ) ; if ( set != null ) { set . remove ( object ) ; }
public class SparseCpuLevel1 { /** * Find the index of the element with minimum absolute value * @ param N The number of elements in vector X * @ param X a vector * @ param incX The increment of X * @ return the index of the element with minimum absolute value */ @ Override protected int isamin ( long N , INDAr...
return ( int ) cblas_isamin ( ( int ) N , ( FloatPointer ) X . data ( ) . addressPointer ( ) , incX ) ;
public class PublishedTrackReader { /** * Add the requested query string arguments to the Request . * @ param request Request to add query string arguments to */ private void addQueryParams ( final Request request ) { } }
if ( getPageSize ( ) != null ) { request . addQueryParam ( "PageSize" , Integer . toString ( getPageSize ( ) ) ) ; }
public class HebrewCalendar { /** * Returns the length of the given month in the given year */ protected int handleGetMonthLength ( int extendedYear , int month ) { } }
// Resolve out - of - range months . This is necessary in order to // obtain the correct year . We correct to // a 12 - or 13 - month year ( add / subtract 12 or 13 , depending // on the year ) but since we _ always _ number from 0 . . 12 , and // the leap year determines whether or not month 5 ( Adar 1) // is present ...
public class ZCertStore { /** * check if a z85 - based public key is in the certificate store . * This method will scan the folder for changes on every call * @ param publicKey */ public boolean containsPublicKey ( String publicKey ) { } }
Utils . checkArgument ( publicKey . length ( ) == 40 , "z85 publickeys should have a length of 40 bytes but got " + publicKey . length ( ) ) ; reloadIfNecessary ( ) ; return publicKeys . containsKey ( publicKey ) ;
public class DockerComputerLauncher { /** * Wait until slave is up and ready for connection . */ public boolean waitUp ( String cloudId , DockerSlaveTemplate dockerSlaveTemplate , InspectContainerResponse containerInspect ) { } }
if ( isFalse ( containerInspect . getState ( ) . getRunning ( ) ) ) { throw new IllegalStateException ( "Container '" + containerInspect . getId ( ) + "' is not running!" ) ; } return true ;
public class MessageFieldDesc { /** * Move the pertinenent information from the request to this reply message . * Override this to be more specific . * Add some code like : this . put ( messageRequest . get ( ) ) ; */ public void moveRequestInfoToReply ( Message messageRequest ) { } }
super . moveRequestInfoToReply ( messageRequest ) ; if ( ( this . getKeyInformation ( ) & ECHO_PARAM ) != 0 ) { // Move this to reply this . put ( ( ( BaseMessage ) messageRequest ) . get ( this . getFullKey ( null ) ) ) ; }
public class ProcessorStylesheetElement { /** * Receive notification of the end of an element . * @ param handler non - null reference to current StylesheetHandler that is constructing the Templates . * @ param uri The Namespace URI , or an empty string . * @ param localName The local name ( without prefix ) , or...
super . endElement ( handler , uri , localName , rawName ) ; handler . popElemTemplateElement ( ) ; handler . popStylesheet ( ) ;
public class Executable { /** * Launches a browser opening an URL . * @ param url the URL you want to open in the browser * @ throws IOException */ public static final void launchBrowser ( String url ) throws IOException { } }
try { if ( isMac ( ) ) { Class macUtils = Class . forName ( "com.apple.mrj.MRJFileUtils" ) ; Method openURL = macUtils . getDeclaredMethod ( "openURL" , new Class [ ] { String . class } ) ; openURL . invoke ( null , new Object [ ] { url } ) ; } else if ( isWindows ( ) ) Runtime . getRuntime ( ) . exec ( "rundll32 url.d...
public class UberData { /** * Transform the payload of a { @ link EntityModel } into { @ link UberData } . * @ param obj * @ return */ private static List < UberData > extractProperties ( Object obj ) { } }
if ( PRIMITIVE_TYPES . contains ( obj . getClass ( ) ) ) { return Collections . singletonList ( new UberData ( ) . withValue ( obj ) ) ; } return PropertyUtils . findProperties ( obj ) . entrySet ( ) . stream ( ) . map ( entry -> new UberData ( ) . withName ( entry . getKey ( ) ) . withValue ( entry . getValue ( ) ) ) ...
public class SearcherFactory { /** * Creates an instance of the Searcher interface implementing the searching algorithm based on the SearchType , * otherwise returns the provided default Searcher implementation if a Searcher based on the specified SearchType * is not available . * @ param < T > the Class type of ...
try { return createSearcher ( type ) ; } catch ( IllegalArgumentException ignore ) { return defaultSearcher ; }
public class CoordinatorAccessor { /** * Left is error Right is Tuple < dimensions , metrics > * @ param name * @ param reqHeaders * @ return */ public Either < String , Tuple2 < List < String > , List < String > > > aboutDataSource ( String name , Map < String , String > reqHeaders ) { } }
Either < String , Either < JSONArray , JSONObject > > resp = fireCommand ( "druid/coordinator/v1/metadata/datasources/" + name , null , reqHeaders ) ; if ( resp . isLeft ( ) ) { return new Left < > ( resp . left ( ) . get ( ) ) ; } Either < JSONArray , JSONObject > goodResp = resp . right ( ) . get ( ) ; if ( goodResp ...
public class AssignedDiscountUrl { /** * Get Resource Url for GetAssignedDiscounts * @ param couponSetCode The unique identifier of the coupon set . * @ return String Resource Url */ public static MozuUrl getAssignedDiscountsUrl ( String couponSetCode ) { } }
UrlFormatter formatter = new UrlFormatter ( "/api/commerce/catalog/admin/couponsets/{couponSetCode}/assigneddiscounts" ) ; formatter . formatUrl ( "couponSetCode" , couponSetCode ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ;
public class YamlConfigurationParser { /** * Merges configurations from an Object into an existing Map . * @ param configurationMap * @ param parsed */ @ SuppressWarnings ( "unchecked" ) private void mergeConfigs ( Map < String , Map < String , ? > > configurationMap , Object parsed ) { } }
if ( parsed instanceof Map ) { Map < ? , ? > parsedMap = ( Map < ? , ? > ) parsed ; for ( Object key : parsedMap . keySet ( ) ) { if ( key instanceof String ) { Map < String , Object > existingValue = ( Map < String , Object > ) configurationMap . get ( ( String ) key ) ; if ( ! configurationMap . containsKey ( ( Strin...
public class Utils { /** * Converts a Heron Config object into a TopologyAPI . Config . Builder . Config entries with null * keys or values are ignored . * @ param config heron Config object * @ return TopologyAPI . Config . Builder with values loaded from config */ public static TopologyAPI . Config . Builder ge...
TopologyAPI . Config . Builder cBldr = TopologyAPI . Config . newBuilder ( ) ; Set < String > apiVars = config . getApiVars ( ) ; for ( String key : config . keySet ( ) ) { if ( key == null ) { LOG . warning ( "ignore: null config key found" ) ; continue ; } Object value = config . get ( key ) ; if ( value == null ) { ...
public class ExpectValues { /** * Find the enumerated object that matchs the input name using the given * offset and length into that name . If none exist , then a null value is * returned . * @ param name * @ param offset * - starting point in that name * @ param length * - length to use from that starti...
if ( null == name ) return null ; return ( ExpectValues ) myMatcher . match ( name , offset , length ) ;
public class SecurityCenterClient { /** * Gets the settings for an organization . * < p > Sample code : * < pre > < code > * try ( SecurityCenterClient securityCenterClient = SecurityCenterClient . create ( ) ) { * OrganizationSettingsName name = OrganizationSettingsName . of ( " [ ORGANIZATION ] " ) ; * Orga...
GetOrganizationSettingsRequest request = GetOrganizationSettingsRequest . newBuilder ( ) . setName ( name ) . build ( ) ; return getOrganizationSettings ( request ) ;
public class ChatService { /** * Sets the listening state of the service . When set to false , the service stops listening to * all events . * @ param active The active state . */ public void setActive ( boolean active ) { } }
if ( this . active != active ) { this . active = active ; inviteListener . setActive ( active ) ; acceptListener . setActive ( active ) ; participants . clear ( ) ; participants . add ( self ) ; participantListener . setActive ( active ) ; }
public class CliClient { /** * Process get operation with conditions ( using Thrift get _ indexed _ slices method ) * @ param statement - tree representation of the current statement * Format : ^ ( NODE _ THRIFT _ GET _ WITH _ CONDITIONS cf ^ ( CONDITIONS ^ ( CONDITION > = column1 value1 ) . . . ) ^ ( NODE _ LIMIT ...
if ( ! CliMain . isConnected ( ) || ! hasKeySpace ( ) ) return ; long startTime = System . nanoTime ( ) ; IndexClause clause = new IndexClause ( ) ; String columnFamily = CliCompiler . getColumnFamily ( statement , currentCfDefs ( ) ) ; // ^ ( CONDITIONS ^ ( CONDITION $ column $ value ) . . . ) Tree conditions = statem...
public class BaseQuartzJob { /** * Utility method to extract a Spring Bean from the Spring * { @ link ApplicationContext } that is supplied in the Quartz * { @ link JobExecutionContext } . The method is parameterized to use dynamic * typing . * @ param < T > * the bean type * @ param clazz * the { @ link ...
if ( this . applicationContext != null ) { return ( T ) this . applicationContext . getBean ( clazz ) ; } return null ;
public class TemplateClassLoader { /** * Detect Template changes */ public void detectChanges ( ) { } }
if ( engine . isProdMode ( ) ) return ; // Now check for file modification List < TemplateClass > modifieds = new ArrayList < TemplateClass > ( ) ; for ( TemplateClass tc : engine . classes ( ) . all ( ) ) { if ( tc . refresh ( ) ) modifieds . add ( tc ) ; } Set < TemplateClass > modifiedWithDependencies = new HashSet ...
public class DataSet { /** * Strips the dataset down to the specified labels * and remaps them * @ param labels the labels to strip down to */ @ Override public void filterAndStrip ( int [ ] labels ) { } }
DataSet filtered = filterBy ( labels ) ; List < Integer > newLabels = new ArrayList < > ( ) ; // map new labels to index according to passed in labels Map < Integer , Integer > labelMap = new HashMap < > ( ) ; for ( int i = 0 ; i < labels . length ; i ++ ) labelMap . put ( labels [ i ] , i ) ; // map examples for ( int...
public class ReplicationLinksInner { /** * Sets which replica database is primary by failing over from the current primary replica database . * @ param resourceGroupName The name of the resource group that contains the resource . You can obtain this value from the Azure Resource Manager API or the portal . * @ para...
beginFailoverWithServiceResponseAsync ( resourceGroupName , serverName , databaseName , linkId ) . toBlocking ( ) . single ( ) . body ( ) ;
public class Metrics { /** * Reports an event to < code > meter < / code > described by given parameters . * @ param metrics - { @ link Metrics } instance with { @ link MetricRegistry } initialized . * @ param component - part of metric description . * @ param methodName - part of metric description . * @ param...
if ( metrics != null ) { mark ( metrics . getMeter ( component , methodName , eventType ) ) ; }
public class PluralRulePrinter { /** * Print each child node of a struct , joining them together with a * delimiter string . */ private static void join ( StringBuilder buf , Node < PluralType > parent , String delimiter ) { } }
List < Node < PluralType > > nodes = parent . asStruct ( ) . nodes ( ) ; int size = nodes . size ( ) ; for ( int i = 0 ; i < size ; i ++ ) { if ( i > 0 ) { buf . append ( delimiter ) ; } print ( buf , nodes . get ( i ) ) ; }
public class AbstractImmutableMapBuilder { /** * Create a delta consisting of defaults to register . * @ param defaults * default entries . * @ return delta */ protected final MapDelta < K , V > genDefaults ( final Map < K , ? extends V > defaults ) { } }
return defaults . isEmpty ( ) ? Nop . instance ( ) : new Defaults < > ( defaults ) ;
public class MergeRequestApi { /** * Get information about a single merge request . * < p > NOTE : GitLab API V4 uses IID ( internal ID ) , V3 uses ID to identify the merge request . < / p > * < pre > < code > GitLab Endpoint : GET / projects / : id / merge _ requests / : merge _ request _ id < / code > < / pre > ...
Response response = get ( Response . Status . OK , null , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "merge_requests" , mergeRequestIid ) ; return ( response . readEntity ( MergeRequest . class ) ) ;
public class DBRef { /** * Append the PDB representation of this DBRef to the provided StringBuffer * @ param buf the StringBuffer to write to . */ @ Override public void toPDB ( StringBuffer buf ) { } }
Formatter formatter = new Formatter ( new StringBuilder ( ) , Locale . UK ) ; // DBREF 3ETA A 990 1295 UNP P06213 INSR _ HUMAN 1017 1322 // DBREF 3EH2 A 2 767 UNP P53992 SC24C _ HUMAN 329 1094 // DBREF 3EH2 A 2 767 UNP P53992 SC24C _ HUMAN 329 1094 // DBREF 3ETA A 990 1295 UNP P06213 INSR _ HUMAN 1017 1322 formatter . ...
public class CmsSecurityManager { /** * Reads a group based on its id . < p > * @ param context the current request context * @ param groupId the id of the group that is to be read * @ return the requested group * @ throws CmsException if operation was not successful */ public CmsGroup readGroup ( CmsRequestCon...
CmsDbContext dbc = m_dbContextFactory . getDbContext ( context ) ; CmsGroup result = null ; try { result = m_driverManager . readGroup ( dbc , groupId ) ; } catch ( Exception e ) { dbc . report ( null , Messages . get ( ) . container ( Messages . ERR_READ_GROUP_FOR_ID_1 , groupId . toString ( ) ) , e ) ; } finally { db...
public class ElevationUtil { /** * Creates and returns a bitmap , which can be used to emulate a shadow , which is located at a * corner of an elevated view on pre - Lollipop devices . * @ param context * The context , which should be used , as an instance of the class { @ link Context } . The * context may not...
if ( elevation == 0 ) { return null ; } else { float shadowWidth = getShadowWidth ( context , elevation , orientation , parallelLight ) ; int shadowColor = getShadowColor ( elevation , orientation , parallelLight ) ; int bitmapWidth = ( int ) Math . round ( ( orientation == Orientation . LEFT || orientation == Orientat...