signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class DescribeConfigurationOptionsRequest { /** * If specified , restricts the descriptions to only the specified options . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setOptions ( java . util . Collection ) } or { @ link # withOptions ( java . uti...
if ( this . options == null ) { setOptions ( new com . amazonaws . internal . SdkInternalList < OptionSpecification > ( options . length ) ) ; } for ( OptionSpecification ele : options ) { this . options . add ( ele ) ; } return this ;
public class DefaultCorsProcessor { /** * Invoked when one of the CORS checks failed . * The default implementation sets the response status to 403. * @ param translet the Translet instance * @ param ce the CORS Exception * @ throws CorsException if the request is denied */ protected void rejectRequest ( Transl...
HttpServletResponse res = translet . getResponseAdaptee ( ) ; res . setStatus ( ce . getHttpStatusCode ( ) ) ; translet . setAttribute ( CORS_HTTP_STATUS_CODE , ce . getHttpStatusCode ( ) ) ; translet . setAttribute ( CORS_HTTP_STATUS_TEXT , ce . getMessage ( ) ) ; throw ce ;
public class CreateClientVpnRouteRequest { /** * This method is intended for internal use only . Returns the marshaled request configured with additional * parameters to enable operation dry - run . */ @ Override public Request < CreateClientVpnRouteRequest > getDryRunRequest ( ) { } }
Request < CreateClientVpnRouteRequest > request = new CreateClientVpnRouteRequestMarshaller ( ) . marshall ( this ) ; request . addParameter ( "DryRun" , Boolean . toString ( true ) ) ; return request ;
public class SServerPlayer { /** * Connects to the server via AbstractUDPClient . * @ param isGoalie a boolean . */ public void connect ( boolean isGoalie ) { } }
CommandFactory f = new CommandFactory ( ) ; f . addPlayerInitCommand ( teamName , isGoalie ) ; initMessage = f . next ( ) ; super . start ( ) ;
public class ResultSetGenerator { /** * Generates DRL from a data provider for the spreadsheet data and templates . * @ param rs the resultset for the table data * @ param templateStream the InputStream for reading the templates * @ return the generated DRL text as a String */ public String compile ( final Result...
TemplateContainer tc = new DefaultTemplateContainer ( templateStream ) ; closeStream ( templateStream ) ; return compile ( rs , new TemplateDataListener ( tc ) ) ;
public class SibDiagnosticModule { /** * Generates a String representation of a Object [ ] , calling toFFDCStringObject for the first multiple _ object _ count _ to _ ffdc * elements * @ param objects * @ return the string representation of the Object [ ] */ public final String toFFDCString ( Object [ ] objects )...
StringBuffer buffer = new StringBuffer ( ) ; buffer . append ( '{' ) ; if ( objects == null ) { buffer . append ( "<null>" ) ; } else { for ( int i = 0 ; i < objects . length ; i ++ ) { Object value = objects [ i ] ; buffer . append ( ( value == objects ? "<this array>" : toFFDCStringSingleObject ( value ) ) + lineSepa...
public class MappingJobConfig { /** * The MappingJob Factory bean . */ @ Bean public JobFactory < MappingJobExecution > mappingJobFactory ( ) { } }
return new JobFactory < MappingJobExecution > ( ) { @ Override public Job createJob ( MappingJobExecution mappingJobExecution ) { final String mappingProjectId = mappingJobExecution . getMappingProjectId ( ) ; final String targetEntityTypeId = mappingJobExecution . getTargetEntityTypeId ( ) ; final String packageId = m...
public class JPAPUnitInfo { /** * Determine if the input class needs persistence provider class transformation using * a pre - defined regular expression filter . */ private final boolean classNeedsTransform ( String className ) { } }
final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "classNeedsTransform : PUID = " + ivArchivePuId + ", class name = " + className ) ; // d454146 } boolean rtnVal = true ; for ( Pattern regex : transformExclusionPatterns ) { if ( regex . ...
public class h2omapper { private void subPath ( String prop , Properties sslProps , String ice_root ) { } }
String path = sslProps . getProperty ( prop ) ; // Change only auto generated path . Don ' t allow the user to use " h2o - internal . jks " as path if ( null != path && "h2o-internal.jks" . equals ( path ) ) { sslProps . setProperty ( prop , ice_root + File . separator + path ) ; }
public class Reflection { /** * Gets all methods annotated by annotation . * @ param classs class to get fields from * @ param ann annotation that must be present on the method * @ return set of methods */ public static Set < Method > getMethodsAnnotatedBy ( Class < ? > classs , Class < ? extends Annotation > ann...
Set < Method > set = new HashSet < > ( ) ; for ( Method method : getAllMethods ( classs ) ) { if ( method . isAnnotationPresent ( ann ) ) { set . add ( method ) ; } } return set ;
public class BaseMessageFilter { /** * Get the message listener for this filter . * @ return The listener . */ public JMessageListener getMessageListener ( int iIndex ) { } }
if ( m_vListenerList == null ) return null ; if ( iIndex >= m_vListenerList . size ( ) ) return null ; return m_vListenerList . get ( iIndex ) ;
public class JavaProcessExecutor { /** * Forks and executes the given Java { @ link File JAR File } in the { @ link File current working directory } * of the currently executing Java { @ link Process } , passing the provided array of { @ link String arguments } * on the command - line to the Java program . * @ pa...
return execute ( FileSystemUtils . WORKING_DIRECTORY , jarFile , args ) ;
public class DefaultConstraintsCatalog { /** * Build a catalog with a builder for every constraints * in the current BtrPlace bundle . * @ return a fulfilled catalog */ public static DefaultConstraintsCatalog newBundle ( ) { } }
DefaultConstraintsCatalog c = new DefaultConstraintsCatalog ( ) ; c . add ( new AmongBuilder ( ) ) ; c . add ( new BanBuilder ( ) ) ; c . add ( new ResourceCapacityBuilder ( ) ) ; c . add ( new RunningCapacityBuilder ( ) ) ; c . add ( new FenceBuilder ( ) ) ; c . add ( new GatherBuilder ( ) ) ; c . add ( new KilledBuil...
public class DefaultElement { /** * / * ( non - Javadoc ) * @ see tuwien . auto . calimero . xml . Element # getAttribute ( java . lang . String ) */ public final String getAttribute ( String name ) { } }
synchronized ( attributes ) { for ( final Iterator i = attributes . iterator ( ) ; i . hasNext ( ) ; ) { final Attribute a = ( Attribute ) i . next ( ) ; if ( a . getName ( ) . equals ( name ) ) return a . getValue ( ) ; } } return null ;
public class JcrResultSet { /** * { @ inheritDoc } * This method , when called on an open result set , always throws { @ link SQLFeatureNotSupportedException } since this JDBC * driver does not support any updates . * @ see java . sql . ResultSet # updateNCharacterStream ( java . lang . String , java . io . Reade...
notClosed ( ) ; noUpdates ( ) ;
public class ZipFileIndexCache { /** * Get a context - specific instance of a cache . */ public static ZipFileIndexCache instance ( Context context ) { } }
ZipFileIndexCache instance = context . get ( ZipFileIndexCache . class ) ; if ( instance == null ) context . put ( ZipFileIndexCache . class , instance = new ZipFileIndexCache ( ) ) ; return instance ;
public class Variables { /** * Creates an untyped value , i . e . { @ link TypedValue # getType ( ) } returns < code > null < / code > * for the returned instance . */ public static TypedValue untypedValue ( Object value , boolean isTransient ) { } }
if ( value == null ) { return untypedNullValue ( isTransient ) ; } else if ( value instanceof TypedValueBuilder < ? > ) { return ( ( TypedValueBuilder < ? > ) value ) . setTransient ( isTransient ) . create ( ) ; } else if ( value instanceof TypedValue ) { TypedValue transientValue = ( TypedValue ) value ; if ( value i...
public class LoadStatistics { /** * Updates all the series from the current snapshot . * @ param current the current snapshot . * @ since 1.607 */ protected void updateCounts ( LoadStatisticsSnapshot current ) { } }
definedExecutors . update ( current . getDefinedExecutors ( ) ) ; onlineExecutors . update ( current . getOnlineExecutors ( ) ) ; connectingExecutors . update ( current . getConnectingExecutors ( ) ) ; busyExecutors . update ( current . getBusyExecutors ( ) ) ; idleExecutors . update ( current . getIdleExecutors ( ) ) ...
public class MainForm { /** * Create the file filters so that we do have them for * the dialogs * @ since 05.01.2008 */ private void createFileFilter ( ) { } }
HashMap < String , String [ ] > extensionMap = MultimediaContainerManager . getSupportedFileExtensionsPerContainer ( ) ; ArrayList < FileFilter > chooserFilterArray = new ArrayList < FileFilter > ( extensionMap . size ( ) + 1 ) ; // add all single file extensions grouped by container Set < String > containerNameSet = e...
public class ConnectionDAODefaultImpl { public DevSource get_source ( final Connection connection ) throws DevFailed { } }
if ( is_taco ( connection ) ) { if ( connection . taco_device == null ) { connection . taco_device = new TacoTangoDevice ( connection . devname , connection . url . host ) ; } return connection . taco_device . get_source ( ) ; } else { return connection . dev_src ; }
public class SerializationClass { /** * Get an attribute by its name . */ public Attribute getAttributeByName ( String name ) { } }
for ( Attribute a : attributes ) if ( name . equals ( a . getName ( ) ) ) return a ; return null ;
public class SSLChannel { /** * Close the inbound and outbound sides of the engine created during the * discrimination path . This engine was not used during an actual connection , * only the discrimination , as such , it has no data to flush . * @ param engine */ private void closeEngine ( SSLEngine engine ) { }...
// PK13349 - close the engine we created during discrimination . We do not // need to flush any data however if ( null != engine ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Closing discrimination engine" ) ; } engine . closeOutbound ( ) ; if ( ! engine . isInbound...
public class ApplicationsImpl { /** * Lists all of the applications available in the specified account . * This operation returns only applications and versions that are available for use on compute nodes ; that is , that can be used in an application package reference . For administrator information about applicatio...
ServiceResponseWithHeaders < Page < ApplicationSummary > , ApplicationListHeaders > response = listSinglePageAsync ( ) . toBlocking ( ) . single ( ) ; return new PagedList < ApplicationSummary > ( response . body ( ) ) { @ Override public Page < ApplicationSummary > nextPage ( String nextPageLink ) { return listNextSin...
public class BytesRange { /** * Checks whether a provided range is within this one . * @ return true if the provided range is within this one , false if given null */ public boolean contains ( @ Nullable BytesRange compare ) { } }
if ( compare == null ) { return false ; } return from <= compare . from && to >= compare . to ;
public class MaxGauge { /** * Update the max for the given index if the provided value is larger than the current max . */ private void updateMax ( int idx , long v ) { } }
AtomicLong current = max . getCurrent ( idx ) ; long m = current . get ( ) ; while ( v > m ) { if ( current . compareAndSet ( m , v ) ) { break ; } m = current . get ( ) ; }
public class ResourceAdapterService { /** * Returns the class loader for the resource adapter . * @ return class loader * @ throws UnableToAdaptException * @ throws MalformedURLException */ public ClassLoader getClassLoader ( ) throws UnableToAdaptException , MalformedURLException { } }
lock . readLock ( ) . lock ( ) ; try { if ( classloader != null ) return classloader ; } finally { lock . readLock ( ) . unlock ( ) ; } if ( ! rarFileExists ( ) ) return null ; lock . writeLock ( ) . lock ( ) ; try { if ( classloader == null ) { classloader = createRarClassLoader ( ) ; } return classloader ; } finally ...
public class BoxApiFile { /** * Gets a request that permanently deletes a file from the trash * @ param id id of file to delete from the trash * @ return request to permanently delete a file from the trash */ public BoxRequestsFile . DeleteTrashedFile getDeleteTrashedFileRequest ( String id ) { } }
BoxRequestsFile . DeleteTrashedFile request = new BoxRequestsFile . DeleteTrashedFile ( id , getTrashedFileUrl ( id ) , mSession ) ; return request ;
public class Matrix4f { /** * Set this matrix to a mirror / reflection transformation that reflects about the given plane * specified via the equation < code > x * a + y * b + z * c + d = 0 < / code > . * The vector < code > ( a , b , c ) < / code > must be a unit vector . * Reference : < a href = " https : / / m...
float da = a + a , db = b + b , dc = c + c , dd = d + d ; this . _m00 ( 1.0f - da * a ) ; this . _m01 ( - da * b ) ; this . _m02 ( - da * c ) ; this . _m03 ( 0.0f ) ; this . _m10 ( - db * a ) ; this . _m11 ( 1.0f - db * b ) ; this . _m12 ( - db * c ) ; this . _m13 ( 0.0f ) ; this . _m20 ( - dc * a ) ; this . _m21 ( - d...
public class SRTOutputStream { /** * This method was created in VisualAge . * @ param b byte [ ] * @ param off int * @ param len int */ public void write ( byte [ ] b , int off , int len ) throws IOException { } }
if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { // 306998.15 logger . logp ( Level . FINE , CLASS_NAME , "write" , "Writing" ) ; } if ( _observer != null ) _observer . alertFirstWrite ( ) ; _conn . write ( b , off , len ) ;
public class Hyaline { /** * It lets you create a new DTO from scratch . This means that any annotation * for JAXB , Jackson or whatever serialization framework you are using on * your entity T will be ignored . The only annotation - based configuration * that will be used is the one you are defining in this invo...
try { return createDTO ( entity , dtoTemplate , true , proxyClassName ) ; } catch ( CannotInstantiateProxyException | DTODefinitionException e ) { e . printStackTrace ( ) ; throw new HyalineException ( ) ; }
public class AkubraLowlevelStorage { /** * Converts a token to a token - as - blobId . * Object tokens are simply prepended with < code > info : fedora / < / code > , * whereas datastream tokens are additionally converted such that * < code > ns : id + dsId + dsVersionId < / code > becomes * < code > info : fed...
try { int i = token . indexOf ( '+' ) ; if ( i == - 1 ) { return new URI ( new PID ( token ) . toURI ( ) ) ; } else { String [ ] dsParts = token . substring ( i + 1 ) . split ( "\\+" ) ; if ( dsParts . length != 2 ) { throw new IllegalArgumentException ( "Malformed datastream token: " + token ) ; } return new URI ( Con...
public class CryptoUtils { /** * Return the hezadecimal representation of the string digest given the * specified algorithm . * @ param str * @ param algorithm * @ return * @ throws NoSuchAlgorithmException */ private static String getHash ( String str , String algorithm ) throws NoSuchAlgorithmException { } ...
MessageDigest md = MessageDigest . getInstance ( algorithm ) ; md . update ( str . getBytes ( ) ) ; byte byteData [ ] = md . digest ( ) ; StringBuilder hexString = new StringBuilder ( ) ; for ( int i = 0 ; i < byteData . length ; i ++ ) { String hex = Integer . toHexString ( 0xff & byteData [ i ] ) ; if ( hex . length ...
public class LLIterator { /** * Dirty trick to avoid delays from finding the correct method . */ public LongLongIndex . LLEntry nextULL ( ) { } }
if ( ! hasNextULL ( ) ) { throw new NoSuchElementException ( ) ; } LongLongIndex . LLEntry e = new LongLongIndex . LLEntry ( nextKey , nextValue ) ; if ( currentPage == null ) { hasValue = false ; } else { gotoPosInPage ( ) ; } return e ;
public class SpringIOUtils { /** * Copies all the resources for the given target directory . The base resource serves to calculate the relative * path such that the directory structure is maintained . * @ param base The base resource * @ param resources The resources to copy * @ param targetDir The target direc...
final URL baseUrl = base . getURL ( ) ; for ( Resource resource : resources ) { final InputStream input = resource . getInputStream ( ) ; final File target = new File ( targetDir , resource . getURL ( ) . toString ( ) . substring ( baseUrl . toString ( ) . length ( ) ) ) ; copy ( new BufferedInputStream ( input ) , new...
public class Index { /** * set the value extensions * @ param extensions value to set * @ throws PageException */ public void setExtensions ( String extensions ) throws PageException { } }
if ( extensions == null ) return ; this . extensions = ListUtil . toStringArrayTrim ( ListUtil . listToArray ( extensions , ',' ) ) ;
public class EnhanceImageOps { /** * Applies the transformation table to the provided input image . * @ param input Input image . * @ param minValue Minimum possible pixel value . * @ param transform Input transformation table . * @ param output Output image . */ public static void applyTransform ( GrayS8 input...
output . reshape ( input . width , input . height ) ; if ( BoofConcurrency . USE_CONCURRENT ) { ImplEnhanceHistogram_MT . applyTransform ( input , transform , minValue , output ) ; } else { ImplEnhanceHistogram . applyTransform ( input , transform , minValue , output ) ; }
public class Substitutor { /** * { @ inheritDoc } */ public Generic onNonGenericType ( Generic typeDescription ) { } }
return typeDescription . isArray ( ) ? new OfGenericArray . Latent ( typeDescription . getComponentType ( ) . accept ( this ) , typeDescription ) : onSimpleType ( typeDescription ) ;
public class ScriptStackTrace { /** * Loads the local line map for a class . */ public static LineMap getScriptLineMap ( String className , ClassLoader loader ) { } }
try { Class cl = loader . loadClass ( className ) ; LineMap map = _scriptMap . get ( cl ) ; if ( map == null ) { map = loadScriptMap ( cl ) ; _scriptMap . put ( cl , map ) ; } return map ; } catch ( Throwable e ) { return null ; }
public class PreferencesPanel { /** * GEN - LAST : event _ buttonFontActionPerformed */ private void buttonAboutActionPerformed ( java . awt . event . ActionEvent evt ) { } }
// GEN - FIRST : event _ buttonAboutActionPerformed JOptionPane . showMessageDialog ( this , new AboutPanel ( ) , "About" , JOptionPane . PLAIN_MESSAGE ) ;
public class Op { /** * Parses the given string into a scalar value * @ param x is the string to parse * @ return the given string into a scalar value * @ throws NumberFormatException if the string does not contain a scalar value */ public static double toDouble ( String x ) throws NumberFormatException { } }
if ( "nan" . equals ( x ) ) { return Double . NaN ; } if ( "inf" . equals ( x ) ) { return Double . POSITIVE_INFINITY ; } if ( "-inf" . equals ( x ) ) { return Double . NEGATIVE_INFINITY ; } return Double . parseDouble ( x ) ;
public class ExportSarlApplicationPage { /** * Returns the Java project name specified by the given launch * configuration , or < code > null < / code > if none . * @ param configuration * launch configuration * @ return the Java project name specified by the given launch * configuration , or < code > null < ...
return configuration . getAttribute ( IJavaLaunchConfigurationConstants . ATTR_PROJECT_NAME , ( String ) null ) ;
public class ComponentNode { /** * Adds a component to this node . If there are multiple components * they will be " stacked " in a tabbed pane . * @ param component The component to be added * @ param label The label for the selection tab which brings the component * to the front if there are multiple componen...
components . add ( component ) ; component2LabelMap . put ( component , label ) ; if ( components . size ( ) == 1 ) { baseComponent . add ( component ) ; } else if ( components . size ( ) > 1 ) { baseComponent . removeAll ( ) ; for ( JComponent c : components ) { tabbedPane . add ( component2LabelMap . get ( c ) , c ) ...
public class DescribeAddressesRequest { /** * [ EC2 - VPC ] Information about the allocation IDs . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setAllocationIds ( java . util . Collection ) } or { @ link # withAllocationIds ( java . util . Collection ) } i...
if ( this . allocationIds == null ) { setAllocationIds ( new com . amazonaws . internal . SdkInternalList < String > ( allocationIds . length ) ) ; } for ( String ele : allocationIds ) { this . allocationIds . add ( ele ) ; } return this ;
public class CommunicationChannelOwnerLinkRepository { /** * region > create ( programmatic ) */ @ Programmatic public CommunicationChannelOwnerLink createLink ( final CommunicationChannel communicationChannel , final Object owner ) { } }
final CommunicationChannelType type = communicationChannel . getType ( ) ; final Class < ? extends CommunicationChannelOwnerLink > subtype = subtypeClassFor ( owner , type ) ; final CommunicationChannelOwnerLink link = repositoryService . instantiate ( subtype ) ; link . setCommunicationChannel ( communicationChannel )...
public class MessageBundleScriptCreator { /** * Loads the message resource bundles specified and uses a * BundleStringJasonifier to generate the properties . * @ param charset * the charset * @ param bundle * the bundle * @ return the script */ public Reader createScript ( Charset charset , ResourceBundle b...
Properties props = new Properties ( ) ; updateProperties ( bundle , props , charset ) ; return doCreateScript ( props ) ;
public class GeometryUtils { /** * Calculate the surface tangent and bitangent for the three supplied vertices and UV coordinates and store the result in < code > dest < / code > . * @ param v1 * XYZ of first vertex * @ param uv1 * UV of first vertex * @ param v2 * XYZ of second vertex * @ param uv2 * U...
float DeltaV1 = uv2 . y ( ) - uv1 . y ( ) ; float DeltaV2 = uv3 . y ( ) - uv1 . y ( ) ; float DeltaU1 = uv2 . x ( ) - uv1 . x ( ) ; float DeltaU2 = uv3 . x ( ) - uv1 . x ( ) ; float f = 1.0f / ( DeltaU1 * DeltaV2 - DeltaU2 * DeltaV1 ) ; destTangent . x = f * ( DeltaV2 * ( v2 . x ( ) - v1 . x ( ) ) - DeltaV1 * ( v3 . x ...
public class LookupManagerImpl { /** * Stop the LookupManagerImpl * it is idempotent , it can be invoked multiple times while in same state and is not thread safe . */ @ Override public void stop ( ) { } }
if ( isStarted ) { synchronized ( this ) { if ( isStarted ) { if ( getLookupService ( ) instanceof Closable ) { ( ( Closable ) getLookupService ( ) ) . stop ( ) ; } isStarted = false ; } } }
public class MorphiaMongoDatastore { /** * Converts Morphia Key < T > list to K , i . e . " _ id " , list . * @ throws OvalRepositoryException */ protected static final < T , K extends Serializable > List < K > _keys2Ids ( final Collection < Key < T > > keys ) { } }
List < K > ids = new ArrayList < K > ( ) ; if ( keys != null ) { for ( Key < T > key : keys ) { @ SuppressWarnings ( "unchecked" ) K id = ( K ) key . getId ( ) ; ids . add ( id ) ; } } return ids ;
public class Period { /** * Returns a new period plus the specified number of hours added . * This period instance is immutable and unaffected by this method call . * @ param hours the amount of hours to add , may be negative * @ return the new period plus the increased hours * @ throws UnsupportedOperationExce...
if ( hours == 0 ) { return this ; } int [ ] values = getValues ( ) ; // cloned getPeriodType ( ) . addIndexedField ( this , PeriodType . HOUR_INDEX , values , hours ) ; return new Period ( values , getPeriodType ( ) ) ;
public class SelectorManager { /** * Register session * @ param session * @ param event */ public final void registerSession ( Session session , EventType event ) { } }
if ( session . isClosed ( ) && event != EventType . UNREGISTER ) { return ; } Reactor reactor = ( Reactor ) session . getAttribute ( REACTOR_ATTRIBUTE ) ; if ( reactor == null ) { reactor = nextReactor ( ) ; final Reactor oldReactor = ( Reactor ) session . setAttributeIfAbsent ( REACTOR_ATTRIBUTE , reactor ) ; if ( old...
public class MimeTypeDetector { /** * Detects a MIME type from a filename and bytes . * This method follows the Shared Mime Info database ' s * < a href = " http : / / standards . freedesktop . org / shared - mime - info - spec / shared - mime - info - spec - latest . html # idm140625828606432 " > Recommended * C...
Set < WeightedMimeType > weightedMimeTypes = filenameToWmts ( filename ) ; Set < String > globMimeTypes = findBestMimeTypes ( weightedMimeTypes ) ; if ( globMimeTypes . size ( ) == 1 ) { return CompletableFuture . completedFuture ( globMimeTypes . iterator ( ) . next ( ) ) ; } return getBytesAsync . get ( ) . thenApply...
public class IntLongSort { /** * Swaps the elements at positions i and j in both the values and index array , which must be the same length . * @ param values An array of values . * @ param index An array of indices . * @ param i The position of the first element to swap . * @ param j The position of the second...
if ( i != j ) { swap ( values , i , j ) ; swap ( index , i , j ) ; numSwaps ++ ; }
public class NetworkInterfacesInner { /** * Updates a network interface tags . * @ param resourceGroupName The name of the resource group . * @ param networkInterfaceName The name of the network interface . * @ param tags Resource tags . * @ param serviceCallback the async ServiceCallback to handle successful a...
return ServiceFuture . fromResponse ( updateTagsWithServiceResponseAsync ( resourceGroupName , networkInterfaceName , tags ) , serviceCallback ) ;
public class SkewedInfoMarshaller { /** * Marshall the given parameter object . */ public void marshall ( SkewedInfo skewedInfo , ProtocolMarshaller protocolMarshaller ) { } }
if ( skewedInfo == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( skewedInfo . getSkewedColumnNames ( ) , SKEWEDCOLUMNNAMES_BINDING ) ; protocolMarshaller . marshall ( skewedInfo . getSkewedColumnValues ( ) , SKEWEDCOLUMNVALUES_BINDING ) ; ...
public class FessMailDeliveryDepartmentCreator { protected SMailPostalParkingLot createPostalParkingLot ( ) { } }
final SMailPostalParkingLot parkingLot = new SMailPostalParkingLot ( ) ; final SMailPostalMotorbike motorbike = new SMailPostalMotorbike ( ) ; final String hostAndPort = fessConfig . getMailSmtpServerMainHostAndPort ( ) ; final List < String > hostPortList = DfStringUtil . splitListTrimmed ( hostAndPort , ":" ) ; motor...
public class DatabaseDAODefaultImpl { /** * / * ( non - Javadoc ) * @ see fr . esrf . TangoApi . IDatabaseDAO # getDevices ( java . lang . String ) */ public String [ ] getDevices ( Database database , String wildcard ) throws DevFailed { } }
// Get each field of device name StringTokenizer stk = new StringTokenizer ( wildcard , "/" ) ; Vector < String > vector = new Vector < String > ( ) ; while ( stk . hasMoreTokens ( ) ) vector . add ( stk . nextToken ( ) ) ; if ( vector . size ( ) < 3 ) Except . throw_exception ( "TangoApi_DeviceNameNotValid" , "Device ...
public class Variable { /** * Sorts the terms in ascending order according to their centroids */ public void sort ( ) { } }
PriorityQueue < Op . Pair < Term , Double > > termCentroids = new PriorityQueue < Op . Pair < Term , Double > > ( terms . size ( ) , new Ascending ( ) ) ; Defuzzifier defuzzifier = new Centroid ( ) ; for ( Term term : terms ) { double centroid ; try { if ( term instanceof Constant || term instanceof Linear ) { centroid...
public class Utils { /** * escape characters in column name or table name */ public static String escapeSpecialCharacters ( String columnName , String escapeChars , String character ) { } }
if ( Strings . isNullOrEmpty ( columnName ) ) { return null ; } if ( StringUtils . isEmpty ( escapeChars ) ) { return columnName ; } List < String > specialChars = Arrays . asList ( escapeChars . split ( "," ) ) ; for ( String specialChar : specialChars ) { columnName = columnName . replace ( specialChar , character ) ...
public class ParallelNodeDispatcher { /** * Extract the threadlocal stored as a reference in the project , and return the string value or null . * @ param nodeNameLocalRefId refid for the thread local variable * @ param project Project * @ return value of the variable , or null if it is not found or the refid doe...
final Object o = project . getReference ( nodeNameLocalRefId ) ; String thrNode = null ; if ( null != o && o instanceof InheritableThreadLocal ) { InheritableThreadLocal < String > local = ( InheritableThreadLocal < String > ) o ; thrNode = local . get ( ) ; } return thrNode ;
public class YarnAppSecurityManager { /** * Write the current delegation token to the token file . */ @ VisibleForTesting synchronized void writeDelegationTokenToFile ( ) throws IOException { } }
if ( this . fs . exists ( this . tokenFilePath ) ) { LOGGER . info ( "Deleting existing token file " + this . tokenFilePath ) ; this . fs . delete ( this . tokenFilePath , false ) ; } LOGGER . info ( "Writing new or renewed token to token file " + this . tokenFilePath ) ; YarnHelixUtils . writeTokenToFile ( this . toke...
public class JCuda { /** * [ C + + API ] Configure a device launch * < pre > * template < class T > cudaError _ t cudaSetupArgument ( * T arg , * size _ t offset ) [ inline ] * < / pre > * < div > * < p > [ C + + API ] Configure a device launch * Pushes < tt > size < / tt > bytes of the argument pointed...
return checkResult ( cudaSetupArgumentNative ( arg , size , offset ) ) ;
public class GoogleAddon { /** * Set the type of the Google map . * @ param type the map type * @ since 1.9.0 */ @ Api public void setMapType ( MapType type ) { } }
this . type = type ; if ( googleMap != null ) { setMapType ( googleMap , type . toString ( ) ) ; }
public class ApiErrorTranslator { /** * / * setters */ public < E extends Enum < E > & IApiError > void setApiErrorEnum ( Class < E > apiErrorClazz ) { } }
this . apiErrorClazz = apiErrorClazz ;
public class CommerceUserSegmentCriterionUtil { /** * Returns the last commerce user segment criterion in the ordered set where commerceUserSegmentEntryId = & # 63 ; . * @ param commerceUserSegmentEntryId the commerce user segment entry ID * @ param orderByComparator the comparator to order the set by ( optionally ...
return getPersistence ( ) . findByCommerceUserSegmentEntryId_Last ( commerceUserSegmentEntryId , orderByComparator ) ;
public class MapImpl { /** * Couples this map to an existing HTML element ( div or span ) . * @ param id * id of the element */ public void setHtmlElementId ( String id ) { } }
htmlElementId = id ; mapWidget . setHtmlElement ( DOM . getElementById ( id ) ) ; mapWidget . draw ( ) ;
public class Actor { /** * The message delivered before the { @ code Actor } has been restarted by its supervisor due to an exception . * Override to implement . * @ param reason the { @ code Throwable } cause of the supervision restart */ protected void beforeRestart ( final Throwable reason ) { } }
// override for specific recovery logger ( ) . log ( "Default before restart recovery after: " + reason . getMessage ( ) , reason ) ; lifeCycle . afterStop ( this ) ;
public class Aligner { /** * Performs global alignment using Linear scoring system ( penalty exists only for gap ) * @ param scoring linear scoring system * @ param seq1 first sequence * @ param seq2 second sequence * @ return array of mutations */ public static < S extends Sequence < S > > Alignment < S > alig...
if ( seq1 . getAlphabet ( ) != seq2 . getAlphabet ( ) || seq1 . getAlphabet ( ) != scoring . getAlphabet ( ) ) throw new IllegalArgumentException ( "Different alphabets." ) ; int size1 = seq1 . size ( ) + 1 , size2 = seq2 . size ( ) + 1 ; int [ ] matrix = new int [ size1 * ( seq2 . size ( ) + 1 ) ] ; for ( int i = 0 ; ...
public class DeleteCustomTargetingValues { /** * Runs the example . * @ param adManagerServices the services factory . * @ param session the session . * @ param customTargetingValueId the ID of the custom targeting value to delete . * @ throws ApiException if the API request failed with one or more service erro...
// Get the CustomTargetingService . CustomTargetingServiceInterface customTargetingService = adManagerServices . get ( session , CustomTargetingServiceInterface . class ) ; // Create a statement to select custom targeting value . StatementBuilder statementBuilder = new StatementBuilder ( ) . where ( "WHERE id = :id" ) ...
public class AntPathMatcher { /** * Combines two patterns into a new pattern that is returned . * < p > This implementation simply concatenates the two patterns , unless the first pattern * contains a file extension match ( such as { @ code * . html } . In that case , the second pattern * should be included in th...
if ( ! StringUtils . hasText ( pattern1 ) && ! StringUtils . hasText ( pattern2 ) ) { return "" ; } if ( ! StringUtils . hasText ( pattern1 ) ) { return pattern2 ; } if ( ! StringUtils . hasText ( pattern2 ) ) { return pattern1 ; } boolean pattern1ContainsUriVar = pattern1 . indexOf ( '{' ) != - 1 ; if ( ! pattern1 . e...
public class FLVWriter { /** * Exposed to allow repair of flv files if . info and . ser files still exist . * @ param args * 0 : path to . ser file 1 : audio codec id 2 : video codec id * @ throws InterruptedException * Exception on interruption */ public static void main ( String [ ] args ) throws InterruptedE...
if ( args == null || args [ 0 ] == null ) { System . err . println ( "Provide the path to your .ser file" ) ; } else { repair ( args [ 0 ] , args . length > 1 && args [ 1 ] != null ? Integer . valueOf ( args [ 1 ] ) : null , args . length > 2 && args [ 2 ] != null ? Integer . valueOf ( args [ 2 ] ) : null ) ; } System ...
public class LocalTime { /** * Obtains the current time from the specified clock . * This will query the specified clock to obtain the current time . * Using this method allows the use of an alternate clock for testing . * The alternate clock may be introduced using { @ link Clock dependency injection } . * @ p...
Jdk8Methods . requireNonNull ( clock , "clock" ) ; // inline OffsetTime factory to avoid creating object and InstantProvider checks final Instant now = clock . instant ( ) ; // called once ZoneOffset offset = clock . getZone ( ) . getRules ( ) . getOffset ( now ) ; long secsOfDay = now . getEpochSecond ( ) % SECONDS_PE...
public class EstimateSceneCalibrated { /** * Select motion which will define the coordinate system . */ Motion selectCoordinateBase ( View view ) { } }
double bestScore = 0 ; Motion best = null ; if ( verbose != null ) verbose . println ( "selectCoordinateBase" ) ; for ( int i = 0 ; i < view . connections . size ( ) ; i ++ ) { Motion e = view . connections . get ( i ) ; double s = e . scoreTriangulation ( ) ; if ( verbose != null ) verbose . printf ( " [%2d] score = ...
public class ServerMonitor { /** * Registers an invalid request rejected by the server . */ public synchronized void onRequestRejected ( String reason ) { } }
allRequestsTracker . onRequestRejected ( reason ) ; recentRequestsTracker . onRequestRejected ( reason ) ; meter . mark ( ) ;
public class vpnvserver_appflowpolicy_binding { /** * Use this API to fetch vpnvserver _ appflowpolicy _ binding resources of given name . */ public static vpnvserver_appflowpolicy_binding [ ] get ( nitro_service service , String name ) throws Exception { } }
vpnvserver_appflowpolicy_binding obj = new vpnvserver_appflowpolicy_binding ( ) ; obj . set_name ( name ) ; vpnvserver_appflowpolicy_binding response [ ] = ( vpnvserver_appflowpolicy_binding [ ] ) obj . get_resources ( service ) ; return response ;
public class Roster { /** * Check for subscription pre - approval support . * @ return true if subscription pre - approval is supported by the server . * @ throws NotLoggedInException if not logged in . * @ since 4.2 */ public boolean isSubscriptionPreApprovalSupported ( ) throws NotLoggedInException { } }
final XMPPConnection connection = getAuthenticatedConnectionOrThrow ( ) ; return connection . hasFeature ( SubscriptionPreApproval . ELEMENT , SubscriptionPreApproval . NAMESPACE ) ;
public class InviteMarshaller { /** * Marshall the given parameter object . */ public void marshall ( Invite invite , ProtocolMarshaller protocolMarshaller ) { } }
if ( invite == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( invite . getInviteId ( ) , INVITEID_BINDING ) ; protocolMarshaller . marshall ( invite . getStatus ( ) , STATUS_BINDING ) ; protocolMarshaller . marshall ( invite . getEmailAddre...
public class ConfirmProductInstanceRequest { /** * This method is intended for internal use only . Returns the marshaled request configured with additional * parameters to enable operation dry - run . */ @ Override public Request < ConfirmProductInstanceRequest > getDryRunRequest ( ) { } }
Request < ConfirmProductInstanceRequest > request = new ConfirmProductInstanceRequestMarshaller ( ) . marshall ( this ) ; request . addParameter ( "DryRun" , Boolean . toString ( true ) ) ; return request ;
public class FlakeEncodingProvider { /** * Return the 32 character left padded hex version of the given id . These * can be lexicographically sorted . * @ param time a time value to encode * @ param sequence a sequence value to encode * @ return 32 character left padded hex version of the given id */ @ Override...
StringBuilder s = new StringBuilder ( 32 ) ; ByteBuffer bb = ByteBuffer . wrap ( encodeAsBytes ( time , sequence ) ) ; s . append ( leftPad ( toHexString ( bb . getLong ( ) ) , 16 , '0' ) ) ; s . append ( leftPad ( toHexString ( bb . getLong ( ) ) , 16 , '0' ) ) ; return s . toString ( ) ;
public class AmazonIdentityManagementAsyncClient { /** * Simplified method form for invoking the ListSSHPublicKeys operation with an AsyncHandler . * @ see # listSSHPublicKeysAsync ( ListSSHPublicKeysRequest , com . amazonaws . handlers . AsyncHandler ) */ @ Override public java . util . concurrent . Future < ListSSH...
return listSSHPublicKeysAsync ( new ListSSHPublicKeysRequest ( ) , asyncHandler ) ;
public class Clock { /** * Obtains a clock that always returns the same instant . * This clock simply returns the specified instant . * As such , it is not a clock in the conventional sense . * The main use case for this is in testing , where the fixed clock ensures * tests are not dependent on the current cloc...
Objects . requireNonNull ( fixedInstant , "fixedInstant" ) ; Objects . requireNonNull ( zone , "zone" ) ; return new FixedClock ( fixedInstant , zone ) ;
public class AbstractBlockBasedDataStore { /** * ( non - Javadoc ) * @ see net . timewalker . ffmq4 . utils . store . LinkedStore # previous ( int ) */ @ Override public final int previous ( int handle ) throws DataStoreException { } }
if ( SAFE_MODE ) checkHandle ( handle ) ; int current = previousBlock [ handle ] ; while ( current != - 1 && ( flags [ current ] & FLAG_START_BLOCK ) == 0 ) current = previousBlock [ current ] ; return current ;
public class CommandBusOnServer { /** * Client - to - Container event propagation */ private void executePutOperation ( HttpServletRequest request , HttpServletResponse response ) throws IOException , ClassNotFoundException { } }
if ( request . getContentLength ( ) > 0 ) { ObjectInputStream input = new ObjectInputStream ( new BufferedInputStream ( request . getInputStream ( ) ) ) ; CommandPayload payload = ( CommandPayload ) input . readObject ( ) ; Command operation = payload . getCommand ( ) ; Manager manager = ( Manager ) request . getAttrib...
public class FeatureMate { /** * Getter for the list of attribute names . * @ return the list of attribute names . */ public List < String > getAttributesNames ( ) { } }
SimpleFeatureType featureType = feature . getFeatureType ( ) ; List < AttributeDescriptor > attributeDescriptors = featureType . getAttributeDescriptors ( ) ; List < String > attributeNames = new ArrayList < String > ( ) ; for ( AttributeDescriptor attributeDescriptor : attributeDescriptors ) { String name = attributeD...
public class AgentsClient { /** * Retrieves the specified agent . * < p > Sample code : * < pre > < code > * try ( AgentsClient agentsClient = AgentsClient . create ( ) ) { * ProjectName parent = ProjectName . of ( " [ PROJECT ] " ) ; * Agent response = agentsClient . getAgent ( parent . toString ( ) ) ; * ...
GetAgentRequest request = GetAgentRequest . newBuilder ( ) . setParent ( parent ) . build ( ) ; return getAgent ( request ) ;
public class UnicastRequest { /** * If the target address is not a member of the new view , we ' ll mark the response as suspected and unblock * the caller of execute ( ) */ public void viewChange ( View view ) { } }
if ( view == null ) return ; // SiteAddresses are not checked as they might be in a different cluster if ( ! ( target instanceof SiteAddress ) && ! view . containsMember ( target ) && ! isDone ( ) ) { completeExceptionally ( new SuspectedException ( target ) ) ; corrDone ( ) ; }
public class RadialLabelSausage { /** * Paints the radial label sausage . */ protected void paint ( Graphics2D gfx , int x , int y , RadialMenu menu ) { } }
paint ( gfx , x , y , UIManager . getColor ( "RadialLabelSausage.background" ) , menu ) ;
public class PrefixedProperties { /** * Gets the prefixed key and parse it to an boolean - value . * @ param key * key value * @ param def * default value * @ return boolean - representation of value */ public boolean getBoolean ( final String key , final boolean def ) { } }
final String value = getProperty ( key ) ; return value != null ? Boolean . valueOf ( value ) . booleanValue ( ) : def ;
public class DefaultJsonMapper { /** * Recursively marshal the given { @ code object } to JSON . * Used by { @ link # toJson ( Object ) } . * @ param object * The object to marshal . * @ param ignoreNullValuedProperties * If this is { @ code true } , no Javabean properties with { @ code null } values will be ...
if ( object == null ) { return Json . NULL ; } if ( object instanceof JsonValue ) { return ( JsonValue ) object ; } if ( object instanceof List < ? > ) { JsonArray jsonArray = new JsonArray ( ) ; for ( Object o : ( List < ? > ) object ) jsonArray . add ( toJsonInternal ( o , ignoreNullValuedProperties ) ) ; return json...
public class ClutoSparseMatrixBuilder { /** * { @ inheritDoc } */ public synchronized int addColumn ( SparseArray < ? extends Number > row ) { } }
if ( isFinished ) throw new IllegalStateException ( "Cannot add columns to a MatrixBuilder that is finished" ) ; // Update the size of the matrix based on the size of the array if ( row . length ( ) > numCols ) numCols = row . length ( ) ; // SparseArray instances can take on the maximum possible array size // when the...
public class LoadBalancerInfo { /** * The target group pair information . This is an array of < code > TargeGroupPairInfo < / code > objects with a maximum * size of one . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setTargetGroupPairInfoList ( java . u...
if ( this . targetGroupPairInfoList == null ) { setTargetGroupPairInfoList ( new com . amazonaws . internal . SdkInternalList < TargetGroupPairInfo > ( targetGroupPairInfoList . length ) ) ; } for ( TargetGroupPairInfo ele : targetGroupPairInfoList ) { this . targetGroupPairInfoList . add ( ele ) ; } return this ;
public class CmsGalleryController { /** * Removes a tab id from the internal list of tab ids . < p > * @ param tabId the id of the tab to remove */ protected void removeTab ( GalleryTabId tabId ) { } }
if ( m_tabIds != null ) { List < GalleryTabId > tabs = new ArrayList < GalleryTabId > ( Arrays . asList ( m_tabIds ) ) ; if ( tabs . contains ( tabId ) ) { m_tabIds = new GalleryTabId [ tabs . size ( ) - 1 ] ; tabs . remove ( tabId ) ; m_tabIds = tabs . toArray ( new GalleryTabId [ tabs . size ( ) ] ) ; } }
public class MethodCallImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public void setValue ( String newValue ) { } }
String oldValue = value ; value = newValue ; if ( eNotificationRequired ( ) ) eNotify ( new ENotificationImpl ( this , Notification . SET , SimpleExpressionsPackage . METHOD_CALL__VALUE , oldValue , value ) ) ;
public class WindowsPlatform { /** * Compare two input streams for duplicate content * Naive implementation , but should not be performance issue . * @ param stream1 * stream * @ param stream2 * stream * @ return true if streams are identical in content * @ throws IOException * if error reading streams ...
int byte1 = - 1 ; int byte2 = - 1 ; do { byte1 = stream1 . read ( ) ; byte2 = stream2 . read ( ) ; } while ( byte1 == byte2 && byte1 != - 1 ) ; return byte1 == byte2 ;
public class BaseApplet { /** * Clean the javascript command for java use . */ public String cleanCommand ( String command ) { } }
if ( command == null ) return command ; Map < String , Object > properties = Util . parseArgs ( null , command ) ; properties . remove ( Params . APPLET ) ; properties . remove ( "code" ) ; properties . remove ( "jnlpjars" ) ; properties . remove ( "jnlpextensions" ) ; properties . remove ( ScreenUtil . BACKGROUND_COLO...
public class AbstractAutofillDefaultValueBuilder { /** * Registers a property key . The key may be either of the form * < code > " $ { custom . foo . bar } " < / code > or < code > " custom . foo . bar " < / code > . * @ param properties * the property keys to register * @ return this instance for fluent chaini...
for ( String prop : properties ) { String propertyKey = BuilderUtils . isExpression ( prop ) ? BuilderUtils . getPropertyKey ( prop ) : prop ; this . defaultValueProperties . add ( propertyKey ) ; } return myself ;
public class Selection { /** * Sort the char array in ascending order using this algorithm . * @ param charArray the array of chars that we want to sort */ public static void sort ( char [ ] charArray ) { } }
int index = 0 ; char value = 0 ; for ( int i = 1 ; i < charArray . length ; i ++ ) { index = i ; value = charArray [ index ] ; while ( index > 0 && value < charArray [ index - 1 ] ) { charArray [ index ] = charArray [ index - 1 ] ; index -- ; } charArray [ index ] = value ; }
public class Reflections { /** * collect saved Reflections resources from all urls that contains the given packagePrefix and matches the given resourceNameFilter * and de - serializes them using the default serializer { @ link org . reflections . serializers . XmlSerializer } or using the optionally supplied optional...
Serializer serializer = optionalSerializer != null && optionalSerializer . length == 1 ? optionalSerializer [ 0 ] : new XmlSerializer ( ) ; Collection < URL > urls = ClasspathHelper . forPackage ( packagePrefix ) ; if ( urls . isEmpty ( ) ) return null ; long start = System . currentTimeMillis ( ) ; final Reflections r...
public class ProtobufIDLProxy { /** * Creates the single . * @ param data the data * @ param debug the debug * @ param path the path * @ return the IDL proxy object */ public static IDLProxyObject createSingle ( String data , boolean debug , File path ) { } }
return createSingle ( data , debug , path , true ) ;
public class ApiOvhOrder { /** * Get allowed durations for ' new ' option * REST : GET / order / email / domain / new * @ param domain [ required ] Domain name which will be linked to this mx account * @ param offer [ required ] Offer for your new mx account * @ deprecated */ public ArrayList < String > email_d...
String qPath = "/order/email/domain/new" ; StringBuilder sb = path ( qPath ) ; query ( sb , "domain" , domain ) ; query ( sb , "offer" , offer ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , t1 ) ;
public class CmsJlanDiskInterface { /** * Internal method for creating a new file . < p > * @ param session the session * @ param connection the tree connection * @ param params the parameters for opening the file * @ param typeName the name of the resource type for the new file * @ return a NetworkFile insta...
String path = params . getPath ( ) ; String cmsPath = getCmsPath ( path ) ; try { CmsObjectWrapper cms = getCms ( session , connection ) ; if ( typeName == null ) { typeName = OpenCms . getResourceManager ( ) . getDefaultTypeForName ( cmsPath ) . getTypeName ( ) ; } CmsResource createdResource = cms . createResource ( ...