signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class TraceEventHelper { /** * Get status
* @ param data The data
* @ return The status */
public static TraceEventStatus mergeStatus ( Collection < TraceEventStatus > data ) { } } | TraceEventStatus result = TraceEventStatus . GREEN ; for ( TraceEventStatus tes : data ) { if ( tes == TraceEventStatus . YELLOW ) { result = TraceEventStatus . YELLOW ; } else if ( tes == TraceEventStatus . RED ) { return TraceEventStatus . RED ; } } return result ; |
public class AWSCognitoIdentityProviderClient { /** * Starts the user import .
* @ param startUserImportJobRequest
* Represents the request to start the user import job .
* @ return Result of the StartUserImportJob operation returned by the service .
* @ throws ResourceNotFoundException
* This exception is th... | request = beforeClientExecution ( request ) ; return executeStartUserImportJob ( request ) ; |
public class AfplibFactoryImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public PGPRGPgFlgs createPGPRGPgFlgsFromString ( EDataType eDataType , String initialValue ) { } } | PGPRGPgFlgs result = PGPRGPgFlgs . get ( initialValue ) ; if ( result == null ) throw new IllegalArgumentException ( "The value '" + initialValue + "' is not a valid enumerator of '" + eDataType . getName ( ) + "'" ) ; return result ; |
public class DiagnosticGroup { /** * Returns whether all of the types in the given group are in this group . */
boolean isSubGroup ( DiagnosticGroup group ) { } } | for ( DiagnosticType type : group . types ) { if ( ! matches ( type ) ) { return false ; } } return true ; |
public class HttpRequest { /** * Parses an http message from an input stream . The first line of input is
* save in the protected < tt > command < / tt > variable . The subsequent lines are
* put into a linked hash as field / value pairs . Input is parsed until a
* blank line is reached , after which any data sho... | Pattern p = Pattern . compile ( ":" ) ; BufferedReader bin = new BufferedReader ( new InputStreamReader ( in ) , 1 ) ; String currLine = bin . readLine ( ) ; // command = currLine ;
// parse the command to get the request method
parseCommand ( currLine ) ; // parse headers
currLine = bin . readLine ( ) ; while ( currLi... |
public class ProjectsInner { /** * Get projects in a service .
* The project resource is a nested resource representing a stored migration project . This method returns a list of projects owned by a service resource .
* @ param groupName Name of the resource group
* @ param serviceName Name of the service
* @ t... | return listWithServiceResponseAsync ( groupName , serviceName ) . map ( new Func1 < ServiceResponse < Page < ProjectInner > > , Page < ProjectInner > > ( ) { @ Override public Page < ProjectInner > call ( ServiceResponse < Page < ProjectInner > > response ) { return response . body ( ) ; } } ) ; |
public class ViewDragHelper { /** * Settle the captured view at the given ( left , top ) position .
* @ param finalLeft Target left position for the captured view
* @ param finalTop Target top position for the captured view
* @ param xvel Horizontal velocity
* @ param yvel Vertical velocity
* @ return true if... | final int startLeft = mCapturedView . getLeft ( ) ; final int startTop = mCapturedView . getTop ( ) ; final int dx = finalLeft - startLeft ; final int dy = finalTop - startTop ; if ( dx == 0 && dy == 0 ) { // Nothing to do . Send callbacks , be done .
mScroller . abortAnimation ( ) ; setDragState ( STATE_IDLE ) ; retur... |
public class SwapFile { /** * Not applicable . Call get ( File , String ) method instead .
* @ throws IOException
* I / O error */
public static SwapFile createTempFile ( String prefix , String suffix , File directory ) throws IOException { } } | throw new IOException ( "Not applicable. Call get(File, String) method instead" ) ; |
public class ClientAsyncResult { /** * readObject and writeObject implementations */
private void writeObject ( java . io . ObjectOutputStream out ) throws IOException { } } | if ( svLogger . isLoggable ( Level . FINER ) ) svLogger . logp ( Level . FINER , CLASS_NAME , "writeObject" , toString ( ) ) ; // if ivServer object is null throw and exception because there is no server side
// Future object to communicate with .
if ( ivServer == null ) { throw new EJBException ( "No Server side Futur... |
public class RedisClusterStorage { /** * Store a trigger in redis
* @ param trigger the trigger to be stored
* @ param replaceExisting true if an existing trigger with the same identity should be replaced
* @ param jedis a thread - safe Redis connection
* @ throws JobPersistenceException
* @ throws ObjectAlre... | final String triggerHashKey = redisSchema . triggerHashKey ( trigger . getKey ( ) ) ; final String triggerGroupSetKey = redisSchema . triggerGroupSetKey ( trigger . getKey ( ) ) ; final String jobTriggerSetKey = redisSchema . jobTriggersSetKey ( trigger . getJobKey ( ) ) ; if ( ! ( trigger instanceof SimpleTrigger ) &&... |
public class DateParser { /** * / * TODO : things that Graphite can parse in addition :
* & from = 04:00_20110501 & until = 16:00_20110501
* ( shows 4AM - 4PM on May 1st , 2011)
* & from = 20091201 & until = 20091231
* ( shows December 2009)
* & from = noon + yesterday
* ( shows data since 12:00pm on the pr... | if ( StringUtils . isEmpty ( dateStr ) ) { return defaultDate ; } /* There are multiple formats for these functions :
& from = - RELATIVE _ TIME
& from = ABSOLUTE _ TIME
& from and & until can mix absolute and relative time if desired . */
if ( dateStr . startsWith ( "-" ) ) { /* RELATIVE _ TIME is a length of ti... |
public class CmsListTab { /** * Sets the clear list button enabled . < p >
* @ param enabled < code > true < / code > to enable the button */
public void setClearButtonEnabled ( boolean enabled ) { } } | if ( enabled ) { m_clearButton . enable ( ) ; } else { m_clearButton . disable ( Messages . get ( ) . key ( Messages . GUI_DISABLE_CLEAR_LIST_0 ) ) ; } |
public class DefaultBeanContext { /** * The start method will read all bean definition classes found on the classpath and initialize any pre - required
* state . */
@ Override public synchronized BeanContext start ( ) { } } | if ( ! isRunning ( ) ) { if ( initializing . compareAndSet ( false , true ) ) { if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( "Starting BeanContext" ) ; } readAllBeanConfigurations ( ) ; readAllBeanDefinitionClasses ( ) ; if ( LOG . isDebugEnabled ( ) ) { String activeConfigurations = beanConfigurations . values ( ) ... |
public class JarafeMETrainer { /** * @ param label - A string value that is the " gold standard " label for this training instance
* @ param features - A list of strings that correspond to the names of the features present for this training instance */
public void addTrainingInstance ( String label , List < String > ... | maxent . addInstance ( label , features ) ; |
public class FileRecyclerViewAdapter { /** * From the google examples , decodes a bitmap as a byte array and then resizes it for the required
* width and hieght .
* @ param picture the picture byte array
* @ param reqWidth the required width
* @ param reqHeight the required height
* @ return a Bitmap */
publi... | // First decode with inJustDecodeBounds = true to check dimensions
BitmapFactory . Options options = new BitmapFactory . Options ( ) ; options . inJustDecodeBounds = true ; BitmapFactory . decodeByteArray ( picture , 0 , picture . length , options ) ; // Calculate inSampleSize
options . inSampleSize = calculateInSample... |
public class SelfCalibrationGuessAndCheckFocus { /** * Given the focal lengths for the first two views compute homography H
* @ param f1 view 1 focal length
* @ param f2 view 2 focal length
* @ param P2 projective camera matrix for view 2
* @ param H ( Output ) homography
* @ return true if successful */
bool... | estimatePlaneInf . setCamera1 ( f1 , f1 , 0 , 0 , 0 ) ; estimatePlaneInf . setCamera2 ( f2 , f2 , 0 , 0 , 0 ) ; if ( ! estimatePlaneInf . estimatePlaneAtInfinity ( P2 , planeInf ) ) return false ; // TODO add a cost for distance from nominal and scale other cost by focal length fx for each view
// RefineDualQuadraticCo... |
public class ComponentVertex { /** * ( non - Javadoc )
* @ see org . jgrapes . core . core . Manager # fire
* ( org . jgrapes . core . Event , org . jgrapes . core . Channel ) */
@ Override public < T > Event < T > fire ( Event < T > event , Channel ... channels ) { } } | if ( channels . length == 0 ) { channels = event . channels ( ) ; if ( channels . length == 0 ) { channels = new Channel [ ] { channel ( ) } ; } } event . setChannels ( channels ) ; tree ( ) . fire ( event , channels ) ; return event ; |
public class Assert { /** * Check that the parameter array has exactly the right number of elements .
* @ param parameterName
* The name of the user - supplied parameter that we are validating
* so that the user can easily find the error in their code .
* @ param actualLength
* The actual array length
* @ p... | if ( actualLength != expectedLength ) { throw Exceptions . IllegalArgument ( "Array %s should have %d elements, not %d" , parameterName , expectedLength , actualLength ) ; } |
public class SyntheticStorableReferenceBuilder { /** * Sets all the properties of the given index entry , using the applicable
* properties of the given master .
* @ param indexEntry index entry whose properties will be set
* @ param master source of property values
* @ deprecated call getReferenceAccess */
@ D... | getReferenceAccess ( ) . copyFromMaster ( indexEntry , master ) ; |
public class Session { /** * Opens a session based on an existing Facebook access token , and also makes this session
* the currently active session . This method should be used
* only in instances where an application has previously obtained an access token and wishes
* to import it into the Session / TokenCachi... | Session session = new Session ( context , null , null , false ) ; setActiveSession ( session ) ; session . open ( accessToken , callback ) ; return session ; |
public class DescribeTrailsRequest { /** * Specifies a list of trail names , trail ARNs , or both , of the trails to describe . The format of a trail ARN is :
* < code > arn : aws : cloudtrail : us - east - 2:123456789012 : trail / MyTrail < / code >
* If an empty list is specified , information for the trail in th... | if ( trailNameList == null ) { this . trailNameList = null ; return ; } this . trailNameList = new com . amazonaws . internal . SdkInternalList < String > ( trailNameList ) ; |
public class XmlDataProviderImpl { /** * Generates a list of the declared type after parsing the XML file .
* @ return A { @ link List } of object of declared type { @ link XmlFileSystemResource # getCls ( ) } . */
private List < ? > loadDataFromXmlFile ( ) { } } | logger . entering ( ) ; Preconditions . checkArgument ( resource . getCls ( ) != null , "Please provide a valid type." ) ; List < ? > returned ; try { JAXBContext context = JAXBContext . newInstance ( Wrapper . class , resource . getCls ( ) ) ; Unmarshaller unmarshaller = context . createUnmarshaller ( ) ; StreamSource... |
public class ObjectPropertiesController { /** * Retrieve a single value property .
* @ param method method definition
* @ param object target object
* @ param map parameter values */
private void getSingleValue ( Method method , Object object , Map < String , String > map ) { } } | Object value ; try { value = filterValue ( method . invoke ( object ) ) ; } catch ( Exception ex ) { value = ex . toString ( ) ; } if ( value != null ) { map . put ( getPropertyName ( method ) , String . valueOf ( value ) ) ; } |
public class Axis { /** * Generates Axis with values and labels from given lists , both lists must have the same size . */
public static Axis generateAxisFromCollection ( List < Float > axisValues , List < String > axisValuesLabels ) { } } | if ( axisValues . size ( ) != axisValuesLabels . size ( ) ) { throw new IllegalArgumentException ( "Values and labels lists must have the same size!" ) ; } List < AxisValue > values = new ArrayList < AxisValue > ( ) ; int index = 0 ; for ( float value : axisValues ) { AxisValue axisValue = new AxisValue ( value ) . set... |
public class IDValueSelect { /** * { @ inheritDoc } */
@ Override public int append2SQLSelect ( final Type _type , final SQLSelect _select , final int _tableIndex , final int _colIndex ) { } } | int ret = 0 ; if ( getParent ( ) == null || ! "type" . equals ( getParent ( ) . getValueType ( ) ) ) { _select . column ( _tableIndex , "ID" ) ; getColIndexs ( ) . add ( _colIndex ) ; ret ++ ; this . attribute = _type . getAttribute ( "ID" ) ; } return ret ; |
public class MobileCommand { /** * This method forms a { @ link java . util . Map } of parameters for the
* device unlocking .
* @ return a key - value pair . The key is the command name . The value is a
* { @ link java . util . Map } command arguments . */
public static Map . Entry < String , Map < String , ? > ... | return new AbstractMap . SimpleEntry < > ( UNLOCK , ImmutableMap . of ( ) ) ; |
public class LoggingConfigurator { /** * Configure logging with default behaviour and log to stderr . If the SPOTIFY _ SYSLOG _ HOST or
* SPOTIFY _ SYSLOG _ PORT environment variable is defined , the syslog appender will be used ,
* otherwise console appender will be .
* @ param ident The logging identity .
* @... | // Call configureSyslogDefaults if the SPOTIFY _ SYSLOG _ HOST or SPOTIFY _ SYSLOG _ PORT env var is
// set . If this causes a problem , we could introduce a configureConsoleDefaults method which
// users could call instead to avoid this behavior .
final String syslogHost = getSyslogHost ( ) ; final int syslogPort = ge... |
public class PickerSpinner { /** * Removes the specified item from the adapter and takes care of handling selection changes .
* Always call this method instead of getAdapter ( ) . remove ( ) .
* Note that if you remove the selected item here , it will just reselect the next one instead of
* creating a temporary i... | PickerSpinnerAdapter adapter = ( PickerSpinnerAdapter ) getAdapter ( ) ; int count = adapter . getCount ( ) ; int selection = getSelectedItemPosition ( ) ; // check which item will be removed :
if ( index == count ) // temporary selection
selectTemporary ( null ) ; else if ( index == count - 1 && adapter . hasFooter ( ... |
public class GingerbreadPurgeableDecoder { /** * Decodes a byteArray containing jpeg encoded bytes into a purgeable bitmap
* < p > Adds a JFIF End - Of - Image marker if needed before decoding .
* @ param bytesRef the byte buffer that contains the encoded bytes
* @ param length the length of bytes for decox
* @... | byte [ ] suffix = endsWithEOI ( bytesRef , length ) ? null : EOI ; return decodeFileDescriptorAsPurgeable ( bytesRef , length , suffix , options ) ; |
public class WARCRecordToSearchResultAdapter { /** * This just calls adaptInner , returning null if an Exception is thrown : */
public CaptureSearchResult adapt ( WARCRecord rec ) { } } | try { return adaptInner ( rec ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; return null ; } catch ( OutOfMemoryError e ) { e . printStackTrace ( ) ; return null ; } |
public class A_CmsStaticExportHandler { /** * Gets the exported container pages that should be purged when the content with the given id is published . < p >
* @ param cms the current CMS context
* @ param targetId the structure id of the published content
* @ return the list of files to purge */
private List < F... | try { List < File > purgePages = new ArrayList < File > ( ) ; List < CmsRelation > relations = cms . readRelations ( CmsRelationFilter . relationsToStructureId ( targetId ) ) ; for ( CmsRelation relation : relations ) { CmsResource source = null ; try { source = relation . getSource ( cms , CmsResourceFilter . ALL ) ; ... |
public class ManagementHttpRequestProcessor { /** * This gets called in HttpShutdownService # stop ( ) to signal that the server is about to stop */
void prepareShutdown ( ) { } } | int oldState , newState ; do { oldState = state ; if ( ( oldState & CLOSED ) != 0 ) { return ; } newState = oldState | CLOSED ; } while ( ! stateUpdater . compareAndSet ( this , oldState , newState ) ) ; // If there no active requests notify listeners directly
if ( newState == CLOSED ) { handleCompleted ( ) ; } |
public class DolphinPlatformApplication { /** * This methods defines parts of the Dolphin Platform lifecyycle and is therefore defined as final .
* Use the { @ link DolphinPlatformApplication # start ( Stage , ClientContext ) } method instead .
* @ param primaryStage the primary stage
* @ throws Exception in case... | Assert . requireNonNull ( primaryStage , "primaryStage" ) ; this . primaryStage = primaryStage ; if ( initializationException == null ) { if ( clientContext != null ) { try { start ( primaryStage , clientContext ) ; } catch ( Exception e ) { handleInitializationError ( primaryStage , new ClientInitializationException (... |
public class AbstractRepositoryBuilder { /** * Throw a configuration exception if the configuration is not filled out
* sufficiently and correctly such that a repository could be instantiated
* from it . */
public final void assertReady ( ) throws ConfigurationException { } } | ArrayList < String > messages = new ArrayList < String > ( ) ; errorCheck ( messages ) ; int size = messages . size ( ) ; if ( size == 0 ) { return ; } StringBuilder b = new StringBuilder ( ) ; if ( size > 1 ) { b . append ( "Multiple problems: " ) ; } for ( int i = 0 ; i < size ; i ++ ) { if ( i > 0 ) { b . append ( "... |
public class LandmarkStorage { /** * This method calculates the landmarks and initial weightings to & from them . */
public void createLandmarks ( ) { } } | if ( isInitialized ( ) ) throw new IllegalStateException ( "Initialize the landmark storage only once!" ) ; // fill ' from ' and ' to ' weights with maximum value
long maxBytes = ( long ) graph . getNodes ( ) * LM_ROW_LENGTH ; this . landmarkWeightDA . create ( 2000 ) ; this . landmarkWeightDA . ensureCapacity ( maxByt... |
public class SRTServletRequest { /** * Returns null since this request has no concept of servlet mappings .
* This method will be overidden by the webapp layer . */
public String getPathInfo ( ) { } } | if ( WCCustomProperties . CHECK_REQUEST_OBJECT_IN_USE ) { checkRequestObjectInUse ( ) ; } SRTServletRequestThreadData reqData = SRTServletRequestThreadData . getInstance ( ) ; // Begin PK06988 , strip session id of when url rewriting is enabled
if ( reqData . getPathInfo ( ) == null ) { String aPathInfo = ( ( WebAppDis... |
public class DFSClient { /** * create the iterator from the iterative listing with block locations */
private RemoteIterator < LocatedFileStatus > iteratorListing ( final String src ) throws IOException { } } | return new RemoteIterator < LocatedFileStatus > ( ) { private LocatedDirectoryListing thisListing ; private int i ; { // initializer
// fetch the first batch of entries in the directory
thisListing = namenode . getLocatedPartialListing ( src , HdfsFileStatus . EMPTY_NAME ) ; if ( thisListing == null ) { // the director... |
public class AbstractGitFlowMojo { /** * Initializes command line executables . */
private void initExecutables ( ) { } } | if ( StringUtils . isBlank ( cmdMvn . getExecutable ( ) ) ) { if ( StringUtils . isBlank ( mvnExecutable ) ) { mvnExecutable = "mvn" ; } cmdMvn . setExecutable ( mvnExecutable ) ; } if ( StringUtils . isBlank ( cmdGit . getExecutable ( ) ) ) { if ( StringUtils . isBlank ( gitExecutable ) ) { gitExecutable = "git" ; } c... |
public class TreeMap { /** * ( non - Javadoc )
* @ see com . ibm . ws . objectManager . Map # get ( java . lang . Object , com . ibm . ws . objectManager . Transaction ) */
public synchronized Token get ( Object key , Transaction transaction ) throws ObjectManagerException { } } | if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . entry ( this , cclass , "get" , new Object [ ] { key , transaction } ) ; Entry entry = getEntry ( key , transaction ) ; Token value = null ; if ( entry != null ) value = entry . getValue ( ) ; if ( Tracing . isAnyTracingEnabled ( ) && trace ... |
public class BitmapUtils { /** * Get width and height of the bitmap specified with the file path .
* @ param path the bitmap file path .
* @ return the size . */
public static Point getSize ( String path ) { } } | BitmapFactory . Options options = new BitmapFactory . Options ( ) ; options . inJustDecodeBounds = true ; BitmapFactory . decodeFile ( path , options ) ; int width = options . outWidth ; int height = options . outHeight ; return new Point ( width , height ) ; |
public class FieldType { /** * Return whether or not the field value passed in is the default value for the type of the field . Null will return
* true . */
public Object getJavaDefaultValueDefault ( ) { } } | if ( field . getType ( ) == boolean . class ) { return DEFAULT_VALUE_BOOLEAN ; } else if ( field . getType ( ) == byte . class || field . getType ( ) == Byte . class ) { return DEFAULT_VALUE_BYTE ; } else if ( field . getType ( ) == char . class || field . getType ( ) == Character . class ) { return DEFAULT_VALUE_CHAR ... |
public class LdapAuthenticationService { /** * Set the authorizations for the roles which may be defined . If the keys are DN values , the application role names
* are taken from the leftmost RDN value . Use { @ link LdapAuthenticationService # setNamedRoles ( Map ) } instead of this
* method to explicitly define a... | Map < String , List < NamedRoleInfo > > namedRoles = new HashMap < String , List < NamedRoleInfo > > ( ) ; for ( String ldapRole : roles . keySet ( ) ) { DN dn ; List < AuthorizationInfo > auth = roles . get ( ldapRole ) ; NamedRoleInfo role = new NamedRoleInfo ( ) ; role . setAuthorizations ( auth ) ; try { dn = new D... |
public class EJBFactoryImpl { /** * Returns a reference to the EJB object specified . < p >
* The combination of application name , module name , and bean name
* uniquely identify any EJB object . < p >
* This method if intended to be used when neither the specific
* module name nor bean name are known . All mo... | return ejbLinkResolver . findByInterface ( application , interfaceName ) ; |
public class BplusTree { /** * Returns the greatest key less than or equal to the given key , or null if there is no such key .
* @ param key the key
* @ return the Entry with greatest key less than or equal to key , or null if there is no such key */
public synchronized TreeEntry < K , V > floorEntry ( final K key... | // Retorna la clave mas cercana menor o igual a la clave indicada
return getRoundEntry ( key , false , true ) ; |
public class FrequentlyUsedPolicy { /** * Moves the entry to the next higher frequency list , creating it if necessary . */
private void onHit ( Node node ) { } } | policyStats . recordHit ( ) ; int newCount = node . freq . count + 1 ; FrequencyNode freqN = ( node . freq . next . count == newCount ) ? node . freq . next : new FrequencyNode ( newCount , node . freq ) ; node . remove ( ) ; if ( node . freq . isEmpty ( ) ) { node . freq . remove ( ) ; } node . freq = freqN ; node . a... |
public class TreeData { /** * 设置treeDatas值
* @ param treeDatas */
public TreeData children ( TreeData ... treeDatas ) { } } | if ( treeDatas == null || treeDatas . length == 0 ) { return this ; } this . children ( ) . addAll ( Arrays . asList ( treeDatas ) ) ; return this ; |
public class Card { /** * Setter for the card number . Note that mutating the number of this card object
* invalidates the { @ link # brand } and { @ link # last4 } .
* @ param number the new { @ link # number } */
@ Deprecated public void setNumber ( @ Nullable String number ) { } } | this . number = number ; this . brand = null ; this . last4 = null ; |
public class ReadBuffer { /** * Reads the given amount of bytes from the file into the read buffer and resets the internal buffer position . If
* the capacity of the read buffer is too small , a larger one is created automatically .
* @ param length the amount of bytes to read from the file .
* @ return true if t... | // ensure that the read buffer is large enough
if ( this . bufferData == null || this . bufferData . length < length ) { // ensure that the read buffer is not too large
if ( length > Parameters . MAXIMUM_BUFFER_SIZE ) { LOGGER . warning ( "invalid read length: " + length ) ; return false ; } this . bufferData = new byt... |
public class InternalLocaleBuilder { /** * Reset Builder ' s internal state with the given language tag */
public InternalLocaleBuilder setLanguageTag ( LanguageTag langtag ) { } } | clear ( ) ; if ( ! langtag . getExtlangs ( ) . isEmpty ( ) ) { language = langtag . getExtlangs ( ) . get ( 0 ) ; } else { String lang = langtag . getLanguage ( ) ; if ( ! lang . equals ( LanguageTag . UNDETERMINED ) ) { language = lang ; } } script = langtag . getScript ( ) ; region = langtag . getRegion ( ) ; List < ... |
public class ResizeManager { /** * Triggered
* @ param event Down event */
private boolean onDownEvent ( @ NonNull MotionEvent event ) { } } | if ( MotionEventCompat . getActionMasked ( event ) != MotionEvent . ACTION_DOWN ) { throw new IllegalStateException ( "Has to be down event!" ) ; } if ( mVelocityTracker == null ) { mVelocityTracker = VelocityTracker . obtain ( ) ; } else { mVelocityTracker . clear ( ) ; } mDownY = event . getY ( ) ; if ( ! mScroller .... |
public class StringUtils { /** * < p > Checks if the CharSequence contains only lowercase characters . < / p >
* < p > { @ code null } will return { @ code false } .
* An empty CharSequence ( length ( ) = 0 ) will return { @ code false } . < / p >
* < pre >
* StringUtils . isAllLowerCase ( null ) = false
* St... | if ( cs == null || isEmpty ( cs ) ) { return false ; } final int sz = cs . length ( ) ; for ( int i = 0 ; i < sz ; i ++ ) { if ( ! Character . isLowerCase ( cs . charAt ( i ) ) ) { return false ; } } return true ; |
public class WTree { /** * Override preparePaint to register an AJAX operation .
* @ param request the request being responded to . */
@ Override protected void preparePaintComponent ( final Request request ) { } } | super . preparePaintComponent ( request ) ; // If is an internal AJAX action , set the action type .
if ( isCurrentAjaxTrigger ( ) ) { AjaxOperation operation = AjaxHelper . getCurrentOperation ( ) ; if ( operation . isInternalAjaxRequest ( ) ) { // Want to replace children in the target ( Internal defaults to REPLACE ... |
public class TypeValidator { /** * Expect the type to contain an object sometimes . If the expectation is not met , issue a warning
* at the provided node ' s source code position . */
void expectAnyObject ( Node n , JSType type , String msg ) { } } | JSType anyObjectType = getNativeType ( NO_OBJECT_TYPE ) ; if ( ! anyObjectType . isSubtypeOf ( type ) && ! type . isEmptyType ( ) ) { mismatch ( n , msg , type , anyObjectType ) ; } |
public class DefaultMonitorRegistry { /** * Gets the { @ link ObjectNameMapper } to use by looking at the
* { @ code com . netflix . servo . DefaultMonitorRegistry . jmxMapperClass }
* property . If not specified , then { @ link ObjectNameMapper # DEFAULT }
* is used .
* @ param props the properties
* @ retur... | ObjectNameMapper mapper = ObjectNameMapper . DEFAULT ; final String jmxNameMapperClass = props . getProperty ( REGISTRY_JMX_NAME_PROP ) ; if ( jmxNameMapperClass != null ) { try { Class < ? > mapperClazz = Class . forName ( jmxNameMapperClass ) ; mapper = ( ObjectNameMapper ) mapperClazz . newInstance ( ) ; } catch ( T... |
public class ArgParser { /** * Gets the name specified in @ Opt ( name = . . . ) if present , or the name of the field otherwise . */
private static String getName ( Opt option , Field field ) { } } | if ( option . name ( ) . equals ( Opt . DEFAULT_STRING ) ) { return field . getName ( ) ; } else { return option . name ( ) ; } |
public class PatternBox { /** * Finds the cases where transcription relation is shown using a Conversion instead of a
* TemplateReaction .
* @ return the pattern */
public static Pattern controlsExpressionWithConversion ( ) { } } | Pattern p = new Pattern ( SequenceEntityReference . class , "TF ER" ) ; p . add ( linkedER ( true ) , "TF ER" , "TF generic ER" ) ; p . add ( erToPE ( ) , "TF generic ER" , "TF SPE" ) ; p . add ( linkToComplex ( ) , "TF SPE" , "TF PE" ) ; p . add ( peToControl ( ) , "TF PE" , "Control" ) ; p . add ( controlToConv ( ) ,... |
public class PointerHierarchyRepresentationBuilder { /** * Add an element to the pointer representation .
* Important : If an algorithm does not produce links in an increasing fashion ,
* a warning will be issued and the linking distance will be increased .
* Otherwise , the hierarchy would be misinterpreted when... | assert prototypes == null ; parent . putDBID ( cur , par ) ; double olddist = parentDistance . putDouble ( cur , distance ) ; assert ( olddist == Double . POSITIVE_INFINITY ) : "Object was already linked!" ; order . putInt ( cur , mergecount ) ; ++ mergecount ; |
public class PointLocationFormatter { /** * Formats a point location as an ISO 6709 string .
* @ param pointLocation
* Point location to format
* @ return Formatted string */
private static String formatISO6709Long ( final PointLocation pointLocation ) { } } | final Latitude latitude = pointLocation . getLatitude ( ) ; final Longitude longitude = pointLocation . getLongitude ( ) ; String string = formatLatitudeLong ( latitude ) + formatLongitudeLong ( longitude ) ; final double altitude = pointLocation . getAltitude ( ) ; string = string + formatAltitudeWithSign ( altitude )... |
public class GridList { /** * Get the record bookmark at this location .
* @ param iTargetPosition The logical position to retrieve .
* @ return The bookmark at this location . */
public Object elementAt ( int iTargetPosition ) { } } | int iArrayIndex ; Object bookmark = null ; if ( ! this . inRecordList ( iTargetPosition ) ) return null ; // Not here , you need to Move to < bookmark , and move next until you hit this one
iArrayIndex = this . listToArrayIndex ( iTargetPosition ) ; bookmark = m_aRecords [ iArrayIndex ] ; return bookmark ; |
public class BaseMigrationOperation { /** * Verifies that the cluster is active . */
private void verifyClusterState ( ) { } } | NodeEngineImpl nodeEngine = ( NodeEngineImpl ) getNodeEngine ( ) ; ClusterState clusterState = nodeEngine . getClusterService ( ) . getClusterState ( ) ; if ( ! clusterState . isMigrationAllowed ( ) ) { throw new IllegalStateException ( "Cluster state does not allow migrations! " + clusterState ) ; } |
public class A_CmsSearchIndex { /** * Initializes the search index . < p >
* @ throws CmsSearchException if the index source association failed or a configuration error occurred */
public void initialize ( ) throws CmsSearchException { } } | if ( ! isEnabled ( ) ) { // index is disabled , no initialization is required
return ; } String sourceName = null ; CmsSearchIndexSource indexSource = null ; List < String > searchIndexSourceDocumentTypes = null ; List < String > resourceNames = null ; String resourceName = null ; m_sources = new ArrayList < CmsSearchI... |
public class AbstractScope { /** * Returns < code > true < / code > if the given description { @ code input } from the parent scope is
* shadowed by local elements .
* @ return < code > true < / code > if the given description { @ code input } from the parent scope is
* shadowed by local elements . */
protected b... | final Iterable < IEObjectDescription > localElements = getLocalElementsByName ( input . getName ( ) ) ; final boolean isEmpty = isEmpty ( localElements ) ; return ! isEmpty ; |
public class A_CmsSearchIndex { /** * Returns the document type factory used for the given resource in this index , or < code > null < / code >
* in case the resource is not indexed by this index . < p >
* A resource is indexed if the following is all true : < ol >
* < li > The index contains at last one index so... | if ( isIndexing ( res ) ) { if ( OpenCms . getResourceManager ( ) . getResourceType ( res ) instanceof CmsResourceTypeXmlContainerPage ) { return OpenCms . getSearchManager ( ) . getDocumentFactory ( CmsSolrDocumentContainerPage . TYPE_CONTAINERPAGE_SOLR , "text/html" ) ; } if ( CmsResourceTypeXmlContent . isXmlContent... |
public class EntryPointNode { /** * Retract a fact object from this < code > RuleBase < / code > and the specified
* < code > WorkingMemory < / code > .
* @ param handle
* The handle of the fact to retract .
* @ param workingMemory
* The working memory session . */
public void retractObject ( final InternalFa... | if ( log . isTraceEnabled ( ) ) { log . trace ( "Delete {}" , handle . toString ( ) ) ; } workingMemory . addPropagation ( new PropagationEntry . Delete ( this , handle , context , objectTypeConf ) ) ; |
public class ReactionEngine { /** * Extract the mechanism necessary for this reaction .
* @ param entry The EntryReact object */
private void extractMechanism ( EntryReact entry ) { } } | String mechanismName = "org.openscience.cdk.reaction.mechanism." + entry . getMechanism ( ) ; try { mechanism = ( IReactionMechanism ) this . getClass ( ) . getClassLoader ( ) . loadClass ( mechanismName ) . newInstance ( ) ; logger . info ( "Loaded mechanism: " , mechanismName ) ; } catch ( ClassNotFoundException exce... |
public class PersistenceBrokerImpl { /** * Deletes the concrete representation of the specified object in the underlying
* persistence system . This method is intended for use in top - level api or
* by internal calls .
* @ param obj The object to delete .
* @ param ignoreReferences With this flag the automatic... | if ( isTxCheck ( ) && ! isInTransaction ( ) ) { if ( logger . isEnabledFor ( Logger . ERROR ) ) { String msg = "No running PB-tx found. Please, only delete objects in context of a PB-transaction" + " to avoid side-effects - e.g. when rollback of complex objects." ; try { throw new Exception ( "** Delete object without ... |
public class SystemUtil { /** * returns the Hoome Directory of the System
* @ return home directory */
public static Resource getHomeDirectory ( ) { } } | if ( homeFile != null ) return homeFile ; ResourceProvider frp = ResourcesImpl . getFileResourceProvider ( ) ; String homeStr = System . getProperty ( "user.home" ) ; if ( homeStr != null ) { homeFile = frp . getResource ( homeStr ) ; homeFile = ResourceUtil . getCanonicalResourceEL ( homeFile ) ; } return homeFile ; |
public class AppEngineDatastoreService { /** * Executes the specified query without an offset qualification .
* @ param paramQuery The query to be executed .
* @ return The query result as { @ code List } view . */
public List < Entity > query ( Query query ) { } } | return query ( query , FetchOptions . Builder . withOffset ( 0 ) ) ; |
public class StackTraceSampleCoordinator { /** * Triggers a stack trace sample to all tasks .
* @ param tasksToSample Tasks to sample .
* @ param numSamples Number of stack trace samples to collect .
* @ param delayBetweenSamples Delay between consecutive samples .
* @ param maxStackTraceDepth Maximum depth of ... | checkNotNull ( tasksToSample , "Tasks to sample" ) ; checkArgument ( tasksToSample . length >= 1 , "No tasks to sample" ) ; checkArgument ( numSamples >= 1 , "No number of samples" ) ; checkArgument ( maxStackTraceDepth >= 0 , "Negative maximum stack trace depth" ) ; // Execution IDs of running tasks
ExecutionAttemptID... |
public class GodHandableAction { protected ActionResponse processHookBefore ( ActionHook hook ) { } } | if ( hook == null ) { return ActionResponse . undefined ( ) ; } showBefore ( runtime ) ; ActionResponse response = hook . godHandPrologue ( runtime ) ; if ( isUndefined ( response ) ) { response = hook . hookBefore ( runtime ) ; } if ( isDefined ( response ) ) { runtime . manageActionResponse ( response ) ; } redCardab... |
public class WSManUtils { /** * Validates a UUID value and throws a specific exception if UUID is invalid .
* @ param uuid The UUID value to validate .
* @ param uuidValueOf The property associated to the given UUID value .
* @ throws RuntimeException */
public static void validateUUID ( String uuid , String uuid... | if ( ! WSManUtils . isUUID ( uuid ) ) { throw new RuntimeException ( "The returned " + uuidValueOf + " is not a valid UUID value! " + uuidValueOf + ": " + uuid ) ; } |
public class StandardBullhornData { /** * Makes the api call to add files to an entity . Takes a MultipartFile .
* @ param type
* @ param entityId
* @ param multipartFile
* @ param externalId
* @ param params
* @ param deleteFile
* @ return */
protected FileWrapper handleAddFileWithMultipartFile ( Class <... | MultiValueMap < String , Object > multiValueMap = null ; try { multiValueMap = restFileManager . addFileToMultiValueMap ( multipartFile ) ; } catch ( IOException e ) { log . error ( "Error creating temp file" , e ) ; } Map < String , String > uriVariables = restUriVariablesFactory . getUriVariablesForAddFile ( Bullhorn... |
public class KeystoreFactory { /** * Based on a public certificate , private key , alias and password , this method will load the certificate and
* private key as an entry into a newly created keystore , and it will set the provided alias and password to the
* keystore entry .
* @ param certResourceLocation
* @... | KeyStore keystore = createEmptyKeystore ( ) ; X509Certificate cert = loadCert ( certResourceLocation ) ; RSAPrivateKey privateKey = loadPrivateKey ( privateKeyResourceLocation ) ; addKeyToKeystore ( keystore , cert , privateKey , alias , keyPassword ) ; return keystore ; |
public class DoubleRangeValidator { /** * < p > Return the specified attribute value , converted to a
* < code > double < / code > . < / p >
* @ param attributeValue The attribute value to be converted
* @ throws NumberFormatException if conversion is not possible */
private static double doubleValue ( Object att... | if ( attributeValue instanceof Number ) { return ( ( ( Number ) attributeValue ) . doubleValue ( ) ) ; } else { return ( Double . parseDouble ( attributeValue . toString ( ) ) ) ; } |
public class Image { /** * Draw the image with a given scale
* @ param x The x position to draw the image at
* @ param y The y position to draw the image at
* @ param scale The scaling to apply */
public void draw ( float x , float y , float scale ) { } } | init ( ) ; draw ( x , y , width * scale , height * scale , Color . white ) ; |
public class EpicsApi { /** * Gets all epics of the requested group and its subgroups as a Stream .
* < pre > < code > GitLab Endpoint : GET / groups / : id / epics < / code > < / pre >
* @ param groupIdOrPath the group ID , path of the group , or a Group instance holding the group ID or path
* @ param authorId r... | return ( getEpics ( groupIdOrPath , authorId , labels , orderBy , sortOrder , search , getDefaultPerPage ( ) ) . stream ( ) ) ; |
public class CompositeELResolver { /** * For a given base and property , attempts to identify the most general type that is acceptable
* for an object to be passed as the value parameter in a future call to the
* { @ link # setValue ( ELContext , Object , Object , Object ) } method . The result is obtained by
* q... | context . setPropertyResolved ( false ) ; for ( ELResolver resolver : resolvers ) { Class < ? > type = resolver . getType ( context , base , property ) ; if ( context . isPropertyResolved ( ) ) { return type ; } } return null ; |
public class CmsJspStandardContextBean { /** * Returns the subsite path for the currently requested URI . < p >
* @ return the subsite path */
public String getSubSitePath ( ) { } } | return m_cms . getRequestContext ( ) . removeSiteRoot ( OpenCms . getADEManager ( ) . getSubSiteRoot ( m_cms , m_cms . getRequestContext ( ) . getRootUri ( ) ) ) ; |
public class PredicatedImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public NotificationChain eInverseRemove ( InternalEObject otherEnd , int featureID , NotificationChain msgs ) { } } | switch ( featureID ) { case SimpleAntlrPackage . PREDICATED__PREDICATE : return basicSetPredicate ( null , msgs ) ; case SimpleAntlrPackage . PREDICATED__ELEMENT : return basicSetElement ( null , msgs ) ; } return super . eInverseRemove ( otherEnd , featureID , msgs ) ; |
public class JestClientFactory { /** * Extension point */
protected HttpClientConnectionManager getConnectionManager ( ) { } } | HttpClientConnectionManager retval ; Registry < ConnectionSocketFactory > registry = RegistryBuilder . < ConnectionSocketFactory > create ( ) . register ( "http" , httpClientConfig . getPlainSocketFactory ( ) ) . register ( "https" , httpClientConfig . getSslSocketFactory ( ) ) . build ( ) ; if ( httpClientConfig . isM... |
public class MetadataService { /** * Adds the specified { @ link Token } to the specified { @ code projectName } . */
public CompletableFuture < Revision > addToken ( Author author , String projectName , Token token , ProjectRole role ) { } } | return addToken ( author , projectName , requireNonNull ( token , "token" ) . appId ( ) , role ) ; |
public class ObjectFactory { /** * Create an instance of { @ link Project . Storepoints . Storepoint . Calendars . Calendar . NonWork } */
public Project . Storepoints . Storepoint . Calendars . Calendar . NonWork createProjectStorepointsStorepointCalendarsCalendarNonWork ( ) { } } | return new Project . Storepoints . Storepoint . Calendars . Calendar . NonWork ( ) ; |
public class Model { /** * Import a context from the given configuration
* @ param ctx the context to import the context data to .
* @ param config the { @ code Configuration } containing the context data .
* @ throws ConfigurationException if an error occurred while reading the context data from the { @ code Con... | validateContextNotNull ( ctx ) ; validateConfigNotNull ( config ) ; for ( ContextDataFactory cdf : this . contextDataFactories ) { cdf . importContextData ( ctx , config ) ; } |
public class File { /** * Converts a String [ ] containing filenames to a File [ ] .
* Note that the filenames must not contain slashes .
* This method is to remove duplication in the implementation
* of File . list ' s overloads . */
private File [ ] filenamesToFiles ( String [ ] filenames ) { } } | if ( filenames == null ) { return null ; } int count = filenames . length ; File [ ] result = new File [ count ] ; for ( int i = 0 ; i < count ; ++ i ) { result [ i ] = new File ( this , filenames [ i ] ) ; } return result ; |
public class StringUtil { /** * Converts the specified array of bytes to a hex string .
* @ param bytes The array of bytes to convert to a string .
* @ return The hexadecimal representation of < code > bytes < / code > . */
public static String toHex ( byte [ ] bytes ) { } } | final char [ ] string = new char [ 2 * bytes . length ] ; int i = 0 ; for ( byte b : bytes ) { string [ i ++ ] = hexDigits [ ( b >> 4 ) & 0x0f ] ; string [ i ++ ] = hexDigits [ b & 0x0f ] ; } return new String ( string ) ; |
public class Property { /** * Sets the property value which this metamodel property instance
* represents to the specified entity instance .
* @ param entity The entity instance into which you attempt to set the
* property value . < b > The specified entity have to make sure to be JavaBeans
* to set property va... | Object object = entity ; for ( int i = 0 ; i < path ( ) . size ( ) - 1 ; i ++ ) { try { Field field = object . getClass ( ) . getDeclaredField ( path ( ) . get ( i ) ) ; field . setAccessible ( true ) ; object = field . get ( object ) ; } catch ( Exception e ) { throw new UncheckedException ( e ) ; } } try { Field fiel... |
public class share { /** * Private method that handles facebook and twitter sharing
* @ param message Message to be delivered
* @ param activityInfoName */
private static void shareMethod ( String message , String activityInfoName ) { } } | Intent shareIntent = new Intent ( Intent . ACTION_SEND ) ; shareIntent . setType ( "text/plain" ) ; shareIntent . putExtra ( Intent . EXTRA_TEXT , message ) ; PackageManager pm = QuickUtils . getContext ( ) . getPackageManager ( ) ; List < ResolveInfo > activityList = pm . queryIntentActivities ( shareIntent , 0 ) ; fo... |
public class NodeLocatorHelper { /** * Returns all nodes known in the current config .
* @ return all currently known nodes . */
public List < InetAddress > nodes ( ) { } } | List < InetAddress > allNodes = new ArrayList < InetAddress > ( ) ; BucketConfig config = bucketConfig . get ( ) ; for ( NodeInfo nodeInfo : config . nodes ( ) ) { try { allNodes . add ( InetAddress . getByName ( nodeInfo . hostname ( ) . address ( ) ) ) ; } catch ( UnknownHostException e ) { throw new IllegalStateExce... |
public class SoundStore { /** * Play the specified buffer as a sound effect with the specified
* pitch and gain .
* @ param buffer The ID of the buffer to play
* @ param pitch The pitch to play at
* @ param gain The gain to play at
* @ param loop True if the sound should loop
* @ param x The x position to p... | gain *= soundVolume ; if ( gain == 0 ) { gain = 0.001f ; } if ( soundWorks ) { if ( sounds ) { int nextSource = findFreeSource ( ) ; if ( nextSource == - 1 ) { return - 1 ; } AL10 . alSourceStop ( sources . get ( nextSource ) ) ; AL10 . alSourcei ( sources . get ( nextSource ) , AL10 . AL_BUFFER , buffer ) ; AL10 . alS... |
public class SummaryComputer { /** * 计算一个句子的分数
* @ param sentence
* @ param sf */
private void computeScore ( Sentence sentence , SmartForest < Double > forest ) { } } | SmartGetWord < Double > sgw = new SmartGetWord < > ( forest , sentence . value ) ; String name = null ; while ( ( name = sgw . getFrontWords ( ) ) != null ) { sentence . updateScore ( name , sgw . getParam ( ) ) ; } if ( sentence . score == 0 ) { sentence . score = sentence . value . length ( ) * - 0.005 ; } else { sen... |
public class JumboEnumSet { /** * Adds the specified element to this set if it is not already present .
* @ param e element to be added to this set
* @ return < tt > true < / tt > if the set changed as a result of the call
* @ throws NullPointerException if < tt > e < / tt > is null */
public boolean add ( E e ) ... | typeCheck ( e ) ; int eOrdinal = e . ordinal ( ) ; int eWordNum = eOrdinal >>> 6 ; long oldElements = elements [ eWordNum ] ; elements [ eWordNum ] |= ( 1L << eOrdinal ) ; boolean result = ( elements [ eWordNum ] != oldElements ) ; if ( result ) size ++ ; return result ; |
public class SortAttributesOperation { /** * Sort attributes of each element */
@ Override public void processElement ( Wrapper < Element > elementWrapper ) { } } | Element element = elementWrapper . getContent ( ) ; element . setAttributes ( getSortedAttributes ( element ) ) ; |
public class backup_policy { /** * < pre >
* Performs generic data validation for the operation to be performed
* < / pre > */
protected void validate ( String operationType ) throws Exception { } } | super . validate ( operationType ) ; MPSString policy_name_validator = new MPSString ( ) ; policy_name_validator . setConstraintMaxStrLen ( MPSConstants . GENERIC_CONSTRAINT , 128 ) ; policy_name_validator . setConstraintMinStrLen ( MPSConstants . GENERIC_CONSTRAINT , 1 ) ; policy_name_validator . validate ( operationT... |
public class RegressionDataSet { /** * Returns the i ' th data point in the data set paired with its target regressor value .
* Modifying the DataPointPair will effect the data set .
* @ param i the index of the data point to obtain
* @ return the i ' th DataPOintPair */
public DataPointPair < Double > getDataPoi... | return new DataPointPair < > ( getDataPoint ( i ) , targets . get ( i ) ) ; |
public class cmpglobal_binding { /** * Use this API to fetch a cmpglobal _ binding resource . */
public static cmpglobal_binding get ( nitro_service service ) throws Exception { } } | cmpglobal_binding obj = new cmpglobal_binding ( ) ; cmpglobal_binding response = ( cmpglobal_binding ) obj . get_resource ( service ) ; return response ; |
public class BindingSet { /** * True when this type ' s bindings use Resource directly instead of Context . */
private boolean hasResourceBindingsNeedingResource ( int sdk ) { } } | for ( ResourceBinding binding : resourceBindings ) { if ( binding . requiresResources ( sdk ) ) { return true ; } } return false ; |
public class AmazonInspectorClient { /** * Lists the ARNs of the assessment targets within this AWS account . For more information about assessment targets ,
* see < a href = " https : / / docs . aws . amazon . com / inspector / latest / userguide / inspector _ applications . html " > Amazon Inspector
* Assessment ... | request = beforeClientExecution ( request ) ; return executeListAssessmentTargets ( request ) ; |
public class ConfigOptionBuilder { /** * if you don ' t have an argument , choose the value that is going to be inserted into the map instead
* @ param commandLineOption specification of the command line options
* @ param value the value that is going to be inserted into the map instead of the argument */
public Co... | co . setCommandLineOption ( commandLineOption ) ; co . setValue ( value ) ; return this ; |
public class JmxData { /** * Convert object to string and checking if it fails . */
@ SuppressWarnings ( "PMD.AvoidCatchingThrowable" ) static String mkString ( Object obj ) { } } | if ( obj == null ) { return "null" ; } try { return obj . toString ( ) + " (type is " + obj . getClass ( ) + ")" ; } catch ( Throwable t ) { return t . getClass ( ) . toString ( ) + ": " + t . getMessage ( ) + " (type is " + obj . getClass ( ) + ")" ; } |
public class EnableEnhancedMonitoringResult { /** * Represents the list of all the metrics that would be in the enhanced state after the operation .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setDesiredShardLevelMetrics ( java . util . Collection ) } or ... | if ( this . desiredShardLevelMetrics == null ) { setDesiredShardLevelMetrics ( new com . amazonaws . internal . SdkInternalList < String > ( desiredShardLevelMetrics . length ) ) ; } for ( String ele : desiredShardLevelMetrics ) { this . desiredShardLevelMetrics . add ( ele ) ; } return this ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.