signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class Model { /** * Single row scoring , on a compatible Frame . */
public final float [ ] score ( Frame fr , boolean exact , int row ) { } } | double tmp [ ] = new double [ fr . numCols ( ) ] ; for ( int i = 0 ; i < tmp . length ; i ++ ) tmp [ i ] = fr . vecs ( ) [ i ] . at ( row ) ; return score ( fr . names ( ) , fr . domains ( ) , exact , tmp ) ; |
public class EJSHome { /** * Activates and returns the remote < code > EJBObject < / code > associated
* with the specified primary key for this home . < p >
* If the bean defined by primaryKey is already active then returns
* the active instance . Otherwise , the bean is activated ( ejbActivate )
* and loaded ... | EJSWrapperCommon wrappers = null ; // d215317
// Single - object ejbSelect methods may result in a null value ,
// and since this code path also supports ejbSelect , null must
// be tolerated and returned . d149627
if ( primaryKey == null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr... |
public class ClassNodeResolver { /** * Search for classes using class loading */
private static LookupResult findByClassLoading ( String name , CompilationUnit compilationUnit , GroovyClassLoader loader ) { } } | Class cls ; try { // NOTE : it ' s important to do no lookup against script files
// here since the GroovyClassLoader would create a new CompilationUnit
cls = loader . loadClass ( name , false , true ) ; } catch ( ClassNotFoundException cnfe ) { LookupResult lr = tryAsScript ( name , compilationUnit , null ) ; return l... |
public class BondMaker { /** * Creates bond objects from a LinkRecord as parsed from a PDB file
* @ param linkRecord */
public void formLinkRecordBond ( LinkRecord linkRecord ) { } } | // only work with atoms that aren ' t alternate locations
if ( linkRecord . getAltLoc1 ( ) . equals ( " " ) || linkRecord . getAltLoc2 ( ) . equals ( " " ) ) return ; try { Map < Integer , Atom > a = getAtomFromRecord ( linkRecord . getName1 ( ) , linkRecord . getAltLoc1 ( ) , linkRecord . getResName1 ( ) , linkRecord ... |
public class Maps { /** * Computes the difference between two sorted maps , using the comparator of
* the left map , or { @ code Ordering . natural ( ) } if the left map uses the
* natural ordering of its elements . This difference is an immutable snapshot
* of the state of the maps at the time this method is cal... | checkNotNull ( left ) ; checkNotNull ( right ) ; Comparator < ? super K > comparator = orNaturalOrder ( left . comparator ( ) ) ; SortedMap < K , V > onlyOnLeft = Maps . newTreeMap ( comparator ) ; SortedMap < K , V > onlyOnRight = Maps . newTreeMap ( comparator ) ; onlyOnRight . putAll ( right ) ; // will whittle it d... |
public class AuthorizationHandler { /** * Checks if any of the given strings is blank
* @ param subject The subject to validate
* @ param resource The resource to validate
* @ param operation The operation to validate
* @ return True if all strings are not blank , false otherwise */
private boolean isNotBlank (... | return StringUtils . isNotBlank ( subject ) && StringUtils . isNotBlank ( resource ) && StringUtils . isNotBlank ( operation ) ; |
public class MatchExptScript { /** * Load commands from a file and execute them . */
public void runScript ( String configFileName ) { } } | int lineNum = 0 ; try { BufferedReader in = new BufferedReader ( new FileReader ( configFileName ) ) ; String line ; while ( ( line = in . readLine ( ) ) != null ) { lineNum ++ ; if ( ! line . startsWith ( "#" ) ) { String command = null ; List args = new ArrayList ( ) ; StringTokenizer tok = new StringTokenizer ( line... |
public class BaseValidatingInterceptor { /** * Note : May return null */
protected ValidationResult validate ( T theRequest , RequestDetails theRequestDetails ) { } } | FhirValidator validator = theRequestDetails . getServer ( ) . getFhirContext ( ) . newValidator ( ) ; if ( myValidatorModules != null ) { for ( IValidatorModule next : myValidatorModules ) { validator . registerValidatorModule ( next ) ; } } if ( theRequest == null ) { return null ; } ValidationResult validationResult ... |
public class VirtualMachinesInner { /** * Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs .
* @ param resourceGroupName The name of the resource group .
* @ param vmName The name of the virtual machine .
* @ param parameters Parameters supplied... | if ( resourceGroupName == null ) { throw new IllegalArgumentException ( "Parameter resourceGroupName is required and cannot be null." ) ; } if ( vmName == null ) { throw new IllegalArgumentException ( "Parameter vmName is required and cannot be null." ) ; } if ( this . client . subscriptionId ( ) == null ) { throw new ... |
public class TimeSpinnerTimer { /** * tick , This is called once each time that the timer fires . ( Every 20 milliseconds ) .
* However , the value in the time picker will only be changed once for every certain number of
* calls to the tick ( ) function . The number of calls which is required is controlled by the
... | if ( startedIndexTimeStamp == 0 ) { startedIndexTimeStamp = System . currentTimeMillis ( ) ; } long timeElapsedSinceIndexStartMilliseconds = System . currentTimeMillis ( ) - startedIndexTimeStamp ; int maximumIndex = divisorList . length - 1 ; int currentDivisor = divisorList [ currentIndex ] ; if ( ticksSinceIndexChan... |
public class DeliveryChannelMarshaller { /** * Marshall the given parameter object . */
public void marshall ( DeliveryChannel deliveryChannel , ProtocolMarshaller protocolMarshaller ) { } } | if ( deliveryChannel == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( deliveryChannel . getName ( ) , NAME_BINDING ) ; protocolMarshaller . marshall ( deliveryChannel . getS3BucketName ( ) , S3BUCKETNAME_BINDING ) ; protocolMarshaller . ma... |
public class MemcachedSessionService { /** * Specifies the memcached protocol to use , either " text " ( default ) or " binary " .
* @ param memcachedProtocol one of " text " or " binary " . */
public void setMemcachedProtocol ( final String memcachedProtocol ) { } } | if ( ! PROTOCOL_TEXT . equals ( memcachedProtocol ) && ! PROTOCOL_BINARY . equals ( memcachedProtocol ) ) { _log . warn ( "Illegal memcachedProtocol " + memcachedProtocol + ", using default (" + _memcachedProtocol + ")." ) ; return ; } _memcachedProtocol = memcachedProtocol ; |
public class CommerceShipmentItemPersistenceImpl { /** * Returns the first commerce shipment item in the ordered set where commerceShipmentId = & # 63 ; .
* @ param commerceShipmentId the commerce shipment ID
* @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > )
* ... | List < CommerceShipmentItem > list = findByCommerceShipment ( commerceShipmentId , 0 , 1 , orderByComparator ) ; if ( ! list . isEmpty ( ) ) { return list . get ( 0 ) ; } return null ; |
public class Partition { /** * Merges the given components and returns the representative of the new component */
public V merge ( V a , V b ) { } } | final V aHead = componentOf ( a ) ; final V bHead = componentOf ( b ) ; if ( aHead . equals ( bHead ) ) return aHead ; // add the shorter tree underneath the taller tree
final int aRank = ranks . getOrDefault ( aHead , 0 ) ; final int bRank = ranks . getOrDefault ( bHead , 0 ) ; if ( aRank > bRank ) { parents . put ( b... |
public class CliClient { /** * Delete a keyspace
* @ param statement - a token tree representing current statement
* @ throws TException - exception
* @ throws InvalidRequestException - exception
* @ throws NotFoundException - exception
* @ throws SchemaDisagreementException */
private void executeDelKeySpace... | if ( ! CliMain . isConnected ( ) ) return ; String keyspaceName = CliCompiler . getKeySpace ( statement , thriftClient . describe_keyspaces ( ) ) ; String version = thriftClient . system_drop_keyspace ( keyspaceName ) ; sessionState . out . println ( version ) ; if ( keyspaceName . equals ( keySpace ) ) // we just dele... |
public class Jdk8Methods { /** * Safely adds two int values .
* @ param a the first value
* @ param b the second value
* @ return the result
* @ throws ArithmeticException if the result overflows an int */
public static int safeAdd ( int a , int b ) { } } | int sum = a + b ; // check for a change of sign in the result when the inputs have the same sign
if ( ( a ^ sum ) < 0 && ( a ^ b ) >= 0 ) { throw new ArithmeticException ( "Addition overflows an int: " + a + " + " + b ) ; } return sum ; |
public class ThrottlingHttpService { /** * Creates a new decorator using the specified { @ link ThrottlingStrategy } instance .
* @ param strategy The { @ link ThrottlingStrategy } instance to be used */
public static Function < Service < HttpRequest , HttpResponse > , ThrottlingHttpService > newDecorator ( Throttlin... | requireNonNull ( strategy , "strategy" ) ; return delegate -> new ThrottlingHttpService ( delegate , strategy ) ; |
public class ContinuousBackupsDescriptionMarshaller { /** * Marshall the given parameter object . */
public void marshall ( ContinuousBackupsDescription continuousBackupsDescription , ProtocolMarshaller protocolMarshaller ) { } } | if ( continuousBackupsDescription == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( continuousBackupsDescription . getContinuousBackupsStatus ( ) , CONTINUOUSBACKUPSSTATUS_BINDING ) ; protocolMarshaller . marshall ( continuousBackupsDescrip... |
public class GrailsHibernateTemplate { /** * Prepare the given Criteria object , applying cache settings and / or a
* transaction timeout .
* @ param criteria the Criteria object to prepare
* @ deprecated Deprecated because Hibernate Criteria are deprecated */
@ Deprecated protected void prepareCriteria ( Criteri... | if ( cacheQueries ) { criteria . setCacheable ( true ) ; } if ( shouldPassReadOnlyToHibernate ( ) ) { criteria . setReadOnly ( true ) ; } SessionHolder sessionHolder = ( SessionHolder ) TransactionSynchronizationManager . getResource ( sessionFactory ) ; if ( sessionHolder != null && sessionHolder . hasTimeout ( ) ) { ... |
public class SlicedFileConsumer { /** * Sets a video decoder configuration ; some codecs require this , such as AVC .
* @ param decoderConfig
* video codec configuration */
public void setVideoDecoderConfiguration ( IRTMPEvent decoderConfig ) { } } | if ( decoderConfig instanceof IStreamData ) { IoBuffer data = ( ( IStreamData < ? > ) decoderConfig ) . getData ( ) . asReadOnlyBuffer ( ) ; videoConfigurationTag = ImmutableTag . build ( decoderConfig . getDataType ( ) , 0 , data , 0 ) ; } |
public class SingleInputGate { /** * Retriggers a partition request . */
public void retriggerPartitionRequest ( IntermediateResultPartitionID partitionId ) throws IOException , InterruptedException { } } | synchronized ( requestLock ) { if ( ! isReleased ) { final InputChannel ch = inputChannels . get ( partitionId ) ; checkNotNull ( ch , "Unknown input channel with ID " + partitionId ) ; LOG . debug ( "{}: Retriggering partition request {}:{}." , owningTaskName , ch . partitionId , consumedSubpartitionIndex ) ; if ( ch ... |
public class FxFlowableTransformers { /** * Performs an action on onError with the provided emission count
* @ param onError
* @ param < T > */
public static < T > FlowableTransformer < T , T > doOnErrorCount ( Consumer < Integer > onError ) { } } | return obs -> obs . lift ( new FlowableEmissionCounter < > ( new CountObserver ( null , null , onError ) ) ) ; |
public class ForkJoinPool { /** * Signals and releases worker v if it is top of idle worker
* stack . This performs a one - shot version of signalWork only if
* there is ( apparently ) at least one idle worker .
* @ param c incoming ctl value
* @ param v if non - null , a worker
* @ param inc the increment to... | int sp = ( int ) c , ns = sp & ~ UNSIGNALLED ; if ( v != null ) { int vs = v . scanState ; long nc = ( v . stackPred & SP_MASK ) | ( UC_MASK & ( c + inc ) ) ; if ( sp == vs && U . compareAndSwapLong ( this , CTL , c , nc ) ) { v . scanState = ns ; LockSupport . unpark ( v . parker ) ; return true ; } } return false ; |
public class CxxIssuesReportSensor { /** * Saves code violation only if it wasn ' t already saved
* @ param sensorContext
* @ param issue */
public void saveUniqueViolation ( SensorContext sensorContext , CxxReportIssue issue ) { } } | if ( uniqueIssues . add ( issue ) ) { saveViolation ( sensorContext , issue ) ; } |
public class CollectionManager { /** * Inspect the supplied object and cast type to delegates .
* @ param obj the value to iterate of unknown type .
* @ return the bsh iterator */
public Iterator < ? > getBshIterator ( final Object obj ) { } } | if ( obj == null ) return this . emptyIt ( ) ; if ( obj instanceof Primitive ) return this . getBshIterator ( Primitive . unwrap ( obj ) ) ; if ( obj . getClass ( ) . isArray ( ) ) return this . arrayIt ( obj ) ; if ( obj instanceof Iterable ) return this . getBshIterator ( ( Iterable < ? > ) obj ) ; if ( obj instanceo... |
public class DateFormat { /** * Specifies whether date / time parsing is to be lenient . With
* lenient parsing , the parser may use heuristics to interpret inputs that
* do not precisely match this object ' s format . Without lenient parsing ,
* inputs must match this object ' s format more closely .
* < br > ... | calendar . setLenient ( lenient ) ; setBooleanAttribute ( BooleanAttribute . PARSE_ALLOW_NUMERIC , lenient ) ; setBooleanAttribute ( BooleanAttribute . PARSE_ALLOW_WHITESPACE , lenient ) ; |
public class PiElectronegativityDescriptor { /** * The method calculates the pi electronegativity of a given atom
* It is needed to call the addExplicitHydrogensToSatisfyValency method from the class tools . HydrogenAdder .
* @ param atom The IAtom for which the DescriptorValue is requested
* @ param atomContaine... | IAtomContainer clone ; IAtom localAtom ; try { clone = ( IAtomContainer ) atomContainer . clone ( ) ; AtomContainerManipulator . percieveAtomTypesAndConfigureAtoms ( clone ) ; if ( lpeChecker ) { LonePairElectronChecker lpcheck = new LonePairElectronChecker ( ) ; lpcheck . saturate ( atomContainer ) ; } localAtom = clo... |
public class CmsFlexResponse { /** * Sets the cache key for this response , which is calculated
* from the provided parameters . < p >
* @ param resourcename the target resource for which to create the cache key
* @ param cacheDirectives the cache directives of the resource ( value of the property " cache " )
*... | m_key = new CmsFlexCacheKey ( resourcename , cacheDirectives , online ) ; if ( m_key . hadParseError ( ) ) { // We throw the exception here to make sure this response has a valid key ( cache = never )
throw new CmsFlexCacheException ( Messages . get ( ) . container ( Messages . LOG_FLEXRESPONSE_PARSE_ERROR_IN_CACHE_KEY... |
public class ScrollablePanel { /** * documentation inherited from interface */
public int getScrollableBlockIncrement ( Rectangle visibleRect , int orientation , int direction ) { } } | if ( orientation == SwingConstants . HORIZONTAL ) { return visibleRect . width ; } else { return visibleRect . height ; } |
public class AbstractReplicator { /** * Set the given DocumentReplicationListener to the this replicator .
* @ param listener */
@ NonNull public ListenerToken addDocumentReplicationListener ( Executor executor , @ NonNull DocumentReplicationListener listener ) { } } | if ( listener == null ) { throw new IllegalArgumentException ( "listener cannot be null." ) ; } synchronized ( lock ) { setProgressLevel ( ReplicatorProgressLevel . PER_DOCUMENT ) ; final DocumentReplicationListenerToken token = new DocumentReplicationListenerToken ( executor , listener ) ; docEndedListenerTokens . add... |
public class SetElement { /** * Tests if this value is newer than the specified SetElement .
* @ param other the value to be compared
* @ return true if this value is newer than other */
public boolean isNewerThan ( SetElement other ) { } } | if ( other == null ) { return true ; } return this . timestamp . isNewerThan ( other . timestamp ) ; |
public class DancingLinks { /** * Find the column with the fewest choices .
* @ return The column header */
private ColumnHeader < ColumnName > findBestColumn ( ) { } } | int lowSize = Integer . MAX_VALUE ; ColumnHeader < ColumnName > result = null ; ColumnHeader < ColumnName > current = ( ColumnHeader < ColumnName > ) head . right ; while ( current != head ) { if ( current . size < lowSize ) { lowSize = current . size ; result = current ; } current = ( ColumnHeader < ColumnName > ) cur... |
public class AuthorizerMarshaller { /** * Marshall the given parameter object . */
public void marshall ( Authorizer authorizer , ProtocolMarshaller protocolMarshaller ) { } } | if ( authorizer == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( authorizer . getAuthorizerCredentialsArn ( ) , AUTHORIZERCREDENTIALSARN_BINDING ) ; protocolMarshaller . marshall ( authorizer . getAuthorizerId ( ) , AUTHORIZERID_BINDING ) ... |
public class Repartitioner { /** * Within a single zone , swaps one random partition on one random node with
* another random partition on different random node .
* @ param nextCandidateCluster
* @ param zoneId Zone ID within which to shuffle partitions
* @ return updated cluster */
public static Cluster swapRa... | Cluster returnCluster = Cluster . cloneCluster ( nextCandidateCluster ) ; Random r = new Random ( ) ; List < Integer > nodeIdsInZone = new ArrayList < Integer > ( nextCandidateCluster . getNodeIdsInZone ( zoneId ) ) ; if ( nodeIdsInZone . size ( ) == 0 ) { return returnCluster ; } // Select random stealer node
int stea... |
public class BeforeBuilder { /** * Build a precedence constraint .
* @ param t the current tree
* @ param args can be a non - empty set of vms ( { @ see Precedence } constraint ) or
* a timestamp string ( { @ see Deadline } constraint )
* @ return a constraint */
@ Override public List < ? extends SatConstraint... | if ( ! checkConformance ( t , args ) ) { return Collections . emptyList ( ) ; } // Get the first parameter
@ SuppressWarnings ( "unchecked" ) List < VM > s = ( List < VM > ) params [ 0 ] . transform ( this , t , args . get ( 0 ) ) ; if ( s == null ) { return Collections . emptyList ( ) ; } // Get param ' OneOf '
Object... |
public class PatternFlattener { /** * Try to create a date filler if the given parameter is a date parameter .
* @ return created date filler , or null if the given parameter is not a date parameter */
static DateFiller parseDateParameter ( String wrappedParameter , String trimmedParameter ) { } } | if ( trimmedParameter . startsWith ( PARAMETER_DATE + " " ) && trimmedParameter . length ( ) > PARAMETER_DATE . length ( ) + 1 ) { String dateFormat = trimmedParameter . substring ( PARAMETER_DATE . length ( ) + 1 ) ; return new DateFiller ( wrappedParameter , trimmedParameter , dateFormat ) ; } else if ( trimmedParame... |
public class AWSGreengrassClient { /** * Associates a role with your account . AWS IoT Greengrass will use the role to access your Lambda functions and AWS
* IoT resources . This is necessary for deployments to succeed . The role must have at least minimum permissions in
* the policy ' ' AWSGreengrassResourceAccess... | request = beforeClientExecution ( request ) ; return executeAssociateServiceRoleToAccount ( request ) ; |
public class Device { /** * Command the device to update
* @ param url The URL to update from
* @ param md5 The MD5 Checksum for the update
* @ return True if the command has been received . This does not mean that the update was successful .
* @ throws CommandExecutionException When there has been a error duri... | if ( url == null || md5 == null ) throw new CommandExecutionException ( CommandExecutionException . Error . INVALID_PARAMETERS ) ; if ( md5 . length ( ) != 32 ) throw new CommandExecutionException ( CommandExecutionException . Error . INVALID_PARAMETERS ) ; JSONObject params = new JSONObject ( ) ; params . put ( "mode"... |
public class StatsUtils { /** * Find an operation statistic attached ( as a children ) to this context that matches the statistic name and type
* @ param context the context of the query
* @ param type type of the operation statistic
* @ param statName statistic name
* @ param < T > type of the operation statis... | @ SuppressWarnings ( "unchecked" ) Query query = queryBuilder ( ) . children ( ) . filter ( context ( attributes ( Matchers . allOf ( hasAttribute ( "name" , statName ) , hasAttribute ( "type" , type ) ) ) ) ) . build ( ) ; Set < TreeNode > result = query . execute ( Collections . singleton ( ContextManager . nodeFor (... |
public class Base64Codec { /** * Encodes the provided raw data using base64.
* @ param rawData The raw data to encode . It must not be < CODE > null < / CODE > .
* @ return The base64 - encoded representation of the provided raw data . */
public static String encode ( byte [ ] rawData ) { } } | StringBuilder buffer = new StringBuilder ( 4 * rawData . length / 3 ) ; int pos = 0 ; int iterations = rawData . length / 3 ; for ( int i = 0 ; i < iterations ; i ++ ) { int value = ( ( rawData [ pos ++ ] & 0xFF ) << 16 ) | ( ( rawData [ pos ++ ] & 0xFF ) << 8 ) | ( rawData [ pos ++ ] & 0xFF ) ; buffer . append ( BASE6... |
public class FindingReplacing { /** * Sets the given lookups string as the search string
* < B > May multiple substring matched . < / B >
* @ param left
* @ return */
public S lookups ( String ... lookups ) { } } | for ( String lookup : checkNotNull ( lookups ) ) { lookup ( lookup ) . late ( ) ; } return THIS ( ) ; |
public class AbstractParamContainerPanel { /** * Tells whether or not the given param panel , or one of its child panels , is selected .
* @ param panelName the name of the panel to check , should not be { @ code null } .
* @ return { @ code true } if the panel or one of its child panels is selected , { @ code fals... | DefaultMutableTreeNode node = getTreeNodeFromPanelName ( panelName ) ; if ( node != null ) { TreePath panelPath = new TreePath ( node . getPath ( ) ) ; if ( getTreeParam ( ) . isPathSelected ( panelPath ) ) { return true ; } TreePath selectedPath = getTreeParam ( ) . getSelectionPath ( ) ; return selectedPath != null &... |
public class DeviceStore { /** * Internal method to add an actual device to the store .
* @ param device The device to add .
* @ throws AndroidDeviceException */
protected synchronized void addDeviceToStore ( AndroidDevice device ) throws AndroidDeviceException { } } | if ( androidDevices . containsKey ( device . getTargetPlatform ( ) ) ) { List < AndroidDevice > platformDevices = androidDevices . get ( device . getTargetPlatform ( ) ) ; if ( ! platformDevices . contains ( device ) ) { platformDevices . add ( device ) ; } } else { androidDevices . put ( device . getTargetPlatform ( )... |
public class CharTrie { /** * Reduce simple char trie .
* @ param z the z
* @ param fn the fn
* @ return the char trie */
public CharTrie reduceSimple ( CharTrie z , BiFunction < Long , Long , Long > fn ) { } } | return reduce ( z , ( left , right ) -> { TreeMap < Character , ? extends TrieNode > leftChildren = null == left ? new TreeMap < > ( ) : left . getChildrenMap ( ) ; TreeMap < Character , ? extends TrieNode > rightChildren = null == right ? new TreeMap < > ( ) : right . getChildrenMap ( ) ; Map < Character , Long > map ... |
public class ValidStorageOptions { /** * The valid range of Provisioned IOPS to gibibytes of storage multiplier . For example , 3-10 , which means that
* provisioned IOPS can be between 3 and 10 times storage .
* @ return The valid range of Provisioned IOPS to gibibytes of storage multiplier . For example , 3-10 , ... | if ( iopsToStorageRatio == null ) { iopsToStorageRatio = new com . amazonaws . internal . SdkInternalList < DoubleRange > ( ) ; } return iopsToStorageRatio ; |
public class StringFixture { /** * Extracts a whole number for a string using a regular expression .
* @ param value input string .
* @ param regEx regular expression to match against value .
* @ param groupIndex index of group in regular expression containing the number .
* @ return extracted number . */
publi... | Integer result = null ; if ( value != null ) { Matcher matcher = getMatcher ( regEx , value ) ; if ( matcher . matches ( ) ) { String intStr = matcher . group ( groupIndex ) ; result = convertToInt ( intStr ) ; } } return result ; |
public class MapLabelSetterFactory { /** * フィールドによるラベル情報を格納する場合 。
* < p > { @ code < フィールド名 > + Label } のメソッド名 < / p >
* @ param beanClass フィールドが定義してあるクラスのインスタンス
* @ param fieldName フィールド名
* @ return ラベル情報の設定用クラス */
private Optional < MapLabelSetter > createField ( final Class < ? > beanClass , final St... | final String labelFieldName = fieldName + "Label" ; final Field labelField ; try { labelField = beanClass . getDeclaredField ( labelFieldName ) ; labelField . setAccessible ( true ) ; } catch ( NoSuchFieldException | SecurityException e ) { return Optional . empty ( ) ; } if ( ! Map . class . isAssignableFrom ( labelFi... |
public class SftpClient { /** * Download the remote file to the local computer . If the paths provided are
* not absolute the current working directory is used .
* @ param remote
* the path / name of the remote file
* @ param local
* the path / name to place the file on the local computer
* @ param progress... | // Moved here to ensure that stream is closed in finally
OutputStream out = null ; SftpFileAttributes attrs = null ; // Perform local file operations first , then if it throws an exception
// the server hasn ' t been unnecessarily loaded .
File localPath = resolveLocalPath ( local ) ; if ( ! localPath . exists ( ) ) { ... |
public class AuthorizationRequestManager { /** * Initializes the collection of expected challenge answers .
* @ param realms List of realms */
private void setExpectedAnswers ( ArrayList < String > realms ) { } } | if ( answers == null ) { return ; } for ( String realm : realms ) { try { answers . put ( realm , "" ) ; } catch ( JSONException t ) { logger . error ( "setExpectedAnswers failed with exception: " + t . getLocalizedMessage ( ) , t ) ; } } |
public class CrosstabNavigator { /** * Puts the given value to the navigated position in the crosstab .
* @ param value
* the value to put .
* @ param createCategories
* if true , the chosen categories will automatically be created
* if they do not already exists in the dimensions of the
* crosstab .
* @ ... | if ( createCategories ) { for ( int i = 0 ; i < categories . length ; i ++ ) { String category = categories [ i ] ; CrosstabDimension dimension = crosstab . getDimension ( i ) ; dimension . addCategory ( category ) ; } } crosstab . putValue ( value , categories ) ; |
public class InstanceValidator { private boolean passesCodeWhitespaceRules ( String v ) { } } | if ( ! v . trim ( ) . equals ( v ) ) return false ; boolean lastWasSpace = true ; for ( char c : v . toCharArray ( ) ) { if ( c == ' ' ) { if ( lastWasSpace ) return false ; else lastWasSpace = true ; } else if ( Character . isWhitespace ( c ) ) return false ; else lastWasSpace = false ; } return true ; |
public class TransmitMessage { /** * / * ( non - Javadoc )
* @ see com . ibm . ws . sib . processor . runtime . SIMPRemoteMessageControllable # removeMessage ( boolean ) */
public void moveMessage ( boolean discard ) throws SIMPControllableNotFoundException , SIMPRuntimeOperationFailedException { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "moveMessage" , Boolean . valueOf ( discard ) ) ; assertValidControllable ( ) ; // remove the message from the MessageStore
QueuedMessage queuedMessage = null ; try { queuedMessage = ( QueuedMessage ) getSIMPMessage ( ) . ge... |
public class WxCryptUtil { /** * 对明文进行加密 .
* @ param plainText 需要加密的明文
* @ return 加密后base64编码的字符串 */
protected String encrypt ( String randomStr , String plainText ) { } } | ByteGroup byteCollector = new ByteGroup ( ) ; byte [ ] randomStringBytes = randomStr . getBytes ( CHARSET ) ; byte [ ] plainTextBytes = plainText . getBytes ( CHARSET ) ; byte [ ] bytesOfSizeInNetworkOrder = number2BytesInNetworkOrder ( plainTextBytes . length ) ; byte [ ] appIdBytes = appidOrCorpid . getBytes ( CHARSE... |
public class RepositoryOptionImpl { /** * Returns the full repository url .
* @ return the full repository as given plus eventual snapshot / release tags ( cannot be null or
* empty )
* @ throws IllegalStateException
* - if both snapshots and releases are not allowed */
public String getRepository ( ) { } } | if ( ! allowReleases && ! allowSnapshots ) { throw new IllegalStateException ( "Does not make sense to disallow both releases and snapshots." ) ; } // start with a plus to append default repositories from settings . xml and Maven Cental
// to the list of repositories defined by options
final StringBuilder url = new Str... |
public class OClassImpl { /** * Adds a base class to the current one . It adds also the base class cluster ids to the polymorphic cluster ids array .
* @ param iBaseClass
* The base class to add . */
private OClass addBaseClasses ( final OClass iBaseClass ) { } } | if ( baseClasses == null ) baseClasses = new ArrayList < OClass > ( ) ; if ( baseClasses . contains ( iBaseClass ) ) return this ; baseClasses . add ( iBaseClass ) ; // ADD CLUSTER IDS OF BASE CLASS TO THIS CLASS AND ALL SUPER - CLASSES
OClassImpl currentClass = this ; while ( currentClass != null ) { currentClass . ad... |
public class TimedTextMarkupLanguageParser { /** * Build the Subtitle objects from TTML content . */
@ SuppressWarnings ( "deprecation" ) private void buildFilmList ( ) throws Exception { } } | final NodeList subtitleData = doc . getElementsByTagName ( "tt:p" ) ; for ( int i = 0 ; i < subtitleData . getLength ( ) ; i ++ ) { final Subtitle subtitle = new Subtitle ( ) ; final Node subnode = subtitleData . item ( i ) ; if ( subnode . hasAttributes ( ) ) { // retrieve the begin and end attributes . . .
final Name... |
public class UserStorageMetadataMarshaller { /** * Marshall the given parameter object . */
public void marshall ( UserStorageMetadata userStorageMetadata , ProtocolMarshaller protocolMarshaller ) { } } | if ( userStorageMetadata == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( userStorageMetadata . getStorageUtilizedInBytes ( ) , STORAGEUTILIZEDINBYTES_BINDING ) ; protocolMarshaller . marshall ( userStorageMetadata . getStorageRule ( ) , S... |
public class ExtendedMockito { /** * Make an existing object a spy .
* < p > This does < u > not < / u > clone the existing objects . If a method is stubbed on a spy
* converted by this method all references to the already existing object will be affected by
* the stubbing .
* @ param toSpy The existing object ... | if ( onSpyInProgressInstance . get ( ) != null ) { throw new IllegalStateException ( "Cannot set up spying on an existing object while " + "setting up spying for another existing object" ) ; } onSpyInProgressInstance . set ( toSpy ) ; try { spy ( toSpy ) ; } finally { onSpyInProgressInstance . remove ( ) ; } |
public class BatchedTimeoutManager { /** * Start the BatchedTimeoutManager */
public void startTimer ( ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "startTimer" ) ; btmLockManager . lockExclusive ( ) ; try { // only start if currently stopped
if ( isStopped ) { // set stopped to false
isStopped = false ; // iterate over the entries currently in the active list
LinkedLis... |
public class WhileMatchFilterAdapter { /** * { @ inheritDoc }
* Adapt { @ link WhileMatchFilter } as follow :
* label ( ' id - in ' ) wrappedFilter . filter ( )
* sink ( ) + - - - - - + - - - - - +
* label ( ' id - out ' ) all ( )
* sink ( ) |
* The above implementation gives enough information from the ser... | // We need to eventually support more than one { @ link WhileMatchFilter } s soon . Checking the size
// of a list of { @ link WhileMatchFilter } s makes more sense than verifying a single boolean flag .
checkArgument ( context . getNumberOfWhileMatchFilters ( ) == 0 , "More than one WhileMatchFilter is not supported."... |
public class ApiConnection { /** * Returns a user - readable message for a given API response .
* @ deprecated to be migrated to { @ class PasswordApiConnection }
* @ param loginResult
* a API login request result string other than
* { @ link # LOGIN _ RESULT _ SUCCESS }
* @ return error message */
@ Deprecat... | switch ( loginResult ) { case ApiConnection . LOGIN_WRONG_PASS : return loginResult + ": Wrong Password." ; case ApiConnection . LOGIN_WRONG_PLUGIN_PASS : return loginResult + ": Wrong Password. An authentication plugin rejected the password." ; case ApiConnection . LOGIN_NOT_EXISTS : return loginResult + ": Username d... |
public class MACAddressSection { /** * Writes this address as a single hexadecimal value with always the exact same number of characters , with or without a preceding 0x prefix . */
@ Override public String toHexString ( boolean with0xPrefix ) { } } | String result ; if ( hasNoStringCache ( ) || ( result = ( with0xPrefix ? stringCache . hexStringPrefixed : stringCache . hexString ) ) == null ) { result = toHexString ( with0xPrefix , null ) ; if ( with0xPrefix ) { stringCache . hexStringPrefixed = result ; } else { stringCache . hexString = result ; } } return result... |
public class ObjectParameter { /** * Parse a file definition by using canonical path .
* @ param serializedObject the full file path
* @ return the File object */
private Object parseFileParameter ( final String serializedObject ) { } } | final File res = new File ( serializedObject ) ; if ( ! res . exists ( ) ) { throw new CoreRuntimeException ( "Impossible to load file " + serializedObject ) ; } return res ; |
public class ListResourceBundle { /** * Returns an < code > Enumeration < / code > of the keys contained in
* this < code > ResourceBundle < / code > and its parent bundles .
* @ return an < code > Enumeration < / code > of the keys contained in
* this < code > ResourceBundle < / code > and its parent bundles .
... | // lazily load the lookup hashtable .
if ( lookup == null ) { loadLookup ( ) ; } ResourceBundle parent = this . parent ; return new ResourceBundleEnumeration ( lookup . keySet ( ) , ( parent != null ) ? parent . getKeys ( ) : null ) ; |
public class DefaultSizeRollingConfigurator { /** * Parse the maxLogSize parameter to a < code > long < / code > . Defaults to { @ link SizeRollingFileHandler # DEFAULT _ LOG _ SIZE _ BOUND }
* @ param maxLogSizeStr
* @ return */
long parseMaxLogSize ( String maxLogSizeStr ) { } } | long maxLogSize = SizeRollingFileHandler . DEFAULT_LOG_SIZE_BOUND ; if ( maxLogSizeStr != null ) { maxLogSizeStr = maxLogSizeStr . trim ( ) . toUpperCase ( ) ; if ( maxLogSizeStr . endsWith ( "T" ) ) { maxLogSizeStr = maxLogSizeStr . substring ( 0 , maxLogSizeStr . length ( ) - 1 ) ; try { maxLogSize = Long . parseLong... |
public class DoublesUnionImpl { /** * Returns a Heap DoublesUnion object that has been initialized with the data from the given
* sketch .
* @ param sketch A DoublesSketch to be used as a source of data only and will not be modified .
* @ return a DoublesUnion object */
static DoublesUnionImpl heapifyInstance ( f... | final int k = sketch . getK ( ) ; final DoublesUnionImpl union = new DoublesUnionImpl ( k ) ; union . maxK_ = k ; union . gadget_ = copyToHeap ( sketch ) ; return union ; |
public class AutumnApplication { /** * Invoked before context initiation .
* @ param initializer should be used to registered default components , created with plain old Java . */
protected void addDefaultComponents ( final ContextInitializer initializer ) { } } | initializer . addComponents ( // PROCESSORS .
// Assets :
new AssetService ( ) , new SkinAssetAnnotationProcessor ( ) , // Locale :
new LocaleService ( ) , // SFX :
new MusicEnabledAnnotationProcessor ( ) , new MusicVolumeAnnotationProcessor ( ) , new SoundEnabledAnnotationProcessor ( ) , new SoundVolumeAnnotationProce... |
public class Ifc2x3tc1PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public EEnum getIfcLightEmissionSourceEnum ( ) { } } | if ( ifcLightEmissionSourceEnumEEnum == null ) { ifcLightEmissionSourceEnumEEnum = ( EEnum ) EPackage . Registry . INSTANCE . getEPackage ( Ifc2x3tc1Package . eNS_URI ) . getEClassifiers ( ) . get ( 854 ) ; } return ifcLightEmissionSourceEnumEEnum ; |
public class SwipeBack { /** * Attaches the SwipeBack to the Activity
* @ param activity
* @ param type
* @ param position
* @ param dragMode
* The dragMode which is { @ link # DRAG _ CONTENT } or
* { @ link # DRAG _ WINDOW }
* @ return The created SwipeBack instance */
public static SwipeBack attach ( Ac... | return attach ( activity , type , position , dragMode , new DefaultSwipeBackTransformer ( ) ) ; |
public class AbstractResourceBundleTag { /** * Returns the resource handler
* @ param context
* the FacesContext
* @ return the resource handler */
protected ResourceBundlesHandler getResourceBundlesHandler ( FacesContext context ) { } } | Object handler = context . getExternalContext ( ) . getApplicationMap ( ) . get ( getResourceBundlesHandlerAttributeName ( ) ) ; if ( null == handler ) throw new IllegalStateException ( "ResourceBundlesHandler not present in servlet context. Initialization of Jawr either failed or never occurred." ) ; ResourceBundlesHa... |
public class MetadataTemplate { /** * Returns all metadata templates within a user ' s scope . Currently only the enterprise scope is supported .
* @ param scope the scope of the metadata templates .
* @ param api the API connection to be used .
* @ param fields the fields to retrieve .
* @ return the metadata ... | return getEnterpriseMetadataTemplates ( ENTERPRISE_METADATA_SCOPE , DEFAULT_ENTRIES_LIMIT , api , fields ) ; |
public class PStmAssistantInterpreter { /** * Find a statement starting on the given line . Single statements just compare their location to lineno , but block
* statements and statements with sub - statements iterate over their branches .
* @ param stm
* the statement
* @ param lineno
* The line number to lo... | try { return stm . apply ( af . getStatementFinder ( ) , lineno ) ; // FIXME : should we handle exceptions like this
} catch ( AnalysisException e ) { return null ; // Most have none
} |
public class Utility { /** * Post Lollipop Devices require permissions on Runtime ( Risky Ones ) , even though it has been
* specified in the uses - permission tag of manifest . checkStorageAccessPermissions
* method checks whether the READ EXTERNAL STORAGE permission has been granted to
* the Application .
* @... | // Only for Android M and above .
if ( android . os . Build . VERSION . SDK_INT >= android . os . Build . VERSION_CODES . M ) { String permission = "android.permission.READ_EXTERNAL_STORAGE" ; int res = context . checkCallingOrSelfPermission ( permission ) ; return ( res == PackageManager . PERMISSION_GRANTED ) ; } els... |
public class Table { /** * Update record in the table using table ' s primary key to locate record in
* the table and values of fields of specified object < I > obj < / I > to alter
* record fields . Only the fields marked as modified in the supplied field
* mask will be updated in the database .
* @ param obj ... | int nUpdated = 0 ; String sql = "update " + name + " set " + ( mask != null ? buildListOfAssignments ( mask ) : listOfAssignments ) + buildUpdateWhere ( ) ; PreparedStatement ustmt = conn . prepareStatement ( sql ) ; int column = bindUpdateVariables ( ustmt , obj , mask ) ; for ( int i = 0 ; i < primaryKeys . length ; ... |
public class StackBenchmarkParameterized { /** * Bench for pushing the data to the { @ link FastIntStack } . */
@ Bench ( dataProvider = "generateData" ) void benchFastIntPush ( final List < Integer > intData ) { } } | fastInt = new FastIntStack ( ) ; for ( final Object i : intData ) { fastInt . push ( ( Integer ) i ) ; } |
public class ManCommand { /** * / * ( non - Javadoc )
* @ see org . telegram . telegrambots . extensions . bots . commandbot . commands . helpCommand . IManCommand # toMan ( ) */
@ Override public String toMan ( ) { } } | StringBuilder sb = new StringBuilder ( toString ( ) ) ; sb . append ( System . lineSeparator ( ) ) . append ( "-----------------" ) . append ( System . lineSeparator ( ) ) ; if ( getExtendedDescription ( ) != null ) sb . append ( getExtendedDescription ( ) ) ; return sb . toString ( ) ; |
public class string { /** * Turns a camel case string into an underscored one , e . g . " HelloWorld "
* becomes " hello _ world " .
* @ param camelCaseString the string to underscore
* @ return the underscored string */
public static String underscore ( String camelCaseString ) { } } | String [ ] words = splitByCharacterTypeCamelCase ( camelCaseString ) ; return TextUtils . join ( "_" , words ) . toLowerCase ( ) ; |
public class RevisionDecoder { /** * Decodes a Delete operation .
* @ param blockSize _ S
* length of a S block
* @ param blockSize _ E
* length of a E block
* @ return DiffPart , Delete operation
* @ throws DecodingException
* if the decoding failed */
private DiffPart decodeDelete ( final int blockSize_... | if ( blockSize_S < 1 || blockSize_E < 1 ) { throw new DecodingException ( "Invalid value for blockSize_S: " + blockSize_S + " or blockSize_E: " + blockSize_E ) ; } int s = r . read ( blockSize_S ) ; int e = r . read ( blockSize_E ) ; DiffPart part = new DiffPart ( DiffAction . DELETE ) ; part . setStart ( s ) ; part . ... |
public class Query { /** * < pre >
* { $ and : [ expressions ] }
* { $ or : [ expressions ] }
* < / pre > */
public static Query logical ( LogOp op , Query ... expressions ) { } } | return logical ( op , Arrays . asList ( expressions ) ) ; |
public class GifAnimationBackend { /** * Measures the source , and sets the size based on them . Maintains aspect ratio of source , and
* ensures that screen is filled in at least one dimension .
* < p > Adapted from com . facebook . cameracore . common . RenderUtil # calculateFitRect
* @ param viewPortWidth the ... | float inputRatio = ( ( float ) sourceWidth ) / sourceHeight ; float outputRatio = ( ( float ) viewPortWidth ) / viewPortHeight ; int scaledWidth = viewPortWidth ; int scaledHeight = viewPortHeight ; if ( outputRatio > inputRatio ) { // Not enough width to fill the output . ( Black bars on left and right . )
scaledWidth... |
public class CamelCommandsHelper { /** * Populates the details for the given component , returning a Result if it fails . */
public static Result loadCamelComponentDetails ( CamelCatalog camelCatalog , String camelComponentName , CamelComponentDetails details ) { } } | String json = camelCatalog . componentJSonSchema ( camelComponentName ) ; if ( json == null ) { return Results . fail ( "Could not find catalog entry for component name: " + camelComponentName ) ; } List < Map < String , String > > data = JSonSchemaHelper . parseJsonSchema ( "component" , json , false ) ; for ( Map < S... |
public class Utils { /** * Formats a collection of elements as a string .
* @ param items a non - null list of items
* @ param separator a string to separate items
* @ return a non - null string */
public static String format ( Collection < String > items , String separator ) { } } | StringBuilder sb = new StringBuilder ( ) ; for ( Iterator < String > it = items . iterator ( ) ; it . hasNext ( ) ; ) { sb . append ( it . next ( ) ) ; if ( it . hasNext ( ) ) sb . append ( separator ) ; } return sb . toString ( ) ; |
public class CmsClientUserSettingConverter { /** * Saves the given user preference values . < p >
* @ param settings the user preference values to save
* @ throws Exception if something goes wrong */
public void saveSettings ( Map < String , String > settings ) throws Exception { } } | for ( Map . Entry < String , String > entry : settings . entrySet ( ) ) { String key = entry . getKey ( ) ; String value = entry . getValue ( ) ; saveSetting ( key , value ) ; } m_currentPreferences . save ( m_cms ) ; CmsWorkplace . updateUserPreferences ( m_cms , m_request ) ; |
public class Blog { /** * Get the submissions for this blog
* @ param options the options ( or null )
* @ return a List of posts */
public List < Post > submissions ( Map < String , ? > options ) { } } | return client . blogSubmissions ( name , options ) ; |
public class BaseLexicon { /** * TODO : this used to actually score things based on the original trees */
public final void tune ( ) { } } | double bestScore = Double . NEGATIVE_INFINITY ; double [ ] bestSmooth = { 0.0 , 0.0 } ; for ( smooth [ 0 ] = 1 ; smooth [ 0 ] <= 1 ; smooth [ 0 ] *= 2.0 ) { // 64
for ( smooth [ 1 ] = 0.2 ; smooth [ 1 ] <= 0.2 ; smooth [ 1 ] *= 2.0 ) { // for ( smooth [ 0 ] = 0.5 ; smooth [ 0 ] < = 64 ; smooth [ 0 ] * = 2.0 ) { / / 64
... |
public class BoxResource { /** * Resolves { @ link BoxResourceType } for a provided { @ link BoxResource } { @ link Class } .
* @ param clazz
* { @ link BoxResource } type
* @ return resolved { @ link BoxResourceType # value ( ) } */
public static String getResourceType ( Class < ? extends BoxResource > clazz ) {... | BoxResourceType resource = clazz . getAnnotation ( BoxResourceType . class ) ; if ( resource == null ) { throw new IllegalArgumentException ( "Provided BoxResource type does not have @BoxResourceType annotation." ) ; } return resource . value ( ) ; |
public class HiveSQLException { /** * Converts the specified { @ link Exception } object into a { @ link TStatus } object
* @ param e a { @ link Exception } object
* @ return a { @ link TStatus } object */
public static TStatus toTStatus ( Exception e ) { } } | if ( e instanceof HiveSQLException ) { return ( ( HiveSQLException ) e ) . toTStatus ( ) ; } TStatus tStatus = new TStatus ( TStatusCode . ERROR_STATUS ) ; tStatus . setErrorMessage ( e . getMessage ( ) ) ; tStatus . setInfoMessages ( toString ( e ) ) ; return tStatus ; |
public class CsvDataSource { /** * CSV files are not loaded here , this is done on - access ( lazy loading ) . */
protected Map < String , CsvFile > getCsvFiles ( ) { } } | if ( csvFiles == null ) { String fileName = null ; csvFiles = Maps . newHashMap ( ) ; Set < String > keys = configuration . keySet ( ) ; String prefix = "dataSource." + getName ( ) + "." ; for ( String key : keys ) { if ( key . startsWith ( prefix ) ) { String dataKey = key . substring ( key . indexOf ( prefix ) + pref... |
public class ThriftServiceUtils { /** * Retrieves thrift service names of { @ code service } using reflection . */
static Set < String > serviceNames ( Service < HttpRequest , HttpResponse > service ) { } } | if ( thriftServiceClass == null || entriesMethod == null || interfacesMethod == null ) { return ImmutableSet . of ( ) ; } return service . as ( thriftServiceClass ) . map ( s -> { @ SuppressWarnings ( "unchecked" ) final Map < String , ? > entries = ( Map < String , ? > ) invokeMethod ( entriesMethod , s ) ; assert ent... |
public class AvatarZKShell { /** * This method tries to update the information in ZooKeeper For every address
* of the NameNode it is being run for ( fs . default . name ,
* dfs . namenode . dn - address , dfs . namenode . http . address ) if they are present . It
* also creates information for aliases in ZooKeep... | if ( ! force ) { initAvatarRPC ( ) ; Avatar avatar = avatarnode . getAvatar ( ) ; if ( avatar != Avatar . ACTIVE ) { throw new IOException ( "Cannot update ZooKeeper information to point to " + "the AvatarNode in Standby mode" ) ; } } AvatarNodeZkUtil . updateZooKeeper ( originalConf , conf , toOverwrite , serviceName ... |
public class SSLConfigManager { /** * This method checks if the client supports / requires SSL client
* authentication . Returns false if both required and supported are false .
* @ return boolean */
public synchronized boolean isClientAuthenticationEnabled ( ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "isClientAuthenticationEnabled" ) ; boolean auth = false ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "isClientAuthenticationEnabled" , Boolean . valueOf ( auth ) ) ; return auth... |
public class AbstractWSingleSelectList { /** * Determines which selection has been included in the given request .
* @ param request the current request
* @ return the selected option in the given request */
protected Object getNewSelection ( final Request request ) { } } | String paramValue = request . getParameter ( getId ( ) ) ; if ( paramValue == null ) { return null ; } // Figure out which option has been selected .
List < ? > options = getOptions ( ) ; if ( options == null || options . isEmpty ( ) ) { if ( ! isEditable ( ) ) { // User could not have made a selection .
return null ; ... |
public class Sanitizer { /** * Sanitize the given value if necessary .
* @ param key the key to sanitize
* @ param value the value
* @ return the potentially sanitized value */
public Object sanitize ( String key , Object value ) { } } | if ( value == null ) { return null ; } for ( Pattern pattern : this . keysToSanitize ) { if ( pattern . matcher ( key ) . matches ( ) ) { return "******" ; } } return value ; |
public class CPDefinitionLocalizationPersistenceImpl { /** * Removes the cp definition localization with the primary key from the database . Also notifies the appropriate model listeners .
* @ param primaryKey the primary key of the cp definition localization
* @ return the cp definition localization that was remov... | Session session = null ; try { session = openSession ( ) ; CPDefinitionLocalization cpDefinitionLocalization = ( CPDefinitionLocalization ) session . get ( CPDefinitionLocalizationImpl . class , primaryKey ) ; if ( cpDefinitionLocalization == null ) { if ( _log . isDebugEnabled ( ) ) { _log . debug ( _NO_SUCH_ENTITY_WI... |
public class LookupBinding { /** * Get / create the button to open the dataEditor in selection mode */
protected AbstractButton getDataEditorButton ( ) { } } | if ( dataEditorButton == null ) { dataEditorButton = getDataEditorCommand ( ) . createButton ( ) ; dataEditorButton . setFocusable ( false ) ; // dataEditorButton . addFocusListener ( createFocusListener ( ) ) ;
} return dataEditorButton ; |
public class Eval { /** * General object type evaluation .
* < ul >
* < li > return < code > false < / code > if the object instance is < code > null < / code > < / li >
* < li > return < code > false < / code > if the object instance is an empty { @ link java . util . Collection } or { @ link java . util . Map }... | if ( condition == null ) { return false ; } else if ( condition instanceof String ) { return eval ( ( String ) condition ) ; } else if ( condition instanceof Boolean ) { return ( Boolean ) condition ; } else if ( condition instanceof Collection ) { return eval ( ( Collection ) condition ) ; } else if ( condition instan... |
public class KvStateSerializer { /** * Deserializes all kv pairs with the given serializer .
* @ param serializedValue Serialized value of type Map & lt ; UK , UV & gt ;
* @ param keySerializer Serializer for UK
* @ param valueSerializer Serializer for UV
* @ param < UK > Type of the key
* @ param < UV > Type... | if ( serializedValue != null ) { DataInputDeserializer in = new DataInputDeserializer ( serializedValue , 0 , serializedValue . length ) ; Map < UK , UV > result = new HashMap < > ( ) ; while ( in . available ( ) > 0 ) { UK key = keySerializer . deserialize ( in ) ; boolean isNull = in . readBoolean ( ) ; UV value = is... |
public class SipServletResponseImpl { /** * ( non - Javadoc )
* @ see javax . servlet . sip . SipServletResponse # createAck ( ) */
@ SuppressWarnings ( "unchecked" ) public SipServletRequest createAck ( ) { } } | final Response response = getResponse ( ) ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( "transaction " + getTransaction ( ) ) ; logger . debug ( "originalRequest " + originalRequest ) ; } // transaction can be null in case of forking
if ( ( ( getTransaction ( ) == null && originalRequest != null && ! Request ... |
public class Rational { /** * Remove the fractional part .
* @ return The integer rounded towards zero . */
public BigInteger trunc ( ) { } } | /* is already integer : return the numerator */
if ( b . compareTo ( BigInteger . ONE ) == 0 ) { return a ; } else { return a . divide ( b ) ; } |
public class ShutdownHookProcessDestroyer { /** * Removes this < code > ProcessDestroyer < / code > as a shutdown hook , uses
* reflection to ensure pre - JDK 1.3 compatibility */
private void removeShutdownHook ( ) { } } | if ( added && ! running ) { boolean removed = Runtime . getRuntime ( ) . removeShutdownHook ( destroyProcessThread ) ; if ( ! removed ) { log . error ( "Could not remove shutdown hook" ) ; } /* * start the hook thread , a unstarted thread may not be eligible for
* garbage collection Cf . : http : / / developer . java... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.