signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class ExtendedProperties { /** * Created an instance from the specified { @ link java . util . Properties } instance .
* @ param props
* The properties instance
* @ return The { @ link ExtendedProperties } instance */
public static ExtendedProperties fromProperties ( final Properties props ) { } } | ExtendedProperties result = new ExtendedProperties ( ) ; for ( Enumeration < ? > en = props . propertyNames ( ) ; en . hasMoreElements ( ) ; ) { String key = ( String ) en . nextElement ( ) ; String value = props . getProperty ( key ) ; result . put ( key , value ) ; } return result ; |
public class InstallToRemoteAccessSessionRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( InstallToRemoteAccessSessionRequest installToRemoteAccessSessionRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( installToRemoteAccessSessionRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( installToRemoteAccessSessionRequest . getRemoteAccessSessionArn ( ) , REMOTEACCESSSESSIONARN_BINDING ) ; protocolMarshaller . marshall ( installToRem... |
public class RegularEnumSet { /** * Adds all of the elements in the specified collection to this set .
* @ param c collection whose elements are to be added to this set
* @ return < tt > true < / tt > if this set changed as a result of the call
* @ throws NullPointerException if the specified collection or any
... | if ( ! ( c instanceof RegularEnumSet ) ) return super . addAll ( c ) ; RegularEnumSet < ? > es = ( RegularEnumSet < ? > ) c ; if ( es . elementType != elementType ) { if ( es . isEmpty ( ) ) return false ; else throw new ClassCastException ( es . elementType + " != " + elementType ) ; } long oldElements = elements ; el... |
public class Fetcher { /** * Adds the element and all its children
* ( found via traversing into object properties that
* pass all the filters defined in the Constructor , and
* also taking # isSkipSubPathways into account )
* to the target model .
* This method fails if there are different child objects
* ... | if ( ! model . containsID ( element . getUri ( ) ) ) model . add ( element ) ; Set < BioPAXElement > children = fetch ( element ) ; for ( BioPAXElement e : children ) { if ( ! model . containsID ( e . getUri ( ) ) ) { model . add ( e ) ; } else if ( ! model . contains ( e ) ) { throw new AssertionError ( "fetch(bioPAXE... |
public class StreamableTuple { /** * Creates a tuple with the specified two objects . */
public static < L , R > StreamableTuple < L , R > newTuple ( L left , R right ) { } } | return new StreamableTuple < L , R > ( left , right ) ; |
public class JKObjectUtil { /** * Checks if is boolean .
* @ param type the type
* @ return true , if is boolean */
public static boolean isBoolean ( final Class type ) { } } | if ( Boolean . class . isAssignableFrom ( type ) ) { return true ; } return type . getName ( ) . equals ( "boolean" ) ; |
public class ZipArchive { /** * Adds a file to a ZIP archive , given its path .
* @ param zipEntry
* the name of the entry in the archive ; if null , the name of the original
* file is used .
* @ param filename
* The path of a file to be added to the ZIP archive . */
public void addFile ( String zipEntry , St... | addFile ( zipEntry , new File ( filename ) ) ; |
public class MatrixVectorReader { /** * Reads a coordinate vector . First data array contains real entries , and
* the second contains imaginary entries */
public void readCoordinate ( int [ ] index , float [ ] dataR , float [ ] dataI ) throws IOException { } } | int size = index . length ; if ( size != dataR . length || size != dataI . length ) throw new IllegalArgumentException ( "All arrays must be of the same size" ) ; for ( int i = 0 ; i < size ; ++ i ) { index [ i ] = getInt ( ) ; dataR [ i ] = getFloat ( ) ; dataI [ i ] = getFloat ( ) ; } |
public class SystemUtil { /** * Tries to get the current version of MacOS / MacOS X .
* The version usually looks like ' 10.13.4 ' , where the part behind the last dot represents the patchlevel .
* The major version in this case would be ' 10.13 ' .
* @ return version without patchlevel or null */
public static S... | if ( ! isMacOs ( ) ) { return null ; } String osVersion = System . getProperty ( "os.version" ) ; if ( osVersion != null ) { String [ ] split = osVersion . split ( "\\." ) ; if ( split . length >= 2 ) { return split [ 0 ] + "." + split [ 1 ] ; } else { return osVersion ; } } return null ; |
public class ContactsApi { /** * Get a list of contacts for the calling user .
* < br >
* This method requires authentication with ' read ' permission .
* @ param filter Optional . Filter the results that are returned .
* @ param page Optional . The page of results to return . If this argument is zero , it defa... | Map < String , String > params = new TreeMap < > ( ) ; params . put ( "method" , "flickr.contacts.getList" ) ; if ( filter != null ) { params . put ( "filter" , filter . toString ( ) ) ; } if ( page > 0 ) { params . put ( "page" , Integer . toString ( page ) ) ; } if ( perPage > 0 ) { params . put ( "per_page" , Intege... |
public class MediaStoreServiceImpl { /** * Extract a list of imageDTO from current cursor with the given offset and limit .
* @ param cursor
* @ param offset
* @ param limit
* @ return */
protected List < ImageDTO > extractImagesFromCursor ( Cursor cursor , int offset , int limit ) { } } | List < ImageDTO > images = new ArrayList < > ( ) ; int count = 0 ; int begin = offset > 0 ? offset : 0 ; if ( cursor . moveToPosition ( begin ) ) { do { ImageDTO image = extractOneImageFromCurrentCursor ( cursor ) ; images . add ( image ) ; count ++ ; if ( limit > 0 && count > limit ) { break ; } } while ( cursor . mov... |
public class AbstractXtypeSemanticSequencer { /** * Contexts :
* JvmTypeReference returns JvmGenericArrayTypeReference
* JvmTypeReference . JvmGenericArrayTypeReference _ 0_1_0_0 returns JvmGenericArrayTypeReference
* JvmArgumentTypeReference returns JvmGenericArrayTypeReference
* Constraint :
* componentType... | if ( errorAcceptor != null ) { if ( transientValues . isValueTransient ( semanticObject , TypesPackage . Literals . JVM_GENERIC_ARRAY_TYPE_REFERENCE__COMPONENT_TYPE ) == ValueTransient . YES ) errorAcceptor . accept ( diagnosticProvider . createFeatureValueMissing ( semanticObject , TypesPackage . Literals . JVM_GENERI... |
public class SchemaTypeResource { /** * - - - - - public static methods - - - - - */
public static ResultStream getSchemaTypeResult ( final SecurityContext securityContext , final Class type , final String propertyView ) throws FrameworkException { } } | return new PagingIterable < > ( SchemaHelper . getSchemaTypeInfo ( securityContext , rawType , type , propertyView ) ) ; |
public class DeviceAttributeDAODefaultImpl { public void insert_ul ( final long [ ] argIn ) { } } | attributeValue_5 . data_format = AttrDataFormat . FMT_UNKNOWN ; final int [ ] values = new int [ argIn . length ] ; for ( int i = 0 ; i < argIn . length ; i ++ ) { values [ i ] = ( int ) argIn [ i ] ; } attributeValue_5 . w_dim . dim_x = argIn . length ; attributeValue_5 . w_dim . dim_y = 0 ; if ( use_union ) { attribu... |
public class Cookie { /** * Equivalent to { @ link # builder ( String , String ) } .
* @ param name the cookie ' s name
* @ param value the cookie ' s value
* @ return the new builder */
public static Builder cookie ( String name , String value ) { } } | return builder ( name , value ) // Populate default :
. setPath ( "/" ) . setHttpOnly ( true ) . setSecure ( false ) . setMaxAge ( 3600 ) ; |
public class StaticCalendarDetector { /** * Remembers the class name and resets temporary fields . */
@ Override public void visit ( JavaClass someObj ) { } } | currentClass = someObj . getClassName ( ) ; currentMethod = null ; currentCFG = null ; currentLockDataFlow = null ; sawDateClass = false ; |
public class RecyclerAdapterHelper { /** * Calls adapter ' s notify * methods when items are added / removed / moved / updated . */
public static < T > void notifyChanges ( RecyclerView . Adapter < ? > adapter , final List < T > oldList , final List < T > newList ) { } } | DiffUtil . calculateDiff ( new DiffUtil . Callback ( ) { @ Override public int getOldListSize ( ) { return oldList == null ? 0 : oldList . size ( ) ; } @ Override public int getNewListSize ( ) { return newList == null ? 0 : newList . size ( ) ; } @ Override public boolean areItemsTheSame ( int oldItemPosition , int new... |
public class AiMaterial { /** * Returns the texture mapping mode for the v axis . < p >
* If missing , defaults to { @ link AiTextureMapMode # CLAMP }
* @ param type the texture type
* @ param index the index in the texture stack
* @ return the texture mapping mode */
public AiTextureMapMode getTextureMapModeV ... | checkTexRange ( type , index ) ; Property p = getProperty ( PropertyKey . TEX_MAP_MODE_V . m_key ) ; if ( null == p || null == p . getData ( ) ) { return ( AiTextureMapMode ) m_defaults . get ( PropertyKey . TEX_MAP_MODE_V ) ; } return AiTextureMapMode . fromRawValue ( p . getData ( ) ) ; |
public class LdapIdentityStoreDefinitionWrapper { /** * Evaluate and return the groupSearchFilter .
* @ param immediateOnly If true , only return a non - null value if the setting is either an
* immediate EL expression or not set by an EL expression . If false , return the
* value regardless of where it is evalua... | try { return elHelper . processString ( "groupSearchFilter" , this . idStoreDefinition . groupSearchFilter ( ) , immediateOnly ) ; } catch ( IllegalArgumentException e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isWarningEnabled ( ) ) { Tr . warning ( tc , "There was an error resolving the '{1}' configura... |
public class QuickSelect { /** * Sort a small array using repetitive insertion sort .
* @ param data Data to sort
* @ param start Interval start
* @ param end Interval end */
private static void insertionSort ( double [ ] data , int start , int end ) { } } | for ( int i = start + 1 ; i < end ; i ++ ) { for ( int j = i ; j > start && data [ j - 1 ] > data [ j ] ; j -- ) { swap ( data , j , j - 1 ) ; } } |
public class Num { /** * Return count of number in reminder .
* @ return */
public int remainderSize ( ) { } } | BigDecimal fraction = remainder ( ) ; String tmp = fraction . toString ( ) ; int n = tmp . indexOf ( Properties . DEFAULT_DECIMAL_SEPARATOR ) ; if ( n != - 1 ) { return tmp . length ( ) - n - 1 ; } else return 0 ; |
public class MapboxNavigation { /** * Calling this method with { @ link DirectionsRouteType # NEW _ ROUTE } begins a new navigation session using the
* provided directions route . If called with { @ link DirectionsRouteType # FRESH _ ROUTE } , only leg annotation data
* will be update - can be used with { @ link Ro... | startNavigationWith ( directionsRoute , routeType ) ; |
public class PerformanceMonitorBeanFactory { /** * Find an existing { @ link PerformanceMonitorBean }
* @ param name the value for the { @ link PerformanceMonitorBean }
* @ return the found { @ link PerformanceMonitorBean } , or null if it is not
* found . */
public PerformanceMonitorBean findPerformanceMonitorBe... | PerformanceMonitor performanceMonitor = findPerformanceMonitor ( name ) ; if ( performanceMonitor instanceof PerformanceMonitorBean ) { return ( PerformanceMonitorBean ) performanceMonitor ; } return null ; |
public class SARLRuntime { /** * Replies if the given SRE is provided by the Eclipse platform
* through an extension point .
* @ param sre the sre .
* @ return < code > true < / code > if the SRE was provided through an extension
* point . */
public static boolean isPlatformSRE ( ISREInstall sre ) { } } | if ( sre != null ) { LOCK . lock ( ) ; try { return platformSREInstalls . contains ( sre . getId ( ) ) ; } finally { LOCK . unlock ( ) ; } } return false ; |
public class BinaryJedis { /** * SETNX works exactly like { @ link # set ( byte [ ] , byte [ ] ) SET } with the only difference that if the
* key already exists no operation is performed . SETNX actually means " SET if Not eXists " .
* Time complexity : O ( 1)
* @ param key
* @ param value
* @ return Integer ... | checkIsInMultiOrPipeline ( ) ; client . setnx ( key , value ) ; return client . getIntegerReply ( ) ; |
public class LongSequenceIDSource { /** * { @ inheritDoc } */
public Long nextID ( ) { } } | lock . lock ( ) ; try { if ( lastID == Long . MAX_VALUE ) { long days = ( System . currentTimeMillis ( ) - startTime ) / SECONDS_IN_DAY ; throw new IDSourceExhaustedException ( "64-bit ID source exhausted after " + days + " days." ) ; } ++ lastID ; return lastID ; } finally { lock . unlock ( ) ; } |
public class AptControlImplementation { /** * Initializes the list of EventAdaptors for this ControlImpl */
protected void initEventAdaptors ( ) { } } | if ( _implDecl == null || _implDecl . getMethods ( ) == null ) return ; for ( MethodDeclaration implMethod : _implDecl . getMethods ( ) ) { // Do a quick check for the presence of the EventHandler annotation on methods
if ( implMethod . getAnnotation ( EventHandler . class ) == null || implMethod . toString ( ) . equal... |
public class ReferenceSoapRequestHandler { /** * { @ inheritDoc } */
@ WebMethod @ Override public void addAttack ( Attack attack ) throws NotAuthorizedException { } } | checkAuthorization ( Action . ADD_ATTACK ) ; attack . setDetectionSystem ( new DetectionSystem ( getClientApplicationName ( ) ) ) ; appSensorServer . getAttackStore ( ) . addAttack ( attack ) ; |
public class MapElementGroup { /** * Add the given element into the group .
* @ param element the element to add . */
void add ( MapElement element ) { } } | final Rectangle2d r = element . getBoundingBox ( ) ; if ( r != null ) { if ( Double . isNaN ( this . minx ) || this . minx > r . getMinX ( ) ) { this . minx = r . getMinX ( ) ; } if ( Double . isNaN ( this . maxx ) || this . maxx < r . getMaxX ( ) ) { this . maxx = r . getMaxX ( ) ; } if ( Double . isNaN ( this . miny ... |
public class LongTermRetentionBackupsInner { /** * Deletes a long term retention backup .
* @ param locationName The location of the database
* @ param longTermRetentionServerName the String value
* @ param longTermRetentionDatabaseName the String value
* @ param backupName The backup name .
* @ param service... | return ServiceFuture . fromResponse ( deleteWithServiceResponseAsync ( locationName , longTermRetentionServerName , longTermRetentionDatabaseName , backupName ) , serviceCallback ) ; |
public class RestoreTableToPointInTimeRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( RestoreTableToPointInTimeRequest restoreTableToPointInTimeRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( restoreTableToPointInTimeRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( restoreTableToPointInTimeRequest . getSourceTableName ( ) , SOURCETABLENAME_BINDING ) ; protocolMarshaller . marshall ( restoreTableToPointInTimeRequest... |
public class ST_Split { /** * Split a geometry a according a geometry b using a snapping tolerance .
* This function support only the operations :
* - split a line or a multiline with a point .
* @ param geomA the geometry to be splited
* @ param geomB the geometry used to split
* @ param tolerance a distance... | if ( geomA instanceof Polygon ) { throw new SQLException ( "Split a Polygon by a line is not supported using a tolerance. \n" + "Please used ST_Split(geom1, geom2)" ) ; } else if ( geomA instanceof LineString ) { if ( geomB instanceof LineString ) { throw new SQLException ( "Split a line by a line is not supported usin... |
public class IntStreamEx { /** * Returns an effectively unlimited stream of pseudorandom { @ code int }
* values , each conforming to the given origin ( inclusive ) and bound
* ( exclusive ) .
* @ param random a { @ link Random } object to produce the stream from
* @ param randomNumberOrigin the origin ( inclus... | return seq ( random . ints ( randomNumberOrigin , randomNumberBound ) ) ; |
public class DFSContentProvider { /** * / * @ inheritDoc */
public boolean hasChildren ( Object element ) { } } | if ( element instanceof DFSContent ) { DFSContent content = ( DFSContent ) element ; return content . hasChildren ( ) ; } return false ; |
public class Matrix4f { /** * Apply a symmetric perspective projection frustum transformation for a left - handed coordinate system
* using the given NDC z range to this matrix and store the result in < code > dest < / code > .
* If < code > M < / code > is < code > this < / code > matrix and < code > P < / code > ... | if ( ( properties & PROPERTY_IDENTITY ) != 0 ) return dest . setPerspectiveLH ( fovy , aspect , zNear , zFar , zZeroToOne ) ; return perspectiveLHGeneric ( fovy , aspect , zNear , zFar , zZeroToOne , dest ) ; |
public class GridFilesystem { /** * Opens an InputStream for reading from the file denoted by pathname .
* @ param pathname the full path of the file to read from
* @ return an InputStream for reading from the file
* @ throws FileNotFoundException if the file does not exist or is a directory */
public InputStream... | GridFile file = ( GridFile ) getFile ( pathname ) ; checkFileIsReadable ( file ) ; return new GridInputStream ( file , data ) ; |
public class OfflineDownloadService { /** * When a particular download has been completed , this method ' s called which handles removing the
* notification and setting the download state .
* @ param offlineRegion the region which has finished being downloaded
* @ param offlineDownload the corresponding options u... | OfflineDownloadStateReceiver . dispatchSuccessBroadcast ( this , offlineDownload ) ; offlineRegion . setDownloadState ( OfflineRegion . STATE_INACTIVE ) ; offlineRegion . setObserver ( null ) ; removeOfflineRegion ( offlineDownload . uuid ( ) . intValue ( ) ) ; |
public class SplitPaneLayout { /** * Sets the current position of the splitter as a percentage of the layout .
* @ param position the desired position of the splitter */
public void setSplitterPositionPercent ( float position ) { } } | mSplitterPosition = Integer . MIN_VALUE ; mSplitterPositionPercent = clamp ( position , 0 , 1 ) ; remeasure ( ) ; notifySplitterPositionChanged ( false ) ; |
public class JavacFiler { /** * Upon close , register files opened by create { Source , Class } File
* for annotation processing . */
private void closeFileObject ( String typeName , FileObject fileObject ) { } } | /* * If typeName is non - null , the file object was opened as a
* source or class file by the user . If a file was opened as
* a resource , typeName will be null and the file is * not *
* subject to annotation processing . */
if ( ( typeName != null ) ) { if ( ! ( fileObject instanceof JavaFileObject ) ) throw n... |
public class HttpHealthCheck { /** * Adds a HTTP header , which will be sent with the HTTP request to the health check URL .
* @ param name the name of the header
* @ param value the value of the header */
public void addHeader ( String name , String value ) { } } | if ( name == null || name . trim ( ) . length ( ) == 0 ) { throw new IllegalArgumentException ( "The header name must not be null or empty." ) ; } if ( value == null ) { throw new IllegalArgumentException ( "The header value must not be null." ) ; } this . headers . put ( name , value ) ; |
public class Postcard { /** * Inserts a long value into the mapping of this Bundle , replacing
* any existing value for the given key .
* @ param key a String , or null
* @ param value a long
* @ return current */
public Postcard withLong ( @ Nullable String key , long value ) { } } | mBundle . putLong ( key , value ) ; return this ; |
public class RubyIO { /** * Returns a { @ link RubyEnumerator } of lines in given file .
* @ param file
* a File
* @ return { @ link RubyEnumerator } */
public static RubyEnumerator < String > foreach ( File file ) { } } | return Ruby . Enumerator . of ( new EachLineIterable ( file ) ) ; |
public class IntStream { /** * Applies custom operator on stream .
* Transforming function can return { @ code IntStream } for intermediate operations ,
* or any value for terminal operation .
* < p > Operator examples :
* < pre > < code >
* / / Intermediate operator
* public class Zip & lt ; T & gt ; imple... | Objects . requireNonNull ( function ) ; return function . apply ( this ) ; |
public class ServerRedirectService { /** * Add server redirect to a profile
* @ param region region
* @ param srcUrl source URL
* @ param destUrl destination URL
* @ param hostHeader host header
* @ param profileId profile ID
* @ param groupId group ID
* @ return ID of added ServerRedirect
* @ throws Ex... | int serverId = - 1 ; PreparedStatement statement = null ; ResultSet results = null ; try ( Connection sqlConnection = sqlService . getConnection ( ) ) { statement = sqlConnection . prepareStatement ( "INSERT INTO " + Constants . DB_TABLE_SERVERS + "(" + Constants . SERVER_REDIRECT_REGION + "," + Constants . SERVER_REDI... |
public class LineItemSummary { /** * Gets the lineItemType value for this LineItemSummary .
* @ return lineItemType * Indicates the line item type of a { @ code LineItem } . This attribute
* is required .
* The line item type determines the default priority
* of the line item . More information can be
* found... | return lineItemType ; |
public class DatanodeDescriptor { /** * Store block replication work . */
void addBlockToBeReplicated ( Block block , DatanodeDescriptor [ ] targets ) { } } | assert ( block != null && targets != null && targets . length > 0 ) ; replicateBlocks . offer ( block , targets ) ; |
public class SyncGroupsInner { /** * Gets a collection of hub database schemas .
* @ param nextPageLink The NextLink from the previous successful call to List operation .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to the PagedList & lt ; SyncFullSchemaPr... | return listHubSchemasNextWithServiceResponseAsync ( nextPageLink ) . map ( new Func1 < ServiceResponse < Page < SyncFullSchemaPropertiesInner > > , Page < SyncFullSchemaPropertiesInner > > ( ) { @ Override public Page < SyncFullSchemaPropertiesInner > call ( ServiceResponse < Page < SyncFullSchemaPropertiesInner > > re... |
public class AbstractTypeComputer { /** * / * @ Nullable */
protected < Type extends JvmType > Type findDeclaredType ( Class < ? > clazz , ITypeReferenceOwner owner ) { } } | @ SuppressWarnings ( "unchecked" ) Type result = ( Type ) services . getTypeReferences ( ) . findDeclaredType ( clazz , owner . getContextResourceSet ( ) ) ; return result ; |
public class HttpsURLConnection { /** * Sets the default < code > SSLSocketFactory < / code > inherited by new
* instances of this class .
* The socket factories are used when creating sockets for secure
* https URL connections .
* @ param sf the default SSL socket factory
* @ throws IllegalArgumentException ... | if ( sf == null ) { throw new IllegalArgumentException ( "no default SSLSocketFactory specified" ) ; } SecurityManager sm = System . getSecurityManager ( ) ; if ( sm != null ) { sm . checkSetFactory ( ) ; } defaultSSLSocketFactory = sf ; |
public class CheckDomainTransferabilityRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( CheckDomainTransferabilityRequest checkDomainTransferabilityRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( checkDomainTransferabilityRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( checkDomainTransferabilityRequest . getDomainName ( ) , DOMAINNAME_BINDING ) ; protocolMarshaller . marshall ( checkDomainTransferabilityRequest . getA... |
public class SignatureUtils { /** * returns a List of parameter signatures
* @ param methodSignature
* the signature of the method to parse
* @ return a list of parameter signatures */
public static List < String > getParameterSignatures ( String methodSignature ) { } } | int start = methodSignature . indexOf ( '(' ) + 1 ; int limit = methodSignature . lastIndexOf ( ')' ) ; if ( ( limit - start ) == 0 ) { return Collections . emptyList ( ) ; } List < String > parmSignatures = new ArrayList < > ( ) ; int sigStart = start ; for ( int i = start ; i < limit ; i ++ ) { if ( ! methodSignature... |
public class Functions { /** * Returns a function that computes the age in seconds . The value passed into the function
* should be a timestamp in milliseconds since the epoch . Typically this will be the return
* value from calling { @ link java . lang . System # currentTimeMillis ( ) } .
* @ param clock
* Clo... | return new DoubleFunction < AtomicLong > ( ) { @ Override public double apply ( double t ) { return ( clock . wallTime ( ) - t ) / 1000.0 ; } } ; |
public class Long { /** * Returns the value obtained by reversing the order of the bytes in the
* two ' s complement representation of the specified { @ code long } value .
* @ param i the value whose bytes are to be reversed
* @ return the value obtained by reversing the bytes in the specified
* { @ code long ... | i = ( i & 0x00ff00ff00ff00ffL ) << 8 | ( i >>> 8 ) & 0x00ff00ff00ff00ffL ; return ( i << 48 ) | ( ( i & 0xffff0000L ) << 16 ) | ( ( i >>> 16 ) & 0xffff0000L ) | ( i >>> 48 ) ; |
public class AudioWife { /** * Initialize and prepare the audio player */
private void initPlayer ( Context ctx ) { } } | mMediaPlayer = new MediaPlayer ( ) ; mMediaPlayer . setAudioStreamType ( AudioManager . STREAM_MUSIC ) ; try { mMediaPlayer . setDataSource ( ctx , mUri ) ; } catch ( IllegalArgumentException e ) { e . printStackTrace ( ) ; } catch ( SecurityException e ) { e . printStackTrace ( ) ; } catch ( IllegalStateException e ) ... |
public class PermissionTemplateService { /** * Return the permission template for the given component . If no template key pattern match then consider default
* template for the component qualifier . */
@ CheckForNull private PermissionTemplateDto findTemplate ( DbSession dbSession , ComponentDto component ) { } } | String organizationUuid = component . getOrganizationUuid ( ) ; List < PermissionTemplateDto > allPermissionTemplates = dbClient . permissionTemplateDao ( ) . selectAll ( dbSession , organizationUuid , null ) ; List < PermissionTemplateDto > matchingTemplates = new ArrayList < > ( ) ; for ( PermissionTemplateDto permis... |
public class Mnemonic { /** * / * Converts a String to the correct case . */
private String sanitize ( String str ) { } } | if ( wordcase == CASE_UPPER ) return str . toUpperCase ( ) ; else if ( wordcase == CASE_LOWER ) return str . toLowerCase ( ) ; return str ; |
public class CorcInputFormat { /** * This is to work around an issue reading from ORC transactional data sets that contain only deltas . These contain
* synthesised column names that are not usable to us . */
private Path getSplitPath ( FileSplit inputSplit , JobConf conf ) throws IOException { } } | Path path = inputSplit . getPath ( ) ; if ( inputSplit instanceof OrcSplit ) { OrcSplit orcSplit = ( OrcSplit ) inputSplit ; List < Long > deltas = orcSplit . getDeltas ( ) ; if ( ! orcSplit . hasBase ( ) && deltas . size ( ) >= 2 ) { throw new IOException ( "Cannot read valid StructTypeInfo from delta only file: " + p... |
public class TorqueModelDef { /** * Tries to return the single target table to which the given foreign key columns map in
* all m : n collections that target this indirection table .
* @ param targetClassDef The original target class
* @ param indirectionTable The indirection table
* @ param foreignKeys The for... | ModelDef modelDef = ( ModelDef ) targetClassDef . getOwner ( ) ; String tableName = null ; for ( Iterator classIt = modelDef . getClasses ( ) ; classIt . hasNext ( ) ; ) { ClassDescriptorDef curClassDef = ( ClassDescriptorDef ) classIt . next ( ) ; if ( ! curClassDef . getBooleanProperty ( PropertyHelper . OJB_PROPERTY... |
public class A_CmsImport { /** * Imports a single group . < p >
* @ param name the name of the group
* @ param description group description
* @ param flags group flags
* @ param parentgroupName name of the parent group
* @ throws CmsImportExportException if something goes wrong */
protected void importGroup ... | if ( description == null ) { description = "" ; } CmsGroup parentGroup = null ; try { if ( CmsStringUtil . isNotEmpty ( parentgroupName ) ) { try { parentGroup = m_cms . readGroup ( parentgroupName ) ; } catch ( CmsException exc ) { // parentGroup will be null
} } if ( CmsStringUtil . isNotEmpty ( parentgroupName ) && ... |
public class DistributedObjectUtil { /** * Gets the name of the given distributed object .
* @ param distributedObject the { @ link DistributedObject } instance whose name is requested
* @ return name of the given distributed object */
public static String getName ( DistributedObject distributedObject ) { } } | /* * The motivation of this behaviour is that some distributed objects ( ` ICache ` ) can have prefixed name .
* For example , for the point of view of cache ,
* it has pure name and full name which contains prefixes also .
* However both of our ` DistributedObject ` and ` javax . cache . Cache ` ( from JCache sp... |
public class LocalXAResourceImpl { /** * { @ inheritDoc } */
public int prepare ( Xid xid ) throws XAException { } } | if ( ! warned ) { log . prepareCalledOnLocaltx ( ) ; } warned = true ; return XAResource . XA_OK ; |
public class FinalHyperParameterTuningJobObjectiveMetricMarshaller { /** * Marshall the given parameter object . */
public void marshall ( FinalHyperParameterTuningJobObjectiveMetric finalHyperParameterTuningJobObjectiveMetric , ProtocolMarshaller protocolMarshaller ) { } } | if ( finalHyperParameterTuningJobObjectiveMetric == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( finalHyperParameterTuningJobObjectiveMetric . getType ( ) , TYPE_BINDING ) ; protocolMarshaller . marshall ( finalHyperParameterTuningJobObje... |
public class EvaluatorImpl { /** * Get Truth Table index */
public static int ttIndex ( Boolean bVal ) { } } | int idx = 2 ; if ( bVal != null ) { if ( bVal . booleanValue ( ) ) { idx = 0 ; } else if ( ! bVal . booleanValue ( ) ) { idx = 1 ; } } return idx ; |
public class ReflectionUtils { /** * Finds a method on the given type for the given name .
* @ param type The type
* @ param name The name
* @ return An { @ link Optional } contains the method or empty */
public static Stream < Method > findMethodsByName ( Class type , String name ) { } } | Class currentType = type ; Set < Method > methodSet = new HashSet < > ( ) ; while ( currentType != null ) { Method [ ] methods = currentType . isInterface ( ) ? currentType . getMethods ( ) : currentType . getDeclaredMethods ( ) ; for ( Method method : methods ) { if ( name . equals ( method . getName ( ) ) ) { methodS... |
public class RSAUtils { /** * Verify a signature with RSA public key , using { @ link # DEFAULT _ SIGNATURE _ ALGORITHM } .
* @ param key
* @ param message
* @ param signature
* @ return
* @ throws InvalidKeyException
* @ throws NoSuchAlgorithmException
* @ throws SignatureException */
public static boole... | return verifySignature ( key , message , signature , DEFAULT_SIGNATURE_ALGORITHM ) ; |
public class License { /** * Returns true if the license is signed and the authenticity of the signature can be checked successfully
* using the key .
* @ param key encryption key to check the authenticity of the license signature
* @ return { @ code true } if the license was properly signed and is intact . In an... | try { final var digester = MessageDigest . getInstance ( get ( DIGEST_KEY ) . getString ( ) ) ; final var ser = unsigned ( ) ; final var digestValue = digester . digest ( ser ) ; final var cipher = Cipher . getInstance ( key . getAlgorithm ( ) ) ; cipher . init ( Cipher . DECRYPT_MODE , key ) ; final var sigDigest = ci... |
public class HttpFields { /** * Format a set cookie value
* @ param cookie The cookie . */
public void addSetCookie ( Cookie cookie ) { } } | String name = cookie . getName ( ) ; String value = cookie . getValue ( ) ; int version = cookie . getVersion ( ) ; // Check arguments
if ( name == null || name . length ( ) == 0 ) throw new IllegalArgumentException ( "Bad cookie name" ) ; // Format value and params
StringBuffer buf = new StringBuffer ( 128 ) ; String ... |
public class TargetsApi { /** * Get the agent ' s personal favorites .
* @ param limit Number of results to return . The default value is 50 . ( optional )
* @ return SearchResult < Target > */
public SearchResult < Target > getPersonalFavorites ( int limit ) throws WorkspaceApiException { } } | try { TargetsResponse resp = targetsApi . getPersonalFavorites ( limit > 0 ? new BigDecimal ( limit ) : null ) ; Util . throwIfNotOk ( resp . getStatus ( ) ) ; TargetsResponseData data = resp . getData ( ) ; int total = 0 ; List < Target > list = new ArrayList < > ( ) ; if ( data != null ) { total = data . getTotalMatc... |
public class RESTRegistry { /** * Get the method - > command map for the given owner . */
private Map < String , RESTCommand > getCmdNameMap ( String cmdOwner ) { } } | SortedMap < String , RESTCommand > cmdNameMap = m_cmdsByOwnerMap . get ( cmdOwner ) ; if ( cmdNameMap == null ) { cmdNameMap = new TreeMap < > ( ) ; m_cmdsByOwnerMap . put ( cmdOwner , cmdNameMap ) ; } return cmdNameMap ; |
public class VNode { /** * Sets the bound of this VNode by given width and height
* @ param w new width
* @ param h new height */
public void setBounds ( float w , float h ) { } } | this . glyph . getBbox ( ) . setW ( w ) ; this . glyph . getBbox ( ) . setH ( h ) ; |
public class HibernateMetrics { /** * Create { @ code HibernateMetrics } and bind to the specified meter registry .
* @ param registry meter registry to use
* @ param entityManagerFactory entity manager factory to use
* @ param entityManagerFactoryName entity manager factory name as a tag value
* @ param tags a... | monitor ( registry , entityManagerFactory , entityManagerFactoryName , Tags . of ( tags ) ) ; |
public class UselessSubclassMethod { /** * TODO awaiting https : / / github . com / spotbugs / spotbugs / issues / 626 */
@ SuppressWarnings ( "PMD.SimplifyBooleanReturns" ) private boolean differentAttributes ( Method m1 , Method m2 ) { } } | if ( m1 . getAnnotationEntries ( ) . length > 0 || m2 . getAnnotationEntries ( ) . length > 0 ) { return true ; } int access1 = m1 . getAccessFlags ( ) & ( Const . ACC_PRIVATE | Const . ACC_PROTECTED | Const . ACC_PUBLIC | Const . ACC_FINAL ) ; int access2 = m2 . getAccessFlags ( ) & ( Const . ACC_PRIVATE | Const . ACC... |
public class AmazonApiGatewayClient { /** * Gets a < a > RequestValidator < / a > of a given < a > RestApi < / a > .
* @ param getRequestValidatorRequest
* Gets a < a > RequestValidator < / a > of a given < a > RestApi < / a > .
* @ return Result of the GetRequestValidator operation returned by the service .
* ... | request = beforeClientExecution ( request ) ; return executeGetRequestValidator ( request ) ; |
public class PutFileEntryMarshaller { /** * Marshall the given parameter object . */
public void marshall ( PutFileEntry putFileEntry , ProtocolMarshaller protocolMarshaller ) { } } | if ( putFileEntry == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( putFileEntry . getFilePath ( ) , FILEPATH_BINDING ) ; protocolMarshaller . marshall ( putFileEntry . getFileMode ( ) , FILEMODE_BINDING ) ; protocolMarshaller . marshall ( ... |
public class CertPath { /** * Replaces the { @ code CertPath } to be serialized with a
* { @ code CertPathRep } object .
* @ return the { @ code CertPathRep } to be serialized
* @ throws ObjectStreamException if a { @ code CertPathRep } object
* representing this certification path could not be created */
prote... | try { return new CertPathRep ( type , getEncoded ( ) ) ; } catch ( CertificateException ce ) { NotSerializableException nse = new NotSerializableException ( "java.security.cert.CertPath: " + type ) ; nse . initCause ( ce ) ; throw nse ; } |
public class PiwikRequest { /** * Set a visit custom variable with the specified key and value at the first available index .
* All visit custom variables with this key will be overwritten or deleted
* @ param key the key of the variable to set
* @ param value the value of the variable to set at the specified key... | if ( value == null ) { removeCustomVariable ( VISIT_CUSTOM_VARIABLE , key ) ; } else { setCustomVariable ( VISIT_CUSTOM_VARIABLE , new CustomVariable ( key , value ) , null ) ; } |
public class BaseApplet { /** * Link this record to the remote Ejb Table .
* This method , gets the remote database and makes a remote table , the creates a
* RemoteFieldTable for this record and ( optionally ) wraps a CacheRemoteFieldTable .
* Used ONLY for thin tables .
* @ param database ( optional ) remote ... | FieldTable table = record . getTable ( ) ; if ( table == null ) { RemoteTable remoteTable = null ; try { synchronized ( this . getRemoteTask ( ) ) { // In case this is called from another task
RemoteTask server = ( RemoteTask ) this . getRemoteTask ( ) ; Map < String , Object > dbProperties = this . getApplication ( ) ... |
public class MultiIndex { /** * Attempts to delete all files recorded in { @ link # deletable } . */
private void attemptDelete ( ) { } } | synchronized ( deletable ) { for ( Iterator < String > it = deletable . iterator ( ) ; it . hasNext ( ) ; ) { String indexName = it . next ( ) ; if ( directoryManager . delete ( indexName ) ) { it . remove ( ) ; } else { LOG . info ( "Unable to delete obsolete index: " + indexName ) ; } } } |
public class VTensor { /** * Adds a factor elementwise to this one .
* @ param other The addend .
* @ throws IllegalArgumentException If the two tensors have different sizes . */
public void elemAdd ( VTensor other ) { } } | checkEqualSize ( this , other ) ; for ( int c = 0 ; c < this . size ( ) ; c ++ ) { addValue ( c , other . getValue ( c ) ) ; } |
public class Geomem { /** * Adds a record to the in - memory store with the given position and time and
* id .
* @ param lat
* latitude
* @ param lon
* longitude
* @ param time
* time in epoch ms
* @ param t
* object
* @ param id
* identifier */
public void add ( double lat , double lon , long tim... | Info < T , R > info = new Info < T , R > ( lat , lon , time , t , id ) ; add ( info ) ; |
public class appfw_stats { /** * < pre >
* converts nitro response into object and returns the object array in case of get request .
* < / pre > */
protected base_resource [ ] get_nitro_response ( nitro_service service , String response ) throws Exception { } } | appfw_stats [ ] resources = new appfw_stats [ 1 ] ; appfw_response result = ( appfw_response ) service . get_payload_formatter ( ) . string_to_resource ( appfw_response . class , response ) ; if ( result . errorcode != 0 ) { if ( result . errorcode == 444 ) { service . clear_session ( ) ; } if ( result . severity != nu... |
public class DitaWriterFilter { /** * Relativize absolute references if possible .
* @ param attName attribute name
* @ param atts attributes
* @ return attribute value , may be { @ code null } */
private URI replaceHREF ( final QName attName , final Attributes atts ) { } } | URI attValue = toURI ( atts . getValue ( attName . getNamespaceURI ( ) , attName . getLocalPart ( ) ) ) ; if ( attValue != null ) { final String fragment = attValue . getFragment ( ) ; if ( fragment != null ) { attValue = stripFragment ( attValue ) ; } if ( attValue . toString ( ) . length ( ) != 0 ) { final URI curren... |
public class CmsPublishManager { /** * Sets the publish list remove mode . < p >
* @ param publishListRemoveMode the publish list remove mode */
public void setPublishListRemoveMode ( CmsPublishManager . PublishListRemoveMode publishListRemoveMode ) { } } | if ( m_frozen ) { throw new CmsRuntimeException ( Messages . get ( ) . container ( Messages . ERR_CONFIG_FROZEN_0 ) ) ; } m_publishListRemoveMode = publishListRemoveMode ; |
public class RemoteAccessSessionMarshaller { /** * Marshall the given parameter object . */
public void marshall ( RemoteAccessSession remoteAccessSession , ProtocolMarshaller protocolMarshaller ) { } } | if ( remoteAccessSession == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( remoteAccessSession . getArn ( ) , ARN_BINDING ) ; protocolMarshaller . marshall ( remoteAccessSession . getName ( ) , NAME_BINDING ) ; protocolMarshaller . marshall... |
public class TopologyBuilder { /** * Define a new bolt in this topology . This defines a stateful bolt , that requires its
* state ( of computation ) to be saved . When this bolt is initialized , the { @ link IStatefulBolt # initState ( State ) } method
* is invoked after { @ link IStatefulBolt # prepare ( Map , To... | hasStatefulBolt = true ; return setBolt ( id , new StatefulBoltExecutor < T > ( bolt ) , parallelism_hint ) ; |
public class ClustersInner { /** * Executes script actions on the specified HDInsight cluster .
* @ param resourceGroupName The name of the resource group .
* @ param clusterName The name of the cluster .
* @ param parameters The parameters for executing script actions .
* @ param serviceCallback the async Serv... | return ServiceFuture . fromResponse ( beginExecuteScriptActionsWithServiceResponseAsync ( resourceGroupName , clusterName , parameters ) , serviceCallback ) ; |
public class VariantToVcfSliceConverter { /** * With test visibility */
static VcfSliceProtos . Fields buildDefaultFields ( List < Variant > variants ) { } } | return buildDefaultFields ( variants , null , null ) ; |
public class GetAccountChanges { /** * Runs the example .
* @ param adWordsServices the services factory .
* @ param session the session .
* @ 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 stat... | // Get the CampaignService .
CampaignServiceInterface campaignService = adWordsServices . get ( session , CampaignServiceInterface . class ) ; // Get the CustomerSyncService .
CustomerSyncServiceInterface customerSyncService = adWordsServices . get ( session , CustomerSyncServiceInterface . class ) ; // Get a list of a... |
public class TaskManagerService { /** * Delet all task status rows , if any , related to the given application from the Tasks
* table . NOTE : This method can be called even if the TaskManagerService has not been
* initialized so that we can always cleanup deleted applications .
* @ param appDef { @ link Applicat... | String prefixName = appDef . getAppName ( ) + "/" ; String claimPrefixName = "_claim/" + prefixName ; Tenant tenant = Tenant . getTenant ( appDef ) ; DBTransaction dbTran = DBService . instance ( tenant ) . startTransaction ( ) ; for ( DRow row : DBService . instance ( tenant ) . getAllRows ( TaskManagerService . TASKS... |
public class DFSContentProvider { /** * / * @ inheritDoc */
public void inputChanged ( Viewer viewer , Object oldInput , Object newInput ) { } } | this . viewer = viewer ; if ( ( viewer != null ) && ( viewer instanceof StructuredViewer ) ) this . sviewer = ( StructuredViewer ) viewer ; else this . sviewer = null ; |
public class FailedWorkspaceChangeRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( FailedWorkspaceChangeRequest failedWorkspaceChangeRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( failedWorkspaceChangeRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( failedWorkspaceChangeRequest . getWorkspaceId ( ) , WORKSPACEID_BINDING ) ; protocolMarshaller . marshall ( failedWorkspaceChangeRequest . getErrorCode ( ) ... |
public class StatefulPassivator { /** * d430549.10 */
private EJBObjectInfo createSerializableObjectInfo ( Object parentObj ) { } } | final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "createSerializableObjectInfo" , parentObj ) ; EJBObjectInfo objectInfo = new EJBObjectInfo ( ) ; objectInfo . setSerializable ( true ) ; objectInfo . setSerializableObject ( parentObj ) ; ... |
public class FindingFilter { /** * For a record to match a filter , one of the values that is specified for this data type property must be the exact
* match of the value of the < b > autoScalingGroup < / b > property of the < a > Finding < / a > data type .
* @ param autoScalingGroups
* For a record to match a f... | if ( autoScalingGroups == null ) { this . autoScalingGroups = null ; return ; } this . autoScalingGroups = new java . util . ArrayList < String > ( autoScalingGroups ) ; |
public class TileSparklineSkin { /** * * * * * * Methods * * * * * */
@ Override protected void handleEvents ( final String EVENT_TYPE ) { } } | super . handleEvents ( EVENT_TYPE ) ; if ( "RECALC" . equals ( EVENT_TYPE ) ) { minValue = gauge . getMinValue ( ) ; maxValue = gauge . getMaxValue ( ) ; range = gauge . getRange ( ) ; redraw ( ) ; } else if ( "VISIBILITY" . equals ( EVENT_TYPE ) ) { Helper . enableNode ( titleText , ! gauge . getTitle ( ) . isEmpty ( ... |
public class AiMaterial { /** * Helper method . Returns typed property data .
* @ param < T > type
* @ param key the key
* @ param type the texture type
* @ param index the texture index
* @ param clazz type
* @ return the data */
private < T > T getTyped ( PropertyKey key , AiTextureType type , int index ,... | Property p = getProperty ( key . m_key , AiTextureType . toRawValue ( type ) , index ) ; if ( null == p || null == p . getData ( ) ) { return clazz . cast ( m_defaults . get ( key ) ) ; } return clazz . cast ( p . getData ( ) ) ; |
public class MockArtifactStore { /** * { @ inheritDoc } */
public synchronized long getMetadataLastModified ( String path ) throws IOException , MetadataNotFoundException { } } | boolean haveResult = false ; long result = 0 ; path = StringUtils . stripEnd ( StringUtils . stripStart ( path , "/" ) , "/" ) ; String groupId = path . replace ( '/' , '.' ) ; Map < String , Map < String , Map < Artifact , Content > > > artifactMap = contents . get ( groupId ) ; if ( artifactMap != null ) { for ( Map ... |
public class LiveEventsInner { /** * Get Live Event .
* Gets a Live Event .
* @ param resourceGroupName The name of the resource group within the Azure subscription .
* @ param accountName The Media Services account name .
* @ param liveEventName The name of the Live Event .
* @ throws IllegalArgumentExceptio... | return getWithServiceResponseAsync ( resourceGroupName , accountName , liveEventName ) . map ( new Func1 < ServiceResponse < LiveEventInner > , LiveEventInner > ( ) { @ Override public LiveEventInner call ( ServiceResponse < LiveEventInner > response ) { return response . body ( ) ; } } ) ; |
public class CertificatesImpl { /** * Deletes a certificate from the specified account .
* You cannot delete a certificate if a resource ( pool or compute node ) is using it . Before you can delete a certificate , you must therefore make sure that the certificate is not associated with any existing pools , the certif... | deleteWithServiceResponseAsync ( thumbprintAlgorithm , thumbprint ) . toBlocking ( ) . single ( ) . body ( ) ; |
public class OperatorForEachFuture { /** * Subscribes to the given source and calls the callback for each emitted item ,
* and surfaces the completion or error through a Future .
* @ param < T > the element type of the Observable
* @ param source the source Observable
* @ param onNext the action to call with ea... | return forEachFuture ( source , onNext , onError , Functionals . empty ( ) ) ; |
public class GeneratorRegistry { /** * Initializes the generator properties .
* @ param generator
* the generator */
private void initializeGeneratorProperties ( ResourceGenerator generator ) { } } | // Initialize the generator
if ( generator instanceof InitializingResourceGenerator ) { if ( generator instanceof ConfigurationAwareResourceGenerator ) { ( ( ConfigurationAwareResourceGenerator ) generator ) . setConfig ( config ) ; } if ( generator instanceof TypeAwareResourceGenerator ) { ( ( TypeAwareResourceGenerat... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.