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 . util . Collection ) } if you want to override * the existing values . * @ param options * If specified , restricts the descriptions to only the specified options . * @ return Returns a reference to this object so that method calls can be chained together . */ public DescribeConfigurationOptionsRequest withOptions ( OptionSpecification ... options ) { } }
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 ( Translet translet , CorsException ce ) throws CorsException { } }
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 ResultSet rs , final InputStream templateStream ) { } }
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 ) ) + lineSeparator ) ; if ( i > multiple_object_count_to_ffdc ) { buffer . append ( "........contd" ) ; break ; } } } buffer . append ( '}' ) ; return buffer . toString ( ) ;
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 = mappingJobExecution . getPackageId ( ) ; final String label = mappingJobExecution . getLabel ( ) ; final Boolean addSourceAttribute = mappingJobExecution . isAddSourceAttribute ( ) ; final String resultUrl = menuReaderService . findMenuItemPath ( DataExplorerController . ID ) + "?entity=" + targetEntityTypeId ; mappingJobExecution . setResultUrl ( resultUrl ) ; return progress -> mappingService . applyMappings ( mappingProjectId , targetEntityTypeId , addSourceAttribute , packageId , label , progress ) ; } } ;
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 . matcher ( className ) . matches ( ) ) { rtnVal = false ; break ; } } if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "classNeedsTransform : " + className + ( rtnVal ? " needs" : " does not need" ) + " transform." ) ; return rtnVal ;
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 . * @ param jarFile Java { @ link File JAR File } containing the Java program to execute . * @ param args array of { @ link String arguments } passed to the Java program . * @ return a { @ link ProcessAdapter } representing the forked { @ link Process } executing * the given Java { @ link File JAR File } . * @ see org . cp . elements . process . ProcessAdapter * @ see # execute ( File , File , String . . . ) */ public ProcessAdapter execute ( File jarFile , String ... args ) { } }
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 KilledBuilder ( ) ) ; c . add ( new LonelyBuilder ( ) ) ; c . add ( new OfflineBuilder ( ) ) ; c . add ( new OnlineBuilder ( ) ) ; c . add ( new OverbookBuilder ( ) ) ; c . add ( new PreserveBuilder ( ) ) ; c . add ( new QuarantineBuilder ( ) ) ; c . add ( new ReadyBuilder ( ) ) ; c . add ( new RootBuilder ( ) ) ; c . add ( new RunningBuilder ( ) ) ; c . add ( new SleepingBuilder ( ) ) ; c . add ( new SplitBuilder ( ) ) ; c . add ( new SplitAmongBuilder ( ) ) ; c . add ( new SpreadBuilder ( ) ) ; c . add ( new SeqBuilder ( ) ) ; c . add ( new MaxOnlineBuilder ( ) ) ; c . add ( new NoDelayBuilder ( ) ) ; c . add ( new BeforeBuilder ( ) ) ; c . add ( new SerializeBuilder ( ) ) ; c . add ( new SyncBuilder ( ) ) ; return c ;
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 . Reader , long ) */ @ Override public void updateNCharacterStream ( String columnLabel , Reader reader , long length ) throws SQLException { } }
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 instanceof NullValueImpl ) { transientValue = untypedNullValue ( isTransient ) ; } else if ( value instanceof FileValue ) { ( ( FileValueImpl ) transientValue ) . setTransient ( isTransient ) ; } else if ( value instanceof AbstractTypedValue < ? > ) { ( ( AbstractTypedValue < ? > ) transientValue ) . setTransient ( isTransient ) ; } return transientValue ; } else { // unknown value return new UntypedValueImpl ( value , isTransient ) ; }
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 ( ) ) ; availableExecutors . update ( current . getAvailableExecutors ( ) ) ; queueLength . update ( current . getQueueLength ( ) ) ;
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 = extensionMap . keySet ( ) ; Iterator < String > containerNameIterator = containerNameSet . iterator ( ) ; while ( containerNameIterator . hasNext ( ) ) { String containerName = containerNameIterator . next ( ) ; String [ ] extensions = extensionMap . get ( containerName ) ; StringBuilder fileText = new StringBuilder ( containerName ) ; fileText . append ( " (" ) ; int ende = extensions . length - 1 ; for ( int i = 0 ; i <= ende ; i ++ ) { fileText . append ( "*." ) . append ( extensions [ i ] ) ; if ( i < ende ) fileText . append ( ", " ) ; } fileText . append ( ')' ) ; chooserFilterArray . add ( new FileChooserFilter ( extensions , fileText . toString ( ) ) ) ; } // now add playlist as group of files chooserFilterArray . add ( PlayList . PLAYLIST_FILE_FILTER ) ; // now add all playable files at the last step ( container extensions and playlist files ) String [ ] containerExtensions = MultimediaContainerManager . getSupportedFileExtensions ( ) ; String [ ] fullSupportedExtensions = new String [ containerExtensions . length + PlayList . SUPPORTEDPLAYLISTS . length ] ; System . arraycopy ( PlayList . SUPPORTEDPLAYLISTS , 0 , fullSupportedExtensions , 0 , PlayList . SUPPORTEDPLAYLISTS . length ) ; System . arraycopy ( containerExtensions , 0 , fullSupportedExtensions , PlayList . SUPPORTEDPLAYLISTS . length , containerExtensions . length ) ; chooserFilterArray . add ( new FileChooserFilter ( fullSupportedExtensions , "All playable files" ) ) ; // add default " all files " - WE DO NOT DO THAT ANYMORE ; ) // chooserFilterArray . add ( new FileChooserFilter ( " * " , " All files " ) ) ; fileFilterLoad = new FileFilter [ chooserFilterArray . size ( ) ] ; chooserFilterArray . toArray ( fileFilterLoad ) ; fileFilterExport = new FileFilter [ 1 ] ; fileFilterExport [ 0 ] = new FileChooserFilter ( javax . sound . sampled . AudioFileFormat . Type . WAVE . getExtension ( ) , javax . sound . sampled . AudioFileFormat . Type . WAVE . toString ( ) ) ;
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 . isInboundDone ( ) ) { try { engine . closeInbound ( ) ; } catch ( SSLException se ) { // no ffdc required if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( tc , "Error closing inbound engine side; " + se ) ; } } } }
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 applications and versions that are not yet available to compute nodes , use the Azure portal or the Azure Resource Manager API . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ throws BatchErrorException thrown if the request is rejected by server * @ throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @ return the PagedList & lt ; ApplicationSummary & gt ; object if successful . */ public PagedList < ApplicationSummary > list ( ) { } }
ServiceResponseWithHeaders < Page < ApplicationSummary > , ApplicationListHeaders > response = listSinglePageAsync ( ) . toBlocking ( ) . single ( ) ; return new PagedList < ApplicationSummary > ( response . body ( ) ) { @ Override public Page < ApplicationSummary > nextPage ( String nextPageLink ) { return listNextSinglePageAsync ( nextPageLink , null ) . toBlocking ( ) . single ( ) . body ( ) ; } } ;
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 { lock . writeLock ( ) . unlock ( ) ; }
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 : / / msdn . microsoft . com / en - us / library / windows / desktop / bb281733 ( v = vs . 85 ) . aspx " > msdn . microsoft . com < / a > * @ param a * the x factor in the plane equation * @ param b * the y factor in the plane equation * @ param c * the z factor in the plane equation * @ param d * the constant in the plane equation * @ return this */ public Matrix4f reflection ( float a , float b , float c , float d ) { } }
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 ( - dc * b ) ; this . _m22 ( 1.0f - dc * c ) ; this . _m23 ( 0.0f ) ; this . _m30 ( - dd * a ) ; this . _m31 ( - dd * b ) ; this . _m32 ( - dd * c ) ; this . _m33 ( 1.0f ) ; _properties ( PROPERTY_AFFINE | PROPERTY_ORTHONORMAL ) ; return this ;
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 invocation . * @ param < T > * the generic type * @ param entity * the entity you are going proxy . * @ param dtoTemplate * the DTO template passed as an anonymous class . * @ param proxyClassName * the name you want to assign to newly generated class * @ return a proxy that extends the type of entity , holding the same * instance variables values as entity and configured according to * dtoTemplate * @ throws HyalineException * if the dynamic type could be created . */ public static < T > T dtoFromScratch ( T entity , DTO dtoTemplate , String proxyClassName ) throws HyalineException { } }
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 : fedora / ns : id / dsId / dsVersionId < / code > , with the dsId * and dsVersionId segments URI - percent - encoded with UTF - 8 character * encoding . * @ param token the token to convert . * @ return the blob id . * @ throws IllegalArgumentException if the token is not a well - formed * pid or datastream token . */ private static URI getBlobId ( String token ) { } }
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 ( Constants . FEDORA . uri + token . substring ( 0 , i ) + "/" + uriEncode ( dsParts [ 0 ] ) + "/" + uriEncode ( dsParts [ 1 ] ) ) ; } } catch ( MalformedPIDException e ) { throw new IllegalArgumentException ( "Malformed object token: " + token , e ) ; } catch ( URISyntaxException e ) { throw new IllegalArgumentException ( "Malformed object or datastream token: " + token , e ) ; }
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 ( ) == 1 ) { hexString . append ( '0' ) ; } hexString . append ( hex ) ; } return hexString . toString ( ) ;
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 directory * @ throws IOException if there is an error */ public static void copyAll ( Resource base , Resource [ ] resources , File targetDir ) throws IOException { } }
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 BufferedOutputStream ( Files . newOutputStream ( target . toPath ( ) ) ) ) ; }
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 , int transform [ ] , int minValue , GrayS8 output ) { } }
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 < / code > if none * @ exception CoreException * if unable to retrieve the attribute */ protected static String getJavaProjectName ( ILaunchConfiguration configuration ) throws CoreException { } }
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 components . */ public void add ( JComponent component , String label ) { } }
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 ) ; } baseComponent . add ( tabbedPane ) ; } // tabbedPane . add ( label , component ) ; if ( component instanceof NodeComponent ) { // Notify the component that it was added to us ( ( NodeComponent ) component ) . addedToNode ( this ) ; }
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 ) } if you want * to override the existing values . * @ param allocationIds * [ EC2 - VPC ] Information about the allocation IDs . * @ return Returns a reference to this object so that method calls can be chained together . */ public DescribeAddressesRequest withAllocationIds ( String ... allocationIds ) { } }
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 ) ; // copy over the type , to support subsequent querying . link . setCommunicationChannelType ( type ) ; final Bookmark bookmark = bookmarkService . bookmarkFor ( owner ) ; link . setOwner ( owner ) ; link . setOwnerStr ( bookmark . toString ( ) ) ; repositoryService . persist ( link ) ; return link ;
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 bundle ) { } }
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 * UV of second vertex * @ param v3 * XYZ of third vertex * @ param uv3 * UV of third vertex * @ param destTangent * the tangent will be stored here * @ param destBitangent * the bitangent will be stored here */ public static void tangentBitangent ( Vector3fc v1 , Vector2fc uv1 , Vector3fc v2 , Vector2fc uv2 , Vector3fc v3 , Vector2fc uv3 , Vector3f destTangent , Vector3f destBitangent ) { } }
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 ( ) - v1 . x ( ) ) ) ; destTangent . y = f * ( DeltaV2 * ( v2 . y ( ) - v1 . y ( ) ) - DeltaV1 * ( v3 . y ( ) - v1 . y ( ) ) ) ; destTangent . z = f * ( DeltaV2 * ( v2 . z ( ) - v1 . z ( ) ) - DeltaV1 * ( v3 . z ( ) - v1 . z ( ) ) ) ; destTangent . normalize ( ) ; destBitangent . x = f * ( - DeltaU2 * ( v2 . x ( ) - v1 . x ( ) ) - DeltaU1 * ( v3 . x ( ) - v1 . x ( ) ) ) ; destBitangent . y = f * ( - DeltaU2 * ( v2 . y ( ) - v1 . y ( ) ) - DeltaU1 * ( v3 . y ( ) - v1 . y ( ) ) ) ; destBitangent . z = f * ( - DeltaU2 * ( v2 . z ( ) - v1 . z ( ) ) - DeltaU1 * ( v3 . z ( ) - v1 . z ( ) ) ) ; destBitangent . normalize ( ) ;
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 UnsupportedOperationException if the field is not supported */ public Period plusHours ( int hours ) { } }
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 ( oldReactor != null ) { reactor = oldReactor ; } } reactor . registerSession ( session , event ) ;
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 * Checking Order < / a > . The only difference : it tests for * < tt > text / plain < / tt > thoroughly , both by scanning more of the file and * by supporting many character sets . * getBytes ( ) is a { @ link java . util . concurrent . Callable } because it may or * may not be needed . A file named < tt > README < / tt > will always be detected * as < tt > text / plain < / tt > , for instance ; a file named < tt > foo . doc < / tt > * will need a magic - number check because it may be plain text or it may be * a Word document . * If you are creating your own { @ code getBytesAsync } method , ensure its return * value is unpadded . ( Use { @ link java . util . Arrays # copyOf ( byte [ ] , int ) } to truncate * it . ) It needn ' t be any longer than { @ link # getMaxGetBytesLength ( ) } * bytes . * The CompletionStage may return a { @ link ExecutionException } which is caused * by a { @ link GetBytesException } . ( That , in turn , will wrap a * { @ link IOException } or other exception that prevented getBytesAsync ( ) from * working . * @ param filename Filename . To skip filename globbing , pass { @ literal " " } * @ param getBytesAsync Supplier that eventually returns a { @ code byte [ ] } * @ return Eventual MIME type String , falling back to < tt > " application / octet - stream < / tt > " */ public CompletionStage < String > detectMimeTypeAsync ( String filename , Supplier < CompletionStage < byte [ ] > > getBytesAsync ) { } }
Set < WeightedMimeType > weightedMimeTypes = filenameToWmts ( filename ) ; Set < String > globMimeTypes = findBestMimeTypes ( weightedMimeTypes ) ; if ( globMimeTypes . size ( ) == 1 ) { return CompletableFuture . completedFuture ( globMimeTypes . iterator ( ) . next ( ) ) ; } return getBytesAsync . get ( ) . thenApply ( bytes -> { for ( String magicMimeType : bytesToMimeTypes ( bytes ) ) { if ( globMimeTypes . isEmpty ( ) ) { return magicMimeType ; } else { for ( String globMimeType : globMimeTypes ) { if ( isMimeTypeEqualOrSubclass ( globMimeType , magicMimeType ) ) { return globMimeType ; } } } } if ( isText ( bytes ) ) { return "text/plain" ; } return "application/octet-stream" ; } ) . exceptionally ( ex -> { throw new CompletionException ( new GetBytesException ( ex ) ) ; } ) ;
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 element to swap . */ private static void swap ( long [ ] values , int [ ] index , int i , int j ) { } }
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 and failed responses . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the { @ link ServiceFuture } object */ public ServiceFuture < NetworkInterfaceInner > updateTagsAsync ( String resourceGroupName , String networkInterfaceName , Map < String , String > tags , final ServiceCallback < NetworkInterfaceInner > serviceCallback ) { } }
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 ) ; protocolMarshaller . marshall ( skewedInfo . getSkewedColumnValueLocationMaps ( ) , SKEWEDCOLUMNVALUELOCATIONMAPS_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
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 , ":" ) ; motorbike . registerConnectionInfo ( hostPortList . get ( 0 ) , Integer . parseInt ( hostPortList . get ( 1 ) ) ) ; motorbike . registerReturnPath ( fessConfig . getMailReturnPath ( ) ) ; parkingLot . registerMotorbikeAsMain ( motorbike ) ; return parkingLot ;
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 name not valid" , "ATangoApi.Database.getDevices()" ) ; String domain = vector . elementAt ( 0 ) ; String family = vector . elementAt ( 1 ) ; String member = vector . elementAt ( 2 ) ; vector . clear ( ) ; // Check for specifieddomain String [ ] domains = get_device_domain ( database , domain ) ; if ( domains . length == 0 ) domains = new String [ ] { domain } ; // Check for all domains found for ( String domain_1 : domains ) { String domain_header = domain_1 + "/" ; // Get families String [ ] families = get_device_family ( database , domain_header + family ) ; if ( families . length == 0 ) families = new String [ ] { family } ; // Check for all falilies found for ( String family_1 : families ) { String family_header = domain_header + family_1 + "/" ; String [ ] members = get_device_member ( database , family_header + member ) ; // Add all members found for ( String member_1 : members ) vector . add ( family_header + member_1 ) ; } } // Copy all from vector to String array String [ ] devices = new String [ vector . size ( ) ] ; for ( int i = 0 ; i < vector . size ( ) ; i ++ ) devices [ i ] = vector . elementAt ( i ) ; return devices ;
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 = term . membership ( 0 ) ; } else { centroid = defuzzifier . defuzzify ( term , getMinimum ( ) , getMaximum ( ) ) ; } } catch ( Exception ex ) { centroid = Double . POSITIVE_INFINITY ; } termCentroids . offer ( new Op . Pair < Term , Double > ( term , centroid ) ) ; } List < Term > sortedTerms = new ArrayList < Term > ( terms . size ( ) ) ; while ( ! termCentroids . isEmpty ( ) ) { sortedTerms . add ( termCentroids . poll ( ) . getFirst ( ) ) ; } setTerms ( sortedTerms ) ;
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 ) ; } return columnName ;
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 doesn ' t refer to a valid thread local */ public static String getThreadLocalForProject ( final String nodeNameLocalRefId , final Project project ) { } }
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 . token , this . tokenFilePath , this . fs . getConf ( ) ) ; // Only grand access to the token file to the login user this . fs . setPermission ( this . tokenFilePath , new FsPermission ( FsAction . READ_WRITE , FsAction . NONE , FsAction . NONE ) ) ;
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 to by < tt > arg < / tt > * at < tt > offset < / tt > bytes from the start of the parameter passing area , * which starts at offset 0 . The arguments are stored in the top of the * execution stack . cudaSetupArgument ( ) must * be preceded by a call to cudaConfigureCall ( ) . * < div > * < span > Note : < / span > * < p > Note that this * function may also return error codes from previous , asynchronous * launches . * < / div > * < / div > * @ param arg Argument to push for a kernel launch * @ param size Size of argument * @ param offset Offset in argument stack to push new arg * @ param arg Argument to push for a kernel launch * @ param offset Offset in argument stack to push new arg * @ return cudaSuccess * @ see JCuda # cudaConfigureCall * @ see JCuda # cudaFuncGetAttributes * @ see JCuda # cudaLaunch * @ see JCuda # cudaSetDoubleForDevice * @ see JCuda # cudaSetDoubleForHost * @ see JCuda # cudaSetupArgument * @ deprecated This function is deprecated as of CUDA 7.0 */ @ Deprecated public static int cudaSetupArgument ( Pointer arg , long size , long offset ) { } }
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 < code > null < / code > ) * @ return the last matching commerce user segment criterion * @ throws NoSuchUserSegmentCriterionException if a matching commerce user segment criterion could not be found */ public static CommerceUserSegmentCriterion findByCommerceUserSegmentEntryId_Last ( long commerceUserSegmentEntryId , OrderByComparator < CommerceUserSegmentCriterion > orderByComparator ) throws com . liferay . commerce . user . segment . exception . NoSuchUserSegmentCriterionException { } }
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 > alignGlobalLinear ( LinearGapAlignmentScoring scoring , S seq1 , S seq2 ) { } }
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 ; i < size2 ; ++ i ) matrix [ i ] = scoring . getGapPenalty ( ) * i ; for ( int j = 1 ; j < size1 ; ++ j ) matrix [ size2 * j ] = scoring . getGapPenalty ( ) * j ; int i1 , i2 , match , delete , insert ; for ( i1 = 0 ; i1 < seq1 . size ( ) ; ++ i1 ) for ( i2 = 0 ; i2 < seq2 . size ( ) ; ++ i2 ) { match = matrix [ i1 * size2 + i2 ] + scoring . getScore ( seq1 . codeAt ( i1 ) , seq2 . codeAt ( i2 ) ) ; delete = matrix [ i1 * size2 + i2 + 1 ] + scoring . getGapPenalty ( ) ; insert = matrix [ ( i1 + 1 ) * size2 + i2 ] + scoring . getGapPenalty ( ) ; matrix [ ( i1 + 1 ) * size2 + i2 + 1 ] = Math . max ( match , Math . max ( delete , insert ) ) ; } MutationsBuilder < S > builder = new MutationsBuilder < > ( seq1 . getAlphabet ( ) , true ) ; i1 = seq1 . size ( ) - 1 ; i2 = seq2 . size ( ) - 1 ; int score = matrix [ ( i1 + 1 ) * size2 + i2 + 1 ] ; while ( i1 >= 0 || i2 >= 0 ) { if ( i1 >= 0 && i2 >= 0 && matrix [ ( i1 + 1 ) * size2 + i2 + 1 ] == matrix [ i1 * size2 + i2 ] + scoring . getScore ( seq1 . codeAt ( i1 ) , seq2 . codeAt ( i2 ) ) ) { if ( seq1 . codeAt ( i1 ) != seq2 . codeAt ( i2 ) ) builder . appendSubstitution ( i1 , seq1 . codeAt ( i1 ) , seq2 . codeAt ( i2 ) ) ; -- i1 ; -- i2 ; } else if ( i1 >= 0 && matrix [ ( i1 + 1 ) * size2 + i2 + 1 ] == matrix [ i1 * size2 + i2 + 1 ] + scoring . getGapPenalty ( ) ) { builder . appendDeletion ( i1 , seq1 . codeAt ( i1 ) ) ; i1 -- ; } else if ( i2 >= 0 && matrix [ ( i1 + 1 ) * size2 + i2 + 1 ] == matrix [ ( i1 + 1 ) * size2 + i2 ] + scoring . getGapPenalty ( ) ) { builder . appendInsertion ( i1 + 1 , seq2 . codeAt ( i2 ) ) ; i2 -- ; } else throw new RuntimeException ( ) ; } return new Alignment < > ( seq1 , builder . createAndDestroy ( ) , new Range ( 0 , seq1 . size ( ) ) , new Range ( 0 , seq2 . size ( ) ) , score ) ;
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 errors . * @ throws RemoteException if the API request failed due to other errors . */ public static void runExample ( AdManagerServices adManagerServices , AdManagerSession session , long customTargetingValueId ) throws RemoteException { } }
// 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" ) . orderBy ( "id ASC" ) . limit ( StatementBuilder . SUGGESTED_PAGE_LIMIT ) . withBindVariableValue ( "id" , customTargetingValueId ) ; // Default for total result set size . int totalResultSetSize = 0 ; do { // Get custom targeting values by statement . CustomTargetingValuePage page = customTargetingService . getCustomTargetingValuesByStatement ( statementBuilder . toStatement ( ) ) ; if ( page . getResults ( ) != null ) { totalResultSetSize = page . getTotalResultSetSize ( ) ; int i = page . getStartIndex ( ) ; for ( CustomTargetingValue customTargetingValue : page . getResults ( ) ) { System . out . printf ( "%d) Custom targeting value with ID %d" + " will be deleted.%n" , i ++ , customTargetingValue . getId ( ) ) ; } } statementBuilder . increaseOffsetBy ( StatementBuilder . SUGGESTED_PAGE_LIMIT ) ; } while ( statementBuilder . getOffset ( ) < totalResultSetSize ) ; System . out . printf ( "Number of custom targeting values to be deleted: %d%n" , totalResultSetSize ) ; if ( totalResultSetSize > 0 ) { // Remove limit and offset from statement . statementBuilder . removeLimitAndOffset ( ) ; // Create action . com . google . api . ads . admanager . axis . v201902 . DeleteCustomTargetingValues action = new com . google . api . ads . admanager . axis . v201902 . DeleteCustomTargetingValues ( ) ; // Perform action . UpdateResult result = customTargetingService . performCustomTargetingValueAction ( action , statementBuilder . toStatement ( ) ) ; if ( result != null && result . getNumChanges ( ) > 0 ) { System . out . printf ( "Number of custom targeting values deleted: %d%n" , result . getNumChanges ( ) ) ; } else { System . out . println ( "No custom targeting values deleted." ) ; } }
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 the first , or an { @ code IllegalArgumentException } is thrown . * < p > For example : < table > * < tr > < th > Pattern 1 < / th > < th > Pattern 2 < / th > < th > Result < / th > < / tr > < tr > < td > / hotels < / td > < td > { @ code * null } < / td > < td > / hotels < / td > < / tr > < tr > < td > { @ code null } < / td > < td > / hotels < / td > < td > / hotels < / td > < / tr > * < tr > < td > / hotels < / td > < td > / bookings < / td > < td > / hotels / bookings < / td > < / tr > < tr > < td > / hotels < / td > < td > bookings < / td > < td > / hotels / bookings < / td > < / tr > * < tr > < td > / hotels / * < / td > < td > / bookings < / td > < td > / hotels / bookings < / td > < / tr > < tr > < td > / hotels / & # 42 ; & # 42 ; < / td > < td > / bookings < / td > < td > / hotels / & # 42 ; & # 42 ; / bookings < / td > < / tr > * < tr > < td > / hotels < / td > < td > { hotel } < / td > < td > / hotels / { hotel } < / td > < / tr > < tr > < td > / hotels / * < / td > < td > { hotel } < / td > < td > / hotels / { hotel } < / td > < / tr > * < tr > < td > / hotels / & # 42 ; & # 42 ; < / td > < td > { hotel } < / td > < td > / hotels / & # 42 ; & # 42 ; / { hotel } < / td > < / tr > * < tr > < td > / * . html < / td > < td > / hotels . html < / td > < td > / hotels . html < / td > < / tr > < tr > < td > / * . html < / td > < td > / hotels < / td > < td > / hotels . html < / td > < / tr > * < tr > < td > / * . html < / td > < td > / * . txt < / td > < td > IllegalArgumentException < / td > < / tr > < / table > * @ param pattern1 the first pattern * @ param pattern2 the second pattern * @ return the combination of the two patterns * @ throws IllegalArgumentException when the two patterns cannot be combined */ @ Override public String combine ( String pattern1 , String pattern2 ) { } }
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 . equals ( pattern2 ) && ! pattern1ContainsUriVar && match ( pattern1 , pattern2 ) ) { // / * + / hotel - > / hotel ; " / * . * " + " / * . html " - > / * . html // However / user + / user - > / usr / user ; / { foo } + / bar - > / { foo } / bar return pattern2 ; } // / hotels / * + / booking - > / hotels / booking // / hotels / * + booking - > / hotels / booking if ( pattern1 . endsWith ( this . pathSeparatorPatternCache . getEndsOnWildCard ( ) ) ) { return concat ( pattern1 . substring ( 0 , pattern1 . length ( ) - 2 ) , pattern2 ) ; } // / hotels / * + / booking - > / hotels / * / booking // / hotels / * + booking - > / hotels / * / booking if ( pattern1 . endsWith ( this . pathSeparatorPatternCache . getEndsOnDoubleWildCard ( ) ) ) { return concat ( pattern1 , pattern2 ) ; } int starDotPos1 = pattern1 . indexOf ( "*." ) ; if ( pattern1ContainsUriVar || starDotPos1 == - 1 || this . pathSeparator . equals ( "." ) ) { // simply concatenate the two patterns return concat ( pattern1 , pattern2 ) ; } String extension1 = pattern1 . substring ( starDotPos1 + 1 ) ; int dotPos2 = pattern2 . indexOf ( '.' ) ; String fileName2 = ( dotPos2 == - 1 ? pattern2 : pattern2 . substring ( 0 , dotPos2 ) ) ; String extension2 = ( dotPos2 == - 1 ? "" : pattern2 . substring ( dotPos2 ) ) ; String extension = extension1 . startsWith ( "*" ) ? extension2 : extension1 ; return fileName2 + extension ;
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 InterruptedException { } }
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 . exit ( 0 ) ;
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 } . * @ param clock the clock to use , not null * @ return the current time , not null */ public static LocalTime now ( Clock clock ) { } }
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_PER_DAY ; secsOfDay = ( secsOfDay + offset . getTotalSeconds ( ) ) % SECONDS_PER_DAY ; if ( secsOfDay < 0 ) { secsOfDay += SECONDS_PER_DAY ; } return LocalTime . ofSecondOfDay ( secsOfDay , now . getNano ( ) ) ;
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 = %s\n" , i , s ) ; if ( s > bestScore ) { bestScore = s ; best = e ; } } return best ;
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 . getEmailAddress ( ) , EMAILADDRESS_BINDING ) ; protocolMarshaller . marshall ( invite . getEmailStatus ( ) , EMAILSTATUS_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
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 public String encodeAsString ( long time , int sequence ) { } }
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 < ListSSHPublicKeysResult > listSSHPublicKeysAsync ( com . amazonaws . handlers . AsyncHandler < ListSSHPublicKeysRequest , ListSSHPublicKeysResult > asyncHandler ) { } }
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 clock . * The returned implementation is immutable , thread - safe and { @ code Serializable } . * @ param fixedInstant the instant to use as the clock , not null * @ param zone the time - zone to use to convert the instant to date - time , not null * @ return a clock that always returns the same instant , not null */ public static Clock fixed ( Instant fixedInstant , ZoneId zone ) { } }
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 . getAttribute ( ARQUILLIAN_MANAGER_ATTRIBUTE ) ; // execute remote Event try { manager . fire ( new ActivateManager ( manager ) ) ; manager . inject ( operation ) ; operation . perform ( ) ; manager . fire ( new PassivateManager ( manager ) ) ; } catch ( Throwable e ) { payload . setThrowable ( e ) ; } response . setStatus ( HttpServletResponse . SC_OK ) ; ObjectOutputStream output = new ObjectOutputStream ( response . getOutputStream ( ) ) ; output . writeObject ( payload ) ; output . flush ( ) ; output . close ( ) ; } else { response . setStatus ( HttpServletResponse . SC_NO_CONTENT ) ; }
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 = attributeDescriptor . getLocalName ( ) ; attributeNames . add ( name ) ; } return attributeNames ;
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 ( ) ) ; * < / code > < / pre > * @ param parent Required . The project that the agent to fetch is associated with . Format : * ` projects / & lt ; Project ID & gt ; ` . * @ throws com . google . api . gax . rpc . ApiException if the remote call fails */ public final Agent getAgent ( String parent ) { } }
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 included in the generated * JSON . * @ return JSON representation of the given { @ code object } . * @ throws FacebookJsonMappingException * If an error occurs while marshaling to JSON . */ protected JsonValue toJsonInternal ( Object object , boolean ignoreNullValuedProperties ) { } }
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 jsonArray ; } if ( object instanceof Map < ? , ? > ) { JsonObject jsonObject = new JsonObject ( ) ; for ( Entry < ? , ? > entry : ( ( Map < ? , ? > ) object ) . entrySet ( ) ) { if ( ! ( entry . getKey ( ) instanceof String ) ) { throw new FacebookJsonMappingException ( "Your Map keys must be of type " + String . class + " in order to be converted to JSON. Offending map is " + object ) ; } try { jsonObject . add ( ( String ) entry . getKey ( ) , toJsonInternal ( entry . getValue ( ) , ignoreNullValuedProperties ) ) ; } catch ( ParseException | IllegalArgumentException e ) { throw new FacebookJsonMappingException ( "Unable to process value '" + entry . getValue ( ) + "' for key '" + entry . getKey ( ) + "' in Map " + object , e ) ; } } return jsonObject ; } if ( isPrimitive ( object ) ) { return primitiveToJsonValue ( object ) ; } if ( object instanceof BigInteger ) { return Json . value ( ( ( BigInteger ) object ) . longValue ( ) ) ; } if ( object instanceof BigDecimal ) { return Json . value ( ( ( BigDecimal ) object ) . doubleValue ( ) ) ; } if ( object instanceof Enum ) { return Json . value ( ( ( Enum ) object ) . name ( ) ) ; } if ( object instanceof Date ) { return Json . value ( DateUtils . toLongFormatFromDate ( ( Date ) object ) ) ; } // We ' ve passed the special - case bits , so let ' s try to marshal this as a // plain old Javabean . . . List < FieldWithAnnotation < Facebook > > fieldsWithAnnotation = findFieldsWithAnnotation ( object . getClass ( ) , Facebook . class ) ; JsonObject jsonObject = new JsonObject ( ) ; // No longer throw an exception in this case . If there are multiple fields // with the same @ Facebook value , it ' s luck of the draw which is picked for // JSON marshaling . // TODO : A better implementation would query each duplicate - mapped field . If // it has is a non - null value and the other duplicate values are null , use // the non - null field . Set < String > facebookFieldNamesWithMultipleMappings = facebookFieldNamesWithMultipleMappings ( fieldsWithAnnotation ) ; if ( ! facebookFieldNamesWithMultipleMappings . isEmpty ( ) && MAPPER_LOGGER . isDebugEnabled ( ) ) { MAPPER_LOGGER . debug ( "Unable to convert to JSON because multiple @{} annotations for the same name are present: {}" , Facebook . class . getSimpleName ( ) , facebookFieldNamesWithMultipleMappings ) ; } for ( FieldWithAnnotation < Facebook > fieldWithAnnotation : fieldsWithAnnotation ) { String facebookFieldName = getFacebookFieldName ( fieldWithAnnotation ) ; fieldWithAnnotation . getField ( ) . setAccessible ( true ) ; try { Object fieldValue = fieldWithAnnotation . getField ( ) . get ( object ) ; if ( ! ( ignoreNullValuedProperties && ( fieldValue == null || isEmptyCollectionOrMap ( fieldValue ) ) ) ) { jsonObject . add ( facebookFieldName , toJsonInternal ( fieldValue , ignoreNullValuedProperties ) ) ; } } catch ( Exception e ) { throw new FacebookJsonMappingException ( "Unable to process field '" + facebookFieldName + "' for " + object . getClass ( ) , e ) ; } } return jsonObject ;
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 array length isn ' t specified . This ruins the matrix size // specification since the matrix shouldn ' t actually be that big . // However , because this is an implementation artifact , we can ' t check // for it explicitly with an exception . Therefore , put in an assert to // indicate what is likely going on if asserts are enabled for debugging // they symptoms . assert row . length ( ) != Integer . MAX_VALUE : "adding a column whose " + "length is Integer.MAX_VALUE (was likley left unspecified in the " + " constructor)." ; // Write the row to the file . int [ ] nonZero = row . getElementIndices ( ) ; nonZeroValues += nonZero . length ; StringBuilder sb = new StringBuilder ( ) ; for ( int i : nonZero ) { sb . append ( i + 1 ) . append ( " " ) ; sb . append ( row . get ( i ) . floatValue ( ) ) . append ( " " ) ; } writer . println ( sb . toString ( ) ) ; return ++ curRow ;
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 . util . Collection ) } or * { @ link # withTargetGroupPairInfoList ( java . util . Collection ) } if you want to override the existing values . * @ param targetGroupPairInfoList * The target group pair information . This is an array of < code > TargeGroupPairInfo < / code > objects with a * maximum size of one . * @ return Returns a reference to this object so that method calls can be chained together . */ public LoadBalancerInfo withTargetGroupPairInfoList ( TargetGroupPairInfo ... targetGroupPairInfoList ) { } }
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 */ private static boolean hasSameContent ( final InputStream stream1 , final InputStream stream2 ) throws IOException { } }
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_COLOR ) ; properties . remove ( Params . BACKGROUND ) ; return Util . propertiesToUrl ( properties ) ;
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 chaining */ public MYSELF defaultValueProperty ( String ... properties ) { } }
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 optionalSerializer * it is preferred to use a designated resource prefix ( for example META - INF / reflections but not just META - INF ) , * so that relevant urls could be found much faster * @ param optionalSerializer - optionally supply one serializer instance . if not specified or null , { @ link org . reflections . serializers . XmlSerializer } will be used */ public static Reflections collect ( final String packagePrefix , final Predicate < String > resourceNameFilter , @ Nullable Serializer ... optionalSerializer ) { } }
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 reflections = new Reflections ( ) ; Iterable < Vfs . File > files = Vfs . findFiles ( urls , packagePrefix , resourceNameFilter ) ; for ( final Vfs . File file : files ) { InputStream inputStream = null ; try { inputStream = file . openInputStream ( ) ; reflections . merge ( serializer . read ( inputStream ) ) ; } catch ( IOException e ) { throw new ReflectionsException ( "could not merge " + file , e ) ; } finally { close ( inputStream ) ; } } if ( log != null ) { Store store = reflections . getStore ( ) ; int keys = 0 ; int values = 0 ; for ( String index : store . keySet ( ) ) { keys += store . get ( index ) . keySet ( ) . size ( ) ; values += store . get ( index ) . size ( ) ; } log . info ( format ( "Reflections took %d ms to collect %d url%s, producing %d keys and %d values [%s]" , System . currentTimeMillis ( ) - start , urls . size ( ) , urls . size ( ) > 1 ? "s" : "" , keys , values , Joiner . on ( ", " ) . join ( urls ) ) ) ; } return reflections ;
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_domain_new_GET ( String domain , OvhOfferEnum offer ) throws IOException { } }
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 instance representing the newly created file * @ throws IOException if something goes wrong */ protected NetworkFile internalCreateFile ( SrvSession session , TreeConnection connection , FileOpenParams params , String typeName ) throws IOException { } }
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 ( cmsPath , OpenCms . getResourceManager ( ) . getResourceType ( typeName ) . getTypeId ( ) ) ; tryUnlock ( cms , cmsPath ) ; CmsJlanNetworkFile result = new CmsJlanNetworkFile ( cms , createdResource , path ) ; result . setFullName ( params . getPath ( ) ) ; return result ; } catch ( CmsVfsResourceAlreadyExistsException e ) { throw new FileExistsException ( "File exists: " + path ) ; } catch ( CmsException e ) { throw new IOException ( e ) ; }