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 FrameworkExce... | 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 whi... | 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 pk... |
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 shouldYieldFocu... | 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 ( ) , PRINC... |
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 ... | 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... |
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 configured... | 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 )... | 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 annotationParamVal... |
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 = ... |
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 ; ... |
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 ... |
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
* @ retu... | 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... |
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 < ... | 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... |
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 ... | 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 . ap... |
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 InternalE... | 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 .
*... | 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 v... | 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 . getTop... |
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 Publi... | 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 . mars... |
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 ... |
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 ... | 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 ( ) ... |
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... | 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 ... | 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... |
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 ( ) )... |
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 NoSu... | 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 ) valu... | 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 . *... | 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 != nu... |
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 obs... | return listByResourceGroupWithServiceResponseAsync ( resourceGroupName ) . map ( new Func1 < ServiceResponse < Page < IotHubDescriptionInner > > , Page < IotHubDescriptionInner > > ( ) { @ Override public Page < IotHubDescriptionInner > call ( ServiceResponse < Page < IotHubDescriptionInner > > response ) { return resp... |
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... | 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 = ( JView... |
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 ... | 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 ... | 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 . */
stati... | 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... | 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... | 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 projec... | 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 . ... | 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 s... | 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 . ... | 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 ) to... |
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 ParametersA... | if ( overrides == null ) { ParametersAction parametersAction = new ParametersAction ( parameters ) ; parametersAction . safeParameters = this . safeParameters ; return parametersAction ; } List < ParameterValue > combinedParameters = Lists . < ParameterValue > newArrayList ( overrides ) ; Set < String > names = newHash... |
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 ei... | 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 ) ; BigDeci... |
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 */
publ... | // 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 ) ; // Otherwis... |
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 ;... |
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 Nam... | 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.assign... |
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 ( scr... |
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 PutThi... | 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 ( ) , ROLLOVERINTERVA... |
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 . BackendEx... | 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 ( Th... | 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 . o... |
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 l... |
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... | 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 ,... | 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 ( ) ; TCContinueMessage... |
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 ( Byte... | 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... |
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... |
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 , ... | // 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 [ ge... |
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 , t... |
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 boun... | 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 RequestBuilde... | 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... |
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 ne... |
public class InternalXbaseWithAnnotationsParser { /** * InternalXbaseWithAnnotations . g : 3135:1 : ruleXExpressionInClosure returns [ EObject current = null ] : ( ( ) ( ( ( lv _ expressions _ 1_0 = ruleXExpressionOrVarDeclaration ) ) ( otherlv _ 2 = ' ; ' ) ? ) * ) ; */
public final EObject ruleXExpressionInClosure ( ... | 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 : ( ( ) ( (... |
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
* ... | 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... |
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 be... | 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 (... |
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 ( @ NotNu... | // 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 ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.