idx
int64
0
41.2k
question
stringlengths
83
4.15k
target
stringlengths
5
715
14,400
public void dropIndex ( final ODatabaseObject db ) { final String name = index . getName ( ) ; logger . info ( "Dropping existing index '{}' (class '{}'), because of definition mismatch" , name , index . getDefinition ( ) . getClassName ( ) ) ; SchemeUtils . dropIndex ( db , name ) ; }
Drops index .
14,401
@ SuppressWarnings ( "PMD.LinguisticNaming" ) public IndexMatchVerifier isIndexSigns ( final Object ... signs ) { final List < Object > idxsigns = Lists . newArrayList ( ) ; idxsigns . add ( index . getType ( ) ) ; idxsigns . addAll ( Arrays . asList ( signs ) ) ; return new IndexMatchVerifier ( idxsigns ) ; }
Compares current index configuration with new signature . Used to decide if index should be dropped and re - created or its completely equal to new signature .
14,402
public static Class < ? extends CobolContext > getInputKeyCobolContext ( Configuration conf ) { return conf . getClass ( CONF_INPUT_KEY_COBOL_CONTEXT , null , CobolContext . class ) ; }
Gets the job input key mainframe COBOL parameters .
14,403
public static void setInputKeyRecordType ( Job job , Class < ? extends CobolComplexType > cobolType ) { job . getConfiguration ( ) . setClass ( CONF_INPUT_KEY_RECORD_TYPE , cobolType , CobolComplexType . class ) ; }
Sets the job input key mainframe record type .
14,404
public static Class < ? extends CobolComplexType > getInputKeyRecordType ( Configuration conf ) { return conf . getClass ( CONF_INPUT_KEY_RECORD_TYPE , null , CobolComplexType . class ) ; }
Gets the job input key mainframe record type .
14,405
public static void setInputRecordMatcher ( Job job , Class < ? extends CobolTypeFinder > matcherClass ) { job . getConfiguration ( ) . setClass ( CONF_INPUT_RECORD_MATCHER_CLASS , matcherClass , CobolTypeFinder . class ) ; }
Sets the job input record matcher class .
14,406
public static Class < ? extends CobolTypeFinder > getInputRecordMatcher ( Configuration conf ) { return conf . getClass ( CONF_INPUT_RECORD_MATCHER_CLASS , null , CobolTypeFinder . class ) ; }
Gets the job input record matcher class .
14,407
public static void setInputChoiceStrategy ( Job job , Class < ? extends FromCobolChoiceStrategy > choiceStrategyClass ) { job . getConfiguration ( ) . setClass ( CONF_INPUT_RECORD_CHOICE_STRATEGY_CLASS , choiceStrategyClass , FromCobolChoiceStrategy . class ) ; }
Sets the job input record choice strategy class .
14,408
public static Class < ? extends FromCobolChoiceStrategy > getInputChoiceStrategy ( Configuration conf ) { return conf . getClass ( CONF_INPUT_RECORD_CHOICE_STRATEGY_CLASS , null , FromCobolChoiceStrategy . class ) ; }
Gets the job input record choice strategy class .
14,409
public int readFully ( byte b [ ] , int off , int len ) throws IOException { IOUtils . readFully ( inStream , b , off , len ) ; return len ; }
Read a number of bytes from the input stream blocking until all requested bytes are read or end of file is reached .
14,410
public int read ( byte b [ ] , int off , int len ) throws IOException { return IOUtils . read ( inStream , b , off , len ) ; }
Same as above but does not throw an exception at end of file just returns the actual data read .
14,411
public void addNamedParam ( final String name , final ParamInfo paramInfo ) { check ( ! named . containsKey ( name ) , "Duplicate parameter %s declaration at position %s" , name , paramInfo . position ) ; named . put ( name , paramInfo ) ; }
Register parameter as named .
14,412
public void addStaticElVarValue ( final String name , final String value ) { check ( ! staticElValues . containsKey ( name ) , "Duplicate el variable %s value declaration: %s (original: %s)" , name , value , staticElValues . get ( name ) ) ; check ( ! dynamicElValues . contains ( name ) , "El variable %s can't be regis...
Register static query el variable value .
14,413
public void addDynamicElVarValue ( final String name ) { check ( ! dynamicElValues . contains ( name ) , "Duplicate dynamic el variable %s declaration" , name ) ; check ( ! staticElValues . containsKey ( name ) , "El variable %s can't be registered as dynamic, because static declaration already defined" , name ) ; dyna...
Register dynamic query el variable value . Variable will be completely handled by extension . Registration is required to validated not handled variables .
14,414
private String generateXmlSchema ( Reader cobolReader , String targetNamespace , String targetXmlSchemaName , final String xsltFileName ) { log . debug ( "XML schema {} generation started" , targetXmlSchemaName + XSD_FILE_EXTENSION ) ; String xmlSchemaSource = cob2xsd . translate ( cobolReader , NamespaceUtils . toName...
Translate the COBOL copybook to XML Schema .
14,415
private Map < String , String > generateConverterClasses ( String xmlSchemaSource , String targetPackageName ) { log . debug ( "Converter support classes generation started" ) ; Map < String , String > codeMap = xsd2CobolTypes . generate ( new StringReader ( xmlSchemaSource ) , targetPackageName ) ; if ( log . isDebugE...
Produce the LegStar converter support classes .
14,416
private String generateAvroSchema ( String xmlSchemaSource , String targetPackageName , String targetAvroSchemaName ) throws IOException { log . debug ( "Avro schema {} generation started" , targetAvroSchemaName + AVSC_FILE_EXTENSION ) ; String avroSchemaSource = cob2AvroTranslator . translate ( new StringReader ( xmlS...
Produce the avro schema .
14,417
private void avroCompile ( String avroSchemaSource , File avroSchemaFile , File javaTargetFolder ) throws IOException { log . debug ( "Avro compiler started for: {}" , avroSchemaFile ) ; Schema . Parser parser = new Schema . Parser ( ) ; Schema schema = parser . parse ( avroSchemaSource ) ; SpecificCompiler compiler = ...
Given an Avro schema produce java specific classes .
14,418
public static TxConfig buildConfig ( final Class < ? > type , final Method method , final boolean useDefaults ) { final Transactional transactional = findAnnotation ( type , method , Transactional . class , useDefaults ) ; TxConfig res = null ; if ( transactional != null ) { final TxType txType = findAnnotation ( type ...
Build transaction config for type .
14,419
private static List < Class < ? extends Exception > > wrapExceptions ( final Class < ? extends Exception > ... list ) { return list . length == 0 ? null : Arrays . asList ( list ) ; }
Avoid creation of empty list .
14,420
public void setTitleGaps ( int gapBetweenIconAndTitle , int gapBetweenTitleAndComponents , int gapBetweenComponents ) { gapBetweenIconAndTitle = Math . max ( gapBetweenIconAndTitle , 0 ) ; gapBetweenTitleAndComponents = Math . max ( gapBetweenTitleAndComponents , 0 ) ; gapBetweenComponents = Math . max ( gapBetweenComp...
Defines the title gaps
14,421
public static void checkExec ( final boolean condition , final String message , final Object ... args ) { if ( ! condition ) { throw new MethodExecutionException ( String . format ( message , args ) ) ; } }
Shortcut to check and throw execution exception .
14,422
public static List < String > findVars ( final String str ) { final List < String > vars = new ArrayList < String > ( ) ; final char [ ] strArray = str . toCharArray ( ) ; int i = 0 ; while ( i < strArray . length - 1 ) { if ( strArray [ i ] == VAR_START && strArray [ i + 1 ] == VAR_LEFT_BOUND ) { i = i + 2 ; final int...
Analyze string for variables .
14,423
public static String replace ( final String str , final Map < String , String > params ) { final StringBuilder sb = new StringBuilder ( str . length ( ) ) ; final char [ ] strArray = str . toCharArray ( ) ; int i = 0 ; while ( i < strArray . length - 1 ) { if ( strArray [ i ] == VAR_START && strArray [ i + 1 ] == VAR_L...
Replace placeholders in string .
14,424
public static void validate ( final String string , final List < String > params ) { final List < String > vars = findVars ( string ) ; for ( String param : params ) { Preconditions . checkState ( vars . contains ( param ) , "Variable '%s' not found in target string '%s'" , param , string ) ; } vars . removeAll ( param...
Validate string variables and declared values for correctness .
14,425
private void expand ( boolean immediately ) { if ( locked == false && inAction == false && collapsed ) { inAction = true ; CollapsiblePanelListener [ ] array = listeners . getListeners ( CollapsiblePanelListener . class ) ; for ( CollapsiblePanelListener cpl : array ) { cpl . panelWillExpand ( new CollapsiblePanelEvent...
Expand the panel .
14,426
public void setReverseLayout ( boolean reverseLayout ) { if ( mPendingSavedState != null && mPendingSavedState . mReverseLayout != reverseLayout ) { mPendingSavedState . mReverseLayout = reverseLayout ; } if ( reverseLayout == mReverseLayout ) { return ; } mReverseLayout = reverseLayout ; requestLayout ( ) ; }
Used to reverse item traversal and layout order . This behaves similar to the layout change for RTL views . When set to true first item is rendered at the end of the UI second item is render before it etc .
14,427
public static void command ( final ODatabaseObject db , final String command , final Object ... args ) { db . command ( new OCommandSQL ( String . format ( command , args ) ) ) . execute ( ) ; }
Calls schema change sql command .
14,428
@ SuppressFBWarnings ( "RV_RETURN_VALUE_IGNORED_NO_SIDE_EFFECT" ) public static void dropIndex ( final ODatabaseObject db , final String indexName ) { db . getMetadata ( ) . getIndexManager ( ) . dropIndex ( indexName ) ; }
Drops named index . Safe to call even if index not exist .
14,429
private void configureCustomTypes ( ) { final Multibinder < OObjectSerializer > typesBinder = Multibinder . newSetBinder ( binder ( ) , OObjectSerializer . class ) ; if ( ! customTypes . isEmpty ( ) ) { for ( Class < ? extends OObjectSerializer > type : customTypes ) { bind ( type ) . in ( Singleton . class ) ; typesBi...
Binds registered custom types as guice singletons and register them with multibinder .
14,430
protected void loadOptionalPool ( final String poolBinder ) { try { final Method bindPool = OrientModule . class . getDeclaredMethod ( "bindPool" , Class . class , Class . class ) ; bindPool . setAccessible ( true ) ; try { Class . forName ( poolBinder ) . getConstructor ( OrientModule . class , Method . class , Binder...
Allows to load pool only if required jars are in classpath . For example no need for graph dependencies if only object db is used .
14,431
@ SuppressWarnings ( "unchecked" ) private static boolean isParametersCompatible ( final List < Class < ? > > params , final List < ParamInfo > ordinalParamInfos ) { boolean resolution = params . size ( ) == ordinalParamInfos . size ( ) ; if ( resolution && ! params . isEmpty ( ) ) { final Iterator < Class < ? > > para...
Checking method parameters compatibility .
14,432
public static ElDescriptor analyzeQuery ( final GenericsContext genericsContext , final String query ) { final List < String > vars = ElUtils . findVars ( query ) ; ElDescriptor descriptor = null ; if ( ! vars . isEmpty ( ) ) { descriptor = new ElDescriptor ( vars ) ; checkGenericVars ( descriptor , genericsContext ) ;...
Analyze query string for variables .
14,433
public static void check ( final boolean condition , final String message , final Object ... args ) { if ( ! condition ) { throw new MethodDefinitionException ( String . format ( message , args ) ) ; } }
Shortcut to check and throw definition exception .
14,434
private static Object jdk8 ( final Class < ? > type , final Object object ) { try { if ( jdk8OptionalFactory == null ) { lookupOptionalFactoryMethod ( type ) ; } return jdk8OptionalFactory . invoke ( null , object ) ; } catch ( Exception e ) { throw new IllegalStateException ( "Failed to instantiate jdk Optional" , e )...
Only this will cause optional class loading and fail for earlier jdk .
14,435
public void setEngineConfigMap ( Map < String , Object > engineConfigMap ) { if ( engineConfigMap != null ) { this . engineConfig . putAll ( engineConfigMap ) ; } }
Set Rythm properties as Map to allow for non - String values like ds . resource . loader . instance .
14,436
public RythmEngine createRythmEngine ( ) throws IOException , RythmException { Map < String , Object > p = new HashMap < String , Object > ( ) ; p . put ( RythmConfigurationKey . ENGINE_PLUGIN_VERSION . getKey ( ) , Version . VALUE ) ; if ( this . configLocation != null ) { logger . info ( "Loading Rythm config from [%...
Prepare the RythmEngine instance and return it .
14,437
private static int getRecordLen ( byte [ ] hostData , int start , int length ) { int len = getRawRdw ( hostData , start , length ) ; if ( len < RDW_LEN || len > hostData . length ) { throw new IllegalArgumentException ( "Record does not start with a Record Descriptor Word" ) ; } return len - RDW_LEN ; }
RDW is a 4 bytes numeric stored in Big Endian as a binary 2 s complement .
14,438
public String translate ( XmlSchema xmlSchema , String avroNamespace , String avroSchemaName ) throws Xsd2AvroTranslatorException { log . debug ( "XML Schema to Avro Schema translator started" ) ; final Map < QName , XmlSchemaElement > items = xmlSchema . getElements ( ) ; ObjectNode rootAvroSchema = null ; final Array...
Translate the input XML Schema .
14,439
private void visit ( XmlSchema xmlSchema , final XmlSchemaElement xsdElement , final int level , final ArrayNode avroFields ) throws Xsd2AvroTranslatorException { if ( xsdElement . getRef ( ) . getTarget ( ) != null ) { return ; } log . debug ( "process started for element = " + xsdElement . getName ( ) ) ; if ( xsdEle...
Process a regular XML schema element .
14,440
private void visit ( XmlSchema xmlSchema , XmlSchemaComplexType xsdType , final int level , final ArrayNode avroFields ) { visit ( xmlSchema , xsdType . getParticle ( ) , level , avroFields ) ; }
Create an avro complex type field using an XML schema type .
14,441
private void visit ( XmlSchemaSimpleType xsdType , final int level , final String avroFieldName , long minOccurs , long maxOccurs , ArrayNode avroFields ) throws Xsd2AvroTranslatorException { Object avroType = getAvroPrimitiveType ( avroFieldName , xsdType , maxOccurs > 1 , minOccurs == 0 && maxOccurs == 1 ) ; ObjectNo...
Create an avro primitive type field using an XML schema type .
14,442
public static boolean isBigDecimal ( Schema schema ) { if ( Type . BYTES == schema . getType ( ) ) { JsonNode logicalTypeNode = schema . getJsonProp ( "logicalType" ) ; if ( logicalTypeNode != null && "decimal" . equals ( logicalTypeNode . asText ( ) ) ) { return true ; } } return false ; }
Tests whether a field is to be externalized as a BigDecimal
14,443
protected void configureAop ( ) { final RepositoryMethodInterceptor proxy = new RepositoryMethodInterceptor ( ) ; requestInjection ( proxy ) ; bindInterceptor ( Matchers . any ( ) , new AbstractMatcher < Method > ( ) { public boolean matches ( final Method method ) { try { return ExtUtils . findMethodAnnotation ( metho...
Configures repository annotations interceptor .
14,444
protected void bindExecutor ( final Class < ? extends RepositoryExecutor > executor ) { bind ( executor ) . in ( Singleton . class ) ; executorsMultibinder . addBinding ( ) . to ( executor ) ; }
Register executor for specific connection type .
14,445
protected void loadOptionalExecutor ( final String executorBinder ) { try { final Method bindExecutor = RepositoryModule . class . getDeclaredMethod ( "bindExecutor" , Class . class ) ; bindExecutor . setAccessible ( true ) ; try { Class . forName ( executorBinder ) . getConstructor ( RepositoryModule . class , Method ...
Allows to load executor only if required jars are in classpath . For example no need for graph dependencies if only object db is used .
14,446
public void setAdapter ( Adapter adapter ) { if ( mAdapter != null ) { mAdapter . unregisterAdapterDataObserver ( mObserver ) ; } if ( mItemAnimator != null ) { mItemAnimator . endAnimations ( ) ; } if ( mLayout != null ) { mLayout . removeAndRecycleAllViews ( mRecycler ) ; mLayout . removeAndRecycleScrapInt ( mRecycle...
Set a new adapter to provide child views on demand .
14,447
private void addAnimatingView ( View view ) { boolean alreadyAdded = false ; if ( mNumAnimatingViews > 0 ) { for ( int i = mAnimatingViewIndex ; i < getChildCount ( ) ; ++ i ) { if ( getChildAt ( i ) == view ) { alreadyAdded = true ; break ; } } } if ( ! alreadyAdded ) { if ( mNumAnimatingViews == 0 ) { mAnimatingViewI...
Adds a view to the animatingViews list . mAnimatingViews holds the child views that are currently being kept around purely for the purpose of being animated out of view . They are drawn as a regular part of the child list of the RecyclerView but they are invisible to the LayoutManager as they are managed separately fro...
14,448
private void removeAnimatingView ( View view ) { if ( mNumAnimatingViews > 0 ) { for ( int i = mAnimatingViewIndex ; i < getChildCount ( ) ; ++ i ) { if ( getChildAt ( i ) == view ) { removeViewAt ( i ) ; -- mNumAnimatingViews ; if ( mNumAnimatingViews == 0 ) { mAnimatingViewIndex = - 1 ; } mRecycler . recycleView ( vi...
Removes a view from the animatingViews list .
14,449
void scrollByInternal ( int x , int y ) { int overscrollX = 0 , overscrollY = 0 ; consumePendingUpdateOperations ( ) ; if ( mAdapter != null ) { eatRequestLayout ( ) ; if ( x != 0 ) { final int hresult = mLayout . scrollHorizontallyBy ( x , mRecycler , mState ) ; overscrollX = x - hresult ; } if ( y != 0 ) { final int ...
Does not perform bounds checking . Used by internal methods that have already validated input .
14,450
public boolean fling ( int velocityX , int velocityY ) { if ( Math . abs ( velocityX ) < mMinFlingVelocity ) { velocityX = 0 ; } if ( Math . abs ( velocityY ) < mMinFlingVelocity ) { velocityY = 0 ; } velocityX = Math . max ( - mMaxFlingVelocity , Math . min ( velocityX , mMaxFlingVelocity ) ) ; velocityY = Math . max ...
Begin a standard fling with an initial velocity along each axis in pixels per second . If the velocity given is below the system - defined minimum this method will return false and no fling will occur .
14,451
private void pullGlows ( int overscrollX , int overscrollY ) { if ( overscrollX < 0 ) { if ( mLeftGlow == null ) { mLeftGlow = new EdgeEffectCompat ( getContext ( ) ) ; mLeftGlow . setSize ( getMeasuredHeight ( ) - getPaddingTop ( ) - getPaddingBottom ( ) , getMeasuredWidth ( ) - getPaddingLeft ( ) - getPaddingRight ( ...
Apply a pull to relevant overscroll glow effects
14,452
void viewRangeUpdate ( int positionStart , int itemCount ) { final int childCount = getChildCount ( ) ; final int positionEnd = positionStart + itemCount ; for ( int i = 0 ; i < childCount ; i ++ ) { final ViewHolder holder = getChildViewHolderInt ( getChildAt ( i ) ) ; if ( holder == null ) { continue ; } final int po...
Rebind existing views for the given range or create as needed .
14,453
void markKnownViewsInvalid ( ) { final int childCount = getChildCount ( ) ; for ( int i = 0 ; i < childCount ; i ++ ) { final ViewHolder holder = getChildViewHolderInt ( getChildAt ( i ) ) ; if ( holder != null ) { holder . addFlags ( ViewHolder . FLAG_UPDATE | ViewHolder . FLAG_INVALID ) ; } } mRecycler . markKnownVie...
Mark all known views as invalid . Used in response to a the whole world might have changed data change event .
14,454
void postAdapterUpdate ( UpdateOp op ) { mPendingUpdates . add ( op ) ; if ( mPendingUpdates . size ( ) == 1 ) { if ( mPostUpdatesOnAnimation && mHasFixedSize && mIsAttached ) { ViewCompat . postOnAnimation ( this , mUpdateChildViewsRunnable ) ; } else { mAdapterUpdateDuringMeasure = true ; requestLayout ( ) ; } } }
Schedule an update of data from the adapter to occur on the next frame . On newer platform versions this happens via the postOnAnimation mechanism and RecyclerView attempts to avoid relayouts if possible . On older platform versions the RecyclerView requests a layout the same way ListView does .
14,455
public int getChildPosition ( View child ) { final ViewHolder holder = getChildViewHolderInt ( child ) ; return holder != null ? holder . getPosition ( ) : NO_POSITION ; }
Return the adapter position that the given child view corresponds to .
14,456
public long getChildItemId ( View child ) { if ( mAdapter == null || ! mAdapter . hasStableIds ( ) ) { return NO_ID ; } final ViewHolder holder = getChildViewHolderInt ( child ) ; return holder != null ? holder . getItemId ( ) : NO_ID ; }
Return the stable item id that the given child view corresponds to .
14,457
public View findChildViewUnder ( float x , float y ) { final int count = getChildCount ( ) ; for ( int i = count - 1 ; i >= 0 ; i -- ) { final View child = getChildAt ( i ) ; final float translationX = ViewCompat . getTranslationX ( child ) ; final float translationY = ViewCompat . getTranslationY ( child ) ; if ( x >=...
Find the topmost view under the given point .
14,458
protected int getHorizontalSnapPreference ( ) { return mTargetVector == null || mTargetVector . x == 0 ? SNAP_TO_ANY : mTargetVector . x > 0 ? SNAP_TO_END : SNAP_TO_START ; }
When scrolling towards a child view this method defines whether we should align the left or the right edge of the child with the parent RecyclerView .
14,459
protected int getVerticalSnapPreference ( ) { return mTargetVector == null || mTargetVector . y == 0 ? SNAP_TO_ANY : mTargetVector . y > 0 ? SNAP_TO_END : SNAP_TO_START ; }
When scrolling towards a child view this method defines whether we should align the top or the bottom edge of the child with the parent RecyclerView .
14,460
protected void updateActionForInterimTarget ( Action action ) { PointF scrollVector = computeScrollVectorForPosition ( getTargetPosition ( ) ) ; if ( scrollVector == null || ( scrollVector . x == 0 && scrollVector . y == 0 ) ) { Log . e ( TAG , "To support smooth scrolling, you should override \n" + "LayoutManager#comp...
When the target scroll position is not a child of the RecyclerView this method calculates a direction vector towards that child and triggers a smooth scroll .
14,461
public int calculateDyToMakeVisible ( View view , int snapPreference ) { final RecyclerView . LayoutManager layoutManager = getLayoutManager ( ) ; if ( ! layoutManager . canScrollVertically ( ) ) { return 0 ; } final RecyclerView . LayoutParams params = ( RecyclerView . LayoutParams ) view . getLayoutParams ( ) ; final...
Calculates the vertical scroll amount necessary to make the given view fully visible inside the RecyclerView .
14,462
public int calculateDxToMakeVisible ( View view , int snapPreference ) { final RecyclerView . LayoutManager layoutManager = getLayoutManager ( ) ; if ( ! layoutManager . canScrollHorizontally ( ) ) { return 0 ; } final RecyclerView . LayoutParams params = ( RecyclerView . LayoutParams ) view . getLayoutParams ( ) ; fin...
Calculates the horizontal scroll amount necessary to make the given view fully visible inside the RecyclerView .
14,463
private Class < ? > resolveTargetType ( final Class < ? > listenerType , final Class < ? > declaredTargetType ) { Class < ? > target = null ; if ( RequiresRecordConversion . class . isAssignableFrom ( listenerType ) ) { target = GenericsResolver . resolve ( listenerType ) . type ( RequiresRecordConversion . class ) . g...
Resolve target conversion type either from listener instance or if its not possible from listener parameter declaration .
14,464
public static String methodToString ( final Class < ? > type , final Method method ) { final StringBuilder res = new StringBuilder ( ) ; res . append ( type . getSimpleName ( ) ) . append ( '#' ) . append ( method . getName ( ) ) . append ( '(' ) ; int i = 0 ; for ( Class < ? > param : method . getParameterTypes ( ) ) ...
Converts method signature to human readable string .
14,465
public static void checkParamExtensionCompatibility ( final Class < ? extends RepositoryMethodDescriptor > descriptorType , final Class < ? extends MethodParamExtension > paramExtType ) { check ( isCompatible ( paramExtType , MethodParamExtension . class , descriptorType ) , "Param extension %s is incompatible with des...
Checks that parameter extension is compatible with descriptor and throws error if extension incompatible .
14,466
public static void checkAmendExtensionsCompatibility ( final Class < ? extends RepositoryMethodDescriptor > descriptorType , final List < Annotation > extensions ) { final List < Class < ? extends AmendMethodExtension > > exts = Lists . transform ( extensions , new Function < Annotation , Class < ? extends AmendMethodE...
Checks that amend extensions strictly compatible with descriptor object . Used for amend annotations defined on method .
14,467
public static List < AmendExecutionExtension > filterCompatibleExtensions ( final List < AmendExecutionExtension > extensions , final Class < ? extends RepositoryMethodDescriptor > descriptorType ) { @ SuppressWarnings ( "unchecked" ) final Class < ? extends AmendExecutionExtension > supportedExtension = ( Class < ? ex...
Checks resolved amend extensions compatibility with method specific extension type . Extension may be universal and support some methods and doesn t support other .
14,468
public void disposeTooltip ( ) { if ( popup != null ) { timer . stop ( ) ; popup . setVisible ( false ) ; popup = null ; } }
Dispose the tooltip
14,469
private void showTooltip ( ) { Wrap tooltipLabel = new Wrap ( toolTipWrapWidth ) ; tooltipLabel . setForeground ( getForeground ( ) ) ; tooltipLabel . setFont ( ToolTipButton . this . getFont ( ) ) ; tooltipLabel . setText ( text ) ; JPanel panel = new JPanel ( ) ; panel . setBackground ( toolTipBackground ) ; panel . ...
Show the tooltip .
14,470
public static Collection < MatchedMethod > filterByClosestParams ( final Collection < MatchedMethod > possibilities , final int paramsCount ) { Collection < MatchedMethod > res = null ; for ( int i = 0 ; i < paramsCount ; i ++ ) { final Collection < MatchedMethod > filtered = filterByParam ( possibilities , i ) ; if ( ...
Looks for most specific type for each parameter .
14,471
private ODatabaseDocument checkAndAcquireConnection ( ) { final ODatabaseDocument res ; if ( userManager . isSpecificUser ( ) ) { res = orientDB . get ( ) . open ( database , userManager . getUser ( ) , userManager . getPassword ( ) ) ; } else { res = pool . acquire ( ) ; } if ( res . isClosed ( ) ) { final String mess...
Its definitely not normal that pool returns closed connections but possible if used improperly .
14,472
public static void trackIdChange ( final ODocument document , final Object pojo ) { if ( document . getIdentity ( ) . isNew ( ) ) { ORecordInternal . addIdentityChangeListener ( document , new OIdentityChangeListener ( ) { public void onBeforeIdentityChange ( final ORecord record ) { } public void onAfterIdentityChange...
When just created object is detached to pure pojo it gets temporary id . Real id is assigned only after transaction commit . This method tracks original document intercepts its id change and sets correct id and version into pojo . So it become safe to use such pojo id outside of transaction .
14,473
private static Field findIdField ( final Object value ) { Field res = null ; final Class < ? > type = value . getClass ( ) ; if ( ODatabaseRecordThreadLocal . instance ( ) . isDefined ( ) ) { res = OObjectEntitySerializer . getIdField ( type ) ; } else { final String idField = OObjectSerializerHelper . getObjectIDField...
Core orient field resolve method relies on bound connection but it may be required to resolve id outside of transaction . So we use orient method under transaction and do manual scan outside of transaction .
14,474
private static Component getCurrentModal_ ( RootPaneContainer rootPane ) { synchronized ( modals ) { Modal modal = modals . get ( rootPane ) ; if ( modal != null ) { if ( modal . getSize ( ) > 0 ) { return modal . components . get ( modal . components . size ( ) - 1 ) ; } } return null ; } }
Get the current modal component of a specific RootPaneContainer .
14,475
private static void closeCurrentModal_ ( RootPaneContainer rootPane ) { synchronized ( modals ) { Modal modal = modals . get ( rootPane ) ; if ( modal != null ) { modal . closeCurrent ( ) ; if ( modal . getSize ( ) == 0 ) { modals . remove ( rootPane ) ; } } } }
Close the current modal component of a specific RootPaneContainer .
14,476
public static void closeModal ( Component component ) { synchronized ( modals ) { RootPaneContainer frame = null ; Modal modal = null ; Iterator < Entry < RootPaneContainer , Modal > > it = modals . entrySet ( ) . iterator ( ) ; while ( it . hasNext ( ) ) { Entry < RootPaneContainer , Modal > entry = it . next ( ) ; mo...
Close a specific modal component .
14,477
private static void closeAllModals_ ( RootPaneContainer rootPane ) { synchronized ( modals ) { Modal modal = modals . get ( rootPane ) ; if ( modal != null ) { modal . closeAll ( ) ; modals . remove ( rootPane ) ; } } }
Close all modals of a specific RootPaneContainer .
14,478
private static boolean hasModal_ ( RootPaneContainer rootPane ) { synchronized ( modals ) { Modal modal = modals . get ( rootPane ) ; if ( modal != null && modal . getSize ( ) > 0 ) { return true ; } return false ; } }
Indicates whether the RootPaneContainer has a modal .
14,479
private static Modal getModal ( RootPaneContainer rootPane ) { synchronized ( modals ) { Modal modal = modals . get ( rootPane ) ; if ( modal == null ) { modal = new Modal ( rootPane ) ; modals . put ( rootPane , modal ) ; } return modal ; } }
Get the modal of a specific frame
14,480
public static boolean isModal ( Component component ) { synchronized ( modals ) { Iterator < Entry < RootPaneContainer , Modal > > it = modals . entrySet ( ) . iterator ( ) ; while ( it . hasNext ( ) ) { Entry < RootPaneContainer , Modal > entry = it . next ( ) ; if ( entry . getValue ( ) . components . contains ( comp...
Indicates whether the component is a modal component .
14,481
public static void addModal ( JInternalFrame frame , Component component , ModalListener listener ) { addModal_ ( frame , component , listener , defaultModalDepth ) ; }
Add a modal component in the internal frame .
14,482
public static void addModal ( JFrame frame , Component component , ModalListener listener , Integer modalDepth ) { addModal_ ( frame , component , listener , modalDepth ) ; }
Add a modal component in the frame .
14,483
private static void addModal_ ( RootPaneContainer rootPane , Component component , ModalListener listener , Integer modalDepth ) { synchronized ( modals ) { if ( isModal ( component ) == false ) { getModal ( rootPane ) . addModal ( component , listener , modalDepth ) ; } } }
Add a modal component in the RootPaneContainer .
14,484
private static int getModalCount_ ( RootPaneContainer rootPane ) { synchronized ( modals ) { Modal modal = modals . get ( rootPane ) ; if ( modal != null ) { return modal . getSize ( ) ; } return 0 ; } }
Get the modal count of a specific RootPaneContainer .
14,485
private void closeCurrent ( ) { if ( components . size ( ) > 0 ) { Component component = components . remove ( components . size ( ) - 1 ) ; getModalPanel ( ) . removeAll ( ) ; fireCloseActionListener ( listeners . get ( component ) ) ; listeners . remove ( component ) ; if ( components . size ( ) > 0 ) { showNextCompo...
Close the current modal .
14,486
private void close ( Component component ) { if ( components . size ( ) > 0 ) { if ( components . contains ( component ) == false ) { return ; } components . remove ( component ) ; depths . remove ( component ) ; getModalPanel ( ) . removeAll ( ) ; fireCloseActionListener ( listeners . get ( component ) ) ; listeners ....
Close a modal
14,487
private void closeAll ( ) { getModalPanel ( ) . removeAll ( ) ; components . clear ( ) ; depths . clear ( ) ; listeners . clear ( ) ; restoreRootPane ( ) ; }
Close all modals .
14,488
private void addModal ( Component component , ModalListener listener , Integer modalDepth ) { if ( modalDepth == null ) { modalDepth = defaultModalDepth ; } if ( components . contains ( component ) == false ) { rootPane . getLayeredPane ( ) . remove ( getModalPanel ( ) ) ; rootPane . getLayeredPane ( ) . add ( getModal...
Add a modal component
14,489
private ModalPanel getModalPanel ( ) { if ( modalPanel == null ) { modalPanel = new ModalPanel ( ) ; modalPanel . setLayout ( new ModalLayout ( ) ) ; } return modalPanel ; }
Get the transparent modal panel
14,490
public static RootPaneContainer getRootPaneContainer ( Component component ) { if ( component instanceof RootPaneContainer ) { return ( RootPaneContainer ) component ; } for ( Container p = component . getParent ( ) ; p != null ; p = p . getParent ( ) ) { if ( p instanceof RootPaneContainer ) { return ( RootPaneContain...
Get the RootPaneContainer of the specific component .
14,491
public static ResultDescriptor analyzeReturnType ( final DescriptorContext context , final Class < ? extends Collection > returnCollectionType ) { final Method method = context . method ; final MethodGenericsContext generics = context . generics . method ( method ) ; final Class < ? > returnClass = generics . resolveRe...
Analyze return type .
14,492
protected void recycleByRenderState ( RecyclerView . Recycler recycler , RenderState renderState ) { if ( renderState . mLayoutDirection == RenderState . LAYOUT_START ) { recycleViewsFromEnd ( recycler , renderState . mScrollingOffset ) ; } else { recycleViewsFromStart ( recycler , renderState . mScrollingOffset ) ; } ...
Helper method to call appropriate recycle method depending on current render layout direction
14,493
public static void check ( final Object result , final Class < ? > targetType ) { if ( result != null && ! targetType . isAssignableFrom ( result . getClass ( ) ) ) { throw new ResultConversionException ( String . format ( "Failed to convert %s to %s" , toStringType ( result ) , targetType . getSimpleName ( ) ) ) ; } }
Check converted result compatibility with required type .
14,494
@ SuppressWarnings ( "unchecked" ) public static Object convertToCollection ( final Object result , final Class collectionType , final Class targetEntity , final boolean projection ) { final Object converted ; if ( collectionType . equals ( Iterator . class ) ) { converted = toIterator ( result , targetEntity , project...
Convert result object to collection . In some cases this could be do nothing case because orient already returns collection . If projection is required or when collection type is different from requested type result will be re - packaged into the new collection .
14,495
@ SuppressWarnings ( "PMD.LooseCoupling" ) public static Object convertToArray ( final Object result , final Class entityType , final boolean projection ) { final Collection res = result instanceof Collection ? ( Collection ) result : convertToCollectionImpl ( result , ArrayList . class , entityType , false ) ; final O...
Convert result object to array .
14,496
public static void check ( final boolean condition , final String message , final Object ... args ) { if ( ! condition ) { throw new SchemeInitializationException ( String . format ( message , args ) ) ; } }
Shortcut to check and throw scheme exception .
14,497
public < T > T doInTransaction ( final TxConfig config , final TxAction < T > action ) { return txTemplate . doInTransaction ( config , action ) ; }
Execute action within transaction .
14,498
public boolean collapsePanel ( ) { if ( mFirstLayout ) { mSlideState = SlideState . COLLAPSED ; return true ; } else { if ( mSlideState == SlideState . HIDDEN || mSlideState == SlideState . COLLAPSED ) return false ; return collapsePanel ( mSlideableView , 0 ) ; } }
Collapse the sliding pane if it is currently slideable . If first layout has already completed this will animate .
14,499
public boolean expandPanel ( float mSlideOffset ) { if ( mSlideableView == null || mSlideState == SlideState . EXPANDED ) return false ; mSlideableView . setVisibility ( View . VISIBLE ) ; return expandPanel ( mSlideableView , 0 , mSlideOffset ) ; }
Partially expand the sliding panel up to a specific offset