signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class SAIS { /** * / * String */ public static int suffixsort ( String T , int [ ] SA , int n ) { } }
if ( ( T == null ) || ( SA == null ) || ( T . length ( ) < n ) || ( SA . length < n ) ) { return - 1 ; } if ( n <= 1 ) { if ( n == 1 ) { SA [ 0 ] = 0 ; } return 0 ; } return SA_IS ( new StringArray ( T , 0 ) , SA , 0 , n , 65536 , false ) ;
public class RelationalOperations { /** * Returns true if the relation holds . */ private static boolean multiPointRelateEnvelope_ ( MultiPoint multipoint_a , Envelope envelope_b , double tolerance , int relation , ProgressTracker progress_tracker ) { } }
switch ( relation ) { case Relation . disjoint : return multiPointDisjointEnvelope_ ( multipoint_a , envelope_b , tolerance , progress_tracker ) ; case Relation . within : return multiPointWithinEnvelope_ ( multipoint_a , envelope_b , tolerance , progress_tracker ) ; case Relation . contains : return multiPointContainsEnvelope_ ( multipoint_a , envelope_b , tolerance , progress_tracker ) ; case Relation . equals : return multiPointEqualsEnvelope_ ( multipoint_a , envelope_b , tolerance , progress_tracker ) ; case Relation . touches : return multiPointTouchesEnvelope_ ( multipoint_a , envelope_b , tolerance , progress_tracker ) ; case Relation . crosses : return multiPointCrossesEnvelope_ ( multipoint_a , envelope_b , tolerance , progress_tracker ) ; default : break ; // warning fix } return false ;
public class AbstractNumberPickerPreference { /** * Obtains all attributes from a specific attribute set . * @ param attributeSet * The attribute set , the attributes should be obtained from , as an instance of the type * { @ link AttributeSet } or null , if no attributes should be obtained * @ param defaultStyle * The default style to apply to this preference . If 0 , no style will be applied ( beyond * what is included in the theme ) . This may either be an attribute resource , whose value * will be retrieved from the current theme , or an explicit style resource * @ param defaultStyleResource * A resource identifier of a style resource that supplies default values for the * preference , used only if the default style is 0 or can not be found in the theme . Can * be 0 to not look for defaults */ private void obtainStyledAttributes ( @ Nullable final AttributeSet attributeSet , @ AttrRes final int defaultStyle , @ StyleRes final int defaultStyleResource ) { } }
TypedArray numberPickerTypedArray = getContext ( ) . obtainStyledAttributes ( attributeSet , R . styleable . AbstractNumberPickerPreference , defaultStyle , defaultStyleResource ) ; TypedArray unitTypedArray = getContext ( ) . obtainStyledAttributes ( attributeSet , R . styleable . AbstractUnitPreference , defaultStyle , defaultStyleResource ) ; try { obtainUseInputMethod ( numberPickerTypedArray ) ; obtainWrapSelectorWheel ( numberPickerTypedArray ) ; obtainUnit ( unitTypedArray ) ; } finally { numberPickerTypedArray . recycle ( ) ; }
public class A_CmsTabHandler { /** * Selects the given resource and sets its path into the xml - content field or editor link . < p > * @ param resourcePath the item resource path * @ param structureId the structure id * @ param title the resource title * @ param resourceType the item resource type */ public void selectResource ( String resourcePath , CmsUUID structureId , String title , String resourceType ) { } }
m_controller . selectResource ( resourcePath , structureId , title , resourceType ) ;
public class AbstractStoreResource { /** * Set the info for the file in this store reosurce . * @ param _ filename name of the file * @ param _ fileLength length of the file * @ throws EFapsException on error */ protected void setFileInfo ( final String _filename , final long _fileLength ) throws EFapsException { } }
if ( ! _filename . equals ( this . fileName ) || _fileLength != this . fileLength ) { ConnectionResource res = null ; try { res = Context . getThreadContext ( ) . getConnectionResource ( ) ; final AbstractDatabase < ? > db = Context . getDbType ( ) ; final StringBuilder cmd = new StringBuilder ( ) . append ( db . getSQLPart ( SQLPart . UPDATE ) ) . append ( " " ) . append ( db . getTableQuote ( ) ) . append ( AbstractStoreResource . TABLENAME_STORE ) . append ( db . getTableQuote ( ) ) . append ( " " ) . append ( db . getSQLPart ( SQLPart . SET ) ) . append ( " " ) . append ( db . getColumnQuote ( ) ) . append ( AbstractStoreResource . COLNAME_FILENAME ) . append ( db . getColumnQuote ( ) ) . append ( db . getSQLPart ( SQLPart . EQUAL ) ) . append ( "? " ) . append ( db . getSQLPart ( SQLPart . COMMA ) ) . append ( db . getColumnQuote ( ) ) . append ( AbstractStoreResource . COLNAME_FILELENGTH ) . append ( db . getColumnQuote ( ) ) . append ( db . getSQLPart ( SQLPart . EQUAL ) ) . append ( "? " ) . append ( db . getSQLPart ( SQLPart . WHERE ) ) . append ( " " ) . append ( db . getColumnQuote ( ) ) . append ( "ID" ) . append ( db . getColumnQuote ( ) ) . append ( db . getSQLPart ( SQLPart . EQUAL ) ) . append ( getGeneralID ( ) ) ; final PreparedStatement stmt = res . prepareStatement ( cmd . toString ( ) ) ; try { stmt . setString ( 1 , _filename ) ; stmt . setLong ( 2 , _fileLength ) ; stmt . execute ( ) ; } finally { stmt . close ( ) ; } } catch ( final EFapsException e ) { throw e ; } catch ( final SQLException e ) { throw new EFapsException ( JDBCStoreResource . class , "write.SQLException" , e ) ; } }
public class CheckBox { /** * < p > Changes the checked state of this button . < / p > * @ param checked true to check the button , false to uncheck it */ public void setChecked ( boolean checked ) { } }
setChecked ( checked ? CheckableDrawable . CheckedState . CHECKED : CheckableDrawable . CheckedState . UNCHECKED ) ;
public class Config { /** * Loads a config file * @ param resource The config file */ @ SneakyThrows public static void loadConfig ( Resource resource ) { } }
if ( resource == null || ! resource . exists ( ) ) { return ; } if ( resource . path ( ) != null && getInstance ( ) . loaded . contains ( resource . path ( ) ) ) { return ; // Only load once ! } new ConfigParser ( resource ) . parse ( ) ; if ( resource . path ( ) != null ) { getInstance ( ) . loaded . add ( resource . path ( ) ) ; }
public class KeyVaultClientBaseImpl { /** * List all versions of the specified secret . * The full secret identifier and attributes are provided in the response . No values are returned for the secrets . This operations requires the secrets / list permission . * @ param vaultBaseUrl The vault name , for example https : / / myvault . vault . azure . net . * @ param secretName The name of the secret . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the PagedList & lt ; SecretItem & gt ; object wrapped in { @ link ServiceResponse } if successful . */ public Observable < ServiceResponse < Page < SecretItem > > > getSecretVersionsSinglePageAsync ( final String vaultBaseUrl , final String secretName ) { } }
if ( vaultBaseUrl == null ) { throw new IllegalArgumentException ( "Parameter vaultBaseUrl is required and cannot be null." ) ; } if ( secretName == null ) { throw new IllegalArgumentException ( "Parameter secretName is required and cannot be null." ) ; } if ( this . apiVersion ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.apiVersion() is required and cannot be null." ) ; } final Integer maxresults = null ; String parameterizedHost = Joiner . on ( ", " ) . join ( "{vaultBaseUrl}" , vaultBaseUrl ) ; return service . getSecretVersions ( secretName , maxresults , this . apiVersion ( ) , this . acceptLanguage ( ) , parameterizedHost , this . userAgent ( ) ) . flatMap ( new Func1 < Response < ResponseBody > , Observable < ServiceResponse < Page < SecretItem > > > > ( ) { @ Override public Observable < ServiceResponse < Page < SecretItem > > > call ( Response < ResponseBody > response ) { try { ServiceResponse < PageImpl < SecretItem > > result = getSecretVersionsDelegate ( response ) ; return Observable . just ( new ServiceResponse < Page < SecretItem > > ( result . body ( ) , result . response ( ) ) ) ; } catch ( Throwable t ) { return Observable . error ( t ) ; } } } ) ;
public class TextWrapper { /** * todo eude - merge with com . haulmont . yarg . formatters . impl . DocxFormatterDelegate . handleStringWithAliases ( ) */ public void fillTextWithBandData ( ) { } }
Matcher matcher = AbstractFormatter . ALIAS_WITH_BAND_NAME_PATTERN . matcher ( text . getValue ( ) ) ; while ( matcher . find ( ) ) { String alias = matcher . group ( 1 ) ; String stringFunction = matcher . group ( 2 ) ; AbstractFormatter . BandPathAndParameterName bandAndParameter = docxFormatter . separateBandNameAndParameterName ( alias ) ; if ( isBlank ( bandAndParameter . getBandPath ( ) ) || isBlank ( bandAndParameter . getParameterName ( ) ) ) { if ( alias . matches ( "[A-z0-9_\\.]+?" ) ) { // skip aliases in tables continue ; } throw docxFormatter . wrapWithReportingException ( "Bad alias : " + text . getValue ( ) ) ; } BandData band = docxFormatter . findBandByPath ( bandAndParameter . getBandPath ( ) ) ; if ( band == null ) { throw docxFormatter . wrapWithReportingException ( String . format ( "No band for alias [%s] found" , alias ) ) ; } String fullParameterName = band . getName ( ) + "." + bandAndParameter . getParameterName ( ) ; Object parameterValue = band . getParameterValue ( bandAndParameter . getParameterName ( ) ) ; if ( docxFormatter . tryToApplyInliners ( fullParameterName , parameterValue , text ) ) return ; text . setValue ( docxFormatter . inlineParameterValue ( text . getValue ( ) , alias , docxFormatter . formatValue ( parameterValue , bandAndParameter . getParameterName ( ) , fullParameterName , stringFunction ) ) ) ; text . setSpace ( "preserve" ) ; }
public class Button { /** * Release any acquired resources . */ protected void localRelease ( ) { } }
super . localRelease ( ) ; _state . clear ( ) ; _action = null ; _value = null ; _text = null ; _params = null ; _targetScope = null ; _popupSupport = null ; _disableSecondClick = false ; _renderAsButton = false ;
public class AsmClassGenerator { public void visitClass ( ClassNode classNode ) { } }
referencedClasses . clear ( ) ; WriterControllerFactory factory = ( WriterControllerFactory ) classNode . getNodeMetaData ( WriterControllerFactory . class ) ; WriterController normalController = new WriterController ( ) ; if ( factory != null ) { this . controller = factory . makeController ( normalController ) ; } else { this . controller = normalController ; } this . controller . init ( this , context , cv , classNode ) ; if ( controller . shouldOptimizeForInt ( ) || factory != null ) { OptimizingStatementWriter . setNodeMeta ( controller . getTypeChooser ( ) , classNode ) ; } try { cv . visit ( controller . getBytecodeVersion ( ) , adjustedClassModifiersForClassWriting ( classNode ) , controller . getInternalClassName ( ) , BytecodeHelper . getGenericsSignature ( classNode ) , controller . getInternalBaseClassName ( ) , BytecodeHelper . getClassInternalNames ( classNode . getInterfaces ( ) ) ) ; cv . visitSource ( sourceFile , null ) ; if ( classNode instanceof InnerClassNode ) { InnerClassNode innerClass = ( InnerClassNode ) classNode ; MethodNode enclosingMethod = innerClass . getEnclosingMethod ( ) ; if ( enclosingMethod != null ) { String outerClassName = BytecodeHelper . getClassInternalName ( innerClass . getOuterClass ( ) . getName ( ) ) ; cv . visitOuterClass ( outerClassName , enclosingMethod . getName ( ) , BytecodeHelper . getMethodDescriptor ( enclosingMethod ) ) ; } } if ( classNode . getName ( ) . endsWith ( "package-info" ) ) { PackageNode packageNode = classNode . getPackage ( ) ; if ( packageNode != null ) { // pull them out of package node but treat them like they were on class node for ( AnnotationNode an : packageNode . getAnnotations ( ) ) { // skip built - in properties if ( an . isBuiltIn ( ) ) continue ; if ( an . hasSourceRetention ( ) ) continue ; AnnotationVisitor av = getAnnotationVisitor ( classNode , an , cv ) ; visitAnnotationAttributes ( an , av ) ; av . visitEnd ( ) ; } } cv . visitEnd ( ) ; return ; } else { visitAnnotations ( classNode , cv ) ; } if ( classNode . isInterface ( ) ) { ClassNode owner = classNode ; if ( owner instanceof InnerClassNode ) { owner = owner . getOuterClass ( ) ; } String outerClassName = classNode . getName ( ) ; String name = outerClassName + "$" + context . getNextInnerClassIdx ( ) ; controller . setInterfaceClassLoadingClass ( new InterfaceHelperClassNode ( owner , name , 4128 , ClassHelper . OBJECT_TYPE , controller . getCallSiteWriter ( ) . getCallSites ( ) ) ) ; super . visitClass ( classNode ) ; createInterfaceSyntheticStaticFields ( ) ; } else { super . visitClass ( classNode ) ; MopWriter . Factory mopWriterFactory = classNode . getNodeMetaData ( MopWriter . Factory . class ) ; if ( mopWriterFactory == null ) { mopWriterFactory = MopWriter . FACTORY ; } MopWriter mopWriter = mopWriterFactory . create ( controller ) ; mopWriter . createMopMethods ( ) ; controller . getCallSiteWriter ( ) . generateCallSiteArray ( ) ; createSyntheticStaticFields ( ) ; } // GROOVY - 6750 and GROOVY - 6808 for ( Iterator < InnerClassNode > iter = classNode . getInnerClasses ( ) ; iter . hasNext ( ) ; ) { InnerClassNode innerClass = iter . next ( ) ; makeInnerClassEntry ( innerClass ) ; } makeInnerClassEntry ( classNode ) ; cv . visitEnd ( ) ; } catch ( GroovyRuntimeException e ) { e . setModule ( classNode . getModule ( ) ) ; throw e ; } catch ( NegativeArraySizeException nase ) { throw new GroovyRuntimeException ( "NegativeArraySizeException while processing " + sourceFile , nase ) ; } catch ( NullPointerException npe ) { throw new GroovyRuntimeException ( "NPE while processing " + sourceFile , npe ) ; }
public class CTInboxMessageContent { /** * Returns the text for the JSONObject of Link provided * The JSONObject of Link provided should be of the type " copy " * @ param jsonObject of Link * @ return String */ public String getLinkCopyText ( JSONObject jsonObject ) { } }
if ( jsonObject == null ) return "" ; try { JSONObject copyObject = jsonObject . has ( "copyText" ) ? jsonObject . getJSONObject ( "copyText" ) : null ; if ( copyObject != null ) { return copyObject . has ( "text" ) ? copyObject . getString ( "text" ) : "" ; } else { return "" ; } } catch ( JSONException e ) { Logger . v ( "Unable to get Link Text with JSON - " + e . getLocalizedMessage ( ) ) ; return "" ; }
public class MoveOnSelectHandler { /** * Constructor . * @ param pfldDest tour . field . BaseField The destination field . * @ param fldSource The source field . * @ param pCheckMark If is field if false , don ' t move the data . * @ param bMoveOnNew If true , move on new also . * @ param bMoveOnValid If true , move on valid also . */ public void init ( Record record , BaseField fldDest , BaseField fldSource , Converter convCheckMark , boolean bMoveOnNew , boolean bMoveOnValid , boolean bMoveOnSelect , boolean bMoveOnAdd , boolean bMoveOnUpdate , String strSource , boolean bDontMoveNullSource ) { } }
super . init ( record , fldDest , fldSource , convCheckMark , bMoveOnNew , bMoveOnValid , bMoveOnSelect , bMoveOnAdd , bMoveOnUpdate , strSource , bDontMoveNullSource ) ;
public class ServletContextResourceReaderHandler { /** * ( non - Javadoc ) * @ see * net . jawr . web . resource . handler . reader . ResourceBrowser # getResourceNames * ( java . lang . String ) */ @ Override public Set < String > getResourceNames ( String dirName ) { } }
Set < String > resourceNames = new TreeSet < > ( ) ; List < ResourceBrowser > list = new ArrayList < > ( ) ; list . addAll ( resourceInfoProviders ) ; for ( ResourceBrowser rsBrowser : list ) { if ( generatorRegistry . isPathGenerated ( dirName ) ) { if ( rsBrowser instanceof ResourceGenerator ) { ResourceGenerator rsGeneratorBrowser = ( ResourceGenerator ) rsBrowser ; if ( rsGeneratorBrowser . getResolver ( ) . matchPath ( dirName ) ) { resourceNames . addAll ( rsBrowser . getResourceNames ( dirName ) ) ; break ; } } } else { if ( ! ( rsBrowser instanceof ResourceGenerator ) ) { resourceNames . addAll ( rsBrowser . getResourceNames ( dirName ) ) ; break ; } } } return resourceNames ;
public class AnalyticsItemsInner { /** * Deletes a specific Analytics Items defined within an Application Insights component . * @ param resourceGroupName The name of the resource group . * @ param resourceName The name of the Application Insights component resource . * @ param scopePath Enum indicating if this item definition is owned by a specific user or is shared between all users with access to the Application Insights component . Possible values include : ' analyticsItems ' , ' myanalyticsItems ' * @ 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 delete ( String resourceGroupName , String resourceName , ItemScopePath scopePath ) { } }
deleteWithServiceResponseAsync ( resourceGroupName , resourceName , scopePath ) . toBlocking ( ) . single ( ) . body ( ) ;
public class JspConfigTypeImpl { /** * If not already created , a new < code > taglib < / code > element will be created and returned . * Otherwise , the first existing < code > taglib < / code > element will be returned . * @ return the instance defined for the element < code > taglib < / code > */ public TaglibType < JspConfigType < T > > getOrCreateTaglib ( ) { } }
List < Node > nodeList = childNode . get ( "taglib" ) ; if ( nodeList != null && nodeList . size ( ) > 0 ) { return new TaglibTypeImpl < JspConfigType < T > > ( this , "taglib" , childNode , nodeList . get ( 0 ) ) ; } return createTaglib ( ) ;
public class JcrGroovyCompiler { /** * Compile Groovy source that located in < code > sourceReferences < / code > . * Compiled sources can be dependent to each other and dependent to Groovy * sources that are accessible for this compiler and with additional Groovy * sources < code > src < / code > . < b > NOTE < / b > To be able load Groovy source files * from specified folders the following rules must be observed : * < ul > * < li > Groovy source files must be located in folder with respect to package * structure < / li > * < li > Name of Groovy source files must be the same as name of class located * in file < / li > * < li > Groovy source file must have extension ' . groovy ' < / li > * < / ul > * < br > * Example : If source stream that we want compile contains the following * code : * < pre > * package c . b . a * import a . b . c . A * class B extends A { * / / Do something . * < / pre > * Assume we store dependencies in JCR then URL of folder with Groovy sources * may be like this : < code > jcr : / / repository / workspace # / groovy - library < / code > . * Then absolute path to JCR node that contains Groovy source must be as * following : < code > / groovy - library / a / b / c / A . groovy < / code > * @ param src additional Groovy source location that should be added in * class - path when compile < code > sourceReferences < / code > * @ param sourceReferences references to Groovy sources to be compiled * @ return result of compilation * @ throws IOException if any i / o errors occurs */ public Class < ? > [ ] compile ( SourceFolder [ ] src , UnifiedNodeReference ... sourceReferences ) throws IOException { } }
SourceFile [ ] files = new SourceFile [ sourceReferences . length ] ; for ( int i = 0 ; i < sourceReferences . length ; i ++ ) files [ i ] = new SourceFile ( sourceReferences [ i ] . getURL ( ) ) ; return doCompile ( ( JcrGroovyClassLoader ) classLoaderProvider . getGroovyClassLoader ( src ) , files ) ;
public class AbstractXTree { /** * Celebrated by the Profiler as a lot faster than the previous variant : that * used to calculate all overlaps of the old MBR and the new MBR with all * other MBRs . Now : The overlaps are only calculated if necessary : < br > * < ul > * < li > the new MBR does not have to be tested on overlaps if the current * dimension has never changed < / li > * < li > the old MBR does not have to be tested if the new MBR shows no overlaps * < / li > * < / ul > * Furthermore tries to avoid rounding errors arising from large value ranges * and / or larger dimensions . * However : hardly any difference in real runtime ! * @ param node Node * @ param ei current entry * @ param testMBR extended MBR of < code > ei < / code > * @ return overlap increase . */ private double calculateOverlapIncrease ( N node , SpatialEntry ei , SpatialComparable testMBR ) { } }
ModifiableHyperBoundingBox eiMBR = new ModifiableHyperBoundingBox ( ei ) ; ModifiableHyperBoundingBox testMBRModifiable = new ModifiableHyperBoundingBox ( testMBR ) ; double [ ] lb = eiMBR . getMinRef ( ) ; double [ ] ub = eiMBR . getMaxRef ( ) ; double [ ] lbT = testMBRModifiable . getMinRef ( ) ; double [ ] ubT = testMBRModifiable . getMaxRef ( ) ; double [ ] lbNext = null ; // next tested lower bounds double [ ] ubNext = null ; // and upper bounds boolean [ ] dimensionChanged = new boolean [ lb . length ] ; for ( int i = 0 ; i < dimensionChanged . length ; i ++ ) { if ( lb [ i ] > lbT [ i ] || ub [ i ] < ubT [ i ] ) { dimensionChanged [ i ] = true ; } } double multiOverlapInc = 0 , multiOverlapMult = 1 , mOOld = 1 , mONew = 1 ; double ol , olT ; // dimensional overlap for ( int j = 0 ; j < node . getNumEntries ( ) ; j ++ ) { SpatialEntry ej = node . getEntry ( j ) ; if ( getPageID ( ej ) != getPageID ( ei ) ) { multiOverlapMult = 1 ; // is constant for a unchanged dimension mOOld = 1 ; // overlap for old MBR on changed dimensions mONew = 1 ; // overlap on new MBR on changed dimension ModifiableHyperBoundingBox ejMBR = new ModifiableHyperBoundingBox ( ej ) ; lbNext = ejMBR . getMinRef ( ) ; ubNext = ejMBR . getMaxRef ( ) ; for ( int i = 0 ; i < dimensionChanged . length ; i ++ ) { if ( dimensionChanged [ i ] ) { if ( lbT [ i ] > ubNext [ i ] || ubT [ i ] < lbNext [ i ] ) { multiOverlapMult = 0 ; break ; // old MBR has no overlap either } olT = ( ubT [ i ] > ubNext [ i ] ? ubNext [ i ] : ubT [ i ] ) - ( lbT [ i ] < lbNext [ i ] ? lbNext [ i ] : lbT [ i ] ) ; mONew *= olT ; if ( mOOld != 0 ) { // else : no use in calculating overlap ol = ( ub [ i ] > ubNext [ i ] ? ubNext [ i ] : ub [ i ] ) - ( lb [ i ] < lbNext [ i ] ? lbNext [ i ] : lb [ i ] ) ; if ( ol < 0 ) { ol = 0 ; } mOOld *= ol ; } } else { if ( lb [ i ] > ubNext [ i ] || ub [ i ] < lbNext [ i ] ) { multiOverlapMult = 0 ; break ; } ol = ( ub [ i ] > ubNext [ i ] ? ubNext [ i ] : ub [ i ] ) - ( lb [ i ] < lbNext [ i ] ? lbNext [ i ] : lb [ i ] ) ; multiOverlapMult *= ol ; } } if ( multiOverlapMult != 0 ) { multiOverlapInc += multiOverlapMult * ( mONew - mOOld ) ; } } } return multiOverlapInc ;
public class LongTupleIterators { /** * Returns an iterator that returns { @ link MutableLongTuple } s in the * given range . < br > * < br > * Copies of the given tuples will be stored internally . < br > * < br > * Also see < a href = " . . / . . / package - summary . html # IterationOrder " > * Iteration Order < / a > * @ param min The minimum values , inclusive * @ param max The maximum values , exclusive * @ return The iterator * @ throws IllegalArgumentException If the given tuples do not * have the same { @ link Tuple # getSize ( ) size } */ public static Iterator < MutableLongTuple > lexicographicalIterator ( LongTuple min , LongTuple max ) { } }
Utils . checkForEqualSize ( min , max ) ; LongTuple localMin = LongTuples . copy ( min ) ; LongTuple localMax = LongTuples . copy ( max ) ; return new LongTupleIterator ( localMin , localMax , LongTupleIncrementors . lexicographicalIncrementor ( ) ) ;
public class PackedMemoryCloneIndex { /** * Performs sorting , if necessary . */ private void ensureSorted ( ) { } }
if ( sorted ) { return ; } ensureCapacity ( ) ; DataUtils . sort ( byBlockHash ) ; for ( int i = 0 ; i < size ; i ++ ) { resourceIdsIndex [ i ] = i ; } DataUtils . sort ( byResourceId ) ; sorted = true ;
public class ContainerKeyIndex { /** * Looks up a Backpointer offset . * @ param segment A DirectSegmentAccess providing access to the Segment to search in . * @ param offset The offset to find a backpointer from . * @ param timeout Timeout for the operation . * @ return A CompletableFuture that , when completed , will contain the backpointer offset , or - 1 if no such pointer exists . */ CompletableFuture < Long > getBackpointerOffset ( DirectSegmentAccess segment , long offset , Duration timeout ) { } }
Exceptions . checkNotClosed ( this . closed . get ( ) , this ) ; // First check the index tail cache . long cachedBackpointer = this . cache . getBackpointer ( segment . getSegmentId ( ) , offset ) ; if ( cachedBackpointer >= 0 ) { return CompletableFuture . completedFuture ( cachedBackpointer ) ; } if ( offset <= this . cache . getSegmentIndexOffset ( segment . getSegmentId ( ) ) ) { // The sought source offset is already indexed ; do not bother with waiting for recovery . return this . indexReader . getBackpointerOffset ( segment , offset , timeout ) ; } else { // Nothing in the tail cache ; look it up in the index . return this . recoveryTracker . waitIfNeeded ( segment , ( ) -> this . indexReader . getBackpointerOffset ( segment , offset , timeout ) ) ; }
public class WorkbinsApi { /** * Get the content of a Workbin . * @ param workbinId Id of the Workbin ( required ) * @ param getWorkbinContentData ( required ) * @ return ApiSuccessResponse * @ throws ApiException If fail to call the API , e . g . server error or cannot deserialize the response body */ public ApiSuccessResponse getWorkbinContent ( String workbinId , GetWorkbinContentData getWorkbinContentData ) throws ApiException { } }
ApiResponse < ApiSuccessResponse > resp = getWorkbinContentWithHttpInfo ( workbinId , getWorkbinContentData ) ; return resp . getData ( ) ;
public class DeleteResponseUnmarshaller { /** * { @ inheritDoc } */ @ Override public Object unMarshall ( Response < DeleteResponse > response , Class < ? > entity ) { } }
try { consume ( response . getResult ( ) ) ; return statusMessage ; } catch ( Exception e ) { throw new MappingException ( e ) ; }
public class AbstractStructuredRenderer { /** * Converts component dependencies to a human - readable text . * @ param component a component * @ return a non - null list of component names that match those this component needs */ private List < String > getImportComponents ( Component component ) { } }
List < String > result = new ArrayList < > ( ) ; Map < String , Boolean > map = ComponentHelpers . findComponentDependenciesFor ( component ) ; for ( Map . Entry < String , Boolean > entry : map . entrySet ( ) ) { String s = applyLink ( entry . getKey ( ) , entry . getKey ( ) ) ; s += entry . getValue ( ) ? this . messages . get ( "optional" ) : this . messages . get ( "required" ) ; // $ NON - NLS - 1 $ / / $ NON - NLS - 2 $ result . add ( s ) ; } return result ;
public class CmsRadioButtonGroupWidget { /** * Sets the value of the widget . < p > * @ param value the new value */ public void setFormValue ( Object value ) { } }
if ( value == null ) { value = "" ; } if ( value instanceof String ) { String strValue = ( String ) value ; if ( strValue . equals ( "" ) ) { // interpret empty string as " no radio button selected " reset ( ) ; } else { CmsRadioButton button = m_radioButtons . get ( value ) ; m_group . selectButton ( button ) ; } }
public class SeaGlassStyleWrapper { /** * Gets the appropriate background Painter , if there is one , for the state * specified in the given SynthContext . This method does appropriate * fallback searching , as described in # get . * @ param ctx The SynthContext . Must not be null . * @ return The background painter associated for the given state , or null if * none could be found . */ @ SuppressWarnings ( "unchecked" ) public SeaGlassPainter getBackgroundPainter ( SynthContext ctx ) { } }
if ( ! ( style instanceof SeaGlassStyle ) ) { return null ; } return new PainterWrapper ( ( ( SeaGlassStyle ) style ) . getBackgroundPainter ( ctx ) ) ;
public class PdfCopyFieldsImp { /** * Checks if a reference refers to a page object . * @ paramrefthe reference that needs to be checked * @ returntrue is the reference refers to a page object . */ protected boolean isPage ( PRIndirectReference ref ) { } }
IntHashtable refs = ( IntHashtable ) pages2intrefs . get ( ref . getReader ( ) ) ; if ( refs != null ) return refs . containsKey ( ref . getNumber ( ) ) ; else return false ;
public class PlanAssembler { /** * Generate best cost plans for each Subquery expression from the list * @ param subqueryExprs - list of subquery expressions * @ return true if a best plan was generated for each subquery , false otherwise */ private boolean getBestCostPlanForExpressionSubQueries ( Set < AbstractExpression > subqueryExprs ) { } }
int nextPlanId = m_planSelector . m_planId ; for ( AbstractExpression expr : subqueryExprs ) { assert ( expr instanceof SelectSubqueryExpression ) ; if ( ! ( expr instanceof SelectSubqueryExpression ) ) { continue ; // DEAD CODE ? } SelectSubqueryExpression subqueryExpr = ( SelectSubqueryExpression ) expr ; StmtSubqueryScan subqueryScan = subqueryExpr . getSubqueryScan ( ) ; nextPlanId = planForParsedSubquery ( subqueryScan , nextPlanId ) ; CompiledPlan bestPlan = subqueryScan . getBestCostPlan ( ) ; if ( bestPlan == null ) { return false ; } subqueryExpr . setSubqueryNode ( bestPlan . rootPlanGraph ) ; // The subquery plan must not contain Receive / Send nodes because it will be executed // multiple times during the parent statement execution . if ( bestPlan . rootPlanGraph . hasAnyNodeOfType ( PlanNodeType . SEND ) ) { // fail the whole plan m_recentErrorMsg = IN_EXISTS_SCALAR_ERROR_MESSAGE ; return false ; } } // need to reset plan id for the entire SQL m_planSelector . m_planId = nextPlanId ; return true ;
public class TrueTypeFont { /** * Draw a string * @ param x * The x position to draw the string * @ param y * The y position to draw the string * @ param whatchars * The string to draw */ public void drawString ( float x , float y , String whatchars ) { } }
drawString ( x , y , whatchars , org . newdawn . slick . Color . white ) ;
public class Bytes { /** * Converts a byte array to a long value . * @ param bytes array of bytes * @ param offset offset into array * @ param length length of data ( must be { @ link # SIZEOF _ LONG } ) * @ return the long value * @ throws IllegalArgumentException if length is not { @ link # SIZEOF _ LONG } or * if there ' s not enough room in the array at the offset indicated . */ public static long toLong ( byte [ ] bytes , int offset , final int length ) { } }
if ( length != SIZEOF_LONG || offset + length > bytes . length ) { throw explainWrongLengthOrOffset ( bytes , offset , length , SIZEOF_LONG ) ; } long l = 0 ; for ( int i = offset ; i < offset + length ; i ++ ) { l <<= 8 ; l ^= bytes [ i ] & 0xFF ; } return l ;
public class Client { /** * Returns virtual host shovels . * @ return Shovels . */ public List < ShovelStatus > getShovelsStatus ( ) { } }
final URI uri = uriWithPath ( "./shovels/" ) ; return Arrays . asList ( this . rt . getForObject ( uri , ShovelStatus [ ] . class ) ) ;
public class CloudStorageApi { /** * Get the Cloud Storage Provider configuration for the specified user . * Retrieves the list of cloud storage providers enabled for the account and the configuration information for the user . The { serviceId } parameter can be either the service name or serviceId . * @ param accountId The external account number ( int ) or account ID Guid . ( required ) * @ param userId The user ID of the user being accessed . Generally this is the user ID of the authenticated user , but if the authenticated user is an Admin on the account , this may be another user the Admin user is accessing . ( required ) * @ return CloudStorageProviders */ public CloudStorageProviders listProviders ( String accountId , String userId ) throws ApiException { } }
return listProviders ( accountId , userId , null ) ;
public class JSON { /** * Mutant factory for constructing an instance with specified { @ link TreeCodec } , * and returning new instance ( or , if there would be no change , this instance ) . */ public JSON with ( TreeCodec c ) { } }
if ( c == _treeCodec ) { return this ; } return _with ( _features , _streamFactory , c , _reader , _writer . with ( c ) , _prettyPrinter ) ;
public class BGZFSplitGuesser { /** * Returns a negative number if it doesn ' t find anything . */ private int guessNextBGZFPos ( int p , int end ) throws IOException { } }
for ( ; ; ) { for ( ; ; ) { in . seek ( p ) ; in . read ( buf . array ( ) , 0 , 4 ) ; int n = buf . getInt ( 0 ) ; if ( n == BGZF_MAGIC ) break ; // Skip ahead a bit more than 1 byte if you can . if ( n >>> 8 == BGZF_MAGIC << 8 >>> 8 ) ++ p ; else if ( n >>> 16 == BGZF_MAGIC << 16 >>> 16 ) p += 2 ; else p += 3 ; if ( p >= end ) return - 1 ; } // Found what looks like a gzip block header : now get XLEN and // search for the BGZF subfield . final int p0 = p ; p += 10 ; in . seek ( p ) ; in . read ( buf . array ( ) , 0 , 2 ) ; p += 2 ; final int xlen = getUShort ( 0 ) ; final int subEnd = p + xlen ; while ( p < subEnd ) { in . read ( buf . array ( ) , 0 , 4 ) ; if ( buf . getInt ( 0 ) != BGZF_MAGIC_SUB ) { p += 4 + getUShort ( 2 ) ; in . seek ( p ) ; continue ; } // Found it : this is close enough to a BGZF block , make it // our guess . return p0 ; } // No luck : look for the next gzip block header . Start right after // where we last saw the identifiers , although we could probably // safely skip further ahead . ( If we find the correct one right // now , the previous block contained 0x1f8b0804 bytes of data : that // seems . . . unlikely . ) p = p0 + 4 ; }
public class WSConfigurationHelperImpl { /** * ( non - Javadoc ) * @ see com . ibm . websphere . config . WSConfigurationHelper # removeDefaultConfiguration ( java . lang . String , java . lang . String ) */ @ Override public boolean removeDefaultConfiguration ( String pid , String id ) throws ConfigUpdateException { } }
return bundleProcessor . removeDefaultConfiguration ( pid , id ) ;
public class GenderRatioProcessor { /** * Prints some basic documentation about this program . */ public static void printDocumentation ( ) { } }
System . out . println ( "********************************************************************" ) ; System . out . println ( "*** Wikidata Toolkit: GenderRatioProcessor" ) ; System . out . println ( "*** " ) ; System . out . println ( "*** This program will download and process dumps from Wikidata." ) ; System . out . println ( "*** It will compute the numbers of articles about humans across" ) ; System . out . println ( "*** Wikimedia projects, and in particular it will count the articles" ) ; System . out . println ( "*** for each sex/gender. Results will be stored in a CSV file." ) ; System . out . println ( "*** See source code for further details." ) ; System . out . println ( "********************************************************************" ) ;
public class DirectBytes { /** * Allocates a new direct byte array . * @ param size The count of the buffer to allocate ( in bytes ) . * @ return The direct buffer . * @ throws IllegalArgumentException If { @ code count } is greater than the maximum allowed count for * an array on the Java heap - { @ code Integer . MAX _ VALUE - 5} */ public static DirectBytes allocate ( int size ) { } }
if ( size > MAX_SIZE ) { throw new IllegalArgumentException ( "size cannot for DirectBytes cannot be greater than " + MAX_SIZE ) ; } return new DirectBytes ( ByteBuffer . allocateDirect ( ( int ) size ) ) ;
public class KeenClient { /** * Adds an event to the default project with no callbacks . * @ see # addEvent ( KeenProject , String , java . util . Map , java . util . Map , KeenCallback ) * @ param eventCollection The name of the collection in which to publish the event . * @ param event A Map that consists of key / value pairs . Keen naming conventions apply ( see * docs ) . Nested Maps and lists are acceptable ( and encouraged ! ) . * @ param keenProperties A Map that consists of key / value pairs to override default properties . * ex : " timestamp " - & gt ; Calendar . getInstance ( ) */ public void addEventAsync ( String eventCollection , Map < String , Object > event , final Map < String , Object > keenProperties ) { } }
addEventAsync ( null , eventCollection , event , keenProperties , null ) ;
public class GoogleCloudStorageImpl { /** * Helper for both listObjectNames and listObjectInfo that executes the actual API calls to get * paginated lists , accumulating the StorageObjects and String prefixes into the params { @ code * listedObjects } and { @ code listedPrefixes } . * @ param bucketName bucket name * @ param objectNamePrefix object name prefix or null if all objects in the bucket are desired * @ param delimiter delimiter to use ( typically " / " ) , otherwise null * @ param includeTrailingDelimiter whether to include prefix objects into the { @ code * listedObjects } * @ param maxResults maximum number of results to return ( total of both { @ code listedObjects } and * { @ code listedPrefixes } ) , unlimited if negative or zero * @ param listedObjects output parameter into which retrieved StorageObjects will be added * @ param listedPrefixes output parameter into which retrieved prefixes will be added */ private void listStorageObjectsAndPrefixes ( String bucketName , String objectNamePrefix , String delimiter , boolean includeTrailingDelimiter , long maxResults , List < StorageObject > listedObjects , List < String > listedPrefixes ) throws IOException { } }
logger . atFine ( ) . log ( "listStorageObjectsAndPrefixes(%s, %s, %s, %s, %d)" , bucketName , objectNamePrefix , delimiter , includeTrailingDelimiter , maxResults ) ; checkArgument ( listedObjects != null && listedObjects . isEmpty ( ) , "Must provide a non-null empty container for listedObjects." ) ; checkArgument ( listedPrefixes != null && listedPrefixes . isEmpty ( ) , "Must provide a non-null empty container for listedPrefixes." ) ; Storage . Objects . List listObject = createListRequest ( bucketName , objectNamePrefix , delimiter , includeTrailingDelimiter , maxResults ) ; String pageToken = null ; do { if ( pageToken != null ) { logger . atFine ( ) . log ( "listStorageObjectsAndPrefixes: next page %s" , pageToken ) ; listObject . setPageToken ( pageToken ) ; } pageToken = listStorageObjectsAndPrefixesPage ( listObject , maxResults , listedObjects , listedPrefixes ) ; } while ( pageToken != null && getMaxRemainingResults ( maxResults , listedPrefixes , listedObjects ) > 0 ) ;
public class BaseForeignCollection { /** * Add the collection of elements to this collection . This will also them to the associated database table . * @ return Returns true if any of the items did not already exist in the collection otherwise false . */ @ Override public boolean addAll ( Collection < ? extends T > collection ) { } }
boolean changed = false ; for ( T data : collection ) { try { if ( addElement ( data ) ) { changed = true ; } } catch ( SQLException e ) { throw new IllegalStateException ( "Could not create data elements in dao" , e ) ; } } return changed ;
public class LabelsDeserializer { /** * Gson invokes this call - back method during deserialization when it encounters a field of the specified type . * @ param element The Json data being deserialized * @ param type The type of the Object to deserialize to * @ param context The JSON deserialization context * @ return The labels */ @ Override public Collection < Label > deserialize ( JsonElement element , Type type , JsonDeserializationContext context ) throws JsonParseException { } }
JsonObject obj = element . getAsJsonObject ( ) ; JsonArray labels = obj . getAsJsonArray ( "labels" ) ; List < Label > values = new ArrayList < Label > ( ) ; if ( labels != null && labels . isJsonArray ( ) ) { for ( JsonElement label : labels ) values . add ( gson . fromJson ( label , Label . class ) ) ; } return values ;
public class DistributedLogSession { /** * Handles a cluster event . */ private void handleClusterEvent ( ClusterMembershipEvent event ) { } }
PrimaryTerm term = this . term ; if ( term != null && event . type ( ) == ClusterMembershipEvent . Type . MEMBER_REMOVED && event . subject ( ) . id ( ) . equals ( term . primary ( ) . memberId ( ) ) ) { changeState ( PrimitiveState . SUSPENDED ) ; }
public class IntervalHistogram { /** * The starting point of interval that contains the smallest value added to * this histogram . */ public long getMin ( ) { } }
for ( int i = 0 ; i < hits . length ( ) ; i ++ ) { if ( hits . get ( i ) > 0 ) { return i == 0 ? 0 : 1 + bins [ i - 1 ] ; } } return 0 ;
public class UpdateGatewayResponseResult { /** * Response templates of the < a > GatewayResponse < / a > as a string - to - string map of key - value pairs . * @ param responseTemplates * Response templates of the < a > GatewayResponse < / a > as a string - to - string map of key - value pairs . * @ return Returns a reference to this object so that method calls can be chained together . */ public UpdateGatewayResponseResult withResponseTemplates ( java . util . Map < String , String > responseTemplates ) { } }
setResponseTemplates ( responseTemplates ) ; return this ;
public class ShrinkWrapFileSystemProvider { /** * { @ inheritDoc } * @ see java . nio . file . spi . FileSystemProvider # checkAccess ( java . nio . file . Path , java . nio . file . AccessMode [ ] ) */ @ Override public void checkAccess ( final Path path , final AccessMode ... modes ) throws IOException { } }
// We support READ , WRITE , and EXECUTE on everything , so long as a file exists final Archive < ? > archive = this . getArchive ( path ) ; final String desired = path . toString ( ) ; if ( ! archive . contains ( desired ) ) { throw new NoSuchFileException ( desired ) ; }
public class CmsGalleryDialog { /** * Updates the dialog size according to the requirements of the selected tab . < p > * @ param tab the selected tab */ public void updateSizeForTab ( A_CmsTab tab ) { } }
if ( tab == m_resultsTab ) { m_resultsTab . updateListSize ( ) ; } if ( ! m_previewVisible ) { int height = tab . getRequiredHeight ( ) + 42 ; int availableHeight = CmsToolbarPopup . getAvailableHeight ( ) ; setDialogSize ( m_width , height < availableHeight ? height : availableHeight ) ; tab . onResize ( ) ; }
public class UpdateByPrimaryKeySelectiveForceProvider { /** * 判断自动 ! = null的条件结构 * @ param entityName * @ param column * @ param contents * @ param empty * @ return */ public String getIfNotNull ( String entityName , EntityColumn column , String contents , boolean empty ) { } }
StringBuilder sql = new StringBuilder ( ) ; sql . append ( "<choose>" ) ; sql . append ( "<when test=\"" ) ; if ( StringUtil . isNotEmpty ( entityName ) ) { sql . append ( entityName ) . append ( "." ) ; } sql . append ( column . getProperty ( ) ) . append ( " != null" ) ; if ( empty && column . getJavaType ( ) . equals ( String . class ) ) { sql . append ( " and " ) ; if ( StringUtil . isNotEmpty ( entityName ) ) { sql . append ( entityName ) . append ( "." ) ; } sql . append ( column . getProperty ( ) ) . append ( " != '' " ) ; } sql . append ( "\">" ) ; sql . append ( contents ) ; sql . append ( "</when>" ) ; // 指定的字段会被强制更新 sql . append ( "<when test=\"" ) ; sql . append ( FORCE_UPDATE_PROPERTIES ) . append ( " != null and " ) . append ( FORCE_UPDATE_PROPERTIES ) . append ( ".contains('" ) ; sql . append ( column . getProperty ( ) ) ; sql . append ( "')\">" ) ; sql . append ( contents ) ; sql . append ( "</when>" ) ; sql . append ( "<otherwise></otherwise>" ) ; sql . append ( "</choose>" ) ; return sql . toString ( ) ;
public class PersistentUserManagedEhcache { /** * { @ inheritDoc } */ @ Override public void destroy ( ) throws CachePersistenceException { } }
StatusTransitioner . Transition st = statusTransitioner . maintenance ( ) ; try { st . succeeded ( ) ; } catch ( Throwable t ) { throw st . failed ( t ) ; } destroyInternal ( ) ; // Exit maintenance mode once # 934 is solved // statusTransitioner . exitMaintenance ( ) . succeeded ( ) ;
public class Partitioner { /** * Create a List of Partition objects of the specified size , which span the * date range specified . * @ param size of Partitions to create * @ param start Date of beginning of time range to cover * @ param end Date of end of time range to cover * @ return List of Partitions spanning start and end , sized size , in date - * ascending order . */ public List < Partition < T > > getRange ( PartitionSize size , Date start , Date end ) { } }
// logDates ( " Constructing partitions Size ( " + size . name ( ) + " ) " , start , end ) ; // Date origStart = new Date ( start . getTime ( ) ) ; List < Partition < T > > partitions = new ArrayList < Partition < T > > ( ) ; Calendar cStart = Calendar . getInstance ( TZ_UTC ) ; cStart . setTime ( start ) ; size . alignStart ( cStart ) ; // logDates ( " AlignedStart ( " + size . name ( ) + " ) " , origStart , cStart . getTime ( ) ) ; Calendar cEnd = size . increment ( cStart , 1 ) ; // logDates ( " AlignedEnd ( " + size . name ( ) + " ) " , cStart . getTime ( ) , cEnd . getTime ( ) ) ; while ( cStart . getTime ( ) . compareTo ( end ) < 0 ) { partitions . add ( new Partition < T > ( cStart . getTime ( ) , cEnd . getTime ( ) ) ) ; cStart = cEnd ; cEnd = size . increment ( cStart , 1 ) ; // logDates ( " Incremented ( " + size . name ( ) + " ) " , // cStart . getTime ( ) , cEnd . getTime ( ) ) ; } return partitions ;
public class ScanDynamicStoreAdapter { /** * 扫描更新回调函数 */ public static void scanUpdateCallbacks ( ScanStaticModel scanModel , Registry registry ) { } }
// 扫描出来 ScanDynamicModel scanDynamicModel = analysis4DisconfUpdate ( scanModel , registry ) ; // 写到仓库中 transformUpdateService ( scanDynamicModel . getDisconfUpdateServiceInverseIndexMap ( ) ) ; transformPipelineService ( scanDynamicModel . getDisconfUpdatePipeline ( ) ) ;
public class J4pClientBuilder { /** * Parse proxy specification and return a proxy object representing the proxy configuration . * @ param spec specification of for a proxy * @ return proxy object or null if none is set */ static Proxy parseProxySettings ( String spec ) { } }
try { if ( spec == null || spec . length ( ) == 0 ) { return null ; } return new Proxy ( spec ) ; } catch ( URISyntaxException e ) { return null ; }
public class ApiOvhMe { /** * Get this object properties * REST : GET / me / deposit / { depositId } / payment * @ param depositId [ required ] */ public OvhPayment deposit_depositId_payment_GET ( String depositId ) throws IOException { } }
String qPath = "/me/deposit/{depositId}/payment" ; StringBuilder sb = path ( qPath , depositId ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , OvhPayment . class ) ;
public class BufferedInputStream { /** * Reads bytes from this byte - input stream into the specified byte array , * starting at the given offset . * < p > This method implements the general contract of the corresponding * < code > { @ link InputStream # read ( byte [ ] , int , int ) read } < / code > method of * the < code > { @ link InputStream } < / code > class . As an additional * convenience , it attempts to read as many bytes as possible by repeatedly * invoking the < code > read < / code > method of the underlying stream . This * iterated < code > read < / code > continues until one of the following * conditions becomes true : < ul > * < li > The specified number of bytes have been read , * < li > The < code > read < / code > method of the underlying stream returns * < code > - 1 < / code > , indicating end - of - file , or * < li > The < code > available < / code > method of the underlying stream * returns zero , indicating that further input requests would block . * < / ul > If the first < code > read < / code > on the underlying stream returns * < code > - 1 < / code > to indicate end - of - file then this method returns * < code > - 1 < / code > . Otherwise this method returns the number of bytes * actually read . * < p > Subclasses of this class are encouraged , but not required , to * attempt to read as many bytes as possible in the same fashion . * @ param b destination buffer . * @ param off offset at which to start storing bytes . * @ param len maximum number of bytes to read . * @ return the number of bytes read , or < code > - 1 < / code > if the end of * the stream has been reached . * @ exception IOException if this input stream has been closed by * invoking its { @ link # close ( ) } method , * or an I / O error occurs . */ public synchronized int read ( byte b [ ] , int off , int len ) throws IOException { } }
getBufIfOpen ( ) ; // Check for closed stream if ( ( off | len | ( off + len ) | ( b . length - ( off + len ) ) ) < 0 ) { throw new IndexOutOfBoundsException ( ) ; } else if ( len == 0 ) { return 0 ; } int n = 0 ; for ( ; ; ) { int nread = read1 ( b , off + n , len - n ) ; if ( nread <= 0 ) return ( n == 0 ) ? nread : n ; n += nread ; if ( n >= len ) return n ; // if not closed but no bytes available , return InputStream input = in ; if ( input != null && input . available ( ) <= 0 ) return n ; }
public class HtmlDocletWriter { /** * Return the link to the given package . * @ param pkg the package to link to . * @ param label the label for the link . * @ return a content tree for the package link . */ public Content getPackageLink ( PackageDoc pkg , String label ) { } }
return getPackageLink ( pkg , new StringContent ( label ) ) ;
public class Triangle3f { /** * { @ inheritDoc } */ @ Override public Vector3f getNormal ( ) { } }
Vector3f v = null ; if ( this . normal != null ) { v = this . normal . get ( ) ; } if ( v == null ) { v = new Vector3f ( ) ; FunctionalVector3D . crossProduct ( this . p2 . getX ( ) - this . p1 . getX ( ) , this . p2 . getY ( ) - this . p1 . getY ( ) , this . p2 . getZ ( ) - this . p1 . getZ ( ) , this . p3 . getX ( ) - this . p1 . getX ( ) , this . p3 . getY ( ) - this . p1 . getY ( ) , this . p3 . getZ ( ) - this . p1 . getZ ( ) , v ) ; v . normalize ( ) ; this . normal = new SoftReference < > ( v ) ; } return v ;
public class MessageFilterLexer { /** * $ ANTLR start " OCTAL _ ESC " */ public final void mOCTAL_ESC ( ) throws RecognitionException { } }
try { // MessageFilter . g : 232:5 : ( ' \ \ \ \ ' ( ' 0 ' . . ' 3 ' ) ( ' 0 ' . . ' 7 ' ) ( ' 0 ' . . ' 7 ' ) | ' \ \ \ \ ' ( ' 0 ' . . ' 7 ' ) ( ' 0 ' . . ' 7 ' ) | ' \ \ \ \ ' ( ' 0 ' . . ' 7 ' ) ) int alt18 = 3 ; int LA18_0 = input . LA ( 1 ) ; if ( ( LA18_0 == '\\' ) ) { int LA18_1 = input . LA ( 2 ) ; if ( ( ( LA18_1 >= '0' && LA18_1 <= '3' ) ) ) { int LA18_2 = input . LA ( 3 ) ; if ( ( ( LA18_2 >= '0' && LA18_2 <= '7' ) ) ) { int LA18_4 = input . LA ( 4 ) ; if ( ( ( LA18_4 >= '0' && LA18_4 <= '7' ) ) ) { alt18 = 1 ; } else { alt18 = 2 ; } } else { alt18 = 3 ; } } else if ( ( ( LA18_1 >= '4' && LA18_1 <= '7' ) ) ) { int LA18_3 = input . LA ( 3 ) ; if ( ( ( LA18_3 >= '0' && LA18_3 <= '7' ) ) ) { alt18 = 2 ; } else { alt18 = 3 ; } } else { NoViableAltException nvae = new NoViableAltException ( "" , 18 , 1 , input ) ; throw nvae ; } } else { NoViableAltException nvae = new NoViableAltException ( "" , 18 , 0 , input ) ; throw nvae ; } switch ( alt18 ) { case 1 : // MessageFilter . g : 232:9 : ' \ \ \ \ ' ( ' 0 ' . . ' 3 ' ) ( ' 0 ' . . ' 7 ' ) ( ' 0 ' . . ' 7 ' ) { match ( '\\' ) ; if ( ( input . LA ( 1 ) >= '0' && input . LA ( 1 ) <= '3' ) ) { input . consume ( ) ; } else { MismatchedSetException mse = new MismatchedSetException ( null , input ) ; recover ( mse ) ; throw mse ; } if ( ( input . LA ( 1 ) >= '0' && input . LA ( 1 ) <= '7' ) ) { input . consume ( ) ; } else { MismatchedSetException mse = new MismatchedSetException ( null , input ) ; recover ( mse ) ; throw mse ; } if ( ( input . LA ( 1 ) >= '0' && input . LA ( 1 ) <= '7' ) ) { input . consume ( ) ; } else { MismatchedSetException mse = new MismatchedSetException ( null , input ) ; recover ( mse ) ; throw mse ; } } break ; case 2 : // MessageFilter . g : 233:9 : ' \ \ \ \ ' ( ' 0 ' . . ' 7 ' ) ( ' 0 ' . . ' 7 ' ) { match ( '\\' ) ; if ( ( input . LA ( 1 ) >= '0' && input . LA ( 1 ) <= '7' ) ) { input . consume ( ) ; } else { MismatchedSetException mse = new MismatchedSetException ( null , input ) ; recover ( mse ) ; throw mse ; } if ( ( input . LA ( 1 ) >= '0' && input . LA ( 1 ) <= '7' ) ) { input . consume ( ) ; } else { MismatchedSetException mse = new MismatchedSetException ( null , input ) ; recover ( mse ) ; throw mse ; } } break ; case 3 : // MessageFilter . g : 234:9 : ' \ \ \ \ ' ( ' 0 ' . . ' 7 ' ) { match ( '\\' ) ; if ( ( input . LA ( 1 ) >= '0' && input . LA ( 1 ) <= '7' ) ) { input . consume ( ) ; } else { MismatchedSetException mse = new MismatchedSetException ( null , input ) ; recover ( mse ) ; throw mse ; } } break ; } } finally { // do for sure before leaving }
public class JSONObject { /** * Get an optional int value associated with a key , or the default if there * is no such key or if the value is not a number . If the value is a string , * an attempt will be made to evaluate it as a number . * @ param key * A key string . * @ param defaultValue * The default . * @ return An object which is the value . */ public int optInt ( String key , int defaultValue ) { } }
final Number val = this . optNumber ( key , null ) ; if ( val == null ) { return defaultValue ; } return val . intValue ( ) ;
public class CommerceAccountUserRelLocalServiceBaseImpl { /** * Creates a new commerce account user rel with the primary key . Does not add the commerce account user rel to the database . * @ param commerceAccountUserRelPK the primary key for the new commerce account user rel * @ return the new commerce account user rel */ @ Override @ Transactional ( enabled = false ) public CommerceAccountUserRel createCommerceAccountUserRel ( CommerceAccountUserRelPK commerceAccountUserRelPK ) { } }
return commerceAccountUserRelPersistence . create ( commerceAccountUserRelPK ) ;
public class ICUNotifier { /** * Queue a notification on the notification thread for the current * listeners . When the thread unqueues the notification , notifyListener * is called on each listener from the notification thread . */ public void notifyChanged ( ) { } }
if ( listeners != null ) { synchronized ( notifyLock ) { if ( listeners != null ) { if ( notifyThread == null ) { notifyThread = new NotifyThread ( this ) ; notifyThread . setDaemon ( true ) ; notifyThread . start ( ) ; } notifyThread . queue ( listeners . toArray ( new EventListener [ listeners . size ( ) ] ) ) ; } } }
public class MultiPointCrossover { /** * Package private for testing purpose . */ static < T > void crossover ( final MSeq < T > that , final MSeq < T > other , final int [ ] indexes ) { } }
for ( int i = 0 ; i < indexes . length - 1 ; i += 2 ) { final int start = indexes [ i ] ; final int end = indexes [ i + 1 ] ; that . swap ( start , end , other , start ) ; } if ( indexes . length % 2 == 1 ) { final int index = indexes [ indexes . length - 1 ] ; that . swap ( index , min ( that . length ( ) , other . length ( ) ) , other , index ) ; }
public class Journaler { /** * Delegate to the JournalWorker . */ public String [ ] getNextPID ( Context context , int numPIDs , String namespace ) throws ServerException { } }
return worker . getNextPID ( context , numPIDs , namespace ) ;
public class ByteConverter { /** * Encodes a int value to the byte array . * @ param target The byte array to encode to . * @ param idx The starting index in the byte array . * @ param value The value to encode . */ public static void float8 ( byte [ ] target , int idx , double value ) { } }
int8 ( target , idx , Double . doubleToRawLongBits ( value ) ) ;
public class StorageAccountsInner { /** * Returns the properties for the specified storage account including but not limited to name , SKU name , location , and account status . The ListKeys operation should be used to retrieve storage keys . * @ param resourceGroupName The name of the resource group within the user ' s subscription . The name is case insensitive . * @ param accountName The name of the storage account within the specified resource group . Storage account names must be between 3 and 24 characters in length and use numbers and lower - case letters only . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the StorageAccountInner object */ public Observable < StorageAccountInner > getByResourceGroupAsync ( String resourceGroupName , String accountName ) { } }
return getByResourceGroupWithServiceResponseAsync ( resourceGroupName , accountName ) . map ( new Func1 < ServiceResponse < StorageAccountInner > , StorageAccountInner > ( ) { @ Override public StorageAccountInner call ( ServiceResponse < StorageAccountInner > response ) { return response . body ( ) ; } } ) ;
public class PDF417ScanningDecoder { /** * Verify that all is OK with the codeword array . */ private static void verifyCodewordCount ( int [ ] codewords , int numECCodewords ) throws FormatException { } }
if ( codewords . length < 4 ) { // Codeword array size should be at least 4 allowing for // Count CW , At least one Data CW , Error Correction CW , Error Correction CW throw FormatException . getFormatInstance ( ) ; } // The first codeword , the Symbol Length Descriptor , shall always encode the total number of data // codewords in the symbol , including the Symbol Length Descriptor itself , data codewords and pad // codewords , but excluding the number of error correction codewords . int numberOfCodewords = codewords [ 0 ] ; if ( numberOfCodewords > codewords . length ) { throw FormatException . getFormatInstance ( ) ; } if ( numberOfCodewords == 0 ) { // Reset to the length of the array - 8 ( Allow for at least level 3 Error Correction ( 8 Error Codewords ) if ( numECCodewords < codewords . length ) { codewords [ 0 ] = codewords . length - numECCodewords ; } else { throw FormatException . getFormatInstance ( ) ; } }
public class DeploymentDescriptorIO { /** * Reads XML data from given input stream and produces valid instance of * < code > DeploymentDescriptor < / code > * @ param inputStream input stream that comes with xml data of the descriptor * @ return instance of the descriptor after deserialization */ public static DeploymentDescriptor fromXml ( InputStream inputStream ) { } }
try { Unmarshaller unmarshaller = getContext ( ) . createUnmarshaller ( ) ; unmarshaller . setSchema ( schema ) ; DeploymentDescriptor descriptor = ( DeploymentDescriptor ) unmarshaller . unmarshal ( inputStream ) ; return descriptor ; } catch ( Exception e ) { throw new RuntimeException ( "Unable to read deployment descriptor from xml" , e ) ; }
public class BeatGrid { /** * Get the raw bytes of the beat grid as it was read over the network . This can be used to analyze fields * that have not yet been reliably understood , and is also used for storing the beat grid in a cache file . * This is not available when the beat grid was loaded by Crate Digger . * @ return the bytes that make up the beat grid */ @ SuppressWarnings ( "WeakerAccess" ) public ByteBuffer getRawData ( ) { } }
if ( rawData != null ) { rawData . rewind ( ) ; return rawData . slice ( ) ; } return null ;
public class CmsContentEditor { /** * Saves a value in an Xml content . < p > * @ param contentId the structure id of the content * @ param contentPath the xpath for which to set the value * @ param locale the locale for which to set the value * @ param value the new value * @ param asyncCallback the callback for the result */ public void saveValue ( final String contentId , final String contentPath , final String locale , final String value , final AsyncCallback < String > asyncCallback ) { } }
CmsRpcAction < String > action = new CmsRpcAction < String > ( ) { @ Override public void execute ( ) { start ( 0 , false ) ; getService ( ) . saveValue ( contentId , contentPath , locale , value , this ) ; } @ Override protected void onResponse ( String result ) { stop ( false ) ; asyncCallback . onSuccess ( result ) ; } } ; action . execute ( ) ;
public class DescribeProvisionedProductRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( DescribeProvisionedProductRequest describeProvisionedProductRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( describeProvisionedProductRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( describeProvisionedProductRequest . getAcceptLanguage ( ) , ACCEPTLANGUAGE_BINDING ) ; protocolMarshaller . marshall ( describeProvisionedProductRequest . getId ( ) , ID_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class XImportDeclarationImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public void setMemberName ( String newMemberName ) { } }
String oldMemberName = memberName ; memberName = newMemberName ; if ( eNotificationRequired ( ) ) eNotify ( new ENotificationImpl ( this , Notification . SET , XtypePackage . XIMPORT_DECLARATION__MEMBER_NAME , oldMemberName , memberName ) ) ;
public class LPPrimalDualMethod { /** * Inequality functions values at X . * This is ( - x + lb ) for all bounded lb and ( x - ub ) for all bounded ub . */ @ Override protected DoubleMatrix1D getFi ( DoubleMatrix1D X ) { } }
double [ ] ret = new double [ getMieq ( ) ] ; for ( int i = 0 ; i < getDim ( ) ; i ++ ) { ret [ i ] = - X . getQuick ( i ) + getLb ( ) . getQuick ( i ) ; ret [ getDim ( ) + i ] = X . getQuick ( i ) - getUb ( ) . getQuick ( i ) ; } return F1 . make ( ret ) ;
public class ListELResolver { /** * If the base object is a list , returns the value at the given index . The index is specified by * the property argument , and coerced into an integer . If the coercion could not be performed , * an IllegalArgumentException is thrown . If the index is out of bounds , null is returned . If * the base is a List , the propertyResolved property of the ELContext object must be set to true * by this resolver , before returning . If this property is not true after this method is called , * the caller should ignore the return value . * @ param context * The context of this evaluation . * @ param base * The list to analyze . Only bases of type List are handled by this resolver . * @ param property * The index of the element in the list to return the acceptable type for . Will be * coerced into an integer , but otherwise ignored by this resolver . * @ return If the propertyResolved property of ELContext was set to true , then the value at the * given index or null if the index was out of bounds . Otherwise , undefined . * @ throws PropertyNotFoundException * if the given index is out of bounds for this list . * @ throws IllegalArgumentException * if the property could not be coerced into an integer . * @ throws NullPointerException * if context is null * @ throws ELException * if an exception was thrown while performing the property or variable resolution . * The thrown exception must be included as the cause property of this exception , if * available . */ @ Override public Object getValue ( ELContext context , Object base , Object property ) { } }
if ( context == null ) { throw new NullPointerException ( "context is null" ) ; } Object result = null ; if ( isResolvable ( base ) ) { int index = toIndex ( null , property ) ; List < ? > list = ( List < ? > ) base ; result = index < 0 || index >= list . size ( ) ? null : list . get ( index ) ; context . setPropertyResolved ( true ) ; } return result ;
public class Kim { /** * Get a byte from a kim . * @ param at * The position of the byte . The first byte is at 0. * @ return The byte . * @ throws JSONException * if there is no byte at that position . */ public int get ( int at ) throws JSONException { } }
if ( at < 0 || at > this . length ) { throw new JSONException ( "Bad character at " + at ) ; } return ( ( int ) this . bytes [ at ] ) & 0xFF ;
public class WebAppSecurityConfigImpl { /** * { @ inheritDoc } < p > * This method needs to be maintained when new attributes are added . * Order should be presented in alphabetical order . */ @ Override public Map < String , String > getChangedPropertiesMap ( WebAppSecurityConfig original ) { } }
// Bail out if it is the same object , or if this isn ' t of the right type . if ( this == original ) { return null ; } if ( ! ( original instanceof WebAppSecurityConfigImpl ) ) { return null ; } TreeMap < String , String > output = new TreeMap < String , String > ( ) ; WebAppSecurityConfigImpl orig = ( WebAppSecurityConfigImpl ) original ; for ( Entry < String , String > entry : configAttributes . entrySet ( ) ) { try { Field field = ( WebAppSecurityConfigImpl . class ) . getDeclaredField ( entry . getValue ( ) ) ; field . setAccessible ( true ) ; appendToMapIfDifferent ( output , entry . getKey ( ) , field . get ( this ) , field . get ( orig ) ) ; } catch ( Exception e ) { // this won ' t happen . just ignore . if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Exception is caught " + e ) ; } } } if ( output . isEmpty ( ) ) { output = null ; } return output ;
public class EvaluateVarianceRatioCriteria { /** * Evaluate a single clustering . * @ param db Database * @ param rel Data relation * @ param c Clustering * @ return Variance Ratio Criteria */ public double evaluateClustering ( Database db , Relation < ? extends NumberVector > rel , Clustering < ? > c ) { } }
// FIXME : allow using a precomputed distance matrix ! final SquaredEuclideanDistanceFunction df = SquaredEuclideanDistanceFunction . STATIC ; List < ? extends Cluster < ? > > clusters = c . getAllClusters ( ) ; double vrc = 0. ; int ignorednoise = 0 ; if ( clusters . size ( ) > 1 ) { NumberVector [ ] centroids = new NumberVector [ clusters . size ( ) ] ; ignorednoise = EvaluateSimplifiedSilhouette . centroids ( rel , clusters , centroids , noiseOption ) ; // Build global centroid and cluster count : final int dim = RelationUtil . dimensionality ( rel ) ; Centroid overallCentroid = new Centroid ( dim ) ; int clustercount = globalCentroid ( overallCentroid , rel , clusters , centroids , noiseOption ) ; // a : Distance to own centroid // b : Distance to overall centroid double a = 0 , b = 0 ; Iterator < ? extends Cluster < ? > > ci = clusters . iterator ( ) ; for ( int i = 0 ; ci . hasNext ( ) ; i ++ ) { Cluster < ? > cluster = ci . next ( ) ; if ( cluster . size ( ) <= 1 || cluster . isNoise ( ) ) { switch ( noiseOption ) { case IGNORE_NOISE : continue ; // Ignored case TREAT_NOISE_AS_SINGLETONS : // Singletons : a = 0 by definition . for ( DBIDIter it = cluster . getIDs ( ) . iter ( ) ; it . valid ( ) ; it . advance ( ) ) { b += df . distance ( overallCentroid , rel . get ( it ) ) ; } continue ; // with NEXT cluster . case MERGE_NOISE : break ; // Treat like a cluster below : } } for ( DBIDIter it = cluster . getIDs ( ) . iter ( ) ; it . valid ( ) ; it . advance ( ) ) { NumberVector vec = rel . get ( it ) ; a += df . distance ( centroids [ i ] , vec ) ; b += df . distance ( overallCentroid , vec ) ; } } vrc = ( ( b - a ) / a ) * ( ( rel . size ( ) - clustercount ) / ( clustercount - 1. ) ) ; // Only if { @ link NoiseHandling # IGNORE _ NOISE } : if ( penalize && ignorednoise > 0 ) { vrc *= ( rel . size ( ) - ignorednoise ) / ( double ) rel . size ( ) ; } } if ( LOG . isStatistics ( ) ) { LOG . statistics ( new StringStatistic ( key + ".vrc.noise-handling" , noiseOption . toString ( ) ) ) ; if ( ignorednoise > 0 ) { LOG . statistics ( new LongStatistic ( key + ".vrc.ignored" , ignorednoise ) ) ; } LOG . statistics ( new DoubleStatistic ( key + ".vrc" , vrc ) ) ; } EvaluationResult ev = EvaluationResult . findOrCreate ( db . getHierarchy ( ) , c , "Internal Clustering Evaluation" , "internal evaluation" ) ; MeasurementGroup g = ev . findOrCreateGroup ( "Distance-based Evaluation" ) ; g . addMeasure ( "Variance Ratio Criteria" , vrc , 0. , 1. , 0. , false ) ; return vrc ;
public class CobolTypeFinder { /** * Lookup for the signature of a Cobol type . * Attempts at finding the type one byte at a time delegating the matching * to specialized classes . * @ param hostData the incoming host data where the matching type might * appear * @ param start where to start looking in the incoming host data * @ param length where to stop looking in the incoming host data * @ return the position of the match or - 1 if there is no match */ public int indexOf ( byte [ ] hostData , int start , int length ) { } }
int pos = start ; while ( length - pos >= getSignatureLen ( ) ) { if ( match ( hostData , pos , length ) ) { return pos ; } pos ++ ; } return - 1 ;
public class NativeMethodHelper { /** * Register native methods from the core DLL for the specified class and drive the * registration hooks . * @ param clazz the class to link native methods for * @ param nativeDescriptorName the name of the exported { @ code NativeMethodDescriptor } structure * @ param extra information provided to the registration callback by the caller * @ throws UnsatisfiedLinkError if an error occurs during resolution or registration * @ return the native DLL handle reference for this class or the error return code */ public static long registerNatives ( Class < ? > clazz , String nativeDescriptorName , Object [ ] extraInfo ) { } }
if ( ! initialized ) { if ( loadFailure != null ) { Error e = new UnsatisfiedLinkError ( ) ; e . initCause ( loadFailure ) ; throw e ; } else { return 0 ; } } return ntv_registerNatives ( clazz , nativeDescriptorName , extraInfo ) ;
public class Math { /** * Find the third quantile ( p = 3/4 ) of an array of type double . The input array will * be rearranged . */ public static < T extends Comparable < ? super T > > T q3 ( T [ ] a ) { } }
return QuickSelect . q3 ( a ) ;
public class Utils { /** * Closes a prepared statement . * @ param ps * @ param logger */ public static void closeStatement ( PreparedStatement ps , Logger logger ) { } }
try { if ( ps != null ) ps . close ( ) ; } catch ( SQLException e ) { // Not important . Utils . logException ( logger , e ) ; }
public class SharedPreferencesCollector { /** * Checks if the key matches one of the patterns provided by the developer * to exclude some preferences from reports . * @ param key the name of the preference to be checked * @ return true if the key has to be excluded from reports . */ private boolean filteredKey ( @ NonNull CoreConfiguration config , @ NonNull String key ) { } }
for ( String regex : config . excludeMatchingSharedPreferencesKeys ( ) ) { if ( key . matches ( regex ) ) { return true ; } } return false ;
public class GetterFactory { /** * Search getter for given class and property name . * @ param type Class * @ param name Property name * @ return Getter or null if not found */ @ SuppressWarnings ( "unchecked" ) public static Getter getGetter ( Class type , String name ) { } }
return getGettersAsMap ( type ) . get ( name ) ;
public class CmsCheckableDatePanel { /** * Set dates with the provided check states . * @ param datesWithCheckInfo the dates to set , accompanied with the check state to set . */ public void setDatesWithCheckState ( Collection < CmsPair < Date , Boolean > > datesWithCheckInfo ) { } }
SortedSet < Date > dates = new TreeSet < > ( ) ; m_checkBoxes . clear ( ) ; for ( CmsPair < Date , Boolean > p : datesWithCheckInfo ) { addCheckBox ( p . getFirst ( ) , p . getSecond ( ) . booleanValue ( ) ) ; dates . add ( p . getFirst ( ) ) ; } reInitLayoutElements ( ) ; setDatesInternal ( dates ) ;
public class JmsJcaActivationSpecImpl { /** * ( non - Javadoc ) * @ see com . ibm . ws . sib . api . jmsra . JmsJcaActivationSpec # setSubscriptionDurability ( java . lang . String ) */ @ Override public void setSubscriptionDurability ( final String subscriptionDurability ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isDebugEnabled ( ) ) { SibTr . debug ( this , TRACE , "setSubscriptionDurability" , subscriptionDurability ) ; } _subscriptionDurability = subscriptionDurability ;
public class SAXParseException { /** * Internal initialization method . * @ param publicId The public identifier of the entity which generated the exception , * or null . * @ param systemId The system identifier of the entity which generated the exception , * or null . * @ param lineNumber The line number of the error , or - 1. * @ param columnNumber The column number of the error , or - 1. */ private void init ( String publicId , String systemId , int lineNumber , int columnNumber ) { } }
this . publicId = publicId ; this . systemId = systemId ; this . lineNumber = lineNumber ; this . columnNumber = columnNumber ;
public class BatcherBuilder { /** * Builds a { @ link Batcher } which will provide batches to the provided { @ code listener } . * Note : The builder is required to have either a time or size bound to build a batch . */ public < T > Batcher < T > build ( BatchListener < T > listener ) { } }
requireNonNull ( listener ) ; checkState ( maxSize != UNSET_INT || interval != UNSET_INT , "All batchers are required to have either a time or size bound." ) ; ExecutorService handler = ( listenerService == null ? newCachedThreadPool ( ) : listenerService ) ; BlockingQueue < T > backingQueue = ( maxBufferSize == UNSET_INT ? new LinkedBlockingQueue < T > ( ) : new ArrayBlockingQueue < T > ( maxBufferSize ) ) ; if ( maxSize != UNSET_INT && interval != UNSET_INT ) { return new TimeOrSizeBatcher < > ( backingQueue , listener , handler , maxSize , interval ) . start ( ) ; } else if ( maxSize != UNSET_INT ) { return new SizeBatcher < > ( backingQueue , listener , handler , maxSize ) . start ( ) ; } else { return new TimeBatcher < > ( backingQueue , listener , handler , interval ) . start ( ) ; }
public class ElementCollectionCacheManager { /** * Gets the last element collection object count . * @ param rowKey * the row key * @ return the last element collection object count */ public int getLastElementCollectionObjectCount ( Object rowKey ) { } }
if ( getElementCollectionCache ( ) . get ( rowKey ) == null ) { log . debug ( "No element collection object map found in cache for Row key " + rowKey ) ; return - 1 ; } else { Map < Object , String > elementCollectionMap = getElementCollectionCache ( ) . get ( rowKey ) ; Collection < String > elementCollectionObjectNames = elementCollectionMap . values ( ) ; int max = 0 ; for ( String s : elementCollectionObjectNames ) { String elementCollectionCountStr = s . substring ( s . indexOf ( Constants . EMBEDDED_COLUMN_NAME_DELIMITER ) + 1 ) ; int elementCollectionCount = 0 ; try { elementCollectionCount = Integer . parseInt ( elementCollectionCountStr ) ; } catch ( NumberFormatException e ) { log . error ( "Invalid element collection Object name " + s ) ; throw new CacheException ( "Invalid element collection Object name " + s , e ) ; } if ( elementCollectionCount > max ) { max = elementCollectionCount ; } } return max ; }
public class SnapshotManagerImpl { /** * / * ( non - Javadoc ) * @ see org . duracloud . snapshot . service . SnapshotManager # updateHistory ( ) */ @ Override @ Transactional public Snapshot updateHistory ( Snapshot snapshot , String history ) { } }
snapshot = this . snapshotRepo . getOne ( snapshot . getId ( ) ) ; SnapshotHistory newHistory = new SnapshotHistory ( ) ; newHistory . setHistory ( history ) ; newHistory . setSnapshot ( snapshot ) ; snapshot . getSnapshotHistory ( ) . add ( newHistory ) ; return this . snapshotRepo . save ( snapshot ) ;
public class SVG { /** * Renders this SVG document to a Canvas object . * @ param canvas the canvas to which the document should be rendered . * @ param renderOptions options that describe how to render this SVG on the Canvas . * @ since 1.3 */ @ SuppressWarnings ( { } }
"WeakerAccess" , "unused" } ) public void renderToCanvas ( Canvas canvas , RenderOptions renderOptions ) { if ( renderOptions == null ) renderOptions = new RenderOptions ( ) ; if ( ! renderOptions . hasViewPort ( ) ) { renderOptions . viewPort ( 0f , 0f , ( float ) canvas . getWidth ( ) , ( float ) canvas . getHeight ( ) ) ; } SVGAndroidRenderer renderer = new SVGAndroidRenderer ( canvas , this . renderDPI ) ; renderer . renderDocument ( this , renderOptions ) ;
public class lbvserver_cmppolicy_binding { /** * Use this API to fetch lbvserver _ cmppolicy _ binding resources of given name . */ public static lbvserver_cmppolicy_binding [ ] get ( nitro_service service , String name ) throws Exception { } }
lbvserver_cmppolicy_binding obj = new lbvserver_cmppolicy_binding ( ) ; obj . set_name ( name ) ; lbvserver_cmppolicy_binding response [ ] = ( lbvserver_cmppolicy_binding [ ] ) obj . get_resources ( service ) ; return response ;
public class VariablesInner { /** * Create a variable . * @ param resourceGroupName Name of an Azure Resource group . * @ param automationAccountName The name of the automation account . * @ param variableName The variable name . * @ param parameters The parameters supplied to the create or update variable operation . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the VariableInner object */ public Observable < VariableInner > createOrUpdateAsync ( String resourceGroupName , String automationAccountName , String variableName , VariableCreateOrUpdateParameters parameters ) { } }
return createOrUpdateWithServiceResponseAsync ( resourceGroupName , automationAccountName , variableName , parameters ) . map ( new Func1 < ServiceResponse < VariableInner > , VariableInner > ( ) { @ Override public VariableInner call ( ServiceResponse < VariableInner > response ) { return response . body ( ) ; } } ) ;
public class ExecutionContext { /** * Returns true if the symbol is null or has not been defined . * @ param name The symbol ' s name * @ return true if null */ public boolean isSymbolNull ( String name ) { } }
CommandSymbol s = findSymbol ( name ) ; if ( s == null ) return true ; if ( s instanceof VarCommand ) { VarCommand var = ( VarCommand ) s ; Value v = var . getValue ( this ) ; if ( v == null || v . get ( ) == null || v instanceof NilValue ) return true ; } return false ;
public class DataIO { /** * Parse a table from a given File . * @ param file * @ param name * @ return a CSTable . * @ throws java . io . IOException */ public static CSTable table ( File file , String name ) throws IOException { } }
return new FileTable ( file , name ) ;
public class RequestUrlEncodedFormBody { /** * Set the body of the request * @ param context context of the request * @ throws FoxHttpRequestException can throw different exception based on input streams and interceptors */ @ Override public void setBody ( FoxHttpRequestBodyContext context ) throws FoxHttpRequestException { } }
String formOutputData = QueryBuilder . buildQuery ( formData ) ; writeBody ( context , formOutputData ) ;
public class CmsModuleImportExportHandler { /** * Writes the messages for finishing an import to the given report . < p > * @ param report the report to write to */ public static void reportEndImport ( I_CmsReport report ) { } }
report . println ( Messages . get ( ) . container ( Messages . RPT_IMPORT_MODULE_END_0 ) , I_CmsReport . FORMAT_HEADLINE ) ;
public class UserDetail { /** * A list of IAM groups that the user is in . * @ param groupList * A list of IAM groups that the user is in . */ public void setGroupList ( java . util . Collection < String > groupList ) { } }
if ( groupList == null ) { this . groupList = null ; return ; } this . groupList = new com . amazonaws . internal . SdkInternalList < String > ( groupList ) ;
public class AfplibFactoryImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public String convertResourceLocalIdentifierResTypeToString ( EDataType eDataType , Object instanceValue ) { } }
return instanceValue == null ? null : instanceValue . toString ( ) ;
public class YamlOrchestrationShardingDataSourceFactory { /** * Create sharding data source . * @ param yamlBytes YAML bytes for rule configuration of databases and tables sharding with data sources * @ return sharding data source * @ throws SQLException SQL exception * @ throws IOException IO exception */ public static DataSource createDataSource ( final byte [ ] yamlBytes ) throws SQLException , IOException { } }
YamlOrchestrationShardingRuleConfiguration config = unmarshal ( yamlBytes ) ; return createDataSource ( config . getDataSources ( ) , config . getShardingRule ( ) , config . getProps ( ) , config . getOrchestration ( ) ) ;
public class ApiOvhDedicatedserver { /** * Get this object properties * REST : GET / dedicated / server / { serviceName } / statistics / raid / { unit } / volume / { volume } / port / { port } * @ param serviceName [ required ] The internal name of your dedicated server * @ param unit [ required ] Raid unit * @ param volume [ required ] Raid volume name * @ param port [ required ] Raid volume port */ public OvhRtmRaidVolumePort serviceName_statistics_raid_unit_volume_volume_port_port_GET ( String serviceName , String unit , String volume , String port ) throws IOException { } }
String qPath = "/dedicated/server/{serviceName}/statistics/raid/{unit}/volume/{volume}/port/{port}" ; StringBuilder sb = path ( qPath , serviceName , unit , volume , port ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , OvhRtmRaidVolumePort . class ) ;
public class IdHelper { /** * Helper method that uses reflection to set the ( inaccessible ) id field of * the given { @ link PersistentObject } . * @ param persistentObject The object with the inaccessible id field * @ param id The id to set * @ throws NoSuchFieldException * @ throws IllegalAccessException */ public static final void setIdOnPersistentObject ( PersistentObject persistentObject , Integer id ) throws NoSuchFieldException , IllegalAccessException { } }
// use reflection to get the inaccessible final field ' id ' Field idField = PersistentObject . class . getDeclaredField ( "id" ) ; // make the field accessible and set the value idField . setAccessible ( true ) ; idField . set ( persistentObject , id ) ; idField . setAccessible ( false ) ;
public class GenericBeanInfo { /** * This method returns an image object that can be used to represent the * bean in toolboxes , toolbars , etc . * @ param iconKind * the kind of requested icon * @ return the icon image */ public Image getIcon ( int iconKind ) { } }
switch ( iconKind ) { case ICON_COLOR_16x16 : return iconColor16 ; case ICON_COLOR_32x32 : return iconColor32 ; case ICON_MONO_16x16 : return iconMono16 ; case ICON_MONO_32x32 : return iconMono32 ; } return null ;
public class StorePackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EClass getOAuthAuthorizationCode ( ) { } }
if ( oAuthAuthorizationCodeEClass == null ) { oAuthAuthorizationCodeEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( StorePackage . eNS_URI ) . getEClassifiers ( ) . get ( 109 ) ; } return oAuthAuthorizationCodeEClass ;