signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class ScanStrategy { /** * A naive implementation filtering cross join by condition */ private DataContainer innerJoin ( DataContainer left , DataContainer right , Optional < BooleanExpression > joinCondition ) { } }
return crossJoin ( left , right , joinCondition , JoinType . INNER ) ;
public class Factory { /** * Create structr nodes from all given underlying database nodes * No paging , but security check * @ param input * @ return nodes * @ throws org . structr . common . error . FrameworkException */ public Iterable < T > bulkInstantiate ( final Iterable < S > input ) throws FrameworkException { } }
return Iterables . map ( this , input ) ;
public class ProfilePackageFrameWriter { /** * Generate a profile package summary page for the left - hand bottom frame . Construct * the ProfilePackageFrameWriter object and then uses it generate the file . * @ param configuration the current configuration of the doclet . * @ param packageDoc The package for which " profilename - package - frame . html " is to be generated . * @ param profileValue the value of the profile being documented */ public static void generate ( ConfigurationImpl configuration , PackageDoc packageDoc , int profileValue ) { } }
ProfilePackageFrameWriter profpackgen ; try { String profileName = Profile . lookup ( profileValue ) . name ; profpackgen = new ProfilePackageFrameWriter ( configuration , packageDoc , profileName ) ; StringBuilder winTitle = new StringBuilder ( profileName ) ; String sep = " - " ; winTitle . append ( sep ) ; String pkgName = Util . getPackageName ( packageDoc ) ; winTitle . append ( pkgName ) ; Content body = profpackgen . getBody ( false , profpackgen . getWindowTitle ( winTitle . toString ( ) ) ) ; Content profName = new StringContent ( profileName ) ; Content sepContent = new StringContent ( sep ) ; Content pkgNameContent = new RawHtml ( pkgName ) ; Content heading = HtmlTree . HEADING ( HtmlConstants . TITLE_HEADING , HtmlStyle . bar , profpackgen . getTargetProfileLink ( "classFrame" , profName , profileName ) ) ; heading . addContent ( sepContent ) ; heading . addContent ( profpackgen . getTargetProfilePackageLink ( packageDoc , "classFrame" , pkgNameContent , profileName ) ) ; body . addContent ( heading ) ; HtmlTree div = new HtmlTree ( HtmlTag . DIV ) ; div . addStyle ( HtmlStyle . indexContainer ) ; profpackgen . addClassListing ( div , profileValue ) ; body . addContent ( div ) ; profpackgen . printHtmlDocument ( configuration . metakeywords . getMetaKeywords ( packageDoc ) , false , body ) ; profpackgen . close ( ) ; } catch ( IOException exc ) { configuration . standardmessage . error ( "doclet.exception_encountered" , exc . toString ( ) , DocPaths . PACKAGE_FRAME . getPath ( ) ) ; throw new DocletAbortException ( exc ) ; }
public class IntegerInputVerifier { /** * Verifies the input with the side effect that the background color of { @ code input } to { @ code background } if * returns { @ code true } , or { @ code warningBackground } otherwise * @ param input component * @ return if input is valid */ public boolean shouldYieldFocus ( JComponent input ) { } }
boolean isValidInput = verify ( input ) ; if ( isValidInput ) { input . setBackground ( background ) ; } else { input . setBackground ( warningBackground ) ; } return isValidInput ;
public class DetachThingPrincipalRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( DetachThingPrincipalRequest detachThingPrincipalRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( detachThingPrincipalRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( detachThingPrincipalRequest . getThingName ( ) , THINGNAME_BINDING ) ; protocolMarshaller . marshall ( detachThingPrincipalRequest . getPrincipal ( ) , PRINCIPAL_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class EnumUtils { /** * Writes a value of an enumeration to the given output stream . * @ param out * the output stream to write to * @ param enumVal * the value of a enumeration to be written to the output stream * @ throws IOException * thrown if any error occurred while writing data to the stream */ public static void writeEnum ( final DataOutput out , final Enum < ? > enumVal ) throws IOException { } }
if ( enumVal == null ) { out . writeBoolean ( false ) ; } else { out . writeBoolean ( true ) ; StringRecord . writeString ( out , enumVal . name ( ) ) ; }
public class NikeFS2LazyRandomAccessStorageImpl { /** * Consolidates this soft copy prior to modification . This will detach this * instance from its parent , creating a true copy of its current data . */ public synchronized void consolidateSoftCopy ( ) throws IOException { } }
if ( isSoftCopy == true ) { ArrayList < NikeFS2Block > copyBlocks = new ArrayList < NikeFS2Block > ( ) ; if ( blocks . size ( ) > 0 ) { // make copies of all contained blocks byte [ ] buffer = new byte [ blocks . get ( 0 ) . size ( ) ] ; for ( NikeFS2Block block : blocks ) { NikeFS2Block copyBlock = vfs . allocateBlock ( ) ; block . read ( 0 , buffer ) ; copyBlock . write ( 0 , buffer ) ; copyBlocks . add ( copyBlock ) ; } } // replace blocks list blocks = copyBlocks ; isSoftCopy = false ; // deregister from template parent . deregisterSoftCopy ( this ) ; parent = null ; }
public class PrefixedProperties { /** * Sets the local Prefix . The local Prefix is Thread depended and will only * affect the current thread . You can have a combination of default and * local prefix . * @ param configuredPrefix * the new configuredPrefix */ public void setLocalPrefix ( final String configuredPrefix ) { } }
lock . writeLock ( ) . lock ( ) ; try { final String myPrefix = checkAndConvertPrefix ( configuredPrefix ) ; final List < String > prefixList = split ( myPrefix ) ; setPrefixes ( prefixList ) ; } finally { lock . writeLock ( ) . unlock ( ) ; }
public class AggregateWordCount { /** * The main driver for word count map / reduce program . Invoke this method to * submit the map / reduce job . * @ throws IOException * When there is communication problems with the job tracker . */ @ SuppressWarnings ( "unchecked" ) public static void main ( String [ ] args ) throws IOException { } }
JobConf conf = ValueAggregatorJob . createValueAggregatorJob ( args , new Class [ ] { WordCountPlugInClass . class } ) ; JobClient . runJob ( conf ) ;
public class AnnotationInfo { /** * Get the parameter values . * @ return The parameter values of this annotation , including any default parameter values inherited from the * annotation class definition , or the empty list if none . */ public AnnotationParameterValueList getParameterValues ( ) { } }
if ( annotationParamValuesWithDefaults == null ) { final ClassInfo classInfo = getClassInfo ( ) ; if ( classInfo == null ) { // ClassInfo has not yet been set , just return values without defaults // ( happens when trying to log AnnotationInfo during scanning , before ScanResult is available ) return annotationParamValues == null ? AnnotationParameterValueList . EMPTY_LIST : annotationParamValues ; } // Lazily convert any Object [ ] arrays of boxed types to primitive arrays if ( annotationParamValues != null && ! annotationParamValuesHasBeenConvertedToPrimitive ) { annotationParamValues . convertWrapperArraysToPrimitiveArrays ( classInfo ) ; annotationParamValuesHasBeenConvertedToPrimitive = true ; } if ( classInfo . annotationDefaultParamValues != null && ! classInfo . annotationDefaultParamValuesHasBeenConvertedToPrimitive ) { classInfo . annotationDefaultParamValues . convertWrapperArraysToPrimitiveArrays ( classInfo ) ; classInfo . annotationDefaultParamValuesHasBeenConvertedToPrimitive = true ; } // Check if one or both of the defaults and the values in this annotation instance are null ( empty ) final AnnotationParameterValueList defaultParamValues = classInfo . annotationDefaultParamValues ; if ( defaultParamValues == null && annotationParamValues == null ) { return AnnotationParameterValueList . EMPTY_LIST ; } else if ( defaultParamValues == null ) { return annotationParamValues ; } else if ( annotationParamValues == null ) { return defaultParamValues ; } // Overwrite defaults with non - defaults final Map < String , Object > allParamValues = new HashMap < > ( ) ; for ( final AnnotationParameterValue defaultParamValue : defaultParamValues ) { allParamValues . put ( defaultParamValue . getName ( ) , defaultParamValue . getValue ( ) ) ; } for ( final AnnotationParameterValue annotationParamValue : this . annotationParamValues ) { allParamValues . put ( annotationParamValue . getName ( ) , annotationParamValue . getValue ( ) ) ; } // Put annotation values in the same order as the annotation methods ( there is one method for each // annotation constant ) if ( classInfo . methodInfo == null ) { // Should not happen ( when classfile is read , methods are always read , whether or not // scanSpec . enableMethodInfo is true ) throw new IllegalArgumentException ( "Could not find methods for annotation " + classInfo . getName ( ) ) ; } annotationParamValuesWithDefaults = new AnnotationParameterValueList ( ) ; for ( final MethodInfo mi : classInfo . methodInfo ) { final String paramName = mi . getName ( ) ; switch ( paramName ) { // None of these method names should be present in the @ interface class itself , it should only // contain methods for the annotation constants ( but skip them anyway to be safe ) . These methods // should only exist in concrete instances of the annotation . case "<init>" : case "<clinit>" : case "hashCode" : case "equals" : case "toString" : case "annotationType" : // Skip break ; default : // Annotation constant final Object paramValue = allParamValues . get ( paramName ) ; // Annotation values cannot be null ( or absent , from either defaults or annotation instance ) if ( paramValue != null ) { annotationParamValuesWithDefaults . add ( new AnnotationParameterValue ( paramName , paramValue ) ) ; } break ; } } } return annotationParamValuesWithDefaults ;
public class CrossValidationSplitter { /** * { @ inheritDoc } */ @ Override public DataModelIF < U , I > [ ] split ( final DataModelIF < U , I > data ) { } }
@ SuppressWarnings ( "unchecked" ) final DataModelIF < U , I > [ ] splits = new DataModelIF [ 2 * nFolds ] ; for ( int i = 0 ; i < nFolds ; i ++ ) { splits [ 2 * i ] = DataModelFactory . getDefaultModel ( ) ; // training splits [ 2 * i + 1 ] = DataModelFactory . getDefaultModel ( ) ; // test } if ( perUser ) { int n = 0 ; for ( U user : data . getUsers ( ) ) { List < I > items = new ArrayList < > ( ) ; for ( I i : data . getUserItems ( user ) ) { items . add ( i ) ; } Collections . shuffle ( items , rnd ) ; for ( I item : items ) { Double pref = data . getUserItemPreference ( user , item ) ; int curFold = n % nFolds ; for ( int i = 0 ; i < nFolds ; i ++ ) { DataModelIF < U , I > datamodel = splits [ 2 * i ] ; // training if ( i == curFold ) { datamodel = splits [ 2 * i + 1 ] ; // test } if ( pref != null ) { datamodel . addPreference ( user , item , pref ) ; } } n ++ ; } } } else { List < U > users = new ArrayList < > ( ) ; for ( U u : data . getUsers ( ) ) { users . add ( u ) ; } Collections . shuffle ( users , rnd ) ; int n = 0 ; for ( U user : users ) { List < I > items = new ArrayList < > ( ) ; for ( I i : data . getUserItems ( user ) ) { items . add ( i ) ; } Collections . shuffle ( items , rnd ) ; for ( I item : items ) { Double pref = data . getUserItemPreference ( user , item ) ; int curFold = n % nFolds ; for ( int i = 0 ; i < nFolds ; i ++ ) { DataModelIF < U , I > datamodel = splits [ 2 * i ] ; // training if ( i == curFold ) { datamodel = splits [ 2 * i + 1 ] ; // test } if ( pref != null ) { datamodel . addPreference ( user , item , pref ) ; } } n ++ ; } } } return splits ;
public class CompositeByteBuf { /** * Discard all { @ link ByteBuf } s which are read . */ public CompositeByteBuf discardReadComponents ( ) { } }
ensureAccessible ( ) ; final int readerIndex = readerIndex ( ) ; if ( readerIndex == 0 ) { return this ; } // Discard everything if ( readerIndex = writerIndex = capacity ) . int writerIndex = writerIndex ( ) ; if ( readerIndex == writerIndex && writerIndex == capacity ( ) ) { for ( int i = 0 , size = componentCount ; i < size ; i ++ ) { components [ i ] . free ( ) ; } lastAccessed = null ; clearComps ( ) ; setIndex ( 0 , 0 ) ; adjustMarkers ( readerIndex ) ; return this ; } // Remove read components . int firstComponentId = 0 ; Component c = null ; for ( int size = componentCount ; firstComponentId < size ; firstComponentId ++ ) { c = components [ firstComponentId ] ; if ( c . endOffset > readerIndex ) { break ; } c . free ( ) ; } if ( firstComponentId == 0 ) { return this ; // Nothing to discard } Component la = lastAccessed ; if ( la != null && la . endOffset <= readerIndex ) { lastAccessed = null ; } removeCompRange ( 0 , firstComponentId ) ; // Update indexes and markers . int offset = c . offset ; updateComponentOffsets ( 0 ) ; setIndex ( readerIndex - offset , writerIndex - offset ) ; adjustMarkers ( offset ) ; return this ;
public class StorageUtil { /** * sets a Credentials to a XML Element * @ param el * @ param username * @ param password * @ param credentials */ public void setCredentials ( Element el , String username , String password , Credentials c ) { } }
if ( c == null ) return ; if ( c . getUsername ( ) != null ) el . setAttribute ( username , c . getUsername ( ) ) ; if ( c . getPassword ( ) != null ) el . setAttribute ( password , c . getPassword ( ) ) ;
public class CliFrontend { /** * Executes the cancel action . * @ param args Command line arguments for the cancel action . */ protected int cancel ( String [ ] args ) { } }
// Parse command line options CommandLine line ; try { line = parser . parse ( CANCEL_OPTIONS , args , false ) ; } catch ( MissingOptionException e ) { System . out . println ( e . getMessage ( ) ) ; printHelpForCancel ( ) ; return 1 ; } catch ( UnrecognizedOptionException e ) { System . out . println ( e . getMessage ( ) ) ; printHelpForCancel ( ) ; return 2 ; } catch ( Exception e ) { return handleError ( e ) ; } if ( printHelp ) { printHelpForCancel ( ) ; return 0 ; } JobID jobId ; if ( line . hasOption ( ID_OPTION . getOpt ( ) ) ) { String jobIdString = line . getOptionValue ( ID_OPTION . getOpt ( ) ) ; try { jobId = new JobID ( StringUtils . hexStringToByte ( jobIdString ) ) ; } catch ( Exception e ) { System . out . println ( "Error: The value for the Job ID is not a valid ID." ) ; printHelpForCancel ( ) ; return 1 ; } } else { System . out . println ( "Error: Specify a Job ID to cancel a job." ) ; printHelpForCancel ( ) ; return 1 ; } ExtendedManagementProtocol jmConn = null ; try { jmConn = getJobManagerConnection ( line ) ; if ( jmConn == null ) { printHelpForCancel ( ) ; return 1 ; } jmConn . cancelJob ( jobId ) ; return 0 ; } catch ( Throwable t ) { return handleError ( t ) ; } finally { if ( jmConn != null ) { try { RPC . stopProxy ( jmConn ) ; } catch ( Throwable t ) { System . out . println ( "Warning: Could not cleanly shut down connection to the JobManager." ) ; } } jmConn = null ; }
public class PasswordMaker { /** * Generates a hash of the master password with settings from the account . * @ param masterPassword The password to use as a key for the various algorithms . * @ param account The account with the specific settings for the hash . Uses account . getUrl ( ) as the inputText * @ return A SecureCharArray with the hashed data . * @ throws Exception if something bad happened . */ public SecureUTF8String makePassword ( final SecureUTF8String masterPassword , final Account account ) throws Exception { } }
return makePassword ( masterPassword , account , account . getUrl ( ) ) ;
public class MoreMaps { /** * 以Guava TreeRangeMap实现的 , 一段范围的Key指向同一个Value的Map */ @ SuppressWarnings ( "rawtypes" ) public static < K extends Comparable , V > TreeRangeMap < K , V > createRangeMap ( ) { } }
return TreeRangeMap . create ( ) ;
public class LogsMarshaller { /** * Marshall the given parameter object . */ public void marshall ( Logs logs , ProtocolMarshaller protocolMarshaller ) { } }
if ( logs == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( logs . getAudit ( ) , AUDIT_BINDING ) ; protocolMarshaller . marshall ( logs . getGeneral ( ) , GENERAL_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class ExpectedConditions { /** * An expectation to check if js executable . * Useful when you know that there should be a Javascript value or something at the stage . * @ param javaScript used as executable script * @ return true once javaScript executed without errors */ public static ExpectedCondition < Boolean > javaScriptThrowsNoExceptions ( final String javaScript ) { } }
return new ExpectedCondition < Boolean > ( ) { @ Override public Boolean apply ( WebDriver driver ) { try { ( ( JavascriptExecutor ) driver ) . executeScript ( javaScript ) ; return true ; } catch ( WebDriverException e ) { return false ; } } @ Override public String toString ( ) { return String . format ( "js %s to be executable" , javaScript ) ; } } ;
public class PureFunctionIdentifier { /** * Traverses an { @ code expr } to collect nodes representing potential callables that it may resolve * to well known callables . * @ see { @ link # collectCallableLeavesInternal } * @ return the disovered callables , or { @ code null } if an unexpected possible value was found . */ @ Nullable private static ImmutableList < Node > collectCallableLeaves ( Node expr ) { } }
ArrayList < Node > callables = new ArrayList < > ( ) ; boolean allLegal = collectCallableLeavesInternal ( expr , callables ) ; return allLegal ? ImmutableList . copyOf ( callables ) : null ;
public class AssetController { /** * Retrieves an asset . * @ param path the asset path * @ return the Asset object , or { @ literal null } if the current provider can ' t serve this asset . */ @ Override public Asset < ? > assetAt ( String path ) { } }
Asset < ? > asset = getAssetFromFS ( path ) ; if ( asset == null ) { asset = getAssetFromBundle ( path ) ; } return asset ;
public class Authorization { /** * Produces a String containing the bytes provided in hexadecimal notation . * @ param bytes The bytes to convert into hex . * @ return A String containing the hex representation of the given bytes . */ private static String getHexString ( byte [ ] bytes ) { } }
// If null byte array given , return null if ( bytes == null ) return null ; // Create string builder for holding the hex representation , // pre - calculating the exact length StringBuilder hex = new StringBuilder ( 2 * bytes . length ) ; // Convert each byte into a pair of hex digits for ( byte b : bytes ) { hex . append ( HEX_CHARS [ ( b & 0xF0 ) >> 4 ] ) . append ( HEX_CHARS [ b & 0x0F ] ) ; } // Return the string produced return hex . toString ( ) ;
public class AmazonInspectorClient { /** * Lists the assessment runs that correspond to the assessment templates that are specified by the ARNs of the * assessment templates . * @ param listAssessmentRunsRequest * @ return Result of the ListAssessmentRuns operation returned by the service . * @ throws InternalException * Internal server error . * @ throws InvalidInputException * The request was rejected because an invalid or out - of - range value was supplied for an input parameter . * @ throws AccessDeniedException * You do not have required permissions to access the requested resource . * @ throws NoSuchEntityException * The request was rejected because it referenced an entity that does not exist . The error code describes * the entity . * @ sample AmazonInspector . ListAssessmentRuns * @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / inspector - 2016-02-16 / ListAssessmentRuns " target = " _ top " > AWS * API Documentation < / a > */ @ Override public ListAssessmentRunsResult listAssessmentRuns ( ListAssessmentRunsRequest request ) { } }
request = beforeClientExecution ( request ) ; return executeListAssessmentRuns ( request ) ;
public class OggFile { /** * Returns a random , but previously un - used serial * number for use by a new stream */ protected int getUnusedSerialNumber ( ) { } }
while ( true ) { int sid = ( int ) ( Math . random ( ) * Short . MAX_VALUE ) ; if ( ! seenSIDs . contains ( sid ) ) { return sid ; } }
public class EnvironmentsInner { /** * Stops an environment by stopping all resources inside the environment This operation can take a while to complete . * @ param resourceGroupName The name of the resource group . * @ param labAccountName The name of the lab Account . * @ param labName The name of the lab . * @ param environmentSettingName The name of the environment Setting . * @ param environmentName The name of the environment . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ throws CloudException thrown if the request is rejected by server * @ throws RuntimeException all other wrapped checked exceptions if the request fails to be sent */ public void beginStop ( String resourceGroupName , String labAccountName , String labName , String environmentSettingName , String environmentName ) { } }
beginStopWithServiceResponseAsync ( resourceGroupName , labAccountName , labName , environmentSettingName , environmentName ) . toBlocking ( ) . single ( ) . body ( ) ;
public class ArcCosineUnitlengthDistanceFunction { /** * Computes the cosine distance for two given feature vectors . * The cosine distance is computed as the arcus from the cosine similarity * value , i . e . , < code > arccos ( & lt ; v1 , v2 & gt ; ) < / code > . * @ param v1 first feature vector * @ param v2 second feature vector * @ return the cosine distance for two given feature vectors v1 and v2 */ @ Override public double distance ( NumberVector v1 , NumberVector v2 ) { } }
final double v = VectorUtil . dot ( v1 , v2 ) ; return v < 1 ? ( v > - 1 ? Math . acos ( v ) : 1 ) : 0 ;
public class SplitControllerImpl { /** * about reobtaining . */ private void buildSubJobBatchWorkUnits ( ) { } }
List < Flow > flows = this . split . getFlows ( ) ; splitFlowWorkUnits = new ArrayList < BatchSplitFlowWorkUnit > ( ) ; for ( Flow flow : flows ) { // 1 . First , we build the subjob JSLJob model for flows in split JSLJob splitFlowJSLJob = ParallelStepBuilder . buildFlowInSplitSubJob ( runtimeWorkUnitExecution . getTopLevelInstanceId ( ) , runtimeWorkUnitExecution . getWorkUnitJobContext ( ) , this . split , flow ) ; subJobs . add ( splitFlowJSLJob ) ; // 2 . Next , we build a ( persisted ) execution and a work unit ( thread ) around it . SplitFlowConfig splitFlowConfig = new SplitFlowConfig ( runtimeWorkUnitExecution . getTopLevelNameInstanceExecutionInfo ( ) , split . getId ( ) , flow . getId ( ) , runtimeWorkUnitExecution . getCorrelationId ( ) ) ; BatchSplitFlowWorkUnit workUnit = getBatchKernelService ( ) . createSplitFlowWorkUnit ( splitFlowConfig , splitFlowJSLJob , completedWorkQueue ) ; splitFlowWorkUnits . add ( workUnit ) ; }
public class CallOptions { /** * Disables ' wait for ready ' feature for the call . * This method should be rarely used because the default is without ' wait for ready ' . */ public CallOptions withoutWaitForReady ( ) { } }
CallOptions newOptions = new CallOptions ( this ) ; newOptions . waitForReady = Boolean . FALSE ; return newOptions ;
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EClass getIfcTypeProcess ( ) { } }
if ( ifcTypeProcessEClass == null ) { ifcTypeProcessEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 738 ) ; } return ifcTypeProcessEClass ;
public class DocClient { /** * publish a Document . * @ param bucketName The bucket name response from register . * @ param objectName The object name response from register . * @ param file The Document file need to be uploaded . * @ param endpoint The bos endpoint response from register . * @ return A PublishDocumentResponse object containing the information returned by Document . */ private void bosUploadDocument ( String bucketName , String objectName , File file , String endpoint ) { } }
BosClientConfiguration config = new BosClientConfiguration ( this . config ) ; config . setEndpoint ( endpoint ) ; BosClient bosClient = new BosClient ( config ) ; PutObjectResponse response = bosClient . putObject ( bucketName , objectName , file ) ;
public class PostTextRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( PostTextRequest postTextRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( postTextRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( postTextRequest . getBotName ( ) , BOTNAME_BINDING ) ; protocolMarshaller . marshall ( postTextRequest . getBotAlias ( ) , BOTALIAS_BINDING ) ; protocolMarshaller . marshall ( postTextRequest . getUserId ( ) , USERID_BINDING ) ; protocolMarshaller . marshall ( postTextRequest . getSessionAttributes ( ) , SESSIONATTRIBUTES_BINDING ) ; protocolMarshaller . marshall ( postTextRequest . getRequestAttributes ( ) , REQUESTATTRIBUTES_BINDING ) ; protocolMarshaller . marshall ( postTextRequest . getInputText ( ) , INPUTTEXT_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class EventParser { /** * parses an event from a jsoup document * @ param doc the jsoup document * @ return a parsed event */ @ Override public Event parseDocument ( Document doc ) { } }
Event event = new Event ( ) ; event . setSherdogUrl ( ParserUtils . getSherdogPageUrl ( doc ) ) ; // getting name Elements name = doc . select ( ".header .section_title h1 span[itemprop=\"name\"]" ) ; event . setName ( name . html ( ) . replace ( "<br>" , " - " ) ) ; Elements date = doc . select ( ".authors_info .date meta[itemprop=\"startDate\"]" ) ; // TODO : get date to proper format try { event . setDate ( ParserUtils . getDateFromStringToZoneId ( date . first ( ) . attr ( "content" ) , ZONE_ID ) ) ; } catch ( DateTimeParseException e ) { logger . error ( "Couldn't parse date" , e ) ; } getFights ( doc , event ) ; Element org = doc . select ( ".header .section_title h2 a" ) . get ( 0 ) ; SherdogBaseObject organization = new SherdogBaseObject ( ) ; organization . setSherdogUrl ( org . attr ( "abs:href" ) ) ; organization . setName ( org . select ( "span[itemprop=\"name\"]" ) . get ( 0 ) . html ( ) ) ; event . setOrganization ( organization ) ; return event ;
public class PolicyChecker { /** * Gets an immutable Set of the OID strings for the extensions that * the PKIXCertPathChecker supports ( i . e . recognizes , is able to * process ) , or null if no extensions are * supported . All OID strings that a PKIXCertPathChecker might * possibly be able to process should be included . * @ return the Set of extensions supported by this PKIXCertPathChecker , * or null if no extensions are supported */ @ Override public Set < String > getSupportedExtensions ( ) { } }
if ( supportedExts == null ) { supportedExts = new HashSet < String > ( 4 ) ; supportedExts . add ( CertificatePolicies_Id . toString ( ) ) ; supportedExts . add ( PolicyMappings_Id . toString ( ) ) ; supportedExts . add ( PolicyConstraints_Id . toString ( ) ) ; supportedExts . add ( InhibitAnyPolicy_Id . toString ( ) ) ; supportedExts = Collections . unmodifiableSet ( supportedExts ) ; } return supportedExts ;
public class ConsistentRoutingStrategy { /** * Obtain the master partition for a given key * @ param key * @ return master partition id */ @ Override public Integer getMasterPartition ( byte [ ] key ) { } }
return abs ( hash . hash ( key ) ) % ( Math . max ( 1 , this . partitionToNode . length ) ) ;
public class AssetService { /** * Schedules disposing of the selected asset . * @ param assetPath internal path to the asset . */ public void unload ( final String assetPath ) { } }
if ( assetManager . isLoaded ( assetPath ) || scheduledAssets . contains ( assetPath ) ) { assetManager . unload ( assetPath ) ; } else if ( eagerAssetManager . isLoaded ( assetPath ) ) { eagerAssetManager . unload ( assetPath ) ; }
public class Matrix3d { /** * Set the column at the given < code > column < / code > index , starting with < code > 0 < / code > . * @ param column * the column index in < code > [ 0 . . 2 ] < / code > * @ param x * the first element in the column * @ param y * the second element in the column * @ param z * the third element in the column * @ return this * @ throws IndexOutOfBoundsException if < code > column < / code > is not in < code > [ 0 . . 2 ] < / code > */ public Matrix3d setColumn ( int column , double x , double y , double z ) throws IndexOutOfBoundsException { } }
switch ( column ) { case 0 : this . m00 = x ; this . m01 = y ; this . m02 = z ; break ; case 1 : this . m10 = x ; this . m11 = y ; this . m12 = z ; break ; case 2 : this . m20 = x ; this . m21 = y ; this . m22 = z ; break ; default : throw new IndexOutOfBoundsException ( ) ; } return this ;
public class AbstractAmountFactory { /** * Creates a new instance of { @ link MonetaryAmount } , using the default { @ link MonetaryContext } . * @ return a { @ code MonetaryAmount } combining the numeric value and currency unit . * @ throws ArithmeticException If the number exceeds the capabilities of the default { @ link MonetaryContext } * used . */ @ Override public T create ( ) { } }
if ( currency == null ) { throw new MonetaryException ( "Cannot create an instance of '" + this . getAmountType ( ) . getName ( ) + "': missing currency." ) ; } if ( number == null ) { throw new MonetaryException ( "Cannot create an instance of '" + this . getAmountType ( ) . getName ( ) + "': missing number." ) ; } if ( monetaryContext == null ) { throw new MonetaryException ( "Cannot create an instance of '" + this . getAmountType ( ) . getName ( ) + "': missing context." ) ; } return create ( number , currency , monetaryContext ) ;
public class CliCommandLineConsumer { /** * we reach here when terminal input was value and no help was requested */ static CliReceivedCommand consumeCommandLineInput ( ParseResult providedCommand , @ SuppressWarnings ( "SameParameterValue" ) Iterable < CliDeclaredOptionSpec > declaredOptions ) { } }
assumeTrue ( providedCommand . hasSubcommand ( ) , "Command was empty, expected one of: " + Arrays . toString ( CliCommandType . values ( ) ) ) ; final ParseResult mailCommand = providedCommand . subcommand ( ) ; final CliCommandType matchedCommand = CliCommandType . valueOf ( mailCommand . commandSpec ( ) . name ( ) ) ; final Map < CliDeclaredOptionSpec , OptionSpec > matchedOptionsInOrderProvision = matchProvidedOptions ( declaredOptions , mailCommand . matchedOptions ( ) ) ; logParsedInput ( matchedCommand , matchedOptionsInOrderProvision ) ; List < CliReceivedOptionData > receivedOptions = new ArrayList < > ( ) ; for ( Entry < CliDeclaredOptionSpec , OptionSpec > cliOption : matchedOptionsInOrderProvision . entrySet ( ) ) { final Method sourceMethod = cliOption . getKey ( ) . getSourceMethod ( ) ; final int mandatoryParameters = MiscUtil . countMandatoryParameters ( sourceMethod ) ; final List < String > providedStringValues = cliOption . getValue ( ) . getValue ( ) ; assumeTrue ( providedStringValues . size ( ) >= mandatoryParameters , format ( "provided %s arguments, but need at least %s" , providedStringValues . size ( ) , mandatoryParameters ) ) ; assumeTrue ( providedStringValues . size ( ) <= sourceMethod . getParameterTypes ( ) . length , format ( "provided %s arguments, but need at most %s" , providedStringValues . size ( ) , sourceMethod . getParameterTypes ( ) . length ) ) ; receivedOptions . add ( new CliReceivedOptionData ( cliOption . getKey ( ) , convertProvidedOptionValues ( providedStringValues , sourceMethod ) ) ) ; LOGGER . debug ( "\tconverted option values: {}" , getLast ( receivedOptions ) . getProvidedOptionValues ( ) ) ; } return new CliReceivedCommand ( matchedCommand , receivedOptions ) ;
public class JavaEncrypt { /** * 消息摘要算法 , 单向加密 * @ param key { @ link String } * @ param string { @ link String } * @ param scale { @ link Integer } * @ return { @ link String } * @ throws NoSuchAlgorithmException 异常 */ private static String messageDigest ( String key , String string , int scale ) throws NoSuchAlgorithmException { } }
MessageDigest md = MessageDigest . getInstance ( key ) ; md . update ( string . getBytes ( ) ) ; BigInteger bigInteger = new BigInteger ( md . digest ( ) ) ; return bigInteger . toString ( scale ) ;
public class Configuration { /** * Returns the value associated with the given key as a byte array . * @ param key * The key pointing to the associated value . * @ param defaultValue * The default value which is returned in case there is no value associated with the given key . * @ return the ( default ) value associated with the given key . */ @ SuppressWarnings ( "EqualsBetweenInconvertibleTypes" ) public byte [ ] getBytes ( String key , byte [ ] defaultValue ) { } }
Object o = getRawValue ( key ) ; if ( o == null ) { return defaultValue ; } else if ( o . getClass ( ) . equals ( byte [ ] . class ) ) { return ( byte [ ] ) o ; } else { LOG . warn ( "Configuration cannot evaluate value {} as a byte[] value" , o ) ; return defaultValue ; }
public class Ifc2x3tc1PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EClass getIfcRelAssignsToActor ( ) { } }
if ( ifcRelAssignsToActorEClass == null ) { ifcRelAssignsToActorEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc2x3tc1Package . eNS_URI ) . getEClassifiers ( ) . get ( 440 ) ; } return ifcRelAssignsToActorEClass ;
public class RoadPolyline { /** * Move the start point of a road segment . * < p > This function forces the start point of the given * segment to correspond to the specified connection point * even if the original start point was not near the connection * point . * @ param desiredConnection the connection . */ void setStartPoint ( StandardRoadConnection desiredConnection ) { } }
final StandardRoadConnection oldPoint = getBeginPoint ( StandardRoadConnection . class ) ; if ( oldPoint != null ) { oldPoint . removeConnectedSegment ( this , true ) ; } this . firstConnection = desiredConnection ; if ( desiredConnection != null ) { final Point2d pts = desiredConnection . getPoint ( ) ; if ( pts != null ) { setPointAt ( 0 , pts , true ) ; } desiredConnection . addConnectedSegment ( this , true ) ; }
public class IotHubResourcesInner { /** * Get all the IoT hubs in a resource group . * Get all the IoT hubs in a resource group . * @ param resourceGroupName The name of the resource group that contains the IoT hub . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the PagedList & lt ; IotHubDescriptionInner & gt ; object */ public Observable < Page < IotHubDescriptionInner > > listByResourceGroupAsync ( final String resourceGroupName ) { } }
return listByResourceGroupWithServiceResponseAsync ( resourceGroupName ) . map ( new Func1 < ServiceResponse < Page < IotHubDescriptionInner > > , Page < IotHubDescriptionInner > > ( ) { @ Override public Page < IotHubDescriptionInner > call ( ServiceResponse < Page < IotHubDescriptionInner > > response ) { return response . body ( ) ; } } ) ;
public class UTF8Reader { /** * Throws an exception for invalid surrogate bits . */ private void invalidSurrogate ( int uuuuu ) throws UTFDataFormatException { } }
String msg = JspCoreException . getMsg ( "jsp.error.xml.invalidHighSurrogate" , new Object [ ] { Integer . toHexString ( uuuuu ) } ) ; throw new UTFDataFormatException ( msg ) ;
public class Matrix4d { /** * Set this matrix to a rotation transformation using the given { @ link AxisAngle4f } . * When used with a right - handed coordinate system , the produced rotation will rotate a vector * counter - clockwise around the rotation axis , when viewing along the negative axis direction towards the origin . * When used with a left - handed coordinate system , the rotation is clockwise . * The resulting matrix can be multiplied against another transformation * matrix to obtain an additional rotation . * In order to apply the rotation transformation to an existing transformation , * use { @ link # rotate ( AxisAngle4f ) rotate ( ) } instead . * Reference : < a href = " http : / / en . wikipedia . org / wiki / Rotation _ matrix # Axis _ and _ angle " > http : / / en . wikipedia . org < / a > * @ see # rotate ( AxisAngle4f ) * @ param angleAxis * the { @ link AxisAngle4f } ( needs to be { @ link AxisAngle4f # normalize ( ) normalized } ) * @ return this */ public Matrix4d rotation ( AxisAngle4f angleAxis ) { } }
return rotation ( angleAxis . angle , angleAxis . x , angleAxis . y , angleAxis . z ) ;
public class FileTextArea { /** * Moves the selection to the given offset . */ public void select ( int pos ) { } }
if ( pos >= 0 ) { try { int line = getLineOfOffset ( pos ) ; Rectangle rect = modelToView ( pos ) ; if ( rect == null ) { select ( pos , pos ) ; } else { try { Rectangle nrect = modelToView ( getLineStartOffset ( line + 1 ) ) ; if ( nrect != null ) { rect = nrect ; } } catch ( Exception exc ) { } JViewport vp = ( JViewport ) getParent ( ) ; Rectangle viewRect = vp . getViewRect ( ) ; if ( viewRect . y + viewRect . height > rect . y ) { // need to scroll up select ( pos , pos ) ; } else { // need to scroll down rect . y += ( viewRect . height - rect . height ) / 2 ; scrollRectToVisible ( rect ) ; select ( pos , pos ) ; } } } catch ( BadLocationException exc ) { select ( pos , pos ) ; // exc . printStackTrace ( ) ; } }
public class UtilConversion { /** * Invert binary array ( apply a negation to each value ) . * @ param binary The binary array ( must not be < code > null < / code > ) . * @ return The inverted binary array representation . * @ throws LionEngineException If invalid arguments . */ public static boolean [ ] invert ( boolean [ ] binary ) { } }
Check . notNull ( binary ) ; final boolean [ ] inverted = new boolean [ binary . length ] ; for ( int i = 0 ; i < inverted . length ; i ++ ) { inverted [ i ] = ! binary [ i ] ; } return inverted ;
public class BpmnParse { /** * Parses the properties of an element ( if any ) that can contain properties * ( processes , activities , etc . ) * Returns true if property subelemens are found . * @ param element * The element that can contain properties . * @ param activity * The activity where the property declaration is done . */ public void parseProperties ( Element element , ActivityImpl activity ) { } }
List < Element > propertyElements = element . elements ( "property" ) ; for ( Element propertyElement : propertyElements ) { parseProperty ( propertyElement , activity ) ; }
public class Types { /** * Returns the generic form of { @ code supertype } . For example , if this is { @ code * ArrayList < String > } , this returns { @ code Iterable < String > } given the input { @ code * Iterable . class } . * @ param supertype a superclass of , or interface implemented by , this . */ static Type getSupertype ( Type context , Class < ? > contextRawType , Class < ? > supertype ) { } }
if ( ! supertype . isAssignableFrom ( contextRawType ) ) { throw new IllegalArgumentException ( ) ; } return resolve ( context , contextRawType , getGenericSupertype ( context , contextRawType , supertype ) ) ;
public class TimePickerDialog { /** * Set the time that will be shown when the picker opens for the first time * Overrides the value given in newInstance ( ) * @ deprecated in favor of { @ link # setInitialSelection ( int , int , int ) } * @ param hourOfDay the hour of the day * @ param minute the minute of the hour * @ param second the second of the minute */ @ Deprecated public void setStartTime ( int hourOfDay , int minute , int second ) { } }
mInitialTime = roundToNearest ( new Timepoint ( hourOfDay , minute , second ) ) ; mInKbMode = false ;
public class CommerceRegionLocalServiceBaseImpl { /** * Updates the commerce region in the database or adds it if it does not yet exist . Also notifies the appropriate model listeners . * @ param commerceRegion the commerce region * @ return the commerce region that was updated */ @ Indexable ( type = IndexableType . REINDEX ) @ Override public CommerceRegion updateCommerceRegion ( CommerceRegion commerceRegion ) { } }
return commerceRegionPersistence . update ( commerceRegion ) ;
public class FilesInner { /** * Request information for reading and writing file content . * This method is used for requesting information for reading and writing the file content . * @ param groupName Name of the resource group * @ param serviceName Name of the service * @ param projectName Name of the project * @ param fileName Name of the File * @ param serviceCallback the async ServiceCallback to handle successful and failed responses . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the { @ link ServiceFuture } object */ public ServiceFuture < FileStorageInfoInner > readWriteAsync ( String groupName , String serviceName , String projectName , String fileName , final ServiceCallback < FileStorageInfoInner > serviceCallback ) { } }
return ServiceFuture . fromResponse ( readWriteWithServiceResponseAsync ( groupName , serviceName , projectName , fileName ) , serviceCallback ) ;
public class UBL21DocumentTypes { /** * Get the XSD Schema object for the UBL 2.1 document type of the passed * namespace . * @ param sNamespace * The namespace URI of any UBL 2.1 document type . May be * < code > null < / code > . * @ return < code > null < / code > if no such UBL 2.1 document type exists . */ @ Nullable public static Schema getSchemaOfNamespace ( @ Nullable final String sNamespace ) { } }
final EUBL21DocumentType eDocType = getDocumentTypeOfNamespace ( sNamespace ) ; return eDocType == null ? null : eDocType . getSchema ( ) ;
public class SvgPathDecoder { /** * Values in SVG may not go over 100000. */ private static double getX ( Coordinate c ) { } }
double value = c . getX ( ) ; if ( value > 1000000 ) { value = 1000000 ; } else if ( value < - 1000000 ) { value = - 1000000 ; } return value ;
public class JK { /** * Validate null . * @ param name the name * @ param object the object */ public static void validateNull ( String name , Object object ) { } }
if ( object == null ) { throw new IllegalStateException ( name . concat ( " cannot be null" ) ) ; }
public class Plane4f { /** * Set this pane with the given factors . * @ param a1 is the first factor of the plane equation . * @ param b1 is the first factor of the plane equation . * @ param c1 is the first factor of the plane equation . * @ param d1 is the first factor of the plane equation . */ public void set ( double a1 , double b1 , double c1 , double d1 ) { } }
this . a = a1 ; this . b = b1 ; this . c = c1 ; this . d = d1 ; clearBufferedValues ( ) ;
public class SimpleDocTreeVisitor { /** * { @ inheritDoc } This implementation calls { @ code defaultAction } . * @ param node { @ inheritDoc } * @ param p { @ inheritDoc } * @ return the result of { @ code defaultAction } */ @ Override public R visitDeprecated ( DeprecatedTree node , P p ) { } }
return defaultAction ( node , p ) ;
public class S2SDateTimeServiceImpl { /** * This method returns a { @ link Calendar } whose date matches the date passed as { @ link String } * @ param dateStr string in " MM / dd / yyyy " format for which the Calendar value has to be returned . * @ return Calendar calendar value corresponding to the date string . */ @ Override public Calendar convertDateStringToCalendar ( String dateStr ) { } }
Calendar calendar = null ; if ( dateStr != null ) { calendar = Calendar . getInstance ( ) ; calendar . set ( Integer . parseInt ( dateStr . substring ( 6 , 10 ) ) , Integer . parseInt ( dateStr . substring ( 0 , 2 ) ) - 1 , Integer . parseInt ( dateStr . substring ( 3 , 5 ) ) ) ; } return calendar ;
public class WstxDOMWrappingReader { /** * Defined / Overridden error reporting */ @ Override protected void throwStreamException ( String msg , Location loc ) throws XMLStreamException { } }
if ( loc == null ) { throw new WstxParsingException ( msg ) ; } throw new WstxParsingException ( msg , loc ) ;
public class PersonDocumentRepositoryMongoImpl { /** * { @ inheritDoc } */ @ Override public PersonDocument findByFileAndString ( final String filename , final String string ) { } }
final Query searchQuery = new Query ( Criteria . where ( "string" ) . is ( string ) . and ( "filename" ) . is ( filename ) ) ; final PersonDocument personDocument = mongoTemplate . findOne ( searchQuery , PersonDocumentMongo . class ) ; if ( personDocument == null ) { return null ; } final Person person = ( Person ) toObjConverter . createGedObject ( null , personDocument ) ; personDocument . setGedObject ( person ) ; return personDocument ;
public class ParametersAction { /** * Creates a new { @ link ParametersAction } that contains all the parameters in this action * with the overrides / new values given as parameters . * @ return New { @ link ParametersAction } . The result may contain null { @ link ParameterValue } s */ @ Nonnull public ParametersAction createUpdated ( Collection < ? extends ParameterValue > overrides ) { } }
if ( overrides == null ) { ParametersAction parametersAction = new ParametersAction ( parameters ) ; parametersAction . safeParameters = this . safeParameters ; return parametersAction ; } List < ParameterValue > combinedParameters = Lists . < ParameterValue > newArrayList ( overrides ) ; Set < String > names = newHashSet ( ) ; for ( ParameterValue v : overrides ) { if ( v == null ) continue ; names . add ( v . getName ( ) ) ; } for ( ParameterValue v : parameters ) { if ( v == null ) continue ; if ( ! names . contains ( v . getName ( ) ) ) { combinedParameters . add ( v ) ; } } return new ParametersAction ( combinedParameters , this . safeParameters ) ;
public class ZonalOffset { /** * / * [ deutsch ] * < p > Konstruiert eine neue Verschiebung auf Basis einer geographischen * L & auml ; ngenangabe . < / p > * < p > Hinweis : Fraktionale Verschiebungen werden im Zeitzonenkontext * nicht verwendet , sondern nur dann , wenn ein { @ code PlainTimestamp } * zu einem { @ code Moment } oder zur & uuml ; ck konvertiert wird . < / p > * @ param longitude geographical longitude in degrees defined in * range { @ code - 180.0 < = longitude < = 180.0} * @ return zonal offset in decimal precision * @ throws IllegalArgumentException if range check fails */ public static ZonalOffset atLongitude ( BigDecimal longitude ) { } }
if ( ( longitude . compareTo ( DECIMAL_POS_180 ) > 0 ) || ( longitude . compareTo ( DECIMAL_NEG_180 ) < 0 ) ) { throw new IllegalArgumentException ( "Out of range: " + longitude ) ; } BigDecimal offset = longitude . multiply ( DECIMAL_240 ) ; BigDecimal integral = offset . setScale ( 0 , RoundingMode . DOWN ) ; BigDecimal delta = offset . subtract ( integral ) ; BigDecimal decimal = delta . setScale ( 9 , RoundingMode . HALF_UP ) . multiply ( MRD ) ; int total = integral . intValueExact ( ) ; int fraction = decimal . intValueExact ( ) ; if ( fraction == 0 ) { return ZonalOffset . ofTotalSeconds ( total ) ; } else if ( fraction == 1_000_000_000 ) { return ZonalOffset . ofTotalSeconds ( total + 1 ) ; } else if ( fraction == - 1_000_000_000 ) { return ZonalOffset . ofTotalSeconds ( total - 1 ) ; } else { return new ZonalOffset ( total , fraction ) ; }
public class MetadataStore { /** * Function to add a new Store to the Metadata store . This involves * 1 . Create a new entry in the ConfigurationStorageEngine for STORES . * 2 . Update the metadata cache . * 3 . Re - create the ' stores . xml ' key * @ param storeDef defines the new store to be created */ public void addStoreDefinition ( StoreDefinition storeDef ) { } }
// acquire write lock writeLock . lock ( ) ; try { // Check if store already exists if ( this . storeNames . contains ( storeDef . getName ( ) ) ) { throw new VoldemortException ( "Store already exists !" ) ; } // Check for backwards compatibility StoreDefinitionUtils . validateSchemaAsNeeded ( storeDef ) ; // Otherwise add to the STORES directory StoreDefinitionsMapper mapper = new StoreDefinitionsMapper ( ) ; String storeDefStr = mapper . writeStore ( storeDef ) ; Versioned < String > versionedValueStr = new Versioned < String > ( storeDefStr ) ; this . storeDefinitionsStorageEngine . put ( storeDef . getName ( ) , versionedValueStr , null ) ; // Update the metadata cache this . metadataCache . put ( storeDef . getName ( ) , new Versioned < Object > ( storeDefStr ) ) ; // Re - initialize the store definitions . This is primarily required // to re - create the value for key : ' stores . xml ' . This is necessary // for backwards compatibility . initStoreDefinitions ( null ) ; updateRoutingStrategies ( getCluster ( ) , getStoreDefList ( ) ) ; } finally { writeLock . unlock ( ) ; }
public class ViewUtil { /** * Apply any View style attributes to a view . * @ param v The view is applied . * @ param attrs * @ param defStyleAttr * @ param defStyleRes */ public static void applyStyle ( View v , AttributeSet attrs , int defStyleAttr , int defStyleRes ) { } }
TypedArray a = v . getContext ( ) . obtainStyledAttributes ( attrs , R . styleable . View , defStyleAttr , defStyleRes ) ; int leftPadding = - 1 ; int topPadding = - 1 ; int rightPadding = - 1 ; int bottomPadding = - 1 ; int startPadding = Integer . MIN_VALUE ; int endPadding = Integer . MIN_VALUE ; int padding = - 1 ; boolean startPaddingDefined = false ; boolean endPaddingDefined = false ; boolean leftPaddingDefined = false ; boolean rightPaddingDefined = false ; for ( int i = 0 , count = a . getIndexCount ( ) ; i < count ; i ++ ) { int attr = a . getIndex ( i ) ; if ( attr == R . styleable . View_android_background ) { Drawable bg = a . getDrawable ( attr ) ; ViewUtil . setBackground ( v , bg ) ; } else if ( attr == R . styleable . View_android_backgroundTint ) { if ( Build . VERSION . SDK_INT >= Build . VERSION_CODES . LOLLIPOP ) v . setBackgroundTintList ( a . getColorStateList ( attr ) ) ; } else if ( attr == R . styleable . View_android_backgroundTintMode ) { if ( Build . VERSION . SDK_INT >= Build . VERSION_CODES . LOLLIPOP ) { int value = a . getInt ( attr , 3 ) ; switch ( value ) { case 3 : v . setBackgroundTintMode ( PorterDuff . Mode . SRC_OVER ) ; break ; case 5 : v . setBackgroundTintMode ( PorterDuff . Mode . SRC_IN ) ; break ; case 9 : v . setBackgroundTintMode ( PorterDuff . Mode . SRC_ATOP ) ; break ; case 14 : v . setBackgroundTintMode ( PorterDuff . Mode . MULTIPLY ) ; break ; case 15 : v . setBackgroundTintMode ( PorterDuff . Mode . SCREEN ) ; break ; case 16 : v . setBackgroundTintMode ( PorterDuff . Mode . ADD ) ; break ; } } } else if ( attr == R . styleable . View_android_elevation ) { if ( Build . VERSION . SDK_INT >= Build . VERSION_CODES . LOLLIPOP ) v . setElevation ( a . getDimensionPixelOffset ( attr , 0 ) ) ; } else if ( attr == R . styleable . View_android_padding ) { padding = a . getDimensionPixelSize ( attr , - 1 ) ; leftPaddingDefined = true ; rightPaddingDefined = true ; } else if ( attr == R . styleable . View_android_paddingLeft ) { leftPadding = a . getDimensionPixelSize ( attr , - 1 ) ; leftPaddingDefined = true ; } else if ( attr == R . styleable . View_android_paddingTop ) topPadding = a . getDimensionPixelSize ( attr , - 1 ) ; else if ( attr == R . styleable . View_android_paddingRight ) { rightPadding = a . getDimensionPixelSize ( attr , - 1 ) ; rightPaddingDefined = true ; } else if ( attr == R . styleable . View_android_paddingBottom ) bottomPadding = a . getDimensionPixelSize ( attr , - 1 ) ; else if ( attr == R . styleable . View_android_paddingStart ) { if ( Build . VERSION . SDK_INT >= Build . VERSION_CODES . JELLY_BEAN_MR1 ) { startPadding = a . getDimensionPixelSize ( attr , Integer . MIN_VALUE ) ; startPaddingDefined = ( startPadding != Integer . MIN_VALUE ) ; } } else if ( attr == R . styleable . View_android_paddingEnd ) { if ( Build . VERSION . SDK_INT >= Build . VERSION_CODES . JELLY_BEAN_MR1 ) { endPadding = a . getDimensionPixelSize ( attr , Integer . MIN_VALUE ) ; endPaddingDefined = ( endPadding != Integer . MIN_VALUE ) ; } } else if ( attr == R . styleable . View_android_fadeScrollbars ) v . setScrollbarFadingEnabled ( a . getBoolean ( attr , true ) ) ; else if ( attr == R . styleable . View_android_fadingEdgeLength ) v . setFadingEdgeLength ( a . getDimensionPixelOffset ( attr , 0 ) ) ; else if ( attr == R . styleable . View_android_minHeight ) v . setMinimumHeight ( a . getDimensionPixelSize ( attr , 0 ) ) ; else if ( attr == R . styleable . View_android_minWidth ) v . setMinimumWidth ( a . getDimensionPixelSize ( attr , 0 ) ) ; else if ( attr == R . styleable . View_android_requiresFadingEdge ) v . setVerticalFadingEdgeEnabled ( a . getBoolean ( attr , true ) ) ; else if ( attr == R . styleable . View_android_scrollbarDefaultDelayBeforeFade ) { if ( Build . VERSION . SDK_INT >= Build . VERSION_CODES . JELLY_BEAN ) v . setScrollBarDefaultDelayBeforeFade ( a . getInteger ( attr , 0 ) ) ; } else if ( attr == R . styleable . View_android_scrollbarFadeDuration ) { if ( Build . VERSION . SDK_INT >= Build . VERSION_CODES . JELLY_BEAN ) v . setScrollBarFadeDuration ( a . getInteger ( attr , 0 ) ) ; } else if ( attr == R . styleable . View_android_scrollbarSize ) { if ( Build . VERSION . SDK_INT >= Build . VERSION_CODES . JELLY_BEAN ) v . setScrollBarSize ( a . getDimensionPixelSize ( attr , 0 ) ) ; } else if ( attr == R . styleable . View_android_scrollbarStyle ) { int value = a . getInteger ( attr , 0 ) ; switch ( value ) { case 0x0 : v . setScrollBarStyle ( View . SCROLLBARS_INSIDE_OVERLAY ) ; break ; case 0x01000000 : v . setScrollBarStyle ( View . SCROLLBARS_INSIDE_INSET ) ; break ; case 0x02000000 : v . setScrollBarStyle ( View . SCROLLBARS_OUTSIDE_OVERLAY ) ; break ; case 0x03000000 : v . setScrollBarStyle ( View . SCROLLBARS_OUTSIDE_INSET ) ; break ; } } else if ( attr == R . styleable . View_android_soundEffectsEnabled ) v . setSoundEffectsEnabled ( a . getBoolean ( attr , true ) ) ; else if ( attr == R . styleable . View_android_textAlignment ) { if ( Build . VERSION . SDK_INT >= Build . VERSION_CODES . JELLY_BEAN_MR1 ) { int value = a . getInteger ( attr , 0 ) ; switch ( value ) { case 0 : v . setTextAlignment ( View . TEXT_ALIGNMENT_INHERIT ) ; break ; case 1 : v . setTextAlignment ( View . TEXT_ALIGNMENT_GRAVITY ) ; break ; case 2 : v . setTextAlignment ( View . TEXT_ALIGNMENT_TEXT_START ) ; break ; case 3 : v . setTextAlignment ( View . TEXT_ALIGNMENT_TEXT_END ) ; break ; case 4 : v . setTextAlignment ( View . TEXT_ALIGNMENT_CENTER ) ; break ; case 5 : v . setTextAlignment ( View . TEXT_ALIGNMENT_VIEW_START ) ; break ; case 6 : v . setTextAlignment ( View . TEXT_ALIGNMENT_VIEW_END ) ; break ; } } } else if ( attr == R . styleable . View_android_textDirection ) { if ( Build . VERSION . SDK_INT >= Build . VERSION_CODES . JELLY_BEAN_MR1 ) { int value = a . getInteger ( attr , 0 ) ; switch ( value ) { case 0 : v . setTextDirection ( View . TEXT_DIRECTION_INHERIT ) ; break ; case 1 : v . setTextDirection ( View . TEXT_DIRECTION_FIRST_STRONG ) ; break ; case 2 : v . setTextDirection ( View . TEXT_DIRECTION_ANY_RTL ) ; break ; case 3 : v . setTextDirection ( View . TEXT_DIRECTION_LTR ) ; break ; case 4 : v . setTextDirection ( View . TEXT_DIRECTION_RTL ) ; break ; case 5 : v . setTextDirection ( View . TEXT_DIRECTION_LOCALE ) ; break ; } } } else if ( attr == R . styleable . View_android_visibility ) { int value = a . getInteger ( attr , 0 ) ; switch ( value ) { case 0 : v . setVisibility ( View . VISIBLE ) ; break ; case 1 : v . setVisibility ( View . INVISIBLE ) ; break ; case 2 : v . setVisibility ( View . GONE ) ; break ; } } else if ( attr == R . styleable . View_android_layoutDirection ) { if ( Build . VERSION . SDK_INT >= Build . VERSION_CODES . JELLY_BEAN_MR1 ) { int value = a . getInteger ( attr , 0 ) ; switch ( value ) { case 0 : v . setLayoutDirection ( View . LAYOUT_DIRECTION_LTR ) ; break ; case 1 : v . setLayoutDirection ( View . LAYOUT_DIRECTION_RTL ) ; break ; case 2 : v . setLayoutDirection ( View . LAYOUT_DIRECTION_INHERIT ) ; break ; case 3 : v . setLayoutDirection ( View . LAYOUT_DIRECTION_LOCALE ) ; break ; } } } else if ( attr == R . styleable . View_android_src ) { if ( v instanceof ImageView ) { int resId = a . getResourceId ( attr , 0 ) ; ( ( ImageView ) v ) . setImageResource ( resId ) ; } } } if ( padding >= 0 ) v . setPadding ( padding , padding , padding , padding ) ; else if ( Build . VERSION . SDK_INT < Build . VERSION_CODES . JELLY_BEAN_MR1 ) { if ( startPaddingDefined ) leftPadding = startPadding ; if ( endPaddingDefined ) rightPadding = endPadding ; v . setPadding ( leftPadding >= 0 ? leftPadding : v . getPaddingLeft ( ) , topPadding >= 0 ? topPadding : v . getPaddingTop ( ) , rightPadding >= 0 ? rightPadding : v . getPaddingRight ( ) , bottomPadding >= 0 ? bottomPadding : v . getPaddingBottom ( ) ) ; } else { if ( leftPaddingDefined || rightPaddingDefined ) v . setPadding ( leftPaddingDefined ? leftPadding : v . getPaddingLeft ( ) , topPadding >= 0 ? topPadding : v . getPaddingTop ( ) , rightPaddingDefined ? rightPadding : v . getPaddingRight ( ) , bottomPadding >= 0 ? bottomPadding : v . getPaddingBottom ( ) ) ; if ( startPaddingDefined || endPaddingDefined ) v . setPaddingRelative ( startPaddingDefined ? startPadding : v . getPaddingStart ( ) , topPadding >= 0 ? topPadding : v . getPaddingTop ( ) , endPaddingDefined ? endPadding : v . getPaddingEnd ( ) , bottomPadding >= 0 ? bottomPadding : v . getPaddingBottom ( ) ) ; } a . recycle ( ) ; if ( v instanceof TextView ) applyStyle ( ( TextView ) v , attrs , defStyleAttr , defStyleRes ) ;
public class LexiconUtility { /** * 将字符串词性转为Enum词性 * @ param name 词性名称 * @ param customNatureCollector 一个收集集合 * @ return 转换结果 */ public static Nature convertStringToNature ( String name , LinkedHashSet < Nature > customNatureCollector ) { } }
Nature nature = Nature . fromString ( name ) ; if ( nature == null ) { nature = Nature . create ( name ) ; if ( customNatureCollector != null ) customNatureCollector . add ( nature ) ; } return nature ;
public class HawkbitCommonUtil { /** * Display Target Tag action message . * @ param tagName * as tag name * @ param result * as TargetTagAssigmentResult * @ param i18n * I18N * @ return message */ public static String createAssignmentMessage ( final String tagName , final AssignmentResult < ? extends NamedEntity > result , final VaadinMessageSource i18n ) { } }
final StringBuilder formMsg = new StringBuilder ( ) ; final int assignedCount = result . getAssigned ( ) ; final int alreadyAssignedCount = result . getAlreadyAssigned ( ) ; final int unassignedCount = result . getUnassigned ( ) ; if ( assignedCount == 1 ) { formMsg . append ( i18n . getMessage ( "message.target.assigned.one" , result . getAssignedEntity ( ) . get ( 0 ) . getName ( ) , tagName ) ) . append ( "<br>" ) ; } else if ( assignedCount > 1 ) { formMsg . append ( i18n . getMessage ( "message.target.assigned.many" , assignedCount , tagName ) ) . append ( "<br>" ) ; if ( alreadyAssignedCount > 0 ) { final String alreadyAssigned = i18n . getMessage ( "message.target.alreadyAssigned" , alreadyAssignedCount ) ; formMsg . append ( alreadyAssigned ) . append ( "<br>" ) ; } } if ( unassignedCount == 1 ) { formMsg . append ( i18n . getMessage ( "message.target.unassigned.one" , result . getUnassignedEntity ( ) . get ( 0 ) . getName ( ) , tagName ) ) . append ( "<br>" ) ; } else if ( unassignedCount > 1 ) { formMsg . append ( i18n . getMessage ( "message.target.unassigned.many" , unassignedCount , tagName ) ) . append ( "<br>" ) ; } return formMsg . toString ( ) ;
public class UserPasswordChange { /** * Add the toolbars that belong with this screen . * @ return The new toolbar . */ public ToolScreen addToolbars ( ) { } }
ToolScreen screen = new ToolScreen ( null , this , null , ScreenConstants . DONT_DISPLAY_FIELD_DESC , null ) ; new SCannedBox ( screen . getNextLocation ( ScreenConstants . NEXT_LOGICAL , ScreenConstants . SET_ANCHOR ) , screen , null , ScreenConstants . DEFAULT_DISPLAY , MenuConstants . SUBMIT ) ; new SCannedBox ( screen . getNextLocation ( ScreenConstants . NEXT_LOGICAL , ScreenConstants . SET_ANCHOR ) , screen , null , ScreenConstants . DEFAULT_DISPLAY , MenuConstants . RESET ) ; String strDesc = "Create account" ; new SCannedBox ( screen . getNextLocation ( ScreenConstants . NEXT_LOGICAL , ScreenConstants . SET_ANCHOR ) , screen , null , ScreenConstants . DEFAULT_DISPLAY , null , strDesc , MenuConstants . FORM , MenuConstants . FORM , MenuConstants . FORM + "Tip" ) ; return screen ;
public class AWSCodePipelineClient { /** * Represents the failure of a third party job as returned to the pipeline by a job worker . Only used for partner * actions . * @ param putThirdPartyJobFailureResultRequest * Represents the input of a PutThirdPartyJobFailureResult action . * @ return Result of the PutThirdPartyJobFailureResult operation returned by the service . * @ throws ValidationException * The validation was specified in an invalid format . * @ throws JobNotFoundException * The specified job was specified in an invalid format or cannot be found . * @ throws InvalidJobStateException * The specified job state was specified in an invalid format . * @ throws InvalidClientTokenException * The client token was specified in an invalid format * @ sample AWSCodePipeline . PutThirdPartyJobFailureResult * @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / codepipeline - 2015-07-09 / PutThirdPartyJobFailureResult " * target = " _ top " > AWS API Documentation < / a > */ @ Override public PutThirdPartyJobFailureResultResult putThirdPartyJobFailureResult ( PutThirdPartyJobFailureResultRequest request ) { } }
request = beforeClientExecution ( request ) ; return executePutThirdPartyJobFailureResult ( request ) ;
public class ArchiveGroupSettingsMarshaller { /** * Marshall the given parameter object . */ public void marshall ( ArchiveGroupSettings archiveGroupSettings , ProtocolMarshaller protocolMarshaller ) { } }
if ( archiveGroupSettings == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( archiveGroupSettings . getDestination ( ) , DESTINATION_BINDING ) ; protocolMarshaller . marshall ( archiveGroupSettings . getRolloverInterval ( ) , ROLLOVERINTERVAL_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class ExpectedValueCheckingTransaction { /** * Check that all expected values saved from earlier * { @ link KeyColumnValueStore # acquireLock ( StaticBuffer , StaticBuffer , StaticBuffer , StoreTransaction ) } * calls using this transaction . * @ throws com . thinkaurelius . titan . diskstorage . BackendException */ void checkAllExpectedValues ( ) throws BackendException { } }
for ( final ExpectedValueCheckingStore store : expectedValuesByStore . keySet ( ) ) { final Map < KeyColumn , StaticBuffer > m = expectedValuesByStore . get ( store ) ; for ( final KeyColumn kc : m . keySet ( ) ) { checkSingleExpectedValue ( kc , m . get ( kc ) , store ) ; } }
public class PhoneBook { /** * < p > insert . < / p > * @ param firstName a { @ link java . lang . String } object . * @ param lastName a { @ link java . lang . String } object . * @ param number a { @ link java . lang . String } object . */ public void insert ( String firstName , String lastName , String number ) { } }
entries . add ( new PhoneBookEntry ( this , firstName , lastName , number ) ) ;
public class Ray3 { /** * Sets the ray parameters to the values contained in the supplied vectors . * @ return a reference to this ray , for chaining . */ public Ray3 set ( Vector3 origin , Vector3 direction ) { } }
this . origin . set ( origin ) ; this . direction . set ( direction ) ; return this ;
public class systembackup { /** * Use this API to restore systembackup . */ public static base_response restore ( nitro_service client , systembackup resource ) throws Exception { } }
systembackup restoreresource = new systembackup ( ) ; restoreresource . filename = resource . filename ; return restoreresource . perform_operation ( client , "restore" ) ;
public class PerlinNoise { /** * 2 - D Perlin noise function . * @ param x X Value . * @ param y Y Value . * @ return Returns function ' s value at point xy . */ public double Function2D ( double x , double y ) { } }
double frequency = initFrequency ; double amplitude = initAmplitude ; double sum = 0 ; // octaves for ( int i = 0 ; i < octaves ; i ++ ) { sum += SmoothedNoise ( x * frequency , y * frequency ) * amplitude ; frequency *= 2 ; amplitude *= persistence ; } return sum ;
public class SaltedDatabaseServerLoginModule { /** * Factory method : instantiate the PBKDF2 engine parameters . Override or * change the class via attribute . * @ return Engine parameter object , initialized . On error / exception , this * method registers the exception via { * { @ link # setValidateError ( Throwable ) } and returns * < code > null < / code > . */ protected PBKDF2Parameters getEngineParameters ( ) { } }
PBKDF2Parameters p = newInstance ( parameterClassName , PBKDF2Parameters . class ) ; if ( p != null ) { p . setHashAlgorithm ( hashAlgorithm ) ; p . setHashCharset ( hashCharset ) ; } return p ;
public class TransactionManager { /** * add a list of actions to the end of queue */ void addToCommittedQueue ( Session session , Object [ ] list ) { } }
synchronized ( committedTransactionTimestamps ) { // add the txList according to commit timestamp committedTransactions . addLast ( list ) ; // get session commit timestamp committedTransactionTimestamps . addLast ( session . actionTimestamp ) ; /* debug 190 if ( committedTransactions . size ( ) > 64 ) { System . out . println ( " * * * * * excessive transaction queue " ) ; / / debug 190 */ }
public class RSAUtils { /** * 公钥加密 * @ param data * @ param publicKey * @ return * @ throws Exception */ public static String encryptByPublicKey ( String data , String publicKey ) throws Exception { } }
return encryptByPublicKey ( data , publicKey , "RSA/ECB/PKCS1Padding" ) ;
public class GroovyPagesUriSupport { /** * Obtains a view URI of the given controller name and view name * @ param controllerName The name of the controller * @ param viewName The name of the view * @ return The view URI */ public String getViewURI ( String controllerName , String viewName ) { } }
FastStringWriter buf = new FastStringWriter ( ) ; return getViewURIInternal ( controllerName , viewName , buf , true ) ;
public class WStyledTextRenderer { /** * Writes out paragraph delimited content . * @ param text the String content to output . * @ param xml the XmlStringBuilder to paint to . */ private static void writeParagraphs ( final String text , final XmlStringBuilder xml ) { } }
if ( ! Util . empty ( text ) ) { int start = 0 ; int end = text . length ( ) - 1 ; // Set the start index to the first non - linebreak , so we don ' t emit leading ui : nl tags for ( ; start < end ; start ++ ) { char c = text . charAt ( start ) ; if ( c != '\n' && c != '\r' ) { break ; } } // Set the end index to the last non - linebreak , so we don ' t emit trailing ui : nl tags for ( ; start < end ; end -- ) { char c = text . charAt ( end ) ; if ( c != '\n' && c != '\r' ) { break ; } } char lastChar = 0 ; for ( int i = start ; i <= end ; i ++ ) { char c = text . charAt ( i ) ; if ( c == '\n' || c == '\r' ) { if ( lastChar != 0 ) { xml . write ( "<ui:nl/>" ) ; } lastChar = 0 ; } else { xml . write ( c ) ; lastChar = c ; } } }
public class AmazonMTurkClient { /** * The < code > GetAssignment < / code > operation retrieves the details of the specified Assignment . * @ param getAssignmentRequest * @ return Result of the GetAssignment operation returned by the service . * @ throws ServiceException * Amazon Mechanical Turk is temporarily unable to process your request . Try your call again . * @ throws RequestErrorException * Your request is invalid . * @ sample AmazonMTurk . GetAssignment * @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / mturk - requester - 2017-01-17 / GetAssignment " target = " _ top " > AWS * API Documentation < / a > */ @ Override public GetAssignmentResult getAssignment ( GetAssignmentRequest request ) { } }
request = beforeClientExecution ( request ) ; return executeGetAssignment ( request ) ;
public class CPDefinitionOptionRelUtil { /** * Returns the last cp definition option rel in the ordered set where uuid = & # 63 ; . * @ param uuid the uuid * @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > ) * @ return the last matching cp definition option rel , or < code > null < / code > if a matching cp definition option rel could not be found */ public static CPDefinitionOptionRel fetchByUuid_Last ( String uuid , OrderByComparator < CPDefinitionOptionRel > orderByComparator ) { } }
return getPersistence ( ) . fetchByUuid_Last ( uuid , orderByComparator ) ;
public class DialogImpl { /** * ( non - Javadoc ) * @ see org . restcomm . protocols . ss7 . tcap . api . tc . dialog . Dialog # send ( org . mobicents * . protocols . ss7 . tcap . api . tc . dialog . events . TCContinueRequest ) */ public void send ( TCContinueRequest event ) throws TCAPSendException { } }
if ( this . previewMode ) return ; if ( ! this . isStructured ( ) ) { throw new TCAPSendException ( "Unstructured dialogs do not use Continue" ) ; } try { this . dialogLock . lock ( ) ; if ( this . state == TRPseudoState . InitialReceived ) { this . idleTimerActionTaken = true ; restartIdleTimer ( ) ; TCContinueMessageImpl tcbm = ( TCContinueMessageImpl ) TcapFactory . createTCContinueMessage ( ) ; if ( event . getApplicationContextName ( ) != null ) { // set dialog portion DialogPortion dp = TcapFactory . createDialogPortion ( ) ; dp . setUnidirectional ( false ) ; DialogResponseAPDU apdu = TcapFactory . createDialogAPDUResponse ( ) ; apdu . setDoNotSendProtocolVersion ( doNotSendProtocolVersion ( ) ) ; dp . setDialogAPDU ( apdu ) ; apdu . setApplicationContextName ( event . getApplicationContextName ( ) ) ; if ( event . getUserInformation ( ) != null ) { apdu . setUserInformation ( event . getUserInformation ( ) ) ; } // WHERE THE HELL THIS COMES FROM ! ! ! ! // WHEN REJECTED IS USED ! ! ! ! ! Result res = TcapFactory . createResult ( ) ; res . setResultType ( ResultType . Accepted ) ; ResultSourceDiagnostic rsd = TcapFactory . createResultSourceDiagnostic ( ) ; rsd . setDialogServiceUserType ( DialogServiceUserType . Null ) ; apdu . setResultSourceDiagnostic ( rsd ) ; apdu . setResult ( res ) ; tcbm . setDialogPortion ( dp ) ; } tcbm . setOriginatingTransactionId ( Utils . encodeTransactionId ( this . localTransactionId , isSwapTcapIdBytes ) ) ; tcbm . setDestinationTransactionId ( this . remoteTransactionId ) ; if ( this . scheduledComponentList . size ( ) > 0 ) { Component [ ] componentsToSend = new Component [ this . scheduledComponentList . size ( ) ] ; this . prepareComponents ( componentsToSend ) ; tcbm . setComponent ( componentsToSend ) ; } // local address may change , lets check it ; if ( event . getOriginatingAddress ( ) != null && ! event . getOriginatingAddress ( ) . equals ( this . localAddress ) ) { this . localAddress = event . getOriginatingAddress ( ) ; } AsnOutputStream aos = new AsnOutputStream ( ) ; try { tcbm . encode ( aos ) ; if ( this . provider . getStack ( ) . getStatisticsEnabled ( ) ) { this . provider . getStack ( ) . getCounterProviderImpl ( ) . updateTcContinueSentCount ( this ) ; } this . provider . send ( aos . toByteArray ( ) , event . getReturnMessageOnError ( ) , this . remoteAddress , this . localAddress , this . seqControl , this . networkId , this . localSsn , this . remotePc ) ; this . setState ( TRPseudoState . Active ) ; this . scheduledComponentList . clear ( ) ; } catch ( Exception e ) { // FIXME : remove freshly added invokes to free invoke ID ? ? if ( logger . isEnabledFor ( Level . ERROR ) ) { logger . error ( "Failed to send message: " , e ) ; } throw new TCAPSendException ( "Failed to send TC-Continue message: " + e . getMessage ( ) , e ) ; } } else if ( state == TRPseudoState . Active ) { this . idleTimerActionTaken = true ; restartIdleTimer ( ) ; // in this we ignore acn and passed args ( except qos ) TCContinueMessageImpl tcbm = ( TCContinueMessageImpl ) TcapFactory . createTCContinueMessage ( ) ; tcbm . setOriginatingTransactionId ( Utils . encodeTransactionId ( this . localTransactionId , isSwapTcapIdBytes ) ) ; tcbm . setDestinationTransactionId ( this . remoteTransactionId ) ; if ( this . scheduledComponentList . size ( ) > 0 ) { Component [ ] componentsToSend = new Component [ this . scheduledComponentList . size ( ) ] ; this . prepareComponents ( componentsToSend ) ; tcbm . setComponent ( componentsToSend ) ; } AsnOutputStream aos = new AsnOutputStream ( ) ; try { tcbm . encode ( aos ) ; this . provider . getStack ( ) . getCounterProviderImpl ( ) . updateTcContinueSentCount ( this ) ; this . provider . send ( aos . toByteArray ( ) , event . getReturnMessageOnError ( ) , this . remoteAddress , this . localAddress , this . seqControl , this . networkId , this . localSsn , this . remotePc ) ; this . scheduledComponentList . clear ( ) ; } catch ( Exception e ) { // FIXME : remove freshly added invokes to free invoke ID ? ? if ( logger . isEnabledFor ( Level . ERROR ) ) { logger . error ( "Failed to send message: " , e ) ; } throw new TCAPSendException ( "Failed to send TC-Continue message: " + e . getMessage ( ) , e ) ; } } else { throw new TCAPSendException ( "Wrong state: " + this . state ) ; } } finally { this . dialogLock . unlock ( ) ; }
public class VdmLineBreakpointPropertyPage { /** * Sets the enabled state of the condition editing controls . * @ param enabled */ private void setConditionEnabled ( boolean enabled ) { } }
fConditionEditor . setEnabled ( enabled ) ; fSuspendWhenLabel . setEnabled ( enabled ) ; fConditionIsTrue . setEnabled ( enabled ) ; fConditionHasChanged . setEnabled ( enabled ) ;
public class StandaloneAhcWSResponse { /** * Get only one cookie , using the cookie name . */ @ Override public Optional < WSCookie > getCookie ( String name ) { } }
for ( Cookie ahcCookie : ahcResponse . getCookies ( ) ) { // safe - - cookie . getName ( ) will never return null if ( ahcCookie . name ( ) . equals ( name ) ) { return Optional . of ( asCookie ( ahcCookie ) ) ; } } return Optional . empty ( ) ;
public class MapField { /** * Gets the content of this MapField as a read - only List . */ List < Message > getList ( ) { } }
if ( mode == StorageMode . MAP ) { synchronized ( this ) { if ( mode == StorageMode . MAP ) { listData = convertMapToList ( mapData ) ; mode = StorageMode . BOTH ; } } } return Collections . unmodifiableList ( listData ) ;
public class BufferUtils { /** * Convert buffer to an integer . Parses up to the first non - numeric character . If no number is found an IllegalArgumentException is thrown * @ param buffer A buffer containing an integer in flush mode . The position is updated . * @ return an int */ public static int takeInt ( ByteBuffer buffer ) { } }
int val = 0 ; boolean started = false ; boolean minus = false ; int i ; for ( i = buffer . position ( ) ; i < buffer . limit ( ) ; i ++ ) { byte b = buffer . get ( i ) ; if ( b <= SPACE ) { if ( started ) break ; } else if ( b >= '0' && b <= '9' ) { val = val * 10 + ( b - '0' ) ; started = true ; } else if ( b == MINUS && ! started ) { minus = true ; } else break ; } if ( started ) { buffer . position ( i ) ; return minus ? ( - val ) : val ; } throw new NumberFormatException ( toString ( buffer ) ) ;
public class StickyListHeadersListView { /** * This is called in response to the data set or the adapter changing */ private void clearHeader ( ) { } }
if ( mHeader != null ) { removeView ( mHeader ) ; mHeader = null ; mHeaderId = null ; mHeaderPosition = null ; mHeaderOffset = null ; // reset the top clipping length mList . setTopClippingLength ( 0 ) ; updateHeaderVisibilities ( ) ; }
public class DecLD8K { /** * init _ decod _ ld8k - Initialization of variables for the decoder section . */ public void init_decod_ld8k ( ) { } }
/* Initialize static pointer */ exc = 0 + LD8KConstants . PIT_MAX + LD8KConstants . L_INTERPOL ; /* Static vectors to zero */ Util . set_zero ( old_exc_array , LD8KConstants . PIT_MAX + LD8KConstants . L_INTERPOL ) ; Util . set_zero ( mem_syn , LD8KConstants . M ) ; sharp = LD8KConstants . SHARPMIN ; old_t0 = 60 ; gain_code . value = ( float ) 0. ; gain_pitch . value = ( float ) 0. ; lspDec . lsp_decw_reset ( ) ; return ;
public class CollationKey { /** * Merges this CollationKey with another . * The levels are merged with their corresponding counterparts * ( primaries with primaries , secondaries with secondaries etc . ) . * Between the values from the same level a separator is inserted . * < p > This is useful , for example , for combining sort keys from first and last names * to sort such pairs . * See http : / / www . unicode . org / reports / tr10 / # Merging _ Sort _ Keys * < p > The recommended way to achieve " merged " sorting is by * concatenating strings with U + FFFE between them . * The concatenation has the same sort order as the merged sort keys , * but merge ( getSortKey ( str1 ) , getSortKey ( str2 ) ) may differ from getSortKey ( str1 + ' \ uFFFE ' + str2 ) . * Using strings with U + FFFE may yield shorter sort keys . * < p > For details about Sort Key Features see * http : / / userguide . icu - project . org / collation / api # TOC - Sort - Key - Features * < p > It is possible to merge multiple sort keys by consecutively merging * another one with the intermediate result . * < p > Only the sort key bytes of the CollationKeys are merged . * This API does not attempt to merge the * String representations of the CollationKeys , hence null will be returned * as the result ' s String representation . * < p > Example ( uncompressed ) : * < pre > 191B1D 01 050505 01 910505 00 * 1F2123 01 050505 01 910505 00 < / pre > * will be merged as * < pre > 191B1D 02 1F2123 01 050505 02 050505 01 910505 02 910505 00 < / pre > * @ param source CollationKey to merge with * @ return a CollationKey that contains the valid merged sort keys * with a null String representation , * i . e . < tt > new CollationKey ( null , merged _ sort _ keys ) < / tt > * @ exception IllegalArgumentException thrown if source CollationKey * argument is null or of 0 length . */ public CollationKey merge ( CollationKey source ) { } }
// check arguments if ( source == null || source . getLength ( ) == 0 ) { throw new IllegalArgumentException ( "CollationKey argument can not be null or of 0 length" ) ; } // 1 byte extra for the 02 separator at the end of the copy of this sort key , // and 1 more for the terminating 00. byte result [ ] = new byte [ getLength ( ) + source . getLength ( ) + 2 ] ; // merge the sort keys with the same number of levels int rindex = 0 ; int index = 0 ; int sourceindex = 0 ; while ( true ) { // copy level from src1 not including 00 or 01 // unsigned issues while ( m_key_ [ index ] < 0 || m_key_ [ index ] >= MERGE_SEPERATOR_ ) { result [ rindex ++ ] = m_key_ [ index ++ ] ; } // add a 02 merge separator result [ rindex ++ ] = MERGE_SEPERATOR_ ; // copy level from src2 not including 00 or 01 while ( source . m_key_ [ sourceindex ] < 0 || source . m_key_ [ sourceindex ] >= MERGE_SEPERATOR_ ) { result [ rindex ++ ] = source . m_key_ [ sourceindex ++ ] ; } // if both sort keys have another level , then add a 01 level // separator and continue if ( m_key_ [ index ] == Collation . LEVEL_SEPARATOR_BYTE && source . m_key_ [ sourceindex ] == Collation . LEVEL_SEPARATOR_BYTE ) { ++ index ; ++ sourceindex ; result [ rindex ++ ] = Collation . LEVEL_SEPARATOR_BYTE ; } else { break ; } } // here , at least one sort key is finished now , but the other one // might have some contents left from containing more levels ; // that contents is just appended to the result int remainingLength ; if ( ( remainingLength = m_length_ - index ) > 0 ) { System . arraycopy ( m_key_ , index , result , rindex , remainingLength ) ; rindex += remainingLength ; } else if ( ( remainingLength = source . m_length_ - sourceindex ) > 0 ) { System . arraycopy ( source . m_key_ , sourceindex , result , rindex , remainingLength ) ; rindex += remainingLength ; } result [ rindex ] = 0 ; assert rindex == result . length - 1 ; return new CollationKey ( null , result , rindex ) ;
public class KruskalMSTGAC { private int addMandatoryArcs ( ) throws ContradictionException { } }
int from , to , rFrom , rTo , arc ; int tSize = 0 ; double val = propHK . getMinArcVal ( ) ; for ( int i = ma . size ( ) - 1 ; i >= 0 ; i -- ) { arc = ma . get ( i ) ; from = arc / n ; to = arc % n ; rFrom = findUF ( from ) ; rTo = findUF ( to ) ; if ( rFrom != rTo ) { linkUF ( rFrom , rTo ) ; Tree . addEdge ( from , to ) ; updateCCTree ( rFrom , rTo , val ) ; treeCost += costs [ arc ] ; tSize ++ ; } else { propHK . contradiction ( ) ; } } return tSize ;
public class CommerceOrderLocalServiceBaseImpl { /** * Returns a range of commerce orders matching the UUID and company . * @ param uuid the UUID of the commerce orders * @ param companyId the primary key of the company * @ param start the lower bound of the range of commerce orders * @ param end the upper bound of the range of commerce orders ( not inclusive ) * @ param orderByComparator the comparator to order the results by ( optionally < code > null < / code > ) * @ return the range of matching commerce orders , or an empty list if no matches were found */ @ Override public List < CommerceOrder > getCommerceOrdersByUuidAndCompanyId ( String uuid , long companyId , int start , int end , OrderByComparator < CommerceOrder > orderByComparator ) { } }
return commerceOrderPersistence . findByUuid_C ( uuid , companyId , start , end , orderByComparator ) ;
public class ClientFactory { /** * Return a new { @ link Client } instance * @ param clientClass the runtime instance class of { @ link Client } instance that is returned * @ return a new { @ link Client } instance */ public < T extends Client < ? extends Options , ? extends OptionsBuilder , ? extends RequestBuilder > > T newClient ( Class < ? extends Client > clientClass ) { } }
Client client ; try { client = clientClass . newInstance ( ) ; return ( T ) client ; } catch ( Exception e ) { throw new RuntimeException ( e ) ; }
public class FieldTextBuilder { /** * Does the work for the OR , AND , XOR and WHEN methods . * @ param operator * @ param fieldText * @ return */ private FieldTextBuilder binaryOperation ( final String operator , final FieldText fieldText ) { } }
// This should never happen as the AND , OR , XOR and WHEN methods should already have checked this Validate . isTrue ( fieldText != this ) ; // Optimized case when fieldText is a FieldTextBuilder if ( fieldText instanceof FieldTextBuilder ) { return binaryOp ( operator , ( FieldTextBuilder ) fieldText ) ; } // Special case when we ' re empty if ( componentCount == 0 ) { fieldTextString . append ( fieldText . toString ( ) ) ; if ( fieldText . size ( ) > 1 ) { lastOperator = "" ; } } else { // Add the NOTs , parentheses and operator addOperator ( operator ) ; // Size 1 means a single specifier , so no parentheses if ( fieldText . size ( ) == 1 ) { fieldTextString . append ( fieldText . toString ( ) ) ; } else { fieldTextString . append ( '(' ) . append ( fieldText . toString ( ) ) . append ( ')' ) ; } } componentCount += fieldText . size ( ) ; not = false ; return this ;
public class SegmentReferenceMarshaller { /** * Marshall the given parameter object . */ public void marshall ( SegmentReference segmentReference , ProtocolMarshaller protocolMarshaller ) { } }
if ( segmentReference == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( segmentReference . getId ( ) , ID_BINDING ) ; protocolMarshaller . marshall ( segmentReference . getVersion ( ) , VERSION_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class InternalXbaseWithAnnotationsParser { /** * InternalXbaseWithAnnotations . g : 3135:1 : ruleXExpressionInClosure returns [ EObject current = null ] : ( ( ) ( ( ( lv _ expressions _ 1_0 = ruleXExpressionOrVarDeclaration ) ) ( otherlv _ 2 = ' ; ' ) ? ) * ) ; */ public final EObject ruleXExpressionInClosure ( ) throws RecognitionException { } }
EObject current = null ; Token otherlv_2 = null ; EObject lv_expressions_1_0 = null ; enterRule ( ) ; try { // InternalXbaseWithAnnotations . g : 3141:2 : ( ( ( ) ( ( ( lv _ expressions _ 1_0 = ruleXExpressionOrVarDeclaration ) ) ( otherlv _ 2 = ' ; ' ) ? ) * ) ) // InternalXbaseWithAnnotations . g : 3142:2 : ( ( ) ( ( ( lv _ expressions _ 1_0 = ruleXExpressionOrVarDeclaration ) ) ( otherlv _ 2 = ' ; ' ) ? ) * ) { // InternalXbaseWithAnnotations . g : 3142:2 : ( ( ) ( ( ( lv _ expressions _ 1_0 = ruleXExpressionOrVarDeclaration ) ) ( otherlv _ 2 = ' ; ' ) ? ) * ) // InternalXbaseWithAnnotations . g : 3143:3 : ( ) ( ( ( lv _ expressions _ 1_0 = ruleXExpressionOrVarDeclaration ) ) ( otherlv _ 2 = ' ; ' ) ? ) * { // InternalXbaseWithAnnotations . g : 3143:3 : ( ) // InternalXbaseWithAnnotations . g : 3144:4: { if ( state . backtracking == 0 ) { current = forceCreateModelElement ( grammarAccess . getXExpressionInClosureAccess ( ) . getXBlockExpressionAction_0 ( ) , current ) ; } } // InternalXbaseWithAnnotations . g : 3150:3 : ( ( ( lv _ expressions _ 1_0 = ruleXExpressionOrVarDeclaration ) ) ( otherlv _ 2 = ' ; ' ) ? ) * loop56 : do { int alt56 = 2 ; int LA56_0 = input . LA ( 1 ) ; if ( ( ( LA56_0 >= RULE_STRING && LA56_0 <= RULE_ID ) || LA56_0 == 14 || ( LA56_0 >= 18 && LA56_0 <= 19 ) || LA56_0 == 26 || ( LA56_0 >= 42 && LA56_0 <= 43 ) || LA56_0 == 48 || LA56_0 == 55 || LA56_0 == 59 || LA56_0 == 61 || ( LA56_0 >= 65 && LA56_0 <= 82 ) || LA56_0 == 84 ) ) { alt56 = 1 ; } switch ( alt56 ) { case 1 : // InternalXbaseWithAnnotations . g : 3151:4 : ( ( lv _ expressions _ 1_0 = ruleXExpressionOrVarDeclaration ) ) ( otherlv _ 2 = ' ; ' ) ? { // InternalXbaseWithAnnotations . g : 3151:4 : ( ( lv _ expressions _ 1_0 = ruleXExpressionOrVarDeclaration ) ) // InternalXbaseWithAnnotations . g : 3152:5 : ( lv _ expressions _ 1_0 = ruleXExpressionOrVarDeclaration ) { // InternalXbaseWithAnnotations . g : 3152:5 : ( lv _ expressions _ 1_0 = ruleXExpressionOrVarDeclaration ) // InternalXbaseWithAnnotations . g : 3153:6 : lv _ expressions _ 1_0 = ruleXExpressionOrVarDeclaration { if ( state . backtracking == 0 ) { newCompositeNode ( grammarAccess . getXExpressionInClosureAccess ( ) . getExpressionsXExpressionOrVarDeclarationParserRuleCall_1_0_0 ( ) ) ; } pushFollow ( FOLLOW_46 ) ; lv_expressions_1_0 = ruleXExpressionOrVarDeclaration ( ) ; state . _fsp -- ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { if ( current == null ) { current = createModelElementForParent ( grammarAccess . getXExpressionInClosureRule ( ) ) ; } add ( current , "expressions" , lv_expressions_1_0 , "org.eclipse.xtext.xbase.Xbase.XExpressionOrVarDeclaration" ) ; afterParserOrEnumRuleCall ( ) ; } } } // InternalXbaseWithAnnotations . g : 3170:4 : ( otherlv _ 2 = ' ; ' ) ? int alt55 = 2 ; int LA55_0 = input . LA ( 1 ) ; if ( ( LA55_0 == 58 ) ) { alt55 = 1 ; } switch ( alt55 ) { case 1 : // InternalXbaseWithAnnotations . g : 3171:5 : otherlv _ 2 = ' ; ' { otherlv_2 = ( Token ) match ( input , 58 , FOLLOW_47 ) ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { newLeafNode ( otherlv_2 , grammarAccess . getXExpressionInClosureAccess ( ) . getSemicolonKeyword_1_1 ( ) ) ; } } break ; } } break ; default : break loop56 ; } } while ( true ) ; } } if ( state . backtracking == 0 ) { leaveRule ( ) ; } } catch ( RecognitionException re ) { recover ( input , re ) ; appendSkippedTokens ( ) ; } finally { } return current ;
public class ManagedPoolDataSource { /** * This method will return a valid connection as fast as possible . Here is the sequence of events : * < ol > * < li > First it will try to take a ready connection from the pool . < / li > * < li > If the pool doesn ' t have any ready connections this method will check * if the pool has space for new connections . If yes , a new connection is created and inserted * into the pool . < / li > * < li > If the pool is already at maximum size this method will check for abandoned * connections among the connections given out earlier . * If any of the connections are abandoned it will be reclaimed , reset and * given out . < / li > * < li > If there are no abandoned connections this method waits until a connection becomes * available in the pool , or until the login time out time has passed ( if login timeout set ) . < / li > * < / ol > * This sequence means that the pool will not grow till max size as long as there are available connections * in the pool . Only when no connections are available will it spend time creating new connections . * In addition it will not spend * time reclaiming abandoned connections until it ' s absolutely necessary . Only when no new connections * can be created . Ultimately it only blocks if there really are no available connections , * none can be created and none can be reclaimed . Since the * pool is passive this is the sequence of events that should give the highest performance possible * for giving out connections from the pool . * < br / > < br / > * Perhaps it is faster to reclaim a connection if possible than to create a new one . If so , it would be faster * to reclaim existing connections before creating new ones . It may also preserve resources better . * However , assuming that there will not often be abandoned connections , that programs most often * remember to close them , on the average the reclaim check is only going to be " wasted overhead " . * It will only rarely result in a usable connection . In that perspective it should be faster * to only do the reclaim check when no connections can be created . * @ throws SQLException */ public Connection getConnection ( ) throws SQLException { } }
PooledConnection pooledConnection = null ; synchronized ( this ) { if ( ! initialized ) { if ( initialSize > maxPoolSize ) { throw new SQLException ( "Initial size of " + initialSize + " exceeds max. pool size of " + maxPoolSize ) ; } logInfo ( "Pre-initializing " + initialSize + " physical connections" ) ; for ( int i = 0 ; i < initialSize ; i ++ ) { connectionsInactive . add ( createNewConnection ( ) ) ; } initialized = true ; } long loginTimeoutExpiration = calculateLoginTimeoutExpiration ( ) ; // each waiting thread will spin around in this loop until either // a ) a connection becomes available // b ) the login timeout passes . Results in SQLException . // c ) the thread is interrupted while waiting for an available connection // d ) the connection pool is closed . Results in SQLException . // the reason the threads spin in a loop is that they should always check all options // ( available + space for new + abandoned ) before waiting . In addition the threads will // repeat the close check before spinning a second time . That way all threads waiting // for a connection when the connection is closed will get an SQLException . while ( pooledConnection == null ) { if ( this . isPoolClosed ) { throw new SQLException ( "The pool is closed. You cannot get anymore connections from it." ) ; } // 1 ) Check if any connections available in the pool . pooledConnection = dequeueFirstIfAny ( ) ; if ( pooledConnection != null ) { return wrapConnectionAndMarkAsInUse ( pooledConnection ) ; } // 2 ) Check if the pool has space for new connections and create one if it does . if ( poolHasSpaceForNewConnections ( ) ) { pooledConnection = createNewConnection ( ) ; return wrapConnectionAndMarkAsInUse ( pooledConnection ) ; } // 3 ) Check if connection pool has session timeout . If yes , // check if any connections has timed out . Return one if there are any . if ( this . sessionTimeout > 0 ) { reclaimAbandonedConnections ( ) ; // check if any connections were closed during the time out check . pooledConnection = dequeueFirstIfAny ( ) ; if ( pooledConnection != null ) { return wrapConnectionAndMarkAsInUse ( pooledConnection ) ; } } // 4 ) wait until a connection becomes available or the login timeout passes ( if set ) . doWait ( loginTimeoutExpiration ) ; } return wrapConnectionAndMarkAsInUse ( pooledConnection ) ; }
public class JsonArray { /** * Returns the < code > long < / code > at index or otherwise if not found . * @ param index * @ return the value at index or null if not found * @ throws java . lang . IndexOutOfBoundsException if the index is out of the array bounds */ public long getLong ( int index , long otherwise ) { } }
Long l = getLong ( index ) ; return l == null ? otherwise : l ;
public class ExpressionMapping { /** * Gets the from expression . * @ return the from expression */ public Expression getFromExpression ( ) { } }
if ( _fromExpression == null && _from != null ) { _fromExpression = ExpressionFactory . INSTANCE . create ( _from , null , _propertyResolver ) ; } return _fromExpression ;
public class DeepEquals { /** * Determine if the passed in class has a non - Object . equals ( ) method . This * method caches its results in static ConcurrentHashMap to benefit * execution performance . * @ param c Class to check . * @ return true , if the passed in Class has a . equals ( ) method somewhere between * itself and just below Object in it ' s inheritance . */ public static boolean hasCustomEquals ( Class c ) { } }
Class origClass = c ; if ( _customEquals . containsKey ( c ) ) { return _customEquals . get ( c ) ; } while ( ! Object . class . equals ( c ) ) { try { c . getDeclaredMethod ( "equals" , Object . class ) ; _customEquals . put ( origClass , true ) ; return true ; } catch ( Exception ignored ) { } c = c . getSuperclass ( ) ; } _customEquals . put ( origClass , false ) ; return false ;
public class MimeType { /** * Gets the default charset for a file . * for now all mime types that start with text returns UTF - 8 otherwise the fallback . * @ param mime the mime type to query * @ param fallback if not found returns fallback * @ return charset string */ public static String getCharset ( @ NotNull String mime , String fallback ) { } }
// TODO : exceptions json and which other should also be marked as text if ( mime . startsWith ( "text" ) ) { return defaultContentEncoding ; } return fallback ;
public class PAbstractObject { /** * Get a property as a float or Default value . * @ param key the property name * @ param defaultValue default value */ @ Override public final Float optFloat ( final String key , final Float defaultValue ) { } }
Float result = optFloat ( key ) ; return result == null ? defaultValue : result ;